"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");exports.__esModule=!0,exports.default=closePage;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends")),_invoker=_interopRequireWildcard(require("./invoker"));function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,n=new WeakMap;return(_getRequireWildcardCache=function(e){return e?n:r})(e)}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=_getRequireWildcardCache(r);if(n&&n.has(e))return n.get(e);var t={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var a=i?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(t,o,a):t[o]=e[o]}return t.default=e,n&&n.set(e,t),t}function popWindow(e,r){var n=r.resolve,t=r.reject,i=r.context,o=r.containerType,a=r.appType,l=r.platformType;if(o){var u=function(e){_invoker.default.handleBridgeResponse(e,n,t)},d=function(e){_invoker.default.handleBridgeResponse(e,n,t)};a===_invoker.API_INVOKER_TYPE.MINI_APP?i&&i({m:"biz.navigation.close",args:e,onSuccess:u,onFail:d}):l===_invoker.PLATFORM_TYPE_ENUM.ANDROID?i&&i(u,d,"biz.navigation","close",e):l===_invoker.PLATFORM_TYPE_ENUM.IOS&&i.callHandler("biz.navigation.close",Object.assign({},e),(function(e){_invoker.default.handleBridgeResponse(e,n,t)}))}else i&&i.call("popWindow",e,(function(e){_invoker.default.handleBridgeResponse(e,n,t)}))}function closePage(e){return _invoker.default.invoke("closePage",(0,_extends2.default)({},e,{_apiName:"closePage"}))}_invoker.default.registerAPI("closePage",{mini:popWindow,mobile:popWindow,pc:function(e,r){window.dingtalk.platform.invokeAPI(r.msgId,"biz.navigation.quit",e)}}),closePage.version={android:"1.2.0",ios:"1.2.0",pc:"1.2.0"},module.exports=exports.default,module.exports.default=exports.default;