public function resolveShortcutTarget(NodeInterface $node)
    {
        $infiniteLoopPrevention = 0;
        while ($node->getNodeType()->isOfType('Neos.Neos:Shortcut') && $infiniteLoopPrevention < 50) {
            $infiniteLoopPrevention++;
            switch ($node->getProperty('targetMode')) {
                case 'selectedTarget':
                    $target = $node->getProperty('target');
                    if ($this->linkingService->hasSupportedScheme($target)) {
                        $targetObject = $this->linkingService->convertUriToObject($target, $node);
                        if ($targetObject instanceof NodeInterface) {
                            $node = $targetObject;
                        } elseif ($targetObject instanceof AssetInterface) {
                            return $this->linkingService->resolveAssetUri($target);
                        }
                    } else {
                        return $target;
                    }
                    break;
                case 'parentNode':
                    $node = $node->getParent();
                    break;
                case 'firstChildNode':
                default:
                    $childNodes = $node->getChildNodes('Neos.Neos:Document');
                    if ($childNodes !== []) {
                        $node = reset($childNodes);
                    } else {
                        return null;
                    }
            }
        }

        return $node;
    }