local w=Vector2.new(0,0)local z=require(script.Parent:WaitForChild("\066\097\115\101\067\097\109\101\114\097"))local y=setmetatable({},z)y.__index=y local o=require(script.Parent:WaitForChild("\067\097\109\101\114\097\085\116\105\108\115"))function y.new()local w=setmetatable(z.new(),y)w.isFollowCamera=false w.isCameraToggle=false w.lastUpdate=tick()w.cameraToggleSpring=o.Spring.new(5,0)return w end local c=require(script.Parent:WaitForChild("\067\097\109\101\114\097\073\110\112\117\116"))function y.GetCameraToggleOffset(w,z)if not w.isCameraToggle then return Vector3.new()end local y=w.currentSubjectDistance if c.getTogglePan()then w.cameraToggleSpring.goal=math.clamp(o.map(y,.5,w.FIRST_PERSON_DISTANCE_THRESHOLD,0,1),0,1)else w.cameraToggleSpring.goal=0 end return Vector3.new(0,w.cameraToggleSpring:step(z)*(math.clamp(o.map(y,.5,64,0,1),0,1)+1),0)end function y.SetCameraMovementMode(w,y)z.SetCameraMovementMode(w,y)w.isFollowCamera=y==Enum.ComputerCameraMovementMode.Follow w.isCameraToggle=y==Enum.ComputerCameraMovementMode.CameraToggle end local D=CFrame.fromOrientation(-0.26179938779915,0,0)local N=game:GetService("\080\108\097\121\101\114\115")local t=0 local L=game:GetService("\086\082\083\101\114\118\105\099\101")function y.Update(w)local z=tick()local y=z-w.lastUpdate local H=workspace.CurrentCamera local F=H.CFrame local G=H.Focus local J=nil if w.resetCameraAngle then local z=w:GetHumanoidRootPart()if z then J=(z.CFrame*D).lookVector else J=D.lookVector end w.resetCameraAngle=false end local h=w:GetHumanoid()local W=H.CameraSubject local Y=W and W:IsA("\086\101\104\105\099\108\101\083\101\097\116")local s=W and W:IsA("\083\107\097\116\101\098\111\097\114\100\080\108\097\116\102\111\114\109")local n=h and h:GetState()==Enum.HumanoidStateType.Climbing if w.lastUpdate==nil or y>1 then w.lastCameraTransform=nil end local O=c.getRotation()w:StepZoom()local x=w:GetCameraHeight()if c.getRotation()~=Vector2.new()then t=0 w.lastUserPanCamera=tick()end local A=z-w.lastUserPanCamera<2 local V=w:GetSubjectPosition()if V and(N.LocalPlayer and H)then local z=w:GetCameraToSubjectDistance()if z<.5 then z=.5 end if w:GetIsMouseLocked()and not w:IsInFirstPerson()then local z=w:CalculateNewLookCFrameFromArg(J,O)local y=w:GetMouseLockOffset()local c=(y.X*z.RightVector+y.Y*z.UpVector)+y.Z*z.LookVector if o.IsFiniteVector3(c)then V=V+c end elseif c.getRotation()==Vector2.new()and w.lastCameraTransform then local z=w:IsInFirstPerson()if not Y and not s then if w.isFollowCamera and(n and(w.lastUpdate and(h and h.Torso)))then if z then if w.lastSubjectCFrame and((Y or s)and W:IsA("\066\097\115\101\080\097\114\116"))then local z=-o.GetAngleBetweenXZVectors(w.lastSubjectCFrame.lookVector,W.CFrame.lookVector)if o.IsFinite(z)then O=O+Vector2.new(z,0)end t=0 end elseif not A then t=math.clamp(t+3.8397243543875*y,0,4.3633231299858)local z=math.clamp(t*y,0,1)if w:IsInFirstPerson()and(not w.isFollowCamera or not w.isClimbing)then z=1 end local c=o.GetAngleBetweenXZVectors(h.Torso.CFrame.lookVector,w:GetCameraLookVector())if o.IsFinite(c)and math.abs(c)>.0001 then O=O+Vector2.new(c*z,0)end end elseif w.isFollowCamera and(not z and(not A and not L.VREnabled))then local z=o.GetAngleBetweenXZVectors(-(w.lastCameraTransform.p-V),w:GetCameraLookVector())if o.IsFinite(z)and(math.abs(z)>.0001 and.4*y<math.abs(z))then O=O+Vector2.new(z,0)end end elseif w.lastUpdate and(h and h.Torso)then if z then if w.lastSubjectCFrame and((Y or s)and W:IsA("\066\097\115\101\080\097\114\116"))then v27=-o.GetAngleBetweenXZVectors(w.lastSubjectCFrame.lookVector,W.CFrame.lookVector)if o.IsFinite(v27)then O=O+Vector2.new(v27,0)end t=0 end elseif not A then t=math.clamp(t+3.8397243543875*y,0,4.3633231299858)v28=math.clamp(t*y,0,1)if w:IsInFirstPerson()and(not w.isFollowCamera or not w.isClimbing)then v28=1 end v29=o.GetAngleBetweenXZVectors(h.Torso.CFrame.lookVector,w:GetCameraLookVector())if o.IsFinite(v29)and math.abs(v29)>.0001 then O=O+Vector2.new(v29*v28,0)end end elseif w.isFollowCamera and(not z and(not A and not L.VREnabled))then v30=o.GetAngleBetweenXZVectors(-(w.lastCameraTransform.p-V),w:GetCameraLookVector())if o.IsFinite(v30)and(math.abs(v30)>.0001 and.4*y<math.abs(v30))then O=O+Vector2.new(v30,0)end end end if not w.isFollowCamera then local o=L.VREnabled if o then local z=w:GetVRFocus(V,y)else v32=CFrame.new(V)end local c=v32.p if o and not w:IsInFirstPerson()then local y=(V-H.CFrame.p).magnitude if z<y or O.x~=0 then local o=w:CalculateNewLookVectorFromArg(nil,O)*math.min(y,z)local D=c-o local N=H.CFrame.lookVector if O.x~=0 then N=o end local t=CFrame.new(D,Vector3.new(D.x+N.x,D.y,D.z+N.z))+Vector3.new(0,x,0)end else v38=CFrame.new(c-z*w:CalculateNewLookVectorFromArg(J,O),c)end else if L.VREnabled then v32=w:GetVRFocus(V,y)else v32=CFrame.new(V)end v38=CFrame.new(v32.p-z*w:CalculateNewLookVectorFromArg(J,O),v32.p)+Vector3.new(0,x,0)end local D=w:GetCameraToggleOffset(y)G=v32+D F=v38+D w.lastCameraTransform=F w.lastCameraFocus=G if(Y or s)and W:IsA("\066\097\115\101\080\097\114\116")then w.lastSubjectCFrame=W.CFrame else w.lastSubjectCFrame=nil end end w.lastUpdate=z return F,G end function y.EnterFirstPerson(w)w.inFirstPerson=true w:UpdateMouseBehavior()end function y.LeaveFirstPerson(w)w.inFirstPerson=false w:UpdateMouseBehavior()end return y
-- Decompiled with the Synapse X Luau decompiler.

local v1 = Vector2.new(0, 0)
local v2 = require(script.Parent:WaitForChild("BaseCamera"))
local v3 = setmetatable({}, v2)
v3.__index = v3
local u1 = require(script.Parent:WaitForChild("CameraUtils"))
function v3.new()
	local v4 = setmetatable(v2.new(), v3)
	v4.isFollowCamera = false
	v4.isCameraToggle = false
	v4.lastUpdate = tick()
	v4.cameraToggleSpring = u1.Spring.new(5, 0)
	return v4
end
local u2 = require(script.Parent:WaitForChild("CameraInput"))
function v3.GetCameraToggleOffset(p1, p2)
	if not p1.isCameraToggle then
		return Vector3.new()
	end
	local l__currentSubjectDistance__5 = p1.currentSubjectDistance
	if u2.getTogglePan() then
		p1.cameraToggleSpring.goal =
			math.clamp(u1.map(l__currentSubjectDistance__5, 0.5, p1.FIRST_PERSON_DISTANCE_THRESHOLD, 0, 1), 0, 1)
	else
		p1.cameraToggleSpring.goal = 0
	end
	return Vector3.new(
		0,
		p1.cameraToggleSpring:step(p2) * (math.clamp(u1.map(l__currentSubjectDistance__5, 0.5, 64, 0, 1), 0, 1) + 1),
		0
	)
end
function v3.SetCameraMovementMode(p3, p4)
	v2.SetCameraMovementMode(p3, p4)
	p3.isFollowCamera = p4 == Enum.ComputerCameraMovementMode.Follow
	p3.isCameraToggle = p4 == Enum.ComputerCameraMovementMode.CameraToggle
end
local u3 = CFrame.fromOrientation(-0.2617993877991494, 0, 0)
local l__Players__4 = game:GetService("Players")
local u5 = 0
local l__VRService__6 = game:GetService("VRService")
function v3.Update(p5)
	local v6 = tick()
	local v7 = v6 - p5.lastUpdate
	local l__CurrentCamera__8 = workspace.CurrentCamera
	local v9 = l__CurrentCamera__8.CFrame
	local v10 = l__CurrentCamera__8.Focus
	local v11 = nil
	if p5.resetCameraAngle then
		local v12 = p5:GetHumanoidRootPart()
		if v12 then
			v11 = (v12.CFrame * u3).lookVector
		else
			v11 = u3.lookVector
		end
		p5.resetCameraAngle = false
	end
	local v13 = p5:GetHumanoid()
	local l__CameraSubject__14 = l__CurrentCamera__8.CameraSubject
	local v15 = l__CameraSubject__14 and l__CameraSubject__14:IsA("VehicleSeat")
	local v16 = l__CameraSubject__14 and l__CameraSubject__14:IsA("SkateboardPlatform")
	local v17 = v13 and v13:GetState() == Enum.HumanoidStateType.Climbing
	if p5.lastUpdate == nil or v7 > 1 then
		p5.lastCameraTransform = nil
	end
	local v18 = u2.getRotation()
	p5:StepZoom()
	local v19 = p5:GetCameraHeight()
	if u2.getRotation() ~= Vector2.new() then
		u5 = 0
		p5.lastUserPanCamera = tick()
	end
	local v20 = v6 - p5.lastUserPanCamera < 2
	local v21 = p5:GetSubjectPosition()
	if v21 and l__Players__4.LocalPlayer and l__CurrentCamera__8 then
		local v22 = p5:GetCameraToSubjectDistance()
		if v22 < 0.5 then
			v22 = 0.5
		end
		if p5:GetIsMouseLocked() and not p5:IsInFirstPerson() then
			local v23 = p5:CalculateNewLookCFrameFromArg(v11, v18)
			local v24 = p5:GetMouseLockOffset()
			local v25 = v24.X * v23.RightVector + v24.Y * v23.UpVector + v24.Z * v23.LookVector
			if u1.IsFiniteVector3(v25) then
				v21 = v21 + v25
			end
		elseif u2.getRotation() == Vector2.new() and p5.lastCameraTransform then
			local v26 = p5:IsInFirstPerson()
			if not v15 and not v16 then
				if p5.isFollowCamera and v17 and p5.lastUpdate and v13 and v13.Torso then
					if v26 then
						if p5.lastSubjectCFrame and ((v15 or v16) and l__CameraSubject__14:IsA("BasePart")) then
							local v27 = -u1.GetAngleBetweenXZVectors(
								p5.lastSubjectCFrame.lookVector,
								l__CameraSubject__14.CFrame.lookVector
							)
							if u1.IsFinite(v27) then
								v18 = v18 + Vector2.new(v27, 0)
							end
							u5 = 0
						end
					elseif not v20 then
						u5 = math.clamp(u5 + 3.839724354387525 * v7, 0, 4.363323129985824)
						local v28 = math.clamp(u5 * v7, 0, 1)
						if p5:IsInFirstPerson() and (not p5.isFollowCamera or not p5.isClimbing) then
							v28 = 1
						end
						local v29 = u1.GetAngleBetweenXZVectors(v13.Torso.CFrame.lookVector, p5:GetCameraLookVector())
						if u1.IsFinite(v29) and math.abs(v29) > 0.0001 then
							v18 = v18 + Vector2.new(v29 * v28, 0)
						end
					end
				elseif p5.isFollowCamera and not v26 and not v20 and not l__VRService__6.VREnabled then
					local v30 = u1.GetAngleBetweenXZVectors(-(p5.lastCameraTransform.p - v21), p5:GetCameraLookVector())
					if u1.IsFinite(v30) and math.abs(v30) > 0.0001 and 0.4 * v7 < math.abs(v30) then
						v18 = v18 + Vector2.new(v30, 0)
					end
				end
			elseif p5.lastUpdate and v13 and v13.Torso then
				if v26 then
					if p5.lastSubjectCFrame and ((v15 or v16) and l__CameraSubject__14:IsA("BasePart")) then
						v27 = -u1.GetAngleBetweenXZVectors(
							p5.lastSubjectCFrame.lookVector,
							l__CameraSubject__14.CFrame.lookVector
						)
						if u1.IsFinite(v27) then
							v18 = v18 + Vector2.new(v27, 0)
						end
						u5 = 0
					end
				elseif not v20 then
					u5 = math.clamp(u5 + 3.839724354387525 * v7, 0, 4.363323129985824)
					v28 = math.clamp(u5 * v7, 0, 1)
					if p5:IsInFirstPerson() and (not p5.isFollowCamera or not p5.isClimbing) then
						v28 = 1
					end
					v29 = u1.GetAngleBetweenXZVectors(v13.Torso.CFrame.lookVector, p5:GetCameraLookVector())
					if u1.IsFinite(v29) and math.abs(v29) > 0.0001 then
						v18 = v18 + Vector2.new(v29 * v28, 0)
					end
				end
			elseif p5.isFollowCamera and not v26 and not v20 and not l__VRService__6.VREnabled then
				v30 = u1.GetAngleBetweenXZVectors(-(p5.lastCameraTransform.p - v21), p5:GetCameraLookVector())
				if u1.IsFinite(v30) and math.abs(v30) > 0.0001 and 0.4 * v7 < math.abs(v30) then
					v18 = v18 + Vector2.new(v30, 0)
				end
			end
		end
		if not p5.isFollowCamera then
			local l__VREnabled__31 = l__VRService__6.VREnabled
			if l__VREnabled__31 then
				local v32 = p5:GetVRFocus(v21, v7)
			else
				v32 = CFrame.new(v21)
			end
			local l__p__33 = v32.p
			if l__VREnabled__31 and not p5:IsInFirstPerson() then
				local l__magnitude__34 = (v21 - l__CurrentCamera__8.CFrame.p).magnitude
				if v22 < l__magnitude__34 or v18.x ~= 0 then
					local v35 = p5:CalculateNewLookVectorFromArg(nil, v18) * math.min(l__magnitude__34, v22)
					local v36 = l__p__33 - v35
					local v37 = l__CurrentCamera__8.CFrame.lookVector
					if v18.x ~= 0 then
						v37 = v35
					end
					local v38 = CFrame.new(v36, (Vector3.new(v36.x + v37.x, v36.y, v36.z + v37.z)))
						+ Vector3.new(0, v19, 0)
				end
			else
				v38 = CFrame.new(l__p__33 - v22 * p5:CalculateNewLookVectorFromArg(v11, v18), l__p__33)
			end
		else
			if l__VRService__6.VREnabled then
				v32 = p5:GetVRFocus(v21, v7)
			else
				v32 = CFrame.new(v21)
			end
			v38 = CFrame.new(v32.p - v22 * p5:CalculateNewLookVectorFromArg(v11, v18), v32.p) + Vector3.new(0, v19, 0)
		end
		local v39 = p5:GetCameraToggleOffset(v7)
		v10 = v32 + v39
		v9 = v38 + v39
		p5.lastCameraTransform = v9
		p5.lastCameraFocus = v10
		if (v15 or v16) and l__CameraSubject__14:IsA("BasePart") then
			p5.lastSubjectCFrame = l__CameraSubject__14.CFrame
		else
			p5.lastSubjectCFrame = nil
		end
	end
	p5.lastUpdate = v6
	return v9, v10
end
function v3.EnterFirstPerson(p6)
	p6.inFirstPerson = true
	p6:UpdateMouseBehavior()
end
function v3.LeaveFirstPerson(p7)
	p7.inFirstPerson = false
	p7:UpdateMouseBehavior()
end
return v3
