torage.getItem(n.ZqSuggestionsStorageKey);if(!i)return t;try{t=JSON.parse(i)}catch(r){const u=`[MSB.Error]  QWS docs cache is broken.
                            cacheString=${i},
                            error.message=${r===null||r===void 0?void 0:r.message}`;return t.cacheState=n.MsbQfCacheState.EmptyFromParseError,t.lastUpdatedTime=n.getCurrentTime(),n.LightweightStorage.setItem(n.ZqSuggestionsStorageKey,JSON.stringify(t)),t}return t.cacheState==n.MsbQfCacheState.EmptyFromParseError||t.cacheState==n.MsbQfCacheState.EmptyFromExpired?t:(t&&t.dataSource==this._dataSource&&(n.getCurrentTime()-t.lastUpdatedTime<ht&&!(n.TestHookUrlParameters===null||n.TestHookUrlParameters===void 0?void 0:n.TestHookUrlParameters.msbSHCacheExpired)?l(t.results,this._dataSource)?(t.results=t.results,t.cacheState=n.MsbQfCacheState.ValidResults):t.cacheState=n.MsbQfCacheState.NoResults:(t.cacheState=n.MsbQfCacheState.EmptyFromExpired,t.results=undefined,t.lastUpdatedTime=n.getCurrentTime(),n.LightweightStorage.setItem(n.ZqSuggestionsStorageKey,JSON.stringify(t)))),t)}buildParams(t,i,r){var s,u={};if(this._providerType==0&&(u[n.Service.QueryParams.ConversationId]=t[n.Service.QueryParams.ConversationId],u[p]=b,this._authType!=1||r||i!=n.Scope.People?i!=n.Scope.All&&(u[f]=k):u[f]=d,r&&this._authType==1&&t[n.Service.QueryParams.ImpressionGuid]&&(u[n.Service.QueryParams.LogicalId]=t[n.Service.QueryParams.ImpressionGuid]),u[o]=this.getEntityTypes(i,r),i==n.Scope.Documents&&r&&n.config.msbEnableDocumentZQ&&(u[e]=ot)),n.TestHookUrlParameters){let t=(s=n.TestHookUrlParameters["3sflights"])!==null&&s!==void 0?s:"";t&&(u[e]=t);n.TestHookUrlParameters["3sdebug"]&&(u[w]="1")}return u}getEntityTypes(t,i){let r;switch(t){case n.Scope.Documents:r="Documents";break;case n.Scope.People:r="People";break;case n.Scope.All:case n.Scope.Work:let u=[];if(this._authType==1&&u.push("Documents"),!i&&n.RuntimeConfig.QfMode!=5){let t=n.msbHost===null||n.msbHost===void 0?void 0:n.msbHost.isTenantMsbEnabled();t||u.push("People")}r=u.join(",");break;default:throw new Error("Unsupported scope "+t);}return r}instrumentClick(t,i){if(t&&i){let u=[{Key:t,Value:[{Name:"entityclicked",Attributes:[{Key:"Id",Value:i},{Key:"LocalTime",Value:n.getDateWithTimezone()}]}]}],r={};r[s]=h;this.fetchUrl(this.getSubstrateEventsUrl(),r,JSON.stringify(u),()=>{},null,()=>!0)}}}n.SubstrateDataProvider=a})(WSB||(WSB={})),function(n){function b(t,i,r){let u=n.OfficeTypeExtensionConfigs[t];u?n.LocalDataProvider.getApps(u.appIds,t=>{let f=!n.Map.isEmpty(t);f?i(u.uri):r()}):r()}function h(t,i,r){let u=t?new URL(t):null;!u||u.pathname&&u.pathname.indexOf(":")!=-1?n.Host.launchUrlWithHttpProtocolAsync(i,{medium:"MSBLink"}):b(r,i=>n.Host.launchUriAsync(i+t),()=>n.Host.launchUrlWithHttpProtocolAsync(i,{medium:"MSBLink"}))}function k(t,i,r){n.setExtraVerbs(t,()=>{let u=[];return u.push({verb:n.JumplistActionItemType[n.JumplistActionItemType.S_OpenInBrowser],displayName:n.Host.getLocString("OpenInBrowser"),executeSync:()=>n.Host.launchUriAsync(i),icon:{type:1,content:"&#xE774"}}),t.locationUrl&&u.pus