boundsRelativeTo(target, includeTransform = true) {
    const type = typeof target;
    const bounds = includeTransform ? this.bounds : this.localBounds;
    const selfRect = this._getElementBoundingRect();
    let dx = selfRect.left;
    let dy = selfRect.top;

    if (type === 'object' && target !== null && typeof target.getBoundingClientRect === 'function') {
      const { left = 0, top = 0 } = target.getBoundingClientRect();
      dx -= left;
      dy -= top;
    }

    bounds.x += dx;
    bounds.y += dy;

    return bounds;
  }
/**
   * Bounding rectangle of the node, relative a target.
   *
   * If target is an HTMLElement, the bounds are relative to the HTMLElement.
   * Any other target type will return the bounds relative to the viewport of the browser.
   *
   * @param {HTMLElement|any} target
   * @param {boolean} includeTransform - Whether to include any applied transforms on the node
   * @returns {Rect}
   * @example
   *
   * node.boundsRelativeTo($('div'));
   * node.boundsRelativeTo('viewport');
   */
Bounding rectangle of the node, relative a target.
If target is an HTMLElement, the bounds are relative to the HTMLElement.
Any other target type will return the bounds relative to the viewport of the browser.

@param {HTMLElement|any} target
@param {boolean} includeTransform - Whether to include any applied transforms on the node
@returns {Rect}
@example


Bounding rectangle of the node relative a target . If target is an HTMLElement the bounds are relative to the HTMLElement . Any other target type will return the bounds relative to the viewport of the browser . @param { HTMLElement|any } target @param { boolean } includeTransform - Whether to include any applied transforms on the node @returns { Rect } @example
boundsRelativeTo(target, includeTransform = true) {
    const type = typeof target;
    const bounds = includeTransform ? this.bounds : this.localBounds;
    const selfRect = this._getElementBoundingRect();
    let dx = selfRect.left;
    let dy = selfRect.top;
    if (type === 'object' && target !== null && typeof target.getBoundingClientRect === 'function') {
      const { left = 0, top = 0 } = target.getBoundingClientRect();
      dx -= left;
      dy -= top;
    }
    bounds.x += dx;
    bounds.y += dy;
    return bounds;
  }
boundsRelativeTo ( target , includeTransform = true ) { const type = typeof target ; const bounds = includeTransform ? this . bounds : this . localBounds ; const selfRect = this . _getElementBoundingRect ( ) ; let dx = selfRect . left ; let dy = selfRect . top ; if ( type === 'object' && target !== null && typeof target . getBoundingClientRect === 'function' ) { const { left = 0 , top = 0 } = target . getBoundingClientRect ( ) ; dx -= left ; dy -= top ; } bounds . x += dx ; bounds . y += dy ; return bounds ; }
Bounding rectangle of the node, relative a target.
Bounding rectangle of the node relative a target .