Text this: A nonsmooth maximum principle for a controlled nonconvex sweeping process