local Z=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local I=Z:WaitForChild("\077\111\100\117\108\101\115")local S=require(I.src.utils.Logger)local C=require(I.src.utils.Dict)local f=require(I.src.utils.None)local function L(Z,I)Z=Z or{}if I.type=="\097\100\100\073\116\101\109\115\084\111\080\108\097\121\101\114\073\110\118\101\110\116\111\114\121"then return C.join(Z,I.items)elseif I.type=="\114\101\109\111\118\101\073\116\101\109\070\114\111\109\080\108\097\121\101\114\073\110\118\101\110\116\111\114\121"then return C.join(Z,{[I.itemId]=f})end return Z end return L
--[[
	A client's view of their inventory uses a different reducer than the
	server's view of all client's inventories.
]]

local ReplicatedStorage = game:GetService('ReplicatedStorage')
local Modules = ReplicatedStorage:WaitForChild('Modules')
local logger = require(Modules.src.utils.Logger)

local Dict = require(Modules.src.utils.Dict)
local None = require(Modules.src.utils.None)

local function inventory(state, action)
	state = state or {}

	if action.type == 'addItemsToPlayerInventory' then
		return Dict.join(state, action.items)
	elseif action.type == 'removeItemFromPlayerInventory' then
		return Dict.join(state, { [action.itemId] = None })
	end

	return state
end

return inventory