You are on page 1of 53

var __extends=this&&this.

__extends||function(){var n=function(t,i){return
n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t)
{n.__proto__=t}||function(n,t){for(var i in
t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r()
{this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):
(r.prototype=i.prototype,new r)}}(),AutoSuggest;(function(n){function
f(t,r,u,f,e,o,s,h){i(t,r,u,function(t){return f(t.status==200&&t.responseText?
n.safeExecute(function(){return
JSON.parse(t.responseText)},"JSON.parse"):null)},e,o,s,h)}function
i(i,r,u,f,e,o,s,h,c){var l=c&&_w.XMLHttpRequest?new
XMLHttpRequest:sj_gx(),v,a;try{l.open(u?"POST":"GET",i,!0)}catch(y)
{SharedLogHelper.LogError("fetchUrl",i,y);f&&f({responseText:"",contentType:"",stat
us:-1,result:3});return}if(r)for(v in
r)l.setRequestHeader(v,r[v]);e&&(a=e.register(function(){return l.abort()},!1,"xhr
abort"));n.config.useEventListeners?(l.addEventListener("load",function()
{t(l,0,f,a,e,o)}),l.addEventListener("timeout",function()
{t(l,1,f,a,e,o)}),l.addEventListener("abort",function()
{t(l,2,f,a,e,o)}),l.addEventListener("error",function(){t(l,3,f,a,e,o)})):
(l.onreadystatechange=function()
{l.readyState==4&&l.status>0&&t(l,0,f,a,e,o)},l.ontimeout=function(){return
t(l,1,f,a,e,o)},l.onabort=function(){return t(l,2,f,a,e,o)},l.onerror=function()
{return t(l,3,f,a,e,o)});typeof s!="undefined"?
l.withCredentials=s:l.withCredentials!==undefined&&(l.withCredentials=!
0);h&&h>0&&(l.timeout=h);l.send(u)}function t(n,t,i,r,u,f){(!f||
f())&&(n.readyState==4&&(n.onreadystatechange=function()
{}),r&&u.unregister(r),i&&i({responseText:n.responseText,contentType:n.getResponseH
eader("content-type")||"",status:n.status,result:t}))}function e(n){var
t=n.IconContent;return t?t[0]=="S"?{content:t.slice(1),type:1}:
{content:t,type:2}:n.Icon?{content:n.Icon,type:0}:null}var
r,u;n.fetchUrlJson=f;n.fetchUrl=i;r=function(){function t(t)
{this._dataSource=t;this._delay=n.config.webDataSourcesWithThrottling[t]||
0;this._timers=[]}return t.prototype.getBaseUrl=function(){throw new Error("Not
Implemented");},t.prototype.getPostBody=function(){return
undefined},t.prototype.onBeforeFetchUrl=function()
{},t.prototype.createUrl=function(t){return decodeURIComponent(this.getBaseUrl())+
(t?
n.encodeQueryParameter(t.queryToFetch.toLowerCase()):"")},t.prototype.addParamsToUr
l=function(n,t){var i=t?Object.keys(t):[];return
i.length>0&&(n+=n.includes("?")?"&":"?",n+=i.map(function(n){return
n+"="+t[n]}).join("&")),n},t.prototype.fetch=function(t,i,r,u,f,e,o,s,h,c){var
p=this,l,v,a,y,w;if(n.isDataSourceEnabled(this._dataSource,t)&&(this._dataSource!
=n.WebDataSource||n.isBingEnabled(!0)))
{if(l=this.addParamsToUrl(this.createUrl(t),e),v=this.getPostBody(t)||"",this._last
SequenceNumber!=r){for(a=0,y=this._timers;a<y.length;a+
+)w=y[a],sb_ct(w);this._timers=[];this._lastSequenceNumber=r}if(this._delay>0&&!
t.isFormulatedQuery)this._timers.push(n.safeSetTimeout(function()
{p.onBeforeFetchUrl(r,l);p.fetchUrl(l,o,v,i,u,f,s,h,c)},this._delay,"fetchDelay"));
else{this.onBeforeFetchUrl(r,l);this.fetchUrl(l,o,v,i,u,f,s,h,c)}}},t.prototype.fet
chUrl=function(t,r,u,f,e,o,s,h,c){var l=this;i(t,r,u,function(i){var
r=i.responseText,o=i.contentType,u=i.status,e;u==200&&(n.config.th&&r&&(r=r.replace
(new RegExp("<!--[^]*?--
>","gm"),"")),r&&o.includes("json")&&(e=n.safeExecute(function(){return
JSON.parse(r)},"parseWebProviderResponse",null,t)));f(l._dataSource,e,u==200?
null:u.toString())},this._delay>0?e:null,o,h,s,c)},t}
();n.JsonDataProvider=r;u=function(t){function i(i,r,u){var
f=t.call(this,n.WebDataSource)||this;return
f._instrumentationHelper=i,f._responseCacheManager=r,f._headRankingSignalsManager=u
,f}return __extends(i,t),i.prototype.getName=function()
{return"AsSuggestionsDataProvider"},i.prototype.getBaseUrl=function(){return
n.config.u},i.prototype.onBeforeFetchUrl=function(n,t)
{this._instrumentationHelper.instrumentSnRProviderFetchUrl(n,t)},i.prototype.fetch=
function(i,r,u,f,e,o,s){var
a=this,c,l,h;if(n.isDataSourceEnabled(this._dataSource,i))
{if(this._headRankingSignalsManager&&(c=this._headRankingSignalsManager.get(i),c))
{l=this.addParamsToUrl(this.createUrl(i),o);this.onBeforeFetchUrl(u,l);r(this._data
Source,c,null,2);return}h=r;h=function(t,u,f,e)
{u&&n.isEmptyUrlPrefix(i)&&(u.Suggestions=[]);a.processResourceResponse(u);r(t,u,f,
e)};this._responseCacheManager?
this.fetchWithCache(i,h,u,f,e,o,s):t.prototype.fetch.call(this,i,h,u,f,e,o,s)}},i.p
rototype.fetchWithCache=function(n,i,r,u,f,e,o){var
h=this,c=this._responseCacheManager.get(n),l,a,s;if(c)
{l=this.addParamsToUrl(this.createUrl(n),e);this.onBeforeFetchUrl(r,l);i(this._data
Source,c,null,1)}else a=function(){return!0},s=i,s=function(t,r,u)
{f()&&i(t,r,u,0);n.queryToFetch&&h.responseIsValidForCaching(u,r)&&(r.ELToken&&(r=O
bject.assign({},r),delete
r.ELToken),h._responseCacheManager.put(n,r))},t.prototype.fetch.call(this,n,s,r,u,a
,e,o)},i.prototype.responseIsValidForCaching=function(n,t){var i="HS";return!
n&&t&&t.Suggestions.every(function(n){return!n.InstantAnswer&&n.Attributes.stype!
=i})},i.prototype.processResourceResponse=function(n){var
t,i;n&&(t=n.Resources,t)&&(this._downloadedStylesResources?
this.updateWithDownloadedResources(t):this._downloadedStylesResources=t.Styles,i={S
tyles:t.Styles,Scripts:null},JsonInject.WriteHeadAndBeforeContentResources(i))},i.p
rototype.updateWithDownloadedResources=function(n){var t,i;for(t in n.Styles)for(i
in n.Styles[t])this._downloadedStylesResources[t][i]?delete n.Styles[t]
[i]:this._downloadedStylesResources[t][i]=n.Styles[t][i]},i}
(r);n.AsSuggestionsDataProvider=u;n.getIconFromOnlineResponse=e})(AutoSuggest||
(AutoSuggest={})),function(n){var t;(function(t){function f(n,t,i,r,f){typeof
indexedDB!="undefined"&&new u(n,f,t,i,r)}function e(n,t,i,r,f){typeof indexedDB!
="undefined"&&new u(n,f,t,i,r)}function o(n,t,i,r,f,e){typeof indexedDB!
="undefined"&&new u(n,e,t,i,r,f)}function s(n,t,i,r,f,e){typeof indexedDB!
="undefined"&&new u(n,e,t,i,r,f)}function h(n,t,u){i(n,"deleteDatabase
requested");try{var f=indexedDB.deleteDatabase(n);f.onsuccess=function()
{i(n,"deleteDatabase
completed");t&&t()};f.onerror=r("deleteDatabase.onError",function(t)
{SharedLogHelper.LogError("deleteDB",n,t);u&&u(t)})}catch(e){u&&u(e)}}function
r(n,t){return function(i){var r=n;try{r+=" "+i.target.error.name}catch(u){}t(new
Error(r))}}var
i,u;t.instanceWithNumberKeys=f;t.instanceWithStringKeys=e;t.instanceWithNumberKeysA
ndSecondaryKey=o;t.instanceWithStringKeysAndSecondaryKey=s;i=n.config.th&&ClientTes
tHooks.isTesthookParamSet("dbTrace")?function(t,i){return n.log("["+t+"]
"+i)}:function(){};t.deleteDatabase=h;t.handleErrorEvent=r;u=function(){function
t(n,u,f,e,o,s){var
h=this,c;this._databaseName=n;this.onClosed=o;this._secondaryIndex=s;this._closePen
ding=!1;this._storeName=n+"Store";i(this._databaseName,"open
requested");try{c=indexedDB.open(n,u||1)}catch(l){e(new
Error("IndexedDbClientSideStorage.const: Could not open
database"));return}c.onsuccess=function(n)
{h._database=n.target.result;t._allInstances.push(h);i(h._databaseName,"open
completed");f(h)};c.onupgradeneeded=function(n){var
t,r;i(h._databaseName,"upgrading");t=n.target.result;t.objectStoreNames.contains(h.
_storeName)&&t.deleteObjectStore(h._storeName);r=t.createObjectStore(h._storeName);
h._secondaryIndex&&r.createIndex(h._secondaryIndex,h._secondaryIndex,{unique:!
1})};c.onerror=r("open.onError",e);c.onblocked=r("open.onBlocked",e)}return
t.prototype.put=function(n,t,i,r)
{this.safeDbOperation("put",n.toString(),"readwrite",i,function(i,r,u){var
f=i.put(t,n);f.onsuccess=r;f.onerror=u},r)},t.prototype.putMultiple=function(n,t,i)
{this.safeDbOperation("putMultiple",n.length.toString(),"readwrite",t,function(t,i,
r){var u=0,f=function(){if(u<n.length){var
e=t.put(n[u].value,n[u].key);u+=1;e.onsuccess=u==n.length?
i:f;e.onerror=r}};f()},i)},t.prototype.getValue=function(n,t,i)
{this.safeDbOperation("getValue",n.toString(),"readonly",function(n){return
t(n.target.result)},function(t,i,r){var
u=t.get(n);u.onsuccess=i;u.onerror=r},i)},t.prototype.getRange=function(n,t,i,r)
{var u=this;this.safeDbOperation("getRange","["+n+",
"+t+")","readonly",i,function(i,r,f){var e=IDBKeyRange.bound(n,t,!1,!
0);u.queryFromCursor(i.openCursor(e),r,f)},r)},t.prototype.getRangeOnSecondaryKey=f
unction(n,t,i,r){var u=this;this._secondaryIndex?
this.safeDbOperation("getRangeOnSecondaryKey","["+n+",
"+t+")","readonly",i,function(i,r,f){var
e=i.index(u._secondaryIndex),o=IDBKeyRange.bound(n,t,!1,!
0);u.queryFromCursor(e.openCursor(o),r,f)},r):r(new Error("getRangeOnSecondaryKey:
Index name is missing"))},t.prototype.removeRange=function(n,t,i,r){var
u=this;this.safeDbOperation("removeRange","["+n+","+t+"]","readwrite",i,function(i,
r,f){var e=IDBKeyRange.bound(n,t,!1,!
0);u.removeFromCursor(i.openCursor(e),r,f)},r)},t.prototype.removeRangeOnSecondaryK
ey=function(n,t,i,r){var u=this;this._secondaryIndex?
this.safeDbOperation("removeRangeOnSecondaryKey","["+n+","+t+"]","readwrite",i,func
tion(i,r,f){var e=i.index(u._secondaryIndex),o=IDBKeyRange.bound(n,t,!1,!
0);u.removeFromCursor(e.openCursor(o),r,f)},r):r(new
Error("removeRangeOnSecondaryKey: Index name is
missing"))},t.prototype.getAll=function(n,t){var
i=this;this.safeDbOperation("getAll",null,"readonly",n,function(n,t,r){return
i.queryFromCursor(n.openCursor(),t,r)},t)},t.prototype.close=function()
{i(this._databaseName,"close
requested");this.innerClose()},t.prototype.innerClose=function(){var
f,e,r,u,o;if(t._requestsInProgress>0)i(this._databaseName,"delaying close because
of "+t._requestsInProgress+" requests in progress"),this._closePending=!0;else
for(f=function(t){t._database&&(n.safeExecute(function(){return
t._database.close()},e._databaseName+".close"),i(t._databaseName,"close
completed"),t._database=null,t.onClosed())},e=this,r=0,u=t._allInstances;r<u.length
;r++)o=u[r],f(o)},t.prototype.queryFromCursor=function(t,i,r){var
u=[];t.onsuccess=function(t){var
r=t.target.result;r&&u.push({key:r.primaryKey,value:r.value});r&&u.length!
=n.config.maxIndexedDBCursorIterations?r["continue"]
():i(u)};t.onerror=r},t.prototype.removeFromCursor=function(t,i,r){var
u=0;t.onsuccess=function(t){var r=t.target.result;r&&(r["delete"](),u+=1);r&&u!
=n.config.maxIndexedDBCursorIterations?r["continue"]
():i(null)};t.onerror=r},t.prototype.safeDbOperation=function(n,u,f,e,o,s){var
h=this,l,c,a;i(this._databaseName,n+" requested"+(u?"
"+u:""));t._requestsInProgress+=1;l=function(r){i(h._databaseName,n+" completed "+
(u?u+" ":""));t._requestsInProgress-
=1;e(r);h._closePending&&t._requestsInProgress==0&&h.innerClose()};c=function(n)
{t._requestsInProgress-
=1;s(n);h._closePending&&t._requestsInProgress==0&&h.innerClose()};try{this._databa
se?
(a=this._database.transaction(this._storeName,f).objectStore(this._storeName),o(a,l
,r(n+".onError",c))):c(new Error(n+" Database not initialized"))}catch(v)
{c(v)}},t._requestsInProgress=0,t._allInstances=[],t}()})(t=n.ClientSideStorage||
(n.ClientSideStorage={}))}(AutoSuggest||(AutoSuggest={})),function(n){var t;
(function(t){var i=function(){function t(n,t,i,r,u,f){var
e=this;this._storageFactory=n;this.createResponse=t;this.dataPopulated=i;this.getDa
taSourceState=r;this._dataSource=u;this._storageOpenInProgress=!
1;this._pendingQueries=[];f&&(f.bindAppVisible(function(){return
e.initStorage()}),f.bindDismissed(function(){return
e._pendingQueries=[]}),f.bindAppHidden(function(){return
e.teardownStorage()}))}return t.prototype.teardownStorage=function()
{this._storage&&this._storage.close()},t.prototype.initStorage=function(){var
n=this;!
this._storageOpenInProgress&&this.dataPopulated()&&(this._storageOpenInProgress=!
0,this._storageFactory(function(t){n._storage=t;n._storageOpenInProgress=!
1;n._pendingQueries.forEach(function(n){return
n()});n._pendingQueries=[]},function(t){n.onError(t,"open
storage");n._storageOpenInProgress=!1;n._pendingQueries.forEach(function(n){return
n()});n._pendingQueries=[]},function(){return
n._storage=null}))},t.prototype.onError=function(n,t){t!="open
storage"&&SharedLogHelper.LogError(t,this._dataSource,n);this.teardownStorage()},t.
prototype.reloadStorage=function()
{this.teardownStorage();this.initStorage()},t.prototype.isReady=function(){return!!
this._storage},t.prototype.getKey=function(n){return n.queryToFetch?
n.queryToFetch.toLocaleLowerCase():""},t.prototype.fetch=function(t,i,r,u,f){var
o=this,e;n.isDataSourceEnabled(this._dataSource,t)&&(e=function(n,r){var
u=r=="R";f()&&i(o._dataSource,o.createResponse(t,n,u),o.getDataSourceState(r))},thi
s.innerQueryStorage(1,this.getKey(t),function(n){return e(n,"R")},function(){return
e(null,"E")},function(){return e(null,"X")},function(){return
e(null,"T")}))},t.prototype.withStorage=function(n){return this._storage?
(n(this._storage),!0):!1},t.prototype.getMaxKey=function(n){return
n.slice(0,n.length-1)+String.fromCharCode(n.charCodeAt(n.length-
1)+1)},t.prototype.queryStorage=function(n,t,i,r,u)
{this.innerQueryStorage(0,n,t,i,r,u)},t.prototype.innerQueryStorage=function(t,i,r,
u,f,e){var h=this,o=null,s=!1,c=!0,a=function(){if(c)if(c=!1,h._storage){var
n=function(n){o&&sb_ct(o);h.onError(n,"query");s||(s=!0,u())};t==0?
h._storage.getValue(i,function(n){o&&sb_ct(o);s||(s=!0,r(n))},n):i?
h._storage.getRange(i,h.getMaxKey(i),function(n){o&&sb_ct(o);s||(s=!
0,r(n))},n):h._storage.getAll(function(n){o&&sb_ct(o);s||(s=!0,r(n))},n)}else
o&&sb_ct(o),s||(s=!0,u())},l;if(this._storage)a();else
if(this.initStorage(),this._storageOpenInProgress)this._pendingQueries.push(a);else
{f();return}l=i?
n.config.indexedDBTimeout:n.config.latencyTimeoutForZeroInput;l&&(o=n.safeSetTimeou
t(function(){o=null;c=!1;s||(s=!0,e())},l,"innerQueryStorage"))},t}
();t.StorageBasedDataProvider=i})(t=n.ClientSideStorage||(n.ClientSideStorage={}))}
(AutoSuggest||(AutoSuggest={})),function(n){var t;(function(t){var i=function()
{function i(n,t,i)
{this._host=n;this._instrumentationHelper=t;this._temporaryMessageHandler=i}return
i.prototype.parse=function(i,r,u,f,e,o,s){var
l=this,a=[],v=[],y=[],p=[],w=[],b=[],k=[],d,h,c,g;if(f&&f.Suggestions)for(d=functio
n(u){var f=u.suggestionData,e,o;f.handoffType==2?t.isApp(f.type)?
(e=f,v.push(e.id),w.push(u)):t.isSetting(f.type)?
(e=f,y.push(e.id),b.push(u)):t.isFileOrFolder(f.type)&&(e=f,p.push(e.id),k.push(u))
:n.isBingEnabled()&&(o=n.safeExecute(function(){return
l.parseMRUWebSuggestion(i,u,r)},"parseMRUWebSuggestion"),o&&a.push(o))},h=0,c=f.Sug
gestions;h<c.length;h++)g=c[h],d(g);t.lookupById(i,"MPP",v,w,function(n)
{return[n.suggestionData.id]},"MST",y,b,function(n){return
n.suggestionData.id},e,r,o,s,function(n,t,u,f){return
l.parseIdLookupResponse(i,r,n,t,u,f)},"MFF",p,k,function(n){return
n.suggestionData.id},this._instrumentationHelper,this._host);o(n.MRUDataSource,a,f)
},i.prototype.parseIdLookupResponse=function(i,r,u,f,e,o){var
h=this,s,c;e.length==1&&(s=u.suggestionData,c=function(n){return
h.setupRemoveFromHistoryContextMenu(n,u,h._host),s.appContextData&&(n.appContext=s.
appContextData.appContext,n.query=s.appContextData.query,n.text=i.queryToFetch?
HitHighlightingParser.addMarkers(s.appContextData.textWithoutHH,i.queryToFetch):s.a
ppContextData.textWithoutHH),h.setRankingSignals(n,s),!0},n.safeExecute(function()
{return
t.parseLocalSuggestion(i,e[0],f,r,h._host,h._temporaryMessageHandler,s.type,h._inst
rumentationHelper,o,c)},"parseLocalSuggestion
"+f))},i.prototype.setRankingSignals=function(n,t)
{n.hc=t.hc;n.highConfidenceMetaSuggestionScore=t.highConfidenceMetaSuggestionScore;
n.prefetchConfidenceScore=t.prefetchConfidenceScore;n.fromHistory=!0;n.hasMruData=!
0},i.prototype.parseMRUWebSuggestion=function(i,r,u){var
e=r.suggestionData,f=t.createSuggestion(i,i.queryToFetch?
HitHighlightingParser.addMarkers(e.textWithoutHH,i.queryToFetch):e.textWithoutHH,nu
ll,e.icon,e.type,e.query,n.InstrumentedItem.createInstrumentedItem(u,e.type),e.hand
offType,u,!1),o,s,c,h;this.setRankingSignals(f,e);switch(f.handoffType){case 5:case
4:if(!t.isCortanaEnabledCache||f.type=="CSK"||(o=e,f.primaryMetadata=o.annotation||
o.secondaryText,!
t.setCat1SuggestionProperties(f,i,u,o.actionUri,o.taskFrame,o.confidence,o.source,t
his._host)))return null;break;case 10:return null;case
1:s=e;c=r.rankingData;i.queryToFetch.length>3&&(f.autoOpenPreviewPaneWhenOnTopHit=!
!c.previewPaneLaunchCount);h=s.title||s.secondaryText;i.isSearchHomeZI&&h?
(f.additionalInfoText=s.url,f.text=HitHighlightingParser.removeMarkers(h)):f.primar
yMetadata=h;t.setUrlSuggestionProperties(f,i,u,s.url,this._host);break;default:retu
rn SharedLogHelper.LogError("parseMruWebSuggestion",null,new Error("Unexpected
handoff type: "+e.handoffType)),null}return
t.isValidSuggestion(f,"parseMruWebSuggestion")?
(this.setupRemoveFromHistoryContextMenu(f,r,this._host),f):null},i.prototype.setupR
emoveFromHistoryContextMenu=function(n,i,r){var
u=this;i.remove&&t.setExtraVerbs(n,function(t){if(t||!i.remove)return[];if(!
n.removeIcon&&n.duplicates&&n.duplicates.some(function(n){return!
n.fromHistory}))return[];var
f={verb:"RemoveFromDeviceHistory",displayName:r.getLocString("RemoveFromDeviceHisto
ry"),executeSync:function(){i.remove(function()
{r.refreshCurrentPane();u._temporaryMessageHandler.showTemporaryMessage(r.getLocStr
ing("RemovedFromDeviceHistory",HitHighlightingParser.removeMarkers(n.text)))});dele
te i.remove},icon:{content:"&#xE711",type:2}};return[f]},!0)},i}();t.MRUParser=i})
(t=n.WSB||(n.WSB={}))}(AutoSuggest||
(AutoSuggest={}));__extends=this&&this.__extends||function(){var n=function(t,i)
{return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t)
{n.__proto__=t}||function(n,t){for(var i in
t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r()
{this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):
(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var
i="LastUpdated",r=function(t){function r(r,u,f,e,o,s,h,c){var
l=this;r&&r.bindItemLaunch(function(n,t,i){return l.onLaunch(n,t,i)});var
a,v=function(t,r,f){return u(s,function(i){t(i);var r=n.getTimeDiffInDays(a);
(r===null||r>=1)&&(a=n.getCurrentDate(),l.prune())},r,f,i)},y=function(t,i,r)
{return n.config.th&&typeof
n.MockedMRUData=="object"&&(i=n.MockedMRUData),n.safeExecute(function(){return
l.createMruResponse(t,i,r)},"createMruResponse")},p=function(){return!
0},w=function(n){return n=="R"?undefined:n};return
f.bindClearMRURequested(function(t)
{l.teardownStorage();n.ClientSideStorage.deleteDatabase(s,function(){return t(!
0)},function(){return t(!1)})}),l=t.call(this,v,y,p,w,n.MRUDataSource,f)||
this,l.candidatesEnabled=h,l.loggingEnabled=c,l.getSuggestionKey=e,l.getGroupType=o
,l._pendingWrites=[],l}return __extends(r,t),r.prototype.getName=function()
{return"MRUDataProvider"},r.prototype.shouldStoreSuggestions=function(){return
n.config.historySettingsPresent&&this.candidatesEnabled()},r.prototype.createMruRes
ponse=function(t,i,r){var c=this,f,s,u,o,h;if(i=i||
[],f=this.getKey(t),this._lastKey=r?f:null,s=r?i.find(function(n){return
n.key==f}):null,this._valueForLastKey=s?
s.value:null,u={},n.config.mruSignalsEnabled&&this._valueForLastKey&&(u.SuggestionE
ngagementData=this._valueForLastKey.SuggestionEngagementData),u.LookupCompletions=i
.map(function(n)
{return{key:n.key,value:n.value.SuggestionEngagementData}}),this.shouldStoreSuggest
ions()){var e=[],v=this.getOldestDateToKeep(),y=function(n,t){var
u,i,r,f;if(t.Suggestions)for(u=function(i){var
r=l.getRankingData(t,i);r&&r.lastLaunchTime&&r.lastLaunchTime>=v&&e.push({rankingDa
ta:n==l._lastKey?
{prefixLaunchCount:r.prefixLaunchCount,lastLaunchTime:r.lastLaunchTime,previewPaneL
aunchCount:r.previewPaneLaunchCount,lastPreviewPaneLaunchTime:r.lastPreviewPaneLaun
chTime}:r,suggestionData:i,remove:function(t){return
c.remove(n,i,t)}})},i=0,r=t.Suggestions;i<r.length;i+
+)f=r[i],u(f)},l=this;for(o=0,h=i;o<h.length;o++){var
a=h[o],p=a.key,w=a.value;y(p,w)}e.length>0&&(u.Suggestions=[],e.sort(function(n,t)
{return t.rankingData.lastLaunchTime-
n.rankingData.lastLaunchTime}),e.forEach(function(n){return
c.addToResponseIfNotPresent(u.Suggestions,n)}),f?f.length<=n.config.mruLengthA?
u.Suggestions.splice(n.config.maxMruA):f.length<=n.config.mruLengthB&&u.Suggestions
.splice(n.config.maxMruB):u.Suggestions.splice(n.config.maxMruZeroInput))}return
u},r.removeRankerSignals=function(n,t){return
n=="highConfidenceMetaSuggestionScore"||n=="prefetchConfidenceScore"?
undefined:t},r.prototype.addToResponseIfNotPresent=function(n,t){var
f=JSON.stringify(t.suggestionData,r.removeRankerSignals),i=n.find(function(n)
{return JSON.stringify(n.suggestionData,r.removeRankerSignals)==f}),u;i?
(u=i.remove,i.remove=function(n){return u(function(){return
t.remove(n)})},i.rankingData.lastLaunchTime=Math.max(i.rankingData.lastLaunchTime,t
.rankingData.lastLaunchTime),i.rankingData.prefixLaunchCount+=t.rankingData.prefixL
aunchCount,t.rankingData.previewPaneLaunchCount&&(i.rankingData.previewPaneLaunchCo
unt=(i.rankingData.previewPaneLaunchCount||
0)+t.rankingData.previewPaneLaunchCount),t.rankingData.lastPreviewPaneLaunchTime&&(
i.rankingData.lastPreviewPaneLaunchTime=i.rankingData.lastPreviewPaneLaunchTime?
Math.max(i.rankingData.lastPreviewPaneLaunchTime,t.rankingData.lastPreviewPaneLaunc
hTime):t.rankingData.lastPreviewPaneLaunchTime)):n.push(t)},r.prototype.addToDataIf
NotPresent=function(n,t){var
i=JSON.stringify(t,r.removeRankerSignals),u=n.find(function(n){return
JSON.stringify(n,r.removeRankerSignals)==i});u||
n.push(t)},r.prototype.onAfterWrite=function(){if(this._writing=!
1,this._pendingWrites.length>0){var n=this._pendingWrites.shift();n()}else
this._tearDownPending&&this.teardownStorage()},r.prototype.teardownStorage=function
(){this._writing?this._tearDownPending=!0:(this._tearDownPending=!
1,t.prototype.teardownStorage.call(this))},r.prototype.onLaunch=function(n,t,i){var
r=this,u;if(this.loggingEnabled()){if(this._writing)
{this._pendingWrites.push(function(){return
r.onLaunch(n,t,i)});return}this._writing=!0;u=this.getKey(t);this._lastKey==u?
this.updateAndSaveLaunchData(u,this._valueForLastKey,n,i):this.queryStorage(u,funct
ion(t){return r.updateAndSaveLaunchData(u,t,n,i)},function(){return
r.onAfterWrite()},function(){return r.onAfterWrite()},function(){return
r.onAfterWrite()})}},r.prototype.remove=function(n,t,i){var
r=this;if(this._writing){this._pendingWrites.push(function(){return
r.remove(n,t,i)});return}this._writing=!0;this._lastKey==n?
this.removeAndSaveLaunchData(n,this._valueForLastKey,t,i):this.queryStorage(n,funct
ion(u){return r.removeAndSaveLaunchData(n,u,t,i)},function(){return
r.onAfterWrite()},function(){return r.onAfterWrite()},function(){return
r.onAfterWrite()})},r.getUnixTime=function(n){return n||(n=new
Date),Math.round(n.getTime()/1e3)},r.prototype.createOrUpdateDbEntry=function(n,t,i
,u){var f,e;return t?
(t.LastUpdated=r.getUnixTime(),t.SuggestionEngagementData=t.SuggestionEngagementDat
a||{}):t={LastUpdated:r.getUnixTime(),SuggestionEngagementData:
{}},f=this.getSuggestionKey(i),t.SuggestionEngagementData[f]=this.updateMRUEntryCli
cksAndTime(t.SuggestionEngagementData[f],t.LastUpdated,u),this.getGroupType&&(t.Sug
gestionEngagementData[f].groupType=this.getGroupType(i)),this.shouldStoreSuggestion
s()&&(e=i.getMruData(),e&&n&&(t.Suggestions||
(t.Suggestions=[]),this.addToDataIfNotPresent(t.Suggestions,e))),t},r.prototype.upd
ateMRUEntryClicksAndTime=function(n,t,i){return n?
(n.prefixLaunchCount+=1,n.lastLaunchTime=t):n={prefixLaunchCount:1,lastLaunchTime:t
},i&&(n.previewPaneLaunchCount=(n.previewPaneLaunchCount||
0)+1,n.lastPreviewPaneLaunchTime=t),n},r.prototype.getOldestDateToKeep=function()
{var t=n.getCurrentDate();return t.setDate(t.getDate()-
n.config.mruMaxAgeInDays),r.getUnixTime(t)},r.prototype.updateAndSaveLaunchData=fun
ction(t,i,r,u){var f=this;if(i=n.safeExecute(function(){return
f.createOrUpdateDbEntry(t,i,r,u)},"createOrUpdateDbEntry"),!i)
{this.onAfterWrite();return}n.safeExecute(function(){return
f.removeOldLaunches(i,f.getOldestDateToKeep())},"removeOldLaunches");this._lastKey=
t;this._valueForLastKey=i;this.withStorage(function(n){return n.put(t,i,function()
{return f.onAfterWrite()},function(n)
{f.onError(n,"updateAndSaveLaunchData");f.onAfterWrite()})})||
this.onAfterWrite()},r.prototype.removeAndSaveLaunchData=function(n,t,i,r){var
u=this,e,f;if(!t){SharedLogHelper.LogError("removeAndSaveLaunchData",null,new
Error("MRU entry not
present"));this.onAfterWrite();return}if(e=JSON.stringify(i),f=(t.Suggestions||
[]).findIndex(function(n){return JSON.stringify(n)==e}),f==-1)
{SharedLogHelper.LogError("removeAndSaveLaunchData",null,new Error("Suggestion not
present in
MRU"));this.onAfterWrite();return}t.Suggestions.splice(f,1);this._lastKey=n;this._v
alueForLastKey=t;this.withStorage(function(i){return i.put(n,t,function()
{r&&r();u.onAfterWrite()},function(n)
{u.onError(n,"removeAndSaveLaunchData");u.onAfterWrite()})})||
this.onAfterWrite()},r.prototype.getRankingData=function(n,t){return
n.SuggestionEngagementData?
n.SuggestionEngagementData[t.suggestionKey]:undefined},r.prototype.removeOldLaunche
s=function(n,t){var i,r,u;if(n.Suggestions)for(i=n.Suggestions.length-1;i>=0;--
i)r=this.getRankingData(n,n.Suggestions[i]),u=r?r.lastLaunchTime:null,(!u||
u<t)&&n.Suggestions.splice(i,1);this.removeOldEngagementData(n.SuggestionEngagement
Data,t)},r.prototype.removeOldEngagementData=function(n,t){var i,r,u;if(n)for(i in
n)r=n[i],r&&(u=r.lastLaunchTime,(!u||u<t)&&delete
n[i])},r.prototype.prune=function(n){var t=this;if(this._writing)
{this._pendingWrites.push(function(){return t.prune(n)});return}this._writing=!
0;this.withStorage(function(i){return
i.removeRangeOnSecondaryKey(0,t.getOldestDateToKeep(),function()
{n&&n();t.onAfterWrite()},function(n){t.onError(n,"MRUDataProvider
prune");t.onAfterWrite()})})||this.onAfterWrite()},r}
(n.ClientSideStorage.StorageBasedDataProvider);t.MRUDataProvider=r})(t=n.MRU||
(n.MRU={}))}(AutoSuggest||(AutoSuggest={})),function(n){var t;(function(t){var i;
(function(i){function c(n,i){var r,u;if(f||nt(),r=f[n],!r)throw new
Error("Unsupported data source:
"+n);if(t.config.indexerQuerySimplified&&n=="IFF")return
r[4];if(u=r.filter(function(n){return!n.enabled||n.enabled(i)}),u.length==0)throw
new Error("No enabled strategies for data source: "+n);else if(u.length>1)throw new
Error("Multiple strategies for data source: "+n);else return u[0]}function hr(n)
{return f||nt(),!!f[n]}function cr(n,t,i){if(!f||!f[i]||t.taskFrame)return!1;var
r=c(i,t);return r.sfgaoFilter?!r.sfgaoFilter(n.getProperty("System.SFGAOFlags")):!
1}function r(n,t){return n=vi.concat(n),t&&(n=n.concat(yi)),n}function nt(){var
nt=0,o=s.deviceSearch.getUserSID(),ii=e(t.getKnownFolderPathLC(t.FOLDERID_Profile))
,tt=ti(nt,o,!1),it=tt[0],c=tt[1],rt=ti(nt,o,!0),i=rt[0],n=rt[1];b=it;pt=c;var
ut='"System.Kind" != ANY ARRAY['+d.concat("link").map(function(n)
{return"'"+n+"'"}).join(", ")+"] AND "+it,ri="\"System.Kind\" = SOME
ARRAY['program'] AND "+i,l='"System.Kind" != ANY ARRAY['+bt.map(function(n)
{return"'"+n+"'"}).join(", ")+"] AND "+i,g='"System.Kind" != ANY
ARRAY['+wt.concat(d).concat("folder").map(function(n){return"'"+n+"'"}).join(", ")
+"] AND "+i,ui="\"System.Kind\" = SOME ARRAY['folder'] AND "+i,kt="\"System.Kind\"
= SOME ARRAY['Music'] AND "+i,dt="\"System.Kind\" = SOME ARRAY['Picture'] AND
"+i,gt='"System.Kind" = SOME ARRAY['+k.map(function(n){return"'"+n+"'"}).join(", ")
+"] AND "+i,ni="SCOPE =
'winrt://{"+o+"}/LS/Microsoft.MicrosoftEdge_8wekyb3d8bbwe/spartan
history'",fi="SCOPE = 'file:"+ii+"' AND \"System.Kind\" = SOME ARRAY['folder'] AND
"+i;f={};f.IFF=[{selectFields:r(h,!1),filterFieldsSets:
[ft],mostRelevantProps:a,kindAndScopeClauses:ut,sortClause:u,searchOptions:3,sfgaoF
ilter:c,enabled:function(n){return!!n.queryToFetch&&!
t.supportsShortcuts("IFF",n)}},{selectFields:r(h,!1),filterFieldsSets:
[],mostRelevantProps:a,kindAndScopeClauses:ut,sortClause:u,searchOptions:0,sfgaoFil
ter:c,enabled:function(n){return!n.queryToFetch&&!t.supportsShortcuts("IFF",n)}},
{selectFields:r(et,!0),filterFieldsSets:
[pi],mostRelevantProps:a,kindAndScopeClauses:l,sortClause:u,searchOptions:3,sfgaoFi
lter:n,enabled:function(n){return!!n.queryToFetch&&t.supportsShortcuts("IFF",n)}},
{selectFields:r(et,!0),filterFieldsSets:
[],mostRelevantProps:a,kindAndScopeClauses:l,sortClause:u,searchOptions:0,sfgaoFilt
er:n,enabled:function(n){return!n.queryToFetch&&t.supportsShortcuts("IFF",n)}},
{selectFields:r(["System.Title"],!0),filterFieldsSets:[wi],mostRelevantProps:
["System.ItemNameDisplay","
System.Title"],kindAndScopeClauses:l,sortClause:u,searchOptions:0,sfgaoFilter:n,ena
bled:function(n){return t.config.indexerQuerySimplified&&!!
n.queryToFetch}}];f.EBH=[{selectFields:ot,filterFieldsSets:
[bi],mostRelevantProps:st,kindAndScopeClauses:ni,sortClause:ht,searchOptions:7,sfga
oFilter:null,enabled:function(n){return!!n.queryToFetch}},
{selectFields:ot,filterFieldsSets:
[ki],mostRelevantProps:st,kindAndScopeClauses:ni,sortClause:ht,searchOptions:0,sfga
oFilter:null,enabled:function(n){return!
n.queryToFetch}},];f.MDOC=[{selectFields:r(v,!0),filterFieldsSets:
[ct.concat(tr)],mostRelevantProps:y,kindAndScopeClauses:g,sortClause:u,searchOption
s:3,sfgaoFilter:n,enabled:function(n){return
n.queryToFetch&&t.config.minLengthForContentMatch&&n.queryToFetch.length>=t.config.
minLengthForContentMatch}},{selectFields:r(v,!0),filterFieldsSets:
[ct],mostRelevantProps:y,kindAndScopeClauses:g,sortClause:u,searchOptions:3,sfgaoFi
lter:n,enabled:function(n){return n.queryToFetch&&(!
t.config.minLengthForContentMatch||
n.queryToFetch.length<t.config.minLengthForContentMatch)}},{selectFields:r(v,!
0),filterFieldsSets:
[],mostRelevantProps:y,kindAndScopeClauses:g,sortClause:u,searchOptions:0,sfgaoFilt
er:n,enabled:function(n){return!n.queryToFetch}},];f.MFOL=[{selectFields:r(ir,!
0),filterFieldsSets:
[ur],mostRelevantProps:rr,kindAndScopeClauses:ui,sortClause:u,searchOptions:3,sfgao
Filter:n}];f.MPHO=[{selectFields:r(p,!0),filterFieldsSets:
[fr],mostRelevantProps:lt,kindAndScopeClauses:dt,sortClause:u,searchOptions:3,sfgao
Filter:n,enabled:function(n){return!!n.queryToFetch}},{selectFields:r(p,!
0),filterFieldsSe
ts:
[],mostRelevantProps:lt,kindAndScopeClauses:dt,sortClause:u,searchOptions:0,sfgaoFi
lter:n,enabled:function(n){return!n.queryToFetch}},];f.MVID=[{selectFields:r(w,!
0),filterFieldsSets:
[er],mostRelevantProps:at,kindAndScopeClauses:gt,sortClause:u,searchOptions:3,sfgao
Filter:n,enabled:function(n){return!!n.queryToFetch}},{selectFields:r(w,!
0),filterFieldsSets:
[],mostRelevantProps:at,kindAndScopeClauses:gt,sortClause:u,searchOptions:0,sfgaoFi
lter:n,enabled:function(n){return!n.queryToFetch}},];f.MMUS=[{selectFields:r(vt,!
0),filterFieldsSets:
[or],mostRelevantProps:yt,kindAndScopeClauses:kt,sortClause:u,searchOptions:3,sfgao
Filter:n,enabled:function(n){return!!n.queryToFetch}},{selectFields:r(vt,!
0),filterFieldsSets:
[],mostRelevantProps:yt,kindAndScopeClauses:kt,sortClause:u,searchOptions:0,sfgaoFi
lter:n,enabled:function(n){return!n.queryToFetch}},];f.IBA=[{selectFields:r(di,!
0),filterFieldsSets:
[nr],mostRelevantProps:gi,kindAndScopeClauses:ri,sortClause:u,searchOptions:3,sfgao
Filter:n}];f.MFF=[{selectFields:r(h,!1),filterFieldsSets:
[sr],mostRelevantProps:null,kindAndScopeClauses:null,sortClause:null,searchOptions:
0,sfgaoFilter:null}];f.LDIC=[{selectFields:r(h,!0),filterFieldsSets:
[],mostRelevantProps:null,kindAndScopeClauses:fi,sortClause:u,searchOptions:0,sfgao
Filter:n}]}function lr(n,t,i,r){return nu(n.queryToFetch).then(function(u){return
yr(n,u,t,i,r)})}function ar(n,t,i){var r=c(t,n);return"SELECT TOP "+i.length+"
"+tt(r.selectFields)+" FROM SystemIndex WHERE "+kr(r,i)}function vr(n){var
i=c(n,null),r=t.config.maxDeviceItemCacheSize;return"SELECT TOP "+r+"
"+tt(i.selectFields)+" FROM SystemIndex WHERE "+i.kindAndScopeClauses}function
yr(n,t,i,r,u){var
e=s.deviceSearch.getLCIDStringForText(n.queryToFetch),f=n.taskFrame?
eu(u,n.taskFrame.parsed,e):c(u,n);return"SELECT TOP "+r+" "+tt(f.selectFields)+"
FROM SystemIndex WHERE "+dr(f,n.queryToFetch,t,i,f.searchOptions,e)+" ORDER BY
"+f.sortClause}function pr(n){var
t={displayName:n.displayName,id:n.id,kind:n.kind,getProperty:function(t){return
n.getProperty(t)},propertyHits:n.propertyHits,rankScore:n.rankScore,url:n.getProper
ty("System.Link.TargetUrl"),title:n.getProperty("System.Title"),visitCount:n.getPro
perty("System.History.VisitCount"),dateVisited:n.getProperty("System.Link.DateVisit
ed")};return t.originalDeviceItem=n,t}function wr(n){var
f,i,r,t,u;if(n.kind=="link"||
n.kind=="program")for(f=n.getProperty("System.Kind"),i=0,r=f;i<r.length;i++)
{if(t=r[i],t=="program")return br(n,t);if(t!="link")return
u={displayName:n.displayName,id:n.id,kind:t,getProperty:function(t){return
n.getProperty(t)},propertyHits:n.propertyHits,rankScore:n.rankScore,getImageAsync:f
unction(t){return
n.getImageAsync(t)},imageType:n.imageType,canHaveContextMenu:n.canHaveContextMenu,g
etVerbsAsync:function(){return
n.getVerbsAsync()},extension:n.extension,itemTypeDisplayName:n.itemTypeDisplayName,
createdDate:n.createdDate,lastModifiedDate:n.lastModifiedDate},u.originalDeviceItem
=n,u}return n}function br(n,i){var r=n.displayName,u,f;return
r.toLocaleLowerCase().endsWith(".lnk")&&(r=r.substr(0,r.length-
4)),u=t.indexerFilePathToRegularPath(n.id),f={displayName:r,id:u,kind:i,getProperty
:function(t){return
n.getProperty(t)},propertyHits:n.propertyHits,rankScore:n.rankScore,getImageAsync:f
unction(t){return
n.getImageAsync(t)},imageType:n.imageType,canHaveContextMenu:n.canHaveContextMenu,g
etVerbsAsync:function(){return
n.getVerbsAsync()},extension:n.extension,itemTypeDisplayName:n.itemTypeDisplayName,
createdDate:n.createdDate,lastModifiedDate:n.lastModifiedDate,filePath:u,lastAccess
ed:n.getProperty("System.DateAccessed"),version:null,isImmersive:!
1,logoBackgroundColor:null,launchArguments:null,totalLaunches:null,isTrustedApp:!
1,packageFamilyName:null,jumpList:null,getJumpListAsync:null,voiceCommandExamples:n
ull,rawIndexResponse:null},f.originalDeviceItem=n,f}function tt(n){return
n.map(function(n){return
n=="System.ParsingPath"?"path":'"'+n+'"'}).join(",")}function kr(n,t)
{return"("+tu(n,t)+")"}function dr(n,t,i,r,u,f){var e="",o;return
n.mostRelevantProps.length>0&&(e+="WITH ("+n.mostRelevantProps.join(", ")+") AS
#MRProps "),o=iu(n,t,i,u,f),o&&(e+="("+o+") AND "),r&&(e+="(Scope = '"+r+"') AND
"),e+n.kindAndScopeClauses}function gr(n,t){return
s.deviceSearch.tokenize(n,t)}function nu(n){return
s.getLinguisticDataAsync(n)}function kt(t,i){var
r="",u=t.filterFieldsSets.length>1;return t.filterFieldsSets.forEach(function(t)
{var s,f,h,l,e,o,c,a;for(u&&(r?r+=") AND (":r="("),s=!0,f=0,h=t;f<h.length;f++)
{for(l=h[f],e=!1,o=0,c=i;o<c.length;o++)a=c[o],s?(r+="(",s=!1):r+=e?" OR ":" OR
(",r+=n.formatString(l,[a]),e=!0;e&&(r+=")")}}),u&&(r+=")"),r}function tu(n,t){var
i=t.map(function(n){return it(n)});return kt(n,i)}function iu(n,t,i,r,u){var
o=[t],e,f;return i.alternatives&&i.alternatives.forEach(function(n){return
o.push(n)}),e=o.map(function(n){return it(n)}),f=kt(n,e),
(r&2)==2&&(f=ru(r,i,e,f,u)),f}function ru(i,r,u,f,e){for(var
d,l,a,w,o,h,y,b,g,nt=uu(i),c=!1,p=0,k=nt;p<k.length;p++){for(d=k[p],l=!
1,a=0,w=u;a<w.length;a++){var
tt=w[a],v=[],s=gr(tt,r.language);if(c&&t.config.indexerQueryMWLimit){if((i&4)==0||
s.length<=t.config.indexerQueryMWLimit)for(o=0;o<Math.min(s.length,t.config.indexer
QueryMWLimit);++o)v.push(s[o])}else if((i&4)==0||
s.length<=ut)for(o=0;o<Math.min(s.length,ut);++o)v.push(s[o]);if(v.length>1)
{for(h="",y=0,b=v;y<b.length;y++)g=b[y],h&&(h+=" AND "),h+='"'+g+(c?'*"':'"');f?
f+=l?" OR ":" OR (":f="(";f+=n.formatString(d,[h,e]);l=!0}}l&&(f+=")");c=!c}return
f}function uu(n){var i=[];return i.push("CONTAINS(#MRProps, '{0}', {1}) RANK BY
COERCION(ABSOLUTE, 600)"),t.config.indexerQueryMWMinScore?
(n&1)==1&&i.push("CONTAINS(#MRProps, '{0}', {1}) RANK BY COERCION(ABSOLUTE, 50)"):
(n&1)==1&&i.push("CONTAINS(#MRProps, '{0}', {1}) RANK BY COERCION(ABSOLUTE,
550)"),i}function dt(n,t){return n=n.replace(/'/g,"''"),n=n.replace(/"/g,"
"),t>=2&&(n=n.replace(/%/g,"[%]"),n=n.replace(/_/g,"[_]"),n=n.replace(/\
[/g,"[[]"),t==3?(n=n.replace(/\*/g,"%"),n=n.replace(/\?/g,"_")):
(n=n.replace(/\*/g," "),n=n.replace(/\?/g," "))),n}function e(n){return
dt(n,1)}function it(n){return dt(n,2)}function fu(n){var t=l[n];if(t)return t;throw
new Error("select fields for NL Data source was not found: "+n);}function o(n,t,i)
{for(var u=[],r=3;r<arguments.length;r++)u[r-3]=arguments[r];typeof i=="string"?
(i=it(i),t.push(u.map(function(t){return"CONTAINS("+t+",'\""+i+"*\"',"+n+") RANK BY
COERCION(ABSOLUTE, 1000)"}))):i&&i.Value&&o.apply(void 0,
[n,t,i.Value].concat(u))}function eu(n,t,i){var f=[],e='"System.Kind" != ANY
ARRAY['+g+"]",h,r;if(t.FileType&&t.FileType.Value){h=t.FileType.Value;switch(h)
{case"Document":break;case"Picture":e="\"System.Kind\" = SOME
ARRAY['Picture']";break;case"Video":e='"System.Kind" = SOME
ARRAY['+k.map(function(n){return"'"+n+"'"}).join(", ")
+"]";break;case"Powerpoint":case"Word":case"Excel":e="CONTAINS(System.ItemType,'\""
+gt[h]+"*\"',"+i+') RANK BY COERCION(ABSOLUTE, 1000) AND "System.Kind" != ANY
ARRAY['+g+"]";break;default:e='"System.Kind" != ANY
ARRAY['+g+"]";o(i,f,h,"System.ItemType","System.ItemTypeText")}}return
o(i,f,t.Title,"System.ItemNameDisplay","System.Title"),o(i,f,t.Body,"System.ItemNam
eDisplay","System.Title","System.FileDescription","System.Keywords","System.Search.
Contents"),t.People&&t.People.forEach(function(n){var t=n.Value;t&&o(i,f,t=="me"?
s.deviceSearch.userName:t,"System.Author","System.FileOwner","System.Document.LastA
uthor","System.Photo.TagViewAggregate")}),o(i,f,t.Place,"System.Photo.TagViewAggreg
ate"),r=ou(t.Time),r&&f.push(["System.DateCreated>='"+r[0]+"' AND
System.DateCreated<'"+r[1]+"'","System.DateModified>='"+r[0]+"' AND
System.DateModified<'"+r[1]+"'","System.DateAccessed>='"+r[0]+"' AND
System.DateAccessed<'"+r[1]+"'","System.DateArchived>='"+r[0]+"' AND
System.DateArchived<'"+r[1]+"'","System.DateAcquired>='"+r[0]+"' AND
System.DateAcquired<'"+r[1]+"'",]),
{selectFields:fu(n),filterFieldsSets:f,kindAndScopeClauses:e?e+" AND
"+b:b,mostRelevantProps:[],searchOptions:0,sortClause:u,sfgaoFilter:pt}}function
ou(t){var i,f,u,e,r;return t?(i=t.value,!i)?null:(f=i.indexOf("T"),f!=-
1&&(i=i.substr(0,f)),u=i.split("-"),u.length<2||u.length>3)?null:(e=new Date(i),!
n.isValidDate(e))?null:(r=new Date(i),u.length==3?r.setUTCDate(r.getUTCDate()
+1):r.setUTCMonth(r.getUTCMonth()+1),[ni(e),ni(r)]):null}function ni(n){var
t=n.toISOString();return t.substr(0,t.indexOf("T"))}function ti(n,i,r){var
u,h,c,f,o,s,l,a,v;r||(u="NOT System.Shell.SFGAOFlagsStrings = SOME ARRAY['hidden']
AND NOT System.Shell.SFGAOFlagsStrings = SOME ARRAY['system'] AND NOT
System.Shell.SFGAOFlagsStrings = SOME ARRAY['link']");r?h=function(n){return!
(n&hi)&&!(n&si)&&(!!(n&&ci)||n&&ai&&!!(n&&rt)||n&&li&&!!(n&&rt))}:(u+=" AND
(System.Shell.SFGAOFlagsStrings = SOME ARRAY['stream']",u+=" OR
(System.Shell.SFGAOFlagsStrings = SOME ARRAY['fileanc'] AND
System.Shell.SFGAOFlagsStrings = SOME ARRAY['folder'])",u+=" OR
(System.Shell.SFGAOFlagsStrings = SOME ARRAY['storageanc'] AND
System.Shell.SFGAOFlagsStrings = SOME ARRAY['folder'])",u+=")");r?
u="System.Shell.OmitFromView != 'true'":u+=" AND System.Shell.OmitFromView !=
'true'";c=e(t.getKnownFolderPathLC(t.FOLDERID_Profile));switch(n){case
0:f=e(t.getKnownFolderPathLC(ui));u+=" AND (Scope = 'file://' OR Scope =
'csc://{"+i+"}') AND (Scope <> 'file:"+c+"\\AppData') AND (Scope <>
'file:"+f+"\\Default\\AppData') AND (Scope <>
'file:"+f+"\\Administrator\\AppData')";o=e(t.getKnownFolderPathLC(ii));s=e(t.getKno
wnFolderPathLC(ri));u+=" AND (Scope <> 'file:"+o+"')";s!=o&&(u+=" AND (Scope <>
'file:"+s+"')");l=e(t.getKnownFolderPathLC(fi));u+=" AND (Scope <>
'file:"+l+"')";a=e(t.getKnownFolderPathLC(ei));u+=" AND (Scope <>
'file:"+a+"')";r&&(v=e(t.getKnownFolderPathLC(oi)),u+=" AND (Scope <>
'file:"+v+"')");break;case 1:u+=" AND (Scope = 'file://' OR Scope =
'csc://{"+i+"}')";break;default:throw new Error("Unknown SearchScope:
"+n);}return[u,h]}var
s=SearchAppWrapper.CortanaApp.queryFormulationView,ii="{905e63b6-c1bf-494e-b29c-
65b732d3d21a}",ri="{7C5A40EF-A0FB-4BFC-874A-C0F2E0B
9FA8E}",ui="{0762D272-C50A-4BB0-A382-697DCD729B80}",fi="{A4115719-D62E-491D-AA7C-
E74B8BE3B067}",ei="{0482af6c-08f1-4c34-8c90-e17ec98b1e17}",oi="{bfb9d5e0-c6a9-404c-
b2b2-
ae6db6af4968}",si=4096,hi=524288,ci=4194304,rt=536870912,li=8388608,ai=268435456,ut
=3,u='"System.Search.Rank" DESC, "System.DateModified" DESC,
"System.ItemNameDisplay"
ASC',vi=["System.Kind","System.Search.Rank","System.ParsingPath","System.DateCreate
d","System.DateModified","System.Search.QueryPropertyHits","System.ItemNameDisplay"
,"System.FileExtension","System.ItemType",],yi=["System.Link.TargetParsingPath","Sy
stem.SFGAOFlags",],h=["System.Title","System.Music.AlbumTitle","System.Music.Displa
yArtist"],a=["System.ItemNameDisplay","System.Music.DisplayArtist","System.Music.Al
bumTitle",],ft=["System.ItemNameDisplay = '{0}' RANK BY COERCION(ABSOLUTE,
990)","CONTAINS(System.ItemNameDisplay, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
960)","System.Title = '{0}' RANK BY COERCION(ABSOLUTE,
890)","CONTAINS(System.Title, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
860)","System.Music.DisplayArtist = '{0}' RANK BY COERCION(ABSOLUTE,
790)","CONTAINS(System.Music.DisplayArtist, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
760)","System.Music.AlbumTitle = '{0}' RANK BY COERCION(ABSOLUTE,
690)","CONTAINS(System.Music.AlbumTitle, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
660)",],et=h.concat("System.DateAccessed"),pi=ft.concat(["CONTAINS(System.Link.Targ
etParsingPath, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
920)"]),wi=["System.ItemNameDisplay = '{0}' RANK BY COERCION(ABSOLUTE,
990)","CONTAINS(System.ItemNameDisplay, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
960)","System.Title = '{0}' RANK BY COERCION(ABSOLUTE,
890)","CONTAINS(System.Title, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
860)","CONTAINS(System.Link.TargetParsingPath, '\"{0}*\"') RANK BY
COERCION(ABSOLUTE,
920)",],ot=["System.ItemNameDisplay","System.Search.QueryPropertyHits","System.Kind
","System.Search.Rank","System.Link.TargetUrl","System.Title","System.History.Visit
Count","System.Link.DateVisited","System.DateCreated","System.DateModified",],st=["
System.Link.TargetUrl","System.Title",],bi=["(System.Link.TargetUrl LIKE 'http%'
AND CONTAINS(System.Title, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
1000))","(System.Link.TargetUrl LIKE 'http%' AND CONTAINS(System.Link.TargetUrl,
'\"{0}*\"') RANK BY COERCION(ABSOLUTE, 995))",],ki=["(System.Link.TargetUrl LIKE
'http%' RANK BY COERCION(ABSOLUTE, 995))",],ht='"System.History.VisitCount" DESC,
"System.Link.DateVisited" DESC, "System.Title"
ASC',di=["System.DateAccessed",],gi=["System.ItemNameDisplay",],nr=["System.ItemNam
eDisplay = '{0}' RANK BY COERCION(ABSOLUTE, 999)","CONTAINS(System.ItemNameDisplay,
'\"{0}*\"') RANK BY COERCION(ABSOLUTE,
895)","CONTAINS(System.Link.TargetParsingPath, '\"{0}*\"') RANK BY
COERCION(ABSOLUTE,
795)",],v=["System.Search.AutoSummary","System.Keywords","System.Title","System.Aut
hor","System.Document.LastAuthor",],y=["System.ItemNameDisplay","System.Keywords","
System.Title",],ct=["System.ItemNameDisplay = '{0}' RANK BY COERCION(ABSOLUTE,
999)","CONTAINS(System.ItemNameDisplay, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
895)","System.Title = '{0}' RANK BY COERCION(ABSOLUTE,
980)","CONTAINS(System.Title, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
875)","System.Keywords = '{0}' RANK BY COERCION(ABSOLUTE,
960)","CONTAINS(System.Keywords, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
855)",],tr="CONTAINS(System.Search.Contents, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
545)",ir=[],rr=["System.ItemNameDisplay",],ur=["System.ItemNameDisplay = '{0}' RANK
BY COERCION(ABSOLUTE, 999)","CONTAINS(System.ItemNameDisplay, '\"{0}*\"') RANK BY
COERCION(ABSOLUTE,
895)",],p=["System.Photo.TagViewAggregate","System.Title",],lt=["System.ItemNameDis
play","System.Photo.TagViewAggregate",],fr=["System.ItemNameDisplay = '{0}' RANK BY
COERCION(ABSOLUTE, 999)","CONTAINS(System.ItemNameDisplay, '\"{0}*\"') RANK BY
COERCION(ABSOLUTE, 895)","System.Title = '{0}' RANK BY COERCION(ABSOLUTE,
980)","CONTAINS(System.Title, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
875)","System.Photo.TagViewAggregate = '{0}' RANK BY COERCION(ABSOLUTE,
940)","CONTAINS(System.Photo.TagViewAggregate, '\"{0}*\"') RANK BY
COERCION(ABSOLUTE,
835)",],w=["System.Title","System.Keywords","System.Music.DisplayArtist","System.Mu
sic.Genre",],at=["System.ItemNameDisplay","System.Title","System.Keywords",],er=["S
ystem.ItemNameDisplay = '{0}' RANK BY COERCION(ABSOLUTE,
999)","CONTAINS(System.ItemNameDisplay, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
895)","System.Title = '{0}' RANK BY COERCION(ABSOLUTE,
980)","CONTAINS(System.Title, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
875)","System.Music.DisplayArtist = '{0}' RANK BY COERCION(ABSOLUTE,
960)","CONTAINS(System.Music.DisplayArtist, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
855)","System.Music.Genre = '{0}' RANK BY COERCION(ABSOLUTE,
950)","CONTAINS(System.Music.Genre, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
845)","System.Keywords = '{0}' RANK BY COERCION(ABSOLUTE,
940)","CONTAINS(System.Keywords, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
835)",],vt=["System.Title","System.Music.DisplayArtist","System.Music.AlbumTitle","
System.Music.Genre",],yt=["System.ItemNameDisplay","System.Title","System.Music.Alb
umTitle",],or=["System.ItemNameDisplay = '{0}' RANK BY COERCION(ABSOLUTE,
999)","CONTAINS(System.ItemNameDisplay, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
895)","System.Title = '{0}' RANK BY COERCION(ABSOLUTE,
980)","CONTAINS(System.Title, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
875)","System.Music.AlbumTitle = '{0}' RANK BY COERCION(ABSOLUTE,
970)","CONTAINS(System.Music.AlbumTitle, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
865)","System.Music.DisplayArtist = '{0}' RANK BY COERCION(ABSOLUTE,
960)","CONTAINS(System.Music.DisplayArtist, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
855)","System.Music.Genre = '{0}' RANK BY COERCION(ABSOLUTE,
950)","CONTAINS(System.Music.Genre, '\"{0}*\"') RANK BY COERCION(ABSOLUTE,
845)",],sr=["path =
'{0}'"],f,l,gt;i.getStrategy=c;i.dataSourceSupported=hr;i.suppress=cr;var
b,pt,k=["Movie","RecordedTV","Video"],wt=k.concat(["Picture","Music"]),bt=["calenda
r","game","web
history","feed","contact","task","journal","note","instantmessage"],d=bt.concat("pr
ogram"),g=wt.concat(d).concat(["folder","link"]).map(function(n)
{return"'"+n+"'"}).join(",");i.initStrategies=nt;i.generateIndexerQueryAsync=lr;i.g
enerateIndexerQueryForMRUFilesAndFolders=ar;i.generateIndexerQueryForDeviceItemCach
e=vr;i.toBrowsingHistoryItem=pr;i.fixKind=wr;l={};l.MPHO=r(p,!1);l.MVID=r(w,!
1);l.MDOC=r(v,!1);gt=function(){var n={};return
n.Powerpoint="ppt",n.Word="doc",n.Excel="xls",n}()})(i=t.IndexerQueryGenerator||
(t.IndexerQueryGenerator={}))})(t=n.WSB||(n.WSB={}))}(AutoSuggest||
(AutoSuggest={})),function(n){var t;(function(t){function a(n,i,r,u,f,e,o){var s=u?
r+" "+i:r;return t.Promise.safeChainWithGlobalCaching("getIcon",function(i){return
n.getImageAsync(t.getImageSizeValue(i))},function(n){return n+"_"+i},function(n)
{return t.toIcon(n,"getIcon",e,o,s)},e,f?function(){return
n.imageType===0}:null,s)}function r(n,i,r,u,f,e)
{return{deviceItem:n,getIcon:a(n,n.id,r,r&&!
t.localDataSourceMayContainPII(r),t.displayedInGridLayout(i),u,f),icon:e?
u:null,suggestionType:i}}function s(n,t,i)
{return{deviceItem:n,icon:i,suggestionType:t}}function lt(n){return
n.map(function(n){return{isSimulated:!
0,displayName:n,id:null,kind:null,getProperty:null,propertyHits:null,rankScore:null
}})}function at(){var r=n.getCurrentTime();return
i.deviceSearch.getAllAppsAsync().then(function(i){var u=[],o,f,s,e;for(o in
i)f=i[o],(t.config.allowZeroLaunchTopApps||f.totalLaunches>0)&&!
n.contains(ct,f.id)&&u.push(f);return
t.config.minTopApps&&u.length<t.config.minTopApps?[]:
(t.config.hideTopAppsOlderThanDays&&(s=t.config.hideTopAppsOlderThanDays*864e5,u=u.
filter(function(n){return r-
+n.lastAccessed<s})),e=[],t.config.numberOfTopRecentApps&&(u.sort(function(n,t)
{return+t.lastAccessed-
+n.lastAccessed}),e=u.splice(0,t.config.numberOfTopRecentApps)),u.sort(function(n,t
){return t.totalLaunches-n.totalLaunches}),e.concat(u))})}function u(t,i,r)
{switch(t){case"program":return"IBA";case"picture":return
i&&n.contains(v,i.toLowerCase())?"FL":"LI";case"video":return
i&&n.contains(y,i.toLowerCase())?"FL":"LV";case"movie":case"recordedtv":return"LV";
case"music":return"MU";case"folder":return"FD";default:return r}}function
c(i,r,u,f,e,o,s,h,c,l){var v=l&&s&&c?i.filter(function(t){return
n.contains(Object.keys(tt),t)}):[],a;v.length>0&&(i=i.filter(function(t){return!
n.contains(v,t)}));a=function(n){for(var i,f,t=0,u=v;t<u.length;t+
+)i=u[t],f=tt[i],n[i]={deviceItem:
{id:i,displayName:l.getLocString(f.locStringKey),kind:null,getProperty:function()
{return null},propertyHits:
[],rankScore:1e3},icon:f.icon};r(n)};n.safeExecute(function(){var
r,n,c,l,v;if(i.length==0)a({});else{if(r={},n=i.slice(0),h)for(c=i.length-1;c>=0;--
c)l=i[c],h.hasOwnProperty(l)&&(r[l]=h[l],n.splice(c,1));n.length==0?a(r):(v=!s||
t.localDataSourceMayContainPII(s)?s:s+" "+n,t.Promise.safeChain(u,function(){return
f(n)},function(u){var o=t.Map.map(n,u,function(n){return
e(n)}),f;if(h&&n.forEach(function(n){return h[n]=o[n]}),n.length!=i.length)for(f in
r)r.hasOwnProperty(f)&&(o[f]=r[f]);a(o)},function(){return
a({})},o,v))}},"resolveIdsWithCache",null,s,function(){return a({})})}function
wt(n,t){if(!t.launchArguments||pt.test(n.query))return!0;var
i=t.id.toLowerCase();return it.some(function(n){return i.includes(n)})?!0:!
1}function rt(n,i,r,u,f){if(!f)return!1;var
o=n.displayName.toLocaleLowerCase(),e=i.queryToFetch.toLocaleLowerCase(),s=null;if(
f.Parses&&f.Parses.length>0&&f.Parses[0].SubParses&&f.Parses[0].SubParses.length>1&
&f.Parses[0].SubParses[0].Interpretation&&f.Parses[0].SubParses[0].Interpretation==
="regex"&&e.length>=f.Parses[0].SubParses[0].QueryEnd&&f.Query!=null)
{if(e.length===f.Parses[0].SubParses[0].QueryEnd)return!
0;e=e.substr(f.Parses[0].SubParses[0].QueryEnd+1);f.Query=f.Query.substr(f.Parses[0
].SubParses[0].QueryEnd+1)}return
e.length<t.config.filterCICandidatesPrefixLength&&!
ut(e,o)&&(s=t.matchesOnPropertyHH(o,e),!s)?!0:gt(o,e,n,r,u,f)?!0:!1}function
gt(n,i,r,u,f,e){var o,s;return!i||!e||!e.MatchScore||!e.Parses||
e.Parses.length==0||!e.Parses[0].Entities||e.Parses[0].Entities.length==0||!
e.Query?!1:n.startsWith(i)&&i.length>=t.config.filterCICandidatesPrefixLength?!1:
(o=e.Query,o.startsWith(i))?!1:(s=n.startsWith(o),!s)?!
0:f.Counter>=t.config.maxCISpellCorrectionCandidates?!0:(f.Counter++,!1)}function
ut(n,t){var r,i;if(!!t&&t.length==0||(r=t.split(" "),n.length!=r.length))return!
1;for(i=0;i<r.length;i++)if(r[i].length==0||r[i][0]!=n[i])return!1;return!
0}function ft(n){var i=n.id.toLowerCase(),t;if(i.startsWith("http:")||
i.startsWith("https:")||n.kind=="link"&&i.endsWith(".url"))return
1;if(i.startsWith("file:")||n.kind=="document")return
0;if(t=n.filePath,t&&(t=t.toLowerCase(),t!=i)){if(t.startsWith("http:")||
t.startsWith("https:")||n.kind=="link"&&t.endsWith(".url"))return
1;if(t.startsWith("file:"))return 0}return 2}function et(n,t)
{if(t.dataSource=="PP"){var
i=ft(n);if(i==1)return"LURL";if(i==0)return"LDOC"}return
t.getSuggestionType(n)}function ot(t){return t&&t.rawIndexResponse?
n.safeExecute(function(){return
JSON.parse(t.rawIndexResponse)},"parseConstraintIndexMetaData"):undefined}function
st(i,r,u,f,e,o){var
g,v,h,b,y,k,d,l,s,p,a,c;if(t.IndexerQueryGenerator&&t.IndexerQueryGenerator.suppres
s(r,i,f))return!0;if(t.isMobileCache)return!
1;if(u=="PP")return(g=r.id,n.contains(bt,g))?!0:(v=r,rt(v,i,!0,e,o))?!0:
(h=r.kind,h&&(h=h.toLocaleLowerCase(),h!="program"&&h!="unknown"))?!
0:f=="LRA"&&ft(v)!=2?!0:(b=v.extension,b&&b.toLowerCase()==".chm")?!0:!1;if(u!
="LURL"&&r.kind=="link"&&t.RuntimeConfig.QfMode!=5)return!
0;if(t.isSetting(u))return rt(r,i,!1,e,o)?!0:!
1;if(u=="EBH")return(y=r,k=y.url,n.olderThan2Weeks(y.dateVisited)||
n.isBingSearchUrl(k))?!0:i.queryToFetch?i.isMultiWord?!1:n.getProtocol(i.fixedUrl||
i.queryToFetch)==0&&n.contains(y.propertyHits,"System.Title")?!1:
(d={},n.computeUrlMatchLengths(d,k,i.queryToFetch),!d.domainMatchLength):!
1;if(t.isItemWithFileMetadata(u)){if((l=r,!
t.IndexerQueryGenerator&&f=="MDOC"&&l.propertyHits.length==1&&l.propertyHits[0]=="S
ystem.Search.Contents"&&(!t.config.minLengthForContentMatch||
i.queryToFetch.length<t.config.minLengthForContentMatch))||
(s=l.id,s&&(t.RuntimeConfig.QfMode!=5&&(s.includes("\\.")||s.includes("/."))||
(s=s.toLowerCase(),i.queryToFetch.toLocaleLowerCase()!
=r.displayName.toLocaleLowerCase()&&dt.some(function(n){return
s.includes("\\"+n+"\\")||s.includes("/"+n+"/")}))))||
(p=l.extension,p&&t.RuntimeConfig.QfMode!=5&&!
i.queryToFetch.toLowerCase().includes(p.toLowerCase())&&n.contains(kt,p.toLowerCase
())))return!0;if(u=="CG"){if(a=r,c=a.displayName.split(" ")
[0].toLowerCase(),c.includes("\\")||c.indexOf(":")==1)return!1;var
w=a.id.toLowerCase(),nt=w.lastIndexOf("."),tt=w.lastIndexOf("\\"),ut=a.kind=="folde
r"||nt<0||nt<tt;if(ut&&!c.includes("%")||![".exe",".com"].some(function(n){return
c.includes(n)})&&(vt.some(function(n){return w.includes(n)})||!
a.launchArguments&&it.some(function(n){return w.includes(n)})||
n.contains(yt,c)))return!0}return!1}return!1}var
h=SearchAppWrapper.CortanaApp,i=SearchAppWrapper.CortanaApp.queryFormulationView,l=
":wux:",ct=["Microsoft.XboxGamingOverlay_8wekyb3d8bbwe!
App"],v,y,ht,o;t.getIcon=a;v=[".dwg",".ai",".psd"];y=[".ts"];t.getSuggestionTypeFro
mKindAndExtension=u;var p={getResultsContainer:function(n){return
n.apps},dataSource:"PP",getSuggestionType:function()
{return"PP"},maxUpTo3chars:4,maxAfter3chars:7,maxAfter8charsOrInL2ZeroInput:15,cust
omCreateLocalResponseSuggestion:function(n,i,u){return
r(n,i,u,t.ScopeConfig[t.Scope.Apps].icon,n.isImmersive?
n.logoBackgroundColor:undefined)},supportsEmptyQuery:!
0},w={getResultsContainer:function(n){return
n.settings},dataSource:"ST",getSuggestionType:function()
{return"ST"},maxUpTo3chars:4,maxAfter3chars:7,maxAfter8charsOrInL2ZeroInput:15,cust
omCreateLocalResponseSuggestion:function(n,i,u){if(t.isModernSetting(n)){var
f=n.glyph,e=f?{content:f,type:1}:t.ScopeConfig[t.Scope.Settings].icon;return
s(n,i,e)}return r(n,i,u,t.ScopeConfig[t.Scope.Settings].icon)},supportsEmptyQuery:!
1},b=[p,w,{getResultsContainer:function(n){return
n.media},dataSource:"LM",getSuggestionType:function(n){return
u(n.kind,n.extension,"FL")},maxUpTo3chars:7,maxAfter3chars:10,maxAfter8charsOrInL2Z
eroInput:20,supportsEmptyQuery:!0},{getResultsContainer:function(n){return
n.files},dataSource:"FL",getSuggestionType:function(n){return
u(n.kind,n.extension,"FL")},maxUpTo3chars:7,maxAfter3chars:10,maxAfter8charsOrInL2Z
eroInput:20,supportsEmptyQuery:!0},{getResultsContainer:function(n){return
n.powerBi},dataSource:"PBI",getSuggestionType:function()
{return"PBI"},maxUpTo3chars:4,maxAfter3chars:7,maxAfter8charsOrInL2ZeroInput:15,cus
tomCreateLocalResponseSuggestion:function(n,t){return s(n,t,
{content:"&#xEA1E",type:2})},supportsEmptyQuery:!1},
{getResultsContainer:function(n){return
n.browsingHistory},dataSource:"EBH",getSuggestionType:function()
{return"EBH"},maxUpTo3chars:4,maxAfter3chars:7,maxAfter8charsOrInL2ZeroInput:15,cus
tomCreateLocalResponseSuggestion:function(n,t){return
s(n,t,null)},supportsEmptyQuery:!0},{getResultsContainer:function(){throw
Error("Only supported via
IndexerQuery");},dataSource:"IBA",getSuggestionType:function()
{return"IBA"},maxUpTo3chars:4,maxAfter3chars:7,maxAfter8charsOrInL2ZeroInput:15,cus
tomCreateLocalResponseSuggestion:function(n,i,u){return
r(n,i,u,t.ScopeConfig[t.Scope.Apps].icon)},supportsEmptyQuery:!1},
{getResultsContainer:function(){throw Error("Only supported via
IndexerQuery");},dataSource:"IFF",getSuggestionType:function(n){return
u(n.kind,n.extension,"FL")},maxUpTo3chars:7,maxAfter3chars:15,maxAfter8charsOrInL2Z
eroInput:25,supportsEmptyQuery:!0},],k=[{getResultsContainer:function(n){return
n.files},dataSource:"MDOC",getSuggestionType:function(n){return
u(n.kind,n.extension,"FL")},maxUpTo3chars:4,maxAfter3chars:7,maxAfter8charsOrInL2Ze
roInput:15,customCreateLocalResponseSuggestion:function(n,i,u){return
r(n,i,u,t.ScopeConfig[t.Scope.Documents].icon,null,!0)},supportsEmptyQuery:!1},
{getResultsContainer:function(n){return
n.folders},dataSource:"MFOL",getSuggestionType:function(n){return
u(n.kind,n.extension,"FD")},maxUpTo3chars:4,maxAfter3chars:7,maxAfter8charsOrInL2Ze
roInput:15,customCreateLocalResponseSuggestion:function(n,i,u){return
r(n,i,u,t.ScopeConfig[t.Scope.Folders].icon,null,!0)},supportsEmptyQuery:!1},
{getResultsContainer:function(n){return
n.pictures},dataSource:"MPHO",getSuggestionType:function(n){return
u(n.kind,n.extension,"LI")},maxUpTo3chars:4,maxAfter3chars:7,maxAfter8charsOrInL2Ze
roInput:15,customCreateLocalResponseSuggestion:function(n,i,u){return
r(n,i,u,t.ScopeConfig[t.Scope.Photos].icon,null,!0)},supportsEmptyQuery:!1},
{getResultsContainer:function(n){return
n.video},dataSource:"MVID",getSuggestionType:function(n){return
u(n.kind,n.extension,"LV")},maxUpTo3chars:4,maxAfter3chars:7,maxAfter8charsOrInL2Ze
roInput:15,customCreateLocalResponseSuggestion:function(n,i,u){return
r(n,i,u,t.ScopeConfig[t.Scope.Videos].icon,null,!0)},supportsEmptyQuery:!1},
{getResultsContainer:function(n){return
n.music},dataSource:"MMUS",getSuggestionType:function()
{return"MU"},maxUpTo3chars:4,maxAfter3chars:7,maxAfter8charsOrInL2ZeroInput:15,cust
omCreateLocalResponseSuggestion:function(n,i,u){return
r(n,i,u,t.ScopeConfig[t.Scope.Music].icon,null,!0)},supportsEmptyQuery:!
1},],d=[{getResultsContainer:function(n){return
i.startPathCompletionQuery(n.originalQuery,"")},dataSource:"PT",getSuggestionType:f
unction()
{return"PT"},maxUpTo3chars:15,maxAfter3chars:15,maxAfter8charsOrInL2ZeroInput:15,cu
stomCancellation:function(){return
i.cancelLastPathCompletionQuery()},supportsEmptyQuery:!1},
{getResultsContainer:function(){return
i.deviceSearch.getRecentAppsAsync()},getResults:function(n){return
n},dataSource:"LRA",getSuggestionType:function()
{return"PP"},customCreateLocalResponseSuggestion:function(n,i,u){return
r(n,i,u,t.ScopeConfig[t.Scope.Apps].icon,n.isImmersive?
n.logoBackgroundColor:undefined)},supportsEmptyQuery:!0},
{getResultsContainer:function(n){return
ThresholdUtilities.createPromise(function(i){var
r=h.fileExplorerSuggestionPage.recentSearches,u,f,e;n.queryToFetch&&(u=t.escapeRegE
xp(n.queryToFetch),f=u.split(" ").map(function(n){return new RegExp("^"+n+"|
"+n,"i")}),r=r.filter(function(n){return f.every(function(t){return
t.test(n)})}));e=lt(r);i(e)})},getResults:function(n){return
n},dataSource:"FEH",getSuggestionType:function()
{return"FEH"},customCreateLocalResponseSuggestion:function(n,t){return s(n,t,
{type:2,content:"&#xE81C"})},supportsEmptyQuery:!0},{getResultsContainer:function()
{return i.deviceSearch.getAllAppsAsync()},getResults:function(n){return
n},dataSource:"SM",getSuggestionType:function()
{return"SM"},customCreateLocalResponseSuggestion:function(n,i,u){return
r(n,i,u,t.ScopeConfig[t.Scope.Apps].icon,n.logoBackgroundColor)},supportsEmptyQuery
:!0},{getResultsContainer:function(){return at()},getResults:function(n,t){return
n.then(function(n){return t?
n.slice(0,t):n})},dataSource:"TOPP",getSuggestionType:function()
{return"TOPL"},customGetMax:function(){return
5},customCreateLocalResponseSuggestion:function(n,i,u){return
r(n,i,u,t.ScopeConfig[t.Scope.Apps].icon,t.config.backplateAllIconsInZI||
n.isImmersive?n.logoBackgroundColor:undefined)},supportsEmptyQuery:!0},
{getResultsContainer:function(n){return
ThresholdUtilities.createPromise(function(t){var
i=e.retrieveItemsFromCache(n.queryToFetch);t(i)})},getResults:function(n){return
n},dataSource:"LDIC",getSuggestionType:function(n){return
u(n.kind,n.extension,"FD")},maxUpTo3chars:4,maxAfter3chars:7,maxAfter8charsOrInL2Ze
roInput:15,supportsEmptyQuery:!1},],g=[{getResultsContainer:function(n){return
i.startCommandLineQuery(n.originalQuery,"")},dataSource:"CG",getSuggestionType:func
tion(){return"CG"},customCancellation:function(){return
i.cancelLastCommandLineQuery()},supportsEmptyQuery:!
1},];t.LocalDataProviderDataSources=b.concat(k).concat(d).concat(g).map(f
unction(n){return n.dataSource});var f={suggestions:[],maxedOut:!
1},nt={},e,tt={"shell:RecycleBinFolder":{icon:
{content:"&#xEF87",type:2},locStringKey:"RecycleBin"}};var
vt=["\\system32\\user.exe","\\system32\\sidebar.exe","\\system32\\at.exe","\\system
32\\change.exe","\\system32\\control.exe","\\system32\\find.exe","\\system32\\net.e
xe","\\system32\\share.exe","\\system32\\rundll32.exe","\\system32\\append.exe","\\
system32\\choice.exe","\\system32\\clip.exe","\\system32\\comp.exe","\\system32\\co
mpact.exe","\\system32\\consent.exe","\\system32\\convert.exe","\\system32\\format.
exe","\\system32\\graphics.com","\\system32\\label.exe","\\system32\\mem.exe","\\sy
stem32\\mode.com","\\system32\\more.com","\\system32\\recover.exe","\\system32\\rep
lace.exe","\\system32\\reset.exe","\\system32\\shadow.exe","\\system32\\sort.exe","
\\system32\\tree.com","\\system32\\webcam.exe","\\system32\\systemsettings.exe","\\
system32\\command.com","\\system32\\tabtip.exe","\\system32\\services.exe","\\syste
m32\\help.exe","\\system32\\where.exe","\\system32\\skydrive.exe","\\system32\\calc
.exe","\\system32\\fc.exe","\\accessories\\wordpad.exe",t.config.blacklistNotepadCo
mmand?"\\system32\\notepad.exe":null,].filter(function(n){return!!
n}),it=["\\system32\\finger.exe","\\system32\\ping.exe","\\system32\\print.exe","\\
system32\\shutdown.exe","\\system32\\expand.exe","\\system32\\tskill.exe","\\system
32\\reg.exe","\\system32\\sc.exe",],yt=["uninstall","outlook","excel","skype","nero
","onenote","lync","vmware","firefox","itunes","photoshop","print","opera","visio",
"thunderbird","smartscreen"],pt=/[\/\.\-\\]/;t.isRealCommand=wt;var
bt=["Microsoft.Cortana_8wekyb3d8bbwe!
CortanaUI","Microsoft.Windows.Cortana_cw5n1h2txyewy!
CortanaUI",],kt=[".dll",".pdb",".obj",".bin",".etl",".bak",".config",".resx",".mani
fest",".ini",".searchconnector-ms",".settingcontent-ms",".vstx",".vssx",".ms-one-
stub",],dt=["visio
content","bin","debug","obj","objd","amd64","x86","microsoftedgebackups",];t.isInit
ials=ut;t.getSuggestionTypeOverride=et;t.parseConstraintIndexMetaData=ot;t.isSuppre
ssed=st;ht=function(){function s(n,t,i){var
r=this;this._previousKeystrokeCache=n;this._host=i;t&&(e=t,i.bindShown(function()
{e.clean();r.cacheDeviceItems()}));i.bindAppHidden(function(){nt={}})}return
s.prototype.getName=function()
{return"LocalDataProvider"},s.prototype.fetch=function(r,u,f,e,s){var
ut=this,l,a,ft,y,et,c,p,w,ot,nt,ct,lt,tt,st,it,at,vt,rt,ht,v;if(e&&e.register(funct
ion(){return t.Promise.clearPendingItemsFromCache()},!
1,"clearPendingItemsFromCache"),l=[],a=b.filter(function(t){return
n.isDataSourceEnabled(t.dataSource,r)}),t.IndexerQueryGenerator&&(l=l.concat(a.filt
er(function(n){return
t.IndexerQueryGenerator.dataSourceSupported(n.dataSource)})),a=a.filter(function(n)
{return!t.IndexerQueryGenerator.dataSourceSupported(n.dataSource)})),a.length>0)
{if(!r.queryToFetch&&!a.every(function(n){return n.supportsEmptyQuery}))throw new
Error(o);if(e&&e.register(function(){return i.cancelLastDeviceQuery()},!
1,"cancelLastDeviceQuery"),ft=n.safeExecute(function(){return
i.startDeviceQuery(r.queryToFetch)},"startDeviceQuery",null,r.queryToFetch),ft)for(
y=0,et=a;y<et.length;y+
+)v=et[y],this.searchFolderWithMultipleResults(r,v,ft,u,s,e);else
this.emptyFetch(a,u)}if(c=k.filter(function(t){return
n.isDataSourceEnabled(t.dataSource,r)}),t.IndexerQueryGenerator&&(l=l.concat(c.filt
er(function(n){return
t.IndexerQueryGenerator.dataSourceSupported(n.dataSource)})),c=c.filter(function(n)
{return!t.IndexerQueryGenerator.dataSourceSupported(n.dataSource)})),c.length>0)
{if(!r.queryToFetch&&!c.every(function(n){return n.supportsEmptyQuery}))throw new
Error(o);p=r.taskFrame?
r.taskFrame.raw:"";t.Promise.safeChain("executeSearchAsync",function(){return
h.searchResultsView.executeSearchAsync(r.queryToFetch,p)},function(n){var
t,i,f;if(s())if(n)for(t=0,i=c;t<i.length;t+
+)f=i[t],ut.searchFolderWithMultipleResults(r,f,n,u,s,e);else
ut.emptyFetch(c,u)},function(){return ut.emptyFetch(c,u)},null,p?
r.queryToFetch+"\n"+p:r.queryToFetch)}if(l.length>0){if(!r.queryToFetch&&!
l.every(function(n){return n.supportsEmptyQuery}))throw new
Error(o);for(w=0,ot=l;w<ot.length;w+
+)v=ot[w],this.searchFolderWithMultipleResults(r,v,null,u,s,e)}if(nt=d.filter(funct
ion(t){return n.isDataSourceEnabled(t.dataSource,r)}),nt.length>0){if(!
r.queryToFetch&&!nt.every(function(n){return n.supportsEmptyQuery}))throw new
Error(o);for(ct=function(n){e&&n.customCancellation&&e.register(function(){return
n.customCancellation()},!0,n.dataSource+"
cancellation");lt.searchFolderWithMultipleResults(r,n,r,u,s,e)},lt=this,tt=0,st=nt;
tt<st.length;tt++)v=st[tt],ct(v)}if(it=g.filter(function(t){return
n.isDataSourceEnabled(t.dataSource,r)}),it.length>0){if(!r.queryToFetch&&!
it.every(function(n){return n.supportsEmptyQuery}))throw new
Error(o);for(at=function(n){e&&n.customCancellation&&e.register(function(){return
n.customCancellation()},!0,n.dataSource+"
cancellation");vt.searchFolderWithSingleResult(r,n,r,u,s)},vt=this,rt=0,ht=it;rt<ht
.length;rt++)v=ht[rt],at(v)}r.taskFrame&&n.safeExecute(function(){return
h.searchResultsView.setTaskFrame(r.originalQuery,"")},"reset task
frame")},s.prototype.emptyFetch=function(n,t){for(var u,i=0,r=n;i<r.length;i+
+)u=r[i],this.logProviderFailure(u.dataSource),t(u.dataSource,f,s.getDataSourceStat
e(0))},s.prototype.getMax=function(n,i){return i.customGetMax?
i.customGetMax(n):t.RuntimeConfig.QfMode==5||n.scope!=t.Scope.All?n.queryToFetch?
i.maxAfter8charsOrInL2ZeroInput*2:i.maxAfter8charsOrInL2ZeroInput:n.queryToFetch.le
ngth>8?i.maxAfter8charsOrInL2ZeroInput:n.queryToFetch.length>3?
i.maxAfter3chars:i.maxUpTo3chars},s.prototype.toLocalResponse=function(n,i,u,f,e)
{var y,p,a,w,o,v;e&&(p=f,p.getGroupDisplayName&&(y=p.getGroupDisplayName(e)));var
k={Counter:0},b=[],d=u.length<n;for(a=0,w=u;a<w.length;a++){var
h=w[a],c=et(h,f),s=t.isApp(c)||t.isSetting(c)?
ot(h):undefined;st(i,h,c,f.dataSource,k,s)||(o=void
0,o=f.customCreateLocalResponseSuggestion?
f.customCreateLocalResponseSuggestion(h,c,f.dataSource):r(h,c,f.dataSource),y&&(o.g
roupDisplayName=y),s&&(o.ciMetaData=s,s.Query&&s.Query.includes(l)&&(v=s.Query.spli
t(l),v.length==2&&(o.uxHint=v[1],o.ciMetaData.Query=v[0]))),b.push(o))}return{sugge
stions:b,maxedOut:d}},s.prototype.getResults=function(n,t,i,r)
{if(r.getResults)return r.getResults(i,t);var
u=i,f=this.enableSpellCorrection(n);return u.getItemsAsyncWithSpeller?
u.getItemsAsyncWithSpeller(0,t,f):i.getItemsAsync(0,t)},s.prototype.enableSpellCorr
ection=function(n){return
n.queryToFetch.length>=t.config.enableCISpellerAtPrefixLength&&this._previousKeystr
okeCache&&this._previousKeystrokeCache.enableCISpeller(n.queryToFetch)?!
0:n.queryToFetch.length>=t.config.enableCISpellerAtPrefixLength&&t.config.enableCIS
peller==1?!0:!1},s.prototype.searchFolderWithMultipleResults=function(r,u,e,o,h,c)
{var p=this,l=u.dataSource,w=this.getMax(r,u),a=!e,b,v,y;if(a)
{if(t.RuntimeConfig.QfMode==5&&(y=this._host.getFileExplorerCurrentPath()),y&&!/^[a
-zA-Z]\:\\/.test(y)){o(l,f,null,null,!0);return}b=function(){return
t.IndexerQueryGenerator.generateIndexerQueryAsync(r,y,w,l).then(function(n){return
i.deviceSearch.queryWindowsSearchIndexerAsync(n)})}}else{if(v=n.safeExecute(functio
n(){return u.getResultsContainer(e)},"getResultsContainer "+l),!v)
{o(l,f,null);return}b=function(){return
p.getResults(r,w,v,u)}}t.Promise.safeChain(a?"queryWindowsSearchIndexerAsync":"getI
temsAsync",b,function(n){var i,f,e;h()&&(i=n.resultSet,f=void 0,i?
f=n.state:i=typeof n.length=="undefined"?Object.keys(n).map(function(t){return
n[t]}):n,a&&(l=="EBH"?i=i.map(function(n){return
t.IndexerQueryGenerator.toBrowsingHistoryItem(n)}):t.supportsShortcuts(l,r)&&(i=i.m
ap(function(n){return
t.IndexerQueryGenerator.fixKind(n)}))),e=s.getDataSourceState(f),o(l,p.toLocalRespo
nse(w,r,i,u,v),e))},function(t){n.isCancellation(t)||
p.logProviderFailure(l);o(l,f,null)},a?c:null,l+"
"+r.queryToFetch)},s.prototype.searchFolderWithSingleResult=function(i,r,u,e,o){var
h=this,s=r.dataSource,c=n.safeExecute(function(){return
r.getResultsContainer(u)},"getResultsContainer "+s);c?
t.Promise.safeChain("tryGetResultAsync "+s,function(){return
c.tryGetResultAsync()},function(n){o()&&e(s,h.toLocalResponse(1,i,n?[n]:
[],r,null),null)},function(t){n.isCancellation(t)||
h.logProviderFailure(s);e(s,f,null)},null,i.queryToFetch):e(s,f,null)},s.prototype.
logProviderFailure=function(r){var
u=t.providerFailureLogName(r);u&&i.logProviderFailure&&n.safeExecute(function()
{return
i.logProviderFailure(u,"ErrorForTopHit")},"logProviderFailure")},s.prototype.cacheD
eviceItems=function(){var n="LDIC",r=function(){var
r=t.IndexerQueryGenerator.generateIndexerQueryForDeviceItemCache(n);return
i.deviceSearch.queryWindowsSearchIndexerAsync(r)};e.setReady(!
1);t.Promise.safeChain("initializeDeviceItemCacheAsync",r,function(n){for(var
r,t=0,i=n.resultSet;t<i.length;t++)r=i[t],e.addItemToCache(r);e.setReady(!
0)})},s.getDataSourceState=function(n){switch(n){case 0:return"UN";case
1:return"NI";case 2:return"PI"}return undefined},s.getApps=function(n,t,r,u,f)
{c(n,t,"findAppsAsync",function(n){return
i.deviceSearch.findAppsAsync(n)},function(n){return
p.customCreateLocalResponseSuggestion(n,null,u)},r,u,null,!
0,f)},s.getSettings=function(n,t,r,u){c(n,t,"findSettingsAsync",function(n){return
i.deviceSearch.findSettingsAsync(n)},function(n){return
w.customCreateLocalResponseSuggestion(n,null,u)},r,u,null)},s.getFiles=function(n,f
,e,o,s){c(n,f,"findFilesAsync",function(n){if(t.IndexerQueryGenerator){var
r=t.IndexerQueryGenerator.generateIndexerQueryForMRUFilesAndFolders(e,"MFF",n);retu
rn i.deviceSearch.queryWindowsSearchIndexerAsync(r).then(function(n){for(var
i,r={},t=0,u=n.resultSet;t<u.length;t++)i=u[t],r[i.id]=i;return r})}return
i.deviceSearch.findFilesAsync(n)},function(n){return
r(n,u(n.kind,n.extension,"FL"),s)},o,s,nt)},s.launchIndexingOptions=function(n,i)
{var r=this;s.getSettings([t.IndexingOptionsSettingId],function(u){var
f=u[t.IndexingOptionsSettingId];f?n.launchDeviceItem(f.deviceItem,"ST"):i||
r.launchIndexingOptions(n,!0)},null,null,!0)},s}();t.LocalDataProvider=ht;o="Local
provider doesn't support empty query"})(t=n.WSB||(n.WSB={}))}(AutoSuggest||
(AutoSuggest={})),function(n){var t;(function(t){var
i,u="UpsellDismissed",f="moreButton",r="feedbackButton",e="optionsButton",o="reward
sBadgeButton",s="userProfileButton",h=function(){function h(n,h,c,l,a,v,y,p,w){var
b=this;
(this._host=n,this._page=h,this._accessTokenManager=c,this._msRewardsViewModel=l,th
is._menuFactory=a,this._substrateProfilePictureProvider=v,this._instHelper=y,this._
sequenceNumberReader=p,this._moreButton={id:f,selected:!
1,text:null},this._feedbackButton={id:r,selected:!
1,text:null},this._optionsButton={id:e,selected:!
1,text:null},this._rewardsBadgeButton={id:o,selected:!
1,text:null},this._userProfileButton={id:s,selected:!
1,text:null},this._topHitPresent=!1,this._resultsPresent=!
1,this._currentScopeTileIndex=-1,this._moreMenuOpened=!1,this._optionsMenuOpened=!
1,this._lockscreenMenuOpened=!1,this._userProfileMenuOpened=!
1,this._advancedOptionsIdCounter=0,this._advancedOptionsScope=[],this._userProfiles
Cache={},this._upsellGotDismissed=w.getItem(u)=="1",i=SearchAppWrapper.CortanaApp,t
his._scopesHeaderElement=_ge("scopesHeader"),t.config.scopesOrderBegin.length!
=0)&&(n.bindAppHidden(function()
{b._scopeTiles=null;b._effectiveScopeOrder=null}),t.config.renderScopeBarOnAppShown
&&n.bindShown(function()
{b._currentQuery=b._host.getQuery();b.selectScope(b._currentQuery.scope);b.renderSc
opes(!0)}),n.bindQueryChangedOrInitialized(function(n)
{b._currentQuery=n}),n.bindDismissed(function(){b._currentScopeTileIndex=-
1}),n.bindQueryChangedOrInitialized(function(){b._currentScopeTileIndex=-
1}),n.bindButtonRightOfSearchBoxClick(function(i){(i==""||i==""||
t.RuntimeConfig.QfMode==2)&&(n.reformulate(""),b.setFocusInSearchBox("clear search
box"),y.logClientInstEvent("Select","ClearSearchBox",null))}),n.bindScopeListRequir
esUpdate(function(){b.init();b._currentQuery&&b.renderScopes(!
0)}),n.bindOnFeedbackClosing(function(n){!
n&&t.RuntimeConfig.AlwaysWide&&_ge(r).focus()}),this._substrateUpsellDismiss={actio
n:function(){b._upsellGotDismissed=!
0;w.setItem(u,"1");n.refreshCurrentPane()},icon:
{content:"&#xE711",type:2}},l&&l.bindRewardsBadgeUpdated(function()
{b._currentQuery&&b.renderScopes(!0)}))}return
h.prototype.focusNextScopeTile=function(n,i){var
r=[].slice.call(this._scopesHeaderElement.getElementsByClassName("scopeTile")),u=t.
shouldSkipSelectedScope()?r.filter(function(n){return!
n.classList.contains("selectedScope")}):r;this._currentScopeTileIndex=u.indexOf(n);
i?this._currentScopeTileIndex!=u.length-1&&+
+this._currentScopeTileIndex:this._currentScopeTileIndex>0&&--
this._currentScopeTileIndex;t.shouldSkipSelectedScope()&&(this._currentScopeTileInd
ex=r.indexOf(u[this._currentScopeTileIndex]));this._menuFactory.dismiss();r[this._c
urrentScopeTileIndex].focus()},h.prototype.render=function(n,i,r,u,f)
{if(t.config.renderScopeBarOnAppShown||(this._currentQuery=n),n){var
e=t.getEffectiveScope(n);this.innerRender(n.scope,e,n,i,r,u,f)}else
this.cleanUp()},h.prototype.getScopeToolTip=function(n,i){var
u=t.ScopeConfig[n],f=t.getScopeDisplayName(u,this._host),r;return r=i&&!
this._allScopeButtonPresent?"RemovingScopeNarratorText2":n==t.Scope.All?"AddingScop
eNarratorTextAll2":"AddingScopeNarratorText",this._host.getLocString(r,f.toLocaleLo
werCase())},h.prototype.selectScope=function(n){var
i,r,t;for(this._selectedScope&&(this._selectedScope.tooltip=this.getScopeToolTip(th
is._selectedScope.type,!1),this._selectedScope.enabled=!
1,this._selectedScope=null),i=0,r=this._scopeTiles;i<r.length;i+
+)if(t=r[i],t.enabled=t.type==n,t.enabled){t.tooltip=this.getScopeToolTip(n,!
0);this._selectedScope=t;break}},h.prototype.innerRender=function(n,i,r,u,f,e,o)
{this._topHitPresent=u;this._resultsPresent=f;this.renderTopHitHeader(n,i,r,f,e,o);
t.RuntimeConfig.ScopesAvailable&&(this._scopeTiles||
this.init(),this._scopeTiles&&(!this._selectedScope||this._selectedScope.type!
=n)&&this.selectScope(n),this.renderScopes(!
0))},h.prototype.renderTopHitHeader=function(n,i,r,u,f,e){var
o=t.ScopeConfig[i],l=r.showProgressBar?e:!f,a=!r||!
r.queryToFetch,v=this.getEmptyResultsMessage(u,l,a,i,o),s=v[0],h=v[1],c=l||a||u||!
this._lastRenderedTopHitHeader||t.uses3lineTemplate(i)?
this.getHeaderText(i,o):this._lastRenderedTopHitHeader.headerText,y;
(this._advancedOptionsScope=t.RuntimeConfig.ScopesAvailable&&o.showUpsellOnSuggesti
onsList&&o.showUpsellOnSuggestionsList()?
this.getAdvancedOptions(this._sequenceNumberReader.getSequenceNumber(),0):
[],t.RuntimeConfig.AlwaysWide&&(this._advancedOptionsScope=this._advancedOptionsSco
pe.concat(this.getAdvancedOptions(this._sequenceNumberReader.getSequenceNumber(),1)
)),this._lastRenderedTopHitHeader&&this._lastRenderedTopHitHeader.scope==n&&this._l
astRenderedTopHitHeader.message==s&&this._lastRenderedTopHitHeader.subMessage==h&&t
his._lastRenderedTopHitHeader.headerText==c&&this._lastRenderedTopHitHeader.advance
dOptions==this._advancedOptionsScope)||
(this._lastRenderedTopHitHeader={scope:n,headerText:c,message:s,subMessage:h,advanc
edOptions:this._advancedOptionsScope,scopeForDisplay:i},y={headerText:c,message:s,s
ubMessage:h,messageIcon:s?
o.icon:null,advancedOptions:this._advancedOptionsScope},this._page.updateTopHitHead
erView(y))},h.prototype.updateTopHitHeader=function()
{if(this._lastRenderedTopHitHeader){var
n=t.ScopeConfig[this._lastRenderedTopHitHeader.scopeForDisplay],i={headerText:this.
_lastRenderedTopHitHeader.headerText,message:this._lastRenderedTopHitHeader.message
,subMessage:this._lastRenderedTopHitHeader.subMessage,messageIcon:this._lastRendere
dTopHitHeader.message?
n.icon:null,advancedOptions:this._advancedOptionsScope};this._page.updateTopHitHead
erView(i)}},h.prototype.renderScopes=function(n){var i=this,r;if(n){var
u=this.getScopeBarElements(),f=this.getHiddenScopeElements(u)||
[],e=t.config.userProfileButtonEnabled?this.getUserProfileButtonData():
[null,null],o=e[0],s=e[1];r={scopes:u,showFeedback:this.isFeedbackEnabled()?
function(){return
i.showFeedback()}:null,rewardsBadgeDataModel:this._msRewardsViewModel&&this._msRewa
rdsViewModel.getDataModel(),moreMenuDataModel:f.length>0?
{opened:this._moreMenuOpened,buttonClickHandler:function(){return
i._moreMenuOpened?
i.closeMoreMenuDropDown():i.openMoreMenuDropDown(f)}}:null,optionsMenuDataModel:
{opened:this._optionsMenuOpened,buttonClickHandler:function(){return
i._optionsMenuOpened?
i.closeOptionsMenuDropDown():i.openOptionsMenuDropDown()}},userProfileButtonDataMod
el:t.config.userProfileButtonEnabled&&o?
{opened:this._userProfileMenuOpened,buttonClickHandler:function(){return
i._userProfileMenuOpened?
i.closeUserProfileDropDown():i.openUserProfileDropDown()},icon:o,userName:s}:null,l
ockscreenMenuDataModel:
{opened:this._lockscreenMenuOpened,buttonClickHandler:function(){return
i._lockscreenMenuOpened?
i.closeLockscreenMenuDropDown():i.openLockscreenMenuDropDown()}}}}this._page.update
ScopesHeaderView(r)},h.prototype.openMoreMenuDropDown=function(t){var
i=this;this._page.ensureWebViewHeightExpanded();this._menuFactory.showDropdownMenu(
t,document.getElementById(this._moreButton.id),1,function()
{n.safeSetTimeout(function(){return
i.closeMoreMenuDropDown()},0,"closeMoreMenuDropDown")});this._moreMenuOpened=!
0;this.renderScopes(!0)},h.prototype.closeMoreMenuDropDown=function()
{this._moreMenuOpened=!1;this.renderScopes(!
0)},h.prototype.openOptionsMenuDropDown=function(){var
u=this,i,r;this._page.ensureWebViewHeightExpanded();i=t.RuntimeConfig.AlwaysWide?
1:2;r=this.getAdvancedOptions(this._sequenceNumberReader.getSequenceNumber(),i);thi
s._menuFactory.showDropdownMenu(r,document.getElementById(this._optionsButton.id),2
,function(){n.safeSetTimeout(function(){return
u.closeOptionsMenuDropDown()},0,"closeOptionsMenuDropDown")});this._optionsMenuOpen
ed=!0;this.renderScopes(!0)},h.prototype.openLockscreenMenuDropDown=function(){var
r=this,t,i;this._page.ensureWebViewHeightExpanded();t=4;i=this.getAdvancedOptions(t
his._sequenceNumberReader.getSequenceNumber(),t);this._menuFactory.showDropdownMenu
(i,document.getElementById(this._optionsButton.id),2,function()
{n.safeSetTimeout(function(){return
r.closeLockscreenMenuDropDown()},0,"closeLockscreenMenuDropDown")});this._lockscree
nMenuOpened=!0;this.renderScopes(!
0)},h.prototype.closeOptionsMenuDropDown=function(){this._optionsMenuOpened=!
1;this.renderScopes(!0)},h.prototype.closeLockscreenMenuDropDown=function()
{this._lockscreenMenuOpened=!1;this.renderScopes(!
0)},h.prototype.openUserProfileDropDown=function(){var
t=this,i=this.getAccountOptionsForUserProfileButton(this._sequenceNumberReader.getS
equenceNumber());this._menuFactory.showDropdownMenu(i,document.getElementById(this.
_optionsButton.id),2,function(){n.safeSetTimeout(function(){return
t.closeUserProfileDropDown()},0,"closeUserProfileDropDown")});this._userProfileMenu
Opened=!0;this.renderScopes(!0)},h.prototype.closeUserProfileDropDown=function()
{this._userProfileMenuOpened=!1;this.renderScopes(!
0)},h.prototype.cleanUp=function()
{this._lastRenderedTopHitHeader=null;this._page.updateTopHitHeaderView(null);this._
page.updateScopesHeaderView(null)},h.prototype.scopeNamesElements=function(n){var
i=this;return n.map(function(n){return i._scopeTiles.find(function(i){return
t.Scope[i.type]==n})}).filter(function(n){return!!
n})},h.prototype.getEffectiveScopeOrder=function(){var i,r,o,n,u,s,e;if(!
this._scopeTiles||
this._scopeTiles.length==0)return[];if(this._effectiveScopeOrder&&!
t.config.pathCompletionReplacesAll)return
this._effectiveScopeOrder.slice(0);if(t.RuntimeConfig.AlwaysWide?
(i=t.config.scopesOrderBeginAlwaysWide,r=t.config.scopesOrderLastAlwaysWide,o=t.con
fig.numberOfScopesToRenderAlwaysWide):
(i=t.config.scopesOrderBegin,r=t.config.scopesOrderLast,o=t.config.numberOfScopesTo
Render),n=[],i){if(t.config.pathCompletionReplacesAll&&(r=r.filter(function(n)
{return
n!
="PathCompletion"}),this._currentQuery&&this._currentQuery.canBePathCompletion&&(i=
i.map(function(n){return n=="All"?"PathCompletion":n}))),u=r?
this.scopeNamesElements(r):
[],n=this.scopeNamesElements(i),t.RuntimeConfig.AlwaysWide){var
f=0,h=10,c=26,l=t.config.scopeMenuWidth*this._scopesHeaderElement.clientWidth;for(s
=0;s<u.length;s++)f+=u[s].text.length*h+c;for(l-=f,f=0,e=0;e<n.length;e+
+)if(f+=n[e].text.length*h+c,f>l)break;o=e+u.length}n=n.slice(0,o-
u.length);n.push.apply(n,u)}return
this._effectiveScopeOrder=n,n.slice(0)},h.prototype.getHiddenScopeElements=function
(n){return this._moreScopeTiles?this._moreScopeTiles.filter(function(i){return
n.find(function(n){return n.type==i.type})==undefined&&t.Scope[i.type]!
="PathCompletion"&&t.Scope[i.type]!="All"}):
[]},h.prototype.getScopeBarElements=function(){var u=this,n,i,r;return
this._scopeTiles?(n=this.getEffectiveScopeOrder(),i=n.some(function(n){return
n.enabled}),!
i&&this._selectedScope&&(t.config.pathCompletionReplacesAll&&t.Scope[this._selected
Scope.type]=="PathCompletion"||(r=this._scopeTiles.find(function(n){return
n.type==u._selectedScope.type}),n.push(r),i=!0)),n):
[]},h.prototype.isFeedbackEnabled=function(){return
n.isBingEnabledByClient()},h.prototype.showFeedback=function()
{this._page.ensureWebViewHeightExpanded();typeof WindowsFeedbackForm!
="undefined"&&WindowsFeedbackForm.Show("")},h.prototype.getHeaderText=function(n,i)
{var r,u;if(t.RuntimeConfig.FlatListWithoutGroups||t.config.hideBestMatchTag)return
null;if(r=t.getScopeDisplayName(i,this._host),r){if(this._topHitPresent)return
n==t.Scope.All||n==t.Scope.PathCompletion?
(u=t.config.quickMatchLabel?"QuickMatch":"BestMatch",this._host.getLocString(u)):
(u=t.config.quickMatchLabel?"QuickMatchFor":"BestMatchFor",this._host.getLocString(
u,r.toLocaleLowerCase()));if(this._resultsPresent)return null;if(n!
=t.Scope.All)return r}return
this._host.getLocString("BestMatch")},h.prototype.getEmptyResultsMessage=function(n
,i,r,u,f){return t.RuntimeConfig.QfMode==5||n||!i&&!r||u!
=t.Scope.Documents&&f.showUpsellOnSuggestionsList&&f.showUpsellOnSuggestionsList()?
["",""]:r?f.getEmptyZIMessages(this._host):
[this._host.getLocString("NoResults",this._currentQuery.queryToFetch),""]},h.protot
ype.init=function(){var
u,f,r,i;if(t.initScopePrefixes(this._host),this._scopeTiles=[],this._moreScopeTiles
=[],t.RuntimeConfig.ScopesAvailable){u=t.RuntimeConfig.AlwaysWide?
t.config.scopesOrderBeginAlwaysWide:t.config.scopesOrderBegin;this._allScopeButtonP
resent=n.contains(u,"All");for(f in t.ScopeConfig)
(r=parseInt(f),i=t.ScopeConfig[r],(i.prefixes||i.prefixesLocString||
i.scopeNameLocString)&&t.isScopeEnabled(r,i))&&((r!=t.Scope.All||
this._allScopeButtonPresent)&&this._scopeTiles.push(this.createScopeElement(r,i,!
1)),this._moreScopeTiles.push(this.createScopeElement(r,i,!
0)));this._moreScopeTiles.sort(function(n,i){return n.type==t.Scope.All?-
1:i.type==t.Scope.All?
1:n.text.localeCompare(i.text)});this._selectedScope&&this.selectScope(this._select
edScope.type);this._effectiveScopeOrder=null}},h.prototype.createScopeElement=funct
ion(n,i,r){var u=this;return{isScopeElement:!0,id:(r?"scope":"l1scope")
+n,type:n,enabled:!
1,text:t.getScopeDisplayName(i,this._host),title:null,icon:n==t.Scope.All?
{content:"&#xE8A9",type:1}:i.icon,click:function(){return
u.clickHandler(n,"scopeBar")},selected:!1,tooltip:this.getScopeToolTip(n,!
1),isSelectable:!0}},h.prototype.clickHandler=function(n,i,r){var
h=t.getScopeDisplayName(t.ScopeConfig[n],this._host),e,u=this._currentQuery,f=u.sco
pe,o,s,c;if(this._scopeTiles.some(function(n){return n.type==f})||
(f=t.Scope.All),h&&f!=n)e=(n==t.Scope.All||
n==t.Scope.PathCompletion?"":h.toLocaleLowerCase()+": ")
+u.queryToFetch,this.innerRender(n,n,u,this._topHitPresent,this._resultsPresent,!
0,!1),o={query:this._currentQuery,topResults:[],groups:
[]},this._page.updateTopResultsView(o),this._page.updateGroupsView(o);else{if(f==t.
Scope.All||this._allScopeButtonPresent)
{this._page.ensureWebViewHeightExpanded();this.setFocusInSearchBox("scope
clickHandler
noop");return}e=u.queryToFetch;n=t.Scope.All;this.innerRender(n,n,u,this._topHitPre
sent,this._resultsPresent,!0,!
1)}s=t.Scope[n];c={Scope:s,Source:i,GroupSource:r&&r.source?
r.source.toString():undefined};this._instHelper.logClientInstEvent("Select","ScopeC
hanged",null,c);f!
=n&&this._host.reformulate(e,undefined,undefined,r);this.setFocusInSearchBox("scope
clickHandler "+s)},h.prototype.setFocusInSearchBox=function(t)
{this._host.setFocusInSearchBox(null,t);var
i=n.getCurrentActiveElement();i&&i.blur()},h.prototype.isScopeElement=function(t)
{return t&&this._scopeTiles&&(this.isScopeButton(t.id)||
n.contains(this._scopeTiles,t))},h.prototype.isMenuElement=function(n){return
n&&this.isMenuButton(n.id)},h.prototype.isScopeButton=function(n){return
n==this._feedbackButton.id||n==this._rewardsBadgeButton.id||
n==this._userProfileButton.id||
this.isMenuButton(n)},h.prototype.isMenuButton=function(n){return
n==this._moreButton.id||
n==this._optionsButton.id},h.prototype.getSelectableItems=function(){var
n=[],i;return
t.RuntimeConfig.ScopesAvailable&&(n=n.concat(this.getScopeSelectableItems())),i=thi
s._advancedOptionsScope.filter(function(n){return n.layout==0||
n.layout==6}),i.length>0&&(n=n.concat(i)),n},h.prototype.getSelectableItemsByGroup=
function(){var i=[],n=this.getScopeBarElements(),r,u,e,f;return
t.shouldSkipSelectedScope()&&this._selectedScope==n[0]&&(n=n.slice(1)),i.push(n.sli
ce(0,1)),r=n.findIndex(function(n){return n.selected}),r>0?
i.push(n.slice(r,r+1)):t.shouldSkipSelectedScope()||(u=n.findIndex(function(n)
{return
n.enabled}),u>0&&i.push(n.slice(u,u+1))),e=[this._moreButton,this._rewardsBadgeButt
on,this._userProfileButton,this._feedbackButton,this._optionsButton],e.forEach(func
tion(n){_ge(n.id)&&i.push([n])}),f=this._advancedOptionsScope.filter(function(n)
{return n.layout==0||n.layout==6}),f.length>0&&i.push.apply(i,f.map(function(n)
{return[n]})),i},h.prototype.getScopeSelectableItems=function(){var
u=this.getScopeBarElements(),i=this._currentScopeTileIndex,c=u.length,h;if(t.should
SkipSelectedScope()&&this._selectedScope==u[0]&&(u=u.slice(1),--i,--
c),i<0&&this._selectedScope&&!
t.shouldSkipSelectedScope())return[this._selectedScope];if(h=n.getCurrentActiveElem
ent(),h)switch(h.id){case f:return[this._moreButton];case
r:return[this._feedbackButton];case e:return[this._optionsButton];case
o:return[this._rewardsBadgeButton];case
s:return[this._userProfileButton]}return(i<0||
i>=c)&&(i=0),u.slice(i,i+1)},h.prototype.getSelectedItem=function(){return
null},h.prototype.select=function(n){var
i=[].slice.call(this._scopesHeaderElement.getElementsByClassName("scopeTile")),r=t.
shouldSkipSelectedScope()?i.filter(function(n){return!
n.classList.contains("selectedScope")}):i;this._currentScopeTileIndex=r.indexOf(_ge
(n.id));t.shouldSkipSelectedScope()&&(this._currentScopeTileIndex=i.indexOf(r[this.
_currentScopeTileIndex]))},h.prototype.onAfterKeyDown=function(){return!
1},h.prototype.getSubstrateUpsellClickHandler=function(n){var i=this,r=function()
{i._host.refreshCurrentPane();i._host.setFocusInSearchBox(null,"SubstrateUpsell")};
return function(){return
i._accessTokenManager.promptAutheticateDialog(n,t.getSubstrateResourceOrScope(n),r,
r)}},h.prototype.getSubstrateUpsell=function(n,i,r){var
s=null,u="VerifyAccountToSearch",e=0,l="CloudSearch",a=["Verify"],o=null,h=[],f,c;i
f(r==0){f=t.getEffectiveScope(this._currentQuery);switch(f){case
t.Scope.People:u+="Contacts";break;case t.Scope.Emails:u+="Emails";break;case
t.Scope.Documents:u+="Documents";e=1;s={content:"&#xE9BE",type:2,needsAccentColor:!
0};o=this._substrateUpsellDismiss}t.config.accountVerifyMessage&&(e=6,c=this._acces
sTokenManager?
this._accessTokenManager.getCachedAccountInfo(n):null,c&&h.push(c.accountUserName),
(f==t.Scope.People||f==t.Scope.Emails||
f==t.Scope.Documents)&&(h.length>0&&(u="VerifyAccount"),o=this._substrateUpsellDism
iss));l=""}else r==2&&(u=null,e=2,s={content:"&#xE9BE",type:2,needsAccentColor:!
0},o=this._substrateUpsellDismiss,a=["VerifyAccountToSearch"]);return
this.createAdvancedOption(n==1?"COFA":"COOA",i,l,u,a,this.getSubstrateUpsellClickHa
ndler(n),e,o,s,null,h,"VerifyButton")},h.prototype.getOneDriveUpsell=function(n)
{var t=this;return this.createAdvancedOption("SDSC",n,null,null,
["SeeResultsFromOneDrive"],function(){t._host.launchCortanaSignIn()},2,null,
{content:"&#xE9BE",type:2,needsAccentColor:!
1})},h.prototype.getIndexingOption=function(n){var
i=this,r=t.config.controlPanelSearchSettings?function(){return
i._host.launchSearchSettings()}:function(){return
t.LocalDataProvider.launchIndexingOptions(i._host,!1)};return
this.createAdvancedOption("OMIO",n,"",null,["OptionsMenuIndexing"],r,2,null,
{type:2,content:"&#xED52"})},h.prototype.getAdvancedOptionCssClass=function(n)
{return
n==4?"menuInfo":n==5?"menuLabel":null},h.prototype.createContextMenuGroup=function(
n,t,i,r){var u=this.createAdvancedOption(n,t,null,i,null,null,5);return
u.groupItems=r,u.narratorText=u.message,u},h.prototype.createBuildVersionOption=fun
ction(){var
n=this._host.getLocString("Build");return{id:"advancedOption"+this._advancedOptions
IdCounter++,selected:!1,title:n,message:undefined,text:n+":
"+t.config.snrVersion,instItem:undefined,click:undefined,layout:4,cssClass:this.get
AdvancedOptionCssClass(4),isSelectable:!1,subItems:undefined,isExpanded:!
1}},h.prototype.createCossOptInOption=function(n){var
r=this,i=t.RuntimeConfig.QfMode==2?"CossOptOut":"CossOptIn";return
this.createAdvancedOption(null,n,i,null,[i],function(){return
r.onCossOptInOutClick()},2,null,
{type:2,content:"&#xE8A7"})},h.prototype.createAdvancedOption=function(i,r,u,f,e,o,
s,h,c,l,a,v){var k=this,w,y,b,p;return
i&&(y=n.InstrumentedItem.getNonSuggestionInstrumentedItem(i,t.SyntheticQSCodesMaps.
KValues),this._instHelper.instrumentSyntheticInstrumentedItem(r,i,y)),b="advancedOp
tion"+this._advancedOptionsIdCounter++,l&&l.length==0&&(l=null),p={id:b,selected:!
1,title:this._host.getLocString(u),message:f?(w=this._host).getLocString.apply(w,
[f].concat(a)):null,text:this._host.ge
tLocString.apply(this._host,e),instItem:y,click:undefined,layout:s,dismiss:h,icon:c
,cssClass:this.getAdvancedOptionCssClass(s),isSelectable:!!o||!!
l,subItems:l,buttonLabel:this._host.getLocString(v),isExpanded:!l?undefined:!
1},p.click=o?function(n,t)
{y&&k._instHelper.instrumentItemClick(n,y,r,null,t,null);o(p)}:undefined,p},h.proto
type.getAccountOptions=function(n){var u=this,r=[];if(!
this._accessTokenManager)return r;var
f=this._accessTokenManager.getCachedAccountInfo(0),e=this._accessTokenManager.getCa
chedAccountInfo(1),c=this._accessTokenManager.isMsaAvailable(),l=this._accessTokenM
anager.isAadAvailable(),o="menuItemWithButton
focusable",s="removeHover",h="highlight",i;return(f||
e)&&(i=this.createAdvancedOption(null,n,null,"ConnectedAccounts",null,null,5),i.css
Class=this.getAdvancedOptionCssClass(5),r.push(i),f&&t.isCloudSearchEnabledMsaCache
&&(i=this.createAdvancedOption(null,n,null,null,
["MicrosoftAccount"],null,4),i.message=f.accountUserName,i.cssClass=this.getAdvance
dOptionCssClass(4),t.config.accountVerifyMessage&&!
t.isSubstrateOutlookAccountConnected&&(i.cssClass+="
"+h),r.push(i),t.config.accountVerifyMessage&&!
t.isSubstrateOutlookAccountConnected&&(i=this.createAdvancedOption(null,n,null,"Ver
ifyAccountAttention",null,this.getSubstrateUpsellClickHandler(0),4),i.cssClass=s,i.
icon={type:2,content:"&#xE946"},r.push(i),i=this.createAdvancedOption(null,n,null,"
VerifyButton",null,this.getSubstrateUpsellClickHandler(0),2),i.cssClass=o,r.push(i)
)),e&&t.isCloudSearchEnabledAadCache&&(i=this.createAdvancedOption(null,n,null,null
,
["AadAccount"],null,4),i.message=e.accountUserName,i.cssClass=this.getAdvancedOptio
nCssClass(4),r.push(i),t.config.accountVerifyMessage&&!
t.isSubstrateO365AccountConnected&&(i.cssClass+="
"+h),t.config.accountVerifyMessage&&!
t.isSubstrateO365AccountConnected&&(i=this.createAdvancedOption(null,n,null,"Verify
AccountAttention",null,this.getSubstrateUpsellClickHandler(1),4),i.cssClass=s,i.ico
n={type:2,content:"&#xE946"},r.push(i),i=this.createAdvancedOption(null,n,null,"Ver
ifyButton",null,this.getSubstrateUpsellClickHandler(1),2),i.cssClass=o,r.push(i))),
r.push(this.getMenuDividerOption()),i=this.createAdvancedOption(null,n,null,null,
["ManageAccounts"],function(){return
u._host.launchWindowsAccountSettings()},2,null,
{type:2,content:"&#xE716"}),i.cssClass=this.getAdvancedOptionCssClass(2),r.push(i))
,f&&(t.isCloudSearchEnabledMsaCache||!c)||
(i=this.createAdvancedOption(null,n,null,null,t.isCloudSearchEnabledMsaCache?
["AddMicrosoftAccount"]:["EnableMsaSearch"],t.isCloudSearchEnabledMsaCache?
function(){return u._host.launchWindowsAccountSettings()}:function(){return
u._host.launchSearchPermissions()},2,null,
{type:2,content:t.isCloudSearchEnabledMsaCache?"&#xE8FA":"&#xE9BE"}),i.cssClass=thi
s.getAdvancedOptionCssClass(2),r.push(i)),e&&(t.isCloudSearchEnabledAadCache||!l)||
(i=this.createAdvancedOption(null,n,null,null,t.isCloudSearchEnabledAadCache?
["AddAadAccount"]:["EnableAadSearch"],t.isCloudSearchEnabledAadCache?function()
{return u._host.launchWindowsAccountSettings()}:function(){return
u._host.launchSearchPermissions()},2,null,
{type:2,content:t.isCloudSearchEnabledMsaCache?"&#xE8FA":"&#xE9BE"}),i.cssClass=thi
s.getAdvancedOptionCssClass(2),r.push(i)),r},h.prototype.getUserProfileButtonData=f
unction(){var
i=this,r,t,n=this._accessTokenManager.getSelectedAccountInfo(),u;return n?
(t=n.accountProviderAuthority=="consumers"?
0:1,r=this._userProfilesCache[n.accountUserName],!r)?
(u=this._substrateProfilePictureProvider.getPersonDefaultIcon(n.accountUserName),th
is._userProfilesCache[n.accountUserName]=u,this._accessTokenManager.getAccount(t,t=
=1?"https://outlook.office.com/":"https://outlook.office.com/User.ReadWrite",!1,!
0,function(r){if(r&&r.Token){var
u=i._substrateProfilePictureProvider.getProfilePictureIconForToken(t,r.Token,n.acco
untUserName);u&&u(1,function(t)
{t&&(i._userProfilesCache[n.accountUserName]=t,i.renderScopes(!0))})}},"Windows"),
[u,n.accountUserName]):[r,n.accountUserName]:
[null,null]},h.prototype.getAccountOptionsForUserProfileButton=function(n){var
u=this,r,i,f,a,c,o,l,v;if(!this._accessTokenManager)return[];var
s=this._accessTokenManager.getAllAvailableAccounts(0),h=this._accessTokenManager.ge
tAllAvailableAccounts(1),e=s.concat(h);if(s.length+h.length==0)return[];if(r=[],f=t
his._accessTokenManager.getSelectedAccountInfo(),f&&(e=e.filter(function(n){return
n.accountUserName!
=f.accountUserName}),i=this.createAdvancedOption(null,n,null,"ConnectedAccount",nul
l,null,5),i.cssClass=this.getAdvancedOptionCssClass(5),r.push(i),i=this.createAdvan
cedOption(null,n,null,null,f.accountProviderAuthority=="consumers"?
["MicrosoftAccount"]:
["AadAccount"],null,4),i.message=f.accountUserName,i.cssClass=this.getAdvancedOptio
nCssClass(4),r.push(i)),e.length>0)for(i=this.createAdvancedOption(null,n,null,"Ava
ilableAccounts",null,null,5),i.cssClass=this.getAdvancedOptionCssClass(5),r.push(i)
,a=function(t)
{i=c.createAdvancedOption(null,n,null,null,t.accountProviderAuthority=="consumers"?
["MicrosoftAccount"]:["AadAccount"],function()
{u._accessTokenManager.setSelectedAccount(t);u._host.notifyAccountSelected(t);u._me
nuFactory.dismiss()},0,null,
{type:2,content:"&#xE77B"});i.message=t.accountUserName;i.cssClass=c.getAdvancedOpt
ionCssClass(0);r.push(i)},c=this,o=0,l=e;o<l.length;o++)v=l[o],a(v);return
r.push(this.getMenuDividerOption()),i=this.createAdvancedOption(null,n,null,null,
["ManageAccounts"],function(){return
u._host.launchWindowsAccountSettings()},2,null,
{type:2,content:"&#xE716"}),i.cssClass=this.getAdvancedOptionCssClass(2),r.push(i),
s.length==0&&(i=this.createAdvancedOption(null,n,null,null,t.isCloudSearchEnabledMs
aCache?["AddMicrosoftAccount"]:["EnableMsaSearch"],t.isCloudSearchEnabledMsaCache?
function(){return u._host.launchWindowsAccountSettings()}:function(){return
u._host.launchSearchPermissions()},2,null,
{type:2,content:t.isCloudSearchEnabledMsaCache?"&#xE8FA":"&#xE9BE"}),i.cssClass=thi
s.getAdvancedOptionCssClass(2),r.push(i)),h.length==0&&(i=this.createAdvancedOption
(null,n,null,null,t.isCloudSearchEnabledAadCache?["AddAadAccount"]:
["EnableAadSearch"],t.isCloudSearchEnabledAadCache?function(){return
u._host.launchWindowsAccountSettings()}:function(){return
u._host.launchSearchPermissions()},2,null,
{type:2,content:t.isCloudSearchEnabledMsaCache?"&#xE8FA":"&#xE9BE"}),i.cssClass=thi
s.getAdvancedOptionCssClass(2),r.push(i)),r},h.prototype.getMenuDividerOption=funct
ion(){return{id:null,selected:!1,title:"",message:null,isSeparator:!
0,text:"",instItem:null,click:null,layout:3,isSelectable:!
1}},h.prototype.addZiCustomization=function(n,i,r){var
s=this,f,l,u,h,o,c,v,y;if(r===void 0&&(r=!
0),t.config.enableSearchHomeCustomization&&this._currentQuery.isSearchHomeZI&&this.
_currentQuery.scope==t.Scope.All){f={};for(l in
this._currentQuery.availableDataSources)if(u=this._currentQuery.availableDataSource
s[l],u&&u.suggestionGroupToggler){if(typeof u.groupType!="number")throw new
Error("missing groupType declaration for suggestionGroupToggler");f[u.groupType]||
(f[u.groupType]=u.suggestionGroupToggler)}if(h=this._currentQuery.staticGroupOrder?
this._currentQuery.staticGroupOrder.filter(function(n){return!!
f[n]}):Object.keys(f).map(function(n){return+n}),h.length!=0){var
a=[],p=function(n){var
r=f[n],u=r.isHidden(),o=e.createAdvancedOption(null,i,null,null,[],function()
{r.toggle(!
u);s._menuFactory.dismiss();s._host.refreshCurrentPane()},2,null,null,null),h=t.get
GroupTitleAndNarratorText(e._currentQuery,e._host,n,null,!
1).title;o.text=e._host.getLocString(u?"ShowSomething":"HideSomething",h);a.push(o)
},e=this;for(o=0,c=h;o<c.length;o+
+)v=c[o],p(v);y=this.createAdvancedOption(null,i,null,null,
["CustomizeSearchHome"],function(n){return s._menuFactory.showSubMenu(n)},2,null,
{type:2,content:"&#xE70F"},a);r&&n.push(this.getMenuDividerOption());n.push(y)}}},h
.prototype.addSinglepPaneOptions=function(n,r){var
e=this,o=this.getScopeBarElements(),s=this.getHiddenScopeElements(o).filter(functio
n(n){return n.type!=t.Scope.All}).map(function(n){var t=n;return
t.layout=0,t}),u,f;n.push(this.createContextMenuGroup(null,r,"MoreScopesListToolTip
",s));n.push(this.getMenuDividerOption());u=[];i.authenticationManager.getAllSearch
WebAccountsAsync?t.config.userProfileButtonEnabled||
(f=this.getAccountOptions(r),u.push(this.createAdvancedOption(null,r,null,null,
["ConnectedAccounts"],null,2,null,
{type:2,content:"&#xE716"},f))):t.isCloudSearchEnabledCache&&this.addCloudSearchUps
ells(u,r,2);u.push(this.getIndexingOption(r,1));this.addZiCustomization(u,r,!
1);n.push(this.createContextMenuGroup(null,r,"OptionsButtonToolTip",u));this.isFeed
backEnabled()&&(n.push(this.getMenuDividerOption()),n.push(this.createAdvancedOptio
n(null,r,null,null,["FeedbackButtonText"],function(){return
e.showFeedback()},2,null,
{type:2,content:"&#xE8F2"},null)))},h.prototype.getAdvancedOptions=function(n,r)
{var f=this,u=[],e,o;return
r==1&&(i.authenticationManager.getAllSearchWebAccountsAsync&&(t.config.userProfileB
uttonEnabled||
u.push.apply(u,this.getAccountOptions(n)),e=this.createAdvancedOption(null,n,null,n
ull,["SearchSettings"],function(){return t.config.controlPanelSearchSettings?
f._host.launchSearchPermissions():f._host.launchSearchSettings()},2,null,
{type:2,content:"&#xE713"}),e.cssClass=this.getAdvancedOptionCssClass(2),u.push(e))
,u.push(this.getIndexingOption(n,r)),this.addZiCustomization(u,n)),r==2&&this.addSi
nglepPaneOptions(u,n),r==0&&t.isCloudSearchEnabledCache&&this.addCloudSearchUpsells
(u,n,r),r!
=2&&t.config.troubleshootButton&&u.push(this.getMenuDividerOption()),t.config.troub
leshootButton&&(r==1||r==2)&&u.push(this.createAdvancedOption(null,n,null,null,
["Troubleshoot"],function(){return
f._host.launchUri("https://aka.ms/fixsearch")},2,null,
{type:2,content:"&#xE90F"},null)),t.config.cossOptIn&&(r==1||
r==2)&&u.push(this.createCossOptInOption(n)),t.config.snrVersion&&(r==1||
r==2)&&u.push(this.createBuildVersionOption()),r==4&&(o=this.createAdvancedOption(n
ull,this._sequenceNumberReader.getSequenceNumber(),null,null,
["LockScreenSettings"],function(){r
eturn f._host.launchLockscreenSettings()},2,null,
{type:1,content:"&#xEE3F"}),o.cssClass=this.getAdvancedOptionCssClass(2),u.push(o))
,u},h.prototype.addCloudSearchUpsells=function(i,r,u){var
e=t.substrateProvidersEnabled(),f;if((u==0||u==2)&&(u!=0||!this._selectedScope||
this._selectedScope.type==t.Scope.Emails||
this._selectedScope.type==t.Scope.People||
this._selectedScope.type==t.Scope.Documents))if(f=t.getAccountTypeForCloudContent()
,e)
{if(this._upsellGotDismissed&&this._selectedScope&&(this._selectedScope.type==t.Sco
pe.Documents||
t.config.accountVerifyMessage&&(this._selectedScope.type==t.Scope.People||
this._selectedScope.type==t.Scope.Emails))&&u==0)return;f!=1&&f!=4||
t.isSubstrateO365AccountConnected||i.push(this.getSubstrateUpsell(1,r,u));f!=2&&f!
=4||t.isSubstrateOutlookAccountConnected||
i.push(this.getSubstrateUpsell(0,r,u))}else
n.isBingEnabled()&&t.isCortanaEnabledCache&&!
t.isCortanaPersonalized&&i.push(this.getOneDriveUpsell(r))},h.prototype.onCossOptIn
OutClick=function(){var r=this;n.safeSetTimeout(function()
{t.RuntimeConfig.QfMode==2?
i.disableCenterScreenAndRelaunch():i.enableCenterScreenAndRelaunch(!
1);n.safeSetTimeout(function(){return
r._host.reloadWebView()},0,"HeaderFooterViewModel.onCossOptInOutClick.reloadWebView
")},0,"HeaderFooterViewModel.onCossOptInOutClick")},h}
();t.HeaderFooterViewModel=h})(t=n.WSB||(n.WSB={}))}(AutoSuggest||
(AutoSuggest={})),function(n){var t;(function(t){function i(n,t){var
i=HitHighlightingParser.removeMarkers(n.text),r;!
i.includes(t.queryToFetch)&&i.toLowerCase().startsWith(t.queryToFetch.toLowerCase()
)&&(r=t.queryToFetch+i.substr(t.queryToFetch.length),n.text=HitHighlightingParser.a
ddMarkers(r,t.queryToFetch));!
n.query.includes(t.queryToFetch)&&n.query.toLowerCase().startsWith(t.queryToFetch.t
oLowerCase())&&(n.query=t.queryToFetch+n.query.substr(t.queryToFetch.length))}funct
ion r(n,r,u,f,e,o,s,h){var
l,c;if(n.actionUri=f,n.confidence=o,n.source=s,n.handoffType==4)if(l=n.query.toLowe
rCase()==r.queryToFetch.toLowerCase(),n.updateFromQuery=function(i){return l?
(n.query=i.queryToFetch,n.text=HitHighlightingParser.addMarkers(n.query,i.queryToFe
tch),n.narratorText=t.getNarratorText(n),!0):!
1},c=t.parseTaskFrame(e),c)n.isReformulation=!0,n.click=function(){return
h.reformulate(n.query,c)};else return!1;else
n.classNames.push("action"),n.click=function(){return
h.launchCat1(n.query,f,e)};return
n.icon={type:3},i(n,r),n.narratorText=t.getNarratorText(n),n.type!
="CSK"&&(n.getMruData=function()
{return{type:n.type,handoffType:n.handoffType,hc:n.hc,highConfidenceMetaSuggestionS
core:n.highConfidenceMetaSuggestionScore,prefetchConfidenceScore:n.prefetchConfiden
ceScore,query:n.query,textWithoutHH:HitHighlightingParser.removeMarkers(n.text),ann
otation:n.primaryMetadata,icon:n.getIcon?
null:n.icon,actionUri:f,taskFrame:e,confidence:o,source:s,suggestionKey:t.getSugges
tionKey(n)}}),!0}function o(n,r,u,e,o,s,h,c,l,a,v,y){if(n.isAnswer=!
0,n.htmlContent=e&&e.Content?
e.Content.HTML:null,n.baseSearchUrl=h,n.segments=c,n.htmlContent){var
p=JsonInject.GetResourceKeys([e]);p&&(n.executeScript=function(){return
JsonInject.WriteAfterContentResources(JsonInject.FilterResources(a,p))})}s&&(n.seco
ndaryIcon={content:s,type:0});n.text.includes(HitHighlightingParser.startMarker)||
(n.text=HitHighlightingParser.addMarkers(n.text,r.queryToFetch));n.htmlContent||
o&&(n.primaryMetadata=o,n.additionalInfoText=" - "+o);n.handoffType==10?
(n.classNames.push("action"),i(n,r),t.config.useCortanaLogoForAllCortanaSuggestions
&&(n.icon={type:3}),n.click=function(){return
v.launchCat2or3a(n.query,l)},n.allowedInGroups=!n.htmlContent):
(f(n,v),n.click=function(){return
v.launchSearch(n.query,y.getSearchUrl(r.fullPartialQuery,n.query,n.type,n.baseSearc
hUrl),!1)},n.allowedInGroups=n.secondaryIcon?!!n.additionalInfoText:!
n.htmlContent);n.narratorText=t.getNarratorText(n)}function u(n,i,r,u,f)
{n.url=u;n.tooltip=i.isSearchHomeZI?
n.text+"\n\n"+u:u+"\n\n"+HitHighlightingParser.removeMarkers(n.primaryMetadata);t.i
sValidIcon(n.icon)||(n.getIcon=f.getEdgeIcon);n.click=function(){return
f.launchUri(u)};n.narratorText=t.getNarratorText(n,f.getLocString("DirectNavSuggest
ion"));n.getMruData=function()
{return{type:n.type,handoffType:n.handoffType,hc:n.hc,highConfidenceMetaSuggestionS
core:n.highConfidenceMetaSuggestionScore,prefetchConfidenceScore:n.prefetchConfiden
ceScore,query:n.query,textWithoutHH:HitHighlightingParser.removeMarkers(n.text),tit
le:n.primaryMetadata,icon:n.getIcon?
null:n.icon,url:u,suggestionKey:t.getSuggestionKey(n)}}}function f(n,i)
{t.isValidIcon(n.icon)||(n.icon=n.type=="HS"?
{content:"&#xE81C",type:2}:n.handoffType===13?
{content:"&#xEB9F",type:2}:n.handoffType===14?
{content:"&#xE714",type:1}:t.getSearchSuggestionIcon());n.primaryMetadata||
n.secondaryIcon||n.htmlContent||n.additionalInfoText||
(n.primaryMetadata=n.handoffType===13?
i.getLocString("SearchForWebImages"):n.handoffType===14?
i.getLocString("SearchForWebVideos"):t.getWebSuggestionAnnotation(i))}var
e=function(){function i(n,t,i,r,u,f)
{this._host=n;this._instrumentationHelper=t;this._navigationHelper=i;this._temporar
yMessageHandler=r;this._accessTokenManager=u;this._previousKeystrokeCache=f}return
i.prototype.parse=function(n,t,i,r,u,f,e)
{this.parseOnlineSuggestions(n,t,r,u,f,e,i)},i.prototype.parseOnlineSuggestions=fun
ction(i,r,u,f,e,o,s){var a=this,h,l,k;if(!u)
{n.isDataSourceEnabled(n.WebDataSource,i)&&e(n.WebDataSource,
[],null);n.isDataSourceEnabled("OSTMA",i)&&e("OSTMA",
[],null);n.isDataSourceEnabled("QS",i)&&e("QS",
[],null);return}u&&u.ELToken&&(this._host.setElToken(u.ELToken),u.LC==1&&this._host
.sendElToken());var
v=[],y=[],p=[],c=[],w=[],b=n.isDataSourceEnabled(n.WebDataSource,i);n.safeExecute(f
unction(){for(var e,o=function(t){var o=t.Attributes,h=o.appId,f,e;if(h)return
y.push(t),h.split(";").forEach(function(t){n.contains(c,t)||
c.push(t)}),"continue";if(f=o.settingId,f)return
p.push(t),w.push(f),"continue";b&&(e=n.safeExecute(function(){return
a.parseOnlineSuggestion(i,t,r,u.Resources,s)},"parseOnlineSuggestion"),e&&v.push(e)
)},t=0,f=u.Suggestions;t<f.length;t+
+)e=f[t],o(e)},"parseOnlineSuggestions");b&&(h=null,l=null,u.RankingSignals&&(h=n.s
afeExecute(function(){return
n.parseWebEngagementSignals(u.RankingSignals)},"parseWebEngagementSignals"),t.isL2(
i)||(l=n.safeExecute(function(){return
t.parseWebSuppressionSignals(u.RankingSignals,i)},"parseWebSuppressionSignals"))),t
his._previousKeystrokeCache&&this._previousKeystrokeCache.updateWebSignalsData(i.qu
eryToFetch,h),k={rankingSignals:u.RankingSignals,engagementSignals:h,suppressedGrou
ps:l,webTopResultRoutingType:u.PrefixRoutingType},e(n.WebDataSource,v,k));t.lookupB
yId(i,"OSTMA",c,y,function(n){return
n.Attributes.appId.split(";")},"QS",w,p,function(n){return
n.Attributes.settingId},f,r,e,o,function(n,t,f,e){return
a.parseIdLookupResponse(u,i,r,n,t,f,e)},null,null,null,null,this._instrumentationHe
lper,this._host)},i.prototype.parseIdLookupResponse=function(i,u,f,e,o,s,h){var
c=this,l,a;if(e.Attributes.stype!="CS"||!(s.length>0)){if(s.length!=1)
{l=n.safeExecute(function(){return
c.parseOnlineSuggestion(u,e,f,i.Resources,o)},"parseOnlineSuggestion
"+o);l&&h.push(l);return}a=function(n){var i=e.Attributes;return
c.compliesWithMinVersion(i.appMinVersion,n.deviceItem.version)?
(n.appContext=i.appContext,c.setRankingSignals(n,e),e.Text&&i.query&&(!
t.isApp(n.type)||
n.appContext)&&(n.text=e.Text,n.query=i.query),e.SecondaryText&&(n.primaryMetadata=
e.SecondaryText),n.handoffType==5)?
r(n,u,f,i.actionUri,i.taskFrame,parseFloat(i.confidence),parseInt(i.source),c._host
):!0:!1};n.safeExecute(function(){return
t.parseLocalSuggestion(u,s[0],o,f,c._host,c._temporaryMessageHandler,e.Attributes.s
type,c._instrumentationHelper,h,a)},"parseLocalSuggestion
"+o)}},i.prototype.parseOnlineSuggestion=function(i,f,e,s,h){var
d=this,c=f.Attributes,a=c.stype,y,l,v;if(c.appId&&a!="CS"||c.settingId)return
null;if(y=c.isAnswer==="1"?c.url||c.vertical?
n.verticalToHandoffType(c.vertical):10:c.taskFrame?
c.actionUri.startsWith("action://FindMyStuff/")?4:5:a=="CS"?3:a=="MD"||a=="ML"?
1:n.verticalToHandoffType(c.vertical),l=t.createSuggestion(i,f.Text,null,n.getIconF
romOnlineResponse(f),a,c.query,n.InstrumentedItem.createInstrumentedItem(e,a),y,e,!
1),l.primaryMetadata=f.SecondaryText,this.setRankingSignals(l,f),l.autoOpenPreviewP
aneWhenOnTopHit=c.openPP==="1",c.isAnswer==="1"){if(!c.url&&!
t.isCortanaEnabledCache)return
null;l.signals=f.Signals;o(l,i,e,f.InstantAnswer,c.additionalInfoText,c.secondaryIc
onUrl,c.url,c.segments,c.taskFrame,s,this._host,this._navigationHelper);c.noHeightR
estriction==="1"&&l.classNames.push("noHeightRestriction")}else if(c.taskFrame)
{if(!t.isCortanaEnabledCache||!
r(l,i,e,c.actionUri,c.taskFrame,parseFloat(c.confidence),parseInt(c.source),this._h
ost))return null}else
if(l.type=="CS")this.setStoreSuggestionProperties(l,i,e,c);else{if(!c.url)return
null;if(l.autoOpenPreviewPaneWhenOnTopHit=c.openPP==="1",l.type=="MD"||
l.type=="ML")v=n.prettyPrintUrl(c.query,i.queryToFetch,!0),v!
=l.query&&(l.query=v,l.text=i.queryToFetch?
HitHighlightingParser.addMarkers(v,i.queryToFetch):v),l.primaryMetadata&&!
l.primaryMetadata.includes(HitHighlightingParser.startMarker)&&(l.primaryMetadata=H
itHighlightingParser.addMarkers(l.primaryMetadata,i.queryToFetch)),u(l,i,e,c.url,th
is._host);else{if(n.queryLooksLikeUrl(l.query))return
null;this.setWebSearchSuggestionProperties(l,i,e,c.url)}}if(!
t.isValidSuggestion(l,"parseOnlineSuggestion"))return null;var p=l.segments,w=p?
p.split(","):[],b=w.some(function(i){return
n.contains(t.config.relatedWebImageSupportedSegments,i)}),k=w.some(function(i)
{return
n.contains(t.config.relatedWebVideoSupportedSegments,i)});return(f.ChildSuggestions
||b||k)&&(l.calculateChildSuggestions=function(){return
d.calculateRelatedSuggestions(l,i,f,h,b,k)}),l},i.prototype.setStoreSuggestionPrope
rties=function(n,i,r,u){var e=this,f;n.icon.bgColor=u.bgColor=="transparent"?
this._host.getAccentColor():u.bgColor;n.classNames.push("action");f=parseFloat(u.av
gRating);n.stars=this.getStarsRating(f);n.starNarratorText=this._
host.getLocString("StarRating",""+n.stars);n.catalogScore=parseFloat(u.catalogScore
);n.avgRating=f;n.ratingCount=parseInt(u.ratingCount);n.packageFamilyName=u.appId;n
.click=function(){return
e._host.launchStorePdp(u.productId)};n.narratorText=t.getNarratorText(n)},i.prototy
pe.getStarsRating=function(n){var t=Math.round(n*2)/2;return
Math.max(0,Math.min(5,t))},i.prototype.setRankingSignals=function(n,t){var
i=t.Attributes;n.hc=i.hc==="1";n.highConfidenceSuggestionScore=+i.hcs;n.highConfide
nceMetaSuggestionScore=t.HighConfidenceMetaSuggestionScore;n.prefetchConfidenceScor
e=t.PrefetchConfidenceScore;n.suggestionLogMeta=i.lm},i.prototype.compliesWithMinVe
rsion=function(n,t){var r,u,i,f,e;if(!n)return!0;if(!t)return!
1;for(r=n.split("."),u=t.split(".");r.length>u.length;)u.push("0");for(i=0;i<r.leng
th;++i){if(f=u[i],e=r[i],f<e)return!1;if(f>e)return!0}return!
0},i.prototype.setWebSearchSuggestionProperties=function(n,i,r,u){var
e=this;f(n,this._host);i.queryToFetch||
(n.text=HitHighlightingParser.addMarkers(n.text));n.baseSearchUrl=u;n.click=functio
n(){return
e._host.launchSearch(n.query,e._navigationHelper.getSearchUrl(i.fullPartialQuery,n.
query,n.type,n.baseSearchUrl,n.handoffType),n.useRaf)};n.narratorText=t.getNarrator
Text(n);n.type=="HS"&&t.setExtraVerbs(n,function(){var
i=[{verb:"ManageSearchHistory",displayName:e._host.getLocString("ManageSearchHistor
y"),executeSync:function(){return e._host.launchPrivacyPortal()},icon:
{content:"&#xE81C",type:2}}];return
t.config.removeSuggUrl&&i.unshift({verb:"RemoveFromWebHistory",displayName:e._host.
getLocString("RemoveFromWebHistory"),executeSync:function(){return
e.removeBingHistorySuggestion(n.text)},icon:{content:"&#xE711",type:2}}),i},!
0)},i.prototype.sendRemoveBingHistorySuggestionRequest=function(i,r){var
u=this,f;i=HitHighlightingParser.removeMarkers(i);f=t.config.removeSuggUrl.replace(
"%7b0%7d",encodeURIComponent(i)).replace("%7bSID
%7d",sj_cook.get("_SS","SID"));n.fetchUrlJson(f,r,null,function(t)
{t.success&&(u._host.refreshCurrentPane(),n.safeSetTimeout(function(){return
u._temporaryMessageHandler.showTemporaryMessage(u._host.getLocString("RemoveFromWeb
HistoryConfirmation",i))},250,"removeBingHistorySuggestion"))})},i.prototype.remove
BingHistorySuggestion=function(n){var i=this;this._accessTokenManager?
this._accessTokenManager.getAccount(0,t.getBingResourceOrScope(0),!1,!0,function(t)
{if(t&&t.Token){var r={};r["X-Search-
RPSToken"]=t.Token;i.sendRemoveBingHistorySuggestionRequest(n,r)}},t.getAuthAccount
ForCloudContent()):this.sendRemoveBingHistorySuggestionRequest(n,null)},i.prototype
.addRelatedSuggestion=function(i,r,u,f,e,o,s){var
h=t.createSuggestion(r,f,null,e,o,i?
i.Query:u.query,n.InstrumentedItem.createInstrumentedItem(u.sequenceNumber,o),s,u.s
equenceNumber,!1,null,null,!
0);h.groupType=t.GroupType.Related;h.parent=u;h.tooltip=i?
i.SecondaryText:null;h.rankingScore=i?i.RankingScore:0;h.category=i?
i.Category:null;h.isAnswer=!
0;this.setWebSearchSuggestionProperties(h,r,u.sequenceNumber,i?
i.Url:null);h.primaryMetadata=null;t.isValidSuggestion(h,"calculateRelatedSuggestio
ns")&&u.childSuggestions.push(h)},i.prototype.calculateRelatedSuggestions=function(
t,i,r,u,f,e){var
s,h,o;if(t.childSuggestions=[],r.ChildSuggestions)for(s=0,h=r.ChildSuggestions;s<h.
length;s+
+)o=h[s],this.addRelatedSuggestion(o,i,t,o.Text,n.getIconFromOnlineResponse(o),o.Ty
pe,0);f&&this.addRelatedSuggestion(null,i,t,this._host.getLocString("Images"),null,
"EIM",13);e&&this.addRelatedSuggestion(null,i,t,this._host.getLocString("Videos"),n
ull,"EVI",14);t.childSuggestions.length>0&&this._instrumentationHelper.instrumentDa
taSource(t.sequenceNumber,u,t.childSuggestions,null)},i}
();t.OnlineSuggestionsParser=e;t.adjustCasing=i;t.setCat1SuggestionProperties=r;t.s
etUrlSuggestionProperties=u})(t=n.WSB||(n.WSB={}))}(AutoSuggest||
(AutoSuggest={})),function(n){var t;(function(t){function w(n){return n?[n]:
[]}function et(n){if(n){var t=n.lastIndexOf(".");if(t>=0)return
n.substring(t)}return""}function ot(t){var i=t?new Date(t):null;return
n.isValidDate(i)?i:null}function st(i){if(i){var
r=n.getCurrentDate();if(r.getDate()==i.getDate()&&r.getMonth()==i.getMonth()&&r.get
FullYear()==i.getFullYear())return i.toLocaleTimeString(t.uiLanguageCache,
{hour:"numeric",minute:"numeric"})}return null}function f(i,f,o,s,h,c){var
k,v,tt,it,d,y,a,g,p,w,l,b,nt;for(c===void 0&&(c=!1),!
c&&s.extensionLC&&r.hideFileExtensions&&!
t.config.showFileExtn&&(k=s.extensionLC.length,v=s.query,v.toLocaleLowerCase().ends
With(s.extensionLC)&&(tt=HitHighlightingParser.addMarkers(v,f),tt.toLocaleLowerCase
().endsWith(s.extensionLC)&&(s.query=v.substring(0,v.length-
k),it=HitHighlightingParser.removeMarkers(s.text),v==it&&(d=s.text.toLocaleLowerCas
e().lastIndexOf(s.extensionLC),s.text=s.text.substring(0,d)
+s.text.substr(d+k))))),s.lastModifiedDate&&(y=s.lastModifiedDate.toLocaleString(t.
uiLanguageCache,
{day:"numeric",month:"numeric",year:"numeric",hour:"numeric",minute:"numeric"})),a=
s.path,s.tooltip=yt(s,a,y,h),s.primaryMetadata=s.sourceForGroup&&s.sourceForGroup!
=1?t.getGroupSourceDisplayName(s.sourceForGroup,h):s.itemTypeDisplayName,
(i.isSearchHomeZI||
t.RuntimeConfig.QfMode==8)&&(s.additionalInfoText=a),s.classNames=[],s.match?
(g=(pt(s.match.matchType)?h.getLocString(t.MatchType[s.match.matchType])+": ":"")
+HitHighlightingParser.addMarkers(s.match.matchedText,f),s.additionalInfoText=g,s.s
econdaryMetadata=g,s.classNames.push("withMatchAnnotation","forceNoWrapOutsideTopRe
sult")):y&&t.RuntimeConfig.QfMode!
=5&&(s.secondaryMetadata=h.getLocString("LastModified")+":
"+y),s.narratorText=t.getNarratorText(s),t.displayedInGridLayout(s.type)&&(o?
s.classNames.push("bigIcon","biggerIcon"):s.classNames.push("bigIcon")),!
c&&s.handoffType==2&&r.copyToClipboard&&u(s,function()
{return[{verb:t.JumplistActionItemType[t.JumplistActionItemType.S_CopyFullPath],dis
playName:h.getLocString("CopyFullPath"),executeSync:function(){return
r.copyToClipboard(s.path,"")},icon:{type:1,content:"&#xE8C8"}}]},!
1),p={},a&&(w=a.lastIndexOf("/"),w<0&&(w=a.lastIndexOf("\\")),l=a.substring(0,w),l.
endsWith(":")&&(l=l+"\\"),p[h.getLocString("Location")]=[{text:l,click:function()
{return n.isUncOrLocalPath(l)?r.launcher.startLaunchFolder(l):s.locationUrl?
r.launcher.launchUriAsync(decodeURI(s.locationUrl)):r.launcher.launchUriAsync(l)}}]
),p[h.getLocString("LastModified")]=[{text:y}],b=0,nt=e;b<nt.length;b++){var
rt=nt[b],ft=rt[0],et=rt[1],ut=s[et];ut&&(p[h.getLocString(t.MatchType[ft])]=[{text:
ut}])}s.previewMetadata=p}function ht(n,i,r,u){var o,s;for(i.match||!r.match||
i.parentFolderDisambig||(i.match=r.match,i.needsRefreshAfterDeduping=!
0),o=0,s=e;o<s.length;o++){var l=s[o],h=l[1],c=r[h];c&&!
i[h]&&(i[h]=c,i.needsRefreshAfterDeduping=!
0)}t.RuntimeConfig.QfMode==5&&(i.needsRefreshAfterDeduping=!
1);i.needsRefreshAfterDeduping&&f(n,t.getEffectiveQuery(n),t.isL2(n),i,u,!
0)}function ct(n,i,u,f,e){return n?
t.Promise.safeChainWithGlobalCaching("getImageWithLiveTokenAsync",function(){return
r.getImageWithLiveTokenAsync(u)},function(){return e},function(n){return
t.toIcon(n,"getImageWithLiveTokenAsync",i)},i,null,null,3):b(i,f)}function b(n,i)
{return t.Promise.safeChainWithGlobalCaching("getIconForTypeAsync",function(n)
{return
r.queryFormulationView.deviceSearch.getIconForTypeAsync(i,t.getImageSizeValue(n))},
function(n){return n+"_"+i},function(i){return
t.toIcon(i,"getIconForTypeAsync",n)},n)}function k(n){return n!
=null&&(n.type==3||!!n.content||!!n.className)}function o(n,t,i){i===void 0&&(i=!
0);var r=n.mayContainPII;return n.text?n.query?!n.handoffType&&n.handoffType!==0?
(SharedLogHelper.LogError(t,r?"":n.text,new Error("Missing handoff type")),!
1):n.type?i&&!n.getIcon&&!k(n.icon)?(SharedLogHelper.LogError(t,r?"":n.text,new
Error("Missing icon")),!1):!0:(SharedLogHelper.LogError(t,r?"":n.text,new
Error("Missing suggestion type")),!1):(SharedLogHelper.LogError(t,r?"":n.text,new
Error("Missing query")),!1):(SharedLogHelper.LogError(t,r?"":n.deviceItem?
n.deviceItem.id:"",new Error("Missing text")),!1)}function u(n,i,r){var
u=n.getExtraVerbs;n.getExtraVerbs=function(n){var f=u?u(n):[],e=i(n);return
t.joinVerbs(f,e,r)}}function lt(n,i,r){var
u=n.getExtraVerbsAsync;n.getExtraVerbsAsync=u?function(n){return
ThresholdUtilities.createPromise(function(f){return u(n).then(function(u){return
i(n).then(function(n){return f(t.joinVerbs(u,n,r))})})})}:i}function s(n,t){var
r=n.propertyHits||[],i=r.indexOf(t);return typeof i=="object"&&i.returnValue!
==undefined?i.returnValue:i>=0}function at(n){var i,t;if(n&&typeof
n=="object"&&n.length){for(i="",t=0;t<n.length;t++)i+=n[t],t!=n.length-1&&(i+=",
");return i}return n}function i(t,i,r){return n.safeExecute(function(){return
at(t.getProperty(i))},"get"+i,undefined,r)}function vt(n){for(var
r,u,e=[],i=2;i<arguments.length;i++)e[i-2]=arguments[i];for(r=0,u=e;r<u.length;r++)
{var f=u[r],h=f[0],o=f[1],c=f[2];if(o&&s(n,c))return t.createMatch(h,o)}return
null}function yt(n,i,r,u){var
f=i||"",s,h,o,c;for(n.textContentIfMatched&&(f+=(f?"\n\n":"")
+n.textContentIfMatched),s=!!f,h=function(){f&&(f+="\n");s&&(f+="\n",s=!
1)},r&&(h(),f+=u.getLocString("LastModified")+": "+r),o=0,c=e;o<c.length;o++){var
l=c[o],v=l[0],a=l[1],y=n[a];y&&(h(),f+=u.getLocString(t.MatchType[v])+":
"+n[a])}return f}function pt(n){switch(n){case t.MatchType.Author:case
t.MatchType.LastModifiedBy:case t.MatchType.Tags:case t.MatchType.Genre:case
t.MatchType.Album:case t.MatchType.Artist:return!0;case t.MatchType.Content:case
t.MatchType.Location:return!1;default:throw new Error("Unknown match type:
"+n);}}function wt(i,r,u,f,e,o,s,h,c,l,a,v,y,p,b,k,d,g,nt,tt)
{r&&n.isDataSourceEnabled(r,i)&&t.LocalDataProvider.getApps(u,function(t){var
u,s,i,o,h;if(l()){for(nt.instrumentResponseReceived(a,r,null,0,!
1),u=[],s=function(i){n.safeExecute(function(){return p(i,r,e(i).map(function(n)
{return t[n]}).filter(function(n){return!!n}),u)},"parseApp
"+r)},i=0,o=f;i<o.length;i+
+)h=o[i],s(h);v(r,u,null)}},y,r,tt);o&&n.isDataSourceEnabled(o,i)&&t.LocalDataProvi
der.getSettings(s,function(t){var
u,e,i,f,s;if(l()){for(nt.instrumentResponseReceived(a,o,null,0,!
1),u=[],e=function(i){n.safeExecute(function(){return
p(i,o,w(t[c(i)]),u)},"parseSetting "+r)},i=0,f=h;i<f.length;i+
+)s=f[i],e(s);v(o,u,null)}},y,o);b&&n.isDataSourceEnabled(b,i)&&t.LocalDataProvider
.getFiles(k,function(t){var r,f,i,u,e;if(l())
{for(nt.instrumentResponseReceived(a,b,null,0,!1),r=[],f=function(i)
{n.safeExecute(function(){return p(i,b,w(t[g(i)]),r)},"parseFile
"+b)},i=0,u=d;i<u.length;i++)e=u[i],f(e);v(b,r,null)}},i,y,b)}function bt(n,i)
{return t.isMobileCache?null:n.id==t.EdgeAppId?
i.getLocString("MicrosoftRecommendedBrowser"):i.getLocString("App")}function
kt(n,i){return t.isModernSetting(n)?
i.getLocString("SystemSettingsAnnotation"):i.getLocString("ControlPanelAnnotation")
}function dt(i,r,u,e,o,s,h){var c=t.getAppItem(o),l,v,w,y,b,it,k,d,tt;if(c)
{e&&g(o,c);o.primaryMetadata=bt(c,h);o.narratorText=t.getNarratorText(o);o.tooltip=
i.isSearchHomeZI?
o.text:"";o.type=="IBA"&&(o.tooltip=c.id,o.path=c.id);return}if(t.isSetting(o.type)
)
{o.primaryMetadata=kt(o.deviceItem,h);o.narratorText=t.getNarratorText(o);o.tooltip
=i.isSearchHomeZI?o.text:"";return}if(o.type=="LURL"&&(c=o.deviceItem,c))
{l=c.id;o.narratorText=t.getNarratorText(o,h.getLocString("DirectNavSuggestion"));o
.tooltip=o.query+"\n\n"+l;o.url=l;return}if(v=t.getBrowsingHistoryItem(o),v){var
l=v.url,p=n.prettyPrintUrl(l,r,!1),rt=r?
HitHighlightingParser.addMarkers(p,r):p,a=v.title;a&&(o.primaryMetadata=r?
HitHighlightingParser.addMarkers(a,r):a);o.text=rt;o.query=p;o.narratorText=t.getNa
rratorText(o,h.getLocString("DirectNavSuggestion"));o.template=1;o.tooltip=(a?
a+"\n\n":"")
+l;o.classNames.push("forceNoWrapOutsideTopResult");o.url=l;return}if(w=t.getFileIt
em(o),w){gt(i,r,u,e,s,o,w,h);return}if(o.type=="PT"||o.type=="CG"){if(y=o,o.type!
="PT"&&o.deviceItem.launchArguments||
(y.path=o.deviceItem.id),b=o.deviceItem,it=b.kind,it=="program")
{nt(o,h);return}if(k=ni(b),k)
{y.itemTypeDisplayName=k;f(i,r,u,y,h);return}o.type=="CG"&&nt(o,h);return}if(o.type
=="FEH")
{o.narratorText=t.getNarratorText(o,h.getLocString("SearchHistorySuggestion"));r&&(
o.text=HitHighlightingParser.addMarkers(o.text,r));return}if(d=t.getPowerBiItem(o),
d){tt=d.modelDisplayName;o.primaryMetadata=tt;o.additionalInfoText=" -
"+tt;o.narratorText=t.getNarratorText(o);return}throw new Error("Unexpected type:
"+o.type);}function gt(r,u,e,o,h,c,l,a){var
p,d,w,b,y,k,v,nt,tt;if(d=c.type=="LDOC"?
t.resolveKnownFolderGUIDsInPath(l.id):t.indexerFilePathToRegularPath(l.id),c.path=d
,c.itemTypeDisplayName=l.itemTypeDisplayName,o&&g(c,l),w=l.lastModifiedDate,n.isVal
idDate(w)&&(c.lastModifiedDate=w),b=l.extension,b&&(c.extensionLC=b.toLocaleLowerCa
se()),h!="MFF"||t.IndexerQueryGenerator)
{c.type=="MU"&&(c.artist=t.IndexerQueryGenerator?
i(l,"System.Music.DisplayArtist",h):i(l,"System.Music.Artist",h),c.album=i(l,"Syste
m.Music.AlbumTitle",h));y=void 0;switch(h)
{case"MDOC":c.author=i(l,"System.Author",h);c.lastModifiedBy=i(l,"System.Document.L
astAuthor",h);c.tags=i(l,"System.Keywords",h);s(l,"System.Search.Contents")&&(k=i(l
,"System.Search.AutoSummary",h),k&&(p=t.tryGetTextContentMatch(k,u),c.textContentIf
Matched=p[0],y=p[1]),l.propertyHits.length==1&&(c.matchedOnlyOnContent=!
0));break;case"MPHO":c.tags=i(l,"System.Photo.TagViewAggregate",h);break;case"MVID"
:t.IndexerQueryGenerator&&(c.artist=i(l,"System.Music.DisplayArtist",h),c.genre=i(l
,"System.Music.Genre",h));c.tags=i(l,"System.Keywords",h);break;case"MMUS":c.genre=
i(l,"System.Music.Genre",h)}!
c.text.includes(HitHighlightingParser.startMarker)&&u&&(v=void 0,nt=h!="LM"&&h!
="FL",nt&&(h=="MFF"?(v=i(l,"System.Title",h),v&&!
t.matchesOnPropertyHH(v,u)&&(v=undefined)):s(l,"System.Title")&&(v=i(l,"System.Titl
e",h))),v?c.text=HitHighlightingParser.addMarkers(v,u):y?c.match=y:
(tt=t.IndexerQueryGenerator?"System.Music.DisplayArtist":"System.Music.Artist",c.ma
tch=vt(l,h,[t.MatchType.Album,c.album,"System.Music.AlbumTitle"],
[t.MatchType.Artist,c.artist,tt],[t.MatchType.Genre,c.genre,"System.Music.Genre"],
[t.MatchType.Tags,c.tags,"System.Keywords"],
[t.MatchType.Tags,c.tags,"System.Photo.TagViewAggregate"],
[t.MatchType.Author,c.author,"System.Author"],
[t.MatchType.LastModifiedBy,c.lastModifiedBy,"System.Document.LastAuthor"])))}f(r,u
,e,c,a);ii(c,a)}function g(i,r){var u=n.safeExecute(function(){return
r.getProperty("System.Link.TargetParsingPath")},"getTargetPath"),f,e,o;u&&(u=u.toLo
caleLowerCase(),f=t.getKnownFolderPathLC(t.FOLDERID_Profile),f&&(e=t.getKnownFolder
PathLC(t.FOLDERID_SystemX86),e&&u.startsWith(e+"\\config\\systemprofile")?
u=f+u.substr(e.length+21):
(o=t.getKnownFolderPathLC(t.FOLDERID_System),o&&u.startsWith(o+"\\config\\systempro
file")&&(u=f+u.substr(o.length+21)))),i.targetPathLC=u)}function ni(n)
{if(n.launchArguments)return null;var t=n.itemTypeDisplayName;return t&&t[0]!="."?
t:null}function h(i,r){for(var o,y,h,c,a,u,l,f,v,s=[],e=0;e<i.length-1;++e)if(!
t.displayedInGridLayout(i[e].type))for(o=e+1;o<i.length;+
+o)if(i[e].type==i[o].type&&i[e].text.toLocaleLowerCase()==i[o].text.toLocaleLowerC
ase()){s[e]=!0;s[o]=!0;break}if(s.length!=0)for(y=i.filter(function(n,t){return
s[t]}),h=r.getLocString("InfoTextWithSource"),c=0,a=y;c<a.length;c+
+)if(u=a[c],u.path){if(l=u.path.lastIndexOf("\\"),l==-
1)continue;if(f=u.path.slice(u.path.lastIndexOf("\\",l-1)+1,l),v=u.handoffType==2?
null:u.primaryMetadata,v&&f.endsWith(":"))continue;u.type=="IBA"?
(u.secondaryMetadata=u.primaryMetadata,u.primaryMetadata=f):u.primaryMetadata=u.pri
maryMetadata?v?n.formatString(h,[f,u.primaryMetadata]):n.formatString(h,
[u.primaryMetadata,f]):f;u.additionalInfoText=n.formatString(h,["
-",f]);u.match&&(u.classNames=u.classNames.filter(function(n){return n!
="withMatchAnnotation"&&n!
="forceNoWrapOutsideTopResult"}));u.narratorText=t.getNarratorText(u);u.parentFolde
rDisambig=f}}function nt(n,i)
{n.primaryMetadata=i.getLocString("RunCommandPrompt");n.classNames.push("action");n
.narratorText=t.getNarratorText(n)}function ti(n){return n=="EBH"}function
tt(i,r,u,f,e,s,h,c,l,a){var
d=t.localDataSourceMayContainPII(u),g,b,y,nt,tt,k,it;if(!h)
{g=r.deviceItem.kind;SharedLogHelper.LogError("parseLocalSuggestion"+u,d?"":r.devic
eItem.displayName||r.deviceItem.id,new Error("Unrecognized kind:
"+g));return}if(b=h=="LURL"||h=="EBH"?1:2,n.isSuggestionTypeEnabled(u,h,b,i)){var
p=t.getEffectiveQuery(i),w=ti(h)?null:r.deviceItem.displayName,rt=w&&p?
HitHighlightingParser.addMarkers(w,p):w,v=t.createSuggestion(i,rt,r.getIcon,r.icon,
h,w,n.InstrumentedItem.createInstrumentedItem(f,h),b,f,d);v.uxHint=oi(r,p,e);r.devi
ceItem.isSimulated||
(v.deviceItem=r.deviceItem);v.ciMetaData=r.ciMetaData;t.isApp(h)&&(v.pinnedToTaskba
r=e.isPinnedToTaskbar(r.deviceItem.id));r.groupDisplayName&&(v.groupDisplayName=r.g
roupDisplayName);y=t.getAppItem(v);y?(v.click=function(){return
e.launchAppItem(y,u,v.appContext)},t.config.maxJLcm&&ri(i,v,y,e,s,f,u,c)):v.type=="
FEH"?v.click=function(){return
e.submitFileExplorerTextSuggestion(v.query)}:v.type=="FD"&&t.RuntimeConfig.QfMode==
5?v.click=function(){return e.submitFileExplorerFolderSuggestion(v.path)}:
(nt=t.getBrowsingHistoryItem(v),nt?(tt=v.url,v.click=function(){return
e.launchUri(tt)},v.getIcon=e.getEdgeIcon):v.click=function(){return
e.launchDeviceItem(v.deviceItem,u)});y&&v.type!="IBA"||t.isSetting(v.type)||
t.isFileOrFolder(v.type)&&v.type!="LDOC"?v.getMruData=function()
{return{type:v.type,handoffType:v.handoffType,hc:v.hc,highConfidenceMetaSuggestionS
core:v.highConfidenceMetaSuggestionScore,prefetchConfidenceScore:v.prefetchConfiden
ceScore,id:r.deviceItem.id,suggestionKey:t.getSuggestionKey(v),appContextData:v.app
Context?
{appContext:v.appContext,query:v.query,textWithoutHH:HitHighlightingParser.removeMa
rkers(v.text)}:undefined}}:(k=t.getCommandLineItem(v),k?
v.hc=t.isRealCommand(v,k):h=="PBI"&&(v.hc=r.deviceItem.rankScore>900));it=t.getGrou
pType(v);t.shouldSetThisPcGroupSource(it,i)&&(v.sourceForGroup=1);dt(i,p,t.isL2(i),
t.supportsShortcuts(u,i),v,u,e);t.RuntimeConfig.QfMode==5&&(v.additionalInfoText=un
defined,v.primaryMetadata=undefined,v.secondaryMetadata=undefined);o(v,"parseLocalS
uggestion "+u)&&a(v)&&l.push(v)}}function ii(n,i){u(n,function(){var r,u;return
n.duplicates&&(r=n.duplicates.find(function(n){return n.handoffType==7||
n.handoffType==8}),r)?
(u=[],u.push({verb:t.JumplistActionItemType[t.JumplistActionItemType.S_OpenInBrowse
r],displayName:i.getLocString("OpenInBrowser"),executeSync:function(){return
i.launchUri(r.url+(r.handoffType==8?"?web=1":""))},icon:
{type:1,content:"&#xE774"}}),r.locationUrl&&u.push({verb:t.JumplistActionItemType[t
.JumplistActionItemType.S_OpenFileLocationInBrowser],displayName:i.getLocString("Op
enFileLocationIn",t.getGroupSourceDisplayName(r.sourceForGroup,i)),executeSync:func
tion(){return i.launchUri(r.locationUrl)},icon:{type:2,content:"&#xE838"}}),u):
[]},!0)}function it(i,r){return!t.config.enableFallbackIconsForJumpLists||!p[i]?!
1:n.contains(p[i],r)}function ri(n,i,r,f,e,o,s,h){var
l=r.id,p=r.filePath,v=t.config.enableJumplistRestrictions&&ut[l],b,w;if(!
v&&p&&t.config.enableJumplistRestrictions){b=p.toLowerCase();for(w in
y)if(b.includes(w)){v=y[w];break}}v&&v.length==0||(t.RuntimeConfig.AlwaysWide||!
ft.find(function(n){return n==l}))&&(i.calculateChildSuggestions=function(){return
ui(n,l,p,i,r,v,f,e,o,s,h)},t.config.maxJLcm&&u(i,function(n){var u=[],o,s;return
n||(i.calculateChildSuggestions&&i.calculateChildSuggestions(),!
i.childSuggestions||t.RuntimeConfig.AlwaysWide&&i.previewPaneType||(o=!
1,i.childSuggestions.filter(function(n){return n.type=="JL"&&!
n.displayed&&n.groupType==t.GroupType.JumpListTasks}).slice(0,t.config.maxJLcm).for
Each(function(n){o=!0;var t=it(i.deviceItem.id,n.groupType)?
i.getIcon:c(n.jumpListItem,n.parent,!
1,l),s={verb:"JumpListTask_"+l+"_"+n.text,displayName:n.text,executeSync:function()
{return a(r,n,f,e)},getIcon:t};u.push(s)}),s=!
1,i.childSuggestions.filter(function(n){return n.type=="JL"&&!
n.displayed&&n.groupType!
=t.GroupType.JumpListTasks}).slice(0,t.config.maxJLcm).forEach(function(n,t){var
i,h;o&&!s&&(i={},u.push(i));s=!
0;h={verb:"JumpList_"+l+"_"+t,displayName:n.text,executeSync:function(){return
a(r,n,f,e)},getIcon:c(n.jumpListItem,n.parent,!0,l)};u.push(h)}))),u},!0))}function
ui(i,r,u,f,e,s,v,y,p,w,b){var
nt,d,ot,k,tt,ft,g,ut,et,ct;if(f.calculateChildSuggestions=null,nt=e.jumpList,nt&&nt
.length!=0)
{for(d=u||"",ot=d.indexOf("}"),d=d.substr(ot+1),k=[],tt=0,ft=nt;tt<ft.length;tt+
+)if(g=ft[tt],!s||n.contains(s,g.type)){var st=l(g.type),ht=st!
=t.GroupType.JumpListTasks,lt=function(u){var w;if(rt(u))return"continue";var
b=it(f.deviceItem.id,l(g.type))?
f.getIcon:c(u,f,ht,r),h="JL",s=t.createSuggestion(i,u.displayName,b,null,h,u.displa
yName,n.InstrumentedItem.createInstrumentedItem(p,h),2,f.sequenceNumber,ht,null,nul
l,!0);s.click=function(){return
a(e,s,v,y)};s.jumpListItem=u;s.groupType=st;s.groupDisplayName=g.name;s.parent=f;s.
tooltip=u.description;w=d&&u.path.endsWith(d);w||
(s.path=u.path);o(s,"calculateJumpListSuggestions")&&(k.push(s),fi(e,s,v,y))};for(u
t=0,et=g.items;ut<et.length;ut+
+)ct=et[ut],lt(ct)}k.length>0&&(f.childSuggestions=f.childSuggestions?
f.childSuggestions.concat(k):k,h(k,v),b.instrumentDataSource(p,w,k,null))}}function
c(n,i,r,u){return function(f,e){return
t.getIcon(n,u+"_"+n.path+"_"+n.displayName,"jumpList",!r,!1)(f,function(n){n?
e(n):i.getIcon(f,e)})}}function rt(i){return i.displayName?!
t.RuntimeConfig.AlwaysWide&&n.olderThan2Weeks(i.lastAccessed)?!0:!1:!0}function
l(n){switch(n){case 0:return t.GroupType.JumpListTasks;case 1:return
t.GroupType.JumpListPinned;case 2:return t.GroupType.JumpListRecent;case 3:return
t.GroupType.JumpListFrequent;default:return t.GroupType.JumpListCustom}}function
a(n,i,r,u){t.Promise.safeChain("launchJumpList",function(){return
i.jumpListItem.launchAsync()},null,function()
{i.jumpListItem.deleteAsync&&t.DialogBox?
t.DialogBox.show(r.getLocString("JumpListItemUnavailableDeleteConfirmation"),
[{id:null,text:r.getLocString("Cancel"),selected:!0,action:function(){return
r.setFocusInSearchBox(null,"jumpListItemDialogBoxCancel")}},
{id:null,text:r.getLocString("Remove"),selected:!1,action:function()
{v(n,i,r,u);r.setFocusInSearchBox(null,"jumpListItemUnavailable1")}}]):
(u.showTemporaryMessage(r.getLocString("JumpListItemUnavailable")),v(n,i,r,u),r.set
FocusInSearchBox(null,"jumpListItemUnavailable2"))})}function v(n,i,r,u){var
f=function(){return ei(i)},e;i.jumpListItem.deleteAsync?
(e=i.parent.childSuggestions.length==1,t.Promise.safeChain("deleteJumpList",functio
n(){return i.jumpListItem.deleteAsync()},function()
{n.getJumpListAsync&&t.Promise.safeChain("getJumpListAsync",function(){return
n.getJumpListAsync()},function(n){e&&n.some(function(n){return
l(n.type)==i.groupType&&n.items.some(function(n){return!rt(n)})})?f():
(r.refreshCurrentPane(),u.showTemporaryMessage(r.getLocString("RemovedFromList",i.t
ext)))},f)},f)):f()}function fi(n,t,i,r){t.jumpListItem.deleteAsync&&u(t,function()
{var
u={verb:"RemoveFromThisList",displayName:i.getLocString("RemoveFromThisList"),execu
teSync:function(){return v(n,t,i,r)},icon:{type:2,content:"&#xE711"}};return[u]},!
0)}function ei(n){var i=_ge(n.id);t.setVisibility(i,!1);n.suppressed=!0}function
oi(n,t,i){if(n&&n.uxHint){var r=t?
HitHighlightingParser.addMarkers(n.uxHint,t):n.uxHint;return
i.getLocString("RelatedSynonym",r)}return null}var
r=SearchAppWrapper.CortanaApp,ut={"Microsoft.MicrosoftEdge_8wekyb3d8bbwe!
MicrosoftEdge":[0],"Microsoft.InternetExplorer.Default":[0],Chrome:
[0],"360browser":[0]},y={skype:[],outlook:[0],"360browser":[0],chrome:[0],iexplore:
[0],opera:[0],firefox:[0],safari:
[0]},e=[[t.MatchType.LastModifiedBy,"lastModifiedBy"],
[t.MatchType.Author,"author"],[t.MatchType.Artist,"artist"],
[t.MatchType.Album,"album"],[t.MatchType.Genre,"genre"],
[t.MatchType.Tags,"tags"],],p={"Microsoft.MicrosoftEdge_8wekyb3d8bbwe!
MicrosoftEdge":
[t.GroupType.JumpListTasks],"Microsoft.MicrosoftStickyNotes_8wekyb3d8bbwe!App":
[t.GroupType.JumpListTasks],"Microsoft.XboxApp_8wekyb3d8bbwe!Microsoft.XboxApp":
[t.GroupType.JumpListCustom],"com.squirrel.Teams.Teams":
[t.GroupType.JumpListTasks],"Microsoft.ScreenSketch_8wekyb3d8bbwe!App":
[t.GroupType.JumpListTasks]},ft=["Microsoft.Windows.Explorer",],d;t.getFileExtensio
n=et;t.toDate=ot;t.getTodayTimeString=st;t.setFileTemplate=f;t.enrichMetadataFromDu
plicate=ht;t.getOneDriveSuggestionIcon=ct;t.getIconForTypeAsync=b;t.isValidIcon=k;t
.isValidSuggestion=o;t.setExtraVerbs=u;t.setExtraVerbsAsync=lt;d=function()
{function i(n,t,i)
{this._host=n;this._instrumentationHelper=t;this._temporaryMessageHandler=i}return
i.prototype.parse=function(i,r,u,f,e,o){for(var v,y,s=this,c=[],p=function(t)
{n.safeExecute(function(){return
tt(i,t,u,r,s._host,s._temporaryMessageHandler,t.suggestionType,s._instrumentationHe
lper,c,function(){return!0})},"parseLocalSuggestion
"+u)},l=0,a=f.suggestions;l<a.length;l++)v=a[l],p(v);
(t.isFileOrFolderLocalDataSource(u)||
u=="IBA")&&h(c,this._host);y={maxedOut:f.maxedOut};o(u,c,y)},i}
();t.SuggestionsParser=d;t.lookupById=wt;t.decorateSuggestionsWithParentFolder=h;t.
parseLocalSuggestion=tt})(t=n.WSB||(n.WSB={}))}(AutoSuggest||
(AutoSuggest={})),function(n){var t;(function(t){var i;(function(i)
{i.currentCIVersion="-1";var r=function(){function r(u,f,e,o){var s=this;
(this._ariaLogger=e,this._lightweightStorage=o,f.bindShown(function(){var
n=s.getContstraintIndexInfo(u.lastUrl);i.currentCIVersion=n?String(n.version):"-
1"}),f.hasFallbackHappened())||f.bindAppHidden(function(){var
a,h,o;if(n.isBingEnabled()&&n.isBrowserOnline()){var
w=n.getWindowHost().toLowerCase(),nt=w=="bing.com"||
w.endsWith(".bing.com"),tt=typeof ClientTestHooks=="undefined";if(!nt&&(tt||!
ClientTestHooks||!
ClientTestHooks.isTesthookParamSet("isTest")))return;if(a=s._lightweightStorage.get
Item(r.LastCIDownloadAttemptKey),h=null,a&&(h=new
Date(a)),h&&(s.getTimeDiffInMins(h)<t.config.waitBetweenCIDownloadCallsInMins?
t.config.waitBetweenCIDownloadCallsInMins:0))return;o=s.getContstraintIndexInfo(u.l
astUrl);i.currentCIVersion=String(o.version);var
v=t.getCurrentLanguage(),e=t.config.ciVersion,b=u.urlResult,f=s.parseUrlResult(b),k
=i.currentCIVersion,d=s.getUrlForCiCab(e,v),g=n.contains(t.config.blacklistedCiVers
ions,o.version)&&e<o.version,it=e==f.version&&f.errorCode!
="00000000";if(e>0&&t.config.supportedCiMarkets[v]&&(v!=o.language||e>o.version||
g||it)&&(!f.url||g||u.lastUrl==f.url||f.errorCode!="00000000")){var
y="cis_v"+e,p="ci_v"+e,c=s._lightweightStorage.getItem(y)?
parseInt(s._lightweightStorage.getItem(y)):0,l=s._lightweightStorage.getItem(p)?
parseInt(s._lightweightStorage.getItem(p)):0;s._lightweightStorage.setItem(r.LastCI
DownloadAttemptKey,n.getCurrentDate().toString());t.Promise.safeChain("constraintIn
dexDownloader.tryDownloadFromUrlAsync",function(){return
u.tryDownloadFromUrlAsync(d)},function(n){if(n){var
t=s.getContstraintIndexInfo(u.lastUrl);i.currentCIVersion=String(t.version);c+
+;s._lightweightStorage.setItem(y,c.toString())}else
SharedLogHelper.LogError("constraintIndexDownloader.tryDownloadFromUrlAsync","urlRe
sult: "+b,"Download failed");l+
+;s._lightweightStorage.setItem(p,l.toString());s._ariaLogger&&(f=s.parseUrlResult(
u.urlResult),s._ariaLogger.logCIDownloadStatus(i.currentCIVersion==String(e)&&n,!
1,f.version==1?!0:!
1,String(e),k,i.currentCIVersion,c.toString(),l.toString(),f.errorCode))},function(
n)
{s._ariaLogger&&(f=s.parseUrlResult(u.urlResult),s._ariaLogger.logCIDownloadStatus(
!1,!0,f.version==1?!0:!
1,String(e),k,i.currentCIVersion,c.toString(),l.toString(),f.errorCode,n.message))}
,null,d)}}})}return r.prototype.parseUrlResult=function(n){var
r=null,t=null,u=1,i,f;return n&&(i=n.split(":0x"),i.length>1?(r=i[0],t=i[1],t!
="00000000"&&SharedLogHelper.LogError("constraintIndexDownloader.urlResult",t,"Down
load encountered
problems"),f=this.getContstraintIndexInfo(r),u=f.version):SharedLogHelper.LogError(
"constraintIndexDownloader.parseUrlResult","urlResult: "+n,"Invalid URL")),
{url:r,version:u,errorCode:t}},r.prototype.getContstraintIndexInfo=function(n){var
r=-1,u="",t,i;return n&&(t=n.split("/"),t.length>1?(i=t[t.length-
1].split("."),u=i.length==2?i[0]:"",r=+t[t.length-
2]):SharedLogHelper.LogError("constraintIndexDownloader.getContstraintIndexInfo","u
rl: "+n,"Invalid URL")),
{version:r,language:u}},r.prototype.getUrlForCiCab=function(n,t)
{return"https://www.bing.com/bcs/ci/"+n+"/"+t+".cab"},r.prototype.getTimeDiffInMins
=function(t){if(!n.isValidDate(t))return 0;var
i=t.getTime(),r=n.getCurrentTime();return Math.round((r-i)
%864e5%36e5/6e4)},r.LastCIDownloadAttemptKey="LastCIDownloadAttempt",r}
();i.ConstraintIndexDataLoader=r})(i=t.ConstraintIndex||(t.ConstraintIndex={}))})
(t=n.WSB||(n.WSB={}))}(AutoSuggest||
(AutoSuggest={}));__extends=this&&this.__extends||function(){var n=function(t,i)
{return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t)
{n.__proto__=t}||function(n,t){for(var i in
t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r()
{this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):
(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var r="OneDrive
provider called without {0}",u=function(i){function u(n){var
t=i.call(this,"MODC")||this;return t._accessTokenManager=n,t}return
__extends(u,i),u.prototype.getName=function()
{return"MyStuffOneDriveDataProvider"},u.prototype.getAllAccountTokens=function(i)
{if(t.RuntimeConfig.QfMode==5){var
u=SearchAppWrapper.CortanaApp.fileExplorerSuggestionPage.currentSyncRootAccount;u?
this._accessTokenManager.getAccountByUserName(!1,0,u,!1,!0,function(n){n&&n.Token?
i([n.Token]):i(null,"AccountNotFound")},"Windows"):t.config.fileExplorerCloudInSpec
ialFolders&&t.isFileExplorerCurrentPathThisPcOrQuickAccess?
this._accessTokenManager.getAllSyncingAccounts(!1,0,!1,!0,function(n){n.length>0?
i(n.map(function(n){return n.Token})):i(null,"NoAccountsFound")},"Windows"):
(SharedLogHelper.LogError("MyStuffOneDriveParser","QfMode="+t.RuntimeConfig.QfMode,
new Error(n.formatString(r,
["currentSyncRootAccount"]))),i(null,"CurrentSyncRootAccount"))}else
t.getAuthAccountForCloudContent()=="Windows"&&t.cortanaAccountType!
=3&&t.getWindowsAndCortanaAccountIdentityDiff()!=1&&t.substrateProvidersEnabled()?
this._accessTokenManager.getAccount(0,t.getBingResourceOrScope(0),!1,!0,function(n)
{n&&n.Token?
i([n.Token]):i(null,"NoAccountsFound")},"Windows"):i(null)},u.prototype.getBaseUrl=
function(){return
t.config.myStuffOneDriveRootUrl},u.prototype.getPostBody=function(n){return
n.taskFrame?n.taskFrame.raw:""},u.prototype.fetch=function(t,r,u,f,e,o,s){var
l=this,h,c;n.isDataSourceEnabled(this._dataSource,t)&&(h={numOfPendingResponses:0},
c=function(c){var v=Object.assign({},s),a;c&&(v["X-Search-
RPSToken"]=c);a=Object.assign({},o);delete
a[n.Service.QueryParams.ImpressionGuid];delete
a[n.Service.QueryParams.RequestElToken];i.prototype.fetch.call(l,t,function(n,t,i,u
,f){--h.numOfPendingResponses;r(n,t,i,u,f,h.numOfPendingResponses!
=0)},u,f,e,a,v)},this.getAllAccountTokens(function(n,t){t?
r(l._dataSource,null,t,null,null,!1):n?
(h.numOfPendingResponses=n.length,n.forEach(function(n){return c(n)})):
(h.numOfPendingResponses=1,c(null))}))},u}
(n.JsonDataProvider),i;t.MyStuffOneDriveDataProvider=u;i=function(){function i(n)
{this._host=n}return i.prototype.parse=function(n,i,r,u,f,e){var
o=[];u&&(u.Results?
(this.addContent(n,o,u.Results.OneDriveDocuments,"FL",t.Scope.Documents,i),this.add
Content(n,o,u.Results.OneDriveFolders,"FD",t.Scope.Folders,i),this.addContent(n,o,u
.Results.OneDriveImages,"LI",t.Scope.Photos,i),this.addContent(n,o,u.Results.OneDri
veVideos,"LV",t.Scope.Videos,i),this.addContent(n,o,u.Results.OneDriveAudio,"MU",t.
Scope.Music,i)):SharedLogHelper.LogError("MyStuffOneDriveParser",null,new
Error("Missing Results
property")));t.decorateSuggestionsWithParentFolder(o,this._host);e("MODC",o,null)},
i.prototype.addContent=function(i,r,u,f,e,o){var
s=this,c,l,v,a;if(u&&n.isSuggestionTypeEnabled("MODC",f,7,i)){var
h=t.Scope[e],y=function(u){var k,c,d,w,g,b;if(!u.Content)return
SharedLogHelper.LogError("MyStuffOneDriveParser",h,new Error("Missing Content
property")),{value:void 0};if(c=u.Content.OneDriveData,!c)return
SharedLogHelper.LogError("MyStuffOneDriveParser",h,new Error("Missing OneDriveData
property")),{value:void
0};if(d=c.propertyHits.length==1&&c.propertyHits[0]=="TextContent",d&&(!
t.config.minLengthForContentMatch||
i.queryToFetch.length<t.config.minLengthForContentMatch))return{value:void
0};if(w=c.SeeMore,!w)return SharedLogHelper.LogError("MyStuffOneDriveParser",h,new
Error("Missing SeeMore property")),{value:void 0};var
v=t.getEffectiveQuery(i),a=t.decodeHtml(c.Name),y=void
0;if(a.includes(HitHighlightingParser.startMarker)?
y=HitHighlightingParser.removeMarkers(a):
(y=a,a=HitHighlightingParser.addMarkers(y,v)),f=="FL"&&(g=c.FullPath.lastIndexOf("\
\"),g!=-1)){var
nt=c.FullPath.substr(g+1),tt=HitHighlightingParser.addMarkers(nt,v),rt=!
tt.includes(HitHighlightingParser.startMarker)&&a.includes(HitHighlightingParser.st
artMarker);rt||(a=tt,y=nt)}var
it=t.ScopeConfig[e].icon,ut=t.isMedia(f),ft=t.getOneDriveSuggestionIcon(ut,it,c.Thu
mbnail.replace(":Thumbnail",":Cropped176x176#h=176&w=176"),c.Extension,c.Id),l=t.cr
eateSuggestion(i,a,ft,it,f,y,n.InstrumentedItem.createInstrumentedItem(o,f),7,o,!
0);l.url=w;l.path=c.FullPath;l.matchedOnlyOnContent=d;l.lastModifiedDate=t.toDate(c
.DateModified);c.Extension&&(l.extensionLC=c.Extension.toLocaleLowerCase());b=void
0;f=="FL"&&c.TextContent&&n.contains(c.propertyHits,"TextContent")&&(k=t.tryGetText
ContentMatch(c.TextContent,v),l.textContentIfMatched=k[0],b=k[1]);c.Artist&&(l.arti
st=HitHighlightingParser.removeMarkers(c.Artist));c.Album&&(l.album=HitHighlighting
Parser.removeMarkers(c.Album));a.includes(HitHighlightingParser.startMarker)||(b?
l.match=b:c.Path&&n.contains(c.propertyHits,"Path")&&(l.match=t.tryGetLocationMatch
(c.Path,v)));l.sourceForGroup=2;t.setFileTemplate(i,v,t.isL2(i),l,p._host);l.click=
function(){return
s._host.launchUri(w)};c.LocationUrl&&(l.locationUrl=c.LocationUrl,t.setExtraVerbs(l
,function(){var
n={verb:t.JumplistActionItemType[t.JumplistActionItemType.S_OpenFileLocationInBrows
er],displayName:s._host.getLocString("OpenFileLocationIn",t.getGroupSourceDisplayNa
me(2,s._host)),executeSync:function(){return
s._host.launchUri(c.LocationUrl)},icon:{type:2,content:"&#xE838"}};return[n]},!
0));t.isValidSuggestion(l,"MyStuffOneDriveParser
"+h)&&r.push(l)},p=this;for(c=0,l=u;c<l.length;c++)if(v=l[c],a=y(v),typeof
a=="object")return a.value}},i}();t.MyStuffOneDriveParser=i})(t=n.WSB||(n.WSB={}))}
(AutoSuggest||(AutoSuggest={})),function(n){var t;(function(t){var
i=SearchAppWrapper.CortanaApp,r="AFC",u=864e5,f=t.config.activityFeedWindow||
30,s=[1,7,f],e=4,h=32,c=32,l=function(){function o(n){var
t=this;n.bindDismissed(function()
{t._fetchContext&&(t._fetchContext.fetchInProgress=!
1,t._fetchContext=null)});n.bindShown(function()
{t._userActivityItemsCache=null})}return o.prototype.getName=function()
{return"ActivityFeedDataProvider"},o.prototype.fetch=function(i,u,e,o,h){var
l=this,c;i.enabledDataSources[r]&&(o.register(function(){l._callback=null},!
1,"AFCfetch"),this._callback=u,this._userActivityItemsCache?
(c=this._fetchContext&&this._fetchContext.fetchInProgress,n.invokeAsynchronously("A
ctivityFeedDataProvider.callback",function(){h()&&u(r,
{items:l._userActivityItemsCache.slice(0)},undefined,c?
3:1,undefined,c)})):this._fetchContext||(this._fetchContext={fetchInProgress:!
0},this.fetchChunked(0,this.getUserActivityItemsCount(),0,t.config.chunkAFCReqs?s:
[f],this._fetchContext)))},o.prototype.fetchChunked=function(t,i,r,f,e){var
o=this;if(t>=i){SharedLogHelper.LogError("AFCfetchChunked",null,new
Error("targetItemCount <= itemCount"));e.fetchInProgress=!1;return}var
s=n.getCurrentTime(),h=new Date(s-r*u),c=new Date(s-
f[0]*u);this.getUserActivityItemsWithOptionsAsync(function(n){if(e.fetchInProgress)
{t+=n.length;var r=t<i&&f.length>1&&f[1]>f[0];o.onChunkReceived(n,r);r?
o.fetchChunked(t,i,f[0],f.slice(1),e):e.fetchInProgress=!1}},c,h,i-
t)},o.prototype.onChunkReceived=function(n,t){var i;this._userActivityItemsCache||
(this._userActivityItemsCache=[]);
(i=this._userActivityItemsCache).push.apply(i,n);this._callback&&this._callback(r,
{items:n},undefined,undefined,undefined,t)},o.prototype.getUserActivityItemsWithOpt
ionsAsync=function(r,u,f,e){var
s=i.userActivityForWebHelper,o;n.safeExecute(function()
{o=s.createActivityQueryOptions();o.endTime=f;o.startTime=u;o.collapseOnActivityId=
!
0;o.activitySortAggregationType=4;o.activitySortByProperty="System.ActivityHistory.
EndTime";o.activitySortOrder=0},"createActivityQueryOptions",undefined,undefined,fu
nction(){return o=null});o?
t.Promise.safeChain("getUserActivityItemsWithOptionsAsync",function(){return
s.getUserActivityItemsWithOptionsAsync(e,!!
t.config.filterActivitiesToActivatableItems,o)},r,function(){return
r([])}):r([])},o.prototype.getUserActivityItemsCount=function(){var
n=i.textScaleFactor||1;return t.RuntimeConfig.AlwaysWide&&n==1?e:e-1},o}
(),o;t.ActivityFeedDataProvider=l;o=function(){function r(n){var
t=this;this._host=n;this._getEdgeIcon=n.getEdgeIcon;n.bindShown(function()
{t._isInternetConnectionMetered=n.isInternetConnectionMetered()})}return
r.prototype.parse=function(n,r,u,f,e,o,s){var
c=this,h,l;t.config.backplateAllIconsInZI?this.innerParse(n,r,u,f,e,o,s):
(h={},f.items.forEach(function(n)
{n&&n.appId&&(h[n.appId]=n.appId)}),l=Object.keys(h),t.Promise.safeChain("ActivityF
eedSuggestionsParser parse",function(){return
i.queryFormulationView.deviceSearch.findAppsAsync(l)},function(t){return
c.innerParse(n,r,u,f,e,o,s,t)},function(){return
c.innerParse(n,r,u,f,e,o,s)},s))},r.prototype.innerParse=function(i,r,u,f,e,o,s,h)
{for(var y,a=[],p=function(f){var y=!h||
h[f.appId]&&h[f.appId].isImmersive,o=c.getGetIcon(f,y),s=c.getIcon(f,o),l="AFC",e=t
.createSuggestion(i,f.activityDisplayText,s?
undefined:o,s,l,f.activityDisplayText,n.InstrumentedItem.createInstrumentedItem(r,l
),18,r,t.localDataSourceMayContainPII(u),f.id,function(){return
f.launchActivity()}),v;e.additionalInfoText=f.description||
f.contentUri;e.tooltip=f.activityDisplayText;e.additionalInfoText&&(e.tooltip+="\n\
n"+e.additionalInfoText);f.deleteActivityAsync&&t.config.deleteActivity&&(v={verb:"
RemoveFromActivityFeed",displayName:c._host.getLocString("RemoveFromActivityFeed"),
executeSync:function(){return f.deleteActivityAsync()},icon:
{content:"&#xE711",type:2}},n.WSB.setExtraVerbs(e,function(){return[v]},!
1));a.push(e)},c=this,l=0,v=f.items;l<v.length;l+
+)y=v[l],p(y);o(u,a,undefined)},r.prototype.getIcon=function(n,t){return
n.appImageUri&&!this._isInternetConnectionMetered?
{content:n.appImageUri,type:0,canFail:!0,isValidSize:function(n,t){return
n>=h&&t>=c},getFallbackIcon:t}:undefined},r.prototype.getGetIcon=function(n,i)
{return n.appId==t.EdgeAppId?
this._getEdgeIcon:t.Promise.safeChainWithGlobalCaching("activityFeedClientIcon",fun
ction(r){return n.getActivityAppLogoAsync(t.getImageSizeValue(r)).then(function(r)
{return t.toIcon(r,"activityFeedClientIcon toIcon",null,i?
n.logoBackgroundColor:undefined)})},function(i){return
n.id+"_"+t.getImageSizeValue(i)+"px"})},r}();t.ActivityFeedSuggestionsParser=o})
(t=n.WSB||(n.WSB={}))}(AutoSuggest||(AutoSuggest={})),function(n){var t;
(function(n){var t;(function(t){var i=function(){function t(t){var
i=this;t.bindQueryChangedOrInitialized(function(){(!
n.config.keepLastKeystrokeCache||
i._currentWebSignals)&&(i._previousWebSignals=i._currentWebSignals,i._currentWebSig
nals=null);(!n.config.enableCISpeller||
i._currentSpellerTrigger)&&(i._previousSpellerTrigger=i._currentSpellerTrigger,i._c
urrentSpellerTrigger=null)});t.bindConversationStart(function()
{i._previousWebSignals=null;i._currentWebSignals=null;i._previousSpellerTrigger=nul
l;i._currentSpellerTrigger=null;i._previousBestMatchSuggestion=null;i._previousQuer
y=null})}return t.prototype.setPreviousQuery=function(n)
{this._previousQuery=n},t.prototype.getPreviousQuery=function(){return
this._previousQuery||""},t.prototype.updateWebSignalsData=function(n,t)
{this._currentWebSignals={query:n,signals:t}},t.prototype.setPreviousTopHit=fu
nction(n)
{this._previousBestMatchSuggestion=n},t.prototype.getPreviousTopHit=function()
{return
this._previousBestMatchSuggestion},t.prototype.updateSpellerTriggerData=function(n,
t)
{this._currentSpellerTrigger={query:n,triggerSpeller:this.triggerSpellerOnTheNextKe
yStroke(t,n)}},t.prototype.getPreviousEventWebSignalsData=function(n){return
this._previousWebSignals&&this.isPreviousEventQuery(this._previousWebSignals.query,
n)?this._previousWebSignals.signals:null},t.prototype.disableCISpeller=function(n)
{return
this._previousSpellerTrigger&&this._previousSpellerTrigger.triggerSpeller&&this.isP
ossibleFirstMisspelling(n,this._previousSpellerTrigger.query)?!0:!
1},t.prototype.enableCISpeller=function(t){return n.config.enableCISpeller?
this._previousSpellerTrigger&&this._previousSpellerTrigger.triggerSpeller&&this.dis
ableCISpeller(t)?!
1:this._previousSpellerTrigger&&this.isPossibleFirstMisspelling(this._previousSpell
erTrigger.query,t)?!
0:this._previousSpellerTrigger&&(this.isTypedEventQuery(this._previousSpellerTrigge
r.query,t)||
this.isBackspaceEventQuery(this._previousSpellerTrigger.query,t))&&this._previousSp
ellerTrigger.triggerSpeller:this._previousSpellerTrigger&&this.isPreviousEventQuery
(this._previousSpellerTrigger.query,t)&&this._previousSpellerTrigger.triggerSpeller
},t.prototype.triggerSpellerOnTheNextKeyStroke=function(t,i){return
n.config.enableCISpeller==1?!0:t.every(function(n){return n.notAResult})?!
0:t.length>0&&this.isWebSpellCorrectedSuggestion(t[0])&&t.every(function(n){return
n.handoffType==0})?!0:n.config.enableCISpeller==2&&!t.some(function(t){return
n.isApp(t.type)||n.isSetting(t.type)})?!0:this.enableCISpeller(i)?!0:!
1},t.prototype.isWebSpellCorrectedSuggestion=function(n){return n.type=="SC"||
n.type=="OS"},t.prototype.isPreviousEventQuery=function(n,t){return
n&&t&&n.length==t.length-
1&&t.startsWith(n)},t.prototype.isBackspaceEventQuery=function(n,t){return
n&&t&&n.length==t.length+1&&n.startsWith(t)},t.prototype.isTypedEventQuery=function
(n,t){return(n||
n==="")&&t&&n.length<t.length&&t.startsWith(n)},t.prototype.isPossibleFirstMisspell
ing=function(t,i)
{if(n.config.firstMisspellingOnMatchedQuery&&this._previousBestMatchSuggestion){var
r=this._previousBestMatchSuggestion.ciMatchedQuery||
this._previousBestMatchSuggestion.query;return
r.toLocaleLowerCase().startsWith(t.toLocaleLowerCase())&&!
r.toLocaleLowerCase().startsWith(i.toLocaleLowerCase())&&this.isTypedEventQuery(t,i
)&&i.length>=n.config.enableCISpellerAtPrefixLength?!0:!1}return
this._previousBestMatchSuggestion&&this._previousBestMatchSuggestion.query.toLocale
LowerCase().startsWith(t.toLocaleLowerCase())&&!
this._previousBestMatchSuggestion.query.toLocaleLowerCase().startsWith(i.toLocaleLo
werCase())&&this.isTypedEventQuery(t,i)&&i.length>=n.config.enableCISpellerAtPrefix
Length?!0:!1},t}();t.PreviousKeystrokeCache=i})(t=n.Cache||(n.Cache={}))})
(t=n.WSB||(n.WSB={}))}(AutoSuggest||(AutoSuggest={})),function(n){var t;
(function(t){var i;(function(t){function c(n,t){e=n;var
s=_ge("dialogBox");s&&(sj_be(s,"click",function(n){var
r=n.target.id,t=i.filter(function(n){return n.id==r}).shift();t?
(t.action&&t.action(),u()):r=="dialog_overlay"&&u();sj_sp(n)},!
0),t.bindKeyDown(function(n){var e,o,t,s,u,i;if(r){e=void 0;switch(n){case
39:for(t=f(),o=!1,u=0,i=void 0;i=t[u];u++)if(o){e=i;break}else if(o=i.selected==!
0,o&&u+1==t.length){e=t[0];break}break;case 37:for(t=f(),s=void 0,u=0,i=void
0;i=t[u];u++){if(i.selected==!0){e=s?s:t[t.length-
1];break}s=i}}e&&h(e)}}),t.bindKeyEscape(function(n){o()&&(u(),n.handled=!
0)}))}function l(t,u){var f,o;if(i=[],u.length==0)throw new Error("DialogBox: Empty
buttons array");i=u.map(function(n,t){var i=n;return
i.id="dialog_b"+t,i.narratorText=i.text,i.selected&&(f=i.id),i});o={isVisible:!
0,messageText:t,buttons:i};e.updateDialogBox(o);f&&n.safeSetTimeout(function()
{return _ge(f).focus()},0,"DialogBox.show");r=!0}function u()
{if(r)e.updateDialogBox({isVisible:!1}),r=!1}function o(){return r}function f()
{return i}function a(){return f().map(function(n){return[n]})}function s(){return
f().filter(function(n){return n.selected}).shift()}function h(n){for(var
r,t=0,u=i;t<u.length;t+
+)r=u[t],r.selected=r.id==n.id,r.selected&&_ge(n.id).focus()}function v(){if(o())
{var n=s();n&&(n.action&&n.action(),u())}}function y(){return!1}var i=[],e,r=!
1;t.init=c;t.show=l;t.hide=u;t.isVisible=o;t.getSelectableItems=f;t.getSelectableIt
emsByGroup=a;t.getSelectedItem=s;t.select=h;t.submit=v;t.onAfterKeyDown=y})
(i=t.DialogBox||(t.DialogBox={}))})(t=n.WSB||(n.WSB={}))}(AutoSuggest||
(AutoSuggest={})),function(n){var t;(function(t){function l(n){return
n.includes("form=vsranf")}function a(t){var
i=n.tryParseUrl(t,!0);return!!i&&/[\?\&]q=/i.test(i.parameters)&&!/
[\?\&]view=detail/i.test(i.parameters)}function vt(t){var i=n.tryParseUrl(t,!
0);return!!i&&at.test(i.parameters)}function yt(n){switch(n){case 17:case 1:case
0:return 1;case 13:return 2;case 14:return 3;default:throw Error("Unsupported
handoff type: "+n);}}function v(n){switch(n){case 1:return 1;case 2:return 7;case
3:return 8;default:throw Error("Unsupported vertical: "+n);}}function y(t){var
i=n.tryGetBingPathLC(t);return i?n.contains(ct,i)?2:n.contains(lt,i)?
3:n.contains(n.WebSearchPaths,i)?1:null:null}var s=t.PreviewPaneWidth-
24,w="miniserp_focus",b="disableOutline",r=2,k=["tab-active","slide"],d=["aria-
expanded"],g="videoPreview",nt=300,f=30,tt="IsSearchAppXYFocusEnabled",it="WinJS",r
t="dFocusExit",i="win-xyfocus-
suspended",h="MiniSerpContentLoaded",ut="Rewards.ReportActivity.Success",ft="Reward
s.ReportActivity.Failure",p,o;t.MiniSerpFetchEvent="miniSERP.Fetch";var
et=["/account/","/settings.aspx"],u=function(){var n={};return
n[37]="left",n[39]="right",n[38]="up",n[40]="down",n}
(),ot=1e4,c=800,st=100,ht=["&form=s00037&"],ct=["/images/search","/images"],lt=["/v
ideos/search","/videos"],at=/[\?\&]FORM=HDRSC[1-3]/i,e="ClientInst";p=function()
{function i(i,r,f,e,o,s,c){var
l=this;this._page=i;this._host=r;this._navigationHelper=f;this._instrumentationHelp
er=e;this._sequenceNumberManager=o;this._msRewardsViewModel=s;this._latencyInstrume
ntation=c;this._deviceScale=1;this._previewRequestId=0;this._previousURLs=[];this.b
lockedMiniSERPUrls=[_w.location.origin+_w.location.pathname];this._root=_ge("qfPrev
iewPane");this._seeAllResults=_ge("seeAllResults");this._footer=_ge("footer");this.
_mask=_ge("previewMask");this._forceLoadScreen=_ge("forceLoadMessage");this._conten
tContainer=_ge("previewContainer");this._scrollArea=_ge("qfPreviewScrollArea");this
._loadingScreen=_ge("loadingScreen");sj_be(this._scrollArea,"scroll",function(t)
{l._iframe&&n.contains([2,3],l._currentVertical)&&l._iframe.contentWindow.dispatchE
vent(new
Event(t.type,t));l._calculateIFrameHeight&&l._calculateIFrameHeight()});this._foote
r&&sj_be(this._footer,"keydown",function(i){l._iframe&&n.isUpOrDownKey(i.keyCode)?
(i.keyCode==38?l.tryExecuteFocusOnMiniSerp(function(){return
l._focusHelper.moveFocusToEdgeFocusableElement(1)}):t.RuntimeConfig.AllowKeyboardNa
vCycling&&l.tryExecuteFocusOnMiniSerp(function(){return
l._focusHelper.moveFocusToEdgeFocusableElement(0)}),sj_pd(i),sj_sp(i)):i.keyCode==1
3&&l._footer.click()});this._mask&&t.RuntimeConfig.MiniSERPMode!
=0&&sj_be(this._mask,"keydown",function(n)
{n.keyCode==13&&l._mask.click()});sj_be(_w,"message",function(n){var r=n.data?
n.data.msWinJSXYFocusControlMessage:null,i,f;r&&r.type==rt&&(i=r.direction,f=r.keyC
ode,l._focusHelper&&!l._focusHelper.isL2Visible()&&l._focusHelper.getXYFocusRoot()!
=l._originalMiniSerpXYFocusRoot?
(l._focusHelper.setXYFocusRoot(l._originalMiniSerpXYFocusRoot),l.tryExecuteFocusOnM
iniSerp(function(){return l._focusHelper.moveFocus(i,f)})):(i!
=u[t.getRtlAdjustedKey(39)]&&n.source.blur(),i==u[40]||
i==u[38]&&t.RuntimeConfig.AllowKeyboardNavCycling?l._footer?
l._footer.focus():l._focusHelper.moveFocusToEdgeFocusableElement(i==u[38]?1:0):i!
=u[t.getRtlAdjustedKey(37)]||l._host.searchBoxHasFocus()||
l._host.setFocusInSearchBox(f,"previewPaneUnfocus")))});r.bindShown(function()
{ThresholdUtilities.getCortanaHeaders(function(n){n&&n["X-BM-
DeviceScale"]&&(l._deviceScale=+n["X-BM-
DeviceScale"]/100)});l.setVertical(1)});r.bindAppHidden(function()
{l._seeAllResults&&(l._seeAllResults.innerText="");l._currentVertical=null});r.bind
SearchBoxGotFocus(function()
{l._focusHelper&&l._focusHelper.onSearchBoxFocusChanged()});sj_evt.bind(h,function(
)
{l._onIFrameLoadedCallback&&(l._onIFrameLoadedCallback(),l._onIFrameLoadedCallback=
null)});this._msRewardsViewModel&&(sj_evt.bind(ut,function(n){var
t=n[1];l._msRewardsViewModel.notifyPointsRewarded(t)}),sj_evt.bind(ft,function(n)
{var t=n[1];SharedLogHelper.LogError("RewardsReportActivityFailureEvent",null,t?new
Error(t):null)}))}return i.prototype.init=function(n)
{this._previewPaneViewModelParent=n},i.prototype.finalizeKeystroke=function()
{},i.prototype.getSelectableItems=function()
{return[]},i.prototype.getSelectableItemsByGroup=function()
{return[]},i.prototype.getSelectedItem=function(){return
null},i.prototype.select=function(){},i.prototype.onAfterKeyDown=function(){return!
1},i.prototype.clear=function()
{this._previewedSuggestion=null;this._previewedQuery=null;this._onPreviewPaneRender
ed=null;this._footer&&(t.setVisibility(this._footer,!
1),this._footer.onclick=null);this._mask&&(t.setVisibility(this._mask,!
1),this._mask.onclick=null);this._forceLoadScreen&&this.clearForceLoadPage();this.c
learContent();this._previousURLs=[]},i.prototype.showForceLoad=function(n,i){var
r=this;this._instrumentationHelper.logClientInstEvent("Select","ForceLoadOpened",th
is._sequenceNumberManager.getSequenceNumber(),
{suggestionText:n});this.stopLoadingScreen();t.setVisibility(this._scrollArea,!
1);t.setVisibility(this._footer,!1);t.setVisibility(this._mask,!
1);t.setVisibility(this._forceLoadScreen,!
0);this.formatForceLoadPage(n);this._forceLoadScreen.onclick=function()
{r.clearForceLoadPage();r.startLoadingScreen();i()}},i.prototype.clearForceLoadPage
=function(){for(t.setVisibility(this._forceLoadScreen,!
1),t.setVisibility(this._scrollArea,!0),this._forceLoadScreen
.
onclick=null,this._forceLoadScreen.classList.remove("forceLoadContainer");this._for
ceLoadScreen.hasChildNodes();)this._forceLoadScreen.removeChild(this._forceLoadScre
en.lastChild)},i.prototype.formatForceLoadPage=function(n){var
s=this._host.getLocString("ForceLoadMessage"),h=this._host.getLocString("ForceLoadB
utton"),e=s.split("{0}"),o=sj_ce("div","","accentColor"),r,i,u,f,t;this._forceLoadS
creen.appendChild(o);r=_d.createElement("span");r.id="forceLoadIcon";r.innerHTML="&
#xE721";o.appendChild(r);i=sj_ce("div","forceLoadQueryText","");i.appendChild(_d.cr
eateTextNode(e[0]));u=_d.createElement("span");u.textContent=n;i.appendChild(u);i.a
ppendChild(_d.createTextNode(e[1]));this._forceLoadScreen.appendChild(i);f=sj_ce("d
iv","","");this._forceLoadScreen.appendChild(f);t=_d.createElement("button");t.clas
sName="c-
button";t.id="forceLoadSubmit";t.type="submit";t.textContent=h;f.appendChild(t)},i.
prototype.startLoadingScreen=function(){t.setVisibility(this._scrollArea,!
1);t.setVisibility(this._footer,!1);t.setVisibility(this._mask,!
1);t.setVisibility(this._loadingScreen,!
0)},i.prototype.stopLoadingScreen=function(){t.setVisibility(this._loadingScreen,!
1);t.setVisibility(this._scrollArea,!0)},i.prototype.clearContent=function()
{for(this._previewRequestId+=1,this._focusHelper=null,this._onIFrameLoadedCallback=
null;this._contentContainer.hasChildNodes();)this._contentContainer.removeChild(thi
s._contentContainer.lastChild);this._contentContainer.classList.remove("miniSerpCon
tainer");this._contentContainer.classList.remove("errorMessageContainer");this._ifr
ame&&(this._iframe=null,this._calculateIFrameHeight=null);this._mutationObserver&&(
this._mutationObserver.disconnect(),this._mutationObserver=null)},i.prototype.hasFo
cus=function(){if(this._host.searchBoxHasFocus())return!1;var
t=n.getCurrentActiveElement();return t&&t!
=this._iframe&&this._root.contains(t)},i.prototype.focus=function(){var
t=this,n;this.hasFocus()||(this._iframe?
(n=this.tryExecuteFocusOnMiniSerp(function(){return
t._focusHelper.moveFocusToLastFocusedElement()}),n?
this._host.setFocusInWebView("miniserp
focus"):this._host.setFocusInSearchBox(null,"MiniSERP VM Focus
failed")):this._previewPaneViewModelParent.focusPending=!
0)},i.prototype.readyToBlur=function(){return!0},i.prototype.blur=function()
{},i.prototype.setVertical=function(n){if(n!=this._currentVertical)
{if(this._seeAllResults)switch(n){case
1:this._seeAllResults.innerText=t.config.miniSerpPreview?
this._host.getLocString("SeeResultsBrowser"):t.config.wsbTransferText?
this._host.getLocString("OpenResultsBrowser"):this._host.getLocString("SeeAllResult
s");break;case
2:this._seeAllResults.innerText=this._host.getLocString("SeeAllImageResults");break
;case
3:this._seeAllResults.innerText=this._host.getLocString("SeeAllVideoResults");break
;default:throw new Error("Unsupported vertical type:
"+n);}this._currentVertical=n}},i.prototype.update=function(i,r,u,f,e){var
o=this,s,l,h,v,a,p;if(this._previewedSuggestion=i,this._previewedQuery=r,this._onPr
eviewPaneRendered=e,s=i.type=="MB"&&i.segments=="Organization"?
null:i.baseSearchUrl,l=yt(i.handoffType),this.setVertical(l),this._footer&&(this._f
ooter.onclick=function(t)
{o._previewPaneViewModelParent.onBeforeItemLaunch(n.getCurrentTime(),n.getInputType
(t),3);o._host.launchSearch(i.query,o._navigationHelper.getSearchUrl(r.fullPartialQ
uery,i.query,i.type,s,i.handoffType),!
1);o._previewPaneViewModelParent.onAfterItemLaunch(3)}),this._mask&&(this._mask.onc
lick=function(t)
{o._previewPaneViewModelParent.onBeforeItemLaunch(n.getCurrentTime(),n.getInputType
(t),3);o._host.launchSearch(i.query,o._navigationHelper.getSearchUrl(r.fullPartialQ
uery,i.query,i.type,s,i.handoffType),!
1);o._previewPaneViewModelParent.onAfterItemLaunch(3)}),h=l==2&&r.overrideAction==1
,t.config.th&&ClientTestHooks.isTesthookParamSet("noSerp"))
{this.renderIframe(null,"<html><body><\/body><\/html>",
{},undefined,h);v=n.getCurrentTime();this._previewPaneViewModelParent.onResponseRec
eived(v);return}var y=u==0,w=t.RuntimeConfig.QfMode==6?
undefined:y?"WMSRPA":"WMSRPM",c=h?
this._navigationHelper.getImageSearchUrl(t.config.enableSnipSearchV2):this._navigat
ionHelper.getSearchUrl(r.fullPartialQuery,i.query,i.type,s,i.handoffType,w,!
0,null,y);c+="&qfig="+this._instrumentationHelper.getImpressionGuid(this._sequenceN
umberManager.getSequenceNumber());this._msRewardsViewModel&&this._msRewardsViewMode
l.isRewardsEnabled()&&(c+="&rewards=1");this._previousURLs=[];h?(a=function()
{return o.renderErrorMessage(i.query)},p=r.overrideActionHandlerAsync,p(function(n)
{n?o.downloadAndDisplayMiniSerp(i,c,n,u,i.previewCallback):
(o.miniSerpErrorInstrumentation("notHaveMultipartBody"),a())},function()
{o.miniSerpErrorInstrumentation("bingImageSearchActionFailed");a()})):this.download
AndDisplayMiniSerp(i,c,null,u,i.previewCallback)},i.prototype.miniSerpErrorInstrume
ntation=function(n,t,i){var r;r=i?
{ErrorCause:n,ResponseRecievedTimeStamp:t.toString(),ResponseText:i.responseText,Co
ntentType:i.contentType,ResponseStatusCode:i.status.toString(),RequestStatusCode:i.
result.toString()}:
{ErrorCause:n};this._instrumentationHelper.logClientInstEvent(e,"MiniSERPError",thi
s._sequenceNumberManager.getSequenceNumber(),r)},i.prototype.renderErrorMessage=fun
ction(n){var
t=this._host.getLocString("PreviewPaneErrorMessage"),i=t.split("{0}"),r={fullPartia
lQuery:n,textParts:i};this._page.updatePreviewErrorMessageView(r)},i.prototype.down
loadAndDisplayMiniSerp=function(i,r,u,f,e){var h=this,c=!
1,l,a,v,y,p,o;t.config.th&&(l=ClientTestHooks.getUrlValue("client"),c=l&&l.toLowerC
ase()=="windows",a=ClientTestHooks.getUrlValue("previewPaneUrlOverride"),r=a?
decodeURIComponent(a):ClientTestHooks.CopyTestParameters(_w.location.search,r),c&&(
r=ThresholdUtilities.setUrlParameter(r,"client","windowsMiniSerp")),v=ClientTestHoo
ks.getUrlValue("miniSerpBag"),v&&(r=ThresholdUtilities.setUrlParameter(r,"bag",v)),
y=ClientTestHooks.getUrlValue("dummyref"),y&&(r=ThresholdUtilities.setUrlParameter(
r,"dummyref",y)));p=f==0;sj_evt.fire(t.MiniSerpFetchEvent,i,p);o=this._host.getCust
omHeaders(null);o["X-BM-
DeviceDimensionsLogical"]=s+"x"+this._root.clientHeight;o["X-BM-
DeviceDimensions"]=String(Math.round(s*this._deviceScale))
+"x"+this._root.clientHeight;c||(o["User-Agent"]=navigator.userAgent+"
RestrictedAPI");u&&(o["Content-Type"]=u.contentType);(p||
t.config.miniSerpStrictv2)&&(o["X-Search-SafeSearch"]="Strict");var w=+
+this._previewRequestId,b=n.getCurrentTime(),k=function(t){var
f=n.getCurrentTime();h._previewPaneViewModelParent.onResponseReceived(f);t.status==
200&&t.responseText?
(h._latencyInstrumentation&&h._latencyInstrumentation.logMiniSERPRequestLatency(f-
b),h._previousURLs.push(r),h.renderIframe(r,t.responseText,o,c,!!u,e)):
(h.miniSerpErrorInstrumentation("renderErrorMessage",f,t),h.renderErrorMessage(i.qu
ery))};this.fetchMiniSerpUrl(r,u?u.data:null,o,k,w,u?
0:t.config.miniSERPRequestRetries)},i.prototype.fetchMiniSerpUrl=function(i,r,u,f,o
,s){var h=this,c=f;s>0&&(c=function(n){if(n.result==0&&n.responseText)f(n);else{var
r={Url:i,StatusCode:n.status.toString(),Timeout:t.config.miniSERPRequestTimeout.toS
tring(),RetriesRemaining:s.toString()};h._instrumentationHelper.logClientInstEvent(
e,"MiniSERPRefetch",h._sequenceNumberManager.getSequenceNumber(),r);h.fetchMiniSerp
Url(i,null,u,f,o,s-1)}});n.fetchUrl(i,u,r,c,null,function(){return
o==h._previewRequestId},!0,r?
undefined:t.config.miniSERPRequestTimeout)},i.prototype.renderIframe=function(i,r,u
,f,e,o){var
s=this;this.clearContent();this._iframe=sj_ce("iframe","miniIframeSerp");this._ifra
me.setAttribute("scrolling","no");this._contentContainer.classList.add("miniSerpCon
tainer");this._contentContainer.appendChild(this._iframe);var
l=this._iframe.contentWindow,c=this._iframe.contentDocument,a=!
1;this._footer&&(t.setVisibility(this._footer,!e),t.setVisibility(this._mask,!
e));this.setIframeHeight(0);this._onIFrameLoadedCallback=function(){var
r=c.body,e=0,t;s._calculateIFrameHeight=function(){var n=r.offsetHeight;n!
=e&&n>0&&(e=s.setIframeHeight(n))};s._calculateIFrameHeight();s.overrideAjaxCalls(l
,u,f);s.captureNavigationsAndSizeEvents(i,r,l,c);s._scrollArea.scrollTop=0;n.contai
ns([2,3],s._currentVertical)&&(t={childList:!0,subtree:!0},s._mutationObserver=new
MutationObserver(function()
{s._calculateIFrameHeight&&s._calculateIFrameHeight()}),n.safeExecute(function()
{s._currentVertical===2?
s._mutationObserver.observe(c.getElementById("images"),t):s._currentVertical===3&&s
._mutationObserver.observe(c.getElementById("video"),t)},"onIFrameLoadedCallback"))
;s._msRewardsViewModel&&s._msRewardsViewModel.isRewardsEnabled()&&l.sj_rra&&l.sj_rr
a(i);s._onPreviewPaneRendered&&(s._onPreviewPaneRendered(!0,!
1,null),s._onPreviewPaneRendered=null)};this._iframe.onload=function(){if(a)
{s.tryLaunchUrl(i,l.location.href,0);return}a=!
0;s.overrideAjaxCalls(l,u,f)};c.open();c.write(r);c.write("<base href='"+i+"'
target='_parent'
/>");o&&o(this._iframe.contentWindow);c.write("<script>window.parent.sj_evt.fire('"
+h+"')<\/script>");c.close()},i.prototype.setIframeHeight=function(n){return
n<c&&(n=c),this._iframe.style.height=n+"px",n},i.prototype.overrideAjaxCalls=functi
on(n,t,i){var r=this;n.sj_gx=function(){var n=sj_gx(),u=n.open;return
n.open=function(f,e,o,s,h){if(r.blockedMiniSERPUrls.some(function(n){return
e.startsWith(n)}))throw new Error("MiniSERP blocked URL request: iFrame URL:
"+r._iframe.contentDocument.baseURI+" requestUrl:
"+e);f=="GET"&&i&&(e=ThresholdUtilities.setUrlParameter(e,"client","windowsMiniSerp
"));u(f,e,o,s,h);for(var c in
t)n.setRequestHeader(c,t[c])},n}},i.prototype.captureNavigationsAndSizeEvents=funct
ion(i,r,u,f){var
o=this,l;this._focusHelper=this.createFocusHelper(u,f);this._focusHelper&&(this._or
iginalMiniSerpXYFocusRoot=this._focusHelper.getXYFocusRoot());this._previewPaneView
ModelParent.focusPending&&(this._previewPaneViewModelParent.focusPending=!
1,this.focus());this._iframe.contentWindow.overlay_onBeforeContentLoad=function()
{o.setIframeHeight(ot)};this._iframe.contentWindow.overlay_onBeforeSuccess=function
(n){o.
setIframeHeight(n.clientHeight+st)};var s=function(){u.sj_lc=function(n)
{if(n)o.tryLaunchUrl(i,n,0);else{var t=o._previousURLs[o._previousURLs.length-
2];o._previousURLs.splice(o._previousURLs.length-
2,2);o.tryLaunchUrl(i,t,0)}};u.MiniSerp=!
0;o._calculateIFrameHeight()},c=function(n)
{o._focusHelper.setXYFocusRoot(n);o._focusHelper.moveFocusToEdgeFocusableElement(0)
},h=u.sj_evt;h?(l=["onP1","ajaxReady"],l.forEach(function(n){return
h.bind(n,s)}),h.bind("l2_overlay_visible",function(n){s();var
t=o._iframe.contentDocument.getElementById(n[1]);t&&(o._focusHelper.setIsL2Visible(
!0),c(t))}),h.bind("l2_overlay_hidden",function()
{s();o._focusHelper.setIsL2Visible(!
1);c(o._iframe.contentDocument.body)})):s();u.open=function(n){return
o.tryLaunchUrl(i,n,0),null};r.onclick=function(r){var u=r.target;if(u)
{if(u.id=="miniSERPToWeb")
{o._instrumentationHelper.logClientInstEvent(e,"AdultExplicitLoad",o._sequenceNumbe
rManager.getSequenceNumber(),
{url:i,query:o._previewedSuggestion.query});t.config.miniSerpStrictv2?
o._footer.click():
(o.clearContent(),o.startLoadingScreen(),o.update(o._previewedSuggestion,o._preview
edQuery,2,0,null));return}while(u&&!
u.href)u=u.parentNode}u&&o.tryLaunchUrl(i,u.href,n.getInputType(r))==0&&r.preventDe
fault()}},i.prototype.navigateInPlace=function(n,t,i,r){var
u=this,f=v(r),e,o;this._previewPaneViewModelParent.onBeforeItemLaunch(t,i,f);this._
footer&&(this._footer.onclick=function(){return
u._host.launchSearch(null,u.enrichBingSearchUrlParameters(n),!
1)});this.clearContent();this._previewPaneViewModelParent.focusPending=!
0;this._previewPaneViewModelParent.startLoadingScreen();e=this.enrichBingSearchUrlP
arameters(n,!
0);this.setVertical(r);o={destinationVertical:r.toString(),url:n};this._instrumenta
tionHelper.logClientInstEvent("Select","NavigateInPlace",this._sequenceNumberManage
r.getSequenceNumber(),o);this.downloadAndDisplayMiniSerp(this._previewedSuggestion,
e,null,1);this._previewPaneViewModelParent.onAfterItemLaunch(f)},i.prototype.tryLau
nchUrl=function(i,r,u){var s,f,h,e,c,o,p;if(!r)return
1;if(s=n.getCurrentTime(),r=r.trim(),f=r.toLowerCase(),h=y(r),h!==null&&a(r)&&!
l(f)&&(t.config.navigateRequeriesInsideMiniSERP||vt(r))&&h!
==this._currentVertical)return
this.navigateInPlace(r,s,u,h),0;if(f.startsWith("javascript:location.reload"))retur
n 0;if(r==i+"#"||f.startsWith("javascript:"))return 1;if(f=="/loading")return
0;if(r.startsWith(window.location.href))return
SharedLogHelper.LogError("previewPane.tryLaunchUrl",i,new Error("Anchor navigation
on PreviewPane")),0;if(r.startsWith("/")&&(r=n.getWindowProtocol()
+"//"+n.getWindowHost()+r),e=y(r),e)
{if(e==this._currentVertical&&a(r)&&(t.config.navigateRequeriesInsideMiniSERP||
ht.some(function(n){return f.includes(n)})))return
this.navigateInPlace(r,s,u,e),0;r=this.enrichBingSearchUrlParameters(r)}c=e?
v(e):2;this._previewPaneViewModelParent.onBeforeItemLaunch(s,u,c);o=n.tryGetBingPat
hLC(r);o?et.some(function(n){return o.startsWith(n)})||l(f)?
this._host.launchUri(t.config.settingsUri):o.startsWith("/profile/interests")?
this._host.launchCat1(null,"ms-
cortana://navigate/Notebook",null):o.startsWith("/fd/auth/")?
t.isCortanaPersonalized?SharedLogHelper.LogError("previewPane.tryLaunchUrl",i,new
Error("Redirecting to sign in page when already signed
in")):this._host.launchUri("ms-cortana://CapabilitiesPrompt/?
RequestedCapabilities=Personalization"):this._host.launchUri(r):
(t.config.openSearchTabMiniSerp&&(p=this._previewedSuggestion.baseSearchUrl,p&&this
._host.launchUri(this.buildSearchUrl(p),!
1)),this._host.launchUri(r));this._previewPaneViewModelParent.onAfterItemLaunch(c);
return 0},i.prototype.enrichBingSearchUrlParameters=function(n,t){return t===void
0&&(t=!
1),n=this._navigationHelper.enrichUrlWithMarketInfo(n),n=this._navigationHelper.enr
ichUrlWithDeviceInfo(n),n=this._navigationHelper.enrichUrlWithCvid(n),n=this._navig
ationHelper.enrichUrlWithSuggestionType(n,this._previewedSuggestion.type),t||
(n=this._navigationHelper.enrichUrlWithMuidInfo(n),n=this._navigationHelper.enrichU
rlWithSafeSearchInfo(n)),n},i.prototype.createFocusHelper=function(n,t){var
i=this.getSearchAppWinJSXYFocus(n);return!
i&&SearchAppWinJS&&SearchAppWinJS.initXYFocus&&(SearchAppWinJS.initXYFocus(n),i=thi
s.getSearchAppWinJSXYFocus(n),n[tt]=i?!0:!1),i?new
o(t,n,i,this._scrollArea,this._currentVertical):null},i.prototype.getSearchAppWinJS
XYFocus=function(n){var i,t=n[it];return
t&&t.UI&&(i=t.UI.XYFocus),i},i.prototype.tryExecuteFocusOnMiniSerp=function(n){var
t=!1;return this._focusHelper&&(t=n()),t||this._footer&&(this._footer.focus(),t=!
0),t},i.prototype.buildSearchUrl=function(t){return
_w.location.protocol+"//"+_w.location.host+t+"&form=WSBBST&cvid="+n.encodeQueryPara
meter(this._host.getConversationId())},i}();t.MiniSerpViewModel=p;o=function()
{function e(n,i,r,u,f,e){var
o=this;this._targetDocument=n;this._targetWindow=i;this._searchAppXYFocus=r;this._s
crollArea=u;this._verticalType=f;this._useStickyFocusOverride=e;this._isL2Visible=!
1;this._useStickyFocus=!
1;_w.ClientTestHooks&&ClientTestHooks.isTesthookParamSet("stickyFocus")===!
0&&(this._useStickyFocus=!0);this._useStickyFocusOverride!
=null&&(this._useStickyFocus=this._useStickyFocusOverride);var s="b_hide",h="acc-
inactive",c=".b_slidebar";this._focusDiv=sj_ce("div",w,s);n.body.appendChild(this._
focusDiv);sj_be(n,"blur",function(n){o._useStickyFocus?(!
n.srcElement.offsetParent||n.srcElement.classList.contains("b_hide")||
n.relatedTarget)&&t.setVisibility(o._focusDiv,!1):t.setVisibility(o._focusDiv,!
1)},!0);sj_be(n,"focus",function(){return
o.updateFocusedElementAndOutline(o._targetDocument.activeElement)},!
0);sj_be(n,"scroll",function(n)
{o._lastElementFocused&&(n.srcElement==o._lastElementFocused||
o._lastElementFocused.compareDocumentPosition(n.srcElement)&Node.DOCUMENT_POSITION_
CONTAINS)&&o.updateFocusedElementAndOutline(o._lastElementFocused)},!
0);sj_be(n,"transitionend",function(n){var t=o._targetDocument.activeElement;
(n.propertyName=="height"||n.srcElement==t.closest(c))&&(o._focusOutlineTimeout?
(o.clearFocusOutlineTimeout(),o.outlineElementAndScrollIntoView(t)):o._focusDiv.cla
ssList.contains(s)||
o.outlineElementAndScrollIntoView(t),n.srcElement.style.height=="0px"?
n.srcElement.classList.add(h):n.srcElement.classList.remove(h))});this._searchAppXY
Focus.keyCodeMap.home.push(36);this._searchAppXYFocus.keyCodeMap.end.push(35)}retur
n e.prototype.getXYFocusRoot=function(){return
this._searchAppXYFocus.focusRoot},e.prototype.isL2Visible=function(){return
this._isL2Visible},e.prototype.setIsL2Visible=function(n)
{this._isL2Visible=n},e.prototype.setXYFocusRoot=function(n)
{this._searchAppXYFocus.focusRoot=n},e.prototype.moveFocus=function(n,t){return
this._searchAppXYFocus._xyFocus(n,t)},e.prototype.moveFocusToEdgeFocusableElement=f
unction(n,t){var i,h;if(t===void 0&&(t=!
1),this._targetWindow.focus(),t&&n==0)i=this.focusFirstSerpElement();else{var
f=void 0,e=void 0,r=void
0,o=this._targetWindow.innerWidth,s=this._targetWindow.innerHeight;n==0?(f=-
1,e=0,r=40):n==1&&(f=s,e=s+1,r=38);h={top:f,bottom:e,right:o,left:0,height:1,width:
o};i=this._searchAppXYFocus._xyFocus(u[r],r,h)}return
i&&(this.scrollTo(n),this.updateFocusedElementAndOutline(this._targetDocument.activ
eElement)),i},e.prototype.onSearchBoxFocusChanged=function()
{this._targetDocument.hasFocus()?
this.updateFocusedElementAndOutline(this._targetDocument.activeElement):this._useSt
ickyFocus||t.setVisibility(this._focusDiv,!1)},e.prototype.isVisible=function(n)
{var t=_w.getComputedStyle(n);return!(t.visibility=="hidden"||t.display=="none"||
n.offsetWidth===0&&n.offsetHeight===0)},e.prototype.moveFocusToLastFocusedElement=f
unction(){return
this._lastElementFocused&&this.isVisible(this._lastElementFocused)?
(this._lastElementFocused.focus(),this.updateFocusedElementAndOutline(this._lastEle
mentFocused),!0):this.moveFocusToEdgeFocusableElement(0,!
0)},e.prototype.updateFocusedElementAndOutline=function(i){var r=this,u;i&&i!
=this._targetDocument.body&&(this.processFocusedElement(i),u=this._lastElementFocus
ed&&i.elementType&&i.elementType==this._lastElementFocused.elementType&&i.parentEle
ment==this._lastElementFocused.parentElement?nt:0,u?
(t.setVisibility(this._focusDiv,!
1),this._focusOutlineTimeout=n.safeSetTimeout(function()
{r._targetDocument.activeElement==i&&r.outlineElementAndScrollIntoView(i);r.clearFo
cusOutlineTimeout()},u,"updateFocusedElementAndOutline")):this.outlineElementAndScr
ollIntoView(i),this._lastElementFocused=i)},e.prototype.outlineElementAndScrollInto
View=function(n){var u,o,s;if(n!=this._targetDocument.body&&(this._useStickyFocus||
this._targetDocument.hasFocus())){var
i=n.getBoundingClientRect(),y=this._targetDocument.documentElement.scrollWidth-
r*2,p=this._targetDocument.documentElement.scrollHeight-
r*2,h=i.top+this._targetWindow.pageYOffset,e=i.left+this._targetWindow.pageXOffset,
w=y-e,b=p-h,c=e<0?Math.floor(i.width+e-r):i.width;if(c<=0)
{t.setVisibility(this._focusDiv,!
1);return}if(u=i.height,u<=0&&n.children.length>0)for(o=0;o<n.children.length;o+
+)s=n.children[o].getBoundingClientRect(),s.height>u&&(u=s.height,h=s.top);this._fo
cusDiv.style.top=Math.max(r,h)
+"px";this._focusDiv.style.left=Math.max(this.isL2Visible?r:r*4,e)
+"px";this._focusDiv.style.width=Math.min(w,c)
+"px";this._focusDiv.style.height=Math.min(b,u)
+"px";t.setVisibility(this._focusDiv,!0);var
l=n.getBoundingClientRect(),a=this._scrollArea.offsetHeight+this._scrollArea.scroll
Top-l.bottom-f,v=l.top-this._scrollArea.scrollTop-f;a<0?
this._scrollArea.scrollTop+=f-a:v<0&&(this._scrollArea.scrollTop+=v-
f)}},e.prototype.scrollTo=function(n){var
t=0;n==1&&(t=this._scrollArea.scrollHeight);this._scrollArea.scrollTop=t},e.prototy
pe.processFocusedElement=function(n){var r=this,u,e,o,c,f,s,h;n.isProcessed||
(u=n.tagName.toLocaleLowerCase(),e=n.getAttribute("type"),u=="select"&&(sj_be(n,"ke
ydown",function(t){t.keyCode==32?
n.classList.add(i):t.keyCode==13&&n.classList.remove(i)},!
0),this.reactivateXYFocusOnBlur(n)),u=="input"&&e=="range"&&(sj_be(n,"keydown",func
tion(t){var

r=t.target,f=+r.getAttribute("min"),e=+r.getAttribute("step"),u=t.keyCode==37,o=t.k
eyCode==39,s=+r.value-e<f&&u;t.keyCode==38||t.keyCode==40||s?n.classList.remove(i):
(u||o)&&n.classList.add(i)},!0),this.reactivateXYFocusOnBlur(n)),o=function(t,r)
{var u;if(!r.readOnly){if(u=r.selectionStart!=r.selectionEnd,u)
{n.classList.add(i);return}var
f=r.selectionEnd==0,e=r.selectionEnd==r.value.length,o=t.keyCode==36&&!
f,s=t.keyCode==35&&!e,h=t.keyCode==37&&!f,c=t.keyCode==39&&!e;h||c||o||s?
n.classList.add(i):n.classList.remove(i)}},u=="textarea"&&(sj_be(n,"keydown",functi
on(n){return o(n,n.target)},!
0),this.reactivateXYFocusOnBlur(n)),u=="input"&&(e=="number"||
e=="text")&&(sj_be(n,"keydown",function(n){return o(n,n.target)},!
0),this.reactivateXYFocusOnBlur(n)),k.some(function(t){return
n.classList.contains(t)})?
(n.elementType="slide",c=Array.prototype.slice.call(n.querySelectorAll("a:not([oncl
ick='TestHooks.HideShowTestHooks(this);']):not([disabled])"),0),f=c.filter(function
(n){return
r.isVisible(n)&&n.offsetHeight>0&&n.offsetWidth>0}),f&&sj_be(n,"keydown",function(t
){var i=r.countUniqueHrefs(f),u=t.keyCode;t.srcElement==n&&(i>1&&u==40?
(t.preventDefault(),r._searchAppXYFocus.focusRoot=n,f[0].focus()):i==1&&u==13&&f[0]
.click())})):d.some(function(t){return n.hasAttribute(t)})?
(n.elementType="expansion",s=function(){t.setVisibility(r._focusDiv,!
1);r.updateFocusedElementAndOutline(r._targetDocument.activeElement)},sj_be(n,"keyu
p",function(n){n.keyCode==13&&s()},!0),sj_be(n,"click",function()
{s()})):n.classList.contains(g)&&(h=function(){var
t=r._targetDocument.getElementById("vidPreStopButton"),i,u;t&&t.focus();i=function(
){n.focus()};sj_be(t,"click",i);sj_be(t,"keydown",function(n)
{n=sj_ev(n);n.keyCode===13&&i()});u=r._targetDocument.getElementsByTagName("video")
[0];sj_be(u,"ended",i)},sj_be(n,"keydown",function(n){n.keyCode==13&&h()},!
0),sj_be(n,"click",function(){h()})),n.classList.add(b),n.isProcessed=!
0)},e.prototype.countUniqueHrefs=function(n){var
r={},t,i;if(n)for(t=0;t<n.length;t++)i=n[t],i&&(r[i.href]=!0);return
Object.keys(r).length},e.prototype.reactivateXYFocusOnBlur=function(n)
{sj_be(n,"blur",function()
{n.classList.remove(i)})},e.prototype.focusFirstSerpElement=function(){var
n,i,t,r;switch(this._verticalType){case
1:n=this._targetDocument.getElementById("b_content");break;case
2:n=this._targetDocument.getElementById("images");break;case
3:n=this._targetDocument.getElementById("video");break;default:throw Error("Unknown
vertical type
"+this._verticalType);}if(n)for(i=n.querySelectorAll('a:not([onclick=\'TestHooks.Hi
deShowTestHooks(this);\']):not([disabled]):not([tabindex="-1"]),
button:not([disabled]), input[type=text]:not([disabled]),
input[type=submit]:not([disabled]), textarea:not([disabled]),
select:not([disabled]):not(#tta_sl):not(#tta_srcsl),
[tabindex]:not([disabled]):not([tabindex="-
1"]):not(#tta_playiconsrc)'),t=0;t<i.length;t++)if(r=i[t],this.isVisible(r))return
r.focus(),!0;return!1},e.prototype.clearFocusOutlineTimeout=function()
{sb_ct(this._focusOutlineTimeout);this._focusOutlineTimeout=null},e}
();t.WSBMiniSerpFocusHelper=o})(t=n.WSB||(n.WSB={}))}(AutoSuggest||
(AutoSuggest={})),function(n){var t;(function(t){function i(n){switch(n)
{case"arrowRight":case"button":case"submit":return
1;case"autoContent":case"keepOpen":case"alwaysWide":case"arrowUpOrDown":return
0}throw new Error("Unknown open type: "+n);}var r=function(){function
r(n,t,i,r,u,f,e,o){var
s=this;this._page=n;this._host=t;this._instrumentationHelper=i;this._ariaLogger=r;t
his._sequenceNumberManager=u;this._miniSerpViewModel=f;this._localPreviewPaneViewMo
del=e;this._msbPreviewPaneViewModel=o;this._previewPaneId=0;this._beforeItemLaunchE
ventHandlers=[];this._afterItemLaunchEventHandlers=[];var h=function(n,t,i,r,u)
{s._clickLoggedForCurrentPreviewPane||
s._beforeItemLaunchEventHandlers.forEach(function(f){return
f(n,s._previewedSuggestion,t,i,r,u)})},c=function(n)
{s._clickLoggedForCurrentPreviewPane||
(s._afterItemLaunchEventHandlers.forEach(function(t){return
t(s._previewedSuggestion,s._queryForPreviewedSuggestion,n)}),s._clickLoggedForCurre
ntPreviewPane=!0)},l=function(n)
{s._previewPaneResponseReceivedTimeStamp=n;s._miniSerpViewModel.stopLoadingScreen()
};this._previewPaneViewModelParent={focusPending:!
1,onBeforeItemLaunch:h,onAfterItemLaunch:c,startLoadingScreen:function(){return
s._miniSerpViewModel.startLoadingScreen()},onResponseReceived:l};this._miniSerpView
Model.init(this._previewPaneViewModelParent);this._localPreviewPaneViewModel&&this.
_localPreviewPaneViewModel.init(this._previewPaneViewModelParent);this._msbPreviewP
aneViewModel&&this._msbPreviewPaneViewModel.init(this._previewPaneViewModelParent);
SearchAppWrapper.CortanaApp.addEventListener("resettingtodefaultsize",function()
{return s.dismiss()});t.bindKeyDown(function()
{s._previewPaneViewModelParent.focusPending=!1});t.bindSearchBoxGotFocus(function()
{return s._previewPaneViewModelParent.focusPending=!
1});t.bindQueryChangedOrInitialized(function(n){return s._currentQuery=n},!
0);t.bindAccountChanged(function(){s._miniSerpMustRefresh=!
0});i.bindFinalizeKeystroke(function(n)
{s._activePreviewPaneViewModel&&n&&s._activePreviewPaneViewModel.finalizeKeystroke(
)})}return r.prototype.init=function(n)
{this._selectionHandler=n},r.prototype.getSelectableItems=function(){return
this._activePreviewPaneViewModel?
this._activePreviewPaneViewModel.getSelectableItems():
[]},r.prototype.getSelectableItemsByGroup=function(){return
this._activePreviewPaneViewModel?
this._activePreviewPaneViewModel.getSelectableItemsByGroup():
[]},r.prototype.getSelectedItem=function(){return this._activePreviewPaneViewModel?
this._activePreviewPaneViewModel.getSelectedItem():null},r.prototype.select=functio
n(n,t)
{this._activePreviewPaneViewModel&&this._activePreviewPaneViewModel.select(n,t)},r.
prototype.onAfterKeyDown=function(n,t,i,r){return this._activePreviewPaneViewModel?
this._activePreviewPaneViewModel.onAfterKeyDown(n,t,i,r):!
1},r.prototype.getPreviewedSuggestion=function(){return
this._previewedSuggestion},r.prototype.getPreviewedSuggestionToForceTopHit=function
(){return this._forceTopHitForPreviewedSuggestion&&!this._closeTimer?
this._previewedSuggestion:null},r.prototype.showPreview=function(r,u,f,e,o){var
s=this;if(f===void 0&&(f="button"),e===void 0&&(e=!1),o===void
0&&(o=0),this._previewPaneOpenedForThisQuery=!
0,this.clearSuggOpeningState(this._pendingPreviewedSuggestion),this.clearOpenTimer(
),this.clearCloseTimer(),u!=this._previewedSuggestion||e)
{t.RuntimeConfig.AlwaysWide||this._page.setPreviewPaneVisibility(!0);var a=+
+this._previewPaneId,c=!0,h=!1,l=n.getCurrentTime(),v=function(t,r,e){var
p,v,y;if(t||!r){if(r||(s._ariaLogger&&u&&(p=n.getCurrentDate().getTime()-
l,s._ariaLogger.logPreviewPaneRenderLatency(u.type,p)),c=!1),!h)
{if(v={ppId:""+a,openType:f,suggestion:u?
u.instItem.getLayoutKValue():undefined,suggestionType:u?
u.type:undefined,startOpening:""+l,openDelay:o?""+o:undefined},e)for(y in
e)v[y]=e[y];v.waitingForMore=c?"true":undefined;s._instrumentationHelper.previewPan
eOpenedOrClosed(!0,s._sequenceNumberManager.getSequenceNumber(),u?
u.instItem:undefined,u?u.previewPaneType:undefined,i(f)==0,v)}h=!0;t&&(h=!
1,f="keepOpen")}};this.setPreviewPaneContent(r,u,i(f),this._previewPaneId,v)}f!
="button"&&this._selectionHandler.updateSelectionState(u)},r.prototype.showPreviewA
ndFocus=function(n,t,i){i===void 0&&(i="submit");(this._closeTimer||
this._previewedSuggestion!
=t)&&this.showPreview(n,t,i);this._activePreviewPaneViewModel.focus(!
1);this._forceTopHitForPreviewedSuggestion=!0},r.prototype.focus=function(n){return
this._activePreviewPaneViewModel?(this._activePreviewPaneViewModel.focus(n),!0):!
1},r.prototype.blur=function()
{this._activePreviewPaneViewModel&&this._activePreviewPaneViewModel.blur()},r.proto
type.dismiss=function(){this.close(!0)},r.prototype.close=function(i){var
u=this,r;this.clearOpenTimer();r=i?0:t.config.closePreviewPaneDelay;r?
this._closeTimer||(this._closeTimer=n.safeSetTimeout(function()
{u._closeTimer=null;u.innerClose(i)},r,"ppCloseTimer")):
(this.clearCloseTimer(),this.innerClose(i))},r.prototype.innerClose=function(i){var
r,u;this._previewedSuggestion&&(r=!0,i&&(this._clickLoggedForCurrentPreviewPane?r=!
1:this._previewPaneResponseReceivedTimeStamp&&n.getCurrentTime()>this._previewPaneR
esponseReceivedTimeStamp+1e3&&(r=!1)),r&&(u=i?
{fromQFDismiss:"1"}:undefined,this._instrumentationHelper.previewPaneOpenedOrClosed
(!
1,this._sequenceNumberManager.getSequenceNumber(),this._previewedSuggestion.instIte
m,this._previewedSuggestion.previewPaneType,undefined,u)),t.RuntimeConfig.AlwaysWid
e||i||this._page.setPreviewPaneVisibility(!
1),this._miniSerpViewModel.stopLoadingScreen(),this.clear())},r.prototype.clear=fun
ction()
{this._previewedSuggestion&&(this._previewedSuggestion.hasPreviewPaneOpened=!
1,this._selectionHandler.updateSelectionState(this._previewedSuggestion),this._prev
iewedSuggestion=null);this._queryForPreviewedSuggestion=null;this._previewPaneRespo
nseReceivedTimeStamp=null;this._forceTopHitForPreviewedSuggestion=!
1;this._clickLoggedForCurrentPreviewPane=!
1;this._activePreviewPaneViewModel&&(this._activePreviewPaneViewModel.clear(),this.
_activePreviewPaneViewModel=null);this._previewPaneViewModelParent.focusPending=!
1},r.prototype.onQueryChanged=function(n){var
i,r;if((this._previewPaneOpenedForThisQuery=!
1,i=this._queryForPendingPreviewedSuggestion||
this._queryForPreviewedSuggestion,this._queryIsContinuationOfPreviousQuery=i&&n.que
ryToFetch.toLocaleLowerCase().startsWith(i.queryToFetch.toLocaleLowerCase()),i&&n.q
ueryToFetch.toLocaleLowerCase()!
=i.queryToFetch.toLocaleLowerCase())&&(r=this._pendingPreviewedSuggestion&&this._pe
ndingPreviewedSuggestion.updateFromQuery?
this._pendingPreviewedSuggestion:this._previewedSuggestion&&!
this._closeTimer&&this._previewedSuggestion.updateFromQuery?
this._previewedSuggestion:null,r)){if(t.RuntimeConfig.AlwaysWide)
{this.autoOpen(n,r,"alwaysWide",!
0);return}this._queryIsContinuationOfPreviousQuery?
(this._forceTopHitForPreviewedSuggestion=!1,this.autoOpen(n
,r,"keepOpen",!0)):this.close(!1)}},r.prototype.clearSuggOpeningState=function(n)
{n&&(n.isPreviewPaneOpening=!
1,this._selectionHandler.updateSelectionState(n))},r.prototype.clearOpenTimer=funct
ion()
{this._openTimer&&(sb_ct(this._openTimer),this._openTimer=null,this._pendingPreview
edSuggestion=null,this._queryForPendingPreviewedSuggestion=null,this._miniSerpViewM
odel.stopLoadingScreen())},r.prototype.clearCloseTimer=function()
{this._closeTimer&&(sb_ct(this._closeTimer),this._closeTimer=null)},r.prototype.onT
opHitUpdated=function(i,r,u,f){if(u){if(!
this._closeTimer&&(this._openTimer&&this._pendingPreviewedSuggestion!
=u&&this.clearOpenTimer(),!this._miniSerpMustRefresh||u.previewPaneType!=1))
{if(this._pendingPreviewedSuggestion&&t.isEquivalentForPreviewPanePurposes(i,this._
pendingPreviewedSuggestion,u))
{this._pendingPreviewedSuggestion=u;this._queryForPendingPreviewedSuggestion=i;u.ha
sPreviewPaneOpened=!
0;this._selectionHandler.updateSelectionState(u);return}if(this._previewedSuggestio
n&&t.isEquivalentForPreviewPanePurposes(i,this._previewedSuggestion,u))
{n.contains(f,r)||
(this._previewedSuggestion=u,this._queryForPreviewedSuggestion=i,u.hasPreviewPaneOp
ened=!
0,this._selectionHandler.updateSelectionState(u),this.refreshLocalContent(i,u));ret
urn}}if(this._miniSerpMustRefresh=!1,this._forceTopHitForPreviewedSuggestion=!
1,u.previewPaneType){if(t.RuntimeConfig.AlwaysWide)
{this.autoOpen(i,u,"alwaysWide",!1);return}if(u==f[0]&&!
this._previewPaneOpenedForThisQuery){if(u.autoOpenPreviewPaneWhenOnTopHit)
{this.autoOpen(i,u,"autoContent",!
1);return}if(this._previewedSuggestion&&this._queryIsContinuationOfPreviousQuery)
{this.autoOpen(i,u,"keepOpen",!
1);return}}}}this._openTimer&&(this.clearSuggOpeningState(this._pendingPreviewedSug
gestion),this.clearOpenTimer());this._previewedSuggestion&&this.close(!
1)},r.prototype.getDelayForMiniSerp=function(n,i){var
r=t.getTweakedSetting("preventAutomaticMiniSerp");switch(n)
{case"keepOpen":case"alwaysWide":return r?
Number.MAX_VALUE:t.config.probabilityNextKeyStrokeEnabled&&i.featureStore&&i.featur
eStore[264]!==undefined?
this.calculateDelayForProbabilitySignal(i.featureStore[264]):t.RuntimeConfig.Always
Wide?i.isAnswer?
0:t.config.autoOpenMiniSerpDelay:t.config.keepMiniSerpOpenDelay;case"arrowUpOrDown"
:return r?Number.MAX_VALUE:t.config.openOnKeybNavMiniSerpDelay}return
0},r.prototype.calculateDelayForProbabilitySignal=function(n){for(var
i=t.config.probabilityNextKeyStrokeThresholds.length-
1;i>=0;i--)if(n>=t.config.probabilityNextKeyStrokeThresholds[i])return
t.config.probabilityNextKeyStrokeDelays[i];return
0},r.prototype.autoOpen=function(i,r,u,f){var
e=this,s=t.shouldOpenMiniSerp(r),o=s&&!t.config.enableForceLoad?
this.getDelayForMiniSerp(u,r):0;o?
(u=="arrowUpOrDown"&&(this.clear(),this.clearSuggOpeningState(this._pendingPreviewe
dSuggestion),this.clearSuggOpeningState(this._previewedSuggestion)),r.isPreviewPane
Opening=!
0,this._selectionHandler.updateSelectionState(r),this.clearOpenTimer(),this.clearCl
oseTimer(),this._pendingPreviewedSuggestion=r,this._queryForPendingPreviewedSuggest
ion=i,this._openTimer=o==Number.MAX_VALUE?
Number.MAX_VALUE:n.safeSetTimeout(function()
{e._openTimer=null;r=e._pendingPreviewedSuggestion;e._pendingPreviewedSuggestion=nu
ll;e._queryForPendingPreviewedSuggestion=null;e.showPreview(i,r,u,f,o)},o,"ppOpenTi
mer"),s&&this._miniSerpViewModel.startLoadingScreen()):this.showPreview(i,r,u,f)},r
.prototype.onAfterKeyDownWhenNewSelection=function(i,r,u){var
e=t.RuntimeConfig.AlwaysWide&&t.config.openOnKeybNavMiniSerp,f;if(t.isGroup(u))
{e&&(this.clearSuggOpeningState(this._pendingPreviewedSuggestion),this.clearSuggOpe
ningState(this._previewedSuggestion),this.clear(),this.clearOpenTimer(),this.clearC
loseTimer(),this._miniSerpViewModel.stopLoadingScreen());return}f=u;f.previewPaneTy
pe&&(e&&(i==40||i==38)?this._previewedSuggestion!
=f&&this.autoOpen(r,f,"arrowUpOrDown",!
1):i==t.getRtlAdjustedKey(39)&&this._currentQuery.originalCursorPosition==this._cur
rentQuery.originalQuery.length&&this._host.searchBoxHasFocus()?f.handoffType==999?
f.click(n.getCurrentTime(),1):this.showPreviewAndFocus(r,f,"arrowRight"):i==t.getRt
lAdjustedKey(37)&&this._activePreviewPaneViewModel&&this._activePreviewPaneViewMode
l.hasFocus()&&this._activePreviewPaneViewModel.readyToBlur()&&this._host.setFocusIn
SearchBox(i,"previewPaneUnfocus"))},r.prototype.refreshLocalContent=function(n,t)
{t.previewPaneType==2?
this._localPreviewPaneViewModel.update(t,n,0,this._previewPaneId,null,!
0):t.previewPaneType===3&&this._msbPreviewPaneViewModel.update(t,n,0,this._previewP
aneId,null,!0)},r.prototype.setPreviewPaneContent=function(n,i,r,u,f){var
e=this;this.clear();this._previewedSuggestion=i;this._previewedSuggestion&&(this._p
reviewedSuggestion.hasPreviewPaneOpened=!
0,this._previewedSuggestion.isPreviewPaneOpening=!
1);this._previewPaneResponseReceivedTimeStamp=null;this._queryForPreviewedSuggestio
n=n;i.previewPaneType==3&&this._msbPreviewPaneViewModel!=null?
(this._miniSerpViewModel&&this._miniSerpViewModel.stopLoadingScreen(),this._activeP
reviewPaneViewModel=this._msbPreviewPaneViewModel,this._msbPreviewPaneViewModel.upd
ate(i,n,r,u,f)):i.previewPaneType!=2&&(t.shouldOpenMiniSerp(i)||i.previewPaneType!
=1)?t.config.enableForceLoad?
(this._activePreviewPaneViewModel=this._miniSerpViewModel,this._miniSerpViewModel.s
howForceLoad(i.query,function(){e._miniSerpViewModel.update(i,n,r,u,f)})):
(this._localPreviewPaneViewModel&&this._localPreviewPaneViewModel.clear(),this._msb
PreviewPaneViewModel&&this._msbPreviewPaneViewModel.clear(),this._miniSerpViewModel
.startLoadingScreen(),this._activePreviewPaneViewModel=this._miniSerpViewModel,this
._miniSerpViewModel.update(i,n,r,u,f)):
(this._miniSerpViewModel&&this._miniSerpViewModel.stopLoadingScreen(),this._activeP
reviewPaneViewModel=this._localPreviewPaneViewModel,this._localPreviewPaneViewModel
.update(i,n,r,u,f))},r.prototype.bindBeforeItemLaunch=function(n)
{this._beforeItemLaunchEventHandlers.push(n)},r.prototype.bindAfterItemLaunch=funct
ion(n){this._afterItemLaunchEventHandlers.push(n)},r.prototype.hasFocus=function()
{return this._activePreviewPaneViewModel?
this._activePreviewPaneViewModel.hasFocus():!1},r.prototype.isOpened=function()
{return!!this._previewedSuggestion},r}();t.PreviewPane=r})(t=n.WSB||(n.WSB={}))}
(AutoSuggest||(AutoSuggest={})),function(n){var t;(function(t){var
i=SearchAppWrapper.CortanaApp,o=21600,s="/account/permissions/sso?",f="/agents/oaut
h?",r="Office365",u="Outlook",e="0a0a29f9-0a25-49c7-94bf-c53c3f8fa69d",h="fc1b2093-
3a41-4edb-86db-cdaa2832d4e8",c="api://fc1b2093-3a41-4edb-86db-
cdaa2832d4e8/CortanaConnect",l="6df4d00742ec458795c9588001737872-fbbe95f5-f25d-
4197-9d6f-7c3eb54c745f-6908",a=function(){function a(i){var
r=this;this._triggerSSO=!
0;t.WebTelemetry&&t.WebTelemetry.init(l);sj_be(_w,"load",function()
{r.launchSSO()});a._latestSSOTimestamp||
(a._latestSSOTimestamp=n.getCurrentTime());i.bindAppHidden(function()
{r.launchPeriodicalSSO()})}return a.prototype.launchPeriodicalSSO=function(){var
t=(n.getCurrentTime()-a._latestSSOTimestamp)/1e3;t>=o&&(this._triggerSSO=!
0,this.launchSSO(),a._latestSSOTimestamp=n.getCurrentTime())},a.prototype.launchSSO
=function(){var f=this,e=function(){var e=i.isCortanaEnabled?
n.safeExecute(function(){return
i.getCortanaCapabilities()},"getCortanaCapabilities","").split(","):
[],o=n.contains(e,"Personalization");i.currentState==0&&f._triggerSSO&&o&&(f._trigg
erSSO=!1,t.config.wamSupported?
t.Promise.safeChain("enumerateAccountAuthorityAsync",function(){return
i.authenticationManager.enumerateAccountAuthorityAsync()},function(n){var
o,i,e;t.config.enableSSOV2?(o=n.Cortana=="consumers"?u:r,f.silentSignIn(o)):
(i=n.Windows,e=n.Cortana,t.WebTelemetry&&t.WebTelemetry.logSignInAccountEvent(i,e),
i=="organizations"?
f.silentSignIn(r):i=="consumers"&&e=="consumers"&&f.silentSignIn(u))}):t.Promise.sa
feChain("getQueryHeadersAsync",function(){return
i.getQueryHeadersAsync()},function(n){n&&(f.silentSignIn(r),n["X-Search-
RPSToken"]&&f.silentSignIn(u))}))};n.isBrowserOnline()?
e():sj_be(_w,"online",function(){e()})},a.prototype.silentSignIn=function(o){var
v=this,l=s+"campaign_source=WSB&provider="+o,a;t.config.th&&(l=ClientTestHooks.Copy
TestParameters(_w.location.search,l));a=function(s){var
a,y,l;t.WebTelemetry&&t.WebTelemetry.logShouldSSOEvent(o,s?!0:!
1);s&&(a=o==u,y=function(n){var i=n&&!
n.IsError;t.WebTelemetry&&t.WebTelemetry.logAuthCompleteEvent(o,o==r&&t.config.wamS
upported?"assertion":"code",i)},n.isBrowserOnline()&&i.currentState==0&&(t.config.w
amSupported&&(o==r||t.config.enableSSOV2)?
(l=i.authenticationManager.createAuthenticateRequest(),t.config.enableSSOV2?
(l.accountType="Cortana",l.resource=a?h:e,a&&(l.scope=c)):
(l.accountType="Windows",l.resource=e),t.Promise.safeChain("authenticateAsyncOBO",f
unction(){return i.authenticationManager.authenticateAsync(l)},function(i){var
r=i&&i.token,u,e;t.WebTelemetry&&(u=r?0..toString():i&&i.status!=0?
i.status.toString():"-
1",t.WebTelemetry.logClientAuthEvent(o,"WAM",u));r&&(e=f+"provider="+o+"&campaign_s
ource=WSB&assertion="+i.token,n.fetchUrlJson(e,
{},null,y))})):v.refreshOAuthToken(o,s.AuthUrl,s.CallbackUrl,s.Options||
1,y)))};n.fetchUrlJson(l,
{},null,a)},a.prototype.refreshOAuthToken=function(r,u,e,o,s)
{t.Promise.safeChain("authenticateAsyncSSO",function(){return
i.authenticateAsync(o,u,e)},function(i)
{if(t.WebTelemetry&&t.WebTelemetry.logClientAuthEvent(r,"WAB",i?0..toString():"-
1"),i){var u=i.split("?")[1],e=f+u;n.fetchUrlJson(e,{},null,s)}})},a}
();t.ProactiveSSO=a})(t=n.WSB||(n.WSB={}))}(AutoSuggest||
(AutoSuggest={}));__extends=this&&this.__extends||function(){var n=function(t,i)
{return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t)
{n.__proto__=t}||function(n,t){for(var i in
t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r()
{this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):
(r.prototype=i.prototype,new r)}}(),function(n){var t;(function(t){var
i=function(i){function r(){return i!==null&&i.apply(this,arguments)||this}return
__extends(r,i),r.prototype.fetchUrl=function(i,r,u,f,e,o){var
h=this,s;if(n.isBrowserOnline()){var v=u?
1:0,c=SearchAppWrapper.CortanaApp,l=c.createStringMap(),a=c.createStringMap();if(r)
for(s in r)s.toLowerCase().startsWith("content")?
a[s]=r[s]:l[s]=r[s];t.Promise.safeChain("makeHttpRequestAsync",function(){return
c.makeHttpRequestAsync(v,i,l,u,a)},function(i){o()&&(i.statusCode===200?
t.Promise.safeChain("readResponse",function(){return
i.readAsStringAsync()},function(i){if(o()){t.config.th&&i&&(i=i.replace(new
RegExp("<!--[^]*?-->","gm"),""));var r=i?n.safeExecute(function(){return
JSON.parse(i)},"parseCortanaHttpResponse",null,null):null;r!=null?
f(h._dataSource,r,null):f(h._dataSource,null,null)}},function(){return
f(h._dataSource,null,null)},e):f(h._dataSource,null,i.statusCode.toString()))},func
tion(){return f(h._dataSource,null,null)},e)}else
f(this._dataSource,null,null,null,!0)},r}
(n.JsonDataProvider);t.CortanaJsonDataProvider=i})(t=n.WSB||(n.WSB={}))}
(AutoSuggest||(AutoSuggest={})),function(n){var t;(function(t){var
i="LSQS",u=function(){function t(n){this._host=n}return
t.prototype.getName=function()
{return"LockscreenQuickSearchDataProvider"},t.prototype.fetch=function(t,r)
{if(t.enabledDataSources[i]){var
u={};n.isMiniSerpEnabled()&&(u.quickAnswers=[{label:this._host.getLocString("Weathe
r"),icon:{type:2,content:"&#xE9C0"},query:this._host.getLocString("WeatherQuery")},
{label:this._host.getLocString("News"),icon:
{type:2,content:"&#xE900"},query:this._host.getLocString("News")},
{label:this._host.getLocString("ThisDayInHistory"),icon:
{type:2,content:"&#xE823"},query:this._host.getLocString("ThisDayInHistory")},
{label:this._host.getLocString("NewMovies"),icon:
{type:2,content:"&#xE8B2"},query:this._host.getLocString("NewMovies")}]);r(i,u,unde
fined)}},t}(),r;t.LockscreenQuickSearchDataProvider=u;r=function(){function i(n)
{this._host=n}return i.prototype.parse=function(i,r,u,f,e,o){var
c=this,l=[],a="LSQS",v,s,h,y;if(f)for(v=function(f){var
e=n.WSB.createSuggestion(i,f.label,null,f.icon,a,f.query,n.InstrumentedItem.createI
nstrumentedItem(r,a),999,r,t.localDataSourceMayContainPII(u));e.click=function()
{c._host.reformulate(f.query);c._host.setFocusInSearchBox(null,"Quick answer
clicked")};l.push(e)},s=0,h=f.quickAnswers;s<h.length;s+
+)y=h[s],v(y);o(u,l,undefined)},i}();t.LockscreenQuickSearchParser=r})(t=n.WSB||
(n.WSB={}))}(AutoSuggest||(AutoSuggest={}))

You might also like