How to make a condition "no widgets of class in viewport"?

Hi,
Is there possibility to make a condition “no widgets of class in viewport”?
Thanks

Here’s the function to do that.

Get all widgets of the class & fail if any are in the viewport.

Thanks you so much!