(this.webpackChunk_msteams_react_web_client=this.webpackChunk_msteams_react_web_client||[]).push([[271888],{415654:e=>{e.exports=[{types:{SystemSettingId:[5,["AutoStart","OpenAppInBackground","KeepAppRunningOnClose","MinimizeMainWindowOnClose","DefaultImProvider"]],SystemSetting:[2,{id:"SystemSettingId!",enabled:7}]}},{types:{Query:[2,{systemSettings:["SystemSetting",{id:"SystemSettingId!"}]}],Mutation:[2,{toggleSetting:["SystemSetting",{id:"SystemSettingId!",enabled:7}]}]}}]},618780:(e,n,t)=>{"use strict";t.r(n),t.d(n,{resolvers:()=>s,typeDefs:()=>a});var a=t(415654),i=t(783987);const s={Query:{async systemSettings(e,{id:n},{hostCommunicationService:t,loggerFactory:a}){const s=a.newLogger("SystemSettingsQueryResolver","data-resolvers-system-settings"),l=await t.loadModule("osutils"),o=await t.loadModule("settings");switch(s.debug(`Received: ${n}`),n){case"AutoStart":{const e=await(l?.getAutoStartState?.());return e?{id:n,enabled:e.enabled}:(s.warn("AutoStart state HostComms API unavailable"),null)}case"OpenAppInBackground":{const e=await(l?.getOpenAppInBackground?.());return e?{id:n,enabled:e.enabled}:(s.warn("OpenAppInBackground HostComms API unavailable"),null)}case"KeepAppRunningOnClose":{const e=await(l?.getKeepAppRunningOnClose?.());return e?{id:n,enabled:e.enabled}:(s.warn("KeepAppRunningOnClose HostComms API unavailable"),null)}case"MinimizeMainWindowOnClose":if(!o||!o.getMinimizeMainWindowOnClose)return s.warn("settings HostComms API unavailable"),null;return{id:n,enabled:!!await o.getMinimizeMainWindowOnClose()};case"DefaultImProvider":{const e=i.Q.defaultInstance();if(!e)return s.warn("OfficeIntegrationService instance unavailable"),null;const t=await e.isRegisteredIMProvider();return{id:n,enabled:!!t?.isRegistered}}default:return s.warn(`Unrecognized Id: ${n}`),null}}},Mutation:{async toggleSetting(e,{id:n,enabled:t},{hostCommunicationService:a,loggerFactory:s}){const l=s.newLogger("SystemSettingsMutationResolver","data-resolvers-system-settings"),o=await a.loadModule("osutils"),r=await a.loadModule("settings");switch(l.debug(`Received: ${n}`),n){case"AutoStart":{if(!o?.setAutoStartState)return l.warn("setAutoStartState HostComms API unavailable"),null;await(o?.setAutoStartState?.({enabled:t}));const e=await(o?.getAutoStartState?.());return e?{id:n,enabled:e.enabled}:(l.warn("getAutoStartState HostComms API unavailable"),null)}case"OpenAppInBackground":{if(!o?.setOpenAppInBackground)return l.warn("setOpenAppInBackground HostComms API unavailable"),null;await(o?.setOpenAppInBackground?.({enabled:t}));const e=await(o?.getOpenAppInBackground?.());return e?{id:n,enabled:e.enabled}:(l.warn("getOpenAppInBackground HostComms API unavailable"),null)}case"KeepAppRunningOnClose":{if(!o?.setKeepAppRunningOnClose)return l.warn("setKeepAppRunningOnClose HostComms API unavailable"),null;await(o?.setKeepAppRunningOnClose?.({enabled:t}));const e=await(o?.getKeepAppRunningOnClose?.());return e?{id:n,enabled:e.enabled}:(l.warn("getKeepAppRunningOnClose HostComms API unavailable"),null)}case"MinimizeMainWindowOnClose":if(!r||!r.getMinimizeMainWindowOnClose||!r.setMinimizeMainWindowOnClose)return l.warn("settings HostComms API unavailable"),null;await r.setMinimizeMainWindowOnClose(t);return{id:n,enabled:!!await r.getMinimizeMainWindowOnClose()};case"DefaultImProvider":{const e="system-settings",a=i.Q.defaultInstance();if(!a)return l.warn(`OfficeIntegrationService instance unavailable. caller: ${e}`),null;return await a.toggleIMProvider(e)?{id:n,enabled:t}:(l.warn(`OfficeIntegrationService toggle failed. caller: ${e}`),null)}default:return l.warn(`Unrecognized Id: ${n}`),null}}}}}}]);
//# sourceMappingURL=https://local.teams.office.com/sourcemaps/hashed-assets/r_data-resolvers-system-settings-3228479b6b177c76.js.map