function red.error(x)print(x)end red.remotes=RunService:IsClient()and ReplicatedStorage:WaitForChild(Constants.remoteFolderName)or ReplicatedStorage:FindFirstChild(Constants.remoteFolderName)if not red.remotes then red.remotes=Instance.new("\070\111\108\100\101\114")red.remotes.Name=Constants.remoteFolderName local x=Instance.new("\082\101\109\111\116\101\069\118\101\110\116")x.Name="\067\108\105\101\110\116"x.Parent=red.remotes local U=Instance.new("\066\105\110\100\097\098\108\101\069\118\101\110\116")U.Name="\083\101\114\118\101\114"U.Parent=red.remotes red.remotes.Parent=ReplicatedStorage end return Util.extend(red,{Server=require(script.Server);State=require(script.State);Store=require(script.Store)})

function red.error(err)
	print(err)
end

red.remotes = RunService:IsClient() and
	ReplicatedStorage:WaitForChild(Constants.remoteFolderName) or
	ReplicatedStorage:FindFirstChild(Constants.remoteFolderName)

if not red.remotes then
	-- Container for remotes
	red.remotes = Instance.new('Folder')
	red.remotes.Name = Constants.remoteFolderName
	
	-- store:dispatch() calls from client to server and server to client
	local client = Instance.new('RemoteEvent')
	client.Name = 'Client'
	client.Parent = red.remotes
	
	-- store:dispatch() calls from server to server
	local server = Instance.new('BindableEvent')
	server.Name = 'Server'
	server.Parent = red.remotes
	
	red.remotes.Parent = ReplicatedStorage
end

return Util.extend(red, {
	Server = require(script.Server),
	State = require(script.State),
	Store = require(script.Store)
})
