A Single Recipe for Online Submodular Maximization with Adversarial or Stochastic Constraints