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.AvatarScreenContext);
local v5 = require(l_script_FirstAncestor_0.Src.Util.DEPRECATED_AvatarScreenContext);
local v6 = require(l_script_FirstAncestor_0.Src.Resources.CatalogItems);
local v7 = require(l_script_FirstAncestor_0.Src.Util.SelectionWrapper);
local v8 = require(l_script_FirstAncestor_0.Src.Hooks.useAddInstancesToUserCatalogAndEquip);
local v9 = require(l_script_FirstAncestor_0.Src.Hooks.useEventConnection);
local v10 = 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 v13 = require(l_script_FirstAncestor_0.Src.Flags.getFFlagAvatarPreviewerSkinToneAlphaDetection);
local l_UI_0 = v2.UI;
local l_Button_0 = l_UI_0.Button;
local l_Image_0 = l_UI_0.Image;
local l_Pane_0 = l_UI_0.Pane;
local l_StyledDialog_0 = l_UI_0.StyledDialog;
local l_TextLabel_0 = l_UI_0.TextLabel;
local l_Analytics_0 = v2.ContextServices.Analytics;
local l_Localization_0 = v2.ContextServices.Localization;
local l_Stylizer_0 = v2.ContextServices.Stylizer;
local l_LayoutOrderIterator_0 = v2.Util.LayoutOrderIterator;
local function v32(v24)
    if not (v24 ~= nil) or #v24 == 0 then
        return false;
    else
        assert(v24 ~= nil, v10.LUAU_ANALYZE_ERROR);
        for _, v26 in v24, nil, nil do
            for _, v28 in v6, nil, nil do
                for _, v30 in v28, nil, nil do
                    local v31 = v30.CreateCustomInstanceFromSelection(v26);
                    if v31 ~= nil and typeof(v31) ~= "string" then
                        return true;
                    end;
                end;
            end;
        end;
        return false;
    end;
end;
local function v40(v33)
    local v34 = v7:use():get();
    local v35 = l_Analytics_0:use();
    local v36 = v8();
    local v37 = v3.useContext(if not v13() then v5 else v4.Context);
    return v3.useCallback(function()
        local v38 = v34:Get();
        if #v38 == 0 then
            v35:report("addUserItems", 0, 0);
            v33({
                type = "noSelection"
            });
            return ;
        else
            local v39 = v36(v38);
            if #v39.invalidInstances > 0 then
                v33({
                    type = "noPalette",
                    instances = v39.invalidInstances,
                    extraErrors = v39.extraErrors
                });
            end;
            v35:report("addUserItems", #v38, #v38 - #v39.invalidInstances);
            if v39.activePalette ~= nil then
                v37.openPalette(v39.activePalette.Key);
            end;
            return ;
        end;
    end, {
        v35,
        v37,
        v36,
        v33
    });
end;
return function(v41)
    local v42 = l_Localization_0:use();
    local v43 = l_Stylizer_0:use("AddItemButton");
    local v44, v45 = v3.useState(nil);
    local v46 = v3.useCallback(function()
        v45(nil);
    end, {});
    local v47 = v40(v45);
    local v48 = l_LayoutOrderIterator_0.new();
    local function _()
        if ((v44 ~= nil and v44.type == "noPalette") and #v44.instances == 1) and v44.extraErrors ~= nil then
            local v49, v50 = next(v44.extraErrors);
            local v51 = false;
            if v50 == "OnlyOneShoe" then
                v51 = v44.instances[1] == v49;
            end;
            return v51;
        else
            return false;
        end;
    end;
    local v53;
    if v44 == nil then
        v53 = nil;
    else
        local v54;
        if ((v44 ~= nil and v44.type == "noPalette") and #v44.instances == 1) and v44.extraErrors ~= nil then
            local v55, v56 = next(v44.extraErrors);
            v54 = false;
            if v56 == "OnlyOneShoe" then
                v54 = v44.instances[1] == v55;
            end;
        else
            v54 = false;
        end;
        v53 = if not v54 then if v44.type == "noPalette" and #v44.instances == 1 then v42:getText("AddItems", "FailedAddNoPaletteHeaderSingle") else if v44.type == "noPalette" and #v44.instances > 1 then v42:getText("AddItems", "FailedAddNoPaletteHeaderMultiple", {
            items = table.concat(v1.collectArray(v44.instances, function(_, v58)
                return v58.Name;
            end), ", ")
        }) else nil else v42:getText("AddItems", "WarningHeaderOneShoe");
    end;
    local v61 = if ((not not v44 and v44.type == "noPalette") and v44.extraErrors) and next(v44.extraErrors) ~= nil then table.concat(v1.collectArray(v44.extraErrors, function(_, v60)
        return v42:getText("AddItems", v60);
    end), " ") .. " " else "";
    local v62, v63 = v3.useState(100);
    local v64 = v7:use():get();
    local v65, v66 = v3.useState(function()
        return (v32(v64:Get()));
    end);
    v9(v64.SelectionChanged, function()
        v66((v32(v64:Get())));
    end, {});
    local l_createElement_0 = v3.createElement;
    local l_l_Pane_0_0 = l_Pane_0;
    local v69 = {
        LayoutOrder = v41.LayoutOrder,
        Size = UDim2.new(1, 0, 0, v43.Height)
    };
    local v70 = {
        Padding = v3.createElement("UIPadding", {
            PaddingTop = UDim.new(0, v43.PaddingTop),
            PaddingBottom = UDim.new(0, v43.PaddingBottom)
        }),
        Inner = v3.createElement(l_Button_0, {
            OnClick = v47,
            Style = "Round",
            Tooltip = if v65 then nil else v42:getText("AddItems", "FailedAddHint"),
            DisableHover = not v65
        }, {
            Image = v3.createElement(l_Image_0, {
                AnchorPoint = Vector2.new(0.5, 0.5),
                Image = v43.Image,
                ImageColor3 = if v65 then v43.ImageColor else v43.ImageColorDisabled,
                Position = UDim2.fromScale(0.5, 0.5),
                Size = UDim2.fromOffset(v43.ImageSize, v43.ImageSize)
            })
        })
    };
    local v71;
    if v44 ~= nil then
        v71 = v3.createElement;
        local l_l_StyledDialog_0_0 = l_StyledDialog_0;
        local v73 = {};
        local v74;
        if ((v44 ~= nil and v44.type == "noPalette") and #v44.instances == 1) and v44.extraErrors ~= nil then
            local v75, v76 = next(v44.extraErrors);
            v74 = false;
            if v76 == "OnlyOneShoe" then
                v74 = v44.instances[1] == v75;
            end;
        else
            v74 = false;
        end;
        v73.Title = if not v74 then v42:getText("AddItems", "FailedTitle") else v42:getText("AddItems", "WarningTitle");
        v73.Enabled = true;
        v73.MinContentSize = Vector2.new(350, v62);
        v73.Modal = true;
        v73.OnClose = v46;
        v73.OnButtonPressed = v46;
        v73.Buttons = {
            {
                Key = "OK",
                Text = v42:getText("AddItems", "OK")
            }
        };
        v73.ButtonHorizontalAlignment = Enum.HorizontalAlignment.Center;
        local v77 = {};
        v74 = v3.createElement;
        local l_l_Pane_0_1 = l_Pane_0;
        local v80 = {
            AutomaticSize = Enum.AutomaticSize.Y,
            Layout = Enum.FillDirection.Vertical,
            HorizontalAlignment = Enum.HorizontalAlignment.Center,
            VerticalAlignment = Enum.VerticalAlignment.Top,
            Spacing = v43.FailureDialogSpacing,
            [v3.Change.AbsoluteSize] = function(v79)
                v63(v79.AbsoluteSize.Y);
            end
        };
        local v81 = {
            Title = v53 and v3.createElement(l_TextLabel_0, {
                AutomaticSize = Enum.AutomaticSize.Y,
                Font = Enum.Font.SourceSansBold,
                LayoutOrder = v48:getNextOrder(),
                Size = UDim2.fromScale(1, 0),
                Text = v53,
                TextWrapped = true,
                TextXAlignment = Enum.TextXAlignment.Left
            })
        };
        local l_createElement_1 = v3.createElement;
        local l_l_TextLabel_0_0 = l_TextLabel_0;
        local v84 = {
            AutomaticSize = Enum.AutomaticSize.Y,
            LayoutOrder = v48:getNextOrder(),
            Size = UDim2.fromScale(1, 0)
        };
        local v85;
        if ((v44 ~= nil and v44.type == "noPalette") and #v44.instances == 1) and v44.extraErrors ~= nil then
            local v86, v87 = next(v44.extraErrors);
            v85 = false;
            if v87 == "OnlyOneShoe" then
                v85 = v44.instances[1] == v86;
            end;
        else
            v85 = false;
        end;
        v84.Text = if not v85 then v61 .. v42:getText("AddItems", "FailedAddHint") else v61;
        v84.TextWrapped = true;
        v84.TextXAlignment = Enum.TextXAlignment.Left;
        v81.Hint = l_createElement_1(l_l_TextLabel_0_0, v84);
        v77.Contents = v74(l_l_Pane_0_1, v80, v81);
        v71 = v71(l_l_StyledDialog_0_0, v73, v77);
    else
        v71 = nil;
    end;
    v70.FailureDialog = v71;
    return l_createElement_0(l_l_Pane_0_0, v69, v70);
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.AvatarScreenContext);
local v5 = require(l_script_FirstAncestor_0.Src.Resources.BuiltinItems);
local v6 = require(l_script_FirstAncestor_0.Src.Components.ItemDataPreview);
local v7 = require(l_script_FirstAncestor_0.Src.Util.EquipmentStateContext);
local v8 = require(l_script_FirstAncestor_0.Src.Util.equippedItemDataEquals);
local v9 = require(l_script_FirstAncestor_0.Src.Util.find);
local v10 = require(l_script_FirstAncestor_0.Src.Util.getItemAccessoryType);
local v11 = require(l_script_FirstAncestor_0.Src.Hooks.useItemName);
local v12 = require(l_script_FirstAncestor_0.Src.Hooks.useToggleState);
local v13 = require(l_script_FirstAncestor_0.Src.Flags.getFFlagAvatarPreviewerClothingTypeIcons);
local v14 = require(l_script_FirstAncestor_0.Src.Flags.getFFlagAvatarPreviewerEditingTools)();
local _ = require(l_script_FirstAncestor_0.Src.Resources.Theme);
local _ = require(l_script_FirstAncestor_0.Src.Types);
local l_UI_0 = v2.UI;
local l_Button_0 = l_UI_0.Button;
local l_Image_0 = l_UI_0.Image;
local l_TextLabel_0 = l_UI_0.TextLabel;
local l_Pane_0 = l_UI_0.Pane;
local l_showContextMenu_0 = l_UI_0.showContextMenu;
local l_Analytics_0 = v2.ContextServices.Analytics;
local l_Localization_0 = v2.ContextServices.Localization;
local l_StyleModifier_0 = v2.Util.StyleModifier;
local l_Stylizer_0 = v2.ContextServices.Stylizer;
local function v33(v27)
    assert(v13(), "FFlagAvatarPreviewerClothingTypeIcons not enabled");
    if #v27.palette.Items == 1 then
        return nil;
    else
        local function v29(v28)
            return v10({
                palette = v27.palette,
                item = {
                    source = "builtin",
                    builtinItem = v28
                }
            }) == "layered";
        end;
        local v30 = v29(v27.palette.Items[1]);
        local v31 = false;
        for v32 = 2, #v27.palette.Items do
            if v29(v27.palette.Items[v32]) ~= v30 then
                v31 = true;
                break;
            end;
        end;
        if v31 then
            return v10(v27);
        else
            return nil;
        end;
    end;
end;
return function(v34)
    local v35 = l_Analytics_0:use();
    local v36 = l_Stylizer_0:use("CatalogItemButton");
    local v37 = if not v14 then nil else v3.useContext(v4.Context);
    local v38 = v3.useContext(v7);
    local v39 = l_Localization_0:use();
    local v40 = v3.useCallback(function()
        v35:report("equipItem", v34.ItemData);
        v38.addEquippedItem(v34.ItemData);
    end, {
        v38.addEquippedItem,
        v34.ItemData
    });
    local v41 = v3.useCallback(function()
        v35:report("unequipItem", v34.ItemData);
        v38.removeEquippedItem(v34.ItemData);
    end, {
        v38.removeEquippedItem,
        v34.ItemData
    });
    local v43 = v3.useMemo(function()
        return v1.find(v38.equippedItems, function(v42)
            return v8(v42, v34.ItemData);
        end);
    end, {
        v34.ItemData,
        v38.equippedItems
    });
    local v44 = v11(v34.ItemData);
    local v45 = v12(false);
    local v46 = true;
    if v34.ItemData.palette.Key ~= "BodyRangeOfMotion" then
        v46 = true;
        if v34.ItemData.palette.Key ~= "Movement" then
            v46 = v34.ItemData.palette.Key == "BodyEmotes";
        end;
    end;
    local v47 = if not v13() then nil else v33(v34.ItemData);
    local v50 = v3.useCallback(function(_, v49)
        if not v34.IsUserProvided or v49.UserInputType ~= Enum.UserInputType.MouseButton2 then
            return ;
        else
            l_showContextMenu_0(l_script_FirstAncestor_0.Parent, {
                {
                    Text = v39:getText("CatalogContextMenu", "DeleteItem"),
                    OnItemClicked = v34.Delete
                },
                {
                    Text = v39:getText("CatalogContextMenu", "DeleteAllItems"),
                    OnItemClicked = v34.DeleteAll
                }
            });
            return ;
        end;
    end, {
        v34.ItemData
    });
    local v51 = false;
    if ((v14 and #v37.focusedAttachments ~= nil) and v34.ItemData.item.source == "builtin") and typeof(v34.ItemData.item.builtinItem) == "number" then
        local v53 = v9(v5.allItems, function(v52)
            return v52.id == v34.ItemData.item.builtinItem;
        end);
        local v54 = false;
        if v53 ~= nil then
            v54 = false;
            if v53.attachment ~= nil then
                v54 = table.find(v37.focusedAttachments, v53.attachment) ~= nil;
            end;
        end;
        v51 = v54;
    end;
    local l_createElement_0 = v3.createElement;
    local l_l_Button_0_0 = l_Button_0;
    local v57 = {
        LayoutOrder = v34.LayoutOrder,
        Size = v34.Size,
        OnClick = if not v43 then v40 else v41,
        Style = if not v14 then v43 and "RoundActive" or "Round" else v43 and "RoundActive" or (v51 and "RoundHighlighted" or "Round"),
        Tooltip = if v46 then nil else v44
    };
    local v58 = {};
    local l_createElement_1 = v3.createElement;
    local l_l_Pane_0_0 = l_Pane_0;
    local v61 = {
        [v3.Event.InputBegan] = v50,
        [v3.Event.MouseEnter] = v45.enable,
        [v3.Event.MouseLeave] = v45.disable
    };
    local v62 = {
        ItemNamePadding = if not not v44 and v46 then v3.createElement("UIPadding", {
            PaddingBottom = v36.ItemNamePaddingBottom
        }) else nil,
        Preview = v3.createElement(v6, {
            ItemData = v34.ItemData,
            Selected = v43
        })
    };
    local v63 = false;
    if v34.Delete ~= nil then
        v63 = v45.enabled and v3.createElement(l_Pane_0, {
            AnchorPoint = v36.HoverX.AnchorPoint,
            Position = v36.HoverX.Position,
            Size = v36.HoverX.Size
        }, {
            RemoveButton = v3.createElement(l_Button_0, {
                StyleModifier = l_StyleModifier_0.Hover,
                OnClick = v34.Delete
            }, {
                HoverX = v3.createElement(l_Image_0, {
                    Image = v36.HoverX.Image,
                    Size = UDim2.fromScale(1, 1)
                })
            })
        });
    end;
    v62.HoverX = v63;
    v63 = v13();
    if v63 then
        v63 = false;
        if v47 ~= nil then
            v63 = v3.createElement(l_Pane_0, {
                AnchorPoint = v36.AccessoryTypeImage.AnchorPoint,
                Position = v36.AccessoryTypeImage.Position,
                Size = v36.AccessoryTypeImage.Size
            }, {
                Image = v3.createElement(l_Image_0, {
                    Image = if v47 == "layered" then v36.AccessoryTypeImage.LayeredImage else v36.AccessoryTypeImage.RigidImage,
                    ImageColor3 = v36.AccessoryTypeImage.Color,
                    Size = UDim2.fromScale(1, 1)
                })
            });
        end;
    end;
    v62.AccessoryTypeImage = v63;
    v62.UserImage = v34.IsUserProvided and v3.createElement(l_Pane_0, {
        AnchorPoint = v36.UserImage.AnchorPoint,
        Position = v36.UserImage.Position,
        Size = v36.UserImage.Size
    }, {
        UserImage = v3.createElement(l_Image_0, {
            Image = v36.UserImage.Image,
            ImageColor3 = v36.UserImage.Color,
            Size = UDim2.fromScale(1, 1)
        })
    });
    v58.Contents = l_createElement_1(l_l_Pane_0_0, v61, v62);
    v58.ItemName = if not not v44 and v46 then v3.createElement(l_TextLabel_0, {
        Text = v44,
        TextWrapped = true,
        TextXAlignment = Enum.TextXAlignment.Left,
        TextYAlignment = Enum.TextYAlignment.Bottom,
        ZIndex = 2
    }, {
        Padding = v3.createElement("UIPadding", {
            PaddingLeft = UDim.new(0, 3)
        })
    }) else nil;
    return l_createElement_0(l_l_Button_0_0, v57, v58);
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(script.AddItemButton);
local v5 = require(script.CatalogItemButton);
local v6 = require(l_script_FirstAncestor_0.Src.Util.UserCatalogContext);
local v7 = 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_UI_0 = v2.UI;
local l_Pane_0 = l_UI_0.Pane;
local l_ScrollingFrame_0 = l_UI_0.ScrollingFrame;
local l_LayoutOrderIterator_0 = v2.Util.LayoutOrderIterator;
local l_Stylizer_0 = v2.ContextServices.Stylizer;
local function v19(v15)
    local v16 = {};
    for _, v18 in v15.Items, nil, nil do
        table.insert(v16, {
            item = {
                source = v7.SOURCE_BUILTIN,
                builtinItem = v18
            },
            palette = v15
        });
    end;
    return v16;
end;
local function _(v20, v21)
    return v1.filter(v20, function(v22)
        return v22.palette.Key == v21;
    end);
end;
return function(v24)
    local v25 = l_Stylizer_0:use("Catalog");
    local v26 = v3.useContext(v6);
    local v27 = l_LayoutOrderIterator_0.new();
    local l_Palette_0 = v24.Palette;
    local v33 = v3.useMemo(function()
        local l_append_0 = v1.append;
        local l_equippableItems_0 = v26.equippableItems;
        local l_Key_0 = l_Palette_0.Key;
        return l_append_0(v1.filter(l_equippableItems_0, function(v32)
            return v32.palette.Key == l_Key_0;
        end), (v19(l_Palette_0)));
    end, {
        l_Palette_0,
        v26.equippableItems
    });
    local v42 = v1.collectArray(v33, function(v34, v35)
        local v36 = v35.item.source == v7.SOURCE_INSTANCE;
        return v3.createElement(v5, {
            key = ("item_%*_%*"):format(v35.item.source, v34),
            ItemData = v35,
            IsUserProvided = v36,
            LayoutOrder = if not v36 then #v33 + v34 else v34,
            Size = v25.CellSize,
            Delete = v35.item.source ~= v7.SOURCE_BUILTIN and function()
                return v26.removeItem(l_Palette_0, v35.item.instance);
            end or nil,
            DeleteAll = v35.item.source ~= v7.SOURCE_BUILTIN and function()
                local l_equippableItems_1 = v26.equippableItems;
                local l_Key_1 = l_Palette_0.Key;
                for _, v41 in v1.filter(l_equippableItems_1, function(v39)
                    return v39.palette.Key == l_Key_1;
                end) do
                    if v41.item.source == v7.SOURCE_INSTANCE then
                        assert(v41.item.source == v7.SOURCE_INSTANCE, v7.LUAU_ANALYZE_ERROR);
                        v26.removeItem(l_Palette_0, v41.item.instance);
                    end;
                end;
            end or nil
        });
    end);
    local v43 = v24.Palette.PreviewAspectRatio or 1;
    return v3.createElement(l_Pane_0, {
        Layout = Enum.FillDirection.Vertical
    }, {
        ScrollingFrame = v3.createElement(l_ScrollingFrame_0, {
            AutomaticCanvasSize = Enum.AutomaticSize.Y,
            LayoutOrder = v27:getNextOrder(),
            Size = UDim2.new(UDim.new(1, 0), v25.ScrollingFrameHeight),
            Style = v25.ScrollingFrame
        }, {
            UIGridLayout = v3.createElement("UIGridLayout", {
                CellPadding = UDim2.fromOffset(5, 5),
                CellSize = UDim2.new(v25.CellSize.X, UDim.new(v25.CellSize.Y.Scale / v43, v25.CellSize.Y.Offset / v43)),
                HorizontalAlignment = Enum.HorizontalAlignment.Center,
                SortOrder = Enum.SortOrder.LayoutOrder
            }, {
                UIAspectRatioConstraint = v3.createElement("UIAspectRatioConstraint", {
                    AspectRatio = v43
                })
            })
        }, v42),
        AddItemButton = v3.createElement(v4, {
            LayoutOrder = v27:getNextOrder(),
            Palette = l_Palette_0
        })
    });
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.getFFlagAvatarPreviewerEquippedHoverMenu);
local v4 = require(l_script_FirstAncestor_0.Src.Util.getAssetThumbnail);
local l_Image_0 = v1.UI.Image;
return function(v6)
    return v2.createElement(l_Image_0, {
        Image = v4(v6.Item),
        Style = if not v3() then nil else {
            Transparency = v6.Transparency
        },
        Size = UDim2.fromScale(1, 1)
    });
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 l_SimpleTab_0 = v2.UI.SimpleTab;
return v2.Wrappers.withForwardRef(function(v5)
    return v3.createElement(l_SimpleTab_0, v1.Dictionary.join(v5, {
        Style = "CategoryTab"
    }));
end);


local v0 = require(script:FindFirstAncestor("AvatarCompatibilityPreviewer").Packages.React);
return function(v1)
    local l_children_0 = v1.children;
    for v3 = #v1.providers, 1, -1 do
        l_children_0 = v0.cloneElement(v1.providers[v3], nil, l_children_0);
    end;
    return l_children_0;
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);
return function(v3)
    local l_children_0 = v3.children;
    for v5 = #v3.providers, 1, -1 do
        local v6 = v3.providers[v5];
        l_children_0 = v2.createElement(v6.provider, v1.omit(v6, {
            "provider"
        }), l_children_0);
    end;
    return l_children_0;
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.DisambiguationMenu.DisambiguationMenuEntry);
local _ = require(l_script_FirstAncestor_0.Src.Resources.Theme);
local _ = require(l_script_FirstAncestor_0.Src.Types);
local l_UI_0 = v2.UI;
local l_Pane_0 = l_UI_0.Pane;
local l_SelectInput_0 = l_UI_0.SelectInput;
local l_Localization_0 = v2.ContextServices.Localization;
local l_Stylizer_0 = v2.ContextServices.Stylizer;
return function(v12)
    local v13 = l_Localization_0:use();
    local v14 = l_Stylizer_0:use("DisambiguationMenu");
    local v16 = v1.collectArray(v12.AmbiguousAsset.instances, function(v15)
        return {
            Id = v15,
            Label = v13:getText("AssetPalettes", v15.Key)
        };
    end);
    table.sort(v16, function(v17, v18)
        return v17.Label < v18.Label;
    end);
    return v3.createElement(v4, {
        Name = v12.AmbiguousAsset.worldModel.Name,
        Instance = v12.AmbiguousAsset.worldModel,
        LayoutOrder = v12.LayoutOrder
    }, {
        Dropdown = v3.createElement(l_Pane_0, {
            AutomaticSize = Enum.AutomaticSize.Y,
            Size = UDim2.new(0, v14.DropdownWidth, 0, 0)
        }, {
            DropdownMenu = v3.createElement(l_SelectInput_0, {
                PlaceholderText = v13:getText("DisambiguationMenu", "DropdownPlaceholder"),
                Width = v14.DropdownWidth,
                SelectedId = v12.AssignedPalette,
                OnItemActivated = function(v19)
                    v12.SetAssignedPalette(v19.Id);
                end,
                Items = v16
            })
        })
    });
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.ItemDataPreview.ItemDataPreviewModel);
local _ = require(l_script_FirstAncestor_0.Src.Resources.Theme);
local l_UI_0 = v1.UI;
local l_Pane_0 = l_UI_0.Pane;
local l_TextLabel_0 = l_UI_0.TextLabel;
local l_LayoutOrderIterator_0 = v1.Util.LayoutOrderIterator;
local l_Stylizer_0 = v1.ContextServices.Stylizer;
return function(v10)
    local v11 = l_LayoutOrderIterator_0.new();
    local v12 = l_Stylizer_0:use("DisambiguationMenu");
    local v13, v14 = v2.useState(0);
    return v2.createElement(l_Pane_0, {
        AutomaticSize = Enum.AutomaticSize.Y,
        LayoutOrder = v10.LayoutOrder,
        Layout = Enum.FillDirection.Horizontal,
        Spacing = v12.HorizontalSpacing
    }, {
        ItemIcon = v2.createElement(l_Pane_0, {
            BackgroundColor3 = v12.IconBackground,
            LayoutOrder = v11:getNextOrder(),
            Size = v12.IconSize
        }, {
            ItemDataPreviewModel = v2.createElement(v3, {
                Instance = v10.Instance
            })
        }),
        ItemNames = v2.createElement(l_Pane_0, {
            AutomaticSize = Enum.AutomaticSize.Y,
            LayoutOrder = v11:getNextOrder(),
            Layout = Enum.FillDirection.Vertical,
            Spacing = v12.TextSpacing,
            Size = UDim2.new(1, -((v12.IconSize.X.Offset + v12.HorizontalSpacing) + v13), 0, 0)
        }, {
            ItemName = v2.createElement(l_TextLabel_0, {
                AutomaticSize = Enum.AutomaticSize.Y,
                LayoutOrder = v11:getNextOrder(),
                Size = UDim2.fromScale(1, 0),
                Text = v10.Name,
                TextXAlignment = Enum.TextXAlignment.Left,
                TextTruncate = Enum.TextTruncate.AtEnd
            }),
            Subtitle = v10.Subtitle and v2.createElement(l_TextLabel_0, {
                AutomaticSize = Enum.AutomaticSize.Y,
                LayoutOrder = v11:getNextOrder(),
                Style = "SubText",
                Size = UDim2.fromScale(1, 0),
                Text = v10.Subtitle,
                TextXAlignment = Enum.TextXAlignment.Left,
                TextTruncate = Enum.TextTruncate.AtEnd
            }),
            Warning = v10.WarningText and v2.createElement(l_TextLabel_0, {
                AutomaticSize = Enum.AutomaticSize.Y,
                LayoutOrder = v11:getNextOrder(),
                Style = "Warning",
                Size = UDim2.fromScale(1, 0),
                Text = v10.WarningText,
                TextXAlignment = Enum.TextXAlignment.Left,
                TextWrapped = true
            })
        }),
        Children = v2.createElement(l_Pane_0, {
            AutomaticSize = Enum.AutomaticSize.XY,
            LayoutOrder = v11:getNextOrder(),
            ref = v2.useRef(nil),
            [v2.Change.AbsoluteSize] = function(v15)
                v14(v15.AbsoluteSize.X);
            end
        }, v10.children)
    });
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.Packages.UGCValidation);
local v5 = require(l_script_FirstAncestor_0.Src.Components.DisambiguationMenu.DisambiguationMenuEntry);
local v6 = require(l_script_FirstAncestor_0.Src.Components.DisambiguationMenu.getChoosableAssetTypes);
local _ = require(l_script_FirstAncestor_0.Src.Resources.Theme);
local _ = require(l_script_FirstAncestor_0.Src.Types);
local l_UI_0 = v2.UI;
local l_Pane_0 = l_UI_0.Pane;
local l_SelectInput_0 = l_UI_0.SelectInput;
local l_LayoutOrderIterator_0 = v2.Util.LayoutOrderIterator;
local l_Localization_0 = v2.ContextServices.Localization;
local l_Stylizer_0 = v2.ContextServices.Stylizer;
return function(v15)
    local v16 = l_Localization_0:use();
    local v17 = l_Stylizer_0:use("DisambiguationMenu");
    local v18 = l_LayoutOrderIterator_0.new();
    local v19 = v15.MeshPart:FindFirstChildWhichIsA("WrapLayer") ~= nil;
    local v20, v21 = v6();
    for _, v23 in v20, nil, nil do
        v23.Label = v16:getText("AssetType", v23.Label);
    end;
    table.sort(v20, function(v24, v25)
        return v24.Label < v25.Label;
    end);
    table.insert(v20, 1, {
        Id = "Ignore",
        Label = v16:getText("DisambiguationMenu", "Ignore")
    });
    local v26 = nil;
    if v15.Assignment ~= nil and v15.Assignment.assetType ~= nil then
        local function _(v27)
            return v16:getText("DisambiguationMenu", v27, {
                name = v16:getText("AssetType", v15.Assignment.assetType.Name)
            });
        end;
        if not v19 or v4.util.isLayeredClothingAllowed(v15.Assignment.assetType) then
            if not (v19 or v4.util.isRigidAccessoryAllowed(v15.Assignment.assetType)) then
                v26 = v16:getText("DisambiguationMenu", "LoneMeshPartBadMarketplaceRigidAccessories", {
                    name = v16:getText("AssetType", v15.Assignment.assetType.Name)
                });
            end;
        else
            v26 = v16:getText("DisambiguationMenu", "LoneMeshPartBadMarketplaceLayeredClothing", {
                name = v16:getText("AssetType", v15.Assignment.assetType.Name)
            });
        end;
    end;
    local l_createElement_0 = v3.createElement;
    local l_v5_0 = v5;
    local v31 = {
        Instance = v15.MeshPart,
        Name = v15.MeshPart.Name,
        Subtitle = if not v19 then v16:getText("DisambiguationMenu", "RigidAccessory") else v16:getText("DisambiguationMenu", "LayeredClothing"),
        WarningText = v26,
        LayoutOrder = v15.LayoutOrder
    };
    local l_createElement_1 = v3.createElement;
    local l_l_Pane_0_0 = l_Pane_0;
    local v34 = {
        AutomaticSize = Enum.AutomaticSize.XY,
        Layout = Enum.FillDirection.Horizontal,
        Spacing = v17.HorizontalSpacing
    };
    local v35 = {};
    local l_Assignment_0 = v15.Assignment;
    if l_Assignment_0 then
        l_Assignment_0 = false;
        if v15.Assignment.assetType ~= nil then
            l_Assignment_0 = false;
            if #v21[v15.Assignment.assetType] > 1 then
                l_Assignment_0 = not v19 and v3.createElement(l_SelectInput_0, {
                    LayoutOrder = v18:getNextOrder(),
                    Width = v17.AttachmentDropdownWidth,
                    SelectedId = v15.Assignment.attachmentName,
                    Items = v1.map(v21[v15.Assignment.assetType], function(v37)
                        return {
                            Id = v37.attachmentName,
                            Label = v16:getText("AccessoryAttachment", v37.label)
                        };
                    end),
                    OnItemActivated = function(v38)
                        local v39 = table.clone(v15.Assignment);
                        v39.attachmentName = v38.Id;
                        v15.SetAssignment(v39);
                    end
                });
            end;
        end;
    end;
    v35.AttachmentDropdown = l_Assignment_0;
    v35.AssetTypeDropdown = v3.createElement(l_SelectInput_0, {
        LayoutOrder = v18:getNextOrder(),
        PlaceholderText = v16:getText("DisambiguationMenu", "AssetTypeDropdownPlaceholder"),
        Width = v17.DropdownWidth,
        SelectedId = (v15.Assignment ~= nil and v15.Assignment.assetType == nil) and "Ignore" or if v15.Assignment ~= nil and v15.Assignment.assetType ~= nil then v15.Assignment.assetType.Name else nil,
        Items = v20,
        OnItemActivated = function(v40)
            v15.SetAssignment({
                meshPart = v15.MeshPart,
                assetType = if v40.Id == "Ignore" then nil else Enum.AssetType[v40.Id],
                attachmentName = v40.Id == "Ignore" and "Ignore" or v21[Enum.AssetType[v40.Id]][1].attachmentName
            });
        end
    });
    return l_createElement_0(l_v5_0, v31, l_createElement_1(l_l_Pane_0_0, v34, v35));
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.Src.Util.Constants);
local l_AssetTypeAttachmentInfo_0 = v1.Util.AccessoryAndBodyToolShared.AssetTypeAttachmentInfo;
return function()
    local v5 = {};
    local v6 = {};
    local v7 = {};
    for _, v9 in l_AssetTypeAttachmentInfo_0, nil, nil do
        for _, v11 in v9, nil, nil do
            local l_status_0, l_result_0 = pcall(function()
                return Enum.AssetType[v11.AssetType];
            end);
            if not (not (l_status_0 and v3.ASSET_TYPE_TO_ACCESSORY_TYPE[l_result_0] ~= nil) or v7[v11.AssetType]) then
                v7[v11.AssetType] = true;
                table.insert(v5, {
                    Id = l_result_0.Name,
                    Label = v11.AssetType
                });
                v6[l_result_0] = v2.collectArray(v11.Attachments, function(v14, v15)
                    return {
                        label = v14,
                        attachmentName = v15.Name
                    };
                end);
            end;
        end;
    end;
    return v5, v6;
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(script.AmbiguousAssetEntry);
local v5 = require(script.LoneMeshPartEntry);
local _ = require(l_script_FirstAncestor_0.Src.Components.ItemDataPreview.ItemDataPreviewModel);
local v7 = require(l_script_FirstAncestor_0.Src.Flags.getFFlagAvatarPreviewerDisambiguationCancel);
local v8 = require(l_script_FirstAncestor_0.Src.Util.createUniqueKey);
local _ = require(l_script_FirstAncestor_0.Src.Resources.Theme);
local _ = require(l_script_FirstAncestor_0.Src.Types);
local l_UI_0 = v2.UI;
local l_Pane_0 = l_UI_0.Pane;
local l_ScrollingFrame_0 = l_UI_0.ScrollingFrame;
local _ = l_UI_0.SelectInput;
local l_Separator_0 = l_UI_0.Separator;
local l_StyledDialog_0 = l_UI_0.StyledDialog;
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 l_StyleModifier_0 = v2.Util.StyleModifier;
return function(v22)
    local v23 = l_Localization_0:use();
    local v24 = l_Stylizer_0:use("DisambiguationMenu");
    local v25 = l_LayoutOrderIterator_0.new();
    local v26, v27 = v3.useState(0);
    local v28, v29 = v3.useState({});
    local v30, v31 = v3.useState({});
    local v34 = v3.useCallback(function(v32)
        v31(function(v33)
            v33 = table.clone(v33);
            v33[v32.meshPart] = v32;
            return v33;
        end);
    end, {});
    local v35 = true;
    for _, v37 in v22.ambiguousAssets, nil, nil do
        if v28[v37] == nil then
            v35 = false;
            break;
        end;
    end;
    if v35 then
        for _, v39 in v22.loneMeshParts, nil, nil do
            if v30[v39] == nil then
                v35 = false;
                break;
            end;
        end;
    end;
    local v40 = v8();
    return v3.createElement(l_StyledDialog_0, {
        Style = not v7() and "Alert" or "AcceptCancel",
        Title = v23:getText("DisambiguationMenu", "Title"),
        MinContentSize = v24.MinContentSize,
        Buttons = if not v7() then {
            {
                Key = "ok",
                Text = v23:getText("DisambiguationMenu", "OK"),
                StyleModifier = if not v35 then l_StyleModifier_0.Disabled else nil
            }
        } else {
            {
                Key = "ok",
                Text = v23:getText("DisambiguationMenu", "OK"),
                StyleModifier = if not v35 then l_StyleModifier_0.Disabled else nil
            },
            {
                Key = "cancel",
                Text = v23:getText("DisambiguationMenu", "Cancel")
            }
        },
        OnButtonPressed = function(v41)
            if v7() and v41 == "cancel" then
                v22.close();
                return ;
            else
                v22.assign(v1.collectArray(v28, function(v42, v43)
                    return {
                        createdInstance = v42.instances[v43],
                        palette = v43,
                        worldModel = v42.worldModel
                    };
                end), v1.values(v30));
                return ;
            end;
        end,
        OnClose = v22.close
    }, v3.createElement(l_Pane_0, {
        Layout = Enum.FillDirection.Vertical,
        Spacing = v24.TitleContentsSpacing
    }, {
        CallToAction = v3.createElement(l_TextLabel_0, {
            AutomaticSize = Enum.AutomaticSize.Y,
            Text = v23:getText("DisambiguationMenu", "CallToAction"),
            TextXAlignment = Enum.TextXAlignment.Left,
            TextYAlignment = Enum.TextYAlignment.Top,
            TextWrapped = true,
            Size = UDim2.fromScale(1, 0),
            Style = "Title",
            LayoutOrder = v25:getNextOrder(),
            [v3.Change.AbsoluteSize] = function(v44)
                v27(v44.AbsoluteSize.Y);
            end
        }),
        Contents = v3.createElement(l_ScrollingFrame_0, {
            AutomaticCanvasSize = Enum.AutomaticSize.Y,
            Size = UDim2.new(1, 0, 1, -(v26 + v24.TitleContentsSpacing)),
            LayoutOrder = v25:getNextOrder(),
            Layout = Enum.FillDirection.Vertical,
            Spacing = UDim.new(0, v24.VerticalSpacing)
        }, v1.map(v22.ambiguousAssets, function(v45)
            return v3.createElement(v4, {
                key = v40(v45.worldModel.Name),
                AmbiguousAsset = v45,
                LayoutOrder = v25:getNextOrder(),
                AssignedPalette = v28[v45],
                SetAssignedPalette = function(v46)
                    v29(function(v47)
                        v47 = table.clone(v47);
                        v47[v45] = v46;
                        return v47;
                    end);
                end
            });
        end), if #v22.loneMeshParts > 0 and #v22.ambiguousAssets > 0 then v3.createElement(l_Separator_0, {
            LayoutOrder = v25:getNextOrder()
        }) else nil, v1.map(v22.loneMeshParts, function(v48)
            return v3.createElement(v5, {
                key = v40(v48.Name),
                Assignment = v30[v48],
                LayoutOrder = v25:getNextOrder(),
                MeshPart = v48,
                SetAssignment = v34
            });
        end))
    }));
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.Constants);
local _ = require(l_Parent_0.Src.Types);
local v4 = require(l_Parent_0.Src.Util.DEPRECATED_AvatarScreenContext);
local v5 = require(l_Parent_0.Src.Components.AvatarScreenContext);
local v6 = require(l_Parent_0.Src.Components.DisambiguationMenu);
local v7 = require(l_Parent_0.Src.Util.EquipmentStateContext);
local v8 = require(l_Parent_0.Src.Util.UserCatalogContext);
local v9 = require(l_Parent_0.Src.Util.createUnimplemented);
local v10 = require(script.useAssignLoneMeshParts);
local v11 = require(l_Parent_0.Src.Flags.getFFlagAvatarPreviewerSkinToneAlphaDetection);
local v12 = v1.createContext({
    addAmbiguousAsset = v9("addAmbiguousAsset"),
    addLoneMeshPart = v9("addLoneMeshPart")
});
return {
    Context = v12,
    Provider = function(v13)
        local v14, v15 = v1.useState({});
        local v18 = v1.useCallback(function(v16)
            v15(function(v17)
                v17 = table.clone(v17);
                table.insert(v17, v16);
                return v17;
            end);
        end, {});
        local v19 = v1.useContext(if not v11() then v4 else v5.Context);
        local v20 = v1.useContext(v7);
        local v21 = v1.useContext(v8);
        local v25 = v1.useCallback(function(v22)
            assert(#v22 > 0, "assignAmbiguousAssets called with no ambiguous assets");
            for _, v24 in v22, nil, nil do
                v21.addNewItem(v24.createdInstance, v24.palette, v24.worldModel);
                v20.addEquippedItem({
                    palette = v24.palette,
                    item = {
                        source = v2.SOURCE_INSTANCE,
                        instance = v24.createdInstance
                    }
                });
            end;
            v19.openPalette(v22[#v22].palette.Key);
            v15({});
        end, {
            v19.openPalette,
            v20.addEquippedItem,
            v21.addNewItem
        });
        local v26 = v10();
        local v27, v28 = v1.useState({});
        local v31 = v1.useCallback(function(v29, v30)
            if #v29 > 0 then
                v25(v29);
            end;
            if #v30 > 0 then
                v26(v30);
                v28({});
            end;
        end, {
            v25,
            v26
        });
        local v35 = {
            addAmbiguousAsset = v18,
            addLoneMeshPart = v1.useCallback(function(v32)
                v28(function(v33)
                    local v34 = table.clone(v33);
                    table.insert(v34, v32);
                    return v34;
                end);
            end, {})
        };
        local l_createElement_0 = v1.createElement;
        local l_Provider_0 = v12.Provider;
        local v38 = {
            value = v35
        };
        local l_children_0 = v13.children;
        local v40;
        if #v14 <= 0 then
            v40 = false;
            if not (#v27 > 0) then
                goto label0;
            end;
        end;
        v40 = v1.createElement(v6, {
            assign = v31,
            ambiguousAssets = v14,
            loneMeshParts = v27,
            close = function()
                v15({});
                v28({});
            end
        });
        ::label0::;
        return l_createElement_0(l_Provider_0, v38, l_children_0, v40);
    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.Constants);
local _ = require(l_script_FirstAncestor_0.Src.Types);
local function v10(v4, v5)
    for _, v7 in v2.LIMBS, nil, nil do
        local l_v4_FirstChild_0 = v4:FindFirstChild(v7);
        if l_v4_FirstChild_0 ~= nil then
            local l_l_v4_FirstChild_0_FirstChild_0 = l_v4_FirstChild_0:FindFirstChild(v5);
            if not (not (l_l_v4_FirstChild_0_FirstChild_0 ~= nil) or not l_l_v4_FirstChild_0_FirstChild_0:IsA("Attachment")) then
                return l_l_v4_FirstChild_0_FirstChild_0;
            end;
        end;
    end;
    return nil;
end;
return function()
    return v1.useCallback(function(v11)
        assert(#v11 > 0, "assignLoneMeshParts called with no lone mesh part assignments");
        for _, v13 in v11, nil, nil do
            if v13.assetType ~= nil then
                assert(v13.assetType ~= nil, v2.LUAU_ANALYZE_ERROR);
                local l_Parent_0 = v13.meshPart.Parent;
                if l_Parent_0 ~= nil then
                    assert(l_Parent_0 ~= nil, v2.LUAU_ANALYZE_ERROR);
                    local l_Humanoid_0 = l_Parent_0:FindFirstChildWhichIsA("Humanoid");
                    if l_Humanoid_0 ~= nil then
                        local v16 = assert(l_Humanoid_0, v2.LUAU_ANALYZE_ERROR);
                        local v17 = v10(l_Parent_0, v13.attachmentName);
                        if v17 == nil then
                            warn((("Could not find attachment %*"):format(v13.attachmentName)));
                        else
                            assert(v17 ~= nil, v2.LUAU_ANALYZE_ERROR);
                            local l_Accessory_0 = Instance.new("Accessory");
                            l_Accessory_0.Name = v13.meshPart.Name;
                            l_Accessory_0.AccessoryType = assert(v2.ASSET_TYPE_TO_ACCESSORY_TYPE[v13.assetType], "Couldn't find accessory type for asset type");
                            local v19 = nil;
                            if v13.meshPart:FindFirstChildWhichIsA("WrapLayer") == nil then
                                v19 = Instance.new("Part");
                                v19.TopSurface = Enum.SurfaceType.Smooth;
                                v19.BottomSurface = Enum.SurfaceType.Smooth;
                                v19.Name = "Handle";
                                v19.CFrame = v13.meshPart.CFrame;
                                v19.Size = v13.meshPart.Size;
                                local l_SpecialMesh_0 = Instance.new("SpecialMesh");
                                l_SpecialMesh_0.MeshId = v13.meshPart.MeshId;
                                local l_SurfaceAppearance_0 = v13.meshPart:FindFirstChildWhichIsA("SurfaceAppearance");
                                if not l_SurfaceAppearance_0 then
                                    l_SpecialMesh_0.TextureId = v13.meshPart.TextureID;
                                else
                                    l_SpecialMesh_0.TextureId = l_SurfaceAppearance_0.ColorMap;
                                end;
                                l_SpecialMesh_0.MeshType = Enum.MeshType.FileMesh;
                                l_SpecialMesh_0.Parent = v19;
                                v19.Parent = l_Accessory_0;
                            else
                                v19 = v13.meshPart:Clone();
                                v19.Name = "Handle";
                                v19.Parent = l_Accessory_0;
                            end;
                            local v22 = assert(v17.Parent, "No parent");
                            local l_Vector3Value_0 = Instance.new("Vector3Value");
                            l_Vector3Value_0.Name = "OriginalSize";
                            l_Vector3Value_0.Value = v19.Size / v16:GetAccessoryHandleScale(v13.meshPart, v16:GetBodyPartR15(v22));
                            l_Vector3Value_0.Parent = v19;
                            local l_Attachment_0 = Instance.new("Attachment");
                            l_Attachment_0.Name = v13.attachmentName;
                            l_Attachment_0.CFrame = v13.meshPart.CFrame:ToObjectSpace(v17.WorldCFrame);
                            l_Attachment_0.Parent = v19;
                            v13.meshPart:Destroy();
                            l_Accessory_0.Parent = l_Parent_0;
                        end;
                    end;
                end;
            end;
        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(l_script_FirstAncestor_0.Src.Flags.getFFlagAvatarPreviewerSidebarHandCursor);
local v4 = v3();
local v5 = require(l_script_FirstAncestor_0.Src.Util.Constants);
local l_Plugin_0 = v1.ContextServices.Plugin;
local l_Pane_0 = v1.UI.Pane;
return function(v8)
    local v9 = nil;
    if v4 then
        v9 = l_Plugin_0:use():get():GetMouse();
    end;
    local function _(v10)
        v9.Icon = v10;
    end;
    local l_Offset_0 = v8.cellSize.Y.Offset;
    assert(v8.cellSize.Y.Scale == 0, "CellSize cannot have a scaled Y");
    local v13 = {};
    local v14, v15 = v2.useState(nil);
    local v16 = v2.useRef(nil);
    local v17, v18 = v2.useBinding(0);
    local v19, v20 = v2.useBinding(0);
    local v21, v22 = v2.useBinding(0);
    for v23, v24 in v8.tiles, nil, nil do
        local v25, v26 = v8.render(v24, v14 ~= nil);
        assert(v13[v26] == nil, "Render key has already been used");
        local v27 = UDim2.fromOffset(0, l_Offset_0 * (v23 - 1));
        if v14 ~= nil then
            v27 = if v14.index == v23 then v2.joinBindings({
                v21,
                v19
            }):map(function(v28)
                return UDim2.fromOffset(0, (math.clamp(v28[1] - v14.cursorYOffset, 0, v28[2] - l_Offset_0)));
            end) else v21:map(function(v29)
                local v30 = math.floor(v29 / l_Offset_0) + 1;
                local l_v23_0 = v23;
                if v14.index < v30 then
                    if v23 <= v30 and v14.index < v23 then
                        l_v23_0 = l_v23_0 - 1;
                    end;
                elseif v30 <= v23 and v23 < v14.index then
                    l_v23_0 = l_v23_0 + 1;
                end;
                return UDim2.fromOffset(0, l_Offset_0 * (l_v23_0 - 1));
            end);
        end;
        v13[v26] = v2.createElement(l_Pane_0, {
            Position = v27,
            Size = v8.cellSize,
            ZIndex = (v14 ~= nil and v14.index == v23) and 2 or 1
        }, v25);
    end;
    local v35 = v2.useCallback(function(v32)
        local v33 = v32.Position.Y - v17:getValue();
        v22(v33);
        local v34 = {
            cursorYOffset = v33 % l_Offset_0,
            index = math.floor(v33 / l_Offset_0) + 1
        };
        if v3() then
            v9.Icon = "rbxasset://SystemCursors/ClosedHand";
        end;
        v15(v34);
        v16.current = v34;
    end, {
        l_Offset_0
    });
    local v38 = v2.useCallback(function(_, v37)
        if v16.current == nil then
            if v3() then
                v9.Icon = "rbxasset://SystemCursors/OpenHand";
            end;
            return ;
        else
            if v3() then
                v9.Icon = "rbxasset://SystemCursors/ClosedHand";
            end;
            if v37.UserInputType ~= Enum.UserInputType.MouseMovement then
                return ;
            else
                v22(v37.Position.Y - v17:getValue());
                return ;
            end;
        end;
    end, {});
    local v43 = v2.useCallback(function(_, v40)
        if v3() and v40.UserInputType == Enum.UserInputType.MouseMovement then
            v9.Icon = "rbxasset://SystemCursors/Arrow";
        end;
        local l_current_0 = v16.current;
        if l_current_0 == nil then
            return ;
        else
            assert(l_current_0 ~= nil, v5.LUAU_ANALYZE_ERROR);
            if v40.UserInputType ~= Enum.UserInputType.MouseButton1 then
                return ;
            else
                if v3() and v9.Icon ~= "rbxasset://SystemCursors/Arrow" then
                    v9.Icon = "rbxasset://SystemCursors/OpenHand";
                end;
                v15(nil);
                v16.current = nil;
                local v42 = math.floor(v21:getValue() / l_Offset_0) + 1;
                if l_current_0.index == v42 then
                    return ;
                else
                    v8.move(l_current_0.index, v42);
                    return ;
                end;
            end;
        end;
    end, {
        v8.move
    });
    if v4 then
        v2.useEffect(function()
            return function()
                v9.Icon = "rbxasset://SystemCursors/Arrow";
            end;
        end, {});
    end;
    return v2.createElement(l_Pane_0, {
        LayoutOrder = v8.layoutOrder,
        Size = UDim2.new(v8.cellSize.X, UDim.new(0, l_Offset_0 * #v8.tiles)),
        OnPress = v35,
        [v2.Event.InputChanged] = v38,
        [v2.Event.InputEnded] = v43,
        [v2.Change.AbsolutePosition] = function(v44)
            v18(v44.AbsolutePosition.Y);
        end,
        [v2.Change.AbsoluteSize] = function(v45)
            v20(v45.AbsoluteSize.Y);
        end
    }, v13);
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.Util.DEPRECATED_AvatarScreenContext);
local v4 = require(l_script_FirstAncestor_0.Src.Util.addPlatform);
local l_AssetRenderModel_0 = v1.UI.AssetRenderModel;
local l_Stylizer_0 = v1.ContextServices.Stylizer;
local v7 = 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);
return v2.memo(function(v10)
    local v11 = l_Stylizer_0:use("DummyPreview");
    local v12 = v2.useContext(v3);
    local v13, v14 = v2.useState(nil);
    v2.useEffect(function()
        if v13 ~= nil then
            v13:Destroy();
            v14(nil);
        end;
        if v10.Dummy == nil then
            return ;
        else
            assert(v10.Dummy ~= nil, v7.LUAU_ANALYZE_ERROR);
            local l_WorldModel_0 = Instance.new("WorldModel");
            v10.Dummy.Name = "Dummy";
            v10.Dummy.Parent = l_WorldModel_0;
            l_WorldModel_0.PrimaryPart = v10.Dummy.PrimaryPart;
            l_WorldModel_0:PivotTo(CFrame.new());
            v14(l_WorldModel_0);
            return v4(l_WorldModel_0, v10.Dummy, v11.PlatformHeight, v11.PlatformSize);
        end;
    end, {
        v10.Dummy
    });
    local v16 = v2.useState(Instance.new("Camera"));
    local v17 = v2.useRef({
        cframe = CFrame.new(),
        focus = CFrame.new(),
        model = nil
    });
    assert(v17.current ~= nil, v7.LUAU_ANALYZE_ERROR);
    local v20 = v2.useCallback(function()
        local l_current_0 = v17.current;
        assert(l_current_0.model ~= nil, "Model hasn't been set before resetCamera");
        local v19 = v12.stage.getPreviewCameraModifications and v12.stage.getPreviewCameraModifications(l_current_0.model.Dummy);
        v16.CFrame = v19.cframe or l_current_0.cframe;
        v16.Focus = v19.focus or l_current_0.focus;
        v16.FieldOfView = v19.fov;
    end, {
        v12.stage
    });
    v2.useEffect(function()
        if v17.current.model == nil then
            return ;
        else
            v20();
            return ;
        end;
    end, {
        v12.stage
    });
    local v22 = v2.useCallback(function(v21)
        task.defer(function()
            if v21:IsDescendantOf(game) then
                assert(v21:FindFirstChild("Dummy"), "View model does not have a dummy");
                v17.current = {
                    cframe = v16.CFrame,
                    focus = v16.Focus,
                    model = v21
                };
                v20();
                return ;
            else
                return ;
            end;
        end);
    end, {});
    v2.useEffect(function()
        local v23 = v10.ResetCameraSignal:Connect(v20);
        return function()
            v23:Disconnect();
        end;
    end, {
        v20,
        v10.ResetCameraSignal
    });
    if not v13 then
        return nil;
    else
        return (v2.createElement(l_AssetRenderModel_0, {
            Camera = v16,
            Model = v13,
            FocusPosition = v10.Dummy.PrimaryPart.CFrame.Position,
            FocusDirection = v10.Dummy.PrimaryPart.CFrame.LookVector,
            Size = UDim2.fromScale(1, 1),
            Ambient = v11.Ambient,
            LightColor = v11.LightColor,
            LightDirection = v11.LightDirection,
            PanSpeedMultiplier = v11.PanSpeedMultiplier,
            ShouldClone = false,
            RecenterModelOnUpdate = true,
            RecenterCameraOnUpdate = true,
            Static = v12.dummyPreviewLocked,
            OnViewModelLoaded = v22
        }));
    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.Packages.ViewportToolingFramework);
local v3 = require(l_script_FirstAncestor_0.Src.Components.AvatarScreenContext);
local v4 = require(l_script_FirstAncestor_0.Src.Util.DEPRECATED_AvatarScreenContext);
local v5 = require(l_script_FirstAncestor_0.Src.Components.EditingTools.BodyPointsTool);
local _ = require(l_script_FirstAncestor_0.Src.Components.EditingTools.BodyPointsTool.Types);
local v7 = require(l_script_FirstAncestor_0.Src.Util.Constants);
local _ = require(l_script_FirstAncestor_0.Src.Types);
local v9 = require(l_script_FirstAncestor_0.Src.Components.EditingTools.findPaletteKeyForAttachmentName);
local v10 = require(l_script_FirstAncestor_0.Src.Flags.getFFlagAvatarPreviewerSkinToneAlphaDetection);
local function v39(v11)
    local v12 = v1.useContext(if not v10() then v4 else v3.Context);
    local v13 = {};
    assert(v1.useRef({}).current ~= nil, v7.LUAU_ANALYZE_ERROR);
    local function v26(v14)
        local l_v11_0 = v11;
        for _, v17 in v14, nil, nil do
            l_v11_0 = l_v11_0:FindFirstChild(v17);
            if l_v11_0 == nil then
                return nil;
            end;
        end;
        if l_v11_0:IsA("Attachment") then
            assert(l_v11_0:IsA("Attachment"), v7.LUAU_ANALYZE_ERROR);
            return {
                name = l_v11_0.Name,
                limb = l_v11_0.Parent,
                getCFrame = function()
                    return v11.PrimaryPart.CFrame:ToObjectSpace(l_v11_0.WorldCFrame);
                end,
                onChange = function(v18)
                    l_v11_0.WorldCFrame = v11.PrimaryPart.CFrame:ToWorldSpace(v18);
                    local l_l_v11_0_FirstChild_0 = l_v11_0:FindFirstChild(v7.ORIGINAL_POSITION_VALUE);
                    if not (not (l_l_v11_0_FirstChild_0 ~= nil) or not l_l_v11_0_FirstChild_0:IsA("Vector3Value")) then
                        l_l_v11_0_FirstChild_0.Value = l_v11_0.Position;
                    end;
                end,
                onSelect = function()
                    local v20 = v9(l_v11_0.Name);
                    if v20 ~= nil then
                        v12.openPalette(v20);
                        v12.setFocusedAttachments(function(v21)
                            v21 = table.clone(v21);
                            table.insert(v21, l_v11_0.Name);
                            return v21;
                        end);
                    end;
                end,
                onUnselect = function()
                    v12.setFocusedAttachments(function(v22)
                        local v23 = table.find(v22, l_v11_0.Name);
                        if v23 == nil then
                            return v22;
                        else
                            assert(v23 ~= nil, v7.LUAU_ANALYZE_ERROR);
                            v22 = table.clone(v22);
                            table.remove(v22, v23);
                            return v22;
                        end;
                    end);
                end,
                connectChanged = function(v24)
                    local v25 = l_v11_0:GetPropertyChangedSignal("CFrame"):Connect(v24);
                    return function()
                        v25:Disconnect();
                    end;
                end
            };
        else
            return nil;
        end;
    end;
    local function _(v27, v28)
        local v29 = v26(v27);
        if v29 == nil then
            return ;
        else
            assert(v29 ~= nil, v7.LUAU_ANALYZE_ERROR);
            if v28 ~= nil then
                local v30 = v26(v28);
                if v30 ~= nil then
                    v30.symmetricalPartner = v29.name;
                    table.insert(v13, v30);
                    v29.symmetricalPartner = v30.name;
                end;
            end;
            table.insert(v13, v29);
            return ;
        end;
    end;
    local v32 = v26({
        "Head",
        "HatAttachment"
    });
    if not (v32 == nil) then
        assert(v32 ~= nil, v7.LUAU_ANALYZE_ERROR);
        table.insert(v13, v32);
    end;
    v32 = v26({
        "Head",
        "HairAttachment"
    });
    if not (v32 == nil) then
        assert(v32 ~= nil, v7.LUAU_ANALYZE_ERROR);
        table.insert(v13, v32);
    end;
    v32 = v26({
        "Head",
        "FaceCenterAttachment"
    });
    if not (v32 == nil) then
        assert(v32 ~= nil, v7.LUAU_ANALYZE_ERROR);
        table.insert(v13, v32);
    end;
    v32 = v26({
        "Head",
        "FaceFrontAttachment"
    });
    if not (v32 == nil) then
        assert(v32 ~= nil, v7.LUAU_ANALYZE_ERROR);
        table.insert(v13, v32);
    end;
    v32 = v26({
        "UpperTorso",
        "BodyFrontAttachment"
    });
    if not (v32 == nil) then
        assert(v32 ~= nil, v7.LUAU_ANALYZE_ERROR);
        table.insert(v13, v32);
    end;
    v32 = v26({
        "UpperTorso",
        "BodyBackAttachment"
    });
    if not (v32 == nil) then
        assert(v32 ~= nil, v7.LUAU_ANALYZE_ERROR);
        table.insert(v13, v32);
    end;
    v32 = v26({
        "UpperTorso",
        "NeckAttachment"
    });
    if not (v32 == nil) then
        assert(v32 ~= nil, v7.LUAU_ANALYZE_ERROR);
        table.insert(v13, v32);
    end;
    v32 = v26({
        "UpperTorso",
        "WristRigAttachment"
    });
    if not (v32 == nil) then
        assert(v32 ~= nil, v7.LUAU_ANALYZE_ERROR);
        table.insert(v13, v32);
    end;
    v32 = v26({
        "LowerTorso",
        "WaistBackAttachment"
    });
    if not (v32 == nil) then
        assert(v32 ~= nil, v7.LUAU_ANALYZE_ERROR);
        table.insert(v13, v32);
    end;
    v32 = v26({
        "LowerTorso",
        "WaistCenterAttachment"
    });
    if not (v32 == nil) then
        assert(v32 ~= nil, v7.LUAU_ANALYZE_ERROR);
        table.insert(v13, v32);
    end;
    v32 = v26({
        "LowerTorso",
        "WaistFrontAttachment"
    });
    if not (v32 == nil) then
        assert(v32 ~= nil, v7.LUAU_ANALYZE_ERROR);
        table.insert(v13, v32);
    end;
    local v33 = {
        "UpperTorso",
        "LeftCollarAttachment"
    };
    v32 = {
        "UpperTorso",
        "RightCollarAttachment"
    };
    local v34 = v26(v33);
    if not (v34 == nil) then
        assert(v34 ~= nil, v7.LUAU_ANALYZE_ERROR);
        if v32 ~= nil then
            local v35 = v26(v32);
            if v35 ~= nil then
                v35.symmetricalPartner = v34.name;
                table.insert(v13, v35);
                v34.symmetricalPartner = v35.name;
            end;
        end;
        table.insert(v13, v34);
    end;
    v33 = {
        "LeftUpperArm",
        "LeftShoulderAttachment"
    };
    v32 = {
        "RightUpperArm",
        "RightShoulderAttachment"
    };
    v34 = v26(v33);
    if not (v34 == nil) then
        assert(v34 ~= nil, v7.LUAU_ANALYZE_ERROR);
        if v32 ~= nil then
            local v36 = v26(v32);
            if v36 ~= nil then
                v36.symmetricalPartner = v34.name;
                table.insert(v13, v36);
                v34.symmetricalPartner = v36.name;
            end;
        end;
        table.insert(v13, v34);
    end;
    v33 = {
        "LeftHand",
        "LeftGripAttachment"
    };
    v32 = {
        "RightHand",
        "RightGripAttachment"
    };
    v34 = v26(v33);
    if not (v34 == nil) then
        assert(v34 ~= nil, v7.LUAU_ANALYZE_ERROR);
        if v32 ~= nil then
            local v37 = v26(v32);
            if v37 ~= nil then
                v37.symmetricalPartner = v34.name;
                table.insert(v13, v37);
                v34.symmetricalPartner = v37.name;
            end;
        end;
        table.insert(v13, v34);
    end;
    v33 = {
        "LeftFoot",
        "LeftFootAttachment"
    };
    v32 = {
        "RightFoot",
        "RightFootAttachment"
    };
    v34 = v26(v33);
    if v34 == nil then
        return v13;
    else
        assert(v34 ~= nil, v7.LUAU_ANALYZE_ERROR);
        if v32 ~= nil then
            local v38 = v26(v32);
            if v38 ~= nil then
                v38.symmetricalPartner = v34.name;
                table.insert(v13, v38);
                v34.symmetricalPartner = v38.name;
            end;
        end;
        table.insert(v13, v34);
        return v13;
    end;
end;
return function(v40)
    return v1.createElement(v5, {
        name = "AttachmentTool",
        worldModel = v40.worldModel,
        points = v39(v40.worldModel),
        generallyEquivalentPointNames = {
            {
                "HairAttachment",
                "HatAttachment"
            }
        },
        additionalToolbarItems = v40.additionalToolbarItems
    });
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.Hooks.useToggleState);
return function(v3)
    local v4 = v2(false);
    local v5 = v1.useCallback(function()
        v4.enable();
        v3.onMouseEnter();
    end, {
        v3.onMouseEnter
    });
    local v6 = v1.useCallback(function()
        v4.disable();
        v3.onMouseLeave();
    end, {
        v3.onMouseLeave
    });
    local v7 = if v3.showOrientation ~= nil then v3.showOrientation else v4.enabled;
    return v1.createElement(v1.Fragment, {}, {
        Sphere = v1.createElement("SphereHandleAdornment", {
            Adornee = v3.adornee,
            AlwaysOnTop = true,
            CFrame = v3.cframe,
            Color3 = v3.color,
            Radius = 0.1,
            Transparency = v3.transparency,
            ZIndex = 1,
            [v1.Event.MouseEnter] = v5,
            [v1.Event.MouseLeave] = v6
        }),
        X = v7 and v1.createElement("LineHandleAdornment", {
            Adornee = v3.adornee,
            AlwaysOnTop = true,
            Length = 0.25,
            Thickness = 3,
            Color3 = Color3.new(1, 0, 0),
            CFrame = v3.cframe * CFrame.Angles(0, 1.5707963267948966, 0),
            ZIndex = 2
        }),
        Y = v7 and v1.createElement("LineHandleAdornment", {
            Adornee = v3.adornee,
            AlwaysOnTop = true,
            Length = 0.25,
            Thickness = 3,
            Color3 = Color3.new(0, 1, 0),
            CFrame = v3.cframe * CFrame.Angles(1.5707963267948966, 0, 0),
            ZIndex = 2
        }),
        Z = v7 and v1.createElement("LineHandleAdornment", {
            Adornee = v3.adornee,
            AlwaysOnTop = true,
            Length = 0.25,
            Thickness = 3,
            Color3 = Color3.new(0, 0, 1),
            CFrame = v3.cframe,
            ZIndex = 2
        })
    });
end;


local l_Workspace_0 = game:GetService("Workspace");
local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
local _ = require(l_script_FirstAncestor_0.Src.Components.EditingTools.BodyPointsTool.Types);
local v3 = require(l_script_FirstAncestor_0.Src.Util.Constants);
local v4 = game:DefineFastFlag("AvatarPreviewerEditingToolsDraggerClosestPoint", false);
local v5 = {};
v5.__index = v5;
v5.new = function(v6)
    return (setmetatable({
        _draggerContext = v6,
        _selectedPoint = v6.selectedPoints[1],
        _updatePointPosition = if #v6.selectedPoints == 1 then v6.createUpdatePointPosition(v6.selectedPoints[1]) else nil
    }, v5));
end;
v5.render = function(_)
    return nil;
end;
v5.rotate = function(_)
end;
v5.update = function(v9)
    if v9._updatePointPosition == nil then
        return ;
    else
        assert(v9._updatePointPosition ~= nil, v3.LUAU_ANALYZE_ERROR);
        local v10 = v9._draggerContext:getMouseRay();
        local v11 = RaycastParams.new();
        v11.FilterType = Enum.RaycastFilterType.Include;
        v11.FilterDescendantsInstances = {
            v9._selectedPoint.limb
        };
        local v12 = l_Workspace_0:Raycast(v10.Origin, v10.Direction, v11);
        local v13 = nil;
        if not v4 then
            if v12 == nil then
                return ;
            else
                assert(v12 ~= nil, v3.LUAU_ANALYZE_ERROR);
                v13 = v12.Position;
            end;
        elseif v12 == nil then
            local l_limb_0 = v9._selectedPoint.limb;
            v13 = l_limb_0:GetClosestPointOnSurface(v10.Origin + v10.Direction.Unit * (l_limb_0.Position - v10.Origin).Magnitude);
        else
            v13 = v12.Position;
        end;
        if not v9._draggerContext.projectionEnabled then
            local _ = nil;
            local v16;
            while true do
                v16 = l_Workspace_0:Raycast(v10.Origin + v10.Direction * 0.05, -v10.Direction, v11);
                if v16 ~= nil then
                    break;
                end;
            end;
            assert(v16 ~= nil, v3.LUAU_ANALYZE_ERROR);
            v9._updatePointPosition(CFrame.new(v9._draggerContext.worldModel.PrimaryPart.CFrame:PointToObjectSpace((v13:Lerp(v16.Position, 0.5)))) * v9._selectedPoint.getCFrame().Rotation);
            return ;
        else
            v9._updatePointPosition(CFrame.new(v9._draggerContext.worldModel.PrimaryPart.CFrame:PointToObjectSpace(v13)) * v9._selectedPoint.getCFrame().Rotation);
            return ;
        end;
    end;
end;
v5.destroy = function(_)
end;
return v5;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
local v1 = require(l_script_FirstAncestor_0.Packages.DraggerFramework.Utility.BoundingBox);
local _ = require(l_script_FirstAncestor_0.Src.Components.EditingTools.BodyPointsTool.Types);
local v3 = require(l_script_FirstAncestor_0.Src.Components.EditingTools.BodyPointsTool.getBoundingBox);
local v4 = {};
v4.__index = v4;
v4.new = function(v5)
    return (setmetatable({
        _draggerContext = v5
    }, v4));
end;
v4.isEmpty = function(_)
    return false;
end;
v4.getBoundingBox = function(v7)
    if #v7._draggerContext.selectedPoints == 0 then
        local l_Pivot_0 = v7._draggerContext.worldModel:GetPivot();
        return l_Pivot_0, v1.fromObjects({
            v7._draggerContext.worldModel
        }, l_Pivot_0);
    else
        return v3(v7._draggerContext);
    end;
end;
v4.getLocalBoundingBox = function(_)
    error("getLocalBoundingBox is not supported");
end;
v4.doesContainItem = function(v10, v11)
    return table.find(v10._selection, v11) ~= nil;
end;
v4.isDynamic = function(_)
    return false;
end;
return v4;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
local v1 = require(l_script_FirstAncestor_0.Packages.DraggerSchemaTemplate.DraggerSchema);
local _ = require(l_script_FirstAncestor_0.Src.Components.EditingTools.BodyPointsTool.Types);
local v3 = require(l_script_FirstAncestor_0.Src.Components.EditingTools.BodyPointsTool.getHoveringPair);
return function(v4, v5, v6)
    local v7 = v3(v4);
    if v7 ~= nil then
        v4.selection:Set(v7);
    end;
    return v1.dispatchWorldClick(v4, v5, v6);
end;


local l_Workspace_0 = game:GetService("Workspace");
local _ = require(script:FindFirstAncestor("AvatarCompatibilityPreviewer").Src.Components.EditingTools.BodyPointsTool.Types);
return function(v2, _, v4)
    for _, v6 in v4, nil, nil do
        if table.find(v2.hoveredPointNames, v6) ~= nil then
            return v6, nil, 1;
        end;
    end;
    if #v2.hoveredPointNames == 0 then
        return nil, nil, nil;
    elseif #v2.hoveredPointNames == 1 then
        return v2.hoveredPointNames[1], nil, 1;
    else
        local l_CurrentCamera_0 = l_Workspace_0.CurrentCamera;
        assert(l_CurrentCamera_0 ~= nil, "Camera was set to nil before getMouseTarget");
        local v8 = nil;
        local l_huge_0 = math.huge;
        local v10 = 0;
        for _, v12 in v2.points, nil, nil do
            if table.find(v2.hoveredPointNames, v12.name) ~= nil then
                local l_Magnitude_0 = ((v2.worldModel.PrimaryPart.Position + v12.getCFrame().Position) - l_CurrentCamera_0.CFrame.Position).Magnitude;
                if l_Magnitude_0 < l_huge_0 then
                    l_huge_0 = l_Magnitude_0;
                    v8 = v12.name;
                end;
                v10 = v10 + 1;
                if not (v10 ~= #v2.hoveredPointNames) then
                    break;
                end;
            end;
        end;
        return v8, nil, 1;
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
return require(l_script_FirstAncestor_0.Packages.Dash).join(require(l_script_FirstAncestor_0.Packages.DraggerSchemaTemplate.DraggerSchema), {
    dispatchWorldClick = require(script.dispatchWorldClick),
    getMouseTarget = require(script.getMouseTarget),
    FreeformDragger = require(script.FreeformDragger),
    SelectionInfo = require(script.SelectionInfo)
});


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.DraggerFramework.Utility.Signal);
local _ = require(l_script_FirstAncestor_0.Src.Components.EditingTools.BodyPointsTool.Types);
local v4 = require(l_script_FirstAncestor_0.Src.Util.Constants);
local v5 = require(l_script_FirstAncestor_0.Src.Util.diffArray);
local v6 = {};
v6.__index = v6;
v6.new = function(v7)
    return (setmetatable({
        SelectionChanged = v2.new(),
        draggerContext = nil,
        _selection = {},
        _setSelectedPointNames = v7
    }, v6));
end;
v6.Get = function(v8)
    if #v8._selection == 0 then
        return {
            v4.PHONY_NO_SELECTION
        };
    else
        return v8._selection;
    end;
end;
local function _(v9, v10)
    local v12 = v1.find(v9.points, function(v11)
        return v11.name == v10;
    end);
    assert(v12 ~= nil, "Could not find point by name");
    return v12;
end;
v6.Set = function(v14, v15)
    local v16 = v14.draggerContext and v14.draggerContext.points;
    if v16 == nil then
        return ;
    else
        local v17 = false;
        if v14.draggerContext ~= nil then
            v17 = v16 ~= nil;
        end;
        assert(v17, v4.LUAU_ANALYZE_ERROR);
        if #v15 > 1 then
            local l_draggerContext_0 = v14.draggerContext;
            local v19 = v15[#v15];
            local v21 = v1.find(l_draggerContext_0.points, function(v20)
                return v20.name == v19;
            end);
            assert(v21 ~= nil, "Could not find point by name");
            local l_limb_0 = v21.limb;
            v17 = {
                v15[#v15]
            };
            for v23 = #v15 - 1, 1, -1 do
                local l_draggerContext_1 = v14.draggerContext;
                local v25 = v15[v23];
                local v27 = v1.find(l_draggerContext_1.points, function(v26)
                    return v26.name == v25;
                end);
                assert(v27 ~= nil, "Could not find point by name");
                if v27.limb == l_limb_0 then
                    table.insert(v17, 1, v15[v23]);
                end;
            end;
            v15 = v17;
        end;
        v14:_fireOnSelect(v15);
        v14._selection = v15;
        v14._setSelectedPointNames(v15);
        v14.SelectionChanged:Fire();
        return ;
    end;
end;
v6._fireOnSelect = function(v28, v29)
    assert(v28.draggerContext ~= nil, "_fireOnSelect called without dragger context");
    local v30, v31 = v5(v29, v28._selection);
    local v32 = 0;
    for _, v34 in v28.draggerContext.points, nil, nil do
        if table.find(v30, v34.name) ~= nil then
            if v34.onSelect ~= nil then
                v34.onSelect();
            end;
        elseif table.find(v31, v34.name) ~= nil then
            if v34.onUnselect ~= nil then
                v34.onUnselect();
            end;
        else
            continue;
        end;
        v32 = v32 + 1;
        if not (v32 ~= #v30 + #v31) then
            break;
        end;
    end;
end;
return v6;


local _ = require(script:FindFirstAncestor("AvatarCompatibilityPreviewer").Src.Types);
return nil;


local _ = require(script:FindFirstAncestor("AvatarCompatibilityPreviewer").Src.Components.EditingTools.BodyPointsTool.Types);
return function(v1)
    if #v1.selectedPoints == 0 then
        return CFrame.new(), Vector3.new(), (Vector3.new());
    else
        local l_huge_0 = math.huge;
        local v3 = -math.huge;
        local l_huge_1 = math.huge;
        local v5 = -math.huge;
        local l_huge_2 = math.huge;
        local v7 = -math.huge;
        local l_PrimaryPart_0 = v1.worldModel.PrimaryPart;
        for _, v10 in v1.selectedPoints, nil, nil do
            local l_Components_0, v12, v13 = v10.getCFrame():GetComponents();
            l_huge_0 = math.min(l_huge_0, l_Components_0);
            v3 = math.max(v3, l_Components_0);
            l_huge_1 = math.min(l_huge_1, v12);
            v5 = math.max(v5, v12);
            l_huge_2 = math.min(l_huge_2, v13);
            v7 = math.max(v7, v13);
        end;
        return l_PrimaryPart_0.CFrame + l_PrimaryPart_0.CFrame.Rotation * Vector3.new(0.5 * (l_huge_0 + v3), 0.5 * (l_huge_1 + v5), 0.5 * (l_huge_2 + v7)), Vector3.new(), (Vector3.new());
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
local _ = require(l_script_FirstAncestor_0.Src.Components.EditingTools.BodyPointsTool.Types);
local v2 = require(l_script_FirstAncestor_0.Src.Components.EditingTools.BodyPointsTool.DraggerSchema.getMouseTarget);
local v3 = require(l_script_FirstAncestor_0.Src.Util.Constants);
return function(v4)
    if v4.generallyEquivalentPointNames == nil then
        return nil;
    else
        assert(v4.generallyEquivalentPointNames ~= nil, v3.LUAU_ANALYZE_ERROR);
        if #v4.hoveredPointNames <= 1 then
            return nil;
        else
            local v5 = v2(v4, Ray.new(Vector3.zero, Vector3.zero), v4.selection:Get());
            if v5 == nil then
                return nil;
            else
                assert(v5 ~= nil, v3.LUAU_ANALYZE_ERROR);
                for _, v7 in v4.generallyEquivalentPointNames, nil, nil do
                    assert(#v7 == 2, "Generally equivalent point names should be in pairs");
                    if not (v7[1] ~= v5) or v7[2] == v5 then
                        for _, v9 in v4.hoveredPointNames, nil, nil do
                            if v9 ~= v5 and (not (v9 ~= v7[1]) or v9 == v7[2]) then
                                return v7;
                            end;
                        end;
                    end;
                end;
                return nil;
            end;
        end;
    end;
end;


local l_CoreGui_0 = game:GetService("CoreGui");
local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
local v2 = require(l_script_FirstAncestor_0.Packages.Dash);
local l_DraggerFramework_0 = l_script_FirstAncestor_0.Packages.DraggerFramework;
local v4 = require(l_script_FirstAncestor_0.Packages.Framework);
local v5 = require(l_script_FirstAncestor_0.Packages.React);
local v6 = require(l_script_FirstAncestor_0.Packages.ReactRoblox);
local v7 = require(l_script_FirstAncestor_0.Packages.ViewportToolingFramework);
local _ = require(l_script_FirstAncestor_0.Src.Types);
local v9 = require(script.BodyPointAdornment);
local _ = require(script.Types);
local v11 = require(script.getBoundingBox);
local v12 = require(script.useBodyMoveHandles);
local v13 = require(l_DraggerFramework_0.Implementation.DraggerContext_PluginImpl);
local v14 = require(script.DraggerSchema);
local v15 = require(l_DraggerFramework_0.DraggerTools.DraggerToolComponent);
local v16 = require(script.DraggerSelection);
local v17 = require(l_DraggerFramework_0.Handles.MoveHandles);
local v18 = require(l_DraggerFramework_0.Handles.RotateHandles);
local v19 = require(l_script_FirstAncestor_0.Src.Util.Constants);
local _ = require(l_script_FirstAncestor_0.Src.Resources.Theme);
local v21 = require(l_script_FirstAncestor_0.Src.Components.EditingTools.useBindFocusOnPositions);
local v22 = require(script.useDisambiguationContextMenu);
local v23 = require(l_script_FirstAncestor_0.Src.Hooks.useRefWithInitial);
local v24 = require(l_script_FirstAncestor_0.Src.Hooks.useToggleState);
local v25 = require(l_script_FirstAncestor_0.Src.Hooks.useUndoRedoActions);
local l_Mouse_0 = v4.ContextServices.Mouse;
local l_Plugin_0 = v4.ContextServices.Plugin;
local l_Stylizer_0 = v4.ContextServices.Stylizer;
local function v29(v30)
    local v31 = {};
    for _, v33 in v30, nil, nil do
        v31[v33] = v33.getCFrame();
    end;
    return function()
        local v34 = v29(v30);
        for v35, v36 in v31, nil, nil do
            v35.onChange(v36);
        end;
        return v34;
    end;
end;
local function _(v37, v38)
    local v39 = table.remove(v37);
    if v39 == nil then
        return ;
    else
        assert(v39 ~= nil, v19.LUAU_ANALYZE_ERROR);
        table.insert(v38, (v39()));
        return ;
    end;
end;
return function(v41)
    local v42 = l_Stylizer_0:use("BodyPointsTool");
    local v43 = {};
    local v44, v45 = v5.useState({});
    local v46 = v5.useRef(nil);
    local v47 = l_Plugin_0:use():get();
    local v48 = v24(false);
    local v49 = v23(function()
        return v16.new(v45);
    end);
    local v51 = v23(function()
        local v50 = v13.new(v47, game, settings(), v49.current);
        v50.hoveredPointNames = {};
        v50.getGuiParent = function()
            assert(v46.current ~= nil, "Container isn't mounted yet");
            return v46.current;
        end;
        v50.shouldGridSnap = function()
            return false;
        end;
        return v50;
    end);
    local l_current_0 = v51.current;
    v49.current.draggerContext = l_current_0;
    l_current_0.generallyEquivalentPointNames = v41.generallyEquivalentPointNames;
    l_current_0.selection = v49.current;
    l_current_0.points = v41.points;
    local v54 = v5.useMemo(function()
        return v2.filter(v41.points, function(v53)
            return table.find(v44, v53.name) ~= nil;
        end);
    end, {
        v41.points,
        v44
    });
    l_current_0.selectedPoints = v54;
    l_current_0.worldModel = v41.worldModel;
    v22(l_current_0);
    local v55 = v24(true);
    l_current_0.projectionEnabled = v55.enabled;
    local v56 = v24(true);
    v5.useEffect(v48.enable, {});
    local v57 = l_Mouse_0:use():get();
    local v61 = v5.useCallback(function()
        local v58 = {};
        for _, v60 in v41.points, nil, nil do
            table.insert(v58, {
                name = v60.name,
                cframe = v60.getCFrame()
            });
        end;
        return v58;
    end, {
        v41.points
    });
    local v62 = v5.useRef({});
    assert(v62.current ~= nil, v19.LUAU_ANALYZE_ERROR);
    local v63 = v5.useRef({});
    assert(v63.current ~= nil, v19.LUAU_ANALYZE_ERROR);
    local v64, v65 = v5.useState(v61);
    local v76 = v5.useCallback(function(v66)
        local v67 = v66.getCFrame();
        local v69 = v66.symmetricalPartner and v2.find(v41.points, function(v68)
            return v68.name == v66.symmetricalPartner;
        end);
        local v70 = v69 and v69.getCFrame();
        return function(v71)
            v66.onChange(v71);
            if (v56.enabled and v69 ~= nil) and v70 ~= nil then
                local v72 = v71.Position - v67.Position;
                local v73, v74, v75 = (v71 * v67:Inverse()).Rotation:ToOrientation();
                v69.onChange((v70 + v72 * Vector3.new(-1, 1, 1)) * CFrame.fromOrientation(v73, -v74, -v75));
            end;
        end;
    end, {
        v41.points,
        v56.enabled
    });
    l_current_0.createUpdatePointPosition = v76;
    v25(function()
        local l_current_1 = v62.current;
        local l_current_2 = v63.current;
        local v79 = table.remove(l_current_1);
        if v79 == nil then
            return ;
        else
            assert(v79 ~= nil, v19.LUAU_ANALYZE_ERROR);
            table.insert(l_current_2, (v79()));
            return ;
        end;
    end, function()
        local l_current_3 = v63.current;
        local l_current_4 = v62.current;
        local v82 = table.remove(l_current_3);
        if v82 == nil then
            return ;
        else
            assert(v82 ~= nil, v19.LUAU_ANALYZE_ERROR);
            table.insert(l_current_4, (v82()));
            return ;
        end;
    end);
    v21((v5.useMemo(function()
        local v83 = {};
        for _, v85 in v64, nil, nil do
            if table.find(v44, v85.name) ~= nil then
                table.insert(v83, (v41.worldModel.PrimaryPart.CFrame * v85.cframe).Position);
                if not (#v83 ~= #v44) then
                    break;
                end;
            end;
        end;
        return v83;
    end, {
        v64,
        v44,
        v41.worldModel
    })));
    v5.useEffect(function()
        local v86 = {};
        local function v87()
            v65(v61);
        end;
        for _, v89 in v54, nil, nil do
            if v89.connectChanged ~= nil then
                table.insert(v86, v89.connectChanged(v87));
            end;
        end;
        return function()
            for _, v91 in v86, nil, nil do
                v91();
            end;
        end;
    end, {
        v54
    });
    for v92, v93 in v64, nil, nil do
        local v94 = table.find(v44, v93.name) ~= nil;
        local v97 = (not v94 and v56.enabled) and v2.find(v44, function(v95)
            return v2.find(v41.points, function(v96)
                return v96.name == v95;
            end).symmetricalPartner == v93.name;
        end);
        v43[("Point%*"):format(v92)] = v5.createElement(v9, {
            adornee = v41.worldModel.PrimaryPart,
            cframe = v93.cframe,
            selected = v94 or v97,
            color = if not v94 then if v97 then Color3.new(0, 0, 1) else Color3.new(1, 0, 0) else Color3.new(0, 1, 0),
            transparency = (v94 or v97) and 0 or 0.5,
            showOrientation = (v94 or v97) and true or nil,
            onMouseEnter = function()
                if table.find(l_current_0.hoveredPointNames, v93.name) ~= nil then
                    return ;
                else
                    table.insert(l_current_0.hoveredPointNames, v93.name);
                    return ;
                end;
            end,
            onMouseLeave = function()
                local v98 = table.find(l_current_0.hoveredPointNames, v93.name);
                if v98 ~= nil then
                    table.remove(l_current_0.hoveredPointNames, v98);
                end;
            end
        });
    end;
    local v99 = v12(l_current_0, v41.worldModel);
    local v111 = v5.useMemo(function()
        local v100 = {};
        return {
            beginDrag = function()
                local v101 = v11(l_current_0);
                table.clear(v63.current);
                table.insert(v62.current, (v29(v54)));
                for _, v103 in v54, nil, nil do
                    local v104 = v76(v103);
                    local v105 = v103.getCFrame();
                    table.insert(v100, function(v106)
                        v104(((v101:Inverse() * v106) * v101) * v105.Rotation + v105.Position);
                    end);
                end;
            end,
            updateDrag = function(_, v108)
                for _, v110 in v100, nil, nil do
                    v110(v108);
                end;
                return v108;
            end,
            endDrag = function()
                table.clear(v100);
            end,
            render = function()
                return nil;
            end
        };
    end, {
        v54,
        v61,
        v76
    });
    local v112 = v5.useMemo(function()
        return v17.new(l_current_0, {
            ShowBoundingBox = false,
            Summonable = false,
            Outset = 0.3
        }, v111);
    end, {
        v111
    });
    local v113 = v5.useMemo(function()
        return v18.new(l_current_0, {
            ShowBoundingBox = false,
            Summonable = false,
            Outset = 0.3
        }, v111);
    end, {
        v111
    });
    return v5.createElement(v5.Fragment, {}, {
        [v19.EDITING_TOOLS_GUI_NAMES.BodyPoints] = v6.createPortal(v5.createElement("Folder", {
            ref = v46
        }, v43, {
            Dragger = v48.enabled and v5.createElement(v15, (v5.useMemo(function()
                return {
                    Mouse = v57,
                    DraggerContext = v51.current,
                    DraggerSchema = v14,
                    DraggerSettings = {
                        AnalyticsName = v41.name,
                        HandlesList = if #v54 == 0 then {
                            v99
                        } else {
                            v112,
                            v113
                        }
                    }
                };
            end, {
                v99,
                v112,
                v113,
                #v54 == 0
            })))
        }), l_CoreGui_0, v19.EDITING_TOOLS_GUI_NAMES.BodyPoints),
        [v19.EDITING_TOOLS_GUI_NAMES.BodyPointsToolToolbar] = v5.createElement(v7.Toolbar, {
            HorizontalItems = {
                {
                    Type = "Button",
                    Tooltip = "Projection",
                    Icon = v42.ProjectionImage,
                    OnClick = v55.toggle,
                    Selected = v55.enabled
                },
                {
                    Type = "Button",
                    Tooltip = "Symmetrical",
                    Icon = v42.SymmetricalImage,
                    OnClick = v56.toggle,
                    Selected = v56.enabled
                },
                {
                    Type = "Separator"
                },
                unpack(v41.additionalToolbarItems)
            }
        })
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
local l_DraggerFramework_0 = l_script_FirstAncestor_0.Packages.DraggerFramework;
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local _ = require(l_script_FirstAncestor_0.Src.Components.EditingTools.BodyPointsTool.Types);
local _ = require(l_script_FirstAncestor_0.Src.Types);
local v5 = require(l_DraggerFramework_0.Handles.MoveHandles);
return function(v6, v7)
    local v11 = v2.useMemo(function()
        local v8 = nil;
        return {
            beginDrag = function()
                v8 = v7:GetPivot();
            end,
            updateDrag = function(_, v10)
                assert(v8 ~= nil, "startDragPivot not set during updateDrag");
                v7:PivotTo(v8 * v10);
                return v10;
            end,
            endDrag = function()
                v8 = nil;
            end,
            render = function()
                return nil;
            end
        };
    end, {
        v7
    });
    return v2.useMemo(function()
        return v5.new(v6, {
            ShowBoundingBox = false,
            Summonable = false,
            Outset = 1
        }, v11);
    end, {
        v11
    });
end;


local l_UserInputService_0 = game:GetService("UserInputService");
local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
local v2 = require(l_script_FirstAncestor_0.Packages.Framework);
local _ = require(l_script_FirstAncestor_0.Src.Components.EditingTools.BodyPointsTool.Types);
local v4 = require(l_script_FirstAncestor_0.Src.Util.Constants);
local v5 = require(l_script_FirstAncestor_0.Src.Components.EditingTools.BodyPointsTool.getHoveringPair);
local v6 = require(l_script_FirstAncestor_0.Src.Hooks.useEventConnection);
local l_showContextMenu_0 = v2.UI.showContextMenu;
local l_Localization_0 = v2.ContextServices.Localization;
local l_Plugin_0 = v2.ContextServices.Plugin;
return function(v10)
    local v11 = l_Localization_0:use();
    local v12 = l_Plugin_0:use():get();
    v6(l_UserInputService_0.InputBegan, function(v13)
        if v13.UserInputType ~= Enum.UserInputType.MouseButton2 then
            return ;
        else
            local v14 = v5(v10);
            if v14 == nil then
                return ;
            else
                assert(v14 ~= nil, v4.LUAU_ANALYZE_ERROR);
                v13.UserInputState = Enum.UserInputState.Cancel;
                local v15 = {
                    {
                        Text = v11:getText("BodyPointsTool", "SelectAll"),
                        OnItemClicked = function()
                            v10.selection:Set(v14);
                        end
                    }
                };
                for _, v17 in v14, nil, nil do
                    table.insert(v15, {
                        Text = v17,
                        OnItemClicked = function()
                            v10.selection:Set({
                                v17
                            });
                        end
                    });
                end;
                l_showContextMenu_0(v12, v15);
                return ;
            end;
        end;
    end, {});
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
local l_LuaMeshEditingModule_0 = l_script_FirstAncestor_0.Packages.LuaMeshEditingModule;
local v2 = require(l_script_FirstAncestor_0.Packages.AvatarToolsShared);
local v3 = require(l_script_FirstAncestor_0.Packages.React);
local v4 = require(l_script_FirstAncestor_0.Packages.Framework);
local _ = require(l_script_FirstAncestor_0.Src.Types);
local v6 = require(l_script_FirstAncestor_0.Src.Components.EditingTools.createSymmetryMapAsync);
local v7 = require(l_script_FirstAncestor_0.Src.Hooks.useUndoRedoActions);
local v8 = require(l_LuaMeshEditingModule_0.MeshEditingContexts.CageEditingContext);
local v9 = require(l_LuaMeshEditingModule_0.Components.FreeformMeshEditingComponent);
local l_ContextServices_0 = v4.ContextServices;
local l_Mouse_0 = l_ContextServices_0.Mouse;
local l_Plugin_0 = l_ContextServices_0.Plugin;
local l_LuaMeshEditingModuleContext_0 = v2.Contexts.LuaMeshEditingModuleContext;
return function(v14)
    local v15 = l_LuaMeshEditingModuleContext_0:use();
    local l_Mannequin_0 = v14.Mannequin;
    local v17 = l_Mouse_0:use():get();
    local v18 = l_Plugin_0:use():get();
    local v19, v20 = v3.useState(nil);
    local v21 = v3.useRef(nil);
    v3.useEffect(function()
        local v22 = v8.new();
        v21.current = v22;
        v22:initFromCageMesh(Enum.CageType.Outer, l_Mannequin_0);
        v15:setOuterCageContext(v22);
        v15:setCurrentTool("BrushTool");
        v15:changeEditingCage(Enum.CageType.Outer);
        v20(v15:getCurrentTool());
        local v26 = v22:getMeshDataChangedSignal():Connect(function()
            local v23 = v15:getOuterCageContext();
            if not (not v23 or not l_Mannequin_0) then
                for _, v25 in l_Mannequin_0:GetDescendants() do
                    if v25:IsA("WrapTarget") then
                        v25:ModifyVertices(Enum.CageType.Outer, v23:getVertexData()[v25.Name]);
                    end;
                end;
            end;
        end);
        return function()
            v26:Disconnect();
            v15:getCurrentTool():cleanup();
            v20(nil);
        end;
    end, {
        l_Mannequin_0
    });
    v3.useEffect(function()
        if v14.Symmetrical then
            local l_current_0 = v21.current;
            assert(l_current_0 ~= nil, "No outerCageContext");
            local v28 = task.spawn(function()
                l_current_0:setSymmetryMap(v6(l_Mannequin_0));
            end);
            return function()
                task.cancel(v28);
                l_current_0:setSymmetryMap({});
            end;
        else
            return nil;
        end;
    end, {
        v14.Symmetrical
    });
    v7(v3.useCallback(function()
        local v29 = v15:getCurrentTool();
        if v29 then
            v29:undo();
        end;
    end, {}), (v3.useCallback(function()
        local v30 = v15:getCurrentTool();
        if v30 then
            v30:redo();
        end;
    end, {})));
    return v19 and v3.createElement(v9, {
        Mouse = v17,
        Plugin = v18,
        VertexToolBase = v19,
        Radius = v14.Radius,
        Falloff = v14.Falloff,
        Mannequin = l_Mannequin_0,
        OnChangeSelectedPositions = v14.OnChangeSelectedPositions
    });
end;