private function _getThumbnailUrl(EmbeddedAsset $embeddedAsset, int $size, int $maxSize = 200)
	{
		$assetManagerService = Craft::$app->getAssetManager();
		$defaultThumb = $assetManagerService->getPublishedUrl('@spicyweb/embeddedassets/resources/default-thumb.svg', true);

		// If embedded asset thumbnails are disabled, just show Embedded Assets' default.
		if (!$this->getSettings()->showThumbnailsInCp)
		{
			return $defaultThumb;
		}

		$url = false;
		$image = $embeddedAsset->getImageToSize($size);

		if ($image && UrlHelper::isAbsoluteUrl($image['url']))
		{
			$imageSize = max($image['width'], $image['height']);

			if ($size <= $maxSize || $imageSize > $maxSize)
			{
				$url = $image['url'];
			}
		}
		// Check to avoid showing the default thumbnail or provider icon in the asset editor HUD.
		else if ($size <= $maxSize)
		{
			$providerIcon = $embeddedAsset->getProviderIconToSize($size);

			if ($providerIcon && UrlHelper::isAbsoluteUrl($providerIcon['url']))
			{
				$url = $providerIcon['url'];
			}
			else
			{
				$url = $defaultThumb;
			}
		}

		return $url;
	}