return Rodux.createReducer({},{[SetAvailableToSellAssetsFromFetchSellData.name]=function(b,y)local V=y.assetId local S=y.userAssetIdList return Cryo.Dictionary.join(b,{[V]=S})end;[AddAvailableToSellAsset.name]=function(b,y)local V=y.assetId local S=y.userAssetId local X={S}local U=b[V]if U then X=Cryo.List.join(U,X)end return Cryo.Dictionary.join(b,{[V]=X})end;[RemoveAvailableToSellAsset.name]=function(b,y)local V=y.assetId local S=b[V]if not S then return b end local X=Cryo.List.removeValue(S,y.userAssetId)return Cryo.Dictionary.join(b,{[V]=X})end})
-- dictionary of assetIds containing a list of userAssetIds
return Rodux.createReducer({}, {
	--[[
		action.assetId: string
		action.userAssetIdList: table
	]]
	[SetAvailableToSellAssetsFromFetchSellData.name] = function(state, action)
		local assetId = action.assetId
		local userAssetIdList = action.userAssetIdList

		return Cryo.Dictionary.join(state, {
			[assetId] = userAssetIdList,
		})
	end,

	--[[
		action.assetId: string
		action.userAssetId: string
	]]
	[AddAvailableToSellAsset.name] = function(state, action)
		local assetId = action.assetId
		local userAssetId = action.userAssetId
		local newList = { userAssetId }

		local currentInfo = state[assetId]
		if currentInfo then
			newList = Cryo.List.join(currentInfo, newList)
		end

		return Cryo.Dictionary.join(state, {
			[assetId] = newList,
		})
	end,

	--[[
		action.assetId: string
		action.userAssetId: string
	]]
	[RemoveAvailableToSellAsset.name] = function(state, action)
		local assetId = action.assetId

		local currentInfo = state[assetId]
		if not currentInfo then
			return state
		end

		local newList = Cryo.List.removeValue(currentInfo, action.userAssetId)

		return Cryo.Dictionary.join(state, {
			[assetId] = newList,
		})
	end,
})
