code: function getParentNode(node) {
          var parent = node.parentNode;
  
          if (parent && parent.nodeType == 11 && parent.host) {
              // If the parent is a shadow root, return the host element.
              return parent.host;
          }
          return parent;
      }
docs: Gets the parent node of an element or its host element if the parent node
  is a shadow root.
  @param {Node} node The node whose parent to get.
  @return {Node|null} The parent node or null if no parent exists.