local l_CoreGui_0 = game:GetService("CoreGui");
local l_CorePackages_0 = game:GetService("CorePackages");
local v2 = require(l_CorePackages_0.Roact);
local v3 = require(l_CorePackages_0.RoactRodux);
local v4 = require(l_CorePackages_0.UIBlox);
local l_InteractiveAlert_0 = v4.App.Dialog.Alert.InteractiveAlert;
local l_ButtonType_0 = v4.App.Button.Enum.ButtonType;
local v7 = require(l_CorePackages_0.Packages.t);
local l_Modules_0 = l_CoreGui_0.RobloxGui.Modules;
local l_RoactServices_0 = require(l_CorePackages_0.Workspace.Packages.RoactServices).RoactServices;
local v10 = require(l_Modules_0.LuaApp.Services.RoactAnalytics);
local l_AppUpdateService_0 = require(l_CorePackages_0.Workspace.Packages.RoactServiceTags).AppUpdateService;
local v12 = require(l_Modules_0.LuaApp.withLocalization);
local v13 = require(l_Modules_0.LuaApp.Components.ScreenGuiWithBlurControl);
local v14 = require(l_Modules_0.LuaApp.Actions.SetScreenGuiBlur);
local v15 = require(l_Modules_0.LuaApp.Actions.SetCentralOverlay);
local v16 = require(l_Modules_0.LuaApp.Constants);
local l_GetFFlagMoveUpdateCheckToUniversalApp_0 = require(l_CorePackages_0.Workspace.Packages.SharedFlags).GetFFlagMoveUpdateCheckToUniversalApp;
local v18 = v2.PureComponent:extend("UpdateRequiredPrompt");
if l_GetFFlagMoveUpdateCheckToUniversalApp_0() then
    v18.validateProps = v7.interface({
        canPerformBinaryUpdate = v7.optional(v7.boolean),
        closeOverlay = v7.callback,
        screenSize = v7.Vector2,
        setScreenGuiBlur = v7.callback,
        appUpdateService = v7.table
    });
end;
v18.init = function(v19)
    v19.performManagedUpdate = function()
        v19.props.appUpdateService:performManagedUpdate();
    end;
end;
v18.render = function(v20)
    if not l_GetFFlagMoveUpdateCheckToUniversalApp_0() then
        return v12({
            titleText = "CommonUI.Controls.Label.ForceUpdateTitle",
            bodyText = "CommonUI.Controls.Label.ForceUpdateBody",
            buttonText = "CommonUI.Controls.Action.CloseRoblox"
        })(function(v21)
            return v20.props.enabled and v2.createElement(v2.Portal, {
                target = l_CoreGui_0
            }, {
                UpdateRequiredPrompt = v2.createElement(v13, {
                    IgnoreGuiInset = true,
                    ZIndexBehavior = Enum.ZIndexBehavior.Sibling,
                    DisplayOrder = v16.DisplayOrder.UpdateRequiredPrompt,
                    OnTopOfCoreBlur = true
                }, {
                    Overlay = v2.createElement("Frame", {
                        Size = UDim2.new(1, 0, 1, 0),
                        BackgroundColor3 = v16.Color.BLACK,
                        BackgroundTransparency = 0,
                        Active = true,
                        Selectable = false
                    }, {
                        AlertWindow = v2.createElement(l_InteractiveAlert_0, {
                            title = v21.titleText,
                            bodyText = v21.bodyText,
                            buttonStackInfo = {
                                buttons = {
                                    {
                                        buttonType = l_ButtonType_0.PrimarySystem,
                                        props = {
                                            onActivated = v20.performManagedUpdate,
                                            text = v21.buttonText
                                        }
                                    }
                                }
                            },
                            screenSize = v20.props.screenSize
                        })
                    })
                })
            });
        end);
    else
        return v12({
            titleText = "CommonUI.Controls.Label.ForceUpdateTitle",
            bodyText = "CommonUI.Controls.Label.ForceUpdateBody",
            buttonText = "CommonUI.Controls.Action.CloseRoblox",
            cancelButtonText = "Feature.GamePage.LabelCancelField"
        })(function(v22)
            return (v2.createElement(l_InteractiveAlert_0, {
                screenSize = v20.props.screenSize,
                title = v22.titleText,
                bodyText = v22.bodyText,
                buttonStackInfo = {
                    buttons = {
                        if not v20.props.canPerformBinaryUpdate then {
                            buttonType = l_ButtonType_0.Secondary,
                            props = {
                                text = v22.cancelButtonText,
                                onActivated = v20.props.closeOverlay
                            }
                        } else {
                            buttonType = l_ButtonType_0.PrimarySystem,
                            props = {
                                text = v22.buttonText,
                                onActivated = v20.performManagedUpdate
                            }
                        }
                    }
                }
            }));
        end);
    end;
end;
v18.updateBlur = function(v23)
    v23.props.setScreenGuiBlur(if not l_GetFFlagMoveUpdateCheckToUniversalApp_0() then v23.props.enabled else false);
end;
v18.didMount = function(v24)
    v24:updateBlur();
end;
v18.didUpdate = function(v25)
    v25:updateBlur();
end;
v18.willUnmount = function(v26)
    v26.props.setScreenGuiBlur(false);
end;
return l_RoactServices_0.connect({
    analytics = v10,
    appUpdateService = l_AppUpdateService_0
})((v3.connect(function(v27, _)
    return {
        screenSize = v27.ScreenSize,
        enabled = v27.AppUpdateStatus.status == Enum.AppUpdateStatus.Available
    };
end, function(v29)
    return {
        setScreenGuiBlur = function(v30)
            v29(v14("UpdateRequiredPrompt", v30, v16.DisplayOrder.UpdateRequiredPrompt));
        end,
        closeOverlay = if not l_GetFFlagMoveUpdateCheckToUniversalApp_0() then nil else function()
            v29(v15());
        end
    };
end)(v18)));


local l_Modules_0 = game:GetService("CoreGui").RobloxGui.Modules;
local l_CorePackages_0 = game:GetService("CorePackages");
local v2 = require(l_CorePackages_0.Roact);
local v3 = require(l_CorePackages_0.RoactRodux);
local l_RoactServices_0 = require(l_CorePackages_0.Workspace.Packages.RoactServices).RoactServices;
local v5 = require(l_Modules_0.LuaApp.Services.RoactNetworking);
local v6 = require(l_CorePackages_0.Packages.ReactFocusNavigation);
local v7 = require(l_CorePackages_0.Workspace.Packages.LoggingProtocol);
local v8 = require(l_Modules_0.LuaApp.Analytics.RobloxTelemetryConfigs.ToCPopupOccurance);
local v9 = require(l_CorePackages_0.UIBlox);
local v10 = require(l_CorePackages_0.Packages.t);
local v11 = require(l_CorePackages_0.Packages.Cryo);
local l_RoactAppPolicy_0 = require(l_CorePackages_0.Workspace.Packages.UniversalAppPolicy).RoactAppPolicy;
local v13 = require(l_Modules_0.LuaApp.Thunks.CloseCentralOverlay);
local v14 = require(l_Modules_0.LuaApp.Thunks.CloseUserAgreementsUpdatedPopup);
local l_FormFactor_0 = require(l_CorePackages_0.Workspace.Packages.FormFactor).Enums.FormFactor;
local l_withStyle_0 = v9.Core.Style.withStyle;
local v17 = require(l_Modules_0.LuaApp.withLocalization);
local v18 = require(l_Modules_0.LuaApp.Http.Requests.AgreeUpdatedUserAgreements);
local v19 = require(l_Modules_0.LuaApp.Http.Requests.PromotionalEmailsPreference);
local v20 = require(l_CorePackages_0.FitFrame);
local v21 = require(l_Modules_0.LuaApp.Components.DEPRECATED_ImageSetLabel);
local _ = require(l_Modules_0.LuaApp.Components.SystemPrimaryButton);
local l_Checkbox_0 = v9.App.InputButton.Checkbox;
local l_Button_0 = v9.App.Button.Button;
local l_ButtonType_0 = v9.App.Button.Enum.ButtonType;
local l_UserAgreementsList_0 = require(l_CorePackages_0.Workspace.Packages.UserAgreements).UserAgreementsList;
local v27 = game:DefineFastFlag("UserAgreementsDefaultSelection", false);
game:DefineFastFlag("UserAgreementsPopupCloseFix", false);
local v28 = require(l_Modules_0.LuaApp.Flags.GetFFlagLuaAppPromotionalEmailsCheckboxEnabled);
local v29 = Rect.new(8, 8, 9, 9);
local v30 = v2.PureComponent:extend("UserAgreementsUpdatedPopup");
v30.validateProps = v10.strictInterface({
    agreements = v10.array(v10.strictInterface({
        id = v10.string,
        agreementType = v10.string,
        clientType = v10.string,
        displayUrl = v10.string,
        regulationType = v10.string
    })),
    formFactor = v10.string,
    screenSize = v10.Vector2,
    networking = v10.callback,
    closePopup = v10.callback,
    defaultChildRef = v10.optional(v10.any),
    focusController = v10.optional(v10.any),
    containerWidth = v10.optional(v10.integer),
    closeCentralOverlayThunk = v10.optional(v10.callback),
    checkboxEnabled = v10.optional(v10.boolean),
    optInByDefault = v10.optional(v10.boolean),
    defaultFocusRef = if not v27 then nil else v10.callback,
    containerRef = if not v27 then nil else v10.callback
});
v30.init = function(v31)
    if v28() then
        v31.state = {
            promoEmailsDisplayed = v31.props.checkboxEnabled,
            promoEmailsChecked = v31.props.optInByDefault
        };
        v31.SetPromoEmailsCheckbox = function(v32)
            v31:setState({
                promoEmailsChecked = v32
            });
        end;
        v31.SetPromoEmailsCheckboxByTextButton = function()
            v31:setState({
                promoEmailsChecked = not v31.state.promoEmailsChecked
            });
        end;
    end;
    v31.agreeAndClosePopup = function()
        local l_networking_0 = v31.props.networking;
        local l_agreements_0 = v31.props.agreements;
        local l_closePopup_0 = v31.props.closePopup;
        v18(l_networking_0, l_agreements_0, function(_)
        end);
        if v28() then
            v19(l_networking_0, v31.state.promoEmailsChecked);
        end;
        l_closePopup_0();
    end;
end;
v30.getLayoutInfo = function(_, v38, v39)
    if not v38 then
        return "Frame", {
            Size = UDim2.new(1, 0, 1, 0),
            Position = UDim2.new(0.5, 0, 0.5, 0),
            AnchorPoint = Vector2.new(0.5, 0.5),
            BorderSizePixel = 0,
            BackgroundColor3 = v39.BackgroundUIDefault.Color
        };
    else
        return v21, {
            Size = UDim2.new(0, 540, 0, 0),
            Position = UDim2.new(0.5, 0, 0.5, 0),
            AnchorPoint = Vector2.new(0.5, 0.5),
            BackgroundTransparency = 1,
            Image = "LuaApp/buttons/buttonFill",
            ImageColor3 = v39.BackgroundUIDefault.Color,
            BorderSizePixel = 0,
            ScaleType = Enum.ScaleType.Slice,
            SliceCenter = v29,
            AutomaticSize = Enum.AutomaticSize.Y
        };
    end;
end;
v30.renderWithProviders = function(v40, v41, v42)
    local l_Font_0 = v42.Font;
    local l_Theme_0 = v42.Theme;
    local l_screenSize_0 = v40.props.screenSize;
    local l_formFactor_0 = v40.props.formFactor;
    local l_agreements_1 = v40.props.agreements;
    local v48 = l_formFactor_0 == l_FormFactor_0.WIDE;
    local v49, v50 = v40:getLayoutInfo(v48, l_Theme_0);
    local l_title_0 = v41.title;
    local l_message_0 = v41.message;
    local l_agreeButton_0 = v41.agreeButton;
    local v54 = if not v28() then nil else v41.checkbox;
    v7.default:logRobloxTelemetryEvent(v8);
    return v2.createElement("Frame", {
        Size = UDim2.new(1, 0, 0, l_screenSize_0.Y),
        BackgroundTransparency = 1,
        BorderSizePixel = 0,
        [v2.Ref] = if not v27 then nil else v40.props.containerRef
    }, {
        Layout = v2.createElement(v49, v50, {
            ListLayout = v48 and v2.createElement("UIListLayout", {
                FillDirection = Enum.FillDirection.Vertical,
                HorizontalAlignment = Enum.HorizontalAlignment.Center,
                SortOrder = Enum.SortOrder.LayoutOrder
            }),
            Padding = v2.createElement("UIPadding", {
                PaddingTop = UDim.new(0, not v48 and 60 or 0),
                PaddingBottom = UDim.new(0, not v48 and 48 or 24)
            }),
            Content = v2.createElement(v20.FitFrameVertical, {
                width = UDim.new(1, 0),
                BackgroundTransparency = 1,
                LayoutOrder = 1
            }, {
                Title = v2.createElement("Frame", {
                    LayoutOrder = 1,
                    Size = UDim2.new(1, 0, 0, 48),
                    BackgroundTransparency = 1,
                    BorderSizePixel = 0
                }, {
                    TitleText = v2.createElement("TextLabel", {
                        Size = UDim2.new(1, 0, 0, 28),
                        Position = UDim2.new(0.5, 0, 0.5, 0),
                        AnchorPoint = Vector2.new(0.5, 0.5),
                        BackgroundTransparency = 1,
                        Text = l_title_0,
                        Font = l_Font_0.Header1.Font,
                        TextSize = l_Font_0.BaseSize * l_Font_0.Header1.RelativeSize,
                        TextColor3 = l_Theme_0.TextEmphasis.Color,
                        TextXAlignment = Enum.TextXAlignment.Center,
                        TextWrapped = true
                    }),
                    Divider = v2.createElement("Frame", {
                        Size = UDim2.new(1, 0, 0, 1),
                        AnchorPoint = Vector2.new(0, 0),
                        BackgroundColor3 = l_Theme_0.Divider.Color,
                        BackgroundTransparency = l_Theme_0.Divider.Transparency,
                        BorderSizePixel = 0
                    })
                }),
                Message = v2.createElement("Frame", {
                    LayoutOrder = 2,
                    AutomaticSize = Enum.AutomaticSize.Y,
                    Size = UDim2.new(1, 0, 0, 0),
                    BorderSizePixel = 0,
                    BackgroundTransparency = 1
                }, {
                    Padding = v2.createElement("UIPadding", {
                        PaddingTop = UDim.new(0, not v48 and 48 or 24),
                        PaddingRight = UDim.new(0, 24),
                        PaddingBottom = UDim.new(0, not v48 and 48 or 12),
                        PaddingLeft = UDim.new(0, 24)
                    }),
                    MessageText = v2.createElement("TextLabel", {
                        Size = UDim2.new(1, 0, 0, 0),
                        AutomaticSize = Enum.AutomaticSize.Y,
                        BackgroundTransparency = 1,
                        Text = l_message_0,
                        Font = l_Font_0.Body.Font,
                        TextSize = l_Font_0.BaseSize * l_Font_0.Body.RelativeSize,
                        TextColor3 = l_Theme_0.TextEmphasis.Color,
                        TextTransparency = l_Theme_0.TextEmphasis.Transparency,
                        TextXAlignment = Enum.TextXAlignment.Center,
                        TextWrapped = true
                    })
                }),
                SecondDivider = v2.createElement("Frame", {
                    LayoutOrder = 3,
                    AutomaticSize = Enum.AutomaticSize.Y,
                    Size = UDim2.new(1, 0, 0, 0),
                    BorderSizePixel = 0,
                    BackgroundTransparency = 1
                }, {
                    Padding = v2.createElement("UIPadding", {
                        PaddingTop = UDim.new(0, 0),
                        PaddingRight = UDim.new(0, 24),
                        PaddingBottom = UDim.new(0, 0),
                        PaddingLeft = UDim.new(0, 24)
                    }),
                    Divider = v2.createElement("Frame", {
                        Size = UDim2.new(1, 0, 0, 1),
                        AnchorPoint = Vector2.new(0, 0),
                        BackgroundColor3 = l_Theme_0.Divider.Color,
                        BackgroundTransparency = l_Theme_0.Divider.Transparency,
                        BorderSizePixel = 0
                    })
                }),
                AgreementsList = v2.createElement(l_UserAgreementsList_0, {
                    LayoutOrder = 4,
                    agreements = l_agreements_1,
                    margin = v20.Rect.quad(0, 24, 24, 24)
                }),
                PromotionalEmailsContainer = if not not v28() and v40.state.promoEmailsDisplayed then v2.createElement("Frame", {
                    LayoutOrder = 5,
                    AutomaticSize = Enum.AutomaticSize.Y,
                    Size = UDim2.new(1, 0, 0, 0),
                    BorderSizePixel = 0,
                    BackgroundTransparency = 1
                }, {
                    Padding = v2.createElement("UIPadding", {
                        PaddingTop = UDim.new(0, 0),
                        PaddingRight = UDim.new(0, 24),
                        PaddingBottom = UDim.new(0, 48),
                        PaddingLeft = UDim.new(0, 24)
                    }),
                    CheckBox = v2.createElement(l_Checkbox_0, {
                        text = "",
                        isSelected = v40.state.promoEmailsChecked,
                        onActivated = v40.SetPromoEmailsCheckbox
                    }),
                    MessageButton = v2.createElement("TextButton", {
                        Size = UDim2.new(1, -34, 1, 0),
                        Position = UDim2.new(0, 34, 0, 0),
                        AutomaticSize = Enum.AutomaticSize.Y,
                        BackgroundTransparency = 1,
                        Text = v54,
                        Font = l_Font_0.Body.Font,
                        TextSize = l_Font_0.BaseSize * l_Font_0.Body.RelativeSize,
                        TextColor3 = l_Theme_0.TextEmphasis.Color,
                        TextTransparency = l_Theme_0.TextEmphasis.Transparency,
                        TextXAlignment = Enum.TextXAlignment.Left,
                        TextWrapped = true,
                        [v2.Event.Activated] = v40.SetPromoEmailsCheckboxByTextButton
                    })
                }) else nil
            }),
            AgreeButton = v2.createElement(l_Button_0, {
                buttonType = l_ButtonType_0.PrimarySystem,
                size = UDim2.new(1, -48, 0, 48),
                position = UDim2.new(0.5, 0, 1, -10),
                anchorPoint = Vector2.new(0.5, 1),
                layoutOrder = 2,
                text = l_agreeButton_0,
                fontStyle = l_Font_0.SubHeader1,
                onActivated = v40.agreeAndClosePopup,
                [v2.Ref] = if not v27 then nil else v40.props.defaultFocusRef
            })
        })
    });
end;
v30.render = function(v55)
    return v17({
        title = "CommonUI.UserAgreements.Popup.Title",
        message = "CommonUI.UserAgreements.Popup.Message",
        agreeButton = "CommonUI.UserAgreements.Popup.Agree",
        checkbox = if not v28() then nil else "CommonUI.UserAgreements.Popup.PromotionalEmailsCheckbox"
    })(function(v56)
        return l_withStyle_0(function(v57)
            return v55:renderWithProviders(v56, v57);
        end);
    end);
end;
v30 = v3.connect(function(v58)
    return {
        screenSize = v58.ScreenSize,
        formFactor = v58.FormFactor
    };
end, function(v59)
    return {
        closePopup = function()
            if not game:GetFastFlag("UserAgreementsPopupCloseFix") then
                v59(v13());
                return ;
            else
                v59(v14());
                return ;
            end;
        end
    };
end)(v30);
if v28() then
    v30 = l_RoactAppPolicy_0.connect(function(v60, _)
        return {
            checkboxEnabled = v60.getPromotionalEmailsCheckboxEnabled(),
            optInByDefault = v60.getPromotionalEmailsOptInByDefault()
        };
    end)(v30);
end;
v30 = l_RoactServices_0.connect({
    networking = v5
})(v30);
if not v27 then
    return v30;
else
    return function(v62)
        local v63, v64 = v6.useDefaultFocusBehavior();
        return v2.createElement(v30, v11.Dictionary.join(v62, {
            defaultFocusRef = v63,
            containerRef = v64
        }));
    end;
end;


local l_Modules_0 = game:GetService("CoreGui").RobloxGui.Modules;
local l_CorePackages_0 = game:GetService("CorePackages");
local v2 = require(l_CorePackages_0.Roact);
local v3 = require(l_CorePackages_0.RoactRodux);
local v4 = require(l_CorePackages_0.UIBlox);
local l_InteractiveAlert_0 = v4.App.Dialog.Alert.InteractiveAlert;
local l_ButtonType_0 = v4.App.Button.Enum.ButtonType;
local l_withStyle_0 = v4.Core.Style.withStyle;
local v8 = require(l_Modules_0.LuaApp.withLocalization);
local v9 = require(l_Modules_0.LuaApp.Thunks.NavigateDown);
local v10 = require(l_Modules_0.LuaApp.openExternalBrowser);
local l_RoactAppPolicy_0 = require(l_CorePackages_0.Workspace.Packages.UniversalAppPolicy).RoactAppPolicy;
local v12 = require(l_Modules_0.LuaApp.Http.UrlBuilder);
local v13 = require(l_Modules_0.LuaApp.AppPage);
local v14 = v2.Component:extend(script.Name);
v14.defaultProps = {
    anchorPoint = Vector2.new(0.5, 0.5),
    position = UDim2.new(0.5, 0, 0.5, 0)
};
v14.init = function(v15)
    v15.supportFormActivated = function(v16)
        if not v15.props.useExternalBrowserForDisclaimerLinks then
            v15.props.navigateDown({
                name = v13.GenericWebPage,
                detail = v12.static.about.support(),
                extraProps = {
                    title = v16.support
                }
            });
            return ;
        else
            v10(v15.props.linking, v12.static.about.support());
            return ;
        end;
    end;
end;
v14.render = function(v17)
    return v8({
        title = "CommonUI.UserAgreements.Popup.TransferCurrency.Title",
        message = "CommonUI.UserAgreements.Popup.TransferCurrency.Message",
        button = "CommonUI.UserAgreements.Popup.ContactCustomerSupport",
        support = "Feature.Moderation.Link.SupportForm"
    })(function(v18)
        return l_withStyle_0(function(v19)
            return v17:renderWithProviders(v18, v19);
        end);
    end);
end;
v14.renderWithProviders = function(v20, v21, _)
    local l_props_0 = v20.props;
    return v2.createElement(l_InteractiveAlert_0, {
        anchorPoint = l_props_0.anchorPoint,
        position = l_props_0.position,
        screenSize = l_props_0.screenSize,
        title = v21.title,
        bodyText = v21.message,
        buttonStackInfo = {
            buttons = {
                {
                    buttonType = l_ButtonType_0.PrimarySystem,
                    props = {
                        onActivated = function()
                            v20.supportFormActivated(v21);
                            l_props_0.doneActivated();
                        end,
                        text = v21.button
                    }
                }
            }
        }
    });
end;
return (v3.connect(nil, function(v24)
    return {
        navigateDown = function(v25)
            v24(v9(v25));
        end
    };
end)((l_RoactAppPolicy_0.connect(function(v26)
    return {
        useExternalBrowserForDisclaimerLinks = v26.shouldUseExternalBrowserForDisclaimerLinks()
    };
end)(v14))));


local l_Modules_0 = game:GetService("CoreGui").RobloxGui.Modules;
local l_CorePackages_0 = game:GetService("CorePackages");
local v2 = require(l_CorePackages_0.Roact);
local v3 = require(l_CorePackages_0.RoactRodux);
local l_RoactServices_0 = require(l_CorePackages_0.Workspace.Packages.RoactServices).RoactServices;
local v5 = require(l_Modules_0.LuaApp.Services.RoactNetworking);
local l_AppGuiService_0 = require(l_CorePackages_0.Workspace.Packages.RoactServiceTags).AppGuiService;
local v7 = require(l_CorePackages_0.Workspace.Packages.LoggingProtocol);
local v8 = require(l_Modules_0.LuaApp.Analytics.RobloxTelemetryConfigs.ToCPopupOccurance);
local v9 = require(l_CorePackages_0.UIBlox);
local v10 = require(l_CorePackages_0.Packages.t);
local v11 = require(l_Modules_0.LuaApp.Thunks.CloseVNGUserAgreementsPopup);
local l_FormFactor_0 = require(l_CorePackages_0.Workspace.Packages.FormFactor).Enums.FormFactor;
local l_withStyle_0 = v9.Core.Style.withStyle;
local v14 = require(l_Modules_0.LuaApp.withLocalization);
local v15 = require(l_Modules_0.LuaApp.Http.Requests.AgreeUpdatedUserAgreements);
local l_UserAgreementErrorCodes_0 = require(l_CorePackages_0.Workspace.Packages.UserAgreements).UserAgreementErrorCodes;
local _ = require(l_Modules_0.LuaApp.Http.UrlBuilder);
local v18 = require(l_CorePackages_0.FitFrame);
local v19 = require(l_Modules_0.LuaApp.Components.DEPRECATED_ImageSetLabel);
local v20 = require(l_Modules_0.LuaApp.Components.UserAgreement.VNGBalanceTransferPrompt);
local l_Button_0 = v9.App.Button.Button;
local l_ButtonType_0 = v9.App.Button.Enum.ButtonType;
local l_Checkbox_0 = v9.App.InputButton.Checkbox;
local l_IconButton_0 = v9.App.Button.IconButton;
local l_Images_0 = v9.App.ImageSet.Images;
local l_StyledTextLabel_0 = v9.App.Text.StyledTextLabel;
local v27 = require(l_Modules_0.LuaApp.Thunks.Authentication.Logout);
local l_UserAgreementsList_0 = require(l_CorePackages_0.Workspace.Packages.UserAgreements).UserAgreementsList;
local v29 = Rect.new(8, 8, 9, 9);
local v30 = v2.PureComponent:extend("VNGUserAgreementsPopup");
v30.validateProps = v10.strictInterface({
    agreements = v10.array(v10.strictInterface({
        id = v10.string,
        agreementType = v10.string,
        clientType = v10.string,
        displayUrl = v10.string,
        regulationType = v10.string,
        action = v10.optional(v10.string)
    })),
    isSignup = v10.boolean,
    formFactor = v10.string,
    screenSize = v10.Vector2,
    networking = v10.callback,
    guiService = v10.union(v10.Instance, v10.table),
    closePopup = v10.callback,
    logout = v10.callback,
    defaultChildRef = v10.optional(v10.any),
    focusController = v10.optional(v10.any),
    containerWidth = v10.optional(v10.integer),
    closeCentralOverlayThunk = v10.optional(v10.callback),
    agreementAccepted = v10.optional(v10.callback),
    agreementDeclined = v10.optional(v10.callback)
});
v30.init = function(v31)
    local v32, v33 = v2.createBinding(false);
    v31.buttonPressed = v32;
    v31.updateButtonPressed = v33;
    v31.state = {
        agreementsChecked = false,
        acceptingAgreements = false,
        showBalanceTransferAlert = false,
        showError = false
    };
    v31.SetAgreementsCheckBox = function(v34)
        v31:setState({
            agreementsChecked = v34
        });
    end;
    v31.SetAgreementsCheckBoxByTextButton = function()
        v31:setState({
            agreementsChecked = not v31.state.agreementsChecked
        });
    end;
    v31.xClose = function()
        if not v31.props.isSignup then
            v31.props.logout(v31.props.networking, v31.props.guiService);
            v31.props.closePopup();
        else
            v31.props.closePopup();
            if v31.props.agreementDeclined then
                v31.props.agreementDeclined();
                return ;
            end;
        end;
    end;
    v31.tryAgree = function()
        if v31.state.agreementsChecked then
            v31:setState({
                showError = false,
                acceptingAgreements = true
            });
            local l_closePopup_0 = v31.props.closePopup;
            local l_agreements_0 = v31.props.agreements;
            if not v31.props.isSignup then
                v15(v31.props.networking, l_agreements_0, function(v37)
                    if v37 == l_UserAgreementErrorCodes_0.InvalidState then
                        v31:setState({
                            showBalanceTransferAlert = true
                        });
                    elseif v37 == l_UserAgreementErrorCodes_0.NoError then
                        l_closePopup_0();
                        if v31.props.agreementAccepted then
                            v31.props.agreementAccepted(l_agreements_0);
                        end;
                    else
                        v31:setState({
                            showError = true
                        });
                    end;
                    v31:setState({
                        acceptingAgreements = false
                    });
                end);
            else
                l_closePopup_0();
                if v31.props.agreementAccepted then
                    v31.props.agreementAccepted(l_agreements_0);
                    return ;
                end;
            end;
            return ;
        else
            return ;
        end;
    end;
end;
v30.getLayoutInfo = function(_, v39, v40)
    if not v39 then
        return "Frame", {
            Size = UDim2.new(1, 0, 1, 0),
            Position = UDim2.new(0.5, 0, 0.5, 0),
            AnchorPoint = Vector2.new(0.5, 0.5),
            BorderSizePixel = 0,
            BackgroundColor3 = v40.BackgroundUIDefault.Color
        };
    else
        return v19, {
            Size = UDim2.new(0, 540, 0, 0),
            Position = UDim2.new(0.5, 0, 0.5, 0),
            AnchorPoint = Vector2.new(0.5, 0.5),
            BackgroundTransparency = 1,
            Image = "LuaApp/buttons/buttonFill",
            ImageColor3 = v40.BackgroundUIDefault.Color,
            BorderSizePixel = 0,
            ScaleType = Enum.ScaleType.Slice,
            SliceCenter = v29,
            AutomaticSize = Enum.AutomaticSize.Y
        };
    end;
end;
v30.renderBalanceTransferPrompt = function(v41, _)
    return v2.createElement(v20, {
        anchorPoint = Vector2.new(0.5, 0.5),
        position = UDim2.new(0.5, 0, 0.5, 0),
        screenSize = v41.props.screenSize,
        doneActivated = function()
            v41:setState({
                showBalanceTransferAlert = false
            });
        end
    });
end;
v30.renderWithProviders = function(v43, v44, v45)
    local l_Font_0 = v45.Font;
    local l_Theme_0 = v45.Theme;
    local l_screenSize_0 = v43.props.screenSize;
    local v49 = v43.props.formFactor == l_FormFactor_0.WIDE;
    local v50, v51 = v43:getLayoutInfo(v49, l_Theme_0);
    local l_title_0 = v44.title;
    local l_message_0 = v44.message;
    local l_agreeButton_0 = v44.agreeButton;
    local l_checkbox_0 = v44.checkbox;
    local l_errorMessage_0 = v44.errorMessage;
    v7.default:logRobloxTelemetryEvent(v8);
    return v2.createElement("Frame", {
        Size = UDim2.new(1, 0, 0, l_screenSize_0.Y),
        BackgroundTransparency = 1,
        BorderSizePixel = 0
    }, {
        Layout = v2.createElement(v50, v51, {
            ListLayout = v49 and v2.createElement("UIListLayout", {
                FillDirection = Enum.FillDirection.Vertical,
                HorizontalAlignment = Enum.HorizontalAlignment.Center,
                SortOrder = Enum.SortOrder.LayoutOrder
            }),
            Padding = v2.createElement("UIPadding", {
                PaddingTop = UDim.new(0, not v49 and 60 or 0),
                PaddingBottom = UDim.new(0, not v49 and 48 or 24)
            }),
            Content = v2.createElement(v18.FitFrameVertical, {
                width = UDim.new(1, 0),
                BackgroundTransparency = 1,
                LayoutOrder = 1
            }, {
                Title = v2.createElement("Frame", {
                    LayoutOrder = 1,
                    Size = UDim2.new(1, 0, 0, 48),
                    BackgroundTransparency = 1,
                    BorderSizePixel = 0
                }, {
                    v2.createElement(l_IconButton_0, {
                        anchorPoint = Vector2.new(0, 0.5),
                        size = UDim2.new(0, 36, 0, 36),
                        position = UDim2.new(0, 8, 0.5, 0),
                        icon = l_Images_0["icons/navigation/close"],
                        onActivated = v43.xClose
                    });
                    TitleText = v2.createElement(l_StyledTextLabel_0, {
                        size = UDim2.new(1, 0, 0, 36),
                        text = l_title_0,
                        fontStyle = l_Font_0.Header1,
                        colorStyle = l_Theme_0.TextEmphasis,
                        textXAlignment = Enum.TextXAlignment.Center,
                        textYAlignment = Enum.TextYAlignment.Bottom,
                        textTruncate = Enum.TextTruncate.AtEnd
                    }),
                    Divider = v2.createElement("Frame", {
                        Size = UDim2.new(1, 0, 0, 1),
                        AnchorPoint = Vector2.new(0, 0),
                        BackgroundColor3 = l_Theme_0.Divider.Color,
                        BackgroundTransparency = l_Theme_0.Divider.Transparency,
                        BorderSizePixel = 0
                    })
                }),
                Message = v2.createElement("Frame", {
                    LayoutOrder = 2,
                    AutomaticSize = Enum.AutomaticSize.Y,
                    Size = UDim2.new(1, 0, 0, 0),
                    BorderSizePixel = 0,
                    BackgroundTransparency = 1
                }, {
                    Padding = v2.createElement("UIPadding", {
                        PaddingTop = UDim.new(0, not v49 and 48 or 24),
                        PaddingRight = UDim.new(0, 24),
                        PaddingBottom = UDim.new(0, not v49 and 48 or 12),
                        PaddingLeft = UDim.new(0, 24)
                    }),
                    MessageText = v2.createElement(l_StyledTextLabel_0, {
                        size = UDim2.new(1, 0, 0, 0),
                        text = l_message_0,
                        fontStyle = l_Font_0.Body,
                        colorStyle = l_Theme_0.TextDefault,
                        textXAlignment = Enum.TextXAlignment.Left,
                        textYAlignment = Enum.TextYAlignment.Top,
                        textTruncate = Enum.TextTruncate.None,
                        automaticSize = Enum.AutomaticSize.Y
                    })
                }),
                AgreementsContainer = v2.createElement("Frame", {
                    LayoutOrder = 3,
                    AutomaticSize = Enum.AutomaticSize.Y,
                    Size = UDim2.new(1, 0, 0, 0),
                    BorderSizePixel = 0,
                    BackgroundTransparency = 1
                }, {
                    Padding = v2.createElement("UIPadding", {
                        PaddingTop = UDim.new(0, 0),
                        PaddingRight = UDim.new(0, 24),
                        PaddingBottom = UDim.new(0, 20),
                        PaddingLeft = UDim.new(0, 24)
                    }),
                    CheckBox = v2.createElement(l_Checkbox_0, {
                        text = "",
                        isSelected = v43.state.agreementsChecked,
                        onActivated = v43.SetAgreementsCheckBox
                    }),
                    MessageButton = v2.createElement("TextButton", {
                        Size = UDim2.new(1, -34, 1, 0),
                        Position = UDim2.new(0, 34, 0, 0),
                        AutomaticSize = Enum.AutomaticSize.Y,
                        BackgroundTransparency = 1,
                        Text = l_checkbox_0,
                        Font = l_Font_0.Body.Font,
                        TextSize = l_Font_0.BaseSize * l_Font_0.Body.RelativeSize,
                        TextColor3 = l_Theme_0.TextEmphasis.Color,
                        TextTransparency = l_Theme_0.TextEmphasis.Transparency,
                        TextXAlignment = Enum.TextXAlignment.Left,
                        TextWrapped = true,
                        [v2.Event.Activated] = v43.SetAgreementsCheckBoxByTextButton
                    })
                }),
                SecondDivider = v2.createElement("Frame", {
                    LayoutOrder = 4,
                    AutomaticSize = Enum.AutomaticSize.Y,
                    Size = UDim2.new(1, 0, 0, 0),
                    BorderSizePixel = 0,
                    BackgroundTransparency = 1
                }, {
                    Padding = v2.createElement("UIPadding", {
                        PaddingTop = UDim.new(0, 0),
                        PaddingRight = UDim.new(0, 24),
                        PaddingBottom = UDim.new(0, 0),
                        PaddingLeft = UDim.new(0, 24)
                    }),
                    Divider = v2.createElement("Frame", {
                        Size = UDim2.new(1, 0, 0, 1),
                        AnchorPoint = Vector2.new(0, 0),
                        BackgroundColor3 = l_Theme_0.Divider.Color,
                        BackgroundTransparency = l_Theme_0.Divider.Transparency,
                        BorderSizePixel = 0
                    })
                }),
                AgreementsList = v2.createElement(l_UserAgreementsList_0, {
                    LayoutOrder = 5,
                    agreements = v43.props.agreements,
                    margin = v18.Rect.quad(0, 24, 24, 24)
                })
            }),
            AgreeZone = v2.createElement("Frame", {
                LayoutOrder = 2,
                AutomaticSize = Enum.AutomaticSize.Y,
                Size = UDim2.new(1, 0, 0, 0),
                BorderSizePixel = 0,
                BackgroundTransparency = 1,
                Position = UDim2.new(0.5, 0, 1, -10),
                AnchorPoint = Vector2.new(0.5, 1)
            }, {
                Padding = v2.createElement("UIPadding", {
                    PaddingTop = UDim.new(0, 0),
                    PaddingRight = UDim.new(0, 24),
                    PaddingBottom = UDim.new(0, 10),
                    PaddingLeft = UDim.new(0, 24)
                });
                v2.createElement(v18.FitFrameVertical, {
                    width = UDim.new(1, 0),
                    BackgroundTransparency = 1
                }, {
                    ErrorLabel = not not v43.state.showError and v2.createElement("TextLabel", {
                        LayoutOrder = 1,
                        Size = UDim2.new(1, 0, 0, 0),
                        AutomaticSize = Enum.AutomaticSize.Y,
                        BackgroundTransparency = 1,
                        Text = l_errorMessage_0,
                        Font = l_Font_0.Body.Font,
                        TextSize = (l_Font_0.BaseSize * l_Font_0.Body.RelativeSize) * 0.8,
                        TextColor3 = l_Theme_0.Alert.Color,
                        TextTransparency = l_Theme_0.TextEmphasis.Transparency,
                        TextXAlignment = Enum.TextXAlignment.Left,
                        TextWrapped = true
                    }) or nil,
                    AgreeButton = v2.createElement(l_Button_0, {
                        buttonType = l_ButtonType_0.PrimarySystem,
                        size = UDim2.new(1, 0, 0, 48),
                        anchorPoint = Vector2.new(0, 0),
                        isDisabled = v43.state.acceptingAgreements or not v43.state.agreementsChecked,
                        layoutOrder = 2,
                        text = l_agreeButton_0,
                        fontStyle = l_Font_0.SubHeader1,
                        onActivated = v43.tryAgree
                    })
                })
            })
        })
    });
end;
v30.render = function(v57)
    return v14({
        title = "CommonUI.UserAgreements.Popup.Agreement.TermsOfService",
        message = not v57.props.isSignup and "CommonUI.UserAgreements.Popup.ConvertToVNMessage" or "CommonUI.UserAgreements.Popup.SignupMessage",
        agreeButton = "CommonUI.UserAgreements.Popup.Agree2",
        checkbox = "CommonUI.UserAgreements.Popup.CheckboxMessage",
        errorMessage = "CommonUI.UserAgreements.Popup.FailAndRetryMessage"
    })(function(v58)
        return l_withStyle_0(function(v59)
            if not v57.state.showBalanceTransferAlert then
                return (v57:renderWithProviders(v58, v59));
            else
                return (v57:renderBalanceTransferPrompt(v58));
            end;
        end);
    end);
end;
return (l_RoactServices_0.connect({
    networking = v5,
    guiService = l_AppGuiService_0
})((v3.connect(function(v60)
    return {
        screenSize = v60.ScreenSize,
        formFactor = v60.FormFactor
    };
end, function(v61)
    return {
        closePopup = function()
            v61(v11());
        end,
        logout = function(v62, v63)
            v61(v27(v62, v63));
        end
    };
end)(v30))));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("Modules");
local l_CorePackages_0 = game:GetService("CorePackages");
local v2 = require(l_CorePackages_0.Roact);
local l_RoactServices_0 = require(l_CorePackages_0.Workspace.Packages.RoactServices).RoactServices;
local v4 = require(l_script_FirstAncestor_0.LuaApp.Services.RoactNetworking);
local l_compose_0 = require(l_CorePackages_0.LuaSocialLibrariesDeps).SocialLibraries.config({}).RoduxTools.compose;
local v6 = require(script.Parent.UserSearchTileUniversalWrapper);
return l_compose_0(l_RoactServices_0.connect({
    networking = v4
}))(function(v7)
    return v2.createElement(v6, v7);
end);


local l_CorePackages_0 = game:GetService("CorePackages");
local v1 = require(l_CorePackages_0.Roact);
local l_useDispatch_0 = require(l_CorePackages_0.Workspace.Packages.RoactUtils).Hooks.RoactRodux.useDispatch;
local l_Modules_0 = game:GetService("CoreGui").RobloxGui.Modules;
local v4 = require(l_Modules_0.LuaApp.Thunks.NavigateToUserInfo);
local v5 = require(l_Modules_0.Profile.Analytics.EntryPoints);
local v6 = require(l_Modules_0.LuaApp.Thunks.RequestFriendship);
local v7 = require(l_Modules_0.LuaApp.Thunks.AcceptFriendRequest);
local l_UserSearchTile_0 = require(script.Parent.Parent.api).UserSearchTile;
local l_ImpressionsTaggerWrapper_0 = require(l_CorePackages_0.Workspace.Packages.Impressions).ImpressionsTaggerWrapper;
local _ = require(l_CorePackages_0.Workspace.Packages.GraphQLServer);
return function(v11)
    local v12 = l_useDispatch_0();
    local function v14(v13)
        v12(v6(v11.networking, v13.userId));
    end;
    local function v16(v15)
        v12(v7(v11.networking, v15.userId));
    end;
    local function v18(v17)
        v12(v4(v17.userId, {
            profilePeekViewProps = {
                resetPeekView = true,
                source = v5.PlayerSearch.rawValue(),
                contextualInfoType = v17.contextualInfoType,
                contextualInfoDisplay = v17.contextualInfoDisplay,
                analyticsProps = {
                    userSearchSessionId = v11.Analytics.getInfoForAllEvents().userSearchSessionId
                }
            },
            entryPoint = v5.PlayerSearch
        }));
    end;
    return v1.createElement(l_ImpressionsTaggerWrapper_0, {
        impressionsIndex = v11.index,
        impressionsTag = v11.impressionsTag,
        renderComponent = function()
            return v1.createElement(l_UserSearchTile_0, {
                index = v11.index,
                user = v11.user,
                size = v11.size,
                searchParameters = v11.searchParameters,
                hasEmphasis = v11.hasEmphasis,
                profileInsight = v11.profileInsight,
                luaAppNetworkingRequests = {
                    requestFriendship = v14,
                    acceptFriendRequest = v16
                },
                luaAppNavigation = {
                    navigateToUserInfo = v18
                },
                fireAnalyticsEvent = v11.Analytics.fireAnalyticsEvent
            });
        end
    });
end;


local v0 = require(game:GetService("CorePackages").Workspace.Packages.JestConfigs);
return {
    displayName = "SocialAppIntegration-UserSearch",
    testMatch = {
        "**/*.test"
    },
    setupFilesAfterEnv = {
        v0.setupFiles.LogHandler,
        v0.setupFiles.UIBloxInitializer,
        v0.setupFiles.createPromiseRejectionHandler()
    }
};


local l_CorePackages_0 = game:GetService("CorePackages");
local l_Modules_0 = game:GetService("CoreGui").RobloxGui.Modules;
local v2 = require(l_CorePackages_0.Roact);
local v3 = require(l_Modules_0.LuaApp.FitChildren);
local v4 = require(l_Modules_0.LuaApp.Components.FitTextLabel);
local v5 = require(l_CorePackages_0.UIBlox);
local l_withStyle_0 = v5.Style.withStyle;
local l_Checkbox_0 = v5.App.InputButton.Checkbox;
local l_ImageSetLabel_0 = v5.Core.ImageSet.ImageSetLabel;
local l_Large_0 = v5.App.Constant.IconSize.Large;
return function(v10)
    return l_withStyle_0(function(v11)
        local l_Font_0 = v11.Font.Body.Font;
        local v13 = v11.Font.BaseSize * v11.Font.Body.RelativeSize;
        local l_Transparency_0 = v11.Theme.TextDefault.Transparency;
        local v15 = v10.TextColor or v11.Theme.TextDefault.Color;
        local v16 = {
            Layout = v2.createElement("UIListLayout", {
                FillDirection = Enum.FillDirection.Vertical,
                Padding = UDim.new(0, v10.MainTextPadding or 0)
            })
        };
        if v10.MainText then
            for v17 = 1, #v10.MainText do
                local v18 = v10.MainText[v17];
                if not (typeof(v18) == "table") or not v10.showConsentCheckbox then
                    table.insert(v16, v2.createElement(v4, {
                        Text = v18,
                        TextColor3 = v15,
                        TextSize = v13,
                        TextTransparency = l_Transparency_0,
                        Font = l_Font_0,
                        BackgroundTransparency = 1,
                        BorderSizePixel = 0,
                        LayoutOrder = #v16,
                        TextWrapped = true,
                        RichText = v10.showConsentCheckbox,
                        TextXAlignment = if not v10.showConsentCheckbox then Enum.TextXAlignment.Center else Enum.TextXAlignment.Left,
                        Size = UDim2.new(1, 0, 0, 0),
                        fitAxis = v3.FitAxis.Height
                    }));
                else
                    table.insert(v16, v2.createElement("Frame", {
                        AutomaticSize = Enum.AutomaticSize.XY,
                        BackgroundTransparency = 1
                    }, {
                        Image = v2.createElement(l_ImageSetLabel_0, {
                            Image = v18.image,
                            Size = UDim2.fromOffset(l_Large_0, l_Large_0),
                            BackgroundTransparency = 1,
                            ScaleType = Enum.ScaleType.Slice
                        }),
                        Layout = v2.createElement("UIListLayout", {
                            HorizontalAlignment = Enum.HorizontalAlignment.Left,
                            VerticalAlignment = Enum.VerticalAlignment.Top,
                            FillDirection = Enum.FillDirection.Horizontal,
                            SortOrder = Enum.SortOrder.LayoutOrder,
                            Padding = UDim.new(0, 12)
                        }),
                        Label = v2.createElement(v4, {
                            Text = v18.content,
                            TextColor3 = v15,
                            TextSize = v13,
                            TextTransparency = l_Transparency_0,
                            Font = l_Font_0,
                            BackgroundTransparency = 1,
                            BorderSizePixel = 0,
                            LayoutOrder = #v16,
                            TextWrapped = true,
                            RichText = true,
                            TextXAlignment = Enum.TextXAlignment.Left,
                            Size = UDim2.new(1, -l_Large_0, 0, 0),
                            fitAxis = v3.FitAxis.Height
                        })
                    }));
                end;
            end;
            if v10.LocalizedOptOutText then
                table.insert(v16, v2.createElement("Frame", {
                    BackgroundTransparency = 1,
                    LayoutOrder = #v16,
                    Size = UDim2.new(0, 0, 0, 25),
                    AutomaticSize = Enum.AutomaticSize.XY
                }, {
                    v2.createElement("Frame", {
                        Position = UDim2.fromScale(not v10.centerCheckbox and 0 or 0.5, 0.5),
                        BackgroundTransparency = 1
                    }, {
                        Checkbox = v2.createElement(l_Checkbox_0, {
                            text = v10.LocalizedOptOutText,
                            onActivated = v10.onActivated,
                            isSelected = v10.checkboxSelected
                        })
                    })
                }));
            end;
            if v10.showConsentCheckbox then
                table.insert(v16, v2.createElement("Frame", {
                    BackgroundTransparency = 1,
                    LayoutOrder = #v16,
                    AutomaticSize = Enum.AutomaticSize.Y,
                    Size = UDim2.new(1, 0, 0, 25)
                }, {
                    v2.createElement("Frame", {
                        Position = UDim2.fromOffset(0, 12),
                        Size = UDim2.new(1, 0, 0, 50),
                        BackgroundTransparency = 1,
                        AutomaticSize = Enum.AutomaticSize.Y
                    }, {
                        Checkbox = not v10.hideConsent and v2.createElement(l_Checkbox_0, {
                            text = "",
                            onActivated = v10.consentActivated,
                            isSelected = v10.consentSelected
                        }),
                        CheckboxContent = if not v10.hideConsent then v2.createElement("TextButton", {
                            Text = v10.consentText,
                            AutomaticSize = Enum.AutomaticSize.XY,
                            TextColor3 = v15,
                            TextSize = v13,
                            TextTransparency = l_Transparency_0,
                            Font = l_Font_0,
                            BackgroundTransparency = 1,
                            BorderSizePixel = 0,
                            LayoutOrder = 10,
                            TextWrapped = true,
                            RichText = true,
                            TextXAlignment = Enum.TextXAlignment.Left,
                            [v2.Event.Activated] = v10.consentActivated,
                            Size = UDim2.new(1, -10, 0, 0)
                        }) else v2.createElement("TextLabel", {
                            Text = v10.consentText,
                            AutomaticSize = Enum.AutomaticSize.XY,
                            TextColor3 = v15,
                            TextSize = v13,
                            TextTransparency = l_Transparency_0,
                            Font = l_Font_0,
                            BackgroundTransparency = 1,
                            BorderSizePixel = 0,
                            LayoutOrder = 10,
                            TextWrapped = true,
                            RichText = true,
                            TextXAlignment = Enum.TextXAlignment.Left,
                            Size = UDim2.new(1, -10, 0, 0)
                        }),
                        Layout = v2.createElement("UIListLayout", {
                            HorizontalAlignment = Enum.HorizontalAlignment.Left,
                            VerticalAlignment = Enum.VerticalAlignment.Center,
                            FillDirection = Enum.FillDirection.Horizontal,
                            SortOrder = Enum.SortOrder.LayoutOrder,
                            Padding = UDim.new(0, 10)
                        }),
                        Padding = v2.createElement("UIPadding", {
                            PaddingRight = UDim.new(0, 10)
                        })
                    })
                }));
            end;
        end;
        return v2.createElement(v3.FitFrame, {
            LayoutOrder = v10.LayoutOrder,
            Size = UDim2.new(1, 0, 0, 0),
            fitAxis = v3.FitAxis.Height,
            BackgroundTransparency = 1
        }, v16);
    end);
end;


local l_CorePackages_0 = game:GetService("CorePackages");
local l_IXPService_0 = game:GetService("IXPService");
local l_Modules_0 = game:GetService("CoreGui").RobloxGui.Modules;
local v3 = require(l_CorePackages_0.Logging);
local v4 = require(l_CorePackages_0.Roact);
local v5 = require(l_CorePackages_0.RoactRodux);
local v6 = require(l_Modules_0.LuaApp.Services.RoactNetworking);
local l_RoactServices_0 = require(l_CorePackages_0.Workspace.Packages.RoactServices).RoactServices;
local l_AppPermissions_0 = require(l_CorePackages_0.Workspace.Packages.RoactServiceTags).AppPermissions;
local v9 = require(l_CorePackages_0.Cryo);
local v10 = require(l_CorePackages_0.UIBlox);
local l_withStyle_0 = v10.Style.withStyle;
local v12 = require(l_Modules_0.LuaApp.withLocalization);
local l_PartialPageModal_0 = v10.App.Dialog.Modal.PartialPageModal;
local v14 = require(l_Modules_0.LuaApp.Http.Url);
local v15 = require(l_Modules_0.LuaApp.Components.Verification.IdentityVerification.IdentityVerificationModalContent);
local v16 = require(l_Modules_0.LuaApp.Thunks.NavigateDown);
local v17 = require(l_Modules_0.LuaApp.Thunks.CloseCentralOverlay);
local v18 = require(l_Modules_0.LuaApp.Thunks.SetNetworkingErrorToast);
local l_Images_0 = v10.App.ImageSet.Images;
local v20 = require(l_Modules_0.LuaApp.AppPage);
local l_ButtonType_0 = v10.App.Button.Enum.ButtonType;
local l_RoactAppPolicy_0 = require(l_CorePackages_0.Workspace.Packages.UniversalAppPolicy).RoactAppPolicy;
local v23 = require(l_CorePackages_0.Workspace.Packages.VoiceChat);
local l_PostUserOptIn_0 = v23.PostUserOptIn;
local v25 = require(l_Modules_0.LuaApp.Analytics.Events.VoiceUpsellAnalytics);
local v26 = game:DefineFastFlag("VoiceConsentCopyV2", false);
local v27 = game:DefineFastFlag("VoiceUpsellNewAnalytics", false);
local v28 = v23.Flags.GetFStringVoiceUpsellLayer();
local v29 = v4.PureComponent:extend("EnableVoiceModal");
local v30 = require(l_Modules_0.LuaApp.Http.Requests.PostAgeVerificationOptOutCheckbox);
local v31 = require(l_Modules_0.LuaApp.Flags.GetFFlagVoiceUpsellConsentCheckbox);
v29.init = function(v32)
    v32.isMounted = false;
    v32.state = {
        dontShowModalAgain = false
    };
    if v31() then
        v32.state.consentGiven = not v32.props.RequireExplicitVoiceConsent;
    end;
    v32.enableVoice = function()
        if v27 then
            v32.props.voiceUpsellAnalytics.enableVoiceChatUpsell();
        end;
        l_PostUserOptIn_0(v32.props.networking, true, true):andThen(function(v33)
            if not v33 then
                v32.props.setNetworkingErrorToast();
                v3.warn("Error getting UserOptIn. " .. tostring(v33));
                return ;
            else
                v32.props.launchGame();
                v32.props.closeOverlay();
                v32.props.setShowVoiceOptIn({
                    voiceEnabled = true,
                    showVoiceOptInOverlay = false
                });
                return ;
            end;
        end):catch(function()
            v32.props.setNetworkingErrorToast();
            v3.warn("Exception posting PostUserOptIn");
        end);
    end;
    v32.joinAnyways = function()
        v32.props.voiceUpsellAnalytics.joinWithoutVoiceChat(v32.state.dontShowModalAgain == true);
        if not (not v32.state.dontShowModalAgain and not v31()) then
            v32.props.setShowVoiceOptIn({
                voiceEnabled = false,
                showVoiceOptInOverlay = false
            });
        end;
        v32.props.launchGame();
        v32.props.closeOverlay();
    end;
    v32.onOverlayOptOutCheckBoxActivated = function(v34)
        if v32.isMounted then
            v30(v32.props.networking, not v34):catch(function(v35)
                v3.warn("Error posting ShowOverlay for AgeVerificationOptOutCheckbox. " .. tostring(v35));
            end);
            v32:setState({
                dontShowModalAgain = v34
            });
        end;
    end;
    v32.consentActivated = function()
        if v32.isMounted then
            v32:setState({
                consentGiven = not v32.state.consentGiven
            });
        end;
    end;
    v32.closeEnableVoiceModal = function()
        if v31() then
            v32.props.setShowVoiceOptIn({
                showVoiceOptInOverlay = false
            });
        end;
        v32.props.voiceUpsellAnalytics.closeEnableVoiceChatModal();
        v32.props.closeOverlay();
    end;
end;
v29.didMount = function(v36)
    v36.isMounted = true;
    if not (not v31() or not v36.props.postUserSeenModal) then
        v36.props.postUserSeenModal():andThen(function()
            v3.warn("UserSeenModal request succeeded");
        end):catch(function(_)
            v3.warn("UserSeenModal request failed");
        end);
    end;
    if not (not (v28 ~= "") or not v27) then
        l_IXPService_0:LogUserLayerExposure(v28);
    end;
    v36.props.voiceUpsellAnalytics.showEnableVoiceChatModal();
end;
v29.willUnmount = function(v38)
    v38.isMounted = false;
end;
v29.render = function(v39)
    local l_showNewContent_0 = v39.props.showNewContent;
    return v12(v9.Dictionary.join({
        EnableVoiceChat = "Verification.Identity.Label.EnableVoiceChat",
        LearnMoreAboutVoiceRecording = "Verification.Identity.Label.LearnMoreAboutVoiceRecording",
        SkipVoiceChat = "Verification.Identity.Action.SkipVoiceChat",
        UsesVoiceChat = "Verification.Identity.Label.UsesVoiceChat",
        DontShowAgain = "Verification.Identity.Label.DontShowAgain",
        ConsentText = "Verification.Identity.Label.VoiceCollectionConsent",
        EnableVoiceContent1 = "Verification.Identity.Label.EnableVoiceChat1",
        EnableVoiceContent2 = "Verification.Identity.Label.EnableVoiceChat2",
        ClickToConsent = "Verification.Identity.Label.VoiceCollectionConsent2",
        LetsChat = "Verification.Identity.Heading.LetsChat",
        VoiceFAQ = "InGame.CommonUI.Label.FAQWebviewTitle"
    }, if not l_showNewContent_0 then {} else {
        EnableVoiceChat = "Verification.Identity.Label.EnableMicrophone",
        SkipVoiceChat = "Verification.Identity.Label.JoinWithoutMicrophone",
        EnableVoiceContent1 = "Verification.Identity.Label.EnableChatWithVoice",
        LetsChat = "Verification.Identity.Heading.YourNewWayToChat"
    }, if not v26 then {} else {
        LetsChat = "Verification.Identity.Heading.V2LetsChat",
        ClickToConsent = "Verification.Identity.Label.V2ClickToConsent",
        EnableVoiceChat = "Verification.Identity.Label.V2EnableVoiceChat",
        EnableVoiceContent1 = "Verification.Identity.Label.V2EnableVoiceChat1",
        SkipVoiceChat = "Verification.Identity.Label.V2JoinWithout"
    }))(function(v41)
        return l_withStyle_0(function(v42)
            local l_Theme_0 = v42.Theme;
            local l_CaptionHeader_0 = v42.Font.CaptionHeader;
            local v45 = l_CaptionHeader_0.RelativeSize * v42.Font.BaseSize;
            local v46 = not v39.props.RequireExplicitVoiceConsent;
            local v47 = v4.createElement(v15, v9.Dictionary.join({
                MainText = {
                    v41.UsesVoiceChat
                },
                LocalizedOptOutText = v41.DontShowAgain,
                centerCheckbox = true,
                onActivated = v39.onOverlayOptOutCheckBoxActivated,
                checkboxSelected = v39.state.dontShowModalAgain
            }, if not v31() then {} else {
                MainText = {
                    {
                        content = v41.EnableVoiceContent1,
                        image = l_Images_0["icons/graphic/voicechat_large"]
                    },
                    "",
                    {
                        content = v41.EnableVoiceContent2,
                        image = l_Images_0["icons/graphic/hearts_large"]
                    }
                },
                LocalizedOptOutText = false,
                centerCheckbox = false,
                showConsentCheckbox = true,
                consentText = if not v46 then v41.ConsentText else v41.ClickToConsent,
                consentActivated = v39.consentActivated,
                consentSelected = v39.state.consentGiven,
                hideConsent = v46
            }));
            local v48 = {
                {
                    buttonType = l_ButtonType_0.Secondary,
                    props = {
                        onActivated = v39.joinAnyways,
                        text = v41.SkipVoiceChat
                    }
                },
                {
                    buttonType = if not l_showNewContent_0 then l_ButtonType_0.PrimarySystem else l_ButtonType_0.Secondary,
                    props = {
                        isDisabled = if not v31() then nil else not v39.state.consentGiven,
                        onActivated = v39.enableVoice,
                        text = v41.EnableVoiceChat
                    }
                }
            };
            return v4.createElement(l_PartialPageModal_0, {
                title = if not v31() then v41.EnableVoiceChat else v41.LetsChat,
                screenSize = v39.props.screenSize,
                onCloseClicked = v39.closeEnableVoiceModal,
                buttonStackProps = v48 and {
                    buttonHeight = 48,
                    buttons = v48
                },
                footerContent = function()
                    return v4.createFragment({
                        Divider = v4.createElement("Frame", {
                            AnchorPoint = Vector2.new(0.5, 0.5),
                            Position = UDim2.new(0.5, 0, 0, 16),
                            BorderSizePixel = 0,
                            BackgroundColor3 = l_Theme_0.Divider.Color,
                            BackgroundTransparency = l_Theme_0.Divider.Transparency,
                            LayoutOrder = 2,
                            Size = UDim2.new(1, 0, 0, 1)
                        }),
                        FooterText = v4.createElement("TextButton", {
                            Text = v41.LearnMoreAboutVoiceRecording or "Learn More about Voice Recording",
                            AutomaticSize = Enum.AutomaticSize.X,
                            Position = UDim2.new(0.5, 0, 0.5, 24),
                            TextColor3 = v42.Theme.TextEmphasis.Color,
                            AnchorPoint = Vector2.new(0.5, 0.5),
                            BackgroundTransparency = 1,
                            Font = l_CaptionHeader_0.Font,
                            TextSize = v45,
                            BorderSizePixel = 0,
                            RichText = true,
                            TextXAlignment = Enum.TextXAlignment.Left,
                            Size = UDim2.new(0, 0, 0, 20),
                            [v4.Event.Activated] = function()
                                v39.props.openVoiceFAQ(v41.VoiceFAQ or "Voice FAQ");
                                if v27 then
                                    v39.props.voiceUpsellAnalytics.learnMoreAboutVoiceRecordingUpsell();
                                end;
                            end
                        })
                    });
                end
            }, {
                OuterFrame = v4.createElement("Frame", {
                    Size = UDim2.new(1, 0, 0, 0),
                    BackgroundTransparency = 1,
                    AutomaticSize = Enum.AutomaticSize.Y
                }, {
                    ListLayout = v4.createElement("UIListLayout", {
                        FillDirection = Enum.FillDirection.Vertical,
                        Padding = UDim.new(0, 24),
                        SortOrder = Enum.SortOrder.LayoutOrder,
                        HorizontalAlignment = Enum.HorizontalAlignment.Center
                    }),
                    Padding = v4.createElement("UIPadding", {
                        PaddingTop = UDim.new(0, 24),
                        PaddingBottom = UDim.new(0, 24)
                    }),
                    ContentFrame = v4.createElement("Frame", {
                        LayoutOrder = 2,
                        Size = UDim2.new(1, 0, 0, 0),
                        AutomaticSize = Enum.AutomaticSize.Y,
                        BackgroundTransparency = 1
                    }, {
                        Content = v47
                    })
                })
            });
        end);
    end);
end;
return v5.connect(function(v49, _)
    return {
        formFactor = v49.FormFactor,
        screenSize = v49.ScreenSize
    };
end, function(v51)
    return {
        closeOverlay = function()
            v51(v17());
        end,
        setNetworkingErrorToast = function(_)
            v51(v18({
                HttpError = Enum.HttpError.OK
            }));
        end,
        openVoiceFAQ = function(v53)
            return v51(v16({
                name = v20.GenericWebPage,
                detail = string.format("%sinfo/voice-faq", v14.BASE_URL),
                extraProps = {
                    title = v53
                }
            }));
        end
    };
end)((l_RoactServices_0.connect({
    networking = v6,
    permissions = l_AppPermissions_0,
    voiceUpsellAnalytics = v25
})((l_RoactAppPolicy_0.connect(function(v54, _)
    return {
        showNewContent = v54.getGameInfoShowChatFeatures()
    };
end)(v29)))));


local l_CoreGui_0 = game:GetService("CoreGui");
local l_CorePackages_0 = game:GetService("CorePackages");
local l_UserInputService_0 = game:GetService("UserInputService");
local l_Workspace_0 = game:GetService("Workspace");
local l_VRService_0 = game:GetService("VRService");
local l_Modules_0 = l_CoreGui_0.RobloxGui.Modules;
local v6 = require(l_CorePackages_0.Roact);
local v7 = require(l_CorePackages_0.RoactRodux);
local l_FormFactor_0 = require(l_CorePackages_0.Workspace.Packages.FormFactor).Enums.FormFactor;
local l_RoactAppPolicy_0 = require(l_CorePackages_0.Workspace.Packages.UniversalAppPolicy).RoactAppPolicy;
local v10 = require(l_Modules_0.LuaApp.Enum.NotificationType);
local v11 = require(l_Modules_0.LuaApp.Constants);
local l_MainScreenResolution_0 = require(l_CorePackages_0.Workspace.Packages.VrCompatibility).VRConstants.MainScreenResolution;
local l_DeviceOrientationMode_0 = require(l_CorePackages_0.Workspace.Packages.RobloxAppEnums).DeviceOrientationMode;
local v14 = require(l_Modules_0.LuaApp.getScreenBottomInset);
local v15 = require(l_Modules_0.Common.RoactUtilities.ExternalEventConnection);
local v16 = require(l_Modules_0.LuaApp.Actions.SetScreenSize);
local v17 = require(l_Modules_0.LuaApp.Actions.SetDeviceOrientation);
local l_SetFormFactor_0 = require(l_CorePackages_0.Workspace.Packages.FormFactor).Actions.SetFormFactor;
local v19 = require(l_Modules_0.LuaApp.Actions.SetStatusBarHeight);
local v20 = require(l_Modules_0.LuaApp.Actions.SetGlobalGuiInset);
local v21 = require(l_Modules_0.LuaApp.getVRFloorOffset);
local v22 = require(l_Modules_0.LuaApp.Actions.SetGlobalContextMenuInset);
local l_Placements_0 = require(l_CorePackages_0.Workspace.Packages.AppSystemBar).Enum.Placements;
local l_AppGuiService_0 = require(l_CorePackages_0.Workspace.Packages.RoactServiceTags).AppGuiService;
local l_AppRunService_0 = require(l_CorePackages_0.Workspace.Packages.RoactServiceTags).AppRunService;
local l_RoactServices_0 = require(l_CorePackages_0.Workspace.Packages.RoactServices).RoactServices;
local v27 = require(l_Modules_0.LuaApp.Flags.GetFFlagSetOrientationWhenRequested);
local l_GetFFlagAdjustVRFloor_0 = require(l_CorePackages_0.Workspace.Packages.SharedFlags).GetFFlagAdjustVRFloor;
local v29 = require(l_Modules_0.LuaApp.Flags.GetFFlagViewportManagerFixStatusBarHeightRace);
local v30 = v6.Component:extend("ViewportManager");
v30.init = function(v31)
    v31.updateDeviceOrientation = function(v32)
        local v33 = v32.y < v32.x and l_DeviceOrientationMode_0.Landscape or l_DeviceOrientationMode_0.Portrait;
        if v27() or v31.props.deviceOrientation ~= v33 then
            v31.props.setDeviceOrientation(v33);
        end;
    end;
    v31.updateDeviceFormFactor = function(v34)
        local l_useWidthBasedRule_0 = v31.props.useWidthBasedRule;
        local l_WIDE_0 = l_FormFactor_0.WIDE;
        if not l_useWidthBasedRule_0 then
            if v34.X < v34.Y then
                l_WIDE_0 = l_FormFactor_0.COMPACT;
            end;
        elseif v34.X < 600 then
            l_WIDE_0 = l_FormFactor_0.COMPACT;
        end;
        v31.props.setFormFactor(l_WIDE_0);
    end;
    v31.updateViewport = function()
        local l_ViewportSize_0 = l_Workspace_0.CurrentCamera.ViewportSize;
        if v31.props.use3DPanels then
            l_ViewportSize_0 = l_MainScreenResolution_0;
        end;
        if l_ViewportSize_0.X > 1 and l_ViewportSize_0.Y > 1 then
            v31.props.setScreenSize(l_ViewportSize_0);
            v31.updateDeviceOrientation(l_ViewportSize_0);
            v31.updateDeviceFormFactor(l_ViewportSize_0);
        end;
    end;
    v31.pointCameraTo3DPanels = function()
        local l_CurrentCamera_0 = workspace.CurrentCamera;
        if l_CurrentCamera_0 then
            if not l_GetFFlagAdjustVRFloor_0() then
                l_CurrentCamera_0.CFrame = CFrame.new(0, 5, 0);
            else
                l_CurrentCamera_0.CFrame = CFrame.new(0, -v21().Y, 0);
                return ;
            end;
        end;
    end;
    v31.updateStatusBarHeight = function()
        local l_Y_0 = l_UserInputService_0.StatusBarSize.Y;
        if not (v31.props.statusBarHeight == l_Y_0 and not v29()) then
            v31.props.setStatusBarHeight(l_Y_0);
        end;
    end;
    v31.updateGlobalGuiInset = function()
        local l_bottomBarVisible_0 = v31.props.bottomBarVisible;
        local _ = v31.props.systemBarPlacement;
        local v42 = v14();
        local v43 = 0;
        local l_X_0 = l_UserInputService_0.RightBarSize.X;
        local l_v42_0 = v42;
        local l_BOTTOM_BAR_SIZE_0 = v11.BOTTOM_BAR_SIZE;
        if l_bottomBarVisible_0 then
            if v31.props.systemBarPlacement == l_Placements_0.Left then
                v43 = v43 + v11.LEFT_BAR_SIZE;
            elseif v31.props.systemBarPlacement == l_Placements_0.Bottom then
                l_v42_0 = l_v42_0 + l_BOTTOM_BAR_SIZE_0;
            end;
        end;
        v31.props.setGlobalContextMenuInset(0, 0, l_X_0, v42);
        v31.props.setGlobalGuiInset(v43, 0, l_X_0, l_v42_0);
    end;
end;
v30.render = function(v47)
    return v6.createElement("Folder", {}, {
        viewportSizeListener = v6.createElement(v15, {
            event = l_Workspace_0.CurrentCamera:GetPropertyChangedSignal("ViewportSize"),
            callback = v47.updateViewport
        }),
        statusBarSizeListener = v6.createElement(v15, {
            event = l_UserInputService_0:GetPropertyChangedSignal("StatusBarSize"),
            callback = v47.updateStatusBarHeight
        }),
        bottomBarSizeListener = not _G.__TESTEZ_RUNNING_TEST__ and v6.createElement(v15, {
            event = l_UserInputService_0:GetPropertyChangedSignal("BottomBarSize"),
            callback = v47.updateGlobalGuiInset
        }),
        rightBarSizeListener = not _G.__TESTEZ_RUNNING_TEST__ and v6.createElement(v15, {
            event = l_UserInputService_0:GetPropertyChangedSignal("RightBarSize"),
            callback = v47.updateGlobalGuiInset
        }),
        safeZoneOffsetsListener = not _G.__TESTEZ_RUNNING_TEST__ and v6.createElement(v15, {
            event = v47.props.guiService.SafeZoneOffsetsChanged,
            callback = v47.updateGlobalGuiInset
        }),
        VRUserCFrameListener = if not l_GetFFlagAdjustVRFloor_0() then nil else v6.createElement(v15, {
            event = l_VRService_0.UserCFrameChanged,
            callback = function(v48)
                if v48 == Enum.UserCFrame.Floor then
                    v47.pointCameraTo3DPanels();
                end;
            end
        })
    });
end;
v30.didMount = function(v49)
    if not v49.props.useBottomBar then
        v49.props.guiService:BroadcastNotification("", v10.HIDE_TAB_BAR);
    end;
    l_UserInputService_0.LegacyInputEventsEnabled = false;
    v49.updateViewport();
    v49.updateStatusBarHeight();
    v49.updateGlobalGuiInset();
    if v49.props.use3DPanels then
        v49.pointCameraTo3DPanels();
    end;
end;
v30.didUpdate = function(v50, v51)
    if v50.props.bottomBarVisible ~= v51.bottomBarVisible then
        v50.updateGlobalGuiInset();
    end;
    local l_globalGuiInset_0 = v50.props.globalGuiInset;
    if l_globalGuiInset_0 ~= v51.globalGuiInset then
        v50.props.guiService:SetGlobalGuiInset(l_globalGuiInset_0.left, l_globalGuiInset_0.top, l_globalGuiInset_0.right, l_globalGuiInset_0.bottom);
    end;
    local l_hasScreenGuiBlur_0 = v50.props.hasScreenGuiBlur;
    if l_hasScreenGuiBlur_0 ~= v51.hasScreenGuiBlur then
        v50.props.runService:SetRobloxGuiFocused(l_hasScreenGuiBlur_0);
    end;
    if not (not v50.props.use3DPanels or v51.use3DPanels) then
        v50.pointCameraTo3DPanels();
    end;
end;
return (l_RoactAppPolicy_0.connect(function(v54, _)
    return {
        useWidthBasedRule = v54.getUseWidthBasedFormFactorRule(),
        useBottomBar = v54.getUseBottomBar(),
        systemBarPlacement = v54.getSystemBarPlacement(),
        use3DPanels = v54.getUse3DPanels()
    };
end)((l_RoactServices_0.connect({
    guiService = l_AppGuiService_0,
    runService = l_AppRunService_0
})((v7.connect(function(v56)
    return {
        statusBarHeight = v56.TopBar.statusBarHeight,
        deviceOrientation = v56.DeviceOrientation,
        globalGuiInset = v56.GlobalGuiInset,
        globalContextMenuInset = v56.GlobalContextMenuInset,
        bottomBarVisible = v56.TabBarVisible,
        hasScreenGuiBlur = v56.ScreenGuiBlur.hasBlur
    };
end, function(v57)
    return {
        setScreenSize = function(v58)
            v57(v16(v58));
        end,
        setDeviceOrientation = function(v59)
            v57(v17(v59));
        end,
        setFormFactor = function(v60)
            v57(l_SetFormFactor_0(v60));
        end,
        setStatusBarHeight = function(v61)
            v57(v19(v61));
        end,
        setGlobalGuiInset = function(v62, v63, v64, v65)
            return v57(v20(v62, v63, v64, v65));
        end,
        setGlobalContextMenuInset = function(v66, v67, v68, v69)
            return v57(v22(v66, v67, v68, v69));
        end
    };
end)(v30))))));


local l_CorePackages_0 = game:GetService("CorePackages");
local l_SessionService_0 = game:GetService("SessionService");
local l_GuiService_0 = game:GetService("GuiService");
local l_script_FirstAncestor_0 = script:FindFirstAncestor("Modules");
local v4 = require(l_CorePackages_0.Packages.ApolloClient);
local v5 = require(l_CorePackages_0.Packages.Cryo);
local v6 = require(l_CorePackages_0.Packages.RoactAppExperiment);
local v7 = require(l_CorePackages_0.Packages.React);
local l_useDispatch_0 = require(l_CorePackages_0.Workspace.Packages.RoactUtils).Hooks.RoactRodux.useDispatch;
local _ = require(l_CorePackages_0.Workspace.Packages.RoactUtils).Hooks.RoactRodux.useSelector;
local l_useNavigation_0 = require(l_CorePackages_0.Workspace.Packages.RoactUtils).Hooks.useNavigation;
local l_useLocalization_0 = require(l_CorePackages_0.Workspace.Packages.Localization).Hooks.useLocalization;
local l_isSubjectToDesktopPolicies_0 = require(l_CorePackages_0.Workspace.Packages.SharedFlags).isSubjectToDesktopPolicies;
local l_UrlBuilder_0 = require(l_CorePackages_0.Packages.UrlBuilder).UrlBuilder;
local v14 = require(l_script_FirstAncestor_0.LuaApp.Thunks.OpenGameDetails);
local v15 = require(l_script_FirstAncestor_0.LuaApp.AppPage);
local l_default_0 = require(l_CorePackages_0.Workspace.Packages.ExternalContentSharingProtocol).ExternalContentSharingProtocol.default;
local l_SessionType_0 = require(l_CorePackages_0.Workspace.Packages.RobloxAppSessionization).SessionType;
local l_SetGamePlaySession_0 = require(l_CorePackages_0.Workspace.Packages.RobloxAppSessionization).SetGamePlaySession;
local v19 = require(l_CorePackages_0.Workspace.Packages.VirtualEvents);
local v20 = require(l_script_FirstAncestor_0.LuaApp.Enum.TransitionAnimation);
local v21 = require(script.Parent.LaunchGameOnMount);
local _ = v4.gql;
local l_useQuery_0 = v4.useQuery;
local l_useUserExperiment_0 = v6.useUserExperiment;
local l_useIXPService_0 = v6.useIXPService;
local l_getFFlagRemoveVirtualEventsExperiment_0 = require(l_CorePackages_0.Workspace.Packages.SharedFlags).getFFlagRemoveVirtualEventsExperiment;
local v27 = {
    referralSource = "link"
};
return function(v28)
    local v29 = v5.Dictionary.join(v27, v28);
    local v30 = l_useDispatch_0();
    local v31 = l_useNavigation_0();
    local v32, v33 = v7.useState(false);
    local v34 = v7.useRef(true);
    local l_l_GuiService_0_SafeZoneOffsets_0 = l_GuiService_0:GetSafeZoneOffsets();
    local v36 = l_useQuery_0(v19.requests.GET_VIRTUAL_EVENT, {
        variables = {
            virtualEventId = v29.virtualEventId
        }
    });
    local v37 = if not v36.data then nil else v36.data.virtualEvent;
    local v38 = if not not v37 and v37.universeId then tostring(v37.universeId) else nil;
    local v39 = not v37 and 0 or v37.experienceDetails.playing;
    local v40 = l_useLocalization_0({
        hostTitle = "Feature.GameDetails.Label.Developer"
    });
    local v41 = l_useIXPService_0();
    local v44 = if not l_getFFlagRemoveVirtualEventsExperiment_0() then l_useUserExperiment_0({
        "Ecosystems.EventsOnExperienceDetailsPage"
    }, function(v42)
        local v43 = v42["Ecosystems.EventsOnExperienceDetailsPage"];
        if not v43 then
            return nil;
        else
            return v43.virtualEventsMVPEnabled;
        end;
    end, false) else nil;
    local v45 = v7.useCallback(function()
        v31.goBack();
    end, {});
    local v46 = v7.useCallback(function()
        if v38 then
            v30(v14(v38));
        end;
    end, {
        v38
    });
    local v48 = v7.useCallback(function(v47)
        if l_default_0 then
            l_default_0:shareUrl({
                url = v47,
                context = "eventDetailsPage"
            });
        end;
    end, {});
    local _ = v7.useCallback(function(v49)
        if v38 then
            v19.fireVirtualEventLinkCopied({
                virtualEventId = v29.virtualEventId,
                virtualEventLink = v49,
                universeId = v38,
                attendanceCount = v39
            });
        end;
    end, {
        v29.virtualEventId,
        v38,
        v39
    });
    local v52 = v7.useCallback(function(v51)
        if v38 then
            v19.fireShareVirtualEventIconClicked({
                virtualEventId = v29.virtualEventId,
                universeId = v38,
                channel = "eventDetailsPage",
                attendanceCount = v39
            });
            if not l_isSubjectToDesktopPolicies_0() then
                v48((l_UrlBuilder_0.virtualevents.appsflyer({
                    eventId = v29.virtualEventId
                })));
            else
                v31.navigate(v15.ShareVirtualEventModal, {
                    extraProps = {
                        virtualEventId = v29.virtualEventId,
                        virtualEventLink = v51,
                        universeId = v38,
                        attendanceCount = v39
                    }
                });
                return ;
            end;
        end;
    end, {
        v29.virtualEventId,
        v38,
        v39
    });
    local v53 = v7.useCallback(function()
        v33(true);
    end, {});
    local v54 = v7.useCallback(function()
        l_SetGamePlaySession_0(l_SessionService_0, l_SessionType_0.StructuralIdentifier.GamePlayFromEventDetails, true);
        v19.fireVirtualEventJoined({
            virtualEventId = v37.id,
            universeId = tostring(v37.universeId),
            channel = "eventDetailsPage",
            attendanceCount = v39
        });
    end, {
        v37,
        v39
    });
    local v57 = v7.useCallback(function(v55, v56)
        v19.fireVirtualEventRSVP({
            virtualEventId = v37.id,
            universeId = tostring(v37.universeId),
            channel = "eventDetailsPage",
            status = v55,
            attendanceCount = v39
        });
        if v56 then
            if not l_getFFlagRemoveVirtualEventsExperiment_0() then
                v41:LogUserLayerExposure("Ecosystems.EventsOnExperienceDetailsPage");
                if v44 then
                    v31.navigate(v15.EventNotificationsModal, {
                        extraProps = {
                            virtualEvent = v37,
                            channel = "eventDetailsPage"
                        }
                    });
                end;
            else
                v31.navigate(v15.EventNotificationsModal, {
                    extraProps = {
                        virtualEvent = v37,
                        channel = "eventDetailsPage"
                    }
                });
                return ;
            end;
        end;
    end, {
        v37,
        v31,
        v39,
        v44,
        v41
    });
    v7.useEffect(function()
        if not (not v34.current or not v37) then
            v19.fireEventDetailsPageVisit({
                virtualEventId = v37.id,
                universeId = tostring(v37.universeId),
                channel = v29.referralSource
            });
            v34.current = false;
        end;
    end, {
        v37
    });
    return v7.createElement(v7.Fragment, nil, {
        GameLauncher = if not not v32 and v38 then v7.createElement(v21, {
            universeId = v38,
            launchSource = "eventDetailsPage",
            referralSource = v29.referralSource,
            onGameLaunching = v54
        }) else nil,
        Wrapper = v7.createElement("Frame", {
            Size = UDim2.fromScale(1, 1) - UDim2.fromOffset(0, l_l_GuiService_0_SafeZoneOffsets_0.top),
            Position = UDim2.fromOffset(0, l_l_GuiService_0_SafeZoneOffsets_0.top),
            BackgroundTransparency = 1
        }, {
            EventDetailsPageLoader = v7.createElement(v19.EventDetailsPageLoader, {
                virtualEventId = v29.virtualEventId,
                currentTime = DateTime.now(),
                onClose = v45,
                onShare = v52,
                onRsvpChanged = v57,
                onJoinEvent = v53,
                onExperienceTileActivated = v46,
                onHostActivated = v7.useCallback(function(v58)
                    v31.navigate(v15.GenericWebPage, {
                        detail = l_UrlBuilder_0.game.info.creator({
                            creatorType = v58.hostType == "group" and "Group" or "User",
                            creatorId = v58.hostId
                        }),
                        extraProps = {
                            title = v40.hostTitle,
                            transitionAnimation = v20.SlideInFromRight
                        }
                    });
                end, {
                    v31,
                    v40
                })
            })
        })
    });
end;


local l_CorePackages_0 = game:GetService("CorePackages");
local v1 = require(l_CorePackages_0.Packages.ApolloClient);
local _ = require(l_CorePackages_0.Workspace.Packages.GraphQLServer);
local v3 = require(l_CorePackages_0.Packages.React);
local v4 = require(l_CorePackages_0.Packages.Cryo);
local v5 = require(l_CorePackages_0.Workspace.Packages.VirtualEvents);
local l_useMutation_0 = v1.useMutation;
local l_EventNotificationsModal_0 = v5.EventNotificationsModal;
return function(v8)
    local v9 = l_useMutation_0(v5.requests.NEVER_SHOW_NOTIFICATIONS_MODAL_AGAIN);
    local v10 = l_useMutation_0(v5.requests.ENABLE_PUSH_NOTIFICATIONS);
    return v3.createElement(l_EventNotificationsModal_0, v4.Dictionary.join(v8, {
        onClose = v3.useCallback(function()
            v9[1]();
            if v8.onClose then
                v8.onClose();
            end;
        end, {
            v9,
            v8.onClose
        }),
        onConfirm = v3.useCallback(function()
            v10[1]();
            v5.fireEventNotificationEnabled({
                virtualEventId = v8.virtualEvent.id,
                universeId = v8.virtualEvent.universeId,
                channel = v8.channel
            });
            if v8.onConfirm then
                v8.onConfirm();
            end;
        end, {
            v10,
            v8.virtualEvent,
            v8.channel,
            v8.onConfirm
        })
    }));
end;


local l_CorePackages_0 = game:GetService("CorePackages");
local _ = game:GetService("GuiService");
local l_SessionService_0 = game:GetService("SessionService");
local v3 = require(script:FindFirstAncestor("Modules").LuaApp.AppPage);
local v4 = require(l_CorePackages_0.Packages.ApolloClient);
local v5 = require(l_CorePackages_0.Packages.Cryo);
local _ = require(l_CorePackages_0.Workspace.Packages.GraphQLServer);
local v7 = require(script.Parent.LaunchGameOnMount);
local v8 = require(l_CorePackages_0.Packages.React);
local l_SessionType_0 = require(l_CorePackages_0.Workspace.Packages.RobloxAppSessionization).SessionType;
local l_SetGamePlaySession_0 = require(l_CorePackages_0.Workspace.Packages.RobloxAppSessionization).SetGamePlaySession;
local l_useNavigation_0 = require(l_CorePackages_0.Workspace.Packages.RoactUtils).Hooks.useNavigation;
local v12 = require(l_CorePackages_0.Workspace.Packages.VirtualEvents);
local l_EventsList_0 = v12.EventsList;
local l_useQuery_0 = v4.useQuery;
local l_useMutation_0 = v4.useMutation;
local v16 = {
    pollInterval = 300000
};
return function(v17)
    local v18 = v5.Dictionary.join(v16, v17);
    local v19 = l_useNavigation_0();
    local _ = v8.useRef(true);
    local v21, v22 = v8.useState(nil);
    local v23 = v8.useMemo(function()
        return DateTime.now();
    end, {});
    local v24 = l_useQuery_0(v12.requests.GET_EVENTS_FOR_EXPERIENCE, {
        variables = {
            universeId = v18.universeId,
            options = {
                fromUtc = v23:ToIsoDate()
            }
        },
        pollInterval = v18.pollInterval
    });
    local v31 = l_useMutation_0(v12.requests.UPDATE_RSVP_STATUS, {
        update = function(_, v26, v27)
            local l_virtualEvent_0 = v27.data.virtualEventRsvp.virtualEvent;
            v26:modify({
                id = v26:identify(l_virtualEvent_0),
                fields = {
                    rsvpCounters = function(_, v30)
                        return v5.Dictionary.join(v30, {
                            going = v30.going + (l_virtualEvent_0.userRsvpStatus == "going" and 1 or -1)
                        });
                    end
                }
            });
        end
    });
    local v35 = v8.useCallback(function(v32, v33)
        v12.fireVirtualEventRSVP({
            virtualEventId = v32.id,
            universeId = tostring(v32.universeId),
            channel = v18.referralSource,
            status = v33,
            attendanceCount = if not not v32 and v32.experienceDetails then v32.experienceDetails.playing else 0
        });
        v31[1]({
            variables = {
                virtualEventId = v32.id,
                rsvpStatus = v33
            }
        }):andThen(function(v34)
            if v34.data.virtualEventRsvp.shouldSeeNotificationsUpsellModal then
                v19.navigate(v3.EventNotificationsModal, {
                    extraProps = {
                        virtualEvent = v32,
                        channel = v18.referralSource
                    }
                });
            end;
        end);
    end, {
        v18.referralSource
    });
    local v37 = v8.useCallback(function(v36)
        v19.navigate(v3.EventDetails, {
            extraProps = {
                currentTime = DateTime.now(),
                virtualEventId = v36.id,
                referralSource = v18.referralSource
            }
        });
    end, {
        v19
    });
    local v39 = v8.useCallback(function(v38)
        v12.fireVirtualEventImpression({
            virtualEventId = v38.id,
            universeId = v38.universeId,
            channel = v18.referralSource
        });
    end, {
        v18.referralSource
    });
    local v41 = v8.useCallback(function(v40)
        v22(v40);
    end, {});
    local v42 = v8.useCallback(function()
        l_SetGamePlaySession_0(l_SessionService_0, l_SessionType_0.StructuralIdentifier.GamePlayFromEventDetails, true);
        v12.fireVirtualEventJoined({
            virtualEventId = v21.id,
            universeId = tostring(v21.universeId),
            channel = v18.referralSource,
            attendanceCount = if not not v21 and v21.experienceDetails then v21.experienceDetails.playing else 0
        });
    end, {
        v21
    });
    if not v24.data then
        return nil;
    else
        return (v8.createElement(v8.Fragment, nil, {
            GameLauncher = if not v21 then nil else v8.createElement(v7, {
                universeId = tostring(v21.universeId),
                launchSource = v18.referralSource,
                referralSource = v18.referralSource,
                onGameLaunching = v42
            }),
            EventsList = v8.createElement(l_EventsList_0, {
                layoutOrder = v18.layoutOrder,
                virtualEvents = v24.data.virtualEventsByUniverseId.virtualEvents,
                referralSource = v18.referralSource,
                currentTime = v23,
                onTileActivated = v37,
                onRsvpChanged = v35,
                onJoinEvent = v41,
                onEventImpression = v39
            })
        }));
    end;
end;


local l_CorePackages_0 = game:GetService("CorePackages");
local l_script_FirstAncestor_0 = script:FindFirstAncestor("Modules");
local v2 = require(l_CorePackages_0.Packages.React);
local v3 = require(l_script_FirstAncestor_0.LuaApp.Common.Experience.Connectors.LaunchExperienceConnector);
local v4 = require(l_script_FirstAncestor_0.LuaApp.Enum.PlayButtonStates);
return v3.connect(function(v5)
    return {
        universeId = v5.universeId,
        launchSource = v5.launchSource,
        referralSource = v5.referralSource
    };
end, function(v6)
    return {
        playabilityStatus = v6.playabilityStatus,
        playButtonState = v6.playButtonState,
        onPlayButtonActivated = v6.onPlayButtonActivated
    };
end)(function(v7)
    v2.useEffect(function()
        if v7.playButtonState == v4.Playable then
            if v7.onGameLaunching then
                v7.onGameLaunching();
            end;
            v7.onPlayButtonActivated();
        end;
    end, {
        v7.playButtonState
    });
    return nil;
end);


local l_CorePackages_0 = game:GetService("CorePackages");
local l_Modules_0 = game:GetService("CoreGui").RobloxGui.Modules;
local v2 = require(l_CorePackages_0.Roact);
local v3 = require(l_Modules_0.Common.RoactRodux);
local v4 = v2.PureComponent:extend("VngComplianceLoadingPopup");
local l_LoadingSpinner_0 = require(l_CorePackages_0.UIBlox).App.Loading.LoadingSpinner;
v4.render = function(v6)
    return v2.createElement("Frame", {
        Size = UDim2.new(1, 0, 0, v6.props.screenSize.Y),
        BackgroundTransparency = 0,
        BorderSizePixel = 0
    }, {
        Layout = v2.createElement(l_LoadingSpinner_0, {
            anchorPoint = Vector2.new(0.5, 0.5),
            position = UDim2.new(0.5, 0, 0.5, 0)
        })
    });
end;
return (v3.connect(function(v7)
    return {
        screenSize = v7.ScreenSize
    };
end, function(_)
end)(v4));


local l_CorePackages_0 = game:GetService("CorePackages");
local l_Modules_0 = game:GetService("CoreGui").RobloxGui.Modules;
local v2 = require(l_CorePackages_0.Roact);
local v3 = require(l_CorePackages_0.Cryo);
local v4 = require(l_Modules_0.LuaApp.Components.GenericIconTextButton);
local l_Colors_0 = require(l_CorePackages_0.Workspace.Packages.Style).Colors;
local v6 = UDim2.new(0, 37, 0, 37);
local v7 = v2.PureComponent:extend("WeChatButton");
v7.render = function(v8)
    local l_props_0 = v8.props;
    return v2.createElement(v4, v3.Dictionary.join(l_props_0, {
        iconImage = "rbxasset://textures/ui/LuaApp/graphic/Auth/wechatlogo.png",
        iconSize = v6,
        leftIconEnabled = true,
        themeSettings = {
            Color = l_props_0.Color or l_Colors_0.Green,
            Transparency = l_props_0.Transparency or 0,
            OnPressTransparency = 0.5,
            DisabledTransparency = 0.5,
            DisabledColor = l_Colors_0.White,
            Text = {
                Color = l_Colors_0.White,
                Transparency = 0
            },
            Border = {
                Hidden = true,
                Transparency = 1
            }
        },
        iconRightPadding = 10
    }));
end;
return v7;


local l_CorePackages_0 = game:GetService("CorePackages");
local l_Modules_0 = game:GetService("CoreGui").RobloxGui.Modules;
local v2 = require(l_CorePackages_0.Packages.React);
local l_Object_0 = require(l_CorePackages_0.Packages.LuauPolyfill).Object;
local v4 = require(script.Parent.WebView);
local l_useEarlyIsFocused_0 = require(l_CorePackages_0.Workspace.Packages.RoactUtils).Hooks.useEarlyIsFocused;
local l_useNavigation_0 = require(l_CorePackages_0.Workspace.Packages.RoactUtils).Hooks.useNavigation;
local l_useLocalization_0 = require(l_CorePackages_0.Workspace.Packages.Localization).Hooks.useLocalization;
local v8 = require(l_Modules_0.LuaApp.Hooks.useRoactService);
local v9 = require(l_Modules_0.LuaApp.Services.AppWebView);
local v10 = require(l_Modules_0.LuaApp.mapTransitionAnimationToNativeString);
local function _(v11, v12)
    return v11 or l_useLocalization_0({
        titleKey = v12
    }).titleKey;
end;
local function v17(v14)
    local v15 = v2.useRef(v14);
    v2.useEffect(function()
        v15.current = v14;
    end, {
        v14
    });
    v2.useEffect(function()
        return function()
            local l_current_0 = v15.current;
            if l_current_0 ~= nil then
                l_current_0();
            end;
        end;
    end, {});
end;
return function(v18)
    local v19 = l_useEarlyIsFocused_0();
    local l_goBack_0 = l_useNavigation_0().goBack;
    local v21 = v8(v9);
    local v22 = v18.title or l_useLocalization_0({
        titleKey = v18.titleKey
    }).titleKey;
    local v23 = v10(v18.transitionAnimation);
    v17(v18.windowCloseCallback);
    if not v19 then
        return nil;
    else
        return (v2.createElement(v4, l_Object_0.assign({}, v18, {
            webViewProtocol = v21,
            title = v22,
            transitionAnimation = v23,
            windowCloseCallback = l_goBack_0
        })));
    end;
end;


local l_CorePackages_0 = game:GetService("CorePackages");
local l_Modules_0 = game:GetService("CoreGui").RobloxGui.Modules;
local v2 = require(l_CorePackages_0.Packages.React);
local v3 = require(l_CorePackages_0.Packages.tutils);
local l_usePrevious_0 = require(l_CorePackages_0.Workspace.Packages.RoactUtils).Hooks.usePrevious;
local v5 = require(l_Modules_0.LuaApp.Components.WebViewStub);
local _ = require(l_CorePackages_0.Workspace.Packages.WebViewProtocol);
local function _(v7, v8)
    if v3.deepEqual(v7, v8) then
        return nil;
    else
        return v7;
    end;
end;
local function _(v10)
    return {
        url = v10.url,
        title = v10.title,
        isVisible = v10.isVisible,
        windowType = v10.windowType,
        searchParams = v10.searchParams,
        transitionAnimation = v10.transitionAnimation
    };
end;
local function v16(v12, v13)
    local v14 = {};
    local l_url_0 = v12.url;
    v14.url = if v3.deepEqual(l_url_0, v13.url) then nil else l_url_0;
    l_url_0 = v12.title;
    v14.title = if v3.deepEqual(l_url_0, v13.title) then nil else l_url_0;
    l_url_0 = v12.isVisible;
    v14.isVisible = if v3.deepEqual(l_url_0, v13.isVisible) then nil else l_url_0;
    l_url_0 = v12.windowType;
    v14.windowType = if v3.deepEqual(l_url_0, v13.windowType) then nil else l_url_0;
    l_url_0 = v12.searchParams;
    v14.searchParams = if v3.deepEqual(l_url_0, v13.searchParams) then nil else l_url_0;
    l_url_0 = v12.transitionAnimation;
    v14.transitionAnimation = if v3.deepEqual(l_url_0, v13.transitionAnimation) then nil else l_url_0;
    return v14;
end;
local function v22(v17, v18)
    local l_webViewProtocol_0 = v17.webViewProtocol;
    local l_windowCloseCallback_0 = v17.windowCloseCallback;
    local l_javaScriptCallback_0 = v17.javaScriptCallback;
    v2.useEffect(function()
        if v18 then
            if l_windowCloseCallback_0 == nil then
                return ;
            else
                assert(l_windowCloseCallback_0);
                l_webViewProtocol_0:listenForWindowClose(l_windowCloseCallback_0);
                return function()
                    l_webViewProtocol_0:stopListeningForWindowClose();
                end;
            end;
        else
            return ;
        end;
    end, {
        v18,
        l_windowCloseCallback_0
    });
    v2.useEffect(function()
        if v18 then
            if l_javaScriptCallback_0 == nil then
                return ;
            else
                assert(l_javaScriptCallback_0);
                l_webViewProtocol_0:listenForJavaScript(l_javaScriptCallback_0);
                return function()
                    l_webViewProtocol_0:stopListeningForJavaScript();
                end;
            end;
        else
            return ;
        end;
    end, {
        v18,
        l_javaScriptCallback_0
    });
end;
local function v29(v23, v24)
    local l_webViewProtocol_1 = v23.webViewProtocol;
    local v26 = {
        url = v23.url,
        title = v23.title,
        isVisible = v23.isVisible,
        windowType = v23.windowType,
        searchParams = v23.searchParams,
        transitionAnimation = v23.transitionAnimation
    };
    local v27 = l_usePrevious_0(v26);
    local v28 = l_usePrevious_0(v24);
    v2.useEffect(function()
        if v24 then
            l_webViewProtocol_1:openWindow(v26);
            return function()
                l_webViewProtocol_1:closeWindow();
            end;
        else
            return ;
        end;
    end, {
        v24
    });
    v2.useEffect(function()
        if v24 then
            if v28 then
                assert(v27);
                l_webViewProtocol_1:mutateWindow((v16(v26, v27)));
                return ;
            else
                return ;
            end;
        else
            return ;
        end;
    end, {
        v26.url,
        v26.title,
        v26.isVisible,
        v26.windowType,
        v26.searchParams and v26.searchParams.searchType,
        v26.transitionAnimation
    });
end;
local function _(v30, v31)
    local l_webViewProtocol_2 = v30.webViewProtocol;
    v2.useEffect(function()
        return (l_webViewProtocol_2:request(function()
            v31(true);
        end));
    end, {});
end;
local function _(v34)
    local v35, v36 = v2.useState(false);
    v22(v34, v35);
    v29(v34, v35);
    local l_webViewProtocol_3 = v34.webViewProtocol;
    v2.useEffect(function()
        return (l_webViewProtocol_3:request(function()
            v36(true);
        end));
    end, {});
end;
return function(v39)
    local v40, v41 = v2.useState(false);
    v22(v39, v40);
    v29(v39, v40);
    local l_webViewProtocol_4 = v39.webViewProtocol;
    v2.useEffect(function()
        return (l_webViewProtocol_4:request(function()
            v41(true);
        end));
    end, {});
    v40 = v39.overlayProps or {};
    return v2.createElement(v5, {
        isVisible = v40.isVisible,
        DisplayOrder = v40.DisplayOrder
    });
end;