A Bargaining Theory of Conflict with Endogenous Preferences