diff --git a/JSD-8380-需求确认书V1.docx b/JSD-8380-需求确认书V1.docx new file mode 100644 index 0000000..3a0e24e Binary files /dev/null and b/JSD-8380-需求确认书V1.docx differ diff --git a/README.md b/README.md index 74f25fc..fc14871 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ -# open-JSD-8380 +# open-JSD-8380 单点登录 -JSD-8380 \ No newline at end of file +JSD-8380 任务开源材料\ +免责说明:该源码为第三方爱好者提供,不保证源码和方案的可靠性,也不提供任何形式的源码教学指导和协助!\ +仅作为开发者学习参考使用!禁止用于任何商业用途!\ +为保护开发者隐私,开发者信息已隐去!若原开发者希望公开自己的信息,可联系hugh处理。 \ No newline at end of file diff --git a/crc.properties b/crc.properties new file mode 100644 index 0000000..74f62f8 --- /dev/null +++ b/crc.properties @@ -0,0 +1,5 @@ +env=uat +devUser=1 +isLocal=true +appId=xxxxxxxxxxxxxxxx +appSecret=xxxxxxxxxxxxxxxxxxx \ No newline at end of file diff --git a/plugin.xml b/plugin.xml new file mode 100644 index 0000000..90bc8e4 --- /dev/null +++ b/plugin.xml @@ -0,0 +1,18 @@ + + + com.fr.plugin.crc.sso + + yes + 1.17 + 10.0 + 2018-07-31 + fr.open + + + + + + + + + \ No newline at end of file diff --git a/readme.txt b/readme.txt new file mode 100644 index 0000000..e78a7af --- /dev/null +++ b/readme.txt @@ -0,0 +1,6 @@ +此次完成功能如下 + a、单点登录 + +1、将压缩文件解压后的crc.properties配置文件拷贝至 %部署路径%/WEB-INF/resources, 并修改相应的属性配置 +2、安装本插件,插件安装见连接http://help.finereport.com/doc-view-2198.html +3、进入系统测试单点登录,访问地址为http://ip:port/webroot/decision/crc/sso \ No newline at end of file diff --git a/src/main/java/com/fr/plugin/crc/sso/CommonUtils.java b/src/main/java/com/fr/plugin/crc/sso/CommonUtils.java new file mode 100644 index 0000000..ddbf3fe --- /dev/null +++ b/src/main/java/com/fr/plugin/crc/sso/CommonUtils.java @@ -0,0 +1,132 @@ +package com.fr.plugin.crc.sso; + +import com.fr.data.NetworkHelper; +import com.fr.decision.authority.data.User; +import com.fr.decision.mobile.terminal.TerminalHandler; +import com.fr.decision.webservice.utils.DecisionServiceConstants; +import com.fr.decision.webservice.utils.DecisionStatusService; +import com.fr.decision.webservice.v10.login.LoginService; +import com.fr.decision.webservice.v10.login.TokenResource; +import com.fr.decision.webservice.v10.user.UserService; +import com.fr.log.FineLoggerFactory; +import com.fr.stable.StringUtils; +import com.fr.stable.web.Device; +import com.fr.web.utils.WebUtils; + +import javax.servlet.FilterChain; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Map; +import java.util.Properties; + +/** + * @author fr.open + * @since 2021/7/29 + */ +public class CommonUtils { + + public static String getProperty(Properties props, String key, String defaultValue, boolean allowBlank) { + String value = props.getProperty(key); + if (StringUtils.isNotBlank(value)) { + return value; + } else { + if (allowBlank) { + FineLoggerFactory.getLogger().warn("Property[" + key + "] value is blank."); + return defaultValue; + } else { + throw new IllegalArgumentException("Property[" + key + "] cann't be blank."); + } + } + } + + public static String getProperty(Properties props, String key, boolean allowBlank) { + return getProperty(props, key, null, allowBlank); + } + + public static String getProperty(Properties props, String key) { + return getProperty(props, key, null, true); + } + + public static boolean isLogin(HttpServletRequest request) { + String oldToken = TokenResource.COOKIE.getToken(request); + return oldToken != null && checkTokenValid(request, (String) oldToken); + } + + private static boolean checkTokenValid(HttpServletRequest req, String token) { + try { + Device device = NetworkHelper.getDevice(req); + LoginService.getInstance().loginStatusValid(token, TerminalHandler.getTerminal(req, device)); + return true; + } catch (Exception ignore) { + } + return false; + } + + /** + * 跳转到过滤器链中的下一个过滤器 + * + * @param request + * @param response + * @param chain + */ + public static void next(HttpServletRequest request, HttpServletResponse response, FilterChain chain) { + try { + chain.doFilter(request, response); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + public static void login(String username, HttpServletRequest request, HttpServletResponse response) { + try { + User user = UserService.getInstance().getUserByUserName(username); + if (user == null) { + throw new RuntimeException("系统未授权, 当前用户是\"" + username + "\""); + } + String token = LoginService.getInstance().login(request, response, username); + request.setAttribute(DecisionServiceConstants.FINE_AUTH_TOKEN_NAME, token); + } catch (Exception e) { + FineLoggerFactory.getLogger().error("sso >> Failed to login with[" + username + "]", e); + throw new RuntimeException("用户\"" + username +"\"登录失败"); + } + } + + public static boolean isMobileDevice(HttpServletRequest request) { + if (WebUtils.getDevice(request).isMobile()) { + FineLoggerFactory.getLogger().info("current request is is mobile request ,url is {}", request.getRequestURI()); + return true; + } + String requestHeader = request.getHeader("user-agent"); + String[] deviceArray = new String[]{"android", "iphone", "ipad", "ios", "windows phone", "wechat"}; + if (requestHeader == null) { + return false; + } + requestHeader = requestHeader.toLowerCase(); + for (int i = 0; i < deviceArray.length; i++) { + if (requestHeader.toLowerCase().contains(deviceArray[i])) { + FineLoggerFactory.getLogger().info("current request:{} is mobile request!", request.getRequestURI()); + return true; + } + } + String op = WebUtils.getHTTPRequestParameter(request, "op"); + return StringUtils.isNotBlank(op) && StringUtils.equals("h5",op); + } + + public static void cacheParams(String key, Map values) { + try { + DecisionStatusService.originUrlStatusService().put(key, values); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + public static String getCachedParam(String key, String name) { + try { + Map values = DecisionStatusService.originUrlStatusService().get(key); + return values.get(name); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + +} diff --git a/src/main/java/com/fr/plugin/crc/sso/PluginConstants.java b/src/main/java/com/fr/plugin/crc/sso/PluginConstants.java new file mode 100644 index 0000000..9fa56e9 --- /dev/null +++ b/src/main/java/com/fr/plugin/crc/sso/PluginConstants.java @@ -0,0 +1,11 @@ +package com.fr.plugin.crc.sso; + +/** + * @Author fr.open + * @Date 2021/9/24 + * @Description + **/ +public class PluginConstants { + + public static final String PLUGIN_ID = "com.fr.plugin.crc.sso"; +} diff --git a/src/main/java/com/fr/plugin/crc/sso/RIGFilter.java b/src/main/java/com/fr/plugin/crc/sso/RIGFilter.java new file mode 100644 index 0000000..c1277db --- /dev/null +++ b/src/main/java/com/fr/plugin/crc/sso/RIGFilter.java @@ -0,0 +1,173 @@ +package com.fr.plugin.crc.sso; + +import com.fr.decision.fun.impl.AbstractGlobalRequestFilterProvider; +import com.fr.decision.webservice.utils.WebServiceUtils; +import com.fr.general.PropertiesUtils; +import com.fr.general.http.HttpToolbox; +import com.fr.intelli.record.Focus; +import com.fr.intelli.record.Original; +import com.fr.json.JSONObject; +import com.fr.locale.InterProviderFactory; +import com.fr.log.FineLoggerFactory; +import com.fr.plugin.context.PluginContexts; +import com.fr.plugin.transform.FunctionRecorder; +import com.fr.stable.StringUtils; +import com.fr.stable.fun.Authorize; +import com.fr.third.org.apache.commons.codec.binary.Base64; +import com.fr.web.utils.WebUtils; + +import javax.servlet.FilterChain; +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import java.io.IOException; +import java.io.PrintWriter; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; +import java.util.stream.Stream; + +import static com.fr.plugin.crc.sso.CommonUtils.*; + +/** + * @author fr.open + * @since 2021/9/2 + */ +@FunctionRecorder +@Authorize(callSignKey = PluginConstants.PLUGIN_ID) +public class RIGFilter extends AbstractGlobalRequestFilterProvider { + + private final static String[] NOT_FILTER = { + "/decision/file", + "/decision/resources", + "/system", + "/materials.min.js.map", + "/remote", + "/login", + "/url/mobile", + "/crc/sso", + "/login/config" + }; + + private String apiLogin; + + private String apiGetToken; + + private String clientId; + + private String clientSecret; + + private String redirectURI; + + private void initParams() { + Properties props = PropertiesUtils.getProperties("crc"); + apiLogin = getProperty(props, "rig.api.login", false); + apiGetToken = getProperty(props, "rig.api.get-token", false); + clientId = getProperty(props, "rig.api.client_id", false); + clientSecret = getProperty(props, "rig.api.client_secret", false); + redirectURI = getProperty(props, "rig.api.redirect_uri", false); + } + + @Override + public void doFilter(HttpServletRequest request, HttpServletResponse response, FilterChain chain) { + if (isAccept(request)) { + next(request, response, chain); + return; + } + try { + initParams(); + String ticket = request.getParameter("ticket"); + if (StringUtils.isBlank(ticket)) { + jumpAuthorize(request, response); + return; + } + String[] splitted = ticket.split("\\."); + String code = splitted[splitted.length - 1]; + login(getUsername(getToken(code, response)), request, response); + next(request, response, chain); + } catch (Exception e) { + FineLoggerFactory.getLogger().error("RIG sso >>> 处理单点登陆时发生错误", e); + setError(response, e.getMessage()); + } + } + + private String getUsername(String token) { + try { + FineLoggerFactory.getLogger().info("RIG sso >>> 获取到的token值为 ==> \"{}\"", token); + String res = new String(Base64.decodeBase64(token.split("\\.")[1])); + FineLoggerFactory.getLogger().info("RIG sso >>> Base64 decode 后的token值为 ==> \"{}\"", res); + JSONObject body = new JSONObject(res); + if (body.has("user_name")) { + return body.getString("user_name"); + } + throw new RuntimeException("解析token获取用户名失败"); + } catch (Exception e) { + throw new RuntimeException("获取token失败, " + e.getMessage()); + } + } + + private String getToken(String code, HttpServletResponse response) throws IOException { + String api = String.format("%s?grant_type=authorization_code&client_id=%s&client_secret=%s&code=%s", apiGetToken, clientId, clientSecret, code); + FineLoggerFactory.getLogger().info("RIG sso >>> 获取 token 请求地址 ==> \"{}\"", api); + String res = HttpToolbox.post(api, Collections.emptyMap()); + JSONObject body = new JSONObject(res); + if (body.has("refresh_token")) { + Cookie c = new Cookie("RIG_REFRESH_TOKEN", body.getString("refresh_token")); + c.setPath("/"); + response.addCookie(c); + } + if (body.has("access_token")) { + Cookie c = new Cookie("RIG_ACCESS_TOKEN", body.getString("access_token")); + c.setPath("/"); + response.addCookie(c); + return body.getString("access_token"); + } + throw new RuntimeException("获取 token 接口请求失败, " + res); + } + + private void jumpAuthorize(HttpServletRequest request, HttpServletResponse response) throws IOException { + String login = String.format("%s?service=%s", apiLogin, redirectURI); + FineLoggerFactory.getLogger().info("RIG sso >>> 跳转到登陆页面 ==> \"{}\"", login); + response.sendRedirect(login); + } + + @Override + public String filterName() { + return "rigFilter"; + } + + @Override + @Focus(id = PluginConstants.PLUGIN_ID, text = "单点登录", source = Original.PLUGIN) + public String[] urlPatterns() { + if(!PluginContexts.currentContext().isAvailable()){ + return new String[0]; + } + return new String[]{"/*"}; + } + + public boolean isAccept(HttpServletRequest request) { + String url = request.getRequestURL().toString(); + if (Stream.of(NOT_FILTER).anyMatch(url::contains)) { + return true; + } + return isLogin(request); + } + + private void setError(HttpServletResponse res, String reason) { + try { + PrintWriter printWriter = WebUtils.createPrintWriter(res); + Map map = new HashMap<>(); + map.put("result", InterProviderFactory.getProvider().getLocText("Fine-Engine_Error_Page_Result")); + map.put("reason", reason); + map.put("solution", InterProviderFactory.getProvider().getLocText("Fine-Engine_Please_Contact_Platform_Admin")); + String page = WebServiceUtils.parseWebPageResourceSafe("com/fr/web/controller/decision/entrance/resources/unavailable.html", map); + printWriter.write(page); + printWriter.flush(); + printWriter.close(); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } +} diff --git a/src/main/java/com/fr/plugin/crc/sso/SsoFilter.java b/src/main/java/com/fr/plugin/crc/sso/SsoFilter.java new file mode 100644 index 0000000..3560f91 --- /dev/null +++ b/src/main/java/com/fr/plugin/crc/sso/SsoFilter.java @@ -0,0 +1,143 @@ +package com.fr.plugin.crc.sso; + +import com.fr.base.TemplateUtils; +import com.fr.decision.fun.impl.AbstractGlobalRequestFilterProvider; +import com.fr.decision.webservice.utils.WebServiceUtils; +import com.fr.general.PropertiesUtils; +import com.fr.intelli.record.Focus; +import com.fr.intelli.record.Original; +import com.fr.locale.InterProviderFactory; +import com.fr.log.FineLoggerFactory; +import com.fr.plugin.context.PluginContexts; +import com.fr.plugin.transform.FunctionRecorder; +import com.fr.stable.StringUtils; +import com.fr.stable.fun.Authorize; +import com.fr.web.utils.WebUtils; + +import javax.servlet.FilterChain; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.PrintWriter; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; +import java.util.stream.Stream; + +import static com.fr.plugin.crc.sso.CommonUtils.*; + +/** + * @author fr.open + * @since 2021/7/29 + */ +@FunctionRecorder +@Authorize(callSignKey = PluginConstants.PLUGIN_ID) +public class SsoFilter extends AbstractGlobalRequestFilterProvider { + + private static String[] NOT_FILTER = { + "/decision/file", + "/decision/resources", + "/system", + "/materials.min.js.map", + "/remote", + "/login", + "/url/mobile", + "/login/config" + }; + + private final String env; + + private final String devUser; + + private final boolean isLocal; + + private final String appId; + + private final String appSecret; + + public SsoFilter() { + Properties props = PropertiesUtils.getProperties("crc"); + this.env = getProperty(props, "env", true); + this.devUser = getProperty(props, "devUser", true); + this.isLocal = Boolean.parseBoolean(getProperty(props, "isLocal", true)); + this.appId = getProperty(props, "appId", true); + this.appSecret = getProperty(props, "appSecret", true); + } + + + @Override + public void doFilter(HttpServletRequest request, HttpServletResponse response, FilterChain chain) { + if (request.getRequestURI().endsWith("/crc/sso")) { + FineLoggerFactory.getLogger().info("sso >> 进入Filter, 当前URL为: \"{}\"", request.getRequestURI() + "?" + request.getQueryString()); + try { + String root = TemplateUtils.render("${fineServletURL}"); + if (isAccept(request)) { + FineLoggerFactory.getLogger().info("sso >> 已登录, 跳转到 ==> {}", root + "/url/mobile"); + response.sendRedirect(root + "/url/mobile"); + return; + } + + String username = request.getParameter("username"); + if (StringUtils.isBlank(username)) { + FineLoggerFactory.getLogger().info("sso >> 未获取到用户名, 跳转到 ==> crc-sso.html"); + PrintWriter writer = WebUtils.createPrintWriter(response); + Map attributes = new HashMap<>(); + attributes.put("root", root); + attributes.put("env", env); + attributes.put("devUser", devUser); + attributes.put("appId", appId); + attributes.put("appSecret", appSecret); + attributes.put("isLocal", isLocal); + String page = WebServiceUtils.parseWebPageResource("com/fr/plugin/crc-sso.html", attributes); + writer.write(page); + writer.flush(); + writer.close(); + } else { + FineLoggerFactory.getLogger().info("sso >> 获取到有用户名, 用户名为: \"{}\" 执行登录并跳转到 ==> {}", username, root + "/url/mobile"); + login(username, request, response); + response.sendRedirect(root + "/url/mobile"); + } + } catch (Exception e) { + FineLoggerFactory.getLogger().error("单点登录处理失败.", e); + setError(response, e.getMessage()); + } + } else { + next(request, response, chain); + } + + } + + @Override + public String filterName() { + return "sso"; + } + + @Override + @Focus(id = PluginConstants.PLUGIN_ID, text = "单点登录", source = Original.PLUGIN) + public String[] urlPatterns() { + if(!PluginContexts.currentContext().isAvailable()){ + return new String[0]; + } + return new String[]{"/decision/crc/sso"}; + } + + private boolean isAccept(HttpServletRequest request) { + return isLogin(request); + } + + private void setError(HttpServletResponse res, String reason) { + try { + PrintWriter printWriter = WebUtils.createPrintWriter(res); + Map map = new HashMap<>(); + map.put("result", InterProviderFactory.getProvider().getLocText("Fine-Engine_Error_Page_Result")); + map.put("reason", reason); + map.put("solution", InterProviderFactory.getProvider().getLocText("Fine-Engine_Please_Contact_Platform_Admin")); + String page = WebServiceUtils.parseWebPageResourceSafe("com/fr/web/controller/decision/entrance/resources/unavailable.html", map); + printWriter.write(page); + printWriter.flush(); + printWriter.close(); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + +} diff --git a/src/main/resources/com/fr/plugin/crc-sso.html b/src/main/resources/com/fr/plugin/crc-sso.html new file mode 100644 index 0000000..2849507 --- /dev/null +++ b/src/main/resources/com/fr/plugin/crc-sso.html @@ -0,0 +1,34 @@ + + + + + 单点登录 + + + + + + \ No newline at end of file diff --git a/src/main/resources/com/fr/plugin/index.js b/src/main/resources/com/fr/plugin/index.js new file mode 100644 index 0000000..7c8f312 --- /dev/null +++ b/src/main/resources/com/fr/plugin/index.js @@ -0,0 +1,24 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).runworkHelp={})}(this,(function(exports){"use strict";var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var check=function(e){return e&&e.Math==Math&&e},global_1=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof commonjsGlobal&&commonjsGlobal)||Function("return this")(),fails=function(e){try{return!!e()}catch(e){return!0}},descriptors=!fails((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),nativePropertyIsEnumerable={}.propertyIsEnumerable,getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor,NASHORN_BUG=getOwnPropertyDescriptor&&!nativePropertyIsEnumerable.call({1:2},1),f=NASHORN_BUG?function(e){var t=getOwnPropertyDescriptor(this,e);return!!t&&t.enumerable}:nativePropertyIsEnumerable,objectPropertyIsEnumerable={f:f},createPropertyDescriptor=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},toString={}.toString,classofRaw=function(e){return toString.call(e).slice(8,-1)},split="".split,indexedObject=fails((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==classofRaw(e)?split.call(e,""):Object(e)}:Object,requireObjectCoercible=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},toIndexedObject=function(e){return indexedObject(requireObjectCoercible(e))},isObject=function(e){return"object"==typeof e?null!==e:"function"==typeof e},toPrimitive=function(e,t){if(!isObject(e))return e;var r,n;if(t&&"function"==typeof(r=e.toString)&&!isObject(n=r.call(e)))return n;if("function"==typeof(r=e.valueOf)&&!isObject(n=r.call(e)))return n;if(!t&&"function"==typeof(r=e.toString)&&!isObject(n=r.call(e)))return n;throw TypeError("Can't convert object to primitive value")},hasOwnProperty={}.hasOwnProperty,has=function(e,t){return hasOwnProperty.call(e,t)},document$1=global_1.document,EXISTS=isObject(document$1)&&isObject(document$1.createElement),documentCreateElement=function(e){return EXISTS?document$1.createElement(e):{}},ie8DomDefine=!descriptors&&!fails((function(){return 7!=Object.defineProperty(documentCreateElement("div"),"a",{get:function(){return 7}}).a})),nativeGetOwnPropertyDescriptor=Object.getOwnPropertyDescriptor,f$1=descriptors?nativeGetOwnPropertyDescriptor:function(e,t){if(e=toIndexedObject(e),t=toPrimitive(t,!0),ie8DomDefine)try{return nativeGetOwnPropertyDescriptor(e,t)}catch(e){}if(has(e,t))return createPropertyDescriptor(!objectPropertyIsEnumerable.f.call(e,t),e[t])},objectGetOwnPropertyDescriptor={f:f$1},anObject=function(e){if(!isObject(e))throw TypeError(String(e)+" is not an object");return e},nativeDefineProperty=Object.defineProperty,f$2=descriptors?nativeDefineProperty:function(e,t,r){if(anObject(e),t=toPrimitive(t,!0),anObject(r),ie8DomDefine)try{return nativeDefineProperty(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(e[t]=r.value),e},objectDefineProperty={f:f$2},createNonEnumerableProperty=descriptors?function(e,t,r){return objectDefineProperty.f(e,t,createPropertyDescriptor(1,r))}:function(e,t,r){return e[t]=r,e},setGlobal=function(e,t){try{createNonEnumerableProperty(global_1,e,t)}catch(r){global_1[e]=t}return t},SHARED="__core-js_shared__",store=global_1[SHARED]||setGlobal(SHARED,{}),sharedStore=store,functionToString=Function.toString;"function"!=typeof sharedStore.inspectSource&&(sharedStore.inspectSource=function(e){return functionToString.call(e)});var inspectSource=sharedStore.inspectSource,WeakMap=global_1.WeakMap,nativeWeakMap="function"==typeof WeakMap&&/native code/.test(inspectSource(WeakMap)),shared=createCommonjsModule((function(e){(e.exports=function(e,t){return sharedStore[e]||(sharedStore[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.5",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),id=0,postfix=Math.random(),uid=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++id+postfix).toString(36)},keys=shared("keys"),sharedKey=function(e){return keys[e]||(keys[e]=uid(e))},hiddenKeys={},WeakMap$1=global_1.WeakMap,set,get,has$1,enforce=function(e){return has$1(e)?get(e):set(e,{})},getterFor=function(e){return function(t){var r;if(!isObject(t)||(r=get(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return r}};if(nativeWeakMap){var store$1=new WeakMap$1,wmget=store$1.get,wmhas=store$1.has,wmset=store$1.set;set=function(e,t){return wmset.call(store$1,e,t),t},get=function(e){return wmget.call(store$1,e)||{}},has$1=function(e){return wmhas.call(store$1,e)}}else{var STATE=sharedKey("state");hiddenKeys[STATE]=!0,set=function(e,t){return createNonEnumerableProperty(e,STATE,t),t},get=function(e){return has(e,STATE)?e[STATE]:{}},has$1=function(e){return has(e,STATE)}}var internalState={set:set,get:get,has:has$1,enforce:enforce,getterFor:getterFor},redefine=createCommonjsModule((function(e){var t=internalState.get,r=internalState.enforce,n=String(String).split("String");(e.exports=function(e,t,o,i){var a=!!i&&!!i.unsafe,s=!!i&&!!i.enumerable,c=!!i&&!!i.noTargetGet;"function"==typeof o&&("string"!=typeof t||has(o,"name")||createNonEnumerableProperty(o,"name",t),r(o).source=n.join("string"==typeof t?t:"")),e!==global_1?(a?!c&&e[t]&&(s=!0):delete e[t],s?e[t]=o:createNonEnumerableProperty(e,t,o)):s?e[t]=o:setGlobal(t,o)})(Function.prototype,"toString",(function(){return"function"==typeof this&&t(this).source||inspectSource(this)}))})),path=global_1,aFunction=function(e){return"function"==typeof e?e:void 0},getBuiltIn=function(e,t){return arguments.length<2?aFunction(path[e])||aFunction(global_1[e]):path[e]&&path[e][t]||global_1[e]&&global_1[e][t]},ceil=Math.ceil,floor=Math.floor,toInteger=function(e){return isNaN(e=+e)?0:(e>0?floor:ceil)(e)},min=Math.min,toLength=function(e){return e>0?min(toInteger(e),9007199254740991):0},max=Math.max,min$1=Math.min,toAbsoluteIndex=function(e,t){var r=toInteger(e);return r<0?max(r+t,0):min$1(r,t)},createMethod=function(e){return function(t,r,n){var o,i=toIndexedObject(t),a=toLength(i.length),s=toAbsoluteIndex(n,a);if(e&&r!=r){for(;a>s;)if((o=i[s++])!=o)return!0}else for(;a>s;s++)if((e||s in i)&&i[s]===r)return e||s||0;return!e&&-1}},arrayIncludes={includes:createMethod(!0),indexOf:createMethod(!1)},indexOf=arrayIncludes.indexOf,objectKeysInternal=function(e,t){var r,n=toIndexedObject(e),o=0,i=[];for(r in n)!has(hiddenKeys,r)&&has(n,r)&&i.push(r);for(;t.length>o;)has(n,r=t[o++])&&(~indexOf(i,r)||i.push(r));return i},enumBugKeys=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],hiddenKeys$1=enumBugKeys.concat("length","prototype"),f$3=Object.getOwnPropertyNames||function(e){return objectKeysInternal(e,hiddenKeys$1)},objectGetOwnPropertyNames={f:f$3},f$4=Object.getOwnPropertySymbols,objectGetOwnPropertySymbols={f:f$4},ownKeys=getBuiltIn("Reflect","ownKeys")||function(e){var t=objectGetOwnPropertyNames.f(anObject(e)),r=objectGetOwnPropertySymbols.f;return r?t.concat(r(e)):t},copyConstructorProperties=function(e,t){for(var r=ownKeys(t),n=objectDefineProperty.f,o=objectGetOwnPropertyDescriptor.f,i=0;i=74)&&(match=engineUserAgent.match(/Chrome\/(\d+)/),match&&(version=match[1])));var engineV8Version=version&&+version,SPECIES$1=wellKnownSymbol("species"),arrayMethodHasSpeciesSupport=function(e){return engineV8Version>=51||!fails((function(){var t=[];return(t.constructor={})[SPECIES$1]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},IS_CONCAT_SPREADABLE=wellKnownSymbol("isConcatSpreadable"),MAX_SAFE_INTEGER=9007199254740991,MAXIMUM_ALLOWED_INDEX_EXCEEDED="Maximum allowed index exceeded",IS_CONCAT_SPREADABLE_SUPPORT=engineV8Version>=51||!fails((function(){var e=[];return e[IS_CONCAT_SPREADABLE]=!1,e.concat()[0]!==e})),SPECIES_SUPPORT=arrayMethodHasSpeciesSupport("concat"),isConcatSpreadable=function(e){if(!isObject(e))return!1;var t=e[IS_CONCAT_SPREADABLE];return void 0!==t?!!t:isArray(e)},FORCED=!IS_CONCAT_SPREADABLE_SUPPORT||!SPECIES_SUPPORT;_export({target:"Array",proto:!0,forced:FORCED},{concat:function(e){var t,r,n,o,i,a=toObject(this),s=arraySpeciesCreate(a,0),c=0;for(t=-1,n=arguments.length;tMAX_SAFE_INTEGER)throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);for(r=0;r=MAX_SAFE_INTEGER)throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);createProperty(s,c++,i)}return s.length=c,s}});var objectKeys=Object.keys||function(e){return objectKeysInternal(e,enumBugKeys)},objectDefineProperties=descriptors?Object.defineProperties:function(e,t){anObject(e);for(var r,n=objectKeys(t),o=n.length,i=0;o>i;)objectDefineProperty.f(e,r=n[i++],t[r]);return e},html=getBuiltIn("document","documentElement"),GT=">",LT="<",PROTOTYPE="prototype",SCRIPT="script",IE_PROTO=sharedKey("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(e){return LT+SCRIPT+GT+e+LT+"/"+SCRIPT+GT},NullProtoObjectViaActiveX=function(e){e.write(scriptTag("")),e.close();var t=e.parentWindow.Object;return e=null,t},NullProtoObjectViaIFrame=function(){var e,t=documentCreateElement("iframe"),r="java"+SCRIPT+":";return t.style.display="none",html.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(scriptTag("document.F=Object")),e.close(),e.F},activeXDocument,NullProtoObject=function(){try{activeXDocument=document.domain&&new ActiveXObject("htmlfile")}catch(e){}NullProtoObject=activeXDocument?NullProtoObjectViaActiveX(activeXDocument):NullProtoObjectViaIFrame();for(var e=enumBugKeys.length;e--;)delete NullProtoObject[PROTOTYPE][enumBugKeys[e]];return NullProtoObject()};hiddenKeys[IE_PROTO]=!0;var objectCreate=Object.create||function(e,t){var r;return null!==e?(EmptyConstructor[PROTOTYPE]=anObject(e),r=new EmptyConstructor,EmptyConstructor[PROTOTYPE]=null,r[IE_PROTO]=e):r=NullProtoObject(),void 0===t?r:objectDefineProperties(r,t)},UNSCOPABLES=wellKnownSymbol("unscopables"),ArrayPrototype=Array.prototype;null==ArrayPrototype[UNSCOPABLES]&&objectDefineProperty.f(ArrayPrototype,UNSCOPABLES,{configurable:!0,value:objectCreate(null)});var addToUnscopables=function(e){ArrayPrototype[UNSCOPABLES][e]=!0},defineProperty=Object.defineProperty,cache={},thrower=function(e){throw e},arrayMethodUsesToLength=function(e,t){if(has(cache,e))return cache[e];t||(t={});var r=[][e],n=!!has(t,"ACCESSORS")&&t.ACCESSORS,o=has(t,0)?t[0]:thrower,i=has(t,1)?t[1]:void 0;return cache[e]=!!r&&!fails((function(){if(n&&!descriptors)return!0;var e={length:-1};n?defineProperty(e,1,{enumerable:!0,get:thrower}):e[1]=1,r.call(e,o,i)}))},$includes=arrayIncludes.includes,USES_TO_LENGTH=arrayMethodUsesToLength("indexOf",{ACCESSORS:!0,1:0});_export({target:"Array",proto:!0,forced:!USES_TO_LENGTH},{includes:function(e){return $includes(this,e,arguments.length>1?arguments[1]:void 0)}}),addToUnscopables("includes");var arrayMethodIsStrict=function(e,t){var r=[][e];return!!r&&fails((function(){r.call(null,t||function(){throw 1},1)}))},$indexOf=arrayIncludes.indexOf,nativeIndexOf=[].indexOf,NEGATIVE_ZERO=!!nativeIndexOf&&1/[1].indexOf(1,-0)<0,STRICT_METHOD=arrayMethodIsStrict("indexOf"),USES_TO_LENGTH$1=arrayMethodUsesToLength("indexOf",{ACCESSORS:!0,1:0});_export({target:"Array",proto:!0,forced:NEGATIVE_ZERO||!STRICT_METHOD||!USES_TO_LENGTH$1},{indexOf:function(e){return NEGATIVE_ZERO?nativeIndexOf.apply(this,arguments)||0:$indexOf(this,e,arguments.length>1?arguments[1]:void 0)}});var nativeJoin=[].join,ES3_STRINGS=indexedObject!=Object,STRICT_METHOD$1=arrayMethodIsStrict("join",",");_export({target:"Array",proto:!0,forced:ES3_STRINGS||!STRICT_METHOD$1},{join:function(e){return nativeJoin.call(toIndexedObject(this),void 0===e?",":e)}});var DatePrototype=Date.prototype,INVALID_DATE="Invalid Date",TO_STRING="toString",nativeDateToString=DatePrototype[TO_STRING],getTime=DatePrototype.getTime;new Date(NaN)+""!=INVALID_DATE&&redefine(DatePrototype,TO_STRING,(function(){var e=getTime.call(this);return e==e?nativeDateToString.call(this):INVALID_DATE}));var nativeAssign=Object.assign,defineProperty$1=Object.defineProperty,objectAssign=!nativeAssign||fails((function(){if(descriptors&&1!==nativeAssign({b:1},nativeAssign(defineProperty$1({},"a",{enumerable:!0,get:function(){defineProperty$1(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol();return e[r]=7,"abcdefghijklmnopqrst".split("").forEach((function(e){t[e]=e})),7!=nativeAssign({},e)[r]||"abcdefghijklmnopqrst"!=objectKeys(nativeAssign({},t)).join("")}))?function(e,t){for(var r=toObject(e),n=arguments.length,o=1,i=objectGetOwnPropertySymbols.f,a=objectPropertyIsEnumerable.f;n>o;)for(var s,c=indexedObject(arguments[o++]),u=i?objectKeys(c).concat(i(c)):objectKeys(c),l=u.length,p=0;l>p;)s=u[p++],descriptors&&!a.call(c,s)||(r[s]=c[s]);return r}:nativeAssign;_export({target:"Object",stat:!0,forced:Object.assign!==objectAssign},{assign:objectAssign});var TO_STRING_TAG=wellKnownSymbol("toStringTag"),test={};test[TO_STRING_TAG]="z";var toStringTagSupport="[object z]"===String(test),TO_STRING_TAG$1=wellKnownSymbol("toStringTag"),CORRECT_ARGUMENTS="Arguments"==classofRaw(function(){return arguments}()),tryGet=function(e,t){try{return e[t]}catch(e){}},classof=toStringTagSupport?classofRaw:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=tryGet(t=Object(e),TO_STRING_TAG$1))?r:CORRECT_ARGUMENTS?classofRaw(t):"Object"==(n=classofRaw(t))&&"function"==typeof t.callee?"Arguments":n},objectToString=toStringTagSupport?{}.toString:function(){return"[object "+classof(this)+"]"};toStringTagSupport||redefine(Object.prototype,"toString",objectToString,{unsafe:!0});var nativePromiseConstructor=global_1.Promise,redefineAll=function(e,t,r){for(var n in t)redefine(e,n,t[n],r);return e},defineProperty$2=objectDefineProperty.f,TO_STRING_TAG$2=wellKnownSymbol("toStringTag"),setToStringTag=function(e,t,r){e&&!has(e=r?e:e.prototype,TO_STRING_TAG$2)&&defineProperty$2(e,TO_STRING_TAG$2,{configurable:!0,value:t})},SPECIES$2=wellKnownSymbol("species"),setSpecies=function(e){var t=getBuiltIn(e),r=objectDefineProperty.f;descriptors&&t&&!t[SPECIES$2]&&r(t,SPECIES$2,{configurable:!0,get:function(){return this}})},aFunction$1=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},anInstance=function(e,t,r){if(!(e instanceof t))throw TypeError("Incorrect "+(r?r+" ":"")+"invocation");return e},iterators={},ITERATOR=wellKnownSymbol("iterator"),ArrayPrototype$1=Array.prototype,isArrayIteratorMethod=function(e){return void 0!==e&&(iterators.Array===e||ArrayPrototype$1[ITERATOR]===e)},functionBindContext=function(e,t,r){if(aFunction$1(e),void 0===t)return e;switch(r){case 0:return function(){return e.call(t)};case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,o){return e.call(t,r,n,o)}}return function(){return e.apply(t,arguments)}},ITERATOR$1=wellKnownSymbol("iterator"),getIteratorMethod=function(e){if(null!=e)return e[ITERATOR$1]||e["@@iterator"]||iterators[classof(e)]},callWithSafeIterationClosing=function(e,t,r,n){try{return n?t(anObject(r)[0],r[1]):t(r)}catch(t){var o=e.return;throw void 0!==o&&anObject(o.call(e)),t}},iterate_1=createCommonjsModule((function(e){var t=function(e,t){this.stopped=e,this.result=t};(e.exports=function(e,r,n,o,i){var a,s,c,u,l,p,f,d=functionBindContext(r,n,o?2:1);if(i)a=e;else{if("function"!=typeof(s=getIteratorMethod(e)))throw TypeError("Target is not iterable");if(isArrayIteratorMethod(s)){for(c=0,u=toLength(e.length);u>c;c++)if((l=o?d(anObject(f=e[c])[0],f[1]):d(e[c]))&&l instanceof t)return l;return new t(!1)}a=s.call(e)}for(p=a.next;!(f=p.call(a)).done;)if("object"==typeof(l=callWithSafeIterationClosing(a,d,f.value,o))&&l&&l instanceof t)return l;return new t(!1)}).stop=function(e){return new t(!0,e)}})),ITERATOR$2=wellKnownSymbol("iterator"),SAFE_CLOSING=!1;try{var called=0,iteratorWithReturn={next:function(){return{done:!!called++}},return:function(){SAFE_CLOSING=!0}};iteratorWithReturn[ITERATOR$2]=function(){return this},Array.from(iteratorWithReturn,(function(){throw 2}))}catch(e){}var checkCorrectnessOfIteration=function(e,t){if(!t&&!SAFE_CLOSING)return!1;var r=!1;try{var n={};n[ITERATOR$2]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r},SPECIES$3=wellKnownSymbol("species"),speciesConstructor=function(e,t){var r,n=anObject(e).constructor;return void 0===n||null==(r=anObject(n)[SPECIES$3])?t:aFunction$1(r)},engineIsIos=/(iphone|ipod|ipad).*applewebkit/i.test(engineUserAgent),location$1=global_1.location,set$1=global_1.setImmediate,clear=global_1.clearImmediate,process$2=global_1.process,MessageChannel=global_1.MessageChannel,Dispatch=global_1.Dispatch,counter=0,queue={},ONREADYSTATECHANGE="onreadystatechange",defer,channel,port,run=function(e){if(queue.hasOwnProperty(e)){var t=queue[e];delete queue[e],t()}},runner=function(e){return function(){run(e)}},listener=function(e){run(e.data)},post=function(e){global_1.postMessage(e+"",location$1.protocol+"//"+location$1.host)};set$1&&clear||(set$1=function(e){for(var t=[],r=1;arguments.length>r;)t.push(arguments[r++]);return queue[++counter]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},defer(counter),counter},clear=function(e){delete queue[e]},"process"==classofRaw(process$2)?defer=function(e){process$2.nextTick(runner(e))}:Dispatch&&Dispatch.now?defer=function(e){Dispatch.now(runner(e))}:MessageChannel&&!engineIsIos?(channel=new MessageChannel,port=channel.port2,channel.port1.onmessage=listener,defer=functionBindContext(port.postMessage,port,1)):!global_1.addEventListener||"function"!=typeof postMessage||global_1.importScripts||fails(post)||"file:"===location$1.protocol?defer=ONREADYSTATECHANGE in documentCreateElement("script")?function(e){html.appendChild(documentCreateElement("script"))[ONREADYSTATECHANGE]=function(){html.removeChild(this),run(e)}}:function(e){setTimeout(runner(e),0)}:(defer=post,global_1.addEventListener("message",listener,!1)));var task={set:set$1,clear:clear},getOwnPropertyDescriptor$2=objectGetOwnPropertyDescriptor.f,macrotask=task.set,MutationObserver=global_1.MutationObserver||global_1.WebKitMutationObserver,process$3=global_1.process,Promise$1=global_1.Promise,IS_NODE="process"==classofRaw(process$3),queueMicrotaskDescriptor=getOwnPropertyDescriptor$2(global_1,"queueMicrotask"),queueMicrotask=queueMicrotaskDescriptor&&queueMicrotaskDescriptor.value,flush,head,last,notify,toggle,node,promise,then;queueMicrotask||(flush=function(){var e,t;for(IS_NODE&&(e=process$3.domain)&&e.exit();head;){t=head.fn,head=head.next;try{t()}catch(e){throw head?notify():last=void 0,e}}last=void 0,e&&e.enter()},IS_NODE?notify=function(){process$3.nextTick(flush)}:MutationObserver&&!engineIsIos?(toggle=!0,node=document.createTextNode(""),new MutationObserver(flush).observe(node,{characterData:!0}),notify=function(){node.data=toggle=!toggle}):Promise$1&&Promise$1.resolve?(promise=Promise$1.resolve(void 0),then=promise.then,notify=function(){then.call(promise,flush)}):notify=function(){macrotask.call(global_1,flush)});var microtask=queueMicrotask||function(e){var t={fn:e,next:void 0};last&&(last.next=t),head||(head=t,notify()),last=t},PromiseCapability=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n})),this.resolve=aFunction$1(t),this.reject=aFunction$1(r)},f$5=function(e){return new PromiseCapability(e)},newPromiseCapability={f:f$5},promiseResolve=function(e,t){if(anObject(e),isObject(t)&&t.constructor===e)return t;var r=newPromiseCapability.f(e);return(0,r.resolve)(t),r.promise},hostReportErrors=function(e,t){var r=global_1.console;r&&r.error&&(1===arguments.length?r.error(e):r.error(e,t))},perform=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},task$1=task.set,SPECIES$4=wellKnownSymbol("species"),PROMISE="Promise",getInternalState=internalState.get,setInternalState=internalState.set,getInternalPromiseState=internalState.getterFor(PROMISE),PromiseConstructor=nativePromiseConstructor,TypeError$1=global_1.TypeError,document$2=global_1.document,process$4=global_1.process,$fetch=getBuiltIn("fetch"),newPromiseCapability$1=newPromiseCapability.f,newGenericPromiseCapability=newPromiseCapability$1,IS_NODE$1="process"==classofRaw(process$4),DISPATCH_EVENT=!!(document$2&&document$2.createEvent&&global_1.dispatchEvent),UNHANDLED_REJECTION="unhandledrejection",REJECTION_HANDLED="rejectionhandled",PENDING=0,FULFILLED=1,REJECTED=2,HANDLED=1,UNHANDLED=2,Internal,OwnPromiseCapability,PromiseWrapper,nativeThen,FORCED$1=isForced_1(PROMISE,(function(){if(!(inspectSource(PromiseConstructor)!==String(PromiseConstructor))){if(66===engineV8Version)return!0;if(!IS_NODE$1&&"function"!=typeof PromiseRejectionEvent)return!0}if(engineV8Version>=51&&/native code/.test(PromiseConstructor))return!1;var e=PromiseConstructor.resolve(1),t=function(e){e((function(){}),(function(){}))};return(e.constructor={})[SPECIES$4]=t,!(e.then((function(){}))instanceof t)})),INCORRECT_ITERATION=FORCED$1||!checkCorrectnessOfIteration((function(e){PromiseConstructor.all(e).catch((function(){}))})),isThenable=function(e){var t;return!(!isObject(e)||"function"!=typeof(t=e.then))&&t},notify$1=function(e,t,r){if(!t.notified){t.notified=!0;var n=t.reactions;microtask((function(){for(var o=t.value,i=t.state==FULFILLED,a=0;n.length>a;){var s,c,u,l=n[a++],p=i?l.ok:l.fail,f=l.resolve,d=l.reject,h=l.domain;try{p?(i||(t.rejection===UNHANDLED&&onHandleUnhandled(e,t),t.rejection=HANDLED),!0===p?s=o:(h&&h.enter(),s=p(o),h&&(h.exit(),u=!0)),s===l.promise?d(TypeError$1("Promise-chain cycle")):(c=isThenable(s))?c.call(s,f,d):f(s)):d(o)}catch(e){h&&!u&&h.exit(),d(e)}}t.reactions=[],t.notified=!1,r&&!t.rejection&&onUnhandled(e,t)}))}},dispatchEvent=function(e,t,r){var n,o;DISPATCH_EVENT?((n=document$2.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),global_1.dispatchEvent(n)):n={promise:t,reason:r},(o=global_1["on"+e])?o(n):e===UNHANDLED_REJECTION&&hostReportErrors("Unhandled promise rejection",r)},onUnhandled=function(e,t){task$1.call(global_1,(function(){var r,n=t.value;if(isUnhandled(t)&&(r=perform((function(){IS_NODE$1?process$4.emit("unhandledRejection",n,e):dispatchEvent(UNHANDLED_REJECTION,e,n)})),t.rejection=IS_NODE$1||isUnhandled(t)?UNHANDLED:HANDLED,r.error))throw r.value}))},isUnhandled=function(e){return e.rejection!==HANDLED&&!e.parent},onHandleUnhandled=function(e,t){task$1.call(global_1,(function(){IS_NODE$1?process$4.emit("rejectionHandled",e):dispatchEvent(REJECTION_HANDLED,e,t.value)}))},bind=function(e,t,r,n){return function(o){e(t,r,o,n)}},internalReject=function(e,t,r,n){t.done||(t.done=!0,n&&(t=n),t.value=r,t.state=REJECTED,notify$1(e,t,!0))},internalResolve=function(e,t,r,n){if(!t.done){t.done=!0,n&&(t=n);try{if(e===r)throw TypeError$1("Promise can't be resolved itself");var o=isThenable(r);o?microtask((function(){var n={done:!1};try{o.call(r,bind(internalResolve,e,n,t),bind(internalReject,e,n,t))}catch(r){internalReject(e,n,r,t)}})):(t.value=r,t.state=FULFILLED,notify$1(e,t,!1))}catch(r){internalReject(e,{done:!1},r,t)}}};FORCED$1&&(PromiseConstructor=function(e){anInstance(this,PromiseConstructor,PROMISE),aFunction$1(e),Internal.call(this);var t=getInternalState(this);try{e(bind(internalResolve,this,t),bind(internalReject,this,t))}catch(e){internalReject(this,t,e)}},Internal=function(e){setInternalState(this,{type:PROMISE,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:PENDING,value:void 0})},Internal.prototype=redefineAll(PromiseConstructor.prototype,{then:function(e,t){var r=getInternalPromiseState(this),n=newPromiseCapability$1(speciesConstructor(this,PromiseConstructor));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=IS_NODE$1?process$4.domain:void 0,r.parent=!0,r.reactions.push(n),r.state!=PENDING&¬ify$1(this,r,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),OwnPromiseCapability=function(){var e=new Internal,t=getInternalState(e);this.promise=e,this.resolve=bind(internalResolve,e,t),this.reject=bind(internalReject,e,t)},newPromiseCapability.f=newPromiseCapability$1=function(e){return e===PromiseConstructor||e===PromiseWrapper?new OwnPromiseCapability(e):newGenericPromiseCapability(e)},"function"==typeof nativePromiseConstructor&&(nativeThen=nativePromiseConstructor.prototype.then,redefine(nativePromiseConstructor.prototype,"then",(function(e,t){var r=this;return new PromiseConstructor((function(e,t){nativeThen.call(r,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof $fetch&&_export({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return promiseResolve(PromiseConstructor,$fetch.apply(global_1,arguments))}}))),_export({global:!0,wrap:!0,forced:FORCED$1},{Promise:PromiseConstructor}),setToStringTag(PromiseConstructor,PROMISE,!1),setSpecies(PROMISE),PromiseWrapper=getBuiltIn(PROMISE),_export({target:PROMISE,stat:!0,forced:FORCED$1},{reject:function(e){var t=newPromiseCapability$1(this);return t.reject.call(void 0,e),t.promise}}),_export({target:PROMISE,stat:!0,forced:FORCED$1},{resolve:function(e){return promiseResolve(this,e)}}),_export({target:PROMISE,stat:!0,forced:INCORRECT_ITERATION},{all:function(e){var t=this,r=newPromiseCapability$1(t),n=r.resolve,o=r.reject,i=perform((function(){var r=aFunction$1(t.resolve),i=[],a=0,s=1;iterate_1(e,(function(e){var c=a++,u=!1;i.push(void 0),s++,r.call(t,e).then((function(e){u||(u=!0,i[c]=e,--s||n(i))}),o)})),--s||n(i)}));return i.error&&o(i.value),r.promise},race:function(e){var t=this,r=newPromiseCapability$1(t),n=r.reject,o=perform((function(){var o=aFunction$1(t.resolve);iterate_1(e,(function(e){o.call(t,e).then(r.resolve,n)}))}));return o.error&&n(o.value),r.promise}});var regexpFlags=function(){var e=anObject(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t};function RE(e,t){return RegExp(e,t)}var UNSUPPORTED_Y=fails((function(){var e=RE("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),BROKEN_CARET=fails((function(){var e=RE("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),regexpStickyHelpers={UNSUPPORTED_Y:UNSUPPORTED_Y,BROKEN_CARET:BROKEN_CARET},nativeExec=RegExp.prototype.exec,nativeReplace=String.prototype.replace,patchedExec=nativeExec,UPDATES_LAST_INDEX_WRONG=function(){var e=/a/,t=/b*/g;return nativeExec.call(e,"a"),nativeExec.call(t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),UNSUPPORTED_Y$1=regexpStickyHelpers.UNSUPPORTED_Y||regexpStickyHelpers.BROKEN_CARET,NPCG_INCLUDED=void 0!==/()??/.exec("")[1],PATCH=UPDATES_LAST_INDEX_WRONG||NPCG_INCLUDED||UNSUPPORTED_Y$1;PATCH&&(patchedExec=function(e){var t,r,n,o,i=this,a=UNSUPPORTED_Y$1&&i.sticky,s=regexpFlags.call(i),c=i.source,u=0,l=e;return a&&(-1===(s=s.replace("y","")).indexOf("g")&&(s+="g"),l=String(e).slice(i.lastIndex),i.lastIndex>0&&(!i.multiline||i.multiline&&"\n"!==e[i.lastIndex-1])&&(c="(?: "+c+")",l=" "+l,u++),r=new RegExp("^(?:"+c+")",s)),NPCG_INCLUDED&&(r=new RegExp("^"+c+"$(?!\\s)",s)),UPDATES_LAST_INDEX_WRONG&&(t=i.lastIndex),n=nativeExec.call(a?r:i,l),a?n?(n.input=n.input.slice(u),n[0]=n[0].slice(u),n.index=i.lastIndex,i.lastIndex+=n[0].length):i.lastIndex=0:UPDATES_LAST_INDEX_WRONG&&n&&(i.lastIndex=i.global?n.index+n[0].length:t),NPCG_INCLUDED&&n&&n.length>1&&nativeReplace.call(n[0],r,(function(){for(o=1;o")})),REPLACE_KEEPS_$0="$0"==="a".replace(/./,"$0"),REPLACE=wellKnownSymbol("replace"),REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE=!!/./[REPLACE]&&""===/./[REPLACE]("a","$0"),SPLIT_WORKS_WITH_OVERWRITTEN_EXEC=!fails((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var r="ab".split(e);return 2!==r.length||"a"!==r[0]||"b"!==r[1]})),fixRegexpWellKnownSymbolLogic=function(e,t,r,n){var o=wellKnownSymbol(e),i=!fails((function(){var t={};return t[o]=function(){return 7},7!=""[e](t)})),a=i&&!fails((function(){var t=!1,r=/a/;return"split"===e&&((r={}).constructor={},r.constructor[SPECIES$5]=function(){return r},r.flags="",r[o]=/./[o]),r.exec=function(){return t=!0,null},r[o](""),!t}));if(!i||!a||"replace"===e&&(!REPLACE_SUPPORTS_NAMED_GROUPS||!REPLACE_KEEPS_$0||REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE)||"split"===e&&!SPLIT_WORKS_WITH_OVERWRITTEN_EXEC){var s=/./[o],c=r(o,""[e],(function(e,t,r,n,o){return t.exec===regexpExec?i&&!o?{done:!0,value:s.call(t,r,n)}:{done:!0,value:e.call(r,t,n)}:{done:!1}}),{REPLACE_KEEPS_$0:REPLACE_KEEPS_$0,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE}),u=c[0],l=c[1];redefine(String.prototype,e,u),redefine(RegExp.prototype,o,2==t?function(e,t){return l.call(e,this,t)}:function(e){return l.call(e,this)})}n&&createNonEnumerableProperty(RegExp.prototype[o],"sham",!0)},createMethod$1=function(e){return function(t,r){var n,o,i=String(requireObjectCoercible(t)),a=toInteger(r),s=i.length;return a<0||a>=s?e?"":void 0:(n=i.charCodeAt(a))<55296||n>56319||a+1===s||(o=i.charCodeAt(a+1))<56320||o>57343?e?i.charAt(a):n:e?i.slice(a,a+2):o-56320+(n-55296<<10)+65536}},stringMultibyte={codeAt:createMethod$1(!1),charAt:createMethod$1(!0)},charAt=stringMultibyte.charAt,advanceStringIndex=function(e,t,r){return t+(r?charAt(e,t).length:1)},regexpExecAbstract=function(e,t){var r=e.exec;if("function"==typeof r){var n=r.call(e,t);if("object"!=typeof n)throw TypeError("RegExp exec method returned something other than an Object or null");return n}if("RegExp"!==classofRaw(e))throw TypeError("RegExp#exec called on incompatible receiver");return regexpExec.call(e,t)},max$1=Math.max,min$2=Math.min,floor$1=Math.floor,SUBSTITUTION_SYMBOLS=/\$([$&'`]|\d\d?|<[^>]*>)/g,SUBSTITUTION_SYMBOLS_NO_NAMED=/\$([$&'`]|\d\d?)/g,maybeToString=function(e){return void 0===e?e:String(e)};fixRegexpWellKnownSymbolLogic("replace",2,(function(e,t,r,n){var o=n.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,i=n.REPLACE_KEEPS_$0,a=o?"$":"$0";return[function(r,n){var o=requireObjectCoercible(this),i=null==r?void 0:r[e];return void 0!==i?i.call(r,o,n):t.call(String(o),r,n)},function(e,n){if(!o&&i||"string"==typeof n&&-1===n.indexOf(a)){var c=r(t,e,this,n);if(c.done)return c.value}var u=anObject(e),l=String(this),p="function"==typeof n;p||(n=String(n));var f=u.global;if(f){var d=u.unicode;u.lastIndex=0}for(var h=[];;){var y=regexpExecAbstract(u,l);if(null===y)break;if(h.push(y),!f)break;""===String(y[0])&&(u.lastIndex=advanceStringIndex(l,toLength(u.lastIndex),d))}for(var g="",v=0,b=0;b=v&&(g+=l.slice(v,m)+P,v=m+S.length)}return g+l.slice(v)}];function s(e,r,n,o,i,a){var s=n+e.length,c=o.length,u=SUBSTITUTION_SYMBOLS_NO_NAMED;return void 0!==i&&(i=toObject(i),u=SUBSTITUTION_SYMBOLS),t.call(a,u,(function(t,a){var u;switch(a.charAt(0)){case"$":return"$";case"&":return e;case"`":return r.slice(0,n);case"'":return r.slice(s);case"<":u=i[a.slice(1,-1)];break;default:var l=+a;if(0===l)return t;if(l>c){var p=floor$1(l/10);return 0===p?t:p<=c?void 0===o[p-1]?a.charAt(1):o[p-1]+a.charAt(1):t}u=o[l-1]}return void 0===u?"":u}))}}));var runtime=createCommonjsModule((function(e){!function(t){var r,n=Object.prototype,o=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag",u=t.regeneratorRuntime;if(u)e.exports=u;else{(u=t.regeneratorRuntime=e.exports).wrap=S;var l="suspendedStart",p="suspendedYield",f="executing",d="completed",h={},y={};y[a]=function(){return this};var g=Object.getPrototypeOf,v=g&&g(g(x([])));v&&v!==n&&o.call(v,a)&&(y=v);var b=T.prototype=E.prototype=Object.create(y);_.prototype=b.constructor=T,T.constructor=_,T[c]=_.displayName="GeneratorFunction",u.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===_||"GeneratorFunction"===(t.displayName||t.name))},u.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,T):(e.__proto__=T,c in e||(e[c]="GeneratorFunction")),e.prototype=Object.create(b),e},u.awrap=function(e){return{__await:e}},O(P.prototype),P.prototype[s]=function(){return this},u.AsyncIterator=P,u.async=function(e,t,r,n){var o=new P(S(e,t,r,n));return u.isGeneratorFunction(t)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},O(b),b[c]="Generator",b[a]=function(){return this},b.toString=function(){return"[object Generator]"},u.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},u.values=x,w.prototype={constructor:w,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(R),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=r)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,o){return s.type="throw",s.arg=e,t.next=n,o&&(t.method="next",t.arg=r),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),R(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;R(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:x(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=r),h}}}function S(e,t,r,n){var o=t&&t.prototype instanceof E?t:E,i=Object.create(o.prototype),a=new w(n||[]);return i._invoke=function(e,t,r){var n=l;return function(o,i){if(n===f)throw new Error("Generator is already running");if(n===d){if("throw"===o)throw i;return C()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=I(a,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===l)throw n=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=f;var c=m(e,t,r);if("normal"===c.type){if(n=r.done?d:p,c.arg===h)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=d,r.method="throw",r.arg=c.arg)}}}(e,r,a),i}function m(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}function E(){}function _(){}function T(){}function O(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function P(e){var t;this._invoke=function(r,n){function i(){return new Promise((function(t,i){!function t(r,n,i,a){var s=m(e[r],e,n);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==typeof u&&o.call(u,"__await")?Promise.resolve(u.__await).then((function(e){t("next",e,i,a)}),(function(e){t("throw",e,i,a)})):Promise.resolve(u).then((function(e){c.value=e,i(c)}),a)}a(s.arg)}(r,n,t,i)}))}return t=t?t.then(i,i):i()}}function I(e,t){var n=e.iterator[t.method];if(n===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=r,I(e,t),"throw"===t.method))return h;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var o=m(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,h;var i=o.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=r),t.delegate=null,h):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function x(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++ne.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)return;o[t]="set-cookie"===t?(o[t]?o[t]:[]).concat([r]):o[t]?o[t]+", "+r:r}})),o):o},isURLSameOrigin=utils.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=n(window.location.href),function(t){var r=utils.isString(t)?n(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0},cookies=utils.isStandardBrowserEnv()?{write:function(e,t,r,n,o,i){var a=[];a.push(e+"="+encodeURIComponent(t)),utils.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),utils.isString(n)&&a.push("path="+n),utils.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},xhr=function(e){return new Promise((function(t,r){var n=e.data,o=e.headers;utils.isFormData(n)&&delete o["Content-Type"];var i=new XMLHttpRequest;if(e.auth){var a=e.auth.username||"",s=e.auth.password||"";o.Authorization="Basic "+btoa(a+":"+s)}var c=buildFullPath(e.baseURL,e.url);if(i.open(e.method.toUpperCase(),buildURL(c,e.params,e.paramsSerializer),!0),i.timeout=e.timeout,i.onreadystatechange=function(){if(i&&4===i.readyState&&(0!==i.status||i.responseURL&&0===i.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in i?parseHeaders(i.getAllResponseHeaders()):null,o={data:e.responseType&&"text"!==e.responseType?i.response:i.responseText,status:i.status,statusText:i.statusText,headers:n,config:e,request:i};settle(t,r,o),i=null}},i.onabort=function(){i&&(r(createError("Request aborted",e,"ECONNABORTED",i)),i=null)},i.onerror=function(){r(createError("Network Error",e,null,i)),i=null},i.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(createError(t,e,"ECONNABORTED",i)),i=null},utils.isStandardBrowserEnv()){var u=cookies,l=(e.withCredentials||isURLSameOrigin(c))&&e.xsrfCookieName?u.read(e.xsrfCookieName):void 0;l&&(o[e.xsrfHeaderName]=l)}if("setRequestHeader"in i&&utils.forEach(o,(function(e,t){void 0===n&&"content-type"===t.toLowerCase()?delete o[t]:i.setRequestHeader(t,e)})),utils.isUndefined(e.withCredentials)||(i.withCredentials=!!e.withCredentials),e.responseType)try{i.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&i.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&i.upload&&i.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){i&&(i.abort(),r(e),i=null)})),void 0===n&&(n=null),i.send(n)}))},DEFAULT_CONTENT_TYPE={"Content-Type":"application/x-www-form-urlencoded"};function setContentTypeIfUnset(e,t){!utils.isUndefined(e)&&utils.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}function getDefaultAdapter(){var e;return"undefined"!=typeof XMLHttpRequest?e=xhr:"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process)&&(e=xhr),e}var defaults={adapter:getDefaultAdapter(),transformRequest:[function(e,t){return normalizeHeaderName(t,"Accept"),normalizeHeaderName(t,"Content-Type"),utils.isFormData(e)||utils.isArrayBuffer(e)||utils.isBuffer(e)||utils.isStream(e)||utils.isFile(e)||utils.isBlob(e)?e:utils.isArrayBufferView(e)?e.buffer:utils.isURLSearchParams(e)?(setContentTypeIfUnset(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):utils.isObject(e)?(setContentTypeIfUnset(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};utils.forEach(["delete","get","head"],(function(e){defaults.headers[e]={}})),utils.forEach(["post","put","patch"],(function(e){defaults.headers[e]=utils.merge(DEFAULT_CONTENT_TYPE)}));var defaults_1=defaults;function throwIfCancellationRequested(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var dispatchRequest=function(e){return throwIfCancellationRequested(e),e.headers=e.headers||{},e.data=transformData(e.data,e.headers,e.transformRequest),e.headers=utils.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),utils.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||defaults_1.adapter)(e).then((function(t){return throwIfCancellationRequested(e),t.data=transformData(t.data,t.headers,e.transformResponse),t}),(function(t){return isCancel(t)||(throwIfCancellationRequested(e),t&&t.response&&(t.response.data=transformData(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},mergeConfig=function(e,t){t=t||{};var r={},n=["url","method","params","data"],o=["headers","auth","proxy"],i=["baseURL","url","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"];utils.forEach(n,(function(e){void 0!==t[e]&&(r[e]=t[e])})),utils.forEach(o,(function(n){utils.isObject(t[n])?r[n]=utils.deepMerge(e[n],t[n]):void 0!==t[n]?r[n]=t[n]:utils.isObject(e[n])?r[n]=utils.deepMerge(e[n]):void 0!==e[n]&&(r[n]=e[n])})),utils.forEach(i,(function(n){void 0!==t[n]?r[n]=t[n]:void 0!==e[n]&&(r[n]=e[n])}));var a=n.concat(o).concat(i),s=Object.keys(t).filter((function(e){return-1===a.indexOf(e)}));return utils.forEach(s,(function(n){void 0!==t[n]?r[n]=t[n]:void 0!==e[n]&&(r[n]=e[n])})),r};function Axios(e){this.defaults=e,this.interceptors={request:new InterceptorManager_1,response:new InterceptorManager_1}}Axios.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=mergeConfig(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[dispatchRequest,void 0],r=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)r=r.then(t.shift(),t.shift());return r},Axios.prototype.getUri=function(e){return e=mergeConfig(this.defaults,e),buildURL(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},utils.forEach(["delete","get","head","options"],(function(e){Axios.prototype[e]=function(t,r){return this.request(utils.merge(r||{},{method:e,url:t}))}})),utils.forEach(["post","put","patch"],(function(e){Axios.prototype[e]=function(t,r,n){return this.request(utils.merge(n||{},{method:e,url:t,data:r}))}}));var Axios_1=Axios;function Cancel(e){this.message=e}Cancel.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},Cancel.prototype.__CANCEL__=!0;var Cancel_1=Cancel;function CancelToken(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;e((function(e){r.reason||(r.reason=new Cancel_1(e),t(r.reason))}))}CancelToken.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},CancelToken.source=function(){var e;return{token:new CancelToken((function(t){e=t})),cancel:e}};var CancelToken_1=CancelToken,spread=function(e){return function(t){return e.apply(null,t)}};function createInstance(e){var t=new Axios_1(e),r=bind$1(Axios_1.prototype.request,t);return utils.extend(r,Axios_1.prototype,t),utils.extend(r,t),r}var axios=createInstance(defaults_1);axios.Axios=Axios_1,axios.create=function(e){return createInstance(mergeConfig(axios.defaults,e))},axios.Cancel=Cancel_1,axios.CancelToken=CancelToken_1,axios.isCancel=isCancel,axios.all=function(e){return Promise.all(e)},axios.spread=spread;var axios_1=axios,default_1=axios;axios_1.default=default_1;var axios$1=axios_1;function request(e){var t=e.url,r=e.headers,n=void 0===r?{}:r,o=e.data,i=void 0===o?"":o,a=e.responseType,s=void 0===a?"json":a,c=e.timeout,u=void 0===c?3e4:c,l=e.method,p=void 0===l?"POST":l,f=e.params,d=void 0===f?{}:f;return axios$1(Object.assign(Object.assign({},e),{url:t,headers:Object.assign({"content-type":"application/json;charset=UTF-8"},n),data:i,responseType:s,timeout:u,method:p,params:d}))}var createMethod$2=function(e){return function(t,r,n,o){aFunction$1(r);var i=toObject(t),a=indexedObject(i),s=toLength(i.length),c=e?s-1:0,u=e?-1:1;if(n<2)for(;;){if(c in a){o=a[c],c+=u;break}if(c+=u,e?c<0:s<=c)throw TypeError("Reduce of empty array with no initial value")}for(;e?c>=0:s>c;c+=u)c in a&&(o=r(o,a[c],c,i));return o}},arrayReduce={left:createMethod$2(!1),right:createMethod$2(!0)},$reduce=arrayReduce.left,STRICT_METHOD$2=arrayMethodIsStrict("reduce"),USES_TO_LENGTH$2=arrayMethodUsesToLength("reduce",{1:0});_export({target:"Array",proto:!0,forced:!STRICT_METHOD$2||!USES_TO_LENGTH$2},{reduce:function(e){return $reduce(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}});var MATCH=wellKnownSymbol("match"),isRegexp=function(e){var t;return isObject(e)&&(void 0!==(t=e[MATCH])?!!t:"RegExp"==classofRaw(e))},arrayPush=[].push,min$3=Math.min,MAX_UINT32=4294967295,SUPPORTS_Y=!fails((function(){return!RegExp(MAX_UINT32,"y")}));fixRegexpWellKnownSymbolLogic("split",2,(function(e,t,r){var n;return n="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,r){var n=String(requireObjectCoercible(this)),o=void 0===r?MAX_UINT32:r>>>0;if(0===o)return[];if(void 0===e)return[n];if(!isRegexp(e))return t.call(n,e,o);for(var i,a,s,c=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),l=0,p=new RegExp(e.source,u+"g");(i=regexpExec.call(p,n))&&!((a=p.lastIndex)>l&&(c.push(n.slice(l,i.index)),i.length>1&&i.index=o));)p.lastIndex===i.index&&p.lastIndex++;return l===n.length?!s&&p.test("")||c.push(""):c.push(n.slice(l)),c.length>o?c.slice(0,o):c}:"0".split(void 0,0).length?function(e,r){return void 0===e&&0===r?[]:t.call(this,e,r)}:t,[function(t,r){var o=requireObjectCoercible(this),i=null==t?void 0:t[e];return void 0!==i?i.call(t,o,r):n.call(String(o),t,r)},function(e,o){var i=r(n,e,this,o,n!==t);if(i.done)return i.value;var a=anObject(e),s=String(this),c=speciesConstructor(a,RegExp),u=a.unicode,l=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(SUPPORTS_Y?"y":"g"),p=new c(SUPPORTS_Y?a:"^(?:"+a.source+")",l),f=void 0===o?MAX_UINT32:o>>>0;if(0===f)return[];if(0===s.length)return null===regexpExecAbstract(p,s)?[s]:[];for(var d=0,h=0,y=[];h/",production:"https://ssdp.crc.com.cn/ssdp/app//"},cls:{test:"https://ssdpuat.crc.com.cn:8443/ssdp/cls/rf/",production:"https://ssdp.crc.com.cn/ssdp/cls/rf/",runwork:{sit:{App_Sub_ID:"0000000303DM",App_Token:"6debaf0da23340daaac8659144ebed7a",Partner_ID:"00000000",Sys_ID:"00000003"},uat:{App_Sub_ID:"0000000309OK",App_Token:"5643f1d9d86c43c9ae72069c243dbf86",Partner_ID:"00000000",Sys_ID:"00000003"},production:{App_Sub_ID:"0000000401RH",App_Token:"2bbc84f3bde54df488b4b0133989956c",Partner_ID:"00000000",Sys_ID:"00000004"}}},dtgw:{test:"https://dtgw-uat.crcloud.com/dtgw/api/",production:"https://dtgw-ps.crcloud.com/dtgw/api/",runwork:{sit:{"s-crc-app-id":"10012","s-crc-token":"0ed1fe39709f4c9f9e7fe8071fb8f4f1","s-crc-tpl-code":"EMAP_FILE_DOWN"},uat:{"s-crc-app-id":"10013","s-crc-token":"616451486c7c4b46b21c24d35f1f6f9b","s-crc-tpl-code":"EMAP_FILE_DOWN"},production:{"s-crc-app-id":"10012","s-crc-token":"e893a9d21a2a4fe5a50833de3b99f8e1","s-crc-tpl-code":"EMAP_FILE_DOWN"}}},api:{sit:{hrInfo:{api:"crc.rgz.lark0sit.users.getUserInfo",version:"1.0"},avatar:{api:"crc.rgz.lark0sit.getEmpImage",version:"1.0"},gettoken:{api:"crc.rgz.lark0sit.lark.gettoken",version:"1.0"},ticket:{api:"crc.rgz.lark0sit.jsapi.ticket",version:"1.0"}},uat:{hrInfo:{api:"crc.rgz.run3uat.users.getUserInfo",version:"1.0"},avatar:{api:"crc.rgz.run3uat.getEmpImage",version:"1.0"},gettoken:{api:"crc.rgz.run3uat.lark.gettoken",version:"1.0"},ticket:{api:"crc.rgz.run3uat.jsapi.ticket",version:"1.0"}},test:{gettoken:{api:"crc.rgz.lark0sit.lark.gettoken",version:"1.0"},ticket:{api:"crc.rgz.lark0sit.jsapi.ticket",version:"1.0"}},production:{ssdpPostToken:{api:"crc.ssdp.public.apptoken",version:"1.0"},gettoken:{api:"crc.rgz.app.lark.gettoken",version:"1.0"},ticket:{api:"crc.rgz.app.jsapi.ticket",version:"1.0"},hrInfo:{api:"crc.rgz.app.users.getUserInfo",version:"1.0"},avatar:{api:"crc.rgz.app.getEmpImage",version:"1.0"}}}},h5DB=[{name:"ssdpPostToken",store:{keyPath:"id",autoIncrement:!1},index:["token","expires"]},{name:"sys",store:{keyPath:"id",autoIncrement:!1},index:["appVersion","deviceID","system","platform"]},{name:"user",store:{keyPath:"id",autoIncrement:!1},index:["App_Sub_ID","App_Token","App_key","Partner_ID","external_token","open_id"]},{name:"hrInfo",store:{keyPath:"id",autoIncrement:!1},index:["jobCodeDescr","fullPath","businessUnit","gender","avatarUrl","fullDescPath","deptId","employeeId","birthDate","nameFormal","join_time","nameAc","deptDesc","userType","email","seniorityPayDtMap","businessUnitDesc","expires","mobilePhoneNumber","businessUnitDescShort"]},{name:"avatar",store:{keyPath:"id",autoIncrement:!1},index:["imageUrl","expires"]}],cacheKeys={localStorage:{feishu:{tenantAccessToken:"FS_TenantAccessToken",ticket:"FS_Ticket"}},indexeddb:{name:"runworkH5",version:3,store:{sys:"sys",user:"user",hrInfo:"hrInfo",avatar:"avatar",postToken:"ssdpPostToken"}}},constant={ssdp:ssdp,h5DB:h5DB,cacheKeys:cacheKeys};function getConstant(e){return e.split(".").reduce((function(e,t){return e[t]}),constant)}var aPossiblePrototype=function(e){if(!isObject(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e},objectSetPrototypeOf=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return anObject(r),aPossiblePrototype(n),t?e.call(r,n):r.__proto__=n,r}}():void 0),inheritIfRequired=function(e,t,r){var n,o;return objectSetPrototypeOf&&"function"==typeof(n=t.constructor)&&n!==r&&isObject(o=n.prototype)&&o!==r.prototype&&objectSetPrototypeOf(e,o),e},defineProperty$3=objectDefineProperty.f,getOwnPropertyNames=objectGetOwnPropertyNames.f,setInternalState$1=internalState.set,MATCH$1=wellKnownSymbol("match"),NativeRegExp=global_1.RegExp,RegExpPrototype=NativeRegExp.prototype,re1=/a/g,re2=/a/g,CORRECT_NEW=new NativeRegExp(re1)!==re1,UNSUPPORTED_Y$2=regexpStickyHelpers.UNSUPPORTED_Y,FORCED$2=descriptors&&isForced_1("RegExp",!CORRECT_NEW||UNSUPPORTED_Y$2||fails((function(){return re2[MATCH$1]=!1,NativeRegExp(re1)!=re1||NativeRegExp(re2)==re2||"/a/i"!=NativeRegExp(re1,"i")})));if(FORCED$2){for(var RegExpWrapper=function(e,t){var r,n=this instanceof RegExpWrapper,o=isRegexp(e),i=void 0===t;if(!n&&o&&e.constructor===RegExpWrapper&&i)return e;CORRECT_NEW?o&&!i&&(e=e.source):e instanceof RegExpWrapper&&(i&&(t=regexpFlags.call(e)),e=e.source),UNSUPPORTED_Y$2&&(r=!!t&&t.indexOf("y")>-1)&&(t=t.replace(/y/g,""));var a=inheritIfRequired(CORRECT_NEW?new NativeRegExp(e,t):NativeRegExp(e,t),n?this:RegExpPrototype,RegExpWrapper);return UNSUPPORTED_Y$2&&r&&setInternalState$1(a,{sticky:r}),a},proxy=function(e){e in RegExpWrapper||defineProperty$3(RegExpWrapper,e,{configurable:!0,get:function(){return NativeRegExp[e]},set:function(t){NativeRegExp[e]=t}})},keys$1=getOwnPropertyNames(NativeRegExp),index=0;keys$1.length>index;)proxy(keys$1[index++]);RegExpPrototype.constructor=RegExpWrapper,RegExpWrapper.prototype=RegExpPrototype,redefine(global_1,"RegExp",RegExpWrapper)}setSpecies("RegExp");var TO_STRING$1="toString",RegExpPrototype$1=RegExp.prototype,nativeToString=RegExpPrototype$1[TO_STRING$1],NOT_GENERIC=fails((function(){return"/a/b"!=nativeToString.call({source:"a",flags:"b"})})),INCORRECT_NAME=nativeToString.name!=TO_STRING$1;function getTimeStamp(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"yyyy-MM-dd hh:mm:ss:S",r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n={"M+":e.getMonth()+1,"d+":e.getDate(),"h+":e.getHours(),"m+":e.getMinutes(),"s+":e.getSeconds(),"q+":Math.floor((e.getMonth()+3)/3),S:e.getMilliseconds()};for(var o in/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(e.getFullYear()+"").substr(4-RegExp.$1.length))),n)new RegExp("("+o+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?n[o]:("00"+n[o]).substr((""+n[o]).length)));var i=-e.getTimezoneOffset()/60,a=i>=0?"+":"-";i=Math.abs(i);var s="".concat(a).concat(i<10?"0".concat(i):i,"00");return"".concat(t).concat(r?s:"")}(NOT_GENERIC||INCORRECT_NAME)&&redefine(RegExp.prototype,TO_STRING$1,(function(){var e=anObject(this),t=String(e.source),r=e.flags;return"/"+t+"/"+String(void 0===r&&e instanceof RegExp&&!("flags"in RegExpPrototype$1)?regexpFlags.call(e):r)}),{unsafe:!0});var base64encodechars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",base64decodechars=new Array(-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1),base64encode=function(){var e,t,r,n,o,i,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";for(r=a.length,t=0,e="";t>2),e+=base64encodechars.charAt((3&n)<<4),e+="==";break}if(o=a.charCodeAt(t++),t==r){e+=base64encodechars.charAt(n>>2),e+=base64encodechars.charAt((3&n)<<4|(240&o)>>4),e+=base64encodechars.charAt((15&o)<<2),e+="=";break}i=a.charCodeAt(t++),e+=base64encodechars.charAt(n>>2),e+=base64encodechars.charAt((3&n)<<4|(240&o)>>4),e+=base64encodechars.charAt((15&o)<<2|(192&i)>>6),e+=base64encodechars.charAt(63&i)}return e},base64decode=function(){var e,t,r,n,o,i,a,s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";for(i=s.length,o=0,a="";o>4);do{if(61==(r=255&s.charCodeAt(o++)))return a;r=base64decodechars[r]}while(o>2);do{if(61==(n=255&s.charCodeAt(o++)))return a;n=base64decodechars[n]}while(o0&&void 0!==arguments[0]?arguments[0]:"";for(e="",r=o.length,t=0;t=1&&n<=127?e+=o.charAt(t):n>2047?(e+=String.fromCharCode(224|n>>12&15),e+=String.fromCharCode(128|n>>6&63),e+=String.fromCharCode(128|n>>0&63)):(e+=String.fromCharCode(192|n>>6&31),e+=String.fromCharCode(128|n>>0&63));return e},utf8to16=function(){var e,t,r,n,o,i,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";for(e="",r=a.length,t=0;t>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:e+=a.charAt(t-1);break;case 12:case 13:o=a.charCodeAt(t++),e+=String.fromCharCode((31&n)<<6|63&o);break;case 14:o=a.charCodeAt(t++),i=a.charCodeAt(t++),e+=String.fromCharCode((15&n)<<12|(63&o)<<6|(63&i)<<0)}return e},base64={encode:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return base64encode(utf16to8(e))},decode:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return utf8to16(base64decode(e))}};function staticJsBridge(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return console.log("获取登录参数",e),new Promise((function(r,n){window._LarkPassportJsBridge.invoke(e,t,{onSuccess:function(e){console.log("获取登录参数完成",e),r(e)},onFail:function(e){console.error("获取登录参数失败",e),n(e)}})}))}function jssdk(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(r,n){window.h5sdk.ready((function(){var o=e.split(".").reduce((function(e,t){return e[t]||{}}),window.h5sdk);"function"!=typeof o&&n(),o.call(window.h5sdk,Object.assign({onSuccess:function(e){r(e)},onFail:function(t){errorHandle(e),console.error("调用原生方法失败:"+e,t),n(t)}},t))})).catch((function(e){return console.error("h5sdk.ready error",e),Promise.reject(e)}))}))}function errorHandle(e){switch(e){case"biz.user.getUserInfoEx":navigator.userAgent.match(/android/i)?alert("认证信息失效,请重新登录"):jssdk("device.notification.confirm",{title:"温馨提示",message:"认证信息失效,请重新登录",buttonLabels:["好的"]}).then((function(){jssdk("biz.navigation.close")}))}}fixRegexpWellKnownSymbolLogic("match",1,(function(e,t,r){return[function(t){var r=requireObjectCoercible(this),n=null==t?void 0:t[e];return void 0!==n?n.call(t,r):new RegExp(t)[e](String(r))},function(e){var n=r(t,e,this);if(n.done)return n.value;var o=anObject(e),i=String(this);if(!o.global)return regexpExecAbstract(o,i);var a=o.unicode;o.lastIndex=0;for(var s,c=[],u=0;null!==(s=regexpExecAbstract(o,i));){var l=String(s[0]);c[u]=l,""===l&&(o.lastIndex=advanceStringIndex(i,toLength(o.lastIndex),a)),u++}return 0===u?null:c}]}));var push=[].push,createMethod$3=function(e){var t=1==e,r=2==e,n=3==e,o=4==e,i=6==e,a=5==e||i;return function(s,c,u,l){for(var p,f,d=toObject(s),h=indexedObject(d),y=functionBindContext(c,u,3),g=toLength(h.length),v=0,b=l||arraySpeciesCreate,S=t?b(s,g):r?b(s,0):void 0;g>v;v++)if((a||v in h)&&(f=y(p=h[v],v,d),e))if(t)S[v]=f;else if(f)switch(e){case 3:return!0;case 5:return p;case 6:return v;case 2:push.call(S,p)}else if(o)return!1;return i?-1:n||o?o:S}},arrayIteration={forEach:createMethod$3(0),map:createMethod$3(1),filter:createMethod$3(2),some:createMethod$3(3),every:createMethod$3(4),find:createMethod$3(5),findIndex:createMethod$3(6)},$some=arrayIteration.some,STRICT_METHOD$3=arrayMethodIsStrict("some"),USES_TO_LENGTH$3=arrayMethodUsesToLength("some");_export({target:"Array",proto:!0,forced:!STRICT_METHOD$3||!USES_TO_LENGTH$3},{some:function(e){return $some(this,e,arguments.length>1?arguments[1]:void 0)}});var isIphonex=function(){if("undefined"!=typeof window&&window){if(!/iphone/gi.test(window.navigator.userAgent))return!1;var e=window,t=e.devicePixelRatio,r=e.screen,n=r.width,o=r.height;return[{devicePixelRatio:3,width:375,height:812},{devicePixelRatio:3,width:414,height:896},{devicePixelRatio:2,width:414,height:896}].some((function(e){return e.devicePixelRatio===t&&e.width===n&&e.height===o}))}return!1};function logger(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info";"[object Array]"!==Object.prototype.toString.call(e)&&(e=[e]),(t=console)[r].apply(t,["runwork-help2.0"].concat(_toConsumableArray(e)))}var $map=arrayIteration.map,HAS_SPECIES_SUPPORT=arrayMethodHasSpeciesSupport("map"),USES_TO_LENGTH$4=arrayMethodUsesToLength("map");_export({target:"Array",proto:!0,forced:!HAS_SPECIES_SUPPORT||!USES_TO_LENGTH$4},{map:function(e){return $map(this,e,arguments.length>1?arguments[1]:void 0)}});var test$1=[],nativeSort=test$1.sort,FAILS_ON_UNDEFINED=fails((function(){test$1.sort(void 0)})),FAILS_ON_NULL=fails((function(){test$1.sort(null)})),STRICT_METHOD$4=arrayMethodIsStrict("sort"),FORCED$3=FAILS_ON_UNDEFINED||!FAILS_ON_NULL||!STRICT_METHOD$4;_export({target:"Array",proto:!0,forced:FORCED$3},{sort:function(e){return void 0===e?nativeSort.call(toObject(this)):nativeSort.call(toObject(this),aFunction$1(e))}});var md5=createCommonjsModule((function(e){!function(t){function r(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function n(e,t,n,o,i,a){return r((s=r(r(t,e),r(o,a)))<<(c=i)|s>>>32-c,n);var s,c}function o(e,t,r,o,i,a,s){return n(t&r|~t&o,e,t,i,a,s)}function i(e,t,r,o,i,a,s){return n(t&o|r&~o,e,t,i,a,s)}function a(e,t,r,o,i,a,s){return n(t^r^o,e,t,i,a,s)}function s(e,t,r,o,i,a,s){return n(r^(t|~o),e,t,i,a,s)}function c(e,t){var n,c,u,l,p;e[t>>5]|=128<>>9<<4)]=t;var f=1732584193,d=-271733879,h=-1732584194,y=271733878;for(n=0;n>5]>>>t%32&255);return r}function l(e){var t,r=[];for(r[(e.length>>2)-1]=void 0,t=0;t>5]|=(255&e.charCodeAt(t/8))<>>4&15)+"0123456789abcdef".charAt(15&t);return n}function f(e){return unescape(encodeURIComponent(e))}function d(e){return function(e){return u(c(l(e),8*e.length))}(f(e))}function h(e,t){return function(e,t){var r,n,o=l(e),i=[],a=[];for(i[15]=a[15]=void 0,o.length>16&&(o=c(o,8*e.length)),r=0;r<16;r+=1)i[r]=909522486^o[r],a[r]=1549556828^o[r];return n=c(i.concat(l(t)),512+8*t.length),u(c(a.concat(n),640))}(f(e),f(t))}function y(e,t,r){return t?r?h(t,e):p(h(t,e)):r?d(e):p(d(e))}e.exports?e.exports=y:t.md5=y}(commonjsGlobal)}));function generateSysSign(e){var t=e.App_Sub_ID,r=e.App_Token,n=e.User_Token,o=void 0===n?"":n,i=e.Api_ID,a=e.Api_Version,s=e.Time_Stamp,c=e.Partner_ID,u=e.REQUEST_DATA,l=e.App_ID,p=e.App_Version,f=e.Divice_ID,d=e.Divice_Version,h=e.OS_Version,y=e.App_key,g=[["App_Sub_ID",t],["App_Token",r],["User_Token",o],["Api_ID",i],["Api_Version",a],["Time_Stamp",s],["Partner_ID",c],["REQUEST_DATA","string"==typeof u?u:JSON.stringify(u)],["App_ID",l],["App_Version",p],["Divice_ID",f],["Divice_Version",d],["OS_Version",h]];return g.sort(),console.log("签名参数",g),md5("".concat(g.map((function(e){return e.join("=")})).join("&"),"&").concat(y)).toUpperCase()}var SSDPConfigMode=function e(t){var r=t.App_Sub_ID,n=t.App_Token,o=t.App_ID,i=t.App_key,a=t.App_Version,s=t.Divice_ID,c=t.Divice_Version,u=t.OS_Version,l=t.Partner_ID,p=t.User_Token;_classCallCheck(this,e),this.App_Sub_ID=r,this.App_Token=n,this.App_ID=o,this.App_key=i,this.App_Version=a,this.Divice_ID=s,this.Divice_Version=c,this.OS_Version=u,this.Partner_ID=l,this.User_Token=p||""},nativeGetOwnPropertyNames=objectGetOwnPropertyNames.f,toString$2={}.toString,windowNames="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],getWindowNames=function(e){try{return nativeGetOwnPropertyNames(e)}catch(e){return windowNames.slice()}},f$6=function(e){return windowNames&&"[object Window]"==toString$2.call(e)?getWindowNames(e):nativeGetOwnPropertyNames(toIndexedObject(e))},objectGetOwnPropertyNamesExternal={f:f$6},f$7=wellKnownSymbol,wellKnownSymbolWrapped={f:f$7},defineProperty$4=objectDefineProperty.f,defineWellKnownSymbol=function(e){var t=path.Symbol||(path.Symbol={});has(t,e)||defineProperty$4(t,e,{value:wellKnownSymbolWrapped.f(e)})},$forEach=arrayIteration.forEach,HIDDEN=sharedKey("hidden"),SYMBOL="Symbol",PROTOTYPE$1="prototype",TO_PRIMITIVE=wellKnownSymbol("toPrimitive"),setInternalState$2=internalState.set,getInternalState$1=internalState.getterFor(SYMBOL),ObjectPrototype=Object[PROTOTYPE$1],$Symbol=global_1.Symbol,$stringify=getBuiltIn("JSON","stringify"),nativeGetOwnPropertyDescriptor$1=objectGetOwnPropertyDescriptor.f,nativeDefineProperty$1=objectDefineProperty.f,nativeGetOwnPropertyNames$1=objectGetOwnPropertyNamesExternal.f,nativePropertyIsEnumerable$1=objectPropertyIsEnumerable.f,AllSymbols=shared("symbols"),ObjectPrototypeSymbols=shared("op-symbols"),StringToSymbolRegistry=shared("string-to-symbol-registry"),SymbolToStringRegistry=shared("symbol-to-string-registry"),WellKnownSymbolsStore$1=shared("wks"),QObject=global_1.QObject,USE_SETTER=!QObject||!QObject[PROTOTYPE$1]||!QObject[PROTOTYPE$1].findChild,setSymbolDescriptor=descriptors&&fails((function(){return 7!=objectCreate(nativeDefineProperty$1({},"a",{get:function(){return nativeDefineProperty$1(this,"a",{value:7}).a}})).a}))?function(e,t,r){var n=nativeGetOwnPropertyDescriptor$1(ObjectPrototype,t);n&&delete ObjectPrototype[t],nativeDefineProperty$1(e,t,r),n&&e!==ObjectPrototype&&nativeDefineProperty$1(ObjectPrototype,t,n)}:nativeDefineProperty$1,wrap=function(e,t){var r=AllSymbols[e]=objectCreate($Symbol[PROTOTYPE$1]);return setInternalState$2(r,{type:SYMBOL,tag:e,description:t}),descriptors||(r.description=t),r},isSymbol=useSymbolAsUid?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof $Symbol},$defineProperty=function(e,t,r){e===ObjectPrototype&&$defineProperty(ObjectPrototypeSymbols,t,r),anObject(e);var n=toPrimitive(t,!0);return anObject(r),has(AllSymbols,n)?(r.enumerable?(has(e,HIDDEN)&&e[HIDDEN][n]&&(e[HIDDEN][n]=!1),r=objectCreate(r,{enumerable:createPropertyDescriptor(0,!1)})):(has(e,HIDDEN)||nativeDefineProperty$1(e,HIDDEN,createPropertyDescriptor(1,{})),e[HIDDEN][n]=!0),setSymbolDescriptor(e,n,r)):nativeDefineProperty$1(e,n,r)},$defineProperties=function(e,t){anObject(e);var r=toIndexedObject(t),n=objectKeys(r).concat($getOwnPropertySymbols(r));return $forEach(n,(function(t){descriptors&&!$propertyIsEnumerable.call(r,t)||$defineProperty(e,t,r[t])})),e},$create=function(e,t){return void 0===t?objectCreate(e):$defineProperties(objectCreate(e),t)},$propertyIsEnumerable=function(e){var t=toPrimitive(e,!0),r=nativePropertyIsEnumerable$1.call(this,t);return!(this===ObjectPrototype&&has(AllSymbols,t)&&!has(ObjectPrototypeSymbols,t))&&(!(r||!has(this,t)||!has(AllSymbols,t)||has(this,HIDDEN)&&this[HIDDEN][t])||r)},$getOwnPropertyDescriptor=function(e,t){var r=toIndexedObject(e),n=toPrimitive(t,!0);if(r!==ObjectPrototype||!has(AllSymbols,n)||has(ObjectPrototypeSymbols,n)){var o=nativeGetOwnPropertyDescriptor$1(r,n);return!o||!has(AllSymbols,n)||has(r,HIDDEN)&&r[HIDDEN][n]||(o.enumerable=!0),o}},$getOwnPropertyNames=function(e){var t=nativeGetOwnPropertyNames$1(toIndexedObject(e)),r=[];return $forEach(t,(function(e){has(AllSymbols,e)||has(hiddenKeys,e)||r.push(e)})),r},$getOwnPropertySymbols=function(e){var t=e===ObjectPrototype,r=nativeGetOwnPropertyNames$1(t?ObjectPrototypeSymbols:toIndexedObject(e)),n=[];return $forEach(r,(function(e){!has(AllSymbols,e)||t&&!has(ObjectPrototype,e)||n.push(AllSymbols[e])})),n};if(nativeSymbol||($Symbol=function(){if(this instanceof $Symbol)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=uid(e),r=function(e){this===ObjectPrototype&&r.call(ObjectPrototypeSymbols,e),has(this,HIDDEN)&&has(this[HIDDEN],t)&&(this[HIDDEN][t]=!1),setSymbolDescriptor(this,t,createPropertyDescriptor(1,e))};return descriptors&&USE_SETTER&&setSymbolDescriptor(ObjectPrototype,t,{configurable:!0,set:r}),wrap(t,e)},redefine($Symbol[PROTOTYPE$1],"toString",(function(){return getInternalState$1(this).tag})),redefine($Symbol,"withoutSetter",(function(e){return wrap(uid(e),e)})),objectPropertyIsEnumerable.f=$propertyIsEnumerable,objectDefineProperty.f=$defineProperty,objectGetOwnPropertyDescriptor.f=$getOwnPropertyDescriptor,objectGetOwnPropertyNames.f=objectGetOwnPropertyNamesExternal.f=$getOwnPropertyNames,objectGetOwnPropertySymbols.f=$getOwnPropertySymbols,wellKnownSymbolWrapped.f=function(e){return wrap(wellKnownSymbol(e),e)},descriptors&&(nativeDefineProperty$1($Symbol[PROTOTYPE$1],"description",{configurable:!0,get:function(){return getInternalState$1(this).description}}),redefine(ObjectPrototype,"propertyIsEnumerable",$propertyIsEnumerable,{unsafe:!0}))),_export({global:!0,wrap:!0,forced:!nativeSymbol,sham:!nativeSymbol},{Symbol:$Symbol}),$forEach(objectKeys(WellKnownSymbolsStore$1),(function(e){defineWellKnownSymbol(e)})),_export({target:SYMBOL,stat:!0,forced:!nativeSymbol},{for:function(e){var t=String(e);if(has(StringToSymbolRegistry,t))return StringToSymbolRegistry[t];var r=$Symbol(t);return StringToSymbolRegistry[t]=r,SymbolToStringRegistry[r]=t,r},keyFor:function(e){if(!isSymbol(e))throw TypeError(e+" is not a symbol");if(has(SymbolToStringRegistry,e))return SymbolToStringRegistry[e]},useSetter:function(){USE_SETTER=!0},useSimple:function(){USE_SETTER=!1}}),_export({target:"Object",stat:!0,forced:!nativeSymbol,sham:!descriptors},{create:$create,defineProperty:$defineProperty,defineProperties:$defineProperties,getOwnPropertyDescriptor:$getOwnPropertyDescriptor}),_export({target:"Object",stat:!0,forced:!nativeSymbol},{getOwnPropertyNames:$getOwnPropertyNames,getOwnPropertySymbols:$getOwnPropertySymbols}),_export({target:"Object",stat:!0,forced:fails((function(){objectGetOwnPropertySymbols.f(1)}))},{getOwnPropertySymbols:function(e){return objectGetOwnPropertySymbols.f(toObject(e))}}),$stringify){var FORCED_JSON_STRINGIFY=!nativeSymbol||fails((function(){var e=$Symbol();return"[null]"!=$stringify([e])||"{}"!=$stringify({a:e})||"{}"!=$stringify(Object(e))}));_export({target:"JSON",stat:!0,forced:FORCED_JSON_STRINGIFY},{stringify:function(e,t,r){for(var n,o=[e],i=1;arguments.length>i;)o.push(arguments[i++]);if(n=t,(isObject(t)||void 0!==e)&&!isSymbol(e))return isArray(t)||(t=function(e,t){if("function"==typeof n&&(t=n.call(this,e,t)),!isSymbol(t))return t}),o[1]=t,$stringify.apply(null,o)}})}$Symbol[PROTOTYPE$1][TO_PRIMITIVE]||createNonEnumerableProperty($Symbol[PROTOTYPE$1],TO_PRIMITIVE,$Symbol[PROTOTYPE$1].valueOf),setToStringTag($Symbol,SYMBOL),hiddenKeys[HIDDEN]=!0;var defineProperty$5=objectDefineProperty.f,NativeSymbol=global_1.Symbol;if(descriptors&&"function"==typeof NativeSymbol&&(!("description"in NativeSymbol.prototype)||void 0!==NativeSymbol().description)){var EmptyStringDescriptionStore={},SymbolWrapper=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof SymbolWrapper?new NativeSymbol(e):void 0===e?NativeSymbol():NativeSymbol(e);return""===e&&(EmptyStringDescriptionStore[t]=!0),t};copyConstructorProperties(SymbolWrapper,NativeSymbol);var symbolPrototype=SymbolWrapper.prototype=NativeSymbol.prototype;symbolPrototype.constructor=SymbolWrapper;var symbolToString=symbolPrototype.toString,native="Symbol(test)"==String(NativeSymbol("test")),regexp=/^Symbol\((.*)\)[^)]+$/;defineProperty$5(symbolPrototype,"description",{configurable:!0,get:function(){var e=isObject(this)?this.valueOf():this,t=symbolToString.call(e);if(has(EmptyStringDescriptionStore,e))return"";var r=native?t.slice(7,-1):t.replace(regexp,"$1");return""===r?void 0:r}}),_export({global:!0,forced:!0},{Symbol:SymbolWrapper})}defineWellKnownSymbol("iterator");var correctPrototypeGetter=!fails((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),IE_PROTO$1=sharedKey("IE_PROTO"),ObjectPrototype$1=Object.prototype,objectGetPrototypeOf=correctPrototypeGetter?Object.getPrototypeOf:function(e){return e=toObject(e),has(e,IE_PROTO$1)?e[IE_PROTO$1]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?ObjectPrototype$1:null},ITERATOR$3=wellKnownSymbol("iterator"),BUGGY_SAFARI_ITERATORS=!1,returnThis=function(){return this},IteratorPrototype,PrototypeOfArrayIteratorPrototype,arrayIterator;[].keys&&(arrayIterator=[].keys(),"next"in arrayIterator?(PrototypeOfArrayIteratorPrototype=objectGetPrototypeOf(objectGetPrototypeOf(arrayIterator)),PrototypeOfArrayIteratorPrototype!==Object.prototype&&(IteratorPrototype=PrototypeOfArrayIteratorPrototype)):BUGGY_SAFARI_ITERATORS=!0),null==IteratorPrototype&&(IteratorPrototype={}),has(IteratorPrototype,ITERATOR$3)||createNonEnumerableProperty(IteratorPrototype,ITERATOR$3,returnThis);var iteratorsCore={IteratorPrototype:IteratorPrototype,BUGGY_SAFARI_ITERATORS:BUGGY_SAFARI_ITERATORS},IteratorPrototype$1=iteratorsCore.IteratorPrototype,returnThis$1=function(){return this},createIteratorConstructor=function(e,t,r){var n=t+" Iterator";return e.prototype=objectCreate(IteratorPrototype$1,{next:createPropertyDescriptor(1,r)}),setToStringTag(e,n,!1),iterators[n]=returnThis$1,e},IteratorPrototype$2=iteratorsCore.IteratorPrototype,BUGGY_SAFARI_ITERATORS$1=iteratorsCore.BUGGY_SAFARI_ITERATORS,ITERATOR$4=wellKnownSymbol("iterator"),KEYS="keys",VALUES="values",ENTRIES="entries",returnThis$2=function(){return this},defineIterator=function(e,t,r,n,o,i,a){createIteratorConstructor(r,t,n);var s,c,u,l=function(e){if(e===o&&y)return y;if(!BUGGY_SAFARI_ITERATORS$1&&e in d)return d[e];switch(e){case KEYS:case VALUES:case ENTRIES:return function(){return new r(this,e)}}return function(){return new r(this)}},p=t+" Iterator",f=!1,d=e.prototype,h=d[ITERATOR$4]||d["@@iterator"]||o&&d[o],y=!BUGGY_SAFARI_ITERATORS$1&&h||l(o),g="Array"==t&&d.entries||h;if(g&&(s=objectGetPrototypeOf(g.call(new e)),IteratorPrototype$2!==Object.prototype&&s.next&&(objectGetPrototypeOf(s)!==IteratorPrototype$2&&(objectSetPrototypeOf?objectSetPrototypeOf(s,IteratorPrototype$2):"function"!=typeof s[ITERATOR$4]&&createNonEnumerableProperty(s,ITERATOR$4,returnThis$2)),setToStringTag(s,p,!0))),o==VALUES&&h&&h.name!==VALUES&&(f=!0,y=function(){return h.call(this)}),d[ITERATOR$4]!==y&&createNonEnumerableProperty(d,ITERATOR$4,y),iterators[t]=y,o)if(c={values:l(VALUES),keys:i?y:l(KEYS),entries:l(ENTRIES)},a)for(u in c)!BUGGY_SAFARI_ITERATORS$1&&!f&&u in d||redefine(d,u,c[u]);else _export({target:t,proto:!0,forced:BUGGY_SAFARI_ITERATORS$1||f},c);return c},ARRAY_ITERATOR="Array Iterator",setInternalState$3=internalState.set,getInternalState$2=internalState.getterFor(ARRAY_ITERATOR),es_array_iterator=defineIterator(Array,"Array",(function(e,t){setInternalState$3(this,{type:ARRAY_ITERATOR,target:toIndexedObject(e),index:0,kind:t})}),(function(){var e=getInternalState$2(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}}),"values");iterators.Arguments=iterators.Array,addToUnscopables("keys"),addToUnscopables("values"),addToUnscopables("entries");var defineProperty$6=objectDefineProperty.f,FunctionPrototype=Function.prototype,FunctionPrototypeToString=FunctionPrototype.toString,nameRE=/^\s*function ([^ (]*)/,NAME="name";!descriptors||NAME in FunctionPrototype||defineProperty$6(FunctionPrototype,NAME,{configurable:!0,get:function(){try{return FunctionPrototypeToString.call(this).match(nameRE)[1]}catch(e){return""}}});var charAt$1=stringMultibyte.charAt,STRING_ITERATOR="String Iterator",setInternalState$4=internalState.set,getInternalState$3=internalState.getterFor(STRING_ITERATOR);defineIterator(String,"String",(function(e){setInternalState$4(this,{type:STRING_ITERATOR,string:String(e),index:0})}),(function(){var e,t=getInternalState$3(this),r=t.string,n=t.index;return n>=r.length?{value:void 0,done:!0}:(e=charAt$1(r,n),t.index+=e.length,{value:e,done:!1})}));var domIterables={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},ITERATOR$5=wellKnownSymbol("iterator"),TO_STRING_TAG$3=wellKnownSymbol("toStringTag"),ArrayValues=es_array_iterator.values;for(var COLLECTION_NAME in domIterables){var Collection=global_1[COLLECTION_NAME],CollectionPrototype=Collection&&Collection.prototype;if(CollectionPrototype){if(CollectionPrototype[ITERATOR$5]!==ArrayValues)try{createNonEnumerableProperty(CollectionPrototype,ITERATOR$5,ArrayValues)}catch(e){CollectionPrototype[ITERATOR$5]=ArrayValues}if(CollectionPrototype[TO_STRING_TAG$3]||createNonEnumerableProperty(CollectionPrototype,TO_STRING_TAG$3,COLLECTION_NAME),domIterables[COLLECTION_NAME])for(var METHOD_NAME in es_array_iterator)if(CollectionPrototype[METHOD_NAME]!==es_array_iterator[METHOD_NAME])try{createNonEnumerableProperty(CollectionPrototype,METHOD_NAME,es_array_iterator[METHOD_NAME])}catch(e){CollectionPrototype[METHOD_NAME]=es_array_iterator[METHOD_NAME]}}}var slice=[].slice,MSIE=/MSIE .\./.test(engineUserAgent),wrap$1=function(e){return function(t,r){var n=arguments.length>2,o=n?slice.call(arguments,2):void 0;return e(n?function(){("function"==typeof t?t:Function(t)).apply(this,o)}:t,r)}};_export({global:!0,bind:!0,forced:MSIE},{setTimeout:wrap$1(global_1.setTimeout),setInterval:wrap$1(global_1.setInterval)});var IndexedDB=function(){function e(t){var r=t.dbname,n=void 0===r?"":r,o=t.onupgradeneeded,i=void 0===o?void 0:o,a=t.version,s=void 0===a?1:a;_classCallCheck(this,e),this.dbname=n,this.version=s,this.onupgradeneeded=i,this.init()}return _createClass(e,[{key:"init",value:function(){var e=this;if(!("indexedDB"in window))throw this.error="当前环境不支持 indexedDB",Error(this.error);return new Promise((function(t,r){e.DBRequestLink=window.indexedDB.open(e.dbname,e.version),e.DBRequestLink.onsuccess=function(r){e.DBInstance=r.target.result,e.isReady=!0,t(r)},e.DBRequestLink.onerror=function(t){console.error("indexedDB open error",t),e.error=t,r(t)},e.DBRequestLink.onupgradeneeded=e.onupgradeneeded}))}},{key:"initReady",value:function(){var e=this;return this.isReady?Promise.resolve(this.DBInstance):this.error?Promise.reject(this.error):new Promise((function(t,r){var n=0,o=setInterval((function(){e.isReady||n>=50?(clearInterval(o),e.isReady?t(e.DBInstance):r("IndexedDB init time out")):e.error&&(r(e.error),clearInterval(o)),n++}),300)}))}}]),e}();function get$1(e,t){return new Promise((function(r,n){var o=e[t?"get":"getAll"](t);o.onsuccess=function(e){r(e.target.result)},o.onerror=function(e){n(e)}}))}function put(e,t){return new Promise((function(r,n){var o=e.put(t);o.onsuccess=function(e){r(e)},o.onerror=function(e){n(e)}}))}var SSDPDtgw=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"test";_classCallCheck(this,e),this.env=t,this.url=getConstant("ssdp.dtgw.".concat(this.getEnv()))}return _createClass(e,[{key:"request",value:function(e){var t=e.code,r=e.data,n=e.headers,o=e.responseType,i=void 0===o?"json":o,a=e.timeout,s=e.method,c=void 0===s?"post":s,u=e.params,l=e.onUploadProgress,p=e.onDownloadProgress;return request({url:this.url,data:r,method:c,params:u,headers:Object.assign(Object.assign({"s-crc-ds-codes":t},this.getRunworkStaticKeys()),n),timeout:a,onUploadProgress:l,onDownloadProgress:p,responseType:i})}},{key:"getRunworkStaticKeys",value:function(){return getConstant("ssdp.dtgw.runwork.".concat(this.env))}},{key:"getEnv",value:function(){switch(this.env){case"production":return"production";default:return"test"}}},{key:"generateUrlParam",value:function(e){return""}}]),e}(),FAILS_ON_PRIMITIVES=fails((function(){objectKeys(1)}));_export({target:"Object",stat:!0,forced:FAILS_ON_PRIMITIVES},{keys:function(e){return objectKeys(toObject(e))}});var SSDPCls=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"sit",r=arguments.length>1?arguments[1]:void 0;_classCallCheck(this,e),this.url=getConstant("ssdp.cls.".concat("production"===t?"production":"test")),this.env=t,this.commonParam=r?Object.assign({},r):Object.assign({},getConstant("ssdp.cls.runwork.".concat(this.env)))}return _createClass(e,[{key:"request",value:function(e){var t=e.api,r=void 0===t?"":t,n=e.version,o=void 0===n?"":n,i=e.data,a=void 0===i?"":i,s=e.params,c=void 0===s?{}:s,u=e.headers,l=void 0===u?{}:u,p=e.method,f=void 0===p?"GET":p;return request({url:"".concat(this.url,"?ssdp=").concat(this.generateUrlParam(Object.assign({Api_ID:r,Api_Version:o,Sign:"NO_SIGN",User_Token:"null",Time_Stamp:getTimeStamp()},this.commonParam))),method:f,params:c,headers:Object.assign({},l),data:a})}},{key:"generateUrlParam",value:function(e){return base64.encode(Object.keys(e).map((function(t){return"".concat(t,"=").concat(e[t])})).join("&"))}},{key:"setSysOption",value:function(e){var t=e.App_Sub_ID,r=e.App_Token,n=e.Partner_ID,o=e.Sys_ID;this.App_Sub_ID=t,this.App_Token=r,this.Partner_ID=n,this.Sys_ID=o}}]),e}(),Factory=function e(){_classCallCheck(this,e)};function getIndexedDB(){return Factory.indexedDB?Factory.indexedDB:(console.info("实例化 indexedDB"),Factory.indexedDB=new IndexedDB({dbname:getConstant("cacheKeys.indexeddb.name"),version:getConstant("cacheKeys.indexeddb.version"),onupgradeneeded:function(e){console.info("indexedDB onupgradeneeded");var t=e.target.result,r=getConstant("h5DB"),n=!0,o=!1,i=void 0;try{for(var a,s=r[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var c=a.value,u=c.name,l=c.store,p=c.index;t.objectStoreNames.contains(u)&&t.deleteObjectStore(u);var f=t.createObjectStore(u,l),d=!0,h=!1,y=void 0;try{for(var g,v=p[Symbol.iterator]();!(d=(g=v.next()).done);d=!0){var b=g.value;f.createIndex(b,b)}}catch(e){h=!0,y=e}finally{try{d||null==v.return||v.return()}finally{if(h)throw y}}}}catch(e){o=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(o)throw i}}}}),Factory.indexedDB)}function getSsdpCls(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"sit";return Factory.ssdpCls||(Factory.ssdpCls=new SSDPCls(e)),Factory.ssdpCls}function getSsdpDtgw(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"test";return Factory.ssdpDtgw||(Factory.ssdpDtgw=new SSDPDtgw(e)),Factory.ssdpDtgw}Factory.getIndexedDB=getIndexedDB,Factory.getSsdpCls=getSsdpCls,Factory.getSsdpDtgw=getSsdpDtgw;var SSDPApp=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"test",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];_classCallCheck(this,e),this.CacheDBKey=getConstant("cacheKeys.indexeddb.store.postToken"),this.isLogin=!1,this.config=new SSDPConfigMode(t),this.isLogin=n,this.url=getConstant("ssdp.app.".concat(r)),this.env=r,this.CacheStoreKey="PostToken_".concat(this.env)}return _createClass(e,[{key:"init",value:function(){return __awaiter(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAccessToken();case 2:this.postToken=e.sent;case 3:case"end":return e.stop()}}),e,this)})))}},{key:"getPostToken",value:function(){return this.postToken}},{key:"request",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return __awaiter(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,o,i,a,s,c,u,l,p,f,d,h,y,g,v,b,S,m,E,_,T,O;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n=e.api,o=void 0===n?"":n,i=e.version,a=void 0===i?"1.0":i,s=e.data,c=void 0===s?"":s,u=e.params,l=void 0===u?{}:u,p=e.headers,f=void 0===p?{}:p,d=e.isFormatData,h=void 0===d||d,y=e.type,g=void 0===y?"rs":y,v=e.method,b=void 0===v?"POST":v,S=e.uri,"get"===b.toLowerCase()&&(m=this.getApiAttrs(o,a)),r.next=4,request(Object.assign(Object.assign({},e),{url:"".concat(this.url.replace("",g)).concat(S||"","?ssdp=").concat(this.generateUrlParam("post"===b.toLowerCase()?{Api_ID:o,Api_Version:a,App_Sub_ID:this.config.App_Sub_ID}:Object.assign(Object.assign({},m),{Sign:generateSysSign(Object.assign(Object.assign({},m),{REQUEST_DATA:c}))}))),params:l,method:b,headers:Object.assign({},f),data:"post"===b.toLowerCase()?this.generateCommonParam(o,a,c):void 0}));case 4:if(E=r.sent,!1!==h){r.next=7;break}return r.abrupt("return",E);case 7:if(_=E.data.RESPONSE,T=_.RETURN_CODE,O=_.RETURN_DESC,!((["E0MI0006","E0MI0003"].includes(T)||"string"==typeof O&&~O.toLocaleLowerCase().indexOf("app_token"))&&t<=3)){r.next=13;break}return r.next=11,this.getAccessTokenByPost();case 11:return this.postToken=r.sent,r.abrupt("return",this.request({api:o,version:a,data:c,headers:f},++t));case 13:return r.abrupt("return",E);case 14:case"end":return r.stop()}}),r,this)})))}},{key:"generateCommonParam",value:function(e,t,r,n){var o=this.getApiAttrs(e,t,n);if(o=Object.assign(Object.assign({},o),{Sign:generateSysSign(Object.assign(Object.assign({},o),{REQUEST_DATA:r,App_key:this.config.App_key}))}),this.isLogin&&"crc.ssdp.public.apptoken"!==o.Api_ID){var i=r.BUS_DATA;(i=JSON.parse(base64.decode(i))).appToken=o.App_Token,r={BUS_DATA:base64.encode(JSON.stringify(i))}}return JSON.stringify({REQUEST:{REQUEST_DATA:r,API_ATTRS:o}})}},{key:"getApiAttrs",value:function(e,t,r){return Object.assign(Object.assign({},this.config),{App_key:void 0,App_Token:r||this.postToken,Time_Stamp:getTimeStamp(),Api_ID:e,Api_Version:t})}},{key:"generateUrlParam",value:function(e){var t=[];for(var r in e){var n=e[r];n&&t.push("".concat(r,"=").concat(n))}return base64.encode(t.join("&"))}},{key:"getAccessToken",value:function(){return __awaiter(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getAccessTokenByCache();case 2:if(!(t=e.sent)){e.next=5;break}return e.abrupt("return",Promise.resolve(t));case 5:return e.abrupt("return",this.getAccessTokenByPost());case 6:case"end":return e.stop()}}),e,this)})))}},{key:"getAccessTokenByPost",value:function(){return __awaiter(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r,n,o,i,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,request({url:this.generateUrlByAccessToken(),data:this.generateCommonParam("crc.ssdp.public.apptoken","1.0",{App_Type:"",App_key:this.config.App_key,Remarks:"",Scope:""},this.config.App_Token)});case 2:if(t=e.sent,r=t.data,n=r.RESPONSE,o=n.RETURN_DATA,"S"===(i=n.RETURN_CODE).charAt(0)||"MS000A000"===i){e.next=7;break}return e.abrupt("return",Promise.reject(r.RESPONSE));case 7:if(a=o.App_Token,s=o.Token_Expires,!this.isLogin){e.next=10;break}return e.abrupt("return",a);case 10:return this.setPostTokenCache({token:a,expires:(new Date).getTime()+1e3*s}),e.abrupt("return",a);case 12:case"end":return e.stop()}}),e,this)})))}},{key:"getAccessTokenByCache",value:function(){var t=this;if(this.isLogin)return Promise.resolve();if(!e.isIndexedDB){var r=localStorage.getItem(this.CacheDBKey),n="string"==typeof r?JSON.parse(r):void 0;return void 0!==r&&this.checkPostTokenExpires(n.expires)?n.value:void 0}return Factory.getIndexedDB().initReady().then((function(e){return get$1(e.transaction(t.CacheDBKey,"readwrite").objectStore(t.CacheDBKey),t.CacheStoreKey)})).then((function(e){var r=e||{},n=r.token,o=r.expires;return Promise.resolve(n&&t.checkPostTokenExpires(o)?n:void 0)})).catch((function(e){return logger(["getAccessTokenByCache",e],"warn"),Promise.resolve()}))}},{key:"setPostTokenCache",value:function(t){var r=this,n=t.expires,o=t.token;e.isIndexedDB?Factory.getIndexedDB().initReady().then((function(e){return put(e.transaction(r.CacheDBKey,"readwrite").objectStore(r.CacheDBKey),{id:r.CacheStoreKey,token:o,expires:n})})).catch((function(e){logger(["更新IndexedDB【setPostToken】失败",e],"warn")})):localStorage.setItem(this.CacheDBKey,JSON.stringify({expires:n,value:o}))}},{key:"checkPostTokenExpires",value:function(e){return e-(new Date).getTime()>3e5}},{key:"generateUrlByAccessToken",value:function(){var e=getConstant("ssdp.api.production.ssdpPostToken"),t=e.api,r=e.version;return"".concat(this.url.replace("","rs"),"?ssdp=").concat(this.generateUrlParam({Api_ID:t,Api_Version:r,App_Sub_ID:this.config.App_Sub_ID}))}},{key:"setUserToken",value:function(e){this.config.User_Token=e}}]),e}();SSDPApp.isIndexedDB="indexedDB"in window;var $findIndex=arrayIteration.findIndex,FIND_INDEX="findIndex",SKIPS_HOLES=!0,USES_TO_LENGTH$5=arrayMethodUsesToLength(FIND_INDEX);FIND_INDEX in[]&&Array(1)[FIND_INDEX]((function(){SKIPS_HOLES=!1})),_export({target:"Array",proto:!0,forced:SKIPS_HOLES||!USES_TO_LENGTH$5},{findIndex:function(e){return $findIndex(this,e,arguments.length>1?arguments[1]:void 0)}}),addToUnscopables(FIND_INDEX);var HAS_SPECIES_SUPPORT$1=arrayMethodHasSpeciesSupport("slice"),USES_TO_LENGTH$6=arrayMethodUsesToLength("slice",{ACCESSORS:!0,0:0,1:2}),SPECIES$6=wellKnownSymbol("species"),nativeSlice=[].slice,max$2=Math.max;_export({target:"Array",proto:!0,forced:!HAS_SPECIES_SUPPORT$1||!USES_TO_LENGTH$6},{slice:function(e,t){var r,n,o,i=toIndexedObject(this),a=toLength(i.length),s=toAbsoluteIndex(e,a),c=toAbsoluteIndex(void 0===t?a:t,a);if(isArray(i)&&("function"!=typeof(r=i.constructor)||r!==Array&&!isArray(r.prototype)?isObject(r)&&null===(r=r[SPECIES$6])&&(r=void 0):r=void 0,r===Array||void 0===r))return nativeSlice.call(i,s,c);for(n=new(void 0===r?Array:r)(max$2(c-s,0)),o=0;s1?arguments[1]:void 0)}});var RunworkH5Mode=function e(t){var r=t.isLocal,n=void 0!==r&&r,o=t.devUser,i=t.env,a=void 0===i?"sit":i,s=t.jsApiList,c=void 0===s?[]:s,u=t.log,l=void 0!==u&&u,p=t.appId,f=t.appSecret,d=t.isLogin,h=void 0!==d&&d,y=t.isHrInfo,g=void 0===y||y,v=t.isAvatar,b=void 0!==v&&v,S=t.isPrivate,m=void 0!==S&&S,E=t.isHrInfoCache,_=void 0===E||E;_classCallCheck(this,e),this.env="sit",this.jsApiList=[],this.domain=["https://runwork-h5.crc.com.cn","https://runwork-h5-uat.crc.com.cn"],this.isLocal=n,this.devUser=o,this.env=a,RunWorkH5.env=this.env,this.log=l,this.appId=p,this.appSecret=f,this.isLogin=h,this.isHrInfo=g,this.isAvatar=b,this.isPrivate=m,this.isHrInfoCache=_,this.jsApiList=["device.base.getSystemInfo","biz.user.getUserInfoEx","biz.util.openDocument","biz.user.getUserInfo"].concat(c)};function getTenantAccessToken(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";return __awaiter(this,void 0,void 0,regeneratorRuntime.mark((function o(){var i,a,s,c,u,l,p,f,d,h,y;return regeneratorRuntime.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(i="".concat(getConstant("cacheKeys.localStorage.feishu.tenantAccessToken"),"_").concat(e),!0===r&&(logger("清空【TenantAccessToken】缓存"),localStorage.setItem(i,"")),a=localStorage.getItem(i),s=a?JSON.parse(a):void 0,!((c="object"===_typeof(s)?s.expire-(new Date).getTime():-1)>9e4)){o.next=8;break}return logger(["从缓存获取【TenantAccessToken】",c]),o.abrupt("return",s.value);case 8:return u=getConstant("ssdp.api.".concat(RunWorkH5.env,".gettoken")),l=u.api,p=u.version,console.info("TenantAccessToken",n,n||(RunWorkH5.isPrivate?"2.0":p)),o.next=12,RunWorkH5.ssdpCls.request({method:"POST",api:l,version:n||(RunWorkH5.isPrivate?"2.0":p),headers:{"Access-Control-Expose-Headers":"RETURN_CODE"},data:JSON.stringify({app_id:e,app_secret:t})});case 12:return f=o.sent,d=f.data,f.headers,h=d.tenant_access_token,d.code,d.msg,y=d.expire,localStorage.setItem(i,JSON.stringify({expire:(new Date).getTime()+1e3*y,value:h})),o.abrupt("return",h);case 18:case"end":return o.stop()}}),o)})))}function getTicket(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";return __awaiter(this,void 0,void 0,regeneratorRuntime.mark((function o(){var i,a,s,c,u,l,p,f,d,h,y,g;return regeneratorRuntime.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(i="".concat(getConstant("cacheKeys.localStorage.feishu.ticket"),"_").concat(e),!0===r&&(logger("清空【Ticket】缓存"),localStorage.setItem(i,"")),a=localStorage.getItem(i),s=a?JSON.parse(a):void 0,!((c="object"===_typeof(s)?s.expire-(new Date).getTime():-1)>9e4)){o.next=8;break}return logger(["从缓存获取【Ticket】",c,s.value]),o.abrupt("return",s.value);case 8:return u=getConstant("ssdp.api.".concat(RunWorkH5.env,".ticket")),l=u.api,p=u.version,o.next=11,RunWorkH5.ssdpCls.request({method:"POST",api:l,version:n||(RunWorkH5.isPrivate?"2.0":p),headers:{Authorization:"Bearer ".concat(t)},data:JSON.stringify({})});case 11:if(f=o.sent,d=f.data){o.next=15;break}return o.abrupt("return",Promise.reject("get ticket error"));case 15:return d.code,d.msg,h=d.data,y=h.ticket,g=h.expire_in,localStorage.setItem(i,JSON.stringify({expire:(new Date).getTime()+1e3*g,value:y})),o.abrupt("return",y);case 19:case"end":return o.stop()}}),o)})))}var sameValue=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t};fixRegexpWellKnownSymbolLogic("search",1,(function(e,t,r){return[function(t){var r=requireObjectCoercible(this),n=null==t?void 0:t[e];return void 0!==n?n.call(t,r):new RegExp(t)[e](String(r))},function(e){var n=r(t,e,this);if(n.done)return n.value;var o=anObject(e),i=String(this),a=o.lastIndex;sameValue(a,0)||(o.lastIndex=0);var s=regexpExecAbstract(o,i);return sameValue(o.lastIndex,a)||(o.lastIndex=a),null===s?-1:s.index}]}));var sha1=createCommonjsModule((function(module){ +/* + * [js-sha1]{@link https://github.com/emn178/js-sha1} + * + * @version 0.6.0 + * @author Chen, Yi-Cyuan [emn178@gmail.com] + * @copyright Chen, Yi-Cyuan 2014-2017 + * @license MIT + */ +!function(){var root="object"==typeof window?window:{},NODE_JS=!root.JS_SHA1_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;NODE_JS&&(root=commonjsGlobal);var COMMON_JS=!root.JS_SHA1_NO_COMMON_JS&&module.exports,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[],createOutputMethod=function(e){return function(t){return new Sha1(!0).update(t)[e]()}},createMethod=function(){var e=createOutputMethod("hex");NODE_JS&&(e=nodeWrap(e)),e.create=function(){return new Sha1},e.update=function(t){return e.create().update(t)};for(var t=0;t>2]|=e[o]<>2]|=r<>2]|=(192|r>>6)<>2]|=(128|63&r)<=57344?(a[n>>2]|=(224|r>>12)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<>2]|=(240|r>>18)<>2]|=(128|r>>12&63)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<=64?(this.block=a[16],this.start=n-64,this.hash(),this.hashed=!0):this.start=n}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha1.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>2]|=EXTRA[3&t],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},Sha1.prototype.hash=function(){var e,t,r=this.h0,n=this.h1,o=this.h2,i=this.h3,a=this.h4,s=this.blocks;for(e=16;e<80;++e)t=s[e-3]^s[e-8]^s[e-14]^s[e-16],s[e]=t<<1|t>>>31;for(e=0;e<20;e+=5)r=(t=(n=(t=(o=(t=(i=(t=(a=(t=r<<5|r>>>27)+(n&o|~n&i)+a+1518500249+s[e]<<0)<<5|a>>>27)+(r&(n=n<<30|n>>>2)|~r&o)+i+1518500249+s[e+1]<<0)<<5|i>>>27)+(a&(r=r<<30|r>>>2)|~a&n)+o+1518500249+s[e+2]<<0)<<5|o>>>27)+(i&(a=a<<30|a>>>2)|~i&r)+n+1518500249+s[e+3]<<0)<<5|n>>>27)+(o&(i=i<<30|i>>>2)|~o&a)+r+1518500249+s[e+4]<<0,o=o<<30|o>>>2;for(;e<40;e+=5)r=(t=(n=(t=(o=(t=(i=(t=(a=(t=r<<5|r>>>27)+(n^o^i)+a+1859775393+s[e]<<0)<<5|a>>>27)+(r^(n=n<<30|n>>>2)^o)+i+1859775393+s[e+1]<<0)<<5|i>>>27)+(a^(r=r<<30|r>>>2)^n)+o+1859775393+s[e+2]<<0)<<5|o>>>27)+(i^(a=a<<30|a>>>2)^r)+n+1859775393+s[e+3]<<0)<<5|n>>>27)+(o^(i=i<<30|i>>>2)^a)+r+1859775393+s[e+4]<<0,o=o<<30|o>>>2;for(;e<60;e+=5)r=(t=(n=(t=(o=(t=(i=(t=(a=(t=r<<5|r>>>27)+(n&o|n&i|o&i)+a-1894007588+s[e]<<0)<<5|a>>>27)+(r&(n=n<<30|n>>>2)|r&o|n&o)+i-1894007588+s[e+1]<<0)<<5|i>>>27)+(a&(r=r<<30|r>>>2)|a&n|r&n)+o-1894007588+s[e+2]<<0)<<5|o>>>27)+(i&(a=a<<30|a>>>2)|i&r|a&r)+n-1894007588+s[e+3]<<0)<<5|n>>>27)+(o&(i=i<<30|i>>>2)|o&a|i&a)+r-1894007588+s[e+4]<<0,o=o<<30|o>>>2;for(;e<80;e+=5)r=(t=(n=(t=(o=(t=(i=(t=(a=(t=r<<5|r>>>27)+(n^o^i)+a-899497514+s[e]<<0)<<5|a>>>27)+(r^(n=n<<30|n>>>2)^o)+i-899497514+s[e+1]<<0)<<5|i>>>27)+(a^(r=r<<30|r>>>2)^n)+o-899497514+s[e+2]<<0)<<5|o>>>27)+(i^(a=a<<30|a>>>2)^r)+n-899497514+s[e+3]<<0)<<5|n>>>27)+(o^(i=i<<30|i>>>2)^a)+r-899497514+s[e+4]<<0,o=o<<30|o>>>2;this.h0=this.h0+r<<0,this.h1=this.h1+n<<0,this.h2=this.h2+o<<0,this.h3=this.h3+i<<0,this.h4=this.h4+a<<0},Sha1.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3,o=this.h4;return HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[15&o]},Sha1.prototype.toString=Sha1.prototype.hex,Sha1.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3,o=this.h4;return[e>>24&255,e>>16&255,e>>8&255,255&e,t>>24&255,t>>16&255,t>>8&255,255&t,r>>24&255,r>>16&255,r>>8&255,255&r,n>>24&255,n>>16&255,n>>8&255,255&n,o>>24&255,o>>16&255,o>>8&255,255&o]},Sha1.prototype.array=Sha1.prototype.digest,Sha1.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(20),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),e};var exports=createMethod();COMMON_JS?module.exports=exports:root.sha1=exports}()}));function generateFeishuSignature(e,t,r,n){var o={jsapi_ticket:e,noncestr:t,timestamp:r,url:n||"".concat(location.origin).concat(location.pathname).concat(location.search)},i=Object.keys(o).map((function(e){return"".concat(e,"=").concat(o[e])})).join("&");return logger(["签名参数",i]),sha1(i)}function identity(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"",a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0;return __awaiter(this,void 0,void 0,regeneratorRuntime.mark((function s(){var c,u,l,p,f;return regeneratorRuntime.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return s.prev=0,s.next=3,getTenantAccessToken(e,t,a>0,o);case 3:return c=s.sent,s.next=6,getTicket(e,c,a>0,o);case 6:return u=s.sent,l=(new Date).getTime(),p=base64.encode("".concat(e).concat(l)),f=generateFeishuSignature(u,p,l,i),console.log("signature",f),s.next=13,callFeishuIdentity({appId:e,timestamp:l,nonceStr:p,signature:f,jsApiList:r});case 13:return"function"==typeof n&&n({success:!0}),s.abrupt("return",!0);case 17:if(s.prev=17,s.t0=s.catch(0),!(a<3)){s.next=21;break}return s.abrupt("return",identity(e,t,r,n,o,i,++a));case 21:return"function"==typeof n&&n({success:!1,error:s.t0}),s.abrupt("return",Promise.reject(s.t0));case 23:case"end":return s.stop()}}),s,null,[[0,17]])})))}function callFeishuIdentity(e){return console.info("config",e),new Promise((function(t,r){window.h5sdk.ready((function(){window.h5sdk.config(e).then((function(){console.info("jssdk identity success",e.jsApiList),t(!0)})).catch((function(e){console.error("identity error",e),r(e)}))}))}))}function browseFile(e){var t=e.fileType,r=void 0===t?"":t,n=e.data,o=void 0===n?{}:n,i=e.headers,a=void 0===i?{}:i,s=e.code,c=void 0===s?"":s,u=e.onProgress;return a=Object.assign(Object.assign({"content-type":"application/json;charset=UTF-8","s-crc-ds-codes":c},RunWorkH5.ssdpDtgw.getRunworkStaticKeys()),a),["jpg","jpeg","png","gif"].includes(r.toLowerCase())?RunWorkH5.ssdpDtgw.request({code:c,headers:a,responseType:"blob",onDownloadProgress:u,data:o}).then((function(e){return e})).catch((function(e){return console.error(e),Promise.reject(e)})):openDocument({fileType:r,data:o,headers:a,onDownloadProgress:u})}function openDocument(e){var t=e.fileType,r=e.data,n=void 0===r?{}:r,o=e.headers,i=e.onDownloadProgress;return jssdk("biz.util.openDocument",{method:"POST",fileType:t,body:"object"===_typeof(n)?JSON.stringify(n):n,header:o,url:RunWorkH5.ssdpDtgw.url,onProgress:i}).then((function(){return!0})).catch((function(e){return console.error(e),Promise.reject(e)}))}var sitMockData={user:{open_id:"",external_token:"local",App_Sub_ID:"0000000303DM",App_Token:"6debaf0da23340daaac8659144ebed7a",App_key:"a59eacd0661d4ebb8a2b86aa02d2335f",Partner_ID:"00000000"},sys:{appVersion:"0.0.1",deviceID:"1A283E7B-F167-41E3-8974-493D57B74581",system:"local",platform:"local"}},uatMockData={user:{open_id:"",external_token:"local",App_Sub_ID:"0000000309OK",App_Token:"5643f1d9d86c43c9ae72069c243dbf86",App_key:"52e219166c7c41a68b490ac4efc22fa2",Partner_ID:"00000000"},sys:{appVersion:"1.0.0",deviceID:"1A283E7B-F167-41E3-8974-493D57B74581",system:"local",platform:"local"}},productionMockData={user:{open_id:"",external_token:void 0,App_Sub_ID:"0000000401RH",App_Token:"2bbc84f3bde54df488b4b0133989956c",App_key:"8c33a5babafd4f1197a6880a960ab91b",Partner_ID:"00000000"},sys:{appVersion:"0.0.1",deviceID:"1A283E7B-F167-41E3-8974-493D57B74581",system:"local",platform:"local"}};function mock(e){switch(e){case"sit":return sitMockData;case"uat":return uatMockData;case"production":return productionMockData;default:return{}}}var HrInfoMode=function e(t){var r=t.jobCodeDescr,n=t.fullPath,o=t.businessUnit,i=t.gender,a=t.avatarUrl,s=t.fullDescPath,c=t.deptId,u=t.employeeId,l=t.birthDate,p=t.nameFormal,f=t.join_time,d=t.nameAc,h=t.deptDesc,y=t.userType,g=t.email,v=t.seniorityPayDtMap,b=t.businessUnitDesc,S=t.mobilePhoneNumber,m=t.businessUnitDescShort;_classCallCheck(this,e),this.jobCodeDescr=r,this.fullPath=n,this.businessUnit=o,this.gender=i,this.avatarUrl=a,this.fullDescPath=s,this.deptId=c,this.employeeId=u,this.birthDate=l,this.nameFormal=p,this.join_time=f,this.nameAc=d,this.deptDesc=h,this.userType=y,this.email=g,this.seniorityPayDtMap=v,this.businessUnitDesc=b,this.mobilePhoneNumber=S,this.businessUnitDescShort=m},RunWorkH5=function(e){function t(e){var r;return _classCallCheck(this,t),(r=_possibleConstructorReturn(this,_getPrototypeOf(t).call(this,e))).ready=!1,r.isJssdkReady=!1,r.browseFile=browseFile,t.ssdpCls=Factory.getSsdpCls(t.env),t.ssdpDtgw=Factory.getSsdpDtgw(t.env),t.isPrivate=e.isPrivate,r.ssdpRequestCls=t.ssdpCls.request.bind(t.ssdpCls),r.ssdpRequestDtgw=t.ssdpDtgw.request.bind(t.ssdpDtgw),logger("是否支持IndexedDB:".concat(t.isIndexedDB)),r.init().then((function(e){var t=e.ldap,n=e.hrInfo;logger(["初始化完成",t,n]),r.ready=!0,r.ldap=t,n&&(r.hrInfo=new HrInfoMode(n))})).catch((function(e){r.ready=!1,r.error=e,logger(r.error,"error")})),r}return _inherits(t,e),_createClass(t,[{key:"init",value:function(){return __awaiter(this,void 0,void 0,regeneratorRuntime.mark((function e(){var r,n,o,i,a,s,c,u,l,p,f,d,h,y,g,v,b;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.checkOption()){e.next=2;break}return e.abrupt("return",Promise.reject(this.error));case 2:return e.next=4,this.getBaseInfoByNative();case 4:return r=e.sent,n=_slicedToArray(r,2),o=n[0],i=n[1],logger(["getBaseInfoByNative",o,i],"info"),a=i.App_Sub_ID,s=i.App_Token,c=i.App_key,u=i.Partner_ID,l=i.external_token,p=i.open_id,f=o.appVersion,d=o.deviceID,h=o.system,y=o.platform,this.ssdpApp=new SSDPApp({App_ID:"002601",App_Sub_ID:a,App_Token:s,App_key:c,App_Version:f,Partner_ID:u,Divice_ID:d,Divice_Version:h,OS_Version:y,User_Token:l},t.getEnv(),this.isLogin),e.next=14,this.ssdpApp.init();case 14:if(logger(["ssdpApp 初始化完成"]),!this.isHrInfo||this.isLogin){e.next=20;break}return logger(["获取用户Hr信息"]),e.next=19,this.getHrInfo(p);case 19:g=e.sent;case 20:return this.isLogin&&(v=getConstant("cacheKeys.indexeddb.name"),(b=window.indexedDB.deleteDatabase(v)).onerror=function(e){logger(["删除数据库失败:".concat(v),e],"error")},b.onsuccess=function(){logger("删除数据库完成:".concat(v),"info")}),e.abrupt("return",{ldap:p,hrInfo:g});case 22:case"end":return e.stop()}}),e,this)})))}},{key:"initReady",value:function(){var e=this;return this.ready?Promise.resolve():this.error?Promise.reject(this.error):new Promise((function(t,r){var n=0,o=setInterval((function(){e.error&&(logger(["初始化失败",e.error],"error"),clearInterval(o),r(e.error)),(e.ready||n>=100)&&(logger(["初始化结束",e.ready,e.error]),clearInterval(o),!e.ready&&logger("初始化超时","error"),e.ready?t():r("初始化超时,请稍后重试")),n++}),300)}))}},{key:"jssdkReady",value:function(){return __awaiter(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isJssdkReady){e.next=4;break}return e.abrupt("return",!0);case 4:if(!this.jssdkIdentityError){e.next=7;break}return logger(["jssdk鉴权失败",this.jssdkIdentityError],"error"),e.abrupt("return",Promise.reject(this.jssdkIdentityError));case 7:return e.abrupt("return",new Promise((function(e,r){var n=0,o=setInterval((function(){t.jssdkIdentityError&&(clearInterval(o),r(t.jssdkIdentityError)),(t.isJssdkReady||n>=50)&&(clearInterval(o),logger(["jssdk鉴权结束",t.isJssdkReady]),t.isJssdkReady?e():r("jssdk鉴权超时")),n++}),300)})));case 8:case"end":return e.stop()}}),e,this)})))}},{key:"ssdpRequestApp",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return __awaiter(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,o,i,a,s,c,u,l,p,f,d,h,y,g,v,b,S,m,E,_,T,O;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n=e.api,o=e.version,i=e.data,a=void 0===i?{}:i,s=e.headers,c=e.isFormatData,u=void 0===c||c,l=e.type,p=void 0===l?"rs":l,f=e.method,d=void 0===f?"POST":f,h=e.params,y=void 0===h?{}:h,r.next=3,this.ssdpApp.request(Object.assign(Object.assign({},e),{api:n,version:o,data:a,headers:s,isFormatData:u,method:d,type:p,params:y}));case 3:if(g=r.sent,v=g.data,!1!==u){r.next=7;break}return r.abrupt("return",v);case 7:if(b=v.RESPONSE,S=b.RETURN_CODE,m=b.RETURN_DESC,E=b.RETURN_DATA,!(("E0MI0007"===S||"string"==typeof m&&~m.indexOf("User_Token"))&&t<=3)){r.next=16;break}return r.next=11,this.getUserInfoEx();case 11:return _=r.sent,T=_.external_token,logger(["ssdpRequestApp请求失败,尝试重新请求",S,m,T,t]),this.ssdpApp.setUserToken(T),r.abrupt("return",this.ssdpRequestApp(e,++t));case 16:return O="S"===S.charAt(0)||"MS000A000"===S?"resolve":"reject",r.abrupt("return",Promise[O]({RETURN_CODE:S,RETURN_DESC:m,RETURN_DATA:E}));case 18:case"end":return r.stop()}}),r,this)})))}},{key:"getBaseInfoByNative",value:function(){return __awaiter(this,void 0,void 0,regeneratorRuntime.mark((function e(){var r,n,o,i,a,s,c,u,l=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isLocal){e.next=4;break}return r=mock(t.env),n=r.sys,(o=r.user).open_id=this.devUser,e.abrupt("return",Promise.resolve([n,o]));case 4:if(!this.isLogin){e.next=6;break}return e.abrupt("return",Promise.all([staticJsBridge("device.base.getSystemInfo",{}),staticJsBridge("biz.account.ka_info",{})]));case 6:return e.next=8,this.getBaseInfoByCache();case 8:if(i=e.sent,a=i.sys,s=i.user,c=[],u=!a||!s,logger(["从缓存中获取基础信息",a,s]),logger(["是否启用异步鉴权",!u]),!u){e.next=20;break}return e.next=18,identity(this.appId,this.appSecret,this.jsApiList);case 18:e.next=21;break;case 20:identity(this.appId,this.appSecret,this.jsApiList,(function(e){var t=e.success,r=e.error;l.isJssdkReady=t,l.jssdkIdentityError=r}));case 21:return this.isJssdkReady=!0,c.push(a?Promise.resolve(a):this.getSystemInfo()),c.push(s?Promise.resolve(s):this.getUserInfoEx()),logger(["调用原生获取基本参数",c]),e.abrupt("return",Promise.all(c));case 26:case"end":return e.stop()}}),e,this)})))}},{key:"getSystemInfo",value:function(){return __awaiter(this,void 0,void 0,regeneratorRuntime.mark((function e(){var r,n,o,i,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,jssdk("device.base.getSystemInfo");case 2:if(r=e.sent,t.isIndexedDB){e.next=5;break}return e.abrupt("return",r);case 5:return e.prev=5,e.next=8,Factory.getIndexedDB().initReady();case 8:n=e.sent,o=getConstant("cacheKeys.indexeddb.store.sys"),i=n.transaction(o,"readwrite"),a=i.objectStore(o),logger(["getSystemInfo",r]),put(a,Object.assign(Object.assign({},r),{id:o})),e.next=19;break;case 16:e.prev=16,e.t0=e.catch(5),logger(["更新IndexedDB【sys】失败",e.t0],"warn");case 19:return e.abrupt("return",r);case 20:case"end":return e.stop()}}),e,null,[[5,16]])})))}},{key:"getUserInfoEx",value:function(){return __awaiter(this,void 0,void 0,regeneratorRuntime.mark((function e(){var r,n,o,i,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,jssdk("biz.user.getUserInfoEx");case 2:if(r=e.sent,t.isIndexedDB){e.next=5;break}return e.abrupt("return",r);case 5:return e.prev=5,e.next=8,Factory.getIndexedDB().initReady();case 8:n=e.sent,o=getConstant("cacheKeys.indexeddb.store.user"),i=n.transaction(o,"readwrite"),a=i.objectStore(o),logger(["getUserInfoEx",r]),put(a,Object.assign(Object.assign({},r),{id:o})),e.next=19;break;case 16:e.prev=16,e.t0=e.catch(5),logger(["更新IndexedDB【UserInfoEx】失败",e.t0],"warn");case 19:return e.abrupt("return",r);case 20:case"end":return e.stop()}}),e,null,[[5,16]])})))}},{key:"getBaseInfoByCache",value:function(){return __awaiter(this,void 0,void 0,regeneratorRuntime.mark((function e(){var r,n,o,i,a,s,c,u,l,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.isIndexedDB&&this.domain.includes(location.origin)&&navigator.userAgent.match(/iPhone/i)){e.next=3;break}return logger(["不启用缓存中获取基础信息"],"warn"),e.abrupt("return",Promise.resolve({}));case 3:return e.prev=3,r=getConstant("cacheKeys.indexeddb.store.sys"),n=getConstant("cacheKeys.indexeddb.store.user"),e.next=8,Factory.getIndexedDB().initReady();case 8:return o=e.sent,i=o.transaction([r,n],"readwrite"),a=i.objectStore(r),s=i.objectStore(n),e.next=14,Promise.all([get$1(a,r),get$1(s,n)]);case 14:return c=e.sent,u=_slicedToArray(c,2),l=u[0],p=u[1],e.abrupt("return",{sys:l,user:p});case 21:return e.prev=21,e.t0=e.catch(3),e.abrupt("return",Promise.resolve({}));case 24:case"end":return e.stop()}}),e,this,[[3,21]])})))}},{key:"getHrInfo",value:function(e){return __awaiter(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,o,i,a,s,c,u,l;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getHrInfoByCache(e);case 2:if(logger(["getHrInfoByCache",n=r.sent]),!n){r.next=6;break}return r.abrupt("return",new HrInfoMode(n));case 6:return r.next=8,this.ssdpRequestApp(Object.assign(Object.assign({},getConstant("ssdp.api.".concat(t.env,".hrInfo"))),{data:{BUS_DATA:base64.encode(JSON.stringify({ldap:e,isRequireAvatar:!0===this.isAvatar?"1":"0"}))}}));case 8:if(o=r.sent,i=o.RETURN_DATA,(a=new HrInfoMode(JSON.parse(base64.decode(i)))).employeeId){r.next=13;break}return r.abrupt("return",a);case 13:return r.prev=13,r.next=16,Factory.getIndexedDB().initReady();case 16:s=r.sent,c=getConstant("cacheKeys.indexeddb.store.hrInfo"),u=s.transaction(c,"readwrite"),l=u.objectStore(c),e&&(logger(["更新 HrInfo",a]),put(l,Object.assign(Object.assign({},a),{id:e,expires:(new Date).getTime()+864e5}))),r.next=26;break;case 23:r.prev=23,r.t0=r.catch(13),logger(["更新IndexedDB【hrInfo】失败",r.t0],"warn");case 26:return r.abrupt("return",a);case 27:case"end":return r.stop()}}),r,this,[[13,23]])})))}},{key:"getHrInfoByCache",value:function(e){if(logger(["从缓存中获取Hr信息"]),!t.isIndexedDB||!1===this.isHrInfoCache)return Promise.resolve();var r=getConstant("cacheKeys.indexeddb.store.hrInfo");return logger(["从缓存中获取Hr信息 storeKey",r]),Factory.getIndexedDB().initReady().then((function(t){logger(["从缓存中获取Hr信息 db",t]);var n=t.transaction(r,"readwrite");logger(["从缓存中获取Hr信息 transaction",n]);var o=n.objectStore(r);return logger(["从缓存中获取Hr信息 store",o]),get$1(o,e)})).then((function(e){if(logger(["从缓存中获取Hr信息 res",e]),!e)return Promise.resolve();var t=e.expires-(new Date).getTime();return logger(["HrInfo 缓存有效期",t/1e3/60/60]),Promise.resolve(t>0?e:void 0)})).catch((function(e){return logger(["获取IndexedDB【getHrInfoByCache】失败",e],"warn"),Promise.resolve()}))}},{key:"getAvatarByUserId",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;return __awaiter(this,void 0,void 0,regeneratorRuntime.mark((function n(){var o,i,a,s,c,u,l,p,f,d,h,y,g,v;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.getAvatarByCache(e);case 2:if(o=n.sent,i=o.includes,0!==o.exclusion.length){n.next=7;break}return n.abrupt("return",i);case 7:for(a=Math.ceil(e.length/r),s=[],c=1;c<=a;c++)u=(c-1)*r,s.push(this.ssdpRequestApp(Object.assign(Object.assign({},getConstant("ssdp.api.".concat(t.env,".avatar"))),{data:{BUS_DATA:base64.encode(JSON.stringify({ldap:e.slice(u,u+r)}))}})));return n.next=12,Promise.all(s);case 12:for(l=n.sent,p=[],f=!0,d=!1,h=void 0,n.prev=17,y=l[Symbol.iterator]();!(f=(g=y.next()).done);f=!0)v=g.value,p=p.concat(JSON.parse(base64.decode(v.RETURN_DATA)));n.next=25;break;case 21:n.prev=21,n.t0=n.catch(17),d=!0,h=n.t0;case 25:n.prev=25,n.prev=26,f||null==y.return||y.return();case 28:if(n.prev=28,!d){n.next=31;break}throw h;case 31:return n.finish(28);case 32:return n.finish(25);case 33:return this.addAvatarCache(p),n.abrupt("return",i.concat(p));case 35:case"end":return n.stop()}}),n,this,[[17,21,25,33],[26,,28,32]])})))}},{key:"addAvatarCache",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=getConstant("cacheKeys.indexeddb.store.avatar");Factory.getIndexedDB().initReady().then((function(r){for(var n=r.transaction(t,"readwrite").objectStore(t),o=0;o0&&void 0!==arguments[0]?arguments[0]:[],t=getConstant("cacheKeys.indexeddb.store.avatar");return Factory.getIndexedDB().initReady().then((function(e){return get$1(e.transaction(t,"readwrite").objectStore(t))})).then((function(t){if(!t)return Promise.resolve({exclusion:[]});for(var r=[],n=[],o=function(o){var i=e[o],a=t.findIndex((function(e){return e.id===i})),s=~a?t[a]:void 0;s&&s.expires-(new Date).getTime()>0?r.push({imageUrl:s.imageUrl,account:s.id}):n.push(i)},i=0;i + + + + 单点登录-回填cookie + + + + \ No newline at end of file diff --git a/src/main/resources/crc.properties b/src/main/resources/crc.properties new file mode 100644 index 0000000..74f62f8 --- /dev/null +++ b/src/main/resources/crc.properties @@ -0,0 +1,5 @@ +env=uat +devUser=1 +isLocal=true +appId=xxxxxxxxxxxxxxxx +appSecret=xxxxxxxxxxxxxxxxxxx \ No newline at end of file