function handleTaggedTemplate(strings, ...values) {
  const empty = createTree('#text', EMPTY.STR);

  // Do not attempt to parse empty strings.
  if (!strings) {
    return empty;
  }

  // If this function is used outside of a tagged template, ensure that flat
  // strings are coerced to arrays, simulating a tagged template call.
  else if (typeof strings === 'string') {
    strings = [strings];
  }

  // Parse only the text, no dynamic bits.
  if (strings.length === 1 && !values.length) {
    if (!strings[0]) {
      return empty;
    }

    let { childNodes } = Internals.parse(strings[0]);

    const startNode = childNodes[0];
    const endNode = childNodes[childNodes.length - 1];
    const isStartText = startNode.nodeType === NODE_TYPE.TEXT;
    const isEndText = endNode.nodeType === NODE_TYPE.TEXT;

    // Trim surrounding text if only one single element was returned.
    if (isStartText || isEndText) {
      /** @type {VTree[]} */
      const trimmedNodes = [].concat(...childNodes);

      for (let i = 0; i < trimmedNodes.length; i++) {
        const node = trimmedNodes[i];

        if (
          (node === startNode || node === endNode) &&
          node.nodeType === NODE_TYPE.TEXT &&
          !node.nodeValue.trim()
        ) {
          trimmedNodes.splice(i, 1);
        }
      }

      if (trimmedNodes.length === 1) {
        childNodes = trimmedNodes;
      }
    }

    return createTree(childNodes.length === 1 ? childNodes[0] : childNodes);
  }

  // Used to store markup and tokens.
  let HTML = EMPTY.STR;

  // We filter the supplemental values by where they are used. Values are
  // either attributes, children, or tags (for components).
  /** @type {Supplemental} */
  const supplemental = ({
    attributes: {},
    children: {},
    tags: {},
   });

  // Loop over the static strings, each break correlates to an interpolated
  // value. As these values can be dynamic, we cannot pass them to the HTML
  // parser inline (it only accepts strings). These dynamic values are indexed
  // in an object called supplemental and keyed by a incremental string token.
  // The following loop instruments the markup with these tokens that the
  // parser then uses to assemble the correct tree.
  strings.forEach((string, i) => {
    // Always add the string, we need it to parse the markup later.
    HTML += string;

    // If there are values, figure out where in the markup they were injected.
    if (values.length) {
      const value = nextValue(values);
      const lastCharacter = HTML.trim().slice(-1);
      const lastTwoCharacters = HTML.trim().slice(-2);
      const isAttribute = HTML.lastIndexOf('>') < HTML.lastIndexOf('<');
      const isTag = Boolean(lastCharacter === '<' || lastTwoCharacters === '</');
      const isObject = typeof value === 'object';
      const token = `${TOKEN}${i}__`;

      // Injected as a tag.
      if (isTag) {
        supplemental.tags[i] = value;
        HTML += token;
      }
      // Injected as attribute.
      else if (isAttribute) {
        supplemental.attributes[i] = value;
        HTML += token;
      }
      // Injected as a child node.
      else if (isArray(value) || isObject) {
        supplemental.children[i] = createTree(value);
        HTML += token;
      }
      // Injected as something else in the markup or undefined, ignore
      // obviously falsy values used with boolean operators.
      else if (value) {
        HTML += value;
      }
    }
  });

  // Parse the instrumented markup to get the Virtual Tree.
  const { childNodes } = Internals.parse(HTML);

  // Pass through flatten and interpolate dynamic data.
  const vTree = interpolateAndFlatten(createTree(childNodes), supplemental);

  // Loop through all nodes and apply the dynamic attributes and flatten
  // fragments.
  if (vTree.nodeType === NODE_TYPE.FRAGMENT && vTree.childNodes.length === 1) {
    return vTree.childNodes[0];
  }

  return vTree;
}
Processes a tagged template, or process a string and interpolate
associated values. These values can be of any type and can be
put in various parts of the markup, such as tag names, attributes,
and node values.

@param {string | string[] | TemplateStringsArray} strings
@param  {...any} values - test
@return {VTree} VTree object or null if no input strings