local I=script.Parent.Parent local p=I.Parent local l=require(p.LuauPolyfill)local t=l.Array return function(I)local p=I.forwardRef local l=I.useRef local o=I.useEffect local b=p(function(p,b)local q=l()local Y=l()local S=b or Y o(function()q.current.CurrentCamera=S.current end)return I.createElement("\086\105\101\119\112\111\114\116\070\114\097\109\101",{Size=UDim2.new(.8,0,.8,0);Position=UDim2.new(.1,0,.1,0);BackgroundColor3=Color3.fromRGB(39,39,55);ref=q},t.concat({I.createElement("\067\097\109\101\114\097",{CFrame=CFrame.new(Vector3.new(0,0,6),Vector3.new(0,0,0));ref=S})},p.children))end)return b end
local srcWorkspace = script.Parent.Parent
local rootWorkspace = srcWorkspace.Parent
local LuauPolyfill = require(rootWorkspace.LuauPolyfill)
local Array = LuauPolyfill.Array

return function(Roact)
	local forwardRef = Roact.forwardRef
	local useRef = Roact.useRef
	local useEffect = Roact.useEffect

	local Canvas = forwardRef(function(props, ref)
		local viewportRef = useRef()
		local cameraRef_ = useRef()
		local cameraRef = ref or cameraRef_

		useEffect(function()
			viewportRef.current.CurrentCamera = cameraRef.current
		end)

		return Roact.createElement(
			"ViewportFrame",
			{
				Size = UDim2.new(0.8, 0, 0.8, 0),
				Position = UDim2.new(0.1, 0, 0.1, 0),
				BackgroundColor3 = Color3.fromRGB(0x27, 0x27, 0x37),
				-- selene: allow(roblox_incorrect_roact_usage)
				ref = viewportRef,
			},
			Array.concat({
				Roact.createElement("Camera", {
					CFrame = CFrame.new(Vector3.new(0, 0, 6), Vector3.new(0, 0, 0)),
					-- selene: allow(roblox_incorrect_roact_usage)
					ref = cameraRef,
				}),
			}, props.children)
		)
	end)

	return Canvas
end
