/// <summary>
        /// On click 'Update package' callback.
        /// </summary>
        public void UpdateClick()
        {
            Debug.Log(kHeader, "[UpdateClick]");
            var selectedPackage = GetSelectedPackage();

            if (selectedPackage.source == PackageSource.Git)
            {
                string packageId = selectedPackage.packageId;
                string url       = PackageUtils.GetRepoUrl(packageId);
#if UNITY_2019_3_OR_NEWER
                string refName = GetSelectedVersion().packageInfo.git.revision;
#else
                string refName       = GetSelectedVersion().VersionId.Split('@')[1];
                var    originRefName = refName;

                // Find correct reference (branch or tag) name.
                while (!AvailableVersions.GetVersions(selectedPackage.name, url).Any(x => x.refName == refName))
                {
                    var index = refName.IndexOf('-');
                    if (index < 0 || refName.Length < 1)
                    {
                        throw new Exception($"Cannot install '{packageId}'. The branch or tag is not found in repository.");
                    }
                    refName = refName.Substring(index + 1);
                }
#endif
                PackageUtils.UninstallPackage(selectedPackage.name);
                PackageUtils.InstallPackage(selectedPackage.name, url, refName);
            }
            else
            {
                packageDetails.UpdateClick();
            }
        }
        /// <summary>
        /// On click 'Remove package' callback.
        /// </summary>
        public void RemoveClick()
        {
            Debug.Log(kHeader, "[RemoveClick]");
            var selectedPackage = GetSelectedPackage();

            if (selectedPackage.source == PackageSource.Git)
            {
                PackageUtils.UninstallPackage(selectedPackage.name);
            }
            else
            {
                packageDetails.RemoveClick();
            }
        }