Replace profile.activate and rcOptions with
profile.modeActivationCondition and rcModeActivationMask.

Implementation of using and setting modeActivationConditions is missing.