Remove items in context menu using bpmn-modeler-development.js

I am using bpmn-modeler-development.js file to load my bpmn diagram.

i like to remove items from context menu on certain conditions

but it is not becoming possible to use this code

const _getContextPadEntries = ContextPadProvider.prototype.getContextPadEntries;
as i am getting undefined. can anyone suggest how I can get ContextPadProvider using the above file please.