local l_GuiService_0 = game:GetService("GuiService");
local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local l_Util_0 = l_Parent_0.Core.Util;
local l_Packages_0 = l_Parent_0.Packages;
local v4 = require(l_Packages_0.Framework);
local l_UnifyModelPackagePublish3_0 = game:GetFastFlag("UnifyModelPackagePublish3");
local v6 = require(l_Parent_0.Core.Util.SharedFlags.getFFlagEnableUGCForAllChecks);
local l_ToolboxVideoConfigSharing2_0 = game:GetFastFlag("ToolboxVideoConfigSharing2");
local _ = require(l_Parent_0.Core.Util.SharedFlags.getFFlagToolboxEnableFiatFully);
local v9 = require(l_Parent_0.Core.Util.SharedFlags.getFFlagToolboxRestrictAssetConfig);
local v10 = require(l_Parent_0.Core.Util.SharedFlags.getFFlagToolboxAssetConfigOnboardingLink);
local v11 = game:DefineFastFlag("ToolboxDeleteForAnimationsOnly", false);
local v12 = require(l_Packages_0.Roact);
local v13 = require(l_Packages_0.RoactRodux);
local l_ContextServices_0 = require(l_Packages_0.Framework).ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_UI_0 = v4.UI;
local _ = l_UI_0.MultiImagePickerWrapper;
local l_TextLabel_0 = l_UI_0.TextLabel;
local l_TitledFrame_0 = l_UI_0.TitledFrame;
local _ = l_UI_0.BulletList;
local l_LinkText_0 = l_UI_0.LinkText;
local l_Pane_0 = l_UI_0.Pane;
local l_Separator_0 = l_UI_0.Separator;
local v24 = require(l_Parent_0.Core.Components.StyledScrollingFrame);
local l_map_0 = require(l_Packages_0.Dash).map;
local v26 = require(l_Util_0.createAssetMediaMetadata);
local v27 = require(l_Util_0.LayoutOrderIterator);
local v28 = require(l_Util_0.AssetConfigConstants);
local v29 = require(l_Util_0.AssetConfigUtil);
local v30 = require(l_Util_0.Constants);
local v31 = require(l_Parent_0.Core.Util.Images);
local v32 = require(l_Parent_0.Core.Localization.getLocalizedAssetTextMap);
local v33 = require(l_Util_0.ToolboxUtilities);
local _ = require(l_Util_0.FiatTempConstants);
local v35 = require(l_Util_0.Urls);
local l_AssetConfiguration_0 = l_Parent_0.Core.Components.AssetConfiguration;
local v37 = require(l_AssetConfiguration_0.ConfigTextField);
local v38 = require(l_AssetConfiguration_0.ConfigAccess);
local v39 = require(l_AssetConfiguration_0.ConfigDeleteLocal);
local v40 = require(l_AssetConfiguration_0.ConfigGenre);
local _ = require(l_AssetConfiguration_0.ConfigCopy);
local v42 = require(l_AssetConfiguration_0.ConfigPackage);
local v43 = require(l_AssetConfiguration_0.ConfigAssetType);
local v44 = require(l_AssetConfiguration_0.ConfigComment);
local v45 = require(l_AssetConfiguration_0.ConfigSharing);
local _ = require(l_AssetConfiguration_0.ConfigSectionWrapper);
local v47 = require(l_AssetConfiguration_0.CatalogTags.TagsComponent);
local v48 = require(l_AssetConfiguration_0.Header);
local _ = require(l_AssetConfiguration_0.PriceComponent);
local _ = require(l_AssetConfiguration_0.FiatPriceComponent);
local _ = require(l_Parent_0.Core.Types.MarketplaceFiatServiceTypes);
local _ = require(l_Util_0.SharedFlags.getFFlagEnableUGCUploadingDataSharing);
local v53 = require(l_Parent_0.Core.Actions.SetFieldError);
local _ = require(l_Parent_0.Core.Util.PageInfoHelper);
local v55 = v12.PureComponent:extend("PublishAsset");
v55.init = function(v56, v57)
    v56.state = {
        maxDropdownPosition = 0
    };
    v56.baseFrameRef = v12.createRef();
    v56.listLayoutRef = v12.createRef();
    v56.tagsRef = v12.createRef();
    v56.genreRef = v12.createRef();
    v56.onClickConfigurePriceUrl = function()
        l_GuiService_0:OpenBrowserWindow(v33.getMarketplaceAssetConfigUrl(v56.props.assetId));
    end;
    if v10() then
        v56.onClickOnboardLink = function()
            l_GuiService_0:OpenBrowserWindow(v33.getMarketplaceOnboardingUrl());
        end;
    end;
    v56.refreshCanvas = function()
        if not (not v56.baseFrameRef.current or not v56.listLayoutRef.current) then
            v56.baseFrameRef.current.CanvasSize = UDim2.new(v57.Size.X.Scale, v57.Size.X.Offset, 0, (math.max(v56.listLayoutRef.current.AbsoluteContentSize.y + 48, v56.state.maxDropdownPosition)));
        end;
    end;
    v56.updateMaxDropdownPosition = function(v58, v59)
        if v58.current and v59 > 0 then
            local v60 = ((v58.current.AbsolutePosition.Y + v56.baseFrameRef.current.CanvasPosition.Y) + -v56.baseFrameRef.current.AbsolutePosition.Y) - 24;
            local v61 = (((v60 + 24) + v58.current.AbsoluteSize.Y) + v59) + 24;
            spawn(function()
                if v56.state.maxDropdownPosition < v61 then
                    v56:setState({
                        maxDropdownPosition = v61
                    });
                    v56.refreshCanvas();
                end;
                v56:bumpCanvas(v60, v61);
            end);
        end;
    end;
end;
v55.bumpCanvas = function(v62, v63, v64)
    if v62.baseFrameRef.current then
        local l_current_0 = v62.baseFrameRef.current;
        local l_Y_0 = l_current_0.CanvasPosition.Y;
        local l_Y_1 = l_current_0.AbsoluteSize.Y;
        if v63 < l_Y_0 then
            l_current_0.CanvasPosition = Vector2.new(0, (math.max(0, v63)));
            return ;
        elseif l_Y_0 + l_Y_1 < v64 then
            l_current_0.CanvasPosition = Vector2.new(0, (math.max(0, v64 - l_Y_1)));
        end;
    end;
end;
v55.render = function(v68)
    local l_Stylizer_0 = v68.props.Stylizer;
    local l_props_0 = v68.props;
    local l_Size_0 = l_props_0.Size;
    local l_LayoutOrder_0 = l_props_0.LayoutOrder;
    local l_allowCopy_0 = l_props_0.allowCopy;
    local l_allowSelectPrivate_0 = l_props_0.allowSelectPrivate;
    local l_name_0 = l_props_0.name;
    local l_description_0 = l_props_0.description;
    local l_tags_0 = l_props_0.tags;
    local l_owner_0 = l_props_0.owner;
    local l_genres_0 = l_props_0.genres;
    local l_copyOn_0 = l_props_0.copyOn;
    local l_allowComment_0 = l_props_0.allowComment;
    local l_commentOn_0 = l_props_0.commentOn;
    local l_deleteLocal_0 = l_props_0.deleteLocal;
    local v84 = if not l_UnifyModelPackagePublish3_0 then nil else l_props_0.allowPackage;
    local v85 = if not l_UnifyModelPackagePublish3_0 then nil else l_props_0.packageOn;
    local v86 = if not l_UnifyModelPackagePublish3_0 then nil else l_props_0.packageWarningText;
    local l_assetTypeEnum_0 = l_props_0.assetTypeEnum;
    local l_isAssetPublic_0 = l_props_0.isAssetPublic;
    local _ = v28.additionalImages.MaxThumbnails;
    local v90 = l_assetTypeEnum_0 == Enum.AssetType.Audio;
    local v91 = l_assetTypeEnum_0 == Enum.AssetType.Video;
    local v92 = l_assetTypeEnum_0 == Enum.AssetType.Model;
    local v93 = l_assetTypeEnum_0 == Enum.AssetType.Plugin;
    local v94 = l_assetTypeEnum_0 == Enum.AssetType.Animation;
    local _ = if not l_UnifyModelPackagePublish3_0 then nil else l_props_0.isPackageAsset;
    local v96 = v29.isCreatorStoreAssetNotIncludingAnimation(l_assetTypeEnum_0);
    local v97 = if typeof(l_props_0.assetId) == "number" then v35.constructCreatorStoreConfigurationUrl(l_props_0.assetId) else v33.getCreatorDashboardBaseUrl();
    local l_onNameChange_0 = l_props_0.onNameChange;
    local l_onDescChange_0 = l_props_0.onDescChange;
    local l_onTagsChange_0 = l_props_0.onTagsChange;
    local l_onOwnerSelected_0 = l_props_0.onOwnerSelected;
    local l_onCategoryChange_0 = l_props_0.onCategoryChange;
    local l_onGenreSelected_0 = l_props_0.onGenreSelected;
    local l_onSharingChanged_0 = l_props_0.onSharingChanged;
    local _ = l_props_0.toggleCopy;
    local l_toggleComment_0 = l_props_0.toggleComment;
    local v107 = if not l_UnifyModelPackagePublish3_0 then nil else l_props_0.togglePackage;
    local l_toggleDeleteLocal_0 = l_props_0.toggleDeleteLocal;
    local v109 = if not v6() then nil else l_props_0.canUploadWithUgcRestrictions;
    local v110 = if not v6() then nil else l_props_0.canUploadWithUgcRestrictionsDenyReason;
    local l_publishingRequirements_0 = l_props_0.publishingRequirements;
    local v112 = if not v9() then nil else l_props_0.publishingRestriction;
    local v113 = if not l_publishingRequirements_0 then nil else l_publishingRequirements_0.verification;
    local _ = not not v113 and if v113.supportedTypes then #v113.supportedTypes ~= 0 else false;
    local _ = (v113 and v113.isVerified) and v93;
    local l_displayOwnership_0 = l_props_0.displayOwnership;
    local l_displayGenre_0 = l_props_0.displayGenre;
    local _ = l_props_0.displayCopy;
    local v119 = if not l_UnifyModelPackagePublish3_0 then nil else l_props_0.displayPackage;
    local l_displayComment_0 = l_props_0.displayComment;
    local v121 = if not v93 then l_props_0.displayAssetType else false;
    local l_displayTags_0 = l_props_0.displayTags;
    local l_displaySharing_0 = l_props_0.displaySharing;
    local l_displayAssetTypeSelection_0 = l_props_0.displayAssetTypeSelection;
    local _ = if not v93 then nil else l_props_0.allowedAssetTypesForRelease;
    local _ = l_props_0.allowedAssetTypesForFree;
    local v127 = if not v93 then nil else l_props_0.newAssetStatus;
    local _ = if not v93 then nil else l_props_0.currentAssetStatus;
    local _ = if not v93 then nil else l_props_0.onStatusChange;
    local _ = if not v93 then nil else l_props_0.price;
    local _ = if not v93 then nil else l_props_0.minPrice;
    local _ = if not v93 then nil else l_props_0.maxPrice;
    local _ = if not v93 then nil else l_props_0.feeRate;
    local _ = if not v93 then nil else l_props_0.isPriceValid;
    local _ = if not v93 then nil else l_props_0.onPriceChange;
    local v136 = if not v93 then nil else v29.isReadyForSale(v127) or v29.isBuyableMarketplaceAsset(l_assetTypeEnum_0);
    local l_maximumItemTagsPerItem_0 = l_props_0.maximumItemTagsPerItem;
    local v138 = nil;
    local v139 = nil;
    local l_Localization_0 = l_props_0.Localization;
    if not (((not v90 and (not l_ToolboxVideoConfigSharing2_0 or not v91) or l_isAssetPublic_0) or not l_copyOn_0) or l_UnifyModelPackagePublish3_0) then
        v138 = l_Localization_0:getText("AssetConfigCopy", "MustShare");
    end;
    if v92 then
        v139 = l_Localization_0:getText("AssetConfig", "ModelPublishWarning");
    end;
    local v141 = v27.new();
    local l_publishAsset_0 = l_Stylizer_0.publishAsset;
    local v143 = 80;
    if not l_allowCopy_0 then
        v143 = v143 + 60;
    end;
    local v144 = {
        Size = l_Size_0,
        LayoutOrder = l_LayoutOrder_0,
        [v12.Ref] = v68.baseFrameRef
    };
    local v145 = nil;
    if not l_props_0.assetMediaMetadataArray then
        if l_props_0.assetMediaIds ~= nil then
            v145 = l_map_0(l_props_0.assetMediaIds, function(v146)
                return v26.from(v146, true, true);
            end);
        end;
    else
        v145 = l_props_0.assetMediaMetadataArray;
    end;
    local v147 = nil;
    v147 = if not v9() then if v93 then v136 else l_allowCopy_0 else if v93 then v136 and v112 == nil else l_allowCopy_0;
    return v12.createElement(v24, v144, {
        Padding = v12.createElement("UIPadding", {
            PaddingTop = UDim.new(0, 24),
            PaddingBottom = UDim.new(0, 24),
            PaddingLeft = UDim.new(0, 24),
            PaddingRight = UDim.new(0, 24)
        }),
        UIListLayout = v12.createElement("UIListLayout", {
            FillDirection = Enum.FillDirection.Vertical,
            HorizontalAlignment = Enum.HorizontalAlignment.Left,
            VerticalAlignment = Enum.VerticalAlignment.Top,
            SortOrder = Enum.SortOrder.LayoutOrder,
            Padding = UDim.new(0, 0),
            [v12.Change.AbsoluteContentSize] = v68.refreshCanvas or function(v148)
                if v68.baseFrameRef.current then
                    v68.baseFrameRef.current.CanvasSize = UDim2.new(l_Size_0.X.Scale, l_Size_0.X.Offset, 0, v148.AbsoluteContentSize.y + 48);
                end;
            end,
            [v12.Ref] = v68.listLayoutRef
        }),
        ModelWarningFrame = if not l_displayAssetTypeSelection_0 and v92 then v12.createElement(l_Pane_0, {
            HorizontalAlignment = Enum.HorizontalAlignment.Left,
            Layout = Enum.FillDirection.Horizontal,
            LayoutOrder = v141:getNextOrder(),
            Size = UDim2.new(1, 0, 0, v30.FONT_SIZE_TITLE),
            Padding = {
                Bottom = 30
            },
            Spacing = 5,
            VerticalAlignment = Enum.VerticalAlignment.Top
        }, {
            Icon = v12.createElement("ImageLabel", {
                LayoutOrder = 1,
                BackgroundTransparency = 1,
                Image = v31.WARNING_ICON,
                ImageColor3 = l_publishAsset_0.warningIconColor,
                Size = UDim2.fromOffset(24, 24)
            }),
            WarningText = v12.createElement("TextLabel", {
                AutomaticSize = Enum.AutomaticSize.XY,
                LayoutOrder = 2,
                BackgroundTransparency = 1,
                Font = v30.FONT,
                Size = UDim2.new(1, 0, 1, 0),
                Text = v139,
                TextWrapped = true,
                TextColor3 = l_Stylizer_0.assetConfig.warningColor,
                TextXAlignment = Enum.TextXAlignment.Left,
                TextYAlignment = Enum.TextYAlignment.Center,
                TextSize = v30.FONT_SIZE_TITLE
            })
        }) else nil,
        Header = if not v93 then nil else v12.createElement(v48, {
            LayoutOrder = v141:getNextOrder(),
            Title = l_Localization_0:getText("AssetConfig", "PublishPluginHeader")
        }),
        Title = v12.createElement(v37, {
            Title = l_Localization_0:getText("General", "Title"),
            TotalHeight = 100,
            MaxCount = v28.NAME_CHARACTER_LIMIT,
            TextChangeCallBack = l_onNameChange_0,
            TextContent = l_name_0,
            ErrorCallback = function(v149)
                v68.props.setFieldError(v28.FIELD_NAMES.Title, v149);
            end,
            LayoutOrder = v141:getNextOrder()
        }),
        Description = v12.createElement(v37, {
            BottomRightText = l_Localization_0:getText("AssetConfigDescription", "AddRobloxLinks"),
            Title = l_Localization_0:getText("General", "Description"),
            TotalHeight = 180,
            MaxCount = v28.DESCRIPTION_CHARACTER_LIMIT,
            TextChangeCallBack = l_onDescChange_0,
            TextContent = l_description_0,
            ErrorCallback = function(v150)
                v68.props.setFieldError(v28.FIELD_NAMES.Description, v150);
            end,
            LayoutOrder = v141:getNextOrder()
        }),
        AssetTypeSelection = if not l_displayAssetTypeSelection_0 then nil else v12.createElement(v43, {
            LayoutOrder = v141:getNextOrder(),
            onCategoryChange = l_onCategoryChange_0,
            canUploadWithUgcRestrictions = if not v6() then nil else v109,
            canUploadWithUgcRestrictionsDenyReason = if not v6() then nil else v110,
            dataSharingEnabled = l_props_0.dataSharingEnabled,
            dataSharingToggled = l_props_0.dataSharingToggled,
            onDataConsentToggleClick = l_props_0.onDataConsentToggleClick
        }),
        Creator = if not not l_displayAssetTypeSelection_0 and l_displayOwnership_0 then v12.createElement(v38, {
            LayoutOrder = v141:getNextOrder(),
            onDropDownSelect = l_onOwnerSelected_0,
            owner = l_owner_0,
            Title = l_Localization_0:getText("General", "Ownership"),
            TotalHeight = 70
        }) else nil,
        AssetType = v121 and v12.createElement(l_TitledFrame_0, {
            Title = l_Localization_0:getText("General", "AssetType"),
            LayoutOrder = v141:getNextOrder()
        }, {
            Label = v12.createElement("TextLabel", {
                BackgroundTransparency = 1,
                TextColor3 = l_publishAsset_0.textColor,
                Font = v30.FONT,
                TextSize = v30.FONT_SIZE_TITLE,
                Text = v32(l_Localization_0)[l_assetTypeEnum_0],
                TextXAlignment = Enum.TextXAlignment.Left,
                TextYAlignment = Enum.TextYAlignment.Top
            })
        }),
        Tags = l_displayTags_0 and v12.createElement(v47, {
            tags = l_tags_0,
            onTagsChange = l_onTagsChange_0,
            maximumItemTagsPerItem = l_maximumItemTagsPerItem_0,
            Title = l_Localization_0:getText("General", "Tags"),
            AssetTypeEnum = l_assetTypeEnum_0,
            LayoutOrder = v141:getNextOrder(),
            setDropdownHeight = function(v151)
                v68.updateMaxDropdownPosition(v68.tagsRef, v151);
            end,
            [v12.Ref] = v68.tagsRef
        }),
        Ownership = if not l_displayAssetTypeSelection_0 and l_displayOwnership_0 then v12.createElement(v38, {
            Title = l_Localization_0:getText("General", "Ownership"),
            owner = l_owner_0,
            TotalHeight = 70,
            onDropDownSelect = l_onOwnerSelected_0,
            LayoutOrder = v141:getNextOrder()
        }) else nil,
        Genre = l_displayGenre_0 and v12.createElement(v40, {
            Title = l_Localization_0:getText("General", "Genre"),
            genres = l_genres_0,
            TotalHeight = 70,
            onDropDownSelect = l_onGenreSelected_0,
            LayoutOrder = v141:getNextOrder(),
            setDropdownHeight = function(v152)
                v68.updateMaxDropdownPosition(v68.genreRef, v152);
            end,
            [v12.Ref] = v68.genreRef
        }),
        DividerBase = (l_displayGenre_0 or v96) and v12.createElement("Frame", {
            BackgroundTransparency = 1,
            LayoutOrder = v141:getNextOrder(),
            Size = UDim2.new(1, 0, 0, 20)
        }, {
            Separator = v12.createElement(l_Separator_0, {
                Position = UDim2.new(0.5, 0, 0.5, 0)
            })
        }),
        Sharing = if not l_displaySharing_0 then nil else v12.createElement(v45, {
            AssetId = l_props_0.assetId,
            AssetType = l_assetTypeEnum_0,
            AllowSelectPrivate = l_allowSelectPrivate_0,
            LayoutOrder = v141:getNextOrder(),
            IsAssetPublic = l_isAssetPublic_0,
            OnSelected = l_onSharingChanged_0
        }),
        SharingDivider = if not l_displaySharing_0 then nil else v12.createElement("Frame", {
            BackgroundTransparency = 1,
            LayoutOrder = v141:getNextOrder(),
            Size = UDim2.new(1, 0, 0, 20)
        }, {
            Separator = v12.createElement(l_Separator_0, {
                Position = UDim2.new(0.5, 0, 0.5, 0)
            })
        }),
        CreatorStoreConfigurationFrame = if not v96 then nil else v12.createElement(l_Pane_0, {
            AutomaticSize = Enum.AutomaticSize.Y,
            Layout = Enum.FillDirection.Vertical,
            LayoutOrder = v141:getNextOrder(),
            Padding = {
                Top = 20
            }
        }, {
            CreatorStoreConfigurationText = v12.createElement(l_TextLabel_0, {
                Text = l_props_0.Localization:getText("AssetUploadResult", "CreatorStoreConfigurationMessage"),
                TextColor3 = l_Stylizer_0.uploadResult.text,
                TextSize = v30.FONT_SIZE_LARGE,
                Size = UDim2.new(1, 0, 0, 24),
                LayoutOrder = v141:getNextOrder()
            }),
            CreatorStoreConfigurationLink = v12.createElement(l_LinkText_0, {
                Text = v97,
                TextColor3 = l_Stylizer_0.uploadResult.link,
                TextSize = v30.FONT_SIZE_LARGE,
                Size = UDim2.new(1, 0, 0, 24),
                LayoutOrder = v141:getNextOrder(),
                OnClick = function()
                    l_GuiService_0:OpenBrowserWindow(v97);
                end
            })
        }),
        Package = if not not l_UnifyModelPackagePublish3_0 and v119 then v12.createElement(v42, {
            Title = l_Localization_0:getText("General", "Package"),
            TotalHeight = 80,
            PackageEnabled = v84,
            PackageOn = v85,
            PackageWarningText = v86,
            ToggleCallback = v107,
            LayoutOrder = v141:getNextOrder()
        }) else nil,
        Comment = l_displayComment_0 and v12.createElement(v44, {
            Title = l_Localization_0:getText("General", "Comments"),
            TotalHeight = 80,
            CommentEnabled = l_allowComment_0,
            CommentOn = l_commentOn_0,
            ToggleCallback = l_toggleComment_0,
            LayoutOrder = v141:getNextOrder()
        }),
        DeleteLocal = (not v11 or v94) and v12.createElement(v39, {
            Title = l_Localization_0:getText("General", "DeleteLocal"),
            TotalHeight = 80,
            DeleteLocal = l_deleteLocal_0,
            ToggleCallback = l_toggleDeleteLocal_0,
            LayoutOrder = v141:getNextOrder()
        })
    });
end;
return v13.connect(function(v153)
    v153 = v153 or {};
    return {
        publishingRequirements = v153.publishingRequirements,
        assetMediaIds = v153.assetMediaIds,
        assetMediaMetadataArray = v153.assetMediaMetadataArray,
        sellerStatusData = if not v10() then nil else v153.sellerStatusData
    };
end, function(v154)
    return {
        setFieldError = function(v155, v156)
            v154(v53(v28.SIDE_TABS.General, v155, v156));
        end
    };
end)((l_withContext_0({
    Localization = l_ContextServices_0.Localization,
    Stylizer = l_ContextServices_0.Stylizer
})(v55)));


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local l_Packages_0 = l_Parent_0.Packages;
local v2 = require(l_Packages_0.Roact);
local l_ContextServices_0 = require(l_Packages_0.Framework).ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_UI_0 = require(l_Packages_0.Framework).UI;
local l_ToggleButton_0 = l_UI_0.ToggleButton;
local l_TitledFrame_0 = l_UI_0.TitledFrame;
local l_Util_0 = l_Parent_0.Core.Util;
local v9 = require(l_Util_0.LayoutOrderIterator);
local v10 = require(l_Util_0.Constants);
local v11 = require(l_Util_0.AssetConfigUtil);
local v12 = require(l_Util_0.AssetConfigConstants);
local v13 = v2.PureComponent:extend("SalesComponent");
v13.init = function(v14, _)
    v14.onToggle = function()
        local l_props_0 = v14.props;
        local l_CanChangeSalesStatus_0 = l_props_0.CanChangeSalesStatus;
        local _ = l_props_0.NewAssetStatus;
        local l_CurrentAssetStatus_0 = l_props_0.CurrentAssetStatus;
        local l_OnStatusChange_0 = l_props_0.OnStatusChange;
        if l_CanChangeSalesStatus_0 then
            l_OnStatusChange_0(not not v11.isOnSale(l_CurrentAssetStatus_0) and v12.ASSET_STATUS.OffSale or v12.ASSET_STATUS.OnSale);
        end;
    end;
end;
v13.render = function(v21)
    local l_Stylizer_0 = v21.props.Stylizer;
    local l_props_1 = v21.props;
    local l_Title_0 = l_props_1.Title;
    local l_NewAssetStatus_1 = l_props_1.NewAssetStatus;
    local _ = l_props_1.CurrentAssetStatus;
    local l_AssetTypeEnum_0 = l_props_1.AssetTypeEnum;
    local l_assetConfig_0 = l_Stylizer_0.assetConfig;
    local v29 = l_props_1.Localization:getText("AssetConfigSales", "Target", {
        market = not v11.isMarketplaceAsset(l_AssetTypeEnum_0) and "Catalog" or "Marketplace",
        user = not v11.isMarketplaceAsset(l_AssetTypeEnum_0) and "user" or "developer"
    });
    local l_CanChangeSalesStatus_1 = l_props_1.CanChangeSalesStatus;
    local l_labelTextColor_0 = l_assetConfig_0.labelTextColor;
    local l_LayoutOrder_0 = l_props_1.LayoutOrder;
    local v33 = v9.new();
    return v2.createElement(l_TitledFrame_0, {
        Title = l_Title_0,
        LayoutOrder = l_LayoutOrder_0
    }, {
        ToggleButton = v2.createElement(l_ToggleButton_0, {
            Disabled = not l_CanChangeSalesStatus_1,
            LayoutOrder = v33:getNextOrder(),
            OnClick = v21.onToggle,
            Selected = v11.isOnSale(l_NewAssetStatus_1),
            Size = UDim2.new(0, 40, 0, 24)
        }),
        Label = v2.createElement("TextLabel", {
            Size = UDim2.new(1, 0, 0, 24),
            BackgroundTransparency = 1,
            TextColor3 = l_labelTextColor_0,
            BorderSizePixel = 0,
            Font = v10.FONT,
            TextSize = v10.FONT_SIZE_SMALL,
            Text = v29,
            TextXAlignment = Enum.TextXAlignment.Left,
            LayoutOrder = v33:getNextOrder()
        })
    });
end;
return (l_withContext_0({
    Stylizer = l_ContextServices_0.Stylizer,
    Localization = l_ContextServices_0.Localization
})(v13));


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local l_Packages_0 = l_Parent_0.Packages;
local v2 = require(l_Packages_0.Roact);
local v3 = require(l_Packages_0.RoactRodux);
local l_Components_0 = l_Parent_0.Core.Components;
local v5 = require(l_Components_0.AssetConfiguration.AssetConfig);
local v6 = require(l_Components_0.AssetConfiguration.AssetTypeSelection);
local v7 = require(l_Components_0.AssetConfiguration.AssetValidation);
local v8 = require(l_Components_0.AssetConfiguration.AssetUpload);
local v9 = require(l_Components_0.AssetConfiguration.AssetUploadResult);
local v10 = require(l_Parent_0.Core.Util.AssetConfigConstants);
local function _(v11)
    return v11 == v10.SCREENS.CONFIGURE_ASSET;
end;
local function _(v13)
    return v13 == v10.SCREENS.ASSET_TYPE_SELECTION;
end;
local function _(v15)
    return v15 == v10.SCREENS.ASSET_VALIDATION;
end;
local function _(v17)
    return v17 == v10.SCREENS.UPLOADING_ASSET;
end;
local function _(v19)
    return v19 == v10.SCREENS.UPLOAD_ASSET_RESULT;
end;
local v21 = v2.PureComponent:extend("ScreenSelect");
v21.render = function(v22)
    local l_props_0 = v22.props;
    local l_currentScreen_0 = l_props_0.currentScreen;
    return v2.createElement("Frame", {
        Size = UDim2.new(1, 0, 1, 0),
        BackgroundTransparency = 1
    }, {
        AssetConfig = l_currentScreen_0 == v10.SCREENS.CONFIGURE_ASSET and v2.createElement(v5, {
            Size = UDim2.new(1, 0, 1, 0),
            assetId = l_props_0.assetId,
            assetTypeEnum = l_props_0.assetTypeEnum,
            onClose = l_props_0.onClose,
            pluginGui = l_props_0.pluginGui
        }),
        AssetTypeSelection = l_currentScreen_0 == v10.SCREENS.ASSET_TYPE_SELECTION and v2.createElement(v6, {
            Size = UDim2.new(1, 0, 1, 0),
            onClose = l_props_0.onClose
        }),
        AssetValidation = l_currentScreen_0 == v10.SCREENS.ASSET_VALIDATION and v2.createElement(v7, {
            Size = UDim2.new(1, 0, 1, 0),
            onClose = l_props_0.onClose
        }),
        AssetUpload = l_currentScreen_0 == v10.SCREENS.UPLOADING_ASSET and v2.createElement(v8, {
            Size = UDim2.new(1, 0, 1, 0),
            onClose = l_props_0.onClose
        }),
        AssetUploadResult = l_currentScreen_0 == v10.SCREENS.UPLOAD_ASSET_RESULT and v2.createElement(v9, {
            Size = UDim2.new(1, 0, 1, 0),
            onClose = l_props_0.onClose
        })
    });
end;
return v3.connect(function(v25, _)
    return {
        currentScreen = (v25 or {}).currentScreen
    };
end)(v21);


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local l_Packages_0 = l_Parent_0.Packages;
local v2 = require(l_Packages_0.Roact);
local v3 = require(l_Packages_0.RoactRodux);
local v4 = require(l_Packages_0.Framework);
local l_Util_0 = l_Parent_0.Core.Util;
local v6 = require(l_Util_0.Constants);
local v7 = require(l_Util_0.Images);
local v8 = require(l_Parent_0.Core.Localization.getLocalizedSideTabsMap);
local l_ContextServices_0 = v4.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local v11 = v2.PureComponent:extend("SideTabs");
v11.init = function(v12, _)
    v12.state = {
        hoveredIndex = 0
    };
    v12.onItemEntered = function(v14)
        v12:setState({
            hoveredIndex = v14
        });
    end;
    v12.onItemLeft = function(_)
        v12:setState({
            hoveredIndex = 0
        });
    end;
end;
v11.createSideButtons = function(v16, v17, v18, v19, v20, v21, v22)
    local v23 = v19 * 0.4;
    local v24 = {
        UIListLayout = v2.createElement("UIListLayout", {
            FillDirection = Enum.FillDirection.Vertical,
            HorizontalAlignment = Enum.HorizontalAlignment.Center,
            VerticalAlignment = Enum.VerticalAlignment.Top,
            SortOrder = Enum.SortOrder.LayoutOrder,
            Padding = UDim.new(0, 0)
        })
    };
    local l_current_0 = v21.current;
    local v26 = 0;
    if l_current_0 then
        v26 = l_current_0.AbsoluteSize.X;
    end;
    for v27, v28 in pairs(v17) do
        local v29 = v8(v16.props.Localization)[v28.name];
        v24[v29] = v2.createElement("Frame", {
            Size = UDim2.new(0.5, 0, 0, v19),
            BackgroundTransparency = 1,
            LayoutOrder = v27
        }, {
            Icon = v2.createElement("ImageButton", {
                AnchorPoint = Vector2.new(0, 0.5),
                Position = UDim2.new(0, 0, 0.5, 0),
                Size = UDim2.new(0, v23, 0, v23),
                BackgroundTransparency = 1,
                ImageColor3 = v20.sideTab.contentColor,
                Image = v28.image,
                [v2.Event.Activated] = function(_)
                    v16.props.ItemClickCallBack(v27, v28);
                end,
                LayoutOrder = 1
            }),
            Text = v2.createElement("TextButton", {
                Position = UDim2.new(0, v23 * 2, 0, 0),
                Size = UDim2.new(1, -v23, 1, 0),
                BackgroundTransparency = 1,
                Text = v29,
                Font = v6.FONT,
                TextSize = v6.FONT_SIZE_LARGE,
                TextXAlignment = Enum.TextXAlignment.Left,
                TextColor3 = v20.sideTab.textColor,
                [v2.Event.Activated] = function(_)
                    v16.props.ItemClickCallBack(v27, v28);
                end,
                LayoutOrder = 2
            }),
            Selection = v28 == v18 and v2.createElement("Frame", {
                Position = UDim2.new(-0.5, 0, 0, 0),
                Size = UDim2.new(0, v26, 1, 0),
                BackgroundTransparency = v22.selecteBarTrans,
                BackgroundColor3 = v22.selecteBarColor,
                BorderSizePixel = 0,
                ZIndex = v22.selecteBarZindex,
                LayoutOrder = 0
            }, {
                Indicator = v2.createElement("Frame", {
                    Position = UDim2.new(0, 0, 0, 0),
                    Size = UDim2.new(0, 4, 1, 0),
                    BackgroundTransparency = v22.selecteIndicatorTrans,
                    BackgroundColor3 = v22.selecteIndicatorColor,
                    BorderSizePixel = 0
                })
            }),
            Error = v16.props.tabHasErrors(v28.name) and v2.createElement("ImageButton", {
                BackgroundTransparency = 1,
                Size = UDim2.new(0, 20, 0, 20),
                Position = UDim2.new(1, -20, 0.5, -10),
                Image = v7.ERROR_ICON,
                [v2.Event.Activated] = function(_)
                    v16.props.ItemClickCallBack(v27, v28);
                end,
                LayoutOrder = 3
            })
        });
    end;
    return v24;
end;
v11.render = function(v33)
    local l_props_0 = v33.props;
    local l_Stylizer_0 = l_props_0.Stylizer;
    return v2.createElement("Frame", {
        Position = l_props_0.Position,
        Size = l_props_0.Size,
        BackgroundTransparency = 1,
        BorderSizePixel = 0,
        LayoutOrder = l_props_0.LayoutOrder
    }, (v33:createSideButtons(l_props_0.Items, l_props_0.CurrentTab, l_props_0.ItemHeight, l_Stylizer_0, l_props_0.SelectParentRef, l_Stylizer_0.sideTab)));
end;
return v3.connect(function(v36, _)
    v36 = v36 or {};
    return {
        tabHasErrors = function(v38)
            if v36.tabErrors then
                local v39 = v36.tabErrors[v38];
                if v39 then
                    for _, v41 in pairs(v39) do
                        if v41 == true then
                            return true;
                        end;
                    end;
                end;
            end;
            return false;
        end
    };
end)((l_withContext_0({
    Stylizer = l_ContextServices_0.Stylizer,
    Localization = l_ContextServices_0.Localization
})(v11)));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("Toolbox");
local l_Packages_0 = l_script_FirstAncestor_0.Packages;
local v2 = require(l_Packages_0.Framework);
local v3 = require(l_Packages_0.Roact);
local l_ContextServices_0 = v2.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_LayoutOrderIterator_0 = v2.Util.LayoutOrderIterator;
local l_UI_0 = v2.UI;
local l_Pane_0 = l_UI_0.Pane;
local _ = l_UI_0.Image;
local l_StyledDialog_0 = l_UI_0.StyledDialog;
local l_TextLabel_0 = l_UI_0.TextLabel;
local v12 = require(l_script_FirstAncestor_0.Core.Util.Constants);
local v13 = Vector2.new(400, 70);
local v14 = v3.PureComponent:extend("StyledConfirmDialog");
local v15 = {
    Accept = true,
    Cancel = false
};
v14.init = function(v16)
    v16.onButtonPressed = function(v17)
        local l_props_0 = v16.props;
        if v17 == v15.Accept then
            l_props_0.OnAccepted();
            return ;
        else
            l_props_0.OnCanceled();
            return ;
        end;
    end;
end;
v14.render = function(v19)
    local l_props_1 = v19.props;
    local l_AcceptText_0 = l_props_1.AcceptText;
    local l_CancelText_0 = l_props_1.CancelText;
    local l_Description_0 = l_props_1.Description;
    local l_Enabled_0 = l_props_1.Enabled;
    local l_Heading_0 = l_props_1.Heading;
    local l_OnCanceled_0 = l_props_1.OnCanceled;
    local l_Title_0 = l_props_1.Title;
    local v28 = l_LayoutOrderIterator_0.new();
    return v3.createElement(l_StyledDialog_0, {
        Buttons = {
            {
                Key = v15.Cancel,
                Text = l_CancelText_0
            },
            {
                Key = v15.Accept,
                Text = l_AcceptText_0
            }
        },
        Enabled = l_Enabled_0 == true,
        FitTextButtonWidth = true,
        MinContentSize = v13,
        Modal = true,
        OnButtonPressed = v19.onButtonPressed,
        OnClose = l_OnCanceled_0,
        Style = "AssetConfigWarningDialog",
        Title = l_Title_0
    }, {
        Contents = v3.createElement(l_Pane_0, {
            HorizontalAlignment = Enum.HorizontalAlignment.Center,
            Layout = Enum.FillDirection.Vertical,
            Spacing = 20,
            Size = UDim2.fromScale(1, 1)
        }, {
            Heading = v3.createElement(l_TextLabel_0, {
                AutomaticSize = Enum.AutomaticSize.Y,
                LayoutOrder = v28:getNextOrder(),
                Size = UDim2.new(1, 0, 0, 0),
                Font = v12.FONT_BOLD,
                Text = l_Heading_0,
                TextWrapped = true,
                TextXAlignment = Enum.TextXAlignment.Center
            }),
            Description = v3.createElement(l_TextLabel_0, {
                AutomaticSize = Enum.AutomaticSize.Y,
                LayoutOrder = v28:getNextOrder(),
                Size = UDim2.new(1, 0, 0, 0),
                Text = l_Description_0,
                TextWrapped = true,
                TextXAlignment = Enum.TextXAlignment.Center
            })
        })
    });
end;
return (l_withContext_0({
    Stylizer = l_ContextServices_0.Stylizer
})(v14));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("Toolbox");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework);
local v2 = require(l_script_FirstAncestor_0.Packages.Roact);
local v3 = require(l_script_FirstAncestor_0.Core.Localization.getLocalizedAssetTextMap);
local l_Util_0 = l_script_FirstAncestor_0.Core.Util;
local v5 = require(l_Util_0.Images);
local v6 = require(l_Util_0.Constants);
local v7 = require(l_Util_0.AssetConfigUtil);
local l_UI_0 = v1.UI;
local l_Image_0 = l_UI_0.Image;
local l_Pane_0 = l_UI_0.Pane;
local l_TextLabel_0 = l_UI_0.TextLabel;
local l_AssetRenderModel_0 = l_UI_0.AssetRenderModel;
local v13 = require(l_Util_0.SharedFlags.getFFlagEnableUGCMissingPartsMessage);
local v14 = require(l_Util_0.SharedFlags.getFFlagUGCBundleValidationFullBodyErrors);
local l_ContextServices_0 = v1.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_LayoutOrderIterator_0 = v1.Util.LayoutOrderIterator;
local v18 = require(l_script_FirstAncestor_0.Core.Components.AssetConfiguration.ValidationStatus);
local v19 = not v13() and 16 or 22;
local v20 = if not v13() then nil else 8;
local v21 = if not v13() then nil else 18;
local function v28(v22)
    assert(#v22:GetChildren() > 0, "Folder from limb validation did not have any instances");
    local l_Model_0 = Instance.new("Model");
    for v24, v25 in v22:GetChildren() do
        local v26 = v25:Clone();
        if v24 == 1 then
            local l_v26_0 = v26;
            if not l_v26_0:IsA("BasePart") then
                l_v26_0 = v26:FindFirstChildWhichIsA("BasePart");
            end;
            l_Model_0.PrimaryPart = l_v26_0;
        end;
        v26.Parent = l_Model_0;
    end;
    return l_Model_0;
end;
local function _(v29)
    local l_Model_1 = Instance.new("Model");
    local v31 = v29:Clone();
    local l_v31_0 = v31;
    if not l_v31_0:IsA("BasePart") then
        l_v31_0 = v31:FindFirstChildWhichIsA("BasePart");
    end;
    l_Model_1.PrimaryPart = l_v31_0;
    v31.Parent = l_Model_1;
    return l_Model_1;
end;
local v34 = v2.PureComponent:extend("UGCBundleValidation");
v34.render = function(v35)
    local l_props_0 = v35.props;
    local l_Localization_0 = l_props_0.Localization;
    local l_ugcBundleValidation_0 = l_props_0.Stylizer.ugcBundleValidation;
    local v39 = if not l_props_0.validationResults then {} else l_props_0.validationResults;
    local v40 = l_props_0.Localization:getText("AssetConfig", "UGCPublishWarning");
    local v41 = {};
    local v42 = l_LayoutOrderIterator_0.new();
    table.insert(v41, v2.createElement(l_Pane_0, {
        AutomaticSize = if not v13() then nil else Enum.AutomaticSize.Y,
        HorizontalAlignment = Enum.HorizontalAlignment.Left,
        Layout = Enum.FillDirection.Horizontal,
        LayoutOrder = -1,
        Size = if not v13() then UDim2.new(1, 0, 0, v19) else UDim2.fromScale(1, 0),
        Spacing = if not v13() then nil else v20,
        VerticalAlignment = Enum.VerticalAlignment.Top
    }, {
        Icon = v2.createElement("ImageLabel", {
            BackgroundTransparency = 1,
            Image = v5.WARNING_ICON,
            ImageColor3 = l_ugcBundleValidation_0.warningColor,
            LayoutOrder = 1,
            Size = UDim2.fromOffset(v19, v19)
        }),
        UGCWarningText = v2.createElement("TextLabel", {
            AutomaticSize = if not v13() then Enum.AutomaticSize.XY else Enum.AutomaticSize.Y,
            BackgroundTransparency = 1,
            Font = v6.FONT,
            LayoutOrder = 2,
            Size = if not v13() then UDim2.new(1, 0, 1, 0) else UDim2.fromScale(1, 0),
            Text = v40,
            TextColor3 = l_ugcBundleValidation_0.warningColor,
            TextSize = v19,
            TextWrapped = true,
            TextXAlignment = Enum.TextXAlignment.Left,
            TextYAlignment = Enum.TextYAlignment.Center
        })
    }));
    for v43, v44 in v39, nil, nil do
        local v45 = assert(l_ugcBundleValidation_0.validationStyles[v44.type], "No validation style for validation result type");
        local v46 = nil;
        if not v7.AssetTypeRequiresFolderForUpload(v44.assetType) then
            local l_instance_0 = v44.instance;
            if l_instance_0 then
                local l_instance_1 = v44.instance;
                local l_Model_2 = Instance.new("Model");
                local v50 = l_instance_1:Clone();
                local l_v50_0 = v50;
                if not l_v50_0:IsA("BasePart") then
                    l_v50_0 = v50:FindFirstChildWhichIsA("BasePart");
                end;
                l_Model_2.PrimaryPart = l_v50_0;
                v50.Parent = l_Model_2;
                l_instance_0 = l_Model_2;
            end;
            v46 = l_instance_0;
        else
            v46 = v44.instance and v28(v44.instance);
        end;
        local v52 = nil;
        v52 = if not v14() then assert(v3(l_props_0.Localization)[v44.assetType], "Couldn't find localized text for asset type") else if v44.assetType == nil then l_Localization_0:getText("AssetConfig", "ValidationFullBody") else assert(v3(l_props_0.Localization)[v44.assetType], "Couldn't find localized text for asset type");
        table.insert(v41, v2.createElement(l_Pane_0, {
            AutomaticSize = Enum.AutomaticSize.Y,
            HorizontalAlignment = Enum.HorizontalAlignment.Left,
            Layout = Enum.FillDirection.Horizontal,
            LayoutOrder = v43,
            Size = UDim2.fromScale(1, 0),
            Spacing = 5
        }, {
            Preview = v2.createElement(l_Pane_0, {
                BackgroundColor = l_ugcBundleValidation_0.previewBackgroundColor,
                LayoutOrder = v42:getNextOrder(),
                Size = UDim2.fromOffset(l_ugcBundleValidation_0.previewSize, l_ugcBundleValidation_0.previewSize)
            }, {
                UICorner = v2.createElement("UICorner", {
                    CornerRadius = UDim.new(0, 10)
                }),
                PreviewModel = if not not v44.instance and v46.PrimaryPart ~= nil then v2.createElement(l_AssetRenderModel_0, {
                    FocusDirection = v46.PrimaryPart.CFrame.LookVector,
                    Model = v46,
                    ShouldMuteModelSounds = true,
                    Static = true
                }) else v2.createElement(l_Image_0, {
                    Image = v5.PLACEHOLDER_ICON,
                    ImageColor3 = l_ugcBundleValidation_0.placeholderIconColor
                })
            }),
            AssetName = v2.createElement(l_TextLabel_0, {
                AutomaticSize = Enum.AutomaticSize.XY,
                LayoutOrder = v42:getNextOrder(),
                Text = if not v44.required then v52 else v52 .. "*",
                TextSize = l_ugcBundleValidation_0.nameTextSize,
                TextXAlignment = Enum.TextXAlignment.Left
            }, {
                UISizeConstraint = v2.createElement("UISizeConstraint", {
                    MinSize = Vector2.new(l_ugcBundleValidation_0.nameMinWidth, 0)
                })
            }),
            ValidationArea = v2.createElement(l_Pane_0, {
                AutomaticSize = Enum.AutomaticSize.XY,
                LayoutOrder = v42:getNextOrder(),
                Layout = Enum.FillDirection.Horizontal,
                OnClick = if v44.type == v18.error then l_props_0.onClickError else nil,
                Spacing = 5
            }, {
                ValidationIcon = v2.createElement(l_Image_0, {
                    Image = assert(v5.UGCValidationStatus[v44.type], "No icon for validation result type"),
                    ImageColor3 = v45.iconColor,
                    LayoutOrder = v42:getNextOrder(),
                    Size = UDim2.fromOffset(l_ugcBundleValidation_0.validationIconSize, l_ugcBundleValidation_0.validationIconSize)
                }),
                ValidationText = v2.createElement(l_TextLabel_0, {
                    AutomaticSize = Enum.AutomaticSize.XY,
                    LayoutOrder = v42:getNextOrder(),
                    Text = if v44.type == v18.success then l_Localization_0:getText("AssetConfig", "ValidationSuccess") else if v44.type == v18.pending then l_Localization_0:getText("AssetConfig", "ValidatingInProgress") else if v44.type == v18.error then l_Localization_0:getText("AssetConfig", #v44.errors == 1 and "ValidationErrorSingular" or "ValidationErrorPlural", {
                        errorCount = #v44.errors
                    }) else error((("Unknown validation result type \"%*\""):format(v44.type))),
                    TextColor = v45.textColor
                })
            })
        }));
    end;
    return v2.createElement(l_Pane_0, {
        AutomaticSize = Enum.AutomaticSize.Y,
        Layout = Enum.FillDirection.Vertical,
        LayoutOrder = l_props_0.LayoutOrder,
        Size = UDim2.fromScale(1, 0),
        Spacing = not v13() and 5 or v21
    }, v41);
end;
return (l_withContext_0({
    Localization = l_ContextServices_0.Localization,
    Stylizer = l_ContextServices_0.Stylizer
})(v34));


ValidationStatus = {
    pending = "pending",
    success = "success",
    error = "error"
};
return ValidationStatus;


local v0 = require(script.Parent.Parent.Parent.Parent.Packages.Roact);
return function(v1)
    return v0.createElement("Frame", {
        AnchorPoint = v1.AnchorPoint,
        Position = v1.Position,
        Size = v1.Size,
        BackgroundColor3 = Color3.fromRGB(151, 151, 151),
        BorderSizePixel = 0,
        LayoutOrder = v1.LayoutOrder or 0
    });
end;


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local l_Packages_0 = l_Parent_0.Packages;
local v2 = require(l_Packages_0.Roact);
local v3 = require(l_Packages_0.Framework);
local l_ContextServices_0 = v3.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_formatLocalDateTime_0 = v3.Util.formatLocalDateTime;
local v7 = require(l_Parent_0.Core.Components.AssetConfiguration.VersionDivider);
local l_Util_0 = l_Parent_0.Core.Util;
local v9 = require(l_Util_0.Constants);
local v10 = require(l_Util_0.Urls);
local v11 = require(l_Util_0.Images);
local v12 = v2.PureComponent:extend("VersionItem");
local v13 = {
    CURRENT = 1,
    SELECTED = 2,
    DEFAULT = 3
};
v12.init = function(v14, _)
    v14.state = {};
end;
v12.render = function(v16)
    local l_props_0 = v16.props;
    local l_Stylizer_0 = l_props_0.Stylizer;
    local _ = l_Stylizer_0.versions;
    local v20 = l_props_0.ItemInfo or {};
    local l_IsCurrent_0 = l_props_0.IsCurrent;
    local l_SelectVersion_0 = l_props_0.SelectVersion;
    local v23 = nil;
    v23 = if not l_IsCurrent_0 then if l_SelectVersion_0 == v20.assetVersionNumber then v13.SELECTED else v13.DEFAULT else v13.CURRENT;
    local _ = v10.constructAssetThumbnailUrl(v20.assetId, v9.ASSET_THUMBNAIL_REQUESTED_IMAGE_SIZE, v9.ASSET_THUMBNAIL_REQUESTED_IMAGE_SIZE);
    local l_versions_1 = l_Stylizer_0.versions;
    local l_createElement_0 = v2.createElement;
    local v27 = "Frame";
    local v28 = {
        Size = l_props_0.Size,
        BackgroundTransparency = 1,
        BorderSizePixel = 0,
        LayoutOrder = l_props_0.LayoutOrder
    };
    local v29 = {
        Version = v2.createElement("TextLabel", {
            AnchorPoint = Vector2.new(0, 0.5),
            Position = UDim2.new(0, 120, 0, 25),
            Size = UDim2.new(1, -67, 0, 20),
            Text = "V" .. tostring(v20.assetVersionNumber),
            TextColor3 = l_versions_1.textColor,
            Font = v9.FONT_BOLD,
            TextSize = v9.FONT_SIZE_MEDIUM,
            TextXAlignment = Enum.TextXAlignment.Left,
            TextYAlignment = Enum.TextYAlignment.Center,
            BackgroundTransparency = 1,
            BorderSizePixel = 0
        }),
        LastChange = v2.createElement("TextLabel", {
            AnchorPoint = Vector2.new(0, 0),
            Position = UDim2.new(0, 120, 0, 35),
            Size = UDim2.new(1, -67, 0, 20),
            Text = l_formatLocalDateTime_0(v20.created, "L LTS", v16.props.Localization:getLocale()),
            TextColor3 = l_versions_1.textColor,
            Font = v9.FONT,
            TextSize = v9.FONT_SIZE_MEDIUM,
            TextXAlignment = Enum.TextXAlignment.Left,
            TextYAlignment = Enum.TextYAlignment.Center,
            BackgroundTransparency = 1,
            BorderSizePixel = 0
        })
    };
    local v30 = false;
    if v23 ~= v13.CURRENT then
        v30 = v2.createElement("ImageButton", {
            AnchorPoint = Vector2.new(1, 0.5),
            Position = UDim2.new(1, -160, 0.5, 0),
            Size = UDim2.new(0, 28, 0, 28),
            Image = v11.MAKE_CURRENT_VERSION,
            BackgroundTransparency = 1,
            ImageColor3 = v23 == v13.DEFAULT and l_versions_1.buttonDefaultColor or l_versions_1.buttonSelectedColor,
            [v2.Event.Activated] = function(_)
                l_props_0.ItemClickCallBack(v20);
            end,
            BorderSizePixel = 0
        });
    end;
    v29.SelectButton = v30;
    v29.Divider = v2.createElement(v7, {
        AnchorPoint = l_props_0.DividerAnchorPoint,
        Position = l_props_0.DividerPosition,
        Size = l_props_0.DividerSize,
        BorderSizePixel = 0
    });
    return l_createElement_0(v27, v28, v29);
end;
return (l_withContext_0({
    Localization = l_ContextServices_0.Localization,
    Stylizer = l_ContextServices_0.Stylizer
})(v12));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("Toolbox");
local l_Packages_0 = l_script_FirstAncestor_0.Packages;
local v2 = require(l_Packages_0.Roact);
local v3 = require(l_Packages_0.RoactRodux);
local v4 = require(l_Packages_0.Cryo);
local v5 = require(l_Packages_0.Framework);
local _ = v5.Util.deepCopy;
local l_deepEqual_0 = v5.Util.deepEqual;
local v8 = require(l_script_FirstAncestor_0.Core.Components.AssetConfiguration.VersionItem);
local l_Util_0 = l_script_FirstAncestor_0.Core.Util;
local v10 = require(l_Util_0.Constants);
local _ = v5.Dash.slice;
local l_ContextServices_0 = v5.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local v14 = require(l_script_FirstAncestor_0.Core.ContextServices.NetworkContext);
local v15 = require(l_script_FirstAncestor_0.Core.Components.AssetConfiguration.Permissions.PermissionsConstants);
local l_Requests_0 = l_script_FirstAncestor_0.Core.Networking.Requests;
local v17 = require(l_Requests_0.GetVersionsHistoryRequest);
local v18 = require(l_Requests_0.MakeChangeRequest);
local v19 = require(script.Parent.VersionsTableCell);
local l_UI_0 = v5.UI;
local l_PaginatedTable_0 = l_UI_0.PaginatedTable;
local l_Container_0 = l_UI_0.Container;
local l_LoadingIndicator_0 = l_UI_0.LoadingIndicator;
local l_ScrollingFrame_0 = l_UI_0.ScrollingFrame;
local v25 = require(l_Util_0.AssetConfigConstants);
local v26 = require(l_script_FirstAncestor_0.Core.Actions.SetFieldError);
local v27 = v2.PureComponent:extend("Versions");
local v28 = require(l_script_FirstAncestor_0.Core.Flags.getFFlagToolboxAddPackageVersionDescriptions);
local function v31(v29, v30)
    v29.IsCurrent = v30;
    v29.DividerAnchorPoint = Vector2.new(0.5, 1);
    if not v30 then
        v29.DividerPosition = UDim2.new(0.5, 40, 1, 0);
        v29.DividerSize = UDim2.new(1, -120, 0, 1);
    else
        v29.DividerPosition = UDim2.new(0.5, 0, 1, 0);
        v29.DividerSize = UDim2.new(1, -30, 0, 1);
    end;
    return v2.createElement(v8, v29);
end;
local function v33(v32)
    return v31(v32, true);
end;
local function v35(v34)
    return v31(v34, false);
end;
v27.init = function(v36, v37)
    local v38 = 0;
    if not (not v37.changeTable or not v37.changeTable.VersionItemSelect) then
        v38 = if not v28() then v37.changeTable.VersionItemSelect else v37.changeTable.VersionItemSelect[1];
    end;
    if not v28() then
        v36.state = {
            currentItem = {},
            selectVersion = v38
        };
    else
        v36.state = {
            selectVersion = v38,
            creatorIdsToUsernames = {},
            loadingDescriptions = true
        };
    end;
    v36.OnItemClicked = function(v39)
        local l_selectVersion_0 = v36.state.selectVersion;
        local v41 = nil;
        if not v28() then
            v41 = v39.assetVersionNumber;
            if l_selectVersion_0 == v39.assetVersionNumber then
                v41 = nil;
            end;
        else
            v41 = v39;
            if l_selectVersion_0 == v39 then
                v41 = nil;
            end;
        end;
        if not v41 then
            if not v28() then
                v36.props.makeChangeRequest("VersionItemSelect", v41, v41);
            else
                v36.props.makeChangeRequest("VersionItemSelect", {
                    v41,
                    v36.props.currentItem.assetVersionNumber
                }, {
                    v41,
                    v36.props.currentItem.assetVersionNumber
                });
            end;
            v36:setState({
                selectVersion = 0
            });
            return ;
        else
            if not v28() then
                v36.props.makeChangeRequest("VersionItemSelect", l_selectVersion_0, v41);
            else
                v36.props.makeChangeRequest("VersionItemSelect", {
                    l_selectVersion_0,
                    v36.props.currentItem.assetVersionNumber
                }, {
                    v41,
                    v36.props.currentItem.assetVersionNumber
                });
            end;
            v36:setState({
                selectVersion = v41
            });
            return ;
        end;
    end;
    v36.GetRowHeight = function(v42, v43)
        if v42.versionColumn == v36.props.openInputKey then
            return v10.VERSIONS_INPUT_ROW_HEIGHT;
        elseif not v42.descriptionColumn.versionDescription then
            return v43;
        else
            local v44 = math.ceil(string.len(v42.descriptionColumn.versionDescription) / v10.VERSIONS_CHARS_PER_LINE) - 1;
            if v44 > 0 then
                return v43 + v44 * v10.VERSIONS_LINE_HEIGHT;
            else
                return v43;
            end;
        end;
    end;
    v36.OnPageChange = function(v45)
        v36.props.onPageChange(v45, v10.VERSIONS_ROWS_PER_PAGE);
    end;
end;
v27.didMount = function(v46)
    if not (v28() or not v46.props.assetId) then
        v46.props.getVersionsHistory(v46.props.Network.networkInterface, v46.props.assetId);
    end;
    if v28() then
        local v47 = {};
        if v46.props.versionHistory then
            local _ = {};
            for _, v50 in ipairs(v46.props.versionHistory) do
                local v51 = nil;
                if v47[v50.creatorTargetId] then
                    v51 = v47[v50.creatorTargetId];
                else
                    local l_owner_0 = v46.props.owner;
                    if (l_owner_0 and l_owner_0.targetId == v50.creatorTargetId) and Enum.CreatorType[l_owner_0.type] == Enum.CreatorType.User then
                        v51 = l_owner_0.username;
                    elseif not (not ((l_owner_0 and l_owner_0.targetId == v50.creatorTargetId) and Enum.CreatorType[l_owner_0.type] == Enum.CreatorType.Group) or not v46.props.assetGroupData) then
                        v51 = v46.props.assetGroupData.Name;
                    end;
                    if not (((v51 or not v46.props.permissions[v15.UserSubjectKey]) or not v46.props.permissions[v15.UserSubjectKey][tostring(v50.creatorTargetId)]) or not v46.props.permissions[v15.UserSubjectKey][tostring(v50.creatorTargetId)][v15.SubjectNameKey]) then
                        v51 = v46.props.permissions[v15.UserSubjectKey][tostring(v50.creatorTargetId)][v15.SubjectNameKey];
                    end;
                    v47[v50.creatorTargetId] = v51;
                end;
            end;
            v46:setState({
                creatorIdsToUsernames = v47
            });
        end;
    end;
end;
local function v54(v53)
    if v28() then
        return ;
    else
        return v4.Dictionary.join({}, v53[1] or {});
    end;
end;
local function _(v55, v56)
    for v57 = #v56 + 2, #v55 do
        v56[v57 - 1] = v55[v57];
    end;
end;
v27.createVersionsContent = function(v59, v60, v61)
    local l_props_0 = v59.props;
    local l_state_0 = v59.state;
    local l_versions_0 = v59.props.Stylizer.versions;
    return v2.createElement("Frame", {
        Size = UDim2.new(1, 0, 0, 0),
        AutomaticSize = Enum.AutomaticSize.Y,
        BackgroundTransparency = 1,
        BorderSizePixel = 0
    }, {
        UIListLayout = v2.createElement("UIListLayout", {
            FillDirection = Enum.FillDirection.Vertical,
            HorizontalAlignment = Enum.HorizontalAlignment.Left,
            VerticalAlignment = Enum.VerticalAlignment.Top,
            SortOrder = Enum.SortOrder.LayoutOrder,
            Padding = UDim.new(0, 20)
        }),
        Title = v2.createElement("Frame", {
            Size = UDim2.new(1, 0, 0, v10.VERSIONS_TITLE_HEIGHT),
            BackgroundTransparency = 1,
            BorderSizePixel = 0,
            LayoutOrder = 1
        }, {
            VersionsLabel = v2.createElement("TextLabel", {
                Position = UDim2.new(0, 15, 0, 15),
                Size = UDim2.new(0, 50, 0, v10.VERSIONS_TITLE_HEIGHT),
                BackgroundTransparency = 1,
                BorderSizePixel = 0,
                Text = l_props_0.Localization:getText("AssetConfigVersions", "VersionHistory"),
                TextColor3 = l_versions_0.textColor,
                Font = v10.FONT_BOLD,
                TextSize = v10.FONT_SIZE_TITLE,
                TextXAlignment = Enum.TextXAlignment.Left
            })
        }),
        PreviousVersion = v2.createElement("Frame", {
            Size = UDim2.new(1, 0, 0, v10.VERSIONS_TITLE_HEIGHT),
            BackgroundTransparency = 1,
            BorderSizePixel = 0,
            LayoutOrder = 3
        }, {
            VersionsLabel = v2.createElement("TextLabel", {
                Position = UDim2.new(0, 15, 0, -10),
                Size = UDim2.new(0, 50, 0, v10.VERSIONS_TITLE_HEIGHT),
                BackgroundTransparency = 1,
                BorderSizePixel = 0,
                Text = l_props_0.Localization:getText("AssetConfigVersions", "AddANote"),
                TextColor3 = l_versions_0.dimmedTextColor,
                Font = v10.FONT,
                TextSize = v10.FONT_SIZE_LARGE,
                TextXAlignment = Enum.TextXAlignment.Left
            })
        }),
        ItemsTable = l_props_0.versionHistory and v2.createElement("Frame", {
            Size = UDim2.new(0.9, 0, 0, 0),
            AutomaticSize = Enum.AutomaticSize.Y,
            BackgroundTransparency = 1,
            BorderSizePixel = 0,
            LayoutOrder = 4
        }, {
            VersionsTable = if not not l_state_0.loadingDescriptions and v28() then v2.createElement(l_Container_0, {
                Size = UDim2.new(1, 0, 0.5, 0)
            }, {
                LoadingIndicator = v2.createElement(l_LoadingIndicator_0, {
                    Size = UDim2.new(0, 40, 0, 40),
                    AnchorPoint = Vector2.new(0.5, 0.5),
                    Position = UDim2.fromScale(0.5, 0.5)
                })
            }) else v2.createElement(l_PaginatedTable_0, {
                Size = UDim2.new(1, 0, 0, 0),
                AutomaticSize = Enum.AutomaticSize.Y,
                Position = UDim2.new(0, 15, 0, -20),
                Columns = v61,
                Rows = l_props_0.pageRootItems,
                CellComponent = v19.Component,
                CellProps = {
                    Theme = l_versions_0,
                    CurrentVersion = v60.assetVersionNumber,
                    SelectVersion = l_state_0.selectVersion,
                    OnClickItem = v59.OnItemClicked,
                    IdsToUsernames = l_state_0.creatorIdsToUsernames,
                    OpenInputKey = l_props_0.openInputKey,
                    OnClickDesc = l_props_0.onDescClicked,
                    PreviousInput = l_props_0.previousInput,
                    SetPreviousInput = l_props_0.setPreviousInput,
                    CloseInput = l_props_0.closeInput,
                    SetVersionError = l_props_0.setVersionError,
                    ErrorCallback = function(v65)
                        v59.props.setFieldError(v25.FIELD_NAMES.Title, v65);
                    end
                },
                RowHeight = v10.VERSIONS_ROW_HEIGHT,
                GetRowHeight = v59.GetRowHeight,
                PageSize = v10.VERSIONS_ROWS_PER_PAGE,
                PageIndex = l_props_0.pageIndex,
                PageCount = math.ceil(#l_props_0.rootItems / v10.VERSIONS_ROWS_PER_PAGE),
                OnPageChange = v59.OnPageChange,
                Footer = true
            })
        })
    });
end;
v27.didUpdate = function(v66, v67, v68)
    if not v28() then
        local l_currentItem_0 = v68.currentItem;
        local l_versionHistory_0 = v66.props.versionHistory;
        if not (next(l_currentItem_0) or not l_versionHistory_0) then
            v66:setState({
                currentItem = v54(l_versionHistory_0)
            });
        end;
    end;
    if v28() then
        local l_packageDescriptions_0 = v66.props.packageDescriptions;
        local l_packageDescriptions_1 = v67.packageDescriptions;
        if not ((not l_packageDescriptions_0 or not v66.props.rootItems) or l_deepEqual_0(l_packageDescriptions_1, v66.props.packageDescriptions) and (not v66.props.rootItems[1] or v66.props.rootItems[1].descriptionColumn.versionDescription)) then
            local l_rootItems_0 = v66.props.rootItems;
            for v74, v75 in pairs(l_packageDescriptions_0) do
                if l_rootItems_0[v74] then
                    l_rootItems_0[v74].descriptionColumn.versionDescription = v75;
                end;
            end;
            v66.props.setStates(l_rootItems_0);
        end;
        v66:setState({
            loadingDescriptions = false
        });
    end;
end;
local function v81(v76)
    local v77 = {
        UIListLayout = v2.createElement("UIListLayout", {
            FillDirection = Enum.FillDirection.Vertical,
            HorizontalAlignment = Enum.HorizontalAlignment.Left,
            VerticalAlignment = Enum.VerticalAlignment.Top,
            SortOrder = Enum.SortOrder.LayoutOrder,
            Padding = UDim.new(0, 20)
        })
    };
    local l_ItemListInfo_0 = v76.ItemListInfo;
    for v79 = 2, #l_ItemListInfo_0 do
        local v80 = l_ItemListInfo_0[v79];
        v77[v80.assetVersionNumber] = v2.createElement(v35, {
            ItemInfo = v80,
            Size = v76.ItemSize,
            SelectVersion = v76.SelectVersion,
            ItemClickCallBack = v76.ItemClickCallBack,
            LayoutOrder = v79 - 1
        });
    end;
    return v2.createElement("Frame", {
        Size = v76.Size,
        BackgroundTransparency = 1,
        BorderSizePixel = 0,
        LayoutOrder = v76.LayoutOrder
    }, v77);
end;
v27.render = function(v82)
    local l_props_1 = v82.props;
    local l_state_1 = v82.state;
    local l_versions_1 = l_props_1.Stylizer.versions;
    local l_LayoutOrder_0 = l_props_1.LayoutOrder;
    local l_Size_0 = l_props_1.Size;
    local l_versionHistory_1 = l_props_1.versionHistory;
    local v89 = nil;
    v89 = if not v28() then l_state_1.currentItem else l_props_1.currentItem;
    local l_selectVersion_1 = l_state_1.selectVersion;
    local v91 = {
        [1] = "versionColumn",
        [2] = "descriptionColumn",
        [3] = "restoreColumn"
    };
    local v92 = {
        UDim.new(0.14, 0),
        UDim.new(0.76, 0),
        UDim.new(0.1, 0)
    };
    local v93 = {
        {
            Name = l_props_1.Localization:getText("AssetConfigVersions", "Version"),
            Key = v91[1],
            Width = v92[1]
        },
        {
            Name = l_props_1.Localization:getText("AssetConfigVersions", "Notes"),
            Key = v91[2],
            Width = v92[2]
        },
        {
            Name = l_props_1.Localization:getText("AssetConfigVersions", "RestoreLabel"),
            Key = v91[3],
            Width = v92[3]
        }
    };
    if not v28() then
        return v2.createElement("ScrollingFrame", {
            BackgroundTransparency = 1,
            BorderSizePixel = 0,
            CanvasSize = not not l_versionHistory_1 and UDim2.new(0, 0, 1, #l_versionHistory_1 * v10.VERSIONS_ITEM_HEIGHT) or nil,
            LayoutOrder = l_LayoutOrder_0,
            ScrollBarImageColor3 = l_versions_1.textColor,
            Size = l_Size_0
        }, {
            UIListLayout = v2.createElement("UIListLayout", {
                FillDirection = Enum.FillDirection.Vertical,
                HorizontalAlignment = Enum.HorizontalAlignment.Left,
                VerticalAlignment = Enum.VerticalAlignment.Top,
                SortOrder = Enum.SortOrder.LayoutOrder,
                Padding = UDim.new(0, 20)
            }),
            Title = v2.createElement("Frame", {
                Size = UDim2.new(1, 0, 0, v10.VERSIONS_TITLE_HEIGHT),
                BackgroundTransparency = 1,
                BorderSizePixel = 0,
                LayoutOrder = 1
            }, {
                VersionsLabel = v2.createElement("TextLabel", {
                    Position = UDim2.new(0, 10, 0, 0),
                    Size = UDim2.new(0, 50, 0, v10.VERSIONS_TITLE_HEIGHT),
                    BackgroundTransparency = 1,
                    BorderSizePixel = 0,
                    Text = l_props_1.Localization:getText("AssetConfigVersions", "Current"),
                    TextColor3 = l_versions_1.textColor,
                    Font = v10.FONT_BOLD,
                    TextSize = v10.FONT_SIZE_TITLE,
                    TextXAlignment = Enum.TextXAlignment.Left
                })
            }),
            CurrentItem = next(v89) and v2.createElement(v33, {
                Size = UDim2.new(1, 0, 0, v10.VERSIONS_ITEM_HEIGHT),
                ItemInfo = v89,
                LayoutOrder = 2
            }),
            PreviousVersion = v2.createElement("Frame", {
                Size = UDim2.new(1, 0, 0, v10.VERSIONS_TITLE_HEIGHT),
                BackgroundTransparency = 1,
                BorderSizePixel = 0,
                LayoutOrder = 3
            }, {
                VersionsLabel = v2.createElement("TextLabel", {
                    Position = UDim2.new(0, 10, 0, 0),
                    Size = UDim2.new(0, 50, 0, v10.VERSIONS_TITLE_HEIGHT),
                    BackgroundTransparency = 1,
                    BorderSizePixel = 0,
                    Text = l_props_1.Localization:getText("AssetConfigVersions", "Restore"),
                    TextColor3 = l_versions_1.textColor,
                    Font = v10.FONT_BOLD,
                    TextSize = v10.FONT_SIZE_TITLE,
                    TextXAlignment = Enum.TextXAlignment.Left
                })
            }),
            ItemList = l_versionHistory_1 and v2.createElement(v81, {
                Size = UDim2.new(1, 0, 1, -v10.VERSIONS_TITLE_HEIGHT * 2 - v10.VERSIONS_ITEM_HEIGHT),
                SelectVersion = l_selectVersion_1,
                ItemSize = UDim2.new(1, 0, 0, v10.VERSIONS_ITEM_HEIGHT),
                ItemListInfo = l_versionHistory_1,
                ItemClickCallBack = v82.OnItemClicked,
                LayoutOrder = 4
            })
        });
    else
        return v2.createElement(l_ScrollingFrame_0, {
            BackgroundTransparency = 1,
            BorderSizePixel = 0,
            LayoutOrder = l_LayoutOrder_0,
            ScrollBarImageColor3 = l_versions_1.dimmedTextColor,
            Size = l_Size_0
        }, {
            VersionsContent = if l_props_1.openInputKey ~= -1 then v2.createElement("ImageButton", {
                Size = UDim2.new(1, 0, 1, 0),
                BackgroundTransparency = 1,
                [v2.Event.Activated] = function()
                    l_props_1.closeInput(false);
                end
            }, {
                Content = v82:createVersionsContent(v89, v93)
            }) else v82:createVersionsContent(v89, v93)
        });
    end;
end;
return v3.connect(function(v94, v95)
    v94 = v94 or {};
    local l_versionHistory_2 = v94.versionHistory;
    local l_packageDescriptions_2 = v94.packageDescriptions;
    local l_changed_0 = v94.changed;
    local v99 = v94.collaborators or {};
    local v100 = not not v94.assetConfigData and v94.assetConfigData.Creator or v95.Owner;
    local v101 = (v100 and v94[v100.targetId]) and v94[v100.targetId].groupMetadata;
    if not v28() then
        return {
            versionHistory = l_versionHistory_2,
            changeTable = l_changed_0
        };
    else
        return {
            packageDescriptions = l_packageDescriptions_2,
            changeTable = l_changed_0,
            permissions = v99,
            owner = v100,
            assetGroupData = v101
        };
    end;
end, function(v102)
    return {
        getVersionsHistory = function(v103, v104)
            v102(v17(v103, v104));
        end,
        makeChangeRequest = function(v105, v106, v107)
            v102(v18(v105, v106, v107));
        end,
        setFieldError = function(v108, v109)
            v102(v26(v25.SIDE_TABS.Versions, v108, v109));
        end
    };
end)((l_withContext_0({
    Stylizer = l_ContextServices_0.Stylizer,
    Localization = l_ContextServices_0.Localization,
    Network = v14
})(v27)));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("Toolbox");
local l_Packages_0 = l_script_FirstAncestor_0.Packages;
local v2 = require(l_Packages_0.Roact);
local v3 = require(l_Packages_0.Framework);
local l_ContextServices_0 = v3.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_formatLocalDateTime_0 = v3.Util.formatLocalDateTime;
local v7 = require(l_script_FirstAncestor_0.Core.Util.LayoutOrderIterator);
local l_Util_0 = l_script_FirstAncestor_0.Core.Util;
local _ = v3.Util.StyleModifier;
local v10 = require(l_Util_0.Constants);
local v11 = require(l_Util_0.AssetConfigConstants);
local l_StyleModifier_1 = v3.Util.StyleModifier;
local l_UI_0 = v3.UI;
local l_Pane_0 = l_UI_0.Pane;
local l_LinkText_0 = l_UI_0.LinkText;
local l_Checkbox_0 = l_UI_0.Checkbox;
local l_TextInput_0 = l_UI_0.TextInput;
local l_Button_0 = l_UI_0.Button;
local v19 = v2.PureComponent:extend("VersionsTableCell");
local v20 = {
    Version = 1,
    Description = 2,
    Restore = 3
};
v19.init = function(v21)
    v21.state = {
        inputText = if v21.props.ColumnIndex == 2 and v21.props.Value.versionDescription then v21.props.Value.versionDescription else ""
    };
    v21.hasError = false;
    v21.onCheck = function(v22, v23, v24)
        local l_props_0 = v21.props;
        local l_OnClickItem_0 = l_props_0.CellProps.OnClickItem;
        if not v23 then
            if not v24 or not l_OnClickItem_0 then
                if not (not (l_props_0.CellProps.SelectVersion ~= v22) or not l_OnClickItem_0) then
                    l_OnClickItem_0(v22);
                end;
                return ;
            else
                l_OnClickItem_0(nil);
                return ;
            end;
        else
            return ;
        end;
    end;
    v21.onClickDesc = function(v27)
        local l_props_1 = v21.props;
        local l_OnClickDesc_0 = l_props_1.CellProps.OnClickDesc;
        v21:setState({
            inputText = if v21.props.ColumnIndex == 2 then v21.props.Value.versionDescription else ""
        });
        if not (not (l_props_1.CellProps.OpenInputKey ~= v27) or not l_OnClickDesc_0) then
            l_OnClickDesc_0(v27, l_props_1.CellProps.PreviousInput);
        end;
        l_props_1.CellProps.SetPreviousInput(v21.state.inputText);
    end;
    v21.onClickOut = function()
        local l_OnClickDesc_1 = v21.props.CellProps.OnClickDesc;
        if l_OnClickDesc_1 then
            l_OnClickDesc_1(-1, v21.props.CellProps.PreviousInput);
        end;
    end;
    v21.onTextChanged = function(v31)
        v21:setState({
            inputText = v31
        });
        v21.props.CellProps.SetPreviousInput(v31);
    end;
end;
v19.createDescriptionComponent = function(v32)
    local l_props_2 = v32.props;
    local l_state_0 = v32.state;
    local v35 = l_props_2.Value.versionDescription and string.find(l_props_2.Value.versionDescription, "\n");
    local v36 = nil;
    local _ = v7.new();
    local v38 = l_state_0.inputText or "";
    if l_props_2.CellProps.ErrorCallback then
        if v11.PACKAGE_NOTE_CHARACTER_LIMIT < #v38 then
            if not v32.hasError then
                v32.hasError = true;
                l_props_2.CellProps.ErrorCallback(v32.hasError);
                l_props_2.CellProps.SetVersionError(l_props_2.Value.assetVersionNumber, v32.hasError);
            end;
        elseif v32.hasError then
            v32.hasError = false;
            l_props_2.CellProps.ErrorCallback(v32.hasError);
            l_props_2.CellProps.SetVersionError(l_props_2.Value.assetVersionNumber, v32.hasError);
        end;
    end;
    local v39 = v11.PACKAGE_NOTE_CHARACTER_LIMIT < #v38;
    if v35 then
        v36 = string.format("%s...", (string.sub(l_props_2.Value.versionDescription, 0, v35 - 1)));
    end;
    if l_props_2.CellProps.OpenInputKey == l_props_2.Value.assetVersionNumber then
        return (v2.createElement("Frame", {
            AutomaticSize = Enum.AutomaticSize.XY,
            Size = UDim2.new(1, 0, 0.9, 0),
            BackgroundTransparency = 1,
            BorderSizePixel = 0
        }, {
            InputBox = v2.createElement(l_TextInput_0, {
                Text = l_state_0.inputText or "",
                OnTextChanged = v32.onTextChanged,
                PlaceholderText = l_props_2.Localization:getText("AssetConfigVersions", "DescribeChanges"),
                MultiLine = true,
                Size = UDim2.fromScale(0.995, 0.85),
                Style = "BorderBox",
                StyleModifier = if not v39 then nil else l_StyleModifier_1.Error,
                MaxLength = v11.PACKAGE_NOTE_CHARACTER_LIMIT
            }),
            CounterText = v2.createElement("Frame", {
                BorderSizePixel = 0,
                BackgroundTransparency = 1,
                Size = UDim2.new(0.995, 0, 1, 0)
            }, {
                UIListLayout = v2.createElement("UIListLayout", {
                    FillDirection = Enum.FillDirection.Horizontal,
                    HorizontalAlignment = Enum.HorizontalAlignment.Right,
                    VerticalAlignment = Enum.VerticalAlignment.Bottom,
                    SortOrder = Enum.SortOrder.LayoutOrder,
                    Padding = UDim.new(0, 5)
                }),
                DiscardButton = v2.createElement(l_Button_0, {
                    BorderSizePixel = 0,
                    Text = l_props_2.Localization:getText("General", "Discard"),
                    Size = UDim2.fromScale(0.125, 0.125),
                    TextSize = v10.FONT_SIZE_LARGE,
                    BackgroundTransparency = 1,
                    Font = v10.FONT,
                    Style = "Round",
                    OnClick = function()
                        l_props_2.CellProps.CloseInput(true);
                    end
                }),
                SubmitButton = v2.createElement(l_Button_0, {
                    BorderSizePixel = 0,
                    Text = l_props_2.Localization:getText("Common", "Submit"),
                    Size = UDim2.fromScale(0.125, 0.125),
                    TextSize = v10.FONT_SIZE_LARGE,
                    BackgroundTransparency = 1,
                    Font = v10.FONT,
                    Style = "RoundPrimary",
                    StyleModifier = not not v39 and l_StyleModifier_1.Disabled or nil,
                    OnClick = function()
                        l_props_2.CellProps.CloseInput(false);
                    end
                })
            })
        }));
    elseif l_props_2.Value.versionDescription ~= "" and l_props_2.Value.versionDescription then
        return (v2.createElement(l_LinkText_0, {
            Style = {
                Font = v10.FONT,
                TextSize = v10.FONT_SIZE_LARGE,
                TextColor = if not v39 then l_props_2.CellProps.Theme.textColor else l_props_2.CellProps.Theme.errorColor
            },
            Text = if not v35 then l_props_2.Value.versionDescription else v36,
            TextWrapped = not v35 and true or nil,
            Position = UDim2.new(0, 2, 0, 1),
            TextXAlignment = Enum.TextXAlignment.Left,
            TextYAlignment = Enum.TextYAlignment.Top,
            OnClick = function()
                v32.onClickDesc(l_props_2.Value.assetVersionNumber);
            end
        }));
    else
        return (v2.createElement(l_LinkText_0, {
            Style = {
                Font = v10.FONT,
                TextSize = v10.FONT_SIZE_LARGE,
                ForceUnderline = true,
                ShowUnderline = true,
                TextColor = l_props_2.CellProps.Theme.textColor
            },
            Text = l_props_2.Localization:getText("AssetConfigVersions", "AddNote"),
            Position = UDim2.new(0, 2, 0, 5),
            OnClick = function()
                v32.onClickDesc(l_props_2.Value.assetVersionNumber);
            end
        }));
    end;
end;
v19.render = function(v40)
    local l_props_3 = v40.props;
    local l_Value_0 = l_props_3.Value;
    local l_Style_0 = l_props_3.Style;
    local v44 = l_props_3.Width or UDim.new(1 / #l_props_3.Columns, 0);
    local l_Theme_0 = l_props_3.CellProps.Theme;
    local l_CurrentVersion_0 = l_props_3.CellProps.CurrentVersion;
    local l_SelectVersion_0 = l_props_3.CellProps.SelectVersion;
    local l_OpenInputKey_0 = l_props_3.CellProps.OpenInputKey;
    local l_BackgroundOdd_0 = l_Style_0.BackgroundOdd;
    local l_IdsToUsernames_0 = l_props_3.CellProps.IdsToUsernames;
    local v51 = v7.new();
    local v52 = nil;
    v52 = if typeof(l_Value_0) == "number" and math.floor(l_Value_0) ~= l_Value_0 then ("%.3f"):format(l_Value_0) else tostring(l_Value_0);
    if l_props_3.ColumnIndex == v20.Version then
        local v53 = l_Value_0 == l_CurrentVersion_0;
        if l_OpenInputKey_0 ~= -1 then
            return v2.createElement(l_Pane_0, {
                LayoutOrder = l_props_3.ColumnIndex,
                Padding = 5,
                Style = "Box",
                BackgroundColor3 = l_BackgroundOdd_0,
                BorderSizePixel = 1,
                BorderColor3 = l_Style_0.Border,
                Size = UDim2.new(v44.Scale, v44.Offset, 1, 0),
                ClipsDescendants = true
            }, {
                Container = v2.createElement("ImageButton", {
                    Size = UDim2.new(1, 0, 1, 0),
                    BackgroundTransparency = 1,
                    [v2.Event.Activated] = v40.onClickOut
                }, {
                    TextFrame = v2.createElement("Frame", {
                        BackgroundTransparency = 1,
                        BorderSizePixel = 0,
                        LayoutOrder = v51:getNextOrder()
                    }, {
                        Text = v2.createElement("TextLabel", {
                            BackgroundTransparency = 1,
                            BorderSizePixel = 0,
                            Text = if not v53 then v52 else string.format("%s (%s)", v52, l_props_3.Localization:getText("AssetConfigVersions", "CurrentLabel")),
                            TextColor3 = l_Theme_0.textColor,
                            Font = v10.FONT,
                            TextSize = v10.FONT_SIZE_LARGE,
                            Position = UDim2.new(0, 2, 0, 2),
                            TextXAlignment = Enum.TextXAlignment.Left,
                            TextYAlignment = Enum.TextYAlignment.Top
                        })
                    })
                })
            });
        else
            return v2.createElement(l_Pane_0, {
                LayoutOrder = l_props_3.ColumnIndex,
                Padding = 5,
                Style = "Box",
                BackgroundColor3 = l_BackgroundOdd_0,
                BorderSizePixel = 1,
                BorderColor3 = l_Style_0.Border,
                Size = UDim2.new(v44.Scale, v44.Offset, 1, 0),
                ClipsDescendants = true
            }, {
                TextFrame = v2.createElement("Frame", {
                    BackgroundTransparency = 1,
                    BorderSizePixel = 0,
                    LayoutOrder = v51:getNextOrder()
                }, {
                    Text = v2.createElement("TextLabel", {
                        BackgroundTransparency = 1,
                        BorderSizePixel = 0,
                        Text = if not v53 then v52 else string.format("%s (%s)", v52, l_props_3.Localization:getText("AssetConfigVersions", "CurrentLabel")),
                        TextColor3 = l_Theme_0.textColor,
                        Font = v10.FONT,
                        TextSize = v10.FONT_SIZE_LARGE,
                        Position = UDim2.new(0, 2, 0, 2),
                        TextXAlignment = Enum.TextXAlignment.Left,
                        TextYAlignment = Enum.TextYAlignment.Top
                    })
                })
            });
        end;
    elseif l_props_3.ColumnIndex == v20.Description then
        local v54 = l_formatLocalDateTime_0(l_Value_0.created, "L LTS", l_props_3.Localization:getLocale());
        local v55 = l_IdsToUsernames_0[l_Value_0.creatorId];
        local _ = nil;
        return v2.createElement(l_Pane_0, {
            LayoutOrder = l_props_3.ColumnIndex,
            Padding = 5,
            Style = "Box",
            BackgroundColor3 = l_BackgroundOdd_0,
            BorderSizePixel = 1,
            BorderColor3 = l_Style_0.Border,
            Size = UDim2.new(v44.Scale, v44.Offset, 1, 0),
            ClipsDescendants = true
        }, {
            UIListLayout = v2.createElement("UIListLayout", {
                FillDirection = Enum.FillDirection.Vertical,
                HorizontalAlignment = Enum.HorizontalAlignment.Left,
                VerticalAlignment = Enum.VerticalAlignment.Top,
                SortOrder = Enum.SortOrder.LayoutOrder
            }),
            CreatedFrame = v2.createElement("Frame", {
                BackgroundTransparency = 1,
                BorderSizePixel = 0,
                LayoutOrder = v51:getNextOrder(),
                AutomaticSize = Enum.AutomaticSize.XY
            }, {
                Created = v2.createElement("TextLabel", {
                    BorderSizePixel = 0,
                    RichText = true,
                    Text = if not v55 then if Enum.CreatorType[l_Value_0.creatorType] == Enum.CreatorType.User then string.format("%s   \226\128\162   <i>%s</i>", v54, l_props_3.Localization:getText("AssetConfigVersions", "RevokedUser")) else v54 else string.format("%s   \226\128\162   %s", v54, v55),
                    BackgroundTransparency = 1,
                    AutomaticSize = Enum.AutomaticSize.XY,
                    TextTruncate = Enum.TextTruncate.AtEnd,
                    TextColor3 = l_Theme_0.dimmedTextColor,
                    Font = v10.FONT,
                    TextSize = v10.FONT_SIZE_LARGE,
                    TextXAlignment = Enum.TextXAlignment.Left,
                    TextYAlignment = Enum.TextYAlignment.Top,
                    Position = UDim2.new(0, 2, 0, 2)
                })
            }),
            DescriptionFrame = v2.createElement("Frame", {
                BackgroundTransparency = 1,
                BorderSizePixel = 0,
                LayoutOrder = v51:getNextOrder(),
                Size = UDim2.new(1, 0, 0.9, 0)
            }, {
                Container = if l_OpenInputKey_0 ~= -1 then v2.createElement("ImageButton", {
                    Size = UDim2.new(1, 0, 1, 0),
                    AutomaticSize = Enum.AutomaticSize.XY,
                    BackgroundTransparency = 1,
                    [v2.Event.Activated] = v40.onClickOut
                }, {
                    DescriptionComponent = v40:createDescriptionComponent()
                }) else v40:createDescriptionComponent()
            })
        });
    elseif l_props_3.ColumnIndex == v20.Restore then
        local v57 = l_SelectVersion_0 == l_Value_0;
        local v58 = l_Value_0 == l_CurrentVersion_0;
        return v2.createElement(l_Pane_0, {
            LayoutOrder = l_props_3.ColumnIndex,
            Padding = 5,
            Style = "Box",
            BackgroundColor3 = l_BackgroundOdd_0,
            BorderSizePixel = 1,
            BorderColor3 = l_Style_0.Border,
            Size = UDim2.new(v44.Scale, v44.Offset, 1, 0),
            ClipsDescendants = true,
            Layout = Enum.FillDirection.Vertical
        }, {
            CheckboxContainer = if l_OpenInputKey_0 ~= -1 then v2.createElement("ImageButton", {
                Size = UDim2.new(1, 0, 1, 0),
                BackgroundTransparency = 1,
                [v2.Event.Activated] = v40.onClickOut
            }, {
                Pane = v2.createElement(l_Pane_0, {
                    LayoutOrder = l_props_3.ColumnIndex,
                    Size = UDim2.fromScale(1, 1),
                    ClipsDescendants = true,
                    Layout = Enum.FillDirection.Vertical
                }, {
                    Checkbox = v2.createElement(l_Checkbox_0, {
                        Key = v52,
                        Disabled = v58,
                        OnClick = function()
                            v40.onCheck(l_Value_0, v58, v57);
                        end,
                        Checked = v57
                    })
                })
            }) else v2.createElement(l_Checkbox_0, {
                Key = v52,
                Disabled = v58,
                OnClick = function()
                    v40.onCheck(l_Value_0, v58, v57);
                end,
                Checked = v57
            })
        });
    else
        return ;
    end;
end;
return {
    Enum = v20,
    Component = l_withContext_0({
        Localization = l_ContextServices_0.Localization
    })(v19)
};


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local l_Packages_0 = l_Parent_0.Packages;
local v2 = require(l_Packages_0.Framework);
local v3 = require(l_Packages_0.Roact);
local l_ContextServices_0 = v2.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_LayoutOrderIterator_0 = v2.Util.LayoutOrderIterator;
local l_UI_0 = v2.UI;
local l_Pane_0 = l_UI_0.Pane;
local l_StyledDialog_0 = l_UI_0.StyledDialog;
local l_TextLabel_0 = l_UI_0.TextLabel;
local v11 = require(l_Parent_0.Core.Util.Constants);
local v12 = require(l_Parent_0.Core.Util.Images);
local v13 = Vector2.new(400, 70);
local v14 = v3.PureComponent:extend("WarningDialog");
local v15 = {
    Accept = true,
    Cancel = false
};
v14.init = function(v16)
    v16.onButtonPressed = function(v17)
        local l_props_0 = v16.props;
        if v17 == v15.Accept then
            l_props_0.OnAccepted(l_props_0.ConfirmationKey);
            return ;
        else
            l_props_0.OnCanceled();
            return ;
        end;
    end;
end;
v14.render = function(v19)
    local l_props_1 = v19.props;
    local l_publishAsset_0 = l_props_1.Stylizer.publishAsset;
    local l_AcceptText_0 = l_props_1.AcceptText;
    local l_CancelText_0 = l_props_1.CancelText;
    local l_Description_0 = l_props_1.Description;
    local l_Enabled_0 = l_props_1.Enabled;
    local l_Heading_0 = l_props_1.Heading;
    local l_OnCanceled_0 = l_props_1.OnCanceled;
    local l_Title_0 = l_props_1.Title;
    local v29 = l_LayoutOrderIterator_0.new();
    return v3.createElement(l_StyledDialog_0, {
        Buttons = {
            {
                Key = v15.Cancel,
                Text = l_CancelText_0
            },
            {
                Key = v15.Accept,
                Text = l_AcceptText_0
            }
        },
        Enabled = l_Enabled_0 == true,
        FitTextButtonWidth = true,
        MinContentSize = v13,
        Modal = true,
        OnButtonPressed = v19.onButtonPressed,
        OnClose = l_OnCanceled_0,
        Style = "AssetConfigWarningDialog",
        Title = l_Title_0
    }, {
        Contents = v3.createElement(l_Pane_0, {
            HorizontalAlignment = Enum.HorizontalAlignment.Left,
            Layout = Enum.FillDirection.Horizontal,
            Spacing = 20,
            Size = UDim2.fromScale(1, 1)
        }, {
            Icon = v3.createElement("ImageLabel", {
                LayoutOrder = 1,
                BackgroundTransparency = 1,
                Image = v12.WARNING_ICON,
                ImageColor3 = l_publishAsset_0.warningIconColor,
                Size = UDim2.fromOffset(50, 50)
            }),
            RightContents = v3.createElement(l_Pane_0, {
                Layout = Enum.FillDirection.Vertical,
                LayoutOrder = 2,
                Spacing = 5,
                Size = UDim2.new(1, -50, 1, 0),
                VerticalAlignment = Enum.VerticalAlignment.Top
            }, {
                Heading = v3.createElement(l_TextLabel_0, {
                    AutomaticSize = Enum.AutomaticSize.Y,
                    LayoutOrder = v29:getNextOrder(),
                    Size = UDim2.new(1, 0, 0, 0),
                    Font = v11.FONT_BOLD,
                    Text = l_Heading_0,
                    TextWrapped = true,
                    TextXAlignment = Enum.TextXAlignment.Left
                }),
                Description = v3.createElement(l_TextLabel_0, {
                    AutomaticSize = Enum.AutomaticSize.Y,
                    LayoutOrder = v29:getNextOrder(),
                    Size = UDim2.new(1, 0, 0, 0),
                    Text = l_Description_0,
                    TextWrapped = true,
                    TextXAlignment = Enum.TextXAlignment.Left
                })
            })
        })
    });
end;
return (l_withContext_0({
    Stylizer = l_ContextServices_0.Stylizer
})(v14));