if (window.performance && window.performance.mark) { window.performance.mark('startLoadBundleInner-async'); }
// Copyright (C) Microsoft Corporation. All rights reserved.
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/Controls/VNext/Carousel/Carousel.KnockoutTemplate",["require","exports"],function(n,t){Object.defineProperty(t,"__esModule",{value:!0});t.Carousel=void 0;var i;(function(n){n.TEMPLATE_ID="gallery-carousel";n.TEMPLATE_HTML='    <div class="carousel-nav prev" data-bind="if: !isLeftScrollDisabled() || !isRightScrollDisabled() || isfetching()">\n        <a href="" role="button" class="carousel-prev gallery-element-focus-style-light" data-bind="click: scrollLeft, spacekey: scrollLeft, attr: { title: scrollLeftTitle, tabindex: getTabIndexForLeftNavigator(), \'aria-disabled\': isLeftScrollDisabled(),  \'aria-label\': ariaLabelForLeftScroll }, css: { disabled: isLeftScrollDisabled }">\n            <i class="bowtie-icon bowtie-chevron-left"><\/i>\n        <\/a>\n    <\/div>\n    <div class="carousel-wrapperHomePage">\n        <ul class="carousel"  data-bind=\'foreach: items, event: { keydown: carouselKeyHandler }, attr: {id: carouselIdSelector}, style: {width: cssStyleWidth}\'>\n            <!-- ko if: $index() < $parent.numberOfItemsToRender() -->\n            <li class="carousel-item" role="listitem" data-bind="component: {name: $parent.componentName, params: {item: $data, containerName: $parent.carouselIdSelector, removeTabFocus: $index() < $parent._viewPortStartIndex() || $index() >= $parent._viewPortStartIndex() + $parent._numberOfItemsToDisplay}}"><\/li>\n            <!-- /ko -->\n        <\/ul>\n        <!-- ko if: items().length == 0 -->\n        <div class="no-data-message">\n            <span data-bind="text:noDataAvailableMsg" id="no-data-message-container">  <\/span>\n        <\/div>\n        <!-- /ko -->\n    <\/div>\n    <div data-bind="if: !isSpinnerDisabled()">\n        <div class="carousel-spinner"> <\/div>\n    <\/div>\n    <div class="carousel-indicators" data-bind="foreach: indicators">\n        <span class="indicator" data-bind="css: { active: $index() === $parent.selectedIndicatorIndex() }, click: $parent.selectIndicator($index())"><\/span>\n    <\/div>\n    <div class="carousel-nav next" data-bind="if: !isLeftScrollDisabled() || !isRightScrollDisabled() || isfetching()">\n        <a href="" role="button" class="carousel-next gallery-element-focus-style-light" data-bind="click: scrollRight, spacekey: scrollRight, hasFocus: rightArrowFocused, attr: { title: scrollRightTitle, tabindex:  getTabIndexForRightNavigator(), \'aria-disabled\': isRightScrollDisabled(), \'aria-label\': ariaLabelForRightScroll }, css: { disabled: isRightScrollDisabled }">\n            <i class="bowtie-icon bowtie-chevron-right"><\/i>\n        <\/a>\n    <\/div>\n    <span data-bind="template: { afterRender: componentLoaded() }" style="visibility: hidden"> <\/span>\n'})(i=t.Carousel||(t.Carousel={}))});

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/VNext/Carousel/Carousel.ViewModel",["require","exports","knockout","Gallery/Client/Controls/VNext/Carousel/Carousel.KnockoutTemplate","Gallery/Client/Common/Telemetry","Gallery/Scripts/Gallery/Resources/VSS.Resources.GalleryCommon","Gallery/Client/Service/VNext/ItemMinified","Gallery/Client/Common/Utility.Common","Gallery/Client/Common/ScrollEventListener","VSS/Utils/String"],function(n,t,i,r,u,f,e,o,s,h){function l(){i.components.register(c.COMPONENT_NAME,{viewModel:{createViewModel:function(n){return n.viewModel}},template:r.Carousel.TEMPLATE_HTML})}Object.defineProperty(t,"__esModule",{value:!0});t._registerComponents=t.CarouselViewModel=void 0;var c=function(){function n(n){var t=this;this.items=i.observableArray([]);this.isLeftScrollDisabled=i.observable(!0);this.isRightScrollDisabled=i.observable(!1);this.isSpinnerDisabled=i.observable(!0);this.isfetching=i.observable(!1);this.indicators=[];this.selectedIndicatorIndex=i.observable(0);this.cssStyleWidth=i.observable("0px");this.cssStyleLeft=i.observable("0px");this.carouselIdSelector="";this.carouselCategory="";this.ariaLabelForRightScroll="";this.ariaLabelForLeftScroll="";this.rightArrowFocused=i.observable(!1);this.scrollLeftTitle=f.ScrollLeftTitle;this.scrollRightTitle=f.ScrollRightTitle;this.noDataAvailableMsg=f.noDataAvailableMsg;this.numberOfItemsToRender=i.observable(0);this.bringFocusInsideCarousel=!1;this._shouldFetchExtensions=!1;this._pageToFetch=1;this._pageSize=6;this._maxNoOfPages=0;this._maxItemIndexVisibleTillNow=-1;this.ARROWLEFT_KEY_CODE=37;this.ARROWRIGHT_KEY_CODE=39;this.TAB_KEY_CODE=9;this.PAGEUP_KEY_CODE=33;this.PAGEDOWN_KEY_CODE=34;this.scrollLeft=function(){var i=t.items().length,n;i>t._numberOfItemsToDisplay&&t.isRightScrollDisabled(!1);n=t._viewPortStartIndex()-t._numberOfItemsToDisplay;n>=0?(t._viewPortStartIndex(n),t._refreshIndicatorAndResetAutoPlayTimer()):n+t._numberOfItemsToDisplay>0&&(t._viewPortStartIndex(0),t._refreshIndicatorAndResetAutoPlayTimer());t._carouselId&&t._logTelemetry("left")};this.scrollRight=function(){var n=t.renderItemsOnRightScroll();t._shouldFetchExtensions&&(n||(t._pageToFetch=Math.ceil(t.items().length/t._pageSize),t.isfetching(!0),t.isRightScrollDisabled(!0),t.isSpinnerDisabled()&&setTimeout(function(){t.isfetching()&&t.isSpinnerDisabled(!1)},200),u.GalleryPerformance.startScenario(u.PerformanceConstants.LoadCarouselItems,(new Date).getTime()),t._fetchNextSetOfItems(t._carouselId,t._pageToFetch+1,t._pageSize).then(function(n){u.GalleryPerformance.endScenario(u.PerformanceConstants.LoadCarouselItems);n.length===0?(t._shouldFetchExtensions=!1,t.isRightScrollDisabled(!0)):(n.length<t._pageSize||t._maxNoOfPages>0&&t._maxNoOfPages<=t._pageToFetch+1?(t.isRightScrollDisabled(!0),t._shouldFetchExtensions=!1):(t.isRightScrollDisabled(!1),t.rightArrowFocused(!0)),t.items(t.items().concat(n)),t.cssStyleWidth(t.items().length*t._itemWidth+"px"),t.renderItemsOnRightScroll());t.isSpinnerDisabled(!0);t.isfetching(!1)},function(){t.isRightScrollDisabled(!0);t._shouldFetchExtensions=!1;t.isfetching(!1);t.isSpinnerDisabled(!0);u.GalleryPerformance.endScenario(u.PerformanceConstants.LoadCarouselItems)})));t._carouselId&&t._logTelemetry("right")};this._viewPortStartIndex=i.observable(0);this._itemWidth=0;this._autoPlay=!1;this._autoPlayDuration=5e3;this._delayRenderingOfItemsNotInViewport=!1;this._carouselTitle=n.carouselTitle;this.carouselCategory=n.carouselCategory;this.items(n.items);this.componentName=n.componentName;this._itemWidth=n.itemWidth;this.cssStyleWidth(this.items().length*this._itemWidth+"px");this._numberOfItemsToDisplay=n.numberOfItemsToDisplay?n.numberOfItemsToDisplay:1;this._carouselId=n.carouselId;this.carouselIdSelector=this._carouselTitle.replace(/ /g,"");this._shouldFetchExtensions=n.fetchNextSetOfItems!==undefined;this.ariaLabelForRightScroll=h.format(f.CarouselButtonReadableText,f.ScrollRightTitle,this.carouselCategory);this.ariaLabelForLeftScroll=h.format(f.CarouselButtonReadableText,f.ScrollLeftTitle,this.carouselCategory);n.delayRenderingOfItemsNotInViewport?(this._delayRenderingOfItemsNotInViewport=!0,this.numberOfItemsToRender(this._numberOfItemsToDisplay)):this.numberOfItemsToRender(this.items().length);n.newItemsDisplayedCallback&&(this._newItemsDisplayedCallback=n.newItemsDisplayedCallback);this._fetchNextSetOfItems=n.fetchNextSetOfItems;this._maxNoOfPages=n.maxNoOfPages;this.initializeRightScroll(n.hasMoreItems);this.initializeIndicators(n.showIndicators);this.initializeAutoPlay(n.autoPlay,n.autoPlayDuration);this._viewPortStartIndex.subscribe(function(){var t=this,n;this._viewPortStartIndex()===0?this.isLeftScrollDisabled(!0):this.isLeftScrollDisabled(!1);this._shouldFetchExtensions||this._viewPortStartIndex()>=this.items().length-this._numberOfItemsToDisplay&&this.isRightScrollDisabled(!0);n=this._viewPortStartIndex()*this._itemWidth*-1+"px";this.cssStyleLeft(n);setTimeout(function(){t._animate()},0)}.bind(this));this._scrollEventHandler=this._scrollEventHandler.bind(this)}return n.prototype.initializeRightScroll=function(n){n?this.isRightScrollDisabled(!1):this.isRightScrollDisabled(!0)},n.prototype.getTabIndexForLeftNavigator=function(){return this.isLeftScrollDisabled()?"-1":"0"},n.prototype.getTabIndexForRightNavigator=function(){return this.isRightScrollDisabled()?"-1":"0"},n.prototype.initializeIndicators=function(n){var n=n?n:!1,i=Math.floor(this.items().length/this._numberOfItemsToDisplay),r=this.items().length%this._numberOfItemsToDisplay==0?i:i+1,t;if(r>1&&n)for(t=0;t<r;t++)this.indicators.push(t)},n.prototype.initializeAutoPlay=function(n,t){n&&this.items().length>this._numberOfItemsToDisplay&&(this._autoPlay=!0,t&&(this._autoPlayDuration=t),this._startAutoPlay())},n.prototype.scrollToZeroIndex=function(){var i="#"+this.carouselIdSelector,t;this.cssStyleLeft("0px");t=$(i).closest(n.CAROUSEL_SELECTOR);t.css({left:this.cssStyleLeft()});this._viewPortStartIndex()===0?(this.isLeftScrollDisabled(!0),this._shouldFetchExtensions||this._viewPortStartIndex()>=this.items().length-this._numberOfItemsToDisplay&&this.isRightScrollDisabled(!0)):this._viewPortStartIndex(0)},n.prototype.resetCarouselItems=function(n,t){this._shouldFetchExtensions=this._fetchNextSetOfItems!==undefined;this._carouselId=t;this.numberOfItemsToRender(this._numberOfItemsToDisplay);this.isRightScrollDisabled(!1);this.items(n);this.cssStyleWidth(this.items().length*this._itemWidth+"px");this.items().length<this._pageSize&&(this._shouldFetchExtensions=!1);this.scrollToZeroIndex();this.isfetching(!1);this.isSpinnerDisabled(!0);this._maxItemIndexVisibleTillNow=-1;this._scrollEventHandler()},n.prototype.setCssStyleWidth=function(){this.cssStyleWidth(this.items().length*this._itemWidth+"px")},n.prototype.setSpinner=function(){var n=this;this.isfetching(!0);this.isSpinnerDisabled()&&setTimeout(function(){n.isfetching()&&n.isSpinnerDisabled(!1)},200)},n.prototype.renderItemsOnRightScroll=function(){var t=this.items().length,n;return(this._delayRenderingOfItemsNotInViewport&&this.numberOfItemsToRender(t),n=this._viewPortStartIndex()+this._numberOfItemsToDisplay,n<t)?(n+this._numberOfItemsToDisplay>t&&this.isRightScrollDisabled(!0),n+this._numberOfItemsToDisplay>=t&&(n=t-this._numberOfItemsToDisplay,this._maxNoOfPages>0&&Math.ceil(n/this._pageSize)+1>=this._maxNoOfPages&&(this.isRightScrollDisabled(!0),this._shouldFetchExtensions=!1)),this._viewPortStartIndex(n),this._refreshIndicatorAndResetAutoPlayTimer(),this._checkAndCallNewItemsDisplayedCallback(this._viewPortStartIndex()+this._numberOfItemsToDisplay),!0):!1},n.prototype.selectIndicator=function(n){var t,i;i<=this._numberOfItemsToDisplay?(this.isLeftScrollDisabled(!0),this.isRightScrollDisabled(!0)):(this.isLeftScrollDisabled(!1),this.isRightScrollDisabled(!1));t=n*this._numberOfItemsToDisplay;t===0&&this.isLeftScrollDisabled(!0);i=this.items().length;t<i&&(t+this._numberOfItemsToDisplay>=i&&(t=i-this._numberOfItemsToDisplay,this.isRightScrollDisabled(!0)),this.selectedIndicatorIndex(n),this._viewPortStartIndex(t),this._resetAutoPlayTimer())},n.prototype._updateViewPortIndexForAutoPlay=function(){var n=this.selectedIndicatorIndex();n<this.indicators.length-1?this.selectIndicator(n+1):this.selectIndicator(0)},n.prototype._resetAutoPlayTimer=function(){this._autoPlay&&(this._clearAutoPlayTimer(),this._startAutoPlay())},n.prototype._clearAutoPlayTimer=function(){this._autoPlayTimer&&window.clearInterval(this._autoPlayTimer)},n.prototype._startAutoPlay=function(){var n=this;this._autoPlayTimer=window.setInterval(function(){n._updateViewPortIndexForAutoPlay()},this._autoPlayDuration)},n.prototype._refreshIndicatorAndResetAutoPlayTimer=function(){this._refreshSelectedIndicator();this._resetAutoPlayTimer()},n.prototype._logTelemetry=function(n){var t={};t[u.CustomerIntelligenceConstants.MarketPlaceIntelligenceProperties.CarouselProperties.Id]=this._carouselId;t[u.CustomerIntelligenceConstants.MarketPlaceIntelligenceProperties.CarouselProperties.ScrollDirection]=n;t[u.CustomerIntelligenceConstants.MarketPlaceIntelligenceProperties.CarouselProperties.ProductType]=this._getProductType();this._shouldFetchExtensions&&n==="right"&&(t[u.CustomerIntelligenceConstants.MarketPlaceIntelligenceProperties.CarouselProperties.PageNumber]=this._pageToFetch);u.TelemetryHelper.publishEventAsync(u.CustomerIntelligenceConstants.MarketPlaceIntelligenceFeature.CAROUSEL,t)},n.prototype._getProductType=function(){var n="";return this._carouselId.indexOf("vs_")>=0?n=e.ItemMinifiedHelper.getItemTypeText(e.ItemTypeEnum.VS):this._carouselId.indexOf("vsts_")>=0?n=e.ItemMinifiedHelper.getItemTypeText(e.ItemTypeEnum.VSTS):this._carouselId.indexOf("vscode_")>=0?n=e.ItemMinifiedHelper.getItemTypeText(e.ItemTypeEnum.VSCode):this._carouselId.indexOf("vsformac_")>=0&&(n=e.ItemMinifiedHelper.getItemTypeText(e.ItemTypeEnum.VSForMac)),n},n.prototype._refreshSelectedIndicator=function(){var n=Math.floor(this._viewPortStartIndex()/this._numberOfItemsToDisplay);this.selectedIndicatorIndex(this._viewPortStartIndex()%this._numberOfItemsToDisplay?n+1:n)},n.prototype._animate=function(){var t=this,r="#"+this.carouselIdSelector,i=$(r).closest(n.CAROUSEL_SELECTOR);i.animate({left:this.cssStyleLeft()},n.ANIMATION_TIME);this.bringFocusInsideCarousel&&setTimeout(function(){var r=i.find(n.ITEM_CARD_CONTAINER_SELECTOR);r[t._viewPortStartIndex()].focus();t.bringFocusInsideCarousel=!1},n.ANIMATION_TIME)},n.prototype._checkAndCallNewItemsDisplayedCallback=function(n){if(this._newItemsDisplayedCallback&&this._maxItemIndexVisibleTillNow+1<n){var t=this.items().slice();t=t.slice(this._maxItemIndexVisibleTillNow+1,n);this._newItemsDisplayedCallback(t,this.carouselIdSelector);this._maxItemIndexVisibleTillNow=n-1}},n.prototype.carouselKeyHandler=function(n,t){var i=t.which?t.which:t.keyCode,r=$(t.target);if(t&&(t.altKey||t.ctrlKey||t.metaKey))return!0;if(i===this.ARROWLEFT_KEY_CODE)this.bringFocusInsideCarousel=!0,this._moveLeft(r);else if(i===this.ARROWRIGHT_KEY_CODE)this.bringFocusInsideCarousel=!0,this._moveRight(r);else{if(i===this.PAGEUP_KEY_CODE)return this.bringFocusInsideCarousel=!0,this.scrollLeft(),!1;if(i===this.PAGEDOWN_KEY_CODE)return this.bringFocusInsideCarousel=!0,this.scrollRight(),!1;i===this.TAB_KEY_CODE&&this._setTabIndexOfSiblings(r)}return!0},n.prototype._moveRight=function(t){var f=t.parent(),e=f.prevAll(n.CAROUSEL_ITEM_SELECTOR),o=f.nextAll(n.CAROUSEL_ITEM_SELECTOR).first(),i=o.find(n.ITEM_CARD_CONTAINER_SELECTOR),r,u;i&&(r=e.length<this._viewPortStartIndex()+this._pageSize-1,u=this.isRightScrollDisabled(),r||u||this.scrollRight(),(!u||r)&&(this._setTabIndexOfSiblings(i),i.focus()))},n.prototype._moveLeft=function(t){var f=t.parent(),e=f.prevAll(n.CAROUSEL_ITEM_SELECTOR),o=f.prevAll(n.CAROUSEL_ITEM_SELECTOR).first(),r=o.find(n.ITEM_CARD_CONTAINER_SELECTOR),i,u;r&&(i=e.length>this._viewPortStartIndex(),u=this.isLeftScrollDisabled(),i||u||this.scrollLeft(),(!u||i)&&(this._setTabIndexOfSiblings(r),i&&r.focus()))},n.prototype._setTabIndexOfSiblings=function(t){var i=t.closest(n.CAROUSEL_SELECTOR);i.find(n.ITEM_CARD_CONTAINER_SELECTOR).attr("tabindex","-1");t.attr("tabindex","0")},n.prototype.componentLoaded=function(){var n=this;setTimeout(function(){s.ScrollEventListener.subscribeScrollEvent({id:n.carouselIdSelector,callback:n._scrollEventHandler});n._scrollEventHandler()},0)},n.prototype._scrollEventHandler=function(){o.TileImpressionUtils.isScrolledIntoView(document.getElementById(this.carouselIdSelector))&&(this._checkAndCallNewItemsDisplayedCallback(this._pageSize<this.items().length?this._pageSize:this.items().length),s.ScrollEventListener.unsubscribeScrollEvent(this.carouselIdSelector))},n.prototype._unbindScrollHandler=function(){$(document).off("scroll",this._scrollEventHandler)},n.COMPONENT_NAME="gallery-carousel",n.ANIMATION_TIME=300,n.CAROUSEL_SELECTOR=".carousel",n.CAROUSEL_ITEM_SELECTOR=".carousel-item",n.ITEM_CARD_CONTAINER_SELECTOR=".gallery-item-card-container",n}();t.CarouselViewModel=c;t._registerComponents=l});

define("Gallery/Client/Controls/VNext/CategoryTile/CategoryTile.KnockoutTemplate",["require","exports"],function(n,t){Object.defineProperty(t,"__esModule",{value:!0});t.CategoryTile=void 0;var i;(function(n){n.TEMPLATE_ID="gallery-category-tile";n.TEMPLATE_HTML='    <div class="category-entry">\n        <a data-bind="attr: { href: link, target: linkTarget },  click: clickTile()">\n            <div class="main-cell">\n                <span class="name" data-bind="text: name, attr: { title: name }"><\/span>\n            <\/div>\n        <\/a>\n    <\/div>\n'})(i=t.CategoryTile||(t.CategoryTile={}))});

define("Gallery/Client/Controls/VNext/CategoryTile/CategoryTile.ViewModel",["require","exports","knockout","Gallery/Client/Controls/VNext/CategoryTile/CategoryTile.KnockoutTemplate","Gallery/Client/Common/Telemetry","Gallery/Client/Common/Constants"],function(n,t,i,r,u,f){function o(){i.components.register(e.COMPONENT_NAME,{viewModel:e,template:r.CategoryTile.TEMPLATE_HTML})}Object.defineProperty(t,"__esModule",{value:!0});t._registerComponents=t.CategoryTileViewModel=void 0;var e=function(){function n(n){this.name=n.item.name;this.link=n.item.link;this.product=n.item.product;this.linkTarget=n.item.openInNewTab?"_blank":"_self"}return n.prototype.clickTile=function(){var n=this;return function(){return n.logTelemetryToCI()}},n.prototype.logTelemetryToCI=function(){var t="",n={},i=u.CustomerIntelligenceConstants.MarketPlaceIntelligenceProperties.HomePageProperties;return t=u.CustomerIntelligenceConstants.MarketPlaceIntelligenceFeature.CATEGORY_CLICK,t!==""&&(n.Type=f.CatgeoryHeaderConstants.button,n[i.ProductType]=this.product,n[u.CustomerIntelligenceConstants.MarketPlaceIntelligenceProperties.HomePageProperties.Id]=this.name,u.TelemetryHelper.publishEventAsync(t,n)),!0},n.COMPONENT_NAME="gallery-category-tile",n}();t.CategoryTileViewModel=e;t._registerComponents=o});

define("Gallery/Client/Controls/VNext/ErrorControl/ErrorControl.KnockoutTemplate",["require","exports"],function(n,t){Object.defineProperty(t,"__esModule",{value:!0});t.ErrorControl=void 0;var i;(function(n){n.TEMPLATE_ID="error-control-template-vnext";n.TEMPLATE_HTML='    <div class="gallery-error-control">\n        <div class="error-text" data-bind="text: errorText"><\/div>\n        <div class="tips-header" data-bind="text: tipsText"><\/div>\n        <div class="error-diagnosis" data-bind="html: errorDiagnosisHtml"><\/div>\n        <div class="report-issue" data-bind="html: contactUsHtml"><\/div>\n    <\/div>\n'})(i=t.ErrorControl||(t.ErrorControl={}))});

define("Gallery/Client/Controls/VNext/ErrorControl/ErrorControl.ViewModel",["require","exports","knockout","Gallery/Client/Controls/VNext/ErrorControl/ErrorControl.KnockoutTemplate","Gallery/Scripts/Gallery/Resources/VSS.Resources.GalleryCommon","Gallery/Client/URLHelper","VSS/Utils/String"],function(n,t,i,r,u,f,e){function s(){i.components.register(o.COMPONENT_NAME,{viewModel:o,template:r.ErrorControl.TEMPLATE_HTML})}Object.defineProperty(t,"__esModule",{value:!0});t._registerComponents=t.ErrorControlViewModel=void 0;var o=function(){function n(t){if(this.errorText=t.errorText,this.tipsText=u.TipsText,t.errorDiagnosisHtml)this.errorDiagnosisHtml=t.errorDiagnosisHtml;else{var i=e.format("<a href='{0}'>"+u.Marketplace+"<\/a>",f.GalleryURLs.getHomePageURL());this.errorDiagnosisHtml=e.format(u.DefaultErrorDiagnosisText,i)}this.contactUsHtml=n.getContactUsHtmlContent()}return n.getContactUsHtmlContent=function(){var t=e.format(u.ErrorContactUsEmailBody,encodeURIComponent(location.href),encodeURIComponent(f.GalleryURLs.getHomePageURL())),i=e.format(n.EMAIL_HREF,n.EMAIL_ADDR,u.ErrorContactUsEmailSubject,e.htmlEncode(t)),r=e.format("<a href='{0}'>"+u.ErrorContactUsHere,i);return e.format(u.ErrorContactUs,r)},n.COMPONENT_NAME="error-control-template-vnext",n.EMAIL_HREF="mailto:{0}?subject={1}&Body={2}",n.EMAIL_ADDR="vsmarketplace@microsoft.com",n}();t.ErrorControlViewModel=o;t._registerComponents=s});

define("Gallery/Client/Controls/ImageControl/Image.ViewModel",["require","exports","VSS/Utils/String"],function(n,t,i){Object.defineProperty(t,"__esModule",{value:!0});t.ImageViewModel=void 0;var r=function(){function n(n){this.imageVisible=!0;this.imageSrc=n.imageUrl;this.fallbackImageSrc=n.fallbackImageUrl||this.imageSrc;this._hideIfNotFound=n.hideIfNotFound;this.imageStyle=n.imageStyle;this.bowtieStyle=n.bowtieStyle;this._hideIfNotFound&&!n.imageUrl&&(this.imageVisible=!1)}return n.prototype.componentLoaded=function(n){var t=this,i;if(n.parentElement){i=n.parentElement.getElementsByClassName("image-display");$(i).on("error",function(n){t.imageOnError(t,n)})}},n.prototype.imageOnError=function(n,t){var r=t.srcElement,u;r||(r=t.target);r&&r instanceof Element&&(u=r.getAttribute("src"),i.ignoreCaseComparer(u,this.fallbackImageSrc)!==0?r.setAttribute("src",this.fallbackImageSrc):(this._hideIfNotFound&&(this.imageVisible=!1),this.imageOnError=function(){}),this.imageVisible||r.setAttribute("style","display:none"))},n}();t.ImageViewModel=r});

define("Gallery/Client/Controls/VNext/ItemTile/ItemTile.KnockoutTemplate",["require","exports"],function(n,t){Object.defineProperty(t,"__esModule",{value:!0});t.ItemTile=void 0;var i;(function(n){n.TEMPLATE_ID="gallery-item-tile";n.TEMPLATE_HTML='    <a class="gallery-item-card-container" data-bind="attr: { href: item.link, target: linkTarget, tabindex : getTabIndex(), \'aria-label\': getScreenReaderText() }, click: clickItem()">\n        <div class="gallery-item-cardHomePage" data-bind="attr: { title: item.title}">\n            <div class="cover">\n                <!-- ko if: showCertifiedBadge -->\n                <i class="active-user-info certified-badge-image" data-bind="attr: { title: certifiedBadgeText }, text: certifiedBadgeIcon" role="presentation"><\/i>\n                <!-- /ko -->\n                <div class="icon-cell" data-bind="template: { name: \'image-template\', data: imageViewModel}, attr: { title: item.summary }"><\/div>\n                <div class="core-info-cell">\n                    <div class="name">\n                        <span class="item-title" data-bind="text: item.title, attr: { title: item.summary}"><\/span>\n                        <span class="text-fadeout" data-bind="style: {width: calculateWidthBasedOnSibling($element, \'item-title\', 158, \'30px\')}"><\/span>\n                    <\/div>\n                    <!--ko ifnot: showInstallCount -->\n                    <div class="publisher" data-bind="text: item.author , attr: { title: item.author }"><\/div>\n                    <span class="text-fadeout"><\/span>\n                    <!-- /ko -->\n                    <!--ko if: showInstallCount -->\n                    <div class="core-info-second-row">\n                        <span class="installs" data-bind="visible: item.installCount && item.installCount !== \'0\'">\n                            <i class="bowtie-icon bowtie-install install-icon"><\/i>\n                            <span class="install-count" data-bind="text: item.installCount"><\/span>\n                        <\/span>\n                        <div class="publisher">\n                            <span data-bind="text: item.author , attr: { title: item.author }"><\/span>\n                            <span class="text-fadeout"><\/span>\n                        <\/div>\n                    <\/div>\n                    <!-- /ko -->\n                    <!--ko if: showDomain -->\n                    <div class="core-info-third-row">\n                        <i class="verified-domain-icon" data-bind="attr: { title: verifiedDomainText }, text: verifiedDomainIcon" role="presentation"><\/i>\n                        <div class="publisher-domain">\n                            <span data-bind="text: cleanedPublisherDomain, attr: { title: cleanedPublisherDomain }"><\/span>\n                            <span class="text-fadeout"><\/span>\n                        <\/div>\n                    <\/div>\n                    <!-- /ko -->\n                <\/div>\n            <\/div>\n            <div class="stats-and-offer">\n                <!-- ko if: showRatingReview -->\n                <div class="rating-and-price">\n                    <div role="img" class="rating" data-bind="component: {name: \'gallery-rating-control\', params: ratingControlParams}, attr: { \'alt\': averageRatingText, title: averageRatingText }"><\/div>\n                    <div class="pricing-tag" data-bind="text: item.costCategory, attr: { title: item.costCategory }"><\/div>\n                    <span class="text-fadeout"><\/span>\n                <\/div>\n                <!-- /ko -->\n                <!-- ko ifnot: showRatingReview -->\n                <div class="pricing-tag" data-bind="text: item.costCategory, attr: { title: item.costCategory }"><\/div>\n                <span class="text-fadeout"><\/span>\n                <!-- /ko -->\n            <\/div>\n        <\/div>\n    <\/a>\n'})(i=t.ItemTile||(t.ItemTile={}))});

define("Gallery/Client/Controls/VNext/ItemTile/ItemTile.ViewModel",["require","exports","knockout","Gallery/Client/Common/Telemetry","Gallery/Client/Service/VNext/Utility","Gallery/Client/Common/Utility","Gallery/Client/Service/VNext/GalleryDataProvider","Gallery/Scripts/Gallery/Resources/VSS.Resources.GalleryCommon","Gallery/Client/Controls/ImageControl/Image.ViewModel","Gallery/Client/Service/VNext/ItemMinified","Gallery/Client/Controls/VNext/ItemTile/ItemTile.KnockoutTemplate","VSS/Utils/String","Gallery/Client/Common/Constants"],function(n,t,i,r,u,f,e,o,s,h,c,l,a){function y(){i.components.register(v.COMPONENT_NAME,{viewModel:v,template:c.ItemTile.TEMPLATE_HTML})}Object.defineProperty(t,"__esModule",{value:!0});t._registerComponents=t.ItemTileViewModel=void 0;var v=function(){function n(n){this.removeTabFocus=!1;this.showRatingReview=!1;this.showInstallCount=!1;this.useDefaultIcon=!1;this.showCertifiedBadge=!1;this.certifiedBadgeText="";this.verifiedDomainText="";this.showDomain=!1;this.cleanedPublisherDomain="";this.certifiedBadgeIcon="\ue9d1";this.verifiedDomainIcon="\uf6ad";this.containerName="";this.containerName=n.containerName;this.item=n.item;this.ratingControlParams={rating:this.item.rating,totalStars:5};var t={imageUrl:"",fallbackImageUrl:"",imageStyle:"item-icon",hideIfNotFound:!0};t.imageUrl=this.item.thumbnail;t.fallbackImageUrl=this.item.fallbackThumbnail;this.useDefaultIcon=!this.item.thumbnail;this.useDefaultIcon&&(n.item.itemType===h.ItemTypeEnum.VSTS?(t.imageUrl=null,t.bowtieStyle="bowtie-brand-vsts-alt-1"):t.imageUrl=u.GalleryURLs.getResourcePath()+"Header/default_icon.png");this.imageViewModel=new s.ImageViewModel(t);n.removeTabFocus&&(this.removeTabFocus=!0);this.linkTarget="_self";e.GalleryDataProvider.deploymentIsHosted()&&(this.showRatingReview=!0,this.item.installCount!=="0"&&this.item.installCount!==undefined&&(this.showInstallCount=!0));this.averageRatingText=l.format(o.AverageRatingHoverText,this.item.rating.toFixed(1),this.item.ratingCount.toString(),this.item.ratingCount>1?o.RatingPluralText:o.RatingSingularText);this.showCertifiedBadge=u.isFeatureFlagOrCookieEnabled(a.ManagePublisherPageConstants.EnableCertifiedPublisherUIChanges,a.ManagePublisherPageConstants.EnableCertifiedPublisherUIChanges)&&this.item.itemType===h.ItemTypeEnum.VSTS&&this.item.isPublisherCertified;this.certifiedBadgeText=o.MarketplaceCertifiedPublisherTitle;this.verifiedDomainText=o.MarketplaceVerifiedDomainTitle;f.FeatureFlagUtils.isVerifiedPublisherDomainEnabled()&&this.item.isPublisherDomainVerified&&(this.showDomain=!0,this.cleanedPublisherDomain=f.UrlUtils.getDomainNameFromUrl(this.item.publisherDomain))}return n.prototype.getScreenReaderText=function(){var n=this.showCertifiedBadge?o.Top:"";return l.format(o.ItemTile_ScreenReaderText,this.item.title,n,this.item.author,this.item.installCount,this.averageRatingText,this.item.costCategory)},n.prototype.getTabIndex=function(){return this.removeTabFocus?"-1":"0"},n.prototype.clickItem=function(){var n=this;return function(){return n.logTelemetryToCI()}},n.prototype.logTelemetryToCI=function(){var t="",i="",n={},u=r.CustomerIntelligenceConstants.MarketPlaceIntelligenceProperties.HomePageProperties;switch(this.item.itemType){case h.ItemTypeEnum.VS:t=r.CustomerIntelligenceConstants.MarketPlaceIntelligenceFeature.VS_ITEM;n[u.ProductType]=h.ItemMinifiedHelper.getItemTypeText(h.ItemTypeEnum.VS);i=this.item.title;break;case h.ItemTypeEnum.VSTS:t=r.CustomerIntelligenceConstants.MarketPlaceIntelligenceFeature.VSTS_ITEM;n[u.ProductType]=h.ItemMinifiedHelper.getItemTypeText(h.ItemTypeEnum.VSTS);i=h.ItemMinifiedHelper._getItemName(this.item.link);break;case h.ItemTypeEnum.VSCode:t=r.CustomerIntelligenceConstants.MarketPlaceIntelligenceFeature.VSCODE_ITEM;n[u.ProductType]=h.ItemMinifiedHelper.getItemTypeText(h.ItemTypeEnum.VSCode);i=h.ItemMinifiedHelper._getItemName(this.item.link)}return t!==""&&(n[r.CustomerIntelligenceConstants.MarketPlaceIntelligenceProperties.HomePageProperties.Id]=i,n.container=this.containerName,r.TelemetryHelper.publishEventAsync(t,n)),!0},n.prototype.calculateWidthBasedOnSibling=function(n,t,i,r){var u=n.parentElement.getElementsByClassName(t)[0].offsetWidth;return u>i?r:"0px"},n.prototype.calculateMarginBasedonPubNameWithInstall=function(n){return this.isPubNameWithInstallOverflow(n)?"0px":"5px"},n.prototype.isPubNameWithInstallOverflow=function(n){var t=n.parentElement.getElementsByClassName("publisher-with-installcount")[0].offsetWidth;return t>105?!0:!1},n.COMPONENT_NAME="gallery-item-tile",n}();t.ItemTileViewModel=v;t._registerComponents=y});

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/VNext/VSTSTab/BaseTab.ViewModel",["require","exports","knockout","q","Gallery/Client/Controls/VNext/Carousel/Carousel.ViewModel","Gallery/Client/Controls/VNext/CategoryTile/CategoryTile.ViewModel","Gallery/Client/Common/Constants","Gallery/Client/Controls/VNext/ErrorControl/ErrorControl.ViewModel","Gallery/Client/Common/Telemetry","Gallery/Client/Service/VNext/GalleryDataProvider","Gallery/Scripts/Gallery/Resources/VSS.Resources.GalleryCommon","Gallery/Client/Service/VNext/ItemMinified","Gallery/Client/Service/ItemsConverter","Gallery/Client/Controls/VNext/ItemTile/ItemTile.ViewModel","Gallery/Client/Service/VNext/Utility","Gallery/Client/Common/AccessibilityUtils","VSS/Utils/String"],function(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w){var k,b;Object.defineProperty(t,"__esModule",{value:!0});t.GalleryTab=t.BaseTabViewModel=void 0;k=function(){function n(n){this.categories=i.observable();this.categoriesString=c.FilterByCategoryCollection;this.showCategories=i.observable(!1);this.extensionsPerCategory=i.observableArray([]);this._koShowSpinner=i.observable();this._spinnerID="OtherLoadSpinner";this.isHosted=i.observable(!0);this.hasError=i.observable(!1);this._tabDataPromise=r.defer();this._tabDataWholeFetchPromise=r.defer();this.carouselViewModelsData={};this._spinnerStartAnnounced=!1;this._completed=!1;this._announceStartDelay=1e3;this.isDedupeEnabled=!1;this.isSSREnabledForHomepage=!1;this.shouldRedirectToAFD=!1;this._TileWidth=195.5;this.seeMoreString=c.SeeMore;this.currentTab=n;this.errorControlViewModel=new o.ErrorControlViewModel({errorText:"We're sorry, the tools and extensions are not loading at this time."});this._koShowSpinner(!1);this.isDedupeEnabled=y.HomepageDedupeUtils.isHomepageDedupeEnabled();this.isSSREnabledForHomepage=this.isHosted()&&y.isFeatureFlagOrCookieEnabled("EnableSSRForHomepageVSCode","EnableSSRForHomepageVSCode");this.shouldRedirectToAFD=this.isHosted()&&y.isFeatureFlagOrCookieEnabled("EnableItemDetailsAFDCachingForVSCodeHomePage","EnableItemDetailsAFDCachingForVSCodeHomePage")}return n.prototype.setcategoriesIDs=function(n){var t=e.tabConstants.SubcriptionTab,i;this.categoriesIDs=[];switch(this.currentTab){case b.VSTab:t=e.tabConstants.VSTab;break;case b.VSForMacTab:t=e.tabConstants.VSForMacTab;break;case b.VSTSTab:t=e.tabConstants.VSTSTab;break;case b.VSCodeTab:t=e.tabConstants.VSCodeTab}for(i=0;i<n.extensionsPerCategory.length;i++)this.categoriesIDs.push("HeaderID_"+t+"_"+n.extensionsPerCategory[i].categoryName.replace(/ /g,""))},n.prototype.getkeyPressed=function(n){var t=this;return function(i,r){return t.keyPressed(r,n)}},n.prototype.getClicked=function(n){var t=this;return function(){return t.logTelemetryToCI_CategoryClick?t.logTelemetryToCI_CategoryClick(n):!0}},n.prototype.getSeeMoreAriaLabel=function(n){return w.format(c.SeeMoreAriaLabel,n)},n.prototype.getTabIndex=function(n){return this.isTabbableCategory(n)?"0":"-1"},n.prototype.getCategoriesID=function(n){if(!isNaN(n))return this.categoriesIDs[Number(n)]},n.prototype.getCategoryHeaderRole=function(n){return n?"link":"presentation"},n.prototype.logTelemetryToCI_CategoryClick=function(n){var i="",t={},u=s.CustomerIntelligenceConstants.MarketPlaceIntelligenceProperties.HomePageProperties,r;return i=s.CustomerIntelligenceConstants.MarketPlaceIntelligenceFeature.CATEGORY_CLICK,r=this._getProduct(),i!==""&&(t.Type=e.CatgeoryHeaderConstants.header,t[u.ProductType]=r,t[s.CustomerIntelligenceConstants.MarketPlaceIntelligenceProperties.HomePageProperties.Id]=n,s.TelemetryHelper.publishEventAsync(i,t)),!0},n.prototype.keyPressed=function(n,t){return n.which===e.SPACE_KEY_CODE?(t!==this.categoriesIDs.length-1?$("#"+this.categoriesIDs[t+1]).focus():$("#"+this.categoriesIDs[0]).focus(),!1):!0},n.prototype.getCategoriesViewModelParams=function(){return{componentName:f.CategoryTileViewModel.COMPONENT_NAME,items:this.categories()}},n.prototype.getDropDownViewModelParams=function(){var i=this,t,n;switch(this.currentTab){case b.VSTSTab:t=e.tabSelector.VSTSTab;break;case b.VSCodeTab:t=e.tabSelector.VSCodeTab}return n={itemsList:[],onDropDownChanged:function(n){i._setIsTrendingIsVisibleStatus(n().elementID);i._logTrendingTypeChangeTelemetry(n().elementID)},defaultItemIndex:1,tabSelector:t},n.itemsList.push({elementLabel:"today",elementID:"TrendingDaily"}),n.itemsList.push({elementLabel:"this week",elementID:"TrendingWeekly"}),n.itemsList.push({elementLabel:"this month",elementID:"TrendingMonthly"}),n},n.prototype._getProduct=function(){var n;switch(this.currentTab){case b.VSTab:n=e.tabConstants.VSTab;break;case b.VSForMacTab:n=e.tabConstants.VSForMacTab;break;case b.VSTSTab:n=e.tabConstants.VSTSTab;break;case b.VSCodeTab:n=e.tabConstants.VSCodeTab}return n},n.prototype.setCategories=function(n,t){t===void 0&&(t=!1);var r=this._getProduct(),i=[];n&&n.forEach(function(n){n&&i.push({name:n.title,link:n.link,product:r,openInNewTab:t})});this.categories(i)},n.prototype._preFetchExtensions=function(n,t,i){var e=this,f=r.defer(),u={};return u.category=n,u.currentPageNumber=t,u.pageSize=i,u.tab=this.currentTab,u.searchTerm="",h.GalleryDataProvider.GetInstance().GetExtensionsData(u).then(function(n){f.resolve(e._preFetchExtensionSuccess(n))},function(n){f.reject(n)}),f.promise},n.prototype._preFetchExtensionSuccess=function(n){var t=[],i;return t.push({vssItems:n.searchResults,categoryName:"",hasMoreExtensions:!1}),this.currentTab===b.VSTSTab&&(i=a.ItemsConverter.convertToBaseTabTileData(t,null,l.ItemTypeEnum.VSTS,null,null,null,null,null,!1)),this.currentTab===b.VSCodeTab&&(i=a.ItemsConverter.convertToBaseTabTileData(t,null,l.ItemTypeEnum.VSCode,null,null,null,null,null,this.isSSREnabledForHomepage)),this.currentTab===b.VSTab&&(i=a.ItemsConverter.convertToBaseTabTileData(t,null,l.ItemTypeEnum.VS,null,null,null,null,null,!1)),this.currentTab===b.VSForMacTab&&(i=a.ItemsConverter.convertToBaseTabTileData(t,null,l.ItemTypeEnum.VSForMac,null,null,null,null,null,!1)),i.extensionsPerCategory[0].extensions},n.prototype.onVSTabDataInitialized=function(){return this._tabDataPromise.promise},n.prototype.onVSTabOtherDataInitialized=function(){return this._tabDataWholeFetchPromise.promise},n.prototype.isTrendingCategoryType=function(n){return n.indexOf(c.Trending)>=0?!0:!1},n.prototype.isTabbableCategory=function(n){return this.isTrendingCategoryType(n)||n.indexOf(c.Featured)>=0?!1:!0},n.prototype.showSeeMore=function(n){return n.indexOf(c.Trending)>=0?!1:!0},n.prototype.getCategoryHeaderText=function(n){return n.indexOf(c.Trending)>=0?c.Trending:n},n.prototype.getCarouselViewModel=function(n){return this.carouselViewModelsData[this.getCategoryHeaderText(n.categoryName)]||this.constructCarouselViewModel(n),this.carouselViewModelsData[this.getCategoryHeaderText(n.categoryName)]},n.prototype.EndScenario=function(t){s.TelemetryVNext.split(s.PerformanceConstants.ExtensionRendered);this.endScenarioPromise=s.TelemetryVNext.EndScenario(t,{tabSelectedSource:n.TabSelectedSource,isTTI:!0},!1).then(function(t){return s.TelemetryVNext.EndScenario(s.PerformanceConstants.LoadHomePageAllTabs,{tabSelectedSource:n.TabSelectedSource,isTTI:!0},!0,t)})},n.prototype.constructCarouselViewModel=function(n){var t=this._getCarouselViewModelParams(n),i=new u.CarouselViewModel(t);this.carouselViewModelsData[this.getCategoryHeaderText(n.categoryName)]=i},n.prototype._getCarouselViewModelParams=function(n){var t=this;return{componentName:v.ItemTileViewModel.COMPONENT_NAME,items:n.extensions,numberOfItemsToDisplay:6,itemWidth:this._TileWidth,delayRenderingOfItemsNotInViewport:!0,carouselId:this._getCarouselId(n.categoryName),hasMoreItems:n.hasMoreExtensions,fetchNextSetOfItems:function(n,i,r){return t._preFetchExtensions(n,i,r)},carouselTitle:this._getCarouselTitle(n.categoryName),carouselCategory:n.categoryName,maxNoOfPages:this.isTrendingCategoryType(n.categoryName)?3:0,newItemsDisplayedCallback:function(n,i){t._sendImpressionsTelemetry(n,i)}}},n.prototype._sendImpressionsTelemetry=function(n,t){if(y.TileImpressionUtils.isTileImpressionsEnabled()&&n){var i={},r=[];n.forEach(function(n){r.push(l.ItemMinifiedHelper._getItemName(n.link))});i[s.CustomerIntelligenceConstants.MarketPlaceIntelligencePropertyName.IMPRESSIONS_ITEMS]=r;i[s.CustomerIntelligenceConstants.MarketPlaceIntelligencePropertyName.IMPRESSIONS_LOCATION]="homePage";i[s.CustomerIntelligenceConstants.MarketPlaceIntelligencePropertyName.CONTAINER]=t;s.TelemetryHelper.publishEventAsync(s.CustomerIntelligenceConstants.MarketPlaceIntelligenceFeature.IMPRESSIONS,i)}},n.prototype._setIsTrendingIsVisibleStatus=function(n){var t=this,i,r;this.carouselViewModelsData[c.Trending].setSpinner();this.isDedupeEnabled?(i=this._getTrendingItems(n),this.carouselViewModelsData[c.Trending].resetCarouselItems(i,this._getCarouselId(n)),this.carouselViewModelsData[c.Trending].isSpinnerDisabled(!0)):(r=6,this._preFetchExtensions(n,0,r).then(function(i){t.carouselViewModelsData[c.Trending].resetCarouselItems(i,t._getCarouselId(n));t.carouselViewModelsData[c.Trending].isSpinnerDisabled(!0)}))},n.prototype._getTrendingItems=function(n){for(var r=[],i=this.extensionsPerCategory(),t=0;t<i.length;t++)if(i[t].categoryName===n){r=i[t].extensions;break}return r},n.prototype._getCarouselId=function(n){var t=e.tabConstants.SubcriptionTab;switch(this.currentTab){case b.VSTab:t=e.tabConstants.VSTab;break;case b.VSForMacTab:t=e.tabConstants.VSForMacTab;break;case b.VSTSTab:t=e.tabConstants.VSTSTab;break;case b.VSCodeTab:t=e.tabConstants.VSCodeTab}return t+"_"+n},n.prototype._getCarouselTitle=function(n){return n.indexOf(c.Trending)>=0?this._getCarouselId(c.Trending):this._getCarouselId(n)},n.prototype._logTrendingTypeChangeTelemetry=function(n){var t={},u=s.CustomerIntelligenceConstants.MarketPlaceIntelligencePropertyName,i="",r="";switch(this.currentTab){case b.VSTab:i=e.tabConstants.VSTab;r="VS";break;case b.VSTSTab:i=e.tabConstants.VSTSTab;r="VSTS";break;case b.VSCodeTab:i=e.tabConstants.VSCodeTab;r="VSCode"}t[u.TAB_SELECTED]=i;t.TrendingType=n;t[u.PRODUCT_TYPE]=r;s.TelemetryHelper.publishEventAsync(s.CustomerIntelligenceConstants.MarketPlaceIntelligenceFeature.TRENDING_TYPE,t)},n.prototype.startSpinner=function(){var n=this;this._koShowSpinner(!0);this._completed=!1;this._announceDelay=setTimeout(function(){p.announce(c.StartFetchingExtensions,!0);n._spinnerStartAnnounced=!0},this._announceStartDelay)},n.prototype.stopSpinner=function(n){n===void 0&&(n=!1);this._koShowSpinner(!1);this._completed||(this._completed=!0,this._spinnerStartAnnounced?n?p.announce(c.ErrorFetchingExtensions):p.announce(c.EndFetchingExtensions):clearTimeout(this._announceDelay))},n}();t.BaseTabViewModel=k,function(n){n[n.VSTab=0]="VSTab";n[n.VSForMacTab=1]="VSForMacTab";n[n.VSTSTab=2]="VSTSTab";n[n.VSCodeTab=3]="VSCodeTab"}(b=t.GalleryTab||(t.GalleryTab={}))});

define("Gallery/Client/Service/VNext/SearchProviderAbstractions",["require","exports","q","Gallery/Client/Common/Constants","Gallery/Client/Service/VNext/GalleryDataProvider","Gallery/Scripts/Gallery/Resources/VSS.Resources.GalleryCommon","Gallery/Client/Service/ItemsConverter","Gallery/Client/Service/VSSGallery/IVSSGallery","Gallery/Client/Service/VSSItem","Gallery/Client/Service/VSSItem","Gallery/Client/Service/SearchProvider/VSSGallerySearchProvider","Gallery/Client/Controls/VNext/VSTSTab/BaseTab.ViewModel","Gallery/Client/Service/VNext/Utility"],function(n,t,i,r,u,f,e,o,s,h,c,l,a){Object.defineProperty(t,"__esModule",{value:!0});t.VSSSearchProviderAbstraction=void 0;var v=function(){function n(){}return n._getVSSSearchProvider=function(){return n._vssSearchProvider||(n._vssSearchProvider=new c.VSSGallerySearchProvider),n._vssSearchProvider},n.GetExtensionsData=function(n){var g=this,y=i.defer(),c,v,w=[],t,p=e.PublishedExtensionFlags.None,b=e.PublishedExtensionFlags.None,k,d;return n.tab===l.GalleryTab.VSTSTab?(this.category=n.category.replace("vsts_",""),v=[s.ItemConstants.INSTALLATION_TARGET_EXTENSION,s.ItemConstants.INSTALLATION_TARGET_INTEGRATION,s.ItemConstants.INSTALLATION_TARGET_HOSTED_EXTENSION,s.ItemConstants.INSTALLATION_TARGET_TFSEXTENSION,s.ItemConstants.INSTALLATION_TARGET_TFSINTEGRATION,s.ItemConstants.INSTALLATION_TARGET_HOSTED_INTEGRATION]):n.tab===l.GalleryTab.VSCodeTab?(this.category=n.category.replace("vscode_",""),v=[s.ItemConstants.INSTALLATION_TARGET_CODE]):n.tab===l.GalleryTab.VSTab&&(this.category=n.category.replace("vs_",""),a.getFeatureFlag(r.HomepageConstants.Vs2019Homepage)?(d="16.0",v=h.InstallationTargetToVSIdeMapping.getInstallationTargetsFromIdeVersion("2019",!0)):v=[s.ItemConstants.INSTALLATION_TARGET_VS_IDE]),this.category===f.MostPopular_Items_Header?t=o.VSSSortByValue.Installs:this.category===f.Org_Internal?(t=o.VSSSortByValue.Installs,p=e.PublishedExtensionFlags.Public,k="me"):this.category===f.TopPaid_Items_Header?(t=o.VSSSortByValue.Installs,b=e.PublishedExtensionFlags.Paid):this.category===f.TopFree_Items_Header?(t=o.VSSSortByValue.Installs,p=e.PublishedExtensionFlags.Paid):this.category===f.HighestRated_Items_Header?t=o.VSSSortByValue.AverageRating:this.category===f.RecentlyAdded?t=u.GalleryDataProvider.deploymentIsHosted()?o.VSSSortByValue.ReleaseDate:o.VSSSortByValue.PublishedDate:this.category===r.TrendingCategoryConstants.TrendingWeekly?t=o.VSSSortByValue.TrendingWeekly:this.category===r.TrendingCategoryConstants.TrendingDaily?t=o.VSSSortByValue.TrendingDaily:this.category===r.TrendingCategoryConstants.TrendingMonthly?t=o.VSSSortByValue.TrendingMonthly:(w=[this.category],t=o.VSSSortByValue.Installs),c={searchTerm:"",pageNumber:n.currentPageNumber,pageSize:n.pageSize,installationTargets:v,categories:w,sortBy:t,excludeFlags:p,includeFlags:b,orgSharedWith:k,version:d},this._getVSSSearchProvider().search(c,function(n){(c.sortBy===o.VSSSortByValue.TrendingWeekly||c.sortBy===o.VSSSortByValue.TrendingDaily||c.sortBy===o.VSSSortByValue.TrendingMonthly)&&(n.searchResults=g.filterTrendingCategoryExtensions(n.searchResults,c.sortBy));y.resolve(n)},function(n){y.reject(n)}),y.promise},n.filterTrendingCategoryExtensions=function(n,t){return t===o.VSSSortByValue.TrendingWeekly?n.filter(function(n){return n.trendingWeekly>0}):t===o.VSSSortByValue.TrendingDaily?n.filter(function(n){return n.trendingDaily>0}):n.filter(function(n){return n.trendingMonthly>0})},n._vssSearchProvider=null,n.category="",n}();t.VSSSearchProviderAbstraction=v});

if (window.performance && window.performance.mark) { window.performance.mark('endLoadBundleInner-async'); }