You are on page 1of 19

var WSB;(function(n){function hr(n,i){var

r=[],u,f;if(i)if(n)r=i.slice();else{u=function(n){var t=i.find(function(t){return
t.verb&&t.verb.toLocaleLowerCase()==n.toLocaleLowerCase()});t&&r.push(t)};for(f in
t)u(f)}return r}function cr(n){return n?n.filter(function(n){return!n.verb||
n.verb.toLowerCase()!="open"}):[]}function f(t,i,r,u,f,e)
{e()&&(t=t.slice(),i.getExtraVerbsAsync?
n.Async.safeChain("getExtraVerbsAsync",function(){return
i.getExtraVerbsAsync(u)},function(n){return l(tt(t,n,!0),i,u,f,e)},function()
{return l(t,i,u,f,e)},null,r):l(t,i,u,f,e))}function l(n,t,i,r,u){if(u()){var
f=t.getExtraVerbs?tt(n,t.getExtraVerbs(i),!1):n;f[0]==b&&f.shift();r(f)}}function
lr(i,r,u,f){return i.map(function(i){var e,o,s,h;if(i.verb)
{switch(i.verb.toLocaleLowerCase()){case yt:e="PinnedToStart";break;case
g:e="PinnedToTaskbar";break;case pt:e="UnpinnedFromStart";break;case
nt:e="UnpinnedFromTaskbar";break;case
vt:o=n.config.useCobaltCSS?"UninstallMessage":"UninstallConfirmation";e="Uninstalla
tionInProgress";break;case sr:e="PathCopied"}return s=function(t)
{t();n.RuntimeConfig.AlwaysWide&&e=="UninstallationInProgress"?
(r.uninstallationInProgress=!0,f&&f()):e?
u.showTemporaryMessage(n.Host.getLocString(e,HitHighlightingParser.removeMarkers(r.
text))):u.hideTemporaryMessage();i.verb.toLocaleLowerCase()==g&&n.Host.addItemToPin
nedToTaskbar(r.deviceItem.id);i.verb.toLocaleLowerCase()==nt&&n.Host.removeItemFrom
PinnedToTaskbar(r.deviceItem.id)},h=i.icon||t[i.verb.toLocaleLowerCase()],new
n.DeviceItemVerbWrapper(i,h,function(t){o&&n.DialogBox?
n.DialogBox.show(n.Host.getLocString(o),
[{id:null,text:i.displayName,action:function(){return s(t)},selected:!
1,useAccentColor:n.config.useCobaltCSS?!0:!1},
{id:null,text:n.Host.getLocString("Cancel"),selected:!0}],n.config.useCobaltCSS?
n.Host.getLocString("UninstallConfirmationTitle",HitHighlightingParser.removeMarker
s(r.text)):""):s(t)})}return i})}function kt(t,i,r,u,e,o)
{if(n.isJumpListSuggestion(i))return
n.Async.safeChain("jumpListItem.getVerbsAsync",function(){return
i.jumpListItem.getVerbsAsync()},function(n){return f(cr(n),i,s,u,e,o)},function()
{return f([],i,s,u,e,o)},null,t+" "+i.type),!0;var s=t+"
"+i.type,h=n.getItemWithFileMetadata(i);return h&&h.canHaveContextMenu?
(n.Async.safeChain("item.getVerbsAsync",function(){return
h.getVerbsAsync()},function(n){return f(hr(r,n),i,s,u,e,o)},function(){return
f([],i,s,u,e,o)},null,s),!0):i.getExtraVerbsAsync?(f([],i,s,u,e,o),!
0):i.getExtraVerbs?(l([],i,u,e,o),!0):(u&&e([]),!1)}function e(n,t,i){var
r=HitHighlightingParser.removeMarkers(n.text),u=r?r.length:0;return
n.additionalInfoText&&!i&&(u+=n.additionalInfoText.length),u>(i?er:or)}function
dt(n){for(var i,r={topResults:n.topResults.slice(0),groups:
[]},t=0,u=n.groups;t<u.length;t+
+)i=u[t],r.groups.push({typeWithSource:i.typeWithSource,suggestions:i.suggestions.s
lice(0)});return r}function gt(t,i){if(t.isHtmlAnswer)return ai;if(t.grid)return(i?
n.IconSize_GridLayout:n.IconSize_GridLayout_Medium)+2*r;var u=t.numberOfLines==3?
li:t.numberOfLines==2?ci:hi;return
t.mainTextWrapsToTwoLines&&(u+=ot),u<et&&(u=et),u}function ar(t,i)
{if(i&&n.uses3lineTemplate(n.getScope(i.type)))return gt({mainTextWrapsToTwoLines:!
1,numberOfLines:3,isHtmlAnswer:!1,isSuppressed:t.isSuppressed,grid:!1},!
1);if(t.isSuppressed)return 0;var r=oi;return t.hasTwoLines?
r+=v+2:t.mainTextWrapsToTwoLines&&(r+=ot),r}function vr(t,i){var
r=ft;if(i.typeWithSource&&n.displayedInGridLayout(i.typeWithSource.type)){var
u=n.isL2(t),f=Math.ceil(i.suggestions.length/(u?lt:at)),e=u?
st:ht;r+=e*f;r+=2*y}else i.suggestions.forEach(function(n){return
r+=ar(n,i.typeWithSource)});return r}function yr(n){switch(n){case
0:return"CP";case 7:return"DI";case 1:return"PP";case 2:return"PD";case
4:return"SP";case 5:return"TP";case 6:return"SD"}return undefined}function
tt(n,t,i){if(n.length>0&&t.length>0){var r=i?n.concat(b):n;return
r.concat(t)}return n.length>0?n:t.length>0?i?[b].concat(t):t:[]}function i(t,i)
{return t.find(function(t){return n.sameGroup(t.typeWithSource,i)})}function
ni(t,i){return t.find(function(t){return
n.sameGroup(t.group.typeWithSource,i)})}function ti(n,t){return
n.queryToFetch.substring(0,t.queryToFetch.lastIndexOf("\\"))}function ii(t)
{switch(t){case n.GroupType.AnaheimDataTile:case n.GroupType.TopApps:case
n.GroupType.People:return!0}return!1}function pr(t,i){if(!t.isSearchHomeZI||
t.scope==n.Scope.All||i==n.GroupType.RecommendedDocs)return
null;if(t.scope==n.Scope.Web){if(i==n.GroupType.Websites)return
n.Host.getLocString("RecentWebsiteSection");if(i==n.GroupType.SearchSuggestions)ret
urn n.Host.getLocString("RecentWebSearchSection")}return ii(i)?
n.Host.getLocString("FrequentSection"):n.Host.getLocString("RecentSection")}functio
n wr(t){return n.Host.getLocString(t?typeof
n.getIsMsbEduTenantEnabled=="function"&&n.getIsMsbEduTenantEnabled()?"SearchSchoolA
ndWeb":"SearchWorkAndWeb":"SearchTheWeb")}function br(){return
n.Host.getLocString("Websites")}function kr(){return n.SubstrateTenantName?
n.Host.getLocString("MsbTenantRecommended").replace("{0}",n.SubstrateTenantName):n.
Host.getLocString("QuickWorkSearchSuggestionsSection")}function ri(t,i,r,u){var
o,e,f,s,h;if(i==n.GroupType.PathCompletion)return o=ti(t,t)
+"\\"+String.fromCharCode(8206),
{title:o,narratorText:o};if(r&&(e=r.groupDisplayName,e))return{title:e,narratorText
:u?n.Host.getLocString("AddingScopeNarratorText",e):e};if(f=pr(t,i),!f)switch(i)
{case n.GroupType.Command:f=n.Host.getLocString("CommandGroup");break;case
n.GroupType.Cortana:f=n.Host.getLocString("CortanaGroup");break;case
n.GroupType.Store:f=n.Host.getLocString("StoreGroup");break;case
n.GroupType.LocalPlaces:f=n.Host.getLocString("LocalPlacesGroup");break;case
n.GroupType.Related:f=n.Host.getLocString("RelatedSuggestionsGroup");break;case
n.GroupType.SearchSuggestions:f=wr(n.msbEnabledForQuery(t));break;case
n.GroupType.Websites:f=br();break;case
n.GroupType.Contact:f=n.Host.getLocString("ContactGroup");break;case
n.GroupType.LocalSearchHistory:f="Search history";break;case
n.GroupType.CuratedSuggestions:f=n.Host.getLocString("SuggestedSection");break;case
n.GroupType.CuratedSettings:f=n.Host.getLocString("QuickSearchSuggestionsSection");
break;case n.GroupType.TopApps:f=n.Host.getLocString("TopAppsSection");break;case
n.GroupType.QuickSearch:f=n.Host.getLocString("QuickSearchSuggestionsSection");brea
k;case n.GroupType.QuickWorkSearch:case
n.GroupType.QuickWorkSearchTopList:f=kr();break;case
n.GroupType.VisualSearch:f="Visual search";break;case
n.GroupType.MSNNews:f=n.Host.getLocString(n.config.msnNewsTitleResource);break;case
n.GroupType.WelcomeExperience:f=n.Host.getLocString("WelcomeExperienceTitle");break
;case n.GroupType.Upsell:f=n.Host.getLocString("RecommendedGroup");break;case
n.GroupType.MRUHistory:f=n.Host.getLocString("MRUHistoryGroup");break;case
n.GroupType.AnaheimDataTile:f=n.Host.getLocString("AnaheimDataTopSites");break;case
n.GroupType.AnaheimDataList:r.type=="QSSG"?
f=n.Host.getLocString("QuickSearchSuggestionsSection"):r.type=="ANAH"?
f=n.Host.getLocString("AnaheimDataHistory"):r.type=="ANAT"?
f=n.Host.getLocString("AnaheimDataTopSites"):r.type=="ANAR"&&(f=n.Host.getLocString
("AnaheimDataRecentlyClosed"));break;case
n.GroupType.AnaheimDataTopHit:n.config.topHitMuse&&r.type=="ANATH"&&(f="Best match
for Edge history");break;case
n.GroupType.RecommendedDocs:f=n.Host.getLocString("RecommendedDocsGroup");n.config.
msbEnableDocumentZQ&&(f=n.Host.getLocString("RecommendedZQGroup"));break;case
n.GroupType.PromoBanner:f=n.Host.getLocString("VaccineUpdate")}if(!f)
{if(s=n.getScope(i),s==n.Scope.All)throw new Error("Unknown group type:
"+i);h=n.ScopeConfig[s];f=n.getScopeDisplayName(h)}return{title:f,narratorText:u?
n.Host.getLocString("AddingScopeNarratorText",f.toLocaleLowerCase()):f}}function
dr(t){var r,u,i=n.AnaheimDataProvider.getSelectedProfile();return
n.config.enableAnaheimDataProfile&&i&&(i.accountType=="MSA"?
r=i.id:i.accountType=="AAD"&&(u=i.id)),
[{text:n.Host.getLocString("AnaheimDataEdgeSettings"),id:"anaheimDataEdgeSettings",
selected:!1,useAccentColor:!0,action:function(){return
n.Host.launchUrlWithEdgeProtocol(null,
{edgeSettingsUrl:n.config.anaheimDataEdgeSettings,cid:r,oid:u})},instItem:n.Instrum
entedItem.getNonSuggestionInstrumentedItem("ANA",n.SyntheticQSCodesMaps.KValues,19)
,sequenceNumber:t}]}function ui(t,i,r,u,f){var
e,o=[],h,c,l=n.canShowAnaheimDataSHTile(r),p=n.canShowAnaheimDataSHList(r),w=n.canS
howAnaheimDataQF(),a=t==n.GroupType.AnaheimDataTile&&l;if((t==n.GroupType.AnaheimDa
taTile&&l||t==n.GroupType.AnaheimDataList&&p||t==n.GroupType.SearchSuggestions&&w||
t==n.GroupType.AnaheimDataTopHit&&n.config.topHitMuse)&&(e="AnaheimDataGroupPopup",
c="anaheimDataPopover",o=dr(f)),e){var s=t+"informationBubble",v=c||
t+"groupTitlePopover",y=function(){return
i.showPopover(n.Host.getLocString(e),o,_ge(s),!0,!0,v,a)},b=function(t,r){if(r==1)
{y();return}i.showPopover(n.Host.getLocString(e),o,_ge(s),!0,!1,v,a)};h={subItem:
{id:s,selected:!1,selectedStyleSuspended:!
1,narratorText:"",tooltip:"",text:"",onSelected:y},onMouseEnter:b}}return h}var
it=4,rt=6,a=8,r=12,ut=1,u=20,v=n.config.useCobaltCSS?
20:16,ei=n.config.useCobaltCSS?20:16,oi=n.config.useCobaltCSS?
42:u+2*a,ft=n.config.useCobaltCSS?40:ei+2*a,si=n.config.useCobaltCSS?
40:ft,et=n.config.useCobaltCSS?70:60,hi=n.config.useCobaltCSS?
50:u+2*r,ci=n.config.useCobaltCSS?70:u+v+it+2*r,li=n.config.useCobaltCSS?
88:u+2*(v+it)+2*r,ai=80+2*r,vi=n.config.useCobaltCSS?
18:a,ot=u,yi=n.config.useCobaltCSS?
58:48,pi=48,y=1,st=n.IconSize_GridLayout+2*(rt+ut),ht=n.IconSize_GridLayout_Medium+
2*(rt+ut),wi=n.config.useCobaltCSS?44:32,bi=8,ki=n.config.useCobaltCSS?
139:140,di=156,p=8,gi=n.config.useCobaltCSS?
572:600,nr=510,tr=400,ir=350,o=184,w=692,rr=628,ur=565,fr=501,ct=200,lt=3,at=4,er=n
.config.useCobaltCSS?33:39,or=n.config.useCobaltCSS?
33:42,b={},k="runas",d="tabletmode_opennewwindow",vt="tile.uninstall",yt="startpin"
,g="taskbarpin",pt="startunpin",nt="taskbarunpin",wt="MRUNoItemsAvailable",s="launc
hIndexingOptions",sr="s_copyfullpath",h=[{id:"FlyoutNextButton",s
elected:!1,text:null},{id:"FlyoutButton",selected:!1,text:null},
{id:"FlyoutHyperLinkButton",selected:!1,text:null},
{id:"FlyoutDismissFooterButton",selected:!1,text:null},
{id:"flyoutDismissIcon",selected:!1,text:null}],c={id:"SearchBox",selected:!
1,text:"SearchBox"},t={},bt,fi;t[k]={content:"&#xE7EF",type:1};t.runasuser={content
:"&#xE7EE",type:1};t.openinbrowser={content:"&#xE774",type:1};t.openfilelocation={c
ontent:"&#xE838",type:2};t.opencontaining={content:"&#xE838",type:2};t[d]={content:
"&#xE8A7",type:2};t[pt]={content:"&#xE77A",type:1};t[nt]={content:"&#xE77A",type:1}
;t[yt]={content:"&#xE718",type:2};t[g]={content:"&#xE718",type:2};t.settings={conte
nt:"&#xE713",type:2};t.manage={content:"&#xE912",type:1};t.review={content:"&#xE728
",type:2};t.share={content:"&#xE72D",type:1};t.connectnetworkdrive={content:"&#xE8C
E",type:1};t.disconnectnetworkdrive={content:"&#xE8CD",type:1};t.uninstall={content
:"&#xE74D",type:2};t[vt]={content:"&#xE74D",type:2};t.itemproperties={content:"&#xF
106",type:2};bt=function(){var t={};return
t[n.GroupType.PathCompletion]="GPT",t[n.GroupType.Store]="GT",t[n.GroupType.SearchS
uggestions]="GW",t[n.GroupType.WelcomeExperience]="WWE",t[n.GroupType.MRUHistory]="
MRUH",t[n.GroupType.QuickSearch]="QSCH",t[n.GroupType.CuratedSuggestions]="DFLS",t[
n.GroupType.CuratedSettings]="CUSE",t[n.GroupType.MSNNews]="MSNN",t[n.GroupType.Vis
ualSearch]="SNSC",t}
();n.extendVerbs=lr;n.getVerbsAsync=kt;n.wrapsToTwoLines=e;n.joinVerbs=tt;n.getGrou
pTitleAndNarratorText=ri;n.getGroupPopover=ui;fi=function(){function
t(t,i,r,u,f,e,o,s,h){var
c=this;this._autoComplete=t;this._navigationHelper=i;this._page=r;this._previewPane
=u;this._menuFactory=f;this._upsellViewModel=e;this._lightweightStorage=o;this._pop
overFactory=s;this._headerFooterViewModel=h;this._pendingSubmitSequenceNumber=-
1;this._pendingSubmitModifierKeys=null;this._pendingSubmitTimeStamp=null;this._item
LaunchEventHandlers=[];this.groups=[];this.topResults=[];this._lastUpdatedSequenceN
umber=-1;this._topResultsRenderingDisabled=!1;this._groupRenderingDisabled=!
1;this._resultsCounter={topResults:[],groups:
[]};this._pendingSuggestionsInExistingGroups=[];this._pendingSuggestionsInMissingGr
oups=[];n.Host.bindShown(function()
{c._selectedItem=null});r.setSuggestionClickHandler(this.doubleClickGuardedHandler(
function(t,i){n.safeExecute(function(){return
c.click(n.getCurrentTime(),t,n.getInputType(i),null)},"suggestionClickHandler")}));
r.setContextMenuHandler(function(t,i){n.safeExecute(function(){return
c._menuFactory.showContextMenuOnXY(t,i.pageX,i.pageY,function(){return
n.Host.setFocusInSearchBox(null,"contextMenuDismiss")},n.getInputType(i))},"context
MenuHandler")});r.setOpenPreviewPaneClickHandler(function(t,i)
{n.safeExecute(function(){return
c.openPreviewPane(t,i)},"openPreviewPaneClickHandler")});r.setExpanderClickInstrume
ntation(function(t,i,r){var u="Expander"+
(r?"Opened":"Closed"),f={st:i,K:t.instItem.getLayoutKValue()};n.InstrumentationHelp
er.logClientInstEvent("Select",u,null,f)});this._previewPane&&(this._previewPane.in
it(this),this._previewPane.bindBeforeItemLaunch(function(t,i,r,u,f,e){return
n.InstrumentationHelper.instrumentItemClickForPreviewPane(t,i.instItem,i.sequenceNu
mber,i.instrumentPingBack,r,null,u,f,e)}),this._previewPane.bindAfterItemLaunch(fun
ction(n,t,i){return c.onSuggestionLaunch(n,t,i)}));n.Host.bindShown(function()
{n.config.setIndexerDefaultValue&&(n.config.searchServiceDisabled=!
0);SearchAppWrapper.CortanaApp.queryFormulationView.deviceSearch.getSearchServiceSt
atusAsync&&n.Async.safeChain("getSearchServiceStatusAsync",function(){return
SearchAppWrapper.CortanaApp.queryFormulationView.deviceSearch.getSearchServiceStatu
sAsync()},function(t)
{n.InstrumentationHelper.setSearchServiceStatus(yr(t));switch(t){case 1:case 2:case
5:case 6:case 7:n.config.searchServiceDisabled=!0;c.showIndexingMessage(!
1);break;case 0:case 4:if(n.config.queryIndexerOnRunningOnly)
{n.config.searchServiceDisabled=!0;c.showIndexingMessage(!
0);break}n.config.searchServiceDisabled=!1;break;case
3:n.config.searchServiceDisabled=!1}})});r.bindOnNarratorLaunch(function(t){for(var
i,f=n.getCurrentTime(),e=c.getSelectableItems(),r=0,u=e;r<u.length;r+
+)if(i=u[r],i.id==t){c.isSuggestionOrGroup(i)?(c.select(i,!1),c.submit(f,!
1,i.sequenceNumber,null,!
0)):c.isScopeElement(i)&&_ge(i.id).click();break}});n.Host.bindSearchBoxGotFocus(fu
nction(){c._menuFactory.dismiss();var
t=n.getCurrentActiveElement();t&&t.blur();c._selectedItem&&!
c.isScopeElement(c._selectedItem)&&c.renderSelectedSuggestionState(!
1)});n.Host.bindSearchBoxLostFocus(function(){var
t=c.isScopeTile(n.getCurrentActiveElement());t?n.safeSetTimeout(function()
{n.Host.searchBoxHasFocus()||c.isScopeElement(c._selectedItem)||
c.renderSelectedSuggestionState(!
0)},75,"RootViewModel.bindSearchBoxLostFocus"):c.renderSelectedSuggestionState(!
0)});sj_evt.bind("CortanaPaneWidthSet",function(n){return
c.onPaneWidthSet(n[1])});sj_be(_ge("qfContainer"),"scroll",function()
{c._menuFactory.dismiss();c._popoverFactory&&c._popoverFactory.dismiss()});this._ic
onRenderInfos=[]}return t.prototype.isScopeTile=function(n){return
n&&n.classList.contains("scope-tile")},t.prototype.onDismiss=function()
{this.topResults=[];this.renderTopResults(!0);this.groups=[];this.renderGroups(!
0);this._partialQuery=null;this._lastUpdatedSequenceNumber=-
1;this._pendingSuggestionsInExistingGroups=[];this._pendingSuggestionsInMissingGrou
ps=[];this.toggleProgressBar(!
1);this._menuFactory.dismiss();this._previewPane&&n.RuntimeConfig.PreviewPaneAvaila
ble&&this._previewPane.dismiss();this._page.hideTemporaryMessage();this.hideIndexin
gMessage();n.DialogBox&&n.DialogBox.hide();this._headerFooterViewModel&&this._heade
rFooterViewModel.render(null,!1,!1,!1,!
0);n.Host.setSearchBoxGlyphIcon()},t.prototype.bindItemLaunch=function(n)
{this._itemLaunchEventHandlers.push(n)},t.prototype.onPaneWidthSet=function(n)
{at=Math.floor((n-2*y)/ht);lt=Math.floor((n-2*y)/
st)},t.prototype.setSelectedStyleSuspended=function(t,i)
{t.selectedStyleSuspended=i&&n.Host.isRequestFocusAvailable()},t.prototype.renderSe
lectedSuggestionState=function(n)
{this._selectedItem&&(this.setSelectedStyleSuspended(this._selectedItem,n),this.ren
derSelection(this._selectedItem))},t.prototype.toggleProgressBar=function(t){var
i=this;n.config.dataSourcesWithProgressBar.length>0&&(this._progressTimer&&(sb_ct(t
his._progressTimer),this._progressTimer=null),t?
(this._partialQuery.showProgressBar||
this._partialQuery.queryToFetch=="")&&(this._progressTimer=n.safeSetTimeout(functio
n(){i._progressTimer&&(i._page.setProgressIndicatorVisibility(!
0),i._progressTimer=null)},250,"showProgress")):n.config.dataSourcesWithProgressBar
.length>0&&(this._progressTimer&&(sb_ct(this._progressTimer),this._progressTimer=nu
ll),this._page.setProgressIndicatorVisibility(!
1)))},t.prototype.resetPendingSubmitSequenceNumber=function()
{this._pendingSubmitSequenceNumber=null;this._pendingSubmitModifierKeys=null;this._
pendingSubmitTimeStamp=null},t.prototype.onAfterKeyDown=function(t,i,r,u){var
a,e,f,p,o,c,l,w,b,v,y;if(!this._partialQuery||!
this._menuFactory.isMenuVisible()&&(!this._popoverFactory||!
this._popoverFactory.isPopoverVisible())&&t==13)return!
1;if(e=i&&i.shiftKey,n.DialogBox&&n.DialogBox.isVisible())return t!=9||u||
this.handleCrossViewModelsTabKeyNavigation(null,e),!
0;if(f=this._previewPane&&this._previewPane.hasFocus(),p="rvm
onAfterKeyDown",this._page.hideTemporaryMessage(),this.resetPendingSubmitSequenceNu
mber(),!r&&n.isContextMenuKey(t,e)&&!f)return
this.tryShowContextMenuOnSelectedSuggestion(),!
0;if(this._menuFactory.isMenuVisible()){if(t==37||t==39||t==13||n.isUpOrDownKey(t))
{if(o=this._menuFactory.onAfterKeyDown(t,i,r,u),o)return!
0;if(n.isUpOrDownKey(t))return!1}else if(t==9)return this._menuFactory.dismiss(!
0),!0;this._menuFactory.dismiss(!
0)}if(this._popoverFactory&&this._popoverFactory.isPopoverVisible()){if(t==37||
t==39||t==13||n.isUpOrDownKey(t))
{if(o=this._popoverFactory.onAfterKeyDown(t,i,r,u),o)return!0;if(t==37||
t==39)return!1}this._popoverFactory.dismiss(!
1)}if(n.RuntimeConfig.QfMode==5&&t==46)return(c=this._selectedItem,c&&c.removeIcon)
?(c.removeIcon.click(n.getCurrentTime(),1),!0):!
1;if(l=n.getCurrentActiveElement(),!this.isScopeTile(l)||f||
this._menuFactory.isMenuVisible()||
this._popoverFactory&&this._popoverFactory.isPopoverVisible()||t!=39&&t!
=37)if(t==9)if(n.config.allowTabToSelectSuggestions||e||!this._selectedItem||f||
this.isScopeElement(this._selectedItem))if(u)
{if(n.RuntimeConfig.PreviewPaneAvailable&&this._previewPane&&this._selectedItem&&!
this.isScopeElement(this._selectedItem))
{this._previewPane.onAfterKeyDownWhenNewSelection(t,this._partialQuery,this._select
edItem);if(f)return!0}}else this.handleCrossViewModelsTabKeyNavigation(l,e);else
this.select(this._headerFooterViewModel.getSelectableItems()[0],!1);else if(typeof
n.msbDsbHost!="object"||!n.msbDsbHost.isEnabled()||
this.isScopeElement(this._selectedItem)||((a=this._selectedItem)===null||a===void
0?void 0:a.hasPreviewPaneOpened)||t!==39)
{if(n.RuntimeConfig.PreviewPaneAvailable&&this._previewPane&&this._selectedItem&&!
this.isScopeElement(this._selectedItem))
{this._previewPane.onAfterKeyDownWhenNewSelection(t,this._partialQuery,this._select
edItem);if(f)return!0}}else return this.select(n.msbDsbHost.getSelectableItems()
[0],!1),!0;else
w=n.getRtlAdjustedKey(t),this._headerFooterViewModel.focusNextScopeTile(l,w==39),b=
this._headerFooterViewModel.getSelectableItems(),this.select(b[0],!1);return
f=this._previewPane&&this._previewPane.hasFocus(),this._selectedItem&&(n.isUpOrDown
Key(t)||t==9)&&!f&&(v=this.isScopeElement(this._selectedItem),v||
this._selectedItem==this.topResults[0]?
this._page.scrollToTop():this._page.scrollTo(this._selectedItem),y=p+"-
AdjustFocus",v||this.isAdvancedOption(this._selectedItem)||
this.isFlyout(this._selectedItem)?
(this.isAdvancedOption(this._selectedItem)&&this._selectedItem.id!==s?
_ge(this._selectedItem.id).querySelector("input").focus():_ge(this._selectedItem.id
).focus(),n.Host.searchBoxHasFocus()&&n.Host.setFocusInWebView(y))
:this.isDSBItem(this._selectedItem)?_ge(this._selectedItem.id).focus():t!
=9&&n.Host.searchBoxHasFocus()||
n.Host.setFocusInSearchBox(t,y)),this.isFlyoutVisible()&&h.indexOf(this._selectedIt
em)>=0&&(t==39?this.selectNextFlyoutItem(1):t==37&&this.selectNextFlyoutItem(-1)),!
1},t.prototype.isFlyoutVisible=function(){return
n.config.enableEducationalFlyout&&!
_ge("flyoutContainer").classList.contains("b_hide")},t.prototype.selectNextFlyoutIt
em=function(n){if(this.isFlyoutVisible()){var t=h.filter(function(n){return
_ge(n.id)}),r=t.indexOf(this._selectedItem),i=(r+n)
%t.length;this._selectedItem=t[i>=0?i:t.length-
1];_ge(this._selectedItem.id).focus()}},t.prototype.handleCrossViewModelsTabKeyNavi
gation=function(t,i){var v=n.RuntimeConfig.PreviewPaneAvailable&&!!
this._previewPane,h=v&&this._previewPane.isOpened(),y=h&&this._previewPane.hasFocus
(),o,c,l,e,s,u,a,r,f;if(n.DialogBox&&n.DialogBox.isVisible())o=n.DialogBox.getSelec
tableItemsByGroup(),i?this.select(o[o.length-1][0],!1):this.select(o[0][0],!1);else
if(y)if(i)this._previewPane.blur(),f=null,this._headerFooterViewModel&&(c=this._hea
derFooterViewModel.getSelectableItemsByGroup(),f=c[c.length-1][0]),this.select(f,!
1);else{this._previewPane.blur();u=this.getSelectableItems();this.select(u[0],!
0);this._previewPane.onAfterKeyDownWhenNewSelection(9,this._partialQuery,u[0])}else
this.isScopeTile(t)?(l=!
1,n.dsbManager&&i&&(r=n.dsbManager.getSelectableItemsByGroup(),r.length>0&&(s=r[r.l
ength-1][0],this.select(s,!1),l=!0)),l||(!h||i?
(e=this.getSelectableSuggestionsByGroup(),e.length>0?(s=i?e[e.length-1][0]:e[0]
[0],this.select(s,!0)):(u=this.getSelectableItems(),u.length>0?this.select(u[0],!
0):this.select(null,!
0)),a="handleCrossBordersNavigationWithTab",n.safeSetTimeout(function(){return
n.Host.setFocusInSearchBox(9,a)},0,a)):
(this.select(this._previewPane.getPreviewedSuggestion(),!
0),this._previewPane.focus(!0)))):this._selectedItem?i?h?this._previewPane.focus():
(r=this.getSelectableItemsByGroup(),f=r[r.length-1][0],this.select(f,!
1)):this.select(this.getSelectableItemsByGroup()[0][0],!
1):this.select(this.getSelectableItemsByGroup()[0][0],!
1)},t.prototype.tryShowContextMenuOnSelectedSuggestion=function(t){var
r=this,i=this._selectedItem&&this.isSuggestion(this._selectedItem)?
this._selectedItem:null;i&&n.safeExecute(function(){return
r._menuFactory.showContextMenuOnElement(i,_ge(i.id),function(){return
n.Host.setFocusInSearchBox(null,"contextMenuDismiss")},t)},"contextMenuHandler")},t
.prototype.onQueryChanged=function(t,i){var
s=this,h,u,f,e,c,l,o,a,r;if(n.DialogBox&&n.DialogBox.hide(),this._menuFactory.dismi
ss(),!this._partialQuery||!this._partialQuery.equals(t))
{if(this._page.hideTemporaryMessage(),n.config.dataSourcesWithProgressBar.length>0&
&(this._progressTimer&&(sb_ct(this._progressTimer),this._progressTimer=null),t.show
ProgressBar?this._progressTimer=n.safeSetTimeout(function()
{s._progressTimer&&(s._page.setProgressIndicatorVisibility(!
0),s._progressTimer=null)},250,"showProgress"):this._page.setProgressIndicatorVisib
ility(!1)),this._partialQuery&&this._partialQuery.scope!
=t.scope&&(this._turnOnIndexingInstItem||
this.hideIndexingMessage()),h=this._partialQuery?
this._partialQuery.queryToFetch:"",u=t.queryToFetch,this._previewPane&&n.RuntimeCon
fig.PreviewPaneAvailable)this._previewPane.onQueryChanged(t);for(this._partialQuery
=t,f=!1,e=0,c=this.topResults;e<c.length;e++)r=c[e],r.updateFromQuery&&!
r.hasPreviewPaneOpened?r.updateFromQuery(t)&&(f=!
0):u.length>h.length&&u.startsWith(h)&&r.query.toLowerCase().includes(t.queryToFetc
h.toLowerCase())&&(l=r.text.indexOf(HitHighlightingParser.endMarker),l>=0&&l<r.text
.length-
1&&(r.text=HitHighlightingParser.addMarkers(HitHighlightingParser.removeMarkers(r.t
ext),u),f=!0));if(f){for(o=0,a=this.topResults;o<a.length;o+
+)r=a[o],r.sequenceNumber=i,this.updateNarratorWithPreviewMessage(r);this.renderTop
Results()}this.resetIconTimers();this._iconRenderInfos=[]}},t.prototype.onSuggestio
nsParsed=function(t,i,r,u,f){var
o=t.enabledDataSources[r].groupType,s,a,h,v,c,y,l,p,e;if(o===n.GroupType.QuickWorkS
earch&&typeof
n.qwsShowTopList=="function"&&n.qwsShowTopList()&&t.isSearchHomeZI)for(s=0,a=f;s<a.
length;s++)e=a[s],e.staticGroupType=e.msbDomain==="Person"?
n.GroupType.QuickWorkSearchTopList:o;else
if(o===n.GroupType.AnaheimDataList)for(h=0,v=f;h<v.length;h+
+)e=v[h],e.staticGroupType=n.config.enableAnaheimDataTSTile&&e.type=="ANAT"?
n.GroupType.AnaheimDataTile:o;else
if(o===n.GroupType.SearchSuggestions)for(c=0,y=f;c<y.length;c+
+)e=y[c],e.staticGroupType=n.config.topHitMuse&&e.type=="ANATH"?
n.GroupType.AnaheimDataTopHit:o;else if(typeof
o=="number")for(l=0,p=f;l<p.length;l++)e=p[l],e.staticGroupType=o;(u==="NI"||
u==="PI")&&(r=="PP"||r=="ST"||t.scope!
=n.Scope.All)&&n.RuntimeConfig.ScopesAvailable&&t.scope!
=n.Scope.Web&&this.showIndexingMessage(!
0)},t.prototype.areSuggestionsPresent=function(){return this.topResults.length>0||
this.groups.length>0&&this.groups.some(function(n){return
n.suggestions.length>0})},t.prototype.getSuggestions=function(n){var
t=this.getCurrentTopResults();return this.groups.forEach(function(n){return
t=t.concat(n.suggestions)}),n&&(this._pendingSuggestionsInExistingGroups.forEach(fu
nction(n){return
t=t.concat(n.suggestions)}),this._pendingSuggestionsInMissingGroups.forEach(functio
n(n){return
t=t.concat(n.suggestions)})),t},t.prototype.getSelectableItems=function(){var
t,r,u,i,f;if(n.DialogBox&&n.DialogBox.isVisible())return
n.DialogBox.getSelectableItems();if(this._menuFactory.isMenuVisible())return
this._menuFactory.getSelectableItems();if(this._previewPane&&this._previewPane.hasF
ocus())return this._previewPane.getSelectableItems();if(typeof
n.msbDsbHost=="object"&&n.msbDsbHost.hasFocus())return[];for(t=[],this._launchIndex
ingDataModel&&t.push(this._launchIndexingDataModel.action),t.push.apply(t,this.topR
esults),r=0,u=this.groups;r<u.length;r+
+)i=u[r],i.click&&t.push(i),i.popover&&t.push(i.popover.subItem),f=i.suggestions.fi
lter(function(n){return!n.suppressed}),f.forEach(function(n){n.unselectable||
t.push(n);n.subItems&&t.push.apply(t,n.subItems.filter(function(n){return!
n.disabled}))});return
n.dsbManager&&t.push.apply(t,n.dsbManager.getSelectableItems()),this.areSuggestions
Present()||
t.push(c),this._headerFooterViewModel&&t.push.apply(t,this._headerFooterViewModel.g
etSelectableItems()),t},t.prototype.getSelectableSuggestionsByGroup=function()
{if(n.config.allowTabToSelectSuggestions){var t=[];return
t.push(this.topResults),this.groups.forEach(function(n)
{n.click&&t.push([n]);n.popover&&t.push([n.popover.subItem]);var
i=[],r=n.suggestions.filter(function(n){return!n.suppressed});r.forEach(function(n)
{n.unselectable||i.push(n);n.subItems&&i.push.apply(i,n.subItems.filter(function(n)
{return!n.disabled}))});t.push(i)}),t.filter(function(n){return
n.length>0})}return[]},t.prototype.getSelectableItemsByGroup=function()
{if(n.DialogBox&&n.DialogBox.isVisible())return
n.DialogBox.getSelectableItemsByGroup();if(this._menuFactory.isMenuVisible())return
this._menuFactory.getSelectableItemsByGroup();if(this._previewPane&&this._previewPa
ne.hasFocus())return this._previewPane.getSelectableItemsByGroup();var t=[];return
this.isFlyoutVisible()&&t.push([h.find(function(n){return!!
_ge(n.id)})]),this._headerFooterViewModel&&t.push.apply(t,this._headerFooterViewMod
el.getSelectableItemsByGroup()),this._launchIndexingDataModel&&t.push([this._launch
IndexingDataModel.action]),this.areSuggestionsPresent()?
(t.push.apply(t,this.getSelectableSuggestionsByGroup()),n.dsbManager&&t.push.apply(
t,n.dsbManager.getSelectableItemsByGroup())):
(n.dsbManager&&t.push.apply(t,n.dsbManager.getSelectableItemsByGroup()),t.push([c])
),t},t.prototype.getSelectedItem=function(){return
n.DialogBox&&n.DialogBox.isVisible()?
n.DialogBox.getSelectedItem():this._menuFactory.isMenuVisible()?
this._menuFactory.getSelectedItem():this._previewPane&&this._previewPane.hasFocus()
?this._previewPane.getSelectedItem():this._selectedItem?
this._selectedItem:c},t.prototype.updateSelectionState=function(t)
{n.contains(this.topResults,t)?this.renderTopResults():this.groups.some(function(i)
{return
n.contains(i.suggestions,t)})&&this.renderGroups()},t.prototype.isSubItem=function(
n){return n&&typeof n.itemView!
="undefined"},t.prototype.getSuggestionById=function(n){for(var
i,t=0;t<this.groups.length;t++)for(i=0;i<this.groups[t].suggestions.length;i+
+)if(this.groups[t].suggestions[i].id==n)return
this.groups[t].suggestions[i];return null},t.prototype.selectGroupItem=function(n)
{for(var s,r,e,u,o,t,i=0,f=this.groups;i<f.length;i+
+)for(s=f[i],r=0,e=s.suggestions;r<e.length;r++)t=e[r],t.reactKey==n.reactKey?
(t.selected=!0,this._selectedItem=t):t.selected=!
1;for(u=0,o=this.topResults;u<o.length;u++)t=o[u],t.reactKey==n.reactKey?
(t.selected=!0,this._selectedItem=t):t.selected=!
1},t.prototype.doesGroupsContain=function(n){for(var
f,i,u,e,t=0,r=this.groups;t<r.length;t+
+)for(f=r[t],i=0,u=f.suggestions;i<u.length;i+
+)if(e=u[i],e.reactKey==n.reactKey)return!0;return!
1},t.prototype.renderSelection=function(t,i){var
r,u;this.updateGroupSuggestion(i);this.isSubItem(t)&&(t=this.getSuggestionById(t.su
ggestionId));i&&this.isSubItem(i)&&(i=this.getSuggestionById(i.suggestionId));
(t&&this.isSuggestion(t)&&n.contains(this.topResults,t)||
i&&this.isSuggestion(i)&&n.contains(this.topResults,i))&&(this.renderTopResults(),t
his.groups&&i&&i.handoffType===21&&this.renderGroups());this._headerFooterViewModel
&&(t&&this.isAdvancedOption(t)||
i&&this.isAdvancedOption(i))&&this._headerFooterViewModel.updateTopHitHeader();t&&(
(u=(r=this._launchIndexingDataModel)===null||r===void 0?void 0:r.action)===null||
u===void 0?void
0:u.id)===s&&this._page.updateTemporaryMessageView(this._launchIndexingDataModel);
(t&&n.isGroup(t)&&n.contains(this.groups,t)||
t&&this.isSuggestion(t)&&this.doesGroupsContain(t)||
i&&n.isGroup(i)&&n.contains(this.groups,i)||
i&&this.isSuggestion(i)&&this.groups.some(function(t){return
n.contains(t.suggestions,i)}))&&this.renderGroups()},t.prototype.updateGroupSuggest
ion=function(n){var
t,i;n&&n.handoffType===21&&this.groups&&(t=this.groups.findIndex(function(t)
{return t.type===n.groupType}),t>-
1&&(i=this.groups[t].suggestions.findIndex(function(t){return t.id===n.id}),i>-
1&&(this.groups[t].suggestions[i].selected=!
1)))},t.prototype.renderGroups=function(t){if(this._partialQuery){var
i=this._partialQuery.queryToFetch?
n.config.maxSuggestionsPerGroup:0;i&&i>0&&this.groups.forEach(function(n,t,r)
{r[t].suggestions=n.suggestions.slice(0,i)})}this._groupRenderingDisabled||
(this.adjustMsbGroups(),this._page.updateGroupsView({query:this._contentQuery,topRe
sults:this.topResults,groups:this.groups},t),n.InstrumentationHelper.updateSuggesti
onsList(this.topResults,this.groups))},t.prototype.adjustMsbGroups=function()
{this.suppressDefault();this.msbGroupsMergeDocsIntoQws();this.msbGroupsSetupTopList
();this.msbGroupsSetLayout()},t.prototype.suppressDefault=function(){var
t;if(typeof
n.enableQws=="function"&&n.enableQws()&&((t=this._contentQuery)===null||t===void 0?
void 0:t.isSearchHomeZI)){var i=this.groups.filter(function(t){return
t.type===n.GroupType.QuickWorkSearchTopList})[0],r=this.groups.filter(function(t)
{return t.type===n.GroupType.QuickWorkSearch})[0],u=this.groups.filter(function(t)
{return t.type===n.GroupType.RecommendedDocs})[0];(i||r||
u)&&(this.groups=this.groups.filter(function(t){return t.type!
==n.GroupType.TopApps&&t.type!
==n.GroupType.QuickSearch}))}},t.prototype.getMaxMsbItems=function(){var
i,r=this.getMaxNumberOfRecentItems(n.GroupType.CuratedSuggestions),t;return typeof
n.qwsShowTopList=="function"&&n.qwsShowTopList()&&(t=this.groups.filter(function(t)
{return t.type===n.GroupType.QuickWorkSearchTopList})[0],((i=t===null||t===void 0?
void 0:t.suggestions)===null||i===void 0?void 0:i.length)>0)?r-
2:r},t.prototype.msbGroupsMergeDocsIntoQws=function(){var u,f,r,i,t;if(typeof
n.enableQwsRecDocs=="function"&&n.enableQwsRecDocs()&&((u=this._contentQuery)===nul
l||u===void 0?void 0:u.isSearchHomeZI)&&(r=this.groups.filter(function(t){return
t.type===n.GroupType.QuickWorkSearch})[0],i=this.groups.filter(function(t){return
t.type===n.GroupType.RecommendedDocs})[0],r&&((f=i===null||i===void 0?void
0:i.suggestions)===null||f===void 0?void 0:f.length)>0))
{t=r.suggestions;n.isMsbQwsDocsCacheEnabled(this._partialQuery)&&(t=t.filter(functi
on(n){return n.type!=="FL"}));var
e=i.suggestions.slice(0,n.config.ziRecommendedDocsResultsCount),o=this.getMaxMsbIte
ms(),s=o-
e.length;t=t.slice(0,s);t.push.apply(t,e);r.suggestions=t;this.groups=this.groups.f
ilter(function(t){return t.type!
==n.GroupType.RecommendedDocs});this.groups.filter(function(t){return
t.type===n.GroupType.QuickWorkSearch}).map(function(n){return
n.instRegionName="QuickWorkSearchWithRecDocs"})}},t.prototype.msbGroupsSetupTopList
=function(){var i,t,r,u;typeof
n.qwsShowTopList=="function"&&n.qwsShowTopList()&&((i=this._contentQuery)===null||
i===void 0?void 0:i.isSearchHomeZI)&&(t=this.groups.filter(function(t){return
t.type===n.GroupType.QuickWorkSearchTopList})
[0],t&&(r=this.groups.filter(function(t){return
t.type===n.GroupType.QuickWorkSearch})[0],r&&(r.hideGroupHeader=!
0),u=this.groups.filter(function(t){return t.type===n.GroupType.RecommendedDocs})
[0],u&&(u.hideGroupHeader=!0),t.cssClasses=(t.cssClasses||"")+"
msbQwsTop"))},t.prototype.msbGroupsSetLayout=function(){var u,f,t,e,i,r;typeof
n.qwsShowTopList=="function"&&n.qwsShowTopList()&&((u=this._contentQuery)===null||
u===void 0?void 0:u.isSearchHomeZI)&&(t=this.groups.filter(function(t){return
t.type===n.GroupType.QuickWorkSearch})[0],t?t.cssClasses=(t.cssClasses||"")+"
colRight":(e=this.groups.filter(function(t){return
t.type===n.GroupType.QuickWorkSearchTopList})[0],i=this.groups.filter(function(t)
{return t.type===n.GroupType.RecommendedDocs})[0],e&&((f=e.suggestions)===null||
f===void 0?void 0:f.length)>0&&i&&(i.cssClasses=(i.cssClasses||"")+"
colRight")),r=this.groups.filter(function(t){return
t.type===n.GroupType.QuickWorkSearchTopList})
[0],r&&(r.cssClasses=(r.cssClasses||"")+"
colRight"))},t.prototype.select=function(t,i){var f,e,r,u;
(n.cohortProfileManager===null||n.cohortProfileManager===void 0?void
0:n.cohortProfileManager.isTourVisible())&&((f=t===null||t===void 0?void
0:t.id)===null||f===void 0?void 0:f.toLowerCase().search(/flyout/i))==-1||
(n.DialogBox&&n.DialogBox.isVisible()?
n.DialogBox.select(t):this._menuFactory.isMenuVisible()&&n.contains(this._menuFacto
ry.getSelectableItems(),t)?this._menuFactory.select(t,!
1):this._previewPane&&n.contains(this._previewPane.getSelectableItems(),t)?
this._previewPane.select(t,!1):(r=this._selectedItem,r&&(r.selected=!
1,this.setSelectedStyleSuspended(r,!1)),t==c?
(this._selectedItem=null,n.Host.searchBoxHasFocus()||
n.Host.setFocusInSearchBox(null,"rvm_select")):
(this._selectedItem=t,t&&(this.isDSBItem(t)&&n.Host.searchBoxHasFocus()&&n.Host.set
FocusInWebView("rvm_dsb_select"),t.selected=!0,(e=t.onSelected)===null||e===void 0?
void 0:e.call(t),this.setSelectedStyleSuspended(t,!
n.Host.searchBoxHasFocus()))),i&&t&&(t.arrowOrTabAction=!
0),this.renderSelection(this._selectedItem,r),this.isScopeElement(t)&&this._headerF
ooterViewModel.select(t,!1),i&&(u=t?
t.query:null,u&&this._partialQuery.scopePrefix&&(u=this._partialQuery.scopePrefix.t
rim()+":
"+u),n.Host.updateQueryWithoutRefetching(u))))},t.prototype.resetIconTimers=functio
n(n,t){var o=typeof n=="undefined"||!n,s=typeof n=="undefined"||n,i,f,u,e,r;if(o)
{if(t)for(i=0,f=this._renderGroupsIconsCBs;i<f.length;i+
+)r=f[i],r();this._renderGroupsIconsCBs=[];this._renderGroupsTimerForIcons&&(sb_ct(
this._renderGroupsTimerForIcons),this._renderGroupsTimerForIcons=null)}if(s)
{if(t)for(u=0,e=this._renderTopResultsIconsCBs;u<e.length;u+
+)r=e[u],r();this._renderTopResultsIconsCBs=[];this._renderTopResultsTimerForIcons&
&(sb_ct(this._renderTopResultsTimerForIcons),this._renderTopResultsTimerForIcons=nu
ll)}},t.prototype.setupIcon=function(i,r,u,f){var
e=this,o,s,h;if(n.config.noFetchIcons||n.config.reactGroups)
{f();return}if(o=function(){u.isTopResult?
e.renderTopResults():e.renderGroups();e.resetIconTimers(u.isTopResult,!
0)},s=function(t){u.iconsPendingReturn==0?(o(),t&&t()):u.isTopResult?
(t&&e._renderTopResultsIconsCBs.push(t),e._renderTopResultsTimerForIcons||
(e._renderTopResultsTimerForIcons=n.safeSetTimeout(function()
{e._renderTopResultsTimerForIcons=null;o()},ct,"renderTRIconsAsync"))):
(t&&e._renderGroupsIconsCBs.push(t),e._renderGroupsTimerForIcons||
(e._renderGroupsTimerForIcons=n.safeSetTimeout(function()
{e._renderGroupsTimerForIcons=null;o()},ct,"renderGRPIconsAsync")))},+
+u.iconsPendingReturn,!
r.suppressed&&r.getIcon)n.InstrumentationHelper.notifyIconPending(i,u.isTopResult),
h=this._partialQuery,r.getIcon(t.getImageSize(h,r,u.isTopResult),function(t)
{r.icon=t;var o=function(){--
u.iconsPendingReturn;e._partialQuery&&i==n.SequenceNumberManager.getSequenceNumber(
)&&(n.InstrumentationHelper.notifyIconReadyOrFailed(i,u.isTopResult),
(u.isTopResult&&n.contains(e.topResults,r)||!
u.isTopResult&&e.groups.some(function(t){return
n.contains(t.suggestions,r)}))&&s(f))};n.populateImageRatio(r.icon,r.type,o)});else
if(!r.suppressed&&r.icon&&n.canIconFail(r.icon))
{n.InstrumentationHelper.notifyIconPending(i,u.isTopResult);var
c=r.icon.getFallbackIcon,l=function(n,t){return
t(r.icon)},a=r.icon.isValidSize,v=function()
{r.getIcon=c;e.setupIcon(i,r,u,f);n.InstrumentationHelper.notifyIconReadyOrFailed(i
,u.isTopResult)},y=function(){r.icon.isSmall=!
0;r.getIcon=l;e.setupIcon(i,r,u,f);n.InstrumentationHelper.notifyIconReadyOrFailed(
i,u.isTopResult)};r.icon.onIconError=v;r.icon.onIconRendered=function(t,e){a(t,e)||
r.icon.isSmall?
(n.InstrumentationHelper.notifyIconReadyOrFailed(i,u.isTopResult),f()):y()};--
u.iconsPendingReturn;s()}else--
u.iconsPendingReturn,f()},t.getImageSize=function(t,i,r){return t.isSearchHomeZI?
i.type=="TOPL"?7:8:t.scope==n.Scope.Apps&&!t.queryToFetch?
3:n.displayedInGridLayout(i.type)?2:r?
0:1},t.prototype.isSuggestionOrGroup=function(n){return!
this.isScopeElement(n)},t.prototype.isSuggestion=function(t){return!n.isGroup(t)&&!
this.isScopeElement(t)&&!
this.isAdvancedOption(t)},t.prototype.isDSBItem=function(n){var t;return!!
((t=n)===null||t===void 0?void 0:t.dsb)},t.prototype.isAdvancedOption=function(n)
{return typeof n.layout=="number"},t.prototype.isFlyout=function(n){return
this.isFlyoutVisible()&&h.indexOf(n)>=0},t.prototype.isBodyOrSuggestion=function(n)
{return n&&(n.tagName.toLowerCase()=="body"||n.tagName.toLowerCase()=="iframe"||
n.className&&n.classList.contains("suggestion"))},t.prototype.submit=function(t,i,r
,u,f){var c,o=f?5:i?
6:1,a=n.getCurrentActiveElement(),e,h,l,v;if(n.DialogBox&&n.DialogBox.isVisible())
{n.DialogBox.submit();return}if(this._previewPane&&this._previewPane.hasFocus())
{if(e=this._previewPane.getSelectedItem(),e&&e.click&&e.optionType===undefined)
{e.click(t,o);return}}else if(!this._selectedItem||!
this.isScopeElement(this._selectedItem)||this._menuFactory.isMenuVisible()||
this._popoverFactory&&this._popoverFactory.isPopoverVisible())
{if((n.RuntimeConfig.QfMode==5||n.RuntimeConfig.QfMode==9)&&!this._selectedItem)
{n.Host.submitFileExplorerTextSuggestion(this._partialQuery.queryToFetch);return}}e
lse{_ge(this._selectedItem.id).click();return}if(h=this._menuFactory.getSelectedIte
m(),h){h.click&&h.click(t,o,u);return}if(l=this._popoverFactory?
this._popoverFactory.getSelectedItem():null,l)
{this._popoverFactory.submit(l);return}if(((c=this._selectedItem)===null||c===void
0?void 0:c.id)===s){this.click(t,this._selectedItem,o,u);return}if(v=!
this.isBodyOrSuggestion(a),v){n.Host.isRequestFocusAvailable()||
a.click();return}if(this._lastUpdatedSequenceNumber!=r&&(!this._selectedItem||
this._selectedItem==this.topResults[0]))
{this._pendingSubmitSequenceNumber=r;this._pendingSubmitModifierKeys=u;this._pendin
gSubmitTimeStamp=t;return}this._selectedItem?
this.click(t,this._selectedItem,o,u):this.groups.length>0&&this._partialQuery.fullP
artialQuery&&this.showDisableEnterMessage()},t.prototype.doubleClickGuardedHandler=
function(t){var
i;return function(r,u){i&&n.getCurrentTime()-i<=250||
(i=n.getCurrentTime(),t(r,u))}},t.prototype.click=function(t,i,r,u)
{if(this._page.hideTemporaryMessage(),this.isAdvancedOption(i))
{i.click&&i.click(t,r,u);return}var f=n.isGroup(i)||this.isSubItem(i)?null:i;if(!
i.instItem||f&&f.isReformulation||
n.InstrumentationHelper.instrumentItemClick(t,i.instItem,i.sequenceNumber,f?
f.instrumentPingBack:null,r,u),!f){i.click&&i.click(t,r,u);return}u=u||
n.Host.getModifierKeyState();u.ctrlKey&&u.shiftKey?
this.launchVerb(f,k,t):u.shiftKey?
this.launchVerb(f,d,t):f.click(t,r,u);this.onSuggestionLaunch(f,this._partialQuery)
},t.prototype.onSuggestionLaunch=function(t,i,r)
{n.isChildSuggestion(t)&&t.parent&&(t=t.parent);this._itemLaunchEventHandlers.forEa
ch(function(n){return n(t,i,r)})},t.prototype.launchVerb=function(t,i,r){var
u=kt("launchVerb",t,n.config.rawVerbs,!1,function(u){for(var s,h,e=!1,c=function(t)
{if(t.verb&&t.verb.toLocaleLowerCase()==i.toLocaleLowerCase())return t.executeSync?
n.safeExecute(function(){return
t.executeSync()},"verb.executeSync",null,i):n.Async.safeChain("verb.executeAsync",f
unction(){return t.executeAsync()},function(){return
n.Host.manuallyDismissApp()},null,null,i),e=!0,"break"},f=0,o=u;f<o.length;f+
+)if(s=o[f],h=c(s),h==="break")break;e||t.click(r,0)},function(){return!0});u||
t.click(r,0)},t.prototype.getGroupHeaderClickAction=function(t,i,r){var
s=this,u,f,e=null,o=null,h,c,l;if(n.RuntimeConfig.ScopesAvailable&&(h=n.getScope(i.
type),h!
=n.Scope.All))if(i.type==n.GroupType.SearchSuggestions&&t.isSearchHomeZI)f=n.Host.g
etLocString("OpenPrivacyPortalButtonText"),e=n.Host.getLocString("ManageSearchHisto
ry"),u=function(){return n.Host.launchPrivacyPortal()};else return n.isL2(t)||!
n.isScopeEnabled(h,n.ScopeConfig[h])?[null,null,null,null,null]:(c=function()
{return s._headerFooterViewModel.clickHandler(h,"groupHeader",i)},
[c,null,null,null,null]);if(!u)switch(i.type){case n.GroupType.Store:u=function()
{return n.Host.launchStoreSearch(t.queryToFetch)};break;case
n.GroupType.SearchSuggestions:u=function(){return s.launchSearch(t,r)};break;case
n.GroupType.PathCompletion:u=function(){return
n.Host.launchFolder(ti(t,s._partialQuery))};break;case n.GroupType.MSNNews:if(!
n.config.msnNewsAlternativeUX)return
f=n.Host.getLocString("QuickSearchSuggestionsSection"),e=n.Host.getLocString("MSNNe
wsQuickSearchHover"),u=function()
{s._lightweightStorage.setItem(n.currentTabStorageKey,n.MSNNewsTabs.QuickSearches);
n.Host.refreshCurrentPane();n.InstrumentationHelper.logClientInstEvent("Select","MS
NNewsTabChange",null,{newtab:"QuickSearches"})},[u,null,f,e,o];break;case
n.GroupType.Upsell:if(t.isSearchHomeZI)return
o={content:"&#xE711",type:2},f=n.Host.getLocString("DismissUpsell"),e=n.Host.getLoc
String("DismissUpsell"),u=this._upsellViewModel.getDismissButtonAction(),
[u,null,f,e,o];break;case
n.GroupType.QuickSearch:if(n.config.msnNewsSearch&&n.shouldEnableMSNNewsSearches(n.
getCurrentLanguage()))return
f=n.Host.getLocString(n.config.msnNewsTitleResource),e=n.Host.getLocString(n.config
.msnNewsHoverResource),u=function()
{s._lightweightStorage.setItem(n.currentTabStorageKey,n.MSNNewsTabs.News);n.Host.re
freshCurrentPane();n.InstrumentationHelper.logClientInstEvent("Select","MSNNewsTabC
hange",null,{newtab:"MSNNews"})},[u,null,f,e,o];break;case
n.GroupType.WelcomeExperience:if(n.config.enableWWETour&&n.RuntimeConfig.PreviewPan
eAvailable&&SearchAppWrapper.CortanaApp.height>=615)return
o={content:"&#xE711",type:2},f=n.Host.getLocString("DismissUpsell"),e=n.Host.getLoc
String("DismissUpsell"),u=function(){return s.dismissTour(t)},
[u,null,f,e,o];break;case
n.GroupType.AnaheimDataTile:if(n.canShowAnaheimDataSHTile(this._lightweightStorage)
)return
o={content:"&#xE711",type:2,className:"anaheimDataTileDismissGroup"},f=n.Host.getLo
cString("DismissAnaheimData"),e=n.Host.getLocString("DismissAnaheimData"),u=functio
n()
{s._lightweightStorage.setItem("AnaheimDataTileDismissed","1");n.Host.refreshCurren
tPane()},[u,null,f,e,o];break;case
n.GroupType.AnaheimDataList:if(n.canShowAnaheimDataSHList(this._lightweightStorage)
)return
o={content:"&#xE711",type:2,className:"anaheimDataListDismissGroup"},f=n.Host.getLo
cString("DismissAnaheimData"),e=n.Host.getLocString("DismissAnaheimData"),u=functio
n()
{s._lightweightStorage.setItem("AnaheimDataListDismissed","1");n.Host.refreshCurren
tPane()},[u,null,f,e,o];break;case n.GroupType.PromoBanner:return
o={content:"&#xE711",type:2},f=n.Host.getLocString("DismissUpsell"),e=n.Host.getLoc
String("DismissUpsell"),u=this._upsellViewModel.getDismissButtonAction(),
[u,null,f,e,o]}if(u){if(!r)throw"No QS code for: "+n.GroupType[i.type];return
l=n.InstrumentedItem.getNonSuggestionInstrumentedItem(r,n.SyntheticQSCodesMaps.KVal
ues),
[u,l,f,e,o]}return[null,null,null,null,null]},t.prototype.shouldShowPlusIconInGroup
Header=function(t,i){if(n.getScope(t)==n.Scope.Web||t==n.GroupType.Store)return!
1;if(t==n.GroupType.Apps&&this._partialQuery.queryToFetch.length<n.config.minLength
ForIBAonL1)return!0;if(t==n.GroupType.Apps||t==n.GroupType.Settings){var
r=i[t==n.GroupType.Apps?"PP":"ST"];return!(r&&r.maxedOut)}return!
0},t.prototype.shouldHideGroupHeader=function(t,i){var
r=i===n.Host.getLocString("MsbVerticalSuggestionGroupName");return
t===n.GroupType.QuickSearch&&n.shouldEnableMSNNewsSearches(n.getCurrentLanguage())&
&n.canShowMSNNewsTab(this._lightweightStorage)?!0:t===n.GroupType.VisualSearch||r||
t===n.GroupType.MSNNews&&n.config.msnNewsAlternativeUX?!0:!
1},t.prototype.addGroup=function(t,r,u,f,e){var w,o,a;if(i(this.groups,t))throw new
Error("Trying to add repeated group "+t);var
v=bt[t.type],s=this.getGroupHeaderClickAction(this._partialQuery,t,v,r),c=s[0],l=s[
1],y=s[2],b=s[3],p=s[4],h=ri(this._partialQuery,t.type,r,!!c);return
t.source&&(h.title+=" -
"+n.getGroupSourceDisplayName(t.source)),w=ui(t.type,this._popoverFactory,this._lig
htweightStorage,this._partialQuery.isSearchHomeZI,u),o=[],n.isTopHitChildGroup(t)?
o.push("topHitConnectedToGroup"):t.type==n.GroupType.TopApps||
this._partialQuery.isSearchHomeZI&&t.type==n.GroupType.People||
t.type==n.GroupType.AnaheimDataTile?
o.push("topItemsGroup"):t.type==n.GroupType.QuickSearch?
o.push("balloonSuggGroup"):t.type==n.GroupType.QuickWorkSearch?
(o.push("quickWorkSearchGroup"),typeof
n.shouldHideTopApp=="function"&&n.shouldHideTopApp()&&n.isQwsSuccessRateThresholdMe
t()&&n.isMsbEnterprise()&&o.push("topMostGroup")):t.type==n.GroupType.VisualSearch?
o.push("snipSuggGroup"):t.type==n.GroupType.MSNNews?
o.push("msnNewsGroup"):t.type==n.GroupType.WelcomeExperience?
o.push("welcomeExperience"):t.type==n.GroupType.Upsell?
(o.push("upsellSuggGroup"),n.shouldEnableAnaheimResetDefault()&&o.push("edgeUpsellD
efaultTopBanner")):t.type==n.GroupType.PromoBanner?
o.push("skypePromoSuggGroup"):t.type==n.GroupType.MRUHistory||
t.type==n.GroupType.CuratedSuggestions?
o.push("leftPaneZIsuggestions"):t.type==n.GroupType.RecommendedDocs||
t.type==n.GroupType.Documents&&n.isRecommendedDocsGroupEnabled(this._partialQuery)?
(o.push("recommendedDocsGroup"),typeof
n.shouldHideTopApp=="function"&&n.shouldHideTopApp()&&n.isQwsSuccessRateThresholdMe
t()&&n.isMsbEnterprise()&&o.push("topMostGroup")):t.type==n.GroupType.AnaheimDataLi
st?o.push("anaheimDataGroup"):t.type==n.GroupType.AnaheimDataTopHit?
o.push("anaheimDataGroup"):t.type==n.GroupType.CuratedSettings?
o.push("curatedSettingsGroup"):t.type==n.GroupType.ThreeFingerTap&&o.push("threeFin
gerTap"),a={type:t.type,typeWithSource:t,id:"gr"+t.type+
(t.source||""),text:h.title,secondaryText:y,secondaryIcon:p,narratorText:h.narrator
Text,tooltip:b,click:(n.cohortProfileManager===null||n.cohortProfileManager===void
0?void 0:n.cohortProfileManager.isTourVisible())?
null:c,onlyAnnotationIsClickable:c&&(!!y||!!p),suggestions:
[],instRegionName:n.GroupType[t.type],instItem:l,selected:!1,cssClasses:o.join("
")||
undefined,sequenceNumber:u,showPlusIconInHeader:this.shouldShowPlusIconInGroupHeade
r(t.type,e),hideGroupHeader:this.shouldHideGroupHeader(t.type,h.title),popover:w},l
&&n.InstrumentationHelper.instrumentSyntheticInstrumentedItem(u,v,l),this._resultsC
ounter.groups.push({typeWithSource:t,suggestions:
[]}),this.insertGroup(a,f),a},t.prototype.insertGroup=function(t,i){for(var
f,e=this,o=i.findIndex(function(i){return n.sameGroup(i,t.typeWithSource)}),u=!
1,s=function(r){var f=i.findIndex(function(t){return
n.sameGroup(t,e.groups[r].typeWithSource)});if(f>o)return
h.groups.splice(r,0,t),u=!0,"break"},h=this,r=0;r<this.groups.length;r+
+)if(f=s(r),f==="break")break;u||
this.groups.push(t)},t.prototype.handlePendingSubmit=function(t)
{if(this._pendingSubmitSequenceNumber==this._lastUpdatedSequenceNumber)try{if(this.
topResults.length==0)(this.groups.length>0||
t.length>0)&&this.showDisableEnterMessage();else{var i=this.topResults[0];return
n.InstrumentationHelper.instrumentItemClick(this._pendingSubmitTimeStamp,i.instItem
,i.sequenceNumber,i.instrumentPingBack,1,this._pendingSubmitModifierKeys),this._pen
dingSubmitModifierKeys&&this._pendingSubmitModifierKeys.ctrlKey&&this._pendingSubmi
tModifierKeys.shiftKey?
this.launchVerb(i,k,this._pendingSubmitTimeStamp):this._pendingSubmitModifierKeys&&
this._pendingSubmitModifierKeys.shiftKey?
this.launchVerb(i,d,this._pendingSubmitTimeStamp):i.click(this._pendingSubmitTimeSt
amp,0,this._pendingSubmitModifierKeys),0}}finally{this.resetPendingSubmitSequenceNu
mber()}return 1},t.prototype.showDisableEnterMessage=function()
{this._page.showTemporaryMessage(n.Host.getLocString("EnterOnAmbiguousTopHitMessage
Text"))},t.prototype.showIndexingMessage=function(t){var i=this,r;t?
(this._turnOnIndexingInstItem=null,this._launchIndexingDataModel=null):
(this._turnOnIndexingInstItem=n.InstrumentedItem.getNonSuggestionInstrumentedItem("
IMIO",n.SyntheticQSCodesMaps.KValues),r={id:s,selected:null,text:n.Host.getLocStrin
g("WindowsIndexingDisabledAction"),title:null,instItem:this._turnOnIndexingInstItem
,click:function(t,r){var
u=n.SequenceNumberManager.getSequenceNumber();u>i._lastUpdatedSequenceNumber&&n.Ins
trumentationHelper.instrumentSyntheticInstrumentedItem(u,"IMIO",i._tu
rnOnIndexingInstItem);n.InstrumentationHelper.instrumentItemClick(t,i._turnOnIndexi
ngInstItem,u,null,r,null);n.LocalDataProvider.launchIndexingOptions(!
1)},layout:1,isSelectable:!0});this._launchIndexingDataModel={messageText:t?
n.Host.getLocString("WindowsIndexingInProgressMessage"):n.Host.getLocString("Window
sIndexingDisabledMessage"),icon:t?
{content:"&#xE895",type:2}:null,messageClassName:"indexingMessage",title:t?
n.Host.getLocString("WindowsIndexingInProgressToolTip"):n.Host.getLocString("Window
sIndexingDisabledToolTip"),action:r};this._page.updateTemporaryMessageView(this._la
unchIndexingDataModel)},t.prototype.hideIndexingMessage=function()
{this._turnOnIndexingInstItem=null;this._page.updateTemporaryMessageView(null)},t.p
rototype.getAvailableSpace=function(t){var r=this,i;return
n.isL2(this._partialQuery)&&this._partialQuery.queryToFetch?Number.MAX_VALUE:
(i=this._page.getSuggestionsContainerHeight(),n.config.extraTopPadding&&!
n.RuntimeConfig.SearchBoxOnTop&&(i-
=n.config.extraTopPadding),n.RuntimeConfig.ScopesAvailable&&(i-
=yi),t.topResults.length==0||n.RuntimeConfig.FlatListWithoutGroups||(i-
=si),t.topResults.forEach(function(t){return i-
=gt(t,n.isL2(r._partialQuery))}),t.groups.forEach(function(n){return i-
=vr(r._partialQuery,n)}),t.groups.some(function(t){return
t.typeWithSource&&n.isTopHitChildGroup(t.typeWithSource)})&&t.groups.some(function(
t){return t.typeWithSource&&!n.isTopHitChildGroup(t.typeWithSource)})&&(i-
=vi),i)},t.prototype.getAvailableSpaceForZeroInputHomeTopSection=function(t,i){var
r=this._page.getSuggestionsContainerWidth(),u,f;return
n.shouldShowStaticSearchHome(this._partialQuery)||
n.shouldShowDSBLayout(this._partialQuery)?r:(r-=n.RuntimeConfig.AlwaysWide?wi:bi,r-
=p,u=t?t.suggestions.filter(function(n){return n&&!
n.suppressed}).length:0,u+=i.suppressed?0:1,f=n.RuntimeConfig.AlwaysWide?ki:di,r-
=(f+p)*u,n.config.useCobaltCSS&&(r+=2*p),r)},t.prototype.canFitSuggestion=function(
t,r,u)
{if(r.type==n.GroupType.SearchSuggestions&&(n.config.enableFullFitSearchTheWebMaxSu
ggestionsStandAlone||
u.suppressed&&n.config.enableSearchTheWebMaxSuggestions&&n.config.enableFullFitSear
chTheWebMaxSuggestions)&&this.getAvailableSpace(this._resultsCounter)>=0)return
u.suppressed&&(u.suppressed=!1),!0;if(u.suppressed||
n.getTweakedSetting("scrollBarInL1")||
u.handoffType===21&&n.config.msbVerticalChildSuggestionsNoTrim)return!0;var
o=dt(this._resultsCounter),f;return t?(f={typeWithSource:r,suggestions:
[]},o.groups.push(f)):f=i(o.groups,r),f.suggestions.push({mainTextWrapsToTwoLines:u
&&e(u,r.type,!
1),isSuppressed:u&&u.suppressed,hasTwoLines:u&&n.contains(u.classNames,"forceNoWrap
OutsideTopResult")}),this._partialQuery.isSearchHomeZI?
this.canFitSuggestionInZeroInputHome(r,u):this.getAvailableSpace(o)>=0},t.prototype
.canFitSuggestionInZeroInputHome=function(t,r){var u,e,f;return r.type==="SNSC"?!
0:typeof
n.enableQws=="function"&&n.enableQws()&&(t.type===n.GroupType.QuickWorkSearch||
t.type===n.GroupType.RecommendedDocs)?!0:
(u=i(this.groups,t),t.type==n.GroupType.MRUHistory)?!0:ii(t.type)?
this.getAvailableSpaceForZeroInputHomeTopSection(u,r)>=0:!
(n.shouldShowStaticSearchHome(this._partialQuery)||
n.shouldShowDSBLayout(this._partialQuery))&&this.isGroupTypeInRightCol(t.type)?
(e=n.config.maxSuggestionsInRightCol,f=0,n.config.useCobaltCSS||
(f=this.getCountOfSuggestionsToReduce()),(u?u.suggestions.length:0)>=e-f)?!1:!0:(u?
u.suggestions.length:0)<this.getMaxNumberOfRecentItems(t.type)},t.prototype.isGroup
TypeInRightCol=function(t){return t===n.GroupType.QuickSearch||
t===n.GroupType.AnaheimDataList},t.prototype.getCountOfSuggestionsToReduce=function
(){var t=0,i=SearchAppWrapper.CortanaApp.height;typeof
n.enableBrandingBar=="function"&&n.enableBrandingBar()&&n.isTwoPanesZIEnabled()&&(i
-=pi);var f=n.shouldShowStaticSearchHome(this._partialQuery)||
n.shouldShowDSBLayout(this._partialQuery),u=i-
w,r=n.canShowSearchHomeUpsell(this._partialQuery)&&f;return f?i<fr?t=r?7:4:i<ur?
t=r?6:3:i<rr?t=r?5:2:i<w?t=r?4:1:i>w&&r&&(u<o/3?t=4:u<o/2?t=3:u<o/1.5?
t=2:u<o&&(t=1)):i<ir?t=4:i<tr?t=3:i<nr?
t=2:i<gi&&(t=1),t},t.prototype.getMaxNumberOfRecentItems=function(t)
{if(t===n.GroupType.MSNNews)return 5;if(t==n.GroupType.MRUHistory||
t==n.GroupType.RecommendedDocs||t==n.GroupType.CuratedSuggestions){var
i=n.ScopeConfig[n.Scope.All].enabledDataSourcesForZeroInput,r=i.some(function(n)
{return
n&&n.suggestionGroupToggler&&n.suggestionGroupToggler.isHidden()});if(n.RuntimeConf
ig.PreviewPaneAvailable&&n.shouldEnableQuickSearches(n.Host.getLanguage().toLowerCa
se())&&!r)return n.isL2(this._partialQuery)?
10:this._partialQuery.isSearchHomeZI&&n.isMsbEnterprise()&&typeof
n.shouldHideTopApp=="function"&&n.shouldHideTopApp()&&n.isQwsSuccessRateThresholdMe
t()&&typeof n.isTenantMsbEnabled=="function"&&n.isTenantMsbEnabled()?
6:n.config.activityInZI-this.getCountOfSuggestionsToReduce()}return
n.config.activityInZI},t.prototype.getMaxNumberOfGroupsToFitMinSuggestionsPerGroup=
function(){var
i,r,u,t,f;if(n.isL2(this._partialQuery)&&this._partialQuery.queryToFetch||
n.getTweakedSetting("scrollBarInL1"))return
Number.MAX_VALUE;if(this._partialQuery.isSearchHomeZI)return typeof
n.enableQwsRecDocs=="function"&&n.enableQwsRecDocs()&&typeof
n.qwsShowTopList=="function"&&n.qwsShowTopList()&&n.isQwsSuccessRateThresholdMet()&
&n.isMsbEnterprise()?
5:4;for(i=dt(this._resultsCounter),r=0,u=i.groups;r<u.length;r+
+)for(t=u[r];t.suggestions.length<n.config.minSuggestionsPerGroup;)t.suggestions.pu
sh(t.suggestions[0]);while(this.getAvailableSpace(i)>0){for(t={suggestions:
[]},f=0;f<n.config.minSuggestionsPerGroup;+
+f)t.suggestions.push({mainTextWrapsToTwoLines:!1,isSuppressed:!1,hasTwoLines:!
1});i.groups.push(t)}return i.groups.length-
1},t.prototype.onSuggestionAddedToGroup=function(t,r){var
f=this,u,o;this.updateNarratorWithPreviewMessage(t);n.isChildSuggestion(t)&&(t.disp
layed=!
0,u=t.parent,t.id=u.id+"_"+u.childSuggestions.indexOf(t),n.isJumpListSuggestion(t)&
&t.tooltip===undefined&&n.Async.safeChain("getJumpListDescription",function()
{return t.jumpListItem.getDescriptionAsync()},function(i)
{t.tooltip=i;f.groups.some(function(i){return
n.contains(i.suggestions,t)})&&f.renderGroups()}));this.setRemoveIcon(t);o=i(this._
resultsCounter.groups,r.typeWithSource);o.suggestions.push({mainTextWrapsToTwoLines
:e(t,r.typeWithSource.type,!
1),isSuppressed:t.suppressed,hasTwoLines:n.contains(t.classNames,"forceNoWrapOutsid
eTopResult")});n.displayedInGridLayout(r.typeWithSource.type)&&r.suggestions.filter
(function(n){return!
n.suppressed}).length>0&&(r.cssClasses+=n.isL2(this._partialQuery)?" gridLayout":"
gridLayout gridLayoutMedium")},t.prototype.onGroupsCleared=function()
{this._pendingSuggestionsInExistingGroups=[];this._pendingSuggestionsInMissingGroup
s=[];this._resultsCounter.groups=[];this._turnOnIndexingInstItem&&n.Instrumentation
Helper.instrumentSyntheticInstrumentedItem(this._lastUpdatedSequenceNumber,"IMIO",t
his._turnOnIndexingInstItem)},t.prototype.dismissTour=function(t){var
i={query:t.queryToFetch};this._lightweightStorage.setItem("wweTourTook","1");this._
lightweightStorage.setItem("wweTourRefreshed","1");this._lightweightStorage.removeI
tem("wweTourEnabled");_ge("root").classList.remove("overlayEnabled");n.setZeroInput
DataSourcesForL1();n.Host.refreshCurrentPane();this._lightweightStorage.removeItem(
"wweTourRefreshed");n.InstrumentationHelper.logClientInstEvent("Select","WWETourDis
miss",null,i)},t.prototype.launchSearch=function(t,i){var
r=t.queryToFetch;n.Host.launchSearch(r,this._navigationHelper.getSearchUrl(t.fullPa
rtialQuery,r,i),!1)},t.prototype.setRemoveIcon=function(t){var
r=this,u=t.getExtraVerbs&&t.getExtraVerbs(!1).some(function(n){return
n.verb=="RemoveFromDeviceHistory"}),e=t.type=="HS"&&n.config.removeSuggUrl,o=n.Test
HookUrlParameters===null||n.TestHookUrlParameters===void 0?void
0:n.TestHookUrlParameters.forceRemoveIcon,f=t.getExtraVerbs&&t.getExtraVerbs(!
1).some(function(n){return n.verb=="RemoveFromDeviceHistoryAll"}),i;(o||u||e||
f)&&(i=f?"RemoveFromDeviceHistoryAll":u?"RemoveFromDeviceHistory":"RemoveFromWebHis
tory",t.removeIcon={icon:
{content:"&#xE711",type:2},title:n.Host.getLocString(i),click:function(u,f)
{r._page.hideTemporaryMessage();n.InstrumentationHelper.instrumentItemClickForConte
xtMenu(u,t.instItem,t.sequenceNumber,t.instrumentPingBack,f,null,i);r.launchVerb(t,
i,u);n.Host.setFocusInSearchBox(null,"remove")}})},t.prototype.updateNarratorWithPr
eviewMessage=function(t){var
r=n.RuntimeConfig.AlwaysWide?"PreviewPaneButtonNarratorMessageWidePane":"PreviewPan
eButtonNarratorMessage",i=n.Host.getLocString(r);t.narratorText&&t.previewPaneType&
&t.narratorText.indexOf(i)==-1&&(t.narratorText+=",
"+i)},t.prototype.handleWorkScopeRequeryTophit=function(n,t){var
i=t.findIndex(function(t){return t.msbVerticalHash===n.msbVerticalHash});i>-
1&&(t[i].selected=!
0,this._selectedItem=n);this._previewPane.onQueryChanged(this._partialQuery,n)},t.p
rototype.onBeforeRenderTopResults=function(t,i,r,u,f){var
s=this,l,c,a,e,o,y,p,v,h,w;return this.topResults.forEach(function(n)
{s.setRemoveIcon(n);s.updateNarratorWithPreviewMessage(n)}),l=1,this.topResults.len
gth!=1||this.topResults[0].hasChildSuggestionsDisplayed||r.some(function(t){return
n.isChildSuggestion(t)})&&(this.topResults[0].hasChildSuggestionsDisplayed=!
0,l=0),c=!
1,a=this.getSelectableItems(),n.RuntimeConfig.FirstSuggestionSelectedByDefault?(!
this._selectedItem||!n.contains(a,this._selectedItem)||
this.isScopeElement(this._selectedItem)||
this._selectedItem==i[0]&&this.topResults[0]!=i[0]||this._selectedItem!=a[0]||
this._selectedItem.previewPaneNeedsRefreshAfterDeduping)&&(e=this._partialQuery.que
ryToFetch&&this.topResults.length>0?
this.topResults[0]:null,o=this._selectedItem&&this.isSuggestion(this._selectedItem)
?
this._selectedItem:null,n.config.synthWebNoBestMatch&&n.isNullOrUndefined(e)&&(y=[n
.GroupType.SearchSuggestions,n.GroupType.Websites],p=r.filter(function(t){return!
n.contains(y,n.getGroupType(t))}),p.length==0&&(e=r.length>0?
r[0]:null)),this._previewPane&&n.RuntimeConfig.PreviewPaneAvailable&&(this._partial
Query.queryToFetc
h&&this._partialQuery.scope===n.Scope.Work&&o&&typeof
n.isMsbWorkScope=="function"&&n.isMsbWorkScope(o.handoffType)&&this._previewPane.ge
tPreviewedSuggestion()&&o.reactKey!=undefined?
(e=o,this.handleWorkScopeRequeryTophit(e,r),c=!0):(c=!1,n.safeExecute(function()
{return s._previewPane.onTopHitUpdated(s._partialQuery,o,e,s.getSuggestions(!
1))},"ppOnTopHitUpdated"))),this.select(e,!
1),this._page.scrollToTop()):t&&this.select(null,!
1),v=this.topResults.length>0,h=function(t){return!t.suppressed&&t.staticGroupType!
=n.GroupType.VisualSearch},this._headerFooterViewModel&&!c&&(w=v||r.some(h)||
this.groups.some(function(n){return n.suggestions.some(h)})||
this._pendingSuggestionsInMissingGroups.some(function(n){return
n.suggestions.some(h)})||this._pendingSuggestionsInExistingGroups.some(function(n)
{return
n.suggestions.some(h)}),this._headerFooterViewModel.render(this._partialQuery,v,w,u
,f)),l},t.prototype.isRankable=function(t){return
n.config.enableAnaheimRelevance==2?t.typeWithSource.type!
=n.GroupType.Websites&&t.typeWithSource.type!=n.GroupType.LocalPlaces&&!
t.suggestions.some(n.enforceOriginalOrder):t.typeWithSource.type!
=n.GroupType.SearchSuggestions&&t.typeWithSource.type!
=n.GroupType.Websites&&t.typeWithSource.type!=n.GroupType.LocalPlaces&&!
t.suggestions.some(n.enforceOriginalOrder)},t.prototype.isNotRankableWithRecourse=f
unction(t){return
t.typeWithSource.type==n.GroupType.Emails},t.prototype.openPreviewPane=function(t,i
)
{i.stopPropagation();this._previewPane.showPreview(this._partialQuery,t);this.selec
t(t,!
0);n.config.reactGroups&&this.selectGroupItem(t);n.Host.setFocusInSearchBox(null,"o
penPreviewPane")},t.prototype.mayNeedFlush=function(){return!
n.RuntimeConfig.FlatListWithoutGroups},t.prototype.update=function(t,i,r,u,f,o,s,h,
c,l){var
a=this,g=this.topResults,p,nt,tt,w,rt,v,st,d,lt,et;if(t&&(this._contentQuery=this._
partialQuery,this._renderTopResultsTimerForIcons=null,this._renderGroupsTimerForIco
ns=null),n.config.enableMRUHint)for(p=0,nt=i;p<nt.length;p+
+)tt=nt[p],tt.mruHintEnabled&&(tt.uxHint=n.Host.getLocString("MruBestMatch"));var
ot=this.updateTopResults(t,i,r,u,f,c),it=ot[0],at=ot[1];for(at(),this._resultsCount
er.topResults=[],w=0,rt=this.topResults;w<rt.length;w+
+)v=rt[w],v.previewPaneNeedsRefreshAfterDeduping=!1,st=1+(v.primaryMetadata?1:0)+
(v.secondaryMetadata?
1:0),this._resultsCounter.topResults.push({mainTextWrapsToTwoLines:e(v,null,!
0),numberOfLines:st,isHtmlAnswer:!!v.htmlContent,isSuppressed:!
1,grid:n.displayedInGridLayout(v.type)});if(this._autoComplete&&this.topResults.len
gth>0&&this._selectedItem==this.topResults[0]&&this._autoComplete.apply(this.topRes
ults[0]),this.handlePendingSubmit(f)==0)return this.toggleProgressBar(!
0),0;this._partialQuery&&this._partialQuery.isSearchHomeZI&&this.toggleProgressBar(
!c);var ut=!1,b=0,vt=this.createIconRenderInfo(),ht=function(){var
t,i;ut&&(t=a.groups.map(function(n){return
n.typeWithSource.type}),a._contentQuery.queryToFetch||b!=0||(i=a._cvidAtLastRender!
=n.Host.getConversationId(),a._cvidAtLastRender=n.Host.getConversationId(),n.Instru
mentationHelper.instrumentZiRendered(u,i)),n.InstrumentationHelper.instrumentRender
Finished(u,s,t,b!=0,!a._contentQuery.queryToFetch))},ft=function(n,t){var r=!
1,i;if(a.isRankable(t)&&a._partialQuery&&a._partialQuery.queryToFetch)for(i=0;i<t.s
uggestions.length;i++)if(n.rankingScore>t.suggestions[i].rankingScore)
{t.suggestions.splice(i,0,n);r=!0;break}r||t.suggestions.push(n);+
+b;a.setupIcon(u,n,vt,function(){--
b;ht()});a.onSuggestionAddedToGroup(n,t)},y=this.getMaxNumberOfGroupsToFitMinSugges
tionsPerGroup()-this.groups.length,k=!1,ct=function(){var i,f,t,e;if(y!=0&&r||
a.flush(ft,u,h),a.groups.sort(function(t,i){return h.findIndex(function(i){return
n.sameGroup(i,t.typeWithSource)})-h.findIndex(function(t){return
n.sameGroup(t,i.typeWithSource)})}),a._partialQuery&&a._partialQuery.queryToFetch)f
or(i=0,f=a.groups;i<f.length;i++)t=f[i],a.isRankable(t)?
t.suggestions.sort(function(n,t){return t.rankingScore-
n.rankingScore}):a.isNotRankableWithRecourse(t)&&(e=t.suggestions.map(function(n)
{return n.notAResult}).findIndex(function(n){return n}),e!=-
1&&t.suggestions.splice(t.suggestions.length-1,0,t.suggestions.splice(e,1)
[0])),a.populateGroupHeaderFlags(t)};return t||f.length>0||o.length>0?
(this.renderGroupsAfter(function(){for(var
ut,s,c,k,d,v,nt,p,tt,i,w,rt,e=0,b=o;e<b.length;e+
+)i=b[e],ut=a.removeSuggestion(i,l),ut&&(y+=1);for(s=function(t,i){var
e=a.getGroupData(t),f=e[0],r=e[1],o;(n.cohortProfileManager===null||
n.cohortProfileManager===void 0?void
0:n.cohortProfileManager.isTourVisible())&&(t.click=undefined,t.tooltip=undefined);
r?(r.count&&r.count++,o=n.config.minSuggestionsPerGroup&&!i?
n.config.minSuggestionsPerGroup-r.suggestions.length:999,o>0&&a.canFitSuggestion(!
1,f,t)?ft(t,r):a._partialQuery.isSearchHomeZI||
a.queueSuggestionInExistingGroup(t,r)):y>0&&a.canFitSuggestion(!0,f,t)?
(r=a.addGroup(f,t,u,h,l),a.shouldTrackGroupCount(r)&&(r.count=1),ft(t,r),y-
=1):a._partialQuery.isSearchHomeZI||
a.queueSuggestionInMissingGroup(t,f,l)},c=0,k=g;c<k.length;c++){var
et=k[c],ot=a.getGroupData(et),r=ot[1];r&&r.count&&(r.count-=1)}if(d=function()
{return a._contentQuery.isSearchHomeZI||n.getTweakedSetting("scrollBarInL1")},it&&!
t){for(v=0,nt=f;v<nt.length;v++)i=nt[v],n.contains(g,i)&&s(i,!
0);for(p=0,tt=f;p<tt.length;p++)i=tt[p],n.contains(g,i)||s(i,d())}else
f.forEach(function(n){return s(n,d())});for(w=0,rt=a.topResults;w<rt.length;w++)
{var et=rt[w],st=a.getGroupData(et),r=st[1];r&&r.count&&(r.count+=1)}ct()}),k=!
0,ut=!0):y!=0&&r||(this._pendingSuggestionsInMissingGroups.some(function(n){return
n.suggestions.length>0})||this._pendingSuggestionsInExistingGroups.some(function(n)
{return n.suggestions.length>0}))&&(this.renderGroupsAfter(function(){return
ct()}),k=!0,ut=!0),(it||k)&&(d=void 0,it?k||(d=!0):d=!1,this.resetIconTimers(d,!
0)),lt=this.groups.findIndex(function(t){return
t.type==n.GroupType.MRUHistory}),lt>-1&&(et=this.groups.findIndex(function(t)
{return t.type==n.GroupType.CuratedSuggestions}),et>-
1&&this.groups.splice(et,1)),ht(),c&&this.toggleProgressBar(!
1),n.config.mruSearchHome&&this._partialQuery.isSearchHomeZI&&this._partialQuery.sc
ope==n.Scope.All&&this.sortMRUList(),1},t.prototype.sortMRUList=function(){var
r=this.groups.filter(function(t){return
t.type==n.GroupType.MRUHistory}),u=this.groups.filter(function(t){return t.type!
=n.GroupType.MRUHistory}),f=this.getMaxNumberOfRecentItems(n.GroupType.MRUHistory),
t,i;r.length>0?
(this._lightweightStorage.removeItem(wt),t=r[0],t.suggestions.sort(function(n,t)
{return t.lastLaunchTime-
n.lastLaunchTime}),t.suggestions.length>f&&(t.suggestions=t.suggestions.splice(0,f)
),i=-1,this.groups.forEach(function(t,r){i=t.type==n.GroupType.MRUHistory?
r:i}),u.splice(i,0,t),this.groups=u,this.renderGroups()):this._lightweightStorage.s
etItem(wt,"1")},t.prototype.canGoToL2=function(n){return n.click&&!
n.instItem},t.prototype.populateGroupHeaderFlags=function(n){if(this.canGoToL2(n))
{var t=n.suggestions.every(function(n){return
n.suppressed});n.showCountInHeader=t}},t.prototype.shouldTrackGroupCount=function(n
){return this.canGoToL2(n)},t.prototype.getGroupData=function(t){var
r={type:n.getGroupType(t),source:t.sourceForGroup};return
n.enableMRUSearchHome()&&r.type==n.GroupType.MRUHistory&&(r.source=undefined),
[r,i(this.groups,r)]},t.prototype.removePendingSuggestionFromExistingGroup=function
(n,t){for(var r,u,i=0;i<this._pendingSuggestionsInExistingGroups.length;+
+i)if(r=this._pendingSuggestionsInExistingGroups[i],r.group==t)if(u=r.suggestions.i
ndexOf(n),u==-1)throw new Error("Pending suggestion not found in existing
group");else{r.suggestions.splice(u,1);r.suggestions.length==0&&this._pendingSugges
tionsInExistingGroups.splice(i,1);return}throw new Error("Pending suggestion not
found: pending suggestions in existing groups is
empty");},t.prototype.removePendingSuggestionFromMissingGroup=function(t,i){for(var
u,f,r=0;r<this._pendingSuggestionsInMissingGroups.length;+
+r)if(u=this._pendingSuggestionsInMissingGroups[r],n.sameGroup(u.typeWithSource,i))
if(f=u.suggestions.indexOf(t),f==-1)throw new Error("Pending suggestion not found
in missing
group");else{u.suggestions.splice(f,1);u.suggestions.length==0&&this._pendingSugges
tionsInMissingGroups.splice(r,1);return}throw new Error("Pending suggestion not
found: pending suggestions in missing groups is
empty");},t.prototype.queueSuggestionInExistingGroup=function(n,t){var
i=ni(this._pendingSuggestionsInExistingGroups,t.typeWithSource);i?
i.suggestions.push(n):(i={group:t,suggestions:
[n]},this._pendingSuggestionsInExistingGroups.push(i))},t.prototype.queueSuggestion
InMissingGroup=function(n,t,r){var
u=i(this._pendingSuggestionsInMissingGroups,t);u?u.suggestions.push(n):
(u={typeWithSource:t,suggestions:
[n],extraSignalsMap:r},this._pendingSuggestionsInMissingGroups.push(u))},t.prototyp
e.partialFlush=function(n,t,i,r){while(n>0&&i.length>0){var
u=i[0];this.canFitSuggestion(!1,t.typeWithSource,u)&&r(u,t);i.splice(0,1);n-
=1}},t.prototype.flush=function(t,i,r){for(var e,s,u,c,l=this,a=function(u){var
o=u.suggestions[0],e;o&&f.canFitSuggestion(!
0,u.typeWithSource,o)&&(e=f.addGroup(u.typeWithSource,o,i,r,u.extraSignalsMap),f.sh
ouldTrackGroupCount(e)&&(e.count=u.suggestions.length),f.partialFlush(n.config.minS
uggestionsPerGroup,e,u.suggestions,t),u.suggestions.forEach(function(n){return
l.queueSuggestionInExistingGroup(n,e)}),u.suggestions=[])},f=this,o=0,h=this._pendi
ngSuggestionsInMissingGroups;o<h.length;o+
+)u=h[o],a(u);while(this._pendingSuggestionsInExistingGroups.some(function(n)
{return
n.suggestions.length>0}))for(e=0,s=this._pendingSuggestionsInExistingGroups;e<s.len
gth;e++)u=s[e],c=n.config.minSuggestionsPerGroup?
1:u.suggestions.length,this.partialFlush(c,u.group,u.suggestions,t)},t.prototype.re
moveSuggestion=function(t,r){var
s={type:n.getGroupType(t),source:t.sourceForGroup},u=i(this.groups,s),f,h,o;if(u)if
(n.tryRemove(u.suggestions,t))
{if(f=i(this._resultsCounter.groups,u.typeWithSource),h=e(t,u.typeWithSource.type,!
1),n.removeFirstWhere(f.suggest
ions,function(n){return
n.mainTextWrapsToTwoLines==h}),n.displayedInGridLayout(u.typeWithSource.type)&&u.su
ggestions.filter(function(n){return!
n.suppressed}).length==0&&(u.cssClasses=""),u.suggestions.length==0)return
n.tryRemove(this.groups,u),this._resultsCounter.groups=this._resultsCounter.groups.
filter(function(n){return n!
=f}),o=ni(this._pendingSuggestionsInExistingGroups,u.typeWithSource),o&&this._pendi
ngSuggestionsInMissingGroups.push({typeWithSource:u.typeWithSource,suggestions:o.su
ggestions,extraSignalsMap:r}),!0}else
this.removePendingSuggestionFromExistingGroup(t,u);else
this.removePendingSuggestionFromMissingGroup(t,s);return!
1},t.prototype.isScopeElement=function(n){return
this._headerFooterViewModel&&this._headerFooterViewModel.isScopeElement(n)},t.proto
type.createIconRenderInfo=function(n){var
t={iconsPendingReturn:0,isTopResult:n};return
this._iconRenderInfos.push(t),t},t.prototype.getCurrentTopResults=function(){return
this.topResults.slice(0)},t.prototype.getTopResultsWhichFitInCanvas=function(n)
{return n},t.prototype.resetAriaSelected=function(n)
{n&&this._page.render(function(){var t=_ge(n.id);t&&(t.setAttribute("aria-
selected","false"),t.setAttribute("aria-
selected","true"))})},t.prototype.updateTopResults=function(t,i,r,u,f,e){var
h=this,a,o,s,y;t!=(u!
=this._lastUpdatedSequenceNumber)&&SharedLogHelper.LogError("updateTopResult",t+" !
= (sequenceNumber "+u+" != lastUpdateSequenceNumber
"+this._lastUpdatedSequenceNumber+")",new Error("Precondition
failed"));this._lastUpdatedSequenceNumber=u;t&&(this.groups=[],this.onGroupsCleared
());a=this._selectedItem;o=this.topResults;i=this.getTopResultsWhichFitInCanvas(i);
i.forEach(function(t){n.RuntimeConfig.QfMode==5||n.RuntimeConfig.QfMode==9||
t.staticGroupType&&t.staticGroupType==n.GroupType.Upsell||!t.secondaryMetadata||
t.secondaryMetadata.indexOf(n.Host.getLocString("LastModified")+": ")!==0||
(t.template=1,t.narratorText=n.getNarratorText(t))});s=!n.sequenceEqual(i,o)||
o.some(function(n){return
n.needsRefreshAfterDeduping});s&&(this.topResults=i.slice(0));var c=!1,l=s?
i.length:0,p=this.createIconRenderInfo(!0),v=function()
{c&&(n.config.enableLocalInstrumentation&&n.InstrumentationHelper.instrumentRendere
dLocalSuggestion(u,i),n.InstrumentationHelper.instrumentTopResultRendered(u,i.map(f
unction(n){return n.type}),l!=0))};return s?(this.renderTopResultsAfter(function()
{for(var s,i=0,c=h.topResults;i<c.length;i++)s=c[i],s.needsRefreshAfterDeduping=!
1,n.contains(o,s)?l-=1:h.setupIcon(u,s,p,function(){l-
=1;v()});h.onBeforeRenderTopResults(t,o,f,r,e)}),c=!0):
(y=this.onBeforeRenderTopResults(t,o,f,r,e),y==0&&(this.renderTopResults(),c=!
0)),this._selectedItem&&(a!=this._selectedItem||
t)&&n.contains(this.topResults,this._selectedItem)&&this.resetAriaSelected(this._se
lectedItem),[s,v]},t.prototype.renderGroupsAfter=function(n){var
t=this._groupRenderingDisabled;this._groupRenderingDisabled=!
0;try{n()}finally{this._groupRenderingDisabled=t;this.renderGroups()}},t.prototype.
renderTopResults=function(t){this._topResultsRenderingDisabled||
(this._page.updateTopResultsView({query:this._contentQuery,topResults:this.topResul
ts,groups:this.groups},t),n.InstrumentationHelper.updateSuggestionsList(this.topRes
ults,this.groups))},t.prototype.renderTopResultsAfter=function(n){var
u=this._topResultsRenderingDisabled,t,i,r;this._topResultsRenderingDisabled=!
0;try{n()}finally{for(this._topResultsRenderingDisabled=u,this.renderTopResults(),t
=0,i=this.topResults;t<i.length;t++)r=i[t],r.executeScript&&r.executeScript()}},t}
();n.RootViewModel=fi})(WSB||(WSB={}))

You might also like