local l_script_FirstAncestor_0 = script:FindFirstAncestor("AnimationClipEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.Roact);
local v2 = require(l_script_FirstAncestor_0.Packages.RoactRodux);
local l_ContextServices_0 = require(l_script_FirstAncestor_0.Packages.Framework).ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Focus_0 = l_ContextServices_0.Focus;
local l_CoreGui_0 = game:GetService("CoreGui");
local v7 = require(l_script_FirstAncestor_0.Src.Util.RigUtils);
local v8 = require(l_script_FirstAncestor_0.Src.Util.RigInfo);
local v9 = require(l_script_FirstAncestor_0.Src.Util.Constants);
local v10 = require(l_script_FirstAncestor_0.Src.Thunks.Recording.LoadRecorderFrames);
local v11 = require(l_script_FirstAncestor_0.Src.Thunks.Recording.SetFacialRecordingMode);
local v12 = require(l_script_FirstAncestor_0.Src.Actions.SetHaveToSetBackToNotLooping);
local v13 = require(l_script_FirstAncestor_0.Src.Actions.SetAnimationData);
local v14 = require(l_script_FirstAncestor_0.Src.Components.FacialAnimationRecorder.CameraSelectionDialog);
local v15 = require(l_script_FirstAncestor_0.Src.Components.FacialAnimationRecorder.ShowStyledDialog);
local v16 = require(l_script_FirstAncestor_0.Src.Components.FacialAnimationRecorder.WarningDialog);
local v17 = require(l_script_FirstAncestor_0.Src.Components.FacialAnimationRecorder.WarningOverlay);
local v18 = require(l_script_FirstAncestor_0.Src.Util.AnimationData);
local l_RunService_0 = game:GetService("RunService");
local l_VideoCaptureService_0 = game:GetService("VideoCaptureService");
local l_FaceAnimatorService_0 = game:GetService("FaceAnimatorService");
local v22 = v1.PureComponent:extend("FacialAnimationRecorder");
local v23 = game:DefineFastInt("FacialAnimationRecorderMaxRecordingTimeInSeconds", 60);
local v24 = game:DefineFastString("ACEFaceRecorderBiometricsLink", "https://en.help.roblox.com/hc/articles/8064749848980");
local v25 = require(l_script_FirstAncestor_0.Packages.Framework);
local l_StyleModifier_0 = v25.Util.StyleModifier;
local _ = v25.Util.StyleValue;
local l_UI_0 = v25.UI;
local l_Pane_0 = l_UI_0.Pane;
local l_Button_0 = v25.UI.Button;
local _ = l_UI_0.TextLabel;
local l_Container_0 = l_UI_0.Container;
local l_Tooltip_0 = l_UI_0.Tooltip;
local l_HoverArea_0 = l_UI_0.HoverArea;
local l_LoadingIndicator_0 = l_UI_0.LoadingIndicator;
local v36 = require(script.Parent.FlashingDot);
local v37 = require(l_script_FirstAncestor_0.Src.Actions.SetPlayState);
local v38 = require(l_script_FirstAncestor_0.Src.Actions.SetInReviewState);
local v39 = require(l_script_FirstAncestor_0.Src.Thunks.Playback.StepAnimation);
local l_Selection_0 = game:GetService("Selection");
local v41 = false;
local v42 = false;
v22.init = function(v43)
    v43.presentationGui = l_CoreGui_0.RobloxGui;
    v43.focus = l_Focus_0.new(v43.presentationGui);
    v43:setState({
        remainingSeconds = 0,
        shouldShowCameraSelectionDialog = false,
        isAgeRestricted = false,
        shouldShowNoCamerasWarning = false,
        deniedCameraPermission = false
    });
    v43.startRecording = function()
        v43.timeAtStartOfRecording = os.clock();
        v43.props.Analytics:report("onFacialAnimationRecordingStartRecording");
        v43:setState({
            isRecording = true
        });
    end;
    v43.resetLooping = function()
        local l_props_0 = v43.props;
        if l_props_0.haveToSetBackToNotLooping then
            l_props_0.haveToSetBackToNotLooping = false;
            local l_AnimationData_0 = l_props_0.AnimationData;
            if not (not l_AnimationData_0 or not l_AnimationData_0.Metadata.Looping) then
                v18.setLooping(l_AnimationData_0, false);
                l_props_0:SetAnimationData(l_AnimationData_0);
            end;
            return ;
        else
            return ;
        end;
    end;
    v43.endRecording = function()
        v43.timeAtEndOfRecording = os.clock();
        local l_props_1 = v43.props;
        l_props_1.Analytics:report("onFacialAnimationRecordingEndRecording", not not v43.timeAtStartOfRecording and v43.timeAtEndOfRecording - v43.timeAtStartOfRecording or 0);
        l_props_1.SetInReviewState(true);
        v43:setState({
            isRecording = false
        });
        v41 = v18.hasFacsData(v43.props.AnimationData);
        l_props_1:LoadRecorderFrames(v43.RecordedFrames, l_props_1.Analytics);
        l_props_1.SetFacialRecordingMode(false);
        v43:disconnect();
        l_props_1.StepAnimation(0);
        l_props_1.SetPlayState(v9.PLAY_STATE.Play);
        local v47 = nil;
        v47 = l_Selection_0.SelectionChanged:Connect(function(_)
            v47:Disconnect();
            l_props_1.SetInReviewState(false);
        end);
    end;
    v43.showCameraSelectionDialog = function()
        v43:setState({
            shouldShowCameraSelectionDialog = true
        });
    end;
    v43.hideCameraSelectionDialog = function()
        v43:setState({
            shouldShowCameraSelectionDialog = false
        });
    end;
    v43.movePlayheadToBeginning = function()
        wait(0.1);
        if v43.props.RootInstance then
            v43.props.StepAnimation(0);
        end;
    end;
    v43.dismissSelf = function()
        local l_props_2 = v43.props;
        l_props_2.SetInReviewState(false);
        l_props_2.SetFacialRecordingMode(false);
        v43.movePlayheadToBeginning();
    end;
    v43.toggleRecording = function()
        if not v43.state.isRecording then
            v43.startRecording();
            return ;
        else
            v43.endRecording();
            return ;
        end;
    end;
    v43.triggerReRecording = function()
        local l_props_3 = v43.props;
        l_props_3.Analytics:report("onFacialAnimationRecordingReRecordPressed");
        v42 = true;
        v43.resetLooping();
        l_props_3.SetPlayState(v9.PLAY_STATE.Pause);
        v43.movePlayheadToBeginning();
        v43.props.SetInReviewState(false);
        v43.props.SetFacialRecordingMode(true);
        v43:InitializeRecordingMode();
    end;
    v43.showAgeRestrictionError = function()
        local l_props_4 = v43.props;
        local l_Localization_0 = l_props_4.Localization;
        v43:setState({
            isAgeRestricted = true
        });
        v15(l_props_4.Plugin, l_props_4.Localization, l_props_4.Stylizer, l_props_4.Mouse, v16, {
            Title = l_Localization_0:getText("FaceCapture", "WarningTitle"),
            TitleText = l_Localization_0:getText("FaceCapture", "AgeRestrictedTitle"),
            BodyText = l_Localization_0:getText("FaceCapture", "AgeRestrictedBody"),
            Buttons = {
                {
                    Key = "Ok",
                    Text = l_props_4.Localization:getText("FaceCapture", "WarningDialogOk"),
                    Style = "RoundPrimary"
                }
            },
            OnButtonPressed = v43.dismissSelf,
            OnClose = v43.dismissSelf
        });
    end;
    v43.showBiometricDataCollectionDialog = function()
        local l_props_5 = v43.props;
        local l_Localization_1 = l_props_5.Localization;
        local l_FacialAnimationRecordingService_0 = game:GetService("FacialAnimationRecordingService");
        v15(l_props_5.Plugin, l_props_5.Localization, l_props_5.Stylizer, l_props_5.Mouse, v16, {
            Title = l_Localization_1:getText("FaceCapture", "WarningTitle"),
            TitleText = l_Localization_1:getText("FaceCapture", "BioDataCollectionTitle"),
            BodyText = l_Localization_1:getText("FaceCapture", "BioDataCollectionBody"),
            Buttons = {
                {
                    Key = "Disagree",
                    Text = l_Localization_1:getText("FaceCapture", "BioDataCollectionDisagree"),
                    Style = "Round"
                },
                {
                    Key = "Agree",
                    Text = l_Localization_1:getText("FaceCapture", "BioDataCollectionAgree"),
                    Style = "Round"
                }
            },
            OnButtonPressed = function(v56)
                if v56 == "Agree" then
                    l_FacialAnimationRecordingService_0.BiometricDataConsent = true;
                    v43:StartupInitialize();
                    return ;
                else
                    v43.dismissSelf();
                    return ;
                end;
            end,
            OnClose = v43.dismissSelf,
            learnMoreUrl = v24,
            learnMoreLabel = l_Localization_1:getText("FaceCapture", "LearnMoreLabel")
        });
    end;
    v43.numberOfCameras = function()
        local l_l_VideoCaptureService_0_CameraDevices_0 = l_VideoCaptureService_0:GetCameraDevices();
        local v58 = 0;
        for _ in pairs(l_l_VideoCaptureService_0_CameraDevices_0) do
            v58 = v58 + 1;
        end;
        return v58;
    end;
    v43.checkAndShowCameraWarning = function()
        v43:setState({
            shouldShowNoCamerasWarning = v43.numberOfCameras() == 0
        });
    end;
    v43.checkOrRequestCameraPermission = function()
        local l_FacialAnimationRecordingService_1 = game:GetService("FacialAnimationRecordingService");
        local v61 = {
            AUTHORIZED = "AUTHORIZED",
            DENIED = "DENIED"
        };
        local l_status_0, l_result_0 = pcall(function()
            return l_FacialAnimationRecordingService_1:CheckOrRequestCameraPermission();
        end);
        if l_status_0 then
            v43:setState({
                deniedCameraPermission = l_result_0 == v61.DENIED
            });
            return ;
        else
            return ;
        end;
    end;
end;
v22.updateAvatarData = function(v64)
    local l_RootInstance_0 = v64.props.RootInstance;
    if not v64.Animator then
        v64.Animator = v8.getAnimationController(l_RootInstance_0):FindFirstChildOfClass("Animator");
    end;
end;
v22.InitializeRecordingMode = function(v66)
    if l_FaceAnimatorService_0 then
        l_FaceAnimatorService_0.FlipHeadOrientation = false;
        if not l_FaceAnimatorService_0:IsStarted() then
            l_FaceAnimatorService_0:Init(true, false);
        end;
        task.defer(v66.checkOrRequestCameraPermission);
        v66.RecordInfo = {};
        v66.RecordedFrames = {};
        v66.HeartbeatCount = 0;
        v7.clearPose(v66.props.Status.RootInstance);
        v7.focusCameraOnFace(v66.props.RootInstance);
        v66:updateAvatarData();
        v66.animation = Instance.new("TrackerStreamAnimation");
        v66.track = v66.Animator:LoadStreamAnimation(v66.animation);
        if v66.track then
            v66.track:Play();
            v66.heartbeatSignal = l_RunService_0.Heartbeat:Connect(function(v67)
                local l_v66_0 = v66;
                l_v66_0.HeartbeatCount = l_v66_0.HeartbeatCount + 1;
                l_v66_0 = v66.state.isRecording;
                if math.fmod(v66.HeartbeatCount, 30) == 0 then
                    v66.checkAndShowCameraWarning();
                end;
                v66:updateAvatarData();
                l_FaceAnimatorService_0:Step();
                v66.Animator:StepAnimations(v67);
                local l_TrackerData_0, v70, v71 = v66.track:GetTrackerData();
                local v72 = v71 > 0;
                v66:setState({
                    isCameraReady = v72
                });
                if not (not l_v66_0 or not v72) then
                    if not v66.RecordInfo.startTime then
                        v66.RecordInfo.startTime = v71;
                    end;
                    local l_v23_0 = v23;
                    local v74 = v71 - v66.RecordInfo.startTime;
                    local v75 = l_v23_0 - v74;
                    if v75 < 0 then
                        v66.endRecording();
                    end;
                    local v76 = math.floor(v74 * v9.TICK_FREQUENCY + 0.5);
                    local v77 = {};
                    for v78, v79 in pairs(l_TrackerData_0) do
                        v77[v78] = v79;
                    end;
                    v77.Head = v70;
                    v66.RecordedFrames[v76] = v77;
                    local v80 = math.floor(v75);
                    if v66.state.remainingSeconds ~= v80 then
                        v66:setState({
                            remainingSeconds = v80
                        });
                    end;
                end;
            end);
            return ;
        else
            return ;
        end;
    else
        return ;
    end;
end;
v22.StartupInitialize = function(v81)
    local l_FacialAnimationRecordingService_2 = game:GetService("FacialAnimationRecordingService");
    v42 = false;
    v41 = false;
    v81.props.SetInReviewState(false);
    v81.resetLooping();
    if not l_FacialAnimationRecordingService_2:IsAgeRestricted() then
        if l_FacialAnimationRecordingService_2.BiometricDataConsent then
            v81:InitializeRecordingMode();
            return ;
        else
            v81.showBiometricDataCollectionDialog();
            return ;
        end;
    else
        v81.showAgeRestrictionError();
        return ;
    end;
end;
v22.didMount = function(v83)
    v83:StartupInitialize();
end;
v22.render = function(v84)
    local l_props_6 = v84.props;
    local l_Stylizer_0 = l_props_6.Stylizer;
    local l_Localization_2 = v84.props.Localization;
    local l_isRecording_0 = v84.state.isRecording;
    local l_inReviewState_0 = l_props_6.inReviewState;
    local _ = l_props_6.haveToSetBackToNotLooping;
    local l_isCameraReady_0 = v84.state.isCameraReady;
    local l_isAgeRestricted_0 = v84.state.isAgeRestricted;
    local l_remainingSeconds_0 = v84.state.remainingSeconds;
    local l_deniedCameraPermission_0 = v84.state.deniedCameraPermission;
    local l_shouldShowCameraSelectionDialog_0 = v84.state.shouldShowCameraSelectionDialog;
    local l_shouldShowNoCamerasWarning_0 = v84.state.shouldShowNoCamerasWarning;
    local _ = l_props_6.StepAnimation;
    local _ = v84.state.AnimationData;
    local l_faceCaptureDefaultButtonIconColor_0 = l_Stylizer_0.faceCaptureTheme.faceCaptureDefaultButtonIconColor;
    local l_stopRecordingButtonImage_0 = l_Stylizer_0.faceCaptureTheme.stopRecordingButtonImage;
    local l_errorIcon_0 = l_Stylizer_0.faceCaptureTheme.errorIcon;
    return l_ContextServices_0.provide({
        v84.focus
    }, {
        RecordingPanelPortal = not l_isAgeRestricted_0 and v1.createElement(v1.Portal, {
            target = v84.presentationGui
        }, {
            RecordingPanelContainer = v1.createElement(l_Container_0, {
                Size = UDim2.new(0, 160, 0, 38),
                Position = UDim2.new(0.5, 0, 1, -5),
                AnchorPoint = Vector2.new(0.5, 1),
                Padding = {
                    Left = 5,
                    Right = 5
                }
            }, {
                RecordingPanel = v1.createElement(l_Pane_0, {
                    Size = UDim2.new(1, 0, 1, 0),
                    Padding = {
                        Left = 40,
                        Right = 40
                    },
                    Layout = Enum.FillDirection.Horizontal,
                    Spacing = 3,
                    VerticalAlignment = Enum.VerticalAlignment.Center,
                    ZIndex = 1,
                    Style = "RoundBox",
                    Image = "",
                    BackgroundColor3 = l_props_6.Stylizer.Color,
                    BackgroundTransparency = 0.1,
                    ImageTransparency = 0.1
                }, {
                    Corner = v1.createElement("UICorner", {
                        CornerRadius = UDim.new(0, 8)
                    }),
                    RecordButton = not l_inReviewState_0 and v1.createElement(l_Button_0, {
                        Size = UDim2.new(0, 30, 0, 30),
                        Position = UDim2.new(0, 0, 0, 0),
                        ImageTransparency = 1,
                        BackgroundTransparency = 0.5,
                        BorderSizePixel = 1,
                        OnClick = v84.toggleRecording,
                        Text = "",
                        LayoutOrder = 1,
                        Style = {
                            BackgroundTransparency = 1,
                            BorderSizePixel = 0
                        },
                        StyleModifier = not l_isCameraReady_0 and l_StyleModifier_0.Disabled or nil
                    }, {
                        Image = v1.createElement("ImageLabel", {
                            BackgroundTransparency = 1,
                            Size = UDim2.new(0, 30, 0, 30),
                            Position = UDim2.new(0, 0, 0, 0),
                            Image = not not l_isRecording_0 and l_stopRecordingButtonImage_0 or "rbxasset://textures/AnimationEditor/FaceCaptureUI/button_control_record.png"
                        }),
                        Tooltip = v1.createElement(l_Tooltip_0, {
                            Text = not not l_isRecording_0 and l_Localization_2:getText("FaceCapture", "TooltipStopRecording") or l_Localization_2:getText("FaceCapture", "TooltipStartRecording")
                        });
                        v1.createElement(l_HoverArea_0, {
                            Cursor = "PointingHand"
                        })
                    }),
                    ReRecordButton = l_inReviewState_0 and v1.createElement(l_Button_0, {
                        Size = UDim2.new(0, 30, 0, 30),
                        Position = UDim2.new(0, 0, 0, 0),
                        ImageTransparency = 1,
                        BackgroundTransparency = 0.5,
                        BorderSizePixel = 1,
                        OnClick = v84.triggerReRecording,
                        Text = "",
                        LayoutOrder = 1,
                        Style = {
                            BackgroundTransparency = 1,
                            BorderSizePixel = 0
                        },
                        StyleModifier = not l_isCameraReady_0 and l_StyleModifier_0.Disabled or nil
                    }, {
                        Image = v1.createElement("ImageLabel", {
                            BackgroundTransparency = 1,
                            Size = UDim2.new(0, 30, 0, 30),
                            Position = UDim2.new(0, 0, 0, 0),
                            Image = "rbxasset://textures/AnimationEditor/FaceCaptureUI/ReRecordButton.png",
                            ImageColor3 = l_faceCaptureDefaultButtonIconColor_0
                        }),
                        Tooltip = v1.createElement(l_Tooltip_0, {
                            Text = l_Localization_2:getText("FaceCapture", "TooltipReRecording")
                        });
                        v1.createElement(l_HoverArea_0, {
                            Cursor = "PointingHand"
                        })
                    }),
                    FlashingDot = l_isRecording_0 and v1.createElement(v36, {
                        Size = UDim2.new(0, 20, 0, 7),
                        PaddingLeft = 30,
                        LayoutOrder = 2
                    }),
                    TextLabelButton = l_isCameraReady_0 and v1.createElement(l_Button_0, {
                        Size = (not not l_isRecording_0 and l_remainingSeconds_0) and UDim2.new(0, 68, 1, 0) or UDim2.new(0, 60, 1, 0),
                        Position = UDim2.new(0, 0, 0, 0),
                        ImageTransparency = 1,
                        BackgroundTransparency = 0.5,
                        BorderSizePixel = 1,
                        OnClick = (not not l_inReviewState_0 and v84.triggerReRecording or not (l_inReviewState_0 or l_isRecording_0) and v84.toggleRecording) or (not l_inReviewState_0 and l_isRecording_0) and v84.toggleRecording,
                        TextXAlignment = Enum.TextXAlignment.Center,
                        TextTruncate = Enum.TextTruncate.None,
                        TextSize = 15,
                        Text = not not l_inReviewState_0 and l_Localization_2:getText("FaceCapture", "PanelReRecording") or not l_inReviewState_0 and (l_isRecording_0 and l_remainingSeconds_0 .. " sec   " or l_Localization_2:getText("FaceCapture", "PanelReady")),
                        LayoutOrder = 3,
                        Style = {
                            BackgroundTransparency = 1,
                            BorderSizePixel = 0,
                            TextColor = l_props_6.Stylizer.TextColor
                        }
                    }),
                    LoadingIndicator = (not l_inReviewState_0 and not l_isCameraReady_0) and v1.createElement(l_LoadingIndicator_0, {
                        Size = UDim2.new(0, 60, 0, 15),
                        LayoutOrder = 2
                    }),
                    CameraSelectionButton = (not l_inReviewState_0 and not l_isRecording_0) and v1.createElement(l_Button_0, {
                        Size = UDim2.fromOffset(30, 30),
                        Style = {
                            BackgroundTransparency = 1,
                            BorderSizePixel = 0
                        },
                        Text = "",
                        TextSize = 30,
                        OnClick = v84.showCameraSelectionDialog,
                        LayoutOrder = 4
                    }, {
                        Image = v1.createElement("ImageLabel", {
                            BackgroundTransparency = 1,
                            Size = UDim2.new(0, 30, 0, 30),
                            Position = UDim2.new(0, 0, 0, 0),
                            Image = "rbxasset://textures/AnimationEditor/FaceCaptureUI/MoreButton.png",
                            ImageColor3 = l_faceCaptureDefaultButtonIconColor_0
                        }),
                        Tooltip = v1.createElement(l_Tooltip_0, {
                            Text = l_Localization_2:getText("FaceCapture", "TooltipCameraSettings"),
                            Position = UDim2.new(0, 50, 0, 50)
                        });
                        v1.createElement(l_HoverArea_0, {
                            Cursor = "PointingHand"
                        })
                    })
                }),
                DismissButton = v1.createElement(l_Button_0, {
                    Style = {
                        BackgroundTransparency = 1,
                        BorderSizePixel = 0
                    },
                    Size = UDim2.new(0, 16, 0, 16),
                    Position = UDim2.new(1, 0, 0, 0),
                    AnchorPoint = Vector2.new(0.5, 0.5),
                    ZIndex = 10,
                    OnClick = function()
                        v84.dismissSelf();
                    end
                }, {
                    Image = v1.createElement("ImageLabel", {
                        BackgroundTransparency = 1,
                        Size = UDim2.new(0, 16, 0, 16),
                        Image = "rbxasset://textures/AnimationEditor/FaceCaptureUI/CloseButton.png"
                    })
                })
            }),
            WarningsPane = v1.createElement(l_Pane_0, {
                AutomaticSize = Enum.AutomaticSize.XY,
                Position = UDim2.new(0.5, 0, 1, -50),
                AnchorPoint = Vector2.new(0.5, 1),
                Layout = Enum.FillDirection.Vertical,
                Spacing = 8,
                VerticalAlignment = Enum.VerticalAlignment.Center,
                ZIndex = 1,
                Style = "RoundBox",
                ImageTransparency = 1
            }, {
                NoCameraWarningOverlay = l_shouldShowNoCamerasWarning_0 and v1.createElement(v17, {
                    TitleText = l_Localization_2:getText("FaceCapture", "NoCameraWarningText"),
                    Image = l_errorIcon_0,
                    LayoutOrder = 1
                }),
                CameraPermissionDeniedWarningOverlay = l_deniedCameraPermission_0 and v1.createElement(v17, {
                    TitleText = l_Localization_2:getText("FaceCapture", "CameraPermissionDeniedWarningText"),
                    Image = l_errorIcon_0,
                    LayoutOrder = 2
                }),
                DetectingCameraOverlay = ((((not l_inReviewState_0 and not l_isCameraReady_0) and not l_isRecording_0) and not l_shouldShowNoCamerasWarning_0) and not l_deniedCameraPermission_0) and v1.createElement(v17, {
                    TitleText = l_Localization_2:getText("FaceCapture", "DetectingCameraTitle"),
                    Image = "",
                    LayoutOrder = 3
                }),
                PreviousFacsWillBeOverwrittenInfoOverlay = (((l_inReviewState_0 and l_isCameraReady_0) and not l_isRecording_0) and (((not v42 and v41) and v84.timeAtEndOfRecording) and os.clock() - v84.timeAtEndOfRecording <= 5)) and v1.createElement(v17, {
                    TitleText = l_Localization_2:getText("FaceCapture", "OverwritingPreviousFacsTracksBody"),
                    Image = "",
                    LayoutOrder = 4
                })
            })
        }),
        CameraSelectionDialog = l_shouldShowCameraSelectionDialog_0 and v1.createElement(v14, {
            OnClose = v84.hideCameraSelectionDialog
        })
    });
end;
v22.disconnect = function(v102)
    if v102.heartbeatSignal then
        v102.heartbeatSignal:Disconnect();
    end;
    if v102.track then
        v102.track:Stop(0);
    end;
    if v102.Animator then
        v102.Animator:StepAnimations(0);
    end;
end;
v22.willUnmount = function(v103)
    v42 = false;
    v103.resetLooping();
    v103.props.SetInReviewState(false);
    v103:disconnect();
end;
return v2.connect(function(v104, _)
    return {
        AnimationData = v104.AnimationData,
        PlayState = v104.Status.PlayState,
        RootInstance = v104.Status.RootInstance,
        Status = v104.Status,
        inReviewState = v104.Status.inReviewState,
        haveToSetBackToNotLooping = v104.Status.haveToSetBackToNotLooping
    };
end, function(v106)
    return {
        LoadRecorderFrames = function(v107, v108, v109)
            v106(v10(v107, v108, v109));
        end,
        SetFacialRecordingMode = function(v110)
            v106(v11(v110));
        end,
        SetInReviewState = function(v111)
            v106(v38(v111));
        end,
        SetPlayState = function(v112)
            v106(v37(v112));
        end,
        StepAnimation = function(v113)
            v106(v39(v113));
        end,
        SetHaveToSetBackToNotLooping = function(v114)
            v106(v12(v114));
        end,
        SetAnimationData = function(_, v116)
            v106(v13(v116));
            local _ = v116.Metadata.Looping;
            v106(v39(0));
        end
    };
end)((l_withContext_0({
    Stylizer = l_ContextServices_0.Stylizer,
    Analytics = l_ContextServices_0.Analytics,
    Localization = l_ContextServices_0.Localization,
    Mouse = l_ContextServices_0.Mouse,
    Plugin = l_ContextServices_0.Plugin
})(v22)));


local l_RunService_0 = game:GetService("RunService");
local l_script_FirstAncestor_0 = script:FindFirstAncestor("AnimationClipEditor");
local v2 = require(l_script_FirstAncestor_0.Packages.Framework);
local v3 = require(l_script_FirstAncestor_0.Packages.Roact);
local l_ContextServices_0 = v2.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Typecheck_0 = v2.Util.Typecheck;
local v7 = v3.PureComponent:extend("FlashingDot");
l_Typecheck_0.wrap(v7, script);
v7.init = function(v8)
    v8.state = {
        time = 1.5707963267948966,
        sinTime = 1,
        animatingDotIndex = 1
    };
end;
v7.didMount = function(v9)
    v9.animationConnection = l_RunService_0.RenderStepped:connect(function(v10)
        v9:updateAnimation(v10);
    end);
end;
v7.willUnmount = function(v11)
    if v11.animationConnection then
        v11.animationConnection:Disconnect();
    end;
end;
v7.updateAnimation = function(v12, v13)
    v12:setState(function(v14, _)
        local l_sinTime_0 = v14.sinTime;
        local l_animatingDotIndex_0 = v14.animatingDotIndex;
        local v18 = v14.time + v13;
        local v19 = math.sin(v18 * 5);
        if not (not (l_sinTime_0 >= 0) or v19 >= 0) or l_sinTime_0 < 0 and v19 >= 0 then
            l_animatingDotIndex_0 = l_animatingDotIndex_0 % 1 + 1;
        end;
        return {
            time = v18,
            sinTime = v19,
            animatingDotIndex = l_animatingDotIndex_0
        };
    end);
end;
lerpNum = function(v20, v21, v22)
    return v20 + (v21 - v20) * v22;
end;
v7.render = function(v23)
    local l_props_0 = v23.props;
    local l_state_0 = v23.state;
    local l_AnchorPoint_0 = l_props_0.AnchorPoint;
    local l_Position_0 = l_props_0.Position;
    local l_ZIndex_0 = l_props_0.ZIndex;
    local l_LayoutOrder_0 = l_props_0.LayoutOrder;
    local v30 = l_props_0.Size or l_props_0.Stylizer.Size;
    local v31 = l_props_0.PaddingLeft or 0;
    local v32 = Color3.new(1, 1, 1);
    local v33 = {
        UIListLayout = v3.createElement("UIListLayout", {
            SortOrder = Enum.SortOrder.LayoutOrder,
            FillDirection = Enum.FillDirection.Horizontal,
            Padding = UDim.new(1, 0),
            HorizontalAlignment = Enum.HorizontalAlignment.Center,
            VerticalAlignment = Enum.VerticalAlignment.Center
        })
    };
    local v34 = math.abs(l_state_0.sinTime);
    local l_animatingDotIndex_1 = l_state_0.animatingDotIndex;
    for v36 = 1, 1 do
        local v37 = 0.5;
        if v36 == l_animatingDotIndex_1 then
            v37 = lerpNum(0.5, 0, v34);
        end;
        v33["Frame" .. v36] = v3.createElement("Frame", {
            Size = UDim2.new(0.6666666666666666, v31, 0.6666666666666666, 0),
            LayoutOrder = v36,
            BorderSizePixel = 0,
            BackgroundColor3 = v32,
            BackgroundTransparency = 1
        }, {
            Image = v3.createElement("ImageLabel", {
                AnchorPoint = Vector2.new(0, 0.5),
                BackgroundTransparency = 1,
                Size = UDim2.new(0, 8, 0, 8),
                Position = UDim2.new(0, v31, 0.5, 0),
                Image = "rbxasset://textures/AnimationEditor/FaceCaptureUI/FlashingDot.png",
                ImageTransparency = v37,
                LayoutOrder = 2
            })
        });
    end;
    return v3.createElement("Frame", {
        AnchorPoint = l_AnchorPoint_0,
        Position = l_Position_0,
        Size = v30,
        ZIndex = l_ZIndex_0,
        LayoutOrder = l_LayoutOrder_0,
        BorderSizePixel = 0,
        BackgroundTransparency = 1
    }, v33);
end;
return (l_withContext_0({
    Stylizer = l_ContextServices_0.Stylizer
})(v7));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AnimationClipEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.Roact);
local v2 = require(l_script_FirstAncestor_0.Packages.RoactRodux);
local v3 = require(l_script_FirstAncestor_0.Packages.Framework);
local l_Button_0 = v3.UI.Button;
local l_StyleModifier_0 = v3.Util.StyleModifier;
local l_GetTextSize_0 = v3.Util.GetTextSize;
local l_ContextServices_0 = v3.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local v9 = require(l_script_FirstAncestor_0.Src.Util.RigUtils);
local v10 = require(l_script_FirstAncestor_0.Src.Thunks.Recording.ToggleRecordingAndEndReview);
local v11 = require(l_script_FirstAncestor_0.Src.Components.TeachingCallout);
local v12 = v1.PureComponent:extend("RecordingModeButton");
v12.init = function(_)
end;
v12.render = function(v14)
    local l_Localization_0 = v14.props.Localization;
    local l_props_0 = v14.props;
    local l_Stylizer_0 = l_props_0.Stylizer;
    local l_button_0 = l_Stylizer_0.button;
    local _ = v14.state;
    local l_Analytics_0 = l_props_0.Analytics;
    local l_ReadOnly_0 = l_props_0.ReadOnly;
    local function v22()
        l_props_0.ToggleRecordingAndEndReview(l_Analytics_0);
    end;
    local v23 = v9.canUseFaceControlsEditor(l_props_0.RootInstance);
    local v24 = l_Localization_0:getText("FaceCapture", "MainButtonTitle");
    local l_textSize_0 = l_Stylizer_0.ikTheme.textSize;
    local l_font_0 = l_Stylizer_0.font;
    return v14.props.RootInstance and v1.createElement("Frame", {
        Position = l_props_0.Position,
        Size = UDim2.new(0, l_GetTextSize_0(v24, l_textSize_0, l_font_0, Vector2.new(1000, 1000)).X + 10, 0, 18),
        BackgroundTransparency = 1,
        AnchorPoint = Vector2.new(0, 0.5),
        LayoutOrder = 3
    }, {
        FaceControlsEditorButton = (l_props_0.RootInstance and v23) and v1.createElement(l_Button_0, {
            Style = if not l_props_0.inReviewState then l_button_0.FaceControlsEditorDefault else "RoundPrimary",
            StyleModifier = if not l_ReadOnly_0 then nil else l_StyleModifier_0.Disabled,
            Size = UDim2.new(1, 0, 1, 0),
            IsDisabled = true,
            OnClick = v22
        }, {
            Label = v1.createElement("TextLabel", {
                BackgroundTransparency = 1,
                Size = UDim2.new(1, 0, 1, 0),
                TextYAlignment = Enum.TextYAlignment.Center,
                TextSize = l_textSize_0,
                Text = v24,
                Font = l_font_0,
                TextColor3 = l_Stylizer_0.ikTheme.textColor
            }, {
                TeachingCallout = if not not l_props_0.RootInstance and v23 then v1.createElement(v11, {
                    Offset = Vector2.new(0, 6),
                    DefinitionId = "FaceRecorderCallout",
                    LocationId = "RecordingModeButton"
                }) else nil
            })
        })
    });
end;
return v2.connect(function(v27, _)
    return {
        inReviewState = v27.Status.inReviewState,
        ReadOnly = v27.Status.ReadOnly,
        RootInstance = v27.Status.RootInstance
    };
end, function(v29)
    return {
        ToggleRecordingAndEndReview = function(v30)
            v29(v10(v30));
        end
    };
end)((l_withContext_0({
    Stylizer = l_ContextServices_0.Stylizer,
    Localization = l_ContextServices_0.Localization,
    Analytics = l_ContextServices_0.Analytics
})(v12)));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AnimationClipEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.Roact);
local v2 = require(l_script_FirstAncestor_0.Packages.Framework);
local v3 = require(l_script_FirstAncestor_0.Src.Util.Theme);
local v4 = require(l_script_FirstAncestor_0.Packages.Cryo);
local l_ContextServices_0 = v2.ContextServices;
local _ = l_ContextServices_0.withContext;
return function(v7, v8, _, v10, v11, v12)
    local v13 = nil;
    local function v15(v14)
        if v13 then
            v1.unmount(v13);
        end;
        if not (not v14 or not v14.OnClose) then
            v14.OnClose();
        end;
    end;
    local function _(v16)
        if v13 then
            v1.unmount(v13);
        end;
        if v12.OnButtonPressed then
            v12.OnButtonPressed(v16);
        end;
    end;
    v13 = v1.mount((l_ContextServices_0.provide({
        Mouse = v10,
        Localization = v8,
        v3(),
        Plugin = v7
    }, {
        v1.createElement(v11, v4.Dictionary.join(v12, {
            OnClose = function()
                if v13 then
                    v1.unmount(v13);
                end;
            end,
            OnButtonPressed = function(v18)
                if v13 then
                    v1.unmount(v13);
                end;
                if v12.OnButtonPressed then
                    v12.OnButtonPressed(v18);
                end;
            end
        }))
    })));
    return v15;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AnimationClipEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.Roact);
local v2 = require(l_script_FirstAncestor_0.Packages.Framework);
local l_LinkText_0 = v2.UI.LinkText;
local l_ContextServices_0 = v2.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_GuiService_0 = game:GetService("GuiService");
local l_UI_0 = v2.UI;
local _ = l_UI_0.DockWidget;
local l_Pane_0 = l_UI_0.Pane;
local l_TextLabel_0 = l_UI_0.TextLabel;
local l_GetTextSize_0 = v2.Util.GetTextSize;
local l_StyledDialog_0 = l_UI_0.StyledDialog;
local v13 = v1.PureComponent:extend("WarningDialog");
v2.Util.Typecheck.wrap(v13, script);
local l_Colors_0 = v2.Style.Colors;
v13.init = function(_)
end;
v13.render = function(v16)
    local l_props_0 = v16.props;
    local l_Localization_0 = l_props_0.Localization;
    local v19 = l_props_0.Title or l_Localization_0:getText("Dialog", "DefaultTitle");
    local l_Stylizer_0 = l_props_0.Stylizer;
    local v21 = l_props_0.learnMoreLabel or l_Localization_0:getText("FaceCapture", "DefaultLearnMoreLabel");
    local l_TitleText_0 = l_props_0.TitleText;
    local l_SourceSansBold_0 = Enum.Font.SourceSansBold;
    local v24 = l_GetTextSize_0(l_TitleText_0, 20, l_SourceSansBold_0, Vector2.new(450, 1000));
    local l_BodyText_0 = l_props_0.BodyText;
    local l_SourceSans_0 = Enum.Font.SourceSans;
    return v1.createElement(l_StyledDialog_0, {
        Title = v19,
        OnClose = l_props_0.OnClose,
        BorderPadding = 20,
        OnButtonPressed = l_props_0.OnButtonPressed,
        Buttons = l_props_0.Buttons,
        ButtonHorizontalAlignment = Enum.HorizontalAlignment.Right,
        MinContentSize = Vector2.new(450, (v24.Y + 10) + l_GetTextSize_0(l_BodyText_0, 20, l_SourceSans_0, Vector2.new(450, 1000)).Y),
        Modal = true
    }, {
        Content = v1.createElement(l_Pane_0, {
            Layout = Enum.FillDirection.Vertical,
            HorizontalAlignment = Enum.HorizontalAlignment.Left,
            AutomaticSize = Enum.AutomaticSize.XY,
            Spacing = 10
        }, {
            Message = v1.createElement(l_TextLabel_0, {
                AutomaticSize = Enum.AutomaticSize.XY,
                TextXAlignment = Enum.TextXAlignment.Left,
                Text = l_TitleText_0,
                Font = l_SourceSansBold_0,
                TextSize = 20,
                TextColor3 = l_Stylizer_0.TextColor,
                BackgroundTransparency = 1,
                TextWrapped = true,
                LayoutOrder = 1
            }),
            Message2 = v1.createElement(l_TextLabel_0, {
                AutomaticSize = Enum.AutomaticSize.XY,
                TextXAlignment = Enum.TextXAlignment.Left,
                Text = l_BodyText_0,
                Font = l_SourceSans_0,
                TextSize = 20,
                TextColor3 = l_Stylizer_0.TextColor,
                BackgroundTransparency = 1,
                TextWrapped = true,
                LayoutOrder = 2
            })
        }),
        LinkText = l_props_0.learnMoreUrl and v1.createElement(l_LinkText_0, {
            LayoutOrder = 3,
            Text = v21,
            TextYAlignment = Enum.TextYAlignment.Bottom,
            OnClick = function()
                l_GuiService_0:OpenBrowserWindow(l_props_0.learnMoreUrl);
            end,
            Style = {
                Font = Enum.Font.SourceSans,
                TextColor = l_Colors_0.Blue,
                TextSize = 20,
                ShowUnderline = true
            },
            Position = UDim2.new(0, 0, 0, 157)
        })
    });
end;
return (l_withContext_0({
    Mouse = l_ContextServices_0.Mouse,
    Stylizer = l_ContextServices_0.Stylizer,
    Localization = l_ContextServices_0.Localization
})(v13));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AnimationClipEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.Roact);
local v2 = require(l_script_FirstAncestor_0.Packages.Framework);
local l_ContextServices_0 = v2.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local _ = v2.Util.StyleModifier;
local l_UI_0 = v2.UI;
local l_Pane_0 = l_UI_0.Pane;
local _ = v2.UI.Button;
local l_TextLabel_0 = l_UI_0.TextLabel;
local _ = l_UI_0.Container;
local _ = l_UI_0.Tooltip;
local _ = l_UI_0.HoverArea;
local _ = l_UI_0.LoadingIndicator;
local v14 = v1.PureComponent:extend("WarningOverlay");
v14.init = function(_)
end;
v14.render = function(v16)
    local l_props_0 = v16.props;
    local l_TitleText_0 = l_props_0.TitleText;
    local l_AnchorPoint_0 = l_props_0.AnchorPoint;
    local l_Image_0 = l_props_0.Image;
    local l_Position_0 = l_props_0.Position;
    local l_LayoutOrder_0 = l_props_0.LayoutOrder;
    local l_createElement_0 = v1.createElement;
    local l_l_Pane_0_0 = l_Pane_0;
    local v25 = {
        AutomaticSize = Enum.AutomaticSize.XY,
        Position = l_Position_0,
        AnchorPoint = l_AnchorPoint_0,
        Padding = {
            Left = 10,
            Right = 10,
            Top = 5,
            Bottom = 5
        },
        Layout = Enum.FillDirection.Horizontal,
        Spacing = 8,
        VerticalAlignment = Enum.VerticalAlignment.Center,
        ZIndex = 1,
        Style = "RoundBox",
        ImageTransparency = 0.1,
        LayoutOrder = l_LayoutOrder_0
    };
    local v26 = {};
    local v27 = false;
    if l_Image_0 ~= nil then
        v27 = false;
        if l_Image_0 ~= "" then
            v27 = v1.createElement("ImageLabel", {
                BackgroundTransparency = 1,
                Size = UDim2.new(0, 15, 0, 15),
                Position = UDim2.new(0, 19, 0, 5),
                Image = l_Image_0
            });
        end;
    end;
    v26.Image = v27;
    v26.Message = v1.createElement(l_TextLabel_0, {
        AutomaticSize = Enum.AutomaticSize.XY,
        TextXAlignment = Enum.TextXAlignment.Left,
        Text = l_TitleText_0,
        BackgroundTransparency = 1,
        TextWrapped = true,
        LayoutOrder = 1
    });
    return l_createElement_0(l_l_Pane_0_0, v25, v26);
end;
return (l_withContext_0({
    Stylizer = l_ContextServices_0.Stylizer,
    Localization = l_ContextServices_0.Localization
})(v14));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AnimationClipEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.Roact);
local v2 = require(l_script_FirstAncestor_0.Packages.Cryo);
local v3 = require(l_script_FirstAncestor_0.Packages.Framework);
local l_DropdownMenu_0 = v3.UI.DropdownMenu;
local l_ContextServices_0 = v3.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local v7 = require(l_script_FirstAncestor_0.Src.Components.TextBox);
local v8 = v1.PureComponent:extend("FilteringTextBox");
v8.init = function(v9, v10)
    v9.state = {
        hoveredItem = nil,
        currentText = v10.Text or ""
    };
    v9.frameRef = v1.createRef();
    v9.onItemClicked = function(v11)
        v9.props.OnItemClicked(v11);
    end;
    v9.onItemMouseEnter = function(v12)
        v9:setState({
            hoveredItem = v12
        });
    end;
    v9.onItemMouseLeave = function(v13)
        if v9.state.hoveredItem == v13 then
            v9:setState({
                hoveredItem = v1.None
            });
        end;
    end;
    v9.updateText = function(v14)
        v9:setState({
            currentText = v14
        });
    end;
    v9.onFocusChanged = function(v15, v16, v17)
        if v17 or v9.state.hoveredItem == nil then
            v9.props.FocusChanged(v15, v16, v17);
        end;
        v9.updateText(v15.Text);
    end;
end;
v8.render = function(v18)
    local l_props_0 = v18.props;
    local l_Stylizer_0 = l_props_0.Stylizer;
    local l_dropdownTheme_0 = l_Stylizer_0.dropdownTheme;
    local l_state_0 = v18.state;
    local v23 = v18.frameRef and v18.frameRef.current;
    local v24 = nil;
    if v23 then
        local l_AbsolutePosition_0 = v23.AbsolutePosition;
        local v26 = l_AbsolutePosition_0 + v23.AbsoluteSize;
        v24 = Rect.new(l_AbsolutePosition_0.X, l_AbsolutePosition_0.Y, v26.X, v26.Y);
    end;
    local v27 = l_props_0.Items or {};
    local l_Size_0 = l_props_0.Size;
    local l_Position_0 = l_props_0.Position;
    local l_MaxItems_0 = l_props_0.MaxItems;
    local l_currentText_0 = l_state_0.currentText;
    local l_hoveredItem_0 = l_state_0.hoveredItem;
    local v34 = v2.List.filter(v27, function(v33)
        return string.find(v33, l_currentText_0, 1, true) ~= nil;
    end);
    local l_createElement_0 = v1.createElement;
    local v36 = "Frame";
    local v37 = {
        Size = l_Size_0,
        Position = l_Position_0,
        BackgroundTransparency = 1,
        [v1.Ref] = v18.frameRef
    };
    local v38 = {
        TextBox = v1.createElement(v7, v2.Dictionary.join(l_props_0, {
            Size = UDim2.new(1, 0, 1, 0),
            FocusChanged = v18.onFocusChanged,
            TextChanged = v18.updateText
        }))
    };
    local v39 = false;
    if #v34 > 0 then
        v39 = v23 and v1.createElement(l_DropdownMenu_0, {
            OnItemActivated = v18.onItemClicked,
            OnFocusLost = v18.hideDropdown,
            SourceExtents = v24,
            MaxHeight = not not l_MaxItems_0 and l_dropdownTheme_0.itemHeight * l_MaxItems_0 or nil,
            Width = v24.Width,
            ShowBorder = true,
            ScrollBarPadding = 2,
            ScrollBarThickness = 10,
            Items = v34,
            OnRenderItem = function(v40, v41, v42)
                return v1.createElement("TextButton", {
                    Size = UDim2.new(0, v24.Width, 0, 22),
                    Font = l_Stylizer_0.font,
                    TextSize = l_dropdownTheme_0.textSize,
                    Text = v40,
                    TextTruncate = Enum.TextTruncate.AtEnd,
                    TextXAlignment = Enum.TextXAlignment.Left,
                    TextColor3 = l_dropdownTheme_0.textColor,
                    BackgroundColor3 = l_hoveredItem_0 == v40 and l_dropdownTheme_0.hoveredItemColor or l_dropdownTheme_0.itemColor,
                    BorderSizePixel = 0,
                    AutoButtonColor = false,
                    LayoutOrder = v41,
                    [v1.Event.Activated] = v42,
                    [v1.Event.MouseEnter] = function()
                        v18.onItemMouseEnter(v40);
                    end,
                    [v1.Event.MouseLeave] = function()
                        v18.onItemMouseLeave(v40);
                    end
                }, {
                    Padding = v1.createElement("UIPadding", {
                        PaddingLeft = UDim.new(0, 5)
                    })
                });
            end
        });
    end;
    v38.Dropdown = v39;
    return l_createElement_0(v36, v37, v38);
end;
return (l_withContext_0({
    Stylizer = l_ContextServices_0.Stylizer
})(v8));


local l_CoreGui_0 = game:GetService("CoreGui");
local l_script_FirstAncestor_0 = script:FindFirstAncestor("AnimationClipEditor");
local v2 = require(l_script_FirstAncestor_0.Packages.Roact);
local l_ContextServices_0 = require(l_script_FirstAncestor_0.Packages.Framework).ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Util_0 = l_script_FirstAncestor_0.Src.Util;
local v6 = require(l_Util_0.Constants);
local _ = require(l_Util_0.RigUtils);
local v8 = require(l_Util_0.RigInfo);
local v9 = require(l_script_FirstAncestor_0.LuaFlags.GetFFlagGridSpeed);
local v10 = v2.PureComponent:extend("FloorGrid");
v10.renderLine = function(_, v12, v13, v14, v15)
    return v2.createElement("LineHandleAdornment", {
        Thickness = 2,
        Color = v12.lineColor,
        Adornee = v13,
        Length = v15,
        CFrame = v14
    });
end;
v10.renderLines = function(v16, v17, v18, v19)
    local l_props_0 = v16.props;
    local l_v18_ExtentsSize_0 = v18:GetExtentsSize();
    local v22 = math.max(l_v18_ExtentsSize_0.X, l_v18_ExtentsSize_0.Z) + 3;
    local v23 = v22 / 10;
    local v24 = Vector3.new(0, -(l_v18_ExtentsSize_0.Y * 0.5 + (v19.Position.Y - v18:GetModelCFrame().p.Y)), 0);
    local v25 = (l_props_0.Speed * l_props_0.Playhead) / v6.TICK_FREQUENCY;
    local v26 = {};
    for v27 = -5, 5 do
        table.insert(v26, v16:renderLine(v17, v19, CFrame.new(v24 + Vector3.new(v27 * v23, 0, if not v9() then v22 / 2 else v22 / 2 + v25 % v23)), v22));
    end;
    for v28 = -5, 5 do
        table.insert(v26, v16:renderLine(v17, v19, CFrame.new(v24 + Vector3.new(v22 / 2, 0, if not v9() then v28 * v23 else v28 * v23 + v25 % v23)) * CFrame.Angles(0, 1.5707963267948966, 0), v22));
    end;
    return v26;
end;
v10.render = function(v29)
    local l_props_1 = v29.props;
    local l_gridTheme_0 = l_props_1.Stylizer.gridTheme;
    local v32 = l_props_1.Container or l_CoreGui_0;
    local l_RootInstance_0 = l_props_1.RootInstance;
    local v34 = l_RootInstance_0 and v8.findRootPart(l_RootInstance_0);
    if not v34 then
        return ;
    else
        return v2.createElement(v2.Portal, {
            target = v32
        }, {
            GridLines = v2.createElement("Folder", {}, (v29:renderLines(l_gridTheme_0, l_RootInstance_0, v34)))
        });
    end;
end;
return (l_withContext_0({
    Stylizer = l_ContextServices_0.Stylizer
})(v10));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AnimationClipEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.Roact);
local l_ContextServices_0 = require(l_script_FirstAncestor_0.Packages.Framework).ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local v4 = v1.PureComponent:extend("HierarchyLines");
v4.render = function(v5)
    local l_props_0 = v5.props;
    local l_Stylizer_0 = l_props_0.Stylizer;
    local l_IsLeafNode_0 = l_props_0.IsLeafNode;
    local l_InActiveChain_0 = l_props_0.InActiveChain;
    local l_IsChildNode_0 = l_props_0.IsChildNode;
    local l_IsExpanded_0 = l_props_0.IsExpanded;
    local l_Indent_0 = l_props_0.Indent;
    local l_Height_0 = l_props_0.Height;
    local l_IKHeight_0 = l_props_0.IKHeight;
    local l_LayoutOrder_0 = l_props_0.LayoutOrder;
    local l_Highlight_0 = l_props_0.Highlight;
    local l_IsSelected_0 = l_props_0.IsSelected;
    local v18 = l_Indent_0 > 0 and 20 or 0;
    local v19 = not l_IsLeafNode_0 and 6 or 3;
    local v20 = l_Indent_0 > 1 and (l_Indent_0 - 1) * 20 or 0;
    return v1.createElement("Frame", {
        BackgroundTransparency = 1,
        Size = UDim2.new(0, v20 + v18, 0, 0),
        LayoutOrder = l_LayoutOrder_0
    }, {
        Indent = v1.createElement("Frame", {
            BackgroundTransparency = 1,
            LayoutOrder = 0,
            Size = UDim2.new(0, v20, 1, 0)
        }),
        VerticalLine = (not l_IsLeafNode_0 and l_IsExpanded_0) and v1.createElement("Frame", {
            Size = UDim2.new(0, 1, 0, l_Height_0 - 6),
            BorderSizePixel = 0,
            BackgroundTransparency = l_Stylizer_0.ikTheme.transparency,
            Position = UDim2.new(0, (v20 + v18) + 6, 0, 6),
            BackgroundColor3 = not not l_Highlight_0 and l_Stylizer_0.ikTheme.ikLineColor or l_Stylizer_0.ikTheme.lineColor,
            ZIndex = 2
        }),
        IKVerticalLine = ((not l_IsLeafNode_0 and l_IsExpanded_0) and l_InActiveChain_0) and v1.createElement("Frame", {
            Size = UDim2.new(0, 1, 0, (math.max(l_IKHeight_0 - 6, 0))),
            BorderSizePixel = 0,
            Position = UDim2.new(0, (v20 + v18) + 6, 0, 6),
            BackgroundColor3 = l_Stylizer_0.ikTheme.ikLineColor,
            BorderColor3 = l_Stylizer_0.ikTheme.ikLineColor,
            ZIndex = 3
        }),
        HorizontalLine = l_IsChildNode_0 and v1.createElement("Frame", {
            Size = UDim2.new(0, v18 - v19, 0, 1),
            BorderSizePixel = 0,
            BackgroundTransparency = not (not not l_Highlight_0 and l_InActiveChain_0) and l_Stylizer_0.ikTheme.transparency or 0,
            BackgroundColor3 = not not l_Highlight_0 and l_Stylizer_0.ikTheme.ikLineColor or l_Stylizer_0.ikTheme.lineColor,
            Position = UDim2.new(0, v20 + 6, 0, 0),
            ZIndex = 2
        }),
        LeafNode = l_IsLeafNode_0 and v1.createElement("ImageLabel", {
            Size = UDim2.new(0, 6, 0, 6),
            BorderSizePixel = 0,
            BackgroundTransparency = 1,
            Image = l_Stylizer_0.ikTheme.leafNodeImage,
            ImageColor3 = not not l_IsSelected_0 and l_Stylizer_0.ikTheme.primaryTextColor or l_Stylizer_0.ikTheme.lineColor,
            Position = UDim2.new(0, v20 + v18, 0.5, 0),
            AnchorPoint = Vector2.new(0, 0.5),
            ZIndex = 4
        }),
        Toggle = not l_IsLeafNode_0 and v1.createElement("ImageButton", {
            Size = UDim2.new(0, 12, 0, 12),
            BorderSizePixel = 0,
            BackgroundTransparency = 1,
            Image = not not l_IsExpanded_0 and l_Stylizer_0.ikTheme.collapseImage or l_Stylizer_0.ikTheme.expandImage,
            ImageColor3 = not not l_IsSelected_0 and l_Stylizer_0.ikTheme.primaryTextColor or l_Stylizer_0.ikTheme.lineColor,
            Position = UDim2.new(0, v20 + v18, 0.5, 0),
            AnchorPoint = Vector2.new(0, 0.5),
            AutoButtonColor = false,
            ZIndex = 4,
            [v1.Event.MouseButton1Click] = function()
                l_props_0.ToggleExpanded(l_props_0.Element);
            end
        })
    });
end;
return (l_withContext_0({
    Stylizer = l_ContextServices_0.Stylizer
})(v4));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AnimationClipEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.Roact);
local v2 = require(l_script_FirstAncestor_0.Packages.RoactRodux);
local v3 = require(l_script_FirstAncestor_0.Packages.Framework);
local l_Button_0 = v3.UI.Button;
local l_ContextServices_0 = v3.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local _ = l_ContextServices_0.Localization;
local l_Actions_0 = l_script_FirstAncestor_0.Src.Actions;
local v9 = require(l_Actions_0.SetIKEnabled);
local v10 = require(l_Actions_0.SetIKMode);
local v11 = require(l_Actions_0.SetSelectedTracks);
local v12 = require(l_Actions_0.SetShowTree);
local l_Components_0 = l_script_FirstAncestor_0.Src.Components;
local v14 = require(l_Components_0.IK.IKWindow);
local v15 = require(l_Components_0.IK.R15IKRig);
local l_Thunks_0 = l_script_FirstAncestor_0.Src.Thunks;
local v17 = require(l_Thunks_0.SetSelectedTracks);
local v18 = require(l_Thunks_0.ToggleIKEnabled);
local v19 = require(l_Thunks_0.TogglePinnedPart);
local v20 = require(l_Thunks_0.ToggleShowTree);
local l_Util_0 = l_script_FirstAncestor_0.Src.Util;
local v22 = require(l_Util_0.Constants);
local v23 = require(l_Util_0.RigIK);
local v24 = require(l_Util_0.RigInfo);
local v25 = require(l_Util_0.RigUtils);
local v26 = require(l_script_FirstAncestor_0.LuaFlags.GetFFlagAnimationConstraints);
local v27 = require(l_script_FirstAncestor_0.LuaFlags.GetFFlagRigIK);
local v28 = require(l_script_FirstAncestor_0.LuaFlags.GetFFlagSelectFromViewport);
local v29 = v1.PureComponent:extend("IKController");
v29.init = function(v30)
    v30.state = {
        showMenu = false,
        showTree = false
    };
    v30.showMenu = function()
        v30:setState({
            showMenu = true
        });
    end;
    v30.hideMenu = function()
        v30:setState({
            showMenu = false
        });
    end;
    v30.setShowTree = function(v31)
        v30:setState({
            showTree = v31
        });
    end;
    v30.makeChainHelper = function(v32, v33, v34)
        if not v26() or v33 then
            local v35 = v33[v34.Name];
            if v35 then
                v32[v34.Name] = true;
                v30.makeChainHelper(v32, v33, v35.Part0);
            end;
            return ;
        else
            return ;
        end;
    end;
    v30.makeChainHelperAnimationConstraint = function(v36, v37, v38)
        if v37 then
            local v39 = v37[v38.Name];
            if v39 then
                v36[v38.Name] = true;
                v30.makeChainHelperAnimationConstraint(v36, v37, v39.Attachment0.Parent);
            end;
            return ;
        else
            return ;
        end;
    end;
    v30.getLastSelectedTrack = function()
        if not v30.props.SelectedTracks then
            return ;
        else
            return v30.props.SelectedTracks[#v30.props.SelectedTracks];
        end;
    end;
    v30.toggleIKEnabledHandler = function()
        return v30.props.ToggleIKEnabled(v30.props.Analytics);
    end;
    v30.makeChains = function()
        local v40 = v30.getLastSelectedTrack();
        local v41 = not not v40 and v40[1] or nil;
        local v42 = v24.getRigInfo(v30.props.RootInstance);
        local l_Parts_0 = v42.Parts;
        local l_PartNameToMotor_0 = v42.PartNameToMotor;
        local l_PartNameToAnimConstraint_0 = v42.PartNameToAnimConstraint;
        local v46 = {};
        local l_PinnedParts_0 = v30.props.PinnedParts;
        if v30.props.IKMode == v22.IK_MODE.BodyPart then
            l_PinnedParts_0 = {};
        end;
        for _, v49 in ipairs(l_Parts_0) do
            if not l_PinnedParts_0[v49] then
                v46[v49.Name] = false;
            end;
        end;
        if v41 then
            local v50 = v24.getPartByName(v30.props.RootInstance, v41);
            if v50 then
                if v30.props.IKMode == v22.IK_MODE.BodyPart then
                    l_PinnedParts_0 = if not v27() then v25.pinForLimbMode(v50, l_PartNameToMotor_0, l_PartNameToAnimConstraint_0) else v23.pinForLimbMode(v50, l_PartNameToMotor_0, l_PartNameToAnimConstraint_0);
                end;
                if not (v26() and not l_PartNameToMotor_0[v41]) then
                    v30.makeChainHelper(v46, l_PartNameToMotor_0, l_PartNameToMotor_0[v41].Part1);
                end;
                if not (not v26() or not l_PartNameToAnimConstraint_0[v41]) then
                    v30.makeChainHelperAnimationConstraint(v46, l_PartNameToAnimConstraint_0, l_PartNameToAnimConstraint_0[v41].Attachment1.Parent);
                end;
                for v51, v52 in pairs(l_PinnedParts_0) do
                    if not (not (v51.Name ~= v41) or not v52) then
                        v30.makeChainHelper(v46, l_PartNameToMotor_0, v51);
                        if v26() then
                            v30.makeChainHelperAnimationConstraint(v46, l_PartNameToAnimConstraint_0, v51);
                        end;
                    end;
                end;
            end;
        end;
        return v46;
    end;
end;
v29.didUpdate = function(v53)
    local l_props_0 = v53.props;
    if l_props_0.ShowTree ~= v53.state.showTree then
        if l_props_0.ShowTree ~= nil then
            spawn(function()
                v53.setShowTree(l_props_0.ShowTree);
            end);
            return ;
        else
            v53.setShowTree(l_props_0.ShowTree);
        end;
    end;
end;
v29.render = function(v55)
    local l_Localization_1 = v55.props.Localization;
    local l_props_1 = v55.props;
    local l_Stylizer_0 = l_props_1.Stylizer;
    local v59 = v55.getLastSelectedTrack();
    local l_state_0 = v55.state;
    local l_ToggleShowTree_0 = l_props_1.ToggleShowTree;
    local v62 = nil;
    local v63 = nil;
    if not v27() then
        local v64, v65 = v25.canUseIK(l_props_1.RootInstance);
        v62 = v64;
        v63 = v65;
    else
        local v66, v67 = v23.canUseIK(l_props_1.RootInstance);
        v62 = v66;
        v63 = v67;
    end;
    return v55.props.RootInstance and v1.createElement("Frame", {
        Position = l_props_1.Position,
        Size = UDim2.new(0, 40, 0, 18),
        BackgroundTransparency = 1,
        AnchorPoint = Vector2.new(0, 0.5)
    }, {
        IKButton = (l_props_1.RootInstance and v62) and v1.createElement(l_Button_0, {
            Style = not l_state_0.showTree and "ACEHeaderButtonDefault" or "ACEHeaderButtonActive",
            Size = UDim2.new(1, 0, 1, 0),
            OnClick = l_ToggleShowTree_0
        }, {
            Label = v1.createElement("TextLabel", {
                BackgroundTransparency = 1,
                Size = UDim2.new(1, 0, 1, 0),
                TextYAlignment = Enum.TextYAlignment.Center,
                TextSize = l_Stylizer_0.ikTheme.textSize,
                Text = l_Localization_1:getText("Title", "IK"),
                Font = l_Stylizer_0.font,
                TextColor3 = l_Stylizer_0.ikTheme.textColor
            })
        }),
        IKWindow = (l_props_1.ShowTree and l_state_0.showTree) and v1.createElement(v14, {
            RootInstance = l_props_1.RootInstance,
            PinnedParts = l_props_1.PinnedParts,
            IKEnabled = l_props_1.IKEnabled,
            ShowTree = l_props_1.ShowTree,
            SelectedTrack = v59,
            SetSelectedTracks = l_props_1.SetSelectedTracks,
            ToggleIKEnabled = v55.toggleIKEnabledHandler,
            TogglePinnedPart = l_props_1.TogglePinnedPart,
            SetShowTree = l_props_1.SetShowTree,
            SetIKEnabled = l_props_1.SetIKEnabled,
            SetIKMode = l_props_1.SetIKMode,
            Chain = v55.makeChains(),
            IKMode = l_props_1.IKMode,
            IsR15 = v63
        }),
        R15IKRig = (l_props_1.IKEnabled and v63) and v1.createElement(v15, {
            RootInstance = l_props_1.RootInstance
        })
    });
end;
return v2.connect(function(v68, _)
    return {
        ShowTree = v68.Status.ShowTree,
        IKMode = v68.Status.IKMode,
        IKEnabled = v68.Status.IKEnabled,
        RootInstance = v68.Status.RootInstance,
        PinnedParts = v68.Status.PinnedParts,
        SelectedTracks = v68.Status.SelectedTracks
    };
end, function(v70)
    return {
        ToggleShowTree = function()
            v70(v20());
        end,
        SetIKMode = function(v71)
            v70(v10(v71));
        end,
        SetIKEnabled = function(v72)
            v70(v9(v72));
        end,
        ToggleIKEnabled = function(v73)
            v70(v18(v73));
        end,
        TogglePinnedPart = function(v74)
            v70(v19(v74));
        end,
        SetShowTree = function(v75)
            v70(v12(v75));
        end,
        SetSelectedTracks = function(v76)
            if not v28() then
                v70(v11(v76));
                return ;
            else
                v70(v17(v76));
                return ;
            end;
        end
    };
end)((l_withContext_0({
    Stylizer = l_ContextServices_0.Stylizer,
    Localization = l_ContextServices_0.Localization,
    Analytics = l_ContextServices_0.Analytics
})(v29)));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AnimationClipEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.Roact);
local v2 = require(l_script_FirstAncestor_0.Packages.Framework);
local l_RadioButtonList_0 = v2.UI.RadioButtonList;
local l_ContextServices_0 = v2.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local v6 = require(l_script_FirstAncestor_0.Src.Util.Constants);
local v7 = v1.PureComponent:extend("IKModeButtons");
v7.render = function(v8)
    local l_Localization_0 = v8.props.Localization;
    local l_props_0 = v8.props;
    local l_Stylizer_0 = l_props_0.Stylizer;
    return v1.createElement("Frame", {
        Size = UDim2.new(1, 0, 0, l_props_0.Height),
        BackgroundColor3 = l_Stylizer_0.ikTheme.headerColor,
        BorderSizePixel = 1,
        BorderColor3 = l_Stylizer_0.ikTheme.headerBorder,
        LayoutOrder = l_props_0.LayoutOrder
    }, {
        IKModeLabel = v1.createElement("TextLabel", {
            AnchorPoint = Vector2.new(0, 0.5),
            Position = UDim2.new(0, 0, 0.5, 0),
            Size = UDim2.new(0, 64, 0, v6.TRACK_HEIGHT),
            BackgroundTransparency = 1,
            TextSize = l_Stylizer_0.ikTheme.textSize,
            Font = l_Stylizer_0.font,
            TextColor3 = l_Stylizer_0.ikTheme.textColor,
            TextXAlignment = Enum.TextXAlignment.Center,
            TextYAlignment = Enum.TextYAlignment.Center,
            Text = l_Localization_0:getText("IKMenu", "IKMode"),
            LayoutOrder = 0
        }),
        RadioButtonsFrame = v1.createElement("Frame", {
            BackgroundTransparency = 1,
            AnchorPoint = Vector2.new(1, 0.5),
            Position = UDim2.new(1, 0, 0.5, 0),
            Size = UDim2.new(0, 186, 0.5, 0),
            LayoutOrder = 1
        }, {
            RadioButtons = v1.createElement(l_RadioButtonList_0, {
                Buttons = {
                    {
                        Key = v6.IK_MODE.BodyPart,
                        Text = l_Localization_0:getText("IKMenu", "BodyPart")
                    },
                    {
                        Key = v6.IK_MODE.FullBody,
                        Text = l_Localization_0:getText("IKMenu", "FullBody")
                    }
                },
                SelectedKey = l_props_0.IKMode,
                FillDirection = Enum.FillDirection.Horizontal,
                LayoutOrder = 1,
                OnClick = l_props_0.SetIKMode
            })
        })
    });
end;
return (l_withContext_0({
    Stylizer = l_ContextServices_0.Stylizer,
    Localization = l_ContextServices_0.Localization
})(v7));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AnimationClipEditor");
local _ = require(l_script_FirstAncestor_0.Packages.Cryo);
local v2 = require(l_script_FirstAncestor_0.Src.Util.Constants);
local _ = require(l_script_FirstAncestor_0.Src.Util.RigUtils);
local v4 = require(l_script_FirstAncestor_0.Src.Util.RigInfo);
local v5 = require(l_script_FirstAncestor_0.Packages.Roact);
local v6 = require(l_script_FirstAncestor_0.Packages.Framework);
local l_ContextServices_0 = v6.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_UI_0 = v6.UI;
local l_Button_0 = l_UI_0.Button;
local l_Pane_0 = l_UI_0.Pane;
local v12 = require(l_script_FirstAncestor_0.Src.Components.IK.HierarchyLines);
local v13 = v5.PureComponent:extend("IKTreeRow");
v13.render = function(v14)
    local l_props_0 = v14.props;
    local l_Stylizer_0 = l_props_0.Stylizer;
    local l_Item_0 = l_props_0.Item;
    local l_IKMode_0 = l_props_0.IKMode;
    local l_IsSelected_0 = l_props_0.IsSelected;
    local l_createElement_0 = v5.createElement;
    local v21 = "ImageButton";
    local v24 = {
        Position = l_props_0.Position,
        Size = UDim2.new(1, -8, 0, v2.TRACK_HEIGHT),
        ImageTransparency = 1,
        AutoButtonColor = false,
        BackgroundColor3 = if not l_IsSelected_0 then l_Stylizer_0.backgroundColor else l_Stylizer_0.ikTheme.selected,
        BorderSizePixel = 0,
        ZIndex = 1,
        [v5.Event.InputBegan] = function(_, v23)
            v14.props.OnInputBegan(v23, l_Item_0);
        end
    };
    local v25 = {};
    local v26 = false;
    if l_IKMode_0 == v2.IK_MODE.FullBody then
        v26 = v14:renderPinButton();
    end;
    v25.Pin = v26;
    v25.Container = v5.createElement(l_Pane_0, {
        HorizontalAlignment = Enum.HorizontalAlignment.Left,
        Layout = Enum.FillDirection.Horizontal,
        Spacing = 14,
        VerticalAlignment = Enum.VerticalAlignment.Center
    }, {
        HierarchyLines = v14:renderHierarchyLines(),
        TextLabel = v14:renderJointLabel()
    });
    return l_createElement_0(v21, v24, v25);
end;
v13.renderPinButton = function(v27)
    local l_props_1 = v27.props;
    local l_Stylizer_1 = l_props_1.Stylizer;
    local l_Item_1 = l_props_1.Item;
    local l_IsSelected_1 = l_props_1.IsSelected;
    local l_RootInstance_0 = l_props_1.RootInstance;
    local l_PinnedParts_0 = l_props_1.PinnedParts;
    local l_TogglePinnedPart_0 = l_props_1.TogglePinnedPart;
    local v35 = v4.getPartByName(l_RootInstance_0, l_Item_1);
    return v5.createElement(l_Button_0, {
        Position = UDim2.new(1, -10, 0.5, 0),
        AnchorPoint = Vector2.new(1, 0.5),
        ZIndex = 1,
        IsRound = false,
        Size = UDim2.fromOffset(11, 11),
        BorderSizePixel = 0,
        OnClick = function()
            if v35 then
                l_TogglePinnedPart_0(v35);
            end;
        end
    }, {
        Image = v5.createElement("ImageLabel", {
            BackgroundColor3 = not not l_IsSelected_1 and l_Stylizer_1.ikTheme.selected or l_Stylizer_1.backgroundColor,
            BorderSizePixel = 0,
            Size = UDim2.fromScale(1, 1),
            Image = l_Stylizer_1.ikTheme.pinImage,
            ImageColor3 = not not if not v35 then nil else l_PinnedParts_0[v35] and l_Stylizer_1.ikTheme.pinHover or l_Stylizer_1.ikTheme.iconColor
        })
    });
end;
v13.renderHierarchyLines = function(v36)
    local l_props_2 = v36.props;
    local l_Item_2 = l_props_2.Item;
    local l_IsLeafNode_0 = l_props_2.IsLeafNode;
    local l_Depth_0 = l_props_2.Depth;
    local l_GetVerticalLineHeight_0 = l_props_2.GetVerticalLineHeight;
    local l_Chain_0 = l_props_2.Chain;
    local v43 = l_Depth_0 - 1;
    return v5.createElement(v12, {
        Highlight = l_Chain_0[l_Item_2] ~= nil,
        IsSelected = l_props_2.IsSelected,
        InActiveChain = l_Chain_0[l_Item_2],
        IsLeafNode = l_IsLeafNode_0,
        IsChildNode = v43 > 0,
        IsExpanded = l_props_2.IsExpanded,
        Indent = v43,
        Height = l_GetVerticalLineHeight_0(l_Item_2, false),
        IKHeight = l_GetVerticalLineHeight_0(l_Item_2, true),
        LayoutOrder = 1,
        ToggleExpanded = l_props_2.OnToggleExpanded,
        Element = l_Item_2
    });
end;
v13.renderJointLabel = function(v44)
    local l_props_3 = v44.props;
    local l_Stylizer_2 = l_props_3.Stylizer;
    return v5.createElement("TextLabel", {
        Text = l_props_3.Item,
        TextSize = l_Stylizer_2.ikTheme.textSize,
        Font = l_Stylizer_2.font,
        TextColor3 = not not l_props_3.IsSelected and l_Stylizer_2.ikTheme.primaryTextColor or l_Stylizer_2.ikTheme.textColor,
        TextXAlignment = Enum.TextXAlignment.Left,
        TextYAlignment = Enum.TextYAlignment.Center,
        Size = UDim2.new(0, 160, 1, 0),
        TextTruncate = Enum.TextTruncate.AtEnd,
        BackgroundTransparency = 1,
        LayoutOrder = 3
    });
end;
return (l_withContext_0({
    Stylizer = l_ContextServices_0.Stylizer
})(v13));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AnimationClipEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.Cryo);
local v2 = require(l_script_FirstAncestor_0.Src.Util.Constants);
local _ = require(l_script_FirstAncestor_0.Src.Util.RigUtils);
local v4 = require(l_script_FirstAncestor_0.Src.Util.RigInfo);
local v5 = require(l_script_FirstAncestor_0.Packages.Roact);
local v6 = require(l_script_FirstAncestor_0.Packages.Framework);
local l_TreeView_0 = v6.UI.TreeView;
local l_ContextServices_0 = v6.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local v10 = require(l_script_FirstAncestor_0.LuaFlags.GetFFlagAnimationConstraints);
local v11 = require(l_script_FirstAncestor_0.Src.Components.IK.IKTreeRow);
local v12 = v5.PureComponent:extend("IKTreeView");
v12.init = function(v13)
    local v14 = {};
    local v15 = v4.getMotors(v13.props.RootInstance);
    local v16 = if not v10() then nil else v4.getAnimationConstraints(v13.props.RootInstance);
    for _, v18 in ipairs(v15) do
        v14[v18.Part1.Name] = true;
    end;
    if v10() then
        for _, v20 in v16, nil, nil do
            v14[v20.Attachment1.Parent.Name] = true;
        end;
    end;
    v14[v4.findRootPart(v13.props.RootInstance).Name] = true;
    v13.state = {
        expandedItems = v14,
        treeArray = {}
    };
    v13.getChildren = function(v21)
        local v22 = {};
        for _, v24 in ipairs(v15) do
            if v24.Part0.Name == v21 then
                table.insert(v22, v24.Part1.Name);
            end;
        end;
        if v10() then
            for _, v26 in v16, nil, nil do
                if v26.Attachment0.Parent.Name == v21 then
                    table.insert(v22, v26.Attachment1.Parent.Name);
                end;
            end;
        end;
        return v22;
    end;
    v13.onInputBegan = function(v27, v28)
        if v27.UserInputType == Enum.UserInputType.MouseButton1 then
            v13.props.SetSelectedTracks({
                {
                    v28
                }
            });
        end;
    end;
    v13.getVerticalLineHeight = function(v29, v30)
        local v31 = 1;
        local v32 = {};
        local v33 = v13.getChildren(v29);
        for v34, v35 in ipairs(v13.state.treeArray) do
            if v35 == v29 then
                v31 = v34;
            end;
            for _, v37 in ipairs(v33) do
                if not (not (v37 == v35) or v30 and not v13.props.Chain[v37]) then
                    table.insert(v32, {
                        index = v34,
                        element = v37
                    });
                end;
            end;
        end;
        table.sort(v32, function(v38, v39)
            return v38.index < v39.index;
        end);
        local l_v31_0 = v31;
        if #v32 > 0 then
            l_v31_0 = v32[#v32].index;
        end;
        return (l_v31_0 - v31) * v2.TRACK_HEIGHT;
    end;
    v13.toggleExpanded = function(v41)
        v13:setState(function(v42)
            return {
                expandedItems = v1.Dictionary.join(v42.expandedItems, {
                    [v41] = not v42.expandedItems[v41]
                })
            };
        end);
    end;
    v13.contributeItem = function(v43, v44, v45)
        table.insert(v45, v43);
        if v13.state.expandedItems[v43] then
            for _, v47 in ipairs((v13.getChildren(v43))) do
                v13.contributeItem(v47, v44 + 1, v45);
            end;
        end;
        return v45;
    end;
    v13.calculateRows = function(v48)
        if v48 and v13.state.expandedItems == v48.expandedItems then
            return ;
        else
            local v49 = {};
            v13.contributeItem(v4.findRootPart(v13.props.RootInstance).Name, 0, v49);
            v13:setState({
                treeArray = v49
            });
            v13.props.OnTreeUpdated(v49);
            return ;
        end;
    end;
    v13.getRowProps = function(v50, v51, v52, v53)
        local l_props_0 = v13.props;
        local l_SelectedTrack_0 = l_props_0.SelectedTrack;
        local l_item_0 = v50.item;
        return {
            Chain = l_props_0.Chain,
            Depth = v50.depth,
            GetVerticalLineHeight = v13.getVerticalLineHeight,
            IsExpanded = v13.state.expandedItems[l_item_0],
            IsLeafNode = #v13.getChildren(l_item_0) == 0,
            Item = l_item_0,
            Key = v51,
            OnInputBegan = v13.onInputBegan,
            OnToggleExpanded = v13.toggleExpanded,
            PinnedParts = l_props_0.PinnedParts,
            Position = v52,
            RootInstance = l_props_0.RootInstance,
            IKMode = l_props_0.IKMode,
            IsSelected = l_SelectedTrack_0 and l_SelectedTrack_0[1] == l_item_0,
            Size = v53,
            TogglePinnedPart = l_props_0.TogglePinnedPart
        };
    end;
end;
v12.didMount = function(v57)
    v57.calculateRows();
end;
v12.didUpdate = function(v58, _, v60)
    v58.calculateRows(v60);
end;
v12.render = function(v61)
    local l_props_1 = v61.props;
    local l_Position_0 = l_props_1.Position;
    local l_Size_0 = l_props_1.Size;
    local v65 = v4.findRootPart(l_props_1.RootInstance);
    local v66 = {};
    table.insert(v66, v65.Name);
    return v5.createElement("Frame", {
        Position = l_Position_0,
        Size = l_Size_0,
        BackgroundTransparency = 1
    }, {
        TreeView = v5.createElement(l_TreeView_0, {
            RootItems = v66,
            GetChildren = v61.getChildren,
            Expansion = v61.state.expandedItems,
            RowComponent = v11,
            RowHeight = v2.TRACK_HEIGHT,
            GetRowProps = v61.getRowProps,
            Style = "BorderBox"
        })
    });
end;
return (l_withContext_0({
    Stylizer = l_ContextServices_0.Stylizer
})(v12));


local l_StudioFixPluginWidgetLocalizedIds_0 = game:GetFastFlag("StudioFixPluginWidgetLocalizedIds");
local l_script_FirstAncestor_0 = script:FindFirstAncestor("AnimationClipEditor");
local v2 = require(l_script_FirstAncestor_0.Packages.Roact);
local v3 = require(l_script_FirstAncestor_0.Packages.Framework);
local l_UI_0 = v3.UI;
local l_Button_0 = l_UI_0.Button;
local l_DockWidget_0 = l_UI_0.DockWidget;
local l_ContextServices_0 = v3.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local v9 = require(l_script_FirstAncestor_0.Src.Util.Input);
local v10 = require(l_script_FirstAncestor_0.Src.Components.IK.IKTreeView);
local v11 = require(l_script_FirstAncestor_0.Src.Components.IK.IKModeButtons);
local v12 = v2.PureComponent:extend("IKWindow");
local v13 = Vector2.new(260, 440);
v12.init = function(v14)
    v14.state = {
        treeArray = {}
    };
    v14.hideTree = function()
        local l_props_0 = v14.props;
        if l_props_0.ShowTree then
            l_props_0.SetShowTree(false);
        end;
        if l_props_0.IKEnabled then
            l_props_0.SetIKEnabled(false);
        end;
    end;
    v14.onDockWidgetLoaded = function(v16)
        if v16:IsA("PluginGui") then
            v16:BindToClose(v14.hideTree);
        end;
    end;
    v14.onTreeUpdated = function(v17)
        v14:setState({
            treeArray = v17
        });
    end;
    v14.changeSelectedTrack = function(v18)
        local l_state_0 = v14.state;
        local l_props_1 = v14.props;
        local l_treeArray_0 = l_state_0.treeArray;
        local l_SelectedTrack_0 = l_props_1.SelectedTrack;
        local l_SetSelectedTracks_0 = l_props_1.SetSelectedTracks;
        local v24 = 0;
        for v25, v26 in ipairs(l_treeArray_0) do
            if l_SelectedTrack_0 and l_SelectedTrack_0[1] == v26 then
                v24 = v25;
                break;
            end;
        end;
        l_SetSelectedTracks_0({
            {
                l_treeArray_0[math.clamp(v24 + v18, 1, #l_treeArray_0)]
            }
        });
    end;
    v14.onInputBegan = function(_, v28)
        if v28.UserInputType == Enum.UserInputType.Keyboard then
            if not v9.isUp(v28.KeyCode) then
                if v9.isDown(v28.KeyCode) then
                    v14.changeSelectedTrack(1);
                end;
            else
                v14.changeSelectedTrack(-1);
                return ;
            end;
        end;
    end;
end;
v12.willUnmount = function(v29)
    v29.hideTree();
end;
v12.render = function(v30)
    local l_Localization_0 = v30.props.Localization;
    local l_props_2 = v30.props;
    local l_Stylizer_0 = l_props_2.Stylizer;
    local l_RootInstance_0 = l_props_2.RootInstance;
    local l_PinnedParts_0 = l_props_2.PinnedParts;
    local l_IsR15_0 = l_props_2.IsR15;
    local l_IKMode_0 = l_props_2.IKMode;
    local l_IKEnabled_0 = l_props_2.IKEnabled;
    return v2.createElement(l_DockWidget_0, {
        Id = if not l_StudioFixPluginWidgetLocalizedIds_0 then nil else "ManageIK",
        Title = l_Localization_0:getText("Title", "ManageIK"),
        Name = "ManageIK",
        ZIndexBehavior = Enum.ZIndexBehavior.Global,
        InitialDockState = Enum.InitialDockState.Left,
        InitialEnabled = true,
        InitialEnabledShouldOverrideRestore = true,
        Size = v13,
        MinSize = v13,
        OnClose = v30.hideTree,
        Enabled = true,
        [v2.Ref] = v30.onDockWidgetLoaded
    }, {
        Container = v2.createElement("Frame", {
            BorderSizePixel = 0,
            BackgroundColor3 = l_Stylizer_0.backgroundColor,
            Size = UDim2.new(1, 0, 1, 0),
            [v2.Event.InputBegan] = v30.onInputBegan
        }, {
            IKModeControls = (l_IsR15_0 and l_IKEnabled_0) and v2.createElement(v11, {
                Height = 32,
                IKMode = l_IKMode_0,
                SetIKMode = l_props_2.SetIKMode
            }),
            TreeView = (l_RootInstance_0 and l_IKEnabled_0) and v2.createElement(v10, {
                Size = UDim2.new(1, 0, 1, not l_IsR15_0 and -56 or -96),
                Position = UDim2.new(0, 0, 0, not l_IsR15_0 and 0 or 40),
                RootInstance = l_RootInstance_0,
                PinnedParts = l_PinnedParts_0,
                TogglePinnedPart = l_props_2.TogglePinnedPart,
                SelectedTrack = l_props_2.SelectedTrack,
                SetSelectedTracks = l_props_2.SetSelectedTracks,
                Chain = l_props_2.Chain,
                IKMode = l_IKMode_0,
                TreeArray = v30.state.treeArray,
                OnTreeUpdated = v30.onTreeUpdated
            }),
            EnableIKPrompt = not l_IKEnabled_0 and v2.createElement("TextLabel", {
                AnchorPoint = Vector2.new(0.5, 0.5),
                BackgroundTransparency = 1,
                Position = UDim2.new(0.5, 0, 0.5, 0),
                Size = UDim2.new(1, -8, 1, -40),
                TextXAlignment = Enum.TextXAlignment.Center,
                TextYAlignment = Enum.TextYAlignment.Center,
                TextSize = l_Stylizer_0.ikTheme.textSize,
                TextColor3 = l_Stylizer_0.ikTheme.textColor,
                TextWrapped = true,
                Font = l_Stylizer_0.font,
                Text = l_Localization_0:getText("IKMenu", "Prompt")
            }),
            BottomFrame = v2.createElement("Frame", {
                Size = UDim2.new(1, 0, 0, 48),
                Position = UDim2.new(0, 0, 1, 0),
                AnchorPoint = Vector2.new(0, 1),
                BackgroundColor3 = l_Stylizer_0.ikTheme.headerColor,
                BorderSizePixel = 1,
                BorderColor3 = l_Stylizer_0.ikTheme.headerBorder
            }, {
                EnableIKButton = v2.createElement(l_Button_0, {
                    AnchorPoint = Vector2.new(0.5, 1),
                    Position = UDim2.new(0.5, 0, 1, -8),
                    IsRound = true,
                    Size = UDim2.new(1, -8, 0, 32),
                    OnClick = l_props_2.ToggleIKEnabled
                }, {
                    TextLabel = v2.createElement("TextLabel", {
                        BackgroundTransparency = 1,
                        Size = UDim2.new(1, 0, 1, 0),
                        TextYAlignment = Enum.TextYAlignment.Center,
                        TextSize = l_Stylizer_0.ikTheme.textSize,
                        Text = not not l_IKEnabled_0 and l_Localization_0:getText("IKMenu", "DisableIK") or l_Localization_0:getText("IKMenu", "EnableIK"),
                        Font = l_Stylizer_0.font,
                        TextColor3 = l_Stylizer_0.ikTheme.textColor
                    })
                })
            })
        })
    });
end;
return (l_withContext_0({
    Stylizer = l_ContextServices_0.Stylizer,
    Localization = l_ContextServices_0.Localization,
    Plugin = l_ContextServices_0.Plugin
})(v12));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AnimationClipEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.Roact);
local v2 = require(l_script_FirstAncestor_0.Src.Util.RigIK);
local v3 = require(l_script_FirstAncestor_0.Src.Util.RigUtils);
local v4 = require(l_script_FirstAncestor_0.Src.Util.Constants);
local l_Workspace_0 = game:GetService("Workspace");
local v6 = require(l_script_FirstAncestor_0.LuaFlags.GetFFlagRigIK);
local v7 = v1.PureComponent:extend("R15IKRig");
v7.buildConstraints = function(v8)
    local v9 = if not v6() then v3.buildR15Constraints(v8.props.RootInstance) else v2.buildR15Constraints(v8.props.RootInstance);
    local v10 = {};
    for v11, v12 in pairs(v9) do
        v10[v11] = v1.createElement(v12.Type, v12.Props);
    end;
    return v10;
end;
v7.init = function(_)
    local l_l_Workspace_0_FirstChild_0 = l_Workspace_0:FindFirstChild(v4.TEMPORARY_CONSTRAINTS);
    if l_l_Workspace_0_FirstChild_0 then
        l_l_Workspace_0_FirstChild_0:Destroy();
    end;
end;
v7.render = function(v15)
    return v1.createElement(v1.Portal, {
        target = l_Workspace_0
    }, {
        [v4.TEMPORARY_CONSTRAINTS] = v1.createElement("Folder", {}, v15:buildConstraints())
    });
end;
return v7;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AnimationClipEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.Roact);
local v2 = require(l_script_FirstAncestor_0.Packages.Framework);
local l_ContextServices_0 = v2.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_CaptureFocus_0 = v2.UI.CaptureFocus;
local v6 = v1.PureComponent:extend("InactiveCover");
v6.render = function(v7)
    local l_OnFocused_0 = v7.props.OnFocused;
    local l_Stylizer_0 = v7.props.Stylizer;
    return v1.createElement(l_CaptureFocus_0, {
        Priority = 100
    }, {
        Text = v1.createElement("TextButton", {
            Size = UDim2.new(1, 0, 1, 0),
            BackgroundColor3 = Color3.new(),
            BackgroundTransparency = 0.35,
            AutoButtonColor = false,
            Font = l_Stylizer_0.font,
            TextSize = l_Stylizer_0.startScreenTheme.textSize,
            TextColor3 = l_Stylizer_0.startScreenTheme.darkTextColor,
            Text = v7.props.Localization:getText("Title", "ClickToContinue"),
            [v1.Event.Activated] = l_OnFocused_0
        })
    });
end;
return (l_withContext_0({
    Stylizer = l_ContextServices_0.Stylizer,
    Localization = l_ContextServices_0.Localization
})(v6));


local l_RunService_0 = game:GetService("RunService");
local l_CoreGui_0 = game:GetService("CoreGui");
local l_Selection_0 = game:GetService("Selection");
local l_script_FirstAncestor_0 = script:FindFirstAncestor("AnimationClipEditor");
local v4 = require(l_script_FirstAncestor_0.Packages.Roact);
local v5 = require(l_script_FirstAncestor_0.Packages.RoactRodux);
local l_ContextServices_0 = require(l_script_FirstAncestor_0.Packages.Framework).ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local v8 = require(l_script_FirstAncestor_0.Src.Context.Signals);
local l_Actions_0 = l_script_FirstAncestor_0.Src.Actions;
local v10 = require(l_Actions_0.SetSelectedTrackInstances);
local v11 = require(l_Actions_0.SetSelectedTracks);
local l_Components_0 = l_script_FirstAncestor_0.Src.Components;
local _ = require(l_Components_0.BlockingDialog.ErrorDialogContents);
local v14 = require(l_Components_0.BlockingDialog.ErrorList);
local l_Util_0 = l_script_FirstAncestor_0.Src.Util;
local v16 = require(l_Util_0.Constants);
local v17 = require(l_Util_0.RigInfo);
local _ = require(l_Util_0.RigUtils);
local v19 = require(l_Util_0.RigValidation);
local v20 = require(l_Util_0.RigVisualization);
local v21 = require(l_Util_0.showBlockingDialog);
local l_Thunks_0 = l_script_FirstAncestor_0.Src.Thunks;
local v23 = require(l_Thunks_0.SetSelectedTracks);
local v24 = require(l_Thunks_0.UpdateRootInstance);
local v25 = require(l_script_FirstAncestor_0.LuaFlags.GetFFlagSelectFromViewport);
local v26 = v4.PureComponent:extend("InstanceSelector");
local function v27(v28)
    if not v28 or v28 == game.Workspace then
        return nil;
    else
        assert(v28);
        if not v28:IsA("Model") then
            return v27(v28.Parent);
        else
            return v28;
        end;
    end;
end;
local function _(v29)
    return v29:FindFirstAncestor(game.Workspace.Name) ~= nil;
end;
local function _()
    if #l_Selection_0:Get() > 0 then
        return l_Selection_0:Get()[1];
    else
        return nil;
    end;
end;
local function _(v32)
    return v32.props.Mouse:get().Target;
end;
local function _(v34)
    local v35 = false;
    if v34 ~= nil then
        v35 = v34:FindFirstAncestor(game.Workspace.Name) ~= nil and v17.getAnimationController(v34) ~= nil;
    end;
    return v35;
end;
v26.isCurrentRootInstance = function(v37, v38)
    return v38 == v37.props.RootInstance;
end;
v26.selectValidInstance = function(v39, v40, v41)
    if not v39.wasUnmounted then
        local l_Target_0 = v39.props.Mouse:get().Target;
        if l_Target_0 ~= nil then
            local v43;
            if not l_Target_0 or l_Target_0 == game.Workspace then
                v43 = nil;
            else
                assert(l_Target_0);
                v43 = if not l_Target_0:IsA("Model") then v27(l_Target_0.Parent) else l_Target_0;
            end;
            if not (not v43 or v39:isCurrentRootInstance(v43)) then
                local v44 = false;
                if v43 ~= nil then
                    v44 = v43:FindFirstAncestor(game.Workspace.Name) ~= nil and v17.getAnimationController(v43) ~= nil;
                end;
                if v44 then
                    v40(v43);
                    return ;
                end;
            end;
            if v41 then
                v41();
            end;
        end;
        return ;
    else
        return ;
    end;
end;
v26.showErrorDialogs = function(_, v46, v47)
    v21(v46, v4.createElement(v14, {
        ErrorKey = v16.RIG_ERRORS_KEY,
        ErrorList = v47
    }));
end;
v26.init = function(v48)
    v48.wasUnmounted = false;
    v48.state = {
        HoverPart = nil
    };
    v48.selectInstance = function(v49)
        l_Selection_0:Set({
            v49
        });
    end;
    v48.deselect = function()
        l_Selection_0:Set({});
    end;
    v48.deselectAndRemoveSelectedTrackInstances = function()
        v48.deselect();
        if not v25() then
            v48.props.SetSelectedTrackInstances({});
        else
            v48.props.ClearSelectedTracks();
        end;
        v48.props.Signals:get(v16.SIGNAL_KEYS.SelectionChanged):Fire();
    end;
    v48.highlightInstance = function(v50)
        v48:setState({
            HoverPart = v50
        });
    end;
    v48.removeHighlight = function()
        v48:setState({
            HoverPart = v4.None
        });
    end;
    v48.SelectionChangedHandle = l_Selection_0.SelectionChanged:Connect(function()
        local v51 = if #l_Selection_0:Get() > 0 then l_Selection_0:Get()[1] else nil;
        local v52;
        if not v51 or v51 == game.Workspace then
            v52 = nil;
        else
            assert(v51);
            v52 = if not v51:IsA("Model") then v27(v51.Parent) else v51;
        end;
        local l_Plugin_0 = v48.props.Plugin;
        local v54 = false;
        if v52 ~= nil then
            v54 = v52:FindFirstAncestor(game.Workspace.Name) ~= nil and v17.getAnimationController(v52) ~= nil;
        end;
        if not v54 or v48:isCurrentRootInstance(v52) then
            if not (not v51 or not l_Plugin_0) then
                l_Plugin_0:get():Deactivate();
            end;
            return ;
        else
            local v55;
            v54, v55 = v19.rigHasErrors(v52);
            if v54 then
                v48.deselectAndRemoveSelectedTrackInstances();
                l_Plugin_0:get():Deactivate();
                v48:showErrorDialogs(l_Plugin_0:get(), v55);
                return ;
            else
                v48.props.UpdateRootInstance(v52, v48.props.Analytics);
                v48.deselectAndRemoveSelectedTrackInstances();
                return ;
            end;
        end;
    end);
end;
v26.didMount = function(v56)
    v56.deselect();
    v56.Heartbeat = l_RunService_0.Heartbeat:Connect(function(_)
        v56:selectValidInstance(v56.highlightInstance, v56.removeHighlight);
    end);
    local l_Plugin_1 = v56.props.Plugin;
    if l_Plugin_1 then
        l_Plugin_1:get():Activate(true);
        v56.MouseButtonDown = v56.props.Mouse:get().Button1Down:Connect(function()
            v56:selectValidInstance(v56.selectInstance);
        end);
    end;
end;
v26.render = function(v59)
    local l_state_0 = v59.state;
    local l_props_0 = v59.props;
    local l_VisualizeBones_0 = l_props_0.VisualizeBones;
    local l_HoverPart_0 = l_state_0.HoverPart;
    local v64 = l_props_0.Container or l_CoreGui_0;
    local v65 = {};
    if l_VisualizeBones_0 then
        v20.deselectBones();
    end;
    if l_props_0.SelectedTrackInstances then
        for v66, v67 in ipairs(l_props_0.SelectedTrackInstances) do
            if not l_VisualizeBones_0 or not v20.isBone(v67) then
                v65["SelectionBox" .. v66] = v4.createElement("SelectionBox", {
                    Archivable = false,
                    Adornee = v67,
                    LineThickness = 1,
                    Transparency = 0.5,
                    SurfaceTransparency = 0.8,
                    StudioSelectionBox = true
                });
            else
                v20.selectBone(v67);
            end;
        end;
    end;
    v65.HoverBox = l_HoverPart_0 and v4.createElement("SelectionBox", {
        Archivable = false,
        Adornee = l_HoverPart_0,
        LineThickness = 2,
        StudioSelectionBox = true
    });
    return v4.createElement(v4.Portal, {
        target = v64
    }, v65);
end;
v26.willUnmount = function(v68)
    v68.wasUnmounted = true;
    if v68.Heartbeat then
        v68.Heartbeat:Disconnect();
    end;
    if not v25() then
        v68.props.SetSelectedTrackInstances({});
    else
        v68.props.ClearSelectedTracks();
    end;
    v68.props.Signals:get(v16.SIGNAL_KEYS.SelectionChanged):Fire();
    if v68.SelectionChangedHandle then
        v68.SelectionChangedHandle:Disconnect();
    end;
    if v68.MouseButtonDown then
        v68.MouseButtonDown:Disconnect();
    end;
    if v68.props.Plugin then
        v68.props.Plugin:get():Deactivate();
    end;
end;
return v5.connect(function(v69, _)
    return {
        RootInstance = v69.Status.RootInstance,
        SelectedTrackInstances = v69.Status.SelectedTrackInstances,
        VisualizeBones = v69.Status.VisualizeBones
    };
end, function(v71)
    return {
        ClearSelectedTracks = function()
            v71(v23({}));
        end,
        SetSelectedTrackInstances = if v25() then nil else function(v72)
            local v73 = {};
            for v74, v75 in pairs(v72) do
                v73[v74] = {
                    v75.Name
                };
            end;
            v71(v10(v72));
            v71(v11(v73));
        end,
        UpdateRootInstance = function(v76, v77)
            v71(v24(v76, v77));
        end
    };
end)((l_withContext_0({
    Plugin = l_ContextServices_0.Plugin,
    Mouse = l_ContextServices_0.Mouse,
    Analytics = l_ContextServices_0.Analytics,
    Signals = v8
})(v26)));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AnimationClipEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.Roact);
local l_ContextServices_0 = require(l_script_FirstAncestor_0.Packages.Framework).ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local v4 = v1.PureComponent:extend("KeyframeCluster");
v4.render = function(v5)
    local l_props_0 = v5.props;
    local l_keyframeTheme_0 = l_props_0.Stylizer.keyframeTheme;
    local l_Position_0 = l_props_0.Position;
    local l_Size_0 = l_props_0.Size;
    local l_ZIndex_0 = l_props_0.ZIndex;
    local v11 = UDim2.new(0, l_Size_0.Y.Offset - 4, 0, l_Size_0.Y.Offset - 4);
    local v12 = not not l_props_0.Primary and l_keyframeTheme_0.primaryClusterColor or l_keyframeTheme_0.clusterColor;
    return v1.createElement("Frame", {
        BackgroundColor3 = v12,
        ZIndex = l_ZIndex_0,
        Position = l_Position_0,
        AnchorPoint = Vector2.new(0, 0.5),
        BorderSizePixel = 0,
        Size = l_Size_0
    }, {
        LeftDiamond = v1.createElement("Frame", {
            BackgroundColor3 = v12,
            Position = UDim2.new(0, 0, 0.5, 0),
            ZIndex = l_ZIndex_0,
            Size = v11,
            BorderSizePixel = 0,
            AnchorPoint = Vector2.new(0.5, 0.5),
            Rotation = 45
        }),
        RightDiamond = v1.createElement("Frame", {
            BackgroundColor3 = v12,
            Position = UDim2.new(1, 0, 0.5, 0),
            ZIndex = l_ZIndex_0,
            Size = v11,
            BorderSizePixel = 0,
            AnchorPoint = Vector2.new(0.5, 0.5),
            Rotation = 45
        })
    });
end;
return (l_withContext_0({
    Stylizer = l_ContextServices_0.Stylizer
})(v4));