findGroupForElement(element2) {
      for (const group of this.conditionalGroups || []) {
        if (group.some((item) => item.element === element2)) {
          return group;
        }
      }
      return null;
    }
Finds and returns the group of conditional elements that contains the specified element.

This method searches through the existing groups of conditional elements to determine
the group where the given element belongs. Each group represents a logical chain of
`data-if`, `data-else-if`, and `data-else` elements.

@param {Element} element - The DOM element to find the group for.
@returns {Array<Object>|null} The group containing the specified element, or `null` if not found.
Each group object comprises:
   - {Element} element: The DOM element.
   - {string} type: The type of conditional ('if', 'else-if', 'else').
   - {string|null} expression: The conditional expression, null for 'else'.