focus = function (event) {
  const targetElement = event.map.getTargetElement();
  const rootNode = targetElement.getRootNode();
  const activeElement = event.map.getOwnerDocument().activeElement;

  return rootNode instanceof ShadowRoot
    ? rootNode.host.contains(activeElement)
    : targetElement.contains(activeElement);
}
Return `true` if the map has the focus. This condition requires a map target
element with a `tabindex` attribute, e.g. `<div id="map" tabindex="1">`.

@param {import("../MapBrowserEvent.js").default} event Map browser event.
@return {boolean} The map has the focus.
@api