if (window.performance && window.performance.mark) { window.performance.mark('startLoadBundleInner-view'); }
// Copyright (C) Microsoft Corporation. All rights reserved.
define("Gallery/Client/Service/SearchProvider/IGallerySearchProviderFactory",["require","exports"],function(n,t){Object.defineProperty(t,"__esModule",{value:!0});t.SearchProviderType=void 0;var i;(function(n){n[n.VSSearchProvider=0]="VSSearchProvider";n[n.VSSSearchProvider=1]="VSSSearchProvider"})(i=t.SearchProviderType||(t.SearchProviderType={}))});

var __extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}();define("Gallery/Client/Controls/RatingControl/RatingControl.ViewModel",["require","exports","knockout","Gallery/Client/URLHelper","VSS/Diag","VSS/Events/Services","VSS/Adapters/Knockout"],function(n,t,i,r,u,f,e){var s,o;Object.defineProperty(t,"__esModule",{value:!0});t.IRatingStarType=t.RatingControlViewModel=void 0;s=function(n){function t(r){var u=__construct(this,n,[]),f,e;for(f in u)u.hasOwnProperty(f)&&(this[f]=u[f]);return u.fullStars=i.observable(0),u.halfStars=i.observable(0),u.isReadOnly=!0,u.fixedFullStars=i.observable(0),u._starType=o.DefaultStar,u.totalStars=r.totalStars,e=t.parseRating(r.rating,r.totalStars),u.fullStars(e.fullStars),u.halfStars(e.halfStars),u.emptyStars=i.computed(function(){var n=u.totalStars-u.fullStars()-u.halfStars();return n>=0?n:0}),u.hasFullStars=i.computed(function(){return u.fixedFullStars()>0}),u.fixedFullStars(e.fullStars),r.isReadOnly===!1&&(u.isReadOnly=r.isReadOnly),r.ratingStarType!==o.DefaultStar&&(u._starType=r.ratingStarType),u._setImagePath(),u}return __extends(t,n),t.prototype.fullStarArray=function(){return new Array(this.fullStars())},t.prototype.halfStarArray=function(){return new Array(this.halfStars())},t.prototype.emptyStarArray=function(){return new Array(this.emptyStars())},t.prototype.fullStarClick=function(n){var t=this;return this.isReadOnly?null:function(){t.onClickRatingFullStars(n+1)}},t.prototype.fullStarMouseOver=function(n){var t=this;return this.isReadOnly?null:function(){t.mouseOverRatingFullStars(n+1)}},t.prototype.fullStarMouseOut=function(){return this.isReadOnly?null:this.mouseOutRatingFullStars.bind(this)},t.prototype.fullStarKeyPress=function(n){var t=this;return function(i,r){t.onKeyDown({index:n+1,isFullStar:!0},r);return!0}},t.prototype.emptyStarClick=function(n){var t=this;return this.isReadOnly?null:function(){t.onClickRatingEmptyStars(n+1)}},t.prototype.emptyStarMouseOver=function(n){var t=this;return this.isReadOnly?null:function(){t.mouseOverRatingEmptyStars(n+1)}},t.prototype.emptyStarKeyPress=function(n){var t=this;return function(i,r){t.onKeyDown({index:n+1,isEmptyStar:!0},r);return!0}},t.prototype.starTabIndex=function(){return this.isReadOnly?null:0},t.prototype._setImagePath=function(){var n=r.GalleryURLs.getResourcePath();this._starType===o.DarkStar?(this.fullStarPath=n+"FullStar.svg",this.halfStarPath=n+"HalfStarDark.svg",this.emptyStarPath=n+"EmptyStarDark.svg"):this._starType===o.LightStar?(this.fullStarPath=n+"FullStarLight.svg",this.halfStarPath=n+"HalfStarLight.svg",this.emptyStarPath=n+"EmptyStar.svg"):(this.fullStarPath=n+"FullStar.svg",this.halfStarPath=n+"HalfStar.svg",this.emptyStarPath=n+"EmptyStar.svg")},t.parseRating=function(n,t){var e=0,i=0,r,s,f,h,o;return(n||(n="0.0"),r=parseFloat(n),r<=0)?{fullStars:0,halfStars:0}:r>=5?{fullStars:5,halfStars:0}:(s=r.toFixed(2),f=s.split("."),h=parseInt(f[0]),e=h,f.length===2&&(o=parseFloat(f[1])/100,o<.25?i=0:o<.75?i=1:e++),{fullStars:e,halfStars:i})},t.prototype.mouseOutRatingFullStars=function(){this.fullStars(this.fixedFullStars())},t.prototype.onKeyDown=function(n,i){f.getService().fire(t.EVENT_ON_KEY_PRESS,this,[{data:n,e:i}])},t.prototype.mouseOverRatingFullStars=function(n){this.fullStars(n)},t.prototype.mouseOverRatingEmptyStars=function(n){this.fullStars(this.fullStars()+n)},t.prototype.onClickRatingFullStars=function(n){this.fixedFullStars(n);this.fullStars(n)},t.prototype.onClickRatingEmptyStars=function(n){this.fixedFullStars(this.fullStars()+n);this.fullStars(this.fullStars()+n)},t.EVENT_ON_KEY_PRESS="VSS.Gallery.RatingControl.OnKeyPress",t.TOTAL_RATING_STARS=5,t}(e.TemplateViewModel);t.RatingControlViewModel=s,function(n){n[n.DefaultStar=0]="DefaultStar";n[n.DarkStar=1]="DarkStar";n[n.LightStar=2]="LightStar"}(o=t.IRatingStarType||(t.IRatingStarType={}))});

define("Gallery/Client/Scenarios/Publisher/Constants",["require","exports"],function(n,t){var c,l,a,i,r,u,f,e,o,s,h,v;Object.defineProperty(t,"__esModule",{value:!0});t.ExtensionCertificationStatus=t.MemberListColumnKeys=t.ExtensionListColumnKeys=t.WellKnownPublisherMetadataLinks=t.PublisherAssetTypes=t.WellKnownPublisherActions=t.PublisherNotificationContractConstants=t.QueryParameterNames=t.PublisherConstants=t.DetailsTabSaveMode=t.PublisherVerificationMode=t.PublisherControlMenuKey=void 0,function(n){n[n.Extensions=0]="Extensions";n[n.Details=1]="Details";n[n.Members=2]="Members";n[n.Certification=3]="Certification"}(c=t.PublisherControlMenuKey||(t.PublisherControlMenuKey={})),function(n){n[n.None=0]="None";n[n.Verified=1]="Verified";n[n.Verification_Needed=2]="Verification_Needed"}(l=t.PublisherVerificationMode||(t.PublisherVerificationMode={})),function(n){n[n.None=0]="None";n[n.PublisherDetails=2]="PublisherDetails";n[n.AzurePublisherNamespace=4]="AzurePublisherNamespace";n[n.PublisherLogo=8]="PublisherLogo"}(a=t.DetailsTabSaveMode||(t.DetailsTabSaveMode={}));i=function(){function n(){}return n.DISPLAY_NAME_LENGTH=90,n.PUBLISHER_ID_LENGTH=63,n.PUBLISHER_LONG_DESCRIPTION_LENGTH=1024,n}();t.PublisherConstants=i;r=function(){function n(){}return n.ManagePageRedirectParamName="managePageRedirect",n.CreateLogoError="updateLogoFailed",n}();t.QueryParameterNames=r;u=function(){function n(){}return n.PublisherName="PublisherName",n.PublisherDisplayName="PublisherDisplayName",n.PublisherAction="PublisherAction",n.UserId="UserId",n}();t.PublisherNotificationContractConstants=u;f=function(){function n(){}return n.AddMember="add",n.RemoveMember="remove",n}();t.WellKnownPublisherActions=f;e=function(){function n(){}return n.Logo="logo",n}();t.PublisherAssetTypes=e;o=function(){function n(){}return n.Company="company",n.Support="support",n.SourceCode="sourceCode",n.Twitter="twitter",n.LinkedIn="linkedIn",n.Profile="profile",n.Logo="logo",n.FallbackLogo="fallbackLogo",n}();t.WellKnownPublisherMetadataLinks=o;s=function(){function n(){}return n.Name="column-key-name",n.Version="column-key-versions",n.LastUpdated="column-key-updated",n.Availability="column-key-availability",n.Rating="column-key-rating",n.Installs="column-key-installs",n.WorksWith="column-key-works-with",n}();t.ExtensionListColumnKeys=s;h=function(){function n(){}return n.UserName="column-key-user-display-name",n.Role="column-key-role",n.RemoveUser="column-key-remove-user",n}();t.MemberListColumnKeys=h,function(n){n[n.None=0]="None";n[n.PrivacyPresent=1]="PrivacyPresent";n[n.LicensePresent=2]="LicensePresent";n[n.SupportPresent=4]="SupportPresent";n[n.AllCriteriaPresent=7]="AllCriteriaPresent"}(v=t.ExtensionCertificationStatus||(t.ExtensionCertificationStatus={}))});

define("Gallery/Client/Pages/Publisher/Publisher.Common",["require","exports","Gallery/Client/Common/Constants","Gallery/Scripts/Gallery/Resources/VSS.Resources.Gallery","Gallery/Client/Common/TelemetryInternal","Gallery/Client/Common/Telemetry","Gallery/Client/Common/Utility.Common","Gallery/Client/Service/VSSGallery/VSSGallery","Gallery/Client/Service/VSSItem","Gallery/Client/URLHelper","Gallery/Client/Scenarios/Publisher/Constants","Gallery/Client/Common/Utility","Gallery/Client/Common/Constants","VSS/Context","VSS/FeatureAvailability/Services","VSS/Gallery/Contracts","VSS/Utils/String","VSS/Utils/Url","VSS/Serialization"],function(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w,b,k){var g,nt,d,tt;Object.defineProperty(t,"__esModule",{value:!0});t.PublisherPageTelemetryHelper=t.PublishedExtensionHelper=t.PublisherHelper=t.PublishingEvents=void 0;g=function(){function n(){}return n.ITEM_PUBLISHED="item-published",n.ITEM_SHARED="item-shared",n.ITEM_UNSHARED="item-unshared",n.ITEM_UPDATED="item-updated",n.ITEM_REMOVED="item-removed",n.ITEM_VALIDATED="item-validated",n}();t.PublishingEvents=g;nt=function(){function n(){}return n.isVerified=function(n){return(n.flags&p.PublisherFlags.Verified)!=0},n.getPublisherMetadataLinkValue=function(n,t){return n&&n[t]&&n[t].href?n[t].href:""},n.setPublisherMetadataLinkValue=function(n,t,i){return n||(n={}),n[t]={href:i},""},n.isPublisherVerificationInPendingState=function(n){return n.state===p.PublisherState.VerificationPending},n.isUpdateLogoFailedInPublisherCreation=function(){if(h.GalleryURLs.getWebPageURL(b.Uri.parse(document.referrer).path)===h.GalleryURLs.getPublisherCreatePublisherURL()){var n=h.GalleryURLs.getQueryParameterValue(window.location.href,c.QueryParameterNames.CreateLogoError);if(n==="true")return!0}return!1},n.shouldShowMarketplaceCertifiedBadge=function(n){return n&&l.FeatureFlagUtils.checkFeatureState(a.FeatureFlag.EnableCertifiedPublisherUIChanges,i.ManagePublisherPageConstants.EnableCertifiedPublisherUIChanges)&&(n&p.PublisherFlags.Certified)>0?!0:!1},n.getReservedPublisherDisplayNameList=function(){var n=k.deserializeJsonIsland($(".ReservedPublisherDisplayNames"),null);return n?n.split(","):[]},n}();t.PublisherHelper=nt;d=function(){function n(){}return n.initialize=function(){n._initialized||(n.ITEM_TYPES_DESCRIPTIONS[s.VSSItemType.VSSExtension]=r.VSTeamServicesExtension_ItemType_Description,n.ITEM_TYPES_DESCRIPTIONS[s.VSSItemType.VSSHostedExtension]=r.VSTeamServicesExtension_ItemType_Description,n.ITEM_TYPES_DESCRIPTIONS[s.VSSItemType.VSSIntegration]=r.VSTeamServicesIntegrationItemTypeDescription,n.ITEM_TYPES_DESCRIPTIONS[s.VSSItemType.VSCodeExtension]=r.VSCodeExtension_ItemType_Description,n.ITEM_TYPES_DESCRIPTIONS[s.VSSItemType.VSSOffer]=r.VSOffer_ItemType_Description,n.ITEM_TYPES_DESCRIPTIONS[s.VSSItemType.VSSTfsExtension]=r.TeamServicesExtensionItemTypeDescription,n.ITEM_TYPES_DESCRIPTIONS[s.VSSItemType.VSSTfsIntegration]=r.TeamServicesIntegrationItemTypeDescription,n.ITEM_TYPES_DESCRIPTIONS[s.VSSItemType.VSSHostedIntegration]=r.VSTeamServicesIntegrationItemTypeDescription,n._initialized=!0)},n.getItemType=function(n){return o.VSSItemHelper.getItemType(n)},n.needsPublisherVerification=function(n){return o.VSSItemHelper.getItemType(n)===s.VSSItemType.VSSExtension||o.VSSItemHelper.getItemType(n)===s.VSSItemType.VSSHostedExtension||o.VSSItemHelper.getItemType(n)===s.VSSItemType.VSSIntegration||o.VSSItemHelper.getItemType(n)===s.VSSItemType.VSSTfsExtension||o.VSSItemHelper.getItemType(n)===s.VSSItemType.VSSTfsIntegration||o.VSSItemHelper.getItemType(n)===s.VSSItemType.VSSHostedIntegration?!0:!1},n.getItemTypeDescription=function(t){return n.ITEM_TYPES_DESCRIPTIONS[t]},n.getIconSource=function(n,t){var i,r;if(t===void 0&&(t=!1),n.versions&&n.versions.length>0&&n.versions[0].files)for(i=0;i<n.versions[0].files.length;i++)if(n.versions[0].files[i].assetType===s.ItemConstants.ASSET_ICON_DEFAULT)return r=n.versions[0].files[i].source,t&&n.versions[0].assetUri&&n.versions[0].fallbackAssetUri&&(r=r.replace(n.versions[0].assetUri,n.versions[0].fallbackAssetUri)),r;return undefined},n.isLocked=function(n){return(n.flags&p.PublishedExtensionFlags.Locked)!=0},n.isUnpublished=function(n){return(n.flags&p.PublishedExtensionFlags.Unpublished)!=0},n.isPublic=function(n){return(n.flags&p.PublishedExtensionFlags.Public)!=0},n.isBuiltIn=function(n){return(n.flags&p.PublishedExtensionFlags.BuiltIn)!=0},n.isHidden=function(n){return(n.flags&p.PublishedExtensionFlags.Hidden)!=0},n.isTrusted=function(n){return(n.flags&p.PublishedExtensionFlags.Trusted)!=0},n.isCertAvailable=function(t){var i=n.getItemType(t);return s.ItemModelHelper.isVSSExtension(i)&&!n.isBuiltIn(t)&&n.hasValidVersion(t)&&!n.isTrusted(t)},n.hasValidVersion=function(n){return(n.flags&p.PublishedExtensionFlags.Validated)!=0},n.getValidationMessage=function(n){return n.versions&&n.versions.length>0?n.versions[0].validationResultMessage:""},n.isShared=function(n){return n.sharedWith&&n.sharedWith.length>0},n.isShareable=function(t){var i=n.getItemType(t);return(s.ItemModelHelper.isVSSExtension(i)||s.ItemModelHelper.isHostedResource(i))&&!n.isPublic(t)&&!n.isBuiltIn(t)},n.isOnPremInstallableExtension=function(t){return n.isOnPremInstallableExtensionType(t)&&n.isPublic(t)&&(t.flags&p.PublishedExtensionFlags.Validated)!=0},n.isOnPremInstallableExtensionType=function(t){var i=n.getItemType(t);return i===s.VSSItemType.VSSTfsExtension||i===s.VSSItemType.VSSExtension},n.isPaid=function(n){return(n.flags&p.PublishedExtensionFlags.Paid)!=0},n.getSharedAccountsFromName=function(n){for(var r,u,f=n.length,i={},t=0;t<f;t++)i[n[t].name]=n[t];r=[];for(u in i)r.push(i[u]);return r},n.getAvailabilityDescription=function(t){var i="",u;return n.isUnpublished(t)?i+=r.Publisher_ExtensionAvailability_Unpublished:n.isPublic(t)?i+=r.Publisher_ExtensionAvailability_Public:n.isShared(t)?(u=t.sharedWith.length,u>0&&(t.sharedWith=n.getSharedAccountsFromName(t.sharedWith)),i+=w.format(r.Publisher_ExtensionAvailability_PrivateSharedMultipleAccounts,t.sharedWith.length)):i+=n.isShareable(t)?r.Publisher_ExtensionAvailability_PrivateNotShared:s.ItemModelHelper.isVSIdeExtension(n.getItemType(t))?r.Publisher_ExtensionAvailability_NotPublic:r.Publisher_ExtensionAvailability_Private,t.flags&p.PublishedExtensionFlags.Locked&&(i+=" & "+r.Publisher_ExtensionAvailability_Locked),i},n.showReportsMenu=function(n){var t=!1,r;return e.FeatureFlagUtils.isFeatureFlagEnabled(location.href,e.FeatureFlagUtils.EnableReportsPage)&&(e.FeatureFlagUtils.setFeatureFlagCookie(e.FeatureFlagUtils.EnableReportsPage),t=!0),n===s.VSSItemType.VSCodeExtension?(r=y.FeatureAvailabilityService.isFeatureEnabled(i.FeatureFlag.EnablePublisherStatPageVSCode,!1),r||t):n===s.VSSItemType.VSIdeExtension?!0:n===s.VSSItemType.VSForMacExtension?!0:v.getPageContext().webAccessConfiguration.isHosted&&n!==s.VSSItemType.VSSOffer},n.requiresPublisherVerification=function(t){var r=!1,i;if(t)for(i=0;i<t.length;i++)if(r=n.needsPublisherVerification(t[i]),r===!0)break;return r},n.ITEM_TYPES_DESCRIPTIONS={},n._initialized=!1,n}();t.PublishedExtensionHelper=d;d.initialize();tt=function(){function n(){}return n.publishEventOnContextMenuOptionClick=function(n,t,i,r){i===void 0&&(i=!1);r===void 0&&(r=!1);var o=f.CustomerIntelligenceConstants.MarketPlaceIntelligenceProperties.ManagePageProperties,e={};e[o.PublisherAction]=n;e[o.IsPublic]=d.isPublic(t);e[o.PublisherId]=t.publisher.publisherName;e[o.ExtensionId]=t.extensionName;e[o.ItemType]=s.ItemModelHelper.getItemTypeText(d.getItemType(t));r?(e[o.TabName]="Extensions",u.TelemetryHelper.publishEvent(f.CustomerIntelligenceConstants.MarketPlaceIntelligenceFeature.MANAGEPUBLISHER,e,i)):u.TelemetryHelper.publishEvent(f.CustomerIntelligenceConstants.MarketPlaceIntelligenceFeature.MANAGEPAGE,e,i)},n}();t.PublisherPageTelemetryHelper=tt});

define("Gallery/Client/Controls/ItemTile/ItemTile.ViewModel",["require","exports","knockout","Gallery/Client/Common/Constants","Gallery/Scripts/Gallery/Resources/VSS.Resources.Gallery","Gallery/Client/Common/Telemetry","Gallery/Client/Common/TelemetryInternal","Gallery/Client/Common/Utility","Gallery/Scripts/Gallery/Resources/VSS.Resources.GalleryCommon","Gallery/Client/Service/Item","Gallery/Client/Controls/RatingControl/RatingControl.ViewModel","Gallery/Client/Common/Telemetry","Gallery/Client/Common/Utility","Gallery/Client/Common/Utility.Common","Gallery/Client/Service/VNext/Utility","Gallery/Client/Service/VSSItem","VSS/Context","VSS/FeatureAvailability/Services","VSS/Gallery/Contracts","VSS/Adapters/Knockout","VSS/Utils/Array","VSS/Utils/String","Gallery/Client/URLHelper","Gallery/Client/Pages/Publisher/Publisher.Common"],function(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w,b,k,d,g,nt,tt,it){Object.defineProperty(t,"__esModule",{value:!0});t.ItemTileViewModel=void 0;var rt=f.CustomerIntelligenceConstants.MarketPlaceIntelligenceProperties.HomePageProperties,ut=function(n){function t(f){var e=__construct(this,n,[]),l,h,k,d;for(l in e)e.hasOwnProperty(l)&&(this[l]=e[l]);return e.containerName="",e.itemClassName="",e.imageViewModelOption=i.observable(null),e.publisherDomain="",e.brandingColor="",e.brandingTheme="light",e.previewString=null,e.itemCss=i.observable(""),e.showRatingReview=!1,e.useDefaultIcon=!1,e.showInstallCount=!1,e.haveTabIndex=!0,e.showCertifiedBadge=!1,e.certifiedBadgeText="",e.certifiedBadgeIcon="\ue9d1",e.verifiedDomainIcon="\uf6ad",e.verifiedDomainText="",e.showDomain=!1,e.cleanedPublisherDomain="",e.title=f.item.title,e.description=f.item.shortDescription,e.link=f.item.link,e.itemClassName=f.itemClassName?f.itemClassName:"",e.linkTarget=f.openInNewTab?"_blank":"_self",e.publisher=f.item.publisherDisplayName,e.publisherDisplay=u.Publisher_By+f.item.publisherDisplayName,e._addBranding(f),e._addPricingTag(f.item),e.setImageViewModelOptions(f),f.haveTabIndex===!1&&(e.haveTabIndex=!1),e.showCertifiedBadge=!1,e.itemClassName===t.VSS_ITEM_CLASS||e.itemClassName===t.VSCODE_ITEM_CLASS||e.itemClassName===t.VS_ITEM_CLASS?(h=f.item,e._itemType=h.itemType,e.installCount=w.getPageContext().webAccessConfiguration.isHosted?y.getInstallCountString(f.item.installCount):"0",e.fullyQualifiedName=p.ItemModelHelper.getFullyQualifiedNameForItem(h.publisherName,h.name),k=b.FeatureAvailabilityService.isFeatureEnabled(r.FeatureFlag.ShowRatingAndReview,!1),v.FeatureFlagUtils.isFeatureFlagEnabled(location.href,v.FeatureFlagUtils.ratingReviewFF)&&(v.FeatureFlagUtils.setFeatureFlagCookie(v.FeatureFlagUtils.ratingReviewFF),k=!0),k&&(e.showRatingReview=!0,d={rating:h.averageRating.toString(),totalStars:t.TOTAL_RATING_STARS,ratingCount:h.ratingCount},e.ratingViewModel=new c.RatingControlViewModel(d),e.averageRatingText=a.getAverageRatingText(h.averageRating,h.ratingCount),e.averageRating=h.averageRating),e.showCertifiedBadge=p.ItemModelHelper.isVSTSExtension(h.itemType)&&it.PublisherHelper.shouldShowMarketplaceCertifiedBadge(h.publisherFlags),e.certifiedBadgeText=s.MarketplaceCertifiedPublisherTitle,e.verifiedDomainText=s.MarketplaceVerifiedDomainTitle,o.FeatureFlagUtils.isVerifiedPublisherDomainEnabled()&&f.item.isPublisherDomainVerified&&(e.showDomain=!0,e.cleanedPublisherDomain=o.UrlUtils.getDomainNameFromUrl(f.item.publisherDomain))):e.itemClassName===""&&(e.showRatingReview=!0,e.averageRatingText="",e.averageRating=0),e.installCount!=="0"&&e.installCount!==undefined&&(e.showInstallCount=!0),f.itemClickCallBack&&(e._itemClickCallback=f.itemClickCallBack),e.containerName=e.itemClassName+"_"+e.searchOrCategory(),e}return __extends(t,n),t.prototype.setImageViewModelOptions=function(n){var t={imageUrl:"",fallbackImageUrl:"",imageStyle:"item-icon"};t.imageUrl=n.item.smallIconUrl;t.fallbackImageUrl=n.item.fallbackSmallIconUrl;nt.ignoreCaseComparer(t.imageUrl,"")===0&&(t.imageUrl=n.item.imageUrl,t.fallbackImageUrl=n.item.fallbackImageUrl);this.useDefaultIcon=!t.imageUrl;this.useDefaultIcon&&(t.imageUrl=tt.GalleryURLs.getResourcePath()+"Header/default_icon.png");this.imageViewModelOption(t)},t.prototype.getTabindex=function(){return this.haveTabIndex?"0":"-1"},t.prototype._addPricingTag=function(n){var r=h.priceCategory.Free,i;if(this.itemClassName===t.VSS_ITEM_CLASS||this.itemClassName===t.VSCODE_ITEM_CLASS||this.itemClassName===t.VS_ITEM_CLASS){if(i=n,!i){this.costCategory=h.priceCategory.Free;this.pricingTag=s.Pricing_Free;return}var u=p.ItemModelHelper.isVSSExtension(i.itemType),e=p.ItemModelHelper.isVSSOffer(i.itemType),o=n.isByolEnabled||n.isByolEnforced,f=i.flags&&(i.flags&k.PublishedExtensionFlags.Paid)!=0||i.tags&&g.arrayContains("$IsPaid",i.tags,function(n,t){return n.toLowerCase()===t.toLowerCase()})||e,c=i.isTrial||f&&u&&!i.isPreview&&!o;c?r=h.priceCategory.Trial:f&&(r=u&&i.isPreview?h.priceCategory.Trial:h.priceCategory.Paid)}this.costCategory=r;switch(this.costCategory){case h.priceCategory.Free:this.pricingTag=s.Pricing_Free;break;case h.priceCategory.Trial:this.pricingTag=s.Pricing_Trial;break;case h.priceCategory.Paid:this.pricingTag=s.Pricing_Paid}return},t.prototype.searchOrCategory=function(){return a.SearchUtils.isSearchPage(window.location.href)?f.CustomerIntelligenceConstants.MarketPlaceIntelligenceFeature.SEARCH:f.CustomerIntelligenceConstants.MarketPlaceIntelligenceFeature.CATEGORY},t.prototype.itemTileClick=function(){var n=this;return function(t,i){return n.onItemTileClick(i)}},t.prototype.onItemTileClick=function(){return this._logTelemetryToCI(),this._itemClickCallback&&this._itemClickCallback(),!0},t.prototype.getScreenReaderText=function(){var n=this.showCertifiedBadge?s.Top:"";return nt.format(s.ItemTile_ScreenReaderText,this.title,n,this.publisher,this.installCount,this.averageRatingText,this.pricingTag)},t.prototype._logTelemetryToCI=function(){var i="",n={};switch(this.itemClassName){case t.VSS_ITEM_CLASS:i=f.CustomerIntelligenceConstants.MarketPlaceIntelligenceFeature.VSTS_ITEM;n[f.CustomerIntelligenceConstants.MarketPlaceIntelligencePropertyName.PRODUCT_TYPE]=p.ItemModelHelper.getItemTypeText(this._itemType?this._itemType:p.VSSItemType.VSSExtension);break;case t.VSCODE_ITEM_CLASS:i=f.CustomerIntelligenceConstants.MarketPlaceIntelligenceFeature.VSCODE_ITEM;n[f.CustomerIntelligenceConstants.MarketPlaceIntelligencePropertyName.PRODUCT_TYPE]=p.ItemModelHelper.getItemTypeText(this._itemType?this._itemType:p.VSSItemType.VSCodeExtension);break;case t.VS_ITEM_CLASS:i=f.CustomerIntelligenceConstants.MarketPlaceIntelligenceFeature.VS_ITEM;n[f.CustomerIntelligenceConstants.MarketPlaceIntelligencePropertyName.PRODUCT_TYPE]=p.ItemModelHelper.getItemTypeText(this._itemType?this._itemType:p.VSSItemType.VSIdeExtension)}i!==""&&(n[rt.Id]=this.fullyQualifiedName,n[l.CustomerIntelligenceConstants.MarketPlaceIntelligencePropertyName.CONTAINER]=this.containerName,e.TelemetryHelper.publishEvent(i,n,!0,!1,!0))},t.prototype._addBranding=function(n){if(n.brandingColor){var t=n.brandingColor,i=/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t);this.brandingColor=i?t:null}else this.brandingColor=null;n.brandingTheme&&(this.brandingTheme=n.brandingTheme)},t.prototype.calculateWidthBasedOnSibling=function(n,t,i,r){var u=n.parentElement.getElementsByClassName(t)[0].offsetWidth;return u>i?r:"0px"},t.prototype.calculateMarginBasedonPubNameWithInstall=function(n){return this.isPubNameWithInstallOverflow(n)?"0px":"5px"},t.prototype.isPubNameWithInstallOverflow=function(n){var t=n.parentElement.getElementsByClassName("publisher-with-installcount")[0].offsetWidth;return t>105?!0:!1},t.prototype.selectItem=function(){},t.VS_ITEM_CLASS="VS",t.VSS_ITEM_CLASS="VSTS",t.VSCODE_ITEM_CLASS="VSCode",t.TOTAL_RATING_STARS=5,t}(d.TemplateViewModel);t.ItemTileViewModel=ut});

define("Gallery/Client/Common/ScrollEventListener",["require","exports","VSS/Utils/String"],function(n,t,i){Object.defineProperty(t,"__esModule",{value:!0});t.ScrollEventListener=void 0;var r=function(){function n(){}return n.subscribeScrollEvent=function(t){return t?(n._registeredCallbacks.length===0&&n.bindScrollListener(),n._registeredCallbacks.push(t),!0):!1},n.unsubscribeScrollEvent=function(t){if(t){var r=-1;n._registeredCallbacks.forEach(function(n,u){if(i.ignoreCaseComparer(t,n.id)===0)return r=u,!1});r!==-1&&n._registeredCallbacks.splice(r,1);n._registeredCallbacks.length===0&&n.unbindScrollListener()}},n.bindScrollListener=function(){$(document).on("scroll",n.scrollListnerHandler)},n.unbindScrollListener=function(){$(document).off("scroll",n.scrollListnerHandler)},n.scrollListnerHandler=function(){n._registeredCallbacks.forEach(function(n){n.callback&&n.callback()})},n._registeredCallbacks=[],n}();t.ScrollEventListener=r});

define("Gallery/Client/Controls/ItemRow/ItemRow.ViewModel",["require","exports","VSS/Adapters/Knockout","Gallery/Client/Common/Utility.Common","Gallery/Client/Common/ScrollEventListener","q"],function(n,t,i,r,u,f){Object.defineProperty(t,"__esModule",{value:!0});t.ItemRowViewModel=void 0;var e=function(n){function t(i){var r=__construct(this,n,[]);for(var e in r)r.hasOwnProperty(e)&&(this[e]=r[e]);return r.ARROWLEFT_KEY_CODE=37,r.ARROWRIGHT_KEY_CODE=39,r.ARROWUP_KEY_CODE=38,r.ARROWDOWN_KEY_CODE=40,r._itemArray=[],r._currentFocusedItemIndex=0,r._itemDisplayTemplate=i&&i.itemDisplayTemplate?i.itemDisplayTemplate:t.DEFAULT_ITEM_TILE_TEMPLATE,i&&i.items&&(r._itemRowId=i.rowId,r.itemId=i.rowId,r._itemArray=i.items,r._itemsVisibleCallback=i.itemsVisibleCallback,r._selectNextCallback=i.selectNextCallback,r._selectPreviousCallback=i.selectPreviousCallback,r._itemContainerSelector=i.itemContainerSelector,r._scrollEventHandler=r._scrollEventHandler.bind(r),r._postRenderCallback=r._postRenderCallback.bind(r),u.ScrollEventListener.subscribeScrollEvent({callback:r._scrollEventHandler,id:r._itemRowId})),r._itemRowRenderedDeferred=f.defer(),r.itemRowRenderedPromise=r._itemRowRenderedDeferred.promise,r}return __extends(t,n),t.prototype.selectItem=function(n){(n.index===-1||n.index>=this._itemArray.length)&&(n.index=this._itemArray.length-1);this._focusElement(n.index);this._currentFocusedItemIndex=n.index},t.prototype._unbindScrollHandler=function(){$(document).off("scroll",this._scrollEventHandler)},t.prototype._itemRowKeyHandler=function(n,t){if(t){var i=t.which?t.which:t.keyCode,r=this._getJQueryFromElement(t.target);if(t.altKey||t.ctrlKey||t.metaKey)return!0;i===this.ARROWLEFT_KEY_CODE?this._moveLeft(r):i===this.ARROWRIGHT_KEY_CODE?this._moveRight(r):i===this.ARROWUP_KEY_CODE?this._moveUp():i===this.ARROWDOWN_KEY_CODE&&this._moveDown()}return!0},t.prototype._postRenderCallback=function(){var n=this;setTimeout(function(){n._scrollEventHandler();n._itemRowRenderedDeferred.resolve(null)},0)},t.prototype._scrollEventHandler=function(){r.TileImpressionUtils.isScrolledIntoView(document.getElementById(this._itemRowId))&&(this._itemsVisibleCallback&&this._itemsVisibleCallback(this._itemArray),u.ScrollEventListener.unsubscribeScrollEvent(this._itemRowId))},t.prototype._moveRight=function(n){var t=n.parent(),i;t.is(":last-child")?this._selectNextCallback(this.itemId,{index:0}):(i=t.next().find(this._itemContainerSelector),i.focus(),this._currentFocusedItemIndex++)},t.prototype._moveLeft=function(n){var t=n.parent(),i;t.is(":first-child")?this._selectPreviousCallback(this.itemId,{index:-1}):(t=n.parent(),i=t.prev().find(this._itemContainerSelector),i.focus(),this._currentFocusedItemIndex--)},t.prototype._moveUp=function(){this._selectPreviousCallback(this.itemId,{index:this._currentFocusedItemIndex})},t.prototype._moveDown=function(){this._selectNextCallback(this.itemId,{index:this._currentFocusedItemIndex})},t.prototype._getJQueryFromElement=function(n){return $(n)},t.prototype._focusElement=function(n){var t=$("#"+this._itemRowId).find(this._itemContainerSelector).eq(n);this._focusElementInternal(t)},t.prototype._focusElementInternal=function(n){n&&n.focus()},t.DEFAULT_ITEM_TILE_TEMPLATE="gallery-item-card-template",t.ITEM_ROW_TILE_LIMIT=6,t}(i.TemplateViewModel);t.ItemRowViewModel=e});

define("Gallery/Client/Controls/VSItemTile/VSItemTile.ViewModel",["require","exports","Gallery/Client/Controls/ItemTile/ItemTile.ViewModel","Gallery/Client/Controls/RatingControl/RatingControl.ViewModel"],function(n,t,i,r){Object.defineProperty(t,"__esModule",{value:!0});t.VSItemTileViewModel=void 0;var u=function(n){function t(t){var i=n.call(this,{item:t.item,openInNewTab:!0})||this,u={rating:t.item.ratings.toString(),totalStars:r.RatingControlViewModel.TOTAL_RATING_STARS,ratingCount:t.item.raters};return i.ratingViewModel=new r.RatingControlViewModel(u),t.onClick&&(i._onClick=t.onClick),i.itemId=t.item.id,i._truncateDescription(),i}return __extends(t,n),t.prototype._truncateDescription=function(){this.description.length>t.truncatedDescriptionMaxLength?(this.truncatedDescription=this.description.substring(0,t.truncatedDescriptionMaxLength),this.truncatedDescription=this.truncatedDescription.concat("...")):this.truncatedDescription=this.description},t.prototype.onClick=function(n){return this._onClick?this._onClick(n,this):!0},t.truncatedDescriptionMaxLength=90,t}(i.ItemTileViewModel);t.VSItemTileViewModel=u});

define("Gallery/Client/Common/AccessibilityUtils",["require","exports","VSS/Diag"],function(n,t,i){function o(n,t){if(n){var i;return(i=t?n.querySelector("."+t):n.querySelector("[data-is-focusable]"),i&&!i.disabled)?(i.focus(),!0):!1}}function s(n){n&&n.focus()}function h(n,t){var u,r,f;if(t===void 0&&(t=!1),n)for(i.log(i.LogVerbosity.Info,"announce (".concat(t?"assertive":"polite","): ").concat(n)),u=t?"utils-accessibility-announce-assertive":"utils-accessibility-announce-polite",r=document.getElementById(u),r||(r=document.createElement("div"),r.id=u,r.className="visually-hidden",r.setAttribute("aria-live",t?"assertive":"polite"),document.body.appendChild(r)),f=document.createElement("p"),f.textContent=n,r.appendChild(f);r.children.length>e;)r.removeChild(r.children[0])}function c(n){n.on("keydown",function(t){var e=t.which?t.which:t.keyCode,r,i,u,f;if(e===9){if(r="a[href], area[href], input:not([disabled]):not([tabindex='-1']), button:not([disabled]):not([tabindex='-1']),select:not([disabled]):not([tabindex='-1']), textarea:not([disabled]):not([tabindex='-1']), iframe, object, embed, *[tabindex]:not([tabindex='-1']), *[contenteditable=true]",i=n.find(r).filter(":visible"),!i||i.length===0)return;t.shiftKey?(u=i.first(),(t.target===u[0]||t.target===n[0])&&(i.last().focus(),t.preventDefault(),t.stopPropagation())):(f=i.last(),t.target===f[0]&&(i.first().focus(),t.preventDefault(),t.stopPropagation()))}})}function l(n){var t=u(n);t&&t.focus()}function u(n){var t=r(n);if(t&&t.length!==0)return t.last()}function a(n){var t=f(n);t&&t.focus()}function f(n){var t=r(n);if(t&&t.length!==0)return t.first()}function v(n,t){var i=r(n),u;i&&i.length!==0&&(u=i.index(t),u===i.length-1&&(u=-1),i.eq(u+1).focus())}function r(n){return n.find("a[href], area[href], input:not([disabled]):not([tabindex='-1']), button:not([disabled]):not([tabindex='-1']),select:not([disabled]):not([tabindex='-1']), textarea:not([disabled]):not([tabindex='-1']), iframe, object, embed, *[tabindex]:not([tabindex='-1']), *[contenteditable=true]")}Object.defineProperty(t,"__esModule",{value:!0});t.setFocusOnNextTabbableElement=t.getFirstTabbableElement=t.setFocusOnFirstTabbableElement=t.getLastTabbableElement=t.setFocusOnLastTabbableElement=t.setModalTabbing=t.announce=t.focusElement=t.focusFocusableElement=void 0;var e=10;t.focusFocusableElement=o;t.focusElement=s;t.announce=h;t.setModalTabbing=c;t.setFocusOnLastTabbableElement=l;t.getLastTabbableElement=u;t.setFocusOnFirstTabbableElement=a;t.getFirstTabbableElement=f;t.setFocusOnNextTabbableElement=v});

define("Gallery/Client/Controls/Category/BaseFilterDropdown",["require","exports","Gallery/Scripts/Gallery/Resources/VSS.Resources.GalleryCommon","Gallery/Client/Service/VSSGallery/IVSSGallery","Gallery/Client/Service/VSSItem","Gallery/Client/Common/Constants","VSS/Utils/String","VSS/Utils/Array","Gallery/Scripts/Gallery/Resources/VSS.Resources.Gallery","Gallery/Client/Service/VSGallery/IVSGallery","Gallery/Client/Common/Utility","Gallery/Client/Common/Telemetry","Gallery/Client/Common/TelemetryInternal","Gallery/Client/Common/Constants","Gallery/Client/Common/Utility","Gallery/Client/Common/Constants"],function(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p){var ft,w,g,nt,tt,d,b,it,k,rt,ut,et,ot,st;Object.defineProperty(t,"__esModule",{value:!0});t.IVersionFilterOption=t.IHostedOnFilterOption=t.IPricingFilterOption=t.TargetPlatformFilter=t.CertifiedFilter=t.CategoryFilter=t.VisibilityFilter=t.SortFilter=t.PriceFilter=t.VersionFilter=t.HostedOn=t.ProductFilter=t.BaseFilterDropdown=t.AllFilters=void 0;ft=function(){function n(n){this.viewModel=n}return n.prototype.createFilters=function(t){var i;this.allFiltersList={};this.viewModel.isHosted?e.ignoreCaseComparer(t,f.SearchConstants.VSCodeProductText)===0?(i=0,c.FeatureFlagUtils.isTargetPlatformFilterDropdownEnabled()&&(this.allFiltersList[n.TargetPlatformFilter]=new ut(this.viewModel,n.TargetPlatformFilter,i++)),this.allFiltersList[n.CategoryFilter]=new k(this.viewModel,n.CategoryFilter,i++),this.allFiltersList[n.SortFilter]=new b(this.viewModel,n.SortFilter,i++)):e.ignoreCaseComparer(t,f.SearchConstants.VSTSProductText)===0?(i=0,this.allFiltersList[n.CategoryFilter]=new k(this.viewModel,n.CategoryFilter,i++),this.allFiltersList[n.HostedOnTragetFilter]=new nt(this.viewModel,n.HostedOnTragetFilter,i++),this.allFiltersList[n.PriceFilter]=new d(this.viewModel,n.PriceFilter,i++),y.FeatureFlagUtils.checkFeatureState(p.FeatureFlag.EnableCertifiedPublisherUIChanges,v.ManagePublisherPageConstants.EnableCertifiedPublisherUIChanges)&&(this.allFiltersList[n.CertifiedFilter]=new rt(this.viewModel,n.CertifiedFilter,i++)),c.isInternalMicrosoftUser()&&(this.allFiltersList[n.VisibilityFilter]=new it(this.viewModel,n.VisibilityFilter,i++)),this.allFiltersList[n.SortFilter]=new b(this.viewModel,n.SortFilter,i++)):e.ignoreCaseComparer(t,f.SearchConstants.VSProductText)===0?this.viewModel.isVsSearchFFEnabled?(this.allFiltersList[n.CategoryFilter]=new k(this.viewModel,n.CategoryFilter,0),this.allFiltersList[n.VersionFilter]=new tt(this.viewModel,n.VersionFilter,1),this.allFiltersList[n.PriceFilter]=new d(this.viewModel,n.PriceFilter,2),this.allFiltersList[n.SortFilter]=new b(this.viewModel,n.SortFilter,3)):(this.allFiltersList[n.CategoryFilter]=new k(this.viewModel,n.CategoryFilter,0),this.allFiltersList[n.SortFilter]=new b(this.viewModel,n.SortFilter,1)):e.ignoreCaseComparer(t,f.SearchConstants.VSForMacProductText)===0&&(this.allFiltersList[n.CategoryFilter]=new k(this.viewModel,n.CategoryFilter,0),this.allFiltersList[n.SortFilter]=new b(this.viewModel,n.SortFilter,1)):(this.allFiltersList[n.ProductFilter]=new g(this.viewModel,n.ProductFilter,0),this.allFiltersList[n.CategoryFilter]=new k(this.viewModel,n.CategoryFilter,1),this.allFiltersList[n.SortFilter]=new b(this.viewModel,n.SortFilter,2))},n.prototype.initializeFilters=function(){for(var n in this.allFiltersList)this.allFiltersList[n].initializeOptions()},n.prototype.setFilterValues=function(n){for(var t in this.allFiltersList)this.allFiltersList[t].setFilterIndex(n)},n.prototype.postQueryUpdate=function(t,i,r){var f=!0,o=!0,s=!0,u;i&&i.length!==0||!this.viewModel.isHosted||!this.viewModel.isVsSearchFFEnabled&&e.ignoreCaseComparer(this.viewModel.searchPageParameters.product,v.SearchConstants.VSProductText)===0||(f=!1);t===0&&(o=!1);r&&r.length!==0||(s=!1);for(u in this.allFiltersList)u===n.CategoryFilter?this.allFiltersList[u].updateFilter(f,i):u===n.SortFilter?this.allFiltersList[u].updateFilter(o):u===n.TargetPlatformFilter?this.allFiltersList[u].updateFilter(s,r):this.allFiltersList[u].updateFilter(f)},n.ProductFilter="product-filter",n.CategoryFilter="category-filter",n.SortFilter="sort-filter",n.VisibilityFilter="visibility-filter",n.VersionFilter="version-filter",n.PriceFilter="price-filter",n.CertifiedFilter="certified-filter",n.HostedOnTragetFilter="hosted-on-target-filter",n.TargetPlatformFilter="target-platform-filter",n}();t.AllFilters=ft;w=function(){function n(n){this._idIndex=-1;this._id="";this._filterTitle="";this._isMultiLevel=!1;this.index={filterIndex:0};this.options=[];this.searchViewModel=n}return n.prototype.setIndex=function(n,t){var i={filterIndex:0};n&&(this.options.forEach(function(t,r){e.ignoreCaseComparer(t.id,n)===0&&(i.filterIndex=r)}),this._isMultiLevel&&(i.childIndex={filterIndex:0},i.filterIndex!==-1&&t&&this.options[i.filterIndex].subDropdownItems&&this.options[i.filterIndex].subDropdownItems.forEach(function(n,r){e.ignoreCaseComparer(n.id,t)===0&&(i.childIndex={filterIndex:r})})));this.index=i;this.setFilterValue()},n.prototype.getOptionValue=function(){return this.options[this.index.filterIndex].id},n.prototype.getOptionIndex=function(){return this.options[this.index.filterIndex].index},n.prototype._onFilterChange=function(){var t=this.index,n;this.index=this.searchViewModel.filterControlViewModel.getSelectedIndexForFilter(this._id);n=this._hasFilterChanged(t,this.index,this._isMultiLevel);n&&(this.setFilterValue(),this._telemetryOnFilterChange(),this.searchViewModel.resetPageContextAndFetchPage())},n.prototype._telemetryOnFilterChange=function(){var t=l.CustomerIntelligenceConstants.MarketPlaceIntelligenceProperties.SearchRefererProperties,n={};n[t.FilterChanged]=this._id;n[t.Action]=l.CustomerIntelligenceConstants.MarketPlaceIntelligenceFeature.FILTER_OPTION_CHANGE;this.searchViewModel.addParamsToTelemetryProperties(n);a.TelemetryHelper.publishEvent(l.CustomerIntelligenceConstants.MarketPlaceIntelligenceFeature.SEARCH_REFERER,n,!0,!1)},n.prototype._hasFilterChanged=function(n,t,i){var r=!1;return n&&t&&n.filterIndex!==t.filterIndex?r=!0:i&&(n&&n.childIndex===undefined&&(n.childIndex={filterIndex:0}),r=n&&n.childIndex&&t&&t.childIndex&&n.childIndex.filterIndex===t.childIndex.filterIndex?!1:!0),r},n.prototype.updateFilter=function(n){var t=this._setFilterOptions(n);this.searchViewModel.filterControlViewModel.addOrUpdateFilter(t,this._idIndex)},n.prototype._setFilterOptions=function(n){var t=this;return{filterId:this._id,filterName:this._filterTitle,selectedItemIndex:this.index,itemsList:this._convertDropdownItemArrayToIFilterElements(this.options),isEnabled:n,filterChangeCallBack:function(n){t._onFilterChange(n)}}},n.prototype._convertDropdownItemArrayToIFilterElements=function(n,t){var u=this,i,r;return t===void 0&&(t=null),i=[],r=0,n.forEach(function(n){var f={elementLabel:n.displayName,elementHoverTitle:n.displayName,index:r++};n.html&&(f.elementHtml=n.html);n.subDropdownItems&&(f.subFilterMenu=u._convertDropdownItemArrayToIFilterElements(n.subDropdownItems,f));t&&(f.parent=t);n.skipShowingInSelectedItem&&(f.skipWhileDisplayingSelectedOptionLabel=!0);n.disabled&&(f.disabled=!0);i.push(f)}),i},n}();t.BaseFilterDropdown=w;g=function(n){function t(t,i,r){var u=__construct(this,n,[t]);for(var f in u)u.hasOwnProperty(f)&&(this[f]=u[f]);return u._id=i,u._idIndex=r,u._filterTitle=s.ProductFilterTitle,u}return __extends(t,n),t.prototype.setFilterIndex=function(n){this.setIndex(n.product)},t.prototype.setFilterValue=function(){this.searchViewModel.searchPageParameters.product=this.getOptionValue()},t.prototype._onFilterChange=function(){$.noop()},t.prototype.initializeOptions=function(){this.options=[];this.options.push({displayName:i.VSTS_Header,id:v.SearchConstants.VSTSProductText})},t}(w);t.ProductFilter=g;nt=function(n){function t(t,i,r){var u=__construct(this,n,[t]);for(var f in u)u.hasOwnProperty(f)&&(this[f]=u[f]);return u._id=i,u._idIndex=r,u._filterTitle=s.HostedOnFilterTitle,u}return __extends(t,n),t.prototype.setFilterIndex=function(n){this.setIndex(n.installationTarget)},t.prototype.setFilterValue=function(){this.searchViewModel.searchPageParameters.installationTarget=this.getOptionValue()},t.prototype.initializeOptions=function(){this.options=[];this.options.push({displayName:s.HostedOnFilterOption_Any,id:null});this.options.push({displayName:s.HostedOnFilterOption_Cloud,id:f.FilterConstants.InstallationTargetParamValueCloud});this.options.push({displayName:s.HostedOnFilterOption_Onprem,id:f.FilterConstants.InstallationTargetParamValueOnPrem})},t}(w);t.HostedOn=nt;tt=function(n){function t(t,i,r){var u=__construct(this,n,[t]);for(var f in u)u.hasOwnProperty(f)&&(this[f]=u[f]);return u._id=i,u._idIndex=r,u._filterTitle=s.VersionFilterTitle,u}return __extends(t,n),t.prototype.setFilterIndex=function(n){var t=null;n.vsVersion&&(t=n.vsVersion[0]);this.setIndex(t)},t.prototype.setFilterValue=function(){this.searchViewModel.searchPageParameters.vsVersion=[this.getOptionValue()]},t.prototype.initializeOptions=function(){var n=this,t;this.options=[];t=u.InstallationTargetToVSIdeMapping.getAllIdeVersions();this.options.push({displayName:s.VersionFilterOption_Any,id:null});t.forEach(function(t){t==="2017"?n.options.push({displayName:e.format(s.VisualStudioVersionMenuItemText,t),id:f.FilterConstants.VersionParamValueVS15}):n.options.push({displayName:e.format(s.VisualStudioVersionMenuItemText,t),id:"vs"+t})})},t}(w);t.VersionFilter=tt;d=function(n){function t(t,i,r){var u=__construct(this,n,[t]);for(var f in u)u.hasOwnProperty(f)&&(this[f]=u[f]);return u._id=i,u._idIndex=r,u._filterTitle=s.PricingFilterTitle,u}return __extends(t,n),t.prototype.setFilterIndex=function(n){this.setIndex(n.pricing)},t.prototype.setFilterValue=function(){this.searchViewModel.searchPageParameters.pricing=this.getOptionValue()},t.prototype.initializeOptions=function(){this.options=[];this.options.push({displayName:s.PricingFilterOption_Any,id:null});this.options.push({displayName:s.PricingFilterOption_Free,id:v.FilterConstants.CostParamValueFree});this.options.push({displayName:s.PricingFilterOption_Paid,id:v.FilterConstants.CostParamValuePaid});e.ignoreCaseComparer(this.searchViewModel.searchPageParameters.product,f.SearchConstants.VSProductText)===0&&this.options.push({displayName:s.PricingFilterOption_Trial,id:v.FilterConstants.CostParamValueTrial})},t}(w);t.PriceFilter=d;b=function(n){function t(t,i,r){var u=__construct(this,n,[t]);for(var f in u)u.hasOwnProperty(f)&&(this[f]=u[f]);return u._id=i,u._idIndex=r,u._filterTitle=s.SortByFilterTitle,u}return __extends(t,n),t.prototype.setFilterIndex=function(n){this.setIndex(n.sortBy)},t.prototype.setFilterValue=function(){this.searchViewModel.searchPageParameters.sortBy=this.getOptionValue()},t.prototype.initializeOptions=function(){var n,u,t,i,f;this.options=[];n=!this.searchViewModel.isVsSearchFFEnabled&&e.ignoreCaseComparer(this.searchViewModel.searchPageParameters.product,v.SearchConstants.VSProductText)===0;u=this.searchViewModel.isVsSearchFFEnabled&&e.ignoreCaseComparer(this.searchViewModel.searchPageParameters.product,v.SearchConstants.VSProductText)===0;this.searchViewModel.isHosted&&(t=!0,this.searchViewModel.searchPageParameters.searchQuery&&(t=!1),this.options.push({displayName:s.SortOption_Relevance,id:"Relevance",index:n?h.VSSortByValue.Relevance:r.VSSSortByValue.Relevance,disabled:t}),i=s.SortOption_Downloads,y.FeatureFlagUtils.checkFeatureState(p.FeatureFlag.EnableSortByInstallCountUI,y.FeatureFlagUtils.EnableSortByInstallCountUI)&&(i=s.SortOption_Installs),this.options.push({displayName:i,id:v.SortOptions.Installs,index:n?h.VSSortByValue.Downloads:r.VSSSortByValue.Installs}));this.options.push({displayName:s.SortOption_UpdatedDate,id:v.SortOptions.UpdatedDate,index:n?h.VSSortByValue.LastModified:r.VSSSortByValue.LastModified});this.options.push({displayName:s.SortOption_Publisher,id:v.SortOptions.Publisher,index:n?h.VSSortByValue.AuthorAsc:r.VSSSortByValue.Publisher});this.options.push({displayName:s.SortOption_Name,id:v.SortOptions.Name,index:n?h.VSSortByValue.TitleAsc:r.VSSSortByValue.Title});f=this.searchViewModel.isHosted?r.VSSSortByValue.ReleaseDate:r.VSSSortByValue.PublishedDate;this.options.push({displayName:s.SortOption_PublishedDate,id:v.SortOptions.SortByDate,index:n?h.VSSortByValue.Date:f});this.searchViewModel.isHosted&&(this.options.push({displayName:s.SortOption_Rating,id:v.SortOptions.Rating,index:n?h.VSSortByValue.Ratings:r.VSSSortByValue.AverageRating}),this.options.push({displayName:s.SortOption_TrendingWeekly,id:"TrendingWeekly",index:n?h.VSSortByValue.Popularity:r.VSSSortByValue.TrendingWeekly,disabled:u}))},t.prototype.initializeDefaultSortBy=function(){this.searchViewModel.searchPageParameters.searchQuery?this.setIndex("Relevance"):this.getOptionValue()==="Relevance"&&this.setIndex(f.SortOptions.Installs)},t}(w);t.SortFilter=b;it=function(n){function t(t,i,r){var u=__construct(this,n,[t]);for(var f in u)u.hasOwnProperty(f)&&(this[f]=u[f]);return u._id=i,u._idIndex=r,u._filterTitle=s.OrganizationFilterTitle,u}return __extends(t,n),t.prototype.setFilterIndex=function(n){e.ignoreCaseComparer(n.visibilityQuery,v.FilterConstants.VisibilityPublic)===0?this.index={filterIndex:2}:e.ignoreCaseComparer(n.visibilityQuery,v.FilterConstants.VisibilityOrganization)===0?this.index={filterIndex:1}:n.visibilityQuery&&e.ignoreCaseComparer(n.visibilityQuery,v.FilterConstants.VisibilityAll)!==0||(this.index={filterIndex:0});this.setFilterValue()},t.prototype.setFilterValue=function(){this.searchViewModel.searchPageParameters.visibilityQuery=this.getOptionValue()},t.prototype.initializeOptions=function(){this.options=[];this.options.push({displayName:s.OrgFilterOptions_Both,id:v.FilterConstants.VisibilityAll});this.options.push({displayName:s.OrgFilterOptions_Internal,id:v.FilterConstants.VisibilityOrganization});this.options.push({displayName:s.OrgFilterOptions_Public,id:v.FilterConstants.VisibilityPublic})},t}(w);t.VisibilityFilter=it;k=function(n){function t(t,i,r){var u=__construct(this,n,[t]);for(var f in u)u.hasOwnProperty(f)&&(this[f]=u[f]);return u._id=i,u._idIndex=r,u._filterTitle=s.CategoryFilterTitle,u._isMultiLevel=u.searchViewModel.isVsSearchFFEnabled&&e.ignoreCaseComparer(u.searchViewModel.searchPageParameters.product,v.SearchConstants.VSProductText)===0,u.isOldVS=!u.searchViewModel.isVsSearchFFEnabled&&e.ignoreCaseComparer(u.searchViewModel.searchPageParameters.product,v.SearchConstants.VSProductText)===0,u.isDynamic=u.searchViewModel.isHosted&&!u.isOldVS,u}return __extends(t,n),t.prototype.setFilterIndex=function(n){this.setIndex(n.category,n.subCategory)},t.prototype.setFilterValue=function(){this.searchViewModel.searchPageParameters.category=this._getCategoryValue();this.searchViewModel.searchPageParameters.subCategory=this._getSubCategoryValue()},t.prototype.initializeOptions=function(){var n=this,t=this.searchViewModel.validCategories;this.options=[{displayName:i.AllCategoriesText,id:i.AllCategoriesText}];t&&!this.isOldVS&&(t.sort(function(n,t){var i=e.localeIgnoreCaseComparer(n.pcn,t.pcn);return i===0?e.localeIgnoreCaseComparer(n.cn,t.cn):i}),t.forEach(function(t){var r,i;if(t.pcn){if(r=o.findIndex(n.options,function(n){return e.ignoreCaseComparer(n.displayName,t.pcn)===0}),r<0)return;i=n.options[r];i&&(i.subDropdownItems||(i.subDropdownItems=[{displayName:s.AllSubCategoryLabel,id:s.AllSubCategoryLabel}]),i.subDropdownItems.push({displayName:t.cn,id:t.cn,html:n._createCategoryFilterItemHtml(t.cn,0)}))}else n.options.push({displayName:t.cn,id:t.cn,html:n._createCategoryFilterItemHtml(t.cn,0)})}));this.searchViewModel.nonEmptyCategories&&this._disableEmptyCategoriesForOnPrem()},t.prototype._disableEmptyCategoriesForOnPrem=function(){var n=this;this.options.forEach(function(t){var r=t.id;r===i.AllCategoriesText||o.contains(n.searchViewModel.nonEmptyCategories.map(function(n){return n.cn}),r,e.localeIgnoreCaseComparer)||(t.disabled=!0)})},t.prototype.getOptionValue=function(){return this._getCategoryName(this._getCategoryValue(),this._getSubCategoryValue())},t.prototype._getCategoryValue=function(){return this.options[this.index.filterIndex].id},t.prototype._getSubCategoryValue=function(){var n=this.options[this.index.filterIndex];return n&&n.subDropdownItems&&this.index.childIndex?n.subDropdownItems[this.index.childIndex.filterIndex].id:""},t.prototype.updateFilter=function(t,r){var u=this;r&&this.isDynamic&&this.options.forEach(function(n){var t=n.displayName,f=u._getExtensionCountPerCategory(r,t);f!==0||t===i.AllCategoriesText?(n.html=u._createCategoryFilterItemHtml(t,f),n.disabled=!1):n.disabled=!0;n.subDropdownItems&&n.subDropdownItems.forEach(function(n){var i=n.displayName,e=u._getCategoryName(t,i),f=u._getExtensionCountPerCategory(r,e);f!==0||i===s.AllSubCategoryLabel?(n.disabled=!1,n.html=u._createCategoryFilterItemHtml(i,f)):n.disabled=!0})});n.prototype.updateFilter.call(this,t)},t.prototype._getExtensionCountPerCategory=function(n,t){for(var u,i=0,r=n;i<r.length;i++)if(u=r[i],u.name===t)return u.value;return 0},t.prototype._getCategoryName=function(n,t){if(n!==i.AllCategoriesText){var r=n;return t&&t!==s.AllSubCategoryLabel&&(r+="/"+t),r}},t.prototype._createCategoryFilterItemHtml=function(n,t){var i=null,r;return n&&t>0&&(r="<span class='category-element-value'>("+t+")<\/span>",i="<span class='category-element-name'>"+r+n+"<\/span>"),i},t}(w);t.CategoryFilter=k;rt=function(n){function t(t,i,r){var u=__construct(this,n,[t]);for(var f in u)u.hasOwnProperty(f)&&(this[f]=u[f]);return u._id=i,u._idIndex=r,u._filterTitle=s.CertifiedFilterTitle,u}return __extends(t,n),t.prototype.setFilterIndex=function(n){this.setIndex(n.certified)},t.prototype.setFilterValue=function(){this.searchViewModel.searchPageParameters.certified=this.getOptionValue()},t.prototype.initializeOptions=function(){this.options=[];this.options.push({displayName:s.CertifiedFilterOption_Any,id:null});this.options.push({displayName:s.CertifiedFilterOption_Microsoft,id:v.FilterConstants.CertifiedParamValueMicrosoft});this.options.push({displayName:s.CertifiedFilterOption_CertifiedPublishers,id:v.FilterConstants.CertifiedParamValueCertifiedPublishers})},t}(w);t.CertifiedFilter=rt;ut=function(n){function t(t,i,r){var u=__construct(this,n,[t]);for(var f in u)u.hasOwnProperty(f)&&(this[f]=u[f]);return u._id=i,u._idIndex=r,u._filterTitle=s.TargetPlatformFilterTitle,u}return __extends(t,n),t.prototype.setFilterIndex=function(n){this.setIndex(n.targetPlatform)},t.prototype.setFilterValue=function(){this.searchViewModel.searchPageParameters.targetPlatform=this.getOptionValue()},t.prototype.initializeOptions=function(){var n=this.searchViewModel.targetPlatforms||{},t;n[s.TargetPlatformFilterOption_Universal_Key]=s.TargetPlatformFilterOption_Universal;this.options=[];this.options.push({displayName:s.TargetPlatformFilterOption_All,id:s.TargetPlatformFilterOption_All_Key});for(t in n)this.options.push({displayName:n[t],id:t})},t.prototype.updateFilter=function(t,i){var r=this;i&&this.options.forEach(function(n){var t=r._getExtensionCountPerTargetPlatform(i,n.id);t!==0||n.id===s.TargetPlatformFilterOption_All_Key?(n.html=r._createTargetPlatformFilterItemHtml(n.id,t),n.disabled=!1):n.disabled=!0});n.prototype.updateFilter.call(this,t)},t.prototype.getOptionValue=function(){var n=this.options[this.index.filterIndex].id;return n==s.TargetPlatformFilterOption_All_Key?null:n},t.prototype._getExtensionCountPerTargetPlatform=function(n,t){for(var u,i=0,r=n;i<r.length;i++)if(u=r[i],u.name===t)return u.value;return 0},t.prototype._createTargetPlatformFilterItemHtml=function(n,t){var i=null,r,u;return n&&t>0&&(r=this.searchViewModel.targetPlatforms[n],u="<span class='targetPlatform-element-value'>("+t+")<\/span>",i="<span class='targetPlatform-element-name'>"+u+r+"<\/span>"),i},t}(w);t.TargetPlatformFilter=ut,function(n){n[n.Any=0]="Any";n[n.Free=1]="Free";n[n.Paid=2]="Paid";n[n.Trial=3]="Trial"}(et=t.IPricingFilterOption||(t.IPricingFilterOption={})),function(n){n[n.Any=0]="Any";n[n.Cloud=1]="Cloud";n[n.OnPremises=2]="OnPremises"}(ot=t.IHostedOnFilterOption||(t.IHostedOnFilterOption={})),function(n){n[n.Any=0]="Any";n[n.Vs2010=1]="Vs2010";n[n.Vs2012=2]="Vs2012";n[n.Vs2013=3]="Vs2013";n[n.Vs2015=4]="Vs2015";n[n.Vs15=5]="Vs15";n[n.Vs2019=6]="Vs2019"}(st=t.IVersionFilterOption||(t.IVersionFilterOption={}))});

define("Gallery/Client/Controls/Category/BaseCategory.ViewModel",["require","exports","knockout","Gallery/Client/Controls/ErrorControl/ErrorControl.ViewModel","Gallery/Client/Common/Constants","Gallery/Client/Common/Telemetry","Gallery/Scripts/Gallery/Resources/VSS.Resources.Gallery","Gallery/Scripts/Gallery/Resources/VSS.Resources.GalleryCommon","Gallery/Client/Service/SearchProvider/IGallerySearchProviderFactory","Gallery/Client/Controls/ItemTile/ItemTile.ViewModel","Gallery/Client/Controls/ItemRow/ItemRow.ViewModel","Gallery/Client/URLHelper","Gallery/Client/Common/Utility","Gallery/Client/Common/Utility.Common","Gallery/Client/Controls/VSItemTile/VSItemTile.ViewModel","VSS/Context","VSS/Diag","VSS/Events/Services","VSS/FeatureAvailability/Services","VSS/Adapters/Knockout","VSS/Utils/Core","VSS/Utils/String","Gallery/Client/Common/AccessibilityUtils","Gallery/Client/Controls/Category/BaseFilterDropdown","q","VSS/VSS"],function(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w,b,k,d,g,nt,tt,it,rt,ut){Object.defineProperty(t,"__esModule",{value:!0});t.BaseCategoryViewModel=void 0;var ot=g.delegate,ft=f.CustomerIntelligenceConstants.MarketPlaceIntelligenceProperties.SearchAndCategoryPageProperties,et=a.WindowWrapper,st=function(n){function t(h){var c=__construct(this,n,[]),y,p;for(y in c)c.hasOwnProperty(y)&&(this[y]=c[y]);c._koExtensionsUrl=i.observable();c.publishExtensionsUrl="";c.extensionsLinkText=e.ExtensionsLinkText;c._koResultsFoundText=i.observable();c._koSearchQueryOrCategoryHeader=i.observable();c._koShowSuggestions=i.observable(!1);c._koShowNewZeroResultExperience=i.observable(!1);c._koIsShowFilterControl=i.observable(!0);c._koShowSpinner=i.observable();c.categoryListRole="tabpanel";c.categoryListId="categorized-list";c.styleFirstSpinner=i.observable(!0);c.isVsSearchFFEnabled=!1;c.vsTabName="VS";c.vsForMacTabName="VSForMac";c.vsCodeTabName="VSCode";c.vstsTabName="VSTS";c.vsSubsTabName="subscriptions";c.currentTab=i.observable();c.currentFocusedTab=i.observable();c.SelectedTabCookie="Market_SelectedTab";c.VSTS_Header=a.FeatureFlagUtils.isMarketPlaceBrandingChangesEnabled()?o.AzureDevOps_Header:o.VSTS_Header;c.VSForMac_Header=o.VSForMac_Header;c.VS_Header=o.VS_Header;c.VSCode_Header=o.VSCode_Header;c.Subs_Header=o.Subs_Header;c.BuildYourOwnText=o.BuildYourOwnText;c.PublishExtensionsText=o.PublishExtensionsText;c.showPublishExtensions=!1;c.showVSForMac=!1;c.newBranding=!1;c.isVSTabFocused=i.observable(!1);c.isVSForMacTabFocused=i.observable(!1);c.isVSTSTabFocused=i.observable(!1);c.isVSCodeTabFocused=i.observable(!1);c.isVSSubsTabFocused=i.observable(!1);c._vssItems=[];c._vsItems=[];c._currentPageNumber=1;c._currentCategoryViewModelNumber=1;c._pageSize=54;c._isFirst=!0;c._isBackNav=!1;c._resultTotalCount=0;c._isQueryInProgress=!1;c._relatedArticleIdsShown=[];c.tabNameToHashDictionary={};c.tabHashToNameDictionary={};c._isScrollBound=!1;c._spinnerStartAnnounced=!1;c._completed=!1;c._announceStartDelay=1e3;c.initializeDictionary(c.vsTabName,"vs");c.initializeDictionary(c.vsForMacTabName,"vsformac");c.initializeDictionary(c.vsCodeTabName,"vscode");c.initializeDictionary(c.vstsTabName,"vsts");c.initializeDictionary(c.vsSubsTabName,"subscriptions");c._performanceScenario=f.PerformanceConstants.LoadCategoriesPage;c.searchPageParameters=h.searchPageParams;c.validCategories=h.validCategories;c.nonEmptyCategories=h.nonEmptyCategories;c.targetPlatforms=h.targetPlatforms;c.isHosted=h.searchPageParams.isHosted;c._updatePageURLCallback=h.updatePageURLCallback;c._errorCallback=h.errorCallback;c._setSearchContextCallback=h.setSearchContextCallback;c._gallerySearchProviderFactory=h.searchProviderFactory;c._vsSearchProvider=c._gallerySearchProviderFactory.getSearchProvider(s.SearchProviderType.VSSearchProvider);c._vssSearchProvider=c._gallerySearchProviderFactory.getSearchProvider(s.SearchProviderType.VSSSearchProvider);p=c._getExtensionsUrl(c.searchPageParameters.product);c._koExtensionsUrl(p);nt.ignoreCaseComparer(c.searchPageParameters.product,u.SearchConstants.VSTSProductText)===0?(c.publishExtensionsUrl=u.BuildYourOwnLinks.VSTS,c.isHosted||(c.publishExtensionsUrl=l.GalleryURLs.getManageURL())):c.publishExtensionsUrl=nt.ignoreCaseComparer(c.searchPageParameters.product,u.SearchConstants.VSCodeProductText)===0?u.BuildYourOwnLinks.VSCode:nt.ignoreCaseComparer(c.searchPageParameters.product,u.SearchConstants.VSForMacProductText)===0?u.BuildYourOwnLinks.VSForMac:u.BuildYourOwnLinks.VS;c.suggestionsText=e.SuggestionsText;var k=e.SuggestionsListBuildOwnParentText,d=nt.format("<a href='{0}' target='_blank' rel='noreferrer noopener nofollow'>{1}<\/a>",c.publishExtensionsUrl,e.SuggestionsListBuildOwnText),g=nt.format("<a href='{0}' target='_blank' rel='noreferrer noopener nofollow'>{1}<\/a>",l.GalleryURLs.getManageURL(),e.SuggestionsListPublishText),tt=nt.format(k,d,g);return c.suggestionsList=[r.ErrorControlViewModel.getContactUsHtmlContent(),tt],c.addToSuggestionsList(),c.isVsSearchFFEnabled=c.isHosted,c.showPublishExtensions=a.FeatureFlagUtils.checkFeatureState(u.FeatureFlag.ShowPublishExtensions,v.FeatureFlagUtils.ShowPublishExtensions),c.showVSForMac=a.FeatureFlagUtils.checkFeatureState(u.FeatureFlag.EnableVsForMac,v.FeatureFlagUtils.EnableVsForMac),c.newBranding=a.FeatureFlagUtils.isMarketPlaceBrandingChangesEnabled(),c.isHosted&&(c._initializeSelectedTab(),c.searchPageParameters.searchQuery&&c.searchPageParameters.searchQuery!==""||c.searchPageParameters.sortBy||(c.searchPageParameters.sortBy=e.SortOption_Installs)),c._backNavigation=ot(c,c._resetAllParamsForBackNav),b.getService().attachEvent(t.EVENT_ON_BACK_NAV,c._backNavigation),c}return __extends(t,n),t.prototype.addToSuggestionsList=function(){var n=[e.SuggestionsListDifferentCategoryText];this.suggestionsList=n.concat(this.suggestionsList)},t.prototype.areArticlesFetched=function(){var n=rt.defer();return this._relatedArticlesFetchedPromise.then(function(){n.resolve()},function(){n.reject()}),n.promise},t.prototype.vsTabClick=function(){var n=this;return function(t,i){n.tabClicked(i,n.vsTabName)}},t.prototype.vstsTabClick=function(){var n=this;return function(t,i){n.tabClicked(i,n.vstsTabName)}},t.prototype.vsformacTabClick=function(){var n=this;return function(t,i){n.tabClicked(i,n.vsForMacTabName)}},t.prototype.vsCodeTabClick=function(){var n=this;return function(t,i){n.tabClicked(i,n.vsCodeTabName)}},t.prototype.vsSubTabClick=function(){var n=this;return function(t,i){n.tabClicked(i,n.vsSubsTabName)}},t.prototype.vsTabKeyDown=function(){var n=this;return function(t,i){n.tabKeyDown(i,n.vsTabName)}},t.prototype.vstsTabKeyDown=function(){var n=this;return function(t,i){n.tabKeyDown(i,n.vstsTabName)}},t.prototype.vsForMacTabKeyDown=function(){var n=this;return function(t,i){n.tabKeyDown(i,n.vsForMacTabName)}},t.prototype.vsCodeTabKeyDown=function(){var n=this;return function(t,i){n.tabKeyDown(i,n.vsCodeTabName)}},t.prototype.vsSubTabKeyDown=function(){var n=this;return function(t,i){n.tabKeyDown(i,n.vsSubsTabName)}},t.prototype.buildYourOwnLinkClick=function(){var n=this;return function(){n.clickBuildYourOwn()}},t.prototype.publishExtensionsClick=function(){var n=this;return function(){n.clickPublishExtensions()}},t.prototype.isTabActive=function(n){return this.currentTab()===n},t.prototype.getAriaControls=function(n){return this.currentTab()===n?"page-content":""},t.prototype.getAriaSelected=function(n){return this.currentTab()===n},t.prototype.getTabIndex=function(n){return this.currentFocusedTab()===n?"0":"-1"},t.prototype.tabKeyDown=function(n,t){var f,e;if(n.keyCode===u.ENTER_KEY_CODE)this.tabClicked(n,t);else if(n.keyCode===u.RIGHT_KEY_CODE||n.keyCode===u.LEFT_KEY_CODE){var r=0,o=[],i=-1;for(f in this.tabNameToHashDictionary)(f!=this.vsForMacTabName||this.showVSForMac)&&(o.push(f),t===f&&(i=r),r++);if(i!==-1){i=n.keyCode===u.RIGHT_KEY_CODE?i===r-1?0:i+1:i===0?r-1:i-1;switch(o[i]){case this.vsTabName:this.currentFocusedTab(this.vsTabName);this.isVSTabFocused(!0);break;case this.vsForMacTabName:this.currentFocusedTab(this.vsForMacTabName);this.isVSForMacTabFocused(!0);break;case this.vstsTabName:this.currentFocusedTab(this.vstsTabName);this.isVSTSTabFocused(!0);break;case this.vsCodeTabName:this.currentFocusedTab(this.vsCodeTabName);this.isVSCodeTabFocused(!0);break;default:this.currentFocusedTab(this.vsSubsTabName);this.isVSSubsTabFocused(!0)}}}else n.keyCode!==u.TAB_KEY_CODE||n.shiftKey?n.keyCode===u.TAB_KEY_CODE&&n.shiftKey&&(e=document.getElementById("search-box"),n.preventDefault(),e.focus()):(e=document.getElementById("publish-extensions"),n.preventDefault(),e.focus());return!0},t.prototype.tabClicked=function(n,t){switch(t){case this.vsSubsTabName:et.open(l.GalleryURLs.getHomePageVSSubscriptionsTabURL(),"_self");return;case this.vstsTabName:a.FeatureFlagUtils.isMarketPlaceBrandingChangesEnabled()?et.open(l.GalleryURLs.getHomePageAzureDevOpsTabURL(),"_self"):et.open(l.GalleryURLs.getHomePageVSTSTabURL(),"_self");return;case this.vsCodeTabName:et.open(l.GalleryURLs.getHomePageVSCodeTabURL(),"_self");return;case this.vsForMacTabName:et.open(l.GalleryURLs.getHomePageVSForMacTabURL(),"_self");return;case this.vsTabName:et.open(l.GalleryURLs.getHomePageVSTabURL(),"_self");return}},t.prototype.setSearchBoxPlaceHolderText=function(){return},t.prototype.clickBuildYourOwn=function(){var n={},t;n[f.CustomerIntelligenceConstants.MarketPlaceIntelligenceProperties.SearchAndCategoryPageProperties.SectionName]=this.getTabHashFromTab(this.currentTab());n[f.CustomerIntelligenceConstants.MarketPlaceIntelligenceProperties.SearchAndCategoryPageProperties.Page]=f.CustomerIntelligenceConstants.MarketPlaceCustomerIntelligenceCategories.CATEGORY_PAGE;n[f.CustomerIntelligenceConstants.MarketPlaceIntelligenceProperties.SearchAndCategoryPageProperties.ProductType]=this.searchPageParameters.product;t=this.getBuildYourOwnURL();window.open(t,"_blank");f.TelemetryHelper.publishEventAsync(f.CustomerIntelligenceConstants.MarketPlaceIntelligenceFeature.BUILD_YOUR_OWN_CATEGORY_PAGE,n)},t.prototype.clickPublishExtensions=function(){var n={},t;n[f.CustomerIntelligenceConstants.MarketPlaceIntelligenceProperties.SearchAndCategoryPageProperties.SectionName]=this.getTabHashFromTab(this.currentTab());n[f.CustomerIntelligenceConstants.MarketPlaceIntelligenceProperties.SearchAndCategoryPageProperties.Page]=f.CustomerIntelligenceConstants.MarketPlaceCustomerIntelligenceCategories.CATEGORY_PAGE;n[f.CustomerIntelligenceConstants.MarketPlaceIntelligenceProperties.SearchAndCategoryPageProperties.ProductType]=this.searchPageParameters.product;t=this.getPublishExtensionsUrl();window.open(t,"_blank");f.TelemetryHelper.publishEventAsync(f.CustomerIntelligenceConstants.MarketPlaceIntelligenceFeature.PUBLISH_EXTENSIONS,n)},t.prototype.getTabHashFromTab=function(n){var t=this.tabNameToHashDictionary[this.vsTabName];return this.tabNameToHashDictionary[n]&&(t=this.tabNameToHashDictionary[n]),t},t.prototype.initializeDictionary=function(n,t){this.tabNameToHashDictionary[n]=t;this.tabHashToNameDictionary[t]=n},t.prototype.dispose=function(){b.getService().detachEvent(t.EVENT_ON_BACK_NAV,this._backNavigation);n.prototype.dispose.call(this)},t.prototype._resetAllParamsForBackNav=function(n,t){this.allFilters.setFilterValues(t[0].searchPageParams);this._isBackNav=!0;this._setCurrentItemClass();this.resetPageContextAndFetchPage();this._isBackNav=!1},t.prototype.initializePage=function(){this.allFilters=new it.AllFilters(this);this.allFilters.createFilters(this.searchPageParameters.product);this.allFilters.initializeFilters();this.allFilters.setFilterValues(this.searchPageParameters);this._setCurrentItemClass();this.resetPageContextAndFetchPage()},t.prototype._getExtensionsUrl=function(n){var t="";return nt.ignoreCaseComparer(n,u.SearchConstants.VSProductText)===0?t=l.GalleryURLs.getHomePageVSTabURL():nt.ignoreCaseComparer(n,u.SearchConstants.VSTSProductText)===0?t=p.getPageContext().webAccessConfiguration.isHosted?l.GalleryURLs.getHomePageVSTSTabURL():l.GalleryURLs.getHomePageURL():nt.ignoreCaseComparer(n,u.SearchConstants.VSCodeProductText)===0?t=l.GalleryURLs.getHomePageVSCodeTabURL():nt.ignoreCaseComparer(n,u.SearchConstants.VSForMacProductText)===0&&(t=l.GalleryURLs.getHomePageVSForMacTabURL()),t},t.prototype.resetPageContextAndFetchPage=function(){this._currentPageNumber=1;this.styleFirstSpinner(!0);this.itemGridViewModel.clear();this._koResultsFoundText("");this._updatePageTitle();this._isBackNav||this._updatePageURLCallback(this._isFirst,this.searchPageParameters);this._fetchNextPage()},t.prototype._updatePageTitle=function(){document.title=nt.format(e.CategoryTitle,this.searchPageParameters.category,e.OnPremGalleryPageTitle)},t.prototype._createItemRowVMsFromItems=function(n){for(var f,e,o,s=this,u=[],i=[],r=this.itemGridViewModel.itemArray().length+1,t=0;t<n.length;t++)f=r===1&&t===0,e=this._createItemTileVMFromItem(n[t],t,f),i.length<c.ItemRowViewModel.ITEM_ROW_TILE_LIMIT&&i.push(e),(i.length===c.ItemRowViewModel.ITEM_ROW_TILE_LIMIT||t===n.length-1)&&(o={items:i,rowId:"row-"+r,itemsVisibleCallback:function(n){s._tileImpressionTelemetry(n)},itemContainerSelector:".gallery-item-card-container",selectNextCallback:this.itemGridViewModel.selectNextItemCallbackHandler,selectPreviousCallback:this.itemGridViewModel.selectPrevItemCallbackHandler},u.push(new c.ItemRowViewModel(o)),i=[],r++);return u},t.prototype._createItemTileVMFromItem=function(n,t,i){var f,r;return this.isVsSearchFFEnabled||nt.ignoreCaseComparer(this.searchPageParameters.product,u.SearchConstants.VSProductText)!==0?(r={item:n,itemClassName:this._itemClassName,haveTabIndex:i},this._tileClickTelemetry(r,t),new h.ItemTileViewModel(r)):(f={item:n},new y.VSItemTileViewModel(f))},t.prototype.addParamsToTelemetryProperties=function(n){n[ft.ProductType]=this.searchPageParameters.product;this.searchPageParameters.category&&(n[ft.CategoryName]=this.searchPageParameters.category);this.searchPageParameters.subCategory&&(n[ft.SubCategoryName]=this.searchPageParameters.subCategory);this.searchPageParameters.installationTarget&&(n[ft.InstallationTarget]=this.searchPageParameters.installationTarget);this.searchPageParameters.vsVersion&&this.searchPageParameters.vsVersion.length>0&&this.searchPageParameters.vsVersion[0]&&(n[ft.VSVersion]=this.searchPageParameters.vsVersion[0]);this.searchPageParameters.pricing&&(n[ft.PriceOption]=this.searchPageParameters.pricing);this.searchPageParameters.sortBy&&(n[ft.SortOption]=this.searchPageParameters.sortBy);this.searchPageParameters.visibilityQuery&&(n[ft.VisibilityQuery]=this.searchPageParameters.visibilityQuery)},t.prototype._tileClickTelemetry=function(n,t){var i=this,r=this.itemGridViewModel.itemArray().length*c.ItemRowViewModel.ITEM_ROW_TILE_LIMIT+t+1;n.itemClickCallBack=function(){var n={};n[ft.Action]=f.CustomerIntelligenceConstants.MarketPlaceIntelligenceFeature.SEARCH_RESULT_CLICK;n[ft.ResultCount]=i._resultTotalCount;n[ft.TilePosition]=r;i.addParamsToTelemetryProperties(n);f.TelemetryHelper.publishEventAsync(f.CustomerIntelligenceConstants.MarketPlaceIntelligenceFeature.SEARCH,n)}},t.prototype._queryCompleteTelemetry=function(){var n=this;this._isFirst&&(f.GalleryPerformance.endScenario(this._performanceScenario,undefined,undefined,!0),f.GalleryPerformance.endPageLoadTTIScenario());this._relatedArticlesFetchedPromise.then(function(){var t={};t[ft.ResultCount]=n._resultTotalCount;t[ft.Action]=f.CustomerIntelligenceConstants.MarketPlaceIntelligenceFeature.SEARCH_QUERY_COMPLETE;n.addParamsToTelemetryProperties(t);n._relatedArticleIdsShown&&n._relatedArticleIdsShown.length>0&&(t[ft.RelatedArticleIds]=JSON.stringify(n._relatedArticleIdsShown));f.TelemetryHelper.publishEventAsync(f.CustomerIntelligenceConstants.MarketPlaceIntelligenceFeature.SEARCH,t)},function(){})},t.prototype._seeMoreTelemetry=function(){var n={};n[ft.PageNumber]=this._currentPageNumber;n[ft.ResultCount]=this._resultTotalCount;n[ft.Action]=f.CustomerIntelligenceConstants.MarketPlaceIntelligenceFeature.SEEMORE;this.addParamsToTelemetryProperties(n);f.TelemetryHelper.publishEventAsync(f.CustomerIntelligenceConstants.MarketPlaceIntelligenceFeature.SEARCH,n)},t.prototype._tileImpressionTelemetry=function(n){if((k.FeatureAvailabilityService.isFeatureEnabled(u.FeatureFlag.TileImpressionsSearchPage)||v.FeatureFlagUtils.isFeatureFlagEnabled(location.href,v.FeatureFlagUtils.TileImpressionsSearchPage))&&n&&n.length>0){var t={},i=[];n.forEach(function(n){i.push(n.fullyQualifiedName)});t[f.CustomerIntelligenceConstants.MarketPlaceIntelligencePropertyName.IMPRESSIONS_ITEMS]=i;t[f.CustomerIntelligenceConstants.MarketPlaceIntelligencePropertyName.IMPRESSIONS_LOCATION]="searchPage";t[f.CustomerIntelligenceConstants.MarketPlaceIntelligencePropertyName.CONTAINER]=n[0].containerName;f.TelemetryHelper.publishEventAsync(f.CustomerIntelligenceConstants.MarketPlaceIntelligenceFeature.IMPRESSIONS,t)}},t.prototype._freezeControlsAndShowSpinner=function(n,t){t===void 0&&(t=!1);n?this.startSpinner():this.stopSpinner(t);this.filterControlViewModel.isEnabled(!n)},t.prototype.startSpinner=function(){var n=this;this._koShowSpinner(!0);this._completed=!1;this._announceDelay=g.delay(this,this._announceStartDelay,function(){tt.announce(o.StartFetchingExtensions,!0);n._spinnerStartAnnounced=!0})},t.prototype.stopSpinner=function(n){n===void 0&&(n=!1);this._koShowSpinner(!1);this._completed||(this._completed=!0,this._spinnerStartAnnounced?n?tt.announce(o.ErrorFetchingExtensions,!0):tt.announce(o.EndFetchingExtensions,!0):this._announceDelay.cancel())},t.prototype._setResults=function(n){this._freezeControlsAndShowSpinner(!1);var t=this._createItemRowVMsFromItems(n.searchResults);this._resultTotalCount=n.totalCount;this._showResultsFound(t,this._resultTotalCount);this._currentPageNumber===1&&(this.setFilterControlVisibility(n),this.allFilters.postQueryUpdate(n.totalCount,n.categoryInfo,n.targetPlatforms),this._queryCompleteTelemetry());this._isQueryInProgress=!1;this._isFirst=!1;this._shouldLoadMoreNow()?this._loadMore():this._isScrollBound||this._bindScroll()},t.prototype.setFilterControlVisibility=function(n){this.isHosted&&n.categoryInfo&&n.categoryInfo.length===0&&n.totalCount===0?this._koIsShowFilterControl(!1):this._koIsShowFilterControl(!0)},t.prototype._bindScroll=function(){this._isScrollBound=!0;var n=this;$(window).on("scroll",function(){n._shouldLoadMoreNow()&&n._loadMore()})},t.prototype._shouldLoadMoreNow=function(){var r=this._resultTotalCount>this.itemGridViewModel.itemArray().length*c.ItemRowViewModel.ITEM_ROW_TILE_LIMIT,n=!1,u=this._isFocusWithinFooter(),t=document.querySelector("#"+this.categoryListId),i;return t&&(i=t.getBoundingClientRect().bottom,n=i<=window.innerHeight),n&&r&&!this._isQueryInProgress&&!u},t.prototype._isFocusWithinFooter=function(){var t=$("#gallery-footer"),n;return t&&(n=t.get(0),n)?n.contains(document.activeElement):!1},t.prototype._loadMore=function(){this._currentPageNumber++;this.styleFirstSpinner(!1);this._seeMoreTelemetry();this._fetchNextPage()},t.prototype._setFailure=function(){this._isFirst&&f.GalleryPerformance.abortScenario(this._performanceScenario);this._isFirst=!1;this._errorCallback(e.ErrorExtensionsNotLoading,null,this.$element);this._freezeControlsAndShowSpinner(!1,!0);this._isQueryInProgress=!1},t.prototype._showResultsFound=function(n,t){var i=this,f=0,r=rt.defer();this._relatedArticlesFetchedPromise=r.promise;n&&n.length?(this.itemGridViewModel.appendItems(n),f=t,this._koShowSuggestions(!1),this._relatedArticleIdsShown=[],r.resolve(null)):a.FeatureFlagUtils.isNewZeroSearchResultExperienceEnabled()?nt.ignoreCaseComparer(this.searchPageParameters.product,u.SearchConstants.VSTSProductText)===0?ut.using(["Gallery/Client/Common/VstsRelatedArticles"],function(n){var t=n.articles.filter(function(n){if(nt.ignoreCaseComparer(n.searchTerm,i.searchPageParameters.searchQuery)===0)return!0}),u=[];t&&t.length>0&&t[0].articles&&t[0].articles.forEach(function(n){u.push(n.id)});i._relatedArticleIdsShown=u;r.resolve(null);i.zeroResultsViewModel.updateZeroResultData({searchTerm:i.searchPageParameters.searchQuery,productType:i.searchPageParameters.product,suggestions:i.suggestionsList,relatedArticles:t&&t.length>0?t[0].articles:null});i._koShowNewZeroResultExperience(!0)}):(this.zeroResultsViewModel.updateZeroResultData({searchTerm:this.searchPageParameters.searchQuery,productType:this.searchPageParameters.product,suggestions:this.suggestionsList,relatedArticles:null}),this._relatedArticleIdsShown=[],r.resolve(null),this._koShowNewZeroResultExperience(!0)):(this._koShowSuggestions(!0),this._relatedArticleIdsShown=[],r.resolve(null));f===0&&a.FeatureFlagUtils.isNewZeroSearchResultExperienceEnabled()?this._koResultsFoundText(null):this._koResultsFoundText(nt.format(this._getResultsFoundString(f),f));this._koSearchQueryOrCategoryHeader(this.searchPageParameters.category)},t.prototype._getResultsFoundString=function(n){return n===1?e.SearchResultFoundText:e.SearchResultsFoundText},t.prototype._initializeSelectedTab=function(){nt.ignoreCaseComparer(this.searchPageParameters.product,u.SearchConstants.VSProductText)===0?(this.currentTab(this.vsTabName),this.currentFocusedTab(this.vsTabName)):nt.ignoreCaseComparer(this.searchPageParameters.product,u.SearchConstants.VSTSProductText)===0?(this.currentTab(this.vstsTabName),this.currentFocusedTab(this.vstsTabName)):nt.ignoreCaseComparer(this.searchPageParameters.product,u.SearchConstants.VSCodeProductText)===0?(this.currentTab(this.vsCodeTabName),this.currentFocusedTab(this.vsCodeTabName)):nt.ignoreCaseComparer(this.searchPageParameters.product,u.SearchConstants.VSForMacProductText)===0?(this.currentTab(this.vsForMacTabName),this.currentFocusedTab(this.vsForMacTabName)):(this.currentTab(this.vsSubsTabName),this.currentFocusedTab(this.vsSubsTabName))},t.prototype.getBuildYourOwnURL=function(){return this.currentTab()===this.vsCodeTabName?u.BuildYourOwnLinks.VSCode:this.currentTab()===this.vstsTabName?u.BuildYourOwnLinks.VSTS:this.currentTab()===this.vsForMacTabName?u.BuildYourOwnLinks.VSForMac:u.BuildYourOwnLinks.VS},t.prototype.getPublishExtensionsUrl=function(){return l.GalleryURLs.getManageURL()},t.prototype._fetchNextPage=function(){var n,t=this.allFilters.allFiltersList[it.AllFilters.SortFilter].getOptionIndex();n=this.isVsSearchFFEnabled||nt.ignoreCaseComparer(this.searchPageParameters.product,u.SearchConstants.VSProductText)!==0?this._vssSearchProvider:this._vsSearchProvider;this._koShowSuggestions(!1);this._koShowNewZeroResultExperience(!1);this._freezeControlsAndShowSpinner(!0);this._isQueryInProgress||(this._isQueryInProgress=!0,n.searchWithParameters(this.searchPageParameters,this._currentPageNumber,this._pageSize,t,ot(this,this._setResults),ot(this,this._setFailure)))},t.prototype._setCurrentItemClass=function(){var n=t.VSS_ITEM_CLASS;nt.ignoreCaseComparer(this.searchPageParameters.product,u.SearchConstants.VSCodeProductText)===0?n=t.VSCODE_ITEM_CLASS:this.isVsSearchFFEnabled&&nt.ignoreCaseComparer(this.searchPageParameters.product,u.SearchConstants.VSProductText)===0?n=t.VS_ITEM_CLASS:nt.ignoreCaseComparer(this.searchPageParameters.product,u.SearchConstants.VSForMacProductText)===0&&(n=t.VSFORMAC_ITEM_CLASS);this._itemClassName=n},t._vscodeProductName="vscode",t.VS_ITEM_CLASS="VS",t.VSS_ITEM_CLASS="VSTS",t.VSCODE_ITEM_CLASS="VSCode",t.VSFORMAC_ITEM_CLASS="VSForMac",t.EVENT_ON_SEARCH="VSS.Gallery.Category.OnSearchFromHeaderBar",t.EVENT_ON_BACK_NAV="VSS.Gallery.Category.OnBackNavigation",t._itemRowTemplate="item-row-template",t._vssItemTileTemplate="gallery-item-card-template",t._vsItemTileTemplate="item-card-template",t.allCategoriesText=o.AllCategoriesText,t._productToTargetList=[{product:o.VS_Header,target:u.SearchConstants.VSProductText},{product:o.VSForMac_Header,target:u.SearchConstants.VSForMacProductText},{product:o.VSTS_Header,target:u.SearchConstants.VSTSProductText},{product:o.VSCode_Header,target:u.SearchConstants.VSCodeProductText}],t}(d.TemplateViewModel);t.BaseCategoryViewModel=st});

define("Gallery/Client/Controls/Category/Category.View",["require","exports","Gallery/Client/Controls/Category/BaseCategory.ViewModel","VSS/Adapters/Knockout"],function(n,t,i,r){Object.defineProperty(t,"__esModule",{value:!0});t.CategoryView=void 0;var u=function(n){function t(){var t=__construct(this,n,arguments);for(var i in t)t.hasOwnProperty(i)&&(this[i]=t[i]);return t}return __extends(t,n),t.prototype.initialize=function(){n.prototype.initialize.call(this);this._categoryViewModel=this.getViewModel();this._initializeChildControls();this._initializePage()},t.prototype._initializeChildControls=function(){var u={filters:null},n=null,t,f,e,o,s,h,c,l,a;this._categoryViewModel.isHosted&&(n=this._initSearchBarViewModelOptions());t=this._initItemGridViewModelOptions([],i.BaseCategoryViewModel._itemRowTemplate);this._categoryViewModel.$element=this.getElement();u&&(f=this.getElement().find(".filter-control-container"),e=r.TemplateControl.applyRegisteredBinding("filter-control-template",f,u),this._categoryViewModel.filterControlViewModel=e.getViewModel());t&&(o=this.getElement().find(".item-list-container"),s=r.TemplateControl.applyRegisteredBinding("item-grid-template",o,t),this._categoryViewModel.itemGridViewModel=s.getViewModel());n&&(h=this.getElement().find(".searchbar-container"),c=r.TemplateControl.applyRegisteredBinding("searchbar-control-template",h,n),this._categoryViewModel.searchBarViewModel=c.getViewModel(),this._categoryViewModel.setSearchBoxPlaceHolderText());l=this.getElement().find(".zero-results-control-container");a=r.TemplateControl.applyRegisteredBinding("zero-results-template",l,{});this._categoryViewModel.zeroResultsViewModel=a.getViewModel()},t.prototype._initItemGridViewModelOptions=function(n,t){return{items:n,itemDisplayTemplate:t}},t.prototype._initSearchBarViewModelOptions=function(){return{initialSearchTerm:"",searchClickCallback:null}},t.prototype._initializePage=function(){this._categoryViewModel.initializePage()},t}(r.TemplateControl);t.CategoryView=u});

define("VSS/Contributions/Contracts",["require","exports","VSS/Gallery/Contracts"],function(n,t,i){"use strict";var r,u,f,e,o,s,h,c,l,a,v,y;Object.defineProperty(t,"__esModule",{value:!0});t.TypeInfo=t.InstalledExtensionStateIssueType=t.ExtensionUpdateType=t.ExtensionStateFlags=t.ExtensionRequestUpdateType=t.ExtensionRequestState=t.ExtensionFlags=t.ContributionQueryOptions=t.ContributionPropertyType=t.ContributionLicensingBehaviorType=t.AcquisitionOperationType=t.AcquisitionOperationState=t.AcquisitionAssignmentType=void 0,function(n){n[n.None=0]="None";n[n.Me=1]="Me";n[n.All=2]="All"}(r=t.AcquisitionAssignmentType||(t.AcquisitionAssignmentType={})),function(n){n[n.Disallow=0]="Disallow";n[n.Allow=1]="Allow";n[n.Completed=3]="Completed"}(u=t.AcquisitionOperationState||(t.AcquisitionOperationState={})),function(n){n[n.Get=0]="Get";n[n.Install=1]="Install";n[n.Buy=2]="Buy";n[n.Try=3]="Try";n[n.Request=4]="Request";n[n.None=5]="None";n[n.PurchaseRequest=6]="PurchaseRequest"}(f=t.AcquisitionOperationType||(t.AcquisitionOperationType={})),function(n){n[n.OnlyIfLicensed=0]="OnlyIfLicensed";n[n.OnlyIfUnlicensed=1]="OnlyIfUnlicensed";n[n.AlwaysInclude=2]="AlwaysInclude"}(e=t.ContributionLicensingBehaviorType||(t.ContributionLicensingBehaviorType={})),function(n){n[n.Unknown=0]="Unknown";n[n.String=1]="String";n[n.Uri=2]="Uri";n[n.Guid=4]="Guid";n[n.Boolean=8]="Boolean";n[n.Integer=16]="Integer";n[n.Double=32]="Double";n[n.DateTime=64]="DateTime";n[n.Dictionary=128]="Dictionary";n[n.Array=256]="Array";n[n.Object=512]="Object"}(o=t.ContributionPropertyType||(t.ContributionPropertyType={})),function(n){n[n.None=0]="None";n[n.IncludeSelf=16]="IncludeSelf";n[n.IncludeChildren=32]="IncludeChildren";n[n.IncludeSubTree=96]="IncludeSubTree";n[n.IncludeAll=112]="IncludeAll";n[n.IgnoreConstraints=256]="IgnoreConstraints"}(s=t.ContributionQueryOptions||(t.ContributionQueryOptions={})),function(n){n[n.BuiltIn=1]="BuiltIn";n[n.Trusted=2]="Trusted"}(h=t.ExtensionFlags||(t.ExtensionFlags={})),function(n){n[n.Open=0]="Open";n[n.Accepted=1]="Accepted";n[n.Rejected=2]="Rejected"}(c=t.ExtensionRequestState||(t.ExtensionRequestState={})),function(n){n[n.Created=1]="Created";n[n.Approved=2]="Approved";n[n.Rejected=3]="Rejected";n[n.Deleted=4]="Deleted"}(l=t.ExtensionRequestUpdateType||(t.ExtensionRequestUpdateType={})),function(n){n[n.None=0]="None";n[n.Disabled=1]="Disabled";n[n.BuiltIn=2]="BuiltIn";n[n.MultiVersion=4]="MultiVersion";n[n.UnInstalled=8]="UnInstalled";n[n.VersionCheckError=16]="VersionCheckError";n[n.Trusted=32]="Trusted";n[n.Error=64]="Error";n[n.NeedsReauthorization=128]="NeedsReauthorization";n[n.AutoUpgradeError=256]="AutoUpgradeError";n[n.Warning=512]="Warning";n[n.Unpublished=1024]="Unpublished"}(a=t.ExtensionStateFlags||(t.ExtensionStateFlags={})),function(n){n[n.Installed=1]="Installed";n[n.Uninstalled=2]="Uninstalled";n[n.Enabled=3]="Enabled";n[n.Disabled=4]="Disabled";n[n.VersionUpdated=5]="VersionUpdated";n[n.ActionRequired=6]="ActionRequired";n[n.ActionResolved=7]="ActionResolved"}(v=t.ExtensionUpdateType||(t.ExtensionUpdateType={})),function(n){n[n.Warning=0]="Warning";n[n.Error=1]="Error"}(y=t.InstalledExtensionStateIssueType||(t.InstalledExtensionStateIssueType={}));t.TypeInfo={AcquisitionAssignmentType:{enumValues:{none:0,me:1,all:2}},AcquisitionOperation:{},AcquisitionOperationState:{enumValues:{disallow:0,allow:1,completed:3}},AcquisitionOperationType:{enumValues:{get:0,install:1,buy:2,"try":3,request:4,none:5,purchaseRequest:6}},AcquisitionOptions:{},ContributionLicensingBehaviorType:{enumValues:{onlyIfLicensed:0,onlyIfUnlicensed:1,alwaysInclude:2}},ContributionNodeQuery:{},ContributionPropertyDescription:{},ContributionPropertyType:{enumValues:{unknown:0,string:1,uri:2,guid:4,boolean:8,integer:16,double:32,dateTime:64,dictionary:128,array:256,object:512}},ContributionQueryOptions:{enumValues:{none:0,includeSelf:16,includeChildren:32,includeSubTree:96,includeAll:112,ignoreConstraints:256}},ContributionType:{},ExtensionAcquisitionRequest:{},ExtensionAuditLog:{},ExtensionAuditLogEntry:{},ExtensionEvent:{},ExtensionFlags:{enumValues:{builtIn:1,trusted:2}},ExtensionLicensing:{},ExtensionManifest:{},ExtensionRequest:{},ExtensionRequestEvent:{},ExtensionRequestsEvent:{},ExtensionRequestState:{enumValues:{open:0,accepted:1,rejected:2}},ExtensionRequestUpdateType:{enumValues:{created:1,approved:2,rejected:3,deleted:4}},ExtensionState:{},ExtensionStateFlags:{enumValues:{none:0,disabled:1,builtIn:2,multiVersion:4,unInstalled:8,versionCheckError:16,trusted:32,error:64,needsReauthorization:128,autoUpgradeError:256,warning:512,unpublished:1024}},ExtensionUpdateType:{enumValues:{installed:1,uninstalled:2,enabled:3,disabled:4,versionUpdated:5,actionRequired:6,actionResolved:7}},InstalledExtension:{},InstalledExtensionState:{},InstalledExtensionStateIssue:{},InstalledExtensionStateIssueType:{enumValues:{warning:0,error:1}},LicensingOverride:{},RequestedExtension:{}};t.TypeInfo.AcquisitionOperation.fields={operationState:{enumType:t.TypeInfo.AcquisitionOperationState},operationType:{enumType:t.TypeInfo.AcquisitionOperationType}};t.TypeInfo.AcquisitionOptions.fields={defaultOperation:{typeInfo:t.TypeInfo.AcquisitionOperation},operations:{isArray:!0,typeInfo:t.TypeInfo.AcquisitionOperation}};t.TypeInfo.ContributionNodeQuery.fields={queryOptions:{enumType:t.TypeInfo.ContributionQueryOptions}};t.TypeInfo.ContributionPropertyDescription.fields={type:{enumType:t.TypeInfo.ContributionPropertyType}};t.TypeInfo.ContributionType.fields={properties:{isDictionary:!0,dictionaryValueTypeInfo:t.TypeInfo.ContributionPropertyDescription}};t.TypeInfo.ExtensionAcquisitionRequest.fields={assignmentType:{enumType:t.TypeInfo.AcquisitionAssignmentType},operationType:{enumType:t.TypeInfo.AcquisitionOperationType}};t.TypeInfo.ExtensionAuditLog.fields={entries:{isArray:!0,typeInfo:t.TypeInfo.ExtensionAuditLogEntry}};t.TypeInfo.ExtensionAuditLogEntry.fields={auditDate:{isDate:!0}};t.TypeInfo.ExtensionEvent.fields={extension:{typeInfo:i.TypeInfo.PublishedExtension},updateType:{enumType:t.TypeInfo.ExtensionUpdateType}};t.TypeInfo.ExtensionLicensing.fields={overrides:{isArray:!0,typeInfo:t.TypeInfo.LicensingOverride}};t.TypeInfo.ExtensionManifest.fields={contributionTypes:{isArray:!0,typeInfo:t.TypeInfo.ContributionType},licensing:{typeInfo:t.TypeInfo.ExtensionLicensing}};t.TypeInfo.ExtensionRequest.fields={requestDate:{isDate:!0},requestState:{enumType:t.TypeInfo.ExtensionRequestState},resolveDate:{isDate:!0}};t.TypeInfo.ExtensionRequestEvent.fields={extension:{typeInfo:i.TypeInfo.PublishedExtension},request:{typeInfo:t.TypeInfo.ExtensionRequest},updateType:{enumType:t.TypeInfo.ExtensionRequestUpdateType}};t.TypeInfo.ExtensionRequestsEvent.fields={extension:{typeInfo:i.TypeInfo.PublishedExtension},requests:{isArray:!0,typeInfo:t.TypeInfo.ExtensionRequest},updateType:{enumType:t.TypeInfo.ExtensionRequestUpdateType}};t.TypeInfo.ExtensionState.fields={flags:{enumType:t.TypeInfo.ExtensionStateFlags},installationIssues:{isArray:!0,typeInfo:t.TypeInfo.InstalledExtensionStateIssue},lastUpdated:{isDate:!0},lastVersionCheck:{isDate:!0}};t.TypeInfo.InstalledExtension.fields={contributionTypes:{isArray:!0,typeInfo:t.TypeInfo.ContributionType},flags:{enumType:t.TypeInfo.ExtensionFlags},installState:{typeInfo:t.TypeInfo.InstalledExtensionState},lastPublished:{isDate:!0},licensing:{typeInfo:t.TypeInfo.ExtensionLicensing}};t.TypeInfo.InstalledExtensionState.fields={flags:{enumType:t.TypeInfo.ExtensionStateFlags},installationIssues:{isArray:!0,typeInfo:t.TypeInfo.InstalledExtensionStateIssue},lastUpdated:{isDate:!0}};t.TypeInfo.InstalledExtensionStateIssue.fields={type:{enumType:t.TypeInfo.InstalledExtensionStateIssueType}};t.TypeInfo.LicensingOverride.fields={behavior:{enumType:t.TypeInfo.ContributionLicensingBehaviorType}};t.TypeInfo.RequestedExtension.fields={extensionRequests:{isArray:!0,typeInfo:t.TypeInfo.ExtensionRequest}}});

define("VSS/Navigation/Location",["require","exports","VSS/Utils/Url","VSS/Context","VSS/Contributions/LocalPageData"],function(n,t,i,r,u){Object.defineProperty(t,"__esModule",{value:!0});t.LocationService=void 0;var f=function(){function n(){this._parsedRoutes={}}return n.prototype.routeTemplates=function(n){var f=this._parsedRoutes[n],e,t,o;if(f||(e=u.getSharedData("_routes"),t=void 0,e&&(t=e[n]),t||(o=r.getPageContext(),n===o.navigation.routeId&&(t=o.navigation.routeTemplates)),t&&(f=t.map(i.parseRouteTemplate),this._parsedRoutes[n]=f)),f)return f;throw new Error("Could not find route for route id ".concat(n,". Ensure that the requested route is added to routes shared data."));},n.prototype.routeUrl=function(n,t,u){var f=this.routeTemplates(n),e;if(f)return e=i.routeUrl(f,t),u||(u=r.getDefaultWebContext().host.relativeUri),i.combineUrl(encodeURI(u),e);throw new Error("Could not find route templates for route id ".concat(n,". Ensure that the requested route is added to routes shared data."));},n}();t.LocationService=f});

var __assign=this&&this.__assign||function(){return __assign=Object.assign||function(n){for(var t,r,i=1,u=arguments.length;i<u;i++){t=arguments[i];for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},__assign.apply(this,arguments)};define("VSS/Navigation/NavigationHistoryService",["require","exports","VSS/Context","VSS/Service","VSS/Utils/Url","./Location"],function(n,t,i,r,u,f){function o(){return r.getLocalService(e)}Object.defineProperty(t,"__esModule",{value:!0});t.getNavigationHistoryService=void 0;var e=function(){function n(){this._routeAliases={};this._listeners=[];window.addEventListener("popstate",this._onPopState.bind(this))}return n.prototype.replaceState=function(n,t,i,r,u){this._setState(!0,n,t,i,r,!1,u)},n.prototype.pushState=function(n,t,i,r,u,f){this._setState(!1,n,t,i,r,u,f)},n.prototype.getState=function(){return this._currentState&&this._currentState.state?__assign({},this._currentState.state):this._getStateFromUrl(window.location.href)},n.prototype._setState=function(n,t,r,f,e,o,s){var h=i.getPageContext(),y=!t,l;r&&!t?t=this._getStateFromUrl(r):t&&!r?r=f?this.generateUrlForRoute(f,t,0):this.generateUrl(t,0):r||t||(r=window.location.href,t=this._currentState&&this._currentState.state,t||(t=this._getStateFromUrl(r)));(f===null||f===undefined)&&(f=h.navigation.routeId);!e&&h.hubsContext&&(e=h.hubsContext.selectedHubId);var c={state:t,routeId:f,navigationElementId:e,url:r},a=u.isAbsoluteUrl(r)?r:u.combineUrl(window.location.origin,r),v=n||s;o&&window.location.href===a&&(v=!0);l=v?__assign(__assign({},window.history.state),{__navigationState:c}):{__navigationState:c};this._currentState=c;n||!o&&window.location.href===a?window.history.replaceState(l,undefined,r):window.history.pushState(l,undefined,r)},n.prototype.getParsedRoutes=function(n){var t,i,r,f;if(this._parsedRouteTemplates&&this._parsedRouteTemplatesSource===n)return this._parsedRouteTemplates;if(t=[],n){for(i=0,r=n;i<r.length;i++)f=r[i],t.push(u.parseRouteTemplate(f));this._parsedRouteTemplates=t;this._parsedRouteTemplatesSource=n}return t},n.prototype.generateUrl=function(n,t){t===void 0&&(t=2);var r=i.getPageContext(),u=this.getParsedRoutes(r.navigation.routeTemplates);return this._generateUrlFromTemplates(u,n,t)},n.prototype.generateUrlForRoute=function(n,t,i){i===void 0&&(i=2);var u=r.getLocalService(f.LocationService);return this._generateUrlFromTemplates(u.routeTemplates(n),t,i)},n.prototype._generateUrlFromTemplates=function(n,t,r){var e,h,c,o,s;r===void 0&&(r=2);var l=i.getPageContext(),a=encodeURI(l.webContext.host.relativeUri),v=l.navigation.routeValues,f;switch(r){case 2:f=__assign(__assign({},this.getState()),t);break;case 1:f=__assign(__assign({},this.getCurrentRouteValues()),t);break;default:f=t}if(e=u.getBestRouteMatch(n,f),h="",e&&(h=e.url),c=new u.Uri(u.combineUrl(a,h)),e)for(o in f)e.matchedParameters[o]||(s=f[o],s!==null&&s!==undefined&&v[o]!==s&&c.addQueryParam(o,s));return c.absoluteUri},n.prototype.getCurrentRouteValues=function(){var r=i.getPageContext(),n={},u=this.getState();for(var t in r.navigation.routeValues)n[t]=u[t];return n},n.prototype.getCurrentRouteId=function(){if(this._currentState&&this._currentState.routeId)return this._currentState.routeId;var n=i.getPageContext();return n.navigation.routeId},n.prototype.registerRouteAlias=function(n,t){this._routeAliases[t]=n;this._routeAliases[n]=n},n.prototype._getStateFromUrl=function(n){var e=__assign({},i.getPageContext().navigation.routeValues),o,t,r,f;if(n)for(o=new u.Uri(n),t=0,r=o.queryParameters;t<r.length;t++)f=r[t],e[f.name]=f.value;return e},n.prototype._onPopState=function(n){var u=n.state,i=this._currentState,t,r=!1,f;u&&u.__navigationState&&(t=u.__navigationState,this._currentState=t,r=!!i&&(!t.routeId||i.routeId!==t.routeId));i&&t&&i.navigationElementId&&t.navigationElementId&&i.navigationElementId!==t.navigationElementId&&(r=!0);i&&t&&this._routeAliases[i.routeId]&&this._routeAliases[i.routeId]===this._routeAliases[t.routeId]&&(r=!1);f={oldState:i,newState:t,isNewRouteId:r};this.notifyListeners(f)},n.prototype.notifyListeners=function(n){for(var r,t=0,i=this._listeners;t<i.length;t++)r=i[t],r.call(this,n)},n.prototype.subscribe=function(n){this._listeners.push(n)},n.prototype.unsubscribe=function(n){this._listeners=this._listeners.filter(function(t){return t!==n})},n}();t.getNavigationHistoryService=o});

var __extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),__assign=this&&this.__assign||function(){return __assign=Object.assign||function(n){for(var t,r,i=1,u=arguments.length;i<u;i++){t=arguments[i];for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},__assign.apply(this,arguments)},__awaiter=this&&this.__awaiter||function(n,t,i,r){function u(n){return n instanceof i?n:new i(function(t){t(n)})}return new(i||(i=Promise))(function(i,f){function o(n){try{e(r.next(n))}catch(t){f(t)}}function s(n){try{e(r["throw"](n))}catch(t){f(t)}}function e(n){n.done?i(n.value):u(n.value).then(o,s)}e((r=r.apply(n,t||[])).next())})},__generator=this&&this.__generator||function(n,t){function o(n){return function(t){return s([n,t])}}function s(e){if(f)throw new TypeError("Generator is already executing.");while(r)try{if(f=1,u&&(i=e[0]&2?u["return"]:e[0]?u["throw"]||((i=u["return"])&&i.call(u),0):u.next)&&!(i=i.call(u,e[1])).done)return i;(u=0,i)&&(e=[e[0]&2,i.value]);switch(e[0]){case 0:case 1:i=e;break;case 4:return r.label++,{value:e[1],done:!1};case 5:r.label++;u=e[1];e=[0];continue;case 7:e=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(e[0]===6||e[0]===2)){r=0;continue}if(e[0]===3&&(!i||e[1]>i[0]&&e[1]<i[3])){r.label=e[1];break}if(e[0]===6&&r.label<i[1]){r.label=i[1];i=e;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(e);break}i[2]&&r.ops.pop();r.trys.pop();continue}e=t.call(n,r)}catch(o){e=[6,o];u=0}finally{f=i=0}if(e[0]&5)throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},f,u,i,e;return e={next:o(0),"throw":o(1),"return":o(2)},typeof Symbol=="function"&&(e[Symbol.iterator]=function(){return this}),e},__spreadArray=this&&this.__spreadArray||function(n,t,i){if(i||arguments.length===2)for(var r=0,f=t.length,u;r<f;r++)!u&&r in t||(u||(u=Array.prototype.slice.call(t,0,r)),u[r]=t[r]);return n.concat(u||Array.prototype.slice.call(t))};define("VSS/Contributions/Services",["require","exports","q","VSS/Common/Constants/Platform","VSS/WebApi/Constants","VSS/Context","VSS/Common/Contracts/Platform","VSS/Contributions/Contracts","VSS/Diag","VSS/FeatureAvailability/Services","VSS/Contributions/LocalPageData","VSS/LWP","VSS/Resources/VSS.Resources.Platform","VSS/Serialization","VSS/Service","VSS/Telemetry/Services","VSS/Utils/File","VSS/Utils/String","VSS/VSS","VSS/Navigation/HubsService","VSS/Navigation/NavigationHistoryService"],function(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w,b,k,d,g){function ft(n,t,i,r){return k.requireModules(["VSS/Contributions/RestClient"]).spread(function(u){return n.getHttpClient(u.ContributionsHttpClient,t,r,{useNewPlatformSerialization:i})})}function ct(){var n=f.getPageContext(),t=g.getNavigationHistoryService();return{url:window.location.href,routeId:n.navigation.routeId,routeValues:t.getCurrentRouteValues()}}var ot,it,lt,nt,tt,rt,ut,st,ht,et;Object.defineProperty(t,"__esModule",{value:!0});t.ExtensionHelper=t.WebPageDataService=t.WebPageDataProviderError=t.WebPageDataSource=t.ExtensionService=t.ContributionQueryCallbackResult=t.ContributionQueryOptions=t.ContributionReservedAttributeValue=t.ContributionReservedProperties=t.CustomerIntelligenceConstants=void 0,function(n){n.CONTRIBUTIONS_AREA="Microsoft.VisualStudio.Services.Contributions";n.CONTRIBUTIONS_USAGE_FEATURE="ContributionUsage";n.CONTRIBUTIONS_ACTION="Action";n.CONTRIBUTIONS_ACTION_EXECUTE="Execute"}(ot=t.CustomerIntelligenceConstants||(t.CustomerIntelligenceConstants={})),function(n){n.ServiceInstanceTypeProperty="::ServiceInstanceType";n.AttributesProperty="::Attributes";n.BaseUriProperty="::BaseUri";n.FallbackBaseUriProperty="::FallbackBaseUri";n.VersionProperty="::Version";n.RegistrationIdProperty="::RegistrationId"}(it=t.ContributionReservedProperties||(t.ContributionReservedProperties={})),function(n){n[n.BuiltIn=1]="BuiltIn";n[n.MultiVersion=2]="MultiVersion";n[n.Paid=4]="Paid";n[n.Preview=8]="Preview";n[n.Public=16]="Public";n[n.System=32]="System";n[n.Trusted=64]="Trusted"}(lt=t.ContributionReservedAttributeValue||(t.ContributionReservedAttributeValue={})),function(n){n[n.IncludeRoot=1]="IncludeRoot";n[n.IncludeDirectTargets=2]="IncludeDirectTargets";n[n.IncludeRecursiveTargets=4]="IncludeRecursiveTargets";n[n.IncludeAll=7]="IncludeAll";n[n.LocalOnly=8]="LocalOnly"}(nt=t.ContributionQueryOptions||(t.ContributionQueryOptions={})),function(n){n[n.None=0]="None";n[n.Include=1]="Include";n[n.Recurse=2]="Recurse";n[n.IncludeAndRecurse=3]="IncludeAndRecurse"}(tt=t.ContributionQueryCallbackResult||(t.ContributionQueryCallbackResult={}));rt=function(n){function t(){var t=__construct(this,n,[]);for(var i in t)t.hasOwnProperty(i)&&(this[i]=t[i]);return t._clearCachedContributionData(),t}return __extends(t,n),t.prototype._clearCachedContributionData=function(){this._contributionsById={};this._contributionsByTargetId={};this._targetsByUnresolvedContributionId={};this._loadedContributionTargets={};this._contributionQueryPromises={}},t.prototype.initializeConnection=function(t){n.prototype.initializeConnection.call(this,t);this._webPageDataService=this.getConnection().getService(ht);f.getDefaultWebContext()===t.getWebContext()&&this._processJsonIsland()},t.prototype.registerContributions=function(n){var t=this,e,i,r,u,f,o;if(n)for(e=function(n){i._loadedContributionTargets[n.id]=!0;i._contributionsById[n.id]=n;r=i._targetsByUnresolvedContributionId[n.id];r&&r.length>0&&(r.forEach(function(i){t._registerContributionTarget(n,i)}),delete i._targetsByUnresolvedContributionId[n.id]);n.targets&&n.targets.forEach(function(i){t._registerContributionTarget(n,i)});n.includes&&n.includes.forEach(function(i){var u=t._contributionsById[i],r;u?t._registerContributionTarget(u,n.id):(r=t._targetsByUnresolvedContributionId[i],r||(r=[],t._targetsByUnresolvedContributionId[i]=r),r.push(n.id))});n.properties||(n.properties={})},i=this,u=0,f=n;u<f.length;u++)o=f[u],e(o)},t.prototype.getContribution=function(n){return this.getContributions([n],!0,!1).then(function(t){if(t.length===0)throw b.format("Contribution with id '{0}' could not be found.",n);else return t[0]})},t.prototype.getContributionsForTarget=function(n,t){return this.getContributions([n],!1,!0,!1,t)},t.prototype.getLoadedContributionsForTarget=function(n,t){var i=this._contributionsByTargetId[n];return i&&t?i.filter(function(n){return et.isContributionOfType(n,t)}):i},t.prototype.getContributionsForTargets=function(n,t){return this.getContributions(n,!1,!0,!1,t)},t.prototype.getContributions=function(n,t,i,r,u){r===void 0&&(r=!1);u===void 0&&(u=null);var f=0;return t&&(f|=nt.IncludeRoot),i&&(f|=nt.IncludeDirectTargets),r&&(f|=nt.IncludeRecursiveTargets),this.queryContributions(n,f,u)},t.prototype.queryContributions=function(n,r,u,f){var e=this,s,l;if(h.FeatureAvailabilityService.isFeatureEnabled(t._testExecutionFeatureFlag,!1))return i.resolve([]);s=(r&nt.LocalOnly)!=0?[]:this._getUnqueriedContributions(n);var c=i.defer(),a=this._getPendingLoadPromises(n),v=function(){a.length>0?i.all(a).then(function(){e._resolveContributions(e._getLoadedContributions(n,r,u,f)).then(c.resolve,c.reject)},c.reject):e._resolveContributions(e._getLoadedContributions(n,r,u,f)).then(c.resolve,c.reject)};return s=s.filter(function(n){return n!==undefined&&n!==null}),s.length>0?(l=ft(this.getConnection()).then(function(n){var t={contributionIds:s,includeProviderDetails:!0,queryOptions:o.ContributionQueryOptions.IncludeAll,dataProviderContext:{properties:{sourcePage:ct()}}};return n.queryContributionNodes(t).then(function(n){var r=[],t,i;if(n&&n.nodes)for(t in n.nodes)n.nodes.hasOwnProperty(t)&&r.push(n.nodes[t].contribution);if(n&&n.providerDetails)for(i in n.providerDetails)n.providerDetails.hasOwnProperty(i)&&e._registerContributionProviderDetails(n.providerDetails[i]);return r})}),$.each(s,function(n,t){e._contributionQueryPromises[t]=l}),l.then(function(n){$.each(s,function(n,t){e._loadedContributionTargets[t]=!0});e.registerContributions(n);$.each(s,function(n,t){delete e._contributionQueryPromises[t]});v()},function(n){$.each(s,function(n,t){delete e._contributionQueryPromises[t]});c.reject(n)})):v(),c.promise},t.prototype.isExtensionActive=function(n){var t=n.split(".");return ft(this.getConnection()).then(function(n){return n.getInstalledExtensionByName(t[0],t[1]).then(function(n){return n!==null},function(){return!1})})},t.prototype._getProviderIdentifier=function(n){var t=n.id.split(".");return t[0]+"."+t[1]},t.prototype._getProviderDetails=function(n){var t=this._getProviderIdentifier(n);return this._contributionProviderDetailsMap?this._contributionProviderDetailsMap[t]:null},t.prototype.getProviderProperty=function(n,t){var i=this._getProviderDetails(n);return i&&i.properties?i.properties[t]:null},t.prototype.getProviderDisplayName=function(n){var t=this._getProviderDetails(n);return t?t.displayName:null},t.prototype.getVersion=function(n){var t=this._getProviderDetails(n);return t&&t.properties?t.properties[it.VersionProperty]:null},t.prototype.getRegistrationId=function(n){var t=this._getProviderDetails(n);return t&&t.properties?t.properties[it.RegistrationIdProperty]:null},t.prototype.getBaseUri=function(n){var t=this._getProviderDetails(n);return t&&t.properties?t.properties[it.BaseUriProperty]:null},t.prototype.getFallbackUri=function(n){var t=this._getProviderDetails(n);return t&&t.properties?t.properties[it.FallbackBaseUriProperty]:null},t.prototype.getServiceInstanceType=function(n){var t=this._getProviderDetails(n);return t&&t.properties?t.properties[it.ServiceInstanceTypeProperty]:null},t.prototype._resolveContributions=function(n){if(!n.length)return i.resolve(n);var t=this._getLoadedContributions(n.map(function(n){return n.id}),nt.IncludeAll,r.DataProviderConstants.DataProviderContributionTypeId);return t.length?this._webPageDataService.ensureDataProvidersResolved(t).then(function(){return n}):i.resolve(n)},t.prototype._getUnqueriedContributions=function(n){var t=this;return $.grep(n,function(n){return t._loadedContributionTargets[n]||t._contributionQueryPromises[n]?!1:!0})},t.prototype._getPendingLoadPromises=function(n){var i=this,t=[];return $.each(n,function(n,r){var u=i._contributionQueryPromises[r];u&&t.push(u)}),t},t.prototype._getLoadedContributions=function(n,t,i,r){var e=this,u=[],f={},o=[],s;return $.each(n,function(n,s){var c=e._contributionsById[s],h;c&&!f[s]&&(h=tt.None,r==null?((t&nt.IncludeRoot)!=0&&(h|=tt.Include),((t&nt.IncludeDirectTargets)!=0||(t&nt.IncludeRecursiveTargets)!=0)&&(h|=tt.Recurse)):h=r(c),f[s]=!0,(h&tt.Include)!=0&&(!i||et.isContributionOfType(c,i))&&u.push(c),(h&tt.Recurse)!=0&&o.push(s))}),s=r==null?(t&nt.IncludeRecursiveTargets)!=0?function(){return tt.IncludeAndRecurse}:function(){return tt.Include}:r,$.each(o,function(n,t){e._fetchTargetingContributions(t,u,f,s,i)}),u},t.prototype._fetchTargetingContributions=function(n,t,i,r,u){var e=this,f=this._contributionsByTargetId[n];f&&$.each(f,function(n,f){var o=f.id,s;i[o]||(i[o]=!0,s=r(f),(s&tt.Include)!=0&&(!u||et.isContributionOfType(f,u))&&t.push(f),(s&tt.Recurse)!=0&&e._fetchTargetingContributions(o,t,i,r,u))})},t.prototype._processJsonIsland=function(){var n=v.deserializeJsonIsland($(".vss-contribution-data"),null);n&&this.registerContributionData(n)},t.prototype.registerContributionData=function(n,t){var i,r,u;if(t&&this._clearCachedContributionData(),n.contributions&&n.contributions.length&&this.registerContributions(n.contributions),n.queriedContributionIds)for(i=0,r=n.queriedContributionIds;i<r.length;i++)u=r[i],this._loadedContributionTargets[u]=!0;n.providerDetails&&(this._contributionProviderDetailsMap=n.providerDetails)},t.prototype._registerContributionTarget=function(n,t){var i=this._contributionsByTargetId[t];i||(i=[],this._contributionsByTargetId[t]=i);i.indexOf(n)<0&&i.push(n)},t.prototype._registerContributionProviderDetails=function(n){this._contributionProviderDetailsMap||(this._contributionProviderDetailsMap={});this._contributionProviderDetailsMap[n.name]=n},t.prototype.getLoadedContributionsOfType=function(n){var i=[],r,t;for(r in this._contributionsById)t=this._contributionsById[r],b.equals(n,t.type)&&i.push(t);return this._resolveContributions(i)},t._testExecutionFeatureFlag="VisualStudio.Services.Contribution.TestExecution",t}(y.VssService);t.ExtensionService=rt,function(n){n[n.JsonIsland=0]="JsonIsland";n[n.RestCall=1]="RestCall";n[n.LocalStorage=2]="LocalStorage"}(ut=t.WebPageDataSource||(t.WebPageDataSource={}));st=function(n){function t(t,i){var r=__construct(this,n,[t]);for(var u in r)r.hasOwnProperty(u)&&(this[u]=r[u]);return r.exceptionDetails=i,r}return __extends(t,n),t}(Error);t.WebPageDataProviderError=st;ht=function(n){function t(){var t=__construct(this,n,arguments);for(var i in t)t.hasOwnProperty(i)&&(this[i]=t[i]);return t._localDataSource={},t._resolvedProviders={},t._contributionPromises={},t._contributionIdsByDataType={},t._dataProviderInitialized={},t}return __extends(t,n),t.prototype._ensureInitialized=function(n){var o=this,t=n?__spreadArray([],n,!0):[],u,f,e;return t=t.filter(function(n){return!o._dataProviderInitialized[n.id]}),(!this._initializationPromise||t.length>0)&&(u=c.getDataProviderResults(),u?(f=v.deserializeJsonIsland($(".vss-contribution-data"),null),e=f?f.contributions:[],e.forEach(function(n){b.equals(n.type,r.DataProviderConstants.DataProviderContributionTypeId,!0)&&t.push(n)}),this._initializationPromise=this._handleDataProviderResult(u,t,ut.JsonIsland)):this._initializationPromise=i.resolve(null)),this._initializationPromise},t.prototype.registerProviderData=function(n,t,i){var o=[],u,f,e;if(t)for(u=0,f=t;u<f.length;u++)e=f[u],b.equals(e.type,r.DataProviderConstants.DataProviderContributionTypeId,!0)&&o.push(e);return i&&this._clearCachedDataProviders(),c.addDataProviderResults(n),this._handleDataProviderResult(n,o,ut.JsonIsland)},t.prototype._clearCachedDataProviders=function(){this._resolvedProviders={};this._localDataSource={};this._contributionIdsByDataType={};this._contributionPromises={};this._dataProviderInitialized={};c.clearDataProviderResults()},t.prototype._handleDataProviderResult=function(n,u,f){var e=this,c,l,v,o,y,h;if(n.data)if(n.resolvedProviders)n.resolvedProviders.forEach(function(n){e._resolvedProviders[n.id]=n;n.error&&s.logWarning(b.format(a.DataProviderFailureMessageFormat,n.id,n.error))});else for(c in n.data)this._resolvedProviders[c]=n.data[c];if(l=[],n.data){for(v={},o=0,y=u;o<y.length;o++)h=y[o],this._dataProviderInitialized[h.id]=!0,v[h.id]=h;$.each(n.data,function(n,u){var a,h,o,y,c=v[n],s,p;c&&c.properties&&(o=c.properties[r.DataProviderConstants.ContributionDataTypeProperty],y=c.properties.caching);!o&&u&&n==="ms.vss-releaseManagement-web.release-service-data-external"&&(o="ServiceContext");o&&(s=e._contributionIdsByDataType[o],s||(s=[],e._contributionIdsByDataType[o]=s),s.push(n),a=t._resolveDataPlugins[o]);e._localDataSource[n]=f;a&&(h=a(n,u));i.isPromise(h)?(p=h.then(function(t){e._storeDataProviderData(n,u,t,y)}),l.push(p)):e._storeDataProviderData(n,u,h,y)})}return i.allSettled(l)},t.prototype._storeDataProviderData=function(n,t,i,r){var u=typeof i=="undefined"?t:i;r&&this._setCachedDataProviderValue(n,u,r)},t.prototype._getLocalStorageCacheScope=function(n){if(n&&n.mode==="localStorage"){var t=this.getWebContext(),i="";switch(n.scope){case"team":i=t.team?t.team.id:"";break;case"project":i=t.project?t.project.id:"";break;case"collection":i=t.collection?t.collection.id:""}if(i)return{scopeId:i,storageEntryName:"dataProviderCache-"+n.scope}}return null},t.prototype._getLocalStorageCacheEntry=function(n){var i,t;try{t=window.localStorage.getItem(n);t&&(i=JSON.parse(t))}catch(r){s.logWarning('Could not parse DataProvider localStorage entry "'.concat(t,'": ').concat(r.message))}return i},t.prototype._isDataExpired=function(n){var u=n.properties.caching,t,i,f,r,e,o;return u&&(t=u.maxCacheLifetimeMinutes||0,t>0&&(t=t*6e4,i=this._getLocalStorageCacheScope(u),i&&(f=this._getLocalStorageCacheEntry(i.storageEntryName),f&&(r=f[i.scopeId],r&&r.dataLastAccessed&&(e=r.dataLastAccessed[n.id],e)))))?(o=(new Date).getTime(),o-e>t):!0},t.prototype._getCachedDataProviderValue=function(n){var u=n.properties.caching,t,r,i;return u&&(t=this._getLocalStorageCacheScope(u),t&&(r=this._getLocalStorageCacheEntry(t.storageEntryName),r&&(i=r[t.scopeId],i&&i.data)))?i.data[n.id]:null},t.prototype._setCachedDataProviderValue=function(n,i,r){var e=this._getLocalStorageCacheScope(r),f,u,h,c,y,o,l,a,v;if(e){if(f=this._getLocalStorageCacheEntry(e.storageEntryName),f||(f={}),u=f[e.scopeId],!u){if(u={},h=Object.keys(f),h.length>=t.MAX_CACHE_SCOPES)for(c=h.map(function(n){return{id:n,value:f[n]||{}}}),c.sort(function(n,t){return(t.value.lastAccess||0)-(n.value.lastAccess||0)}),y=c.slice(0,t.MAX_CACHE_SCOPES-1),f={},o=0,l=y;o<l.length;o++)a=l[o],f[a.id]=a.value;f[e.scopeId]=u}u.data||(u.data={});v=(new Date).getTime();u.lastAccess=v;u.data[n]=i;r&&r.maxCacheLifetimeMinutes&&(u.dataLastAccessed||(u.dataLastAccessed={}),typeof i=="undefined"?delete u.dataLastAccessed[n]:u.dataLastAccessed[n]=v);try{window.localStorage.setItem(e.storageEntryName,JSON.stringify(f))}catch(p){s.logWarning("Could not write to localStorage. Key=".concat(e.storageEntryName,". Error=").concat(p,"."))}}},t.addResolutionPlugin=function(n,i){t._resolveDataPlugins[n]=i},t.removeResolutionPlugin=function(n){delete t._resolveDataPlugins[n]},t.prototype.getPageData=function(n,t){return this._ensureInitialized(),c.getData(n,t)},t.prototype.removePageData=function(n){for(var f=Object.keys(this._contributionIdsByDataType),t=0,i=f;t<i.length;t++){var e=i[t],r=this._contributionIdsByDataType[e],u=r.indexOf(n);u>=0&&r.splice(u,1)}delete this._localDataSource[n];delete this._contributionPromises[n];delete this._resolvedProviders[n];c.removeData(n)},t.prototype.getPageDataSource=function(n){return this._localDataSource[n]},t.prototype.getPageDataByDataType=function(n,t){var e={},r,i,u,f;if(this._ensureInitialized(),r=this._contributionIdsByDataType[n],r)for(i=0,u=r;i<u.length;i++)f=u[i],e[f]=this.getPageData(f,t);return e},t.prototype.getRemoteDataAsync=function(n,t,i,r,u){return __awaiter(this,void 0,void 0,function(){var s,e,o;return __generator(this,function(h){switch(h.label){case 0:return r=r||f.getPageContext().serviceInstanceId,[4,ft(this.getConnection(),r,!!window.LWL,i)];case 1:return s=h.sent(),[4,s.queryDataProviders({contributionIds:[n],context:{properties:u}},t.name,t.value)];case 2:if(e=h.sent(),e&&e.exceptions&&e.exceptions[n]){o=e.exceptions[n];throw new st(o.message,o);}return[2,e&&e.data[n]]}})})},t.prototype.getDataAsync=function(n,t,i){return __awaiter(this,void 0,void 0,function(){var o,s,u,r,e;return __generator(this,function(h){switch(h.label){case 0:return t=t||f.getPageContext().serviceInstanceId,[4,ft(this.getConnection(),t,!!window.LWL)];case 1:return o=h.sent(),s=Object.assign({},i,{pageSource:this.getPageSource(),sourcePage:ct()}),u=c.getDataProviderScope(),[4,o.queryDataProviders({contributionIds:[n],context:{properties:s}},u.name,u.value)];case 2:if(r=h.sent(),r&&r.exceptions&&r.exceptions[n]){e=r.exceptions[n];throw new st(e.message,e);}return[2,r&&r.data[n]]}})})},t.prototype.ensureDataProvidersResolved=function(n,t,u){var f=this;return this._ensureInitialized(n).then(function(){var o={},e;return t||(n=n.filter(function(n){return!f._resolvedProviders[n.id]})),e=[],n.forEach(function(n){var v=t&&f._isDataExpired(n),y=!v&&f._contributionPromises[n.id],s,i,h,a,u;y?e.push(y):(s=!v&&f._getCachedDataProviderValue(n),s?(c.overrideData(n.id,s),f._localDataSource[n.id]=ut.LocalStorage,f._resolvedProviders[n.id]={id:n.id}):(i=(n.properties[r.DataProviderConstants.ContributionInstanceTypeProperty]||"").toLowerCase(),i||(h=n.properties.resourceAreaId||"",h&&(a=l.getLWPService("IVssLocationService"),a&&(i=a.getServiceInstanceTypeForResourceArea(h)||""))),u=o[i],u||(u=[],o[i]=u),u.push(n)))}),$.each(o,function(n,t){var i=f.fetchPageDataForService(n,t,u);t.forEach(function(n){f._contributionPromises[n.id]=i});e.push(i)}),i.allSettled(e)})},t.prototype.fetchPageDataForService=function(n,t,i){var f=this,u,r;return i=i||{},i.pageSource=this.getPageSource(),i.sourcePage=ct(),u={contributionIds:t.map(function(n){return n.id}),context:{properties:i}},r=c.getDataProviderScope(),ft(this.getConnection(),n,!!window.LWL).then(function(n){return n.queryDataProviders(u,r.name,r.value).then(function(n){return c.addDataProviderResults(n),f._handleDataProviderResult(n,t,ut.RestCall)})})},t.prototype.getPageSource=function(){var n=f.getPageContext(),t=y.getLocalService(d.HubsService),i=g.getNavigationHistoryService();return{contributionPaths:n.moduleLoaderConfig.contributionPaths?Object.keys(n.moduleLoaderConfig.contributionPaths):null,diagnostics:n.diagnostics,navigation:__assign(__assign({},n.navigation),{routeValues:i.getCurrentRouteValues()}),project:n.webContext.project,selectedHubGroupId:t.getSelectedHubGroupId(),selectedHubId:t.getSelectedHubId(),team:n.webContext.team,url:window.location.href}},t.prototype.getCachedPageData=function(n,t,i,r,u){i===void 0&&(i=!0);var e,f;return t&&(f=this.getPageData(t,r),f&&(e=this.getPageDataSource(t))),f||(f=this.getPageData(n,r),e=this.getPageDataSource(n)),i&&e===ut.LocalStorage&&this.reloadCachedProviderData(n,u),f},t.prototype.reloadCachedProviderData=function(n,t,i,r){var u=this,f=y.getService(rt),e=function(n,t){if(n||t)if(n&&t)try{return JSON.stringify(n)===JSON.stringify(t)}catch(i){return!1}else return!1;else return!0},o=this.getPageData(n);f.getContribution(n).then(function(f){u.ensureDataProvidersResolved([f],!0,i).then(function(){var f=u.getPageData(n),i;t&&!e(o,f)?t():(i=u._resolvedProviders[n],i&&i.error&&r&&r(i.error))})})},t.prototype.invalidateCachedProviderData=function(n,t){var i=this,r;return t===void 0&&(t=!1),r=y.getService(rt),r.getContribution(n).then(function(n){var r=n.properties.caching;return r&&r.mode=="localStorage"&&i._setCachedDataProviderValue(n.id,undefined,r),t?i.ensureDataProvidersResolved([n],!0):null})},t.MAX_CACHE_SCOPES=20,t._resolveDataPlugins={},t}(y.VssService);t.WebPageDataService=ht;ht.addResolutionPlugin(r.ContributedServiceContextData.ContributedServiceDataProviderType,function(n,t){if(t){var i=v.ContractSerializer.deserialize(t,e.TypeInfo.ContributedServiceContext);return f.processContributedServiceContext(i)}});et=function(){function n(){}return n.getFullContributionId=function(n){return n.id},n.getExtensionId=function(n){return n.id.split(".")[1]},n.getPublisherId=function(n){return n.id.split(".")[0]},n.isContributionOfType=function(n,t){return b.equals(n.type,t,!0)},n.isContributionTrusted=function(n){var t=n.properties[it.AttributesProperty];return t&&(t&lt.Trusted)!=0},n.hasInternalContent=function(t){return n.isContributionTrusted(t)&&!!t.properties.content},n.hasContent=function(t,i){return i===void 0&&(i="uri"),!!t.properties[i]||n.hasInternalContent(t)},n.resolveTemplateString=function(n,t){var r=i.defer();return n?(t||(t={}),t&&n.indexOf("{{")>=0?k.using(["mustache"],function(i){try{n=i.render(n,t)}catch(u){}r.resolve(n)}):r.resolve(n),r.promise):i.resolve(n)},n.resolveUriTemplate=function(t,r,u){var f=i.defer();return this.resolveTemplateString(t,r).then(function(t){n._httpUrlRegex.test(t)||!u?f.resolve(t):n.resolveTemplateString(u,r).then(function(n){f.resolve(w.combinePaths(n,t))},f.reject)},f.reject),f.promise},n.resolveUriTemplateProperty=function(t,r,f,e){var o;if(f===void 0&&(f="uri"),e===void 0&&(e=null),o=t.properties[f],typeof o=="undefined")return i.resolve(null);var s=y.getService(rt),h=s.getServiceInstanceType(t),c=s.getBaseUri(t);return h&&(r=r||{},r[u.ExtensionTemplateContextItemNames.ServiceInstanceType]=h),n.resolveUriTemplate(o,r,e||c)},n.publishTraceData=function(t,i,r){t?n.publishData(t,i):r&&y.getService(rt).getContribution(r).then(function(t){t&&n.publishData(t,i)})},n.publishData=function(t,i){var r=n.getPublisherId(t),u={Action:ot.CONTRIBUTIONS_ACTION_EXECUTE,PublisherId:r,ExtensionId:r+"."+n.getExtensionId(t),ContributionId:t.id,ContributionData:i,Type:t.type};p.publishEvent(new p.TelemetryEventData(ot.CONTRIBUTIONS_AREA,ot.CONTRIBUTIONS_USAGE_FEATURE,u))},n._httpUrlRegex=/^[a-z][a-z0-9+.-]*:/i,n}();t.ExtensionHelper=et;k.tfsModuleLoaded("VSS.Contributions",t)});

define("VSS/Controls/Notifications",["require","exports","VSS/Controls","VSS/Diag","VSS/Events/Services","VSS/Resources/VSS.Resources.Platform","VSS/Utils/Core","VSS/Utils/String","VSS/Utils/UI","VSS/LoaderPlugins/Css!VSS.Controls"],function(n,t,i,r,u,f,e,o,s){var a,h,c,v,l,y,p,w;Object.defineProperty(t,"__esModule",{value:!0});t.ToastNotification=t.InformationAreaControl=t.InformationAreaControlO=t.MessageAreaControl=t.MessageAreaControlO=t.MessageAreaType=void 0;a=e.delegate;h=s.domElem,function(n){n[n.None=0]="None";n[n.Info=1]="Info";n[n.Warning=2]="Warning";n[n.Error=3]="Error"}(c=t.MessageAreaType||(t.MessageAreaType={}));v=function(n){function t(){var t=__construct(this,n,arguments);for(var i in t)t.hasOwnProperty(i)&&(this[i]=t[i]);return t}return __extends(t,n),t.prototype.initializeOptions=function(t){n.prototype.initializeOptions.call(this,$.extend({closeable:!0,expanded:!1,showIcon:!1,showDetailsLink:!0,showHeader:!0,noHeaderNoLinkJustIcon:!1},t))},t.prototype.initialize=function(){var n,e=this,r,t,u;this.getElement().addClass("message-area-control");this.getElement().addClass("bowtie");this.getElement().attr("role","alert");r=this._options.message?this._options.message.type:this._options.type;this._options.showIcon&&(this._iconDiv=$(h("div")).appendTo(this.getElement()).addClass("message-icon"),$("<span/>").addClass("bowtie-icon").appendTo(this._iconDiv),this._setMessageTypeIcon(r));this._options.showHeader&&(n=$(h("div")).appendTo(this.getElement()).addClass("message-header"),this._errorHeader=$(h("span")).appendTo(n));t=""+i.getId();this._errorContent=$(h("div")).attr("id",t).appendTo(this.getElement());this._options.noHeaderNoLinkJustIcon||this._errorContent.addClass("error-content");this._options.showDetailsLink&&(this._showErrorLink=$(h("a")).appendTo(n).addClass("linkAction show-details-action").attr({href:"#",role:"button","aria-controls":t}).click(function(){return e._toggle(),!1}));u=$(h("div")).appendTo(this.getElement()).addClass("close-action bowtie-icon bowtie-navigate-close ").attr({"aria-label":f.MessageAreaControl_CrossIconTooltip,role:"button"}).click(a(this,this._onCloseIconClicked));s.accessible(u,a(this,this._onCloseIconClicked));this.getElement().hide();this._messageType=c.None;this._options.message&&this.setMessage(this._options.message);this._options.fillVertical&&this.getElement().css("height","100%")},t.prototype.setMessage=function(n,t){(typeof n=="string"||n&&n.jquery)&&(n={header:n});n.type||(n.type=t||c.Error);this._setDisplayMessage(n)},t.prototype.setError=function(n,t){(typeof n=="string"||n&&n.jquery)&&(n={header:n});n.type=c.Error;n.click||typeof t!="function"||(n.click=t);this.setMessage(n)},t.prototype.getMessageType=function(){return this._messageType},t.prototype.clear=function(){this._clear(!0)},t.prototype._setDisplayMessage=function(n){var i=this,t;this._options.closeable?this.getElement().addClass("closeable"):this.getElement().removeClass("closeable");this._clear(!1);this._messageType=this._options.message&&this._options.message.type?this._options.message.type:n.type;this._options.showHeader&&(n.header&&n.header.jquery?this._errorHeader.append(n.header):this._errorHeader.text(n.header));n.content?(n.content.jquery?this._errorContent.append(n.content):this._errorContent.text(n.content),this._options.showDetailsLink&&(this.setErrorDetailsVisibility(this._options.expanded),this._showErrorLink.show())):(this._errorContent.hide(),this._options.showDetailsLink&&this._showErrorLink.hide());switch(this._messageType){case c.Info:this.getElement().addClass("info-message");break;case c.Warning:this.getElement().addClass("warning-message");break;case c.Error:this.getElement().addClass("error-message")}this._setMessageTypeIcon(this._messageType);this._options.hidden||(this.getElement().addClass("visible"),this.getElement().show());n.click&&(t=function(){n.click();i.clear()},this._errorHeader.addClass("clickable"),this._errorHeader.click(t),this._errorHeader.keydown(function(n){if(n.keyCode===s.KeyCode.ENTER)return t(),!1}));this._raiseDisplayComplete()},t.prototype._onCloseIconClicked=function(){this.clear();this._fire(l.EVENT_CLOSE_ICON_CLICKED)},t.prototype._setMessageTypeIcon=function(n){if(this._options.showIcon)if(n===c.None)this._iconDiv.hide();else{var t=$(".bowtie-icon",this._iconDiv);t.toggleClass("bowtie-status-info-outline",n===c.Info);t.toggleClass("bowtie-status-warning",n===c.Warning);t.toggleClass("bowtie-status-failure",n===c.Error);this._iconDiv.show()}},t.prototype._toggle=function(){this._errorContent.is(":visible")?(this.setErrorDetailsVisibility(!1),this._fire(l.ERROR_DETAILS_TOGGLED,{show:!1})):(this.setErrorDetailsVisibility(!0),this._fire(l.ERROR_DETAILS_TOGGLED,{show:!0}));this._raiseDisplayComplete()},t.prototype.setErrorDetailsVisibility=function(n){n?(this._showErrorLink.text(f.HideDetails).attr("aria-expanded","true"),this._errorContent.show()):(this._showErrorLink.text(f.ShowDetails).attr("aria-expanded","false"),this._errorContent.hide())},t.prototype._clear=function(n){if(this._options.showHeader){if(this._errorHeader.text().length===0)return;this._errorHeader.text("");this._errorHeader.off("click");this._errorHeader.removeClass("clickable")}switch(this._messageType){case c.Info:this.getElement().removeClass("info-message");break;case c.Warning:this.getElement().removeClass("warning-message");break;case c.Error:this.getElement().removeClass("error-message")}this._messageType=c.None;this._errorContent.text("");this.getElement().removeClass("visible");this.getElement().hide();n&&this._raiseDisplayComplete();this._fire(l.EVENT_DISPLAY_CLEARED);u.getService().fire(l.EVENT_DISPLAY_CLEARED)},t.prototype._raiseDisplayComplete=function(){this._fire(l.EVENT_DISPLAY_COMPLETE)},t.EVENT_CLOSE_ICON_CLICKED="event-close-icon-clicked",t.EVENT_DISPLAY_COMPLETE="event-display-complete",t.EVENT_DISPLAY_CLEARED="event-display-cleared",t.ERROR_DETAILS_TOGGLED="error-details-toggled",t}(i.Control);t.MessageAreaControlO=v;l=function(n){function t(){var t=__construct(this,n,arguments);for(var i in t)t.hasOwnProperty(i)&&(this[i]=t[i]);return t}return __extends(t,n),t}(v);t.MessageAreaControl=l;y=function(n){function t(){var t=__construct(this,n,arguments);for(var i in t)t.hasOwnProperty(i)&&(this[i]=t[i]);return t}return __extends(t,n),t.prototype.initializeOptions=function(t){t&&(this._collapsed=!!t.collapsed);n.prototype.initializeOptions.call(this,$.extend({coreCssClass:"information-area-control",expandedIconClass:"content-expanded",collapsedIconClass:"content-collapsed"},t))},t.prototype.initialize=function(){var n=this,i=this,t=$(h("div","information-header")).appendTo(this.getElement()).click(function(){n._updateCollapsedState(!n._collapsed)});this._$collapseIndicator=$(h("div","icon collapse-indicator")).attr("role","button").attr("tabindex","0").keydown(s.buttonKeydownHandler).appendTo(t);this._$caption=$(h("div","information-caption")).appendTo(t).text(this._options.caption);this._$content=$(h("div","information-content")).appendTo(this.getElement());this._updateCollapsedState(this._collapsed)},t.prototype.appendDetailHeaderContent=function(n){$(h("div","detail-header")).appendTo(this._$content).append(n)},t.prototype.appendDetailContent=function(n){$(h("div","detail-content")).appendTo(this._$content).append(n)},t.prototype.appendCodeContent=function(n){$(h("div","code-content")).appendTo(this._$content).append(n)},t.prototype.appendDetailHeaderHtml=function(n){$(h("div","detail-header")).appendTo(this._$content).html(n)},t.prototype.appendDetailHtml=function(n){$(h("div","detail-content")).appendTo(this._$content).html(n)},t.prototype.appendCodeHtml=function(n){$(h("div","code-content")).appendTo(this._$content).html(n)},t.prototype._updateCollapsedState=function(n){n?(this._$collapseIndicator.removeClass(this._options.expandedIconClass),this._$collapseIndicator.addClass(this._options.collapsedIconClass),this._$collapseIndicator.attr("aria-label",o.format(f.InformationAreaControlExpand,this._options.caption)),this._$collapseIndicator.attr("aria-expanded","false"),this._$content.hide()):(this._$collapseIndicator.removeClass(this._options.collapsedIconClass),this._$collapseIndicator.addClass(this._options.expandedIconClass),this._$collapseIndicator.attr("aria-label",o.format(f.InformationAreaControlCollapse,this._options.caption)),this._$collapseIndicator.attr("aria-expanded","true"),this._$content.show());this._collapsed=n},t}(i.Control);t.InformationAreaControlO=y;p=function(n){function t(){var t=__construct(this,n,arguments);for(var i in t)t.hasOwnProperty(i)&&(this[i]=t[i]);return t}return __extends(t,n),t}(y);t.InformationAreaControl=p;w=function(n){function t(t){return n.call(this,t)||this}return __extends(t,n),t.prototype.initialize=function(){var t=this,n=this.getElement(),r;n.hide();this._processOptions();r=$("<div/>").appendTo(n);this._messageArea=i.Enhancement.enhance(l,r,{closeable:!1,fillVertical:!0});this._toasting=!1;this._bind(n,"mouseover",function(){t._delayedFunction.cancel();n.stop(!0);n.fadeIn(0)});this._bind(n,"mouseout",function(){t._delayedFunction=e.delay(t,t._toastTime,function(){n.fadeOut(t._fadeOutTime,function(){t._toasting=!1})})})},t.prototype.initializeOptions=function(t){n.prototype.initializeOptions.call(this,$.extend({coreCssClass:"toast-notification"},t))},t.prototype._processOptions=function(){var n=this._getOptions(),t=this.getElement();t.width(n.width);t.css("min-height",n.minHeight);this._fadeInTime=n.fadeInTime;this._fadeOutTime=n.fadeOutTime;this._toastTime=n.toastTime},t.prototype._getOptions=function(){return $.extend(this._getDefaultOptions(),this._options)},t.prototype._getDefaultOptions=function(){return{width:280,fadeInTime:1e3,fadeOutTime:1e3,toastTime:5e3}},t.prototype.toast=function(n,t){var r=this,i;t===void 0&&(t=c.Info);this._ensureNoActiveToast();this._toasting=!0;this._messageArea.setMessage(n,t);i=this.getElement();i.fadeIn(this._fadeInTime);this._delayedFunction=e.delay(this,this._toastTime,function(){i.fadeOut(r._fadeOutTime,function(){r._toasting=!1})})},t.prototype._ensureNoActiveToast=function(){this._toasting&&(this.getElement().stop().hide(),this._delayedFunction.cancel())},t}(i.BaseControl);t.ToastNotification=w});

define("VSS/SDK/Host",["require","exports","VSS/Context","VSS/Contributions/Services","VSS/Service","VSS/VSS"],function(n,t,i,r,u,f){Object.defineProperty(t,"__esModule",{value:!0});t.HostManagementService=void 0;var e=function(){function n(n){this._serviceOptions=n}return n.prototype.getContribution=function(n){return u.getService(r.ExtensionService).getContribution(n)},n.prototype.getContributionsForTarget=function(n){return u.getService(r.ExtensionService).getContributionsForTarget(n)},n.prototype.getServiceContribution=function(n){var t=this;return this.getContribution(n).then(function(n){return $.extend({getInstance:function(i,r){return t.getBackgroundContributionInstance(n,i,r)}},n)})},n.prototype.getServiceContributions=function(n){var t=this;return this.getContributionsForTarget(n).then(function(n){return $.map(n,function(n){return $.extend({getInstance:function(i,r){return t.getBackgroundContributionInstance(n,i,r)}},n)})})},n.prototype.getBackgroundContributionInstance=function(n,t,r){var u=this;return f.requireModules(["VSS/Contributions/Controls"]).spread(function(f){return f.getBackgroundInstance(n,t||n.id,$.extend(r,{hostManagementServiceOptions:u._serviceOptions}),i.getPageContext().webContext)})},n}();t.HostManagementService=e});

define("VSS/Utils/Accessibility",["require","exports","VSS/Diag","VSS/Utils/Core"],function(n,t,i,r){function v(){var n=document.getElementById(e);return n||(n=document.createElement("div"),n.id=e,n.classList.add("visually-hidden"),document.body.appendChild(n)),n}function f(n,t){var y;if(t===void 0&&(t=!1),n){var s=t?"assertive":"polite",h=v(),o=h.getElementsByClassName(s),u=o.length>0?o[o.length-1]:null;!u||u.childElementCount>=c?(u=document.createElement("div"),u.id=e+"-old"+a++,u.setAttribute("aria-live",s),u.classList.add(s),u.setAttribute("aria-relevant","additions"),h.appendChild(u),o.length>l&&h.removeChild(o[0]),r.delay(this,10,function(){f(n,t)})):(i.log(i.LogVerbosity.Info,"announce (".concat(s,"): ").concat(n)),y=document.createElement("p"),y.textContent=n,u.appendChild(y),u.style.visibility="hidden",u.style.visibility="visible")}}var u,s,h;Object.defineProperty(t,"__esModule",{value:!0});t.ProgressAnnouncer=t.MultiProgressAnnouncer=t.announce=void 0;var c=1,l=10,e="utils-accessibility-announce",o=1e3,a=0;t.announce=f,function(n){n[n.Idle=0]="Idle";n[n.WaitingForStartAnnouncement=1]="WaitingForStartAnnouncement";n[n.Running=2]="Running";n[n.WaitingForEndAnnouncement=3]="WaitingForEndAnnouncement"}(u||(u={}));s=function(){function n(n){this._state=u.Idle;this._options=n}return n.prototype.update=function(){var n=this._options.getActiveCount();switch(this._state){case u.Idle:n>0&&(this._startAnnounceTimer(this._options.announceStartDelay,this._options.announceStartMessage,u.Running),this._state=u.WaitingForStartAnnouncement);break;case u.WaitingForStartAnnouncement:n===0&&(this._cancelAnnounceTimer(),this._state=u.Idle);break;case u.Running:n===0&&(this._startAnnounceTimer(this._options.announceEndDelay,this._options.announceEndMessage,u.Idle),this._state=u.WaitingForEndAnnouncement);break;case u.WaitingForEndAnnouncement:n>0&&(this._cancelAnnounceTimer(),this._state=u.Running)}},n.prototype._startAnnounceTimer=function(n,t,i){var u=this;this._announceDelay&&this._cancelAnnounceTimer();this._announceDelay=r.delay(this,n!==undefined?n:o,function(){f(t);u._state=i;u._announceDelay=null})},n.prototype._cancelAnnounceTimer=function(){this._announceDelay.cancel();this._announceDelay=null},n}();t.MultiProgressAnnouncer=s;h=function(){function n(n){this._startAnnounced=!1;this._completed=!1;this._options=n;this._start()}return n.forPromise=function(t,i){var r=new n(i);t.then(function(){r.announceCompleted()},function(){r.announceError()})},n.prototype._start=function(){var n=this;this._announceDelay=r.delay(this,this._options.announceStartDelay!==undefined?this._options.announceStartDelay:o,function(){f(n._options.announceStartMessage);n._startAnnounced=!0})},n.prototype.announceCompleted=function(){this._completed||(this._completed=!0,(this._startAnnounced||this._options.alwaysAnnounceEnd)&&f(this._options.announceEndMessage),this._startAnnounced||this._announceDelay.cancel())},n.prototype.announceError=function(){this._completed||(this._completed=!0,f(this._options.announceErrorMessage),this._startAnnounced||this._announceDelay.cancel())},n}();t.ProgressAnnouncer=h});

define("VSS/Controls/StatusIndicator",["require","exports","VSS/Controls","VSS/Diag","VSS/Locations","VSS/Resources/VSS.Resources.Platform","VSS/Utils/Accessibility","VSS/Utils/Core","VSS/Utils/String","VSS/Utils/UI","VSS/LoaderPlugins/Css!VSS.Controls"],function(n,t,i,r,u,f,e,o,s,h){var l,v,y,w,c,p,a;Object.defineProperty(t,"__esModule",{value:!0});t.WaitControl=t.WaitControlO=t.WaitingState=t.LongRunningOperation=t.StatusIndicator=t.StatusIndicatorO=void 0;l=o.delegate;v=function(n){function t(){var t=__construct(this,n,arguments);for(var i in t)t.hasOwnProperty(i)&&(this[i]=t[i]);return t._active=!1,t}return __extends(t,n),t.getActiveCount=function(){for(var i,r=0,n=0,u=t._allIndicators;n<u.length;n++)i=u[n],i.isActive()&&i._options.announceProgress!==!1&&r++;return r},t.prototype.isActive=function(){return this._active&&this._element.is(":visible")},t.prototype.initializeOptions=function(t){n.prototype.initializeOptions.call(this,$.extend({coreCssClass:"status-indicator"},t))},t.prototype.initialize=function(){n.prototype.initialize.call(this);this._options.center===!0&&this.getElement().addClass("center");this._throttleMinTime=this._options.throttleMinTime||100;this._bindEvents();t._allIndicators.push(this)},t.prototype._dispose=function(){var i=t._allIndicators.indexOf(this);i>=0&&t._allIndicators.splice(i,1);t._announcer.update();this._clearTimeout();n.prototype._dispose.call(this)},t.prototype.start=function(n){this._clearTimeout();$.extend(this._options,n);this._start()},t.prototype.delayStart=function(n){this._delayStart&&this._delayStart.cancel();this._delayStart=o.delay(this,n,this._start)},t.prototype.complete=function(){this._delayStart&&(this._delayStart.cancel(),this._delayStart=null);this._clearTimeout();this.hideElement();this._active=!1;t._announcer.update()},t.prototype.error=function(n){this._lastError=n;this._clearTimeout();this.hideElement()},t.prototype.setMessage=function(n){var t=this.getElement().find("#indicator_message");t.text(n)},t.prototype.showElement=function(){this.getElement().css("display","")},t.prototype.hideElement=function(){this.getElement().css("display","none")},t.prototype._draw=function(){var n=this.getElement(),t;if(this.hideElement(),n.empty(),this._statusDiv=$("<div />").appendTo(n).addClass("status").attr("aria-busy","true"),this._options.center){var r=$("<table />").appendTo(this._statusDiv),u=$("<tr />").appendTo(r),i=$("<td />").appendTo(u);this._image=$("<span />").appendTo(i);t=i}else this._statusDiv.addClass("status-inline"),n.addClass("inline"),this._image=$("<span />").appendTo(n),t=n;this._setImageClass();this._options.message&&$("<span id='indicator_message' />").appendTo(t).text(this._options.message)},t.prototype._start=function(){this._statusDiv?this._setImageClass():this._draw();this._active=!0;this.showElement();t._announcer.update()},t.prototype._setImageClass=function(){this._image.removeClass();this._options.imageClass?(this._image.addClass("icon"),this._image.addClass(this._options.imageClass)):this._image.addClass("status-progress")},t.prototype._bindEvents=function(){var n=this._options.eventTarget||window;this._options.statusStartEvent&&this._bind(n,this._options.statusStartEvent,l(this,this._startHandler),!0);this._options.statusCompleteEvent&&this._bind(n,this._options.statusCompleteEvent,l(this,this.complete),!0);this._options.statusErrorEvent&&this._bind(n,this._options.statusErrorEvent,l(this,this.error),!0)},t.prototype._error=function(n,t,i,r){this._lastError=r;this.hideElement()},t.prototype._startHandler=function(n,t){this.delayExecute("start",this._throttleMinTime,!0,function(){this.start(n,t)})},t.prototype._clearTimeout=function(){this.cancelDelayedFunction("start")},t.enhancementTypeName="tfs.statusIndicator",t._allIndicators=[],t._announcer=new e.MultiProgressAnnouncer({announceStartMessage:f.ContentLoading,announceEndMessage:f.ContentLoaded,getActiveCount:t.getActiveCount}),t}(i.Control);t.StatusIndicatorO=v;y=function(n){function t(){var t=__construct(this,n,arguments);for(var i in t)t.hasOwnProperty(i)&&(this[i]=t[i]);return t}return __extends(t,n),t}(v);t.StatusIndicator=y;i.Enhancement.registerJQueryWidget(y,"statusIndicator");w=function(){function n(n,t){this._$rootElement=$(n);this._options=t||{};this._initialize()}return n.prototype.beginOperation=function(n){var t=this.getCancellableOperation();this._cancelable=t;typeof this._options.beginOperationCallback=="function"&&this._options.beginOperationCallback();this._waitControl.startWait(t);o.delay(this,100,function(){n(t)})},n.prototype.createWaitControl=function(n){return i.create(a,this._$rootElement[0]._element,n)},n.prototype.getCancellableOperation=function(){return new o.Cancelable(this)},n.prototype.getWaitControl=function(){return this._waitControl},n.prototype.endOperation=function(){this._waitControl.endWait();typeof this._options.endOperationCallback=="function"&&this._options.endOperationCallback()},n.prototype.isCancelled=function(){return this._cancelled},n.prototype.cancelOperation=function(){this._options&&this._options.cancellable&&(this._cancelled=!0);this.endOperation()},n.prototype._initialize=function(){this._state={message:this._options&&this._options.message?this._options.message:f.DefaultWaitMessage,target:this._$rootElement[0]._element,cancellable:this._options&&this._options.cancellable,showDelay:this._options&&this._options.showDelay!==null?this._options.showDelay:null};this._waitControl=this.createWaitControl(this._state)},n}();t.LongRunningOperation=w,function(n){n[n.NotStarted=0]="NotStarted";n[n.Waiting=1]="Waiting";n[n.Ending=2]="Ending";n[n.Ended=3]="Ended";n[n.Cancelling=4]="Cancelling";n[n.Cancelled=5]="Cancelled"}(c=t.WaitingState||(t.WaitingState={}));p=function(n){function t(t){var i=__construct(this,n,[t]);for(var r in i)i.hasOwnProperty(r)&&(this[r]=i[r]);return i._state=c.NotStarted,i}return __extends(t,n),t.prototype.initializeOptions=function(t){n.prototype.initializeOptions.call(this,$.extend({image:u.urlHelper.getVersionedContentUrl("big-progress.gif"),showDelay:a.DefaultShowDelay},t))},t.prototype.initialize=function(){n.prototype.initialize.call(this)},t.prototype.startWait=function(n){this._canStartWait()&&(this._context={instanceId:"waitControl_"+a._instanceIdSeed++,cancellable:n,options:{wait:this._options}},this._startWait())},t.prototype.endWait=function(){this._canEndWait()&&(this._state=c.Ending,this._tryEndWait())},t.prototype.cancelWait=function(){this._canCancelWait()&&(this._state=c.Cancelling,this._tryCancelWait())},t.prototype.setMessage=function(n){if(this._context){var t=this._context.options.wait;t.messageElement&&(t.messageElement.find(".wait-message-text").text(n),this._resizeWait(),t.cancellable&&h.tryFocus(t.messageElement.find("#"+t.cancelLinkId)))}},t.prototype.isCancelled=function(){return this._state===c.Cancelled},t.prototype._canStartWait=function(){return this._state===c.NotStarted||this._state===c.Ended||this._state===c.Cancelled},t.prototype._canEndWait=function(){return this._context&&(this._state===c.Waiting||this._state===c.Ending)},t.prototype._canCancelWait=function(){return this._context&&this._context.options.wait.cancellable&&(this._state===c.Waiting||this._state===c.Cancelling)},t.prototype._startWait=function(){var n=this._context.options.wait;this._state=c.Waiting;n.showDelay===null&&(n.showDelay=a.DefaultShowDelay);n.target||(n.entireWindow=!0,n.target=$("body"),n.extraStyles="height:100%; width:100%;");n.target.children(".wait-element").hide();n.target.children(".wait-box").hide();n.showDelay?this._context.showTimer=o.delay(this,n.showDelay,this._showWait):this._showWait()},t.prototype._tryEndWait=function(){var n=this._context.options.wait;this._state!==c.Ending||n.minLifeSpanBlocking||(this._state=c.Ended,this._reset())},t.prototype._tryCancelWait=function(){var t=this._context.options.wait,i=t.cancelCallback,n=this._context.cancellable;this._state!==c.Cancelling||t.minLifeSpanBlocking||(this._state=c.Cancelled,this._reset(),i&&i(),n&&n.cancel&&typeof n.cancel=="function"&&n.cancel())},t.prototype._reset=function(){this._unbindKeydownEvent();this._removeWaitElement();this._originalFocusElement&&(this._originalFocusElement.focus(),this._originalFocusElement=null);this._removeShowTimer();this._context=null},t.prototype.updateWaitElements=function(n){n.messageElement=n.target.children(".wait-box").first()},t.prototype._showWait=function(){var t="",n=this._context.options.wait,f=n.extraStyles||"",i=this,u;n.image&&(t+=s.format('<img class="wait-image" src="{0}" />',n.image));u=this._getWaitMessage(n);u&&(t+=s.format('<div class="wait-message" role="alert">{0}<\/div>',u));t.length>0&&(n.target.prepend(s.format('<div class="wait-box">{0}<\/div>',t)),this.updateWaitElements(n));n.backgroundColor&&(f+=s.format("background-color:{0};",n.backgroundColor));n.target.prepend(s.format('<div class="wait-element" style="{0}"><\/div>',f));n.element=n.target.children(".wait-element").first();this._resizeWait();$(window).bind(this._getResizeEventId(this._context.instanceId),l(this,this._resizeWait));n.cancellable&&(this._bindKeydownEvent(n.cancelLinkId),$("#"+n.cancelLinkId).click(l(this,this._handleCancelEvent)),this._originalFocusElement=$(document.activeElement),$("#"+n.cancelLinkId).focus());n.minLifetime||(n.minLifetime=a.MinLifeTime);n.minLifeSpanBlocking=!0;o.delay(this,n.minLifetime,function(){n.minLifeSpanBlocking=!1;i._state===c.Ending?i._tryEndWait():i._state===c.Cancelling&&i._tryCancelWait()})},t.prototype.getWaitingState=function(){return this._state},t.prototype.getWaitingContext=function(){return this._context},t.prototype._resizeWait=function(){var n,t,i;if(n=this._context.options.wait,n.entireWindow||(n.element.css("margin-top",-parseInt(n.target.css("padding-top"),10)),n.element.css("margin-left",-parseInt(n.target.css("padding-left"),10)),n.element.height(n.target.outerHeight()-2),n.element.width(n.target.outerWidth()-2)),n.messageElement){t=parseInt(n.element.css("margin-top"),10);i=parseInt(n.element.css("margin-left"),10);(!t||isNaN(t))&&(t=0);(!i||isNaN(i))&&(i=0);var e=n.element.outerHeight(),f=n.element.outerWidth(),o=n.messageElement.outerHeight(),u=n.messageElement.outerWidth();u>f&&(u=f-4,n.messageElement.outerWidth(u));n.messageElement.css("top",n.element.position().top+(e-o)/2+t);n.messageElement.css("left",n.element.position().left+(f-u)/2+i)}},t.prototype._onKeyDown=function(n){var t=h.KeyCode;if(n.keyCode===t.ESCAPE)return this._handleCancelEvent(n),!1},t.prototype._handleCancelEvent=function(){return this._unbindKeydownEvent(),this.cancelWait(),!1},t.prototype._bindKeydownEvent=function(n){this._keyDownEventHandler||(this._keyDownEventHandler=l(this,this._onKeyDown),$("#"+n).keydown(this._keyDownEventHandler))},t.prototype._unbindKeydownEvent=function(){if(this._context){var n=this._context.options.wait;this._keyDownEventHandler&&n.cancelLinkId&&($("#"+n.cancelLinkId).off("keydown",this._keyDownEventHandler),this._keyDownEventHandler=null)}},t.prototype._removeWaitElement=function(){function t(n){n.element&&(n.element.remove(),n.element=null)}function i(n){n.messageElement&&(n.messageElement.remove(),n.messageElement=null)}if(this._context){var n=this._context.options.wait;n.element&&(n.fade!==!1?(n.element.fadeOut("fast",function(){t(n)}),n.messageElement.fadeOut("fast",function(){i(n)})):(t(n),i(n)),$(window).off(this._getResizeEventId(this._context.instanceId)))}},t.prototype._removeShowTimer=function(){this._context&&this._context.showTimer&&(this._context.showTimer.cancel(),delete this._context.showTimer)},t.prototype._getResizeEventId=function(n){return"resize."+n},t.prototype._getWaitMessage=function(n){var i,t;return i="",n.cancellable&&(n.cancelLinkId="cancelLink_"+this._context.instanceId,i=s.format(n.cancelTextFormat||f.CancelWaitAdvice,s.format('<a href="" class="wait-link" tabindex="0" id="{0}">ESC<\/a>',n.cancelLinkId))),t="",n.message?(t=s.format('<span class="wait-message-text">{0}<\/span>',n.message),t=n.cancellable?s.format(this.getWaitMessageFormatString(),t,i):t):n.cancellable&&(t=i),t},t.prototype.getWaitMessageFormatString=function(){return this._options.messageFormat||"{0}({1})"},t._instanceIdSeed=1,t.DefaultShowDelay=250,t.MinLifeTime=100,t}(i.Control);t.WaitControlO=p;a=function(n){function t(){var t=__construct(this,n,arguments);for(var i in t)t.hasOwnProperty(i)&&(this[i]=t[i]);return t}return __extends(t,n),t}(p);t.WaitControl=a});

var __extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),__assign=this&&this.__assign||function(){return __assign=Object.assign||function(n){for(var t,r,i=1,u=arguments.length;i<u;i++){t=arguments[i];for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},__assign.apply(this,arguments)},__awaiter=this&&this.__awaiter||function(n,t,i,r){function u(n){return n instanceof i?n:new i(function(t){t(n)})}return new(i||(i=Promise))(function(i,f){function o(n){try{e(r.next(n))}catch(t){f(t)}}function s(n){try{e(r["throw"](n))}catch(t){f(t)}}function e(n){n.done?i(n.value):u(n.value).then(o,s)}e((r=r.apply(n,t||[])).next())})},__generator=this&&this.__generator||function(n,t){function o(n){return function(t){return s([n,t])}}function s(e){if(f)throw new TypeError("Generator is already executing.");while(r)try{if(f=1,u&&(i=e[0]&2?u["return"]:e[0]?u["throw"]||((i=u["return"])&&i.call(u),0):u.next)&&!(i=i.call(u,e[1])).done)return i;(u=0,i)&&(e=[e[0]&2,i.value]);switch(e[0]){case 0:case 1:i=e;break;case 4:return r.label++,{value:e[1],done:!1};case 5:r.label++;u=e[1];e=[0];continue;case 7:e=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(e[0]===6||e[0]===2)){r=0;continue}if(e[0]===3&&(!i||e[1]>i[0]&&e[1]<i[3])){r.label=e[1];break}if(e[0]===6&&r.label<i[1]){r.label=i[1];i=e;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(e);break}i[2]&&r.ops.pop();r.trys.pop();continue}e=t.call(n,r)}catch(o){e=[6,o];u=0}finally{f=i=0}if(e[0]&5)throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},f,u,i,e;return e={next:o(0),"throw":o(1),"return":o(2)},typeof Symbol=="function"&&(e[Symbol.iterator]=function(){return this}),e};define("VSS/Contributions/Controls",["require","exports","q","VSS/Authentication/Services","VSS/Context","VSS/Common/Contracts/Platform","VSS/Common/Constants/Platform","VSS/Contributions/Services","VSS/Controls","VSS/Diag","VSS/FeatureAvailability/Services","VSS/Locations","VSS/LWP","VSS/Controls/Notifications","VSS/Telemetry/Services","VSS/Resources/VSS.Resources.Platform","VSS/SDK/Host","VSS/SDK/Shim","VSS/SDK/XDM","VSS/Service","VSS/Controls/StatusIndicator","VSS/Utils/Array","VSS/Utils/Core","VSS/Utils/File","VSS/Utils/String","VSS/Utils/UI","VSS/Utils/Url","VSS/Resources/VSS.Resources.Platform","VSS/VSS","VSS/WebApi/Constants"],function(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w,b,k,d,g,nt,tt,it,rt,ut,ft,et,ot,st){function ni(n,t,i,r,u,f){return r===void 0&&(r=null),f===void 0&&(f=null),u||(u="__contributedControlInstance"+gt++,i=$.extend({},i,{contributedControlInstanceId:u})),wt(n,t,i||{},r,null,null,"uri",!1,f).then(function(n){return n.getRegisteredInstance(u)})}function wt(n,t,i,r,f,e,s,h,c){r===void 0&&(r=null);e===void 0&&(e=null);s===void 0&&(s="uri");h===void 0&&(h=!1);c===void 0&&(c=null);r||(r=u.getDefaultWebContext());e||(e=r);var l=function(t){return o.ExtensionHelper.resolveUriTemplateProperty(t,e,s).then(function(r){var u=d.getService(o.ExtensionService).getFallbackUri(t);return u?o.ExtensionHelper.resolveUriTemplateProperty(t,e,s,u).then(function(u){return lt(n,r,t,i,f,h,c,u)}):lt(n,r,t,i,f,h,c)})};return typeof t=="string"?d.getService(o.ExtensionService,r).getContribution(t).then(function(n){return l(n)}):l(t)}function lt(n,t,i,r,f,e,o,s){return e===void 0&&(e=!1),o===void 0&&(o=null),s===void 0&&(s=null),at(n,i,t,s,r,f,!1,e,o,u.getDefaultWebContext())}function bt(n,t,i,r){t===void 0&&(t=null);i===void 0&&(i=null);r===void 0&&(r="uri");t||(t=u.getDefaultWebContext());i||(i=t);var f=function(n){return o.ExtensionHelper.resolveUriTemplateProperty(n,i,r).then(function(u){var f=d.getService(o.ExtensionService).getFallbackUri(n);return f?o.ExtensionHelper.resolveUriTemplateProperty(n,i,r,f).then(function(i){return at(null,n,u,i,{host:{background:!0}},null,!0,!1,null,t)}):at(null,n,u,null,{host:{background:!0}},null,!0,!1,null,t)})};return typeof n=="string"?d.getService(o.ExtensionService,t).getContribution(n).then(function(n){return f(n)}):f(n)}function ti(n,t,r,u,f,e,o,s){u===void 0&&(u=null);o===void 0&&(o=null);s===void 0&&(s="uri");var h=bt(n,u,o,s).then(function(n){return n.getRegisteredInstance(t,r)});return f>0&&(h=i.timeout(h,f,e)),h}function at(n,t,i,r,u,f,e,h,c,l){var v=o.ExtensionHelper.isContributionTrusted(t),a=!1;if(v&&(t.properties.content||!i))a=!0;else if(!i)throw new Error('No uri was specified for contribution "'.concat(t.id,'". Cannot create extension host.'));return e?dt.getHost(i,r,t,a,u,f):a?new pt(t,u,n,l):s.create(yt,n,{uri:i,fallbackUri:r,contribution:t,interactive:!t.properties.external,initialConfig:u,postContent:f,contributionHostBehavior:c})}var ct,ht,kt,dt;Object.defineProperty(t,"__esModule",{value:!0});t.getBackgroundInstance=t.getBackgroundHost=t.createExtensionHostForContribution=t.createExtensionHost=t.createContributedControl=t.ExternalContentHostEvents=t.ResizeOptions=void 0,function(n){n[n.Default=0]="Default";n[n.FixedHeight=2]="FixedHeight";n[n.FixedWidth=4]="FixedWidth"}(ct=t.ResizeOptions||(t.ResizeOptions={})),function(n){n.SLOW_LOAD_WARNING="external-content-host-slow-load-warning";n.EXTENSION_MESSAGE_RESIZED="external-content-host-message-resized";n.EXTENSION_HOST_RESIZED="external-content-host-resized"}(ht=t.ExternalContentHostEvents||(t.ExternalContentHostEvents={}));var vt="__remoteSerializationSettings",yt=function(n){function t(i){var r=__construct(this,n,[i]);for(var u in r)r.hasOwnProperty(u)&&(this[u]=r[u]);return r._usingFallback=!1,r._usingTheme=!1,r._onThemeChanged=function(n){r._xdmChannel&&r._xdmChannel.invokeRemoteMethod("dispatchEvent","DevOps.SdkClient",["themeChanged",{detail:n}])},r.setEnhancementOptions({coreCssClass:"external-content-host"}),r._contributions=[],r._contributionHostBehavior={showErrorIndicator:!0,showLoadingIndicator:!0,slowWarningDurationMs:t.DEFAULT_SLOW_LOAD_DURATION,maxHandshakeDurationMs:t.MAX_WAIT_FOR_HANDSHAKE_EVENT,resizeOptions:ct.Default},r}return __extends(t,n),t.prototype.getLoadPromise=function(){return this._loadedDeferred.promise},t.prototype.initialize=function(){var t=this,n;this._srcUri=this._options.uri;c.FeatureAvailabilityService.isFeatureEnabled(e.WebPlatformFeatureFlags.UseGalleryCdn)&&this._options.fallbackUri&&this._isGalleryCdnDisabled()?(this._srcUri=this._options.fallbackUri,this._usingFallback=!0):this._deleteFallbackCookie();n=this._options.contributionHostBehavior;n&&(n.showErrorIndicator!==undefined&&n.showErrorIndicator!==null&&(this._contributionHostBehavior.showErrorIndicator=n.showErrorIndicator),n.showLoadingIndicator!==undefined&&n.showLoadingIndicator!==null&&(this._contributionHostBehavior.showLoadingIndicator=n.showLoadingIndicator),n.slowWarningDurationMs!==undefined&&n.slowWarningDurationMs!==null&&(this._contributionHostBehavior.slowWarningDurationMs=n.slowWarningDurationMs),n.maxHandshakeDurationMs!==undefined&&n.maxHandshakeDurationMs!==null&&(this._contributionHostBehavior.maxHandshakeDurationMs=n.maxHandshakeDurationMs),n.resizeOptions!==undefined&&n.resizeOptions!==null&&(this._contributionHostBehavior.resizeOptions=n.resizeOptions),n.callbacks&&(this._contributionHostBehavior.callbacks=n.callbacks),n.teamContextOverride&&(this._contributionHostBehavior.teamContextOverride=n.teamContextOverride));this._$container=$("<div />").addClass("external-content-host-container").appendTo(this._element);this._loadedDeferred=i.defer();u.getPageContext().webAccessConfiguration.isHosted||!ut.BrowserCheckUtils.isLessThanOrEqualToIE9()||c.FeatureAvailabilityService.isFeatureEnabled(e.WebPlatformFeatureFlags.VisualStudioServicesContributionUnSecureBrowsers,!1)?this._getInDomPromise().then(function(){t._finishInitialization()}):this._showExtensionMessage(v.MessageAreaType.Warning,et.ExtensionsNotAvailableOnpremOldIE,!1,null,!1)},t.prototype._finishInitialization=function(){var n=this,i,t;if(!this.isDisposed()){t="externalContentHost"+s.getId();this._options.postContent&&(i=$("<form />").attr("method","post").attr("target",t).attr("action",this._srcUri).appendTo(this._$container),$("<input />").attr("type","hidden").attr("name","requestJson").attr("value",JSON.stringify(this._options.postContent)).appendTo(i));this._$iframe=$("<iframe frameborder='0' />").addClass("external-content-iframe").attr({id:t,name:t,role:"presentation"}).appendTo(this._$container);this._options.interactive&&(this._$iframe.hide(),this._$iframe.addClass("loading"),this._contributionHostBehavior.showLoadingIndicator&&(this._$statusContainer=$("<div />").addClass("status-container").appendTo(this._$container),this._statusControl=s.BaseControl.createIn(g.StatusIndicator,this._$statusContainer,{center:!0,imageClass:"big-status-progress",message:p.ExternalControlLoading}),this._statusControl.start()),this._contributionHostBehavior.slowWarningDurationMs>0&&this.delayExecute("slowLoadTimeout",this._contributionHostBehavior.slowWarningDurationMs,!0,function(){n._disposed||n._loadFailed||n._receivedLoadedEvent||(n._shouldAttemptFallback()?n._loadFallback():(n._showExtensionMessage(v.MessageAreaType.Warning,p.ExternalContentSlowLoadFormat,!0),n._contributionHostBehavior.callbacks&&n._contributionHostBehavior.callbacks.slow()))}));this._$iframe.on("load",function(){n._options.interactive?n._receivedHandshake||n._receivedLoadedEvent||n._loadFailed||n._disposed||n.delayExecute("waitForHandshake",n._contributionHostBehavior.maxHandshakeDurationMs,!0,function(){this._receivedHandshake||this._receivedLoadedEvent||this._loadFailed||this._disposed||(this._shouldAttemptFallback()?this._loadFallback():this._handleLoadError(null))}):n._loadedDeferred.resolve(null)});u.getPageContext().webAccessConfiguration.isHosted||!ft.isSameOrigin(this._srcUri,window.location.href)||c.FeatureAvailabilityService.isFeatureEnabled(e.WebPlatformFeatureFlags.VisualStudioServicesContributionUnSecureBrowsers,!1)&&ut.BrowserCheckUtils.isLessThanOrEqualToIE9()||(this._$iframe.attr("sandbox","allow-downloads allow-forms allow-modals allow-pointer-lock allow-popups allow-scripts allow-top-navigation"),this._sandboxedIframe=!0);this._options.postContent?i[0].submit():this._$iframe.attr("src",this._srcUri);this._options.interactive&&(this._xdmChannel=null,this.ensureXdmChannelIntialized())}},t.prototype._shouldAttemptFallback=function(){return!this._usingFallback&&this._options.fallbackUri&&c.FeatureAvailabilityService.isFeatureEnabled(e.WebPlatformFeatureFlags.UseGalleryCdn)},t.prototype._loadFallback=function(){this._enableFallbackCookie();this._usingFallback=!0;this._srcUri=this._options.fallbackUri;this._$iframe.remove();this._hideLoadingIndicator();this._finishInitialization()},t.prototype._isGalleryCdnDisabled=function(){var n=this._getCookie("GALLERY-CDN");return n&&n==="disabled"},t.prototype._enableFallbackCookie=function(){var n,t;u.getPageContext().webAccessConfiguration.isHosted&&(n=this._getCookie("GALLERY-CDN"),n||(t=3600,this._setFallbackCookie(t,"disabled")))},t.prototype._deleteFallbackCookie=function(){if(u.getPageContext().webAccessConfiguration.isHosted){var n=this._getCookie("GALLERY-CDN");n&&this._setFallbackCookie(0,"")}},t.prototype._setFallbackCookie=function(n,t){if(u.getPageContext().webAccessConfiguration.isHosted){var i="";window.location.protocol.indexOf("https")!==-1&&(i=";secure");document.cookie="GALLERY-CDN="+t+";max-age="+n+";path=/"+i}},t.prototype._getCookie=function(n){var t,i;return u.getPageContext().webAccessConfiguration.isHosted&&document.cookie.length>0&&(t=document.cookie.indexOf(n+"="),t!==-1)?(t=t+n.length+1,i=document.cookie.indexOf(";",t),i===-1&&(i=document.cookie.length),decodeURIComponent(document.cookie.substring(t,i))):""},t.prototype._handleLoadSuccess=function(){this._receivedLoadedEvent||y.publishEvent({feature:"Extensions",area:"Extensions.Loaded",properties:{contributionId:this._options.contribution.id,legacy:!0},elapsedTime:-1});this._receivedLoadedEvent=!0;this._hideLoadingIndicator();this._loadedDeferred.resolve(null);this._contributionHostBehavior.callbacks&&this._contributionHostBehavior.callbacks.success()},t.prototype._handleLoadError=function(n){if(this._loadFailed=!0,this._hideLoadingIndicator(),this._loadedDeferred.reject(n),this._contributionHostBehavior.showErrorIndicator){var t=n&&n.message?n.message:n;this._showExtensionMessage(v.MessageAreaType.Error,p.ExternalContentErrorFormat,!1,t);this._contributionHostBehavior.callbacks&&this._contributionHostBehavior.callbacks.failure(t)}},t.prototype._hideLoadingIndicator=function(){this._$iframe.removeClass("loading");this._statusControl&&(this._statusControl.dispose(),this._$statusContainer.remove(),this._statusControl=null,this._$statusContainer=null)},t.prototype._getExtensionUrl=function(){if(!this._galleryUrlPromise){var n=this._options.contribution,t=i.defer();this._galleryUrlPromise=t.promise;ot.using(["VSS/Gallery/RestClient"],function(i){l.beginGetServiceLocation(i.GalleryHttpClient.serviceInstanceId,f.ContextHostType.Deployment).then(function(i){var r=u.getPageContext().webAccessConfiguration.isHosted?i:it.combinePaths(i,"_gallery");t.resolve(it.combinePaths(r,"items/"+o.ExtensionHelper.getPublisherId(n)+"."+o.ExtensionHelper.getExtensionId(n)))})})}return this._galleryUrlPromise},t.prototype._showExtensionMessage=function(n,i,r,u,f){var e=this,a,y;f===void 0&&(f=!0);var h=this._options.contribution,l=d.getService(o.ExtensionService),w=l.getProviderDisplayName(h)||o.ExtensionHelper.getPublisherId(h),b=l.getProviderProperty(h,t.EXTENSION_DISPLAY_NAME_PROPERTY)||o.ExtensionHelper.getExtensionId(h),k=rt.format(p.ExtensionDisplayNameFormat,b,w),c=$("<div />");if($("<span />").appendTo(c).text(rt.format(i,k)),f&&this._getExtensionUrl().then(function(n){var t=$("<span />").addClass("help-text").appendTo(c).html(p.ExternalContentErrorLearnMoreContent);t.find("a").attr("href",n).attr("target","_blank");e._handleMessageAreaResize()}),this._showingErrorDetails=!!u,this._showingErrorDetails&&(a=$("<div />").text(u)),y={type:n,header:c,content:a},this._messageArea&&this._messageArea.dispose(),this._messageArea=s.Enhancement.enhance(v.MessageAreaControl,$("<div />").prependTo(this._element),{closeable:r,showIcon:!0,expanded:!!u,showDetailsLink:!1,message:y}),this._handleMessageAreaResize(),this._messageArea._bind(v.MessageAreaControl.EVENT_DISPLAY_COMPLETE,function(){e._handleMessageAreaResize();e._fire(ht.EXTENSION_MESSAGE_RESIZED,[e])}),this._messageArea._bind(v.MessageAreaControl.EVENT_DISPLAY_CLEARED,function(){e._messageArea=null;e._handleMessageAreaResize();e._fire(ht.EXTENSION_MESSAGE_RESIZED,[e])}),this._fire(ht.EXTENSION_MESSAGE_RESIZED,[this]),!this._errorResizeDelegate){this._errorResizeDelegate=function(){e._handleMessageAreaResize()};$(window).on("resize",this._errorResizeDelegate)}},t.prototype.dispose=function(){if(n.prototype.dispose.call(this),this._$iframe&&(ut.BrowserCheckUtils.isIEVersion(11)&&this._$iframe.attr("src","about:blank"),this._$iframe=null),this._errorResizeDelegate&&$(window).off("resize",this._errorResizeDelegate),this._xdmChannel&&(k.channelManager.removeChannel(this._xdmChannel),this._xdmChannel=null),this._usingTheme){var t=a.getLWPService("IVssThemeService");t.unsubscribe(this._onThemeChanged,"themeChanged")}this._$container=null},t.prototype._handleMessageAreaResize=function(){var n="0";this._messageArea&&(n=this._messageArea._element.outerHeight()+(this._showingErrorDetails?20:0)+"px");this._$container.css("padding-top",n);this._$statusContainer&&this._$statusContainer.css("top",n)},t.prototype.getXdmChannel=function(){return this.ensureXdmChannelIntialized(),this._xdmChannel},t.prototype.ensureXdmChannelIntialized=function(){var n;if(!this._xdmChannel){var t=d.getService(o.ExtensionService),i=t.getFallbackUri(this._options.contribution),r=t.getBaseUri(this._options.contribution);this._xdmChannel=k.channelManager.addChannel(this._$iframe[0].contentWindow,this._srcUri);n=this.getHostControl();this._xdmChannel.getObjectRegistry().register("VSS.HostControl",n);this._xdmChannel.getObjectRegistry().register("DevOps.HostControl",n);this._hostManagementService=new w.HostManagementService({baseUri:this._usingFallback&&i?i:r,publisherId:o.ExtensionHelper.getPublisherId(this._options.contribution),extensionId:o.ExtensionHelper.getExtensionId(this._options.contribution),contributionId:o.ExtensionHelper.getFullContributionId(this._options.contribution),version:d.getService(o.ExtensionService).getVersion(this._options.contribution),registrationId:d.getService(o.ExtensionService).getRegistrationId(this._options.contribution),initialConfig:this._options.initialConfig});this._xdmChannel.getObjectRegistry().register("vss.hostManagement",this._hostManagementService)}},t.prototype.getRegisteredInstance=function(n,t){var r=this;return this._loadedDeferred.promise.then(function(){return i.Promise(function(i,u){var f,s=!1,o,e;r.getXdmChannel().getRemoteObjectProxy(n,t).then(function(n){s=!0;f&&(f.cancel(),f=null);i(n)},function(n){s=!0;f||u(n)});o=r._options.contribution.id.split(".");e=n.split(".");o.length>=2&&e.length>=2&&o[0]===e[0]&&o[1]===e[1]&&(f=tt.delay(r,250,function(){var n=e.slice(2).join(".");r.getXdmChannel().getRemoteObjectProxy(n,t).then(function(n){f&&(f=null,i(n))},function(n){f=null;s&&u(n)})}))})})},t.prototype.reuseHost=function(n){var t=this;this._loadedDeferred.promise.then(function(){t._contributions.indexOf(n)<0&&(typeof t._extensionReusedCallback=="function"&&t._extensionReusedCallback(n),t._contributions.push(n))})},t.prototype.getHostControl=function(){var n=this;return{resize:function(t,i){(n._contributionHostBehavior.resizeOptions&ct.FixedHeight)==0&&n._$iframe.height(i);(n._contributionHostBehavior.resizeOptions&ct.FixedWidth)==0&&n._$iframe.width(t);b.VSS.resize();var r={height:i,width:t,host:n};n._fireDispatch(ht.EXTENSION_HOST_RESIZED,r)},initialHandshake:function(i){return __awaiter(n,void 0,void 0,function(){var rt,s,p,ut,c,w,l,r,h,b,ft,k,g,nt,et,f,v,e,tt,it,n,y,ot=this;return __generator(this,function(ht){switch(ht.label){case 0:return(this._receivedHandshake=!0,this._$iframe.show(),s=!1,p=!1,i&&(s=i.sdkVersion>0,(i.notifyLoadSucceeded||s&&i.loaded!==!1)&&(p=!0),this._extensionReusedCallback=i.extensionReusedCallback,ut=s?i.applyTheme!==!1:i.applyTheme===!0,ut?(c=a.getLWPService("IVssThemeService"),c&&(w=c.getCurrentTheme(),w&&(rt=w.data),c.subscribe(this._onThemeChanged,"themeChanged"),this._usingTheme=!0)):this._$iframe.addClass("themeless")),l=this._options.contribution,r=u.getPageContext(),!(!r.webContext.team&&r.webContext.project))?[3,3]:(h=this._contributionHostBehavior.teamContextOverride,!!h)?[3,2]:(b="ms.vss-tfs-web.team-context-data-provider",ft={id:b,properties:{serviceInstanceType:st.ServiceInstanceTypes.TFS}},k=d.getService(o.WebPageDataService),[4,k.ensureDataProvidersResolved([ft],!0)]);case 1:ht.sent();h=k.getPageData(b);ht.label=2;case 2:h&&(r=__assign(__assign({},r),{webContext:__assign(__assign({},r.webContext),{team:__assign({},h)})}));ht.label=3;case 3:if(this._contributions.push(l),g=d.getService(o.ExtensionService),nt=g.getFallbackUri(this._options.contribution),et=g.getBaseUri(this._options.contribution),f=o.ExtensionHelper.getPublisherId(this._options.contribution),v=o.ExtensionHelper.getExtensionId(this._options.contribution),e={pageContext:r,initialConfig:this._options.initialConfig,extensionContext:{extensionId:v,publisherId:f,version:d.getService(o.ExtensionService).getVersion(this._options.contribution),baseUri:this._usingFallback&&nt?nt:et},contribution:l,themeData:rt},this._sandboxedIframe&&f){e.sandboxedStorage={};try{tt=window.localStorage.getItem(t.SANDBOXED_STORAGE_SETTINGS_PREFIX+f);tt&&(e.sandboxedStorage=JSON.parse(tt))}catch(ct){}}return s&&(this._xdmChannel.getObjectRegistry().register("DevOps.ServiceManager",(y={},y[vt]={useLegacySerialization:!1},y.getService=function(n){var t=a.getLWPService("IVssContributionService");return t?t.getContributionAsync(n).then(function(i){if(i){if(i.serviceName)return t.getServiceEx(n,i,!0);var r=i;if(r.content&&r.content.require)return ot._hostManagementService.getServiceContribution(n).then(function(n){return n.getInstance().then(function(n){return n&&(n[vt]={useLegacySerialization:!0}),n})})}return undefined}):undefined},y)),e.contributionId=l.id,it=a.getLWPService("IVssPageService"),it&&(n=it.getData(),e.context={host:{id:n.hostId,name:n.hostName,type:n.hostType},user:{id:n.user.id,name:n.user.uniqueName,displayName:n.user.displayName,imageUrl:n.user.imageUrl},extension:{id:"".concat(f,".").concat(v),publisherId:f,extensionId:v}})),p&&window.setTimeout(function(){ot._handleLoadSuccess()},0),[2,e]}})})},notifyLoadSucceeded:function(){n._handleLoadSuccess()},notifyLoadFailed:function(t){n._handleLoadError(t)},getAccessToken:function(){var t=d.getService(o.ExtensionService).getRegistrationId(n._options.contribution),i=!o.ExtensionHelper.isContributionTrusted(n._options.contribution);return r.getToken(t,null,null,i)},getAppToken:function(){var t=d.getService(o.ExtensionService).getRegistrationId(n._options.contribution);return r.getAppToken(t)},updateSandboxedStorage:function(n){var i,r;n&&this._sandboxedIframe&&window.localStorage&&(i=o.ExtensionHelper.getPublisherId(this._options.contribution),i&&(r=JSON.stringify(n),r.length>25e4?h.logWarning("Failed to update sandboxed storage for extension publisher ".concat(i,". The overall storage size ").concat(r.length," exceeds the maximum limit of ").concat(t.SANDBOXED_STORAGE_SIZE_LIMIT,".")):window.localStorage.setItem(t.SANDBOXED_STORAGE_SETTINGS_PREFIX+i,r)))}}},t.DEFAULT_SLOW_LOAD_DURATION=1e4,t.MAX_WAIT_FOR_HANDSHAKE_EVENT=5e3,t.EXTENSION_FLAGS_TRUSTED=2,t.EXTENSION_DISPLAY_NAME_PROPERTY="ExtensionDisplayName",t.SANDBOXED_STORAGE_SETTINGS_PREFIX="extension-data:",t.SANDBOXED_STORAGE_SIZE_LIMIT=25e4,t}(s.Control),pt=function(){function n(t,r,u,f){var c=this,e=t.properties.content,s,l,h;e||t.type!==n.ModuleContentType||(e=t.properties);e?(s=i([]),e.contributionIds&&e.contributionIds.length>0&&(l=d.getService(o.ExtensionService,f),s=l.queryContributions(e.contributionIds,o.ContributionQueryOptions.IncludeAll)),this._loadPromise=s.then(function(){return c._loadContribution(t,e.require||[],e.initialize?[e.initialize]:[],r,u)})):(h=d.getService(o.ExtensionService,f),this._loadPromise=h.queryContributions([t.id],o.ContributionQueryOptions.IncludeRecursiveTargets,n.ModuleContentType).then(function(n){for(var p,f,l,a=[],v=[],e=[],s=0,y=n;s<y.length;s++)p=y[s],f=p.properties,(!f.targetType||rt.equals(f.targetType,t.type,!0))&&(f.require&&nt.addRange(a,f.require),f.initialize&&v.push(f.initialize),f.contributionIds&&nt.addRange(e,f.contributionIds));return l=i([]),e.length>0&&(l=h.queryContributions(nt.unique(e),o.ContributionQueryOptions.IncludeAll)),l.then(function(){return c._loadContribution(t,a,v,r,u)})}))}return n.prototype._loadContribution=function(n,t,r,u,f){var e=this;return this._isDisposed?i.resolve(null):(u||(u={}),this._getRequiredModules(t).then(function(){var i,o,s,t,h,n;if(!e._isDisposed)for(i=0,o=r;i<o.length;i++){if(s=o[i],f){t=u.ownsContainer===!0?f:$('<div class="internal-content-host" />').appendTo(f);e._$container=t;e._$container.on("remove",e.dispose.bind(e))}if(h={$container:t,container:t?t[0]:undefined,options:u,registerInstance:e._registerLocalInstance.bind(e)},typeof u.onBeforeRender=="function"&&u.onBeforeRender(),n=b.VSS.getRegisteredObject(s,h),n&&typeof n.then=="function")return n.then(function(n){u.contributedControlInstanceId&&(b.VSS.register(u.contributedControlInstanceId,n),e._registeredObjectId=u.contributedControlInstanceId);e._registeredObject=n});n&&(u.contributedControlInstanceId&&(b.VSS.register(u.contributedControlInstanceId,n),e._registeredObjectId=u.contributedControlInstanceId),e._registeredObject=n)}}))},n.prototype._registerLocalInstance=function(n,t){this._localRegistry||(this._localRegistry=k.createObjectRegistry());this._localRegistry.register(n,t)},n.prototype._getRequiredModules=function(n){if(!n||!n.length)return i.resolve(null);var t=i.defer();return ot.using(n,function(){t.resolve(null)}),t.promise},n.prototype.dispose=function(){this._$container&&(this._$container.off("remove"),this._$container.remove(),this._$container=null);this._registeredObjectId&&b.VSS.unregister(this._registeredObjectId);this._registeredObject&&(typeof this._registeredObject.dispose=="function"&&this._registeredObject.dispose(),this._registeredObject=null);this._isDisposed=!0},n.prototype.getLoadPromise=function(){return this._loadPromise},n.prototype.getRegisteredInstance=function(n,t){var i=this;return this._loadPromise.then(function(){var r;return i._localRegistry&&(r=i._localRegistry.getInstance(n,t)),r||(r=b.VSS.getRegisteredObject(n,t)),r})},n.ModuleContentType="ms.vss-web.module-content",n}(),gt=0;t.createContributedControl=ni;t.createExtensionHost=wt;t.createExtensionHostForContribution=lt;t.getBackgroundHost=bt;t.getBackgroundInstance=ti;kt=function(){function n(){this._hosts={}}return n.prototype.getHostsContainer=function(){return this._hostsContainer||(this._hostsContainer=$("<div/>").addClass("vs-app-hosts-container").prependTo(document.body)),this._hostsContainer},n.prototype.getHost=function(n,t,i,r,u,f){if(!n&&!r)throw new Error(rt.format("Could not resolve the uri for contribution {0}",i.id));var o=(r?"int.":"ext.")+(n||"").toLowerCase()+(t||"").toLowerCase(),e=this._hosts[o];return e?(e.reuseHost(i),e):this.createBackgroundHost(o,n,t,i,r,u,f)},n.prototype.createBackgroundHost=function(n,t,i,r,f,e,o){if(f)return new pt(r,e,this.getHostsContainer(),u.getDefaultWebContext());var h=s.create(yt,this.getHostsContainer(),{uri:t,fallbackUri:i,contribution:r,interactive:!0,initialConfig:e,postContent:o});return this._hosts[n]=h,h},n}();dt=new kt});

var __extends=this&&this.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),__assign=this&&this.__assign||function(){return __assign=Object.assign||function(n){for(var t,r,i=1,u=arguments.length;i<u;i++){t=arguments[i];for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},__assign.apply(this,arguments)};define("VSS/Controls/PopupContent",["require","exports","VSS/Controls","VSS/Diag","VSS/Utils/Core","VSS/Utils/String","VSS/Utils/UI"],function(n,t,i,r,u,f,e){var v,h,o;Object.defineProperty(t,"__esModule",{value:!0});t.RichContentTooltip=t.RichContentTooltipO=t.PopupContentControl=t.PopupContentControlO=void 0;var c=e.domElem,l=u.delegate,a=100,y=1e3,s=function(n){function t(){var t=n!==null&&n.apply(this,arguments)||this;return t._hasFocus=!1,t._blockFocusUntil=-a-1,t._hasMouse=!1,t._enabled=!0,t._handlers={},t}return __extends(t,n),t.prototype.initialize=function(){n.prototype.initialize.call(this);this._element[0].classList.add("popup-content-control");this._setAriaDescribedBy();!this._options.openDelay&&this._$dropElement.is(":focus")&&this.show();this._onForceHideDropPopupDelegate=this.onForceHideDropPopup.bind(this)},t.prototype.onForceHideDropPopup=function(){this.hide()},t.prototype.setTextContent=function(n){this._setContent(f.htmlEncode(n))},t.prototype.setHtmlContent=function(n){this._setContent(n)},t.prototype._setContent=function(n){this._$contentContainer.html(n);this._contentSet=!0;this._visible&&this._reposition()},t.prototype._initializeContent=function(){if(!this._contentSet){if(this._options.text)typeof this._options.text=="function"?this.setTextContent(this._options.text.call(this)):this.setTextContent(this._options.text);else if(this._options.html)typeof this._options.html=="function"?this.setHtmlContent(this._options.html.call(this)):this.setHtmlContent(this._options.html);else if(this._options.content){var n=this._options.content;typeof n=="function"?this._setContent(n.call(this)):this._setContent(n)}this._contentSet=!0}},t.prototype._setAriaDescribedBy=function(){if(this._options.setAriaDescribedBy){this._initializeContent();var t=this._$contentContainer.attr("id"),n=this._$dropElement.attr("aria-describedby")||"";n.indexOf(t)===-1&&this._$dropElement.attr("aria-describedby",(n?n+" ":"")+t)}},t.prototype.resetContent=function(){this._contentSet=!1},t.prototype.show=function(){this._show({useMousePosition:!1})},t.prototype.toggle=function(){this._element.is(":visible")?this.hide():this.show()},t.prototype._enhance=function(n){var u=this,t;this._createElement();this._$dropElement=n;t=this._options.menuContainer||$("#PopupContentContainer");t.length===0&&(t=$("<div id='PopupContentContainer'><\/div>").appendTo(document.body));this._element.appendTo(t);this._element.css("position","fixed");this._$contentContainer=$(c("div","popup-content-container")).attr({role:"tooltip",id:i.getHtmlId(),"aria-hidden":"true"}).appendTo(this._element);this._decorate();this._bind(n,"remove.removePopupDropElement",function(){u.dispose()})},t.prototype._decorate=function(){var n=this;this._options.openCloseOnHover?(this._listen("mouseover",this.onMouseOver),this._options.showOnFocus!==!1&&this._listen("focus",this._onFocus)):(this._documentEventDelegate=l(this,this._handleDocumentMouseDown),this._bind(this._$dropElement,"click",function(){n._element.is(":visible")?n.hide():n.show()}))},t.prototype._listen=function(n,t){!this._handlers[n]&&this._$dropElement.length>0&&this._$dropElement[0].addEventListener(n,this._handlers[n]=t.bind(this))},t.prototype._stopListening=function(n){var t=this._handlers[n];t&&this._$dropElement[0].removeEventListener(n,t)},t.prototype._onInteract=function(){this.hide();this._hasFocus=!1;this._blockFocusUntil=Date.now()+a},t.prototype._onFocus=function(n){n.target===this._$dropElement[0]&&Date.now()>this._blockFocusUntil&&(this._hasFocus=!0,this._listen("blur",this._onBlur),!this._hasMouse&&this._enabled&&this._showDelayed())},t.prototype._onBlur=function(){this._hasFocus=!1;this._hasMouse||this.hide()},t.prototype._onMouseMove=function(n){this._mousePosition?(this._mousePosition.left=n.pageX,this._mousePosition.top=n.pageY):this._mousePosition={left:n.pageX,top:n.pageY}},t.prototype.onMouseOver=function(n){(!this._options.mouseEventFilter||this._options.mouseEventFilter(n))&&(this._options.useStrictTarget&&n.target!==this._$dropElement[0]||(this._hasMouse=!0,this._enabled)&&(this._listen("mouseout",this._onMouseOut),this._listen("mousemove",this._onMouseMove),this._onMouseMove(n),this._showDelayed({useMousePosition:!0}),this._delayedHide&&this._delayedHide.cancel()))},t.prototype._onMouseOut=function(){var n=this;this._hasMouse=!1;this._delayedHide&&this._delayedHide.cancel();this._delayedHide=u.delay(this,100,function(){n.hide();n._delayedHide=null})},t.prototype.showDelayed=function(){this._showDelayed({useMousePosition:!1})},t.prototype._showDelayed=function(n){var t=this;this._visible||(n=n||{useMousePosition:!1},this._options.openDelay?(this._delayedShow&&this._delayedShow.cancel(),this._delayedShow=u.delay(this,this._options.openDelay,function(){t._show(n)})):this._show(n))},t.prototype._handleDocumentMouseDown=function(n){var t=$(n.target);this._$dropElement.has(n.target).length>0||this._$dropElement[0]===n.target||this._$contentContainer.has(n.target).length>0||this._$contentContainer[0]===n.target||this._element.has(n.target).length>0||this._element[0]===n.target||this.hide()},t.prototype._setPosition=function(){this._setPositionInternal({useMousePosition:!1})},t.prototype._setPositionInternal=function(n){if(this._visible){this._element.css({top:0,left:0});this._lastPositionContext={options:n};var t={elementAlign:this._options.elementAlign||"left-top",baseAlign:this._options.baseAlign||"left-bottom",overflow:this._options.overflow,supportScroll:this._options.supportScroll,leftOffsetPixels:this._options.leftOffsetPixels,topOffsetPixels:this._options.topOffsetPixels,skipZIndexSetting:this._options.skipZIndexSetting};n.useMousePosition&&this._options.useMousePosition!==!1?(this._lastPositionContext.mousePosition={left:this._mousePosition.left,top:this._mousePosition.top},t.leftOffsetPixels=this._options.mouseLeftOffsetPixels||t.leftOffsetPixels,t.topOffsetPixels=this._options.mouseTopOffsetPixels||t.topOffsetPixels,e.Positioning.positionAtLocation(this._element,this._mousePosition,t)):this._$dropElement.length>0&&e.Positioning.position(this._element,this._$dropElement,t)}},t.prototype._reposition=function(){this._lastPositionContext&&(this._lastPositionContext.mousePosition&&(this._mousePosition=this._lastPositionContext.mousePosition),this._setPositionInternal(this._lastPositionContext.options))},t.prototype._getDropElement=function(){return this._$dropElement},t.prototype._show=function(n){if(!this.isDisposed()&&this._getDropElement().is(":visible")&&(!this._options.onlyShowWhenOverflows||e.contentsOverflow(this._options.onlyShowWhenOverflows))&&!this._visible){if(this._visible=!0,this._options.openCloseOnHover&&(this._listen("click",this._onInteract),this._listen("keypress",this._onInteract)),this._initializeContent(),this.getElement().show(),this._setPositionInternal(n),this._fire("popup-opened"),this._documentEventDelegate)$(document).on("mousedown",this._documentEventDelegate);e.attachResize(this._element,l(this,this._setPosition));this._bind(this._$dropElement.parents(),"scroll",this._onForceHideDropPopupDelegate);this._escapeKeyHandler||(this._escapeKeyHandler=this.onEscapeKeyPressed.bind(this),document.addEventListener("keydown",this._escapeKeyHandler,!0));this._delayedShow&&this._delayedShow.cancel();this._$contentContainer.attr("aria-hidden","false")}},t.prototype.onEscapeKeyPressed=function(n){n.key==="Escape"&&(this.hide(),n.preventDefault(),n.stopPropagation())},t.prototype.hide=function(){(this._escapeKeyHandler&&document.removeEventListener("keydown",this._escapeKeyHandler,!0),this.isDisposed())||(this._delayedShow&&this._delayedShow.cancel(),this._visible)&&(this._visible=!1,this._documentEventDelegate&&$(document).off("mousedown",this._documentEventDelegate),e.detachResize(this._element),this._onForceHideDropPopupDelegate&&this._unbind(this._$dropElement.parents(),"scroll",this._onForceHideDropPopupDelegate),this._element.hide(),this._fire("popup-closed"),this._stopListening("mousemove"),this._$contentContainer.attr("aria-hidden","true"))},t.prototype.enable=function(){this._enabled=!0;(this._hasFocus||this._hasMouse)&&this._showDelayed()},t.prototype.disable=function(){this._enabled=!1;this.hide()},t.prototype._dispose=function(){if(n.prototype._dispose.call(this),this._options.setAriaDescribedBy){var i=this._$contentContainer.attr("id"),t=this._$dropElement.attr("aria-describedby")||"";t=t.replace(new RegExp("\\b".concat(i,"\\b"),"g"),"").trim().replace(/\s+/," ");t?this._$dropElement.attr("aria-describedby",t):this._$dropElement.removeAttr("aria-describedby")}this._documentEventDelegate&&($(document).off("mousedown",this._documentEventDelegate),this._documentEventDelegate=null);this._onForceHideDropPopupDelegate&&(this._unbind(this._$dropElement.parents(),"scroll",this._onForceHideDropPopupDelegate),this._onForceHideDropPopupDelegate=null);this._$dropElement&&this._$dropElement.length>=1&&(this._unbind(this._$dropElement,"click"),this._unbind(this._$dropElement,"remove.removePopupDropElement"),this._stopListening("mouseover"),this._stopListening("mouseout"),this._stopListening("mousemove"),this._stopListening("focus"),this._stopListening("blur"),this._stopListening("click"),this._stopListening("keypress"));e.detachResize(this._element)},t}(i.Control);t.PopupContentControlO=s;v=function(n){function t(){var t=__construct(this,n,arguments);for(var i in t)t.hasOwnProperty(i)&&(this[i]=t[i]);return t}return __extends(t,n),t}(s);t.PopupContentControl=v;h=function(n){function t(){var t=n!==null&&n.apply(this,arguments)||this;return t._onKeyDown=function(n){n.which===27&&t._visible&&(t._popupHasMouse=!1,t.hide())},t}return __extends(t,n),t.hide=function(){t._shownTooltip&&t._shownTooltip.hide()},t.prototype.initializeOptions=function(t){n.prototype.initializeOptions.call(this,$.extend({coreCssClass:"rich-content-tooltip",openCloseOnHover:!0,elementAlign:"middle-top",baseAlign:"middle-bottom",useMousePosition:!1},t))},t.prototype.initialize=function(){var i=this.getElement(),r=this._options,t;r.popupTag!==!1&&(this._$popupTag=$(c("div","popup-tag")).prependTo(i),this._popupHasMouse=!1,t=this,this._$popupTag[0].parentElement.addEventListener("mouseenter",function(){t._popupHasMouse=!0}),this._$popupTag[0].parentElement.addEventListener("mouseleave",function(){t._popupHasMouse=!1;t._delayedHide=u.delay(this,100,function(){t.hide();t._delayedHide=null})}));n.prototype.initialize.call(this);i[0].classList.add("v2");r.autoWidth&&i[0].classList.add("auto-width")},t.prototype._getPopupTooltipElement=function(){return this._$popupTag},t.prototype._show=function(i){if(document.addEventListener("keydown",this._onKeyDown),n.prototype._show.call(this,i),this._visible){var r=t._shownTooltip;r&&r!==this&&r.hide();t._shownTooltip=this}},t.prototype.hide=function(){this._popupHasMouse||(document.removeEventListener("keydown",this._onKeyDown),n.prototype.hide.call(this),t._shownTooltip===this&&(t._shownTooltip=null))},t.prototype._setPositionInternal=function(t){var f,i,r,e,o,s;if((n.prototype._setPositionInternal.call(this,t),this._visible)&&this._$popupTag){f=t&&t.useMousePosition&&this._options.useMousePosition!==!1;this._$popupTag.css({top:0,left:0});this._$contentContainer.toggleClass("mouse",f);i={left:parseInt(this._element.css("left"),10),top:parseInt(this._element.css("top"),10),width:this._element.outerWidth(),height:this._element.outerHeight()};r=void 0;f?r=this._mousePosition:(e=this._getDropElement(),o=e.offset(),r={left:o.left+e.outerWidth()/2,top:o.top});s=this._element.offset();r.left+=i.left-s.left;r.top+=i.top-s.top;var l=f?27:11,u=15,a=u*.5,c=u*(Math.SQRT2-1)*.5,v=c+u,h={left:Math.max(Math.min(r.left-a,i.left+i.width-v),i.left+c),top:i.top+l-u*.5};i.top<r.top-.5?(this._$popupTag.addClass("flipped"),h.top=i.top+i.height-11-u*.5):this._$popupTag.removeClass("flipped");this._$popupTag.css({left:h.left+"px",top:h.top+"px"})}},t.add=function(n,t,r){return r=__assign({openDelay:y,topOffsetPixels:0,mouseTopOffsetPixels:0,autoWidth:!0},r),typeof n=="string"?r.text=n:n&&(r.html=n),i.Enhancement.enhance(o,$(t),r)},t.addIfOverflow=function(n,t,i){return o.add(n,t,__assign(__assign({},i),{onlyShowWhenOverflows:t}))},t}(s);t.RichContentTooltipO=h;o=function(n){function t(){var t=__construct(this,n,arguments);for(var i in t)t.hasOwnProperty(i)&&(this[i]=t[i]);return t}return __extends(t,n),t}(h);t.RichContentTooltip=o});

define("VSS/Controls/Menus",["require","exports","q","VSS/Context","VSS/Contributions/Controls","VSS/Contributions/Services","VSS/Controls","VSS/Controls/PopupContent","VSS/Diag","VSS/Events/Action","VSS/Events/Handlers","VSS/Resources/VSS.Resources.Platform","VSS/Service","VSS/Utils/Array","VSS/Utils/Core","VSS/Utils/UI","VSS/Utils/String","VSS/VSS","VSS/ClientTrace/Contracts","VSS/Error","VSS/Telemetry/Services","VSS/LoaderPlugins/Css!VSS.Controls"],function(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w,b,k,d,g){function wt(n){var t;return n&&(t=n.state|it.None,n.disabled&&(t=t|it.Disabled),n.hidden&&(t=t|it.Hidden),n.toggled&&(t=t|it.Toggled)),t}function fi(n){var t=new v.StableSorter(function(n,t){var i=n.rank?n.rank:9999,r=t.rank?t.rank:9999;return i-r});return t.sort(n,!1)}var yt,ft,ut,it,pt,rt,dt,et,ot,bt,ht,ct,lt,at,gt,ni,ti,vt,kt,ii;Object.defineProperty(t,"__esModule",{value:!0});t.sortMenuItems=t.PopupMenu=t.PopupMenuO=t.Toolbar=t.MenuBar=t.MenuBarO=t.MenuOwner=t.Menu=t.MenuContributionProvider=t.MenuItem=t.MenuBase=t.MenuSelectionMode=t.MenuItemState=t.BLUR_CLOSE_TIMEOUT=t.menuManager=void 0;var nt=y.delegate,st=p.domElem,tt=p.KeyCode,ri=b.handleError,ui=b.getErrorMessage;t.BLUR_CLOSE_TIMEOUT=25,function(n){function t(n){return Boolean(n)&&n.which===2}function i(n){return Boolean(n)&&$(n.target).is("ul.menu")}n.isMiddleClick=t;n.targetIsMenu=i}(yt||(yt={})),function(n){function t(t){return t==="vertical"?n.Vertical:n.Horizontal}n.Horizontal=0;n.Vertical=1;n.parse=t}(ft||(ft={})),function(n){function t(t){switch(t){case"static":return n.Static;case"popup":return n.Popup;case"dropdown":return n.DropDown;case"chevron":return n.Chevron}return n.Normal}n.None=0;n.Normal=1;n.Static=2;n.Popup=3;n.DropDown=4;n.Chevron=5;n.SubMenu=6;n.parse=t}(ut||(ut={})),function(n){n[n.None=0]="None";n[n.Disabled=1]="Disabled";n[n.Hidden=2]="Hidden";n[n.Toggled=4]="Toggled"}(it=t.MenuItemState||(t.MenuItemState={})),function(n){n[n.None=0]="None";n[n.SingleSelect=1]="SingleSelect";n[n.MultiSelect=2]="MultiSelect"}(pt=t.MenuSelectionMode||(t.MenuSelectionMode={})),function(n){function t(t){switch(t){case"right-bottom":return n.RightBottom;case"left-bottom":return n.LeftBottom;case"left-top":return n.LeftTop}return n.RightJustify}n.RightBottom=0;n.RightJustify=1;n.LeftBottom=2;n.LeftTop=3;n.parse=t}(rt||(rt={}));dt=function(){function n(){this._executeEvent="execute-command";this._commandStates=null;this._commandStates={}}return n.prototype.getCommandState=function(n,t){var i=this._commandStates&&this._commandStates[n];return typeof i=="function"?i.call(t,n,t):i},n.prototype.updateCommandStates=function(n){var t=this;n&&$.each(n,function(n,i){t._commandStates[i.id]=wt(i)})},n.prototype.executeCommand=function(n){this._fireEvent(this._executeEvent,this,n)},n.prototype.attachExecuteCommand=function(n){this.attachEvent(this._executeEvent,n)},n.prototype.detachExecuteCommand=function(n){this.detachEvent(this._executeEvent,n)},n.prototype.fire=function(n,t,i){return this._fireEvent(n,t,i)},n.prototype._fireEvent=function(n,t,i){var r;if(this._events&&(this._events.invokeHandlers(n,t,i,function(n){if(n===!1)return r=!0,!0}),r))return!1},n.prototype.attachEvent=function(n,t){this._events||(this._events=new c.NamedEventCollection);this._events.subscribe(n,t)},n.prototype.detachEvent=function(n,t){this._events&&this._events.unsubscribe(n,t)},n}();t.menuManager=new dt;et=function(n){function t(t){var i=__construct(this,n,[t]);for(var r in i)i.hasOwnProperty(r)&&(this[r]=i[r]);return i._type=ut.parse(i._options.type),i._children=[],i}return __extends(t,n),t.prototype.getOwner=function(){return this._parent?this._parent.getOwner():this},t.prototype.getParent=function(){return this._parent},t.prototype.getParentMenu=function(){return undefined},t.prototype.getContextInfo=function(){return this._options.contextInfo},t.prototype.getActionArguments=function(){var n=this._options.arguments||this.actionArguments;return typeof n=="string"?{url:n}:typeof n=="function"?n.call(this,this.getOwner().getContextInfo()):n},t.prototype.getMenuType=function(){return this._type},t.prototype.updateCommandStates=function(n){this._updateCommandStates(n)},t.prototype.isMenuBar=function(){return this._type===ut.Static},t.prototype._fireUpdateCommandStates=function(n){(n=n||this,typeof this._options.updateCommandStates!="function"||this._options.updateCommandStates.call(n,n)!==!1)&&this._parent&&this._parent._fireUpdateCommandStates(n)},t.prototype._clear=function(){for(var t=this._children.length,n=0;n<t;n++)this._children[n]._clear(),this._children[n].dispose();this._children=[]},t.prototype._updateCommandStates=function(n){var t=this;this._commandStates||(this._commandStates={});n&&$.each(n,function(n,i){t._commandStates[i.id]=wt(i)})},t.prototype._updateContributedMenuItems=function(n){this._children&&this._children.forEach(function(t){t._updateContributedMenuItems(n)})},t}(e.Control);t.MenuBase=et;b.initClassPrototype(et,{_type:null,_parent:null,_children:null,_commandStates:null,actionArguments:null});ot=function(n){function i(t){var i=__construct(this,n,[t]);for(var r in i)i.hasOwnProperty(r)&&(this[r]=i[r]);i._isPinFocused=!1;i._quenchMouseLeave=!1;i._blockHoverOpenSubMenu=!1;i._isHidden=!1;i._item=i._options.item||{};i.setEnhancementOptions({coreCssClass:i._item.href?"menu-item-container":"menu-item",tagName:"li"});try{i.actionArguments=i._item.arguments}catch(u){}return i._align=rt.parse(i._options.align),i}return __extends(i,n),i.getScopedCommandId=function(n,t){return t?t+"-"+n:n},i.prototype.initializeOptions=function(t){n.prototype.initializeOptions.call(this,t)},i.prototype.getParentMenu=function(){return this._parent instanceof ht&&this._parent},i.prototype.getCommandId=function(){return i.getScopedCommandId(this._item.id,this._item.scope)},i.prototype.getAction=function(){var n=this._item.idIsAction;return n===!1?this._item.action:this._item.action||this.getCommandId()||this._item.href},i.prototype.hasAction=function(){var n=this.getAction();return n!==null&&typeof n!="undefined"},i.prototype.hasSubMenu=function(){return!this.isDefault()&&this._item.childItems},i.prototype.isDecorated=function(){return this._item.decorated===!0},i.prototype.isDefault=function(){return this._type===ut.None},i.prototype.isSeparator=function(){return this._item.separator===!0},i.prototype.isLabel=function(){return this.isSeparator()&&this._item.isLabel},i.prototype.isSelected=function(){return this._item.selected===!0},i.prototype.getCommandState=function(n,i){var r=null;return n=n||this._item.id,i=i||this,typeof this._options.getCommandState=="function"&&(r=this._options.getCommandState.call(this,n,i)),(r===null||typeof r=="undefined")&&this._parent&&typeof this._parent.getCommandState=="function"&&(r=this._parent.getCommandState(n,i)),(r===null||typeof r=="undefined")&&(r=t.menuManager.getCommandState(n,i)),(r===null||typeof r=="undefined")&&this._item.id===n&&(r=wt(i._item)),typeof r=="function"&&(r=r.call(this,n,this)),r},i.prototype.getIndex=function(){return this._index},i.prototype.setIndex=function(n){this._index=n},i.prototype.setIsHidden=function(n){this._isHidden=n;this._updateState()},i.prototype.isHidden=function(){if(this.isPinnable()&&this._parent&&this._parent.getMenuPinningOptions()){var n=this._parent.getMenuPinningOptions();if(n.hidePinnedItems&&this._isPinned&&!this._item.pinningOptions.neverHide||n.hideUnpinnedItems&&!this._isPinned&&!this._item.pinningOptions.neverHide)return!0}return Boolean((this.getCommandState()&it.Hidden)===it.Hidden||this._type===ut.None||this.isSeparator()&&this._item.hidden||this._isHidden)},i.prototype.isEnabled=function(){return this.isHidden()?!1:this.isSeparator()?void 0:(this.getCommandState()&(it.Disabled|it.Hidden))===it.None},i.prototype.isFocusable=function(){return!this.isHidden()&&this._item&&this._item.focusable!==!1},i.prototype.isToggled=function(){var n=!1;return this.isSeparator()||this.isHidden()||(n=(this.getCommandState()&it.Toggled)===it.Toggled),n},i.prototype.isPinnable=function(){return this._item.pinningOptions&&this._item.pinningOptions.isPinnable},i.prototype.isPinned=function(){return this._isPinned},i.prototype.getSelectionMode=function(){var n=this.getOwner()._options.selectionMode;return typeof n=="undefined"?pt.None:typeof n=="function"?n(this._item):n},i.prototype.initialize=function(){var f=this,t,r,u,i;n.prototype.initialize.call(this);this.isPinnable()&&(t=this.getParentMenu(),r=t&&t.getMenuPinningOptions(),r&&r.isPinningSource?(u=t.getParentMenu(),i=v.first(u._menuItems,function(n){return n._item&&n._item.id===f._item.id}),this._isPinned=i&&i.isPinnable()?i._isPinned:!!this._item.pinningOptions.isPinned):this._isPinned=!!this._item.pinningOptions.isPinned);this._decorate()},i.prototype.update=function(n){var t=this;n!==this._item&&(Object.keys(this._item).forEach(function(n){delete t._item[n]}),$.extend(this._item,n));this._clear();this._item.decorated=!1;this._element.empty();this._unbind("click mouseenter mouseleave mousedown mouseup keydown");this._decorate()},i.prototype.updateItems=function(n){this._clear();this._item.childItems=n},i.prototype._decorate=function(){var n=this._element,u,d,t,f,c,l;!this.isDecorated()&&this._item.href&&(n=$('<a class="menu-item" tabindex="-1"/>').appendTo(n),n.attr("href",this._item.href));this._$menuItemElement=n;var g=this.getOwner()._options.showIcon===!0,a=this.hasSubMenu(),v=this._item.showText!==!1,y=this._item.showHtml!==!1,o,i,s,r,w=!1,b=!1,h=!1,k="mi_"+e.getId();this._item.id&&(k+="_"+this._item.id);n.attr({id:k,tabindex:"-1"});this._element.attr({role:this.getAriaRole(),tabindex:"-1"});this.isDecorated()?r=n.children(".drop").eq(0):(n.addClass(this._options.cssCoreClass).addClass(this._options.cssClass),u=this._item.title,u||this._item.encoded||!this._item.setDefaultTitle&&this._item.showText!==!1?u||(u=""):u=this._item.text,this._element.attr("title",""),this.updateTitle(u),this._item.ariaLabel&&this._element.attr("aria-label",this._item.ariaLabel),this._item.id&&n.attr("command",this._item.id),this._item.cssClass&&n.addClass(this._item.cssClass),this._item.hidden&&n.addClass("invisible"),this._item.focusable===!1&&n.addClass("unfocusable"),this.isSeparator()?(n.addClass("menu-item-separator"),n.attr("role","separator"),n.removeAttr("tabindex"),o=this._createSeparatorElement(),this._item.text&&(o.text(this._item.text),o.removeClass("separator"),o.addClass("text-separator")),n.append(o)):(d=this._item.ariaLabel||this._item.text||this._item.title,g&&!this._item.noIcon&&(typeof this._item.icon=="string"&&this._item.icon.match(/^https?:\/\//)?this._item.icon=this._getExternalIcon.bind(this,this._item.icon):typeof this._item.icon=="string"&&this._item.icon.match(/^css:\/\//)&&(this._item.icon=this._item.icon.substr(6)),t=this._createIconElement(),typeof this._item.icon=="function"?t.append(this._item.icon.call(this,t)):this._item.icon&&t.addClass(this._item.icon),t.hasClass("bowtie-icon")&&t.removeClass("icon"),v||y&&this._item.html?t.attr("aria-hidden","true"):t.attr("role","button").attr("aria-label",d),n.append(t),w=!0),v&&(i=this._createTextElement(),this._item.encoded?i[0].innerHTML=this._item.text||"":typeof this._item.text=="string"?i.text(this._item.text):typeof this._item.text=="function"&&i.text(this._item.text.call(this)||""),!u&&jQuery("body").hasClass("gallery")&&(i.attr("aria-label","menuitem"),this._element.attr("aria-label","menuitem")),this._item.textClass&&i.addClass(this._item.textClass),i.attr("role","button"),b=!0,n.append(i)),y&&(h=!0,s=this._createHtmlElement(),f=this._item.html,typeof f=="function"&&(f=f.call(this)),f instanceof jQuery?s.append(this._item.html):typeof f=="string"?s.html(this._item.html):h=!1,this._item.htmlClass&&s.addClass(this._item.htmlClass),n.append(s)),h||b||!w||n.addClass("icon-only"),a&&(this._element.attr({"aria-haspopup":"true","aria-expanded":"false"}),this._item.hideDrop||(r=this._createDropElement(),c=this.getElement().css("display"),c!=="inline-block"&&c!=="table-cell"?n.prepend(r):n.append(r),n.addClass("drop-visible"))),this.isPinnable()&&!this._item.pinningOptions.hidePin&&(n.addClass("pin-visible"),this._pinElement=$("<i class='pin bowtie-icon' />"),this._pinElement.click(this._onPinClick.bind(this)),this._pinElement.attr({id:n.attr("id")+"_pin",role:"button",tabindex:"-1"}),n.append(this._pinElement))));this._updateState();l=this.isSelected();n.toggleClass("selected",l);l?this._element.attr("aria-checked","true"):this._element.removeAttr("aria-checked");this.isDefault()||this.isSeparator()?this.isSeparator()&&this._bind("click",function(n){n.stopPropagation()}):(this._bind("click",nt(this,this._onClick)),this._bind("mouseenter",nt(this,this._onMouseEnter)),"onpointerdown"in this._element[0]||this._bind("touchstart",nt(this,this._onTouchStart)),this._bind("pointerdown",nt(this,this._onPointerDown)),this._bind("pointerup",nt(this,this._onPointerUp)),this._bind("mouseleave",nt(this,this._onMouseLeave)),this._bind("mousedown",nt(this,this._onMouseDown)),this._bind("mouseup",nt(this,this._onMouseUp)),this._bind("keydown",this._onKeyDown.bind(this)),a&&r&&r.length>0&&this._bind(r,"click",nt(this,this._onDropClick)));this.getOwner()._options.markUnselectable===!0&&p.makeElementUnselectable(n[0])},i.prototype._getExternalIcon=function(n){return $("<img/>").attr("src",n)},i.prototype.select=function(n,t){n===void 0&&(n=!1);t===void 0&&(t=!0);this._parent._selectItem(this,n,t);this._parent._clearTimeouts()},i.prototype.focusPin=function(n){n===void 0&&(n=!0);this._isPinFocused=n;this._pinElement&&(this._pinElement.toggleClass("focus",this._isPinFocused),n&&p.tryFocus(this._pinElement))},i.prototype.deselect=function(){this._parent._selectItem(null)},i.prototype.escaped=function(){this.select()},i.prototype.execute=function(n){n;var t=this.getOwner();return this.collapse({immediate:!0}),t.escaped(),t.isMenuBar()&&n&&n.keepHighlight&&this.showHoverHighlight(),t._proceedBlur(),this.hasAction()?this.executeAction($.extend({},t.getActionArguments(),this.getActionArguments()),n?n.e:null):void 0},i.prototype.executeAction=function(n,i){var r=this.getAction(),l=this.getOwner(),e=r==="navigate"&&n.url||this._item.href,o,s,u,f;if(r){if(n.telemetry&&n.telemetry.area&&n.telemetry.feature&&g.publishEvent(new g.TelemetryEventData(n.telemetry.area,n.telemetry.feature,{CommandId:this.getCommandId()||"Unknown",GroupId:this._item.groupId,ContributionId:this._item.contributionId})),o=i&&(i.ctrlKey||i.metaKey),typeof r=="function"&&!(e&&o)&&(s=r.apply(this,[n,i]),!e||s===!1))return s;if(e){try{u=n.url;u||(u=this._item.href);f=null;n.target&&(f=n.target);o&&(f="_blank");f?h.getService().performAction(h.CommonActions.ACTION_WINDOW_OPEN,{url:u,target:n.target}):h.getService().performAction(h.CommonActions.ACTION_WINDOW_NAVIGATE,{url:u})}catch(i){}return!1}return l?l.executeAction(new c.CommandEventArgs(r,n,this)):t.menuManager.executeCommand(new c.CommandEventArgs(r,n,this))}},i.prototype.collapse=function(n){for(var t=this._parent,i=n&&n.immediate===!0;t;)typeof t.hide=="function"&&t.hide({immediate:i}),t=t._parent;this.getOwner().ownFocus()},i.prototype.setFocus=function(n){n===void 0&&(n=!0);var t=this._$menuItemElement;!t||this.isSeparator()||this.isDefault()||t.addClass("focus");t&&p.tryFocus(this._element)},i.prototype.removeFocus=function(){var n=this._$menuItemElement;!n||this.isSeparator()||this.isDefault()||n.removeClass("focus");this.focusPin(!1)},i.prototype.showHoverHighlight=function(){this._highlightHover=!0;this._updateState()},i.prototype.showPressedHighlight=function(){this.hasSubMenu()&&this.getSubMenu()._visible||(this._highlightPressed=!0,this._updateState())},i.prototype.removePressedHighlight=function(){this._highlightPressed&&(this._highlightPressed=!1,this._updateState())},i.prototype.removeHighlight=function(){this._highlightHover=!1;this._highlightPressed=!1;this._updateState()},i.prototype.updateTitle=function(n){this._setTooltip(null);this._item.setTitleOnlyOnOverflow&&this._item.showText!==!1?(n||(n=this._item.text),this._setTooltip(n,{onlyShowWhenOverflows:this._$menuItemElement[0],setAriaDescribedBy:!0})):(n&&!this.getParentMenu().openSubMenuOnHover&&this._setTooltip(n,{setAriaDescribedBy:!0}),this._item.showText!==!1||this._item.ariaLabel||this._element.attr("aria-label",n));this._options.item&&(this._options.item.title=n)},i.prototype._setTooltip=function(n,t){var i=this;this._tooltip&&this._tooltip.dispose();this._tooltip=n?o.RichContentTooltip.add(n,this._element[0],__assign({menuContainer:this._element,mouseEventFilter:function(n){return!(i.hasSubMenu()&&i.getSubMenu()._element[0].contains(n.target))}},t)):null},i.prototype.updateText=function(n){var t;typeof n=="string"?t=n:this._item&&typeof this._item.text=="function"&&(t=this._item.text.call(this));t&&this._$menuItemElement.children("span.text").text(t)},i.prototype.getSubMenu=function(n){var t,i;return n===void 0&&(n=!0),t=null,this.hasSubMenu()&&(this._children.length===0?n&&(i=this._parent&&this._parent._parent&&this._parent._parent._element||this._$menuItemElement,t=e.create(ht,i,$.extend({},this._options,this._item.childOptions,{earlyInitialize:!1,items:this._item.childItems,type:"submenu",cssCoreClass:"menu sub-menu",tagName:"ul",ariaLabel:this._item.ariaLabel})),t._element.addClass("menu"),t._element.attr("data-parent",this._$menuItemElement.attr("id")),t._parent=this,t._type=ut.SubMenu,this._children.push(t)):t=this._children[0]),t},i.prototype.tryShowSubMenu=function(n){var t=n&&n.immediate;return!this.isDefault()&&this.isEnabled()&&this.getSubMenu()?(this.showSubMenu({immediate:t}),!0):!1},i.prototype.showSubMenu=function(n){var i=n&&n.immediate===!0,r=n?n.showTimeout:undefined,u=n?n.callback:undefined,t=this.getSubMenu(),f=this._item.splitDropItem?this._item.splitDropItem:this,e=(n&&n.setFocus)!==!1;this._closeSubmenuOnMouseLeave=n&&n.closeOnMouseLeave;t.show({immediate:i,showTimeout:r,callback:u,element:f._$menuItemElement,align:this._align,setFocus:e})},i.prototype.hideSubMenu=function(n){var r=this;if(this.hasSubMenu()){var u=n&&n.immediate===!0,i=n&&n.callback,t=this.getSubMenu(!1);t&&t._parent===this&&t.hide({immediate:u,callback:function(){r._closeSubmenuOnMouseLeave=!1;typeof i=="function"&&i()}})}},i.prototype.hideSiblings=function(n){this._parent.hideChildren(this,n)},i.prototype.getAriaRole=function(){switch(this.getSelectionMode()){case pt.MultiSelect:return"menuitemcheckbox";case pt.SingleSelect:return"menuitemradio"}return"menuitem"},i.prototype._attachMenuEvents=function(){},i.prototype._createIconElement=function(){return $(st("span","icon menu-item-icon"))},i.prototype._createTextElement=function(){return $(st("span","text"))},i.prototype._createHtmlElement=function(){return $(st("span","html"))},i.prototype._createDropElement=function(){return $(st("div","drop"))},i.prototype._createSeparatorElement=function(){return $(st("div","separator"))},i.prototype._updateState=function(){var n,r,t;this._disposed||(n=this._$menuItemElement,!n||this.isSeparator()||this.isDefault()||(r=(this._item.splitDrop||this._item.splitDropItem||{})._$menuItemElement,this.isEnabled()?(n.toggleClass("hover",this._highlightHover),n.toggleClass("pressed",this._highlightPressed),this._element.attr("aria-disabled","false"),n.removeClass("disabled"),r&&r.toggleClass("split-drop-hover",this._highlightHover)):(n.addClass("disabled"),this._element.attr("aria-disabled","true"),n.removeClass("hover"),n.removeClass("pressed")),this._pinElement&&this._pinElement.toggleClass("focus",this._isPinFocused),n.toggleClass("toggle-on",this.isToggled())),n&&!this.isDefault()&&n.toggleClass("invisible",this.isHidden()),this._pinElement&&(this._pinElement.toggleClass(i.PinnedIconClass,this._isPinned),this._pinElement.toggleClass(i.UnpinnedIconClass,!this._isPinned),this._pinElement.attr("title",this._isPinned?l.MenuItemUnpinButtonLabel:l.MenuItemPinButtonLabel),t=null,this._isPinned?(i._unpinDescribedById||(i._unpinDescribedById=String(e.getId()),$(st("div")).attr("id",i._unpinDescribedById).addClass("visually-hidden").text(l.UnpinDescribedByText).appendTo(document.body)),t=i._unpinDescribedById):(i._pinDescribedById||(i._pinDescribedById=String(e.getId()),$(st("div")).attr("id",i._pinDescribedById).addClass("visually-hidden").text(l.PinDescribedByText).appendTo(document.body)),t=i._pinDescribedById),this._element.attr("aria-describedby",t)))},i.prototype._updateContributedMenuItems=function(t){var i=[this._item],r=function(n,i,u){for(var f,o=!1,e=0,s=t;e<s.length;e++)if(f=s[e],n.id===f.id&&n.sourceExtensionId===f.sourceExtensionId){u[i]=f;o=!0;break}!o&&Array.isArray(n.childItems)&&n.childItems.forEach(r)};i.forEach(r);i[0]!==this._item?this.update(i[0]):n.prototype._updateContributedMenuItems.call(this,t)},i.prototype._onPointerDown=function(n){var i=n.originalEvent;if(i.pointerType==="touch"){var r=this.hasSubMenu()&&this.getParentMenu().openSubMenuOnHover,t=this._children&&this._children[0],u=t&&t._visible;r&&(!u||t.shownTime>Date.now()-100)&&(this._handledPointerId=i.pointerId)}},i.prototype._onPointerUp=function(n){var t=n.originalEvent;t.pointerId===this._handledPointerId&&(this._blockClickUntil=Date.now()+500);this._handledPointerId=null},i.prototype._onTouchStart=function(n){!this.hasSubMenu()||!this.getParentMenu().openSubMenuOnHover||this._children&&this._children[0]&&this._children[0]._visible?this._onClick(n):(this._onMouseEnter(n),n.preventDefault())},i.prototype._onMouseEnter=function(n){var i,t,r,u,f;for(s.logTracePoint("MenuItem._onMouseEnter.start"),i=n.target;i&&i.tagName.toUpperCase()!=="UL";)i=i.parentElement;i===this._parent._element[0]&&(t=this.getOwner(),!this._blockHoverOpenSubMenu&&(t._active||t.openSubMenuOnHover)?(t.activate(),r=t._subMenuVisible,this.hideSiblings({immediate:this._options.immediateShowHide}),this.select(!0),(t!==this._parent||r||t.openSubMenuOnHover)&&(t._subMenuVisible=r,this.isEnabled()&&this.hasSubMenu()&&(u=this.getSubMenu(),u._parent===this&&(u._visible||(f=t.openSubMenuOnHover&&t===this._parent,this.showSubMenu({immediate:f&&!r?!1:this._options.immediateShowHide,showTimeout:f&&!r?200:undefined,closeOnMouseLeave:f,callback:function(){u.selectDefaultItem(!0)},setFocus:!1})))))):this.showHoverHighlight())},i.prototype._onMouseLeave=function(n){var r=this,i=this.getOwner(),t;if(this._quenchMouseLeave){this._quenchMouseLeave=!1;n.stopPropagation();return}this._closeSubmenuOnMouseLeave&&this.hideSubMenu({immediate:!1,hideTimeout:200,callback:function(){return r.removeHighlight()}});i._active?i!==this._parent?this.hasSubMenu()?(t=this.getSubMenu(),t._parent===this?t._visible||(this.deselect(),t._clearTimeouts()):this.deselect()):this.deselect():this.hasSubMenu()&&this.getSubMenu()._visible||this.removeHighlight():this.removeHighlight()},i.prototype._onMouseDown=function(n){this.showPressedHighlight();n.stopPropagation();n.preventDefault()},i.prototype._onMouseUp=function(){this.removePressedHighlight()},i.prototype._onClick=function(n){var u=this,t,i,r;if(yt.targetIsMenu(n))return!1;if(!yt.isMiddleClick(n)){if(this._blockClickUntil&&Date.now()<this._blockClickUntil){n.stopPropagation();n.preventDefault();return}if(i=this.actionArguments,i||(i={}),i.clickArguments||(i.clickArguments={}),$.extend(i.clickArguments,n),this.isEnabled()){if(this.hasSubMenu()&&this._item.clickOpensSubMenu!==!1)t=this.getSubMenu(),this.select(),t._parent===this&&t._visible?(this.getOwner().activate(),this._options.clickToggles===!0?(t.hide({immediate:!0}),this._blockHoverOpenSubMenu=!0,r=function(){u._blockHoverOpenSubMenu=!1;u._unbind("mouseleave",r)},this._bind("mouseleave",r),this.select()):t.ownFocus()):(this.getOwner().activate(),this.hideSiblings({immediate:!0}),this.showSubMenu({immediate:!0}),t.selectDefaultItem());else if(this.hasAction())return this.select(),this.execute({e:n,keepHighlight:this._parent.getMenuType()!==ut.SubMenu})===!0}else this.getOwner().activate(),this.hideSiblings({immediate:!0}),this.select();n.stopPropagation();n.preventDefault()}},i.prototype._onDropClick=function(){var n;return this.isEnabled()&&(this.getOwner().activate(),this.hasSubMenu()&&(n=this.getSubMenu(),n._parent===this&&n._visible?this._options.clickToggles===!0?(n.hide({immediate:!0}),this.select()):n.ownFocus():(this.hideSiblings({immediate:!0}),this.showSubMenu({immediate:!0}),n.selectDefaultItem()))),!1},i.prototype._onPinClick=function(n){n.stopPropagation();n.preventDefault();this.toggleIsPinned()},i.prototype.toggleIsPinned=function(n,t){var i,f,e,s,h,y,c,p,u,l,a,w,g,v,b,r,o,nt,k,d;if(n===void 0&&(n=!this._isPinned),this._isPinned=n,this._updateState(),i=this.getParentMenu(),f=i&&i.getMenuPinningOptions()||{},i&&i.updateAriaSetProperties(),e=[],f.isPinningSource)s=i.getParentMenu(),e.push(s);else if(f.isPinningTarget)for(s=i,h=0,y=this._parent._menuItems;h<y.length;h++)r=y[h],r.hasSubMenu()&&(c=r.getSubMenu(),p=c&&c.getMenuPinningOptions(),p&&p.isPinningSource&&e.push(c));if(e.length>0){for(l=void 0,a=0,w=e;a<w.length;a++){for(g=w[a],v=0,b=g._menuItems;v<b.length;v++)r=b[v],r.isPinnable()&&r._item.pinningOptions.groupId===this._item.pinningOptions.groupId&&(l=r),r._item.id===this._item.id&&(u=r);if(u)break}u&&(u._isPinned=this._isPinned,u._updateState(),o=u.getParentMenu(),o&&(o.updateAriaSetProperties(),l&&o.getMenuPinningOptions().pinItemsToEnd&&o.moveMenuItemAfter(u,l)))}if(f.closeOnPin&&(!t||t.unfocus)&&(this._quenchMouseLeave=!0,this._parent.selectLeft()),i&&!f.closeOnPin&&(nt=i.selectPrevItem()||i.selectNextItem(),nt||(i.hide({immediate:!0}),k=i.getParentMenu(),k&&k.selectFirstItem())),s.updateSourceMenu(this._item.pinningOptions.groupId),d=this._item.pinningOptions,d.onPinnedChanged)d.onPinnedChanged(this,this._isPinned,u)},i.prototype._onKeyDown=function(n){var i=function(){return!n.ctrlKey&&!n.altKey&&!n.shiftKey&&!n.metaKey},t;switch(n.keyCode){case tt.RIGHT:if(i()&&!this._isPinFocused&&this.isPinnable()&&!this._item.pinningOptions.hidePin)return this.focusPin(),!1;break;case tt.LEFT:if(i()&&this._isPinFocused)return this.focusPin(!1),this.select(),!1;break;case tt.SPACE:case tt.ENTER:return this.isEnabled()&&(this._isPinFocused?(this._element.focus(),this.toggleIsPinned()):this.hasAction()?this.execute({e:n}):this.hasSubMenu()&&(t=this.getSubMenu(!1),t&&t._visible||(this.hideSiblings({immediate:!0}),this.showSubMenu({immediate:!0}),this.getSubMenu().selectFirstItem()))),!1}},i.enhancementTypeName="tfs.menu.item",i.PinnedIconClass="bowtie-unpin",i.UnpinnedIconClass="bowtie-pin-unpin",i}(et);t.MenuItem=ot;b.initClassPrototype(ot,{_item:null,_align:null,_index:0,_highlightHover:!1,_highlightPressed:!1});bt=function(){function n(n,t,i,r,u,e,o){this._menu=n;this._webContext=t;this._contributionIds=i;this._contributionType=r;this._contributionQueryOptions=u||f.ContributionQueryOptions.IncludeRecursiveTargets;this._getMenuActionContext=e;this._options=o||{}}return n.prototype._immediateInstanceRequired=function(n){return n.id&&f.ExtensionHelper.hasContent(n)&&!n.properties.text},n.prototype._getContributions=function(){var n=this;return this._contributionsPromise||(this._contributionsPromise=this._contributionIds&&this._contributionIds.length?a.getService(f.ExtensionService).queryContributions(this._contributionIds,this._contributionQueryOptions,this._contributionType).then(function(t){var r=i.defer(),u=[];return t.forEach(function(t){var i=n._getContributionWithSource(t);i&&u.push(i)}),i.allSettled(u).then(function(n){var t=[];n.forEach(function(n){n.state==="rejected"&&console.error(n.reason);n.state==="fulfilled"&&n.value&&t.push(n.value)});r.resolve(t)},r.reject),r.promise}):i.resolve([])),this._contributionsPromise},n.prototype._getContributionWithSource=function(t){var r=t.id||"";return this._immediateInstanceRequired(t)?u.getBackgroundInstance(t,t.properties.registeredObjectId||r,this._webContext,this._webContext,this.getContributionSourceTimeout(),"Timed-out waiting for menu source provider for contribution: "+r).then(function(n){return{contribution:t,source:n}}):t.type===n.ACTION_TYPE||t.type===n.HYPERLINK_ACTION_TYPE?i.resolve({contribution:t}):null},n.prototype._makeThennable=function(n){return n&&typeof n.then=="function"?n:i.resolve(n)},n.prototype._contributionToMenuItems=function(t,r){var e=this,f=t.contribution.id||"",u;return t.source?(u=i.defer(),typeof t.source.getMenuItems=="function"?(r=$.extend({updateMenuItems:function(n){e._updateContributedMenuItems(n,t)}},r),this._makeThennable(t.source.getMenuItems(r)).then(function(n){n&&n.length?i.all(n.map(function(n){return e._updateContributedMenuFromSource(n,t.contribution,t.source)})).then(function(n){u.resolve(n)}):u.resolve(n)},u.reject)):this._getBasicMenuItemFromContribution(f,t.contribution,t.source).then(function(n){u.resolve([n])}),i.timeout(u.promise,n._contributionGetItemsTimeout,"Timed-out waiting for getMenuItems call from contribution: "+f)):this._immediateInstanceRequired(t.contribution)?i.resolve([]):this._getBasicMenuItemFromContribution(f,t.contribution,t.source).then(function(n){return[n]})},n._getMenuItemFromContributedMenuItem=function(t){var r={id:t.id,text:t.text,title:t.title,separator:t.separator,disabled:t.disabled,hidden:t.hidden,icon:t.icon,noIcon:t.noIcon,groupId:t.groupId,action:t.action,href:t.href,setDefaultTitle:!1};return t.pinningOptions&&(r.pinningOptions=t.pinningOptions),t.pinningMenuOptions&&(r.pinningMenuOptions=t.pinningMenuOptions),t.childItems&&(Array.isArray(t.childItems)?r.childItems=t.childItems.map(function(t){return n._getMenuItemFromContributedMenuItem(t)}):i.isPromise(t.childItems)&&(r.childItems=function(i,r,u){t.childItems.then(function(t){r((t||[]).map(function(t){return n._getMenuItemFromContributedMenuItem(t)}))},u)})),r},n.prototype._updateContributedMenuFromSource=function(t,u,e,o){var c=this,s;o===void 0&&(o=!0);s=o?n._getMenuItemFromContributedMenuItem(t):t;s.action=this._getMenuAction(u,e,s.action);var h=null,l=a.getService(f.ExtensionService).getBaseUri(u),v=f.ExtensionHelper.getPublisherId(u),y=f.ExtensionHelper.getExtensionId(u);return typeof s.icon=="string"&&(h=f.ExtensionHelper.resolveUriTemplate(s.icon,r.getDefaultWebContext(),l)),s.isContribution=!0,s.sourceExtensionId=v+"."+y,s.contributionId=u.id,s.title&&!s.text&&s.text!==""&&(this._options.defaultTextToTitle===!1&&s.icon?(s.showText=!1,s.showHtml=!1):s.text=s.title),o&&!s.groupId&&(s.groupId=u.properties.groupId),Array.isArray(s.childItems)&&s.childItems.forEach(function(n){c._updateContributedMenuFromSource(n,u,e,!1)}),h?h.then(function(n){return s.icon=n,s}):i.resolve(s)},n.prototype._getBasicMenuItemFromContribution=function(n,t,i){var e=this,o=t.properties.text||null,u=t.properties.title||null,s=this._makeThennable("");return typeof t.properties.icon=="string"&&(s=f.ExtensionHelper.resolveUriTemplateProperty(t,r.getDefaultWebContext(),"icon")),s.then(function(r){var s={id:n,text:o,title:u,icon:r,groupId:t.properties.groupId,action:e._getMenuAction(t,i,null),isContribution:!0,sourceExtensionId:f.ExtensionHelper.getPublisherId(t)+"."+f.ExtensionHelper.getExtensionId(t),contributionId:n};return o===null&&u&&(e._options.defaultTextToTitle===!1&&r?(s.showText=!1,s.showHtml=!1):s.text=u),s})},n.prototype._getMenuAction=function(t,i,r){var e=this,o;return!r&&t.type===n.ACTION_TYPE?function(){u.getBackgroundInstance(t,t.properties.registeredObjectId||t.id,e._webContext,e._webContext,e.getContributionSourceTimeout(),"Timed-out waiting for menu action: "+t.id).then(function(n){n.execute(e._getMenuActionContext())})}:typeof r=="function"?function(){return f.ExtensionHelper.publishTraceData(t),r(e._getMenuActionContext())}:t.properties.targetUri?function(){var n=a.getService(f.ExtensionService).getBaseUri(t),i=f.ExtensionHelper.resolveUriTemplate(t.properties.targetUri,e._getMenuActionContext(),n);i.then(function(n){f.ExtensionHelper.publishTraceData(t,n);window.location.href=n})}:i&&typeof i.execute=="function"?function(){return f.ExtensionHelper.publishTraceData(t),i.execute(e._getMenuActionContext())}:o},n.prototype._updateContributedMenuItems=function(n,t){var r=this;this._menu&&i.all(n.map(function(n){return r._updateContributedMenuFromSource(n,t.contribution,t.source)})).then(function(n){r._menu.updateContributedMenuItems(n)})},n.prototype.getContributedMenuItems=function(n){var t=this;return this._getContributions().then(function(r){var u=[];return r.forEach(function(i){u.push(t._contributionToMenuItems(i,n))}),i.allSettled(u).then(function(n){var t=[];return n.forEach(function(n){n.value&&n.value.length&&n.value.forEach(function(n){t.push(n)})}),t})})},n.prototype.getContributionSourceTimeout=function(){return this._menu&&this._menu._options&&this._menu._options.contributionSourceTimeoutMs||n.DEFAULT_CONTRIBUTION_SOURCE_TIMEOUT},n.ACTION_TYPE="ms.vss-web.action",n.HYPERLINK_ACTION_TYPE="ms.vss-web.hyperlink-action",n.DEFAULT_CONTRIBUTION_SOURCE_TIMEOUT=5e3,n._contributionGetItemsTimeout=2e3,n}();t.MenuContributionProvider=bt;ht=function(n){function i(t){var i=__construct(this,n,[t]);for(var r in i)i.hasOwnProperty(r)&&(this[r]=i[r]);return i._mouseIsDown=!1,i._shouldSelectFirstItem=!1,i.setEnhancementOptions({role:"menu",coreCssClass:"menu"+(i._options.useBowtieStyle?" bowtie-menus":""),tagName:"ul"}),i._menuItems=[],i._initializeItemsSource(),i}return __extends(i,n),Object.defineProperty(i.prototype,"shownTime",{get:function(){return this._shownTime},enumerable:!1,configurable:!0}),i.prototype.initializeOptions=function(t){n.prototype.initializeOptions.call(this,t);this.openSubMenuOnHover=t.alwaysOpenSubMenuOnHover},i.prototype.initialize=function(){n.prototype.initialize.call(this);this._options.suppressInitContributions||this.refreshContributedItems();this._decorate()},i.prototype._initializeItemsSource=function(){this._itemsSource=this._options.items},i.prototype._decorate=function(){this._element.addClass(this._options.cssCoreClass).addClass(this._options.cssClass).attr("tabindex","-1").attr("aria-label",this._options.ariaLabel);this._bind("mousedown",nt(this,this._onMouseDown));this._bind("keydown",this._onMenuKeyDown.bind(this));this._itemsSource=this.getGroupedItems();this._ensureChildren()},i.prototype.getItem=function(n){for(var i,t=0,r=this._menuItems.length;t<r;t++)if(i=this._menuItems[t],i&&n===i.getCommandId())return i;return null},i.prototype.getItems=function(){return this._menuItems},i.prototype.getItemByTag=function(n){for(var i,t=0,r=this._menuItems.length;t<r;t++)if(i=this._menuItems[t],i&&n===i._item.tag)return i;return null},i.prototype.getMenuItemSpecs=function(){return this._items},i.prototype.getParentMenu=function(){return this._parent&&this._parent._parent instanceof i&&this._parent._parent},i.prototype.getMenuPinningOptions=function(){var n=this._options.item;return n&&n.pinningMenuOptions?n.pinningMenuOptions:this._options.pinningMenuOptions},i.prototype.getCommandState=function(n,t){t=t||this;var i=null;return typeof this._options.getCommandState=="function"&&(i=this._options.getCommandState.call(t,n,t)),(i===null||typeof i=="undefined")&&(i=this._commandStates&&this._commandStates[n]),(i===null||typeof i=="undefined")&&this._parent&&typeof this._parent.getCommandState=="function"&&(i=this._parent.getCommandState(n,t)),typeof i=="function"&&(i=i.call(t,n,t)),i},i.prototype.updateCommandStates=function(t){n.prototype.updateCommandStates.call(this,t);this._skipUpdateMenuItemStates||this._updateMenuItemStates()},i.prototype.updateItems=function(n){this._updateItems(n,!0)},i.prototype._updateItems=function(n,t){if(!this._disposed){var i=this._menuItems.length;this._updateItemsWithContributions(n,this._contributedItems||[]);t&&this._refreshContributedMenuItems();i===0&&this._menuItems.length>0&&this._visible&&this._parent&&this._parent._element&&this._parent._element[0]===document.activeElement&&this.selectFirstItem()}},i.prototype._updateItemsWithContributions=function(n,t){this._disposed||(this._fire("menuUpdatingContributedItems",{source:this,existingItems:n,contributedItems:t}),n||(n=[]),Array.isArray(n)&&(n=$.grep(n,function(n){return!n.isContribution}),t&&t.length&&(n=n.concat(t))),this._contributedItems=t,this._updateCombinedSource(n),this._fire(i.CONTRIBUTION_ITEMS_UPDATED_EVENT,{source:this,existingItems:n,contributedItems:t}))},i.prototype._updateCombinedSource=function(n){var t,i,r;if(!this._disposed){if(i=!1,this._element[0].contains(document.activeElement)&&document.activeElement instanceof HTMLLIElement&&(i=!0,t=this._selectedItem&&this._selectedItem.getCommandId(),this._parent instanceof et&&this._parent.focus()),this._parent instanceof et&&n&&this._parent.getElement().attr({"aria-haspopup":String(n.length>0),"aria-expanded":this._visible}),this._asyncLoadingDelay||this._contributedItemsDelay){this._menuUpdateNeeded=!0;this._itemsSource=n;this.getOwner().focus();return}this._clear();this._itemsSource=n;this._initialized&&(this._menuUpdateNeeded=!1,this._itemsSource=this.getGroupedItems(),this._ensureChildren(),this.updateMenuItemStates(),typeof this._positioningRoutine=="function"&&this._positioningRoutine.call(this),i&&(r=t&&this.getItem(t),r?r.select():this.selectFirstItem()),this._shouldSelectFirstItem&&(this._shouldSelectFirstItem=!1,this.selectFirstItem()))}},i.prototype.getGroupedItems=function(){var n,t,i;if(!Array.isArray(this._itemsSource)||(n=[],t={__ungrouped__:[]},this._itemsSource.forEach(function(n){n.groupId&&(!n.separator||n.separator&&n.text)?t[n.groupId]?t[n.groupId].push(n):t[n.groupId]=[n]:t.__ungrouped__.push(n)}),t.__ungrouped__.length===this._itemsSource.length))return this._itemsSource;for(i=null,t.__ungrouped__=t.__ungrouped__.reduce(function(n,t,r,u){return t.separator&&!t.text&&(i&&i.separator||n.length===0||r===u.length-1)||n.push(t),i=t,n},[]),$.each(t,function(t,i){if(t==="__ungrouped__")return!0;Array.prototype.push.apply(n,i);n.push({separator:!0,isGroupSeparator:!0})}),(t.__ungrouped__.length===0||this._options.doNotSeparateUngroupedItems)&&n.splice(n.length-1,1),Array.prototype.push.apply(n,t.__ungrouped__);n.length>0&&n[n.length-1].separator;)n.splice(n.length-1,1);return n},i.prototype.appendItems=function(n){Array.isArray(n)&&n.length&&this.updateItems((this._itemsSource||[]).slice(0).concat(n))},i.prototype.appendItem=function(n){this._createChildMenuItem(n);this._items.push(n)},i.prototype.moveMenuItemAfter=function(n,t){var i;if(n===t)return!0;var f=this._children.indexOf(n),r=this._menuItems.indexOf(n),e=this._items.indexOf(n._item),o=this._children.indexOf(t)+1,u=this._menuItems.indexOf(t)+1,s=this._items.indexOf(t._item)+1;if(f<0||r<0||e<0||o<0||u<0||s<0)return!1;for(v.reorder(this._children,f,o,1),v.reorder(this._menuItems,r,u,1),v.reorder(this._items,e,s,1),i=Math.min(r,u);i<this._menuItems.length;i++)this._menuItems[i].setIndex(i);return n._element.detach(),n._element.insertAfter(t._element),!0},i.prototype.removeItem=function(n){for(var i,t=0,r=this._children;t<r.length;t++)if(i=r[t],i instanceof ot&&i._item===n)return this.removeMenuItem(i);return!1},i.prototype.removeMenuItem=function(n){var t=this._children.indexOf(n),i=this._menuItems.indexOf(n),r=this._items.indexOf(n._item);return t<0||r<0?!1:(this._children.splice(t,1),i>=0&&this._menuItems.splice(i,1),this._items.splice(r,1),n.dispose(),!0)},i.prototype._updateAllSourceMenus=function(){var t=this,n=[];this._items.forEach(function(i){i.pinningOptions&&n.indexOf(i.pinningOptions.groupId)<0&&(n.push(i.pinningOptions.groupId),t.updateSourceMenu(i.pinningOptions.groupId))})},i.prototype.updateSourceMenu=function(n){var i=this.getMenuPinningOptions()||{},r,t;i.isPinningTarget&&i.hideEmptySourceMenu&&(r=v.first(this._menuItems,function(t){return t._item&&t._item.pinningOptions&&t._item.pinningOptions.groupId===n&&!t.isPinned()}),t=v.first(this._menuItems,function(t){var r=t.getSubMenu(),i=r&&r.getMenuPinningOptions();return i&&i.isPinningSource&&i.groupId===n}),t)&&t.setIsHidden(!r)},i.prototype._enhance=function(t){n.prototype._enhance.call(this,t);this._enhanceChildren()},i.prototype._getMenuItemType=function(){return ot},i.prototype.getMenuItemOptions=function(n,t){return $.extend({earlyInitialize:!1,item:n,align:this.getMenuItemAlignment(),overflow:this._options.overflow},t)},i.prototype._getFirstMenuItem=function(){return this._getNextEnabledItem(0)},i.prototype._selectItem=function(n,t,i){if((t===void 0&&(t=!1),i===void 0&&(i=!0),this._selectedItem&&this._selectedItem!==n&&(this._selectedItem.removeHighlight(),this._selectedItem.removeFocus()),this._selectedItem=n,n)&&(n.showHoverHighlight(),!t)){var r=this.getOwner();r._focusItem=n;this._selectedItem.setFocus(i)}},i.prototype.selectDefaultItem=function(n){n||p.tryFocus(this._element)},i.prototype.selectFirstItem=function(){var n=this._getFirstMenuItem();return n?(this._selectItem(n),!0):(this._shouldSelectFirstItem=!0,!1)},i.prototype.selectLastItem=function(){var n=this._getPrevEnabledItem(-1,{rollOver:!0});n&&this._selectItem(n)},i.prototype.selectNextItem=function(){var t=0,r=this._menuItems,i=this._selectedItem,n;return r.length>0&&(i&&(t=i.getIndex()+1),n=this._getNextEnabledItem(t),n)?(n.select(),!0):!1},i.prototype.selectPrevItem=function(){var t=-1,r=this._menuItems,i=this._selectedItem,n;return r.length>0&&(i&&(t=i.getIndex()-1),n=this._getPrevEnabledItem(t),n)?(n.select(),!0):!1},i.prototype.selectDown=function(){if(this._menuItems.length>0){var n=this._getNextFocusableItem(this._selectedItem?this._selectedItem.getIndex()+1:0,{rollOver:!0});if(n)return n.select(),this._ensureVisible(n),!0}return!1},i.prototype.selectUp=function(){if(this._menuItems.length>0){var n=this._getPrevFocusableItem(this._selectedItem?this._selectedItem.getIndex()-1:-1,{rollOver:!0});if(n)return n.select(),this._ensureVisible(n),!0}return!1},i.prototype.selectRight=function(){return this._selectedItem&&this._selectedItem.tryShowSubMenu({immediate:!0})?(this._selectedItem.getSubMenu().selectFirstItem(),!0):this.getOwner()!==this?this.getOwner().selectRight({redirected:!0}):void 0},i.prototype.selectLeft=function(){return this._parent&&this._parent._parent!==this.getOwner()?(this.hide({immediate:!0}),this._parent.select(),!0):this.getOwner()!==this?this.getOwner().selectLeft({redirected:!0}):void 0},i.prototype.show=function(n){var f=n&&n.immediate===!0,e=n?n.showTimeout:undefined,t=n&&n.callback,i=n?n.element:null,r=n?n.align:rt.RightJustify,u=(n&&n.setFocus)!==!1;if(!i)throw new Error("options.element is required.");return f?(this._showPopup(i,r,u),t&&t()):this._startShowTimeout(i,r,u,e||this.getOwner()._options.showTimeout,t),!0},i.prototype.hide=function(n){var i=n&&n.immediate===!0,r=n?n.hideTimeout:undefined,t=n?n.callback:undefined;i?(this._hidePopup(),t&&t()):this._startHideTimeout(r||this.getOwner()._options.hideTimeout,t)},i.prototype.hideChildren=function(n,t){var i,f,r,u=this._children,e=t&&t.immediate===!0,o=n&&n._item&&n._item.splitDrop;if(Array.isArray(u))for(i=0,f=u.length;i<f;i++)r=u[i],r!==n&&r!==o&&r.hideSubMenu({immediate:e})},i.prototype.escape=function(){return this.hide({immediate:!0}),this._parent&&this._parent.escaped(),!0},i.prototype.ownFocus=function(){this._selectItem(this._selectedItem)},i.prototype.attach=function(n){this._parent!==n&&this._visible&&this.hide({immediate:!0});this._parent=n},i.prototype.getMenuItemAlignment=function(){return"right-justify"},i.prototype.updateMenuItemStates=function(){try{this._skipUpdateMenuItemStates=!0;this._fireUpdateCommandStates(this)}finally{this._skipUpdateMenuItemStates=!1}this._updateMenuItemStates()},i.prototype.executeAction=function(n){var i;return typeof this._options.executeAction=="function"&&(i=this._options.executeAction.call(this,n)),i!==!1&&(i=t.menuManager.executeCommand(n)),i},i.prototype._ensureVisible=function(n){if(n&&n.getElement()){var f=n.getElement(),t=this.getElement(),r=f.outerHeight(!0),i=n.getIndex()*r,u=i+r;i<t.scrollTop()?t.scrollTop(i):u-t.height()>t.scrollTop()&&t.scrollTop(u-t.height())}},i.prototype._getItems=function(){var n=this,i,t=!1;return this._items||(this._itemsSource?typeof this._itemsSource=="function"?(i=this._itemsSource.call(this,this.getOwner().getContextInfo(),function(i){n._asyncLoadingDelay&&(n._asyncLoadingDelay.cancel(),n._asyncLoadingDelay=null);n._items=i||[];t?n._disposed||n._updateItems(n._items,!1):t=!0},function(i){n._asyncLoadingDelay&&(n._asyncLoadingDelay.cancel(),n._asyncLoadingDelay=null);n._items=[{text:ui(i),icon:"icon-tfs-build-failed"}];t?n._disposed||n._updateItems(n._items,!1):t=!0;ri(i)}),t||(t=!0,i||(i=[],this._asyncLoadingDelay=y.delay(this,200,function(){n._asyncLoadingDelay=null;n._updateItems([{text:l.MenuItemsLoading}],!1)})),this._items=i)):this._items=this._itemsSource:this._items=[]),this._items},i.prototype._clear=function(){this._element[0].contains(document.activeElement)&&p.tryFocus(this._element);n.prototype._clear.call(this);this._menuItems=[];this._items=null;this._childrenCreated=!1},i.prototype._createChildMenuItem=function(n,t){var i,r;return r=this.getMenuItemOptions(n,n?n.extraOptions:undefined),i=t?e.Enhancement.enhance(this._getMenuItemType(),t,r):e.BaseControl.createIn(this._getMenuItemType(),this._element,r),i._parent=this,this._children.push(i),i._item.separator||(i.setIndex(this._menuItems.length),this._menuItems.push(i)),n.splitDropOptions&&(n.childItems||n.splitDropOptions.childItems)&&this._createSplitDropMenuItem(n,i),i.initialize(),i},i.prototype._createSplitDropMenuItem=function(n,t){var i=$.extend(n.splitDropOptions,{splitDropItem:t,childItems:n.splitDropOptions.childItems||n.childItems,showText:!1,showHtml:!1,toggled:n.toggled,disabled:n.disabled,title:n.splitDropOptions&&n.splitDropOptions.title,noIcon:n.splitDropOptions.noIcon!==undefined?n.splitDropOptions.noIcon:!0,cssClass:n.splitDropOptions.cssClass||"split-drop",splitDropOptions:null});n.splitDrop=this._createChildMenuItem(i);n.childItems=null;t._element.addClass("split-drop-item")},i.prototype._ensureChildren=function(){var t=this,n;this._childrenCreated||($.each(this._getItems(),function(n,i){t._createChildMenuItem(i)}),this._childrenCreated=!0,n=this.getMenuPinningOptions(),n&&n.isPinningTarget&&this._updateAllSourceMenus(),this.updateAriaSetProperties())},i.prototype._enhanceChildren=function(){var n=this,t=this._getItems();this._element.children("li").each(function(i,r){n._createChildMenuItem($.extend({},t[i],{decorated:!0}),$(r))});this._childrenCreated=!0;this.updateAriaSetProperties()},i.prototype.updateAriaSetProperties=function(){var i,t,r,u,f,n;if(this._menuItems){for(i=0,t=0,r=this._menuItems;t<r.length;t++)u=r[t],u.isFocusable()&&i++;for(f=0,n=0;n<this._menuItems.length;++n)this._menuItems[n].isFocusable()&&this._menuItems[n].getElement().attr({"aria-posinset":++f,"aria-setsize":i})}},i.prototype._getNextFocusableItem=function(n,t){return this._getNextItem(function(n){return n.isFocusable()},n,t)},i.prototype._getNextEnabledItem=function(n,t){return this._getNextItem(function(n){return n.isEnabled()},n,t)},i.prototype._getNextItem=function(n,t,i){function f(t,i){for(var f,r=t;r<=i;r++)if(f=u[r],n(f))return f;return null}var e=i&&i.rollOver===!0,r,u=this._menuItems;return(t=t||0,r=f(t,u.length-1),r)?r:e&&(r=f(0,t),r)?r:null},i.prototype._getPrevFocusableItem=function(n,t){return this._getPrevItem(function(n){return n.isFocusable()},n,t)},i.prototype._getPrevEnabledItem=function(n,t){return this._getPrevItem(function(n){return n.isEnabled()},n,t)},i.prototype._getPrevItem=function(n,t,i){function f(t,i){for(var f,r=i;r>=t;r--)if(f=u[r],n(f))return f;return null}var e=i&&i.rollOver===!0,r,u=this._menuItems;return(t=t||0,r=f(0,t),r)?r:e&&(r=f(t,u.length-1),r)?r:null},i.prototype._ensurePopup=function(){this._ensureInitialized()&&(this._popupElement=this._element);this._ensureChildren()},i.prototype._getPopupAlign=function(n){switch(n){case rt.RightJustify:return["left-top","right-top"];case rt.RightBottom:return["right-top","right-bottom"];case rt.LeftTop:return["left-bottom","left-top"]}return["left-top","left-bottom"]},i.prototype._showPopup=function(n,t,r){var f=this,u;this._clearTimeouts();this._ensurePopup();this.updateAriaSetProperties();this._pinElement=n;y.delay(this,300,function(){f._attachAncestorScroll(n)});this.updateMenuItemStates();u=this._getPopupAlign(t);this._element.show();this._parent instanceof et&&this._parent.getElement().attr("aria-expanded","true");this._positioningRoutine=function(){var f,e,o,t,r;(this._options.alignToMarkerVertical||this._options.alignToMarkerHorizontal)&&(typeof this._options.getAlignmentMarkers=="function"?(o=this._options.getAlignmentMarkers.call(this,this._element,n),f=o.elementAlignmentMarker,e=o.baseAlignmentMarker):(f=this._element.find(".alignment-marker").first(),e=n.find(".alignment-marker:not(.sub-menu .alignment-marker)").first()));t=this._options.overflow;t||(r=this._parent&&this._parent._parent,t=!(r instanceof i)||r instanceof vt||r instanceof lt?"fit-flip":"flip-flip");p.Positioning.position(this._element,n,{elementAlign:u[0],baseAlign:u[1],overflow:t,supportScroll:!0,scrollByMarker:this._options.scrollByMarker,alignToMarkerHorizontal:this._options.alignToMarkerHorizontal,alignToMarkerVertical:this._options.alignToMarkerVertical,elementAlignmentMarker:f,baseAlignmentMarker:e})};this._element[0].style.removeProperty("left");this._element[0].style.removeProperty("top");this._positioningRoutine.call(this);this._visible=!0;this._shownTime=Date.now();this.getOwner()._updateSubMenuVisibleState();r&&this.ownFocus()},i.prototype._hidePopup=function(){this._parent instanceof et&&this._parent.getElement()!=null&&this._parent.getElement().attr("aria-expanded","false");this._visible&&this._options.item.dynamic&&this._clear();this._clearTimeouts();this._visible=!1;this._pinElement&&(this._detachAncestorScroll(this._pinElement),this._pinElement=null);this._popupElement&&this._popupElement.hide();delete this._positioningRoutine;this.hideChildren(null,{immediate:!0});this.getOwner()._updateSubMenuVisibleState()},i.prototype._updateMenuItemStates=function(){function o(){return r&&u}function f(){var n=o();t&&t.isHidden()===n&&t.update($.extend(t._item,{separator:!0,hidden:!n}))}for(var n,t,r=!1,i=!1,u=!1,e=0,s=this._children;e<s.length;e++)n=s[e],n.isSeparator()&&!n.isLabel()?(i=!0,t=n,f()):(n.isHidden()||i?!n.isHidden()&&i&&(r=!0):u=!0,t&&o()&&!n.isHidden()&&(f(),t=null,i=!1,u=!0,r=!1),n._updateState(),n.updateText());f()},i.prototype._startShowTimeout=function(n,t,i,r,u){var f=this;this._clearTimeouts();this.delayExecute("show",r,!0,function(){f.isDisposed()||(f._showPopup(n,t,i),u&&u())})},i.prototype._startHideTimeout=function(n,t){var i=this;this._clearTimeouts();this.delayExecute("hide",n,!0,function(){i._hidePopup();t&&t()})},i.prototype._clearTimeouts=function(){this.cancelDelayedFunction("show");this.cancelDelayedFunction("hide")},i.prototype._attachAncestorScroll=function(n){this._bind($(n).parents(),"scroll",nt(this,this._onParentScroll))},i.prototype._detachAncestorScroll=function(n){this._unbind($(n).parents(),"scroll")},i.prototype._dispose=function(){this._pinElement&&this._detachAncestorScroll(this._pinElement);this._asyncLoadingDelay&&(this._asyncLoadingDelay.cancel(),this._asyncLoadingDelay=null);this._contributedItemsDelay&&(this._contributedItemsDelay.cancel(),this._contributedItemsDelay=null);this._options.executeAction=null;n.prototype._dispose.call(this)},i.prototype._onParentScroll=function(){p.BrowserCheckUtils.isEdge()&&this._mouseIsDown||this._hidePopup()},i.prototype._onMouseDown=function(){var n=this;p.BrowserCheckUtils.isEdge()&&(this._mouseIsDown=!0,this._bind(window.document,"mouseup",function(){n._mouseIsDown=!1;n._unbind(window.document,"mouseup")},!0))},i.prototype._onMenuKeyDown=function(n){var t=!n.ctrlKey&&!n.altKey&&!n.shiftKey;switch(n.keyCode){case tt.DOWN:if(t)return this.selectDown(),!1;break;case tt.UP:if(t)return this.selectUp(),!1;break;case tt.RIGHT:if(t)return this.selectRight(),!1;break;case tt.LEFT:if(t)return this.selectLeft(),!1;break;case tt.ESCAPE:if(this.escape())return!1;break;case tt.HOME:if(t)return this.selectFirstItem(),!1;break;case tt.END:if(t)return this.selectLastItem(),!1}},i.prototype.setContributedItemOptions=function(n,t,i){var r=!1;(this._options.contributionIds||[]).join(";")!==n.join(";")&&(this._options.contributionIds=n,r=!0);typeof t!="undefined"&&this._options.contributionType!==t&&(this._options.contributionType=t,r=!0);typeof i!="undefined"&&this._options.contributionQueryOptions!==i&&(this._options.contributionQueryOptions=i,r=!0);r&&(this._menuContributionProvider=null,this._menuUpdateNeeded=!0,this.refreshContributedItems())},i.prototype.refreshContributedItems=function(){var n=this;!this._menuContributionProvider&&this._options.contributionIds&&(this._menuContributionProvider=new bt(this,r.getDefaultWebContext(),this._options.contributionIds,this._options.contributionType,this._options.contributionQueryOptions,this._getContributionContext.bind(this),this._contributionProviderOptions),this._contributedItemsDelay=y.delay(this,100,function(){n._contributedItemsDelay=null;n._updateItems(n._items,!1)}));this._refreshContributedMenuItems()},i.prototype._refreshContributedMenuItems=function(){var n=this;this._menuContributionProvider&&(this._contributionPromise=this._menuContributionProvider.getContributedMenuItems(this._getContributionContext()).then(function(t){n._contributedItemsDelay&&(n._contributedItemsDelay.cancel(),n._contributedItemsDelay=null);(n._menuUpdateNeeded||t&&t.length)&&n._updateItemsWithContributions(n._itemsSource,t)},function(n){n.name=w.format("{0}.GetContributedMenuItemsError",n.name||"");n.message="getContributedMenuItems() failed in Menu._refreshContributedMenuItems: "+b.getErrorMessage(n);d.publishErrorToTelemetry(n,!1,k.Level.Warning,{thirdParty:!0})}))},i.prototype.updateContributedMenuItems=function(n){var t=this;this._contributionPromise.then(function(){var i=[];(function r(n){Array.prototype.push.apply(i,n);n.forEach(function(n){n.childItems&&n.childItems.length>0&&r(n.childItems)})})(n);i=i.filter(function(n){return!!n.id});t._updateContributedMenuItems(i)})},i.prototype._getContributionContext=function(){var n=this._options.contextInfo?$.extend({},this._options.contextInfo.item):{};return typeof n.getContributionContext=="function"?n=n.getContributionContext():typeof this._options.getContributionContext=="function"&&(n=this._options.getContributionContext()),n},i.enhancementTypeName="tfs.menu.menu",i.CONTRIBUTION_ITEMS_UPDATED_EVENT="menuContributedItemsUpdated",i}(et);t.Menu=ht;b.initClassPrototype(ht,{_items:null,_itemsSource:null,_menuItems:null,_selectedItem:null,_focusItem:null,_childrenCreated:!1,_popupElement:null,_visible:!1,_active:!1,_skipUpdateMenuItemStates:!1,_positioningRoutine:null,_pinElement:null});ct=function(n){function i(t){var i=__construct(this,n,[t]);for(var r in i)i.hasOwnProperty(r)&&(this[r]=i[r]);return i._focusing=!1,i.setEnhancementOptions({role:"menu"}),i._align=rt.parse(i._options.align),i}return __extends(i,n),i.prototype.initializeOptions=function(t){n.prototype.initializeOptions.call(this,$.extend({markUnselectable:!0,showIcon:!0,showTimeout:500,hideTimeout:500},t))},i.prototype.setShowIcon=function(n){this._options.showIcon=n},i.prototype.initialize=function(){n.prototype.initialize.call(this);this._fire("menuInitialized",{menu:this})},i.prototype._decorate=function(){var t=this;n.prototype._decorate.call(this);this._updateTabIndex(!0);this._bind(this._element,"keydown",this._onKeyDown.bind(this));this._bind(this._element,"focus",this._onFocus.bind(this));this._element[0].addEventListener("blur",this._onChildBlur.bind(this),!0);this._element[0].addEventListener("focus",this._onChildFocus.bind(this),!0);this._options.emptyMenuInTabOrder===!1&&this._bind(ht.CONTRIBUTION_ITEMS_UPDATED_EVENT,function(){t._isOwned(document.activeElement)||t._updateTabIndex()})},i.prototype.getMenuItemAlignment=function(){return this._options.popupAlign||n.prototype.getMenuItemAlignment.call(this)},i.prototype.getMenuItemOptions=function(t,i){return n.prototype.getMenuItemOptions.call(this,t,$.extend({immediateShowHide:!0,clickToggles:!0,type:"static"},i))},i.prototype.escape=function(){return!1},i.prototype.escaped=function(){},i.prototype.isActive=function(){return this._active},i.prototype.activate=function(n){if(n===void 0&&(n=!0),!this._activating){this._activating=!0;try{this._clearBlurTimeout();this._active=!0;n&&p.tryFocus(this._focusElement);typeof this._options.onActivate=="function"&&this._options.onActivate.call(this)}finally{this._activating=!1}}},i.prototype._hide=function(){this._active&&(this.hide({immediate:!0}),this.ownFocus())},i.prototype._blur=function(){this._clearBlurTimeout();this.hide({immediate:!0});this._disposed||this._selectItem(null);this._active=!1;typeof this._options.onDeactivate=="function"&&this._options.onDeactivate.call(this);this._disposed||this._updateTabIndex()},i.prototype._updateSubMenuVisibleState=function(){var n,u,t,r=this._menuItems,i;if(this._subMenuVisible=!1,Array.isArray(r))for(n=0,u=r.length;n<u;n++)if(t=r[n],t.hasSubMenu()&&(i=t.getSubMenu(!1),i&&i._parent===t&&i._visible)){this._subMenuVisible=!0;break}},i.prototype._updateTabIndex=function(n){this._options.inTabOrder!==!1&&(this._options.emptyMenuInTabOrder!==!1||this._menuItems.length>0)?this._element.attr("tabIndex",0):n&&this._element.attr("tabIndex",-1)},i.prototype._onKeyDown=function(n){if(n.keyCode===tt.TAB)this._immediateBlur=!0;else if(n.keyCode===tt.F10&&n.shiftKey)return this._onContextMenu(n)},i.prototype._onFocus=function(){var n=this,t;this._focusing||(this._focusing=!0,this.activate(!1),!this._selectedItem||this._selectedItem.getIndex()<0||!this._selectedItem._element?(t=this._getFirstMenuItem()||this._getNextFocusableItem(0),t&&y.delay(null,0,function(){n._selectItem(t)})):y.delay(null,0,function(){n._selectedItem&&n._selectedItem.select()}),this._focusing=!1)},i.prototype._isOwned=function(n){if(this._element[0].contains(n)){for(var t=n;t!==this._element[0]&&t!==document.body;t=t.parentElement)if(t.classList.contains("unfocusable"))return!1;return!0}return!1},i.prototype._onChildFocus=function(n){if(this._isOwned(n.target)){this._element.attr("tabindex","-1");var t=e.Enhancement.getInstance(ot,$(n.target)),i=t&&t.getParentMenu();t&&i&&i._selectItem(t)}},i.prototype._onChildBlur=function(){var n=this;y.delay(this,t.BLUR_CLOSE_TIMEOUT,function(){n._disposed||n._isOwned(document.activeElement)&&document.hasFocus()||(n._options.inTabOrder!==!1&&n._updateTabIndex(),n._immediateBlur?(n._immediateBlur=!1,n._blur()):n._blur())})},i.prototype._proceedBlur=function(){this._canBlur=!0},i.prototype._clearBlurTimeout=function(){this.cancelDelayedFunction("blur")},i.prototype._onParentScroll=function(){this._hide()},i.prototype._onResize=function(){this._hide()},i.prototype._onContextMenu=function(){return this.showSubMenuOnFocusedItem()},i.prototype.showSubMenuOnFocusedItem=function(){var n=this._focusItem;return n&&n.tryShowSubMenu({immediate:!0}),!1},i}(ht);t.MenuOwner=ct;b.initClassPrototype(ct,{_focusItem:null,_focusElement:null,_activating:!1,_subMenuVisible:!1,_align:null,_canBlur:!1,_immediateBlur:!1});lt=function(n){function t(t){var i=__construct(this,n,[t]);for(var r in i)i.hasOwnProperty(r)&&(this[r]=i[r]);return i.setEnhancementOptions({role:"menubar",coreCssClass:"menu-bar"+(i._options.useBowtieStyle?" bowtie-menus":"")}),i._orientation=ft.parse(i._options.orientation),i._type=ut.Static,i._contributionProviderOptions={defaultTextToTitle:!1},i}return __extends(t,n),t.prototype.initializeOptions=function(t){n.prototype.initializeOptions.call(this,t)},t.prototype.getMenuItemAlignment=function(){return this._orientation===ft.Horizontal?"left-bottom":"right-justify"},t.prototype.selectUp=function(t){return this._orientation===ft.Vertical?n.prototype.selectUp.call(this):n.prototype.selectLeft.call(this,t)},t.prototype.selectDown=function(t){return this._orientation===ft.Vertical?n.prototype.selectDown.call(this):n.prototype.selectRight.call(this,t)},t.prototype.selectLeft=function(){if(this._orientation===ft.Vertical)return n.prototype.selectLeft.call(this);var t=this._subMenuVisible;return(this.hideChildren(null,{immediate:!0}),n.prototype.selectUp.call(this),t&&(this._subMenuVisible=!0,this._selectedItem.tryShowSubMenu({immediate:!0})))?(this._selectedItem.getSubMenu().selectFirstItem(),!0):!1},t.prototype.selectRight=function(){if(this._orientation===ft.Vertical)return n.prototype.selectRight.call(this);var t=this._subMenuVisible;return(this.hideChildren(null,{immediate:!0}),n.prototype.selectDown.call(this),t&&(this._subMenuVisible=!0,this._selectedItem.tryShowSubMenu({immediate:!0})))?(this._selectedItem.getSubMenu().selectFirstItem(),!0):!1},t.tryActivate=function(n){var t=this._getMenuBar(n);return t?(t.focus(),!0):!1},t.tryShowSubMenu=function(n){var t=this._getMenuBar(n);return t?(t.focus(),y.delay(this,0,function(){t.showSubMenuOnFocusedItem()}),!0):!1},t.prototype.focus=function(){this.activate()},t._getMenuBar=function(n){var t=$(n);return e.Enhancement.getInstance(at,t)},t.enhancementTypeName="tfs.menu.menubar",t}(ct);t.MenuBarO=lt;at=function(n){function t(){var t=__construct(this,n,arguments);for(var i in t)t.hasOwnProperty(i)&&(this[i]=t[i]);return t}return __extends(t,n),t}(lt);t.MenuBar=at;gt=function(n){function t(t){var i=__construct(this,n,[t]);for(var r in i)i.hasOwnProperty(r)&&(this[r]=i[r]);return i.setEnhancementOptions({role:"toolbar"}),i}return __extends(t,n),t.prototype._getMenuItemType=function(){return ni},t}(at);t.Toolbar=gt;ni=function(n){function t(){var t=__construct(this,n,arguments);for(var i in t)t.hasOwnProperty(i)&&(this[i]=t[i]);return t}return __extends(t,n),t.prototype.getAriaRole=function(){return"listitem"},t}(ot);b.initClassPrototype(lt,{_orientation:ft.Horizontal});ti=function(n){function t(){var t=__construct(this,n,arguments);for(var i in t)t.hasOwnProperty(i)&&(this[i]=t[i]);return t}return __extends(t,n),t.prototype.escaped=function(){n.prototype.escaped.call(this);this._parent.escaped()},t}(ot);vt=function(n){function t(t){var i=n.call(this,$.extend({inTabOrder:!1},t))||this;return i.setEnhancementOptions({coreCssClass:"menu-popup"+(i._options.useBowtieStyle?" bowtie-menus":""),hidden:!0}),i._type=ut.Popup,i._hidden=i._options.hidden===!0,i._onHide=i._options.onHide,i}return __extends(t,n),t.prototype.initializeOptions=function(t){n.prototype.initializeOptions.call(this,t)},t.prototype._getMenuItemType=function(){return ti},t.prototype._decorate=function(){n.prototype._decorate.call(this);this._hidden===!0&&this._element.addClass("invisible")},t.prototype.popup=function(n,t){var r=this;if(this._escapeFocusReceiver=n,this._popupPinElement=t,this._floating=!0,this._active)this.escaped();else{var i=null,f=!1,u=function(){i&&(i.cancel(),i=null);r._active||f||(r.activate(),r._showPopupMenu(),f=!0)};this._contributionPromise?(this._contributionPromise.then(u),i=y.delay(this,500,u)):u()}},t.prototype._showPopupMenu=function(){var i=this._getFirstMenuItem(),n=i.getSubMenu(),t=this._options.setFocus!==!1;n&&(n.show({immediate:!0,element:this._popupPinElement,align:this._align,setFocus:t}),t&&n.selectDefaultItem())},t.prototype._updateItemsWithContributions=function(n,t){if(this._contributedItems=t,n&&n.length>0&&n[0].childItems){var i=$.grep(n[0].childItems,function(n){return!n.isContribution});n[0].childItems=i.concat(t)}else n=[{childItems:t}];this._updateCombinedSource(n)},t.prototype._updateCombinedSource=function(t){n.prototype._updateCombinedSource.call(this,t);this._active&&this._showPopupMenu()},t.prototype.selectUp=function(){return!0},t.prototype.selectDown=function(t){var i=t&&t.redirected;return!i&&this._align!==rt.RightJustify?n.prototype.selectRight.call(this):!1},t.prototype.selectFirstItem=function(){var t=this._getFirstMenuItem(),n=t.getSubMenu();return n._visible?n.selectFirstItem():!1},t.prototype.selectLeft=function(){return!0},t.prototype.selectRight=function(t){var i=t&&t.redirected;return!i&&this._align===rt.RightJustify?n.prototype.selectRight.call(this):!1},t.prototype.escaped=function(){this._floating&&(this._floating=!1,this._escapeFocusReceiver&&(this._escapeFocusReceiver.focus(),this._escapeFocusReceiver=null,typeof this._options.onPopupEscaped=="function"&&this._options.onPopupEscaped.call(this)))},t.prototype._hidePopup=function(){this._onHide&&this._onHide(this._escapeFocusReceiver);n.prototype._hidePopup.call(this)},t.enhancementTypeName="tfs.menu.popup",t}(ct);t.PopupMenuO=vt;kt=function(n){function t(){var t=__construct(this,n,arguments);for(var i in t)t.hasOwnProperty(i)&&(this[i]=t[i]);return t}return __extends(t,n),t}(vt);t.PopupMenu=kt;b.initClassPrototype(vt,{_align:rt.RightJustify,_floating:!1,_hidden:!1,_escapeFocusReceiver:null});ii=function(n){function i(t){return n.call(this,t)||this}return __extends(i,n),i.prototype.initialize=function(){var t=this._element.data();n.prototype.initialize.call(this);this._bind(t.commandAction||"click",nt(this,this.onCommandExecute));t.commandCompleteEvent&&this._bind(window,t.commandCompleteEvent,nt(this,this.onCommandComplete))},i.prototype.onCommandExecute=function(){var n=this._element.data();return n.commandName&&(this._element.prop("disabled",!0),this._element.prop("aria-disabled",!0),t.menuManager.executeCommand(new c.CommandEventArgs(n.commandName,n.commandArg,this))),!1},i.prototype.onCommandComplete=function(){this._element.prop("disabled",!1);this._element.prop("aria-disabled",!1)},i}(e.BaseControl);e.Enhancement.registerEnhancement(at,".menu-bar.enhance");e.Enhancement.registerEnhancement(kt,".menu-popup.enhance");e.Enhancement.registerEnhancement(ii,".single-command");t.sortMenuItems=fi;b.tfsModuleLoaded("VSS.UI.Controls.Menus",t)});

define("Gallery/Client/Controls/FilterControl/FilterControl.View",["require","exports","VSS/Controls","VSS/Adapters/Knockout","VSS/Controls/Menus","VSS/Utils/String","VSS/Utils/UI"],function(n,t,i,r,u,f,e){var o,s;Object.defineProperty(t,"__esModule",{value:!0});t.FilterControlView=void 0;o=function(n){function t(){var t=__construct(this,n,arguments);for(var i in t)t.hasOwnProperty(i)&&(this[i]=t[i]);return t._subscriptions=[],t._filterDropDowns=[],t}return __extends(t,n),t.prototype.initialize=function(){var t=this;n.prototype.initialize.call(this);this._$element=this.getElement();this._filterViewModel=this.getViewModel();this._filterViewModel.subscribe(this._filterViewModel.filters,function(){$.each(t._subscriptions,function(n,t){t.dispose()});t._subscriptions=[];$.each(t._filterViewModel.filters(),function(n,i){var r;r=t._filterViewModel.subscribe(t._filterViewModel.filters()[n].itemsList,function(){t._renderFilterMenu(n,i)});t._subscriptions.push(r);t._renderFilterMenu(n,i);r=t._filterViewModel.subscribe(t._filterViewModel.filters()[n].selectedItemIndex,function(i){t._filterViewModel.filters()[n].filterChangeCallBack(i)});t._subscriptions.push(r)})});this._filterViewModel.filters.notifySubscribers(this._filterViewModel.filters())},t.prototype._renderFilterMenu=function(n,t){var i=this._getFilterDropDownFromId(t.filterId);i?(i.setFilterOptionsAndIndex(t,n),i.displayDropDown()):(i=new s(n,t,this._filterViewModel,this._$element),this._filterDropDowns.push(i),i.displayDropDown())},t.prototype.dispose=function(){$(window).off("scroll");n.prototype.dispose.call(this)},t.prototype._getFilterDropDownFromId=function(n){var t;return this._filterDropDowns.forEach(function(i){f.ignoreCaseComparer(n,i.id)===0&&(t=i)}),t},t}(r.TemplateControl);t.FilterControlView=o;s=function(){function n(n,t,i,r){this.$parent=r;this.filterOptions=t;this.filterViewModel=i;this._index=n;this.id=t.filterId}return n.prototype.displayDropDown=function(){var n=this,t;if(this.filterOptions.itemsList().length>1||this.filterOptions.itemsList().length===1&&this.filterOptions.itemsList()[0].subFilterMenu){if(t=this.$parent.find(".filter-menu").eq(this._index),e.BrowserCheckUtils.isEdge())t.on("mouseup",function(i){if($(i.target).hasClass("filter-value")||$(i.target).hasClass("dropdown"))n._createFilterPopupMenu(t,n.filterOptions);else return!0});else t.on("click",function(){n._createFilterPopupMenu(t,n.filterOptions)});t.on("keydown",function(i){i.keyCode===e.KeyCode.ENTER&&n._createFilterPopupMenu(t,n.filterOptions)});$(window).on("scroll",function(){n.disposeDropDown()})}},n.prototype.disposeDropDown=function(){this._popupMenu&&(this._popupMenu.dispose(),delete this._popupMenu)},n.prototype.setFilterOptionsAndIndex=function(n,t){this._index=t;this.filterOptions=n},n.prototype._createFilterPopupMenu=function(n,t){if(this.disposeDropDown(),this.filterOptions.isExpanded(!0),t.isEnabled()&&this.filterViewModel.isEnabled()){var r=i.BaseControl.createIn(u.PopupMenu,n,{align:"left-bottom",showIcon:!1,items:[{childItems:this._getMenuItems(t.itemsList(),t.selectedItemIndex)}],onClose:this.closeFilterOptions.bind(this)});r.getElement().addClass("menu-popup");r.popup(n,n);r.selectFirstItem();this._popupMenu=r}},n.prototype.closeFilterOptions=function(){this.filterOptions.isExpanded(!1);this.disposeDropDown()},n.prototype._getMenuItems=function(n,t){var i=this,r=[];return $.each(n,function(n,u){var f={title:u.elementHoverTitle,showText:!0,action:function(){u.onClickCallback?u.onClickCallback():u.subFilterMenu||t(i._constructFilterElementIndexTree(u))},setTitleOnlyOnOverflow:!0};u.elementHtml?f.html=u.elementHtml:u.elementLabel&&(f.text=u.elementLabel);u.subFilterMenu&&(f.childItems=i._getMenuItems(u.subFilterMenu,t));u.disabled&&(f.hidden=!0);r.push(f)}),r},n.prototype._constructFilterElementIndexTree=function(n,t){if(n){var i={filterIndex:n.index};return t&&(i.childIndex=t),n.parent?this._constructFilterElementIndexTree(n.parent,i):i}},n}()});

define("Gallery/Client/Controls/FilterControl/FilterControl.ViewModel",["require","exports","knockout","VSS/Adapters/Knockout","VSS/Utils/String"],function(n,t,i,r,u){Object.defineProperty(t,"__esModule",{value:!0});t.FilterControlViewModel=void 0;var f=function(n){function t(t){var r=__construct(this,n,[]),u,f;for(u in r)r.hasOwnProperty(u)&&(this[u]=r[u]);return r.filters=i.observableArray([]),r.isEnabled=i.observable(!0),t&&t.filters&&(f=[],t.filters.forEach(function(n){n.itemsList&&f.push(r._observableFilterOptions(n))}),r.filters(f)),r}return __extends(t,n),t.prototype.addOrUpdateFilter=function(n,t){var u=this,i,r;t===void 0&&(t=-1);i=this._getFilterOptionsFromFilterId(n.filterId);!i&&n.itemsList?t===-1?this.filters.push(this._observableFilterOptions(n)):(r=this.filters.splice(t),this.filters.push(this._observableFilterOptions(n)),$.each(r,function(n,t){u.filters.push(t)})):n.itemsList&&this.filters.replace(i,this._observableFilterOptions(n))},t.prototype.isFilterNameVisible=function(n){return n===""?!1:!0},t.prototype.isFilterMenuTabIndex=function(n){return n?"0":null},t.prototype.isDropDownTabIndex=function(n,t){return n&&this.isEnabled()&&!t?"0":null},t.prototype.isDropDownVisible=function(n,t){return n?t():!1},t.prototype.getSelectedIndexForFilter=function(n){var t=null,i=this._getFilterOptionsFromFilterId(n);return i&&(t=i.selectedItemIndex()),t},t.prototype.getSelectedItemForFilter=function(n){var t=this._getFilterOptionsFromFilterId(n);return t?t.itemsList()[t.selectedItemIndex().filterIndex]:null},t.prototype.getSelectedItemLabelForFilter=function(n){var t=this._getFilterOptionsFromFilterId(n);return this._getSelectedItemLabelFromFilterOptions(t)},t.prototype.removeSelectedFilterOption=function(n){var t=this._getFilterOptionsFromFilterId(n);t&&this.filters.remove(t)},t.prototype._getFilterOptionsFromFilterId=function(n){var t=null;return $.each(this.filters(),function(i,r){u.ignoreCaseComparer(n,r.filterId)===0&&(t=r)}),t},t.prototype._observableFilterOptions=function(n){var u=null,t,r;return u=n.selectedItemIndex?n.selectedItemIndex:this._getItemIndexOfFirstLeafMenuItem(n.itemsList[0]),t={filterId:n.filterId,filterName:i.observable(n.filterName),itemsList:i.observable(n.itemsList),selectedItemIndex:i.observable(u),isEnabled:i.observable(n.isEnabled),filterChangeCallBack:n.filterChangeCallBack,isDropDown:this.computed(function(){return n.itemsList?n.itemsList.length>1?!0:!1:!1}),isCompleteFocus:n.isCompleteFocus?i.observable(!0):i.observable(!1),ariaLabelledByIds:n.ariaLabelledByIds,ariaDescribedByIds:n.ariaDescribedByIds,ariaLabel:r,isExpanded:i.observable(!1)},r=n.filterName+" "+this._getSelectedItemLabelFromFilterOptions(t),t.ariaLabel=r,t},t.prototype._getSelectedItemLabelFromFilterOptions=function(n){if(n){for(var r=n.selectedItemIndex(),u=n.itemsList()[r.filterIndex].elementLabel,i=n.itemsList()[r.filterIndex].subFilterMenu,t=r.childIndex;t&&i;)if(i.length>t.filterIndex&&i[t.filterIndex]){if(i[t.filterIndex].skipWhileDisplayingSelectedOptionLabel)break;u+="/"+i[t.filterIndex].elementLabel;i=i[t.filterIndex].subFilterMenu;t=t.childIndex}else break;return u}return null},t.prototype._getItemIndexOfFirstLeafMenuItem=function(n){var t,i;if(n)return t={filterIndex:0},n.subFilterMenu&&(i=this._getItemIndexOfFirstLeafMenuItem(n.subFilterMenu[0]),t.childIndex=i),t},t}(r.TemplateViewModel);t.FilterControlViewModel=f});

define("Gallery/Client/Service/SearchProvider/VSGallerySearchProvider",["require","exports","Gallery/Client/Service/VSGallery/IVSGallery","Gallery/Client/Service/VSGallery/VSGallery","VSS/Diag"],function(n,t,i,r,u){Object.defineProperty(t,"__esModule",{value:!0});t.VSGallerySearchProvider=void 0;var f=function(){function n(){this._vsGallery=new r.VSGallery}return n.prototype.searchWithParameters=function(n,t,i,r,u,f){var e=this._writeSearchOptions(n,t,i,r);this.search(e,u,f)},n.prototype.search=function(n,t,i){var f,r;n&&(f=null,n.sortBy>=0&&(f=n.sortBy),(n.costCategories||n.vsVersion)&&(r={},n.costCategories&&(r.costCategories=n.costCategories),n.vsVersion&&n.vsVersion.length>0&&(r.vsVersion=n.vsVersion)),this._vsGallery.beginSearchItems(this._createQueryFilters(n),n.pageNumber,n.pageSize,f,r).then(function(n){var i={searchResults:n.items,totalCount:n.totalCount};t(i)},function(){i()}))},n.prototype._createQueryFilters=function(n){var t=[{type:i.VSFilterType.SearchText,value:n.searchTerm}];return n.searchFilters&&(t=t.concat(n.searchFilters)),t},n.prototype._writeSearchOptions=function(n,t,i,r){var u=n.pricing,f=n.vsVersion;return{searchTerm:this._getSearchQuery(n.searchQuery),pageNumber:t,pageSize:i,sortBy:r,costCategories:[u],vsVersion:f}},n.prototype._getSearchQuery=function(n){var t="";return n&&(t=n),t},n}();t.VSGallerySearchProvider=f});

define("Gallery/Client/Service/SearchProvider/VSSGallerySearchProvider",["require","exports","Gallery/Client/Service/VSSGallery/VSSGallery","VSS/Utils/String","Gallery/Client/Service/VSSItem","VSS/Utils/Array","Gallery/Client/Common/Constants","VSS/FeatureAvailability/Services","VSS/Gallery/Contracts","Gallery/Scripts/Gallery/Resources/VSS.Resources.Gallery","Gallery/Scripts/Gallery/Resources/VSS.Resources.GalleryCommon"],function(n,t,i,r,u,f,e,o,s,h,c){Object.defineProperty(t,"__esModule",{value:!0});t.VSSGallerySearchProvider=void 0;var l=function(){function n(){this._vssGallery=new i.VSSGallery}return n.prototype.searchWithParameters=function(n,t,i,r,u,f){var e=this._writeSearchOptions(n,t,i,r);this.search(e,u,f)},n.prototype.search=function(n,t,i){n&&this._vssGallery.searchItems(n).then(function(n){var i={searchResults:n.items,totalCount:n.totalCount,categoryInfo:n.categoryInfo,targetPlatforms:n.targetPlatforms};t(i)},function(n){i(n)})},n.prototype._writeSearchOptions=function(n,t,i,u){var a=n.pricing,o=s.PublishedExtensionFlags.None,c=s.PublishedExtensionFlags.None,v=n.certified,f;if(a)switch(a){case e.FilterConstants.CostParamValueFree:o=s.PublishedExtensionFlags.Paid|s.PublishedExtensionFlags.Trial;break;case e.FilterConstants.CostParamValuePaid:c=s.PublishedExtensionFlags.Paid;break;case e.FilterConstants.CostParamValueTrial:c=s.PublishedExtensionFlags.Trial}var y=n.category,h=this._getTargetsAndVersion(n),l=null;if(n.visibilityQuery&&(r.equals(n.visibilityQuery,e.FilterConstants.VisibilityOrganization,!0)?(l="me",o=o|s.PublishedExtensionFlags.Public):r.equals(n.visibilityQuery,e.FilterConstants.VisibilityAll,!0)&&(l="me")),f={searchTerm:this._getSearchQuery(n,h.installationTargets),pageNumber:t,pageSize:i,installationTargets:h.installationTargets,categories:this._populateCategories(n),sortBy:u,excludeFlags:o,includeFlags:c,tags:null,orgSharedWith:l,targetPlatform:n.targetPlatform},h.versionRange&&(f.versionRange=h.versionRange),v)switch(v){case e.FilterConstants.CertifiedParamValueMicrosoft:f.publisherDisplayName=e.MICROSOFT;break;case e.FilterConstants.CertifiedParamValueCertifiedPublishers:f.includePublisherFlags=s.PublisherFlags.Certified}return f},n.prototype._populateCategories=function(n){var r=[],u=n.category,t=n.subCategory,i;return u!==c.AllCategoriesText&&(i=u,t&&t!==h.AllSubCategoryLabel&&(i+="/"+t),r.push(i)),r},n.prototype._getSearchQuery=function(n,t){if(n.isHosted){var i="";return n.searchQuery?i=n.searchQuery:t.forEach(function(n){i+='target:"'+n+'" '}),i}return null},n.prototype._getTargetsAndVersion=function(n){var i={installationTargets:[],versionRange:null},h;if(r.ignoreCaseComparer(n.product,e.SearchConstants.VSTSProductText)===0)h=n.installationTarget,i.installationTargets=h&&h===e.FilterConstants.InstallationTargetParamValueOnPrem?[u.ItemConstants.INSTALLATION_TARGET_EXTENSION,u.ItemConstants.INSTALLATION_TARGET_TFSEXTENSION,u.ItemConstants.INSTALLATION_TARGET_TFSINTEGRATION,u.ItemConstants.INSTALLATION_TARGET_INTEGRATION]:h&&h===e.FilterConstants.InstallationTargetParamValueCloud?[u.ItemConstants.INSTALLATION_TARGET_EXTENSION,u.ItemConstants.INSTALLATION_TARGET_INTEGRATION,u.ItemConstants.INSTALLATION_TARGET_HOSTED_EXTENSION,u.ItemConstants.INSTALLATION_TARGET_HOSTED_INTEGRATION,u.ItemConstants.INSTALLATION_TARGET_HOSTED_RESOURCE]:[u.ItemConstants.INSTALLATION_TARGET_EXTENSION,u.ItemConstants.INSTALLATION_TARGET_INTEGRATION,u.ItemConstants.INSTALLATION_TARGET_HOSTED_EXTENSION,u.ItemConstants.INSTALLATION_TARGET_TFSEXTENSION,u.ItemConstants.INSTALLATION_TARGET_TFSINTEGRATION,u.ItemConstants.INSTALLATION_TARGET_HOSTED_INTEGRATION,u.ItemConstants.INSTALLATION_TARGET_HOSTED_RESOURCE];else if(r.ignoreCaseComparer(n.product,e.SearchConstants.VSForMacProductText)===0)i.installationTargets=[u.ItemConstants.INSTALLATION_TARGET_VS_MAC];else if(r.ignoreCaseComparer(n.product,e.SearchConstants.VSCodeProductText)===0)i.installationTargets=[u.ItemConstants.INSTALLATION_TARGET_CODE];else if(r.ignoreCaseComparer(n.product,e.SearchConstants.VSProductText)===0){var s=n.vsVersion,c=o.FeatureAvailabilityService.isFeatureEnabled(e.FeatureFlag.EnableVersionRangeOnSearchPage),t=null;s?(f.contains(s,e.FilterConstants.VersionParamValueVS2010)?t="2010":f.contains(s,e.FilterConstants.VersionParamValueVS2012)?t="2012":f.contains(s,e.FilterConstants.VersionParamValueVS2013)?t="2013":f.contains(s,e.FilterConstants.VersionParamValueVS2015)?t="2015":f.contains(s,e.FilterConstants.VersionParamValueVS15)?t="2017":f.contains(s,e.FilterConstants.VersionParamValueVS2019)?t="2019":f.contains(s,e.FilterConstants.VersionParamValueVS2022)?t="2022":i.installationTargets=[u.ItemConstants.INSTALLATION_TARGET_VS_IDE],t&&(i.installationTargets=u.InstallationTargetToVSIdeMapping.getInstallationTargetsFromIdeVersion(t,c),c&&(i.versionRange=u.InstallationTargetToVSIdeMapping.getInstallationTargetVersionRangeFromIdeYear(t)))):i.installationTargets=[u.ItemConstants.INSTALLATION_TARGET_VS_IDE]}return i},n}();t.VSSGallerySearchProvider=l});

define("Gallery/Client/Service/SearchProvider/GallerySearchProviderFactory",["require","exports","Gallery/Client/Service/SearchProvider/IGallerySearchProviderFactory","Gallery/Client/Service/SearchProvider/VSGallerySearchProvider","Gallery/Client/Service/SearchProvider/VSSGallerySearchProvider"],function(n,t,i,r,u){Object.defineProperty(t,"__esModule",{value:!0});t.GallerySearchProviderFactory=void 0;var f=function(){function n(){}return n.getInstance=function(){return n._factoryInstance||(n._factoryInstance=new n),n._factoryInstance},n.prototype.getSearchProvider=function(n){if(n===i.SearchProviderType.VSSSearchProvider)return this._vssGallerySearchProvider||(this._vssGallerySearchProvider=new u.VSSGallerySearchProvider),this._vssGallerySearchProvider;if(n===i.SearchProviderType.VSSearchProvider)return this._vsGallerySearchProvider||(this._vsGallerySearchProvider=new r.VSGallerySearchProvider),this._vsGallerySearchProvider;throw"not a valid search type";},n}();t.GallerySearchProviderFactory=f});

define("Gallery/Client/Service/HistoryService",["require","exports"],function(n,t){Object.defineProperty(t,"__esModule",{value:!0});t.HistoryService=void 0;var i=function(){function n(){if(n._instance)throw new Error("Use HashDataService.getInstance");}return n.getInstance=function(){return n._instance},n.prototype.getCurrentHashData=function(){var n=window.location.hash;return n&&n[0]==="#"&&(n=n.substr(1)),n},n.prototype.setHashData=function(n){window.location.hash=n},n.prototype.replaceHashData=function(n){window.location.replace("#"+n)},n._instance=new n,n}(),r=function(){function n(){if(this.supportHash=!0,this.listeningPopStateChangeEvent=!1,this.stateChangeEventHandlers=[],n._instance)throw new Error("Use HistoryService.getInstance");window.history.pushState&&(this._isPushStateSupported=!0)}return n.getInstance=function(){return n._instance},n.prototype.pushState=function(t,i,r,u){this._isPushStateSupported?(u&&(u=this._addSlashAtEnd(u),r=u+r),window.location.protocol!=="file:"&&window.history.pushState(t,i,r)):n._hashDataService.setHashData(r)},n.prototype.getCurrentState=function(){return this._isPushStateSupported?window.history.state:n._hashDataService.getCurrentHashData()},n.prototype.getCurrentHash=function(){return n._hashDataService.getCurrentHashData()},n.prototype.replaceState=function(t,i,r,u){this._isPushStateSupported?(u&&(u=this._addSlashAtEnd(u),r=u+r),window.location.protocol!=="file:"&&window.history.replaceState(t,i,r)):n._hashDataService.replaceHashData(r)},n.prototype.registerHandler=function(n){if(!this.listeningPopStateChangeEvent){if(this._isPushStateSupported)$(window).on("popstate",this._onStateChanged.bind(this));else $(window).on("hashchange",this._onStateChanged.bind(this));this.listeningPopStateChangeEvent=!0}this.stateChangeEventHandlers.push(n)},n.prototype.detachHandler=function(n){this.stateChangeEventHandlers=this.stateChangeEventHandlers.filter(function(t){return t!==n})},n.prototype.isPushStateSupported=function(){return this._isPushStateSupported},n.prototype._addSlashAtEnd=function(n){return n[n.length-1]!=="/"&&(n+="/"),n},n.prototype._onStateChanged=function(){for(var t=this.getCurrentState(),i=this.stateChangeEventHandlers.length,n=0;n<i;n++)this.stateChangeEventHandlers[n](this,t)},n.prototype._isParentPage=function(n){var t=this._getLastPartOfUrl();return t&&t.toLowerCase()===n.toLowerCase()},n.prototype._getLastPartOfUrl=function(){for(var t=window.location.pathname.split("/"),i="",n=t.length-1;n>=0;)if(t[n].length===0)n--;else{i=t[n];break}return i},n.prototype._clearHash=function(){window.history.replaceState("",document.title,window.location.pathname)},n._instance=new n,n._hashDataService=i.getInstance(),n}();t.HistoryService=r});

define("Gallery/Client/Controls/ItemGrid/ItemGrid.View",["require","exports","VSS/Adapters/Knockout"],function(n,t,i){Object.defineProperty(t,"__esModule",{value:!0});t.ItemGridView=void 0;var r=function(n){function t(){var t=__construct(this,n,arguments);for(var i in t)t.hasOwnProperty(i)&&(this[i]=t[i]);return t}return __extends(t,n),t.TEMPLATE_ID="item-grid-template",t.TEMPLATE_HTML='\n   <div class="item-grid-container" data-bind="foreach: itemArray">\n        <div data-bind="template: { name: $parent.itemDisplayTemplate, data: $data }, css: \'grid-item\'"><\/div>\n    <\/div>',t}(i.TemplateControl);t.ItemGridView=r});

define("Gallery/Client/Controls/ItemGrid/ItemGrid.ViewModel",["require","exports","knockout","VSS/Utils/String","VSS/Adapters/Knockout"],function(n,t,i,r,u){Object.defineProperty(t,"__esModule",{value:!0});t.GridViewModel=void 0;var f=function(n){function t(r){var u=__construct(this,n,[]);for(var f in u)u.hasOwnProperty(f)&&(this[f]=u[f]);return u.itemArray=i.observableArray([]),u.itemDisplayTemplate=r&&r.itemDisplayTemplate?r.itemDisplayTemplate:t.DEFAULT_ITEM_TILE_TEMPLATE,r&&r.items&&u.update(r.items),u.selectNextItemCallbackHandler=u.selectNextItemCallbackHandler.bind(u),u.selectPrevItemCallbackHandler=u.selectPrevItemCallbackHandler.bind(u),u}return __extends(t,n),t.prototype.update=function(n){this._refreshData(n)},t.prototype.clear=function(){this._refreshData([])},t.prototype.appendItems=function(n){i.utils.arrayPushAll(this.itemArray,n);this.itemArray.valueHasMutated()},t.prototype._refreshData=function(n){this.itemArray(n);this.itemArray.valueHasMutated()},t.prototype.selectNextItemCallbackHandler=function(n,t){var u=this.itemArray().length,f,i;if(u){for(i=0;i<u;i++)if(r.ignoreCaseComparer(n,this.itemArray()[i].itemId)===0){f=i;break}f<u-1&&this.itemArray()[f+1].selectItem(t)}},t.prototype.selectPrevItemCallbackHandler=function(n,t){var f=this.itemArray().length,u,i;if(this.itemArray()&&f){for(i=0;i<f;i++)if(r.ignoreCaseComparer(n,this.itemArray()[i].itemId)===0){u=i;break}u>0&&this.itemArray()[u-1].selectItem(t)}},t.DEFAULT_ITEM_TILE_TEMPLATE="gallery-item-card-template",t}(u.TemplateViewModel);t.GridViewModel=f});

define("Gallery/Client/Controls/SearchBar/SearchBar.ViewModel",["require","exports","knockout","Gallery/Scripts/Gallery/Resources/VSS.Resources.Gallery","Gallery/Scripts/Gallery/Resources/VSS.Resources.GalleryCommon","VSS/Events/Services","VSS/Adapters/Knockout","VSS/Utils/Core","VSS/Utils/String"],function(n,t,i,r,u,f,e,o,s){Object.defineProperty(t,"__esModule",{value:!0});t.SearchBarViewModel=void 0;var h=f.getService(),l=o.delegate,c=function(n){function t(f){var e=__construct(this,n,[]);for(var o in e)e.hasOwnProperty(o)&&(this[o]=e[o]);return e.searchTerm=i.observable(""),e.isEnabled=i.observable(!0),e.placeHolder=r.SearchForExtensions,e.searchButtonTitle=u.SearchButtonTitle,e.clearSearchQuery=u.ClearSearchQueryTitle,e.inputFocus=function(){h.fire(t.EVENT_SEARCH_FOCUS,e)},e.clearSearchTerm=function(){e.searchTerm("")},e.submitSearchTerm=function(){if(e._hasTermChanged(e.searchTerm())){e.oldSearchTerm=e.searchTerm();var n=e.searchTerm().trim();t.setFocusOnSearchBox=!0;e.performSearchCallback(n)}},e.setNewSearchTerm=function(n){e.searchTerm(n);e.oldSearchTerm=e.searchTerm();t.setFocusOnSearchBox=!0},e.searchTerm(f.initialSearchTerm),e.oldSearchTerm=e.searchTerm(),e.performSearchCallback=f.searchClickCallback,f.isEnabled!==null&&e.isEnabled(f.isEnabled),e.subscribe(e.searchTerm,function(n){n===""&&e._hasTermChanged(n)&&(e.oldSearchTerm=n,t.setFocusOnSearchBox=!0,e.performSearchCallback(n))}),e}return __extends(t,n),t.prototype.clearButtonClick=function(){return this.isEnabled()?this.clearSearchTerm:null},t.prototype.searchButtonClick=function(){return this.isEnabled()?this.submitSearchTerm:null},t.prototype._hasTermChanged=function(n){return s.ignoreCaseComparer(n,this.oldSearchTerm)!==0},t.EVENT_SEARCH_FOCUS="VSS.Gallery.SearchInputFocus",t.setFocusOnSearchBox=!1,t}(e.TemplateViewModel);t.SearchBarViewModel=c});

define("Gallery/Client/Controls/SearchBar/SearchBar.View",["require","exports","Gallery/Client/Controls/SearchBar/SearchBar.ViewModel","VSS/Events/Services","VSS/Adapters/Knockout","VSS/Utils/Core"],function(n,t,i,r,u,f){Object.defineProperty(t,"__esModule",{value:!0});t.SearchBarView=void 0;var e=r.getService(),o=f.delegate,s=function(n){function t(){var t=__construct(this,n,arguments);for(var i in t)t.hasOwnProperty(i)&&(this[i]=t[i]);return t}return __extends(t,n),t.prototype.initialize=function(){n.prototype.initialize.call(this);this._searchBarViewModel=this.getViewModel();e.attachEvent(i.SearchBarViewModel.EVENT_SEARCH_FOCUS,o(this,this._onSearchTermCleared))},t.prototype._onSearchTermCleared=function(){$(".search-input").focus();i.SearchBarViewModel.setFocusOnSearchBox=!1},t.TEMPLATE_ID="searchbar-control-template",t.TEMPLATE_HTML='<div class="searchbar">\n        <input class="search-input" maxlength="200" data-bind="value: searchTerm, valueUpdate: \'keyup\'" autocomplete="off"/>\n        <span class="clearbutton bowtie-icon bowtie-math-multiply" data-bind="click: clearSearchTerm, visible: searchTerm().length > 0" tabindex="0"><\/span>\n        <span class="searchbutton bowtie-icon bowtie-search" data-bind="click: submitSearchTerm" tabindex="0"><\/span>\n    <\/div>',t}(u.TemplateControl);t.SearchBarView=s});

define("Gallery/Client/Controls/Category/Search.ViewModel",["require","exports","Gallery/Client/Controls/Category/BaseCategory.ViewModel","Gallery/Client/Common/Telemetry","Gallery/Client/Common/TelemetryInternal","Gallery/Scripts/Gallery/Resources/VSS.Resources.Gallery","Gallery/Scripts/Gallery/Resources/VSS.Resources.GalleryCommon","Gallery/Client/Controls/SearchBar/SearchBar.ViewModel","Gallery/Client/Common/Utility","VSS/Events/Services","VSS/Utils/Core","VSS/Utils/String","Gallery/Client/Controls/Category/BaseFilterDropdown"],function(n,t,i,r,u,f,e,o,s,h,c,l,a){Object.defineProperty(t,"__esModule",{value:!0});t.SearchViewModel=void 0;var p=c.delegate,y=r.CustomerIntelligenceConstants.MarketPlaceIntelligenceProperties.SearchAndCategoryPageProperties,v=i.BaseCategoryViewModel,w=function(n){function t(t){var i=__construct(this,n,[t]);for(var u in i)i.hasOwnProperty(u)&&(this[u]=i[u]);return i._externalSearchCallback=p(i,i._externalSearchQueryCallback),i._performanceScenario=r.PerformanceConstants.LoadSearchPage,h.getService().attachEvent(v.EVENT_ON_SEARCH,i._externalSearchCallback),i}return __extends(t,n),t.prototype.dispose=function(){h.getService().detachEvent(v.EVENT_ON_SEARCH,this._externalSearchCallback);n.prototype.dispose.call(this)},t.prototype.addToSuggestionsList=function(){if(this.searchPageParameters.searchQuery){var n=[f.SuggestionsListSpellingText,f.SuggestionsListDifferentWordsText];this.suggestionsList=s.FeatureFlagUtils.isNewZeroSearchResultExperienceEnabled()?n.concat([this.suggestionsList[1]]):n.concat(this.suggestionsList)}},t.prototype.setSearchBoxPlaceHolderText=function(){var n="";switch(this.currentTab()){case this.vsTabName:n=e.VS_Header;break;case this.vsForMacTabName:n=e.VSForMac_Header;break;case this.vstsTabName:n=s.FeatureFlagUtils.isMarketPlaceBrandingChangesEnabled()?e.AzureDevOps_Header:e.VSTS_Header;break;case this.vsCodeTabName:n=e.VSCode_Header;break;default:return}this.searchBarViewModel.placeHolder=l.format(e.SearchExtensions,n)},t.prototype._externalSearchQueryCallback=function(n,t){var i=t[0].searchQuery;this.searchBarViewModel.setNewSearchTerm(i);this._setSearchQuery(i);this.resetPageContextAndFetchPage()},t.prototype._resetAllParamsForBackNav=function(t,i){this.searchPageParameters.searchQuery=i[0].searchPageParams.searchQuery;this.searchBarViewModel.setNewSearchTerm(this.searchPageParameters.searchQuery);n.prototype._resetAllParamsForBackNav.call(this,t,i)},t.prototype.initializePage=function(){this._initializeViewModelOptionsForSearchBar();n.prototype.initializePage.call(this)},t.prototype._initializeViewModelOptionsForSearchBar=function(){var n=this;this.searchBarViewModel.performSearchCallback=function(t){n._setSearchQuery(t);var i={};i[y.SearchBoxLocation]="SearchPage";i[y.Action]=r.CustomerIntelligenceConstants.MarketPlaceIntelligenceFeature.SEARCH_BAR_USE;n.addParamsToTelemetryProperties(i);u.TelemetryHelper.publishEvent(r.CustomerIntelligenceConstants.MarketPlaceIntelligenceFeature.SEARCH_REFERER,i,!0,!1);n.allFilters.allFiltersList[a.AllFilters.SortFilter].initializeDefaultSortBy();n.allFilters.allFiltersList[a.AllFilters.SortFilter].initializeOptions();n.resetPageContextAndFetchPage()};this.searchBarViewModel.setNewSearchTerm(this.searchPageParameters.searchQuery)},t.prototype._setSearchQuery=function(n){n&&(n=this.sanitizeSearchQuery(n.trim()));this.searchPageParameters.searchQuery=n?n:""},t.prototype.sanitizeSearchQuery=function(n){return RegExp("<").test(n)&&(n=n.replace("<"," ")),RegExp("&#").test(n)&&(n=n.replace("&"," ")),n.trim()},t.prototype._productTargetToProductName=function(n){var t="";return $.each(v._productToTargetList,function(i,r){l.ignoreCaseComparer(n,r.target)===0&&(t=r.product)}),t},t.prototype._freezeControlsAndShowSpinner=function(t){this.searchBarViewModel.isEnabled(!t);n.prototype._freezeControlsAndShowSpinner.call(this,t)},t.prototype._setResults=function(t){n.prototype._setResults.call(this,t);o.SearchBarViewModel.setFocusOnSearchBox&&this.searchBarViewModel.inputFocus()},t.prototype._updatePageTitle=function(){var n=this._productTargetToProductName(this.searchPageParameters.product),t=e.VisualStudioMarketplace;n&&this.searchPageParameters.searchQuery?t=l.format(f.SearchPageTitle,this.searchPageParameters.searchQuery,n):n&&this.searchPageParameters.category&&(t=l.format(f.CategoryTitle,this.searchPageParameters.category,n));document.title=t},t}(i.BaseCategoryViewModel);t.SearchViewModel=w});

define("Gallery/Client/Controls/ZeroSearchResults/ZeroSearchResults.View",["require","exports","VSS/Adapters/Knockout"],function(n,t,i){Object.defineProperty(t,"__esModule",{value:!0});t.ZeroSearchResultsView=void 0;var r=function(n){function t(){var t=__construct(this,n,arguments);for(var i in t)t.hasOwnProperty(i)&&(this[i]=t[i]);return t}return __extends(t,n),t}(i.TemplateControl);t.ZeroSearchResultsView=r});

define("Gallery/Client/Controls/ZeroSearchResults/ZeroSearchResults.ViewModel",["require","exports","knockout","VSS/Adapters/Knockout","Gallery/Client/Common/Constants","Gallery/Scripts/Gallery/Resources/VSS.Resources.Gallery","Gallery/Client/Common/Telemetry","Gallery/Client/URLHelper","VSS/Utils/String","VSS/Utils/Url","Gallery/Client/Common/AccessibilityUtils"],function(n,t,i,r,u,f,e,o,s,h,c){Object.defineProperty(t,"__esModule",{value:!0});t.ZeroSearchResultsViewModel=void 0;var l=e.CustomerIntelligenceConstants.MarketPlaceIntelligenceProperties.SearchAndCategoryPageProperties,a=function(n){function t(t){var r=__construct(this,n,[]);for(var e in r)r.hasOwnProperty(e)&&(this[e]=r[e]);return r._koNoMatchTitle=i.observable(),r._koRelevantArticlesTitle=f.RelevantArticles,r._koSuggestionsTitle=f.Suggestions,r._koFeedbackTitle=f.SendFeedback,r._koSuggestions=i.observable(),r._koRelevantArticles=i.observableArray(),r._koExtraRelevantArticles=i.observableArray(),r._koSeeMoreText=f.SeeMore,r._koShouldShowSeeMore=i.observable(!1),r._koShowExtraList=i.observable(!1),r._koUserFeedback=i.observable(""),r._koFeedbackFormLabel=f.ItemDetailsFeedBack+" *",r._koShowFeedbackForm=i.observable(!0),r._koShowPostFeedbackMessage=i.observable(!1),r._koFeedbackPlaceholder=f.ZeroResultFeeedbackPlaceHolder,r._koSubmitFeedbackButton=f.ZeroResultFeedbackButton,r._koPostFeedbackText=f.ZeroResultPostFeedbackText,r._koNoResultsImagePath=h.combineUrl(o.GalleryURLs.getResourcePath(),u.GalleryImages.NoResultsImageIcon),r._productType="",r._searchTerm="",r._updateDataInternal(t),r._koSeeMoreEnter=r._koSeeMoreEnter.bind(r),r._koArticleClick=r._koArticleClick.bind(r),r}return __extends(t,n),t.prototype.updateZeroResultData=function(n){this._updateDataInternal(n)},t.prototype._koArticleClick=function(n){var t={};return t[l.Action]=e.CustomerIntelligenceConstants.MarketPlaceIntelligenceFeature.SEARCH_RESULTS_ARTICLE_CLICK,t[l.ProductType]=this._productType,t[l.RelatedArticleId]=n.id,t[l.RelatedArticleTitle]=n.title,e.TelemetryHelper.publishEventAsync(e.CustomerIntelligenceConstants.MarketPlaceIntelligenceFeature.SEARCH,t),!0},t.prototype._koSeeMoreClick=function(){this._koShouldShowSeeMore(!1);this._koShowExtraList(!0);var n={};n[l.Action]=e.CustomerIntelligenceConstants.MarketPlaceIntelligenceFeature.SEARCH_RESULTS_ARTICLES_SEEMORE;n[l.ProductType]=this._productType;e.TelemetryHelper.publishEventAsync(e.CustomerIntelligenceConstants.MarketPlaceIntelligenceFeature.SEARCH,n)},t.prototype._koSeeMoreEnter=function(){this._koSeeMoreClick();$(".relevant-articles-container.showList .article").eq(0).find("a").focus()},t.prototype._koSubmitFeedback=function(){var t=this._koUserFeedback(),n;t&&t.length>0&&(n={},n[l.Action]=e.CustomerIntelligenceConstants.MarketPlaceIntelligenceFeature.SEARCH_RESULTS_FEEDBACK,n[l.ProductType]=this._productType,n[l.SearchFeedback]=this._koUserFeedback(),e.TelemetryHelper.publishEventAsync(e.CustomerIntelligenceConstants.MarketPlaceIntelligenceFeature.SEARCH,n,!0),this._koShowFeedbackForm(!1),this._koShowPostFeedbackMessage(!0),c.announce(this._koPostFeedbackText))},t.prototype._updateDataInternal=function(n){n&&(n.searchTerm&&(this._koNoMatchTitle(s.format(f.ZeroSearchResultTitle,n.searchTerm)),this._searchTerm=n.searchTerm),n.suggestions&&this._koSuggestions(n.suggestions),n.productType&&(this._productType=n.productType),this._updateRelatedArticles(n.relatedArticles),this._koUserFeedback(""),this._koShowFeedbackForm(!0),this._koShowPostFeedbackMessage(!1))},t.prototype._updateRelatedArticles=function(n){n?n.length>2?(this._koRelevantArticles(n.slice(0,2)),this._koExtraRelevantArticles(n.slice(2)),this._koShouldShowSeeMore(!0)):(this._koRelevantArticles(n),this._koShouldShowSeeMore(!1)):(this._koRelevantArticles([]),this._koShouldShowSeeMore(!1))},t}(r.TemplateViewModel);t.ZeroSearchResultsViewModel=a});

define("VSS/Navigation/Services",["require","exports","VSS/Context","VSS/Events/Handlers","VSS/Navigation/HubsService","VSS/Navigation/NavigationHistoryService","VSS/Resources/VSS.Resources.Platform","VSS/Service","VSS/Utils/String"],function(n,t,i,r,u,f,e,o,s){function h(n,t){var i={};return t&&(n=n||t._a||t.action,i=$.extend(i,t),delete i.action,delete i._a),n&&(i.action=n),i}function v(){return o.getLocalService(c)}function l(n){return s.format(a(),n||"")}function a(){var n,t,r;try{if(n=o.getLocalService(u.HubsService),n&&(t=n.getHubGroupById(n.getSelectedHubGroupId()),r=t&&t.name,r))return s.format(e.PageTitleWithApplication,"{0}",r)}catch(f){}return i.getPageContext().webAccessConfiguration.isHosted?e.PageTitleWithContent_Hosted:e.PageTitleWithContent}Object.defineProperty(t,"__esModule",{value:!0});t.getDefaultPageTitleFormatString=t.getDefaultPageTitle=t.getHistoryService=t.HistoryService=void 0;var c=function(){function n(){var n=this;this._namedEvents=new r.NamedEventCollection;this._onHashChangedDelegate=this._onHashChanged.bind(this);this._navHistoryService=f.getNavigationHistoryService();window.history.pushState&&(this._usePushState=!0,this._navHistoryService.subscribe(this._onPopState.bind(this)));document.body.addEventListener("fpsCompleted",function(){n._lastNavigatedHashString=null;n._lastNavigatedQueryString=null})}return n.prototype.getCurrentFragment=function(){return this._usePushState?n.serializeState(this.getCurrentState()):this.getCurrentHashString()},n.prototype.getCurrentHashString=function(){var n=window.location.hash;return n&&n[0]==="#"&&(n=n.substr(1)),n},n.prototype.getCurrentQueryString=function(){var n=window.location.search;return n&&n[0]==="?"&&(n=n.substr(1)),n},n.prototype.getFragmentActionLink=function(t,i){return"#"+n.serializeState(h(t,i))},n.prototype.getCurrentState=function(){return $.extend(this._ignoreQueryString?{}:n.deserializeState(this.getCurrentQueryString()),n.deserializeState(this.getCurrentHashString()))},n.prototype.replaceHistoryPoint=function(n,t,i,r,u){u===void 0&&(u=!1);this.updateHistoryEntry(n,t,!0,u,i,r)},n.prototype.addHistoryPoint=function(n,t,i,r,u){u===void 0&&(u=!0);this.updateHistoryEntry(n,t,!1,u,i,r)},n.prototype.updateHistoryEntry=function(t,i,r,u,f,e){var o={},s,c,l;u?(o=this.getCurrentState(),$.each(h(t,i),function(n,t){t===null||typeof t=="undefined"?delete o[n]:o[n]=t})):$.each(h(t,i),function(n,t){t!==null&&typeof t!="undefined"&&t!==""&&(o[n]=t)});s="";c="";this._usePushState?c=n.serializeState(o):s=n.serializeState(o);(s!==this.getCurrentHashString()||c!==this.getCurrentQueryString())&&(this._suppressNavigate=e===!0,this._usePushState?(l=this._getRootUrl(),c&&(l+="?"+c),r?this._navHistoryService.replaceState(null,l):this._navHistoryService.pushState(null,l),this._onNavigate()):r?window.location.replace("#"+s):window.location.hash=s);f&&(document.title=f)},n.serializeState=function(n){var t=[];return $.each(n,function(n,i){if(i!==null&&typeof i!="undefined"){var r=n==="action"?"_a":n;t.push(r+"="+encodeURIComponent(i))}}),t.join("&")},n.deserializeState=function(n){var t={},i=(n||"").split("&");return i.forEach(function(n){var r=n.split("=",2),i,u;if(r.length===2){i=r[0];i==="_a"&&(i="action");u=r[1].replace(/\+/g,"%20");try{t[i]=decodeURIComponent(u)}catch(f){t[i]=u}}}),t},n.prototype.attachNavigate=function(n,t,i){if(typeof n=="function"){this.attachNavigate(null,n,t||i);return}if(t&&(this._initialized?(this._lastNavigatedHashString!==this.getCurrentHashString()||this._lastNavigatedQueryString!==this.getCurrentQueryString())&&this._setLastNavigateState():(this._initialized=!0,this._suppressNavigate=!1,this._setLastNavigateState(),$(window).bind("hashchange",this._onHashChangedDelegate),this._usePushState&&this._moveHashStateToQueryParams()),this._namedEvents.subscribe(n?n.toString():"*",t),i)){var r=this.getCurrentState();(!n||r.action&&s.equals(r.action,n.toString(),!0))&&(this._setLastNavigateState(),t(this,r))}},n.prototype.detachNavigate=function(n,t){this._initialized&&(typeof n=="function"?this._namedEvents.unsubscribe("*",n):t&&n&&this._namedEvents.unsubscribe(n.toString(),t),this._namedEvents.hasSubscribers()||(this._initialized=!1,$(window).off("hashchange",this._onHashChangedDelegate)))},n.prototype.pushState=function(n){this._lastNavigatedHashString=null;this._lastNavigatedQueryString=null;this._navHistoryService.pushState(null,n)},n.prototype.replaceState=function(n){this._lastNavigatedHashString=null;this._lastNavigatedQueryString=null;this._navHistoryService.replaceState(null,n)},n.prototype._getFullTitle=function(n){return n?l(n):null},n.prototype._getRootUrl=function(){var n=window.location.href,i=n.indexOf("?"),t;return i>=0&&(n=n.substr(0,i)),t=n.indexOf("#"),t>=0&&(n=n.substr(0,t)),n},n.prototype._moveHashStateToQueryParams=function(){var n=this.getCurrentHashString();n&&this._navHistoryService.replaceState(null,this._getRootUrl()+"?"+n)},n.prototype._onHashChanged=function(){this._usePushState?this._moveHashStateToQueryParams():this._ignoreQueryString=!0;this._onNavigate()},n.prototype._onPopState=function(n){this._initialized&&!n.isNewRouteId&&(this._moveHashStateToQueryParams(),this._onNavigate())},n.prototype._onNavigate=function(){if(this._suppressNavigate)this._suppressNavigate=!1,this._setLastNavigateState();else if(this.getCurrentHashString()!==this._lastNavigatedHashString||this.getCurrentQueryString()!==this._lastNavigatedQueryString){this._setLastNavigateState();var n=this.getCurrentState();n.action&&this._namedEvents.invokeHandlers(n.action,this,n);this._namedEvents.invokeHandlers("*",this,n)}},n.prototype._setLastNavigateState=function(){this._lastNavigatedHashString=this.getCurrentHashString();this._lastNavigatedQueryString=this.getCurrentQueryString()},n}();t.HistoryService=c;t.getHistoryService=v;t.getDefaultPageTitle=l;t.getDefaultPageTitleFormatString=a});

define("Gallery/Client/Controls/NewImageControl/NewImage.View",["require","exports","VSS/Utils/String","VSS/Adapters/Knockout"],function(n,t,i,r){Object.defineProperty(t,"__esModule",{value:!0});t.ImageView=void 0;var u=function(n){function t(){var t=__construct(this,n,arguments);for(var i in t)t.hasOwnProperty(i)&&(this[i]=t[i]);return t}return __extends(t,n),t.prototype.initialize=function(){var t=this;n.prototype.initialize.call(this);$(".image-display").on("load",function(){var n=t.getElement().find(".image-display");n&&n[0]&&t.centerImage(n[0])});$(".image-display").on("error",function(){var i=t.getViewModel(),n=t.getElement().find(".image-display");n&&n[0]&&t.imageOnError(i,n[0])})},t.prototype.imageOnError=function(n,t){var r=t,u;r&&(u=r.getAttribute("src"),i.ignoreCaseComparer(u,n.fallbackImageSrc)!==0?r.setAttribute("src",n.fallbackImageSrc):(n._hideIfNotFound&&(n.imageVisible=!1),this.imageOnError=function(){}),n.imageVisible||r.setAttribute("style","display:none"))},t.prototype.centerImage=function(n){setTimeout(function(){var i=$(n.parentElement).height(),r=$(n.parentElement).width(),u=$(n).height(),t,f;t=r<i?r:i;f=t>u?(t-u)/2:0;$(n).css("top",f+"px");$(n).css("visibility","visible")},0)},t}(r.TemplateControl);t.ImageView=u});

define("Gallery/Client/Controls/NewImageControl/NewImage.ViewModel",["require","exports","VSS/Adapters/Knockout"],function(n,t,i){Object.defineProperty(t,"__esModule",{value:!0});t.NewImageViewModel=void 0;var r=function(n){function t(t){var i=__construct(this,n,[]);for(var r in i)i.hasOwnProperty(r)&&(this[r]=i[r]);return i.imageStyle="",i.imageVisible=!0,i.imageSrc=t.imageUrl,i.fallbackImageSrc=t.fallbackImageUrl||i.imageSrc,i._hideIfNotFound=t.hideIfNotFound,i.imageStyle=t.imageStyle,i.bowtieStyle=t.bowtieStyle,i._hideIfNotFound&&!t.imageUrl&&(i.imageVisible=!1),i}return __extends(t,n),t.prototype.isBowtieVisible=function(){return!this.imageVisible&&this.bowtieStyle!=null},t}(i.TemplateViewModel);t.NewImageViewModel=r});

define("Gallery/Client/Pages/Category/Category.View",["require","exports","Gallery/Client/Controls/Category/BaseCategory.ViewModel","Gallery/Client/Pages/Common/Base.View","Gallery/Client/Controls/Category/Category.View","Gallery/Client/Common/Constants","Gallery/Client/Controls/FilterControl/FilterControl.View","Gallery/Client/Controls/FilterControl/FilterControl.ViewModel","Gallery/Client/Common/Telemetry","Gallery/Scripts/Gallery/Resources/VSS.Resources.Gallery","Gallery/Scripts/Gallery/Resources/VSS.Resources.GalleryCommon","Gallery/Client/Service/SearchProvider/GallerySearchProviderFactory","Gallery/Client/Service/HistoryService","Gallery/Client/Controls/ItemGrid/ItemGrid.View","Gallery/Client/Controls/ItemGrid/ItemGrid.ViewModel","Gallery/Client/Controls/SearchBar/SearchBar.View","Gallery/Client/Controls/SearchBar/SearchBar.ViewModel","Gallery/Client/Controls/Category/Search.ViewModel","Gallery/Client/Controls/ZeroSearchResults/ZeroSearchResults.View","Gallery/Client/Controls/ZeroSearchResults/ZeroSearchResults.ViewModel","Gallery/Client/URLHelper","Gallery/Client/Common/Utility","Gallery/Client/Common/Utility.Common","VSS/Context","VSS/Controls","VSS/Diag","VSS/Events/Services","VSS/Adapters/Knockout","VSS/Navigation/Services","VSS/Utils/String","VSS/Utils/Array","VSS/Utils/Core","VSS/Utils/String","Gallery/Client/Controls/NewImageControl/NewImage.View","Gallery/Client/Controls/NewImageControl/NewImage.ViewModel"],function(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w,b,k,d,g,nt,tt,it,rt,ut,ft,et,ot,st,ht,ct,lt,at,vt){Object.defineProperty(t,"__esModule",{value:!0});t.CategoryPage=void 0;nt.UseSecureBinding();var pt=ct.delegate,wt=s.CustomerIntelligenceConstants.MarketPlaceIntelligenceProperties.SearchAndCategoryPageProperties,yt=function(n){function t(){var t=__construct(this,n,arguments);for(var i in t)t.hasOwnProperty(i)&&(this[i]=t[i]);return t._isHosted=it.getPageContext().webAccessConfiguration.isHosted,t._historyServiceInstance=a.HistoryService.getInstance(),t}return __extends(t,n),t.prototype.initialize=function(){this._isHosted?(s.GalleryPerformance.startScenarioFromNavigation(s.PerformanceConstants.LoadSearchPage),s.GalleryPerformance.split("Search.View.ScriptsLoaded"),ut.logTracePoint("SearchView.loading.start")):(s.GalleryPerformance.startScenarioFromNavigation(s.PerformanceConstants.LoadCategoriesPage),s.GalleryPerformance.split("Category.View.ScriptsLoaded"),ut.logTracePoint("CategoryView.loading.start"));this._searchPageParams={product:null,isHosted:this._isHosted};this._populateProductWiseCategories();this._populateTargetPlatforms();this._fetchURLInfo();var t=nt.HtmlHelper.getReturntoHomePageHtml(this._isHosted);if(this._errorDiagnosisPageNotFound=st.format(h.ErrorDiagnosisReturnToHome,t),!this._searchPageParams.product){s.GalleryPerformance.abortScenario(s.PerformanceConstants.LoadCategoriesPage);this._showError(h.ErrorPageNotAvailable,this._errorDiagnosisPageNotFound,this.getElement().find(".category-content"));return}this._setSearchContextFromTarget();this._initializeControlPrerequisites()&&(n.prototype.initialize.call(this),this._initializeControls())},t.prototype._populateTargetPlatforms=function(){var n=JSON.parse($(".target-platforms").html());this._targetPlatforms=n},t.prototype._populateProductWiseCategories=function(){var n=JSON.parse($(".valid-categories").html());for(var t in n)ht.sortIfNotSorted(n[t],function(n,t){return lt.localeIgnoreCaseComparer(n.cn,t.cn)});this._productWiseValidCategories=n},t.prototype._setSearchContextFromTarget=function(){var n=f.SearchConstants.VSTSProductText;lt.ignoreCaseComparer(this._target,f.SearchConstants.VSProductText)===0?n=f.SearchConstants.VSProductText:lt.ignoreCaseComparer(this._target,f.SearchConstants.VSCodeProductText)===0?n=f.SearchConstants.VSCodeProductText:lt.ignoreCaseComparer(this._target,f.SearchConstants.VSForMacProductText)===0&&(n=f.SearchConstants.VSForMacProductText);tt.setSearchContext(n)},t.prototype._performSearch=function(n){ft.getService().fire(i.BaseCategoryViewModel.EVENT_ON_SEARCH,this,[{searchQuery:n}])},t.prototype._initializeControlPrerequisites=function(){var n=!0;return this._searchPageParams.product||(n=!1),n},t.prototype._initializeControls=function(){if(this._searchPageParams.product){var n=this._initCategoryPageViewModelOptions();n&&this._applyRegisteredBindings(n)}},t.prototype._updatePageUrl=function(n,i){var r={},f,u;i.isHosted?(r.term=i.searchQuery,r.target=i.product,nt.FeatureFlagUtils.isMarketPlaceBrandingChangesEnabled()&&lt.ignoreCaseComparer(r.target,t.VSTS_Target)===0&&(r.target=t.AzureDevOps_Target),i&&i.category&&(r.category=i.category),i&&i.pricing&&(r.cost=i.pricing),i&&i.vsVersion&&i.vsVersion.length>0&&(r.vsVersion=i.vsVersion),this._isHosted&&i&&i.subCategory&&(r.subCategory=i.subCategory),i&&i.installationTarget&&(r.hosting=i.installationTarget),i&&i.certified&&(r.certified=i.certified),i&&i.visibilityQuery&&(r.visibilityQuery=i.visibilityQuery),i&&i.targetPlatform&&(r.targetPlatform=i.targetPlatform)):(f=i.category,u=nt.UrlUtils.getVssCategoryURL(f));r.sortBy=i.sortBy;n||this._historyServiceInstance.pushState(r,null,u?u:null);ot.getHistoryService().replaceHistoryPoint("",r,null,!0)},t.prototype._setCategoryFromURL=function(){var n=g.GalleryURLs.getCategoryNameFromUrl(location.pathname),t;n=st.toSentenceCase(n);this._searchPageParams.category=n;this._isHosted&&(t=g.GalleryURLs.getCategoryFromUrl(location.href),t&&(this._searchPageParams.category=t))},t.prototype._setSubCategoryFromURL=function(){var n=g.GalleryURLs.getSubCategoryFromUrl(location.href);this._searchPageParams.subCategory=n},t.prototype._setInstallationTarget=function(){var n=g.GalleryURLs.getInstallationTargetFromUrl(location.href);n?st.ignoreCaseComparer(n,f.FilterConstants.InstallationTargetParamValueCloud)===0?this._searchPageParams.installationTarget=f.FilterConstants.InstallationTargetParamValueCloud:st.ignoreCaseComparer(n,f.FilterConstants.InstallationTargetParamValueOnPrem)===0&&(this._searchPageParams.installationTarget=f.FilterConstants.InstallationTargetParamValueOnPrem):this._searchPageParams.installationTarget=null;this._hosting=n},t.prototype._setPricing=function(){var n=g.GalleryURLs.getPricingCategoryFromUrl(location.href);n&&(st.ignoreCaseComparer(n,f.FilterConstants.CostParamValuePaid)===0?this._searchPageParams.pricing=f.FilterConstants.CostParamValuePaid:st.ignoreCaseComparer(n,f.FilterConstants.CostParamValueFree)===0?this._searchPageParams.pricing=f.FilterConstants.CostParamValueFree:st.ignoreCaseComparer(n,f.FilterConstants.CostParamValueTrial)===0&&st.ignoreCaseComparer(this._target,f.SearchConstants.VSProductText)===0&&(this._searchPageParams.pricing=f.FilterConstants.CostParamValueTrial))},t.prototype._setCertified=function(){var n=g.GalleryURLs.getCertifiedCategoryFromUrl(location.href);n&&(st.ignoreCaseComparer(n,f.FilterConstants.CertifiedParamValueMicrosoft)===0?this._searchPageParams.certified=f.FilterConstants.CertifiedParamValueMicrosoft:st.ignoreCaseComparer(n,f.FilterConstants.CertifiedParamValueCertifiedPublishers)===0&&(this._searchPageParams.certified=f.FilterConstants.CertifiedParamValueCertifiedPublishers))},t.prototype._setTargetPlatform=function(){var n=g.GalleryURLs.getTargetPlatformFromUrl(location.href);n&&(this._searchPageParams.targetPlatform=n)},t.prototype._getPricingParameterValue=function(){return this._searchPageParams.pricing},t.prototype._setVSVersionFromURL=function(){var n=g.GalleryURLs.getVSVersionFromUrl(location.href);n&&(this._searchPageParams.vsVersion=n.split(","))},t.prototype._setVisibilitySearchParamsFromURL=function(){var n=g.GalleryURLs.getVisibilityQueryFromUrl(location.href);n&&(this._searchPageParams.visibilityQuery=n)},t.prototype._getProductCategoryNames=function(){var n=[],t=JSON.parse($(".product-categories").html());return $.each(t,function(t,i){n.push({cn:st.toSentenceCase(i)})}),n},t.prototype._initCategoryPageViewModelOptions=function(){var t=this,n,i;this._historyServiceInstance.registerHandler(this._onPopState.bind(this));for(n in this._productWiseValidCategories)lt.ignoreCaseComparer(n,this._searchPageParams.product)===0&&(i=this._productWiseValidCategories[n]);return{validCategories:i,targetPlatforms:this._targetPlatforms,nonEmptyCategories:this._isHosted?null:this._getProductCategoryNames(),searchPageParams:this._searchPageParams,errorCallback:function(n,i,r){t._showError(n,i,r)},updatePageURLCallback:function(n,i){t._updatePageUrl(n,i)},setSearchContextCallback:function(n){tt.setSearchContext(n)},searchProviderFactory:l.GallerySearchProviderFactory.getInstance()}},t.prototype._setSearchQuery=function(n){n&&(n=r.BaseView.sanitizeSearchQuery(n.trim()));this._searchPageParams.searchQuery=n?n:""},t.prototype._setProductFromTarget=function(){(st.ignoreCaseComparer(this._target,f.SearchConstants.VSTSProductText)===0||st.ignoreCaseComparer(this._target,f.SearchConstants.VSCodeProductText)===0||st.ignoreCaseComparer(this._target,f.SearchConstants.VSProductText)===0||st.ignoreCaseComparer(this._target,f.SearchConstants.VSForMacProductText)===0)&&(this._searchPageParams.product=this._target)},t.prototype._fetchURLInfo=function(){var i,n;this._searchPageParams={product:null,isHosted:this._isHosted};this._isHosted||(i=g.GalleryURLs.getProductNameFromUrl(location.pathname),i&&st.ignoreCaseComparer(i,f.SearchConstants.VSTSProductText)===0&&(this._target=f.SearchConstants.VSTSProductText),this._searchPageParams.sortBy=g.GalleryURLs.getSortOptionFromUrl(location.href),this._setProductFromTarget(),this._setCategoryFromURL());this._isHosted&&(n=nt.SearchUtils.parseSearchQueryFromUrl(location.href),this._setSearchQuery(n[0]),this._target=n[1],lt.ignoreCaseComparer(this._target,t.AzureDevOps_Target)===0&&(this._target=t.VSTS_Target),this._searchPageParams.sortBy=n[2],this._setProductFromTarget());st.ignoreCaseComparer(this._target,f.SearchConstants.VSTSProductText)===0?(this._setCategoryFromURL(),this._setInstallationTarget(),this._setPricing(),this._setCertified(),this._setVisibilitySearchParamsFromURL()):st.ignoreCaseComparer(this._target,f.SearchConstants.VSCodeProductText)===0||st.ignoreCaseComparer(this._target,f.SearchConstants.VSForMacProductText)===0?(this._setCategoryFromURL(),this._setTargetPlatform()):st.ignoreCaseComparer(this._target,f.SearchConstants.VSProductText)===0&&(this._setVSVersionFromURL(),this._setPricing(),this._isHosted&&(this._setSubCategoryFromURL(),this._setCategoryFromURL()))},t.prototype._onPopState=function(){this._fetchURLInfo();ft.getService().fire(i.BaseCategoryViewModel.EVENT_ON_BACK_NAV,this,[{searchPageParams:this._searchPageParams}])},t.prototype.registerControls=function(){n.prototype.registerControls.call(this);var t=it.getPageContext().webAccessConfiguration.isHosted;et.TemplateControl.registerBinding("item-grid-template",v.ItemGridView,function(n){return new y.GridViewModel(n)});t?et.TemplateControl.registerBinding("category-control-template",u.CategoryView,function(n){return new b.SearchViewModel(n)}):et.TemplateControl.registerBinding("category-control-template",u.CategoryView,function(n){return new i.BaseCategoryViewModel(n)});et.TemplateControl.registerBinding("filter-control-template",e.FilterControlView,function(n){return new o.FilterControlViewModel(n)});et.TemplateControl.registerBinding("searchbar-control-template",p.SearchBarView,function(n){return new w.SearchBarViewModel(n)});et.TemplateControl.registerBinding("zero-results-template",k.ZeroSearchResultsView,function(n){return new d.ZeroSearchResultsViewModel(n)});et.TemplateControl.registerBinding("new-image-template",at.ImageView,function(n){return new vt.NewImageViewModel(n)})},t.prototype._applyRegisteredBindings=function(n){if(n){var t=this.getElement().find(".category-content"),i=et.TemplateControl.applyRegisteredBinding("category-control-template",t,n);this._categoryPageViewModel=i.getViewModel()}},t.prototype._showError=function(n,t,i){i.empty();var u;u={errorText:n,errorDiagnosisHtml:t};r.BaseView._showError(u,i)},t._vscodeProductName="vscode",t.VSS_ITEM_CLASS="VSTS",t.VSCODE_ITEM_CLASS="VSCode",t._vssItemTileTemplate="gallery-item-card-template",t._vsItemTileTemplate="item-card-template",t.VSTS_Target="VSTS",t.AzureDevOps_Target="AzureDevOps",t._productList=[c.VS_Header,c.VSTS_Header,c.VSCode_Header],t}(r.BaseView);t.CategoryPage=yt;rt.Enhancement.registerEnhancement(yt,".category-main-content")});

if (window.performance && window.performance.mark) { window.performance.mark('endLoadBundleInner-view'); }