local l_script_0 = script;
local v1 = require(l_script_0.flags.getFFlagUseUGCValidationContext);
local v2 = require(l_script_0.flags.getFFlagUGCValidationShouldYield);
local v3 = require(l_script_0.flags.getEngineFeatureUGCValidateEditableMeshAndImage);
local v4 = require(l_script_0.Analytics);
local v5 = require(l_script_0.Constants);
local v6 = require(l_script_0.util.BundlesMetadata);
local v7 = require(l_script_0.util.canUploadBundlesAsync);
local v8 = require(l_script_0.util.createUGCBodyPartFolders);
local v9 = require(l_script_0.util.isLayeredClothing);
local v10 = require(l_script_0.util.RigidOrLayeredAllowed);
local _ = require(l_script_0.util.Types);
local v12 = require(l_script_0.util.createEditableInstancesForContext);
local v13 = require(l_script_0.util.destroyEditableInstances);
local v14 = require(l_script_0.validation.validateInternal);
local v15 = require(l_script_0.validation.validateLayeredClothingAccessoryMeshPartAssetFormat);
local v16 = require(l_script_0.validation.validateLegacyAccessoryMeshPartAssetFormat);
local v17 = require(l_script_0.validation.validateFullBody);
local v18 = require(l_script_0.validation.validateBundleReadyForUpload);
local v19 = require(l_script_0.validation.validateDynamicHeadMeshPartFormat);
local v90 = {
    validate = function(v20, v21, v22, v23, v24, v25, v26, v27, v28, v29)
        v4.setMetadata({
            entrypoint = "validate",
            assetType = v21.Name,
            isServer = v22
        });
        if not v1() then
            local v30, v31 = v14(false, v20, v21, v22, v23, v24, v25, v26);
            return v30, v31;
        else
            local v32 = nil;
            local v33 = nil;
            if v3() then
                local v34, v35 = v12(v20, v27);
                v32 = v34;
                v33 = v35;
                if not v32 then
                    if not v22 then
                        return v32, v33;
                    else
                        error(v33[1]);
                    end;
                end;
            end;
            local v36 = {
                instances = v20,
                assetTypeEnum = v21,
                allowUnreviewedAssets = v23,
                restrictedUserIds = v24,
                isServer = v22,
                token = v25,
                universeId = v26,
                isAsync = false,
                allowEditableInstances = v27,
                bypassFlags = v28
            };
            if v2() then
                v36.lastTickSeconds = tick();
                v36.shouldYield = v29;
            end;
            if v3() then
                v36.editableMeshes = v33.editableMeshes;
                v36.editableImages = v33.editableImages;
            end;
            local v37, v38 = v14(v36);
            if v3() then
                v13(v36.editableMeshes, v36.editableImages);
            end;
            return v37, v38;
        end;
    end,
    validateAsync = function(v39, v40, v41, v42, v43, v44)
        v4.setMetadata({
            entrypoint = "validateAsync",
            assetType = v40.Name,
            isServer = v42
        });
        if not v1() then
            coroutine.wrap(function()
                v41(v14(true, v39, v40, v42, v43, v44, ""));
            end)();
            return ;
        else
            local v45 = nil;
            local v46 = nil;
            if v3() then
                local v47, v48 = v12(v39);
                v45 = v47;
                v46 = v48;
                if not v45 then
                    if not v42 then
                        v41(v45, v46);
                    else
                        error(v46[1]);
                    end;
                end;
            end;
            local v49 = {
                instances = v39,
                assetTypeEnum = v40,
                allowUnreviewedAssets = v43,
                restrictedUserIds = v44,
                isServer = v42,
                token = "",
                isAsync = true
            };
            if v3() then
                v49.editableMeshes = v46.editableMeshes;
                v49.editableImages = v46.editableImages;
            end;
            coroutine.wrap(function()
                v41(v14(v49));
                if v3() then
                    v13(v49.editableMeshes, v49.editableImages);
                end;
            end)();
            return ;
        end;
    end,
    validateMeshPartFormat = function(v50, v51, v52, v53, v54)
        v4.setMetadata({
            entrypoint = "validateMeshPartFormat",
            assetType = v51.Name,
            isServer = v52
        });
        assert(Enum.AssetType.DynamicHead == v51);
        if not v1() then
            return v19(v50, v52, v53, v54);
        else
            local v55 = nil;
            local v56 = nil;
            if v3() then
                local v57, v58 = v12(v50);
                v55 = v57;
                v56 = v58;
                if not v55 then
                    if not v52 then
                        return v55, v56;
                    else
                        error(v56[1]);
                    end;
                end;
            end;
            local v59 = {
                instances = v50,
                assetTypeEnum = v51,
                allowUnreviewedAssets = v53,
                restrictedUserIds = v54,
                isServer = v52
            };
            if v3() then
                v59.editableMeshes = v56.editableMeshes;
                v59.editableImages = v56.editableImages;
            end;
            local v60, v61 = v19(v59);
            if v3() then
                v13(v59.editableMeshes, v59.editableImages);
            end;
            return v60, v61;
        end;
    end,
    validateAsyncMeshPartFormat = function(v62, v63, v64, v65, v66, v67)
        v4.setMetadata({
            entrypoint = "validateAsyncMeshPartFormat",
            assetType = v63.Name,
            isServer = v65
        });
        assert(Enum.AssetType.DynamicHead == v63);
        if not v1() then
            coroutine.wrap(function()
                v64(v19(v62, v65, v66, v67));
            end)();
            return ;
        else
            local v68 = nil;
            local v69 = nil;
            if v3() then
                local v70, v71 = v12(v62);
                v68 = v70;
                v69 = v71;
                if not v68 then
                    if not v65 then
                        v64(v68, v69);
                    else
                        error(v69[1]);
                    end;
                end;
            end;
            local v72 = {
                instances = v62,
                assetTypeEnum = v63,
                allowUnreviewedAssets = v66,
                restrictedUserIds = v67,
                isServer = v65
            };
            if v3() then
                v72.editableMeshes = v69.editableMeshes;
                v72.editableImages = v69.editableImages;
            end;
            coroutine.wrap(function()
                v64(v19(v72));
                if v3() then
                    v13(v72.editableMeshes, v72.editableImages);
                end;
            end)();
            return ;
        end;
    end,
    validateMeshPartAssetFormat2 = function(v73, v74, v75, v76, v77, _)
        v4.setMetadata({
            entrypoint = "validateMeshPartAssetFormat2",
            assetType = v75.Name,
            isServer = v76
        });
        if not v1() then
            if not v9(v73[1]) then
                return v16(v73, v74, v75, v76);
            else
                return v15(v73, v74, v75, v76, v77);
            end;
        else
            local v79 = nil;
            local v80 = nil;
            if v3() then
                local v81, v82 = v12(v73);
                v79 = v81;
                v80 = v82;
                if not v79 then
                    if not v76 then
                        return v79, v80;
                    else
                        error(v80[1]);
                    end;
                end;
            end;
            local v83 = {
                instances = v73,
                assetTypeEnum = v75,
                allowUnreviewedAssets = v77,
                isServer = v76
            };
            if v3() then
                v83.editableMeshes = v80.editableMeshes;
                v83.editableImages = v80.editableImages;
            end;
            local v84 = nil;
            local v85 = nil;
            if not v9(v73[1]) then
                local v86, v87 = v16(v74, v83);
                v84 = v86;
                v85 = v87;
            else
                local v88, v89 = v15(v74, v83);
                v84 = v88;
                v85 = v89;
            end;
            if v3() then
                v13(v83.editableMeshes, v83.editableImages);
            end;
            return v84, v85;
        end;
    end,
    validateBundleReadyForUpload = v18,
    util = {
        BundlesMetadata = v6,
        createUGCBodyPartFolders = v8,
        canUploadBundlesAsync = v7
    }
};
v90.util.isLayeredClothingAllowed = v10.isLayeredClothingAllowed;
v90.util.isRigidAccessoryAllowed = v10.isRigidAccessoryAllowed;
v90.validateFullBody = function(v91, v92, v93, v94, v95)
    v4.setMetadata({
        entrypoint = "validateFullBody",
        assetType = "",
        isServer = v92
    });
    if not v1() then
        return v17(v91, v92);
    else
        local v96 = nil;
        local v97 = nil;
        if v3() then
            local v98 = {};
            for _, v100 in v91, nil, nil do
                for _, v102 in v100.allSelectedInstances, nil, nil do
                    table.insert(v98, v102);
                end;
            end;
            local v103, v104 = v12(v98, v93);
            v96 = v103;
            v97 = v104;
            if not v96 then
                if not v92 then
                    return v96, v97;
                else
                    error(v97[1]);
                end;
            end;
        end;
        local v105 = {
            fullBodyData = v91,
            isServer = v92,
            allowEditableInstances = v93,
            bypassFlags = v94
        };
        if v2() then
            v105.lastTickSeconds = tick();
            v105.shouldYield = v95;
        end;
        if v3() then
            v105.editableMeshes = v97.editableMeshes;
            v105.editableImages = v97.editableImages;
        end;
        local v106, v107 = v17(v105);
        if v3() then
            v13(v105.editableMeshes, v105.editableImages);
        end;
        return v106, v107;
    end;
end;
v90.GUIDAttributeName = v5.GUIDAttributeName;
return v90;


local l_HttpRbxApiService_0 = game:GetService("HttpRbxApiService");
local l_ContentProvider_0 = game:GetService("ContentProvider");
local v7 = {
    getBaseDomain = function()
        local l_BaseUrl_0 = l_ContentProvider_0.BaseUrl;
        if string.sub(l_BaseUrl_0, #l_BaseUrl_0) ~= "/" then
            l_BaseUrl_0 = l_BaseUrl_0 .. "/";
        end;
        local _, v4 = string.find(l_BaseUrl_0, "://");
        local _, v6 = string.find(l_BaseUrl_0, "%.", v4 + 1);
        return (string.sub(l_BaseUrl_0, v6 + 1));
    end
};
local function v8(v9, v10)
    if v10 == nil then
        v10 = 0;
    end;
    local l_status_0, l_result_0 = pcall(v9);
    if not l_status_0 then
        if v10 >= 2 then
            return false, l_result_0;
        else
            wait(2 ^ (v10 - 1));
            return v8(v9, v10 + 1);
        end;
    else
        return true, l_result_0;
    end;
end;
v7.requestAndRetryPost = function(v13, v14)
    return v8(function()
        return l_HttpRbxApiService_0:PostAsyncFullUrl(v13, v14);
    end);
end;
v7.requestAndRetryGet = function(v15)
    return v8(function()
        return l_HttpRbxApiService_0:GetAsyncFullUrl(v15);
    end);
end;
return v7;


local l_Parent_0 = script.Parent.Parent;
local _ = require(l_Parent_0.util.Types);
local v2 = require(l_Parent_0.util.calculateMinMax);
local v3 = require(l_Parent_0.ConstantsInterface);
local v4 = require(l_Parent_0.flags.getFFlagUGCValidateFullBody);
local v17 = {
    calculateBounds = function(v5, v6, v7, v8)
        local v9, v10 = v2(v8.minMeshCorner, v8.maxMeshCorner, v7:PointToWorldSpace(-(v6.Size / 2)), v7:PointToWorldSpace(-(v6.Size / 2)));
        v8.minMeshCorner = v9;
        v8.maxMeshCorner = v10;
        v9, v10 = v2(v8.minMeshCorner, v8.maxMeshCorner, v7:PointToWorldSpace(v6.Size / 2), v7:PointToWorldSpace(v6.Size / 2));
        v8.minMeshCorner = v9;
        v8.maxMeshCorner = v10;
        for _, v12 in v3.getAttachments(v5, v6.Name) do
            local l_v6_FirstChild_0 = v6:FindFirstChild(v12);
            assert(l_v6_FirstChild_0);
            if string.match(l_v6_FirstChild_0.Name, "RigAttachment$") ~= nil then
                local v14 = v7 * l_v6_FirstChild_0.CFrame;
                local v15, v16 = v2(v8.minRigAttachment, v8.maxRigAttachment, v14.Position, v14.Position);
                v8.minRigAttachment = v15;
                v8.maxRigAttachment = v16;
            end;
        end;
        v9, v10 = v2(v8.minOverall, v8.maxOverall, v8.minMeshCorner, v8.maxMeshCorner);
        v8.minOverall = v9;
        v8.maxOverall = v10;
        v9, v10 = v2(v8.minOverall, v8.maxOverall, v8.minRigAttachment, v8.maxRigAttachment);
        v8.minOverall = v9;
        v8.maxOverall = v10;
    end
};
v17.traverseHierarchy = function(v18, v19, v20, v21, v22, v23, v24, v25)
    if v4() then
        assert((v18 ~= nil) ~= ((v19 and v20) ~= nil));
    end;
    local v26 = nil;
    v26 = if not not v4() and v18 then v18[v23] else v19:FindFirstChild(v23);
    assert(v26);
    local l_v22_0 = v22;
    if not v21 then
        l_v22_0 = CFrame.new();
    else
        local v28 = nil;
        v28 = if not not v4() and v18 then v18[v21] else v19:FindFirstChild(v21);
        assert(v28);
        local v29 = v3.getRigAttachmentToParent(v20, v23);
        local l_v28_FirstChild_0 = v28:FindFirstChild(v29);
        assert(l_v28_FirstChild_0);
        local l_v26_FirstChild_0 = v26:FindFirstChild(v29);
        assert(l_v26_FirstChild_0);
        l_v22_0 = (l_v22_0 * l_v28_FirstChild_0.CFrame) * l_v26_FirstChild_0.CFrame:Inverse();
    end;
    v17.calculateBounds(v20, v26, l_v22_0, v25);
    if v24.children then
        for v32, v33 in v24.children, nil, nil do
            v17.traverseHierarchy(v18, v19, v20, v23, l_v22_0, v32, v33, v25);
        end;
    end;
end;
v17.assetHierarchy = {
    [Enum.AssetType.DynamicHead] = {
        root = "Head"
    },
    [Enum.AssetType.Torso] = {
        root = "LowerTorso",
        children = {
            UpperTorso = {}
        }
    },
    [Enum.AssetType.LeftArm] = {
        root = "LeftUpperArm",
        children = {
            LeftLowerArm = {
                children = {
                    LeftHand = {}
                }
            }
        }
    },
    [Enum.AssetType.RightArm] = {
        root = "RightUpperArm",
        children = {
            RightLowerArm = {
                children = {
                    RightHand = {}
                }
            }
        }
    },
    [Enum.AssetType.LeftLeg] = {
        root = "LeftUpperLeg",
        children = {
            LeftLowerLeg = {
                children = {
                    LeftFoot = {}
                }
            }
        }
    },
    [Enum.AssetType.RightLeg] = {
        root = "RightUpperLeg",
        children = {
            RightLowerLeg = {
                children = {
                    RightFoot = {}
                }
            }
        }
    }
};
return v17;


local v0 = {};
v0.__index = v0;
v0.new = function()
    return (setmetatable({
        passed = true,
        reasons = {}
    }, v0));
end;
v0.updateReasons = function(v1, v2, v3)
    if not v2 then
        table.insert(v1.reasons, table.concat(v3, "\n"));
        v1.passed = false;
        return ;
    else
        return ;
    end;
end;
v0.getFinalResults = function(v4)
    if not v4.passed then
        return false, v4.reasons;
    else
        return true;
    end;
end;
return v0;


local l_Parent_0 = script.Parent.Parent;
local v1 = require(l_Parent_0.Constants);
local v2 = require(l_Parent_0.util.FailureReasonsAccumulator);
local v3 = require(l_Parent_0.flags.getFFlagUseUGCValidationContext);
local v4 = require(l_Parent_0.flags.getFFlagAddUGCValidationForPackage);
local v5 = require(l_Parent_0.flags.getFFlagFixPackageIDFieldName);
local v6 = require(l_Parent_0.flags.getEngineFeatureUGCValidateEditableMeshAndImage);
local v7 = {};
local function _(v8)
    return (string.match(v8, "^rbxassetid://(%d+)$"));
end;
local function v11(v10)
    v10 = string.match(v10, "^https?://www%.(.+)") or string.match(v10, "^https?://(.+)");
    if v10 then
        v10 = string.match(v10, "^sitetest%d%.robloxlabs(.+)") or string.match(v10, "^roblox(.+)");
        if v10 then
            return (string.match(v10, "^%.com/asset/%?id=(%d+)$"));
        else
            return nil;
        end;
    else
        return nil;
    end;
end;
local function v13(v12)
    v12 = string.match(v12, "^https?://assetdelivery%.(.+)");
    if v12 then
        v12 = string.match(v12, "^sitetest%d%.robloxlabs(.+)") or string.match(v12, "^roblox(.+)");
        if v12 then
            return (string.match(v12, "^%.com/v1/asset/%?id=(%d+)$"));
        else
            return nil;
        end;
    else
        return nil;
    end;
end;
local function v16(v14)
    local v15 = nil;
    if v4() then
        v15 = tonumber(v14);
        if v15 ~= nil then
            if not v5() then
                return v15;
            else
                return (tostring(v15));
            end;
        end;
    end;
    v15 = string.match(v14, "^rbxassetid://(%d+)$");
    if v15 ~= nil then
        return v15;
    else
        v15 = v11(v14);
        if v15 ~= nil then
            return v15;
        else
            v15 = v13(v14);
            if v15 ~= nil then
                return v15;
            else
                return nil;
            end;
        end;
    end;
end;
local function _(v17, v18, v19)
    if v19 then
        if v19.allowEditableInstances then
            local v20 = v19.editableImages[v17];
            if not v20 or not v20[v18] then
                local v21 = v19.editableMeshes[v17];
                if not v21 or not v21[v18] then
                    return false;
                else
                    return true;
                end;
            else
                return true;
            end;
        else
            return false;
        end;
    else
        return false;
    end;
end;
local function v35(v23, v24, v25, v26, v27, v28, v29)
    local v30 = v26[v27];
    if v30 == "" then
        if not v28 then
            if not (not v3() or not v6()) then
                local v31;
                if v29 then
                    if v29.allowEditableInstances then
                        local v32 = v29.editableImages[v26];
                        if not v32 or not v32[v27] then
                            local v33 = v29.editableMeshes[v26];
                            v31 = not not v33 and (v33[v27] and true or false);
                        else
                            v31 = true;
                        end;
                    else
                        v31 = false;
                    end;
                else
                    v31 = false;
                end;
                if not (not v31 or not v25) then
                    table.insert(v25, {
                        fieldName = v27,
                        instance = v26
                    });
                end;
            end;
            return true;
        else
            return false, {
                string.format("%s.%s cannot be empty", v26:GetFullName(), v27)
            };
        end;
    else
        local v34 = v16(v30);
        if v34 == nil then
            if not v3() then
                return false, {
                    string.format("Could not parse ContentId %s in %s.%s", v30, v26:GetFullName(), v27)
                };
            else
                return false, {
                    string.format("Could not parse ContentId %s in %s.%s. Please make sure you are using a valid URL with a valid ID.", v30, v26:GetFullName(), v27)
                };
            end;
        else
            if v24[v34] == nil then
                v24[v34] = {
                    fieldName = v27,
                    instance = v26
                };
                table.insert(v23, v34);
            end;
            if v25 then
                table.insert(v25, {
                    fieldName = v27,
                    instance = v26,
                    id = v34
                });
            end;
            return true;
        end;
    end;
end;
local function v52(v36, v37, v38, v39, v40, v41, v42)
    v40 = v40 or v1.CONTENT_ID_FIELDS;
    local v43 = v2.new();
    local l_v39_Descendants_0 = v39:GetDescendants();
    table.insert(l_v39_Descendants_0, v39);
    for _, v46 in pairs(l_v39_Descendants_0) do
        local v47 = v40[v46.ClassName];
        if v47 then
            local v48 = v41 and v41[v46.ClassName];
            for _, v50 in ipairs(v47) do
                local v51 = v48 and v48[v50];
                if not v3() then
                    v43:updateReasons(v35(v36, v37, v38, v46, v50, v51));
                else
                    v43:updateReasons(v35(v36, v37, v38, v46, v50, v51, v42));
                end;
            end;
        end;
    end;
    return v43:getFinalResults();
end;
v7.tryGetAssetIdFromContentId = function(v53)
    return (v16(v53));
end;
v7.parseWithErrorCheck = function(v54, v55, v56, v57, v58)
    return v52(v54, v55, nil, v56, v57, v58);
end;
v7.parse = function(v59, v60, v61)
    local v62 = {};
    local v63 = {};
    local v64 = {};
    local _ = nil;
    assert(if not v3() then v52(v63, v62, v64, v59, v60) else v52(v63, v62, v64, v59, v60, nil, v61));
    return v64;
end;
return v7;


local l_Parent_0 = script.Parent.Parent;
local v1 = require(l_Parent_0.Constants);
local v2 = require(l_Parent_0.flags.getFStringUGCLCAllowedAssetTypeIds);
return {
    isRigidAccessoryAllowed = function(v3)
        local v4 = v1.ASSET_TYPE_INFO[v3];
        if v4 == nil then
            return false;
        else
            return v4.rigidAllowed == true;
        end;
    end,
    isLayeredClothingAllowed = function(v5)
        return table.find(string.split(v2(), ","), (tostring(v5.Value))) ~= nil;
    end
};


local v0 = require(script.Parent.Parent.Analytics);
local v1 = {};
v1.__index = v1;
v1.new = function(v2, v3, v4)
    local v5 = false;
    if v3 > 0 then
        v5 = v3 <= 120;
    end;
    assert(v5);
    v5 = false;
    if v4.X > 0 then
        v5 = v4.Y > 0;
    end;
    assert(v5);
    local v6 = {
        mode = not v2 and 2 or 1,
        imgSize = v4,
        cameraFov = v3
    };
    setmetatable(v6, v1);
    return v6;
end;
v1.setupViewportFrame = function(v7)
    assert(v7.screenGui);
    assert(v7.worldModel);
    assert(v7.vpfs);
    assert(v7.camera);
    local v8 = Instance.new("ViewportFrame", v7.screenGui);
    v8.BackgroundTransparency = 1;
    v8.BorderSizePixel = 0;
    v8.Size = UDim2.fromOffset(v7.imgSize.X, v7.imgSize.Y);
    v7.worldModel.Parent = v8;
    v7:setCamera(v7.cameraOptions.fill, v7.cameraOptions.maxDim, v7.cameraOptions.dir);
    local l_camera_0 = v7.camera;
    l_camera_0.Parent = v8;
    v8.CurrentCamera = l_camera_0;
    table.insert(v7.vpfs, v8);
end;
v1.setupScreenGui = function(v10)
    local v11 = Instance.new("ScreenGui", game:GetService("CoreGui"));
    local l_WorldModel_0 = Instance.new("WorldModel");
    v10.screenGui = v11;
    v10.worldModel = l_WorldModel_0;
    v10.vpfs = {};
end;
v1.init = function(v13, v14)
    v13.target = v14;
    local l_v14_FirstAncestorWhichIsA_0 = v14:FindFirstAncestorWhichIsA("Model");
    local l_v14_FirstAncestorWhichIsA_1 = v14:FindFirstAncestorWhichIsA("Folder");
    local v17 = nil;
    if not l_v14_FirstAncestorWhichIsA_0 then
        if not l_v14_FirstAncestorWhichIsA_1 then
            v17 = v14;
        else
            v17 = l_v14_FirstAncestorWhichIsA_1;
            v13.ancestor = v17;
        end;
    else
        v17 = l_v14_FirstAncestorWhichIsA_0;
        v13.ancestor = v17;
    end;
    if v13.mode == 2 then
        v13:setupScreenGui();
        v17.Parent = v13.worldModel;
        return ;
    else
        if v13.mode == 1 then
            v17.Parent = workspace;
        end;
        return ;
    end;
end;
v1.setCamera = function(v18, v19, v20, v21)
    assert(v18.target);
    local l_camera_1 = v18.camera;
    local l_cameraFov_0 = v18.cameraFov;
    local l_target_0 = v18.target;
    if not l_camera_1 then
        l_camera_1 = Instance.new("Camera");
        l_camera_1.FieldOfView = l_cameraFov_0;
        if v18.mode == 1 then
            l_camera_1.Name = "ThumbnailCamera";
            l_camera_1.Parent = workspace:GetChildren()[1];
        end;
        v18.camera = l_camera_1;
    end;
    local l_Size_0 = l_target_0.Size;
    local l_Position_0 = l_target_0.CFrame.Position;
    l_camera_1.CFrame = CFrame.lookAt((l_Position_0 + v21 * (v20 / ((v19 * 2) * math.tan((math.rad(l_cameraFov_0 / 2)))))) + (v21 * l_Size_0) / 2, l_Position_0);
    v18.cameraOptions = {
        fill = v19,
        maxDim = v20,
        dir = v21
    };
end;
v1.cleanup = function(v27)
    if v27.screenGui then
        v27.screenGui:Destroy();
        v27.screenGui = nil;
        v27.vpfs = nil;
    end;
    if v27.cameraOptions then
        v27.cameraOptions = nil;
    end;
    if v27.target then
        v27.target:Destroy();
        v27.target = nil;
    end;
    if v27.ancestor then
        v27.ancestor:Destroy();
        v27.ancestor = nil;
    end;
    if v27.camera then
        v27.camera:Destroy();
        v27.camera = nil;
    end;
end;
v1.takeSnapshot = function(v28)
    local v29 = os.clock();
    local v30 = nil;
    local v31 = nil;
    if v28.mode == 1 then
        local l_ThumbnailGenerator_0 = game:GetService("ThumbnailGenerator");
        local l_status_0, l_result_0 = pcall(function()
            return l_ThumbnailGenerator_0:Click("Png", v28.imgSize.X, v28.imgSize.Y, true);
        end);
        v30 = l_status_0;
        v31 = l_result_0;
    else
        v28:setupViewportFrame();
        local l_status_1, l_result_1 = pcall(function()
            task.wait(1);
            return v28.vpfs[#v28.vpfs]:CaptureSnapshotAsync();
        end);
        v30 = l_status_1;
        v31 = l_result_1;
    end;
    v0.reportThumbnailing(os.clock() - v29);
    return v30, v31;
end;
return v1;


local function _(v0, v1, v2)
    if not v0 or not v1 then
        return v0 or v1;
    else
        return (Vector3.new(v2(v0.X, v1.X), v2(v0.Y, v1.Y), v2(v0.Z, v1.Z)));
    end;
end;
return function(v4, v5, v6, v7)
    local l_min_0 = math.min;
    local v9 = if not not v4 and v6 then Vector3.new(l_min_0(v4.X, v6.X), l_min_0(v4.Y, v6.Y), l_min_0(v4.Z, v6.Z)) else v4 or v6;
    local l_max_0 = math.max;
    if not v5 or not v7 then
        return v9, v5 or v7;
    else
        return v9, (Vector3.new(l_max_0(v5.X, v7.X), l_max_0(v5.Y, v7.Y), l_max_0(v5.Z, v7.Z)));
    end;
end;


local l_HttpService_0 = game:GetService("HttpService");
local v1 = require(script:FindFirstAncestor("UGCValidation").util.APIUtil);
local v2 = {
    [0] = "Unknown",
    [1] = "InvalidTargetType",
    [2] = "FailedToFetchPublishingFee",
    [3] = "ServiceUnavailable",
    [4] = "InvalidArgument",
    [5] = "NotFound",
    [6] = "FailedToGetCollectibleItemId",
    [7] = "FailedToGetCommissionRates",
    [8] = "NullParameterRequest",
    [9] = "PublishLimitExceeded",
    [10] = "AssetIsPendingValidation",
    [11] = "AssetContainsInvalidContent",
    [12] = "UserDoesNotHavePermissionsForGroupAsset",
    [13] = "AssetTypeCannotBeReleased",
    [14] = "AssetIsPendingReview",
    [15] = "AssetIsModerated",
    [16] = "ItemIsReleased",
    [17] = "UserDoesNotHavePermissionToRelease",
    [18] = "UserDoesNotOwnTheItem",
    [19] = "ItemPriceTooLow",
    [20] = "ItemPriceTooHigh",
    [21] = "InvalidAssetId",
    [22] = "InvalidAgent",
    [23] = "NoExperiencesListed",
    [24] = "NameIsModerated",
    [25] = "DescriptionIsModerated",
    [26] = "TextIsModerated",
    [27] = "FailedToFilterText",
    [28] = "AssetAlreadyReleasedAsUnlimited",
    [29] = "AssetInDelayedRelease",
    [30] = "InvalidIdempotencyToken",
    [31] = "InvalidAgreedPublishingFee",
    [32] = "GatewayCouldNotPublishItem",
    [33] = "GroupAssetNotSupported",
    [34] = "CouldNotFindInitialUserAsset",
    [35] = "InvalidQuantity",
    [36] = "SaleLocationCurrentlyNotSupported",
    [37] = "InvalidCollectibleItemId",
    [38] = "FailedToGetCollectibleItemInformation",
    [39] = "GroupItemsNotSupported",
    [40] = "FailedToUpdateCollectibleItem",
    [41] = "PublishQuotaUnavailable",
    [42] = "FailedToFetchMarketplaceFee",
    [43] = "QuantityLimitCurrentlyNotSupported",
    [44] = "InvalidQuantityLimit",
    [45] = "ExactCopyOfAssetHasBeenPublished",
    [46] = "ItemIsInBundle",
    [47] = "ResaleRestrictionCurrentlyNotSupported",
    [48] = "InvalidResaleRestriction",
    [49] = "FailedToUpdateCollectibleDescription",
    [50] = "InvalidBundleId",
    [51] = "BundleTypeCannotBeReleased",
    [52] = "BundleIsModerated",
    [53] = "BundleAlreadyReleasedAsUnlimited",
    [54] = "BundlesGatewayUnexpectedErrorCode",
    [55] = "CissUnexpectedException",
    [56] = "PublishingGatewayUnexpectedException",
    [57] = "NonLimitedPublishingNotSupported",
    [58] = "InvalidPublishingType",
    [59] = "InvalidPriceOffset",
    [60] = "InvalidMinimumPrice",
    [61] = "InvalidSaleStatus",
    [62] = "InvalidPriceConfiguration",
    [63] = "FailedToGetPriceConfiguration",
    [64] = "CannotBeFree",
    [65] = "UnexpectedPlaceIds",
    [66] = "MissingAuthenticatedUser",
    [67] = "InvalidCreatorType",
    [68] = "PermissionProviderNotEnabled",
    [69] = "InvalidGroupId",
    [70] = "InsufficientRobux",
    [71] = "ItemNotFound",
    [72] = "ItemIsModerated",
    [73] = "ItemModerationUnknown",
    [74] = "InvalidItemType",
    [101] = "CalendarQuotaExceeded",
    [102] = "CalendarQuotaUnavailable",
    [103] = "PublishingGatewayMissingReason",
    [104] = "PublishingGatewayUnexpectedReason",
    [105] = "PublishingGatewayUnexpectedAccessStatus",
    [106] = "MissingIdVerification",
    [107] = "CreationAccessBlocked",
    [108] = "MissingPremiumSubscriptionTier",
    [109] = "GroupOwnerMissingPremiumSubscriptionTier",
    [110] = "MissingCicRoleset"
};
return function(v3)
    local v4, v5 = v1.requestAndRetryGet((("https://itemconfiguration.%*/v1/collectibles/check-item-upload-access?targetType=1&groupId=%*"):format(v1.getBaseDomain(), v3 or "")));
    if v4 then
        local v6 = l_HttpService_0:JSONDecode(v5);
        if not v6.isAllowed then
            assert(v6.isAllowed == false, "Luau");
            return {
                type = "notAllowed",
                denyReason = v2[v6.deniedReason] or v6.deniedReason
            };
        else
            return {
                type = "allowed"
            };
        end;
    else
        return {
            type = "error",
            message = v5
        };
    end;
end;


return function(v0)
    assert(v0, "attachmentName cannot be nil");
    return {
        ClassName = "Accessory",
        _children = {
            {
                Name = "ThumbnailConfiguration",
                ClassName = "Configuration",
                _optional = true,
                _children = {
                    {
                        Name = "ThumbnailCameraTarget",
                        ClassName = "ObjectValue"
                    },
                    {
                        Name = "ThumbnailCameraValue",
                        ClassName = "CFrameValue"
                    }
                }
            },
            {
                Name = "Handle",
                ClassName = "Part",
                _children = {
                    {
                        Name = v0,
                        ClassName = "Attachment"
                    },
                    {
                        ClassName = "SpecialMesh"
                    },
                    {
                        ClassName = "StringValue",
                        Name = "AvatarPartScaleType",
                        _optional = true
                    },
                    {
                        ClassName = "TouchTransmitter",
                        _optional = true
                    }
                }
            }
        }
    };
end;


local l_Parent_0 = script.Parent.Parent;
local _ = require(l_Parent_0.util.Types);
local v2 = require(l_Parent_0.util.createIndividualBodyPartSchema);
return function(v3)
    local v4 = v2(Enum.AssetType.DynamicHead, "Head", v3);
    table.insert(v4._children, {
        Name = {
            "FaceControls"
        },
        ClassName = "FaceControls"
    });
    return v4;
end;


local l_Parent_0 = script.Parent.Parent;
local v1 = require(l_Parent_0.Constants);
local l_AssetService_0 = game:GetService("AssetService");
local _ = require(l_Parent_0.util.Types);
local v4 = require(l_Parent_0.util.destroyEditableInstances);
local function v20(v5, v6, v7, v8, v9, v10)
    local v11 = true;
    if v7 ~= "EditableMesh" then
        v11 = v7 == "EditableImage";
    end;
    assert(v11, "Wrong class type provided to getOrCreateEditableInstances");
    local v12 = v6[v5.ClassName];
    if v12 then
        for _, v14 in v12, nil, nil do
            local v15 = v5[v14];
            local l_v5_FirstChildOfClass_0 = v5:FindFirstChildOfClass(v7);
            local v17 = false;
            if not (l_v5_FirstChildOfClass_0 and v9) then
                if v15 and v15 ~= "" then
                    l_v5_FirstChildOfClass_0 = v10[v15];
                    if not l_v5_FirstChildOfClass_0 then
                        local l_status_0, l_result_0 = pcall(function()
                            if v7 == "EditableMesh" then
                                return l_AssetService_0:CreateEditableMeshStripSkinningAsync(v15);
                            else
                                return l_AssetService_0:CreateEditableImageAsync(v15);
                            end;
                        end);
                        if l_status_0 then
                            v17 = true;
                            l_v5_FirstChildOfClass_0 = l_result_0;
                            v10[v15] = l_v5_FirstChildOfClass_0;
                        else
                            return l_status_0, l_result_0;
                        end;
                    end;
                else
                    continue;
                end;
            end;
            if not v8[v5] then
                v8[v5] = {};
            end;
            v8[v5][v14] = {
                instance = l_v5_FirstChildOfClass_0,
                created = v17
            };
        end;
    end;
    return true;
end;
return function(v21, v22)
    local l_MESH_CONTENT_ID_FIELDS_0 = v1.MESH_CONTENT_ID_FIELDS;
    local l_TEXTURE_CONTENT_ID_FIELDS_0 = v1.TEXTURE_CONTENT_ID_FIELDS;
    local v25 = {
        editableMeshes = {},
        editableImages = {}
    };
    local v26 = {};
    for _, v28 in v21, nil, nil do
        local l_v28_Descendants_0 = v28:GetDescendants();
        table.insert(l_v28_Descendants_0, v28);
        for _, v31 in pairs(l_v28_Descendants_0) do
            local v32, v33 = v20(v31, l_MESH_CONTENT_ID_FIELDS_0, "EditableMesh", v25.editableMeshes, v22, v26);
            if v32 then
                local v34, v35 = v20(v31, l_TEXTURE_CONTENT_ID_FIELDS_0, "EditableImage", v25.editableImages, v22, v26);
                v32 = v34;
                v33 = v35;
                if not v32 then
                    v4(v25.editableMeshes, v25.editableImages);
                    return false, {
                        v33
                    };
                end;
            else
                v4(v25.editableMeshes, v25.editableImages);
                return false, {
                    v33
                };
            end;
        end;
    end;
    return true, v25;
end;


local l_Parent_0 = script.Parent.Parent;
local _ = require(l_Parent_0.util.Types);
local v2 = require(l_Parent_0.flags.getFFlagUseUGCValidationContext);
local v3 = require(l_Parent_0.flags.getEngineFeatureUGCValidateEditableMeshAndImage);
local v4 = require(l_Parent_0.Constants);
return function(v5, v6, v7)
    local v8 = not not v2() and if v3() and v7 then v7.allowEditableInstances else false;
    local v9 = v4.ASSET_TYPE_INFO[v5].subParts[v6];
    local v10 = {
        ClassName = "MeshPart",
        Name = {
            v6
        },
        _children = {
            {
                Name = {
                    "AvatarPartScaleType"
                },
                ClassName = "StringValue"
            },
            {
                Name = {
                    v6,
                    v6 .. "WrapTarget",
                    "WrapTarget"
                },
                ClassName = "WrapTarget",
                _children = if not v8 then nil else {
                    {
                        Name = {
                            "EditableMesh"
                        },
                        ClassName = "EditableMesh",
                        _optional = true
                    }
                }
            },
            {
                Name = {
                    "SurfaceAppearance"
                },
                ClassName = "SurfaceAppearance",
                _optional = true,
                _children = if not v8 then nil else {
                    {
                        Name = {
                            "EditableImage"
                        },
                        ClassName = "EditableImage",
                        _optional = true
                    }
                }
            }
        }
    };
    if v8 then
        table.insert(v10._children, {
            Name = {
                "EditableMesh"
            },
            ClassName = "EditableMesh",
            _optional = true
        });
    end;
    table.insert(v10._children, {
        Name = {
            v9.rigAttachmentToParent.name
        },
        ClassName = "Attachment"
    });
    for v11 in pairs(v9.otherAttachments) do
        table.insert(v10._children, {
            Name = {
                v11
            },
            ClassName = "Attachment"
        });
    end;
    return v10;
end;


return function(v0)
    assert(v0, "attachmentName cannot be nil");
    return {
        ClassName = "Accessory",
        _children = {
            {
                Name = "ThumbnailConfiguration",
                ClassName = "Configuration",
                _optional = true,
                _children = {
                    {
                        Name = "ThumbnailCameraTarget",
                        ClassName = "ObjectValue"
                    },
                    {
                        Name = "ThumbnailCameraValue",
                        ClassName = "CFrameValue"
                    }
                }
            },
            {
                Name = "Handle",
                ClassName = "MeshPart",
                _children = {
                    {
                        Name = v0,
                        ClassName = "Attachment"
                    },
                    {
                        ClassName = "WrapLayer"
                    },
                    {
                        ClassName = "SurfaceAppearance",
                        _optional = true
                    },
                    {
                        ClassName = "StringValue",
                        Name = "AvatarPartScaleType",
                        _optional = true
                    },
                    {
                        ClassName = "TouchTransmitter",
                        _optional = true
                    }
                }
            }
        }
    };
end;


return function(v0)
    assert(v0, "attachmentName cannot be nil");
    return {
        ClassName = "Accessory",
        _children = {
            {
                Name = "ThumbnailConfiguration",
                ClassName = "Configuration",
                _optional = true,
                _children = {
                    {
                        Name = "ThumbnailCameraTarget",
                        ClassName = "ObjectValue"
                    },
                    {
                        Name = "ThumbnailCameraValue",
                        ClassName = "CFrameValue"
                    }
                }
            },
            {
                Name = "Handle",
                ClassName = "MeshPart",
                _children = {
                    {
                        Name = v0,
                        ClassName = "Attachment"
                    },
                    {
                        ClassName = "StringValue",
                        Name = "AvatarPartScaleType",
                        _optional = true
                    },
                    {
                        ClassName = "TouchTransmitter",
                        _optional = true
                    }
                }
            }
        }
    };
end;


local l_Parent_0 = script.Parent.Parent;
local v1 = require(l_Parent_0.Constants);
local _ = require(l_Parent_0.util.Types);
local v3 = require(l_Parent_0.util.createIndividualBodyPartSchema);
return function(v4, v5, v6)
    local v7 = v1.ASSET_TYPE_INFO[v4];
    local v8 = {
        ClassName = "Folder",
        Name = {
            v5
        },
        _children = {}
    };
    for v9 in pairs(v7.subParts) do
        table.insert(v8._children, (v3(v4, v9, v6)));
    end;
    return v8;
end;


return function(v0)
    assert(v0, "attachmentName cannot be nil");
    return {
        ClassName = "Accessory",
        _children = {
            {
                Name = "ThumbnailConfiguration",
                ClassName = "Configuration",
                _optional = true,
                _children = {
                    {
                        Name = "ThumbnailCameraTarget",
                        ClassName = "ObjectValue"
                    },
                    {
                        Name = "ThumbnailCameraValue",
                        ClassName = "CFrameValue"
                    }
                }
            },
            {
                Name = "Handle",
                ClassName = "MeshPart",
                _children = {
                    {
                        Name = v0,
                        ClassName = "Attachment"
                    },
                    {
                        ClassName = "SurfaceAppearance",
                        Name = "SurfaceAppearance",
                        _optional = true
                    },
                    {
                        ClassName = "StringValue",
                        Name = "AvatarPartScaleType",
                        _optional = true
                    },
                    {
                        ClassName = "TouchTransmitter",
                        Name = "TouchInterest",
                        _optional = true
                    }
                }
            }
        }
    };
end;


local l_Parent_0 = script.Parent.Parent;
local _ = require(l_Parent_0.util.BundlesMetadata);
local v2 = require(l_Parent_0.Constants);
local function v12(v3, v4, v5)
    assert(v3:IsA("Model"));
    local v6 = v4[v5];
    if v6 == nil then
        return {};
    else
        local v7 = {};
        for _, v9 in v2.UGC_BODY_PARTS, nil, nil do
            local l_v3_FirstChild_0 = v3:FindFirstChild(v9);
            if l_v3_FirstChild_0 ~= nil then
                local v11 = v2.UGC_BODY_PART_NAMES_TO_ASSET_TYPE[v9];
                assert(v11 ~= nil, "Body part doesn't map to an asset type");
                if v6.allowedAssetTypeSettings[v11.Name] ~= nil then
                    if v7[v11] == nil then
                        v7[v11] = {
                            l_v3_FirstChild_0
                        };
                    else
                        table.insert(v7[v11], l_v3_FirstChild_0);
                    end;
                end;
            end;
        end;
        return v7;
    end;
end;
return function(v13, v14, v15, v16)
    assert(v13:IsA("Model"), "Invalid root instance, must be a model");
    local v17 = v12(v13, v14, v15);
    local v18 = {};
    for v19, v20 in v17, nil, nil do
        if table.find(v2.ASSET_TYPES_THAT_SKIP_FOLDER, v19) == nil then
            local l_Folder_0 = Instance.new("Folder");
            l_Folder_0.Name = v2.FOLDER_NAMES.R15ArtistIntent;
            for _, v23 in v20, nil, nil do
                v23.Parent = l_Folder_0;
            end;
            v18[v19] = {
                l_Folder_0
            };
            if v16 then
                local v24 = l_Folder_0:Clone();
                v24.Name = v2.FOLDER_NAMES.R15Fixed;
                table.insert(v18[v19], v24);
                local l_Folder_1 = Instance.new("Folder");
                l_Folder_1.Name = v2.FOLDER_NAMES.R6;
                table.insert(v18[v19], l_Folder_1);
            end;
        else
            v18[v19] = v20;
        end;
    end;
    return v18;
end;


local _ = require(script.Parent.Parent.util.Types);
local function v6(v1)
    for _, v3 in v1, nil, nil do
        for _, v5 in v3, nil, nil do
            if not (not v5.created or not v5.instance) then
                v5.instance:Destroy();
            end;
        end;
    end;
    v1 = {};
end;
return function(v7, v8)
    v6(v7);
    v6(v8);
end;


return function(v0)
    v0 = v0:Clone();
    local l_v0_Descendants_0 = v0:GetDescendants();
    table.insert(l_v0_Descendants_0, v0);
    for _, v3 in l_v0_Descendants_0, nil, nil do
        if v3.Parent ~= nil and (not ((not v3:IsA("Motor6D") and v3.Name ~= "OriginalSize") and v3.Name ~= "OriginalPosition") or v3:IsA("Weld") and v3.Name == "AccessoryWeld") then
            v3:Destroy();
        else
            if v3:IsA("BasePart") then
                v3.Velocity = Vector3.zero;
                v3.RotVelocity = Vector3.zero;
            end;
            local v4 = not not v3.Parent and v3.Parent:IsA("Accessory");
            if not (not (not (not v3:IsA("MeshPart") or v4) and v3.TextureID == "") or v3:FindFirstChildWhichIsA("SurfaceAppearance")) then
                Instance.new("SurfaceAppearance").Parent = v3;
            end;
        end;
    end;
    return v0;
end;


local l_HumanoidModelFromDescription_0 = game:GetService("Players"):CreateHumanoidModelFromDescription(Instance.new("HumanoidDescription"), Enum.HumanoidRigType.R15);
l_HumanoidModelFromDescription_0.Humanoid.BodyTypeScale.Value = 0;
l_HumanoidModelFromDescription_0.Humanoid.BodyProportionScale.Value = 0;
local v1 = {};
for _, v3 in pairs(l_HumanoidModelFromDescription_0:GetDescendants()) do
    if v3:IsA("BasePart") then
        for _, v5 in v3:GetChildren() do
            if v5:IsA("Attachment") then
                v1[v5.Name] = l_HumanoidModelFromDescription_0.Humanoid:GetBodyPartR15(v3);
            end;
        end;
    end;
end;
return function(v6, v7)
    return l_HumanoidModelFromDescription_0.Humanoid:GetAccessoryHandleScale(v6, v1[v7.Name]);
end;


local v0 = require(script.Parent.Parent.util.APIUtil);
local l_HttpService_0 = game:GetService("HttpService");
local v2 = string.format("https://itemconfiguration.%s", (v0.getBaseDomain())) .. "v1/creations/get-asset-details";
return function(v3)
    local v4, v5 = v0.requestAndRetryPost(v2, l_HttpService_0:JSONEncode({
        assetIds = v3
    }));
    if not v4 then
        return false, v5;
    else
        return true, l_HttpService_0:JSONDecode(v5);
    end;
end;


local v0 = require(script.Parent.Parent.util.APIUtil);
local l_HttpService_0 = game:GetService("HttpService");
local v2 = string.format("https://apis.%s", (v0.getBaseDomain())) .. "assets/rcc/v1/assets/%s";
return function(v3)
    local v4, v5 = v0.requestAndRetryGet((string.format(v2, v3)));
    if not v4 then
        return false, v5;
    else
        return true, l_HttpService_0:JSONDecode(v5);
    end;
end;


local v0 = require(script.Parent.Parent.flags.getFFlagUGCValidationMeshPartAccessoryUploads);
return function(v1, v2)
    for _, v4 in pairs(v2) do
        local l_v1_FirstChild_0 = v1:FindFirstChild(v4);
        if l_v1_FirstChild_0 then
            if not v0() or not l_v1_FirstChild_0:IsA("Attachment") then
                return l_v1_FirstChild_0;
            else
                return l_v1_FirstChild_0;
            end;
        end;
    end;
    return nil;
end;


local _ = require(script.Parent.Parent.util.Types);
return function(v1, v2, v3)
    if not v3.editableImages then
        if not v3.isServer then
            return false;
        else
            error(string.format("Failed to load texture data"));
        end;
    end;
    local v4 = v3.editableImages[v1];
    assert(v4);
    local v5 = v4[v2];
    if not (v5 and v5.instance) then
        if not v3.isServer then
            return false;
        else
            error(string.format("Failed to load texture data"));
        end;
    end;
    return true, v5.instance;
end;


local _ = require(script.Parent.Parent.util.Types);
return function(v1, v2, v3)
    if not v3.editableMeshes then
        if not v3.isServer then
            return false;
        else
            error(string.format("Failed to load texture data"));
        end;
    end;
    local v4 = v3.editableMeshes[v1];
    assert(v4);
    local v5 = v4[v2];
    if not (v5 and v5.instance) then
        if not v3.isServer then
            return false;
        else
            error(string.format("Failed to load mesh data"));
        end;
    end;
    return true, v5.instance;
end;


local l_UGCValidationService_0 = game:GetService("UGCValidationService");
local l_Parent_0 = script.Parent.Parent;
local _ = require(l_Parent_0.util.Types);
local v3 = require(l_Parent_0.util.pcallDeferred);
local v4 = require(l_Parent_0.flags.getFFlagUGCValidationShouldYield);
local v5 = require(l_Parent_0.flags.getFFlagUseUGCValidationContext);
local v6 = require(l_Parent_0.flags.getEngineFeatureUGCValidateEditableMeshAndImage);
local v7 = require(l_Parent_0.util.calculateMinMax);
local function v18(v8, v9, v10)
    local v11 = nil;
    local v12 = nil;
    if not v6() or not v4() then
        local l_status_0, l_result_0 = pcall(function()
            return l_UGCValidationService_0:GetMeshVerts(v8.contentId);
        end);
        v11 = l_status_0;
        v12 = l_result_0;
    else
        local v15, v16 = v3(function()
            return l_UGCValidationService_0:GetEditableMeshVerts(v8.editableMesh);
        end, v10);
        v11 = v15;
        v12 = v16;
    end;
    if v11 then
        return true, nil, v12;
    else
        local v17 = "Failed to read mesh: " .. v8.fullName;
        if v9 then
            error(v17);
        end;
        return false, {
            v17
        };
    end;
end;
local function v24(v19, v20)
    local l_status_1, l_result_1 = pcall(function()
        return l_UGCValidationService_0:GetMeshVerts(v19);
    end);
    if l_status_1 then
        return true, nil, l_result_1;
    else
        local v23 = "Failed to read mesh: " .. tostring(v19);
        if v20 then
            error(v23);
        end;
        return false, {
            v23
        };
    end;
end;
local function v34(v25, v26)
    local v27 = nil;
    local v28 = nil;
    for _, v30 in pairs(v25) do
        local v31 = if not v26 then v30 else v30 * v26;
        local v32, v33 = v7(v27, v28, v31, v31);
        v27 = v32;
        v28 = v33;
    end;
    return v27, v28;
end;
local function v42(v35, v36)
    local v37, v38, v39 = v18(v35, v36.isServer, v36);
    if v37 then
        if not v39 or #v39 == 0 then
            return false, {
                "Mesh: " .. v35.fullName .. " contains no verts"
            };
        else
            local v40, v41 = v34(v39, v35.scale);
            return true, nil, v40, v41;
        end;
    else
        return v37, v38;
    end;
end;
local function v51(v43, v44, v45)
    local v46, v47, v48 = v24(v43, v44);
    if v46 then
        if not v48 or #v48 == 0 then
            return false, {
                "Mesh: " .. tostring(v43) .. " contains no verts"
            };
        else
            local v49, v50 = v34(v48, v45);
            return true, nil, v49, v50;
        end;
    else
        return v46, v47;
    end;
end;
if not v5() then
    return v51;
else
    return v42;
end;


local l_UGCValidationService_0 = game:GetService("UGCValidationService");
local l_Parent_0 = script.Parent.Parent;
local _ = require(l_Parent_0.util.Types);
local v3 = require(l_Parent_0.flags.getFFlagUseUGCValidationContext);
local v4 = require(l_Parent_0.flags.getEngineFeatureUGCValidateEditableMeshAndImage);
local function v15(v5)
    local v6 = nil;
    v6 = if not v4() then l_UGCValidationService_0:GetMeshVerts(v5.contentId) else l_UGCValidationService_0:GetEditableMeshVerts(v5.editableMesh);
    local l_huge_0 = math.huge;
    local v8 = -math.huge;
    local l_huge_1 = math.huge;
    local v10 = -math.huge;
    local l_huge_2 = math.huge;
    local v12 = -math.huge;
    for v13 = 1, #v6 do
        local v14 = v6[v13];
        l_huge_0 = math.min(l_huge_0, v14.X);
        l_huge_1 = math.min(l_huge_1, v14.Y);
        l_huge_2 = math.min(l_huge_2, v14.Z);
        v8 = math.max(v8, v14.X);
        v10 = math.max(v10, v14.Y);
        v12 = math.max(v12, v14.Z);
    end;
    return (Vector3.new(v8 - l_huge_0, v10 - l_huge_1, v12 - l_huge_2));
end;
local function v26(v16)
    local l_l_UGCValidationService_0_MeshVerts_0 = l_UGCValidationService_0:GetMeshVerts(v16);
    local l_huge_3 = math.huge;
    local v19 = -math.huge;
    local l_huge_4 = math.huge;
    local v21 = -math.huge;
    local l_huge_5 = math.huge;
    local v23 = -math.huge;
    for v24 = 1, #l_l_UGCValidationService_0_MeshVerts_0 do
        local v25 = l_l_UGCValidationService_0_MeshVerts_0[v24];
        l_huge_3 = math.min(l_huge_3, v25.X);
        l_huge_4 = math.min(l_huge_4, v25.Y);
        l_huge_5 = math.min(l_huge_5, v25.Z);
        v19 = math.max(v19, v25.X);
        v21 = math.max(v21, v25.Y);
        v23 = math.max(v23, v25.Z);
    end;
    return (Vector3.new(v19 - l_huge_3, v21 - l_huge_4, v23 - l_huge_5));
end;
if not v3() then
    return v26;
else
    return v15;
end;


local l_status_0, l_result_0 = pcall(function()
    return game:GetService("StudioService");
end);
local v2 = if not l_status_0 then nil else l_result_0;
local _ = require(script.Parent.Parent.util.Types);
return function()
    if not v2 then
        return {};
    else
        return {
            {
                creatorType = "User",
                id = v2:GetUserId()
            }
        };
    end;
end;


local v0 = require(script.Parent.Parent.flags.getFFlagUGCValidationMeshPartAccessoryUploads);
return function(v1)
    if not v0() then
        if not (not (v1 and typeof(v1) == "Instance") or not v1:IsA("Accessory")) then
            local l_Handle_0 = v1:FindFirstChild("Handle");
            if not ((not l_Handle_0 or not l_Handle_0:IsA("MeshPart")) or not l_Handle_0:FindFirstChildOfClass("WrapLayer")) then
                return true;
            end;
        end;
        return false;
    else
        return v1:FindFirstChildWhichIsA("WrapLayer", true);
    end;
end;


return function(v0)
    if v0:IsA("Accessory") then
        local l_Handle_0 = v0:FindFirstChild("Handle");
        if not (not l_Handle_0 or not l_Handle_0:IsA("MeshPart")) then
            return true;
        end;
    end;
    return false;
end;


local l_Parent_0 = script.Parent.Parent;
local _ = require(l_Parent_0.util.Types);
local v2 = require(l_Parent_0.flags.getFIntUGCValidationMaxMsPerFrame);
local v3 = require(l_Parent_0.flags.getFFlagUGCValidationShouldYield);
local v4 = v2() / 1000;
return function(v5, v6)
    if not (not v3() or not v6.shouldYield) and v4 <= tick() - v6.lastTickSeconds then
        task.wait();
        v6.lastTickSeconds = tick();
    end;
    return pcall(v5);
end;


return function(v0)
    return string.format("%.2f, %.2f, %.2f", v0.X, v0.Y, v0.Z);
end;


local l_UGCValidationService_0 = game:GetService("UGCValidationService");
local l_Parent_0 = script.Parent.Parent;
local _ = require(l_Parent_0.util.Types);
local v3 = require(l_Parent_0.util.getEditableMeshFromContext);
local v4 = require(l_Parent_0.flags.getFFlagUseUGCValidationContext);
local v5 = require(l_Parent_0.flags.getEngineFeatureUGCValidateEditableMeshAndImage);
local v6 = require(l_Parent_0.flags.getFFlagUGCValidationFixResetPhysicsError);
local v7 = require(l_Parent_0.Analytics);
local function v17(v8, v9)
    if game:GetEngineFeature("EngineResetCollisionFidelity") then
        for _, v11 in v8, nil, nil do
            local l_v11_Descendants_0 = v11:GetDescendants();
            table.insert(l_v11_Descendants_0, 1, v11);
            for _, v14 in l_v11_Descendants_0, nil, nil do
                if v14:IsA("MeshPart") then
                    if not v5() then
                        if not v6() then
                            l_UGCValidationService_0:ResetCollisionFidelity(v14, v14.CollisionFidelity);
                        elseif not pcall(function()
                            l_UGCValidationService_0:ResetCollisionFidelity(v14, v14.CollisionFidelity);
                        end) then
                            if v9.isServer then
                                error("Failed to load mesh data");
                            end;
                            v7.reportFailure(v7.ErrorType.resetPhysicsData_FailedToLoadMesh);
                            return false, "Failed to load mesh data";
                        end;
                    else
                        local v15, v16 = v3(v14, "MeshId", v9);
                        if v15 then
                            if not v6() then
                                l_UGCValidationService_0:ResetCollisionFidelityWithEditableMeshDataLua(v14, v16, v14.CollisionFidelity);
                            elseif not pcall(function()
                                l_UGCValidationService_0:ResetCollisionFidelityWithEditableMeshDataLua(v14, v16, v14.CollisionFidelity);
                            end) then
                                if v9.isServer then
                                    error("Failed to load mesh data");
                                end;
                                v7.reportFailure(v7.ErrorType.resetPhysicsData_FailedToLoadMesh);
                                return false, "Failed to load mesh data";
                            end;
                        else
                            return false, "Failed to load mesh data";
                        end;
                    end;
                end;
            end;
        end;
        return true;
    else
        return false, "EngineResetCollisionFidelity is not enabled";
    end;
end;
local function v25(v18, v19)
    if game:GetEngineFeature("EngineResetCollisionFidelity") then
        for _, v21 in v18, nil, nil do
            local l_v21_Descendants_0 = v21:GetDescendants();
            table.insert(l_v21_Descendants_0, 1, v21);
            for _, v24 in l_v21_Descendants_0, nil, nil do
                if v24:IsA("MeshPart") then
                    if not v6() then
                        l_UGCValidationService_0:ResetCollisionFidelity(v24, v24.CollisionFidelity);
                    elseif not pcall(function()
                        l_UGCValidationService_0:ResetCollisionFidelity(v24, v24.CollisionFidelity);
                    end) then
                        if v19 then
                            error("Failed to load mesh data");
                        end;
                        v7.reportFailure(v7.ErrorType.resetPhysicsData_FailedToLoadMesh);
                        return false, "Failed to load mesh data";
                    end;
                end;
            end;
        end;
        if not v6() then
            return nil;
        else
            return true;
        end;
    elseif not v6() then
        return nil;
    else
        return true;
    end;
end;
if not v4() then
    return v25;
else
    return v17;
end;


local l_Players_0 = game:GetService("Players");
local v1 = {
    LeftArm = 11714033534,
    LeftLeg = 11714035598,
    RightArm = 11714037276,
    RightLeg = 11714039415,
    Torso = 11714041015
};
local v2 = {
    "Head",
    "Torso",
    "LeftLeg",
    "RightLeg",
    "RightArm",
    "LeftArm"
};
local v3 = Color3.fromRGB(163, 162, 165);
local function v26()
    local l_HumanoidDescription_0 = Instance.new("HumanoidDescription");
    for _, v6 in v2, nil, nil do
        l_HumanoidDescription_0[v6 .. "Color"] = v3;
    end;
    local l_l_Players_0_HumanoidModelFromDescription_0 = l_Players_0:CreateHumanoidModelFromDescription(l_HumanoidDescription_0, Enum.HumanoidRigType.R15);
    l_l_Players_0_HumanoidModelFromDescription_0:FindFirstChild("Humanoid").DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None;
    local function _(v8, v9)
        return game:GetObjectsAllOrNone("https://assetdelivery.roblox.com/v1/asset/?id=" .. tostring(v9) .. "&expectedAssetType=" .. v8);
    end;
    local _ = function(v11, v12)
        for _, v14 in pairs(v11) do
            if v14.Name == v12 then
                return v14;
            end;
        end;
        return nil;
    end;
    for v16, v17 in v1, nil, nil do
        local l_game_ObjectsAllOrNone_0 = game:GetObjectsAllOrNone("https://assetdelivery.roblox.com/v1/asset/?id=" .. tostring(v17) .. "&expectedAssetType=" .. v16);
        if l_game_ObjectsAllOrNone_0 then
            local v19;
            for _, v21 in pairs(l_game_ObjectsAllOrNone_0) do
                if v21.Name == "R15ArtistIntent" then
                    v19 = v21;
                    goto label0 --[[  true, false  ]];
                end;
            end;
            v19 = nil;
            ::label0::;
            if v19 then
                for _, v23 in v19:GetChildren() do
                    local l_SurfaceAppearance_0 = v23:FindFirstChildWhichIsA("SurfaceAppearance");
                    if l_SurfaceAppearance_0 then
                        l_SurfaceAppearance_0:Destroy();
                    end;
                    local l_l_l_Players_0_HumanoidModelFromDescription_0_FirstChild_0 = l_l_Players_0_HumanoidModelFromDescription_0:FindFirstChild(v23.Name);
                    if l_l_l_Players_0_HumanoidModelFromDescription_0_FirstChild_0 then
                        l_l_l_Players_0_HumanoidModelFromDescription_0_FirstChild_0:Destroy();
                    end;
                    v23.Parent = l_l_Players_0_HumanoidModelFromDescription_0;
                end;
            else
                return nil;
            end;
        else
            return nil;
        end;
    end;
    l_l_Players_0_HumanoidModelFromDescription_0:PivotTo(CFrame.new(l_l_Players_0_HumanoidModelFromDescription_0:GetPivot().Position, l_l_Players_0_HumanoidModelFromDescription_0:GetPivot().Position + Vector3.new(0, 0, -1)));
    return l_l_Players_0_HumanoidModelFromDescription_0;
end;
local function _(v27, v28)
    v27:FindFirstChild("Head"):Destroy();
    v28.Parent = v27;
    v27:FindFirstChild("Humanoid"):BuildRigFromAttachments();
end;
local function v33(v30)
    for _, v32 in v30:GetChildren() do
        if v32:IsA("MeshPart") and v32.Name ~= "Head" then
            v32.Transparency = 1;
        end;
    end;
end;
return function(v34)
    local v35 = v26();
    if v35 then
        v35:FindFirstChild("Head"):Destroy();
        v34.Parent = v35;
        v35:FindFirstChild("Humanoid"):BuildRigFromAttachments();
        v33(v35);
        return v35;
    else
        return nil;
    end;
end;


local l_Parent_0 = script.Parent.Parent;
local _ = require(l_Parent_0.util.Types);
local v2 = require(l_Parent_0.util.AssetTraversalUtils);
local v3 = require(l_Parent_0.ConstantsInterface);
return function(v4, v5, v6)
    local v7 = {};
    if Enum.AssetType.DynamicHead == v6 then
        v2.calculateBounds(v6, v5, CFrame.new(), v7);
        v4.Position = v5.Position;
        v4.Size = v5.Size;
    else
        local v8 = v2.assetHierarchy[v6];
        v2.traverseHierarchy(nil, v5, v6, nil, CFrame.new(), v8.root, v8, v7);
        local function v9(v10, v11, v12, v13, v14)
            local l_v10_FirstChild_0 = v10:FindFirstChild(v13);
            local l_v12_0 = v12;
            if v11 then
                local l_v10_FirstChild_1 = v10:FindFirstChild(v11);
                local v18 = v3.getRigAttachmentToParent(v6, v13);
                l_v12_0 = (l_v12_0 * l_v10_FirstChild_1:FindFirstChild(v18).CFrame) * l_v10_FirstChild_0:FindFirstChild(v18).CFrame:Inverse();
            end;
            l_v10_FirstChild_0.CFrame = l_v12_0;
            if v14.children then
                for v19, v20 in v14.children, nil, nil do
                    v9(v10, v13, l_v12_0, v19, v20);
                end;
            end;
        end;
        v9(v5, nil, CFrame.new(), v8.root, v8);
        local v21 = Vector3.new();
        local v22 = Vector3.new();
        v21 = if not v7.maxOverall then Vector3.new() else v7.maxOverall;
        v22 = if not v7.minOverall then Vector3.new() else v7.minOverall;
        if not (v7.minOverall ~= nil) or v7.maxOverall == nil then
            return false;
        else
            v4.Size = Vector3.new(v21.X - v22.X, v21.Y - v22.Y, v21.Z - v22.Z);
            v4.Position = Vector3.new(v22.X + v4.Size.X / 2, v22.Y + v4.Size.Y / 2, v22.Z + v4.Size.Z / 2);
        end;
    end;
    return true;
end;


local _ = function(v0, v1)
    if type(v0) == "table" then
        for _, v3 in pairs(v0) do
            if v3 == v1 then
                return true;
            end;
        end;
    elseif type(v0) == "string" then
        return v0 == v1;
    end;
    return false;
end;
local function _(v5)
    if type(v5) == "table" then
        return table.concat(v5, " or ");
    elseif type(v5) == "string" then
        return v5;
    else
        return "*";
    end;
end;
local function v7(v8, v9, v10)
    if v9.ClassName == v8.ClassName then
        if v8.Name ~= nil then
            local l_Name_0 = v8.Name;
            local l_Name_1 = v9.Name;
            local v13;
            if type(l_Name_0) == "table" then
                for _, v15 in pairs(l_Name_0) do
                    if v15 == l_Name_1 then
                        v13 = true;
                        goto label1 --[[  true, false  ]];
                    end;
                end;
            elseif type(l_Name_0) == "string" then
                v13 = l_Name_0 == l_Name_1;
                goto label1 --[[  true, true  ]];
            end;
            v13 = false;
            ::label1::;
            if not v13 then
                goto label0;
            end;
        end;
        if v8._children then
            for _, v17 in pairs(v8._children) do
                local v18 = false;
                local v19 = nil;
                for _, v21 in pairs(v9:GetChildren()) do
                    local v22 = v7(v17, v21, v10);
                    if not v22.success then
                        if v22.message then
                            v19 = v22;
                        end;
                    else
                        v18 = true;
                        break;
                    end;
                end;
                if not (v18 or v17._optional) then
                    if not v19 then
                        local v23 = {
                            success = false
                        };
                        local v24 = "Could not find a ";
                        local l_ClassName_0 = v17.ClassName;
                        local v26 = " called ";
                        local l_Name_2 = v17.Name;
                        v23.message = v24 .. l_ClassName_0 .. v26 .. if type(l_Name_2) == "table" then table.concat(l_Name_2, " or ") else if type(l_Name_2) == "string" then l_Name_2 else "*" .. " inside " .. v9.Name;
                        return v23;
                    else
                        return v19;
                    end;
                end;
            end;
        end;
        v10[v9] = true;
        return {
            success = true
        };
    end;
    ::label0::;
    return {
        success = false
    };
end;
return function(v28, v29)
    if v29.ClassName == v28.ClassName then
        if v28.Name ~= nil then
            local l_Name_3 = v28.Name;
            local l_Name_4 = v29.Name;
            local v32;
            if type(l_Name_3) == "table" then
                for _, v34 in pairs(l_Name_3) do
                    if v34 == l_Name_4 then
                        v32 = true;
                        goto label3 --[[  true, false  ]];
                    end;
                end;
            elseif type(l_Name_3) == "string" then
                v32 = l_Name_3 == l_Name_4;
                goto label3 --[[  true, true  ]];
            end;
            v32 = false;
            ::label3::;
            if not v32 then
                goto label2;
            end;
        end;
        local v35 = {};
        local v36 = v7(v28, v29, v35);
        if v36.success then
            local v37 = {};
            for _, v39 in pairs(v29:GetDescendants()) do
                if v35[v39] == nil then
                    v37[#v37 + 1] = v39:GetFullName();
                end;
            end;
            if #v37 > 0 then
                return {
                    success = false,
                    message = "Unexpected Descendants:\n" .. table.concat(v37, "\n")
                };
            else
                return {
                    success = true
                };
            end;
        else
            return v36;
        end;
    end;
    ::label2::;
    local v40 = {
        success = false
    };
    local v41 = "Expected top-level instance to be a ";
    local l_ClassName_1 = v28.ClassName;
    local v43 = " named ";
    local l_Name_5 = v28.Name;
    v40.message = v41 .. l_ClassName_1 .. v43 .. if type(l_Name_5) == "table" then table.concat(l_Name_5, " or ") else if type(l_Name_5) == "string" then l_Name_5 else "*";
    return v40;
end;


local v0 = require(script.Parent.Parent.Parent.Cryo);
local function _(v1, v2)
    local v3 = 10 ^ (v2 or 0);
    return math.floor(v1 * v3 + 0.5) / v3;
end;
return function(v5)
    local v6 = typeof(v5);
    if v5 == v0.None then
        return "not defined";
    elseif v6 == "Vector3" then
        return string.format("%d, %d, %d", math.floor(v5.X * 100 + 0.5) / 100, math.floor(v5.Y * 100 + 0.5) / 100, math.floor(v5.Z * 100 + 0.5) / 100);
    elseif v6 == "Color3" then
        return string.format("%d, %d, %d", math.floor(v5.r * 255), math.floor(v5.g * 255), (math.floor(v5.b * 255)));
    else
        return (tostring(v5));
    end;
end;


local v0 = require(script.Parent.Parent.Analytics);
return function(v1)
    if not string.match(v1.Name, "Accessory %(.+%)$") then
        v0.reportFailure(v0.ErrorType.validateAccessoryName);
        return false, {
            "Accessory.Name must match pattern \"Accessory (Name)\""
        };
    else
        return true;
    end;
end;


local l_Parent_0 = script.Parent.Parent;
local v1 = require(l_Parent_0.flags.getFFlagUGCValidateFullBody);
local v2 = require(l_Parent_0.flags.getFFlagUseUGCValidationContext);
local v3 = require(l_Parent_0.flags.getFFlagUGCValidateMinBoundsOnlyMesh);
local v4 = require(l_Parent_0.flags.getFFlagUGCValidationRefactorAssetTraversal);
local v5 = require(l_Parent_0.flags.getFFlagUGCValidateAccessoriesScaleType);
local v6 = require(l_Parent_0.Analytics);
local v7 = require(l_Parent_0.Constants);
local v8 = require(l_Parent_0.ConstantsInterface);
local v9 = require(l_Parent_0.util.prettyPrintVector3);
local v10 = require(l_Parent_0.util.calculateMinMax);
local _ = require(l_Parent_0.util.Types);
local v12 = require(l_Parent_0.util.AssetTraversalUtils);
local v13 = require(l_Parent_0.util.FailureReasonsAccumulator);
local v14 = require(l_Parent_0.validation.validateScaleType);
local v15 = nil;
v15 = if not v4() then {
    [Enum.AssetType.DynamicHead] = {
        root = "Head"
    },
    [Enum.AssetType.Torso] = {
        root = "LowerTorso",
        children = {
            UpperTorso = {}
        }
    },
    [Enum.AssetType.LeftArm] = {
        root = "LeftUpperArm",
        children = {
            LeftLowerArm = {
                children = {
                    LeftHand = {}
                }
            }
        }
    },
    [Enum.AssetType.RightArm] = {
        root = "RightUpperArm",
        children = {
            RightLowerArm = {
                children = {
                    RightHand = {}
                }
            }
        }
    },
    [Enum.AssetType.LeftLeg] = {
        root = "LeftUpperLeg",
        children = {
            LeftLowerLeg = {
                children = {
                    LeftFoot = {}
                }
            }
        }
    },
    [Enum.AssetType.RightLeg] = {
        root = "RightUpperLeg",
        children = {
            RightLowerLeg = {
                children = {
                    RightFoot = {}
                }
            }
        }
    }
} else v12.assetHierarchy;
local v16 = {
    root = "LowerTorso",
    children = {
        UpperTorso = {
            children = {
                Head = v15[Enum.AssetType.DynamicHead],
                LeftUpperArm = v15[Enum.AssetType.LeftArm],
                RightUpperArm = v15[Enum.AssetType.RightArm]
            }
        },
        LeftUpperLeg = v15[Enum.AssetType.LeftLeg],
        RightUpperLeg = v15[Enum.AssetType.RightLeg]
    }
};
local function v29(v17, v18, v19, v20)
    local v21, v22 = v10(v20.minMeshCorner, v20.maxMeshCorner, v19:PointToWorldSpace(-(v18.Size / 2)), v19:PointToWorldSpace(-(v18.Size / 2)));
    v20.minMeshCorner = v21;
    v20.maxMeshCorner = v22;
    v21, v22 = v10(v20.minMeshCorner, v20.maxMeshCorner, v19:PointToWorldSpace(v18.Size / 2), v19:PointToWorldSpace(v18.Size / 2));
    v20.minMeshCorner = v21;
    v20.maxMeshCorner = v22;
    for _, v24 in v8.getAttachments(v17, v18.Name) do
        local l_v18_FirstChild_0 = v18:FindFirstChild(v24);
        assert(l_v18_FirstChild_0);
        if string.match(l_v18_FirstChild_0.Name, "RigAttachment$") ~= nil then
            local v26 = v19 * l_v18_FirstChild_0.CFrame;
            local v27, v28 = v10(v20.minRigAttachment, v20.maxRigAttachment, v26.Position, v26.Position);
            v20.minRigAttachment = v27;
            v20.maxRigAttachment = v28;
        end;
    end;
    v21, v22 = v10(v20.minOverall, v20.maxOverall, v20.minMeshCorner, v20.maxMeshCorner);
    v20.minOverall = v21;
    v20.maxOverall = v22;
    v21, v22 = v10(v20.minOverall, v20.maxOverall, v20.minRigAttachment, v20.maxRigAttachment);
    v20.minOverall = v21;
    v20.maxOverall = v22;
end;
local function v30(v31, v32, v33, v34, v35, v36, v37, v38)
    if v1() then
        assert((v31 ~= nil) ~= ((v32 and v33) ~= nil));
    end;
    local v39 = nil;
    v39 = if not not v1() and v31 then v31[v36] else v32:FindFirstChild(v36);
    assert(v39);
    local l_v35_0 = v35;
    if not v34 then
        l_v35_0 = CFrame.new();
    else
        local v41 = nil;
        v41 = if not not v1() and v31 then v31[v34] else v32:FindFirstChild(v34);
        assert(v41);
        local v42 = v8.getRigAttachmentToParent(v33, v36);
        local l_v41_FirstChild_0 = v41:FindFirstChild(v42);
        assert(l_v41_FirstChild_0);
        local l_v39_FirstChild_0 = v39:FindFirstChild(v42);
        assert(l_v39_FirstChild_0);
        l_v35_0 = (l_v35_0 * l_v41_FirstChild_0.CFrame) * l_v39_FirstChild_0.CFrame:Inverse();
    end;
    v29(v33, v39, l_v35_0, v38);
    if v37.children then
        for v45, v46 in v37.children, nil, nil do
            v30(v31, v32, v33, v36, l_v35_0, v45, v46, v38);
        end;
    end;
end;
local function v56(v47, v48, v49, v50)
    if v1() then
        assert((v47 ~= nil) ~= ((v48 and v49) ~= nil));
    end;
    if not v1() or not v47 then
        local v51 = v7.ASSET_TYPE_INFO[v49];
        assert(v51);
        if Enum.AssetType.DynamicHead == v49 then
            return v50(v48);
        else
            for v52 in pairs(v51.subParts) do
                local l_v48_FirstChild_0 = v48:FindFirstChild(v52);
                assert(l_v48_FirstChild_0);
                if not v50(l_v48_FirstChild_0) then
                    return false;
                end;
            end;
        end;
    else
        for _, v55 in v47, nil, nil do
            if not v50(v55) then
                return false;
            end;
        end;
    end;
    return true;
end;
local function v65(v57, v58, v59)
    if v1() then
        assert((v57 ~= nil) ~= ((v58 and v59) ~= nil));
    end;
    local v60 = nil;
    if v56(v57, v58, v59, function(v61)
        local l_AvatarPartScaleType_0 = v61:FindFirstChild("AvatarPartScaleType");
        assert(l_AvatarPartScaleType_0);
        if v60 then
            if not v5() then
                return v60 == l_AvatarPartScaleType_0.Value;
            else
                return v60.Value == l_AvatarPartScaleType_0.Value;
            end;
        else
            v60 = if not v5() then l_AvatarPartScaleType_0.Value else l_AvatarPartScaleType_0;
            return true;
        end;
    end) then
        if not v5() then
            if v7.AvatarPartScaleTypes[v60] then
                return true, nil, v60;
            else
                v6.reportFailure(v6.ErrorType.validateAssetBounds_InvalidAvatarPartScaleType);
                return false, {
                    "The Value of all MeshParts AvatarPartScaleType children must be either Classic, ProportionsSlender, or ProportionsNormal"
                }, nil;
            end;
        else
            local v63, v64 = v14(v60);
            return v63, v64, if not v63 then nil else v60.Value;
        end;
    else
        v6.reportFailure(v6.ErrorType.validateAssetBounds_InconsistentAvatarPartScaleType);
        if not v2() then
            return false, {
                "All MeshParts must have the same Value in their AvatarPartScaleType child"
            }, nil;
        else
            return false, {
                "All MeshParts must have the same value in their AvatarPartScaleType child. Please verify the values match."
            }, nil;
        end;
    end;
end;
local function v70(v66, v67, v68)
    local v69 = false;
    if v67.X <= v66.X then
        v69 = false;
        if v67.Y <= v66.Y then
            v69 = v67.Z <= v66.Z;
        end;
    end;
    if v69 then
        return true;
    else
        v6.reportFailure(v6.ErrorType.validateAssetBounds_AssetSizeTooSmall);
        if not v2() then
            return false, {
                if not v1() or v68 then string.format("Asset size is [%s], which is too small Min size is [%s]", v9(v66), v9(v67))
            };
        else
            return false, {
                if not v1() or v68 then string.format("%s asset size is smaller than the min allowed bounding size of '%s'. You need to scale up or remodel the asset.", v68.Name, v9(v67)) else string.format("Full body size is smaller than the min allowed bounding size of '%s'. You need to scale up or remodel the asset.", v9(v67))
            };
        end;
    end;
end;
local function v75(v71, v72, v73)
    local v74 = false;
    if v71.X <= v72.X then
        v74 = false;
        if v71.Y <= v72.Y then
            v74 = v71.Z <= v72.Z;
        end;
    end;
    if v74 then
        return true;
    else
        v6.reportFailure(v6.ErrorType.validateAssetBounds_AssetSizeTooBig);
        if not v2() then
            return false, {
                if not v1() or v73 then string.format("Asset size is [%s], which is too big Max size is [%s]", v9(v71), v9(v72))
            };
        else
            return false, {
                if not v1() or v73 then string.format("%s asset size is larger than the max allowed bounding size of '%s'. You need to scale down or remodel the asset.", v73.Name, v9(v72)) else string.format("Full body size is larger than the max allowed bounding size of '%s'. You need to scale down or remodel the asset.", v9(v72))
            };
        end;
    end;
end;
return if not v2() then function(v76, v77, v78, _)
    if v1() then
        assert((v76 ~= nil) ~= ((v77 and v78) ~= nil));
    end;
    local v80 = {};
    if not v1() or not v76 then
        if Enum.AssetType.DynamicHead == v78 then
            if not v4() then
                v29(v78, v77, CFrame.new(), v80);
            else
                v12.calculateBounds(v78, v77, CFrame.new(), v80);
            end;
        else
            local v81 = v15[v78];
            if not v4() then
                v30(nil, v77, v78, nil, CFrame.new(), v81.root, v81, v80);
            else
                v12.traverseHierarchy(nil, v77, v78, nil, CFrame.new(), v81.root, v81, v80);
            end;
        end;
    elseif not v4() then
        v30(v76, nil, nil, nil, CFrame.new(), v16.root, v16, v80);
    else
        v12.traverseHierarchy(v76, nil, nil, nil, CFrame.new(), v16.root, v16, v80);
    end;
    local v82, v83, v84 = v65(v76, v77, v78);
    if v82 then
        local v85 = if v1() then nil else v7.ASSET_TYPE_INFO[v78];
        local v86 = v13.new();
        local v87 = nil;
        local v88 = nil;
        if v1() then
            if not v76 then
                v87 = v7.ASSET_TYPE_INFO[v78].bounds[v84].minSize;
                v88 = v7.ASSET_TYPE_INFO[v78].bounds[v84].maxSize;
            else
                local v89, v90 = v8.calculateFullBodyBounds(v84);
                v87 = v89;
                v88 = v90;
            end;
        end;
        v86:updateReasons(v70(if not v3() then v80.maxOverall - v80.minOverall else v80.maxMeshCorner - v80.minMeshCorner, if not v1() then v85.bounds[v84].minSize else v87, v78));
        v86:updateReasons(v75(v80.maxOverall - v80.minOverall, if not v1() then v85.bounds[v84].maxSize else v88, v78));
        return v86:getFinalResults();
    else
        return v82, v83;
    end;
end else function(v91, v92, v93)
    local v94 = if not v93 then nil else v93.assetTypeEnum;
    if v1() then
        assert((v91 ~= nil) ~= ((v92 and v94) ~= nil));
    end;
    local v95 = {};
    if not v1() or not v91 then
        if Enum.AssetType.DynamicHead == v94 then
            if not v4() then
                v29(v94, v92, CFrame.new(), v95);
            else
                v12.calculateBounds(v94, v92, CFrame.new(), v95);
            end;
        else
            local v96 = v15[v94];
            if not v4() then
                v30(nil, v92, v94, nil, CFrame.new(), v96.root, v96, v95);
            else
                v12.traverseHierarchy(nil, v92, v94, nil, CFrame.new(), v96.root, v96, v95);
            end;
        end;
    elseif not v4() then
        v30(v91, nil, nil, nil, CFrame.new(), v16.root, v16, v95);
    else
        v12.traverseHierarchy(v91, nil, nil, nil, CFrame.new(), v16.root, v16, v95);
    end;
    local v97, v98, v99 = v65(v91, v92, v94);
    if v97 then
        local v100 = if v1() then nil else v7.ASSET_TYPE_INFO[v94];
        local v101 = v13.new();
        local v102 = nil;
        local v103 = nil;
        if v1() then
            if not v91 then
                v102 = v7.ASSET_TYPE_INFO[v94].bounds[v99].minSize;
                v103 = v7.ASSET_TYPE_INFO[v94].bounds[v99].maxSize;
            else
                local v104, v105 = v8.calculateFullBodyBounds(v99);
                v102 = v104;
                v103 = v105;
            end;
        end;
        v101:updateReasons(v70(if not v3() then v95.maxOverall - v95.minOverall else v95.maxMeshCorner - v95.minMeshCorner, if not v1() then v100.bounds[v99].minSize else v102, v94));
        v101:updateReasons(v75(v95.maxOverall - v95.minOverall, if not v1() then v100.bounds[v99].maxSize else v103, v94));
        return v101:getFinalResults();
    else
        return v97, v98;
    end;
end;


local l_Parent_0 = script.Parent.Parent;
local v1 = require(l_Parent_0.Parent.Promise);
game:DefineFastInt("UGCValidationCanPublishRequestPageSize", 50);
game:DefineFastInt("UGCValidationMaxAssetSizeAllowed", 500);
local v2 = require(l_Parent_0.Analytics);
local v3 = require(l_Parent_0.util.APIUtil);
local _ = require(l_Parent_0.util.Types);
local l_HttpService_0 = game:GetService("HttpService");
local v6 = string.format("https://apis.%s", (v3.getBaseDomain()));
local l_game_FastInt_0 = game:GetFastInt("UGCValidationCanPublishRequestPageSize");
local l_game_FastInt_1 = game:GetFastInt("UGCValidationMaxAssetSizeAllowed");
local v9 = require(l_Parent_0.Constants);
local v10 = require(l_Parent_0.util.FailureReasonsAccumulator);
local v11 = require(l_Parent_0.flags.getFFlagFixPackageIDFieldName);
local v12 = require(l_Parent_0.flags.getFFlagUGCValidationAnalytics);
local v13 = require(l_Parent_0.flags.getFFlagUseUGCValidationContext);
local function _(v14, v15, v16, v17, v18)
    if #v15 == 0 then
        return v1.resolve();
    else
        return v1.new(function(v19, v20)
            l_HttpService_0:RequestInternal({
                Url = v14,
                Method = "POST",
                Body = l_HttpService_0:JSONEncode({
                    assetIds = v15,
                    restrictedEntities = v16,
                    universeId = v18
                }),
                Headers = {
                    [v9.ExperienceAuthHeaderKey] = v17,
                    [v9.ContentType] = v9.ApplicationJson
                }
            }):Start(function(v21, v22)
                if v21 and v22.StatusCode == 200 then
                    v19((l_HttpService_0:JSONDecode(v22.Body)));
                    return ;
                else
                    v20();
                    return ;
                end;
            end);
        end);
    end;
end;
local function v61(v24, v25)
    local l_isServer_0 = v25.isServer;
    local l_restrictedUserIds_0 = v25.restrictedUserIds;
    local l_token_0 = v25.token;
    local l_universeId_0 = v25.universeId;
    local v30 = v6 .. (not l_isServer_0 and "packages-api/v1/canPublish" or "packages-api/v1/rcc/canPublish");
    local v31 = {
        User = {},
        Group = {}
    };
    local v32 = v10.new();
    local v33 = {};
    local v34 = {};
    local v35 = 0;
    for _, v37 in ipairs(l_restrictedUserIds_0) do
        v31[v37.creatorType][tonumber(v37.id)] = true;
    end;
    for v38, _ in v24, nil, nil do
        if not v33[v38] then
            v35 = v35 + 1;
            v33[v38] = true;
        end;
    end;
    if l_game_FastInt_1 < v35 then
        v2.reportFailure(v2.ErrorType.validateAssetCreator_TooManyDependencies);
        return false, {
            "Upload of model has too many children assets (Meshes, Textures, etc.) and cannot be processed as is. You need to rearrange the model."
        };
    else
        local v40 = {};
        for v41, _ in v33, nil, nil do
            if not v11() or v41 ~= 0 then
                table.insert(v40, v41);
                if l_game_FastInt_0 <= #v40 then
                    local l_v40_0 = v40;
                    table.insert(v34, if #l_v40_0 == 0 then v1.resolve() else v1.new(function(v44, v45)
                        l_HttpService_0:RequestInternal({
                            Url = v30,
                            Method = "POST",
                            Body = l_HttpService_0:JSONEncode({
                                assetIds = l_v40_0,
                                restrictedEntities = l_restrictedUserIds_0,
                                universeId = l_universeId_0
                            }),
                            Headers = {
                                [v9.ExperienceAuthHeaderKey] = l_token_0,
                                [v9.ContentType] = v9.ApplicationJson
                            }
                        }):Start(function(v46, v47)
                            if v46 and v47.StatusCode == 200 then
                                v44((l_HttpService_0:JSONDecode(v47.Body)));
                                return ;
                            else
                                v45();
                                return ;
                            end;
                        end);
                    end));
                    v40 = {};
                end;
            end;
        end;
        if #v40 > 0 then
            local l_v40_1 = v40;
            local l_l_v40_1_0 = l_v40_1 --[[ copy: 14 -> 27 ]];
            table.insert(v34, if #l_v40_1 == 0 then v1.resolve() else v1.new(function(v50, v51)
                l_HttpService_0:RequestInternal({
                    Url = v30,
                    Method = "POST",
                    Body = l_HttpService_0:JSONEncode({
                        assetIds = l_l_v40_1_0,
                        restrictedEntities = l_restrictedUserIds_0,
                        universeId = l_universeId_0
                    }),
                    Headers = {
                        [v9.ExperienceAuthHeaderKey] = l_token_0,
                        [v9.ContentType] = v9.ApplicationJson
                    }
                }):Start(function(v52, v53)
                    if v52 and v53.StatusCode == 200 then
                        v50((l_HttpService_0:JSONDecode(v53.Body)));
                        return ;
                    else
                        v51();
                        return ;
                    end;
                end);
            end));
        end;
        local v54, v55 = v1.all(v34):await();
        if v54 then
            for _, v57 in v55, nil, nil do
                for v58, v59 in pairs(v57.result) do
                    if not (not v12() or v59) then
                        v2.reportFailure(v2.ErrorType.validateAssetCreator_DependencyNotOwnedByCreator);
                    end;
                    local v60 = v24[v58];
                    v32:updateReasons(v59, {
                        (string.format("%s.%s ( %s ) being used is not owned by the experience creator or player. You can only publish assets that you own.", v60.instance:GetFullName(), v60.fieldName, v58))
                    });
                end;
            end;
            return v32:getFinalResults();
        else
            v2.reportFailure(v2.ErrorType.validateAssetCreator_FailedToLoad);
            return false, {
                "Failed to load detailed information for model assets. Make sure all model assets exist and try again."
            };
        end;
    end;
end;
local function v98(v62, v63, v64, v65, v66)
    local v67 = v6 .. (not v63 and "packages-api/v1/canPublish" or "packages-api/v1/rcc/canPublish");
    local v68 = {
        User = {},
        Group = {}
    };
    local v69 = v10.new();
    local v70 = {};
    local v71 = {};
    local v72 = 0;
    for _, v74 in ipairs(v64) do
        v68[v74.creatorType][tonumber(v74.id)] = true;
    end;
    for v75, _ in v62, nil, nil do
        if not v70[v75] then
            v72 = v72 + 1;
            v70[v75] = true;
        end;
    end;
    if l_game_FastInt_1 < v72 then
        v2.reportFailure(v2.ErrorType.validateAssetCreator_TooManyDependencies);
        return false, {
            "Too many mesh/texture dependencies"
        };
    else
        local v77 = {};
        for v78, _ in v70, nil, nil do
            if not v11() or v78 ~= 0 then
                table.insert(v77, v78);
                if l_game_FastInt_0 <= #v77 then
                    local l_v77_0 = v77;
                    table.insert(v71, if #l_v77_0 == 0 then v1.resolve() else v1.new(function(v81, v82)
                        l_HttpService_0:RequestInternal({
                            Url = v67,
                            Method = "POST",
                            Body = l_HttpService_0:JSONEncode({
                                assetIds = l_v77_0,
                                restrictedEntities = v64,
                                universeId = v66
                            }),
                            Headers = {
                                [v9.ExperienceAuthHeaderKey] = v65,
                                [v9.ContentType] = v9.ApplicationJson
                            }
                        }):Start(function(v83, v84)
                            if v83 and v84.StatusCode == 200 then
                                v81((l_HttpService_0:JSONDecode(v84.Body)));
                                return ;
                            else
                                v82();
                                return ;
                            end;
                        end);
                    end));
                    v77 = {};
                end;
            end;
        end;
        if #v77 > 0 then
            local l_v77_1 = v77;
            local l_l_v77_1_0 = l_v77_1 --[[ copy: 13 -> 26 ]];
            table.insert(v71, if #l_v77_1 == 0 then v1.resolve() else v1.new(function(v87, v88)
                l_HttpService_0:RequestInternal({
                    Url = v67,
                    Method = "POST",
                    Body = l_HttpService_0:JSONEncode({
                        assetIds = l_l_v77_1_0,
                        restrictedEntities = v64,
                        universeId = v66
                    }),
                    Headers = {
                        [v9.ExperienceAuthHeaderKey] = v65,
                        [v9.ContentType] = v9.ApplicationJson
                    }
                }):Start(function(v89, v90)
                    if v89 and v90.StatusCode == 200 then
                        v87((l_HttpService_0:JSONDecode(v90.Body)));
                        return ;
                    else
                        v88();
                        return ;
                    end;
                end);
            end));
        end;
        local v91, v92 = v1.all(v71):await();
        if v91 then
            for _, v94 in v92, nil, nil do
                for v95, v96 in pairs(v94.result) do
                    if not (not v12() or v96) then
                        v2.reportFailure(v2.ErrorType.validateAssetCreator_DependencyNotOwnedByCreator);
                    end;
                    local v97 = v62[v95];
                    v69:updateReasons(v96, {
                        (string.format("%s.%s ( %s ) is not owned by the experience creator or player", v97.instance:GetFullName(), v97.fieldName, v95))
                    });
                end;
            end;
            return v69:getFinalResults();
        else
            v2.reportFailure(v2.ErrorType.validateAssetCreator_FailedToLoad);
            return false, {
                "Failed to load asset detail"
            };
        end;
    end;
end;
if not v13() then
    return v98;
else
    return v61;
end;