local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Rodux);
local l_join_0 = require(l_Parent_0.Packages.Cryo).Dictionary.join;
local _ = require(l_Parent_0.Src.Actions.PlaybackTab.SetShouldSetEmulationDevice);
local _ = require(l_Parent_0.Src.Actions.PlaybackTab.SetCurrentRecordingDurationSec);
local _ = require(l_Parent_0.Src.Actions.PlaybackTab.SetCurrentRecordingNumEvents);
local _ = require(l_Parent_0.Src.Actions.PlaybackTab.SetCurrentRecordingResolution);
local _ = require(l_Parent_0.Src.Actions.PlaybackTab.SetCurrentRecordingDeviceId);
local _ = require(l_Parent_0.Src.Actions.PlaybackTab.SetCurrentRecordingDeviceOrientation);
return v1.createReducer({
    selectedRecordingIndex = 1,
    playbackFileNameOptions = {},
    currentPlaybackRecordingDataValid = false,
    currentRecordingDurationSec = 0,
    currentRecordingNumEvents = 0,
    currentRecordingResolution = Vector2.new(),
    currentRecordingDeviceId = "Unknown",
    currentRecordingDeviceOrientation = "Unknown",
    shouldSetEmulationDevice = true
}, {
    SetCurrentRecordingDurationSec = function(v9, v10)
        return l_join_0(v9, {
            currentRecordingDurationSec = v10.currentRecordingDurationSec
        });
    end,
    SetCurrentRecordingNumEvents = function(v11, v12)
        return l_join_0(v11, {
            currentRecordingNumEvents = v12.currentRecordingNumEvents
        });
    end,
    SetCurrentRecordingResolution = function(v13, v14)
        return l_join_0(v13, {
            currentRecordingResolution = v14.currentRecordingResolution
        });
    end,
    SetCurrentRecordingDeviceId = function(v15, v16)
        return l_join_0(v15, {
            currentRecordingDeviceId = v16.currentRecordingDeviceId
        });
    end,
    SetCurrentRecordingDeviceOrientation = function(v17, v18)
        return l_join_0(v17, {
            currentRecordingDeviceOrientation = v18.currentRecordingDeviceOrientation
        });
    end,
    SetShouldSetEmulationDevice = function(v19, v20)
        return l_join_0(v19, {
            shouldSetEmulationDevice = v20.shouldSetEmulationDevice
        });
    end
});


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Rodux);
local l_join_0 = require(l_Parent_0.Packages.Cryo).Dictionary.join;
local _ = require(l_Parent_0.Src.Actions.RecordTab.SetScreenSize);
local _ = require(l_Parent_0.Src.Actions.RecordTab.SetEmulationDeviceId);
local _ = require(l_Parent_0.Src.Actions.RecordTab.SetEmulationDeviceOrientation);
return v1.createReducer({
    screenSize = Vector2.new(),
    emulationDeviceId = "Unknown",
    emulationDeviceOrientation = "Unknown"
}, {
    SetScreenSize = function(v6, v7)
        return l_join_0(v6, {
            screenSize = v7.screenSize
        });
    end,
    SetEmulationDeviceId = function(v8, v9)
        return l_join_0(v8, {
            emulationDeviceId = v9.emulationDeviceId
        });
    end,
    SetEmulationDeviceOrientation = function(v10, v11)
        return l_join_0(v10, {
            emulationDeviceOrientation = v11.orientation
        });
    end
});


local v0 = require(script.Parent.Parent.Parent.Packages.Framework);
local l_getRawComponentStyle_0 = v0.Style.getRawComponentStyle;
local l_Style_0 = v0.Style;
local l_StudioTheme_0 = l_Style_0.Themes.StudioTheme;
local l_ComponentSymbols_0 = l_Style_0.ComponentSymbols;
local l_StyleKey_0 = l_Style_0.StyleKey;
local l_Util_0 = v0.Util;
local l_Cryo_0 = l_Util_0.Cryo;
local l_StyleModifier_0 = l_Util_0.StyleModifier;
local l_deepCopy_0 = l_Util_0.deepCopy;
local l_DarkTheme_0 = l_Style_0.Themes.DarkTheme;
local l_LightTheme_0 = l_Style_0.Themes.LightTheme;
local v12 = l_Cryo_0.Dictionary.join(l_DarkTheme_0, {
    [l_StyleKey_0.SelectedTabColor] = Color3.fromRGB(64, 64, 64),
    [l_StyleKey_0.UIGroupColor] = Color3.fromRGB(77, 77, 77)
});
local v13 = l_Cryo_0.Dictionary.join(l_LightTheme_0, {
    [l_StyleKey_0.SelectedTabColor] = Color3.fromRGB(253, 253, 253),
    [l_StyleKey_0.UIGroupColor] = Color3.fromRGB(246, 247, 248)
});
local function v16()
    for _, v15 in ipairs({
        "SelectedTabColor",
        "UIGroupColor"
    }) do
        l_StyleKey_0[v15] = v13[l_StyleKey_0[v15]];
    end;
end;
l_ComponentSymbols_0:add("TabbedView");
l_ComponentSymbols_0:add("PlaybackTabView");
l_ComponentSymbols_0:add("FileSelectorUIGroup");
l_ComponentSymbols_0:add("PlaybackInfoUIGroup");
l_ComponentSymbols_0:add("FilterSettingsUIGroup");
l_ComponentSymbols_0:add("LabeledToggleButton");
l_ComponentSymbols_0:add("UIKeyValueTextLabel");
l_ComponentSymbols_0:add("ChooseRecordingNamePopUp");
l_ComponentSymbols_0:add("InputVisualizer");
l_ComponentSymbols_0:add("KeyBarTile");
local v17 = l_getRawComponentStyle_0("Button");
local v18 = v17["&RoundPrimary"];
local v19 = l_getRawComponentStyle_0("TextLabel");
local v20 = l_getRawComponentStyle_0("RoundBox");
local v21 = l_getRawComponentStyle_0("SelectInput");
local v22 = l_getRawComponentStyle_0("Pane");
local v23 = l_deepCopy_0(v20);
local function v24()
    return {
        PrimaryButtonSize = UDim2.new(0, 160, 0, 32),
        UIGroupWidthPx = 340,
        PaddingPx = 10,
        [l_ComponentSymbols_0.Button] = l_Cryo_0.Dictionary.join(v17, {
            ["&RoundPrimaryRecordButton"] = l_Cryo_0.Dictionary.join(v18, {
                [l_StyleModifier_0.Selected] = {
                    BackgroundStyle = l_Cryo_0.Dictionary.join(v23, {
                        Color = Color3.fromRGB(255, 211, 16)
                    }),
                    TextColor = Color3.fromRGB(0, 0, 0)
                },
                [l_StyleModifier_0.Pressed] = {
                    BackgroundStyle = l_Cryo_0.Dictionary.join(v23, {
                        Color = Color3.fromRGB(255, 25, 25)
                    }),
                    TextColor = Color3.fromRGB(255, 255, 255)
                }
            }),
            ["&RoundPrimaryPlayButton"] = l_Cryo_0.Dictionary.join(v18, {
                [l_StyleModifier_0.Selected] = {
                    BackgroundStyle = l_Cryo_0.Dictionary.join(v23, {
                        Color = Color3.fromRGB(255, 211, 16)
                    }),
                    TextColor = Color3.fromRGB(0, 0, 0)
                },
                [l_StyleModifier_0.Pressed] = {
                    BackgroundStyle = l_Cryo_0.Dictionary.join(v23, {
                        Color = Color3.fromRGB(0, 219, 26)
                    }),
                    TextColor = Color3.fromRGB(255, 255, 255)
                }
            })
        }),
        [l_ComponentSymbols_0.Pane] = l_Cryo_0.Dictionary.join(v22, {
            ["&CornerBox"] = {
                CornerRadius = UDim.new(0, 8),
                Background = l_StyleKey_0.UIGroupColor
            },
            ["&KeyTileBox"] = {
                CornerRadius = UDim.new(0, 8),
                Background = Color3.new(0, 0, 0)
            }
        }),
        [l_ComponentSymbols_0.TabbedView] = {
            TabBarHeightPx = 30,
            ForegroundTabColor = l_StyleKey_0.SelectedTabColor,
            TabBarBackgroundColor = l_StyleKey_0.SubBackground
        },
        [l_ComponentSymbols_0.PlaybackTabView] = {
            PaddingPx = 10
        },
        [l_ComponentSymbols_0.FileSelectorUIGroup] = {
            PaddingPx = 10
        },
        [l_ComponentSymbols_0.TextLabel] = l_Cryo_0.Dictionary.join(v19, {
            ["&StatusTextLabel"] = {
                TextSize = 16,
                TextColor = l_StyleKey_0.MainText,
                TextWrapped = true
            }
        }),
        [l_ComponentSymbols_0.LabeledToggleButton] = {
            ComponentSize = UDim2.new(0, 150, 0, 30),
            ToggleSize = UDim2.fromOffset(40, 24),
            LeftInsetPx = 12,
            PaddingPx = 10
        },
        [l_ComponentSymbols_0.UIKeyValueTextLabel] = {
            PaddingPx = 10,
            HeightPx = 25,
            KeyWidthPx = 150
        },
        [l_ComponentSymbols_0.FileSelectorUIGroup] = {
            PaddingPx = 10,
            ProgressBarWidth = 250
        },
        [l_ComponentSymbols_0.FilterSettingsUIGroup] = {
            GridAreaHeightPx = 100,
            PaddingPx = 10,
            GridLayoutCellSize = UDim2.fromOffset(150, 30),
            GridCellPaddingYPx = 2
        },
        [l_ComponentSymbols_0.PlaybackInfoUIGroup] = {
            PaddingPx = 10
        },
        PlaybackSelectInput = l_Cryo_0.Dictionary.join(v21, {
            Size = UDim2.new(0, 240, 0, 32)
        }),
        [l_ComponentSymbols_0.ChooseRecordingNamePopUp] = {
            ContentSize = Vector2.new(300, 60),
            PanelSize = UDim2.fromOffset(250, 60),
            PanelPosition = UDim2.fromOffset(20, -10),
            DialogMessageSize = UDim2.new(1, 0, 0, 40),
            TextInputSize = UDim2.fromOffset(250, 30),
            PaddingPx = 1
        },
        [l_ComponentSymbols_0.InputVisualizer] = {
            KeyBarRowSpacingPx = 2,
            KeyBarSize = UDim2.fromOffset(200, 100)
        },
        [l_ComponentSymbols_0.KeyBarTile] = {
            TextColor = Color3.new(1, 1, 1),
            BackgroundColor = Color3.new(0, 0, 0)
        }
    };
end;
return function(v25)
    local v26 = nil;
    if not v25 then
        v26 = l_StudioTheme_0.new(v12, v13);
    else
        v16();
        v26 = l_StudioTheme_0.mock(v12, v13);
    end;
    return v26:extend((v24()));
end;


local l_Parent_0 = script.Parent.Parent.Parent;
local _ = require(l_Parent_0.Src.Types);
local v2 = require(l_Parent_0.Src.Util.Constants);
local l_StudioDeviceEmulatorService_0 = game:GetService("StudioDeviceEmulatorService");
local l_ReplicatedStorage_0 = game:GetService("ReplicatedStorage");
local l_HttpService_0 = game:GetService("HttpService");
local v6 = {};
local v7 = {
    PluginEnabled = "PluginEnabled",
    RequestDevicePropertiesUpdate = "RequestDevicePropertiesUpdate",
    ConnectToStudioDeviceEmulatorServiceEvents = "ConnectToStudioDeviceEmulatorServiceEvents",
    DisconnectStudioDeviceEmulatorServiceEvents = "DisconnectStudioDeviceEmulatorServiceEvents",
    EmulationDeviceIdChanged = "EmulationDeviceIdChanged",
    EmulationDeviceOrientationChanged = "EmulationDeviceOrientationChanged",
    ViewportResolutionChanged = "ViewportResolutionChanged",
    IsPlayMode = "IsPlayMode",
    StartRecordingButtonClicked = "StartRecordingButtonClicked",
    StopRecordingButtonClicked = "StopRecordingButtonClicked",
    StartPlaybackButtonClicked = "StartPlaybackButtonClicked",
    StopPlaybackButtonClicked = "StopPlaybackButtonClicked",
    SetPluginState = "SetPluginState",
    RoduxState = "RoduxState",
    SaveRecordingDataToDM = "SaveRecordingDataToDM",
    OpenSaveRecordingDialog = "OpenSaveRecordingDialog",
    SetSavedRecordingName = "SetSavedRecordingName",
    SearchForUserInputRecordings = "SearchForUserInputRecordings",
    SetPlayableRecordings = "SetPlayableRecordings",
    LoadRecordingWithName = "LoadRecordingWithName",
    CurrentPlaybackRecordingDataStr = "CurrentPlaybackRecordingDataStr",
    CurrentPlaybackRecordingDataObj = "CurrentPlaybackRecordingDataObj",
    PlaybackInfoChanged = "PlaybackInfoChanged"
};
local v8 = nil;
v6.setPluginObject = function(v9)
    assert(v9, "Plugin object must exist");
    v8 = v9;
end;
local v10 = nil;
v6.setLocalizationObject = function(v11)
    assert(v11, "Localization object must exist");
    v10 = v11;
end;
v6.setIsPlayMode = function(v12)
    v8:SetItem(v7.IsPlayMode, v12);
end;
v6.getIsPlayMode = function()
    return v8:GetItem(v7.IsPlayMode, false);
end;
v6.setPluginEnabled = function(v13)
    v8:SetItem(v7.PluginEnabled, v13);
end;
v6.getPluginEnabled = function()
    return v8:GetItem(v7.PluginEnabled, false);
end;
v6.setRoduxState = function(v14)
    v8:SetItem(v7.RoduxState, v14);
end;
v6.getRoduxState = function()
    return v8:GetItem(v7.RoduxState, nil);
end;
v6.setPluginState = function(v15)
    v8:Invoke(v7.SetPluginState, v15);
end;
v6.getPluginState = function()
    local v16 = v6.getRoduxState();
    if v16 == nil then
        return nil;
    else
        return v16.common.pluginState;
    end;
end;
v6.setPluginStateRoduxActionHandler = function(v17)
    v8:OnInvoke(v7.SetPluginState, v17);
end;
v6.saveRecordingDataToDM = function(v18)
    v8:Invoke(v7.SaveRecordingDataToDM, v18);
end;
local function _()
    local l_l_ReplicatedStorage_0_FirstChild_0 = l_ReplicatedStorage_0:FindFirstChild("User Input Recordings");
    if l_l_ReplicatedStorage_0_FirstChild_0 == nil then
        l_l_ReplicatedStorage_0_FirstChild_0 = Instance.new("Folder");
        l_l_ReplicatedStorage_0_FirstChild_0.Name = v2.RecordingsFolderName;
        l_l_ReplicatedStorage_0_FirstChild_0.Parent = l_ReplicatedStorage_0;
    end;
    assert(l_l_ReplicatedStorage_0_FirstChild_0);
    assert(l_l_ReplicatedStorage_0_FirstChild_0:IsA("Folder"), "ReplicatedStorage.User Input Recordings must be a folder");
    return l_l_ReplicatedStorage_0_FirstChild_0;
end;
local v21 = nil;
local function v27(v22)
    assert(v8.HostDataModelType == Enum.StudioDataModelType.Edit);
    assert(v22, "Must have recording data");
    local v23 = l_HttpService_0:JSONEncode(v22);
    v8:Invoke(v7.OpenSaveRecordingDialog, "EnterNameForRecordingMessage", {
        (string.len(v23))
    });
    local v24 = coroutine.yield();
    if v24 then
        local l_StringValue_0 = Instance.new("StringValue");
        l_StringValue_0.Value = v23;
        l_StringValue_0.Name = tostring(os.date("%x %X"));
        local l_l_ReplicatedStorage_0_FirstChild_1 = l_ReplicatedStorage_0:FindFirstChild("User Input Recordings");
        if l_l_ReplicatedStorage_0_FirstChild_1 == nil then
            l_l_ReplicatedStorage_0_FirstChild_1 = Instance.new("Folder");
            l_l_ReplicatedStorage_0_FirstChild_1.Name = v2.RecordingsFolderName;
            l_l_ReplicatedStorage_0_FirstChild_1.Parent = l_ReplicatedStorage_0;
        end;
        assert(l_l_ReplicatedStorage_0_FirstChild_1);
        assert(l_l_ReplicatedStorage_0_FirstChild_1:IsA("Folder"), "ReplicatedStorage.User Input Recordings must be a folder");
        l_StringValue_0.Parent = l_l_ReplicatedStorage_0_FirstChild_1;
        if string.len(v24) > 0 then
            l_StringValue_0.Name = v24;
        end;
    end;
end;
v6.onSaveRecordingDialogCancel = function()
    v8:Invoke(v7.SetSavedRecordingName, nil);
end;
v6.onSaveRecordingDialogSave = function(v28)
    v8:Invoke(v7.SetSavedRecordingName, v28);
end;
local function v37(v29)
    local l_l_ReplicatedStorage_0_FirstChild_2 = l_ReplicatedStorage_0:FindFirstChild("User Input Recordings");
    if l_l_ReplicatedStorage_0_FirstChild_2 == nil then
        l_l_ReplicatedStorage_0_FirstChild_2 = Instance.new("Folder");
        l_l_ReplicatedStorage_0_FirstChild_2.Name = v2.RecordingsFolderName;
        l_l_ReplicatedStorage_0_FirstChild_2.Parent = l_ReplicatedStorage_0;
    end;
    assert(l_l_ReplicatedStorage_0_FirstChild_2);
    assert(l_l_ReplicatedStorage_0_FirstChild_2:IsA("Folder"), "ReplicatedStorage.User Input Recordings must be a folder");
    l_l_ReplicatedStorage_0_FirstChild_2 = l_l_ReplicatedStorage_0_FirstChild_2:FindFirstChild(v29, false);
    if not l_l_ReplicatedStorage_0_FirstChild_2 then
        error(v10:getText("AssetDM", "CouldNotFindRecordingMessage", {
            name = v29
        }));
    end;
    assert(l_l_ReplicatedStorage_0_FirstChild_2:IsA("StringValue"));
    local l_Value_0 = l_l_ReplicatedStorage_0_FirstChild_2.Value;
    assert(l_Value_0);
    v8:Invoke(v7.PlaybackInfoChanged, nil, 0, 0);
    v8:SetItem(v7.CurrentPlaybackRecordingDataObj, nil);
    v8:SetItem(v7.CurrentPlaybackRecordingDataStr, nil);
    local v32 = l_HttpService_0:JSONDecode(l_Value_0);
    local l_additionalMetadata_0 = v32.additionalMetadata;
    assert(l_additionalMetadata_0, "metaData key not found");
    local l_resolution_0 = l_additionalMetadata_0.resolution;
    assert(l_resolution_0, "resolution key not found");
    assert(#l_resolution_0 == 2, "resolution key invalid");
    assert(l_additionalMetadata_0.deviceId, "deviceId key not found");
    assert(l_additionalMetadata_0.orientation, "orientation key not found");
    local l_events_0 = v32.events;
    assert(l_events_0, "events not found");
    local l_duration_0 = v32.duration;
    assert(l_duration_0, "duration not found");
    assert(l_duration_0 >= 0, "recording duration cannot be negative");
    v8:Invoke(v7.PlaybackInfoChanged, l_additionalMetadata_0, l_duration_0 / 1000, #l_events_0);
    v8:SetItem(v7.CurrentPlaybackRecordingDataObj, v32);
    v8:SetItem(v7.CurrentPlaybackRecordingDataStr, l_Value_0);
end;
local function v42()
    local v38 = {};
    local l_l_ReplicatedStorage_0_FirstChild_3 = l_ReplicatedStorage_0:FindFirstChild("User Input Recordings");
    if l_l_ReplicatedStorage_0_FirstChild_3 == nil then
        l_l_ReplicatedStorage_0_FirstChild_3 = Instance.new("Folder");
        l_l_ReplicatedStorage_0_FirstChild_3.Name = v2.RecordingsFolderName;
        l_l_ReplicatedStorage_0_FirstChild_3.Parent = l_ReplicatedStorage_0;
    end;
    assert(l_l_ReplicatedStorage_0_FirstChild_3);
    assert(l_l_ReplicatedStorage_0_FirstChild_3:IsA("Folder"), "ReplicatedStorage.User Input Recordings must be a folder");
    for _, v41 in ipairs((l_l_ReplicatedStorage_0_FirstChild_3:GetChildren())) do
        if v41:IsA("StringValue") then
            table.insert(v38, v41.Name);
        end;
    end;
    v8:Invoke(v7.SetPlayableRecordings, v38);
end;
local v43 = {};
local function v44()
    if l_StudioDeviceEmulatorService_0 then
        table.insert(v43, l_StudioDeviceEmulatorService_0.CurrentDeviceIdChanged:Connect(function()
            v8:Invoke(v7.EmulationDeviceIdChanged, l_StudioDeviceEmulatorService_0:GetCurrentDeviceId());
        end));
        table.insert(v43, l_StudioDeviceEmulatorService_0.OrientationChanged:Connect(function()
            v8:Invoke(v7.EmulationDeviceOrientationChanged, l_StudioDeviceEmulatorService_0:GetCurrentOrientation().Name);
        end));
    end;
    table.insert(v43, workspace.CurrentCamera:GetPropertyChangedSignal("ViewportSize"):Connect(function()
        v8:Invoke(v7.ViewportResolutionChanged, workspace.CurrentCamera.ViewportSize);
    end));
end;
local function v47()
    for _, v46 in ipairs(v43) do
        v46:Disconnect();
    end;
    v43 = {};
end;
local v48 = false;
v6.setupEditDMEventListeners = function()
    assert(not v48, "Should only setup once per DM");
    v48 = true;
    v8:OnInvoke(v7.RequestDevicePropertiesUpdate, function()
        if l_StudioDeviceEmulatorService_0 then
            v8:Invoke(v7.EmulationDeviceIdChanged, l_StudioDeviceEmulatorService_0:GetCurrentDeviceId());
            v8:Invoke(v7.EmulationDeviceOrientationChanged, l_StudioDeviceEmulatorService_0:GetCurrentOrientation().Name);
            v8:Invoke(v7.ViewportResolutionChanged, workspace.CurrentCamera.ViewportSize);
        end;
    end);
    v8:OnInvoke(v7.ConnectToStudioDeviceEmulatorServiceEvents, v44);
    v8:OnInvoke(v7.DisconnectStudioDeviceEmulatorServiceEvents, v47);
    v8:OnInvoke(v7.SaveRecordingDataToDM, function(v49)
        v21 = coroutine.create(v27);
        coroutine.resume(v21, v49);
    end);
    v8:OnInvoke(v7.SetSavedRecordingName, function(v50)
        coroutine.resume(v21, v50);
    end);
    v8:OnInvoke(v7.SearchForUserInputRecordings, v42);
    v8:OnInvoke(v7.LoadRecordingWithName, v37);
end;
local v51 = false;
v6.setupPlayClientDMEventListeners = function()
    assert(not v51, "Should only setup once per DM");
    v51 = true;
    v8:OnInvoke(v7.ConnectToStudioDeviceEmulatorServiceEvents, v44);
    v8:OnInvoke(v7.DisconnectStudioDeviceEmulatorServiceEvents, v47);
end;
v6.connectToStartRecordButtonClicked = function(v52)
    v8:OnInvoke(v7.StartRecordingButtonClicked, v52);
end;
v6.onStartRecordingButtonClicked = function()
    v8:Invoke(v7.StartRecordingButtonClicked);
end;
v6.connectToStopRecordButtonClicked = function(v53)
    v8:OnInvoke(v7.StopRecordingButtonClicked, v53);
end;
v6.onStopRecordingButtonClicked = function()
    v8:Invoke(v7.StopRecordingButtonClicked);
end;
v6.connectToStartPlaybackButtonClicked = function(v54)
    v8:OnInvoke(v7.StartPlaybackButtonClicked, v54);
end;
v6.onStartPlaybackButtonClicked = function()
    v8:Invoke(v7.StartPlaybackButtonClicked);
end;
v6.connectToStopPlaybackButtonClicked = function(v55)
    v8:OnInvoke(v7.StopPlaybackButtonClicked, v55);
end;
v6.onStopPlaybackButtonClicked = function()
    v8:Invoke(v7.StopPlaybackButtonClicked);
end;
v6.onPlayClientSessionStarted = function()
    v44();
    v8:Invoke(v7.RequestDevicePropertiesUpdate);
end;
v6.getCurrentPlaybackRecordingDataStr = function()
    return v8:GetItem(v7.CurrentPlaybackRecordingDataStr, nil);
end;
v6.getCurrentPlaybackRecordingDataObj = function()
    return v8:GetItem(v7.CurrentPlaybackRecordingDataObj, nil);
end;
local v56 = {};
v6.connectRecordTabEventListenersWithActions = function(v57)
    table.insert(v56, (v8:OnInvoke(v7.EmulationDeviceIdChanged, function(v58)
        v57.SetEmulationDeviceId(v58);
    end)));
    table.insert(v56, (v8:OnInvoke(v7.EmulationDeviceOrientationChanged, function(v59)
        v57.SetEmulationDeviceOrientation((tostring(v59)));
    end)));
    table.insert(v56, (v8:OnInvoke(v7.ViewportResolutionChanged, function(v60)
        v57.SetCurrentScreenSize(v60);
    end)));
    table.insert(v56, (v8:OnInvoke(v7.OpenSaveRecordingDialog, function(v61, v62)
        v57.SetSaveRecordingDialogVisible(v61, v62);
    end)));
end;
v6.disconnectRecordTabEventListeners = function()
    for _, v64 in ipairs(v56) do
        v64:Disconnect();
    end;
    v56 = {};
end;
v6.onRecordTabShown = function()
    v8:Invoke(v7.RequestDevicePropertiesUpdate);
    v8:Invoke(v7.ConnectToStudioDeviceEmulatorServiceEvents);
end;
v6.onRecordTabHidden = function()
    v8:Invoke(v7.DisconnectStudioDeviceEmulatorServiceEvents);
end;
local v65 = nil;
v6.disconnectSetPlayableRecordingsCallback = function()
    if v65 then
        v65:Disconnect();
        v65 = nil;
    end;
end;
v6.connectSetPlayableRecordingsCallback = function(v66)
    v6.disconnectSetPlayableRecordingsCallback();
    v65 = v8:OnInvoke(v7.SetPlayableRecordings, v66);
end;
v6.searchForUserInputRecordings = function()
    v8:Invoke(v7.SearchForUserInputRecordings);
end;
v6.loadRecordingWithName = function(v67)
    v8:Invoke(v7.LoadRecordingWithName, v67);
end;
local v68 = nil;
v6.connectPlaybackInfoChangedCallback = function(v69)
    v68 = v8:OnInvoke(v7.PlaybackInfoChanged, v69);
end;
v6.disconnectPlaybackInfoChangedCallback = function()
    if v68 then
        v68:Disconnect();
        v68 = nil;
    end;
end;
return v6;


local l_Workspace_0 = game:GetService("Workspace");
local l_UserInputPlaybackPluginDeferPackageLoading_0 = game:GetFastFlag("UserInputPlaybackPluginDeferPackageLoading");
local l_status_0, l_result_0 = pcall(function()
    return game:GetService("StudioService"):HasInternalPermission();
end);
local function _(v4, v5)
    v5 = v5 or false;
    return function()
        local l_UserInputPlaybackFlags_0 = l_Workspace_0:FindFirstChild("UserInputPlaybackFlags");
        if l_UserInputPlaybackFlags_0 and l_UserInputPlaybackFlags_0:FindFirstChild(v4) then
            return l_UserInputPlaybackFlags_0[v4].Value;
        else
            return v5;
        end;
    end;
end;
local v8 = {};
local v9 = nil or false;
local v10 = "RunningUnderCLI";
local l_v10_0 = v10 --[[ copy: 8 -> 9 ]];
local v12;
do
    local l_v9_0 = v9;
    v12 = function()
        local l_UserInputPlaybackFlags_1 = l_Workspace_0:FindFirstChild("UserInputPlaybackFlags");
        if l_UserInputPlaybackFlags_1 and l_UserInputPlaybackFlags_1:FindFirstChild(l_v10_0) then
            return l_UserInputPlaybackFlags_1[l_v10_0].Value;
        else
            return l_v9_0;
        end;
    end;
end;
v8.RunningUnderCLI = v12;
v9 = false or false;
v10 = "RunTests";
local l_v10_1 = v10 --[[ copy: 8 -> 10 ]];
do
    local l_v9_1 = v9;
    v12 = function()
        local l_UserInputPlaybackFlags_2 = l_Workspace_0:FindFirstChild("UserInputPlaybackFlags");
        if l_UserInputPlaybackFlags_2 and l_UserInputPlaybackFlags_2:FindFirstChild(l_v10_1) then
            return l_UserInputPlaybackFlags_2[l_v10_1].Value;
        else
            return l_v9_1;
        end;
    end;
end;
v8.RunTests = v12;
v9 = nil or false;
v10 = "LogTestsQuiet";
local l_v10_2 = v10 --[[ copy: 8 -> 11 ]];
do
    local l_v9_2 = v9;
    v12 = function()
        local l_UserInputPlaybackFlags_3 = l_Workspace_0:FindFirstChild("UserInputPlaybackFlags");
        if l_UserInputPlaybackFlags_3 and l_UserInputPlaybackFlags_3:FindFirstChild(l_v10_2) then
            return l_UserInputPlaybackFlags_3[l_v10_2].Value;
        else
            return l_v9_2;
        end;
    end;
end;
v8.LogTestsQuiet = v12;
v9 = nil or false;
v10 = "LogAnalytics";
local l_v10_3 = v10 --[[ copy: 8 -> 12 ]];
do
    local l_v9_3 = v9;
    v12 = function()
        local l_UserInputPlaybackFlags_4 = l_Workspace_0:FindFirstChild("UserInputPlaybackFlags");
        if l_UserInputPlaybackFlags_4 and l_UserInputPlaybackFlags_4:FindFirstChild(l_v10_3) then
            return l_UserInputPlaybackFlags_4[l_v10_3].Value;
        else
            return l_v9_3;
        end;
    end;
end;
v8.LogAnalytics = v12;
v9 = nil or false;
v10 = "RunDeveloperFrameworkTests";
local l_v10_4 = v10 --[[ copy: 8 -> 13 ]];
do
    local l_v9_4 = v9;
    v12 = function()
        local l_UserInputPlaybackFlags_5 = l_Workspace_0:FindFirstChild("UserInputPlaybackFlags");
        if l_UserInputPlaybackFlags_5 and l_UserInputPlaybackFlags_5:FindFirstChild(l_v10_4) then
            return l_UserInputPlaybackFlags_5[l_v10_4].Value;
        else
            return l_v9_4;
        end;
    end;
end;
v8.RunDeveloperFrameworkTests = v12;
v9 = if not l_UserInputPlaybackPluginDeferPackageLoading_0 then l_status_0 and l_result_0 else nil or false;
v10 = "EnableRoactConfigs";
local l_v10_5 = v10 --[[ copy: 8 -> 14 ]];
do
    local l_v9_5 = v9;
    v12 = function()
        local l_UserInputPlaybackFlags_6 = l_Workspace_0:FindFirstChild("UserInputPlaybackFlags");
        if l_UserInputPlaybackFlags_6 and l_UserInputPlaybackFlags_6:FindFirstChild(l_v10_5) then
            return l_UserInputPlaybackFlags_6[l_v10_5].Value;
        else
            return l_v9_5;
        end;
    end;
end;
v8.EnableRoactConfigs = v12;
if l_UserInputPlaybackPluginDeferPackageLoading_0 then
    v9 = nil or false;
    v10 = "EnableDeveloperTools";
    do
        local l_v9_6 = v9;
        v12 = function()
            local l_UserInputPlaybackFlags_7 = l_Workspace_0:FindFirstChild("UserInputPlaybackFlags");
            if l_UserInputPlaybackFlags_7 and l_UserInputPlaybackFlags_7:FindFirstChild(v10) then
                return l_UserInputPlaybackFlags_7[v10].Value;
            else
                return l_v9_6;
            end;
        end;
    end;
    v8.EnableDeveloperTools = v12;
end;
return v8;


local _ = require(script.Parent.Parent.Parent.Src.Types);
return {
    PluginState = {
        Default = "Default",
        Recording = "Recording",
        Playing = "Playing",
        Disabled = "Disabled",
        ShouldStartPlayback = "ShouldStartPlayback",
        ShouldStartRecording = "ShouldStartRecording"
    }
};


return {
    formatDeviceOrientation = function(v0, v1, v2)
        if v1 == "default" then
            return v2:getText("RecordTabView", "ComputerEmulationDeviceOrientation");
        else
            return v0;
        end;
    end,
    formatDeviceName = function(v3, v4)
        if v3 == "default" then
            return v4:getText("RecordTabView", "ComputerEmulationDeviceName");
        else
            return v3;
        end;
    end,
    format2dResolution = function(v5, v6)
        return string.format("%d x %d %s", math.round(v5.X), math.round(v5.Y), v6);
    end
};


if plugin then
    local l_Common_0 = script.Parent.Parent.Common;
    require(l_Common_0.defineLuaFlags);
    local l_status_0, l_result_0 = pcall(function()
        return game:GetService("StudioService"):HasInternalPermission();
    end);
    if l_status_0 and l_result_0 then
        require(l_Common_0.commonInit)();
        local l_Parent_0 = script.Parent.Parent;
        local v4 = require(l_Parent_0.Packages.Roact);
        local v5 = require(l_Parent_0.Packages.Framework);
        local v6 = require(l_Parent_0.Src.MainPlugin);
        local v7 = require(l_Parent_0.Src.Util.DMBridge);
        local v8 = nil;
        local v9 = nil;
        local function v10()
            plugin.Name = l_Parent_0.Name;
            v7.setPluginObject(plugin);
            v8 = v4.mount((v4.createElement(v6, {
                Plugin = plugin
            })));
            if l_result_0 then
                v9 = v5.DeveloperTools.forStandalonePlugin(l_Parent_0.Name, plugin, {
                    rootInstance = v8,
                    rootPrefix = {
                        "UserInputPlaybackGui"
                    }
                });
            end;
            if v9 then
                v9:addRoactTree("Roact tree", v8);
            end;
        end;
        plugin.Unloading:Connect(function()
            if v9 then
                v9:destroy();
            end;
            if v8 then
                v4.unmount(v8);
                v8 = nil;
            end;
        end);
        v10();
        return ;
    else
        return ;
    end;
else
    return ;
end;


if plugin then
    local l_script_FirstAncestor_0 = script:FindFirstAncestor("VisualizationModes");
    require(l_script_FirstAncestor_0.Bin.Common.defineLuaFlags);
    local v1 = require(l_script_FirstAncestor_0.Packages.TestLoader);
    v1.launch("VisualizationModes", l_script_FirstAncestor_0.Src);
    if not v1.isCli() then
        if game:GetFastFlag("StudioVisualizationModes") then
            local v2 = require(l_script_FirstAncestor_0.Src.Util.Maid);
            local v3 = v2.new();
            local function v6()
                local v4 = v2.new();
                local v5 = require(l_script_FirstAncestor_0.Src.Modes.StudioVisualizationModeProvider);
                v4:add(require(l_script_FirstAncestor_0.Src.Model.VisualizationModeCombinerClient).new(plugin, (v4:add(require(l_script_FirstAncestor_0.Src.Model.Tracking.VisualizationModeServiceTracker).new()))));
                v4:add(v5.new());
                v3._mount = v4;
            end;
            plugin.Unloading:Connect(function()
                v3._mount = nil;
            end);
            v6();
            return ;
        else
            return ;
        end;
    else
        return ;
    end;
else
    return ;
end;


game:DefineFastFlag("StudioVisualizationModes", false);
game:DefineFastFlag("StudioVisualizationModesUI", false);
return nil;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("VisualizationModes");
local v1 = require(l_script_FirstAncestor_0.Packages.React);
local v2 = require(l_script_FirstAncestor_0.Packages.Framework);
local v3 = require(l_script_FirstAncestor_0.Packages.ReactUtils);
local l_ContextServices_0 = v2.ContextServices;
return function(v5)
    local v6 = l_ContextServices_0.Plugin:use():get();
    local v8 = v1.useCallback(function()
        if v6 == nil then
            return nil;
        else
            local l_v6_PluginAction_0 = v6:CreatePluginAction(v5.ActionId, v5.Text, v5.StatusTip, v5.IconName, v5.AllowBinding);
            if v5.Checked ~= nil then
                l_v6_PluginAction_0.Checked = v5.Checked;
            end;
            if v5.Enabled ~= nil then
                l_v6_PluginAction_0.Enabled = v5.Enabled;
            end;
            if v5.DefaultShortcut ~= nil then
                l_v6_PluginAction_0.DefaultShortcut = v5.DefaultShortcut;
            end;
            return l_v6_PluginAction_0;
        end;
    end, {
        v6,
        v5.ActionId,
        v5.Text,
        v5.StatusTip,
        v5.IconName,
        v5.AllowBinding
    });
    local v9, v10 = v1.useState(v8);
    v1.useEffect(function()
        if v9 then
            v9:Destroy();
        end;
        local v11 = v8();
        if v11 then
            v10(v11);
        end;
    end, {
        v8
    });
    v1.useEffect(function()
        local l_v9_0 = v9;
        if l_v9_0 == nil then
            return nil;
        else
            return function()
                l_v9_0:Destroy();
            end;
        end;
    end, {
        v9
    });
    v1.useEffect(function()
        if v9 ~= nil and v5.Checked ~= nil then
            v9.Checked = v5.Checked;
        end;
    end, {
        v9,
        v5.Checked
    });
    v1.useEffect(function()
        if v9 ~= nil and v5.Enabled ~= nil then
            v9.Enabled = v5.Enabled;
        end;
    end, {
        v9,
        v5.Enabled
    });
    v1.useEffect(function()
        if v9 ~= nil and v5.DefaultShortcut ~= nil then
            v9.DefaultShortcut = v5.DefaultShortcut;
        end;
    end, {
        v9,
        v5.DefaultShortcut
    });
    if v9 then
        v3.useEventConnection(v9.Triggered, function()
            if v5.OnTrigger then
                v5.OnTrigger();
            end;
        end, {
            v9,
            v5.OnTrigger
        });
    end;
    return nil;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("VisualizationModes");
local v1 = require(l_script_FirstAncestor_0.Packages.React);
local v2 = require(l_script_FirstAncestor_0.Src.Components.Actions.PluginAction);
local _ = require(l_script_FirstAncestor_0.Src.Types);
local l_ContextServices_0 = require(l_script_FirstAncestor_0.Packages.Framework).ContextServices;
return function(v5)
    local v6 = {};
    local v7 = l_ContextServices_0.Analytics:use();
    local v8 = l_ContextServices_0.Localization:use();
    for _, v10 in v5.VisualizationModeCategories, nil, nil do
        for _, v12 in v10.visualizationModeList, nil, nil do
            local v13 = ("ToggleVisualizationMode_User_%*_%*"):format(v10.name, v12.name);
            local v14 = v8:getText("ToggleVisualizationMode", "Title", {
                visualizationModeName = v12.title
            });
            local l_toolTip_0 = v12.toolTip;
            if not l_toolTip_0 or #l_toolTip_0 <= 0 then
                l_toolTip_0 = v8:getText("ToggleVisualizationMode", "Description", {
                    visualizationModeName = v12.title
                });
            end;
            v6[v13] = v1.createElement(v2, {
                ActionId = v13,
                Text = v14,
                StatusTip = l_toolTip_0,
                IconName = "",
                Checked = v12.enabled,
                Enabled = true,
                OnTrigger = function()
                    v7:report("visualizationModeToggled", {
                        actionSource = "plugin_action",
                        visualizationModeCategory = v10.name,
                        visualizationMode = v12.name,
                        isEnabled = not v12.enabled
                    });
                    v5.OnVisualizationModeToggle(v10.name, v12.name, not v12.enabled, true);
                end
            });
        end;
    end;
    return v1.createElement(v1.Fragment, {}, v6);
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("VisualizationModes");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework);
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local l_TextLabel_0 = v1.UI.TextLabel;
return function(v4)
    return v2.createElement("Frame", {
        LayoutOrder = v4.LayoutOrder,
        [v2.Tag] = "VisualizationModes-Badge X-Fit X-Middle"
    }, {
        Label = v2.createElement(l_TextLabel_0, {
            [v2.Tag] = "X-Fit",
            Text = v4.Text
        })
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("VisualizationModes");
local v1 = require(l_script_FirstAncestor_0.Packages.React);
local l_ContextServices_0 = require(l_script_FirstAncestor_0.Packages.Framework).ContextServices;
return function(v3)
    return v1.createElement("TextLabel", {
        [v1.Tag] = "VisualizationModes-HiddenCountLabel",
        LayoutOrder = v3.LayoutOrder,
        Visible = v3.Visible,
        Text = l_ContextServices_0.Localization:use():getText(not v3.AllHidden and "HiddenCount" or "AllHiddenCount", "Text", {
            hidden = v3.HiddenCount
        })
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("VisualizationModes");
local l_TextService_0 = game:GetService("TextService");
local _ = require(l_script_FirstAncestor_0.Src.Types);
local v3 = require(l_script_FirstAncestor_0.Packages.Framework);
local v4 = require(l_script_FirstAncestor_0.Packages.React);
local l_TextLabel_0 = v3.UI.TextLabel;
local function v10(v6)
    local v7 = string.sub(v6.Text, v6.StartIndex, v6.FinishIndex);
    local v8 = v4.useMemo(function()
        return l_TextService_0:GetTextSize(string.sub(v6.Text, 1, v6.StartIndex - 1), 16, Enum.Font.SourceSans, Vector2.new(math.huge, math.huge)).X;
    end, {
        v6.StartIndex,
        v6.Text
    });
    local v9 = v4.useMemo(function()
        return l_TextService_0:GetTextSize(string.sub(v6.Text, 1, v6.FinishIndex), 16, Enum.Font.SourceSans, Vector2.new(math.huge, math.huge)).X;
    end, {
        v6.FinishIndex,
        v6.Text
    });
    return v4.createElement(v4.Fragment, {}, {
        Highlight = v4.createElement("Frame", {
            [v4.Tag] = "VisualizationModes-Highlight",
            Size = UDim2.fromOffset(v9 - v8, 24),
            Position = UDim2.new(0, v8, 0.5, 0),
            ZIndex = 2
        }),
        HighlightTextLabel = v4.createElement(l_TextLabel_0, {
            Text = v7,
            [v4.Tag] = "VisualizationModes-Highlight-TextLabel",
            Size = UDim2.fromOffset(v9 - v8, 24),
            AnchorPoint = Vector2.new(0, 0.5),
            Position = UDim2.new(0, v8, 0.5, 0),
            ZIndex = 3
        })
    });
end;
local function v19(v11)
    if v11.MatchIndexes == nil then
        return nil;
    else
        local l_Text_0 = v11.Text;
        if l_Text_0 == nil then
            return nil;
        else
            local l_MatchIndexes_0 = v11.MatchIndexes;
            local v14 = {};
            local v15 = nil;
            local v16 = nil;
            for _, v18 in l_MatchIndexes_0, nil, nil do
                if v15 == nil then
                    v15 = v18;
                    v16 = v18;
                elseif v16 ~= nil and v18 == v16 + 1 then
                    v16 = v18;
                elseif v15 ~= nil and v16 ~= nil then
                    table.insert(v14, v4.createElement(v10, {
                        Text = l_Text_0,
                        StartIndex = v15,
                        FinishIndex = v16
                    }));
                    v15 = v18;
                    v16 = v18;
                end;
            end;
            if v15 ~= nil and v16 ~= nil then
                table.insert(v14, v4.createElement(v10, {
                    Text = l_Text_0,
                    StartIndex = v15,
                    FinishIndex = v16
                }));
            end;
            return v4.createElement(v4.Fragment, {}, v14);
        end;
    end;
end;
return function(v20)
    return v4.createElement("Frame", {
        LayoutOrder = v20.LayoutOrder,
        [v4.Tag] = "VisualizationModes-TextLabel-Container"
    }, {
        TextLabel = v4.createElement(l_TextLabel_0, {
            Text = v20.Text,
            [v4.Tag] = v3.Styling.joinTags("VisualizationModes-TextLabel", v20[v4.Tag]),
            TextTruncate = Enum.TextTruncate.SplitWord,
            ZIndex = 2
        }),
        HighlightGroup = v4.createElement(v19, {
            Text = v20.Text,
            MatchIndexes = v20.MatchIndexes
        })
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("VisualizationModes");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework);
local v2 = require(l_script_FirstAncestor_0.Src.Components.HighlightTextLabel);
local v3 = require(l_script_FirstAncestor_0.Packages.React);
local l_Pane_0 = v1.UI.Pane;
return {
    name = "HighlightTextLabel",
    summary = "This text label allows for highlighting specific parts of the text based upon a fuzzy search match.",
    stories = {
        {
            name = "HighlightTextLabel",
            story = function(v5)
                return v3.createElement(l_Pane_0, {
                    [v3.Tag] = "X-Fill X-Column X-Top",
                    Size = UDim2.fromOffset(325, 300)
                }, {
                    StyleLink = v3.createElement("StyleLink", {
                        StyleSheet = v1.Styling.registerPluginStyles(v5.plugin, l_script_FirstAncestor_0)
                    }),
                    HighlightTextLabel = v3.createElement(v2, {
                        Text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus laoreet",
                        MatchIndexes = {
                            1,
                            3,
                            4
                        }
                    })
                });
            end
        }
    }
};


local l_script_FirstAncestor_0 = script:FindFirstAncestor("VisualizationModes");
local _ = require(l_script_FirstAncestor_0.Src.Types);
local v2 = require(l_script_FirstAncestor_0.Packages.Framework);
local v3 = require(l_script_FirstAncestor_0.Packages.React);
local v4 = require(l_script_FirstAncestor_0.Src.Components.VisualizationModeEntry);
local v5 = require(l_script_FirstAncestor_0.Src.Components.VisualizationModeSection);
local l_ContextServices_0 = v2.ContextServices;
return function(v7)
    local v8 = l_ContextServices_0.Analytics:use();
    local v9 = l_ContextServices_0.Localization:use();
    local v10 = {};
    local v11 = 0;
    local v12 = 0;
    for v13, v14 in v7.RecentVisualizationModes, nil, nil do
        v11 = v11 + 1;
        if v14.enabled then
            v12 = v12 + 1;
        end;
        v10[v14.name] = v3.createElement(v4, {
            Text = v14.title,
            Enabled = v14.enabled,
            ToolTip = v14.toolTip,
            LayoutOrder = v13,
            MatchIndexes = nil,
            IsEditingEnabled = true,
            OnToggle = function()
                v8:report("visualizationModeToggled", {
                    actionSource = "recent_section",
                    visualizationModeCategory = v14.visualizationModeCategoryName,
                    visualizationMode = v14.name,
                    isEnabled = not v14.enabled
                });
                v7.OnVisualizationModeToggle(v14.visualizationModeCategoryName, v14.name, not v14.enabled, false);
            end
        });
    end;
    return v3.createElement(v5, {
        Text = v9:getText("VisualizationModeCategories", "Recent"),
        SettingKey = "RecentCategories",
        DefaultIsExpanded = false,
        CanToggle = false,
        EnabledEntryCount = v12,
        Enabled = true,
        Visible = v7.Visible,
        LayoutOrder = v7.LayoutOrder,
        EntryCount = v11,
        SectionEntries = v10,
        ForceExpansion = false,
        IsEditingEnabled = v7.IsEditingEnabled
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("VisualizationModes");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework);
local v2 = require(l_script_FirstAncestor_0.Src.Components.HighlightTextLabel);
local v3 = require(l_script_FirstAncestor_0.Packages.React);
local v4 = require(l_script_FirstAncestor_0.Src.Flags.getFFlagDebugStudioShowBrokenVisualizationModes);
local v5 = require(l_script_FirstAncestor_0.Src.Hooks.useInstanceSetting);
local l_UI_0 = v1.UI;
local l_ContextServices_0 = v1.ContextServices;
local l_Pane_0 = l_UI_0.Pane;
local l_SegmentedButton_0 = l_UI_0.SegmentedButton;
local l_Slider_0 = l_UI_0.Slider;
local l_LayoutOrderIterator_0 = v1.Util.LayoutOrderIterator;
local l_Tooltip_0 = l_UI_0.Tooltip;
return function(v13)
    local v14 = l_ContextServices_0.Localization:use();
    local v15 = l_LayoutOrderIterator_0.new();
    local v16, v17 = v3.useState(1);
    local v18, v19 = v5(settings().Studio, "Camera Speed", 1.5);
    return v3.createElement(l_Pane_0, {
        [v3.Tag] = "X-Fill X-Column X-Top X-FitY",
        LayoutOrder = v13.LayoutOrder
    }, {
        UIPadding = v3.createElement("UIPadding", {
            PaddingLeft = UDim.new(0, 22),
            PaddingRight = UDim.new(0, 3)
        }),
        Container = v3.createElement(l_Pane_0, {
            [v3.Tag] = "X-RowS X-Left X-Middle",
            LayoutOrder = v15:getNextOrder(),
            Size = UDim2.new(1, 0, 0, 32),
            Visible = v4()
        }, {
            ViewMode = v3.createElement(l_SegmentedButton_0, {
                Position = UDim2.fromScale(0, 0.5),
                AnchorPoint = Vector2.new(0, 0.5),
                Items = {
                    "Wireframe",
                    "Shaded"
                },
                SelectedIndex = v16,
                OnItemActivated = v17,
                Size = UDim2.new(1, 0, 0, 26)
            })
        }),
        CameraSpeed = v3.createElement(l_Pane_0, {
            [v3.Tag] = "X-Fill X-Column X-Top X-FitY",
            LayoutOrder = v15:getNextOrder()
        }, {
            Contents = v3.createElement(l_Pane_0, {
                [v3.Tag] = "X-RowM X-Left X-Middle",
                Size = UDim2.new(1, 0, 0, 32)
            }, {
                TextContainer = v3.createElement(l_Pane_0, {
                    Size = UDim2.new(1, -160, 1, 0)
                }, {
                    VisualizationModeEntryTitle = v3.createElement(v2, {
                        Text = v14:getText("ViewSection", "CameraSpeed")
                    }),
                    ToolTip = v3.createElement(l_Tooltip_0, {
                        Text = v14:getText("ViewSection", "CameraSpeedToolTip")
                    })
                }),
                Slider = v3.createElement(l_Slider_0, {
                    Min = math.min(0.1, v18),
                    Max = math.max(20, v18),
                    Value = v18,
                    ShowInput = true,
                    OnValueChanged = v19,
                    Size = UDim2.fromOffset(150, 32)
                })
            })
        })
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("VisualizationModes");
local v1 = require(l_script_FirstAncestor_0.Packages.React);
local v2 = require(l_script_FirstAncestor_0.Src.Components.Sections.ViewSectionControls);
local v3 = require(l_script_FirstAncestor_0.Packages.Framework);
local l_Pane_0 = v3.UI.Pane;
local l_registerPluginStyles_0 = v3.Styling.registerPluginStyles;
return {
    name = "ViewSectionControls",
    summary = "Renders the custom controls for the 'View' section of the visualization modes plugin",
    stories = {
        {
            name = "ViewSectionControls",
            story = function(v6)
                return v1.createElement(l_Pane_0, {
                    [v1.Tag] = "X-Fill X-Column X-Top",
                    Size = UDim2.fromOffset(325, 300)
                }, {
                    StyleLink = v1.createElement("StyleLink", {
                        StyleSheet = l_registerPluginStyles_0(v6.plugin, l_script_FirstAncestor_0)
                    }),
                    ViewSectionControls = v1.createElement(v2)
                });
            end
        }
    }
};


local v0 = require(script:FindFirstAncestor("VisualizationModes").Packages.React);
return function(v1)
    return v0.createElement("Frame", {
        [v0.Tag] = "VisualizationModes-Bottom-Divider",
        LayoutOrder = v1.LayoutOrder,
        Visible = v1.Visible
    }, {
        DividerRender = v0.createElement("Frame")
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("VisualizationModes");
local v1 = require(l_script_FirstAncestor_0.Src.Components.Badge);
local v2 = require(l_script_FirstAncestor_0.Packages.Framework);
local v3 = require(l_script_FirstAncestor_0.Src.Components.HighlightTextLabel);
local v4 = require(l_script_FirstAncestor_0.Packages.React);
local _ = require(l_script_FirstAncestor_0.Src.Types);
local l_UI_0 = v2.UI;
local l_Checkbox_0 = l_UI_0.Checkbox;
local l_LayoutOrderIterator_0 = v2.Util.LayoutOrderIterator;
local l_Pane_0 = l_UI_0.Pane;
local l_Tooltip_0 = l_UI_0.Tooltip;
local function v12(v11)
    if v11.CanExpand then
        return v4.createElement("ImageButton", {
            Size = UDim2.fromOffset(12, 12),
            BackgroundTransparency = 1,
            LayoutOrder = v11.LayoutOrder,
            [v4.Event.Activated] = v11.OnExpansionToggled
        }, {
            ArrowImage = v4.createElement("ImageLabel", {
                [v4.Tag] = v2.Styling.joinTags("VisualizationModes-ExpandIcon", not v11.IsExpanded and "VisualizationModes-ExpandIcon-Collapsed" or "VisualizationModes-ExpandIcon-Expanded")
            })
        });
    else
        return v4.createElement("Frame", {
            Size = UDim2.fromOffset(7, 12),
            LayoutOrder = v11.LayoutOrder,
            BackgroundTransparency = 1
        });
    end;
end;
return function(v13)
    local v14 = l_LayoutOrderIterator_0.new();
    return v4.createElement("ImageButton", {
        Visible = v13.Visible,
        LayoutOrder = v13.LayoutOrder,
        [v4.Tag] = v2.Styling.joinTags("VisualizationModes-Entry", v13.IsEditingEnabled == false and "VisualizationModes-Disabled" or "VisualizationModes-Active"),
        [v4.Event.Activated] = function()
            if v13.CanToggle == false then
                if v13.OnExpansionToggled then
                    v13.OnExpansionToggled();
                end;
                return ;
            else
                if v13.OnToggle then
                    v13.OnToggle();
                end;
                return ;
            end;
        end
    }, {
        ToolTip = if not not v13.ToolTip and #v13.ToolTip > 0 then v4.createElement(l_Tooltip_0, {
            Text = v13.ToolTip
        }) else nil,
        VisualizationModesEntryBacking = v4.createElement("Frame"),
        Contents = v4.createElement(l_Pane_0, {
            [v4.Tag] = "X-RowS X-Left X-Middle X-PadS",
            Size = UDim2.new(1, 0, 0, 24),
            AnchorPoint = Vector2.new(0.5, 0.5),
            Position = UDim2.fromScale(0.5, 0.5)
        }, {
            ExpandButton = v4.createElement(v12, {
                LayoutOrder = v14:getNextOrder(),
                CanExpand = v13.CanExpand,
                IsExpanded = v13.IsExpanded,
                OnExpansionToggled = v13.OnExpansionToggled
            }),
            MainEntry = v4.createElement("Frame", {
                LayoutOrder = v14:getNextOrder(),
                [v4.Tag] = "VisualizationModes-EntryButton"
            }, {
                Contents = v4.createElement(l_Pane_0, {
                    [v4.Tag] = "X-RowS X-Left X-Middle"
                }, {
                    Checkbox = if v13.CanToggle ~= false then v4.createElement(l_Checkbox_0, {
                        Checked = v13.Enabled,
                        OnClick = v13.OnToggle,
                        Disabled = v13.IsEditingEnabled == false,
                        LayoutOrder = v14:getNextOrder()
                    }) else nil,
                    VisualizationModeEntryTitle = v4.createElement(v3, {
                        MatchIndexes = v13.MatchIndexes,
                        LayoutOrder = v14:getNextOrder(),
                        [v4.Tag] = v2.Styling.joinTags("VisualizationModes-TextLabel", v13.IsEditingEnabled == false and "VisualizationModes-Disabled" or nil),
                        Text = v13.Text
                    }),
                    Badge = if not v13.BadgeText then nil else v4.createElement(v1, {
                        LayoutOrder = v14:getNextOrder(),
                        Text = v13.BadgeText
                    })
                })
            })
        })
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("VisualizationModes");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework);
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local v3 = require(l_script_FirstAncestor_0.Packages.ReactUtils);
local _ = require(l_script_FirstAncestor_0.Src.Types);
local v5 = require(l_script_FirstAncestor_0.Src.Components.VisualizationModeEntry);
local v6 = require(l_script_FirstAncestor_0.Src.Hooks.usePluginSetting);
local l_LayoutOrderIterator_0 = v1.Util.LayoutOrderIterator;
local l_Pane_0 = v1.UI.Pane;
local function _(v9)
    return string.format("Category_%s_IsExpanded", v9);
end;
return function(v11)
    local v12 = l_LayoutOrderIterator_0.new();
    local v13, v14 = v6(string.format("Category_%s_IsExpanded", v11.SettingKey), v11.DefaultIsExpanded);
    local v15 = v3.useToggleState(v13);
    v2.useEffect(function()
        v14(v15.enabled);
    end, {
        v15.enabled
    });
    local v16 = v15.enabled or v11.ForceExpansion;
    return v2.createElement("ImageButton", {
        Visible = v11.Visible,
        LayoutOrder = v11.LayoutOrder,
        [v2.Tag] = "VisualizationModes-Group",
        [v2.Event.Activated] = v15.toggle
    }, {
        Contents = v2.createElement(l_Pane_0, {
            [v2.Tag] = "X-Column X-Top X-FitY X-Left",
            Size = UDim2.fromScale(1, 0)
        }, {
            Main = v2.createElement(l_Pane_0, {
                [v2.Tag] = "X-Column X-Top X-Fit",
                Size = UDim2.fromScale(1, 0)
            }, {
                Title = v2.createElement(v5, {
                    LayoutOrder = v12:getNextOrder(),
                    Enabled = v11.Enabled,
                    BadgeText = if not v16 and v11.EnabledEntryCount > 0 then tostring(v11.EnabledEntryCount) else nil,
                    MatchIndexes = v11.MatchIndexes,
                    CanExpand = true,
                    IsExpanded = v16,
                    OnToggle = v11.OnToggle,
                    CanToggle = v11.CanToggle,
                    IsEditingEnabled = v11.IsEditingEnabled,
                    OnExpansionToggled = v15.toggle,
                    Text = v11.Text
                }),
                Content = v2.createElement(l_Pane_0, {
                    [v2.Tag] = "X-Column X-Top X-FitY",
                    Size = UDim2.fromScale(1, 0),
                    LayoutOrder = v12:getNextOrder(),
                    Visible = v16
                }, v11.SectionEntries)
            })
        })
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("VisualizationModes");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework);
local v2 = require(l_script_FirstAncestor_0.Src.Components.HiddenCountLabel);
local v3 = require(l_script_FirstAncestor_0.Packages.React);
local v4 = require(l_script_FirstAncestor_0.Src.Components.Sections.RecentSection);
local _ = require(l_script_FirstAncestor_0.Src.Types);
local v6 = require(l_script_FirstAncestor_0.Src.Components.Sections.ViewSectionControls);
local v7 = require(l_script_FirstAncestor_0.Src.Components.VisualizationSearchBar);
local v8 = require(l_script_FirstAncestor_0.Src.Compute.computeDividedSections);
local v9 = require(l_script_FirstAncestor_0.Src.Compute.computeVisualizationModeSections);
local v10 = require(l_script_FirstAncestor_0.Src.Hooks.useFuzzySearch);
local _ = require(l_script_FirstAncestor_0.Src.Hooks.useSizeCalculator);
local l_UI_0 = v1.UI;
local l_Pane_0 = l_UI_0.Pane;
local l_ScrollingFrame_0 = l_UI_0.ScrollingFrame;
return function(v15)
    local v16 = v8();
    local v17 = v10({
        SettingsKey = "VisualizationModesMainView_LastSearchSetting"
    });
    local v18 = v9({
        FuzzySearch = v17,
        OnVisualizationModeCategoryToggle = v15.OnVisualizationModeCategoryToggle,
        OnVisualizationModeToggle = v15.OnVisualizationModeToggle
    });
    v16.addSection({
        key = "RecentSection",
        visible = v17.searchText == "",
        renderContent = function(v19, v20)
            return v3.createElement(v4, {
                LayoutOrder = v19,
                Visible = v20,
                IsEditingEnabled = next(v15.RecentVisualizationModes) ~= nil,
                OnVisualizationModeToggle = v15.OnVisualizationModeToggle,
                RecentVisualizationModes = v15.RecentVisualizationModes
            });
        end
    });
    local v21 = {
        View = v3.createElement(v6)
    };
    for _, v23 in v15.VisualizationModeCategories, nil, nil do
        v16.addSection(v18.createSection(v23, v21[v23.name]));
    end;
    v16.addSection({
        key = "HiddenCount",
        visible = v17.getFilteredCount() > 0,
        renderContent = function(v24, v25)
            return v3.createElement(v2, {
                LayoutOrder = v24,
                Visible = v25,
                HiddenCount = v17.getFilteredCount(),
                AllHidden = v17.getAreAllEntriesHidden()
            });
        end
    });
    return v3.createElement(l_Pane_0, {
        [v3.Tag] = "X-ColumnS X-Top",
        Size = v15.Size
    }, {
        SearchBarContainer = v3.createElement(v7, {
            FuzzySearch = v17,
            LayoutOrder = 1
        }),
        ScrollingFrame = v3.createElement(l_ScrollingFrame_0, {
            [v3.Tag] = "ScrollingAutomaticSize VisualizationModes-MainScrollingFrame",
            Size = v15.SizeCalculator.scrollingFrameSize,
            LayoutOrder = 2
        }, {
            Content = v3.createElement(l_Pane_0, {
                [v3.Tag] = "X-Column X-Top X-FitY",
                ref = v15.SizeCalculator.contentFrameRef
            }, {
                Sections = v16.getSections(),
                UIPadding = v3.createElement("UIPadding", {
                    PaddingRight = UDim.new(0, 1)
                })
            })
        })
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("VisualizationModes");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework);
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local v3 = require(l_script_FirstAncestor_0.Src.Model.VisualizationModeCombinerClient);
local v4 = require(l_script_FirstAncestor_0.Src.Model.Tracking.VisualizationModeServiceTracker);
local v5 = require(l_script_FirstAncestor_0.Src.Components.VisualizationModesMainView);
local v6 = require(l_script_FirstAncestor_0.Src.Hooks.useSizeCalculator);
local v7 = require(l_script_FirstAncestor_0.Src.Hooks.useVisualizationModeCombiner);
local l_Pane_0 = v1.UI.Pane;
return {
    name = "VisualizationModesMainView",
    summary = "Renders the main visualization modes view with all sections and controls",
    stories = {
        {
            name = "VisualizationModesMainView",
            story = function(v9)
                local v10 = v1.Styling.registerPluginStyles(v9.plugin, l_script_FirstAncestor_0);
                local v11 = v7();
                local v12 = v2.useState(function()
                    return v4.new();
                end);
                local v13 = v2.useState(function()
                    return v3.new(v9.plugin, v12);
                end);
                v2.useEffect(function()
                    return function()
                        v12:destroy();
                        v13:destroy();
                    end;
                end, {});
                local v14 = v6({
                    Width = 325,
                    HeaderHeight = 32,
                    MaxHeight = 400,
                    InnerPadding = 5,
                    Padding = Vector2.zero
                });
                return v2.createElement(l_Pane_0, {
                    [v2.Tag] = "X-Fill X-Column X-Top",
                    Size = UDim2.fromOffset(v14.size.X, v14.size.Y)
                }, {
                    StyleLink = v2.createElement("StyleLink", {
                        StyleSheet = v10
                    }),
                    VisualizationModesMainView = v2.createElement(v5, {
                        OnVisualizationModeToggle = v11.onVisualizationModeToggle,
                        OnVisualizationModeCategoryToggle = v11.onVisualizationModeCategoryToggle,
                        SizeCalculator = v14,
                        RecentVisualizationModes = v11.state.recentModes,
                        VisualizationModeCategories = v11.state.categories
                    })
                });
            end
        }
    }
};


local l_script_FirstAncestor_0 = script:FindFirstAncestor("VisualizationModes");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework);
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local _ = require(l_script_FirstAncestor_0.Src.Hooks.useFuzzySearch);
local l_ContextServices_0 = v1.ContextServices;
local l_SearchBar_0 = v1.UI.SearchBar;
return function(v6)
    return v2.createElement("Frame", {
        BackgroundTransparency = 1,
        LayoutOrder = v6.LayoutOrder,
        Size = UDim2.new(1, -5, 0, 32)
    }, {
        SearchBar = v2.createElement(l_SearchBar_0, {
            PlaceholderText = l_ContextServices_0.Localization:use():getText("SearchBar", "Search"),
            ShowSearchIcon = true,
            ShowSearchButton = false,
            ShowFilterButton = false,
            IncrementalTextSearch = true,
            IncrementalTextSearchDelay = 5,
            SearchTerm = v6.FuzzySearch.searchText,
            OnSearchRequested = v6.FuzzySearch.setSearchText
        }),
        UIPadding = v2.createElement("UIPadding", {
            PaddingRight = UDim.new(0, 5)
        })
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("VisualizationModes");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework);
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local _ = require(l_script_FirstAncestor_0.Src.Types);
local v4 = require(l_script_FirstAncestor_0.Src.Components.Sections.VisualizationModeSectionDivider);
local l_LayoutOrderIterator_0 = v1.Util.LayoutOrderIterator;
return function()
    local v6 = l_LayoutOrderIterator_0.new();
    local v7 = {};
    local v8 = {};
    local function _()
        table.insert(v7, v2.createElement(v4, {
            LayoutOrder = v6:getNextOrder()
        }));
    end;
    return table.freeze({
        addSection = function(v10)
            v8[v10.key] = v10.renderContent(v6:getNextOrder(), v10.visible);
            if v10.visible ~= false then
                table.insert(v7, v2.createElement(v4, {
                    LayoutOrder = v6:getNextOrder()
                }));
            end;
        end,
        getSections = function()
            local v11 = table.clone(v7);
            table.remove(v11);
            return v2.createElement(v2.Fragment, {}, {
                Sections = v2.createElement(v2.Fragment, {}, v8),
                Dividers = v2.createElement(v2.Fragment, {}, v11)
            });
        end
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("VisualizationModes");
local _ = require(l_script_FirstAncestor_0.Src.Types);
local v2 = require(l_script_FirstAncestor_0.Packages.Framework);
local v3 = require(l_script_FirstAncestor_0.Packages.React);
local v4 = require(l_script_FirstAncestor_0.Src.Components.VisualizationModeEntry);
local _ = require(l_script_FirstAncestor_0.Src.Hooks.useFuzzySearch);
local l_ContextServices_0 = v2.ContextServices;
local l_LayoutOrderIterator_0 = v2.Util.LayoutOrderIterator;
return function(v8)
    local v9 = l_ContextServices_0.Analytics:use();
    local v10 = l_LayoutOrderIterator_0.new();
    local v11 = {};
    local v12 = 0;
    local v13 = 0;
    local v14 = 0;
    local v15 = 0;
    local v16 = 0;
    return {
        addEntry = function(v17)
            v13 = v13 + 1;
            v8.FuzzySearch.incrementEntryCount();
            if v17.Visible ~= false then
                v12 = v12 + 1;
            end;
            table.insert(v11, v3.createElement(v4, v17));
        end,
        addCustomEntry = function(v18)
            v13 = v13 + 1;
            v12 = v12 + 1;
            v8.FuzzySearch.incrementEntryCount();
            table.insert(v11, v18);
        end,
        addVisualizationModeEntry = function(v19, v20)
            v14 = v14 + 1;
            local v21, v22 = v8.FuzzySearch.includeEntry(v20.title);
            if v8.ForceVisible then
                v21 = true;
            end;
            if v22 ~= nil then
                v15 = v15 + 1;
            end;
            if not v21 then
                v8.FuzzySearch.incrementFilteredCount();
            end;
            if v20.enabled then
                v16 = v16 + 1;
            end;
            local v23 = {
                key = v20.name,
                Text = v20.title,
                Visible = v21,
                ToolTip = v20.toolTip,
                Enabled = v20.enabled,
                LayoutOrder = v10:getNextOrder(),
                MatchIndexes = v22,
                IsEditingEnabled = true,
                OnToggle = function()
                    v9:report("visualizationModeToggled", {
                        actionSource = "button",
                        visualizationModeCategory = v19.name,
                        visualizationMode = v20.name,
                        isEnabled = not v20.enabled
                    });
                    v8.OnVisualizationModeToggle(v19.name, v20.name, not v20.enabled, true);
                end
            };
            v13 = v13 + 1;
            v8.FuzzySearch.incrementEntryCount();
            if v23.Visible ~= false then
                v12 = v12 + 1;
            end;
            table.insert(v11, v3.createElement(v4, v23));
        end,
        renderEntries = function()
            return v11;
        end,
        hasVisibleEntries = function()
            return v12 > 0;
        end,
        getEntryCount = function()
            return v13;
        end,
        getVisualizationModeEntryCount = function()
            return v14;
        end,
        getEntryMatchCount = function()
            return v15;
        end,
        getEnabledCount = function()
            return v16;
        end
    };
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("VisualizationModes");
local _ = require(l_script_FirstAncestor_0.Src.Types);
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local v3 = require(l_script_FirstAncestor_0.Src.Components.VisualizationModeSection);
local v4 = require(l_script_FirstAncestor_0.Src.Compute.computeVisualizationModeSectionEntries);
local _ = require(l_script_FirstAncestor_0.Src.Hooks.useFuzzySearch);
return function(v6)
    return table.freeze({
        createSection = function(v7, v8)
            local v9, v10 = v6.FuzzySearch.includeEntry(v7.title);
            local v11 = v4({
                OnVisualizationModeToggle = v6.OnVisualizationModeToggle,
                ForceVisible = v10 ~= nil,
                FuzzySearch = v6.FuzzySearch
            });
            if v8 then
                v6.FuzzySearch.incrementEntryCount();
                if not v9 then
                    v6.FuzzySearch.incrementFilteredCount();
                else
                    v11.addCustomEntry(v8);
                end;
            end;
            for _, v13 in v7.visualizationModeList, nil, nil do
                v11.addVisualizationModeEntry(v7, v13);
            end;
            return {
                key = "User_" .. v7.name,
                visible = v11.hasVisibleEntries(),
                renderContent = function(v14, v15)
                    local l_createElement_0 = v2.createElement;
                    local l_v3_0 = v3;
                    local v18 = {
                        Text = v7.title,
                        Visible = v15,
                        LayoutOrder = v14,
                        DefaultIsExpanded = true,
                        SettingKey = v7.name,
                        Enabled = v7.enabled,
                        SectionEntries = v11.renderEntries(),
                        MatchIndexes = v10,
                        CanExpand = true,
                        CanToggle = false,
                        EntryCount = v11.getEntryCount(),
                        EnabledEntryCount = v11.getEnabledCount()
                    };
                    local v19 = true;
                    if v11.getEntryMatchCount() <= 0 then
                        v19 = v10 ~= nil;
                    end;
                    v18.ForceExpansion = v19;
                    v18.OnToggle = function()
                        v6.OnVisualizationModeCategoryToggle(v7.name, not v7.enabled);
                    end;
                    return l_createElement_0(l_v3_0, v18);
                end
            };
        end
    });
end;


game:DefineFastFlag("DebugStudioShowBrokenVisualizationModes", false);
return function()
    return game:GetFastFlag("DebugStudioShowBrokenVisualizationModes");
end;


game:DefineFastFlag("StudioPluginPopupAnchorPoint", false);
return function()
    return game:GetFastFlag("StudioPluginPopupAnchorPoint");
end;


game:DefineFastFlag("StudioVisualizationModesUI", false);
return function()
    return game:GetFastFlag("StudioVisualizationModesUI");
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("VisualizationModes");
local _ = require(l_script_FirstAncestor_0.Src.Types);
local v2 = require(l_script_FirstAncestor_0.Src.Util.Fzy);
local v3 = require(l_script_FirstAncestor_0.Src.Hooks.usePluginSetting);
return function(v4)
    local v5 = v2.createConfig({
        caseSensitive = false
    });
    local v6 = v2.getScoreFloor(v5);
    local v7, v8 = v3(v4.SettingsKey, "");
    local function v12(v9)
        if v7 == "" then
            return true, nil;
        else
            local v10, v11 = v2.positions(v5, v7, v9);
            if v6 < v11 then
                return true, v10;
            else
                return false, nil;
            end;
        end;
    end;
    local v13 = 0;
    local v14 = 0;
    return table.freeze({
        searchText = v7,
        setSearchText = v8,
        includeEntry = v12,
        getFilteredCount = function()
            return v13;
        end,
        incrementFilteredCount = function()
            v13 = v13 + 1;
        end,
        incrementEntryCount = function()
            v14 = v14 + 1;
        end,
        getAreAllEntriesHidden = function()
            return v14 <= v13;
        end
    });
end;


local v0 = require(script:FindFirstAncestor("VisualizationModes").Packages.React);
return function(v1, v2, v3)
    local v5 = v0.useCallback(function()
        if not (v1 ~= nil) or v2 == nil then
            return v3;
        else
            local v4 = v1[v2];
            if typeof(v4) == typeof(v3) then
                return v4;
            else
                return v3;
            end;
        end;
    end, {
        v1,
        v2,
        v3
    });
    local v6, v7 = v0.useState(v5);
    v0.useEffect(function()
        if not (v2 ~= nil) or v1 == nil then
            return ;
        else
            if v5() ~= v6 then
                v7(v6);
            end;
            return ;
        end;
    end, {
        v5
    });
    v0.useEffect(function()
        if not (v1 ~= nil) or v2 == nil then
            return nil;
        else
            local l_v1_0 = v1;
            local v9 = l_v1_0:GetPropertyChangedSignal(v2):Connect(function()
                v7(l_v1_0[v2]);
            end);
            return function()
                v9:Disconnect();
            end;
        end;
    end, {
        v1,
        v2
    });
    v0.useEffect(function()
        if not (v2 ~= nil) or v1 == nil then
            return ;
        else
            v1[v2] = v6;
            return ;
        end;
    end, {
        v6,
        v2
    });
    return v6, v7;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("VisualizationModes");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework);
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local l_ContextServices_0 = v1.ContextServices;
return function(v4, v5)
    local v6 = l_ContextServices_0.Plugin:use():get();
    local v8 = v2.useCallback(function()
        if not (v6 ~= nil) or v4 == nil then
            return v5;
        else
            local l_v6_Setting_0 = v6:GetSetting(v4);
            if typeof(l_v6_Setting_0) == typeof(v5) then
                return l_v6_Setting_0;
            else
                return v5;
            end;
        end;
    end, {
        v6,
        v4,
        v5
    });
    local v9, v10 = v2.useState(v8);
    v2.useEffect(function()
        if not (v4 ~= nil) or v6 == nil then
            return ;
        else
            if v8() ~= v9 then
                v10(v9);
            end;
            return ;
        end;
    end, {
        v8
    });
    v2.useEffect(function()
        if not (v4 ~= nil) or v6 == nil then
            return ;
        else
            v6:SetSetting(v4, v9);
            return ;
        end;
    end, {
        v9,
        v6,
        v4
    });
    return v9, v10;
end;


local v0 = require(script:FindFirstAncestor("VisualizationModes").Packages.React);
return function(v1)
    local v2, v3 = v0.useState(nil);
    local v4, v5 = v0.useState(function()
        if not v2 then
            return Vector2.zero;
        else
            return v2.AbsoluteSize;
        end;
    end);
    local v7 = v0.useCallback(function(v6)
        v3(v6);
    end, {});
    v0.useEffect(function()
        local l_v2_0 = v2;
        if l_v2_0 == nil then
            v5(Vector2.zero);
            return nil;
        else
            local v9 = l_v2_0:GetPropertyChangedSignal("AbsoluteSize"):Connect(function()
                v5(l_v2_0.AbsoluteSize);
            end);
            v5(l_v2_0.AbsoluteSize);
            return function()
                v9:Disconnect();
            end;
        end;
    end, {
        v2
    });
    if v2 then
        v4 = v2.AbsoluteSize;
    end;
    local v10 = Vector2.new(v1.Width, v1.HeaderHeight) + v1.Padding;
    local v11 = math.clamp(v4.Y, 0, ((v1.MaxHeight - v1.HeaderHeight) - v1.InnerPadding) - v1.Padding.Y);
    local v12 = UDim2.new(1, 0, 0, v11);
    if v11 > 0 then
        v10 = v10 + Vector2.new(0, v11 + v1.InnerPadding);
    end;
    local l_freeze_0 = table.freeze;
    local v14 = {};
    local v15 = false;
    if v2 ~= nil then
        v15 = v4.Y > 0;
    end;
    v14.loaded = v15;
    v14.contentFrameRef = v7;
    v14.size = v10;
    v14.scrollingFrameSize = v12;
    return l_freeze_0(v14);
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("VisualizationModes");
local _ = require(l_script_FirstAncestor_0.Src.Types);
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local v3 = require(l_script_FirstAncestor_0.Src.Model.VisualizationModeCombiner);
local v4 = require(l_script_FirstAncestor_0.Packages.Framework);
local v5 = require(l_script_FirstAncestor_0.Src.Model.Telemetry.VisualizationModeDurationTelemetry);
return function()
    local v6 = v4.ContextServices.Plugin:use():get();
    local v7 = v4.ContextServices.Analytics:use();
    local v8 = v2.useState(function()
        return v3.new(v6);
    end);
    local v9 = v2.useState(function()
        return v5.new(v8, v7);
    end);
    local v10, v11 = v2.useState(function()
        return v8:getState() or {
            categories = {},
            recentModes = {}
        };
    end);
    v2.useEffect(function()
        return function()
            v9:destroy();
            v8:destroy();
        end;
    end, {});
    v2.useEffect(function()
        local v13 = v8.changed:Connect(function(v12)
            v11(v12);
        end);
        local v14 = v8:getState();
        if v14 then
            v11(v14);
        end;
        return function()
            v13:Disconnect();
        end;
    end, {});
    return table.freeze({
        onVisualizationModeToggle = v2.useCallback(function(v15, v16, v17, v18)
            v8:updateVisualizationModeIsEnabled(v15, v16, v17);
            if v18 then
                v8:recordRecentVisualizationMode(v15, v16);
            end;
        end, {}),
        onVisualizationModeCategoryToggle = v2.useCallback(function(v19, v20)
            v8:updateVisualizationModeCategoryIsEnabled(v19, v20);
        end, {}),
        state = v10,
        combiner = v8
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("VisualizationModes");
local v1 = require(l_script_FirstAncestor_0.Src.Util.Maid);
local _ = require(l_script_FirstAncestor_0.Src.Types);
local _ = require(l_script_FirstAncestor_0.Src.Model.VisualizationModeCombiner);
local v4 = {};
v4.__index = v4;
v4.new = function(v5, v6)
    local v7 = setmetatable({}, v4);
    v7._maid = v1.new();
    v7._visualizationModeCombiner = v5;
    v7._startTimeLookup = {};
    v7._previousState = nil;
    v7._analytics = v6;
    v7._maid:giveTask(v7._visualizationModeCombiner.changed:Connect(function(v8)
        v7:_updateEnabledModeDurations(v8);
    end));
    v7:_updateEnabledModeDurations(v7._visualizationModeCombiner:getState());
    v7._maid:giveTask(function()
        v7:_updateEnabledModeDurations(nil);
    end);
    return v7;
end;
v4._reportDuration = function(v9, v10, v11, v12)
    v9._analytics:report("visualizationModeEnabledDuration", {
        visualizationModeCategory = v10,
        visualizationMode = v11,
        durationSeconds = v12
    });
end;
v4._updateEnabledModeDurations = function(v13, v14)
    local v15 = os.clock();
    local v16 = {};
    if v14 ~= nil then
        for _, v18 in v14.categories, nil, nil do
            if v16[v18.name] == nil then
                v16[v18.name] = {};
            end;
            for _, v20 in pairs(v18.visualizationModeList) do
                if v20.enabled then
                    v16[v18.name][v20.name] = true;
                end;
            end;
        end;
    end;
    for v21, v22 in v13._startTimeLookup, nil, nil do
        for v23, v24 in v22, nil, nil do
            if not (v16[v21] ~= nil) or v16[v21][v23] == nil then
                v13:_reportDuration(v21, v23, v15 - v24);
            end;
        end;
    end;
    local v25 = {};
    for v26, v27 in v16, nil, nil do
        local v28 = v13._startTimeLookup[v26] or {};
        local v29 = {};
        for v30, _ in v27, nil, nil do
            v29[v30] = v28[v30] or v15;
        end;
        v25[v26] = table.freeze(v29);
    end;
    v13._startTimeLookup = table.freeze(v25);
end;
v4.destroy = function(v32)
    v32._maid:destroy();
end;
return v4;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("VisualizationModes");
local v1 = require(l_script_FirstAncestor_0.Src.Util.Maid);
local v2 = require(l_script_FirstAncestor_0.Src.Util.Signal);
local _ = require(l_script_FirstAncestor_0.Src.Types);
local v4 = require(script.Parent.VisualizationModeTracker);
local v5 = {};
v5.__index = v5;
v5.new = function(v6)
    local v7 = false;
    if typeof(v6) == "Instance" then
        v7 = v6:IsA("VisualizationModeCategory");
    end;
    assert(v7, "Bad visualizationModeCategory");
    local v8 = setmetatable({}, v5);
    v8._maid = v1.new();
    v8._visualizationModeCategory = v6;
    v8._visualizationModeTrackers = {};
    v8._state = nil;
    v8.changed = v2.new();
    v8:_startTracking();
    return v8;
end;
v5.getState = function(v9)
    return v9._state;
end;
v5._setState = function(v10, v11)
    if v10._state == v11 then
        return ;
    else
        v10._state = v11;
        v10.changed:Fire(v11);
        return ;
    end;
end;
v5._startTracking = function(v12)
    v12._maid:giveTask(v12._visualizationModeCategory.ChildAdded:Connect(function(v13)
        v12:_handleChildAdded(v13);
    end));
    v12._maid:giveTask(v12._visualizationModeCategory.ChildRemoved:Connect(function(v14)
        v12._maid[v14] = nil;
    end));
    v12._maid:giveTask(v12._visualizationModeCategory:GetPropertyChangedSignal("Title"):Connect(function()
        v12:_queueUpdateState();
    end));
    v12._maid:giveTask(v12._visualizationModeCategory:GetPropertyChangedSignal("Enabled"):Connect(function()
        v12:_queueUpdateState();
    end));
    for _, v16 in v12._visualizationModeCategory:GetChildren() do
        v12:_handleChildAdded(v16);
    end;
    v12:_queueUpdateState();
end;
v5._queueUpdateState = function(v17)
    if not v17._maid._stateUpdateQueue then
        v17._maid._stateUpdateQueue = task.defer(function()
            v17._maid._stateUpdateQueue = nil;
            v17:_updateState();
        end);
        return ;
    else
        return ;
    end;
end;
v5._updateState = function(v18)
    local v19 = {};
    for _, v21 in v18._visualizationModeTrackers, nil, nil do
        local v22 = v21:getState();
        if v22 then
            table.insert(v19, v22);
        end;
    end;
    v18:_setState(table.freeze({
        visualizationModeList = v19,
        name = v18._visualizationModeCategory.Name,
        title = v18._visualizationModeCategory.Title,
        enabled = v18._visualizationModeCategory.Enabled,
        lastUpdateTimeUnixTimeStamp = DateTime.now().UnixTimestamp
    }));
end;
v5.updateVisualizationModeIsEnabled = function(v23, v24, v25)
    for _, v27 in v23._visualizationModeTrackers, nil, nil do
        local v28 = v27:getState();
        if v28 ~= nil and v28.name == v24 then
            v27:updateVisualizationModeIsEnabled(v25);
        end;
    end;
end;
v5.setIsCategoryEnabled = function(v29, v30)
    v29._visualizationModeCategory.Enabled = v30;
end;
v5._handleChildAdded = function(v31, v32)
    if v32:IsA("VisualizationMode") then
        local v33 = v1.new();
        local v34 = v33:add(v4.new(v32));
        table.insert(v31._visualizationModeTrackers, v34);
        v33:giveTask(v34.changed:Connect(function()
            v31:_queueUpdateState();
        end));
        v33:giveTask(function()
            local v35 = table.find(v31._visualizationModeTrackers, v34);
            if v35 then
                table.remove(v31._visualizationModeTrackers, v35);
                v31:_queueUpdateState();
            end;
        end);
        v31._maid[v32] = v33;
        v31:_queueUpdateState();
        return ;
    else
        return ;
    end;
end;
v5.destroy = function(v36)
    v36._maid:destroy();
end;
return v5;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("VisualizationModes");
local l_VisualizationModeService_0 = game:GetService("VisualizationModeService");
local _ = require(l_script_FirstAncestor_0.Src.Types);
local v3 = require(l_script_FirstAncestor_0.Src.Util.Maid);
local v4 = require(l_script_FirstAncestor_0.Src.Util.Signal);
local v5 = require(script.Parent.VisualizationModeCategoryTracker);
local v6 = {};
v6.__index = v6;
v6.new = function()
    local v7 = setmetatable({}, v6);
    v7._maid = v3.new();
    v7._categoryTrackers = {};
    v7._state = nil;
    v7.changed = v7._maid:add(v4.new());
    v7:_startTracking();
    return v7;
end;
v6.getState = function(v8)
    return v8._state;
end;
v6._setState = function(v9, v10)
    if v9._state == v10 then
        return ;
    else
        v9._state = v10;
        v9.changed:Fire(v10);
        return ;
    end;
end;
v6._startTracking = function(v11)
    v11._maid:giveTask(l_VisualizationModeService_0.ChildAdded:Connect(function(v12)
        v11:_handleChildAdded(v12);
    end));
    v11._maid:giveTask(l_VisualizationModeService_0.ChildRemoved:Connect(function(v13)
        v11._maid[v13] = nil;
    end));
end;
v6.updateVisualizationModeIsEnabled = function(v14, v15, v16, v17)
    for _, v19 in v14._categoryTrackers, nil, nil do
        local v20 = v19:getState();
        if v20 ~= nil and v20.name == v15 then
            v19:updateVisualizationModeIsEnabled(v16, v17);
        end;
    end;
end;
v6.updateVisualizationModeCategoryIsEnabled = function(v21, v22, v23)
    for _, v25 in v21._categoryTrackers, nil, nil do
        local v26 = v25:getState();
        if v26 ~= nil and v26.name == v22 then
            v25:setIsCategoryEnabled(v23);
        end;
    end;
end;
v6._handleChildAdded = function(v27, v28)
    if v28:IsA("VisualizationModeCategory") then
        local v29 = v3.new();
        local v30 = v29:add(v5.new(v28));
        v29:giveTask(v30.changed:Connect(function()
            v27:_queueUpdateState();
        end));
        table.insert(v27._categoryTrackers, v30);
        v29:giveTask(function()
            local v31 = table.find(v27._categoryTrackers, v30);
            if v31 then
                table.remove(v27._categoryTrackers, v31);
            end;
            v27:_queueUpdateState();
        end);
        v27._maid[v28] = v29;
        v27:_queueUpdateState();
        return ;
    else
        return ;
    end;
end;
v6._queueUpdateState = function(v32)
    if not v32._maid._stateUpdateQueue then
        v32._maid._stateUpdateQueue = task.defer(function()
            v32._maid._stateUpdateQueue = nil;
            v32:_updateState();
        end);
        return ;
    else
        return ;
    end;
end;
v6._updateState = function(v33)
    local v34 = {};
    for _, v36 in v33._categoryTrackers, nil, nil do
        local v37 = v36:getState();
        if v37 then
            table.insert(v34, v37);
        end;
    end;
    table.sort(v34, function(v38, v39)
        return v38.title < v39.title;
    end);
    v33:_setState(table.freeze(v34));
end;
v6.destroy = function(v40)
    v40._maid:destroy();
end;
return v6;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("VisualizationModes");
local _ = require(l_script_FirstAncestor_0.Src.Types);
local v2 = require(l_script_FirstAncestor_0.Src.Util.Maid);
local v3 = require(l_script_FirstAncestor_0.Src.Util.Signal);
local v4 = {};
v4.__index = v4;
v4.new = function(v5)
    local v6 = false;
    if typeof(v5) == "Instance" then
        v6 = v5:IsA("VisualizationMode");
    end;
    assert(v6, "Bad visualizationMode");
    local v7 = setmetatable({}, v4);
    v7._maid = v2.new();
    v7._visualizationMode = v5;
    v7._state = nil;
    v7.changed = v7._maid:add(v3.new());
    v7:_startTracking();
    return v7;
end;
v4.getState = function(v8)
    return v8._state;
end;
v4._setState = function(v9, v10)
    if v9._state == v10 then
        return ;
    else
        v9._state = v10;
        v9.changed:Fire(v10);
        return ;
    end;
end;
v4._startTracking = function(v11)
    v11._maid:giveTask(v11._visualizationMode:GetPropertyChangedSignal("Name"):Connect(function()
        v11:_updateState();
    end));
    v11._maid:giveTask(v11._visualizationMode:GetPropertyChangedSignal("Title"):Connect(function()
        v11:_updateState();
    end));
    v11._maid:giveTask(v11._visualizationMode:GetPropertyChangedSignal("Enabled"):Connect(function()
        v11:_updateState();
    end));
    v11._maid:giveTask(v11._visualizationMode:GetPropertyChangedSignal("ToolTip"):Connect(function()
        v11:_updateState();
    end));
    v11:_updateState();
end;
v4.updateVisualizationModeIsEnabled = function(v12, v13)
    v12._visualizationMode.Enabled = v13;
end;
v4._updateState = function(v14)
    v14:_setState(table.freeze({
        name = v14._visualizationMode.Name,
        title = v14._visualizationMode.Title,
        enabled = v14._visualizationMode.Enabled,
        toolTip = v14._visualizationMode.ToolTip
    }));
end;
v4.destroy = function(v15)
    v15._maid:destroy();
end;
return v4;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("VisualizationModes");
local _ = require(l_script_FirstAncestor_0.Src.Types);
local v2 = require(l_script_FirstAncestor_0.Packages.Cryo);
local v3 = require(l_script_FirstAncestor_0.Packages.Dash);
local v4 = require(l_script_FirstAncestor_0.Src.Util.Maid);
local v5 = require(l_script_FirstAncestor_0.Src.Util.Signal);
local v6 = {};
v6.__index = v6;
local function _(v7)
    local v8 = false;
    if typeof(v7) == "table" then
        v8 = false;
        if typeof(v7.visualizationModeCategoryName) == "string" then
            v8 = false;
            if typeof(v7.visualizationModeName) == "string" then
                v8 = typeof(v7.lastEditUnixTimeStamp) == "number";
            end;
        end;
    end;
    return v8;
end;
local function _(v10, v11)
    local v12 = false;
    if v10.visualizationModeCategoryName == v11.visualizationModeCategoryName then
        v12 = v10.visualizationModeName == v11.visualizationModeName;
    end;
    return v12;
end;
v6.new = function(v14)
    local v15 = setmetatable({}, v6);
    v15._maid = v4.new();
    v15._plugin = assert(v14, "No plugin");
    v15._recentModeRecordList = {};
    v15._lastReportedClientCombinerStateMap = {};
    v15._state = nil;
    v15._session = nil;
    v15.changed = v15._maid:add(v5.new());
    v15:_connectToFocusedDataModelSession();
    v15._maid:giveTask(v15._plugin:OnInvoke("reportClientCombinerState", function(v16)
        v15._lastReportedClientCombinerStateMap[v16.hostDataModelType] = v16;
        v15:_queueUpdateState();
    end));
    v15:_loadRecentRecords();
    v15._plugin:Invoke("queryClientCombinerState");
    return v15;
end;
v6._queueUpdateState = function(v17)
    if not v17._maid._stateUpdateQueue then
        v17._maid._stateUpdateQueue = task.defer(function()
            v17._maid._stateUpdateQueue = nil;
            v17:_updateState();
        end);
        return ;
    else
        return ;
    end;
end;
v6._updateState = function(v18)
    local v19 = {};
    local l_None_0 = Enum.StudioDataModelType.None;
    if v18._session ~= nil then
        l_None_0 = v18._session.CurrentDataModelType;
    end;
    for v21, v22 in v18._lastReportedClientCombinerStateMap, nil, nil do
        for _, v24 in v22.visualizationModeServiceState, nil, nil do
            local v25 = v19[v24.name];
            if v25 == nil then
                v25 = {
                    lastState = v24,
                    visualizationModes = {}
                };
                v19[v24.name] = v25;
            end;
            if v21 == l_None_0 then
                v25.lastState = v24;
            end;
            for _, v27 in v24.visualizationModeList, nil, nil do
                v25.visualizationModes[v27.name] = v27;
            end;
        end;
    end;
    local v28 = {};
    for _, v30 in v19, nil, nil do
        table.insert(v28, v30.lastState);
    end;
    table.sort(v28, function(v31, v32)
        return v31.title < v32.title;
    end);
    local v33 = {};
    for _, v35 in v18._recentModeRecordList, nil, nil do
        local v36 = v19[v35.visualizationModeCategoryName];
        if v36 ~= nil then
            local v37 = v36.visualizationModes[v35.visualizationModeName];
            if v37 ~= nil then
                local v38 = table.clone(v37);
                v38.visualizationModeCategoryName = v35.visualizationModeCategoryName;
                table.insert(v33, v38);
            end;
        end;
    end;
    v18:_setState(table.freeze({
        categories = v28,
        recentModes = table.freeze(v33)
    }));
end;
v6._setState = function(v39, v40)
    if v39._state == v40 then
        return ;
    else
        v39._state = v40;
        v39.changed:Fire(v40);
        return ;
    end;
end;
v6.getState = function(v41)
    return v41._state;
end;
v6.updateVisualizationModeCategoryIsEnabled = function(v42, v43, v44)
    v42._plugin:Invoke("updateVisualizationModeCategoryIsEnabled", v43, v44);
    for v45, v46 in v42._lastReportedClientCombinerStateMap, nil, nil do
        v42._lastReportedClientCombinerStateMap[v45] = v2.Dictionary.join(v46, {
            visualizationModeServiceState = v3.map(v46.visualizationModeServiceState, function(v47)
                if v47.name ~= v43 then
                    return v47;
                else
                    return v2.Dictionary.join(v47, {
                        enabled = v44
                    });
                end;
            end)
        });
    end;
    v42:_queueUpdateState();
end;
v6.updateVisualizationModeIsEnabled = function(v48, v49, v50, v51)
    v48._plugin:Invoke("updateVisualizationModeIsEnabled", v49, v50, v51);
    for v52, v53 in v48._lastReportedClientCombinerStateMap, nil, nil do
        v48._lastReportedClientCombinerStateMap[v52] = v2.Dictionary.join(v53, {
            visualizationModeServiceState = v3.map(v53.visualizationModeServiceState, function(v54)
                if v54.name ~= v49 then
                    return v54;
                else
                    return v2.Dictionary.join(v54, {
                        visualizationModeList = v3.map(v54.visualizationModeList, function(v55)
                            if v55.name ~= v50 then
                                return v55;
                            else
                                return v2.Dictionary.join(v55, {
                                    enabled = v51
                                });
                            end;
                        end)
                    });
                end;
            end)
        });
    end;
    v48:_queueUpdateState();
end;
v6._loadRecentRecords = function(v56)
    local l_Setting_0 = v56._plugin:GetSetting("RecentVisualizationModes");
    if typeof(l_Setting_0) ~= "table" then
        return ;
    else
        local v58 = {};
        for _, v60 in l_Setting_0, nil, nil do
            local v61 = false;
            if typeof(v60) == "table" then
                v61 = false;
                if typeof(v60.visualizationModeCategoryName) == "string" then
                    v61 = false;
                    if typeof(v60.visualizationModeName) == "string" then
                        v61 = typeof(v60.lastEditUnixTimeStamp) == "number";
                    end;
                end;
            end;
            if v61 then
                table.insert(v58, v60);
            end;
        end;
        table.sort(v58, function(v62, v63)
            return v63.lastEditUnixTimeStamp < v62.lastEditUnixTimeStamp;
        end);
        while #v58 > 3 do
            table.remove(v58);
        end;
        v56._recentModeRecordList = v58;
        v56:_queueUpdateState();
        return ;
    end;
end;
v6._connectToFocusedDataModelSession = function(v64)
    local l_MultipleDocumentInterfaceInstance_0 = v64._plugin.MultipleDocumentInterfaceInstance;
    if l_MultipleDocumentInterfaceInstance_0 == nil then
        return ;
    else
        local l_FocusedDataModelSession_0 = l_MultipleDocumentInterfaceInstance_0.FocusedDataModelSession;
        if l_FocusedDataModelSession_0 == nil then
            return ;
        else
            v64._session = l_FocusedDataModelSession_0;
            v64._maid:giveTask(l_FocusedDataModelSession_0.CurrentDataModelTypeChanged:Connect(function()
                v64:_queueUpdateState();
            end));
            return ;
        end;
    end;
end;
v6.recordRecentVisualizationMode = function(v67, v68, v69)
    local v70 = {
        visualizationModeCategoryName = v68,
        visualizationModeName = v69,
        lastEditUnixTimeStamp = DateTime.now().UnixTimestamp
    };
    local v71 = nil;
    local v72 = nil;
    for v73, v74 in v67._recentModeRecordList, nil, nil do
        local v75 = false;
        if v74.visualizationModeCategoryName == v70.visualizationModeCategoryName then
            v75 = v74.visualizationModeName == v70.visualizationModeName;
        end;
        if not v75 then
            if v72 == nil then
                v72 = v73;
            elseif v74.lastEditUnixTimeStamp < v67._recentModeRecordList[v72].lastEditUnixTimeStamp then
                v72 = v73;
            end;
        else
            v71 = v73;
        end;
    end;
    local v76 = nil;
    v76 = if v71 ~= nil then v71 else if #v67._recentModeRecordList >= 3 and v72 ~= nil then v72 else #v67._recentModeRecordList + 1;
    local v77 = table.clone(v67._recentModeRecordList);
    v77[v76] = v70;
    v67._recentModeRecordList = table.freeze(v77);
    v67._plugin:SetSetting("RecentVisualizationModes", v77);
    v67:_queueUpdateState();
end;
v6.destroy = function(v78)
    v78._maid:destroy();
end;
return v6;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("VisualizationModes");
local _ = require(l_script_FirstAncestor_0.Src.Types);
local v2 = require(l_script_FirstAncestor_0.Src.Util.Maid);
local _ = require(l_script_FirstAncestor_0.Src.Model.Tracking.VisualizationModeServiceTracker);
local v4 = {};
v4.__index = v4;
v4.new = function(v5, v6)
    local v7 = setmetatable({}, v4);
    v7._maid = v2.new();
    v7._visualizationModeServiceTracker = assert(v6, "No tracker");
    v7._plugin = assert(v5, "No plugin");
    v7:_setupStateBinding();
    v7:_bindRemoteRequests();
    return v7;
end;
v4._bindRemoteRequests = function(v8)
    v8._maid:giveTask(v8._plugin:OnInvoke("updateVisualizationModeIsEnabled", function(v9, v10, v11)
        assert(typeof(v9) == "string", "Bad visualizationModeCategoryName");
        assert(typeof(v10) == "string", "Bad visualizationModeName");
        assert(typeof(v11) == "boolean", "Bad isEnabled");
        v8._visualizationModeServiceTracker:updateVisualizationModeIsEnabled(v9, v10, v11);
    end));
    v8._maid:giveTask(v8._plugin:OnInvoke("updateVisualizationModeCategoryIsEnabled", function(v12, v13)
        assert(typeof(v12) == "string", "Bad visualizationModeCategoryName");
        assert(typeof(v13) == "boolean", "Bad isEnabled");
        v8._visualizationModeServiceTracker:updateVisualizationModeCategoryIsEnabled(v12, v13);
    end));
end;
v4._setupStateBinding = function(v14)
    v14._maid:giveTask(v14._visualizationModeServiceTracker.changed:Connect(function()
        v14:_reportCombinerClientState();
    end));
    v14._maid:giveTask(v14._plugin:OnInvoke("queryClientCombinerState", function()
        v14:_reportCombinerClientState();
    end));
    v14._maid:giveTask(v14._plugin:GetPropertyChangedSignal("HostDataModelType"):Connect(function()
        v14:_reportCombinerClientState();
    end));
    v14._maid:giveTask(function()
        v14:_reportCombinerClientClosingState();
    end);
    v14:_reportCombinerClientState();
end;
v4._reportCombinerClientState = function(v15)
    local v16 = v15._visualizationModeServiceTracker:getState();
    if v16 == nil then
        return ;
    else
        v15._plugin:Invoke("reportClientCombinerState", {
            visualizationModeServiceState = v16,
            hostDataModelType = v15._plugin.HostDataModelType
        });
        return ;
    end;
end;
v4._reportCombinerClientClosingState = function(v17)
    v17._plugin:Invoke("reportClientCombinerState", {
        visualizationModeServiceState = {},
        hostDataModelType = v17._plugin.HostDataModelType
    });
end;
v4.destroy = function(v18)
    v18._maid:destroy();
end;
return v4;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("VisualizationModes");
local _ = require(l_script_FirstAncestor_0.Src.Types);
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local v3 = require(l_script_FirstAncestor_0.Src.Hooks.useInstanceSetting);
return function(v4)
    local v5, v6 = v3(v4.Setting, v4.Property, false);
    return v2.createElement("VisualizationMode", {
        Title = v4.Title,
        Enabled = v5,
        ToolTip = v4.ToolTip,
        [v2.Change.Enabled] = v2.useCallback(function(v7)
            v6(v7.Enabled);
            local l_Setting_0 = v4.Setting;
            if l_Setting_0 then
                l_Setting_0[v4.Property] = v7.Enabled;
            end;
        end, {
            v4.Setting,
            v4.Property
        })
    });
end;