function getCachedItem(element) {
    if (!isHTMLElement(element)) {
      return null;
    }
    const slotName = element.getAttribute('slot');
    /** @type {CacheItem|null} */
    let result = null;
    if (slotName) {
      const cachedItemsWithSameName = cache[slotName];
      if (cachedItemsWithSameName) {
        result = cachedItemsWithSameName.filter(item => item?.element === element)[0] || null;
      }
    }
    return result;
  }
@description Returns a cached item for the given element or null otherwise
@param {HTMLElement|ShadowRoot} element
@returns {CacheItem|null}