local l_Workspace_0 = game:GetService("Workspace");
local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
local v2 = require(l_script_FirstAncestor_0.Packages.Dash);
local v3 = require(l_script_FirstAncestor_0.Packages.Framework);
local v4 = require(l_script_FirstAncestor_0.Packages.React);
local v5 = require(l_script_FirstAncestor_0.Src.Util.isAvatar);
local _ = require(l_script_FirstAncestor_0.Src.Resources.Theme);
local v7 = require(script.Parent.AvatarCell);
local v8 = require(script.Parent.ImportPage);
local l_Grid_0 = v3.UI.Grid;
local l_Localization_0 = v3.ContextServices.Localization;
local l_Stylizer_0 = v3.ContextServices.Stylizer;
local function v15()
    local v12 = {};
    debug.profilebegin("Find avatars");
    for _, v14 in l_Workspace_0:GetDescendants() do
        if v5(v14) then
            table.insert(v12, {
                Key = v14:GetDebugId(),
                Avatar = v14
            });
        end;
    end;
    debug.profileend();
    return v12;
end;
local function v17(v16)
    return v16:gsub("([.%%^$()%[%]+*-?])", "%%%1");
end;
local function _(v18, v19)
    if #v19 == 0 then
        return v18;
    else
        return v2.filter(v18, function(v20)
            return v20.Avatar.Name:match(v17(v19));
        end);
    end;
end;
return function(v22)
    local v23 = l_Stylizer_0:use("ImportPage");
    local v24 = l_Localization_0:use();
    local v25 = v4.useMemo(v15);
    local v26, v27 = v4.useState("");
    return v4.createElement(v8, {
        Title = v24:getText("SelectScreen", "CurrentPlace"),
        GoBack = v22.GoBack,
        Search = v26,
        SetSearch = v27
    }, {
        Grid = v4.createElement(l_Grid_0, {
            Cells = if #v26 == 0 then v25 else v2.filter(v25, function(v28)
                return v28.Avatar.Name:match(v17(v26));
            end),
            CellComponent = v7,
            CellPadding = v23.GridPadding,
            CellSize = UDim2.fromOffset(v23.Avatar.IconSize, ((v23.Avatar.IconSize + v23.Avatar.NameFontSize) + v23.Avatar.NameLines) + v23.Avatar.Padding)
        })
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
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.ReactRoblox);
local _ = require(l_script_FirstAncestor_0.Src.Resources.Theme);
local l_UI_0 = v1.UI;
local l_IconButton_0 = l_UI_0.IconButton;
local l_Pane_0 = l_UI_0.Pane;
local l_SearchBar_0 = l_UI_0.SearchBar;
local l_Separator_0 = l_UI_0.Separator;
local l_TextLabel_0 = l_UI_0.TextLabel;
local l_Stylizer_0 = v1.ContextServices.Stylizer;
local l_LayoutOrderIterator_0 = v1.Util.LayoutOrderIterator;
return function(v13)
    local v14 = l_Stylizer_0:use("ImportPage");
    local v15, v16 = v2.useBinding(Vector2.new());
    local v17 = l_LayoutOrderIterator_0.new();
    return v2.createElement(l_Pane_0, {}, {
        Header = v2.createElement(l_Pane_0, {
            Layout = Enum.FillDirection.Horizontal,
            Style = "SubtleBox",
            Size = UDim2.new(1, 0, 0, v14.HeaderHeight)
        }, {
            LeftSide = v2.createElement(l_Pane_0, {
                AutomaticSize = Enum.AutomaticSize.X,
                Layout = Enum.FillDirection.Horizontal,
                LayoutOrder = v17:getNextOrder(),
                Size = UDim2.fromScale(0, 1),
                [v3.Change.AbsoluteSize] = function(v18)
                    v16(v18.AbsoluteSize);
                end
            }, {
                Padding = v2.createElement("UIPadding", {
                    PaddingRight = UDim.new(0, 4)
                }),
                GoBackButton = v2.createElement(l_Pane_0, {
                    LayoutOrder = v17:getNextOrder(),
                    Size = v14.BackButton.Size
                }, {
                    IconButton = v2.createElement(l_IconButton_0, {
                        BackgroundStyle = "None",
                        IconColor = v14.ArrowColor,
                        LeftIcon = v14.ArrowImage,
                        IconScaleType = Enum.ScaleType.Stretch,
                        IconSize = v14.BackButton.IconSize,
                        Rotation = -90,
                        Size = UDim2.fromScale(1, 1),
                        OnClick = v13.GoBack
                    })
                }),
                Separator = v2.createElement(l_Separator_0, {
                    DominantAxis = Enum.DominantAxis.Height,
                    LayoutOrder = v17:getNextOrder(),
                    Style = "SelectScreenSeparator"
                }),
                TitleLabel = v2.createElement(l_TextLabel_0, {
                    AutomaticSize = Enum.AutomaticSize.XY,
                    LayoutOrder = v17:getNextOrder(),
                    Text = v13.Title
                }, {
                    Padding = v2.createElement("UIPadding", {
                        PaddingLeft = UDim.new(0, 4)
                    })
                })
            }),
            SearchBar = v2.createElement(l_SearchBar_0, {
                LayoutOrder = v17:getNextOrder(),
                Size = v15:map(function(v19)
                    return UDim2.new(UDim.new(1, -v19.X), v14.SearchBarHeight);
                end),
                Text = v13.Search,
                OnTextChanged = v13.SetSearch
            })
        }),
        Contents = v2.createElement(l_Pane_0, {
            Position = UDim2.fromOffset(0, v14.HeaderHeight),
            Size = UDim2.new(1, 0, 1, -v14.HeaderHeight)
        }, v13.children)
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
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.Flags.getFFlagAvatarPreviewerAddGeoToSelection);
local v4 = v3();
local v5 = require(l_script_FirstAncestor_0.Src.Hooks.useSelection);
local _ = require(l_script_FirstAncestor_0.Src.Resources.Theme);
local v7 = require(script.CurrentPlacePage);
local l_UI_0 = v1.UI;
local l_IconButton_0 = l_UI_0.IconButton;
local l_Pane_0 = l_UI_0.Pane;
local l_TextLabel_0 = l_UI_0.TextLabel;
local l_Analytics_0 = v1.ContextServices.Analytics;
local l_Localization_0 = v1.ContextServices.Localization;
local l_Stylizer_0 = v1.ContextServices.Stylizer;
local l_LayoutOrderIterator_0 = v1.Util.LayoutOrderIterator;
return function()
    local v16 = l_Analytics_0:use();
    local v17 = l_Localization_0:use();
    local v18 = l_Stylizer_0:use("SelectScreen");
    local v19, v20 = v2.useState(nil);
    local v21 = v2.useCallback(function()
        v20(nil);
    end, {});
    local v22 = nil;
    if v4 then
        v22 = v5();
    end;
    if v19 == "CurrentPlace" then
        return v2.createElement(v7, {
            GoBack = v21
        });
    else
        local v23 = l_LayoutOrderIterator_0.new();
        local v24;
        if not v3() then
            v24 = false;
        else
            v24 = false;
            if #v22 == 1 then
                v24 = v22[1]:IsA("MeshPart");
            end;
        end;
        return v2.createElement(l_Pane_0, {
            Layout = Enum.FillDirection.Vertical,
            Spacing = v18.Spacing,
            HorizontalAlignment = Enum.HorizontalAlignment.Center,
            VerticalAlignment = Enum.VerticalAlignment.Center
        }, {
            ImportCharacterFrom = if v3() then nil else v2.createElement(l_TextLabel_0, {
                AutomaticSize = Enum.AutomaticSize.XY,
                LayoutOrder = v23:getNextOrder(),
                Text = v17:getText("SelectScreen", "ImportCharacterFrom")
            }),
            Buttons = v2.createElement(l_Pane_0, {
                AutomaticSize = Enum.AutomaticSize.XY,
                Layout = if not v3() then Enum.FillDirection.Horizontal else Enum.FillDirection.Vertical,
                Spacing = if not v3() then nil else v18.Spacing,
                HorizontalAlignment = Enum.HorizontalAlignment.Center,
                LayoutOrder = v23:getNextOrder()
            }, {
                AddSelected = if not v3() then nil else v2.createElement(l_IconButton_0, {
                    AutomaticSize = Enum.AutomaticSize.X,
                    LayoutOrder = v23:getNextOrder(),
                    OnClick = if not v24 then nil else function()
                        local v25 = v22[1];
                        v25.Name = v25.Name .. "_Geo";
                    end,
                    Size = UDim2.fromOffset(0, v18.ButtonHeight),
                    Text = v17:getText("SelectScreen", "AddSelected"),
                    TooltipText = if v24 then nil else v17:getText("SelectScreen", "AddSelectedTooltip")
                }),
                CurrentPlace = v2.createElement(l_IconButton_0, {
                    AutomaticSize = Enum.AutomaticSize.X,
                    LayoutOrder = v23:getNextOrder(),
                    OnClick = function()
                        v16:report("selectScreenChoice", "CurrentPlace");
                        v20("CurrentPlace");
                    end,
                    Size = UDim2.fromOffset(0, v18.ButtonHeight),
                    Text = if not v3() then v17:getText("SelectScreen", "CurrentPlace") else v17:getText("SelectScreen", "BrowseCurrentPlace")
                })
            })
        });
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
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.Components.PlacesServiceContext);
local _ = require(l_script_FirstAncestor_0.Src.Resources.Theme);
local l_UI_0 = v1.UI;
local l_IconButton_0 = l_UI_0.IconButton;
local l_Pane_0 = l_UI_0.Pane;
local l_TextLabel_0 = l_UI_0.TextLabel;
local l_Localization_0 = v1.ContextServices.Localization;
local l_Stylizer_0 = v1.ContextServices.Stylizer;
local l_LayoutOrderIterator_0 = v1.Util.LayoutOrderIterator;
return function()
    local v12 = l_Localization_0:use();
    local v13 = l_Stylizer_0:use("TestingScreen");
    local v14 = l_LayoutOrderIterator_0.new();
    local v15 = v2.useContext(v3);
    return v2.createElement(l_Pane_0, {
        Layout = Enum.FillDirection.Vertical,
        Spacing = v13.Spacing,
        HorizontalAlignment = Enum.HorizontalAlignment.Center,
        VerticalAlignment = Enum.VerticalAlignment.Center
    }, {
        Description = v2.createElement(l_TextLabel_0, {
            AutomaticSize = Enum.AutomaticSize.XY,
            LayoutOrder = v14:getNextOrder(),
            Text = v12:getText("TestingScreen", "Description")
        }),
        StopButton = v2.createElement(l_IconButton_0, {
            AutomaticSize = Enum.AutomaticSize.X,
            LayoutOrder = v14:getNextOrder(),
            OnClick = function()
                v15.stopPlaySolo();
            end,
            Size = UDim2.fromOffset(0, v13.ButtonHeight),
            Text = v12:getText("TestingScreen", "Stop")
        })
    });
end;


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.React);
local v2 = require(l_Parent_0.Src.Util.SimpleSerializedStateContext);
local _ = require(l_Parent_0.Src.Types);
local v4 = require(l_Parent_0.Src.Hooks.useSerializedState);
return function(v5)
    local v6, v7 = v4(v5.root, "stage", "CheckBody");
    local v8, v9 = v4(v5.root, "textured", true);
    return v1.createElement(v2.Provider, {
        value = {
            stage = v6,
            setStage = v7,
            isTextured = v8,
            setIsTextured = v9
        }
    }, v5.children);
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
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.Components.AvatarScreenContext);
local _ = require(l_script_FirstAncestor_0.Src.Resources.Theme);
local v5 = require(l_script_FirstAncestor_0.Src.Hooks.useToggleState);
local v6 = require(l_script_FirstAncestor_0.Src.Flags.getFFlagAvatarPreviewerSkinToneAlphaDetection);
local v7 = v6();
local l_UI_0 = v1.UI;
local l_Pane_0 = l_UI_0.Pane;
local l_Tooltip_0 = l_UI_0.Tooltip;
local l_Localization_0 = v1.ContextServices.Localization;
local l_Stylizer_0 = v1.ContextServices.Stylizer;
return function(v13)
    local v14 = nil;
    local v15 = nil;
    if v7 then
        v15 = l_Stylizer_0:use("SkinPreview");
        v14 = l_Localization_0:use();
    end;
    local v16 = nil;
    if v7 then
        v16 = v2.useContext(v3.Context);
    end;
    local v17 = v5(false);
    local l_Item_0 = v13.Item;
    if not (not v7 or v16.isColorable) then
        l_Item_0 = Color3.new(l_Item_0.R * v15.DisabledColorToBlend.R, l_Item_0.G * v15.DisabledColorToBlend.G, l_Item_0.B * v15.DisabledColorToBlend.B);
    end;
    if not v7 then
        v15 = l_Stylizer_0:use("SkinPreview");
    end;
    return v2.createElement(l_Pane_0, {
        BackgroundColor = l_Item_0,
        OnClick = if not v7 or v16.isColorable then nil else function()
        end,
        Style = "SkinPreview",
        [v2.Event.MouseEnter] = v17.enable,
        [v2.Event.MouseLeave] = v17.disable,
        [v2.Tag] = "data-testid=SkinPreview"
    }, {
        Border = if not v13.Selected then if v17.enabled then v2.createElement("UIStroke", {
            Color = v15.HoveredBorderColor,
            Thickness = v15.HoveredBorderThickness
        }) else nil else v2.createElement("UIStroke", {
            Color = v15.SelectedBorderColor,
            Thickness = v15.SelectedBorderThickness
        }),
        Tooltip = (v6() and not v16.isColorable) and v2.createElement(l_Tooltip_0, {
            Text = v14:getText("SkinPreview", "NoAlphaWarning")
        })
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
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.Resources.Theme);
local _ = require(l_script_FirstAncestor_0.Src.Types);
local v5 = require(l_script_FirstAncestor_0.Src.Util.TestInExperienceUtil);
local v6 = require(l_script_FirstAncestor_0.Src.Hooks.useCreatedByAutoSetup);
local v7 = require(l_script_FirstAncestor_0.Src.Hooks.useCreatedByAutoSetup_DEPRECATED);
local v8 = require(l_script_FirstAncestor_0.Src.Hooks.useToggleState);
local v9 = require(l_script_FirstAncestor_0.Src.Components.AvatarSettings);
local v10 = require(l_script_FirstAncestor_0.Src.Components.PlacesServiceContext);
local v11 = require(l_script_FirstAncestor_0.Src.Components.SubmitDialog);
local v12 = require(l_script_FirstAncestor_0.Src.Components.UGCValidationContext);
local v13 = require(l_script_FirstAncestor_0.Src.Flags.getFFlagAvatarPreviewerAutoSetup)();
local v14 = require(l_script_FirstAncestor_0.Src.Flags.getFFlagAvatarPreviewerAutoSetupDisablePublish);
local v15 = require(l_script_FirstAncestor_0.Src.Flags.getFFlagAvatarPreviewerTestWithAssets);
local v16 = require(l_script_FirstAncestor_0.Src.Flags.getFFlagAvatarPreviewerAutoSetupTelemetryV2);
local l_UI_0 = v1.UI;
local l_IconButton_0 = l_UI_0.IconButton;
local l_Pane_0 = l_UI_0.Pane;
local l_LayoutOrderIterator_0 = v1.Util.LayoutOrderIterator;
local l_Analytics_0 = v1.ContextServices.Analytics;
local l_Localization_0 = v1.ContextServices.Localization;
local l_Stylizer_0 = v1.ContextServices.Stylizer;
local function v29(v24)
    local v25 = l_Stylizer_0:use("StageSelector");
    local v26 = l_Localization_0:use();
    local v27 = v24.Enabled ~= false;
    local v28 = v2.createElement(l_IconButton_0, {
        AnchorPoint = v24.AnchorPoint,
        BackgroundColor = if not v24.IsSelected then v25.BackgroundColor else v25.ButtonSelectedBackgroundColor,
        BackgroundStyle = "SubtleBox",
        IconColor = if not v27 then v25.IconColorDisabled else v25.IconColor,
        IconScaleType = Enum.ScaleType.Stretch,
        IconSize = v25.IconSize,
        LeftIcon = v24.Icon,
        LayoutOrder = v24.LayoutOrder,
        Size = UDim2.new(1, 0, 0, v25.ButtonHeight),
        Padding = 0,
        Position = v24.Position,
        TooltipStyle = "NoDelay",
        TooltipText = v24.Tooltip or v26:getText("Stages", v24.StageText),
        OnClick = if not v27 then nil else v24.OnClick
    });
    if v27 then
        return v28;
    else
        return v2.createElement(v2.Fragment, {}, {
            IconButton = v28,
            [("%*_Disabled"):format(v24.StageText)] = v2.createElement("Folder")
        });
    end;
end;
return function(v30)
    local v31 = l_Stylizer_0:use("StageSelector");
    local v32 = l_Localization_0:use();
    local v33 = l_LayoutOrderIterator_0.new();
    local v34 = l_Analytics_0:use();
    local v35 = v2.useContext(v10);
    local v36 = v8(false);
    local v37 = v8(false);
    local v38 = not not v13 and if v14() or v16() then v6(v30.Avatar.WorldModel) else v7(v30.Avatar);
    local v39 = v2.useContext(v12.Context);
    local v40 = true;
    if v39.canUploadBundles ~= nil then
        v40 = v39.canUploadBundles.type ~= "notAllowed";
    end;
    return v2.createElement(l_Pane_0, {
        BackgroundColor = v31.BackgroundColor,
        Size = UDim2.new(0, v31.Width, 1, 0),
        ZIndex = 2
    }, {
        Contents = v2.createElement(l_Pane_0, {
            Layout = Enum.FillDirection.Vertical,
            VerticalAlignment = Enum.VerticalAlignment.Top
        }, {
            CheckBody = v2.createElement(v29, {
                LayoutOrder = v33:getNextOrder(),
                Icon = "rbxasset://studio_svg_textures/Lua/AvatarCompatibilityPreviewer/Dark/Large/" .. "check_body.png",
                IsSelected = v30.SelectedStage == "CheckBody",
                StageText = "CheckBody",
                OnClick = function()
                    v34:report("setStage", "CheckBody");
                    v30.SetStage("CheckBody");
                end
            }),
            CheckFace = v2.createElement(v29, {
                LayoutOrder = v33:getNextOrder(),
                Icon = "rbxasset://studio_svg_textures/Lua/AvatarCompatibilityPreviewer/Dark/Large/" .. "check_face.png",
                IsSelected = v30.SelectedStage == "CheckFace",
                StageText = "CheckFace",
                OnClick = function()
                    v34:report("setStage", "CheckFace");
                    v30.SetStage("CheckFace");
                end
            }),
            Test = v2.createElement(v29, {
                LayoutOrder = v33:getNextOrder(),
                Icon = "rbxasset://studio_svg_textures/Lua/AvatarCompatibilityPreviewer/Dark/Large/" .. "test.png",
                IsSelected = false,
                StageText = "Test",
                OnClick = function()
                    v34:report("testInExperience");
                    if not v15() then
                        v5.DEPRECATED_test(v35, v30.Avatar);
                        return ;
                    else
                        v5.test(v35, v30.PreviewDummy);
                        return ;
                    end;
                end
            }),
            Publish = v2.createElement(v29, {
                LayoutOrder = v33:getNextOrder(),
                Icon = "rbxasset://studio_svg_textures/Lua/AvatarCompatibilityPreviewer/Dark/Large/" .. "publish.png",
                IsSelected = false,
                StageText = not v14() and "Publish" or (v38 and "Publish_AutoSetupDisabled" or "Publish"),
                Tooltip = if (v39.canUploadBundles ~= nil and v39.canUploadBundles.type == "notAllowed") and (not (v39.canUploadBundles.denyReason ~= "MissingPremiumSubscriptionTier") or v39.canUploadBundles.denyReason == "MissingIdVerification") then v32:getText("StageSelector", (("Publish_Deny_%*"):format(v39.canUploadBundles.denyReason))) else nil,
                Enabled = if v40 then if v14() then not v38 else nil else false,
                OnClick = function()
                    if not v13 then
                        v34:report("publish");
                    else
                        v34:report("publish", v38);
                    end;
                    v36.enable();
                end
            })
        }),
        SettingsButton = v2.createElement(v29, {
            Icon = "rbxassetid://6663675885",
            IsSelected = false,
            StageText = "Settings",
            AnchorPoint = Vector2.new(0, 1),
            Position = UDim2.fromScale(0, 1),
            OnClick = v37.enable
        }),
        SettingsMenu = v37.enabled and v2.createElement(v9, {
            worldModel = v30.Avatar.WorldModel,
            close = v37.disable
        }),
        SubmitDialog = v36.enabled and v2.createElement(v11, {
            close = v36.disable,
            avatar = v30.Avatar
        })
    });
end;


local v0 = require(script:FindFirstAncestor("AvatarCompatibilityPreviewer").Packages.React);
local l_status_0, l_result_0 = pcall(function()
    return game:GetService("StudioAssetService");
end);
return (v0.createContext({
    showSaveToRoblox = function(...)
        if not l_status_0 then
            error("Calling showSaveToRoblox on unmocked StudioAssetService");
            return ;
        else
            l_result_0:ShowSaveToRoblox(...);
            return ;
        end;
    end,
    onUGCSubmitCompleted = if not l_status_0 then nil else l_result_0.OnUGCSubmitCompleted
}));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
local v1 = require(l_script_FirstAncestor_0.Packages.Dash);
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.Util.createUniqueKey);
local _ = require(l_script_FirstAncestor_0.Src.Types);
local _ = require(l_script_FirstAncestor_0.Src.Resources.Theme);
local l_UI_0 = v2.UI;
local l_Checkbox_0 = l_UI_0.Checkbox;
local l_Pane_0 = l_UI_0.Pane;
local l_TextLabel_0 = l_UI_0.TextLabel;
local l_Localization_0 = v2.ContextServices.Localization;
local l_Stylizer_0 = v2.ContextServices.Stylizer;
local l_LayoutOrderIterator_0 = v2.Util.LayoutOrderIterator;
return function(v14)
    local v15 = l_Localization_0:use();
    local v16 = l_Stylizer_0:use("SubmitInner");
    local v17 = l_LayoutOrderIterator_0.new();
    local v24 = v3.useCallback(function(v18)
        v14.setPublishChoices(function(v19)
            local v20 = table.clone(v19);
            local v21 = table.find(v20, v18);
            if v21 ~= nil then
                table.remove(v20, v21);
                return v20;
            else
                table.insert(v20, v18);
                table.sort(v20, function(v22, v23)
                    return assert(table.find(v14.availableChoices, v22), "Couldn't find available choice index for A") < assert(table.find(v14.availableChoices, v23), "Couldn't find available choice index for B");
                end);
                return v20;
            end;
        end);
    end, {
        v14.availableChoices
    });
    local v25 = v4();
    return v3.createElement(l_Pane_0, {
        AutomaticSize = Enum.AutomaticSize.Y,
        Layout = Enum.FillDirection.Vertical,
        Padding = v16.ContentPadding,
        Spacing = v16.CallToActionSpacing,
        HorizontalAlignment = Enum.HorizontalAlignment.Left,
        [v3.Change.AbsoluteSize] = function(v26)
            v14.setHeight(v26.AbsoluteSize.Y);
        end
    }, {
        Title = v3.createElement(l_TextLabel_0, {
            AutomaticSize = Enum.AutomaticSize.XY,
            LayoutOrder = v17:getNextOrder(),
            Text = v15:getText("SubmitInner", "CallToAction")
        }),
        Checkboxes = v3.createElement(l_Pane_0, {
            AutomaticSize = Enum.AutomaticSize.Y,
            Layout = Enum.FillDirection.Vertical,
            LayoutOrder = v17:getNextOrder(),
            HorizontalAlignment = Enum.HorizontalAlignment.Left,
            Spacing = v16.CheckboxSpacing
        }, v1.collectArray(v14.availableChoices, function(_, v28)
            return v3.createElement(l_Checkbox_0, {
                key = v25((tostring(v28.assetType))),
                Checked = table.find(v14.publishChoices, v28) ~= nil,
                Key = v28,
                LayoutOrder = v17:getNextOrder(),
                OnClick = v24,
                Text = v15:getText("SubmitInner", "ChoiceItem", {
                    assetType = v15:getText("AssetType", if typeof(v28.assetType) == "string" then v28.assetType else v28.assetType.Name),
                    instanceName = v28.instance.Name
                })
            });
        end))
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
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.Resources.Theme);
local _ = require(l_script_FirstAncestor_0.Src.Types);
local v5 = require(l_script_FirstAncestor_0.Src.Components.StudioAssetServiceContext);
local v6 = require(script.SubmitInner);
local v7 = require(script.useAvailableSubmitChoices);
local l_StyledDialog_0 = v1.UI.StyledDialog;
local l_Localization_0 = v1.ContextServices.Localization;
local l_Stylizer_0 = v1.ContextServices.Stylizer;
local l_StyleModifier_0 = v1.Util.StyleModifier;
return function(v12)
    local v13 = l_Localization_0:use();
    local v14 = l_Stylizer_0:use("SubmitDialog");
    local v15 = v7(v12.avatar);
    local v16, v17 = v2.useState(v15);
    local v18 = v2.useContext(v5);
    v2.useEffect(function()
        v17(v15);
        if #v15 == 1 then
            task.spawn(function()
                local v19 = v15[1];
                v18.showSaveToRoblox({
                    v19.instance
                }, v19.assetType);
            end);
            v12.close();
        end;
    end, {
        v15
    });
    local v20, v21 = v2.useState(0);
    assert(#v15 > 0, "No available publish choices");
    if #v15 == 1 then
        return nil;
    else
        return v2.createElement(l_StyledDialog_0, {
            key = "SubmitDialog",
            Enabled = true,
            Modal = true,
            Title = v13:getText("SubmitDialog", "Title"),
            MinContentSize = Vector2.new(v14.Width, v20),
            Buttons = {
                {
                    Key = "cancel",
                    Text = v13:getText("SubmitDialog", "Cancel")
                },
                {
                    Key = "ok",
                    Text = v13:getText("SubmitDialog", "OK"),
                    Style = "RoundPrimary",
                    StyleModifier = if next(v16) == nil then l_StyleModifier_0.Disabled else nil
                }
            },
            OnButtonPressed = function(v22)
                v12.close();
                if v22 == "cancel" then
                    return ;
                else
                    task.spawn(function()
                        for v23, v24 in v16, nil, nil do
                            v18.showSaveToRoblox({
                                v24.instance
                            }, v24.assetType, v23 ~= #v16);
                            if v18.onUGCSubmitCompleted:Wait() then
                                break;
                            end;
                        end;
                    end);
                    return ;
                end;
            end,
            OnClose = v12.close
        }, v2.createElement(v6, {
            avatar = v12.avatar,
            setHeight = v21,
            availableChoices = v15,
            publishChoices = v16,
            setPublishChoices = v17
        }));
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
local v1 = require(l_script_FirstAncestor_0.Packages.Cryo);
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.Util.Constants);
local v5 = require(l_script_FirstAncestor_0.Src.Util.EquipmentStateContext);
local v6 = require(l_script_FirstAncestor_0.Src.Util.filterDescendants);
local _ = require(l_script_FirstAncestor_0.Src.Types);
local l_Localization_0 = v2.ContextServices.Localization;
local function _(v9)
    local l_v9_FirstChild_0 = v9:FindFirstChild(v4.REFERENCE_VALUE_NAME);
    if l_v9_FirstChild_0 ~= nil and l_v9_FirstChild_0:IsA("ObjectValue") then
        assert(l_v9_FirstChild_0:IsA("ObjectValue"), v4.LUAU_ANALYZE_ERROR);
        return l_v9_FirstChild_0.Value and l_v9_FirstChild_0.Value.Name;
    else
        return nil;
    end;
end;
return function(v12)
    local v13 = l_Localization_0:use();
    local v14 = v3.useContext(v5);
    return v3.useMemo(function()
        local v15 = {};
        local v16 = v12.WorldModel:Clone();
        v6(v16, v1.List.join(v4.LIMBS, {
            "HumanoidRootPart"
        }));
        table.insert(v15, {
            instance = v16,
            assetType = "Body"
        });
        for _, v18 in v14.equippedItems, nil, nil do
            if v18.item.source == v4.SOURCE_INSTANCE then
                assert(v18.item.source == v4.SOURCE_INSTANCE, v4.LUAU_ANALYZE_ERROR);
                if v18.palette.PublishAssetType ~= nil then
                    assert(v18.palette.PublishAssetType ~= nil, v4.LUAU_ANALYZE_ERROR);
                    local v19 = v18.item.instance:Clone();
                    v6(v19, {
                        "Handle"
                    });
                    local l_v19_FirstChild_0 = v19:FindFirstChild(v4.REFERENCE_VALUE_NAME);
                    local v21;
                    if l_v19_FirstChild_0 ~= nil and l_v19_FirstChild_0:IsA("ObjectValue") then
                        assert(l_v19_FirstChild_0:IsA("ObjectValue"), v4.LUAU_ANALYZE_ERROR);
                        v21 = l_v19_FirstChild_0.Value and l_v19_FirstChild_0.Value.Name;
                    else
                        v21 = nil;
                    end;
                    if v21 ~= nil then
                        v19.Name = v21;
                    end;
                    while true do
                        l_v19_FirstChild_0 = v19:FindFirstChildWhichIsA("ValueBase", true);
                        if l_v19_FirstChild_0 ~= nil then
                            l_v19_FirstChild_0:Destroy();
                        else
                            break;
                        end;
                    end;
                    for v22 in v19:GetAttributes() do
                        v19:SetAttribute(v22, nil);
                    end;
                    table.insert(v15, {
                        instance = v19,
                        assetType = v18.palette.PublishAssetType
                    });
                end;
            end;
        end;
        table.sort(v15, function(v23, v24)
            if v23.assetType == "Body" then
                return true;
            elseif v24.assetType == "Body" then
                return false;
            else
                return v13:getText("AssetType", v23.assetType.Name) < v13:getText("AssetType", v24.assetType.Name);
            end;
        end);
        return v15;
    end, {
        v14.equippedItems
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
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.Resources.Theme);
local l_UI_0 = v1.UI;
local l_Image_0 = l_UI_0.Image;
local l_Pane_0 = l_UI_0.Pane;
local l_TextLabel_0 = l_UI_0.TextLabel;
local l_Localization_0 = v1.ContextServices.Localization;
local l_Stylizer_0 = v1.ContextServices.Stylizer;
local l_LayoutOrderIterator_0 = v1.Util.LayoutOrderIterator;
return function(v11)
    local v12 = l_Localization_0:use();
    local v13 = l_Stylizer_0:use("Stars");
    local v14, v15 = v2.useState({});
    local v16 = (next(v14) or v11.rating) or 0;
    local v17 = l_LayoutOrderIterator_0.new();
    local v18 = {};
    for v19 = 1, 5 do
        v18[("Star%*"):format(v19)] = v2.createElement(l_Pane_0, {
            LayoutOrder = v19,
            Size = v13.StarSize + UDim2.fromOffset(v13.StarSpacing, 0),
            OnClick = function()
                v11.setRating(v19);
            end,
            [v2.Event.MouseEnter] = function()
                v15(function(v20)
                    local v21 = table.clone(v20);
                    v21[v19] = true;
                    return v21;
                end);
            end,
            [v2.Event.MouseLeave] = function()
                v15(function(v22)
                    local v23 = table.clone(v22);
                    v23[v19] = nil;
                    return v23;
                end);
            end,
            [v2.Tag] = ("data-testid=Star%*"):format(v19)
        }, {
            Image = v2.createElement(l_Image_0, {
                AnchorPoint = Vector2.new(0.5, 0),
                Image = if v19 <= v16 then v13.StarFilled else v13.StarUnfilled,
                ImageColor3 = v13.StarColor,
                Position = UDim2.fromScale(0.5, 0),
                Size = v13.StarSize
            })
        });
    end;
    return v2.createElement(l_Pane_0, {
        AutomaticSize = Enum.AutomaticSize.Y,
        LayoutOrder = v11.layoutOrder,
        Layout = Enum.FillDirection.Horizontal,
        HorizontalAlignment = Enum.HorizontalAlignment.Left,
        Spacing = v13.RatingSpacing
    }, {
        Stars = v2.createElement(l_Pane_0, {
            AutomaticSize = Enum.AutomaticSize.X,
            LayoutOrder = v17:getNextOrder(),
            Layout = Enum.FillDirection.Horizontal
        }, v18),
        Text = v2.createElement(l_TextLabel_0, {
            AutomaticSize = Enum.AutomaticSize.XY,
            LayoutOrder = v17:getNextOrder(),
            Text = v16 == 0 and "" or v12:getText("Survey", (("StarsRating%*"):format(v16)))
        })
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
local v1 = require(l_script_FirstAncestor_0.Packages.Dash);
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.SurveyDialog.Stars);
local _ = require(l_script_FirstAncestor_0.Src.Types);
local _ = require(l_script_FirstAncestor_0.Src.Resources.Theme);
local l_UI_0 = v2.UI;
local l_Checkbox_0 = l_UI_0.Checkbox;
local l_Pane_0 = l_UI_0.Pane;
local l_TextInput_0 = l_UI_0.TextInput;
local l_TextLabel_0 = l_UI_0.TextLabel;
local l_Localization_0 = v2.ContextServices.Localization;
local l_Stylizer_0 = v2.ContextServices.Stylizer;
local l_LayoutOrderIterator_0 = v2.Util.LayoutOrderIterator;
local v15 = {
    "Teeth",
    "Mouth",
    "Eyes",
    "Eyebrows",
    "Eyelashes",
    "Hair"
};
return function(v16)
    local v17 = l_Localization_0:use();
    local v18 = l_Stylizer_0:use("Survey");
    local v19 = l_LayoutOrderIterator_0.new();
    local v26 = v3.useCallback(function(v20)
        v16.setResults(function(v21)
            local v22 = table.clone(v21);
            local v23 = table.clone(v22.problems);
            if not v23[v20] then
                v23[v20] = true;
            else
                v23[v20] = nil;
            end;
            if v20 == "HeadLooksBad" then
                for _, v25 in v15, nil, nil do
                    v23[("Head%*"):format(v25)] = nil;
                end;
            end;
            v22.problems = v23;
            return v22;
        end);
    end, {});
    local function v28(v27)
        return v3.createElement(l_Checkbox_0, {
            Key = v27,
            Checked = v16.results.problems[v27],
            LayoutOrder = v19:getNextOrder(),
            OnClick = v26,
            Text = v17:getText("Survey", (("Problem%*"):format(v27))),
            TextWrapped = true
        });
    end;
    return v3.createElement(l_Pane_0, {
        AutomaticSize = Enum.AutomaticSize.Y,
        Layout = Enum.FillDirection.Vertical,
        Spacing = v18.Spacing,
        HorizontalAlignment = Enum.HorizontalAlignment.Left,
        [v3.Change.AbsoluteSize] = function(v29)
            v16.setHeight(v29.AbsoluteSize.Y);
        end
    }, {
        PleaseRateYourExperience = v3.createElement(l_TextLabel_0, {
            AutomaticSize = Enum.AutomaticSize.XY,
            LayoutOrder = v19:getNextOrder(),
            Style = "Bold",
            Text = v17:getText("Survey", "PleaseRateYourExperience")
        }),
        Stars = v3.createElement(v4, {
            layoutOrder = v19:getNextOrder(),
            rating = v16.results.rating,
            setRating = v3.useCallback(function(v30)
                v16.setResults(function(v31)
                    local v32 = table.clone(v31);
                    v32.rating = v30;
                    return v32;
                end);
            end, {})
        }),
        Gap = v3.createElement("Frame", {
            LayoutOrder = v19:getNextOrder()
        }),
        UserIntent = v3.createElement(v3.Fragment, {}, {
            IntentForResults = v3.createElement(l_TextLabel_0, {
                AutomaticSize = Enum.AutomaticSize.XY,
                LayoutOrder = v19:getNextOrder(),
                Style = "Bold",
                Text = v17:getText("Survey", "IntentForResults")
            }),
            UseAsNPC = v28("UseAsNPC"),
            UseForMarketplace = v28("UseForMarketplace"),
            Gap1 = v3.createElement("Frame", {
                LayoutOrder = v19:getNextOrder()
            })
        }),
        WhatAreasShouldWeImproveOn = v3.createElement(l_TextLabel_0, {
            AutomaticSize = Enum.AutomaticSize.XY,
            LayoutOrder = v19:getNextOrder(),
            Style = "Bold",
            Text = v17:getText("Survey", "WhatAreasShouldWeImproveOn")
        }),
        CharacterDoesntBend = v28("CharacterDoesntBend"),
        CharacterWeirdBend = v28("CharacterWeirdBend"),
        BadLayeredClothing = v28("BadLayeredClothing"),
        Heads = v3.createElement(v3.Fragment, {}, {
            HeadLooksBad = v28("HeadLooksBad"),
            SpecificProblems = v16.results.problems.HeadLooksBad and v3.createElement(l_Pane_0, {
                AutomaticSize = Enum.AutomaticSize.Y,
                LayoutOrder = v19:getNextOrder(),
                Spacing = v18.Spacing,
                Layout = Enum.FillDirection.Vertical,
                HorizontalAlignment = Enum.HorizontalAlignment.Left
            }, {
                UIPadding = v3.createElement("UIPadding", {
                    PaddingLeft = UDim.new(0, v18.HeadIndent)
                }),
                Specifically = v3.createElement(l_TextLabel_0, {
                    AutomaticSize = Enum.AutomaticSize.XY,
                    LayoutOrder = v19:getNextOrder(),
                    Text = v17:getText("Survey", "Specifically")
                }),
                SpecificProblems = v3.createElement(v3.Fragment, {}, v1.map(v15, function(v33)
                    return v28((("Head%*"):format(v33))), v33;
                end))
            })
        }),
        Gap2 = v3.createElement("Frame", {
            LayoutOrder = v19:getNextOrder()
        }),
        Message = v3.createElement(l_TextInput_0, {
            MultiLine = true,
            LayoutOrder = v19:getNextOrder(),
            Size = UDim2.new(1, 0, 0, v18.MessageHeight),
            PlaceholderText = v17:getText("Survey", "MessagePlaceholder"),
            Text = v16.results.message,
            OnTextChanged = v3.useCallback(function(v34)
                v16.setResults(function(v35)
                    local v36 = table.clone(v35);
                    v36.message = v34;
                    return v36;
                end);
            end, {})
        })
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework);
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local v3 = require(script.Survey);
local _ = require(l_script_FirstAncestor_0.Src.Resources.Theme);
local _ = require(l_script_FirstAncestor_0.Src.Types);
local l_UI_0 = v1.UI;
local l_StyledDialog_0 = l_UI_0.StyledDialog;
local l_TextLabel_0 = l_UI_0.TextLabel;
local l_Localization_0 = v1.ContextServices.Localization;
local l_Stylizer_0 = v1.ContextServices.Stylizer;
local l_StyleModifier_0 = v1.Util.StyleModifier;
return function(v12)
    local v13 = l_Localization_0:use();
    local v14 = l_Stylizer_0:use("SurveyDialog");
    local v15, v16 = v2.useState({
        rating = nil,
        message = "",
        problems = {}
    });
    local v17, v18 = v2.useState(100);
    local v19, v20 = v2.useState(false);
    if not v19 then
        return v2.createElement(l_StyledDialog_0, {
            key = "Survey",
            Enabled = true,
            Modal = true,
            Title = v13:getText("Survey", "Title"),
            MinContentSize = Vector2.new(v14.Width, v17),
            Buttons = {
                {
                    Key = "send",
                    Text = v13:getText("SurveyDialog", "SendFeedback"),
                    Style = "RoundPrimary",
                    StyleModifier = if v15.rating == nil then l_StyleModifier_0.Disabled else nil
                }
            },
            OnButtonPressed = function()
                v12.submitResults(v15);
                v20(true);
            end,
            OnClose = v12.close
        }, v2.createElement(v3, {
            results = v15,
            setResults = v16,
            setHeight = v18
        }));
    else
        return v2.createElement(l_StyledDialog_0, {
            key = "Finish",
            Enabled = true,
            Modal = true,
            Title = v13:getText("Survey", "Title"),
            MinContentSize = v14.FinishDialogSize,
            Buttons = {
                {
                    Key = "close",
                    Text = v13:getText("SurveyDialog", "Close")
                }
            },
            OnButtonPressed = v12.close,
            OnClose = v12.close
        }, {
            Label = v2.createElement(l_TextLabel_0, {
                Text = v13:getText("SurveyDialog", "FinishAlert")
            })
        });
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
local v1 = require(l_script_FirstAncestor_0.Packages.Dash);
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.ForceRerender);
local v5 = require(l_script_FirstAncestor_0.Src.Components.CategoryTab);
local v6 = require(l_script_FirstAncestor_0.Src.Components.PickTabMenu);
local v7 = require(l_script_FirstAncestor_0.Src.Flags.getFFlagAvatarPreviewerPickTabsMenu);
local v8 = v7();
local _ = require(l_script_FirstAncestor_0.Src.Util.Constants);
local _ = require(l_script_FirstAncestor_0.Src.Resources.Theme);
local _ = require(l_script_FirstAncestor_0.Src.Types);
local l_Analytics_0 = v2.ContextServices.Analytics;
local l_Localization_0 = v2.ContextServices.Localization;
local l_Stylizer_0 = v2.ContextServices.Stylizer;
local l_UI_0 = v2.UI;
local l_Pane_0 = l_UI_0.Pane;
local l_ScrollingFrame_0 = l_UI_0.ScrollingFrame;
local l_Tabs_0 = l_UI_0.Tabs;
return function(v19)
    local v20 = l_Analytics_0:use();
    local v21 = l_Localization_0:use();
    local v22 = l_Stylizer_0:use("TabBar");
    local v23 = v3.useRef(nil);
    local v24 = v3.useRef(nil);
    local v25 = v3.useRef({});
    local v26, v27 = v3.useState(100);
    local v28, v29 = v3.useState(100);
    local v30, v31 = v3.useState(Vector2.new());
    local v33 = v3.useMemo(function()
        return v1.map(v19.Tabs, function(v32)
            return {
                Key = v32,
                Label = v21:getText("Categories", v32)
            };
        end);
    end, {
        v21,
        v19.Tabs
    });
    local v35 = if not v8 then nil else v3.useMemo(function()
        return v1.map(v19.Tabs, function(v34)
            return {
                Text = v21:getText("Categories", v34),
                OnItemClicked = function()
                    v19.SetSelectedTab(v34);
                    assert(v24.current ~= nil, "Ref to category tabs is nil");
                    assert(v25.current ~= nil, "Ref to category tabs list is nil");
                    v31(Vector2.new(v25.current[v34].current.AbsolutePosition.X - v24.current.AbsolutePosition.X, 0));
                end,
                Checked = v34 == v19.SelectedTab
            };
        end);
    end, {
        v21,
        v19.Tabs,
        v19.SelectedTab,
        v19.SetSelectedTab
    });
    local v36 = v26 < v28;
    if v8 then
        v3.useEffect(function()
            assert(v23.current ~= nil, "Ref to category tabs frame is nil");
            v27(v23.current.AbsoluteSize.X);
            assert(v24.current ~= nil, "Ref to category tabs is nil");
            v29(v24.current.AbsoluteSize.X);
        end, {});
    end;
    return v3.createElement(l_Pane_0, {
        LayoutOrder = v19.LayoutOrder,
        Size = UDim2.new(1, 0, 0, 32),
        Style = "SubtleBox",
        ref = if not v7() then nil else v23,
        [v3.Change.AbsoluteSize] = if not v7() then nil else function(v37)
            v27(v37.AbsoluteSize.X);
        end
    }, {
        ScrollingFrame = v3.createElement(l_ScrollingFrame_0, {
            AutomaticCanvasSize = Enum.AutomaticSize.X,
            AutomaticSize = Enum.AutomaticSize.Y,
            CanvasPosition = if not v7() then nil else v30,
            OnScrollUpdate = if not v7() then nil else v31,
            Padding = 0,
            ScrollingDirection = Enum.ScrollingDirection.X,
            ScrollBarThickness = 0,
            Size = if not v7() then nil else UDim2.new(1, not v36 and 0 or -32, 1, 0)
        }, {
            Tabs = v3.createElement(v4, {
                component = l_Tabs_0,
                innerProps = {
                    SelectedTab = v19.SelectedTab,
                    OnTabSelected = function(v38)
                        v20:report("openTab", v38.Key);
                        v19.SetSelectedTab(v38.Key);
                    end,
                    Tabs = v33,
                    TabComponent = if not v7() then nil else v5,
                    ref = if not v7() then nil else v24,
                    TabsListRef = v25,
                    OnAbsoluteSizeChanged = if not v7() then nil else function(v39)
                        v29(v39.AbsoluteSize.X);
                    end
                },
                dependencies = {
                    v33
                }
            })
        }),
        PickTabMenu = if not not v7() and v36 then v3.createElement(v6, {
            MenuTabs = v35,
            BackgroundColor = v22.BackgroundColor,
            BackgroundColorHover = v22.BackgroundColorHover
        }) else nil
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
local v1 = require(l_script_FirstAncestor_0.Packages.React);
local v2 = require(l_script_FirstAncestor_0.Src.Util.TestInExperienceUtil);
return function()
    local l_FocusedDataModelSession_0 = l_script_FirstAncestor_0.Parent.MultipleDocumentInterfaceInstance.FocusedDataModelSession;
    assert(l_FocusedDataModelSession_0 ~= nil, "FocusedDataModelSession is nil");
    v1.useEffect(function()
        v2.clearTestingAvatars();
        local v4 = l_FocusedDataModelSession_0.CurrentDataModelTypeChanged:Connect(function()
            if l_FocusedDataModelSession_0.CurrentDataModelType == Enum.StudioDataModelType.Edit then
                v2.clearTestingAvatars();
            end;
        end);
        return function()
            v2.clearTestingAvatars();
            v4:Disconnect();
        end;
    end, {});
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
local v1 = require(l_script_FirstAncestor_0.Packages.React);
local _ = require(l_script_FirstAncestor_0.Src.Util.Signal);
return {
    Context = v1.createContext({
        onIsColorableAcquired = nil,
        onRepresentEditorStateOnWorldModelDescriptionApplied = nil,
        onRepresentEditorStateOnWorldModelUnmounted = nil
    })
};


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
local v1 = require(l_script_FirstAncestor_0.Packages.React);
local _ = require(l_script_FirstAncestor_0.Packages.UGCValidation);
local v3 = require(l_script_FirstAncestor_0.Src.Hooks.useAssertNeverChanges);
return function(v4)
    v3(v4);
    local v5, v6 = v1.useState(nil);
    local v7 = v1.useRef(false);
    return v5, (v1.useCallback(function()
        if not v7.current then
            v7.current = true;
            task.spawn(function()
                v6(v4());
            end);
            return ;
        else
            return ;
        end;
    end, {}));
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
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.Resources.Theme);
local l_UI_0 = v1.UI;
local l_Image_0 = l_UI_0.Image;
local l_Pane_0 = l_UI_0.Pane;
local l_Tooltip_0 = l_UI_0.Tooltip;
local l_Stylizer_0 = v1.ContextServices.Stylizer;
return function(v9)
    local v10 = l_Stylizer_0:use("UGCValidationStatusIcon", v9);
    return v2.createElement(l_Pane_0, {
        Position = v10.Position,
        Size = v10.Size,
        OnClick = v9.OnClick
    }, {
        UIAspectRatioConstraint = v2.createElement("UIAspectRatioConstraint"),
        Image = v2.createElement(l_Image_0, {
            Image = v10.Image,
            ImageColor3 = v10.Color
        }),
        Tooltip = v2.createElement(l_Tooltip_0, {
            Text = v9.TooltipText
        })
    });
end;


local l_BrowserService_0 = game:GetService("BrowserService");
local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
local v2 = require(l_script_FirstAncestor_0.Packages.Dash);
local v3 = require(l_script_FirstAncestor_0.Packages.Framework);
local v4 = require(l_script_FirstAncestor_0.Packages.React);
local _ = require(l_script_FirstAncestor_0.Packages.UGCValidation);
local v6 = require(l_script_FirstAncestor_0.Src.Components.UGCValidationContext);
local _ = require(l_script_FirstAncestor_0.Src.Resources.Theme);
local v8 = require(l_script_FirstAncestor_0.Src.Util.exhaustiveMatch);
local v9 = require(l_script_FirstAncestor_0.Src.Util.localizePlural);
local v10 = game:DefineFastString("AvatarPreviewerAgeIDVerificationLink", "https://en.help.roblox.com/hc/en-us/articles/4407282410644-Age-ID-Verification");
local v11 = game:DefineFastString("AvatarPreviewerPremiumLink", "https://www.roblox.com/premium/membership");
local l_UI_0 = v3.UI;
local l_Image_0 = l_UI_0.Image;
local l_TextLabel_0 = l_UI_0.TextLabel;
local l_TextWithLinks_0 = l_UI_0.TextWithLinks;
local l_Pane_0 = l_UI_0.Pane;
local l_ScrollingFrame_0 = l_UI_0.ScrollingFrame;
local l_StyledDialog_0 = l_UI_0.StyledDialog;
local l_LayoutOrderIterator_0 = v3.Util.LayoutOrderIterator;
local l_Localization_0 = v3.ContextServices.Localization;
local l_Stylizer_0 = v3.ContextServices.Stylizer;
return function(v22)
    local v23 = l_LayoutOrderIterator_0.new();
    local v24 = l_Localization_0:use();
    local v25 = l_Stylizer_0:use("UGCValidationErrorDialog");
    local v26, v27 = v4.useState(0);
    local v29 = v4.useCallback(function(v28)
        v27(v28.AbsoluteSize.Y);
    end, {});
    local v30, v31 = v4.useState(0);
    local v33 = v4.useCallback(function(v32)
        v31(v32.AbsolutePosition.Y);
    end, {});
    local v34 = v4.useContext(v6.Context);
    local v35 = if v34.canUploadBundles ~= nil and v34.canUploadBundles.type == "notAllowed" then v34.canUploadBundles.denyReason else nil;
    local l_createElement_0 = v4.createElement;
    local l_l_StyledDialog_0_0 = l_StyledDialog_0;
    local v38 = {
        Style = "Alert",
        Title = v24:getText("UGCValidation", "AlertTitle"),
        MinContentSize = v25.AlertMinContentSize,
        Resizable = true,
        Buttons = {
            {
                Key = "ok",
                Text = "OK"
            }
        },
        OnButtonPressed = v22.OnClose,
        OnClose = v22.OnClose
    };
    local v39 = {};
    local l_createElement_1 = v4.createElement;
    local l_l_Pane_0_0 = l_Pane_0;
    local v42 = {
        Layout = Enum.FillDirection.Horizontal,
        HorizontalAlignment = Enum.HorizontalAlignment.Left,
        VerticalAlignment = Enum.VerticalAlignment.Top
    };
    local v43 = {
        LeftColumn = v4.createElement(l_Pane_0, {
            Size = UDim2.fromOffset(v25.TextSize + v25.IconTextSpacing, v25.TextSize),
            LayoutOrder = v23:getNextOrder()
        }, {
            Image = v4.createElement(l_Image_0, {
                Image = v25.WarningImage,
                ImageColor3 = v25.WarningColor,
                Size = UDim2.fromOffset(v25.TextSize, v25.TextSize)
            })
        })
    };
    local l_createElement_2 = v4.createElement;
    local l_l_Pane_0_1 = l_Pane_0;
    local v46 = {
        Size = UDim2.new(1, -v25.TextSize, 1, 0),
        LayoutOrder = v23:getNextOrder(),
        Layout = Enum.FillDirection.Vertical,
        Spacing = v25.TitleDetailsSpacing,
        HorizontalAlignment = Enum.HorizontalAlignment.Left,
        VerticalAlignment = Enum.VerticalAlignment.Top,
        [v4.Change.AbsoluteSize] = v29
    };
    local v47 = {
        WarningLabel = v4.createElement(l_TextLabel_0, {
            AutomaticSize = Enum.AutomaticSize.Y,
            Font = v25.WarningFont,
            Size = UDim2.fromScale(1, 0),
            Text = v9(v24, "UGCValidation", "WarningLongTitle", #v22.Errors + (v35 == nil and 0 or 1)),
            TextColor = v25.WarningColor,
            TextSize = v25.TextSize,
            TextXAlignment = Enum.TextXAlignment.Left,
            TextWrapped = true
        })
    };
    local l_createElement_3 = v4.createElement;
    local l_l_ScrollingFrame_0_0 = l_ScrollingFrame_0;
    local v50 = {
        AutomaticCanvasSize = Enum.AutomaticSize.Y,
        Size = UDim2.new(1, 0, 0, v26 - v30),
        Layout = Enum.FillDirection.Vertical,
        Spacing = UDim.new(0, v25.DetailsSpacing),
        [v4.Change.AbsolutePosition] = v33
    };
    local v51 = {};
    local v52 = v35 and v4.createElement(v4.Fragment, {}, {
        Header = v4.createElement(l_TextLabel_0, {
            Text = v24:getText("UGCValidation", "PermissionsRequiredHeader"),
            Style = "Bold",
            AutomaticSize = Enum.AutomaticSize.Y,
            Size = UDim2.fromScale(1, 0),
            TextXAlignment = Enum.TextXAlignment.Left,
            TextSize = v25.TextSize,
            TextWrapped = true,
            LayoutOrder = v23:getNextOrder()
        }),
        ErrorText = v4.createElement(l_TextWithLinks_0, {
            LayoutOrder = v23:getNextOrder(),
            Text = if v35 == "MissingIdVerification" then v24:getText("UGCValidation", "UploadBundleDenied_MissingIdVerification_Text") else if v35 == "MissingPremiumSubscriptionTier" then v24:getText("UGCValidation", "UploadBundleDenied_MissingPremiumSubscriptionTier_Text") else v24:getText("UGCValidation", "UploadBundleDenied_UnknownError", {
                errorCode = v35
            }),
            TextProps = {
                Font = Enum.Font.SourceSans,
                TextSize = v25.TextSize,
                TextXAlignment = Enum.TextXAlignment.Left
            },
            HorizontalAlignment = Enum.HorizontalAlignment.Left,
            LinkMap = {
                ["[Age_Verified]"] = {
                    LinkText = v24:getText("UGCValidation", "UploadBundleDenied_MissingIdVerification_Link"),
                    LinkCallback = function()
                        l_BrowserService_0:OpenBrowserWindow(v10);
                    end
                },
                ["[Premium_1000_Or_2200_Subscription]"] = {
                    LinkText = v24:getText("UGCValidation", "UploadBundleDenied_MissingPremiumSubscriptionTier_Link"),
                    LinkCallback = function()
                        l_BrowserService_0:OpenBrowserWindow(v11);
                    end
                }
            }
        })
    });
    local v53 = false;
    if #v22.Errors > 0 then
        v53 = v4.createElement(v4.Fragment, {}, {
            Header = v4.createElement(l_TextLabel_0, {
                Text = v24:getText("UGCValidation", "ValidationErrorsHeader"),
                Style = "Bold",
                AutomaticSize = Enum.AutomaticSize.Y,
                Size = UDim2.fromScale(1, 0),
                TextXAlignment = Enum.TextXAlignment.Left,
                TextSize = v25.TextSize,
                TextWrapped = true,
                LayoutOrder = v23:getNextOrder()
            })
        }, v2.map(v22.Errors, function(v54, v55)
            return v4.createElement(l_TextLabel_0, {
                key = ("Error%*"):format(v55),
                AutomaticSize = Enum.AutomaticSize.Y,
                Size = UDim2.fromScale(1, 0),
                Text = if v54.error.type == "message" then v54.error.message else if v54.error.type == "notFound" then v24:getText("UGCValidation", "AssetNotFound", {
                    asset = v24:getText("AssetType", assert(v54.assetType, "notFound sent with no error type").Name)
                }) else v8(v54.error.type),
                TextXAlignment = Enum.TextXAlignment.Left,
                TextSize = v25.TextSize,
                TextWrapped = true,
                LayoutOrder = v23:getNextOrder()
            });
        end));
    end;
    setlist { ['R027[1 to 2]'] = 'R028 to R029' };
    v47.Warnings = l_createElement_3(l_l_ScrollingFrame_0_0, v50, v51);
    v43.RightColumn = l_createElement_2(l_l_Pane_0_1, v46, v47);
    v39.Contents = l_createElement_1(l_l_Pane_0_0, v42, v43);
    return l_createElement_0(l_l_StyledDialog_0_0, v38, v39);
end;


local l_HttpService_0 = game:GetService("HttpService");
local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
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.Packages.React);
local v5 = require(l_script_FirstAncestor_0.Src.Util.Constants);
local v6 = require(l_script_FirstAncestor_0.Src.Util.EquipmentStateContext);
local v7 = require(l_script_FirstAncestor_0.Src.Util.UserCatalogContext);
local v8 = require(l_script_FirstAncestor_0.Src.Util.getPaletteFromKey);
local v9 = require(l_script_FirstAncestor_0.Src.Hooks.useUserCatalogFolder);
local _ = require(l_script_FirstAncestor_0.Src.Types);
local function v14(v11)
    local l_v11_Attribute_0 = v11:GetAttribute("RBX_Palette");
    if l_v11_Attribute_0 then
        local v13 = v8(l_v11_Attribute_0);
        if v13 == nil then
            warn((("%* has an invalid palette \"%*\". This is a bug in the plugin, please report it."):format(v11, l_v11_Attribute_0)));
            return nil;
        else
            assert(v13 ~= nil, v5.LUAU_ANALYZE_ERROR);
            return {
                palette = v13,
                item = {
                    source = v5.SOURCE_INSTANCE,
                    instance = v11
                }
            };
        end;
    else
        warn((("%* did not have a palette set. This is a bug in the plugin, please report it."):format(v11)));
        return nil;
    end;
end;
return function(v15)
    local v16 = v9();
    local v17 = v4.useContext(v6);
    local v21, v22 = v4.useState(v3.collectArray(v16:GetChildren(), function(_, v19)
        local v20 = v14(v19);
        if v20 == nil then
            v19:Destroy();
        end;
        return v20;
    end));
    local v30 = v4.useCallback(function(v23, v24, v25)
        for _, v27 in v16:GetChildren() do
            local l_v27_FirstChild_0 = v27:FindFirstChild(v5.REFERENCE_VALUE_NAME);
            if not (not (l_v27_FirstChild_0 ~= nil) or not l_v27_FirstChild_0:IsA("ObjectValue")) then
                assert(l_v27_FirstChild_0:IsA("ObjectValue"), v5.LUAU_ANALYZE_ERROR);
                if l_v27_FirstChild_0.Value == v25 and v27:GetAttribute("RBX_Palette") == v24.Key then
                    v17.removeEquippedItem({
                        palette = v24,
                        item = {
                            source = v5.SOURCE_INSTANCE,
                            instance = v27
                        }
                    });
                    v27:Destroy();
                    break;
                end;
            end;
        end;
        local l_ObjectValue_0 = Instance.new("ObjectValue");
        l_ObjectValue_0.Name = v5.REFERENCE_VALUE_NAME;
        l_ObjectValue_0.Value = v25;
        l_ObjectValue_0.Parent = v23;
        v23:SetAttribute("RBX_Palette", v24.Key);
        v23.Name = l_HttpService_0:GenerateGUID();
        v23.Parent = v16;
    end, {
        v17.removeEquippedItem,
        v16
    });
    local v33 = v4.useCallback(function(v31, v32)
        v17.removeEquippedItem({
            palette = v31,
            item = {
                source = v5.SOURCE_INSTANCE,
                instance = v32
            }
        });
        v32:Destroy();
    end, {
        v17.removeEquippedItem
    });
    v4.useEffect(function()
        local v38 = v16.ChildAdded:Connect(function(v34)
            v22(function(v35)
                local v36 = table.clone(v35);
                local v37 = v14(v34);
                assert(v37 ~= nil, "Newly added child to the catalog couldn't be turned into a catalog item");
                table.insert(v36, v37);
                return v36;
            end);
        end);
        local v44 = v16.ChildRemoved:Connect(function(v39)
            v22(function(v40)
                local v43 = v3.findIndex(v40, function(v41)
                    local v42 = false;
                    if v41.item.source == v5.SOURCE_INSTANCE then
                        v42 = v41.item.instance == v39;
                    end;
                    return v42;
                end);
                if v43 == nil then
                    return v40;
                else
                    return (v2.List.removeIndex(v40, v43));
                end;
            end);
        end);
        v22(v3.map(v16:GetChildren(), function(v45)
            local v46 = v14(v45);
            assert(v46 ~= nil, "Newly added child to the catalog couldn't be turned into a catalog item");
            return v46;
        end));
        return function()
            v38:Disconnect();
            v44:Disconnect();
        end;
    end, {});
    return v4.createElement(v7.Provider, {
        value = {
            equippableItems = v21,
            addNewItem = v30,
            removeItem = v33
        }
    }, v15.children);
end;


local v0 = require(script:FindFirstAncestor("AvatarCompatibilityPreviewer").Src.Flags.getFFlagAvatarPreviewerAutoSetup);
game:DefineFastFlag("AvatarPreviewerAddGeoToSelection", false);
return function()
    return game:GetFastFlag("AvatarPreviewerAddGeoToSelection") and v0();
end;


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


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


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


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


local l_BaseWrapVerticesModified_0 = game:GetFastFlag("BaseWrapVerticesModified");
game:DefineFastFlag("EnableCageEditingTools_Dev", false);
return function()
    return game:GetFastFlag("EnableCageEditingTools_Dev") and l_BaseWrapVerticesModified_0;
end;


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


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


local v0 = require(script:FindFirstAncestor("AvatarCompatibilityPreviewer").Src.Flags.getFFlagAvatarPreviewerCageEditingTools);
game:DefineFastFlag("AvatarPreviewerEditingTools_Dev", false);
return function()
    return game:GetFastFlag("AvatarPreviewerEditingTools_Dev") and v0();
end;


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


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


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


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


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


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


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


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


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


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


game:DefineFastFlag("RobloxScriptSecurityCanCallEditableImageAPIs", false);
game:DefineFastFlag("AvatarPreviewerSkinToneAlphaDetection", false);
return function()
    return game:GetFastFlag("AvatarPreviewerSkinToneAlphaDetection") and game:GetFastFlag("RobloxScriptSecurityCanCallEditableImageAPIs");
end;


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


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


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


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


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
local v1 = require(l_script_FirstAncestor_0.Packages.AvatarToolsShared);
local v2 = require(l_script_FirstAncestor_0.Packages.Dash);
local v3 = require(l_script_FirstAncestor_0.Packages.React);
local v4 = require(l_script_FirstAncestor_0.Src.Util.Constants);
local _ = require(l_script_FirstAncestor_0.Src.Types);
local v6 = require(l_script_FirstAncestor_0.Src.Flags.getFFlagAvatarPreviewerEditingTools);
local l_AccessoryUtil_0 = v1.Util.AccessoryAndBodyToolShared.AccessoryUtil;
local function v13(v8, v9, v10)
    local l_WrapLayer_0 = v10:FindFirstChildWhichIsA("WrapLayer");
    if l_WrapLayer_0 == nil then
        return nil;
    else
        assert(l_WrapLayer_0 ~= nil, v4.LUAU_ANALYZE_ERROR);
        local l_v8_FirstChildWhichIsA_0 = v8:FindFirstChildWhichIsA("WrapTarget", true);
        if l_v8_FirstChildWhichIsA_0 == nil then
            return nil;
        else
            return (((l_WrapLayer_0.CageOrigin * l_WrapLayer_0.ImportOrigin) * l_v8_FirstChildWhichIsA_0.ImportOriginWorld:Inverse()) * v8.CFrame) * v9;
        end;
    end;
end;
return function(v14)
    v3.useEffect(function()
        if v14 == nil then
            return nil;
        else
            assert(v14 ~= nil, v4.LUAU_ANALYZE_ERROR);
            local v15 = {};
            local function v20(v16, v17)
                local v18, v19 = l_AccessoryUtil_0:findMatchingAccessoryAndAvatarAttachments(v16, v14);
                if v19 == nil then
                    return nil;
                else
                    v17.Part0 = v16;
                    v17.C0 = v13(v19.Parent, v19.CFrame, v16) or v18.CFrame;
                    v17.C1 = v19.CFrame;
                    v17.Part1 = v19.Parent;
                    if v6() then
                        v17.Name = "AccessoryWeld";
                    end;
                    v17.Parent = v16;
                    return v19.Parent;
                end;
            end;
            local function v25(v21)
                local l_Handle_0 = v21:FindFirstChild("Handle");
                if l_Handle_0 ~= nil and l_Handle_0:IsA("BasePart") then
                    local v23 = false;
                    if l_Handle_0 ~= nil then
                        v23 = l_Handle_0:IsA("BasePart");
                    end;
                    assert(v23, v4.LUAU_ANALYZE_ERROR);
                    if l_Handle_0:FindFirstChildWhichIsA("Weld") ~= nil then
                        return ;
                    else
                        local l_Weld_0 = Instance.new("Weld");
                        table.insert(v15, {
                            accessoryHandle = l_Handle_0,
                            limb = v20(l_Handle_0, l_Weld_0),
                            weld = l_Weld_0
                        });
                        return ;
                    end;
                else
                    return ;
                end;
            end;
            local function v28()
                for _, v27 in v15, nil, nil do
                    if v27.limb == nil then
                        v27.limb = v20(v27.accessoryHandle, v27.weld);
                    end;
                end;
            end;
            local function v30(v29)
                if not v29:IsA("Accessory") then
                    if v29:IsA("BasePart") then
                        v28();
                    end;
                    return ;
                else
                    task.delay(0.1, v25, v29);
                    return ;
                end;
            end;
            local function v35(v31)
                if not v31:IsA("Accessory") then
                    if v31:IsA("BasePart") then
                        for _, v33 in v15, nil, nil do
                            if v33.limb == v31 then
                                v33.weld.Parent = nil;
                                v33.limb = nil;
                            end;
                        end;
                    end;
                    return ;
                else
                    v15 = v2.filter(v15, function(v34)
                        return v34.accessoryHandle.Parent ~= v31;
                    end);
                    return ;
                end;
            end;
            for _, v37 in v14:GetChildren() do
                if not v37:IsA("Accessory") then
                    if v37:IsA("BasePart") then
                        v28();
                    end;
                else
                    task.delay(0.1, v25, v37);
                end;
            end;
            local v38 = v14.ChildAdded:Connect(v30);
            local v39 = v14.ChildRemoved:Connect(v35);
            return function()
                v38:Disconnect();
                v39:Disconnect();
            end;
        end;
    end, {
        v14
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
local v1 = require(l_script_FirstAncestor_0.Packages.Dash);
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local v3 = require(l_script_FirstAncestor_0.Src.Util.Constants);
local _ = require(l_script_FirstAncestor_0.Src.Types);
local function v12(v5, v6)
    local v7 = 0;
    local v8 = 0;
    for v9, v10 in v5, nil, nil do
        local l_PreferredLayer_0 = v10.palette.PreferredLayer;
        if l_PreferredLayer_0 ~= nil then
            assert(l_PreferredLayer_0 ~= nil, v3.LUAU_ANALYZE_ERROR);
            if l_PreferredLayer_0 <= v6 and v8 <= l_PreferredLayer_0 then
                v7 = v9;
            end;
        end;
    end;
    return v7 + 1;
end;
return function(v13)
    return v2.useCallback(function(v14)
        v13(function(v15)
            local v16 = table.clone(v15);
            local v18 = v1.findIndex(v16, function(v17)
                return (v17.palette.OverrideEquipKey or v17.palette.Key) == (v14.palette.OverrideEquipKey or v14.palette.Key);
            end);
            if v18 ~= nil then
                table.remove(v16, v18);
            end;
            if v14.palette.PreferredLayer == nil then
                table.insert(v16, v14);
                return v16;
            else
                table.insert(v16, v12(v16, v14.palette.PreferredLayer), v14);
                return v16;
            end;
        end);
    end, {
        v13
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
local v1 = require(l_script_FirstAncestor_0.Packages.React);
local _ = require(l_script_FirstAncestor_0.Src.Types);
local v3 = require(l_script_FirstAncestor_0.Src.Resources.CatalogItems);
local v4 = require(l_script_FirstAncestor_0.Src.Util.Constants);
local v5 = require(l_script_FirstAncestor_0.Src.Components.DisambiguationMenuContext);
local v6 = require(l_script_FirstAncestor_0.Src.Util.EquipmentStateContext);
local v7 = require(l_script_FirstAncestor_0.Src.Util.UserCatalogContext);
local v8 = require(l_script_FirstAncestor_0.Src.Util.filterDescendants);
local v9 = require(l_script_FirstAncestor_0.Src.Util.isAvatar);
return function()
    local v10 = v1.useContext(v5.Context);
    local v11 = v1.useContext(v6);
    local v12 = v1.useContext(v7);
    return v1.useCallback(function(v13)
        local v14 = nil;
        local v15 = {};
        local v16 = {};
        local v17 = {};
        local v18 = 0;
        for _, v20 in v13, nil, nil do
            if v20:IsA("MeshPart") and table.find(v4.LIMBS, v20.Name) == nil then
                if not (not (v20.Parent ~= nil) or not v9(v20.Parent)) then
                    v10.addLoneMeshPart(v20);
                end;
            else
                local v21 = {};
                local v22 = 0;
                for _, v24 in v3, nil, nil do
                    for _, v26 in v24, nil, nil do
                        local v27 = v26.CreateCustomInstanceFromSelection(v20);
                        if v27 ~= nil then
                            assert(v27 ~= nil, v4.LUAU_ANALYZE_ERROR);
                            if typeof(v27) == "string" then
                                v17[v20] = v27;
                            else
                                assert(v27 ~= v20, "CreateCustomInstanceFromSelection should always give a new instance");
                                assert(v27.Parent == nil, "CreateCustomInstanceFromSelection should give an isolated instance");
                                v8(v27, {
                                    "Handle"
                                });
                                v22 = v22 + 1;
                                v21[v26] = v27;
                            end;
                        end;
                    end;
                end;
                if v22 == 0 then
                    table.insert(v15, v20);
                elseif v22 > 1 then
                    local v28 = v20:Clone();
                    v8(v28, {
                        "Handle"
                    });
                    v10.addAmbiguousAsset({
                        worldModel = v28,
                        instances = v21
                    });
                else
                    local v29, v30 = next(v21);
                    local v31 = false;
                    if v29 ~= nil then
                        v31 = v30 ~= nil;
                    end;
                    assert(v31, v4.LUAU_ANALYZE_ERROR);
                    if v29.Key == "Shoes" then
                        v16[v20] = v29;
                        v18 = v18 + 1;
                    else
                        v12.addNewItem(v30, v29, v20);
                        v11.addEquippedItem({
                            palette = v29,
                            item = {
                                source = v4.SOURCE_INSTANCE,
                                instance = v30
                            }
                        });
                        v14 = v29;
                    end;
                end;
            end;
        end;
        if v18 == 2 then
            local l_Folder_0 = Instance.new("Folder");
            local v33 = nil;
            local v34 = nil;
            for v35, v36 in v16, nil, nil do
                if v34 == nil then
                    v34 = v36;
                elseif v36 ~= v34 then
                    warn("Shoes palette mismatch found");
                end;
                local v37 = nil;
                if not v35:IsA("Folder") then
                    v37 = v35;
                elseif #v35:GetChildren() <= 1 then
                    v37 = v35:GetChildren()[1];
                else
                    break;
                end;
                local v38 = v37:Clone();
                local l_Handle_0 = v38:FindFirstChild("Handle");
                if v38:IsA("Accessory") and l_Handle_0 ~= nil then
                    v38.Parent = l_Folder_0;
                    if l_Handle_0:FindFirstChild("LeftFootAttachment") then
                        v33 = v37;
                    end;
                end;
            end;
            local v40 = v34.CreateCustomInstanceFromSelection(l_Folder_0);
            if not (not (v40 ~= nil and typeof(v40) ~= "string") or not v40:IsA("Instance")) and v33 ~= nil then
                v12.addNewItem(v40, v34, v33);
                v11.addEquippedItem({
                    palette = v34,
                    item = {
                        source = v4.SOURCE_INSTANCE,
                        instance = v40
                    }
                });
                v14 = v34;
            else
                if typeof(v40) == "string" then
                    local v41, _ = next(v16);
                    if v41 ~= nil then
                        v17[v41] = v40;
                    end;
                end;
                for v43, _ in v16, nil, nil do
                    table.insert(v15, v43);
                end;
            end;
        elseif v18 == 1 then
            local v45, v46 = next(v16);
            local v47 = v46.CreateCustomInstanceFromSelection(v45);
            if v45 ~= nil then
                if v47 and typeof(v47) == "string" then
                    table.insert(v15, v45);
                elseif not (not v47 or not v47:IsA("Instance")) then
                    if not v45:IsA("Folder") then
                        v12.addNewItem(v47, v46, v45);
                    else
                        v12.addNewItem(v47, v46, v45:GetChildren()[1] or v45);
                    end;
                    v11.addEquippedItem({
                        palette = v46,
                        item = {
                            source = v4.SOURCE_INSTANCE,
                            instance = v47
                        }
                    });
                    if v47:IsA("Accessory") then
                        v17[v45] = "OnlyOneShoe";
                        table.insert(v15, v45);
                    end;
                    v14 = v46;
                end;
            end;
        elseif v18 > 2 then
            local v48, _ = next(v16);
            if v48 ~= nil then
                v17[v48] = "NeedTwoShoes";
            end;
            for v50, _ in v16, nil, nil do
                table.insert(v15, v50);
            end;
        end;
        return {
            activePalette = v14,
            invalidInstances = v15,
            extraErrors = v17
        };
    end, {
        v10.addAmbiguousAsset,
        v10.addLoneMeshPart,
        v11.addEquippedItem,
        v12.addNewItem
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
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.Hooks.useToggleState);
local l_Focus_0 = v1.ContextServices.Focus;
local l_UserInputService_0 = game:GetService("UserInputService");
local function _(v6, v7)
    local l_AbsolutePosition_0 = v7.AbsolutePosition;
    local v9 = l_AbsolutePosition_0 + v7.AbsoluteSize;
    local v10 = false;
    if l_AbsolutePosition_0.X <= v6.X then
        v10 = false;
        if v6.X <= v9.X then
            v10 = false;
            if l_AbsolutePosition_0.Y <= v6.Y then
                v10 = v6.Y <= v9.Y;
            end;
        end;
    end;
    return v10;
end;
return function(v12)
    local v13 = l_Focus_0:use():get();
    local v14 = v3(false);
    v2.useEffect(function()
        if v14.enabled then
            local v20 = task.spawn(function()
                while true do
                    local v15 = if not v13:IsA("PluginGui") then l_UserInputService_0:GetMouseLocation() else v13:GetRelativeMousePosition();
                    if v12.current ~= nil then
                        local l_current_0 = v12.current;
                        local l_AbsolutePosition_1 = l_current_0.AbsolutePosition;
                        local v18 = l_AbsolutePosition_1 + l_current_0.AbsoluteSize;
                        local v19 = false;
                        if l_AbsolutePosition_1.X <= v15.X then
                            v19 = false;
                            if v15.X <= v18.X then
                                v19 = false;
                                if l_AbsolutePosition_1.Y <= v15.Y then
                                    v19 = v15.Y <= v18.Y;
                                end;
                            end;
                        end;
                        if v19 then
                            task.wait();
                        else
                            break;
                        end;
                    else
                        break;
                    end;
                end;
                v14.disable();
            end);
            return function()
                task.cancel(v20);
            end;
        else
            return nil;
        end;
    end, {
        v14.enabled
    });
    return {
        hover = v14.enable,
        isHovered = v14.enabled
    };
end;


local l_ContentProvider_0 = game:GetService("ContentProvider");
local l_RunService_0 = game:GetService("RunService");
local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
local v3 = require(l_script_FirstAncestor_0.Packages.React);
local v4 = require(l_script_FirstAncestor_0.Src.Util.Constants);
local _ = require(l_script_FirstAncestor_0.Src.Types);
local function v9(v6)
    local v7 = v6:FindFirstChildWhichIsA("Humanoid") or v6:FindFirstChildWhichIsA("AnimationController");
    assert(v7 ~= nil, "AnimateTarget must have either a Humanoid or an AnimationController");
    local l_Animator_0 = v7:FindFirstChildWhichIsA("Animator");
    if l_Animator_0 == nil then
        l_Animator_0 = Instance.new("Animator");
        l_Animator_0.Parent = v7;
    end;
    return l_Animator_0;
end;
local function v15(v10)
    for _, v12 in v10:GetDescendants() do
        if not v12:IsA("Motor6D") then
            if v12:IsA("FaceControls") then
                for _, v14 in v4.FACE_CONTROLS_PROPERTIES, nil, nil do
                    v12[v14] = 0;
                end;
            end;
        else
            v12.CurrentAngle = 0;
            v12.Transform = CFrame.new();
        end;
    end;
end;
local function _(v16, v17)
    if not l_RunService_0:IsRunning() then
        v16:StepAnimations(v17);
        return ;
    else
        return ;
    end;
end;
return function(v19, v20, v21, v22)
    local v23, v24 = v3.useState(nil);
    local v25, v26 = v3.useState(nil);
    v3.useEffect(function()
        if v19 == nil then
            v26(nil);
            return nil;
        else
            assert(v19 ~= nil, v4.LUAU_ANALYZE_ERROR);
            if not v19:IsDescendantOf(game) then
                local v27 = v19.AncestryChanged:Connect(function()
                    if not v19:IsDescendantOf(game) then
                        v26(nil);
                        return ;
                    else
                        v26(v19);
                        return ;
                    end;
                end);
                return function()
                    v27:Disconnect();
                end;
            else
                v26(v19);
                return nil;
            end;
        end;
    end, {
        v19
    });
    v3.useEffect(function()
        v24(nil);
        if v25 == nil then
            return nil;
        else
            assert(v25 ~= nil, v4.LUAU_ANALYZE_ERROR);
            if v25:IsDescendantOf(game) then
                local l_Animation_0 = Instance.new("Animation");
                l_Animation_0.AnimationId = ("rbxassetid://%*"):format(v20);
                local v29 = v9(v25);
                local v30 = nil;
                local v31 = task.spawn(function()
                    l_ContentProvider_0:PreloadAsync({
                        l_Animation_0
                    });
                    v30 = v29:LoadAnimation(l_Animation_0);
                    v30.Looped = true;
                    v30:Play();
                    v24(v30);
                end);
                return function()
                    task.cancel(v31);
                    if v30 ~= nil then
                        v30:Stop(0);
                        v30:Destroy();
                    end;
                    local l_v29_0 = v29;
                    if not l_RunService_0:IsRunning() then
                        l_v29_0:StepAnimations(0);
                    end;
                    v15(v25);
                end;
            else
                return nil;
            end;
        end;
    end, {
        v25 or 0,
        v20 or 0
    });
    v3.useEffect(function()
        if not (v19 ~= nil) or v23 == nil then
            return ;
        else
            assert(v19 ~= nil, v4.LUAU_ANALYZE_ERROR);
            local v33 = v9(v19);
            if v22 == nil then
                local v36 = l_RunService_0.Heartbeat:Connect(function(v34)
                    local l_v33_0 = v33;
                    if not l_RunService_0:IsRunning() then
                        l_v33_0:StepAnimations(v34);
                    end;
                    if v21 ~= nil then
                        v21(v23.TimePosition / v23.Length);
                    end;
                end);
                return function()
                    v36:Disconnect();
                end;
            else
                v23:Stop(0);
                v23:Play();
                local v37 = v22 * v23.Length;
                if not l_RunService_0:IsRunning() then
                    v33:StepAnimations(v37);
                end;
                return nil;
            end;
        end;
    end, {
        v19,
        v23,
        v22,
        v21
    });
    return v23;
end;


local v0 = require(script:FindFirstAncestor("AvatarCompatibilityPreviewer").Packages.React);
return function(v1)
    assert(v0.useRef(v1).current == v1, "Value has changed");
end;


local v0 = require(script:FindFirstAncestor("AvatarCompatibilityPreviewer").Packages.React);
return function(v1, v2)
    local v3, v4 = v0.useState({
        state = "loading"
    });
    v0.useEffect(function()
        v4({
            state = "loading"
        });
        local v5 = task.spawn(function()
            v4({
                state = "ok",
                value = v1()
            });
        end);
        return function()
            task.cancel(v5);
        end;
    end, v2);
    return v3;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
local v1 = require(l_script_FirstAncestor_0.Src.Util.Constants);
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local v3 = require(l_script_FirstAncestor_0.Src.Flags.getFFlagAvatarPreviewerAutoSetupDisablePublish);
local v4 = require(l_script_FirstAncestor_0.Src.Flags.getFFlagAvatarPreviewerAutoSetupTelemetryV2);
return function(v5, v6)
    local v7, v8 = v2.useState(if v5 == nil then nil else v5:GetAttribute(v6));
    v2.useEffect(function()
        if v5 == nil then
            return nil;
        else
            assert(v5 ~= nil, v1.LUAU_ANALYZE_ERROR);
            if not (not v3() and not v4()) then
                v8(v5:GetAttribute(v6));
            end;
            local v9 = v5:GetAttributeChangedSignal(v6):Connect(function()
                v8(v5:GetAttribute(v6));
            end);
            return function()
                v9:Disconnect();
            end;
        end;
    end, {
        v5,
        v6
    });
    return v7;
end;