????

Your IP : 216.73.216.188


Current Path : C:/Windows/SystemApps/Microsoft.Windows.Search_cw5n1h2txyewy/cache/Desktop/
Upload File :
Current File : C:/Windows/SystemApps/Microsoft.Windows.Search_cw5n1h2txyewy/cache/Desktop/11.txt

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){var i=null;t.status==200&&(i=t.responseText?n.safeExecute(function(){return JSON.parse(t.responseText)},"JSON.parse"):{success:!0});f(i)},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:"",status:-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.getResponseHeader("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.addParamsToUrl=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)){if(l=this.addParamsToUrl(this.createUrl(t),e),v=this.getPostBody(t)||"",this._lastSequenceNumber!=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.fetchUrl=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._dataSource,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.prototype.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._dataSource,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=Object.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={Styles:t.Styles,Scripts:null},JsonInject.WriteHeadAndBeforeContentResources(i))},i.prototype.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.instanceWithNumberKeysAndSecondaryKey=o;t.instanceWithStringKeysAndSecondaryKey=s;i=n.config.th&&ClientTestHooks.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._closePending=!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=function(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.removeRangeOnSecondaryKey=function(n,t,i,r){var u=this;this._secondaryIndex?this.safeDbOperation("removeRangeOnSecondaryKey","["+n+","+t+"]","readwrite",i,function(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._database?(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.getDataSourceState=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))},this.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.safeSetTimeout(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,r){this._host=n;this._instrumentationHelper=t;this._navigationHelper=i;this._temporaryMessageHandler=r}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=function(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.Suggestions;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.appContextData.textWithoutHH),h.setRankingSignals(n,s),!0},n.safeExecute(function(){return t.parseLocalSuggestion(i,e[0],f,r,h._host,h._temporaryMessageHandler,s.type,h._instrumentationHelper,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 c=this,e=r.suggestionData,f=t.createSuggestion(i,i.queryToFetch?HitHighlightingParser.addMarkers(e.textWithoutHH,i.queryToFetch):e.textWithoutHH,null,e.icon,e.type,e.query,n.InstrumentedItem.createInstrumentedItem(u,e.type),e.handoffType,u,!1),o,s,l,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,this._host)))return null;break;case 10:return null;case 0:if(!n.isDataSourceEnabled("MRS",i))return null;f.click=function(){c._host.launchSearch(f.text,c._navigationHelper.getSearchUrl(i.fullPartialQuery,f.query,f.type,null,f.handoffType),f.useRaf)};break;case 1:s=e;l=r.rankingData;i.queryToFetch.length>3&&(f.autoOpenPreviewPaneWhenOnTopHit=!!l.previewPaneLaunchCount);h=s.title||s.secondaryText;i.isSearchHomeZI&&h?(f.additionalInfoText=s.url,f.text=HitHighlightingParser.removeMarkers(h)):f.primaryMetadata=h;t.setUrlSuggestionProperties(f,i,u,s.url,this._host);break;default:return 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.setupRemoveFromHistoryContextMenu=function(n,i,r){var u=this;t.RuntimeConfig.QfMode!=5&&t.RuntimeConfig.QfMode!=9&&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("RemoveFromDeviceHistory"),executeSync:function(){i.remove(function(){r.refreshCurrentPane();u._temporaryMessageHandler.showTemporaryMessage(r.getLocString("RemovedFromDeviceHistory",HitHighlightingParser.removeMarkers(n.text)))});delete 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.createMruResponse=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.SuggestionEngagementData=this._valueForLastKey.SuggestionEngagementData),u.LookupCompletions=i.map(function(n){return{key:n.key,value:n.value.SuggestionEngagementData}}),this.shouldStoreSuggestions()){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({rankingData:n==l._lastKey?{prefixLaunchCount:r.prefixLaunchCount,lastLaunchTime:r.lastLaunchTime,previewPaneLaunchCount:r.previewPaneLaunchCount,lastPreviewPaneLaunchTime:r.lastPreviewPaneLaunchTime}: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.prefixLaunchCount,t.rankingData.previewPaneLaunchCount&&(i.rankingData.previewPaneLaunchCount=(i.rankingData.previewPaneLaunchCount||0)+t.rankingData.previewPaneLaunchCount),t.rankingData.lastPreviewPaneLaunchTime&&(i.rankingData.lastPreviewPaneLaunchTime=i.rankingData.lastPreviewPaneLaunchTime?Math.max(i.rankingData.lastPreviewPaneLaunchTime,t.rankingData.lastPreviewPaneLaunchTime):t.rankingData.lastPreviewPaneLaunchTime)):n.push(t)},r.prototype.addToDataIfNotPresent=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,function(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,function(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.SuggestionEngagementData||{}):t={LastUpdated:r.getUnixTime(),SuggestionEngagementData:{}},f=this.getSuggestionKey(i),t.SuggestionEngagementData[f]=this.updateMRUEntryClicksAndTime(t.SuggestionEngagementData[f],t.LastUpdated,u),this.getGroupType&&(t.SuggestionEngagementData[f].groupType=this.getGroupType(i)),this.shouldStoreSuggestions()&&(e=i.getMruData(),e&&n&&(t.Suggestions||(t.Suggestions=[]),this.addToDataIfNotPresent(t.Suggestions,e))),t},r.prototype.updateMRUEntryClicksAndTime=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=function(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._valueForLastKey=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.removeOldLaunches=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.SuggestionEngagementData,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 s(n,i){var r,u;if(f||tt(),r=f[n],!r)throw new Error("Unsupported data source: "+n);if(t.config.indexerQuerySimplified&&n=="IFF"&&i.queryToFetch.length<=8)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 sr(n){return f||tt(),!!f[n]}function hr(n,t,i){if(!f||!f[i]||t.taskFrame)return!1;var r=s(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 tt(){var y=0,nt=c.deviceSearch.getUserSID(),dt=e(t.getKnownFolderPathLC(t.FOLDERID_Profile)),tt=ni(y,nt,!1),it=tt[0],h=tt[1],rt=ni(y,nt,!0),i=rt[0],n=rt[1];k=it;yt=h;var ft='"System.Kind" != ANY ARRAY['+g.concat("link").map(function(n){return"'"+n+"'"}).join(", ")+"] AND "+it,gt="\"System.Kind\" = SOME ARRAY['program'] AND "+i,s='"System.Kind" != ANY ARRAY['+wt.map(function(n){return"'"+n+"'"}).join(", ")+"] AND "+i,a='"System.Kind" != ANY ARRAY['+pt.concat(g).concat("folder").map(function(n){return"'"+n+"'"}).join(", ")+"] AND "+i,ti="\"System.Kind\" = SOME ARRAY['folder'] AND "+i,et="\"System.Kind\" = SOME ARRAY['Music'] AND "+i,bt="\"System.Kind\" = SOME ARRAY['Picture'] AND "+i,kt='"System.Kind" = SOME ARRAY['+d.map(function(n){return"'"+n+"'"}).join(", ")+"] AND "+i,ii="SCOPE = 'file:"+dt+"' AND \"System.Kind\" = SOME ARRAY['folder'] AND "+i;f={};f.IFF=[{selectFields:r(o,!1),filterFieldsSets:t.config.fileStartsWithShortPrefix?[pi]:[ot],mostRelevantProps:l,kindAndScopeClauses:ft,sortClause:u,searchOptions:3,sfgaoFilter:h,enabled:function(n){return!!n.queryToFetch&&!t.supportsShortcuts("IFF",n)}},{selectFields:r(o,!1),filterFieldsSets:[],mostRelevantProps:l,kindAndScopeClauses:ft,sortClause:u,searchOptions:0,sfgaoFilter:h,enabled:function(n){return!n.queryToFetch&&!t.supportsShortcuts("IFF",n)}},{selectFields:r(st,!0),filterFieldsSets:[wi],mostRelevantProps:l,kindAndScopeClauses:s,sortClause:u,searchOptions:3,sfgaoFilter:n,enabled:function(n){return!!n.queryToFetch&&t.supportsShortcuts("IFF",n)}},{selectFields:r(st,!0),filterFieldsSets:[],mostRelevantProps:l,kindAndScopeClauses:s,sortClause:u,searchOptions:0,sfgaoFilter:n,enabled:function(n){return!n.queryToFetch&&t.supportsShortcuts("IFF",n)}},{selectFields:r(o,!0),filterFieldsSets:[bi],mostRelevantProps:l.concat(["System.Title"]),kindAndScopeClauses:s,sortClause:u,searchOptions:0,sfgaoFilter:n,enabled:function(n){return t.config.indexerQuerySimplified&&n.queryToFetch.length<=8&&!!n.queryToFetch}}];f.MDOC=[{selectFields:r(v,!0),filterFieldsSets:[ht.concat(nr)],mostRelevantProps:p,kindAndScopeClauses:a,sortClause:u,searchOptions:3,sfgaoFilter:n,enabled:function(n){return n.queryToFetch&&t.config.minLengthForContentMatch&&n.queryToFetch.length>=t.config.minLengthForContentMatch}},{selectFields:r(v,!0),filterFieldsSets:[ht],mostRelevantProps:p,kindAndScopeClauses:a,sortClause:u,searchOptions:3,sfgaoFilter:n,enabled:function(n){return n.queryToFetch&&(!t.config.minLengthForContentMatch||n.queryToFetch.length<t.config.minLengthForContentMatch)}},{selectFields:r(v,!0),filterFieldsSets:[],mostRelevantProps:p,kindAndScopeClauses:a,sortClause:u,searchOptions:0,sfgaoFilter:n,enabled:function(n){return!n.queryToFetch}},];f.MFOL=[{selectFields:r(tr,!0),filterFieldsSets:[rr],mostRelevantProps:ir,kindAndScopeClauses:ti,sortClause:u,searchOptions:3,sfgaoFilter:n}];f.MPHO=[{selectFields:r(w,!0),filterFieldsSets:[ur],mostRelevantProps:ct,kindAndScopeClauses:bt,sortClause:u,searchOptions:3,sfgaoFilter:n,enabled:function(n){return!!n.queryToFetch}},{selectFields:r(w,!0),filterFieldsSets:[],mostRelevantProps:ct,kindAndScopeClauses:bt,sortClause:u,searchOptions:0,sfgaoFilter:n,enabled:function(n){return!n.queryToFetch}},];f.MVID=[{selectFields:r(b,!0),filterFieldsSets:[fr],mostRelevantProps:lt,kindAndScopeClauses:kt,sortClause:u,searchOptions:3,sfgaoFilter:n,enabled:function(n){return!!n.queryToFetch}},{selectFields:r(b,!0),filterFieldsSets:[],mostRelevantProps:lt,kindAndScopeClauses:kt,sortClause:u,searchOptions:0,sfgaoFilter:n,enabled:function(n){return!n.queryToFetch}},];f.MMUS=[{selectFields:r(at,!0),filterFieldsSets:[er],mostRelevantProps:vt,kindAndScopeClauses:et,sortClause:u,searchOptions:3,sfgaoFilter:n,enabled:function(n){return!!n.queryToFetch}},{selectFields:r(at,!0),filterFieldsSets:[],mostRelevantProps:vt,kindAndScopeClauses:et,sortClause:u,searchOptions:0,sfgaoFilter:n,enabled:function(n){return!n.queryToFetch}},];f.IBA=[{selectFields:r(ki,!0),filterFieldsSets:[gi],mostRelevantProps:di,kindAndScopeClauses:gt,sortClause:u,searchOptions:3,sfgaoFilter:n}];f.MFF=[{selectFields:r(o,!1),filterFieldsSets:[or],mostRelevantProps:null,kindAndScopeClauses:null,sortClause:null,searchOptions:0,sfgaoFilter:null}];f.LDIC=[{selectFields:r(o,!0),filterFieldsSets:[],mostRelevantProps:null,kindAndScopeClauses:ii,sortClause:u,searchOptions:0,sfgaoFilter:n}];f[ut]=[{selectFields:r(o,!0),filterFieldsSets:[],mostRelevantProps:null,kindAndScopeClauses:s,sortClause:u,searchOptions:0,sfgaoFilter:n}]}function cr(n,t,i,r,u){return gr(n.queryToFetch).then(function(f){return yr(n,f,t,i,r,u)})}function lr(n,t,i,r){var u=s(t,n);return"SELECT TOP "+i.length+" "+y(u.selectFields)+" FROM SystemIndex WHERE "+br(u,i,r)}function ar(n,i){var r=s(n,null),u=t.config.maxDeviceItemCacheSize;return"SELECT TOP "+u+" "+y(r.selectFields)+" FROM SystemIndex WHERE "+it(i)+r.kindAndScopeClauses}function vr(){var n=s(ut,null),r="WorkId, "+y(n.selectFields),i=n.kindAndScopeClauses;return t.config.enableIndexerPrimingOnShown==2&&(i="(SCOPE = '"+t.getKnownFolderPathLC(oi)+"')"),"SELECT "+r+" FROM SystemIndex WHERE "+i+" ORDER BY "+n.sortClause}function yr(n,t,i,r,u,f){var o=c.deviceSearch.getLCIDStringForText(n.queryToFetch),e=n.taskFrame?fu(u,n.taskFrame.parsed,o):s(u,n);return"SELECT TOP "+r+" "+y(e.selectFields)+" FROM SystemIndex WHERE "+kr(e,n.queryToFetch,t,i,e.searchOptions,o,f)+" ORDER BY "+e.sortClause}function pr(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 wr(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:function(t){return n.getImageAsync(t)},imageType:n.imageType,canHaveContextMenu:n.canHaveContextMenu,getVerbsAsync:function(){return n.getVerbsAsync()},extension:n.extension,itemTypeDisplayName:n.itemTypeDisplayName,createdDate:n.createdDate,lastModifiedDate:n.lastModifiedDate},u.originalDeviceItem=n,u}return n}function wr(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:function(t){return n.getImageAsync(t)},imageType:n.imageType,canHaveContextMenu:n.canHaveContextMenu,getVerbsAsync:function(){return n.getVerbsAsync()},extension:n.extension,itemTypeDisplayName:n.itemTypeDisplayName,createdDate:n.createdDate,lastModifiedDate:n.lastModifiedDate,filePath:u,lastAccessed:n.getProperty("System.DateAccessed"),version:null,isImmersive:!1,logoBackgroundColor:null,launchArguments:null,totalLaunches:null,isTrustedApp:!1,packageFamilyName:null,jumpList:null,getJumpListAsync:null,voiceCommandExamples:null,rawIndexResponse:null},f.originalDeviceItem=n,f}function y(n){return n.map(function(n){return n=="System.ParsingPath"?"path":'"'+n+'"'}).join(",")}function it(n){return t.config.useWhereId&&n?"ReuseWhere("+n+") ":""}function br(n,t,i){var r=it(i);return r!=""&&(r+=" AND "),r+"("+nu(n,t)+")"}function kr(n,t,i,r,u,f,e){var o="",s;return o+=it(e),n.mostRelevantProps.length>0&&(o+="WITH ("+n.mostRelevantProps.join(", ")+") AS #MRProps "),s=tu(n,t,i,u,f),s&&(o+="("+s+") AND "),r&&(o+="(Scope = '"+r+"') AND "),o+n.kindAndScopeClauses}function dr(n,t){return c.deviceSearch.tokenize(n,t)}function gr(n){return c.getLinguisticDataAsync(n)}function bt(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 nu(n,t){var i=t.map(function(n){return rt(n)});return bt(n,i)}function tu(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 rt(n)}),f=bt(n,e),(r&2)==2&&(f=iu(r,i,e,f,u)),f}function iu(i,r,u,f,e){for(var d,l,a,w,o,h,y,b,g,nt=ru(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=dr(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.indexerQueryMWLimit);++o)v.push(s[o])}else if((i&4)==0||s.length<=et)for(o=0;o<Math.min(s.length,et);++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 ru(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 kt(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 kt(n,1)}function rt(n){return kt(n,2)}function uu(n){var t=a[n];if(t)return t;throw new Error("select fields for NL Data source was not found: "+n);}function h(n,t,i){for(var u=[],r=3;r<arguments.length;r++)u[r-3]=arguments[r];typeof i=="string"?(i=rt(i),t.push(u.map(function(t){return"CONTAINS("+t+",'\""+i+"*\"',"+n+") RANK BY COERCION(ABSOLUTE, 1000)"}))):i&&i.Value&&h.apply(void 0,[n,t,i.Value].concat(u))}function fu(n,t,i){var f=[],e='"System.Kind" != ANY ARRAY['+nt+"]",o,r;if(t.FileType&&t.FileType.Value){o=t.FileType.Value;switch(o){case"Document":break;case"Picture":e="\"System.Kind\" = SOME ARRAY['Picture']";break;case"Video":e='"System.Kind" = SOME ARRAY['+d.map(function(n){return"'"+n+"'"}).join(", ")+"]";break;case"Powerpoint":case"Word":case"Excel":e="CONTAINS(System.ItemType,'\""+dt[o]+"*\"',"+i+') RANK BY COERCION(ABSOLUTE, 1000) AND "System.Kind" != ANY ARRAY['+nt+"]";break;default:e='"System.Kind" != ANY ARRAY['+nt+"]";h(i,f,o,"System.ItemType","System.ItemTypeText")}}return h(i,f,t.Title,"System.ItemNameDisplay","System.Title"),h(i,f,t.Body,"System.ItemNameDisplay","System.Title","System.FileDescription","System.Keywords","System.Search.Contents"),t.People&&t.People.forEach(function(n){var t=n.Value;t&&h(i,f,t=="me"?c.deviceSearch.userName:t,"System.Author","System.FileOwner","System.Document.LastAuthor","System.Photo.TagViewAggregate")}),h(i,f,t.Place,"System.Photo.TagViewAggregate"),r=eu(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:uu(n),filterFieldsSets:f,kindAndScopeClauses:e?e+" AND "+k:k,mostRelevantProps:[],searchOptions:0,sortClause:u,sfgaoFilter:yt}}function eu(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),[gt(e),gt(r)]):null}function gt(n){var t=n.toISOString();return t.substr(0,t.indexOf("T"))}function ni(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&&ft)||n&&li&&!!(n&&ft))}:(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(ri));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(ti));s=e(t.getKnownFolderPathLC(ii));u+=" AND (Scope <> 'file:"+o+"')";s!=o&&(u+=" AND (Scope <> 'file:"+s+"')");l=e(t.getKnownFolderPathLC(ui));u+=" AND (Scope <> 'file:"+l+"')";a=e(t.getKnownFolderPathLC(fi));u+=" AND (Scope <> 'file:"+a+"')";r&&(v=e(t.getKnownFolderPathLC(ei)),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 c=SearchAppWrapper.CortanaApp.queryFormulationView,ut="PRIME",ti="{905e63b6-c1bf-494e-b29c-65b732d3d21a}",ii="{7C5A40EF-A0FB-4BFC-874A-C0F2E0B9FA8E}",ri="{0762D272-C50A-4BB0-A382-697DCD729B80}",ui="{A4115719-D62E-491D-AA7C-E74B8BE3B067}",fi="{0482af6c-08f1-4c34-8c90-e17ec98b1e17}",ei="{bfb9d5e0-c6a9-404c-b2b2-ae6db6af4968}",oi="{FDD39AD0-238F-46AF-ADB4-6C85480369C7}",si=4096,hi=524288,ci=4194304,ft=536870912,li=8388608,ai=268435456,et=3,u='"System.Search.Rank" DESC, "System.DateModified" DESC, "System.ItemNameDisplay" ASC',vi=["System.Kind","System.Search.Rank","System.ParsingPath","System.DateCreated","System.DateModified","System.Search.QueryPropertyHits","System.ItemNameDisplay","System.FileExtension","System.ItemType",],yi=["System.Link.TargetParsingPath","System.SFGAOFlags",],o=["System.Title","System.Music.AlbumTitle","System.Music.DisplayArtist"],l=["System.ItemNameDisplay","System.Music.DisplayArtist","System.Music.AlbumTitle",],ot=["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)",],pi=["System.ItemNameDisplay = '{0}' RANK BY COERCION(ABSOLUTE, 990)","System.ItemNameDisplay LIKE '{0}%' RANK BY COERCION(ABSOLUTE, 960)","System.Title = '{0}' RANK BY COERCION(ABSOLUTE, 890)","CONTAINS(System.Title, '\"{0}*\"') RANK BY COERCION(ABSOLUTE, 860)",],st=o.concat("System.DateAccessed"),wi=ot.concat(["CONTAINS(System.Link.TargetParsingPath, '\"{0}*\"') RANK BY COERCION(ABSOLUTE, 920)"]),bi=["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)",],ki=["System.DateAccessed",],di=["System.ItemNameDisplay",],gi=["System.ItemNameDisplay = '{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.Author","System.Document.LastAuthor",],p=["System.ItemNameDisplay","System.Keywords","System.Title",],ht=["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)",],nr="CONTAINS(System.Search.Contents, '\"{0}*\"') RANK BY COERCION(ABSOLUTE, 545)",tr=[],ir=["System.ItemNameDisplay",],rr=["System.ItemNameDisplay = '{0}' RANK BY COERCION(ABSOLUTE, 999)","CONTAINS(System.ItemNameDisplay, '\"{0}*\"') RANK BY COERCION(ABSOLUTE, 895)",],w=["System.Photo.TagViewAggregate","System.Title",],ct=["System.ItemNameDisplay","System.Photo.TagViewAggregate",],ur=["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)",],b=["System.Title","System.Keywords","System.Music.DisplayArtist","System.Music.Genre",],lt=["System.ItemNameDisplay","System.Title","System.Keywords",],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.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)",],at=["System.Title","System.Music.DisplayArtist","System.Music.AlbumTitle","System.Music.Genre",],vt=["System.ItemNameDisplay","System.Title","System.Music.AlbumTitle",],er=["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)",],or=["path = '{0}'"],f,a,dt;i.getStrategy=s;i.dataSourceSupported=sr;i.suppress=hr;var k,yt,d=["Movie","RecordedTV","Video"],pt=d.concat(["Picture","Music"]),wt=["calendar","game","web history","feed","contact","task","journal","note","instantmessage"],g=wt.concat("program"),nt=pt.concat(g).concat(["folder","link"]).map(function(n){return"'"+n+"'"}).join(",");i.initStrategies=tt;i.generateIndexerQueryAsync=cr;i.generateIndexerQueryForMRUFilesAndFolders=lr;i.generateIndexerQueryForDeviceItemCache=ar;i.generateIndexerPrimerQuery=vr;i.fixKind=pr;a={};a.MPHO=r(w,!1);a.MVID=r(b,!1);a.MDOC=r(v,!1);dt=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 v(n,t,i){return{deviceItem:n,icon:i,suggestionType:t}}function at(n){return n.map(function(n){return{isSimulated:!0,displayName:n,id:null,kind:null,getProperty:null,propertyHits:null,rankScore:null}})}function vt(){var r=n.getCurrentTime(),u=i.deviceSearch.getAllAppsAsync();return u.then(function(i){var u=[],f,r;for(f in i)(r=i[f],r)&&(t.config.allowZeroLaunchTopApps||r.totalLaunches>0)&&!n.contains(lt,r.id)&&u.push(r);return t.config.minTopApps&&u.length<t.config.minTopApps?[]:u}).then(function(n){if(t.config.hideTopAppsOlderThanDays){var i=t.config.hideTopAppsOlderThanDays*864e5;return n.filter(function(n){return r-+n.lastAccessed<i})}return n}).then(function(i){return t.config.topAppsNotInTaskbar?h.queryFormulationView.deviceSearch.getTaskbarPinnedItemsAsync().then(function(t){return i.filter(function(i){return n.contains(f,i.id)||!t.find(function(n){return n===i.id})})}):i}).then(function(i){var r=[];return t.config.numberOfTopRecentApps&&(i.sort(function(n,t){return+t.lastAccessed-+n.lastAccessed}),r=i.splice(0,t.config.numberOfTopRecentApps)),i.sort(function(i,r){return i.totalLaunches!==0||r.totalLaunches!==0?r.totalLaunches-i.totalLaunches:t.config.defaultTopApps?n.contains(f,i.id)?n.contains(f,r.id)?f.indexOf(i.id)-f.indexOf(r.id):-1:n.contains(f,r.id)?1:0:0}),r.concat(i)})}function u(t,i,r){switch(t){case"program":return"IBA";case"picture":return i&&n.contains(y,i.toLowerCase())?"FL":"LI";case"video":return i&&n.contains(p,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(it),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=it[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 bt(n,t){if(!t.launchArguments||wt.test(n.query))return!0;var i=t.id.toLowerCase();return rt.some(function(n){return i.includes(n)})?!0:!1}function ut(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&&!ft(e,o)&&(s=t.matchesOnPropertyHH(o,e),!s)?!0:ni(o,e,n,r,u,f)?!0:!1}function ni(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:t.config.bypassCIFilterOnSubstringMatch&&n.split(" ").some(function(n){return n.startsWith(i)})?!1:(s=n.startsWith(o),!s)?!0:f.Counter>=t.config.maxCISpellCorrectionCandidates?!0:(f.Counter++,!1)}function ft(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 et(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 ot(n,t){if(t.dataSource=="PP"){var i=et(n);if(i==1)return"LURL";if(i==0)return"LDOC"}return t.getSuggestionType(n)}function st(t){return t&&t.rawIndexResponse?n.safeExecute(function(){return JSON.parse(t.rawIndexResponse)},"parseConstraintIndexMetaData"):undefined}function ht(i,r,u,f,e,o){var b,v,h,w,l,s,y,a,c;if(t.IndexerQueryGenerator&&t.IndexerQueryGenerator.suppress(r,i,f))return!0;if(t.isMobileCache)return!1;if(u=="PP")return(b=r.id,n.contains(kt,b))?!0:(v=r,ut(v,i,!0,e,o))?!0:(h=r.kind,h&&(h=h.toLocaleLowerCase(),h!="program"&&h!="unknown"))?!0:f=="LRA"&&et(v)!=2?!0:(w=v.extension,w&&w.toLowerCase()==".chm")?!0:!1;if(u!="LURL"&&r.kind=="link"&&t.RuntimeConfig.QfMode!=5)return!0;if(t.isSetting(u))return ut(r,i,!1,e,o)?!0:!1;if(t.isItemWithFileMetadata(u)){if((l=r,!t.IndexerQueryGenerator&&f=="MDOC"&&l.propertyHits.length==1&&l.propertyHits[0]=="System.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()&&gt.some(function(n){return s.includes("\\"+n+"\\")||s.includes("/"+n+"/")}))))||(y=l.extension,y&&t.RuntimeConfig.QfMode!=5&&!i.queryToFetch.toLowerCase().includes(y.toLowerCase())&&n.contains(dt,y.toLowerCase())))return!0;if(u=="CG"){if(a=r,c=a.displayName.split(" ")[0].toLowerCase(),c.includes("\\")||c.indexOf(":")==1)return!1;var p=a.id.toLowerCase(),k=p.lastIndexOf("."),d=p.lastIndexOf("\\"),g=a.kind=="folder"||k<0||k<d;if(g&&!c.includes("%")||![".exe",".com"].some(function(n){return c.includes(n)})&&(yt.some(function(n){return p.includes(n)})||!a.launchArguments&&rt.some(function(n){return p.includes(n)})||n.contains(pt,c)))return!0}return!1}return!1}var h=SearchAppWrapper.CortanaApp,i=SearchAppWrapper.CortanaApp.queryFormulationView,l=":wux:",lt=["Microsoft.XboxGamingOverlay_8wekyb3d8bbwe!App"],f=["Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge","windows.immersivecontrolpanel_cw5n1h2txyewy!microsoft.windows.immersivecontrolpanel","Microsoft.WindowsCalculator_8wekyb3d8bbwe!App","Microsoft.ScreenSketch_8wekyb3d8bbwe!App","{D65231B0-B2F1-4857-A4CE-A8E7C6EA7D27}\\mspaint.exe","{1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}\\mspaint.exe"],y,p,ct,s;t.getIcon=a;y=[".dwg",".ai",".psd"];p=[".ts"];t.getSuggestionTypeFromKindAndExtension=u;var w={getResultsContainer:function(n){return n.apps},dataSource:"PP",getSuggestionType:function(){return"PP"},maxUpTo3chars:4,maxAfter3chars:7,maxAfter8charsOrInL2ZeroInput:15,customCreateLocalResponseSuggestion:function(n,i,u){return r(n,i,u,t.ScopeConfig[t.Scope.Apps].icon,n.isImmersive?n.logoBackgroundColor:undefined)},supportsEmptyQuery:!0},b={getResultsContainer:function(n){return n.settings},dataSource:"ST",getSuggestionType:function(){return"ST"},maxUpTo3chars:4,maxAfter3chars:7,maxAfter8charsOrInL2ZeroInput:15,customCreateLocalResponseSuggestion: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 v(n,i,e)}return r(n,i,u,t.ScopeConfig[t.Scope.Settings].icon)},supportsEmptyQuery:!1},k=[w,b,{getResultsContainer:function(n){return n.media},dataSource:"LM",getSuggestionType:function(n){return u(n.kind,n.extension,"FL")},maxUpTo3chars:7,maxAfter3chars:10,maxAfter8charsOrInL2ZeroInput: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,maxAfter8charsOrInL2ZeroInput:20,supportsEmptyQuery:!0},{getResultsContainer:function(){throw Error("Only supported via IndexerQuery");},dataSource:"IBA",getSuggestionType:function(){return"IBA"},maxUpTo3chars:4,maxAfter3chars:7,maxAfter8charsOrInL2ZeroInput:15,customCreateLocalResponseSuggestion: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,maxAfter8charsOrInL2ZeroInput:25,supportsEmptyQuery:!0},],d=[{getResultsContainer:function(n){return n.files},dataSource:"MDOC",getSuggestionType:function(n){return u(n.kind,n.extension,"FL")},maxUpTo3chars:4,maxAfter3chars:7,maxAfter8charsOrInL2ZeroInput: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,maxAfter8charsOrInL2ZeroInput: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,maxAfter8charsOrInL2ZeroInput: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,maxAfter8charsOrInL2ZeroInput: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,customCreateLocalResponseSuggestion:function(n,i,u){return r(n,i,u,t.ScopeConfig[t.Scope.Music].icon,null,!0)},supportsEmptyQuery:!1},],g=[{getResultsContainer:function(n){return i.startPathCompletionQuery(n.originalQuery,"")},dataSource:"PT",getSuggestionType:function(){return"PT"},maxUpTo3chars:15,maxAfter3chars:15,maxAfter8charsOrInL2ZeroInput:15,customCancellation: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;r=r.filter(function(n){return!!n});r.length>0&&n.queryToFetch&&(u=t.escapeRegExp(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=at(r);i(e)})},getResults:function(n){return n},dataSource:"FEH",getSuggestionType:function(){return"FEH"},customCreateLocalResponseSuggestion:function(n,t){return v(n,t,{type:2,content:"&#xE81C"})},supportsEmptyQuery:!0},{getResultsContainer:function(){return vt()},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=o.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,maxAfter8charsOrInL2ZeroInput:15,supportsEmptyQuery:!1},],nt=[{getResultsContainer:function(n){return i.startCommandLineQuery(n.originalQuery,"")},dataSource:"CG",getSuggestionType:function(){return"CG"},customCancellation:function(){return i.cancelLastCommandLineQuery()},supportsEmptyQuery:!1},];t.LocalDataProviderDataSources=k.concat(d).concat(g).concat(nt).map(function(n){return n.dataSource});var e={suggestions:[],maxedOut:!1},tt={},o,it={"shell:RecycleBinFolder":{icon:{content:"&#xEF87",type:2},locStringKey:"RecycleBin"}};var yt=["\\system32\\user.exe","\\system32\\sidebar.exe","\\system32\\at.exe","\\system32\\change.exe","\\system32\\control.exe","\\system32\\find.exe","\\system32\\net.exe","\\system32\\share.exe","\\system32\\rundll32.exe","\\system32\\append.exe","\\system32\\choice.exe","\\system32\\clip.exe","\\system32\\comp.exe","\\system32\\compact.exe","\\system32\\consent.exe","\\system32\\convert.exe","\\system32\\format.exe","\\system32\\graphics.com","\\system32\\label.exe","\\system32\\mem.exe","\\system32\\mode.com","\\system32\\more.com","\\system32\\recover.exe","\\system32\\replace.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","\\system32\\help.exe","\\system32\\where.exe","\\system32\\skydrive.exe","\\system32\\calc.exe","\\system32\\fc.exe","\\accessories\\wordpad.exe",t.config.blacklistNotepadCommand?"\\system32\\notepad.exe":null,].filter(function(n){return!!n}),rt=["\\system32\\finger.exe","\\system32\\ping.exe","\\system32\\print.exe","\\system32\\shutdown.exe","\\system32\\expand.exe","\\system32\\tskill.exe","\\system32\\reg.exe","\\system32\\sc.exe",],pt=["uninstall","outlook","excel","skype","nero","onenote","lync","vmware","firefox","itunes","photoshop","print","opera","visio","thunderbird","smartscreen"],wt=/[\/\.\-\\]/;t.isRealCommand=bt;var kt=["Microsoft.Cortana_8wekyb3d8bbwe!CortanaUI","Microsoft.Windows.Cortana_cw5n1h2txyewy!CortanaUI",],dt=[".dll",".pdb",".obj",".bin",".etl",".bak",".config",".resx",".manifest",".ini",".searchconnector-ms",".settingcontent-ms",".vstx",".vssx",".ms-one-stub",],gt=["visio content","bin","debug","obj","objd","amd64","x86","microsoftedgebackups",];t.isInitials=ft;t.getSuggestionTypeOverride=ot;t.parseConstraintIndexMetaData=st;t.isSuppressed=ht;ct=function(){function f(n,t,i){var r=this;this._previousKeystrokeCache=n;this._host=i;t&&(o=t,i.bindShown(function(){o.clean();r.cacheDeviceItems()}));i.bindAppHidden(function(){tt={}})}return f.prototype.getName=function(){return"LocalDataProvider"},f.setWhereId=function(n){f.whereId=n},f.prototype.fetch=function(r,u,e,o,c){var ft=this,a,v,et,p,ot,l,w,b,st,tt,lt,at,it,ht,rt,vt,yt,ut,ct,y;if(o&&o.register(function(){return t.Promise.clearPendingItemsFromCache()},!1,"clearPendingItemsFromCache"),a=[],v=k.filter(function(t){return n.isDataSourceEnabled(t.dataSource,r)}),t.IndexerQueryGenerator&&(a=a.concat(v.filter(function(n){return t.IndexerQueryGenerator.dataSourceSupported(n.dataSource)})),v=v.filter(function(n){return!t.IndexerQueryGenerator.dataSourceSupported(n.dataSource)})),v.length>0){if(!r.queryToFetch&&!v.every(function(n){return n.supportsEmptyQuery}))throw new Error(s);if(o&&o.register(function(){return i.cancelLastDeviceQuery()},!1,"cancelLastDeviceQuery"),et=n.safeExecute(function(){return i.startDeviceQuery(r.queryToFetch)},"startDeviceQuery",null,r.queryToFetch),et)for(p=0,ot=v;p<ot.length;p++)y=ot[p],this.searchFolderWithMultipleResults(r,y,et,u,c,o,f.whereId);else this.emptyFetch(v,u)}if(l=d.filter(function(t){return n.isDataSourceEnabled(t.dataSource,r)}),t.IndexerQueryGenerator&&(a=a.concat(l.filter(function(n){return t.IndexerQueryGenerator.dataSourceSupported(n.dataSource)})),l=l.filter(function(n){return!t.IndexerQueryGenerator.dataSourceSupported(n.dataSource)})),l.length>0){if(!r.queryToFetch&&!l.every(function(n){return n.supportsEmptyQuery}))throw new Error(s);w=r.taskFrame?r.taskFrame.raw:"";t.Promise.safeChain("executeSearchAsync",function(){return h.searchResultsView.executeSearchAsync(r.queryToFetch,w)},function(n){var t,i,e;if(c())if(n)for(t=0,i=l;t<i.length;t++)e=i[t],ft.searchFolderWithMultipleResults(r,e,n,u,c,o,f.whereId);else ft.emptyFetch(l,u)},function(){return ft.emptyFetch(l,u)},null,w?r.queryToFetch+"\n"+w:r.queryToFetch)}if(a.length>0){if(f.lastQuery&&!r.fullPartialQuery.startsWith(f.lastQuery)&&f.setWhereId(null),f.lastQuery=r.fullPartialQuery,!r.queryToFetch&&!a.every(function(n){return n.supportsEmptyQuery}))throw new Error(s);for(b=0,st=a;b<st.length;b++)y=st[b],this.searchFolderWithMultipleResults(r,y,null,u,c,o,f.whereId)}if(tt=g.filter(function(t){return n.isDataSourceEnabled(t.dataSource,r)}),tt.length>0){if(!r.queryToFetch&&!tt.every(function(n){return n.supportsEmptyQuery}))throw new Error(s);for(lt=function(n){o&&n.customCancellation&&o.register(function(){return n.customCancellation()},!0,n.dataSource+" cancellation");at.searchFolderWithMultipleResults(r,n,r,u,c,o,f.whereId)},at=this,it=0,ht=tt;it<ht.length;it++)y=ht[it],lt(y)}if(rt=nt.filter(function(t){return n.isDataSourceEnabled(t.dataSource,r)}),rt.length>0){if(!r.queryToFetch&&!rt.every(function(n){return n.supportsEmptyQuery}))throw new Error(s);for(vt=function(n){o&&n.customCancellation&&o.register(function(){return n.customCancellation()},!0,n.dataSource+" cancellation");yt.searchFolderWithSingleResult(r,n,r,u,c)},yt=this,ut=0,ct=rt;ut<ct.length;ut++)y=ct[ut],vt(y)}r.taskFrame&&n.safeExecute(function(){return h.searchResultsView.setTaskFrame(r.originalQuery,"")},"reset task frame")},f.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,e,f.getDataSourceState(0))},f.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.length>8?i.maxAfter8charsOrInL2ZeroInput:n.queryToFetch.length>3?i.maxAfter3chars:i.maxUpTo3chars},f.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=ot(h,f),s=t.isApp(c)||t.isSetting(c)?st(h):undefined;ht(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.groupDisplayName=y),s&&(o.ciMetaData=s,s.Query&&s.Query.includes(l)&&(v=s.Query.split(l),v.length==2&&(o.uxHint=v[1],o.ciMetaData.Query=v[0]))),b.push(o))}return{suggestions:b,maxedOut:d}},f.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)},f.prototype.enableSpellCorrection=function(n){return n.queryToFetch.length>=t.config.enableCISpellerAtPrefixLength&&this._previousKeystrokeCache&&this._previousKeystrokeCache.enableCISpeller(n.queryToFetch)?!0:n.queryToFetch.length>=t.config.enableCISpellerAtPrefixLength&&t.config.enableCISpeller==1?!0:!1},f.prototype.searchFolderWithMultipleResults=function(r,u,o,s,h,c,l){var w=this,a=u.dataSource,b=this.getMax(r,u),v=!o,k,y,p;if(v){if(t.RuntimeConfig.QfMode==5&&(p=this._host.getFileExplorerCurrentPath()),p&&!/^[a-zA-Z]\:\\/.test(p)){s(a,e,null,null,!0);return}k=function(){return t.IndexerQueryGenerator.generateIndexerQueryAsync(r,p,b,a,l).then(function(n){return i.deviceSearch.queryWindowsSearchIndexerAsync(n)})}}else{if(y=n.safeExecute(function(){return u.getResultsContainer(o)},"getResultsContainer "+a),!y){s(a,e,null);return}k=function(){return w.getResults(r,b,y,u)}}t.Promise.safeChain(v?"queryWindowsSearchIndexerAsync":"getItemsAsync",k,function(n){var i,e,o;h()&&(i=n.resultSet,e=void 0,f.setWhereId(n.whereId),i?e=n.state:i=typeof n.length=="undefined"?Object.keys(n).map(function(t){return n[t]}):n,v&&t.supportsShortcuts(a,r)&&(i=i.map(function(n){return t.IndexerQueryGenerator.fixKind(n)})),o=f.getDataSourceState(e),s(a,w.toLocalResponse(b,r,i,u,y),o))},function(t){n.isCancellation(t)||w.logProviderFailure(a);s(a,e,null)},v?c:null,a+" "+r.queryToFetch)},f.prototype.searchFolderWithSingleResult=function(i,r,u,f,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()&&f(s,h.toLocalResponse(1,i,n?[n]:[],r,null),null)},function(t){n.isCancellation(t)||h.logProviderFailure(s);f(s,e,null)},null,i.queryToFetch):f(s,e,null)},f.prototype.logProviderFailure=function(r){var u=t.providerFailureLogName(r);u&&i.logProviderFailure&&n.safeExecute(function(){return i.logProviderFailure(u,"ErrorForTopHit")},"logProviderFailure")},f.prototype.cacheDeviceItems=function(){var n="LDIC",r=function(){var r=t.IndexerQueryGenerator.generateIndexerQueryForDeviceItemCache(n,f.whereId);return i.deviceSearch.queryWindowsSearchIndexerAsync(r)};o.setReady(!1);t.Promise.safeChain("initializeDeviceItemCacheAsync",r,function(n){var t,i,r;for(f.setWhereId(n.whereId),t=0,i=n.resultSet;t<i.length;t++)r=i[t],o.addItemToCache(r);o.setReady(!0)})},f.getDataSourceState=function(n){switch(n){case 0:return"UN";case 1:return"NI";case 2:return"PI"}return undefined},f.getApps=function(n,t,r,u,f){c(n,t,"findAppsAsync",function(n){return i.deviceSearch.findAppsAsync(n)},function(n){return w.customCreateLocalResponseSuggestion(n,null,u)},r,u,null,!0,f)},f.getSettings=function(n,t,r,u){c(n,t,"findSettingsAsync",function(n){return i.deviceSearch.findSettingsAsync(n)},function(n){return b.customCreateLocalResponseSuggestion(n,null,u)},r,u,null)},f.getFiles=function(n,e,o,s,h){c(n,e,"findFilesAsync",function(n){if(t.IndexerQueryGenerator){var r=t.IndexerQueryGenerator.generateIndexerQueryForMRUFilesAndFolders(o,"MFF",n,f.whereId);return i.deviceSearch.queryWindowsSearchIndexerAsync(r).then(function(n){var i,t,r,u;for(f.setWhereId(n.whereId),i={},t=0,r=n.resultSet;t<r.length;t++)u=r[t],i[u.id]=u;return i})}return i.deviceSearch.findFilesAsync(n)},function(n){return r(n,u(n.kind,n.extension,"FL"),h)},s,h,tt)},f.launchIndexingOptions=function(n,i){var r=this;f.getSettings([t.IndexingOptionsSettingId],function(u){var f=u[t.IndexingOptionsSettingId];f?n.launchDeviceItem(f.deviceItem,"ST"):i||r.launchIndexingOptions(n,!0)},null,null,!0)},f}();t.LocalDataProvider=ct;s="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="rewardsBadgeButton",s="userProfileButton",h=function(){function h(n,h,c,l,a,v,y,p,w){var b=this,k,d,g;(this._host=n,this._page=h,this._accessTokenManager=c,this._msRewardsViewModel=l,this._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._shouldRenderScopes=!0,this._advancedOptionsIdCounter=0,this._advancedOptionsScope=[],this._userProfilesCache={},this._storage=w,this._upsellGotDismissed=w.getItem(u)=="1",i=SearchAppWrapper.CortanaApp,this._scopesHeaderElement=_ge("scopesHeader"),t.config.scopesOrderBegin.length!=0)&&(k=function(){b._currentQuery&&b.renderScopes()},n.bindAppHidden(function(){b._scopeTiles=null;b._effectiveScopeOrder=null}),n.bindQueryChangedOrInitialized(function(n){b._currentQuery=n;b._currentScopeTileIndex=-1}),n.bindDismissed(function(){b._shouldRenderScopes=!0;b._currentScopeTileIndex=-1;b._verifyAccountForAADRequired=!1;b._verifyAccountForMSARequired=!1}),n.bindButtonRightOfSearchBoxClick(function(i){(i==""||i==""||t.RuntimeConfig.QfMode==2)&&(n.reformulate(""),b.setFocusInSearchBox("clear search box"),y.logClientInstEvent("Select","ClearSearchBox",null))}),n.bindScopeListRequiresUpdate(function(){b.init();k()}),n.bindOnFeedbackClosing(function(n){!n&&t.RuntimeConfig.AlwaysWide&&_ge(r).focus()}),this._substrateUpsellDismiss={action:function(){b._upsellGotDismissed=!0;w.setItem(u,"1");n.refreshCurrentPane()},icon:{content:"&#xE711",type:2}},l&&l.bindRewardsBadgeUpdated(function(){b._shouldRenderScopes=t.config.optScopesRender;k()}),c&&(d=function(){if(b._currentQuery){var n=t.ScopeConfig[b._currentQuery.scope];b.refreshAdvancedOptionsScopeList(n);b.updateTopHitHeader()}},g=function(n,t,i){n==0?(t=="https://substrate.office.com/SubstrateSearch-Internal.ReadWrite"||t=="service::cortana.bing.com::mbi_ssl")&&(b._verifyAccountForMSARequired=i,d()):n==1&&t=="https://substrate.office.com"&&(b._verifyAccountForAADRequired=i,d())},c.bindVerifyAccountRequired(function(n,t){g(n,t,!0)}),c.bindAccessTokenAvailable(function(n,t){g(n,t,!1)})))}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._currentScopeTileIndex=r.indexOf(u[this._currentScopeTileIndex]));this._menuFactory.dismiss();r[this._currentScopeTileIndex].focus()},h.prototype.render=function(n,i,r,u,f){if(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?"AddingScopeNarratorTextAll2":"AddingScopeNarratorText",this._host.getLocString(r,f.toLocaleLowerCase())},h.prototype.selectScope=function(n){var i,r,t;for(this._selectedScope&&(this._selectedScope.tooltip=this.getScopeToolTip(this._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;t.RuntimeConfig.ScopesAvailable&&(this._scopeTiles||this.init(),this._scopeTiles&&(!this._selectedScope||this._selectedScope.type!=n)&&this.selectScope(n));this.renderTopHitHeader(n,i,r,f,e,o);t.RuntimeConfig.ScopesAvailable&&this.renderScopes()},h.prototype.refreshAdvancedOptionsScopeList=function(n){this._advancedOptionsScope=t.RuntimeConfig.ScopesAvailable&&n.showUpsellOnSuggestionsList&&n.showUpsellOnSuggestionsList()?this.getAdvancedOptions(this._sequenceNumberReader.getSequenceNumber(),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.refreshAdvancedOptionsScopeList(o),t.RuntimeConfig.AlwaysWide&&(this._advancedOptionsScope=this._advancedOptionsScope.concat(this.getAdvancedOptions(this._sequenceNumberReader.getSequenceNumber(),1))),this._lastRenderedTopHitHeader&&this._lastRenderedTopHitHeader.scope==n&&this._lastRenderedTopHitHeader.message==s&&this._lastRenderedTopHitHeader.subMessage==h&&this._lastRenderedTopHitHeader.headerText==c&&this._lastRenderedTopHitHeader.advancedOptions==this._advancedOptionsScope)||(this._lastRenderedTopHitHeader={scope:n,headerText:c,message:s,subMessage:h,advancedOptions:this._advancedOptionsScope,scopeForDisplay:i},y={headerText:c,message:s,subMessage:h,messageIcon:s?o.icon:null,advancedOptions:this._advancedOptionsScope},this._page.updateTopHitHeaderView(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._lastRenderedTopHitHeader.message?n.icon:null,advancedOptions:this._advancedOptionsScope};this._page.updateTopHitHeaderView(i)}},h.prototype.shouldShowRewardsBadge=function(n){return t.RuntimeConfig.AlwaysWide||!!n&&n.scope==t.Scope.All},h.prototype.getScopesHeaderDataModel=function(){var n=this,i=this.getScopeBarElements(),r=this.getHiddenScopeElements(i)||[],u=t.config.userProfileButtonEnabled?this.getUserProfileButtonData():[null,null],f=u[0],e=u[1];return{scopes:i,showFeedback:this.isFeedbackEnabled()?function(){return n.showFeedback()}:null,rewardsBadgeDataModel:this._msRewardsViewModel&&this.shouldShowRewardsBadge(this._currentQuery)&&this._msRewardsViewModel.getDataModel(),moreMenuDataModel:r.length>0?{opened:this._moreMenuOpened,buttonClickHandler:function(){return n._moreMenuOpened?n.closeMoreMenuDropDown():n.openMoreMenuDropDown(r)}}:null,optionsMenuDataModel:{opened:this._optionsMenuOpened,buttonClickHandler:function(){return n._optionsMenuOpened?n.closeOptionsMenuDropDown():n.openOptionsMenuDropDown()}},userProfileButtonDataModel:t.config.userProfileButtonEnabled&&f?{opened:this._userProfileMenuOpened,buttonClickHandler:function(){return n._userProfileMenuOpened?n.closeUserProfileDropDown():n.openUserProfileDropDown()},icon:f,userName:e}:null,lockscreenMenuDataModel:{opened:this._lockscreenMenuOpened,buttonClickHandler:function(){return n._lockscreenMenuOpened?n.closeLockscreenMenuDropDown():n.openLockscreenMenuDropDown()}}}},h.prototype.renderScopes=function(){var n=this;(!t.config.optScopesRender||this._currentQuery&&this._currentQuery.scopePrefix||this._selectedScope&&this._selectedScope.selected==!1||this._moreMenuOpened||this._optionsMenuOpened)&&(this._shouldRenderScopes=!0);this._shouldRenderScopes&&(this._page.updateScopesHeaderView(this.getScopesHeaderDataModel()),this._shouldRenderScopes=!1);t.config.EnableWebFlyout&&this._currentQuery&&this._currentQuery.originalQuery.length===0&&this.getScopeBarElements().forEach(function(i){i.type==t.Scope.Web&&n.educationalFlyoutWeb(_ge(i.id))})},h.prototype.educationalFlyoutWeb=function(n){this._page.createFlyout("SearchTheWeb",this._storage).addMessage(this._host.getLocString("WebEducationalFlyoutText")).target(n).show()},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()},h.prototype.closeMoreMenuDropDown=function(){this._moreMenuOpened=!1;this.renderScopes()},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);this._menuFactory.showDropdownMenu(r,document.getElementById(this._optionsButton.id),2,function(){n.safeSetTimeout(function(){return u.closeOptionsMenuDropDown()},0,"closeOptionsMenuDropDown")});this._optionsMenuOpened=!0;this.renderScopes()},h.prototype.openLockscreenMenuDropDown=function(){var r=this,t,i;this._page.ensureWebViewHeightExpanded();t=3;i=this.getAdvancedOptions(this._sequenceNumberReader.getSequenceNumber(),t);this._menuFactory.showDropdownMenu(i,document.getElementById(this._optionsButton.id),2,function(){n.safeSetTimeout(function(){return r.closeLockscreenMenuDropDown()},0,"closeLockscreenMenuDropDown")});this._lockscreenMenuOpened=!0;this.renderScopes()},h.prototype.closeOptionsMenuDropDown=function(){this._optionsMenuOpened=!1;this.renderScopes()},h.prototype.closeLockscreenMenuDropDown=function(){this._lockscreenMenuOpened=!1;this.renderScopes()},h.prototype.openUserProfileDropDown=function(){var t=this,i=this.getAccountOptionsForUserProfileButton(this._sequenceNumberReader.getSequenceNumber());this._menuFactory.showDropdownMenu(i,document.getElementById(this._optionsButton.id),2,function(){n.safeSetTimeout(function(){return t.closeUserProfileDropDown()},0,"closeUserProfileDropDown")});this._userProfileMenuOpened=!0;this.renderScopes()},h.prototype.closeUserProfileDropDown=function(){this._userProfileMenuOpened=!1;this.renderScopes()},h.prototype.cleanUp=function(){this._lastRenderedTopHitHeader=null;this._page.updateTopHitHeaderView(null);t.config.optimizeStartupRendering?(document.activeElement.blur&&document.activeElement.blur(),this._shouldRenderScopes=!0,this.renderScopes()):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.config.numberOfScopesToRenderAlwaysWide):(i=t.config.scopesOrderBegin,r=t.config.scopesOrderLast,o=t.config.numberOfScopesToRender),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.config.menuOverflow&&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._selectedScope.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.isBingEnabled()},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||t.RuntimeConfig.QfMode==9||n||!i&&!r||u!=t.Scope.Documents&&f.showUpsellOnSuggestionsList&&f.showUpsellOnSuggestionsList()?["",""]:r?f.getEmptyZIMessages(this._host):[this._host.getLocString("NoResults",this._currentQuery.queryToFetch),""]},h.prototype.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._allScopeButtonPresent=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._selectedScope.type);this._effectiveScopeOrder=null}},h.prototype.createScopeElement=function(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.scope,o,s,c;if(this._shouldRenderScopes=!0,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,!1),this._page.updateGroupsView(o,!1);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._topHitPresent,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","ScopeChanged",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=this._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.slice(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._rewardsBadgeButton,this._userProfileButton,this._feedbackButton,this._optionsButton],e.forEach(function(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.shouldSkipSelectedScope()&&this._selectedScope==u[0]&&(u=u.slice(1),--i,--c),i<0&&this._selectedScope&&!t.shouldSkipSelectedScope())return[this._selectedScope];if(h=n.getCurrentActiveElement(),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(i,r,u){var l=null,f="VerifyAccountToSearch",e=0,a="CloudSearch",v=["Verify"],o=null,s=[],y,h,c;return u==0?(y=t.getEffectiveScope(this._currentQuery),e=6,h=this._accessTokenManager?this._accessTokenManager.getCachedAccountInfo(i):null,h&&s.push(h.accountUserName),c=[t.Scope.People,t.Scope.Emails,t.Scope.Documents],t.config.accountVerificationInAllScope&&c.push(t.Scope.All),n.contains(c,y)&&(s.length>0&&(f="VerifyAccount"),o=this._substrateUpsellDismiss),a=""):u==2&&(f=null,e=2,l={content:"&#xE9BE",type:2,needsAccentColor:!0},o=this._substrateUpsellDismiss,v=["VerifyAccountToSearch"]),this.createAdvancedOption(i==1?"COFA":"COOA",r,a,f,v,this.getSubstrateUpsellClickHandler(i),e,o,l,null,s,"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=function(){var n=this._host.getLocString("Build");return{id:"advancedOption"+this._advancedOptionsIdCounter++,selected:!1,title:n,message:undefined,text:n+": "+t.config.snrVersion,instItem:undefined,click:undefined,layout:4,cssClass:this.getAdvancedOptionCssClass(4),isSelectable:!1,subItems:undefined,isExpanded:!1}},h.prototype.createDebugFallbackOption=function(n){return this.createAdvancedOption(null,n,"FallbackBundleText",null,["FallbackBundleText"],function(){return t.fallbackToPrepopulatedBundle(new Error("Fallback button clicked"))},2,null,{type:2,content:"&#xE81F"})},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="advancedOption"+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.getLocString.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.prototype.getAccountOptions=function(n){var u=this,r=[];if(!this._accessTokenManager)return r;var f=this._accessTokenManager.getCachedAccountInfo(0),e=this._accessTokenManager.getCachedAccountInfo(1),c=this._accessTokenManager.isMsaAvailable(),l=this._accessTokenManager.isAadAvailable(),o="menuItemWithButton focusable",s="removeHover",h="highlight",i;return(f||e)&&(i=this.createAdvancedOption(null,n,null,"ConnectedAccounts",null,null,5),i.cssClass=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.getAdvancedOptionCssClass(4),t.isSubstrateOutlookAccountConnected||(i.cssClass+=" "+h),r.push(i),this._verifyAccountForMSARequired&&(i=this.createAdvancedOption(null,n,null,"VerifyAccountAttention",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.getAdvancedOptionCssClass(4),r.push(i),t.isSubstrateO365AccountConnected||(i.cssClass+=" "+h),this._verifyAccountForAADRequired&&(i=this.createAdvancedOption(null,n,null,"VerifyAccountAttention",null,this.getSubstrateUpsellClickHandler(1),4),i.cssClass=s,i.icon={type:2,content:"&#xE946"},r.push(i),i=this.createAdvancedOption(null,n,null,"VerifyButton",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=this.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=this.getAdvancedOptionCssClass(2),r.push(i)),r},h.prototype.getUserProfileButtonData=function(){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),this._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.accountUserName);u&&u(1,function(t){t&&(i._userProfilesCache[n.accountUserName]=t,i.renderScopes())})}}),[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.getAllAvailableAccounts(1),e=s.concat(h);if(s.length+h.length==0)return[];if(r=[],f=this._accessTokenManager.getSelectedAccountInfo(),f&&(e=e.filter(function(n){return n.accountUserName!=f.accountUserName}),i=this.createAdvancedOption(null,n,null,"ConnectedAccount",null,null,5),i.cssClass=this.getAdvancedOptionCssClass(5),r.push(i),i=this.createAdvancedOption(null,n,null,null,f.accountProviderAuthority=="consumers"?["MicrosoftAccount"]:["AadAccount"],null,4),i.message=f.accountUserName,i.cssClass=this.getAdvancedOptionCssClass(4),r.push(i)),e.length>0)for(i=this.createAdvancedOption(null,n,null,"AvailableAccounts",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._menuFactory.dismiss()},0,null,{type:2,content:"&#xE77B"});i.message=t.accountUserName;i.cssClass=c.getAdvancedOptionCssClass(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.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=this.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=this.getAdvancedOptionCssClass(2),r.push(i)),r},h.prototype.getMenuDividerOption=function(){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.availableDataSources[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.getGroupTitleAndNarratorText(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(function(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.getAllSearchWebAccountsAsync?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.addCloudSearchUpsells(u,r,2);u.push(this.getIndexingOption(r,1));this.addZiCustomization(u,r,!1);n.push(this.createContextMenuGroup(null,r,"OptionsButtonToolTip",u));this.isFeedbackEnabled()&&(n.push(this.getMenuDividerOption()),n.push(this.createAdvancedOption(null,r,null,null,["FeedbackButtonText"],function(){return e.showFeedback()},2,null,{type:2,content:"&#xED15"},null)))},h.prototype.getAdvancedOptions=function(n,r){var f=this,u=[],e,o,s;return r==1&&(i.authenticationManager.getAllSearchWebAccountsAsync&&(t.config.userProfileButtonEnabled||u.push.apply(u,this.getAccountOptions(n)),e=this.createAdvancedOption(null,n,null,null,["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.isFeedbackEnabled()&&t.config.feedbackUnderOption&&(u.push(this.getMenuDividerOption()),o=this.createAdvancedOption(null,n,null,null,["FeedbackButtonText"],function(){return f.showFeedback()},2,null,{type:2,content:"&#xED15"},null),o.cssClass=this.getAdvancedOptionCssClass(2),u.push(o)),this.addZiCustomization(u,n)),r==2&&this.addSinglepPaneOptions(u,n),r==0&&t.isCloudSearchEnabledCache&&this.addCloudSearchUpsells(u,n,r),r!=2&&t.config.troubleshootButton&&u.push(this.getMenuDividerOption()),t.config.troubleshootButton&&(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)),r!=0&&t.config.th&&t.config.debugFallbackScenario&&u.push(this.createDebugFallbackOption(n)),t.config.snrVersion&&(r==1||r==2)&&u.push(this.createBuildVersionOption()),r==3&&(s=this.createAdvancedOption(null,this._sequenceNumberReader.getSequenceNumber(),null,null,["LockScreenSettings"],function(){return f._host.launchLockscreenSettings()},2,null,{type:1,content:"&#xEE3F"}),s.cssClass=this.getAdvancedOptionCssClass(2),u.push(s)),u},h.prototype.addCloudSearchUpsells=function(i,r,u){var e=t.substrateProvidersEnabled(),f;if((u==0||u==2)&&(f=[t.Scope.People,t.Scope.Emails,t.Scope.Documents],t.config.accountVerificationInAllScope&&f.push(t.Scope.All),u!=0||!this._selectedScope||n.contains(f,this._selectedScope.type)))if(e){if(this._upsellGotDismissed&&this._selectedScope&&n.contains(f,this._selectedScope.type)&&u==0)return;(t.windowsAccountType==1||t.windowsAccountType==4)&&this._verifyAccountForAADRequired&&i.push(this.getSubstrateUpsell(1,r,u));(t.windowsAccountType==2||t.windowsAccountType==4)&&this._verifyAccountForMSARequired&&i.push(this.getSubstrateUpsell(0,r,u))}else n.isBingEnabled()&&t.isCortanaEnabledCache&&i.push(this.getOneDriveUpsell(r))},h.prototype.onCossOptInOutClick=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.addMarkers(r,t.queryToFetch));!n.query.includes(t.queryToFetch)&&n.query.toLowerCase().startsWith(t.queryToFetch.toLowerCase())&&(n.query=t.queryToFetch+n.query.substr(t.queryToFetch.length))}function 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.toLowerCase()==r.queryToFetch.toLowerCase(),n.updateFromQuery=function(i){return l?(n.query=i.queryToFetch,n.text=HitHighlightingParser.addMarkers(n.query,i.queryToFetch),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,highConfidenceMetaSuggestionScore:n.highConfidenceMetaSuggestionScore,prefetchConfidenceScore:n.prefetchConfidenceScore,query:n.query,textWithoutHH:HitHighlightingParser.removeMarkers(n.text),annotation:n.primaryMetadata,icon:n.getIcon?null:n.icon,actionUri:f,taskFrame:e,confidence:o,source:s,suggestionKey:t.getSuggestionKey(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.secondaryIcon={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),n.icon={type:3},n.click=function(){return v.launchCat2or3a(n.query,l)},n.allowedInGroups=!n.htmlContent):(f(n,v,r),n.click=function(){return v.launchSearch(n.query,y.getSearchUrl(r.fullPartialQuery,n.query,n.type,n.baseSearchUrl),!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.isValidIcon(n.icon)||(n.getIcon=f.getEdgeIcon);n.click=function(){return f.launchUri(u)};n.narratorText=t.getNarratorText(n,f.getLocString("DirectNavSuggestion"));n.getMruData=function(){return{type:n.type,handoffType:n.handoffType,hc:n.hc,highConfidenceMetaSuggestionScore:n.highConfidenceMetaSuggestionScore,prefetchConfidenceScore:n.prefetchConfidenceScore,query:n.query,textWithoutHH:HitHighlightingParser.removeMarkers(n.text),title:n.primaryMetadata,icon:n.getIcon?null:n.icon,url:u,suggestionKey:t.getSuggestionKey(n)}}}function f(n,i,r){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,t.msbEnabledForQuery(r)))}var e=function(){function i(n,t,i,r,u,f){this._host=n;this._instrumentationHelper=t;this._navigationHelper=i;this._temporaryMessageHandler=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=function(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(function(){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.safeExecute(function(){return n.parseWebEngagementSignals(u.RankingSignals)},"parseWebEngagementSignals"),t.isL2(i)||(l=n.safeExecute(function(){return t.parseWebSuppressionSignals(u.RankingSignals,i)},"parseWebSuppressionSignals"))),this._previousKeystrokeCache&&this._previousKeystrokeCache.updateWebSignalsData(i.queryToFetch,h),k={rankingSignals:u.RankingSignals,engagementSignals:h,suppressedGroups:l,webTopResultRoutingType:u.PrefixRoutingType},e(n.WebDataSource,v,k));t.lookupById(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._instrumentationHelper,this._host)},i.prototype.parseIdLookupResponse=function(i,u,f,e,o,s,h){var c=this,l,a;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.stype,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(a=="CS"||c.appId||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=="MD"||a=="ML"?1:n.verticalToHandoffType(c.vertical),l=t.createSuggestion(i,f.Text,null,n.getIconFromOnlineResponse(f),a,c.query,n.InstrumentedItem.createInstrumentedItem(e,a),y,e,!1),l.primaryMetadata=f.SecondaryText,this.setRankingSignals(l,f),l.autoOpenPreviewPaneWhenOnTopHit=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.secondaryIconUrl,c.url,c.segments,c.taskFrame,s,this._host,this._navigationHelper);c.noHeightRestriction==="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._host))return null}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=HitHighlightingParser.addMarkers(l.primaryMetadata,i.queryToFetch)),u(l,i,e,c.url,this._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.setRankingSignals=function(n,t){var i=t.Attributes;n.hc=i.hc==="1";n.highConfidenceSuggestionScore=+i.hcs;n.highConfidenceMetaSuggestionScore=t.HighConfidenceMetaSuggestionScore;n.prefetchConfidenceScore=t.PrefetchConfidenceScore;n.suggestionLogMeta=i.lm},i.prototype.compliesWithMinVersion=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.length;++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);i.queryToFetch||(n.text=HitHighlightingParser.addMarkers(n.text));n.baseSearchUrl=u;n.click=function(){return e._host.launchSearch(n.query,e._navigationHelper.getSearchUrl(i.fullPartialQuery,n.query,n.type,n.baseSearchUrl,n.handoffType),n.useRaf)};n.narratorText=t.getNarratorText(n);n.type=="HS"&&t.setExtraVerbs(n,function(){var i=[{verb:"ManageSearchHistory",displayName:e._host.getLocString("ManageSearchHistory"),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&&t.success&&(u._host.refreshCurrentPane(),n.safeSetTimeout(function(){return u._temporaryMessageHandler.showTemporaryMessage(u._host.getLocString("RemoveFromWebHistoryConfirmation",i))},250,"removeBingHistorySuggestion"))})},i.prototype.removeBingHistorySuggestion=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)}}):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.sequenceNumber,!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,"calculateRelatedSuggestions")&&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.Type,0);f&&this.addRelatedSuggestion(null,i,t,this._host.getLocString("Images"),null,"EIM",13);e&&this.addRelatedSuggestion(null,i,t,this._host.getLocString("Videos"),null,"EVI",14);t.childSuggestions.length>0&&this._instrumentationHelper.instrumentDataSource(t.sequenceNumber,u,t.childSuggestions,null)},i}();t.OnlineSuggestionsParser=e;t.adjustCasing=i;t.setCat1SuggestionProperties=r;t.setUrlSuggestionProperties=u})(t=n.WSB||(n.WSB={}))}(AutoSuggest||(AutoSuggest={})),function(n){var t;(function(t){function b(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.getFullYear()==i.getFullYear())return i.toLocaleTimeString(t.uiLanguageCache,{hour:"numeric",minute:"numeric"})}return null}function f(i,f,o,s,h,c){var it,rt,k,v,a,d,y,w,l,b,g;if(c===void 0&&(c=!1),!c&&s.extensionLC&&r.hideFileExtensions&&!t.config.showFileExtn){var nt=s.extensionLC.length,p=s.query,tt=p.toLocaleLowerCase();tt.endsWith(s.extensionLC)&&(it=HitHighlightingParser.addMarkers(p,f),it.toLocaleLowerCase().endsWith(s.extensionLC)&&(s.query=p.substring(0,p.length-nt),rt=HitHighlightingParser.removeMarkers(s.text||"").toLocaleLowerCase(),tt==rt&&(k=s.text.toLocaleLowerCase().lastIndexOf(s.extensionLC),s.text=s.text.substring(0,k)+s.text.substr(k+nt))))}for(s.lastModifiedDate&&(v=s.lastModifiedDate.toLocaleString(t.uiLanguageCache,{day:"numeric",month:"numeric",year:"numeric",hour:"numeric",minute:"numeric"})),a=s.path,s.tooltip=yt(s,a,v,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?(d=(pt(s.match.matchType)?h.getLocString(t.MatchType[s.match.matchType])+": ":"")+HitHighlightingParser.addMarkers(s.match.matchedText,f),s.additionalInfoText=d,s.secondaryMetadata=d,s.classNames.push("withMatchAnnotation","forceNoWrapOutsideTopResult")):v&&t.RuntimeConfig.QfMode!=5&&(s.secondaryMetadata=h.getLocString("LastModified")+": "+v),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],displayName:h.getLocString("CopyFullPath"),executeSync:function(){return r.copyToClipboard(s.path,"")},icon:{type:1,content:"&#xE8C8"}}]},!1),y={},a&&(w=a.lastIndexOf("/"),w<0&&(w=a.lastIndexOf("\\")),l=a.substring(0,w),l.endsWith(":")&&(l=l+"\\"),y[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)}}]),y[h.getLocString("LastModified")]=[{text:v}],b=0,g=e;b<g.length;b++){var ut=g[b],et=ut[0],ot=ut[1],ft=s[ot];ft&&(y[h.getLocString(t.MatchType[et])]=[{text:ft}])}s.previewMetadata=y}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||t.RuntimeConfig.QfMode==9)&&(i.needsRefreshAfterDeduping=!1);i.needsRefreshAfterDeduping&&f(n,t.getEffectiveQuery(n),t.isL2(n),i,u,!0)}function ct(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,w,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.LocalDataProvider.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,b(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);w&&n.isDataSourceEnabled(w,i)&&t.LocalDataProvider.getFiles(k,function(t){var r,f,i,u,e;if(l()){for(nt.instrumentResponseReceived(a,w,null,0,!1),r=[],f=function(i){n.safeExecute(function(){return p(i,w,b(t[g(i)]),r)},"parseFile "+w)},i=0,u=d;i<u.length;i++)e=u[i],f(e);v(w,r,null)}},i,y,w)}function bt(n,i){return t.isMobileCache?null:t.EdgeAppIds.some(function(t){return n.id==t})?i.getLocString("MicrosoftRecommendedBrowser"):i.getLocString("App")}function kt(n,i){return t.isModernSetting(n)?i.getLocString("SystemSettingsAnnotation"):i.getLocString("ControlPanelAnnotation")}function dt(n,i,e,o,s,h,c){var l=t.getAppItem(s),v,y,a,p,b,w,k;if(l){o&&g(s,l);s.primaryMetadata=bt(l,c);s.narratorText=t.getNarratorText(s);s.tooltip=n.isSearchHomeZI?s.text:"";s.type=="IBA"&&(s.tooltip=l.id,s.path=l.id);return}if(t.isSetting(s.type)){s.primaryMetadata=kt(s.deviceItem,c);s.narratorText=t.getNarratorText(s);s.tooltip=n.isSearchHomeZI?s.text:"";return}if(s.type=="LURL"&&(l=s.deviceItem,l)){v=l.id;s.narratorText=t.getNarratorText(s,c.getLocString("DirectNavSuggestion"));s.tooltip=s.query+"\n\n"+v;s.url=v;return}if(y=t.getFileItem(s),y){gt(n,i,e,o,h,s,y,c);return}if(s.type=="PT"||s.type=="CG"){if(a=s,s.type!="PT"&&s.deviceItem.launchArguments||(a.path=s.deviceItem.id),p=s.deviceItem,b=p.kind,b=="program"){nt(s,c);return}if(w=ni(p),w){a.itemTypeDisplayName=w;f(n,i,e,a,c);return}s.type=="CG"&&nt(s,c);return}if(s.type=="FEH"){s.narratorText=t.getNarratorText(s,c.getLocString("SearchHistorySuggestion"));i&&(s.text=HitHighlightingParser.addMarkers(s.text,i));r.fileExplorerSuggestionPage.onSearchHistoryRemoved&&(k={verb:"RemoveFromDeviceHistory",displayName:c.getLocString("RemoveFromDeviceHistory"),executeSync:function(){r.fileExplorerSuggestionPage.onSearchHistoryRemoved(s.query);c.refreshCurrentPane()},icon:{content:"&#xE711",type:2}},u(s,function(){return[k]},!1));return}throw new Error("Unexpected type: "+s.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.isValidDate(w)&&(c.lastModifiedDate=w),b=l.extension,b&&(c.extensionLC=b.toLocaleLowerCase()),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,"System.Music.AlbumTitle",h));y=void 0;switch(h){case"MDOC":c.author=i(l,"System.Author",h);c.lastModifiedBy=i(l,"System.Document.LastAuthor",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.textContentIfMatched=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.Title",h))),v?c.text=HitHighlightingParser.addMarkers(v,u):y?c.match=y:(tt=t.IndexerQueryGenerator?"System.Music.DisplayArtist":"System.Music.Artist",c.match=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);ti(c,a)}function g(i,r){var u=n.safeExecute(function(){return r.getProperty("System.Link.TargetParsingPath")},"getTargetPath"),f,e,o;u&&(u=u.toLocaleLowerCase(),f=t.getKnownFolderPathLC(t.FOLDERID_Profile),f&&(e=t.getKnownFolderPathLC(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\\systemprofile")&&(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.toLocaleLowerCase()){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.primaryMetadata?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.parentFolderDisambig=f}}function nt(n,i){n.primaryMetadata=i.getLocString("RunCommandPrompt");n.classNames.push("action");n.narratorText=t.getNarratorText(n)}function tt(i,r,u,f,e,s,h,c,l,a){var d=t.localDataSourceMayContainPII(u),g,b,y,k,nt;if(!h){g=r.deviceItem.kind;SharedLogHelper.LogError("parseLocalSuggestion"+u,d?"":r.deviceItem.displayName||r.deviceItem.id,new Error("Unrecognized kind: "+g));return}if(b=h=="LURL"?1:2,n.isSuggestionTypeEnabled(u,h,b,i)){var p=t.getEffectiveQuery(i),w=r.deviceItem.displayName,tt=w&&p?HitHighlightingParser.addMarkers(w,p):w,v=t.createSuggestion(i,tt,r.getIcon,r.icon,h,w,n.InstrumentedItem.createInstrumentedItem(f,h),b,f,d);v.uxHint=ei(r,p,e);r.deviceItem.isSimulated||(v.deviceItem=r.deviceItem);v.ciMetaData=r.ciMetaData;t.isApp(h)&&(v.pinnedToTaskbar=e.isPinnedToTaskbar(r.deviceItem.id));r.groupDisplayName&&(v.groupDisplayName=r.groupDisplayName);y=t.getAppItem(v);y?(v.click=function(){return e.launchAppItem(y,u,v.appContext)},t.config.maxJLcm&&ii(i,v,y,e,s,f,u,c)):v.click=v.type=="FEH"?function(){return e.submitFileExplorerTextSuggestion(v.query)}:v.type=="FD"&&t.RuntimeConfig.QfMode==5?function(){return e.submitFileExplorerFolderSuggestion(v.path)}: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,highConfidenceMetaSuggestionScore:v.highConfidenceMetaSuggestionScore,prefetchConfidenceScore:v.prefetchConfidenceScore,id:r.deviceItem.id,suggestionKey:t.getSuggestionKey(v),appContextData:v.appContext?{appContext:v.appContext,query:v.query,textWithoutHH:HitHighlightingParser.removeMarkers(v.text)}:undefined}}:(k=t.getCommandLineItem(v),k&&(v.hc=t.isRealCommand(v,k)));nt=t.getGroupType(v);t.shouldSetThisPcGroupSource(nt,i)&&(v.sourceForGroup=1);dt(i,p,t.isL2(i),t.supportsShortcuts(u,i),v,u,e);(t.RuntimeConfig.QfMode==5||t.RuntimeConfig.QfMode==9)&&(v.additionalInfoText=undefined,v.primaryMetadata=undefined,v.secondaryMetadata=undefined);o(v,"parseLocalSuggestion "+u)&&a(v)&&l.push(v)}}function ti(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_OpenInBrowser],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("OpenFileLocationIn",t.getGroupSourceDisplayName(r.sourceForGroup,i)),executeSync:function(){return i.launchUri(r.locationUrl)},icon:{type:2,content:"&#xE838"}}),u):[]},!0)}function it(i,r){return!t.config.enableFallbackIconsForJumpLists||!w[i]?!1:n.contains(w[i],r)}function ii(n,i,r,f,e,o,s,h){var v=r.id,b=r.filePath,l,k,w;if(!t.config.forceAllJumplists){if(l=t.config.enableJumplistRestrictions&&ut[v],!l&&b){k=b.toLowerCase();for(w in p)if(k.includes(w)){l=p[w];break}if(!l&&t.config.enableJumplistRestrictions)for(w in y)if(k.includes(w)){l=y[w];break}}if(l&&l.length==0)return}(t.RuntimeConfig.AlwaysWide||!ft.find(function(n){return n==v}))&&(i.calculateChildSuggestions=function(){return ri(n,v,b,i,r,l,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).forEach(function(n){o=!0;var t=it(i.deviceItem.id,n.groupType)?i.getIcon:c(n.jumpListItem,n.parent,!1,v),s={verb:"JumpListTask_"+v+"_"+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_"+v+"_"+t,displayName:n.text,executeSync:function(){return a(r,n,f,e)},getIcon:c(n.jumpListItem,n.parent,!0,v)};u.push(h)}))),u},!0))}function ri(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.displayName,n.InstrumentedItem.createInstrumentedItem(p,h),2,f.sequenceNumber,ht,null,null,!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),ui(e,s,v,y))};for(ut=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.setFocusInSearchBox(null,"jumpListItemUnavailable2"))})}function v(n,i,r,u){var f=function(){return fi(i)},e;i.jumpListItem.deleteAsync?(e=i.parent.childSuggestions.length==1,t.Promise.safeChain("deleteJumpList",function(){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.text)))},f)},f)):f()}function ui(n,t,i,r){t.jumpListItem.deleteAsync&&u(t,function(){var u={verb:"RemoveFromThisList",displayName:i.getLocString("RemoveFromThisList"),executeSync:function(){return v(n,t,i,r)},icon:{type:2,content:"&#xE711"}};return[u]},!0)}function fi(n){var i=_ge(n.id);t.setVisibility(i,!1);n.suppressed=!0}function ei(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]},p={"\\msedge.exe":[0]},ft=["Microsoft.Windows.Explorer",],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"],],w={"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]},d;t.getFileExtension=et;t.toDate=ot;t.getTodayTimeString=st;t.setFileTemplate=f;t.enrichMetadataFromDuplicate=ht;t.getIconForTypeAsync=ct;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._instrumentationHelper,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){var o=this;(this._lightweightStorage=e,f.bindShown(function(){var n=o.getContstraintIndexInfo(u.lastUrl);i.currentCIVersion=n?String(n.version):"-1"}),f.hasFallbackHappened())||f.bindAppHidden(function(){var c,h,e,y;if(n.isBingEnabled()&&n.isBrowserOnline()){var p=n.getWindowHost().toLowerCase(),nt=p=="bing.com"||p.endsWith(".bing.com"),tt=typeof ClientTestHooks=="undefined";if(!nt&&(tt||!ClientTestHooks||!ClientTestHooks.isTesthookParamSet("isTest")))return;if(c=o._lightweightStorage.getItem(r.LastCIDownloadAttemptKey),h=null,c&&(h=new Date(c)),h&&(o.getTimeDiffInMins(h)<t.config.waitBetweenCIDownloadCallsInMins?t.config.waitBetweenCIDownloadCallsInMins:0))return;e=o.getContstraintIndexInfo(u.lastUrl);i.currentCIVersion=String(e.version);var l=t.getCurrentLanguage(),f=t.config.ciVersion,w=u.urlResult,s=o.parseUrlResult(w),b=o.getUrlForCiCab(f,l),k=n.contains(t.config.blacklistedCiVersions,e.version)&&f<e.version,it=f==s.version&&s.errorCode!="00000000";if(f>0&&t.config.supportedCiMarkets[l]&&(l!=e.language||f>e.version||k||it)&&(!s.url||k||u.lastUrl==s.url||s.errorCode!="00000000")){var a="cis_v"+f,v="ci_v"+f,d=o._lightweightStorage.getItem(a)?parseInt(o._lightweightStorage.getItem(a)):0,g=o._lightweightStorage.getItem(v)?parseInt(o._lightweightStorage.getItem(v)):0;o._lightweightStorage.setItem(r.LastCIDownloadAttemptKey,n.getCurrentDate().toString());y="constraintIndexDownloader.tryDownloadFromUrlAsync";t.Promise.safeChain(y,function(){return u.tryDownloadFromUrlAsync(b)},function(n){if(n){var t=o.getContstraintIndexInfo(u.lastUrl);i.currentCIVersion=String(t.version);d++;o._lightweightStorage.setItem(a,d.toString())}else SharedLogHelper.LogError(y,"urlResult: "+w,"Download failed");g++;o._lightweightStorage.setItem(v,g.toString())},null,null,b)}}})}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,"Download 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","url: "+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){function a(n){switch(n.type){case"Folder":return"FD";case"Photo":return"LI";case"Video":return"LV";case"Audio":case"Music":return"MU";default:return n.fileSize?"FL":"FD"}}function v(n){switch(n){case"FD":return t.Scope.Folders;case"LI":return t.Scope.Photos;case"LV":return t.Scope.Videos;case"MU":return t.Scope.Music;default:return t.Scope.Documents}}var i=SearchAppWrapper.CortanaApp,r=i.fileExplorerSuggestionPage,u="https://onedrive.live.com",f=u+"/redir.aspx?resid=",s="&ancestorId=",h="&contentMatch=",e="OneDrive provider called without {0}",c=621355968e5,l=function(u){function f(n){var t=u.call(this,"ODC")||this;return t._accessTokenManager=n,t}return __extends(f,u),f.prototype.getName=function(){return"OneDriveDataProvider"},f.prototype.addOneDriveAncestorResourceIdQueryString=function(){if(t.RuntimeConfig.QfMode==5&&!t.isFileExplorerCurrentPathThisPcOrQuickAccess){var i=void 0,u=r.currentSyncRootContentUri?n.tryParseUrl(r.currentSyncRootContentUri,!1):null;if(u&&u.parameters&&(i=u.parameters.substr(1).split("&").find(function(n){return n.startsWith("id=")}).substr(3)),i)return s+i;SharedLogHelper.LogError("OneDriveParser","QfMode="+t.RuntimeConfig.QfMode,new Error(n.formatString(e,["currentSyncRootResourceId"])))}return""},f.prototype.addOneDriveContentMatchQueryString=function(n){return t.RuntimeConfig.QfMode==5||n.scope==t.Scope.Documents?h+"1":""},f.prototype.createUrl=function(i){var r=decodeURIComponent(t.config.oneDriveDotComRootUrl),u;return r+=this.addOneDriveAncestorResourceIdQueryString(),r+=this.addOneDriveContentMatchQueryString(i),u=i?n.encodeQueryParameter(i.queryToFetch.toLowerCase()):"",r+"&q="+u},f.prototype.getAllAccountTokens=function(r){if(t.RuntimeConfig.QfMode==5){var u=i.fileExplorerSuggestionPage.currentSyncRootAccount;u?this._accessTokenManager.getAccountByUserName(!1,0,u,!1,!0,function(n){n&&n.Token?r([n.Token]):r(null,"AccountNotFound")}):t.isFileExplorerCurrentPathThisPcOrQuickAccess?this._accessTokenManager.getAllSyncingAccounts(!1,0,!1,!0,function(n){n.length>0?r(n.map(function(n){return n.Token})):r(null,"NoAccountsFound")}):(SharedLogHelper.LogError("OneDriveParser","QfMode="+t.RuntimeConfig.QfMode,new Error(n.formatString(e,["currentSyncRootAccount"]))),r(null,"CurrentSyncRootAccount"))}else t.windowsAccountType==2?this._accessTokenManager.getAccount(0,t.getBingResourceOrScope(0),!1,!0,function(n){n&&n.Token?r([n.Token]):r(null,"NoAccountsFound")}):r(null)},f.prototype.fetch=function(t,i,r,f,e,o,s){var l=this,h,c;n.isDataSourceEnabled(this._dataSource,t)&&(h={numOfPendingResponses:0},s||(s={}),s["BingAPIs-Authorization-Source"]="Explicit",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];u.prototype.fetch.call(l,t,function(n,t,r,u,f){--h.numOfPendingResponses;i(n,t,r,u,f,h.numOfPendingResponses!=0)},r,f,e,a,v)},this.getAllAccountTokens(function(n,t){t?i(l._dataSource,null,t,null,null,!1):n?(h.numOfPendingResponses=n.length,n.forEach(function(n){return c(n)})):(h.numOfPendingResponses=1,c(null))}))},f}(n.JsonDataProvider),o;t.OneDriveDataProvider=l;o=function(){function i(n){this._host=n}return i.prototype.parse=function(n,i,r,u,f,e){var h=[],o,c,l,s,a,v;if(u&&u.suggestionGroups)for(o=0,c=u.suggestionGroups;o<c.length;o++)if(l=c[o],l.searchSuggestions)for(s=0,a=l.searchSuggestions;s<a.length;s++)v=a[s],this.addContent(n,h,v,i);t.decorateSuggestionsWithParentFolder(h,this._host);e("ODC",h,null)},i.prototype.isValidSuggestion=function(n){return!n.result||n.result.length!=1?!1:n.result[0].type==="History"?(SharedLogHelper.LogError("OneDriveParser",null,new Error("History should be disabled in the request URL")),!1):n.result[0].type==="Tag"?!1:!0},i.prototype.addContent=function(i,r,e,o){var y=this,h,l,k;if(this.isValidSuggestion(e)&&(h=e.result[0],l=a(h),n.isSuggestionTypeEnabled("ODC",l,7,i))){var p=h.rawResourceId,d="https://storage.live.com/items/"+p+":Cropped176x176#h=176&w=176",b=t.ScopeConfig[v(l)].icon,w=l=="FD"?"":t.getFileExtension(h.path),g=this.getOneDriveSuggestionIcon(t.isMedia(l),b,d,w,p),s=t.createSuggestion(i,e.displayText,g,b,l,e.query,n.InstrumentedItem.createInstrumentedItem(o,l),7,o,!0);s.url=f+p;s.path="OneDrive:\\"+h.path.slice(1).replace(/[/]/g,"\\");s.extensionLC=w?w.toLocaleLowerCase():undefined;k=+h.dateModified/1e4-c;s.lastModifiedDate=t.toDate(k);s.sourceForGroup=2;t.setFileTemplate(i,t.getEffectiveQuery(i),t.isL2(i),s,this._host);s.click=function(){return y._host.launchUri(s.url)};s.locationUrl=h.parentFolder&&h.parentFolder.id?f+h.parentFolder.id:u;t.setExtraVerbs(s,function(){var n={verb:t.JumplistActionItemType[t.JumplistActionItemType.S_OpenFileLocationInBrowser],displayName:y._host.getLocString("OpenFileLocationIn",t.getGroupSourceDisplayName(2,y._host)),executeSync:function(){return y._host.launchUri(s.locationUrl)},icon:{type:2,content:"&#xE838"}};return[n]},!0);t.isValidSuggestion(s,"OneDriveParser")&&r.push(s)}},i.prototype.getOneDriveSuggestionIcon=function(n,i,r,u){return t.getIconForTypeAsync(i,u)},i}();t.OneDriveParser=o})(t=n.WSB||(n.WSB={}))}(AutoSuggest||(AutoSuggest={})),function(n){var t;(function(t){var u=SearchAppWrapper.CortanaApp,r="AFC",f=864e5,e=t.config.activityFeedWindow||30,s=[1,7,e],h=32,c=32,l=function(){function o(n){var t=this;this.host=n;n.bindDismissed(function(){t._fetchContext&&(t._fetchContext.fetchInProgress=!1,t._fetchContext=null)});n.bindShown(function(){i.clear()})}return o.prototype.getName=function(){return"ActivityFeedDataProvider"},o.prototype.fetch=function(u,f,o,h,c){var v=this,l,a;u.enabledDataSources[r]&&(h.register(function(){v._callback=null},!1,"AFCfetch"),this._callback=f,i.isSet()?(l=this._fetchContext&&this._fetchContext.fetchInProgress,n.invokeAsynchronously("ActivityFeedDataProvider.callback",function(){c()&&f(r,{items:i.get()},undefined,l?3:1,undefined,l)})):this._fetchContext&&this._fetchContext.fetchInProgress||(a=this.getUserActivityItemsCount(),a<=0?this._callback(r,{items:[]},undefined,undefined,undefined,!1):(this._fetchContext={fetchInProgress:!0},this.fetchChunked(0,this.getUserActivityItemsCount(),0,t.config.chunkAFCReqs?s:[e],this._fetchContext))))},o.prototype.fetchChunked=function(t,i,r,u,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*f),c=new Date(s-u[0]*f);this.getUserActivityItemsWithOptionsAsync(function(n){if(e.fetchInProgress){t+=n.length;var r=t<i&&u.length>1&&u[1]>u[0];o.onChunkReceived(n,r);r?o.fetchChunked(t,i,u[0],u.slice(1),e):e.fetchInProgress=!1}},c,h,i-t)},o.prototype.onChunkReceived=function(n,t){i.push.apply(i,n);this._callback&&this._callback(r,{items:n},undefined,undefined,undefined,t)},o.prototype.getUserActivityItemsWithOptionsAsync=function(i,r,f,e){var s=u.userActivityForWebHelper,o;n.safeExecute(function(){o=s.createActivityQueryOptions();o.endTime=f;o.startTime=r;o.collapseOnActivityId=!0;o.activitySortAggregationType=4;o.activitySortByProperty="System.ActivityHistory.EndTime";o.activitySortOrder=0},"createActivityQueryOptions",undefined,undefined,function(){return o=null});o?t.Promise.safeChain("getUserActivityItemsWithOptionsAsync",function(){return s.getUserActivityItemsWithOptionsAsync(e,!!t.config.filterActivitiesToActivatableItems,o)},i,function(){return i([])}):i([])},o.prototype.getUserActivityItemsCount=function(){var n=u.textScaleFactor||1;return t.shouldEnableTrendingSearches(this.host.getLanguage().toLowerCase())&&t.config.trendingSearchTwoRows?Math.max(t.config.activityInZI-1,0):t.RuntimeConfig.AlwaysWide&&n==1?t.config.activityInZI:t.config.activityInZISinglePane},o}(),o,i;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,i,r,f,e,o,s){var c=this,h,l;t.config.backplateAllIconsInZI?this.innerParse(n,i,r,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("ActivityFeedSuggestionsParser parse",function(){return u.queryFormulationView.deviceSearch.findAppsAsync(l)},function(t){return c.innerParse(n,i,r,f,e,o,s,t)},function(){return c.innerParse(n,i,r,f,e,o,s)},s))},r.prototype.innerParse=function(r,u,f,e,o,s,h,c){for(var p,w=this,v=[],b=function(e){var p=!c||c[e.appId]&&c[e.appId].isImmersive,s=l.getGetIcon(e,p),h=l.getIcon(e,s),a="AFC",o=t.createSuggestion(r,e.activityDisplayText,h?undefined:s,h,a,e.activityDisplayText,n.InstrumentedItem.createInstrumentedItem(u,a),18,u,t.localDataSourceMayContainPII(f),e.id,function(){return e.launchActivity()}),y;o.additionalInfoText=e.description||e.contentUri;o.tooltip=e.activityDisplayText;o.additionalInfoText&&(o.tooltip+="\n\n"+o.additionalInfoText);e.deleteActivityAsync&&t.config.deleteActivity&&(y={verb:"RemoveFromActivityFeed",displayName:l._host.getLocString("RemoveFromActivityFeed"),executeSync:function(){e.deleteActivityAsync();i.clear();w._host.refreshCurrentPane()},icon:{content:"&#xE711",type:2}},n.WSB.setExtraVerbs(o,function(){return[y]},!1));v.push(o)},l=this,a=0,y=e.items;a<y.length;a++)p=y[a],b(p);s(f,v,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 t.EdgeAppIds.some(function(t){return n.appId==t})?this._getEdgeIcon:t.Promise.safeChainWithGlobalCaching("activityFeedClientIcon",function(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,function(n){function i(){t=null}function r(){return!!t}function u(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];t||(t=[]);i.length>0&&t.push.apply(t,i)}function f(){return t.slice(0)}var t;n.clear=i;n.isSet=r;n.push=u;n.get=f}(i||(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="QSCH",r="MUID",e="WSBT",o=function(f){function o(n){var i=f.call(this,"QSCH")||this;return i._host=n,i._lastTypedQuery=new u,t.config.th&&ClientTestHooks.getUrlValue("mockLastQuery")&&i._lastTypedQuery.setQuery(ClientTestHooks.getUrlValue("mockLastQuery")),n.bindDismissed(function(n){n&&n.queryToFetch&&i._lastTypedQuery.setQuery(n.fullPartialQuery)}),i}return __extends(o,f),o.prototype.getName=function(){return"QuickSearchSuggestionsDataProvider"},o.prototype.getBaseUrl=function(){return t.config.trendingSearchUrl},o.prototype.getQuickSearchFormCode=function(){return t.config.quickSearchToEdge?this._host.getFormCode():"WMSRPM"},o.prototype.getPostBody=function(){return JSON.stringify(this.createTrendingSearchAPIProvision(n.cleanGuid(this._host.getRawImpressionGuid()),this.getMuidCookie(),this.getQuickSearchFormCode(),e))},o.prototype.createTrendingSearchAPIProvision=function(n,i,r,u){return{ext:{pagetype:t.config.trendingSearchTwoRows?"trending6":"trending3",appId:"62BA1100B386183A53994BA2AE01182EBFD4A775"},device:{deviceType:2},id:n,imp:[{id:n}],site:{cat:["trendingrecs"],content:{url:"https://www.windowssearch.com/"},domain:"www.windowssearch.com",keywords:"default",page:"https://www.windowssearch.com/",publisher:{ext:{adunitid:11711330,propertyid:10319711,formcode:r,partnercode:u,test:t.config.th},id:"10319711",name:"windowssearch"}},user:{ext:{muid:i}}}},o.prototype.getMuidCookie=function(){if(!this._muidCache){var n=sj_cook.get(r);n&&(n=n.substr(r.length+1),this._muidCache=n)}return this._muidCache},o.prototype.fetch=function(r,u,e,o,s,h,c){var y=this,v,w;if(r.enabledDataSources[i]){var l={},p=t.ScopeConfig[t.Scope.Web]&&t.ScopeConfig[t.Scope.Web].prefixes?t.ScopeConfig[t.Scope.Web].prefixes[0]:null,a=this._host.getLanguage().toLowerCase();t.config.resumeSearch&&(l.quickSearchQuery=this._lastTypedQuery.getQuery(),l.removeAction=function(){y._lastTypedQuery.setQuery("");y._host.refreshCurrentPane()});t.shouldEnableQuickSearches(a)&&!t.shouldEnableTrendingSearches(a)&&(v=[],l.quickAnswers=n.WSB.getQuickAnswersTranslatedSuggestions(a),l.quickAnswers.forEach(function(n){p?v.push(p.toLowerCase()+": "+n.query):v.push(n.query)}),l.quickSearchQuery&&v.indexOf(l.quickSearchQuery)>-1&&(delete l.quickSearchQuery,delete l.removeAction));t.shouldEnableTrendingSearches(a)?(w=function(n,t){l.trendingSearches=[];!!t&&t.impressions&&t.impressions[0]&&t.impressions[0].queries&&(l.trendingSearches=t.impressions[0].queries.map(function(n){return{query:n.query,tooltip:"Web search for "+n.query,serpURLParams:{reqId:ThresholdUtilities.getUrlParameter(n.url,"reqId"),pc:ThresholdUtilities.getUrlParameter(n.url,"pc")}}}));u(i,l,undefined)},f.prototype.fetch.call(this,r,w,e,o,s,h,c)):u(i,l,undefined)}},o}(n.JsonDataProvider),u,f;t.QuickSearchSuggestionsDataProvider=o;u=function(){function t(){this.LastTypedQueryTTLms=6e5}return t.prototype.getQuery=function(){var t=n.getCurrentTime();return this._lastTypedQueryTimeStamp&&t-this._lastTypedQueryTimeStamp<this.LastTypedQueryTTLms?this._lastTypedQuery:(this._lastTypedQuery=null,this._lastTypedQueryTimeStamp=null,null)},t.prototype.setQuery=function(t){this._lastTypedQuery=t;this._lastTypedQueryTimeStamp=n.getCurrentTime()},t}();f=function(){function i(n,t){this._host=n;this._navigationHelper=t}return i.prototype.parse=function(i,r,u,f,e,o){var s=this,l=[],h="RSSG",a=t.ScopeConfig[t.Scope.Web]&&t.ScopeConfig[t.Scope.Web].prefixes?t.ScopeConfig[t.Scope.Web].prefixes[0]:null,c,b,k,v,p,d,g,y,w,nt;if(f&&f.quickSearchQuery&&(c=n.WSB.createSuggestion(i,this._host.getLocString("RedoLastSearch"),null,{type:2,content:"&#xE81C"},h,f.quickSearchQuery,n.InstrumentedItem.createInstrumentedItemNoHandoff(r,h),999,r,t.localDataSourceMayContainPII(u)),b={verb:"RemoveFromDeviceHistory",displayName:this._host.getLocString("RemoveFromDeviceHistory"),executeSync:f.removeAction,icon:{content:"&#xE711",type:2}},c.tooltip=this._host.getLocString("RedoYourLastSearchTooltip",f.quickSearchQuery),n.WSB.setExtraVerbs(c,function(){return[b]},!1),c.click=function(){s._host.reformulate(f.quickSearchQuery);s._host.setFocusInSearchBox(null,"Redo search clicked")},l.push(c)),f&&f.quickAnswers)for(k=function(f){var e=n.WSB.createSuggestion(i,f.text?f.text:f.query,null,t.config.quickAnswerWeb?{type:2,content:"&#xE721"}:f.icon,h,f.query,t.config.quickSearchToEdge?n.InstrumentedItem.createInstrumentedItem(r,h):n.InstrumentedItem.createInstrumentedItemNoHandoff(r,h),999,r,t.localDataSourceMayContainPII(u));e.tooltip=f.tooltip;e.click=function(){if(t.config.quickSearchToEdge)s._host.launchSearch(f.query,s._navigationHelper.getSearchUrl(f.query,f.query,"SW",null,0),e.useRaf);else{var n=f.query;a&&(n=a.toLowerCase()+": "+n);s._host.reformulate(n,null,null,null,!0,f.serpURLParams);s._host.setFocusInSearchBox(null,"Quick answer clicked")}};l.push(e)},v=0,p=f.quickAnswers;v<p.length;v++)d=p[v],k(d);if(f&&f.trendingSearches)for(g=function(f){var e=n.WSB.createSuggestion(i,f.query,null,{type:2,content:"&#xE721"},h,f.query,t.config.quickSearchToEdge?n.InstrumentedItem.createInstrumentedItem(r,h):n.InstrumentedItem.createInstrumentedItemNoHandoff(r,h),999,r,t.localDataSourceMayContainPII(u));e.tooltip=f.tooltip;e.click=function(){var n,r,i;if(t.config.quickSearchToEdge){if(n=s._navigationHelper.getSearchUrl(f.query,f.query,"SW",null,0),f.serpURLParams)for(r in f.serpURLParams)n=ThresholdUtilities.setUrlParameter(n,r,f.serpURLParams[r]);s._host.launchSearch(f.query,n,e.useRaf)}else i=f.query,a&&(i=a.toLowerCase()+": "+i),s._host.reformulate(i,null,null,null,!0,f.serpURLParams),s._host.setFocusInSearchBox(null,"Trending answer clicked")};e.classNames.push("quickAnswerNoIcon");l.push(e)},y=0,w=f.trendingSearches;y<w.length;y++)nt=w[y],g(nt);o(u,l,undefined)},i}();t.QuickSearchSuggestionsParser=f})(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._currentWebSignals=null);(!n.config.enableCISpeller||i._currentSpellerTrigger)&&(i._previousSpellerTrigger=i._currentSpellerTrigger,i._currentSpellerTrigger=null)});t.bindConversationStart(function(){i._previousWebSignals=null;i._currentWebSignals=null;i._previousSpellerTrigger=null;i._currentSpellerTrigger=null;i._previousBestMatchSuggestion=null;i._previousQuery=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=function(n){this._previousBestMatchSuggestion=n},t.prototype.getPreviousTopHit=function(){return this._previousBestMatchSuggestion},t.prototype.updateSpellerTriggerData=function(n,t){this._currentSpellerTrigger={query:n,triggerSpeller:this.triggerSpellerOnTheNextKeyStroke(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.isPossibleFirstMisspelling(n,this._previousSpellerTrigger.query)?!0:!1},t.prototype.enableCISpeller=function(t){return n.config.enableCISpeller?this._previousSpellerTrigger&&this._previousSpellerTrigger.triggerSpeller&&this.disableCISpeller(t)?!1:this._previousSpellerTrigger&&this.isPossibleFirstMisspelling(this._previousSpellerTrigger.query,t)?!0:this._previousSpellerTrigger&&(this.isTypedEventQuery(this._previousSpellerTrigger.query,t)||this.isBackspaceEventQuery(this._previousSpellerTrigger.query,t))&&this._previousSpellerTrigger.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.isPossibleFirstMisspelling=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.toLocaleLowerCase().startsWith(t.toLocaleLowerCase())&&!this._previousBestMatchSuggestion.query.toLocaleLowerCase().startsWith(i.toLocaleLowerCase())&&this.isTypedEventQuery(t,i)&&i.length>=n.config.enableCISpellerAtPrefixLength?!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 l(n,t){e=n;s=t;var f=_ge("dialogBox");f&&(sj_be(f,"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,f,u;if(r){e=void 0;switch(n){case 39:for(t=i(),o=!1,f=0,u=void 0;u=t[f];f++)if(o){e=u;break}else if(o=u.selected==!0,o&&f+1==t.length){e=t[0];break}break;case 37:for(t=i(),s=void 0,f=0,u=void 0;u=t[f];f++){if(u.selected==!0){e=s?s:t[t.length-1];break}s=u}}e&&c(e)}}),t.bindKeyEscape(function(n){o()&&(u(),n.handled=!0)}))}function a(t,i,u,o){var h,c;if(f=[],i.length==0)throw new Error("DialogBox: Empty buttons array");f=i.map(function(n,t){var i=n;return i.id="dialog_b"+t,i.narratorText=i.text,i.selected&&(h=i.id),i});c={isVisible:!0,title:u,messageText:t,buttons:f,isModal:o};e.updateDialogBox(c);h&&n.safeSetTimeout(function(){return _ge(h).focus()},0,"DialogBox.show");s.setFocusInWebView("dialogBoxViewModel");r=!0}function u(){if(r)e.updateDialogBox({isVisible:!1}),r=!1}function o(){return r}function i(){return f}function v(){return i().map(function(n){return[n]})}function h(){return i().filter(function(n){return n.selected}).shift()}function c(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 y(){if(o()){var n=h();n&&(n.action&&n.action(),u())}}function p(){return!1}var f=[],e,r=!1,s;t.init=l;t.show=a;t.hide=u;t.isVisible=o;t.getSelectableItems=i;t.getSelectableItemsByGroup=v;t.getSelectedItem=h;t.select=c;t.submit=y;t.onAfterKeyDown=p})(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=SearchAppWrapper.CortanaApp,h=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",rt="dFocusExit",i="win-xyfocus-suspended",ut="Rewards.ReportActivity.Success",ft="Rewards.ReportActivity.Failure",p,o;t.MiniSerpIframeId="miniIframeSerp";t.MiniSerpFetchEvent="miniSERP.Fetch";t.MiniSerpLoadedEvent="MiniSerpContentLoaded";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=["/videos/search","/videos"],at=/[\?\&]FORM=HDRSC[1-3]/i,e="ClientInst";p=function(){function i(i,r,f,e,o,s){var h=this;this._page=i;this._host=r;this._navigationHelper=f;this._instrumentationHelper=e;this._sequenceNumberManager=o;this._msRewardsViewModel=s;this._deviceScale=1;this._previewRequestId=0;this._previousURLs=[];this.blockedMiniSERPUrls=[_w.location.origin+_w.location.pathname];this._root=_ge("qfPreviewPane");this._seeAllResults=_ge("seeAllResults");this._footer=_ge("footer");this._mask=_ge("previewMask");this._forceLoadScreen=_ge("forceLoadMessage");this._contentContainer=_ge("previewContainer");this._scrollArea=_ge("qfPreviewScrollArea");this._loadingScreen=_ge("loadingScreen");sj_be(this._scrollArea,"scroll",function(t){h._iframe&&n.contains([2,3],h._currentVertical)&&h._iframe.contentWindow.dispatchEvent(new Event(t.type,t));h._calculateIFrameHeight&&h._calculateIFrameHeight()});this._footer&&sj_be(this._footer,"keydown",function(i){h._iframe&&n.isUpOrDownKey(i.keyCode)?(i.keyCode==38?h.tryExecuteFocusOnMiniSerp(function(){return h._focusHelper.moveFocusToEdgeFocusableElement(1)}):t.RuntimeConfig.AllowKeyboardNavCycling&&h.tryExecuteFocusOnMiniSerp(function(){return h._focusHelper.moveFocusToEdgeFocusableElement(0)}),sj_pd(i),sj_sp(i)):i.keyCode==13&&h._footer.click()});this._mask&&t.RuntimeConfig.MiniSERPMode!=0&&sj_be(this._mask,"keydown",function(n){n.keyCode==13&&h._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.keyCode,h._focusHelper&&!h._focusHelper.isL2Visible()&&h._focusHelper.getXYFocusRoot()!=h._originalMiniSerpXYFocusRoot?(h._focusHelper.setXYFocusRoot(h._originalMiniSerpXYFocusRoot),h.tryExecuteFocusOnMiniSerp(function(){return h._focusHelper.moveFocus(i,f)})):(i!=u[t.getRtlAdjustedKey(39)]&&n.source.blur(),i==u[40]||i==u[38]&&t.RuntimeConfig.AllowKeyboardNavCycling?h._footer?h._footer.focus():h._focusHelper.moveFocusToEdgeFocusableElement(i==u[38]?1:0):i!=u[t.getRtlAdjustedKey(37)]||h._host.searchBoxHasFocus()||h._host.setFocusInSearchBox(f,"previewPaneUnfocus")))});r.bindShown(function(){ThresholdUtilities.getCortanaHeaders(function(n){n&&n["X-BM-DeviceScale"]&&(h._deviceScale=+n["X-BM-DeviceScale"]/100)});h.setVertical(1)});r.bindAppHidden(function(){h._seeAllResults&&(h._seeAllResults.innerText="");h._currentVertical=null});r.bindSearchBoxGotFocus(function(){h._focusHelper&&h._focusHelper.onSearchBoxFocusChanged()});sj_evt.bind(t.MiniSerpLoadedEvent,function(){h._onIFrameLoadedCallback&&(h._onIFrameLoadedCallback(),h._onIFrameLoadedCallback=null)});this._msRewardsViewModel&&(sj_evt.bind(ut,function(n){var t=n[1];h._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._onPreviewPaneRendered=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._page.updatePreviewErrorMessageView(null);this.clearContent();this._previousURLs=[]},i.prototype.showForceLoad=function(n,i){var r=this;this._instrumentationHelper.logClientInstEvent("Select","ForceLoadOpened",this._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._forceLoadScreen.hasChildNodes();)this._forceLoadScreen.removeChild(this._forceLoadScreen.lastChild)},i.prototype.formatForceLoadPage=function(n){var s=this._host.getLocString("ForceLoadMessage"),h=this._host.getLocString("ForceLoadButton"),e=s.split("{0}"),o=sj_ce("div","","accentColor"),r,i,u,f,t;this._forceLoadScreen.appendChild(o);r=_d.createElement("span");r.id="forceLoadIcon";r.innerHTML="&#xE721";o.appendChild(r);i=sj_ce("div","forceLoadQueryText","");i.appendChild(_d.createTextNode(e[0]));u=_d.createElement("span");u.textContent=n;i.appendChild(u);i.appendChild(_d.createTextNode(e[1]));this._forceLoadScreen.appendChild(i);f=sj_ce("div","","");this._forceLoadScreen.appendChild(f);t=_d.createElement("button");t.className="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(this._contentContainer.lastChild);this._contentContainer.classList.remove("miniSerpContainer");this._iframe&&(this._iframe=null,this._calculateIFrameHeight=null);this._mutationObserver&&(this._mutationObserver.disconnect(),this._mutationObserver=null)},i.prototype.hasFocus=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=this._host.getLocString("OpenResultsBrowser");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,h,l,c,y,a,v,w;if(this.miniSERPRenderTimeoutInstrumentation("miniSerpViewModelUpdate"),t.config.disableOfflineRequest&&!n.isBrowserOnline()){this.renderOfflineMessage(i.query);return}if(this._previewedSuggestion=i,this._onPreviewPaneRendered=e,h=i.type=="MB"&&i.segments=="Organization"?null:i.baseSearchUrl,l=yt(i.handoffType),this.setVertical(l),this._footer&&(this._footer.onclick=function(t){o._previewPaneViewModelParent.onBeforeItemLaunch(n.getCurrentTime(),n.getInputType(t),3);o._host.launchSearch(i.query,o._navigationHelper.getSearchUrl(r.fullPartialQuery,i.query,i.type,h,i.handoffType),!1);o._previewPaneViewModelParent.onAfterItemLaunch(3)}),this._mask&&(this._mask.onclick=function(t){o._previewPaneViewModelParent.onBeforeItemLaunch(n.getCurrentTime(),n.getInputType(t),3);o._host.launchSearch(i.query,o._navigationHelper.getSearchUrl(r.fullPartialQuery,i.query,i.type,h,i.handoffType),!1);o._previewPaneViewModelParent.onAfterItemLaunch(3)}),c=l==2&&r.overrideAction==1,t.config.th&&ClientTestHooks.isTesthookParamSet("noSerp")){this.renderIframe(null,"<html><body><\/body><\/html>",{},undefined,c);y=n.getCurrentTime();this._previewPaneViewModelParent.onResponseReceived(y);return}var p=r.inorganic?!1:u==0,b=t.RuntimeConfig.QfMode==6?undefined:p?"WMSRPA":"WMSRPM",s=c?this._navigationHelper.getImageSearchUrl(t.config.enableSnipSearchV2):this._navigationHelper.getSearchUrl(r.fullPartialQuery,i.query,i.type,h,i.handoffType,b,!0,null,p);if(s+="&qfig="+this._instrumentationHelper.getImpressionGuid(this._sequenceNumberManager.getSequenceNumber()),this._msRewardsViewModel&&this._msRewardsViewModel.isRewardsEnabled()&&(s+="&rewards=1"),r.serpURLParams)for(a in r.serpURLParams)s=ThresholdUtilities.setUrlParameter(s,a,r.serpURLParams[a]);this._previousURLs=[];c?(v=function(){return o.renderErrorMessage(i.query)},w=r.overrideActionHandlerAsync,w(function(n){n?o.downloadAndDisplayMiniSerp(i,s,n,u,i.previewCallback):(o.miniSerpErrorInstrumentation("notHaveMultipartBody"),v())},function(){o.miniSerpErrorInstrumentation("bingImageSearchActionFailed");v()})):this.downloadAndDisplayMiniSerp(i,s,null,u,i.previewCallback)},i.prototype.miniSERPRenderTimeoutInstrumentation=function(n){var t;t={FunctionCalled:n};this._instrumentationHelper.logClientInstEvent(e,"MiniSERPRenderTimeout",this._sequenceNumberManager.getSequenceNumber(),t)},i.prototype.miniSerpErrorInstrumentation=function(n,t,i){var r;r=i?{ErrorCause:n,ResponseRecievedTimeStamp:t.toString(),ResponseText:i.responseText,ContentType:i.contentType,ResponseStatusCode:i.status.toString(),RequestStatusCode:i.result.toString()}:{ErrorCause:n};this._instrumentationHelper.logClientInstEvent(e,"MiniSERPError",this._sequenceNumberManager.getSequenceNumber(),r)},i.prototype.renderOfflineMessage=function(t){var i=n.isBrowserOnline(),r=this._host.getLocString("PreviewPaneOfflineTitle"),u=this._host.getLocString("PreviewPaneOfflineMessage"),f=u.split("{0}"),e={isOnline:i,previewPaneTitle:r,previewPaneMessageParts:f,fullPartialQuery:t};this._page.updatePreviewErrorMessageView(e)},i.prototype.renderErrorMessage=function(t){var i=n.isBrowserOnline(),r=this._host.getLocString("PreviewPaneErrorMessage"),u=r.split("{0}"),f={isOnline:i,previewPaneTitle:"",previewPaneMessageParts:u,fullPartialQuery:t};this._page.updatePreviewErrorMessageView(f)},i.prototype.downloadAndDisplayMiniSerp=function(i,r,u,f,e){var o=this,l=!1,a,v,y,p,w,s;t.config.th&&(a=ClientTestHooks.getUrlValue("client"),l=a&&a.toLowerCase()=="windows",v=ClientTestHooks.getUrlValue("previewPaneUrlOverride"),r=v?decodeURIComponent(v):ClientTestHooks.CopyTestParameters(_w.location.search,r),l&&(r=ThresholdUtilities.setUrlParameter(r,"client","windowsMiniSerp")),y=ClientTestHooks.getUrlValue("miniSerpBag"),y&&(r=ThresholdUtilities.setUrlParameter(r,"bag",y)),p=ClientTestHooks.getUrlValue("dummyref"),p&&(r=ThresholdUtilities.setUrlParameter(r,"dummyref",p)));w=f==0;sj_evt.fire(t.MiniSerpFetchEvent,i,w);s=this._host.getCustomHeaders(null);s["X-BM-DeviceDimensionsLogical"]=h+"x"+this._root.clientHeight;s["X-BM-DeviceDimensions"]=String(Math.round(h*this._deviceScale))+"x"+this._root.clientHeight;l||(s["User-Agent"]=navigator.userAgent+" RestrictedAPI");u&&(s["Content-Type"]=u.contentType);s["X-Search-SafeSearch"]="Strict";var b=++this._previewRequestId,c,k=function(t){if(c)sb_ct(c),c=null;else return;o.miniSERPRenderTimeoutInstrumentation("miniSerpViewModelCallback");var f=n.getCurrentTime();o._previewPaneViewModelParent.onResponseReceived(f);t.status==200&&t.responseText?(o._previousURLs.push(r),o.renderIframe(r,t.responseText,s,l,!!u,e)):(o.miniSerpErrorInstrumentation("renderErrorMessage",f,t),o.renderErrorMessage(i.query))},d=(t.config.miniSERPRequestRetries+1)*t.config.miniSERPRequestTimeout+1e3;c=n.safeSetTimeout(function(){o._previewedSuggestion!=null&&o._previewedSuggestion==i&&(c=null,o.miniSERPRenderTimeoutInstrumentation("ppMiniSerpRenderTimeout"),o.stopLoadingScreen(),o.renderErrorMessage(i.query))},d,"ppMiniSerpRenderTimer");this.fetchMiniSerpUrl(r,u?u.data:null,s,k,b,u?0:t.config.miniSERPRequestRetries)},i.prototype.isDarkModeEnabled=function(){return s.theme?s.theme.startsWith("000000"):!1},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.toString(),RetriesRemaining:s.toString()};h._instrumentationHelper.logClientInstEvent(e,"MiniSERPRefetch",h._sequenceNumberManager.getSequenceNumber(),r);h.fetchMiniSerpUrl(i,null,u,f,o,s-1)}});t.config.darkMode&&this.isDarkModeEnabled()&&!i.includes("&darkschemeovr=1")&&(i+="&darkschemeovr=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",t.MiniSerpIframeId);this._iframe.setAttribute("scrolling","no");this._contentContainer.classList.add("miniSerpContainer");this._contentContainer.appendChild(this._iframe);var c=this._iframe.contentWindow,h=this._iframe.contentDocument,l=!1;this._footer&&(t.setVisibility(this._footer,!e),t.setVisibility(this._mask,!e));this.setIframeHeight(0);this._onIFrameLoadedCallback=function(){var e=h.body,o=0,r;s._calculateIFrameHeight=function(){var n=e.offsetHeight;n!=o&&n>0&&(o=s.setIframeHeight(n))};s._calculateIFrameHeight();s.overrideAjaxCalls(c,u,f);s.captureNavigationsAndSizeEvents(i,e,c,h);s._scrollArea.scrollTop=0;t.config.backStackSearchEnabled&&(s._shouldAddSearchBackStack=!0,s._currentBackStackTimeout&&clearTimeout(s._currentBackStackTimeout),s._currentBackStackTimeout=sb_st(function(){s._shouldAddSearchBackStack=!1},t.config.miniSerpRedirectTimeoutInMs));n.contains([2,3],s._currentVertical)&&(r={childList:!0,subtree:!0},s._mutationObserver=new MutationObserver(function(){s._calculateIFrameHeight&&s._calculateIFrameHeight()}),n.safeExecute(function(){s._currentVertical===2?s._mutationObserver.observe(h.getElementById("images"),r):s._currentVertical===3&&s._mutationObserver.observe(h.getElementById("video"),r)},"onIFrameLoadedCallback"));s._msRewardsViewModel&&s._msRewardsViewModel.isRewardsEnabled()&&c.sj_rra&&c.sj_rra(i);s._onPreviewPaneRendered&&(s._onPreviewPaneRendered(!0,!1,null),s._onPreviewPaneRendered=null)};this._iframe.onload=function(){if(l){s.tryLaunchUrl(i,c.location.href,0);return}l=!0;s.overrideAjaxCalls(c,u,f)};h.open();h.write(r);h.write("<base href='"+i+"' target='_parent' />");o&&o(this._iframe.contentWindow);h.write("<script>window.parent.sj_evt.fire('"+t.MiniSerpLoadedEvent+"')<\/script>");h.close()},i.prototype.setIframeHeight=function(n){return n<c&&(n=c),this._iframe.style.height=n+"px",n},i.prototype.overrideAjaxCalls=function(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=function(t,i,r,u){var f=this,c;this._focusHelper=this.createFocusHelper(r,u);this._focusHelper&&(this._originalMiniSerpXYFocusRoot=this._focusHelper.getXYFocusRoot());this._previewPaneViewModelParent.focusPending&&(this._previewPaneViewModelParent.focusPending=!1,this.focus());this._iframe.contentWindow.overlay_onBeforeContentLoad=function(){f.setIframeHeight(ot)};this._iframe.contentWindow.overlay_onBeforeSuccess=function(n){f.setIframeHeight(n.clientHeight+st)};var o=function(){r.sj_lc=function(n){if(n)f.tryLaunchUrl(t,n,0);else{var i=f._previousURLs[f._previousURLs.length-2];f._previousURLs.splice(f._previousURLs.length-2,2);f.tryLaunchUrl(t,i,0)}};r.MiniSerp=!0;f._calculateIFrameHeight()},h=function(n){f._focusHelper.setXYFocusRoot(n);f._focusHelper.moveFocusToEdgeFocusableElement(0)},s=r.sj_evt;s?(c=["onP1","ajaxReady"],c.forEach(function(n){return s.bind(n,o)}),s.bind("l2_overlay_visible",function(n){o();var t=f._iframe.contentDocument.getElementById(n[1]);t&&(f._focusHelper.setIsL2Visible(!0),h(t))}),s.bind("l2_overlay_hidden",function(){o();f._focusHelper.setIsL2Visible(!1);h(f._iframe.contentDocument.body)})):o();r.open=function(n){return f.tryLaunchUrl(t,n,0),null};i.onclick=function(i){var r=i.target;if(r){if(r.id=="miniSERPToWeb"){f._instrumentationHelper.logClientInstEvent(e,"AdultExplicitLoad",f._sequenceNumberManager.getSequenceNumber(),{url:t,query:f._previewedSuggestion.query});f._footer.click();return}while(r&&!r.href)r=r.parentNode}r&&f.tryLaunchUrl(t,r.href,n.getInputType(i))==0&&i.preventDefault()}},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.enrichBingSearchUrlParameters(n,!0);this.setVertical(r);o={destinationVertical:r.toString(),url:n};this._instrumentationHelper.logClientInstEvent("Select","NavigateInPlace",this._sequenceNumberManager.getSequenceNumber(),o);this.downloadAndDisplayMiniSerp(this._previewedSuggestion,e,null,1);this._previewPaneViewModelParent.onAfterItemLaunch(f)},i.prototype.tryLaunchUrl=function(i,r,u){var s,f,h,e,c,o;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"))return 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);if(o=n.tryGetBingPathLC(r),o)if(et.some(function(n){return o.startsWith(n)})||l(f))this._host.launchUri(t.config.settingsUri);else if(o.startsWith("/profile/interests"))this._host.launchCat1(null,"ms-cortana://navigate/Notebook",null);else if(o.startsWith("/fd/auth/")){var p=SearchAppWrapper.CortanaApp,w=p.isCortanaEnabled?n.safeExecute(function(){return p.getCortanaCapabilities()},"getCortanaCapabilities","").split(","):[],b=n.contains(w,"Personalization");b?SharedLogHelper.LogError("previewPane.tryLaunchUrl",i,new Error("Redirecting to sign in page when already signed in")):this._host.launchUri("ms-cortana://CapabilitiesPrompt/?RequestedCapabilities=Personalization")}else this._host.launchUri(r);else this._shouldAddSearchBackStack&&(sb_ct(this._currentBackStackTimeout),r=this.buildRedirectUrl(this._previewedSuggestion.query,r)),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.enrichUrlWithDeviceInfo(n),n=this._navigationHelper.enrichUrlWithCvid(n),n=this._navigationHelper.enrichUrlWithSuggestionType(n,this._previewedSuggestion.type),t||(n=this._navigationHelper.enrichUrlWithMuidInfo(n),n=this._navigationHelper.enrichUrlWithSafeSearchInfo(n)),n},i.prototype.createFocusHelper=function(n,t){var i=this.getSearchAppWinJSXYFocus(n);return!i&&SearchAppWinJS&&SearchAppWinJS.initXYFocus&&(SearchAppWinJS.initXYFocus(n),i=this.getSearchAppWinJSXYFocus(n),n[tt]=i?!0:!1),i?new o(t,n,i,this._scrollArea,this._currentVertical):null},i.prototype.getSearchAppWinJSXYFocus=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.buildRedirectUrl=function(t,i){return _w.location.protocol+"//"+_w.location.host+"/WS/redirect/?q="+n.encodeQueryParameter(t)+"&url="+btoa(i)+"&form=WSBBST&cvid="+n.encodeQueryParameter(this._host.getConversationId())+"&rtk="+this._iframe.contentWindow.rtk},i}();t.MiniSerpViewModel=p;o=function(){function e(n,i,r,u,f,e){var o=this,s;this._targetDocument=n;this._targetWindow=i;this._searchAppXYFocus=r;this._scrollArea=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 h="b_hide",c="acc-inactive",l=".b_slidebar";this._focusDiv=sj_ce("div",w,h);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);s=!0;sj_be(n,"click",function(){return s=!1},!0);sj_be(n,"keydown",function(){return s=!0},!0);sj_be(n,"focus",function(){return o.updateFocusedElementAndOutline(o._targetDocument.activeElement,s)},!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,s)},!0);sj_be(n,"transitionend",function(n){var t=o._targetDocument.activeElement;(n.propertyName=="height"||n.srcElement==t.closest(l))&&(o._focusOutlineTimeout?(o.clearFocusOutlineTimeout(),o.outlineElementAndScrollIntoView(t)):o._focusDiv.classList.contains(h)||o.outlineElementAndScrollIntoView(t),n.srcElement.style.height=="0px"?n.srcElement.classList.add(c):n.srcElement.classList.remove(c))});this._searchAppXYFocus.keyCodeMap.home.push(36);this._searchAppXYFocus.keyCodeMap.end.push(35)}return 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=function(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.activeElement)),i},e.prototype.onSearchBoxFocusChanged=function(){this._targetDocument.hasFocus()?this.updateFocusedElementAndOutline(this._targetDocument.activeElement):this._useStickyFocus||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=function(){return this._lastElementFocused&&this.isVisible(this._lastElementFocused)?(this._lastElementFocused.focus(),this.updateFocusedElementAndOutline(this._lastElementFocused),!0):this.moveFocusToEdgeFocusableElement(0,!0)},e.prototype.updateFocusedElementAndOutline=function(i,r){var u=this,f;(r===void 0&&(r=!0),i&&i!=this._targetDocument.body)&&(this.processFocusedElement(i),r)&&(f=this._lastElementFocused&&i.elementType&&i.elementType==this._lastElementFocused.elementType&&i.parentElement==this._lastElementFocused.parentElement?nt:0,f?(t.setVisibility(this._focusDiv,!1),this._focusOutlineTimeout=n.safeSetTimeout(function(){u._targetDocument.activeElement==i&&u.outlineElementAndScrollIntoView(i);u.clearFocusOutlineTimeout()},f,"updateFocusedElementAndOutline")):this.outlineElementAndScrollIntoView(i),this._lastElementFocused=i)},e.prototype.outlineElementAndScrollIntoView=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._focusDiv.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.scrollTop-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.prototype.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,"keydown",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",function(t){var r=t.target,f=+r.getAttribute("min"),e=+r.getAttribute("step"),u=t.keyCode==37,o=t.keyCode==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",function(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([onclick='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(n){n===void 0&&(n=!0);t.setVisibility(r._focusDiv,!1);r.updateFocusedElementAndOutline(r._targetDocument.activeElement,n)},sj_be(n,"keyup",function(n){n.keyCode==13&&s()},!0),sj_be(n,"click",function(){s(!1)})):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.HideShowTestHooks(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){var o=this;this._page=n;this._host=t;this._instrumentationHelper=i;this._sequenceNumberManager=r;this._miniSerpViewModel=u;this._localPreviewPaneViewModel=f;this._msbPreviewPaneViewModel=e;this._previewPaneId=0;this._beforeItemLaunchEventHandlers=[];this._afterItemLaunchEventHandlers=[];var s=function(n,t,i,r,u){o._clickLoggedForCurrentPreviewPane||o._beforeItemLaunchEventHandlers.forEach(function(f){return f(n,o._previewedSuggestion,t,i,r,u)})},h=function(n){o._clickLoggedForCurrentPreviewPane||(o._afterItemLaunchEventHandlers.forEach(function(t){return t(o._previewedSuggestion,o._queryForPreviewedSuggestion,n)}),o._clickLoggedForCurrentPreviewPane=!0)},c=function(n){o._previewPaneResponseReceivedTimeStamp=n;o._miniSerpViewModel.stopLoadingScreen()};this._previewPaneViewModelParent={focusPending:!1,onBeforeItemLaunch:s,onAfterItemLaunch:h,startLoadingScreen:function(){return o._miniSerpViewModel.startLoadingScreen()},onResponseReceived:c};this._miniSerpViewModel.init(this._previewPaneViewModelParent);this._localPreviewPaneViewModel&&this._localPreviewPaneViewModel.init(this._previewPaneViewModelParent);this._msbPreviewPaneViewModel&&this._msbPreviewPaneViewModel.init(this._previewPaneViewModelParent);SearchAppWrapper.CortanaApp.addEventListener("resettingtodefaultsize",function(){return o.dismiss()});t.bindKeyDown(function(){o._previewPaneViewModelParent.focusPending=!1});t.bindSearchBoxGotFocus(function(){return o._previewPaneViewModelParent.focusPending=!1});t.bindQueryChangedOrInitialized(function(n){return o._currentQuery=n},!0);t.bindAccountChanged(function(){o._miniSerpMustRefresh=!0});i.bindFinalizeKeystroke(function(n){o._activePreviewPaneViewModel&&n&&o._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=function(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 h=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 l=++this._previewPaneId,c=!0,s=!1,a=n.getCurrentTime(),v=function(n,t,r){var e,v;if(n||!t){if(t||(c=!1),!s){if(e={ppId:""+l,openType:f,suggestion:u?u.instItem.getLayoutKValue():undefined,suggestionType:u?u.type:undefined,startOpening:""+a,openDelay:o?""+o:undefined},r)for(v in r)e[v]=r[v];e.waitingForMore=c?"true":undefined;h._instrumentationHelper.previewPaneOpenedOrClosed(!0,h._sequenceNumberManager.getSequenceNumber(),u?u.instItem:undefined,u?u.previewPaneType:undefined,i(f)==0,e)}s=!0;n&&(s=!1,f="keepOpen")}};this.setPreviewPaneContent(r,u,i(f),this._previewPaneId,v)}f!="button"&&this._selectionHandler.updateSelectionState(u)},r.prototype.showPreviewAndFocus=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.prototype.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._previewPaneResponseReceivedTimeStamp+1e3&&(r=!1)),r&&(u=i?{fromQFDismiss:"1"}:undefined,this._instrumentationHelper.previewPaneOpenedOrClosed(!1,this._sequenceNumberManager.getSequenceNumber(),this._previewedSuggestion.instItem,this._previewedSuggestion.previewPaneType,undefined,u)),t.RuntimeConfig.AlwaysWide||i||this._page.setPreviewPaneVisibility(!1),this._miniSerpViewModel.stopLoadingScreen(),this.clear())},r.prototype.clear=function(){this._previewedSuggestion&&(this._previewedSuggestion.hasPreviewPaneOpened=!1,this._selectionHandler.updateSelectionState(this._previewedSuggestion),this._previewedSuggestion=null);this._queryForPreviewedSuggestion=null;this._previewPaneResponseReceivedTimeStamp=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.queryToFetch.toLocaleLowerCase().startsWith(i.queryToFetch.toLocaleLowerCase()),i&&n.queryToFetch.toLocaleLowerCase()!=i.queryToFetch.toLocaleLowerCase())&&(r=this._pendingPreviewedSuggestion&&this._pendingPreviewedSuggestion.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=function(){this._openTimer&&(sb_ct(this._openTimer),this._openTimer=null,this._pendingPreviewedSuggestion=null,this._queryForPendingPreviewedSuggestion=null,this._miniSerpViewModel.stopLoadingScreen())},r.prototype.clearCloseTimer=function(){this._closeTimer&&(sb_ct(this._closeTimer),this._closeTimer=null)},r.prototype.onTopHitUpdated=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.hasPreviewPaneOpened=!0;this._selectionHandler.updateSelectionState(u);return}if(this._previewedSuggestion&&t.isEquivalentForPreviewPanePurposes(i,this._previewedSuggestion,u)){n.contains(f,r)||(this._previewedSuggestion=u,this._queryForPreviewedSuggestion=i,u.hasPreviewPaneOpened=!0,this._selectionHandler.updateSelectionState(u),this.refreshLocalContent(i,u));return}}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._pendingPreviewedSuggestion),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.featureStore[264]!==undefined?this.calculateDelayForProbabilitySignal(i.featureStore[264]):t.RuntimeConfig.AlwaysWide?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,o;this._instrumentationHelper.notifyPreviewPanePending(this._sequenceNumberManager.getSequenceNumber(),!0);s=t.config.disableOfflineRequest?n.isBrowserOnline()&&t.shouldOpenMiniSerp(r):t.shouldOpenMiniSerp(r);o=s&&!t.config.enableForceLoad&&!i.inorganic?this.getDelayForMiniSerp(u,r):0;o?(u=="arrowUpOrDown"&&(this.clear(),this.clearSuggOpeningState(this._pendingPreviewedSuggestion),this.clearSuggOpeningState(this._previewedSuggestion)),r.isPreviewPaneOpening=!0,this._selectionHandler.updateSelectionState(r),this.clearOpenTimer(),this.clearCloseTimer(),this._pendingPreviewedSuggestion=r,this._queryForPendingPreviewedSuggestion=i,this._openTimer=o==Number.MAX_VALUE?Number.MAX_VALUE:n.safeSetTimeout(function(){e._openTimer=null;r=e._pendingPreviewedSuggestion;e._pendingPreviewedSuggestion=null;e._queryForPendingPreviewedSuggestion=null;e.showPreview(i,r,u,f,o)},o,"ppOpenTimer"),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.clearSuggOpeningState(this._previewedSuggestion),this.clear(),this.clearOpenTimer(),this.clearCloseTimer(),this._miniSerpViewModel.stopLoadingScreen());return}f=u;f.previewPaneType&&(e&&(i==40||i==38)?this._previewedSuggestion!=f&&this.autoOpen(r,f,"arrowUpOrDown",!1):i==t.getRtlAdjustedKey(39)&&this._currentQuery.originalCursorPosition==this._currentQuery.originalQuery.length&&this._host.searchBoxHasFocus()?f.handoffType==999?f.click(n.getCurrentTime(),1):this.showPreviewAndFocus(r,f,"arrowRight"):i==t.getRtlAdjustedKey(37)&&this._activePreviewPaneViewModel&&this._activePreviewPaneViewModel.hasFocus()&&this._activePreviewPaneViewModel.readyToBlur()&&this._host.setFocusInSearchBox(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._previewPaneId,null,!0)},r.prototype.setPreviewPaneContent=function(i,r,u,f,e){var o=this;this.clear();this._previewedSuggestion=r;this._previewedSuggestion&&(this._previewedSuggestion.hasPreviewPaneOpened=!0,this._previewedSuggestion.isPreviewPaneOpening=!1);this._previewPaneResponseReceivedTimeStamp=null;this._queryForPreviewedSuggestion=i;r.previewPaneType==3&&this._msbPreviewPaneViewModel!=null?(this._miniSerpViewModel&&this._miniSerpViewModel.stopLoadingScreen(),this._activePreviewPaneViewModel=this._msbPreviewPaneViewModel,this._msbPreviewPaneViewModel.update(r,i,u,f,e)):r.previewPaneType!=2&&(t.shouldOpenMiniSerp(r)||r.previewPaneType!=1)?t.config.enableForceLoad?(this._activePreviewPaneViewModel=this._miniSerpViewModel,this._miniSerpViewModel.showForceLoad(r.query,function(){o._miniSerpViewModel.update(r,i,u,f,e)})):(this._localPreviewPaneViewModel&&this._localPreviewPaneViewModel.clear(),this._msbPreviewPaneViewModel&&this._msbPreviewPaneViewModel.clear(),this._page.updatePreviewErrorMessageView(null),(!t.config.disableOfflineRequest||n.isBrowserOnline())&&this._miniSerpViewModel.startLoadingScreen(),this._activePreviewPaneViewModel=this._miniSerpViewModel,this._miniSerpViewModel.update(r,i,u,f,e)):(this._miniSerpViewModel&&this._miniSerpViewModel.stopLoadingScreen(),this._activePreviewPaneViewModel=this._localPreviewPaneViewModel,this._localPreviewPaneViewModel.update(r,i,u,f,e))},r.prototype.bindBeforeItemLaunch=function(n){this._beforeItemLaunchEventHandlers.push(n)},r.prototype.bindAfterItemLaunch=function(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/oauth?",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._triggerSSO=!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.safeChain("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.CopyTestParameters(_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.wamSupported?"assertion":"code",i)},n.isBrowserOnline()&&i.currentState==0&&(t.config.wamSupported&&(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",function(){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_source=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()))},function(){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=[{type:0,label:this._host.getLocString("Weather"),icon:{type:2,content:"&#xE9C0"},query:this._host.getLocString("WeatherQuery")},{type:0,label:this._host.getLocString("News"),icon:{type:2,content:"&#xE900"},query:this._host.getLocString("News")},{type:0,label:this._host.getLocString("ThisDayInHistory"),icon:{type:2,content:"&#xE823"},query:this._host.getLocString("ThisDayInHistory")},{type:0,label:this._host.getLocString("NewMovies"),icon:{type:2,content:"&#xE8B2"},query:this._host.getLocString("NewMovies")}]);r(i,u,undefined)}},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.createInstrumentedItem(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={})),function(n){var t;(function(t){var i="WWE",u=function(){function n(n){this._host=n}return n.prototype.getName=function(){return"WelcomeExperienceDataProvider"},n.prototype.fetch=function(n,t){if(n.enabledDataSources[i]){var r={messages:[{label:this._host.getLocString("WelcomeExperienceTitle"),messageList:[this._host.getLocString("WelcomeExperienceMessage"),this._host.getLocString("WelcomeExperienceMessage2"),this._host.getLocString("WelcomeExperienceMessage3")]}]};t(i,r,undefined)}},n}(),r;t.WelcomeExperienceDataProvider=u;r=function(){function i(){}return i.prototype.parse=function(i,r,u,f,e,o){for(var p,a=[],v="WWE",l=0,y=f.messages;l<y.length;l++){var s=y[l],h=n.WSB.createSuggestion(i,s.label,null,null,v,null,n.InstrumentedItem.createInstrumentedItem(r,v),999,r,t.localDataSourceMayContainPII(u)),c=null;s.messageList&&(c=s.messageList.map(function(n){return'<li class="upsellSubText">'+n+"<\/li>"}));c=c.toString().replace(/,/gi,"");p=n.View.wweLogo();h.tooltip=null;h.narratorText=s.label;h.htmlContent='<div class="upsellCard">\n                    <div class="upsellCardContent">'+p+'<div class="upsellCardText">\n                            <p class="upsellTitle">'+s.label+'<\/p>\n                            <ul class="upsellMessageList">'+c+"<\/ul>\n                        <\/div>\n                    <\/div>\n                <\/div>";h.template=1;a.push(h)}o(u,a,undefined)},i}();t.WelcomeExperienceSuggestionsParser=r})(t=n.WSB||(n.WSB={}))}(AutoSuggest||(AutoSuggest={}));1