import invoker,{API_INVOKER_TYPE}from"./invoker";var RGE_CLIENT_INFO=/TaurusApp\((\S*)\/(\S*)\)/;function getUserAgentInternal(){if(window&&window.navigator){var e=window.navigator.userAgent;if(e){var r=e.match(RGE_CLIENT_INFO);return Promise.resolve({group:"TaurusApp",name:r[1],version:r[2]})}return Promise.reject("调用错误：无法检测到当下环境的 userAgent，请确保在政务钉钉客户端 H5 容器下调用。")}}invoker.registerAPI("getUserAgent",{mobile:!0,mini:!0,pc:!0}),getUserAgent.version={android:"1.6.2",ios:"1.6.2",pc:"1.6.2"};export default function getUserAgent(){var e=invoker.getAppType();return e===API_INVOKER_TYPE.PC||e===API_INVOKER_TYPE.MOBILE?getUserAgentInternal():e===API_INVOKER_TYPE.MINI_APP?invoker.invoke("getUserAgent",{}):void 0}