"use strict";exports.__esModule=!0,exports.default=startListenNetworkStatus;var _invoker=_interopRequireWildcard(require("./invoker"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(_getRequireWildcardCache=function(e){return e?r:t})(e)}function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=_getRequireWildcardCache(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var i=o?Object.getOwnPropertyDescriptor(e,s):null;i&&(i.get||i.set)?Object.defineProperty(n,s,i):n[s]=e[s]}return n.default=e,r&&r.set(e,n),n}function startListenNetworkStatusHandler(e,t){var r=t.resolve,n=t.reject,o=t.context,s=t.containerType,i=t.appType,a=t.platformType,u=_invoker.default.registerEvent(_invoker.CONTINUOUS_EVENT_LIST.UPDATE_NETWORK_STATUS,(function(t){var r=t.data;r.errorCode!==_invoker.BRIDGE_ERROR_CODE.SUCCESS?e.onFail&&e.onFail(r):e.onSuccess&&e.onSuccess(r.result)}));if(s){var l=function(e){_invoker.default.registerContinuesEvent(e.result.requestId,u),_invoker.default.handleBridgeResponse(e,r,n)},d=function(e){_invoker.default.registerContinuesEvent(e.result.requestId,u),_invoker.default.handleBridgeResponse(e,r,n)};i===_invoker.API_INVOKER_TYPE.MINI_APP?o&&o({m:"taurus.common.startListenNetworkStatus",args:e,onSuccess:l,onFail:d}):a===_invoker.PLATFORM_TYPE_ENUM.ANDROID?o&&o(l,d,"taurus.common","startListenNetworkStatus",e):a===_invoker.PLATFORM_TYPE_ENUM.IOS&&o.callHandler("taurus.common.startListenNetworkStatus",Object.assign({},e),(function(e){_invoker.default.registerContinuesEvent(e.result.requestId,u),_invoker.default.handleBridgeResponse(e,r,n)}))}else o&&o.call("startListenNetworkStatus",e,(function(e){_invoker.default.registerContinuesEvent(e.result.requestId,u),_invoker.default.handleBridgeResponse(e,r,n)}))}function startListenNetworkStatus(e){return _invoker.default.invoke("startListenNetworkStatus",e)}_invoker.default.registerAPI("startListenNetworkStatus",{mobile:startListenNetworkStatusHandler,mini:startListenNetworkStatusHandler}),startListenNetworkStatus.version={android:"1.3.1.1",ios:"1.3.1.1"},module.exports=exports.default,module.exports.default=exports.default;