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