local l_Parent_0 = script.Parent.Parent;
local l_HttpService_0 = game:GetService("HttpService");
local l_Workspace_0 = game:GetService("Workspace");
local l_Players_0 = game:GetService("Players");
local v4 = require(l_Parent_0.Actions.SetPromptState);
local v5 = require(l_Parent_0.Actions.StartPurchase);
local v6 = require(l_Parent_0.Actions.ErrorOccurred);
local v7 = require(l_Parent_0.Enums.PurchaseFlow);
local v8 = require(l_Parent_0.Enums.PromptState);
local v9 = require(l_Parent_0.Enums.ItemType);
local v10 = require(l_Parent_0.Enums.PurchaseError);
local v11 = require(l_Parent_0.Network.getToolAsset);
local v12 = require(l_Parent_0.Network.performPurchase);
local v13 = require(l_Parent_0.Network.performPurchaseV2);
local v14 = require(l_Parent_0.Services.Network);
local v15 = require(l_Parent_0.Services.Analytics);
local v16 = require(l_Parent_0.Services.ExternalSettings);
local v17 = require(l_Parent_0.Utils.getPlayerPrice);
local v18 = require(l_Parent_0.Thunk);
local v19 = require(l_Parent_0.Promise);
local v20 = require(script.Parent.completePurchase);
local v21 = require(l_Parent_0.Parent.Flags.FFlagEnableCollectibleCheckToPurchaseItem);
local v22 = {
    v14,
    v15,
    v16
};
return function()
    return v18.new(script.Name, v22, function(v23, v24)
        local v25 = v24[v14];
        local v26 = v24[v16];
        local v27 = v24[v15];
        local l_purchaseFlow_0 = v23:getState().purchaseFlow;
        local v29 = v26.getPlatform();
        v23:dispatch(v5(l_Workspace_0.DistributedGameTime));
        if not (l_purchaseFlow_0 ~= v7.RobuxUpsellV2) or l_purchaseFlow_0 == v7.LargeRobuxUpsell then
            v23:dispatch(v4(v8.PurchaseInProgress));
        end;
        local v30 = v23:getState();
        local v31 = l_HttpService_0:GenerateGUID(false);
        local l_id_0 = v30.promptRequest.id;
        local l_infoType_0 = v30.promptRequest.infoType;
        local l_equipIfPurchased_0 = v30.promptRequest.equipIfPurchased;
        local l_isRobloxPurchase_0 = v30.promptRequest.isRobloxPurchase;
        local l_purchaseAuthToken_0 = v30.promptRequest.purchaseAuthToken;
        local l_idempotencyKey_0 = v30.promptRequest.idempotencyKey;
        local l_collectibleItemId_0 = v30.promptRequest.collectibleItemId;
        local l_collectibleItemInstanceId_0 = v30.promptRequest.collectibleItemInstanceId;
        local l_collectibleProductId_0 = v30.promptRequest.collectibleProductId;
        local l_expectedPrice_0 = v30.promptRequest.expectedPrice;
        local v42 = v17(v30.productInfo, v30.accountInfo.membershipType == 4);
        if l_collectibleItemInstanceId_0 and l_collectibleItemInstanceId_0 ~= "" then
            v42 = l_expectedPrice_0;
        end;
        local l_assetTypeId_0 = v30.productInfo.assetTypeId;
        local l_productId_0 = v30.productInfo.productId;
        local l_collectibleItemId_1 = v30.productInfo.collectibleItemId;
        local l_collectibleProductId_1 = v30.productInfo.collectibleProductId;
        local l_itemType_0 = v30.productInfo.itemType;
        v27.signalProductPurchaseConfirmed(l_productId_0, v30.requestType);
        local v48 = false;
        if v21 then
            local l_l_collectibleItemId_0_0 = l_collectibleItemId_0;
            if l_l_collectibleItemId_0_0 then
                l_l_collectibleItemId_0_0 = false;
                if l_collectibleItemId_0 ~= "" then
                    l_l_collectibleItemId_0_0 = l_infoType_0 == Enum.InfoType.Bundle;
                end;
            end;
            v48 = l_l_collectibleItemId_0_0;
        end;
        if v21 and v48 or l_collectibleItemInstanceId_0 and l_collectibleItemInstanceId_0 ~= "" then
            return v13(v25, l_infoType_0, l_productId_0, v42, v31, l_isRobloxPurchase_0, l_collectibleItemId_0, l_collectibleProductId_0, l_idempotencyKey_0, l_purchaseAuthToken_0, l_collectibleItemInstanceId_0):andThen(function(v50)
                v23:dispatch(v20());
                v27.signalPurchaseSuccess(l_id_0, l_infoType_0, v42, v50);
                return v19.resolve();
            end):catch(function(v51)
                if v51 == v10.TwoFactorNeeded then
                    v27.signalTwoSVSettingsErrorShown(l_productId_0, l_infoType_0);
                    if not (v29 ~= Enum.Platform.Windows) or v29 == Enum.Platform.OSX then
                        v51 = v10.TwoFactorNeededSettings;
                    end;
                end;
                v23:dispatch(v6(v51));
            end);
        else
            return v12(v25, l_infoType_0, l_productId_0, v42, v31, l_isRobloxPurchase_0, l_collectibleItemId_1, l_collectibleProductId_1, l_idempotencyKey_0, l_purchaseAuthToken_0):andThen(function(v52)
                v23:dispatch(v20());
                if l_itemType_0 ~= v9.Bundle then
                    v27.signalPurchaseSuccess(l_id_0, l_infoType_0, v42, v52);
                end;
                if l_equipIfPurchased_0 and l_assetTypeId_0 == 19 then
                    return v11(v25, l_id_0):andThen(function(v53)
                        if v53 then
                            v53.Parent = l_Players_0.LocalPlayer.Backpack;
                        end;
                    end);
                else
                    return v19.resolve();
                end;
            end):catch(function(v54)
                if v54 == v10.TwoFactorNeeded then
                    v27.signalTwoSVSettingsErrorShown(l_productId_0, l_infoType_0);
                    if not (v29 ~= Enum.Platform.Windows) or v29 == Enum.Platform.OSX then
                        v54 = v10.TwoFactorNeededSettings;
                    end;
                end;
                v23:dispatch(v6(v54));
            end);
        end;
    end);
end;


local l_Parent_0 = script.Parent.Parent;
local l_Players_0 = game:GetService("Players");
local v2 = require(l_Parent_0.Actions.SetPromptState);
local v3 = require(l_Parent_0.Actions.ErrorOccurred);
local v4 = require(l_Parent_0.Actions.PremiumInfoRecieved);
local v5 = require(l_Parent_0.Actions.AccountInfoReceived);
local v6 = require(l_Parent_0.Actions.BalanceInfoRecieved);
local v7 = require(l_Parent_0.Enums.PromptState);
local v8 = require(l_Parent_0.Enums.PurchaseError);
local v9 = require(l_Parent_0.Services.Analytics);
local v10 = require(l_Parent_0.Services.ExternalSettings);
local v11 = require(l_Parent_0.Services.Network);
local v12 = require(l_Parent_0.Network.postPremiumImpression);
local v13 = require(l_Parent_0.Thunks.completeRequest);
local v14 = require(l_Parent_0.Thunk);
local v15 = {
    v11,
    v10,
    v9
};
return function(v16, v17, v18, v19)
    return v14.new(script.Name, v15, function(v20, v21)
        local v22 = v21[v11];
        local v23 = v21[v10];
        local v24 = v21[v9];
        local v25 = v23.getPlatform();
        v20:dispatch(v4(v18));
        v20:dispatch(v5(v16));
        v20:dispatch(v6(v17));
        if v19 == false then
            v24.signalPremiumUpsellPrecheckFail();
            return v20:dispatch(v13());
        else
            if not v23.isStudio() then
                if v16.isPremium then
                    v24.signalPremiumUpsellShownPremium();
                    return v20:dispatch(v3(v8.AlreadyPremium));
                end;
            elseif l_Players_0.LocalPlayer.MembershipType == Enum.MembershipType.Premium then
                return v20:dispatch(v3(v8.AlreadyPremium));
            end;
            if v25 == Enum.Platform.XBoxOne then
                v24.signalPremiumUpsellInvalidPlatform();
                return v20:dispatch(v3(v8.PremiumUnavailablePlatform));
            elseif v18 == nil then
                v24.signalPremiumUpsellInvalidProducts();
                return v20:dispatch(v3(v8.PremiumUnavailable));
            else
                if not v23.isStudio() then
                    v24.signalPremiumUpsellShownNonPremium();
                    v12(v22);
                end;
                return v20:dispatch(v2(v7.PremiumUpsell));
            end;
        end;
    end);
end;


local l_Parent_0 = script.Parent.Parent;
local l_CorePackages_0 = game:GetService("CorePackages");
local l_UserInputService_0 = game:GetService("UserInputService");
local v3 = require(l_Parent_0.Actions.SetPurchaseFlow);
local v4 = require(l_Parent_0.Actions.SetPromptState);
local v5 = require(l_Parent_0.Actions.ProductInfoReceived);
local v6 = require(l_Parent_0.Actions.AccountInfoReceived);
local v7 = require(l_Parent_0.Actions.BalanceInfoRecieved);
local v8 = require(l_Parent_0.Actions.PromptNativeUpsell);
local v9 = require(l_Parent_0.Actions.ErrorOccurred);
local v10 = require(l_Parent_0.Actions.CompleteRequest);
local v11 = require(l_Parent_0.Enums.PurchaseFlow);
local v12 = require(l_Parent_0.Enums.PromptState);
local v13 = require(l_Parent_0.Enums.PurchaseError);
local v14 = require(l_Parent_0.Enums.PaymentPlatform);
local v15 = require(l_Parent_0.Enums.RequestType);
local _ = require(l_Parent_0.Models.RobuxUpsell);
local v17 = require(l_Parent_0.Network.getRobuxUpsellProduct);
local v18 = require(l_Parent_0.Services.ABTest);
local v19 = require(l_Parent_0.Services.Analytics);
local v20 = require(l_Parent_0.Services.ExternalSettings);
local v21 = require(l_Parent_0.Services.Network);
local v22 = require(l_Parent_0.Enums.Counter);
local v23 = require(l_Parent_0.Thunks.sendCounter);
local v24 = require(l_Parent_0.Utils.meetsPrerequisites);
local v25 = require(l_Parent_0.Utils.getPlayerProductInfoPrice);
local v26 = require(l_Parent_0.Utils.getPaymentPlatform);
local v27 = require(l_Parent_0.Utils.getPaymentFromPlatformLegacy);
local v28 = require(l_Parent_0.Utils.getHasAmazonUserAgent);
local v29 = require(l_Parent_0.Flags.GetFFlagEnableQuestPaymentPlatformType);
local v30 = require(l_Parent_0.Utils.hasPendingRequest);
local v31 = require(l_Parent_0.Thunk);
local v32 = require(l_Parent_0.Flags.GetFFlagEnableLuobuInGameUpsell);
local l_GetFStringLargerRobuxUpsellIxpLayer_0 = require(l_CorePackages_0.Workspace.Packages.SharedFlags).GetFStringLargerRobuxUpsellIxpLayer;
local v34 = require(l_Parent_0.Flags.LargerRobuxUpsellTest);
local v35 = {
    v18,
    v19,
    v20,
    v21
};
return function(v36, v37, v38, v39, v40, v41)
    return v31.new(script.Name, v35, function(v42, v43)
        local v44 = v42:getState();
        local v45 = v43[v18];
        local v46 = v43[v19];
        local v47 = v43[v20];
        local v48 = v43[v21];
        v42:dispatch(v5(v36));
        v42:dispatch(v6(v37));
        v42:dispatch(v7(v38));
        local v49, v50 = v24(v36, v39, (not v47.getFlagBypassThirdPartySettingForRobloxPurchase() or not v40) and (v47.getLuaUseThirdPartyPermissions() or v47.getFlagRestrictSales2()), v47, v41);
        if v49 then
            local l_robux_0 = v38.robux;
            local v52 = v25(v36, v37.isPremium);
            if v41 ~= nil then
                v52 = v41;
            end;
            local l_l_UserInputService_0_Platform_0 = l_UserInputService_0:GetPlatform();
            if l_robux_0 < v52 then
                if not v47.getFFlagDisableRobuxUpsell() then
                    local v54 = nil;
                    v54 = if not v29() then v27(l_l_UserInputService_0_Platform_0, v32(), (v28())) else v26(l_l_UserInputService_0_Platform_0);
                    if v54 ~= v14.Web then
                        v42:dispatch(v3(v11.RobuxUpsellV2));
                    end;
                    local _ = false;
                    if v34.isEnabled() then
                        local v56 = l_GetFStringLargerRobuxUpsellIxpLayer_0();
                        local v57 = v45.getLayerData(v56);
                        if v57 then
                            v45.logUserLayerExposure(v56);
                            if v34.isUserEnrolled(v57) then
                                v42:dispatch(v3(v11.LargeRobuxUpsell));
                            end;
                        end;
                    end;
                    return v17(v48, v52, l_robux_0, v54):andThen(function(v58)
                        if v30(v42:getState()) then
                            v46.signalProductPurchaseUpsellShown(v58.id, v44.requestType, v58.providerId);
                            v42:dispatch(v8(v58.providerId, v58.id, v58.robuxAmount));
                            v42:dispatch(v23(v22.UpsellModalShown));
                            return ;
                        else
                            return ;
                        end;
                    end, function()
                        if v30(v42:getState()) then
                            if v42:getState().purchaseFlow == v11.LargeRobuxUpsell then
                                v42:dispatch(v4(v12.LargeRobuxUpsell));
                                v42:dispatch(v23(v22.UpsellModalShown));
                                return ;
                            else
                                v42:dispatch(v9(v13.NotEnoughRobuxXbox));
                                v42:dispatch(v23(v22.UpsellGenericModalShown));
                                return ;
                            end;
                        else
                            return ;
                        end;
                    end);
                else
                    return v42:dispatch(v9(v13.NotEnoughRobuxNoUpsell));
                end;
            else
                if v44.requestType ~= v15.AvatarCreationFee then
                    v46.signalProductPurchaseShown(v36.productId, v44.requestType);
                end;
                return v42:dispatch(v4(v12.PromptPurchase));
            end;
        elseif not v47.isStudio() and v50 == v13.ThirdPartyDisabled then
            return v42:dispatch(v10());
        else
            return v42:dispatch(v9(v50));
        end;
    end);
end;


local l_Parent_0 = script.Parent.Parent;
local v1 = require(l_Parent_0.Actions.SetPromptState);
local v2 = require(l_Parent_0.Enums.PromptState);
local v3 = require(l_Parent_0.Enums.PurchaseWarning);
local v4 = require(l_Parent_0.Thunks.launchRobuxUpsell);
local v5 = require(l_Parent_0.Thunk);
return function(v6)
    return v5.new(script.Name, {}, function(v7, _)
        if v6 == v3.U13PaymentModal then
            return v7:dispatch(v1(v2.U13PaymentModal));
        elseif v6 == v3.U13MonthlyThreshold1Modal then
            return v7:dispatch(v1(v2.U13MonthlyThreshold1Modal));
        elseif v6 == v3.RequireEmailVerification then
            return v7:dispatch(v1(v2.RequireEmailVerification));
        elseif v6 == v3.U13MonthlyThreshold2Modal then
            return v7:dispatch(v1(v2.U13MonthlyThreshold2Modal));
        elseif v6 == v3.ParentalConsentWarningPaymentModal13To17 then
            return v7:dispatch(v1(v2.ParentalConsentWarningPaymentModal13To17));
        else
            return v7:dispatch(v4());
        end;
    end);
end;


local l_Parent_0 = script.Parent.Parent;
local v1 = require(l_Parent_0.Actions.SetPromptState);
local v2 = require(l_Parent_0.Actions.ErrorOccurred);
local v3 = require(l_Parent_0.Actions.SubscriptionPurchaseInfoReceived);
local v4 = require(l_Parent_0.Enums.PromptState);
local v5 = require(l_Parent_0.Enums.PurchaseError);
local v6 = require(l_Parent_0.Thunk);
return function(v7)
    return v6.new(script.Name, nil, function(v8, _)
        v8:dispatch(v3(v7));
        if v7.CanPurchase == false then
            return v8:dispatch(v2(v5.AlreadySubscribed));
        else
            return v8:dispatch(v1(v4.PromptSubscriptionPurchase));
        end;
    end);
end;


local l_Parent_0 = script.Parent.Parent;
local v1 = require(l_Parent_0.Actions.SetPromptState);
local v2 = require(l_Parent_0.Actions.BalanceInfoRecieved);
local v3 = require(l_Parent_0.Actions.PurchaseCompleteRecieved);
local v4 = require(l_Parent_0.Actions.ErrorOccurred);
local v5 = require(l_Parent_0.Actions.PromptNativeUpsell);
local v6 = require(l_Parent_0.Enums.PurchaseFlow);
local v7 = require(l_Parent_0.Enums.UpsellFlow);
local v8 = require(l_Parent_0.Enums.PurchaseError);
local v9 = require(l_Parent_0.Enums.PromptState);
local v10 = require(l_Parent_0.Enums.RequestType);
local v11 = require(l_Parent_0.Enums.Counter);
local v12 = require(l_Parent_0.Thunks.sendCounter);
local _ = require(l_Parent_0.Models.RobuxUpsell);
local v14 = require(l_Parent_0.Network.getRobuxUpsellProduct);
local v15 = require(l_Parent_0.Network.getBalanceInfo);
local v16 = require(l_Parent_0.Services.Network);
local v17 = require(l_Parent_0.Services.Analytics);
local v18 = require(l_Parent_0.Services.ExternalSettings);
local v19 = require(l_Parent_0.Thunks.completeRequest);
local v20 = require(l_Parent_0.Utils.getPlayerPrice);
local v21 = require(l_Parent_0.Utils.hasPendingRequest);
local v22 = require(l_Parent_0.Utils.getPaymentPlatform);
local v23 = require(l_Parent_0.NativeUpsell.getUpsellFlow);
local v24 = require(l_Parent_0.Thunk);
local v25 = require(script.Parent.purchaseItem);
local v26 = game:DefineFastInt("UpsellAccountBalanceRetryAttemps", 3);
local v27 = game:DefineFastInt("UpsellAccountBalanceRetryIntervalSec", 1);
local v28 = {
    v17,
    v16,
    v18
};
local function v29(v30)
    v30 = v30 or v26;
    return v24.new(script.Name, v28, function(v31, v32)
        local v33 = v32[v17];
        local v34 = v32[v16];
        local v35 = v32[v18];
        local v36 = v31:getState();
        local l_requestType_0 = v36.promptRequest.requestType;
        local l_promptState_0 = v36.promptState;
        local l_purchaseFlow_0 = v36.purchaseFlow;
        local v40 = v23(v35.getPlatform());
        if l_requestType_0 == v10.None then
            return ;
        elseif l_promptState_0 ~= v9.UpsellInProgress and l_promptState_0 ~= v9.PollingBalance then
            return ;
        elseif not (l_requestType_0 ~= v10.Premium) or l_requestType_0 == v10.Subscription then
            if l_promptState_0 == v9.UpsellInProgress then
                v31:dispatch(v3());
                v31:dispatch(v19());
                return ;
            else
                return ;
            end;
        else
            if not (l_purchaseFlow_0 ~= v6.RobuxUpsellV2) or l_purchaseFlow_0 == v6.LargeRobuxUpsell then
                v31:dispatch(v1(v9.PollingBalance));
            end;
            return v15(v34, v35):andThen(function(v41)
                local v42 = v31:getState();
                local v43 = v20(v42.productInfo, v42.accountInfo.membershipType == 4);
                if v21(v31:getState()) then
                    local l_balance_0 = v42.accountInfo.balance;
                    local l_robux_0 = v41.robux;
                    v31:dispatch(v2(v41));
                    if l_balance_0 ~= l_robux_0 then
                        if v43 ~= nil and l_robux_0 < v43 then
                            if l_purchaseFlow_0 == v6.LargeRobuxUpsell then
                                return v14(v34, v43, l_robux_0, (v22((v35.getPlatform())))):andThen(function(v46)
                                    if v21(v31:getState()) then
                                        v31:dispatch(v5(v46.providerId, v46.id, v46.robuxAmount));
                                        v31:dispatch(v12(v11.UpsellModalShownAgain));
                                        return ;
                                    else
                                        return ;
                                    end;
                                end, function()
                                    if v21(v31:getState()) then
                                        v31:dispatch(v1(v9.LargeRobuxUpsell));
                                        v31:dispatch(v12(v11.UpsellGenericModalShownAgain));
                                        return ;
                                    else
                                        return ;
                                    end;
                                end);
                            else
                                if v40 == v7.Web then
                                    v31:dispatch(v4(v8.InvalidFundsUnknown));
                                else
                                    v31:dispatch(v4(v8.InvalidFunds));
                                end;
                                v31:dispatch(v12(v11.UpsellFailedNotEnoughRobux));
                                return ;
                            end;
                        else
                            v31:dispatch(v25());
                            return ;
                        end;
                    elseif v30 > 0 then
                        delay(v27, function()
                            v31:dispatch(v29(v30 - 1));
                        end);
                        return ;
                    else
                        v33.signalFailedPurchasePostUpsell();
                        if v40 == v7.Web then
                            v31:dispatch(v4(v8.InvalidFundsUnknown));
                            return ;
                        else
                            v31:dispatch(v4(v8.InvalidFunds));
                            return ;
                        end;
                    end;
                else
                    return ;
                end;
            end):catch(function(v47)
                v31:dispatch(v4(v47));
            end);
        end;
    end);
end;
return v29;


local l_Parent_0 = script.Parent.Parent;
local v1 = require(l_Parent_0.Enums.Counter);
local v2 = require(l_Parent_0.Enums.PurchaseFlow);
local v3 = require(l_Parent_0.Enums.PaymentPlatform);
local v4 = require(l_Parent_0.Services.Analytics);
local v5 = require(l_Parent_0.Services.ExternalSettings);
local v6 = require(l_Parent_0.Utils.getPaymentPlatform);
local v7 = require(l_Parent_0.Utils.getCounterCombinations);
local v8 = require(l_Parent_0.Thunk);
local v9 = {
    v4,
    v5
};
return function(v10)
    return v8.new(script.Name, v9, function(v11, v12)
        local v13 = v12[v4];
        local v14 = v12[v5];
        local v15 = v1.toRawValue(v10);
        local v16 = v11:getState();
        local l_purchaseFlow_0 = v16.purchaseFlow;
        local v18 = if l_purchaseFlow_0 ~= nil then v2.toRawValue(l_purchaseFlow_0) else nil;
        for _, v20 in (v7("PurchasePrompt", v15, v3.toRawValue((v6((v14.getPlatform())))), v18, v16.nativeUpsell.robuxPurchaseAmount)), nil, nil do
            v13.sendCounter(v20);
        end;
    end);
end;


local l_Parent_0 = script.Parent.Parent;
local v1 = require(l_Parent_0.Services.Analytics);
local v2 = require(l_Parent_0.Thunk);
local v3 = {
    v1
};
return function(v4, v5)
    return v2.new(script.Name, v3, function(_, v7)
        v7[v1].signalEvent(v4, v5);
    end);
end;


local _ = script.Parent.Parent;
local l_UserInputService_0 = game:GetService("UserInputService");
local l_Cryo_0 = require(game:GetService("CorePackages").PurchasePromptDeps).Cryo;
local v3 = {};
v3.__index = v3;
v3.new = function(v4)
    local v5 = {
        _inputConnection = nil,
        _clickCount = 0,
        _startTime = tick(),
        _options = l_Cryo_0.Dictionary.join({
            clickSpeedThreshold = 3,
            clickTimeWindow = 1,
            initialDelay = 1,
            buttonInput = nil
        }, v4 or {})
    };
    setmetatable(v5, v3);
    v5._inputConnection = l_UserInputService_0.InputBegan:Connect(function(v6)
        v5:_onInput(v6);
    end);
    return v5;
end;
v3._onInput = function(v7, v8)
    local l_UserInputType_0 = v8.UserInputType;
    local v10 = false;
    if v7._options.buttonInput ~= nil then
        v10 = v8.KeyCode == v7._options.buttonInput;
    end;
    local v11 = true;
    if l_UserInputType_0 ~= Enum.UserInputType.MouseButton1 then
        v11 = l_UserInputType_0 == Enum.UserInputType.Touch;
    end;
    if not (not v10 and not v11) then
        v7._clickCount = v7._clickCount + 1;
        delay(v7._options.clickTimeWindow, function()
            v7._clickCount = v7._clickCount - 1;
        end);
    end;
end;
v3.isClickValid = function(v12)
    if l_UserInputService_0.MouseBehavior == Enum.MouseBehavior.LockCurrentPosition then
        return false;
    elseif tick() - v12._startTime < v12._options.initialDelay then
        return false;
    else
        return v12._clickCount / v12._options.clickTimeWindow < v12._options.clickSpeedThreshold;
    end;
end;
v3.destroy = function(v13)
    v13._inputConnection:Disconnect();
end;
return v3;


local v0 = game:DefineFastFlag("PPDebugLogging", false);
return function(v1)
    if v0 and v1 then
        print("[PurchasePrompt]" .. v1());
        return ;
    else
        return ;
    end;
end;


return function(v0, v1, v2, v3, v4)
    local v5 = {};
    if v3 ~= nil then
        table.insert(v5, v0 .. v3 .. v1 .. v2);
    else
        table.insert(v5, v0 .. v1 .. v2);
    end;
    if v4 ~= nil then
        local v6 = tostring(v4);
        if v3 ~= nil then
            table.insert(v5, v0 .. v3 .. v1 .. v6 .. v2);
            return v5;
        else
            table.insert(v5, v0 .. v1 .. v6 .. v2);
        end;
    end;
    return v5;
end;


local l_HttpService_0 = game:GetService("HttpService");
return function()
    return string.find(l_HttpService_0:GetUserAgent(), "AmazonAppStore");
end;


local v0 = require(script.Parent.Parent.Flags.GetFFlagEnableLuobuInGameUpsell);
return function()
    return v0();
end;


local v0 = require(script.Parent.Parent.Enums.PaymentPlatform);
return function(v1, v2, v3)
    if v1 == Enum.Platform.XBoxOne then
        return v0.Xbox;
    elseif v1 == Enum.Platform.IOS then
        if not v2 then
            return v0.Apple;
        else
            return v0.Midas;
        end;
    elseif not (v1 ~= Enum.Platform.Windows and v1 ~= Enum.Platform.OSX) or v1 == Enum.Platform.Linux then
        return v0.Web;
    elseif v1 == Enum.Platform.Android then
        if not v2 then
            if not v3 then
                return v0.Google;
            else
                return v0.Amazon;
            end;
        else
            return v0.Midas;
        end;
    elseif v1 == Enum.Platform.UWP then
        return v0.UWP;
    else
        return v0.None;
    end;
end;


local l_Parent_0 = script.Parent.Parent;
local v1 = require(l_Parent_0.Utils.getPaymentFromPlatform);
local v2 = require(l_Parent_0.Utils.getPaymentFromPlatformLegacy);
local v3 = require(l_Parent_0.Utils.getHasAmazonUserAgent);
local v4 = require(l_Parent_0.Utils.getHasQuestUserAgent);
local v5 = require(l_Parent_0.Flags.GetFFlagEnableLuobuInGameUpsell);
local v6 = require(l_Parent_0.Flags.GetFFlagEnableQuestPaymentPlatformType);
return function(v7)
    local v8 = v3();
    local v9 = v5();
    if not v6() then
        return v2(v7, v9, v8);
    else
        return v1(v7, v9, v8, (v4()));
    end;
end;


local _ = script.Parent.Parent;
return function(v1, v2, v3)
    if v3 and v3 > 0 then
        return v3;
    elseif not v2 then
        return v1.price;
    elseif v1.premiumPrice ~= nil then
        return v1.premiumPrice;
    else
        return v1.price;
    end;
end;


local _ = script.Parent.Parent;
return function(v1, v2)
    if not v2 then
        return v1.PriceInRobux or 0;
    elseif v1.PremiumPriceInRobux ~= nil then
        return v1.PremiumPriceInRobux;
    else
        return v1.PriceInRobux or 0;
    end;
end;


local v0 = require(script.Parent.Parent.Enums.RequestType);
return function(v1)
    return v1.promptRequest.requestType ~= v0.None;
end;


local l_Parent_0 = script.Parent.Parent;
local l_UserInputService_0 = game:GetService("UserInputService");
local v2 = require(l_Parent_0.Enums.UpsellFlow);
local v3 = require(l_Parent_0.NativeUpsell.getUpsellFlow);
return function()
    return v3((l_UserInputService_0:GetPlatform())) == v2.Web;
end;


local l_RunService_0 = game:GetService("RunService");
return function()
    return l_RunService_0:IsStudio();
end;


local l_Parent_0 = script.Parent.Parent;
local l_Players_0 = game:GetService("Players");
local l_Workspace_0 = game:GetService("Workspace");
local v3 = require(l_Parent_0.Misc.Constants);
local v4 = require(l_Parent_0.Enums.PurchaseError);
local v5 = require(l_Parent_0.Parent.Flags.FFlagEnableUGC4ACollectiblePurchaseSupport);
local v6 = "AllowThirdPartySales has blocked the purchase" .. " prompt for %d created by %d. To sell this asset made by a" .. " different %s, you will need to enable AllowThirdPartySales.";
return function(v7, v8, v9, v10, v11)
    local v12 = v7.ProductType == v3.ProductType.CollectibleItem;
    local v13 = if not not v5 and v7.CollectiblesItemDetails then v7.CollectiblesItemDetails.IsLimited else nil;
    if not v5 then
        if not (v12 or not v8) then
            return false, v4.AlreadyOwn;
        end;
    elseif not v12 then
        if v8 then
            return false, v4.AlreadyOwn;
        end;
    elseif not (v13 or not v8) then
        return false, v4.AlreadyOwn;
    end;
    if (not (v11 == nil) or v7.IsForSale) or v7.IsPublicDomain then
        if not (not (v11 == nil) or not v10.GetFFlagEnableRestrictedAssetSaleLocationPurchasePrompt()) and v7.CanBeSoldInThisGame == false then
            return false, v4.NotForSaleHere;
        else
            if not v5 then
                if not (not (v11 == nil) or not (v12 or v7.IsLimited) and not v7.IsLimitedUnique) and (not (v7.Remaining ~= nil) or v7.Remaining == 0) then
                    return false, v4.Limited;
                end;
            elseif not (not (v11 == nil) or not (v12 and v13 or v7.IsLimited) and not v7.IsLimitedUnique) and (not (v7.Remaining ~= nil) or v7.Remaining == 0) then
                return false, v4.Limited;
            end;
            if v7.MinimumMembershipLevel == Enum.MembershipType.Premium.Value and l_Players_0.LocalPlayer.MembershipType ~= Enum.MembershipType.Premium then
                return false, v4.PremiumOnly;
            elseif not (v7.ContentRatingTypeId == 1) or not l_Players_0.LocalPlayer:GetUnder13() then
                local v14 = true;
                v14 = if not v10.getLuaUseThirdPartyPermissions() then l_Workspace_0.AllowThirdPartySales else v10.isThirdPartyPurchaseAllowed();
                if not ((not (v7.ProductType ~= v3.ProductType.DeveloperProduct) or not v9) or v14) then
                    local v15 = game.CreatorType == Enum.CreatorType.Group;
                    local v16 = v7.Creator.CreatorType == "Group";
                    local v17 = tonumber(v7.Creator.CreatorTargetId);
                    if v17 ~= 1 and (not (v15 == v16) or v17 ~= game.CreatorId) then
                        warn(v6:format(v7.AssetId, v17, not v15 and "user" or "group"));
                        return false, v4.ThirdPartyDisabled;
                    end;
                end;
                return true, nil;
            else
                return false, v4.Under13;
            end;
        end;
    else
        return false, v4.NotForSale;
    end;
end;


local v0 = require(script.Parent.Parent.Enums.PurchaseError);
return function(v1)
    if v1 == "UserHasSpendLimitSet" then
        return v0.SubscriptionExceededUserSpendLimit;
    elseif v1 == "UnsupportedLocale" then
        return v0.SubscriptionUnsupportedLocale;
    elseif v1 == "RestrictedUser" then
        return v0.RestrictedUser;
    elseif v1 == "PurchasePlatformNotSupported" then
        return v0.SubscriptionPurchasePlatformNotSupported;
    elseif v1 == "InvalidSaleLocation" then
        return v0.SubscriptionInvalidSaleLocation;
    elseif v1 == "UserAlreadySubscribed" then
        return v0.AlreadySubscribed;
    elseif v1 == "ProductNotForSale" then
        return v0.SubscriptionNotForSale;
    elseif v1 == "VpcRequired" then
        return v0.VpcRequired;
    elseif v1 == "ExceedParentalSpendLimit" then
        return v0.ExceedParentalSpendLimit;
    else
        return v0.UnknownFailure;
    end;
end;


local function v0(v1, v2, v3, v4)
    v3 = v3 or false;
    v4 = v4 or 0;
    local v5 = string.rep(" ", v4);
    if v2 then
        v5 = v5 .. v2 .. " = ";
    end;
    if type(v1) == "table" then
        v5 = v5 .. "{" .. (v3 and "" or "\n");
        for v6, v7 in pairs(v1) do
            v5 = v5 .. v0(v7, v6, v3, v4 + 1) .. "," .. (v3 and "" or "\n");
        end;
        return v5 .. string.rep(" ", v4) .. "}";
    elseif type(v1) == "number" then
        return v5 .. tostring(v1);
    elseif type(v1) == "string" then
        return v5 .. string.format("%q", v1);
    elseif type(v1) == "boolean" then
        return v5 .. (not v1 and "false" or "true");
    else
        return v5 .. "\"[inserializeable datatype:" .. type(v1) .. "]\"";
    end;
end;
return v0;


local _ = script.Parent;
local l_RoactRodux_0 = require(game:GetService("CorePackages").PurchasePromptDeps).RoactRodux;
return function(v2, v3)
    return function(v4)
        local v5 = l_RoactRodux_0.UNSTABLE_connect2(v2, v3)(v4);
        v5.getUnconnected = function()
            return v4;
        end;
        return v5;
    end;
end;


local l_Parent_0 = script.Parent;
local l_ContentProvider_0 = game:GetService("ContentProvider");
local v2 = require(l_Parent_0.Enums.ItemType);
local v3 = string.gsub(l_ContentProvider_0.BaseUrl:lower(), "https?://m.", "https?://www.");
local v4 = v3 .. "thumbs/asset.ashx?assetid=";
local v5 = v3 .. "outfit-thumbnail/image?userOutfitId=%s&width=100&height=100&format=png";
return function(v6, v7)
    local v8 = nil;
    if v6.itemType == v2.Bundle then
        if not v6.costumeId then
            v8 = v6.items[1].id;
        else
            return string.format(v5, v6.costumeId);
        end;
    elseif v6.AssetId ~= nil and v6.AssetId ~= 0 then
        v8 = v6.AssetId;
    elseif v6.IconImageAssetId ~= nil then
        v8 = v6.IconImageAssetId;
    elseif v7 == Enum.Platform.XBoxOne then
        return "rbxasset://textures/ui/Shell/Icons/ROBUXIcon@1080.png";
    end;
    return v4 .. tostring(v8) .. "&x=100&y=100&format=png";
end;


local l_script_0 = script;
local v1 = require(game:GetService("CorePackages").PurchasePromptDeps);
local l_CoreGui_0 = game:GetService("CoreGui");
local l_RunService_0 = game:GetService("RunService");
local l_Roact_0 = v1.Roact;
local l_Rodux_0 = v1.Rodux;
local v6 = require(script.Components.PurchasePromptApp);
local v7 = require(l_script_0.Reducers.Reducer);
local v8 = require(l_script_0.Services.ABTest);
local v9 = require(l_script_0.Services.Network);
local v10 = require(l_script_0.Services.Analytics);
local v11 = require(l_script_0.Services.PlatformInterface);
local v12 = require(l_script_0.Services.ExternalSettings);
local v13 = require(l_script_0.Thunk);
local v14 = require(l_script_0.Thunks.initiateAvatarCreationFeePurchase);
local v15 = require(l_script_0.Flags.GetFFlagEnableAvatarCreationFeePurchase);
local v16 = nil;
local v17 = nil;
local function v18()
    v17 = l_Rodux_0.Store.new(v7, {}, {
        v13.middleware({
            [v8] = v8.new(),
            [v9] = v9.new(),
            [v10] = v10.new(),
            [v11] = v11.new(),
            [v12] = v12.new()
        })
    });
end;
local _ = nil;
return {
    mountPurchasePrompt = not v15() and function()
        if not l_RunService_0:IsStudio() or not l_RunService_0:IsEdit() then
            return (l_Roact_0.mount(l_Roact_0.createElement(v6), l_CoreGui_0, "PurchasePromptApp"));
        else
            return nil;
        end;
    end or function()
        if not (l_RunService_0:IsStudio() and l_RunService_0:IsEdit()) and not v16 then
            v18();
            v16 = l_Roact_0.mount(l_Roact_0.createElement(v6, {
                store = v17
            }), l_CoreGui_0, "PurchasePromptApp");
            return v16;
        else
            return nil;
        end;
    end,
    initiateAvatarCreationFeePurchase = if not v15() then nil else function(v20, v21, v22)
        if not v17 then
            error("initiateAvatarCreationFeePurchase cannot be called when the PurchasePrompt has not been mounted");
        end;
        v17:dispatch(v14(v20, v21, v22));
    end
};


local function v2(v0, v1)
    error(("%q (%s) is not a valid member of %s"):format(tostring(v1), typeof(v1), (tostring(v0))), 2);
end;
return function(v3, v4)
    return (setmetatable(v3, {
        __index = v2,
        __newindex = v2,
        __tostring = function()
            return v4;
        end
    }));
end;


local l_LocalizationService_0 = game:GetService("LocalizationService");
local l_CoreGui_0 = game:GetService("CoreGui");
local l_Players_0 = game:GetService("Players");
local l_Translator_0 = l_CoreGui_0.CoreScriptLocalization:GetTranslator("en-us");
if l_Players_0.LocalPlayer == nil then
    l_Players_0:GetPropertyChangedSignal("LocalPlayer"):Wait();
end;
local v4 = nil;
local function _()
    if v4 == nil then
        v4 = l_CoreGui_0.CoreScriptLocalization:GetTranslator(l_LocalizationService_0.RobloxLocaleId);
    end;
    return v4;
end;
local v6 = {};
local function _(v7)
    local v8 = v6[v7];
    if not v8 then
        v8 = l_CoreGui_0.CoreScriptLocalization:GetTranslator(v7);
        v6[v7] = v8;
        return v8;
    else
        return v8;
    end;
end;
local function v15(v10, v11, v12)
    local l_status_0, l_result_0 = pcall(function()
        return v12:FormatByKey(v10, v11);
    end);
    if not l_status_0 then
        if v12.LocaleId == "zh-cjv" then
            return "";
        else
            return l_Translator_0:FormatByKey(v10, v11);
        end;
    else
        return l_result_0;
    end;
end;
return {
    FormatByKey = function(_, v17, v18)
        local l_v15_0 = v15;
        local l_v17_0 = v17;
        local l_v18_0 = v18;
        if v4 == nil then
            v4 = l_CoreGui_0.CoreScriptLocalization:GetTranslator(l_LocalizationService_0.RobloxLocaleId);
        end;
        return l_v15_0(l_v17_0, l_v18_0, v4);
    end,
    FormatByKeyForLocale = function(_, v23, v24, v25)
        local l_v15_1 = v15;
        local l_v23_0 = v23;
        local l_v25_0 = v25;
        local v29 = v6[v24];
        local v30;
        if not v29 then
            v29 = l_CoreGui_0.CoreScriptLocalization:GetTranslator(v24);
            v6[v24] = v29;
            v30 = v29;
        else
            v30 = v29;
        end;
        return l_v15_1(l_v23_0, l_v25_0, v30);
    end
};


local l_CoreGui_0 = game:GetService("CoreGui");
local l_CorePackages_0 = game:GetService("CorePackages");
local l_RobloxGui_0 = l_CoreGui_0:WaitForChild("RobloxGui");
local l_Modules_0 = l_CoreGui_0.RobloxGui.Modules;
local v4 = require(l_Modules_0.Settings.Theme);
local v5 = require(l_Modules_0.Chrome.Enabled);
local v6 = require(l_CorePackages_0.Workspace.Packages.Screenshots);
local l_FFlagCapturesCarouselCTABarUIUpdateEnabled_0 = require(l_CorePackages_0.Workspace.Packages.SharedFlags).FFlagCapturesCarouselCTABarUIUpdateEnabled;
local l_GetFFlagEnableScreenshotUtility_0 = require(l_CorePackages_0.Workspace.Packages.SharedFlags).GetFFlagEnableScreenshotUtility;
local v9 = v6.App.createApp();
local l_ScreenGui_0 = Instance.new("ScreenGui");
l_ScreenGui_0.DisplayOrder = v6.Constants.CarouselDisplayOrder;
l_ScreenGui_0.Name = "ScreenshotsCarousel";
l_ScreenGui_0.ResetOnSpawn = false;
if l_FFlagCapturesCarouselCTABarUIUpdateEnabled_0 then
    l_ScreenGui_0.ScreenInsets = Enum.ScreenInsets.DeviceSafeInsets;
end;
l_ScreenGui_0.ZIndexBehavior = Enum.ZIndexBehavior.Sibling;
l_ScreenGui_0.Parent = l_CoreGui_0;
local l_ScreenGui_1 = Instance.new("ScreenGui");
l_ScreenGui_1.DisplayOrder = v6.Constants.CarouselDisplayOrder;
l_ScreenGui_1.Name = "CaptureManager";
l_ScreenGui_1.ResetOnSpawn = false;
l_ScreenGui_1.ZIndexBehavior = Enum.ZIndexBehavior.Sibling;
l_ScreenGui_1.Parent = l_CoreGui_0;
local l_ScreenGui_2 = Instance.new("ScreenGui");
l_ScreenGui_2.DisplayOrder = v6.Constants.OverlayDisplayOrder;
l_ScreenGui_2.Name = v6.Constants.OverlayName;
l_ScreenGui_2.ResetOnSpawn = false;
l_ScreenGui_2.ZIndexBehavior = Enum.ZIndexBehavior.Sibling;
l_ScreenGui_2.Parent = l_CoreGui_0;
v9.mountCaptureManager(l_ScreenGui_1, v4);
v9.mountCarousel(l_ScreenGui_0);
v9.mountCoreUI(l_RobloxGui_0, if not l_GetFFlagEnableScreenshotUtility_0() then nil else v5());
v9.mountCaptureOverlay(l_ScreenGui_2);
return v9;


debugPrint = function(_)
end;
debugPrint("Self View Analytics 10-19-2022__1");
local v1 = game:DefineFastFlag("AvatarChatIncludeSelfViewOnTelemetry", false);
local l_RbxAnalyticsService_0 = game:GetService("RbxAnalyticsService");
local l_Players_0 = game:GetService("Players");
local l_RunService_0 = game:GetService("RunService");
local v5 = {};
v5.__index = v5;
v5.INFO = "info";
v5.WARNING = "warning";
v5.ERROR = "error";
local v6 = "SelfView";
v5.new = function(v7)
    if not v7 then
        v7 = l_RbxAnalyticsService_0;
    end;
    assert(v7, "Analytics impl must not be nil.");
    return (setmetatable({
        _impl = v7
    }, v5));
end;
local function v8()
end;
v5.stubService = function()
    return {
        SetRBXEvent = v8,
        SetRBXEventStream = v8,
        SendEventDeferred = v8,
        ReportCounter = v8,
        ReportStats = v8,
        ReportInfluxSeries = v8,
        GetSessionId = v8
    };
end;
v5.setImpl = function(v9, v10)
    v9._impl = v10;
end;
v5._report = function(v11, v12, v13, _, v15)
    local v16 = "client";
    if l_RunService_0:IsStudio() then
        v16 = "studio";
    end;
    v11._impl:SendEventDeferred(v16, v12, v13, v15);
end;
v5.reportMicState = function(v17, v18)
    debugPrint("Self View: Analytics:reportMicState, newState: " .. tostring(v18) .. ",universeid: " .. tostring(game.GameId) .. ",pid: " .. tostring(game.PlaceId) .. ",uid: " .. tostring(l_Players_0.LocalPlayer.UserId) .. ",sessionid: " .. tostring(v17._impl:GetSessionId()));
    v17:_report(v6, "inExperienceMicState", tostring(v18), {
        state = v18,
        universeid = tostring(game.GameId),
        pid = tostring(game.PlaceId),
        uid = tostring(l_Players_0.LocalPlayer.UserId),
        sessionid = tostring(v17._impl:GetPlaySessionId())
    });
end;
v5.reportCamState = function(v19, v20)
    debugPrint("Self View: Analytics:reporCamState, newState: " .. tostring(v20) .. ",universeid: " .. tostring(game.GameId) .. ",pid: " .. tostring(game.PlaceId) .. ",uid: " .. tostring(l_Players_0.LocalPlayer.UserId) .. ",sessionid: " .. tostring(v19._impl:GetSessionId()));
    v19:_report(v6, "inExperienceCamState", tostring(v20), {
        state = v20,
        universeid = tostring(game.GameId),
        pid = tostring(game.PlaceId),
        uid = tostring(l_Players_0.LocalPlayer.UserId),
        sessionid = tostring(v19._impl:GetPlaySessionId())
    });
end;
v5.reportSelfViewEnabledInCoreGuiState = function(v21, v22)
    debugPrint("Self View: Analytics:reportSelfViewEnabledInCoreGuiState, newState: " .. tostring(v22) .. ",universeid: " .. tostring(game.GameId) .. ",pid: " .. tostring(game.PlaceId) .. ",sessionid: " .. tostring(v21._impl:GetSessionId()));
    v21:_report("SelfView", "enabledinCoreGuiState", tostring(v22), {
        state = v22,
        universeid = tostring(game.GameId),
        pid = tostring(game.PlaceId),
        sessionid = tostring(v21._impl:GetPlaySessionId())
    });
end;
v5.reportSelfViewSessionStarted = function(v23, v24, v25, v26, v27, v28, v29, v30, v31)
    debugPrint("Self View: Analytics:reportSelfViewSessionStarted,universeid: " .. tostring(game.GameId) .. ",pid: " .. tostring(game.PlaceId) .. ",sessionid: " .. tostring(v23._impl:GetSessionId()) .. ",x: " .. tostring(v24) .. ",y: " .. tostring(v25) .. ",width: " .. tostring(v26) .. ",height: " .. tostring(v27) .. ",x_relative: " .. tostring(v28) .. ",y_relative: " .. tostring(v29) .. ",width_relative: " .. tostring(v30) .. ",height_relative: " .. tostring(v31));
    v23:_report("SelfView", "sessionStarted", "true", {
        universeid = tostring(game.GameId),
        pid = tostring(game.PlaceId),
        sessionid = tostring(v23._impl:GetPlaySessionId()),
        x = tostring(v24),
        y = tostring(v25),
        width = tostring(v26),
        height = tostring(v27),
        x_relative = tostring(v28),
        y_relative = tostring(v29),
        width_relative = tostring(v30),
        height_relative = tostring(v31)
    });
    if v1 then
        l_RbxAnalyticsService_0:AddGlobalPointsField("feature/avatarChat/selfViewOn", 1);
    end;
end;
v5.reportSelfViewSessionStopped = function(v32)
    debugPrint("Self View: Analytics:reportSelfViewSessionStopped,universeid: " .. tostring(game.GameId) .. ",pid: " .. tostring(game.PlaceId) .. ",sessionid: " .. tostring(v32._impl:GetSessionId()));
    v32:_report("SelfView", "sessionStopped", "true", {
        universeid = tostring(game.GameId),
        pid = tostring(game.PlaceId),
        sessionid = tostring(v32._impl:GetPlaySessionId())
    });
    if v1 then
        l_RbxAnalyticsService_0:AddGlobalPointsField("feature/avatarChat/selfViewOn", 0);
    end;
end;
v5.reportUserAccountSettings = function(v33, v34, v35)
    debugPrint("Self View: Analytics:reportUserAccountSettings,universeid: " .. tostring(game.GameId) .. ",pid: " .. tostring(game.PlaceId) .. ",sessionid: " .. tostring(v33._impl:GetSessionId()) .. ",userAccount_videoEnabled: " .. tostring(v34) .. ",userAccount_audioEnabled: " .. tostring(v35));
    v33:_report("SelfView", "userAccountSettings", "true", {
        universeid = tostring(game.GameId),
        pid = tostring(game.PlaceId),
        sessionid = tostring(v33._impl:GetPlaySessionId()),
        videoenabled = tostring(v34),
        audioenabled = tostring(v35)
    });
end;
v5.reportExperienceSettings = function(v36, v37, v38, v39)
    debugPrint("Self View: Analytics:reportExperienceSettings,universeid: " .. tostring(game.GameId) .. ",pid: " .. tostring(game.PlaceId) .. ",sessionid: " .. tostring(v36._impl:GetSessionId()) .. ",experienceSettings_placeEnabled: " .. tostring(v37) .. ",experienceSettings_videoEnabled: " .. tostring(v38) .. ",experienceSettings_audioEnabled: " .. tostring(v39));
    v36:_report("SelfView", "experienceSettings", "true", {
        universeid = tostring(game.GameId),
        pid = tostring(game.PlaceId),
        sessionid = tostring(v36._impl:GetPlaySessionId()),
        placeenabled = tostring(v37),
        videoenabled = tostring(v38),
        audioenabled = tostring(v39)
    });
end;
v5.setLastCtx = function(_, v41)
    v6 = v41;
end;
return v5;


local l_CorePackages_0 = game:GetService("CorePackages");
local l_UserInputService_0 = game:GetService("UserInputService");
local l_CoreGui_0 = game:GetService("CoreGui");
local l_RobloxGui_0 = l_CoreGui_0:WaitForChild("RobloxGui");
local v4 = require(l_CorePackages_0.Packages.React);
local v5 = require(l_CorePackages_0.UIBlox);
local l_withTooltip_0 = v5.App.Dialog.TooltipV2.withTooltip;
local l_TooltipOrientation_0 = v5.App.Dialog.Enum.TooltipOrientation;
local v8 = require(l_RobloxGui_0.Modules.RobloxTranslator);
local v9 = require(l_CorePackages_0.Packages.Promise);
return function(v10)
    local v11, v12 = v4.useState(true);
    local l_fallbackText_0 = v10.fallbackText;
    pcall(function()
        l_fallbackText_0 = v8:FormatByKey(v10.translationKey);
    end);
    local v14 = {
        textAlignment = Enum.TextXAlignment.Left,
        bodyText = l_fallbackText_0
    };
    local v15 = {
        active = v11,
        guiTarget = l_CoreGui_0,
        DisplayOrder = 10,
        preferredOrientation = l_TooltipOrientation_0.Left
    };
    local v16 = nil;
    local function _()
        v12(false);
        if v16 then
            v16:Disconnect();
            v16 = nil;
        end;
    end;
    v16 = l_UserInputService_0.InputBegan:Connect(function(v18)
        local l_UserInputType_0 = v18.UserInputType;
        if not (l_UserInputType_0 ~= Enum.UserInputType.MouseButton1) or l_UserInputType_0 == Enum.UserInputType.Touch then
            v12(false);
            if v16 then
                v16:Disconnect();
                v16 = nil;
            end;
        end;
    end);
    v9.delay(v10.tooltipLifetime):andThen(function()
        v12(false);
        if v16 then
            v16:Disconnect();
            v16 = nil;
        end;
    end);
    return l_withTooltip_0(v14, v15, function(v20)
        local function v22(v21)
            v20(v21);
        end;
        return v4.createElement("Frame", {
            Visible = false,
            BackgroundTransparency = 1,
            Size = UDim2.new(1, 0, 1, 0),
            [v4.Change.AbsoluteSize] = v22,
            [v4.Change.AbsolutePosition] = v22
        });
    end);
end;


local l_CorePackages_0 = game:GetService("CorePackages");
local v1 = require(l_CorePackages_0.Roact);
local l_CoreGui_0 = game:GetService("CoreGui");
local v3 = require(l_CoreGui_0:WaitForChild("RobloxGui").Modules.TopBar.Constants);
local l_ScreenSideOffset_0 = v3.ScreenSideOffset;
local l_TopBarButtonHeight_0 = v3.TopBarButtonHeight;
local v6 = require(l_CorePackages_0.UIBlox);
local l_AppStyleProvider_0 = v6.App.Style.AppStyleProvider;
local l_Dark_0 = v6.App.Style.Constants.ThemeName.Dark;
local v9 = require(l_CorePackages_0.Packages.Promise);
local v10 = require(script.Parent.SelfViewTooltipFTUX);
return function(v11)
    local l_ScreenGui_0 = Instance.new("ScreenGui");
    l_ScreenGui_0.Name = "SelfViewTooltipOnCloseGui";
    l_ScreenGui_0.DisplayOrder = -1;
    l_ScreenGui_0.ZIndexBehavior = Enum.ZIndexBehavior.Sibling;
    l_ScreenGui_0.Parent = l_CoreGui_0;
    local v13 = v1.mount(v1.createElement(l_AppStyleProvider_0, {
        style = {
            themeName = l_Dark_0
        }
    }, {
        frame = v1.createElement("Frame", {
            Position = UDim2.fromOffset(l_ScreenSideOffset_0, -l_TopBarButtonHeight_0),
            Size = UDim2.fromOffset(l_TopBarButtonHeight_0, l_TopBarButtonHeight_0),
            BackgroundTransparency = 0,
            Visible = false
        }, {
            tooltip = v1.createElement(v10, {
                fallbackText = v11.fallbackText,
                translationKey = v11.translationKey,
                tooltipLifetime = v11.tooltipLifetime
            })
        })
    }), l_ScreenGui_0, "SelfViewTooltipOnClose");
    v9.delay(v11.tooltipLifetime + 5):andThen(function()
        pcall(function()
            v1.unmount(v13);
        end);
    end);
end;


local l_CorePackages_0 = game:GetService("CorePackages");
local v1 = require(l_CorePackages_0.Roact);
local l_CoreGui_0 = game:GetService("CoreGui");
local v3 = require(l_CorePackages_0.UIBlox);
local l_AppStyleProvider_0 = v3.App.Style.AppStyleProvider;
local l_Dark_0 = v3.App.Style.Constants.ThemeName.Dark;
local v6 = require(l_CorePackages_0.Packages.Promise);
local v7 = require(script.Parent.SelfViewTooltipFTUX);
return function(v8)
    local l_ScreenGui_0 = Instance.new("ScreenGui");
    l_ScreenGui_0.Name = "SelfViewTooltipOnOpenGui";
    l_ScreenGui_0.DisplayOrder = -1;
    l_ScreenGui_0.ZIndexBehavior = Enum.ZIndexBehavior.Sibling;
    l_ScreenGui_0.Parent = l_CoreGui_0;
    local v10 = v1.mount(v1.createElement(l_AppStyleProvider_0, {
        style = {
            themeName = l_Dark_0
        }
    }, {
        frame = v1.createElement("Frame", {
            Position = v8.position,
            Size = v8.size,
            BackgroundTransparency = 0,
            AnchorPoint = v8.anchorPoint,
            Visible = false
        }, {
            aspectRatioConstraint = v1.createElement("UIAspectRatioConstraint", {
                AspectRatio = v8.aspectRatio,
                AspectType = "ScaleWithParentSize",
                DominantAxis = "Width"
            }),
            sizeConstraint = v1.createElement("UISizeConstraint", {
                MaxSize = v8.maxSize,
                MinSize = v8.minSize
            }),
            bottomButtonsMock = v1.createElement("Frame", {
                Position = v8.bottomButtonsFramePosition,
                Size = v8.bottomButtonsFrameSize,
                Visible = false,
                BackgroundTransparency = 0
            }, {
                tooltip = v1.createElement(v7, {
                    fallbackText = v8.fallbackText,
                    translationKey = v8.translationKey,
                    tooltipLifetime = v8.tooltipLifetime
                })
            })
        })
    }), l_ScreenGui_0, "SelfViewTooltipOnOpenGui");
    local function v11()
        pcall(function()
            v1.unmount(v10);
        end);
    end;
    v6.delay(v8.tooltipLifetime + 5):andThen(function()
        pcall(function()
            v1.unmount(v10);
        end);
    end);
    return {
        instance = v10,
        unmount = v11
    };
end;


local v0 = require(game:GetService("CoreGui").RobloxGui.Modules.SelfView.selfViewVisibilityUpdatedSignal);
local v1 = false;
return {
    getSelfViewIsOpenAndVisible = function()
        return v1;
    end,
    setSelfViewIsOpenAndVisible = function(v2)
        v1 = v2;
        v0:fire();
    end
};


local l_Packages_0 = game:GetService("CorePackages").Packages;
local v1 = require(l_Packages_0.React);
local l_useStyle_0 = require(l_Packages_0.UIBlox).Core.Style.useStyle;
local v3 = UDim2.fromOffset(4, 4);
local v4 = Vector2.new(0.5, 0.5);
local v5 = UDim2.fromScale(0.8, 0.8);
return function(v6)
    return v1.createElement("Frame", {
        AnchorPoint = v6.AnchorPoint or v4,
        Size = v3,
        BackgroundColor3 = l_useStyle_0().Theme.OnlineStatus.Color,
        Position = v6.Position or v5,
        ZIndex = v6.ZIndex
    }, {
        UICorner = v1.createElement("UICorner", {
            CornerRadius = UDim.new(1, 0)
        })
    });
end;


local l_Packages_0 = game:GetService("CorePackages").Packages;
local v1 = require(l_Packages_0.React);
local v2 = require(l_Packages_0.UIBlox);
local l_Images_0 = v2.App.ImageSet.Images;
local l_ImageSetLabel_0 = v2.Core.ImageSet.ImageSetLabel;
local v5 = require(script.Parent.Parent.Hooks.useCameraOn);
local v6 = UDim2.fromScale(1, 1);
return function(v7)
    return v1.createElement("Frame", {
        BackgroundTransparency = 1,
        Size = UDim2.fromScale(1, 1)
    }, {
        Icon = v1.createElement(l_ImageSetLabel_0, {
            BackgroundTransparency = 1,
            Image = not not v5() and l_Images_0["icons/controls/video"] or l_Images_0["icons/controls/videoOff"],
            Size = v7.iconSize or v6,
            Position = UDim2.fromScale(0.5, 0.5),
            AnchorPoint = Vector2.new(0.5, 0.5),
            ImageTransparency = v7.transparency or 0
        })
    });
end;


local l_CorePackages_0 = game:GetService("CorePackages");
local v1 = require(script.Parent.Parent.Utils.ModelUtils);
local l_CharacterUtility_0 = require(l_CorePackages_0.Thumbnailing).CharacterUtility;
local l_CFrameUtility_0 = require(l_CorePackages_0.Thumbnailing).CFrameUtility;
local v4 = nil;
local v5 = nil;
local v6 = game:DefineFastFlag("SelfViewLookUpHumanoidByType", false);
local v7 = game:DefineFastFlag("DebugSelfViewPerfBenchmark", false);
local v8 = require(script.Parent.Parent.Parent.SelfieView.Flags.GetFFlagSelfieViewDontWaitForCharacter);
local l_GetFFlagSelfViewAssertFix_0 = require(l_CorePackages_0.Workspace.Packages.SharedFlags).GetFFlagSelfViewAssertFix;
local l_GetFFlagSelfViewVisibilityFix_0 = require(l_CorePackages_0.Workspace.Packages.SharedFlags).GetFFlagSelfViewVisibilityFix;
local l_RunService_0 = game:GetService("RunService");
local v12 = Vector3.new(0, 0.105, -0.25);
local v13 = Vector3.new(0, 1.5, 0);
local v14 = 1.31;
local v15 = 0;
local v16 = nil;
local v17 = nil;
local v18 = {};
local v19 = {};
local v20 = nil;
local v21 = {};
local v22 = {};
local v23 = nil;
local v24 = nil;
local v25 = nil;
local v26 = nil;
local v27 = Vector3.new(1.1721, 1.1811, 1.1578);
local v28 = nil;
local v29 = nil;
local v30 = nil;
local v31 = nil;
local v32 = nil;
local v33 = nil;
local v34 = nil;
local v35 = nil;
local v36 = nil;
local v37 = false;
local v38 = 0;
local v39 = {};
local v40 = {
    AnimationPlayed = "AnimationPlayed",
    AnimationPlayedCoreScript = "AnimationPlayedCoreScript",
    DescendantAdded = "DescendantAdded",
    DescendantRemoving = "DescendantRemoving",
    HeadSize = "HeadSize",
    Color = "Color",
    CharacterAdded = "CharacterAdded",
    CharacterRemoving = "CharacterRemoving",
    HumanoidStateChanged = "HumanoidStateChanged"
};
local l_Players_0 = game:GetService("Players");
if not l_Players_0.LocalPlayer then
    warn("Players.LocalPlayer does not exist");
end;
local l_LocalPlayer_0 = l_Players_0.LocalPlayer;
local v43 = false;
setCloneDirty = function(v44)
    if not v44 then
        v15 = 0;
        return ;
    else
        v15 = 0.35;
        return ;
    end;
end;
createCloneAnchor = function()
    if v28 ~= nil then
        v28:Destroy();
        v28 = nil;
    end;
    local l_WorldModel_0 = Instance.new("WorldModel");
    l_WorldModel_0.Parent = v25;
    v28 = l_WorldModel_0;
end;
local function _(v46)
    if v39[v46] then
        v39[v46]:Disconnect();
        v39[v46] = nil;
    end;
end;
clearCloneCharacter = function()
    if v29 then
        v29:Destroy();
        v29 = nil;
    end;
    if v28 then
        assert(v28 ~= nil);
        local l_SelfAvatar_0 = v28:FindFirstChild("SelfAvatar");
        if l_SelfAvatar_0 then
            l_SelfAvatar_0:Destroy();
        end;
        createCloneAnchor();
        return ;
    else
        warn("cloneAnchor is nil, this shouldn't be possible");
        return ;
    end;
end;
local function v50()
    stopRenderStepped();
    local l_AnimationPlayed_0 = v40.AnimationPlayed;
    if v39[l_AnimationPlayed_0] then
        v39[l_AnimationPlayed_0]:Disconnect();
        v39[l_AnimationPlayed_0] = nil;
    end;
    l_AnimationPlayed_0 = v40.AnimationPlayedCoreScript;
    if v39[l_AnimationPlayed_0] then
        v39[l_AnimationPlayed_0]:Disconnect();
        v39[l_AnimationPlayed_0] = nil;
    end;
    v20 = nil;
    v21 = {};
    clearCloneCharacter();
end;
local function v54(v51, v52)
    if v51 and v52.Animation then
        local v53 = nil;
        if not v52.Animation or not v52.Animation:IsA("Animation") then
            if not v52.Animation or not v52.Animation:IsA("TrackerStreamAnimation") then
                warn("No animation to clone in SelfView");
            else
                v4 = Instance.new("TrackerStreamAnimation");
                assert(v4 ~= nil);
                v5 = v51:LoadStreamAnimationForSelfieView_deprecated(v4, l_LocalPlayer_0);
                v53 = v5;
            end;
        end;
        if v53 then
            v53:Play();
            v53.Priority = v52.Priority;
            v18[v52] = v52.Stopped:Connect(function()
                v53:Stop(0);
                if v18[v52] then
                    v18[v52]:Disconnect();
                end;
            end);
        end;
        return ;
    else
        return ;
    end;
end;
local function v76(v55)
    stopRenderStepped();
    local l_AnimationPlayed_1 = v40.AnimationPlayed;
    if v39[l_AnimationPlayed_1] then
        v39[l_AnimationPlayed_1]:Disconnect();
        v39[l_AnimationPlayed_1] = nil;
    end;
    l_AnimationPlayed_1 = v40.AnimationPlayedCoreScript;
    if v39[l_AnimationPlayed_1] then
        v39[l_AnimationPlayed_1]:Disconnect();
        v39[l_AnimationPlayed_1] = nil;
    end;
    v20 = nil;
    v21 = {};
    clearCloneCharacter();
    if v55 then
        assert(v55 ~= nil);
        startRenderStepped(v55);
        l_AnimationPlayed_1 = v55.Character;
        if not v8() then
            if v55 and (v55.Character or v55.CharacterAdded:Wait()) then
                l_AnimationPlayed_1 = v55.Character or v55.CharacterAdded:Wait();
            else
                return ;
            end;
        elseif v55 and v55.Character then
            l_AnimationPlayed_1 = v55.Character;
            if not l_AnimationPlayed_1 then
                return ;
            end;
        else
            return ;
        end;
        assert(l_AnimationPlayed_1 ~= nil);
        local v57 = v1.getAnimator(l_AnimationPlayed_1, 10);
        clearCloneCharacter();
        local l_Archivable_0 = l_AnimationPlayed_1.Archivable;
        l_AnimationPlayed_1.Archivable = true;
        local v59 = v1.getHead(l_AnimationPlayed_1);
        if v59 then
            v29 = l_AnimationPlayed_1:Clone();
            if l_GetFFlagSelfViewAssertFix_0() and v29 == nil then
                return ;
            else
                assert(v29 ~= nil);
                v1.removeTags(v29);
                v1.resetPartOrientation(v29);
                v1.updateTransparency(v29, v19);
                v29.Name = "SelfAvatar";
                v1.removeScripts(v29);
                v1.sanitizeCharacter(v29);
                l_AnimationPlayed_1.Archivable = l_Archivable_0;
                v29.Parent = v28;
                local l_HumanoidRootPart_0 = v29:FindFirstChild("HumanoidRootPart");
                if l_HumanoidRootPart_0 then
                    l_HumanoidRootPart_0.CFrame = CFrame.new((Vector3.new(0, 0, 0)));
                    assert(v26 ~= nil);
                    if not v59 then
                        v26.CFrame = CFrame.lookAt((l_HumanoidRootPart_0.Position + l_HumanoidRootPart_0.CFrame.LookVector * 2.5) + v13, l_HumanoidRootPart_0.Position);
                        v26.CFrame = CFrame.new(v26.CFrame.Position) * CFrame.Angles(-6.981317007977319E-4, 3.141592653589793, 0);
                    else
                        local v61 = v1.getHead(v29);
                        assert(v61 ~= nil);
                        local v62, v63 = l_CharacterUtility_0.CalculateHeadExtents(v29, (l_CFrameUtility_0.CalculateTargetCFrame(v61.CFrame)));
                        v27 = Vector3.new(v63.X, v63.Y, v63.Z) - Vector3.new(v62.X, v62.Y, v62.Z);
                        assert(v27 ~= nil);
                        v14 = v61.Size.Y;
                        local v64 = math.min(v27.X, v27.Y);
                        v64 = math.min(v27.X, v27.Z);
                        local l_Model_0 = Instance.new("Model");
                        l_Model_0.Parent = v29;
                        v61 = v1.getHead(v29);
                        l_AnimationPlayed_1.Archivable = true;
                        v31 = v61:Clone();
                        assert(v31 ~= nil);
                        v31.CanCollide = false;
                        v31.Parent = l_Model_0;
                        v32 = v1.getNeck(v29, v31);
                        v33 = v31.CFrame;
                        v31:Destroy();
                        assert(v33 ~= nil);
                        v26.CFrame = CFrame.lookAt((v33.Position + v33.LookVector * (v64 * 2)) + v12, v33.Position);
                        v26.Focus = v33;
                        l_AnimationPlayed_1.Archivable = l_Archivable_0;
                        l_Model_0:Destroy();
                    end;
                end;
                if v29 == nil then
                    return ;
                else
                    local v66 = nil;
                    v66 = if not v6 then v29:FindFirstChild("Humanoid") else v29:FindFirstChildWhichIsA("Humanoid");
                    if v66 then
                        v66.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None;
                    end;
                    v20 = v1.getAnimator(v29, 0);
                    if v20 then
                        local l_v20_PlayingAnimationTracks_0 = v20:GetPlayingAnimationTracks();
                        local l_v20_PlayingAnimationTracksCoreScript_0 = v20:GetPlayingAnimationTracksCoreScript();
                        for _, v70 in ipairs(l_v20_PlayingAnimationTracks_0) do
                            if v70 ~= nil then
                                v70:Stop(0);
                                v70:Destroy();
                            end;
                        end;
                        for _, v72 in ipairs(l_v20_PlayingAnimationTracksCoreScript_0) do
                            if v72 ~= nil then
                                v72:Stop(0);
                                v72:Destroy();
                            end;
                        end;
                        if v4 then
                            v4:Destroy();
                            v4 = nil;
                        end;
                        if v57 then
                            for _, v74 in ipairs(v57:GetPlayingAnimationTracksCoreScript()) do
                                v54(v20, v74);
                            end;
                            v39[v40.AnimationPlayedCoreScript] = v57.AnimationPlayedCoreScript:Connect(function(v75)
                                v54(v20, v75);
                            end);
                            setCloneDirty(false);
                            return ;
                        end;
                    end;
                    return ;
                end;
            end;
        else
            return ;
        end;
    else
        return ;
    end;
end;
local _ = function(v77, v78)
    local _ = v77[v78];
end;
updateCachedHeadColor = function(v81)
    if v81 == nil then
        return ;
    else
        assert(v81 ~= nil);
        if pcall(function()
            local _ = v81.Color;
        end) then
            v23 = v81.Color;
            if pcall(function()
                local _ = v81.Size;
            end) then
                v24 = v81.Size;
            end;
        end;
        return ;
    end;
end;
local function _(v84)
    if v84 then
        if not v39[v40.HumanoidStateChanged] then
            v39[v40.HumanoidStateChanged] = v84.StateChanged:Connect(function(v85, v86)
                if v85 == Enum.HumanoidStateType.PlatformStanding and v86 == Enum.HumanoidStateType.Running then
                    setCloneDirty(true);
                end;
                if v86 == Enum.HumanoidStateType.GettingUp then
                    setCloneDirty(true);
                end;
            end);
        end;
        return ;
    else
        return ;
    end;
end;
local function v99(v88)
    if not v8() or v88 then
        v30 = v1.getHead(v88);
        updateCachedHeadColor(v30);
        local l_DescendantAdded_0 = v40.DescendantAdded;
        if v39[l_DescendantAdded_0] then
            v39[l_DescendantAdded_0]:Disconnect();
            v39[l_DescendantAdded_0] = nil;
        end;
        l_DescendantAdded_0 = v40.DescendantRemoving;
        if v39[l_DescendantAdded_0] then
            v39[l_DescendantAdded_0]:Disconnect();
            v39[l_DescendantAdded_0] = nil;
        end;
        l_DescendantAdded_0 = v40.HeadSize;
        if v39[l_DescendantAdded_0] then
            v39[l_DescendantAdded_0]:Disconnect();
            v39[l_DescendantAdded_0] = nil;
        end;
        l_DescendantAdded_0 = v40.Color;
        if v39[l_DescendantAdded_0] then
            v39[l_DescendantAdded_0]:Disconnect();
            v39[l_DescendantAdded_0] = nil;
        end;
        l_DescendantAdded_0 = nil;
        l_DescendantAdded_0 = if not v6 then v88:FindFirstChild("Humanoid") else v88:FindFirstChildWhichIsA("Humanoid");
        if l_DescendantAdded_0 then
            local l_l_DescendantAdded_0_0 = l_DescendantAdded_0;
            if not (not l_l_DescendantAdded_0_0 or v39[v40.HumanoidStateChanged]) then
                v39[v40.HumanoidStateChanged] = l_l_DescendantAdded_0_0.StateChanged:Connect(function(v91, v92)
                    if v91 == Enum.HumanoidStateType.PlatformStanding and v92 == Enum.HumanoidStateType.Running then
                        setCloneDirty(true);
                    end;
                    if v92 == Enum.HumanoidStateType.GettingUp then
                        setCloneDirty(true);
                    end;
                end);
            end;
        end;
        v39[v40.DescendantAdded] = v88.DescendantAdded:Connect(function(v93)
            if v93.Name == "Head" then
                v30 = v1.getHead(v88);
                updateCachedHeadColor(v30);
            end;
            if not v6 then
                if not (not (not (v93.Name ~= "Humanoid" and not v93:IsA("Humanoid")) and v93) or v39[v40.HumanoidStateChanged]) then
                    v39[v40.HumanoidStateChanged] = v93.StateChanged:Connect(function(v94, v95)
                        if v94 == Enum.HumanoidStateType.PlatformStanding and v95 == Enum.HumanoidStateType.Running then
                            setCloneDirty(true);
                        end;
                        if v95 == Enum.HumanoidStateType.GettingUp then
                            setCloneDirty(true);
                        end;
                    end);
                end;
            elseif not (not (v93:IsA("Humanoid") and v93) or v39[v40.HumanoidStateChanged]) then
                v39[v40.HumanoidStateChanged] = v93.StateChanged:Connect(function(v96, v97)
                    if v96 == Enum.HumanoidStateType.PlatformStanding and v97 == Enum.HumanoidStateType.Running then
                        setCloneDirty(true);
                    end;
                    if v97 == Enum.HumanoidStateType.GettingUp then
                        setCloneDirty(true);
                    end;
                end);
            end;
            if v1.shouldMarkCloneDirtyForDescendant(v93) then
                setCloneDirty(true);
            end;
        end);
        v39[v40.DescendantRemoving] = v88.DescendantRemoving:Connect(function(v98)
            if not (not v98 or not v98:IsA("MeshPart") and not v98:IsA("Accessory")) then
                if v98:IsA("MeshPart") and v98.MeshId == "" then
                    return ;
                elseif v1.shouldMarkCloneDirtyForDescendant(v98) then
                    setCloneDirty(true);
                end;
            end;
        end);
        setCloneDirty(true);
        v37 = true;
        return ;
    else
        return ;
    end;
end;
local function v101()
    if v25 then
        v25:Destroy();
    end;
    v25 = Instance.new("ViewportFrame");
    v25.Position = UDim2.new(0, 0, 0, 0);
    v25.Size = UDim2.new(1, 0, 1, 0);
    v25.BackgroundTransparency = 1;
    v25.Parent = v34;
    v25.Ambient = Color3.new(0.7529411765, 0.7098039216, 0.7137254902);
    v25.LightColor = Color3.new(1, 0.9960784314, 0.9960784314);
    v25.LightDirection = Vector3.new(9.5, -12, 7.5);
    v25.IsMirrored = true;
    local _ = Instance.new("UICorner");
    Instance.new("UICorner").Parent = v25;
    createCloneAnchor();
    v26 = Instance.new("Camera");
    assert(v26 ~= nil);
    v26.FieldOfView = 70;
    v25.CurrentCamera = v26;
    v26.Parent = v25;
end;
ReInit = function(v102)
    assert(v102.Character ~= nil);
    if (not l_GetFFlagSelfViewVisibilityFix_0() or not v36) or v36.Visible then
        v30 = v1.getHead(v102.Character);
        updateCachedHeadColor(v30);
        setCloneDirty(false);
        local l_CharacterAdded_0 = v40.CharacterAdded;
        if v39[l_CharacterAdded_0] then
            v39[l_CharacterAdded_0]:Disconnect();
            v39[l_CharacterAdded_0] = nil;
        end;
        l_CharacterAdded_0 = v40.CharacterRemoving;
        if v39[l_CharacterAdded_0] then
            v39[l_CharacterAdded_0]:Disconnect();
            v39[l_CharacterAdded_0] = nil;
        end;
        stopRenderStepped();
        l_CharacterAdded_0 = v40.AnimationPlayed;
        if v39[l_CharacterAdded_0] then
            v39[l_CharacterAdded_0]:Disconnect();
            v39[l_CharacterAdded_0] = nil;
        end;
        l_CharacterAdded_0 = v40.AnimationPlayedCoreScript;
        if v39[l_CharacterAdded_0] then
            v39[l_CharacterAdded_0]:Disconnect();
            v39[l_CharacterAdded_0] = nil;
        end;
        v20 = nil;
        v21 = {};
        clearCloneCharacter();
        v101();
        playerAdded(v102);
        startRenderStepped(v102);
        return ;
    else
        v43 = false;
        return ;
    end;
end;
local function v109(v104)
    if v17 then
        v17:Disconnect();
    end;
    if not v8() then
        ReInit(l_LocalPlayer_0);
    elseif v37 then
        ReInit(l_LocalPlayer_0);
    else
        v99(v104);
    end;
    local l_HumanoidStateChanged_0 = v40.HumanoidStateChanged;
    if v39[l_HumanoidStateChanged_0] then
        v39[l_HumanoidStateChanged_0]:Disconnect();
        v39[l_HumanoidStateChanged_0] = nil;
    end;
    l_HumanoidStateChanged_0 = nil;
    l_HumanoidStateChanged_0 = if not v6 then v104:FindFirstChild("Humanoid") else v104:FindFirstChildWhichIsA("Humanoid");
    if l_HumanoidStateChanged_0 then
        local l_l_HumanoidStateChanged_0_0 = l_HumanoidStateChanged_0;
        if l_l_HumanoidStateChanged_0_0 then
            if not v39[v40.HumanoidStateChanged] then
                v39[v40.HumanoidStateChanged] = l_l_HumanoidStateChanged_0_0.StateChanged:Connect(function(v107, v108)
                    if v107 == Enum.HumanoidStateType.PlatformStanding and v108 == Enum.HumanoidStateType.Running then
                        setCloneDirty(true);
                    end;
                    if v108 == Enum.HumanoidStateType.GettingUp then
                        setCloneDirty(true);
                    end;
                end);
            end;
        else
            return ;
        end;
    end;
end;
local function _(v110)
    if v110 then
        if v34 then
            assert(v34 ~= nil, "Wrapper Frame cannot be nil");
            assert(v110 ~= nil, "Frame name cannot be nil ");
            return v34:FindFirstAncestor(v110);
        else
            return nil;
        end;
    else
        return nil;
    end;
end;
_clearViewportFrame = function()
    if v25 then
        v25:Destroy();
    end;
end;
local function v112()
    if v36 then
        if not v36.Visible then
            v43 = false;
        elseif v37 then
            v43 = true;
            return ;
        else
            return ;
        end;
    end;
end;
playerAdded = function(v113)
    if v113 ~= nil and v113 == l_LocalPlayer_0 then
        if v17 ~= nil then
            v17:Disconnect();
            v17 = nil;
            local l_CharacterAdded_1 = v40.CharacterAdded;
            if v39[l_CharacterAdded_1] then
                v39[l_CharacterAdded_1]:Disconnect();
                v39[l_CharacterAdded_1] = nil;
            end;
        end;
        local l_Character_0 = v113.Character;
        l_Character_0 = if not v8() then v113.Character or v113.CharacterAdded:Wait() else v113.Character;
        v17 = v113.CharacterAdded:Connect(v109);
        if not v8() then
            assert(l_Character_0 ~= nil);
            v99(l_Character_0);
        elseif l_Character_0 then
            v99(l_Character_0);
        end;
        v39[v40.CharacterAdded] = v113.CharacterAdded:Connect(v99);
        v39[v40.CharacterRemoving] = v113.CharacterRemoving:Connect(function()
            local l_DescendantAdded_1 = v40.DescendantAdded;
            if v39[l_DescendantAdded_1] then
                v39[l_DescendantAdded_1]:Disconnect();
                v39[l_DescendantAdded_1] = nil;
            end;
            l_DescendantAdded_1 = v40.DescendantRemoving;
            if v39[l_DescendantAdded_1] then
                v39[l_DescendantAdded_1]:Disconnect();
                v39[l_DescendantAdded_1] = nil;
            end;
            l_DescendantAdded_1 = v40.HeadSize;
            if v39[l_DescendantAdded_1] then
                v39[l_DescendantAdded_1]:Disconnect();
                v39[l_DescendantAdded_1] = nil;
            end;
            l_DescendantAdded_1 = v40.Color;
            if v39[l_DescendantAdded_1] then
                v39[l_DescendantAdded_1]:Disconnect();
                v39[l_DescendantAdded_1] = nil;
            end;
            v76(nil);
            l_DescendantAdded_1 = v40.CharacterRemoving;
            if v39[l_DescendantAdded_1] then
                v39[l_DescendantAdded_1]:Disconnect();
                v39[l_DescendantAdded_1] = nil;
            end;
        end);
    end;
end;
stopRenderStepped = function()
    if v16 then
        v16:Disconnect();
        v16 = nil;
    end;
end;
updateClonePartsColor = function(v117)
    if not (not pcall(function()
        local _ = v30.Color;
    end) or not v30) and v30.Color ~= v23 then
        local l_Character_1 = l_LocalPlayer_0.Character;
        if l_Character_1 then
            assert(l_Character_1 ~= nil);
            if v29 then
                assert(v29 ~= nil);
                for _, v121 in pairs(l_Character_1:GetChildren()) do
                    if v121:IsA("MeshPart") then
                        local l_v29_FirstChild_0 = v29:FindFirstChild(v121.Name);
                        if not (((not l_v29_FirstChild_0 or not l_v29_FirstChild_0:IsA("MeshPart")) or not l_v29_FirstChild_0.Color) or not v121.Color) then
                            l_v29_FirstChild_0.Color = v121.Color;
                        end;
                    end;
                end;
            else
                return ;
            end;
        else
            return ;
        end;
    end;
    v23 = v117;
end;
startRenderStepped = function(v123)
    stopRenderStepped();
    v16 = (if not v7 then l_RunService_0.RenderStepped else l_RunService_0.Heartbeat):Connect(function(v124)
        if v7 then
            debug.profilebegin("faceclone");
        end;
        if (not l_GetFFlagSelfViewVisibilityFix_0() or not v29) or v43 then
            if l_LocalPlayer_0 then
                local l_Character_2 = l_LocalPlayer_0.Character;
                if not l_Character_2 or l_Character_2.Parent == nil then
                    return ;
                else
                    assert(l_Character_2 ~= nil);
                    if not (v30 ~= nil) or v30.Parent ~= l_Character_2 then
                        v30 = v1.getHead(l_Character_2);
                    end;
                    if v30 then
                        local v126 = v1.getAnimator(l_Character_2, 0);
                        if v20 ~= nil and v126 ~= nil then
                            assert(v20 ~= nil);
                            for _, v128 in pairs((v20:GetPlayingAnimationTracks())) do
                                if v128 ~= nil then
                                    v128:Stop(0);
                                end;
                            end;
                            local l_v126_PlayingAnimationTracks_0 = v126:GetPlayingAnimationTracks();
                            local v130 = nil;
                            v22 = {};
                            for _, v132 in ipairs(l_v126_PlayingAnimationTracks_0) do
                                v130 = v132.Animation;
                                if not (not v130 or not v130:IsA("Animation")) then
                                    if not l_GetFFlagSelfViewAssertFix_0() then
                                        v22[v130.AnimationId] = v132;
                                        if not v21[v130.AnimationId] then
                                            v21[v130.AnimationId] = v20:LoadAnimation(v130);
                                        end;
                                        local v133 = v21[v130.AnimationId];
                                        v133:Play();
                                        v133.TimePosition = v132.TimePosition;
                                        v133.Priority = v132.Priority;
                                        v133:AdjustWeight(v132.WeightCurrent, 0.1);
                                    elseif v130.AnimationId ~= "" then
                                        v22[v130.AnimationId] = v132;
                                        if not v21[v130.AnimationId] then
                                            v21[v130.AnimationId] = v20:LoadAnimation(v130);
                                        end;
                                        local v134 = v21[v130.AnimationId];
                                        v134:Play();
                                        v134.TimePosition = v132.TimePosition;
                                        v134.Priority = v132.Priority;
                                        v134:AdjustWeight(v132.WeightCurrent, 0.1);
                                    end;
                                end;
                            end;
                            for v135 in v21, nil, nil do
                                local v136 = v21[v135];
                                if v136 then
                                    v130 = v136.Animation;
                                    if not (not v130 or v22[v130.AnimationId]) then
                                        if v21[v130.AnimationId] ~= nil then
                                            v21[v130.AnimationId]:Stop(0);
                                        end;
                                        v21[v130.AnimationId] = nil;
                                    end;
                                end;
                            end;
                            for _, v138 in ipairs(v126:GetPlayingAnimationTracksCoreScript()) do
                                for _, v140 in pairs((v20:GetPlayingAnimationTracksCoreScript())) do
                                    if v140.Animation:IsA("TrackerStreamAnimation") then
                                        v140.Priority = v138.Priority;
                                        v140:AdjustWeight(v138.WeightCurrent, 0);
                                    end;
                                end;
                            end;
                        end;
                    end;
                    v38 = v38 + 1;
                    if v38 == 1 then
                        v38 = 0;
                        if v29 then
                            if not v31 then
                                v31 = v1.getHead(v29);
                                if v31 then
                                    v32 = v1.getNeck(v29, v31);
                                end;
                            end;
                            if v31 then
                                v33 = v31.CFrame;
                            end;
                        end;
                        if not (not v26 or not v31) then
                            local l_Position_0 = v31.Position;
                            local l_Position_1 = v31.Position;
                            local l_CFrame_0 = v31.CFrame;
                            if v32 then
                                local l_Part0_0 = v32.Part0;
                                local _ = v32.Part1;
                                local l_C0_0 = v32.C0;
                                local l_C1_0 = v32.C1;
                                local l_Transform_0 = v32.Transform;
                                if not (not l_Part0_0 or not l_C0_0) then
                                    l_CFrame_0 = ((l_Part0_0.CFrame * l_C0_0) * l_Transform_0) * l_C1_0:Inverse();
                                    l_Position_1 = Vector3.new(l_CFrame_0.Position.X * 0.25, ((v31.CFrame.Position.Y + l_CFrame_0.Position.Y) + l_CFrame_0.Position.Y * 0.75) * 0.33333, l_CFrame_0.Position.Z);
                                    l_Position_0 = Vector3.new(l_CFrame_0.Position.X * 0.6, ((v31.CFrame.Position.Y + l_CFrame_0.Position.Y) + l_CFrame_0.Position.Y * 0.75) * 0.33333, l_CFrame_0.Position.Z);
                                end;
                            end;
                            if not v27 then
                                warn("boundsSize is nil, this shouldn't be possible");
                            end;
                            assert(v27 ~= nil);
                            v26.CFrame = CFrame.lookAt(l_Position_0 + Vector3.new(0, v14 * 0.25, -(v27.Z + 1)), l_Position_1);
                            v26.Focus = v31.CFrame;
                        end;
                    end;
                    if v30 then
                        if v30.Size ~= v24 then
                            v24 = v30.Size;
                            setCloneDirty(true);
                        end;
                        if pcall(function()
                            local _ = v30.Color;
                        end) and v30.Color ~= v23 then
                            updateClonePartsColor(v30.Color);
                        end;
                    end;
                end;
            end;
            if v15 > 0 then
                v15 = v15 - v124;
                if v15 <= 0 then
                    v76(v123);
                    v15 = 0;
                end;
            end;
            if v7 then
                debug.profileend();
            end;
            return ;
        else
            if v20 ~= nil then
                for _, v151 in pairs((v20:GetPlayingAnimationTracks())) do
                    if v151 ~= nil then
                        v151:Stop(0);
                    end;
                end;
            end;
            return ;
        end;
    end);
end;
return function(v152, v153, v154)
    if not v153 then
        return ;
    else
        v34 = v153;
        if not (not l_GetFFlagSelfViewVisibilityFix_0() or not v154) then
            v35 = v154;
            local l_v35_0 = v35;
            local v156;
            if l_v35_0 then
                if v34 then
                    assert(v34 ~= nil, "Wrapper Frame cannot be nil");
                    assert(l_v35_0 ~= nil, "Frame name cannot be nil ");
                    v156 = v34:FindFirstAncestor(l_v35_0);
                else
                    v156 = nil;
                end;
            else
                v156 = nil;
            end;
            v36 = v156;
            if v36 then
                v36:GetPropertyChangedSignal("Visible"):Connect(v112);
            end;
        end;
        v101();
        playerAdded(v152);
        l_Players_0.PlayerAdded:Connect(playerAdded);
        l_Players_0.PlayerRemoving:Connect(function(v157)
            if v157 == l_LocalPlayer_0 then
                local l_HumanoidStateChanged_1 = v40.HumanoidStateChanged;
                if v39[l_HumanoidStateChanged_1] then
                    v39[l_HumanoidStateChanged_1]:Disconnect();
                    v39[l_HumanoidStateChanged_1] = nil;
                end;
                l_HumanoidStateChanged_1 = v40.CharacterAdded;
                if v39[l_HumanoidStateChanged_1] then
                    v39[l_HumanoidStateChanged_1]:Disconnect();
                    v39[l_HumanoidStateChanged_1] = nil;
                end;
                l_HumanoidStateChanged_1 = v40.CharacterRemoving;
                if v39[l_HumanoidStateChanged_1] then
                    v39[l_HumanoidStateChanged_1]:Disconnect();
                    v39[l_HumanoidStateChanged_1] = nil;
                end;
                stopRenderStepped();
                l_HumanoidStateChanged_1 = v40.AnimationPlayed;
                if v39[l_HumanoidStateChanged_1] then
                    v39[l_HumanoidStateChanged_1]:Disconnect();
                    v39[l_HumanoidStateChanged_1] = nil;
                end;
                l_HumanoidStateChanged_1 = v40.AnimationPlayedCoreScript;
                if v39[l_HumanoidStateChanged_1] then
                    v39[l_HumanoidStateChanged_1]:Disconnect();
                    v39[l_HumanoidStateChanged_1] = nil;
                end;
                v20 = nil;
                v21 = {};
                clearCloneCharacter();
            end;
        end);
        startRenderStepped(v152);
        return v50;
    end;
end;


local l_CorePackages_0 = game:GetService("CorePackages");
local l_CoreGui_0 = game:GetService("CoreGui");
local l_Packages_0 = l_CorePackages_0.Packages;
local l_useLocalization_0 = require(l_CorePackages_0.Workspace.Packages.Localization).Hooks.useLocalization;
local v4 = require(l_Packages_0.React);
local _ = require(l_CorePackages_0.Workspace.Packages.AppCommonLib);
local v6 = require(script.Parent.Parent.Utils.FaceChatUtils);
local v7 = require(script.Parent.Parent.Utils.ModelUtils);
local v8 = require(l_Packages_0.UIBlox);
local l_withTooltip_0 = v8.App.Dialog.TooltipV2.withTooltip;
local l_TooltipOrientation_0 = v8.App.Dialog.Enum.TooltipOrientation;
local l_ICON_SIZE_0 = require(script.Parent.Parent.Parent.Chrome.Unibar.Constants).ICON_SIZE;
local v12 = require(script.Parent.CameraStatusDot);
local v13 = require(script.Parent.FaceClone);
local v14 = require(script.Parent.Parent.Hooks.useCameraOn);
local v15 = require(script.Parent.Parent.Hooks.useLocalPlayer);
local v16 = require(script.Parent.Parent.Hooks.useTooltipDismissal);
local v17 = require(script.Parent.Parent.Parent.SelfieView.Flags.GetFFlagSelfieViewDontWaitForCharacter);
local l_GetFFlagSelfViewVisibilityFix_0 = require(l_CorePackages_0.Workspace.Packages.SharedFlags).GetFFlagSelfViewVisibilityFix;
local v19 = require(l_CoreGui_0:WaitForChild("RobloxGui").Modules.SelfView.Analytics).new();
return function(v20)
    local v21 = l_useLocalization_0({
        robloxPermissionErrorHeader = "CoreScripts.TopBar.RobloxPermissionErrorHeader",
        robloxPermissionErrorBody = "CoreScripts.TopBar.RobloxPermissionErrorBody",
        dynamicAvatarMissingErrorHeader = "CoreScripts.TopBar.DynamicAvatarMissingErrorHeader",
        dynamicAvatarMissingErrorBody = "CoreScripts.TopBar.DynamicAvatarMissingErrorBody"
    });
    local v22 = v14();
    local v23 = v15();
    local v24 = v4.useRef(nil);
    v4.useEffect(function()
        if not _G.__TESTEZ_RUNNING_TEST__ then
            local v25 = if not l_GetFFlagSelfViewVisibilityFix_0() then v13(v23, v24.current) else v13(v23, v24.current, v20.outerContainerFrameName);
            return function()
                if v25 then
                    v25();
                end;
            end;
        else
            return ;
        end;
    end, {
        v24
    });
    local v26, v27, v28, v29 = v16(2000);
    v4.useEffect(function()
        local v30 = v20.activatedSignal:connect(function()
            if v6.getPermissions().userCamEligible then
                if v6.getPermissions().userCamEnabled then
                    if not v17() then
                        if not (v7.hasDynamicHead(v23.Character or v23.CharacterAdded:Wait()) or v6.isCameraOn()) then
                            v29(v21.dynamicAvatarMissingErrorHeader, v21.dynamicAvatarMissingErrorBody);
                        end;
                    elseif not ((not v23.Character or v7.hasDynamicHead(v23.Character)) or v6.isCameraOn()) then
                        v29(v21.dynamicAvatarMissingErrorHeader, v21.dynamicAvatarMissingErrorBody);
                    end;
                    v19:setLastCtx("SelfView");
                    v6.toggleVideoAnimation();
                    return ;
                else
                    v29(v21.robloxPermissionErrorHeader, v21.robloxPermissionErrorBody);
                    return ;
                end;
            else
                return ;
            end;
        end);
        return function()
            v30.disconnect();
        end;
    end, {
        v20.activatedSignal
    });
    return l_withTooltip_0({
        headerText = v26,
        bodyText = v27,
        textXAlignment = Enum.TextXAlignment.Left
    }, {
        guiTarget = l_CoreGui_0,
        active = v28,
        DisplayOrder = 100,
        preferredOrientation = l_TooltipOrientation_0.Bottom
    }, function(v31)
        return v4.createElement("Frame", {
            Size = UDim2.fromScale(1, 1),
            BackgroundTransparency = 1,
            [v4.Change.AbsoluteSize] = v31,
            [v4.Change.AbsolutePosition] = v31
        }, {
            CameraStatusDot = not not v22 and v4.createElement(v12, {
                Position = UDim2.fromScale(0.8, 0.7),
                ZIndex = 2
            }) or nil,
            WrapperCanvasGroup = v4.createElement("CanvasGroup", {
                ref = v24,
                Size = UDim2.fromOffset(l_ICON_SIZE_0, l_ICON_SIZE_0),
                AnchorPoint = Vector2.new(0.5, 0.5),
                Position = UDim2.fromScale(0.5, 0.5),
                BackgroundColor3 = Color3.fromHex("#DEEBF1")
            }, {
                Corner = v4.createElement("UICorner", {
                    CornerRadius = UDim.new(1, 0)
                })
            })
        });
    end);
end;