"use strict";exports.__esModule=!0,exports.default=prompt;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 o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=n?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(o,i,a):o[i]=e[i]}return o.default=e,r&&r.set(e,o),o}function promptHandler(e,t){var r=t.resolve,o=t.reject,n=t.context,i=t.containerType,a=t.appType,p=t.platformType,u={message:e.message,title:e.title,okButton:e.buttonLabels[0],cancelButton:e.buttonLabels[1]};if(i){var l=function(e){_invoker.default.handleBridgeResponse(e,r,o)},d=function(e){_invoker.default.handleBridgeResponse(e,r,o)};a===_invoker.API_INVOKER_TYPE.MINI_APP?n&&n({m:"taurus.common.prompt",args:u,onSuccess:l,onFail:d}):p===_invoker.PLATFORM_TYPE_ENUM.ANDROID?n&&n(l,d,"taurus.common","prompt",u):p===_invoker.PLATFORM_TYPE_ENUM.IOS&&n.callHandler("taurus.common.prompt",Object.assign({},u),(function(e){_invoker.default.handleBridgeResponse(e,r,o)}))}else n&&n.call("prompt",u,(function(e){var t={errorCode:_invoker.BRIDGE_ERROR_CODE.SUCCESS,result:{buttonIndex:e.ok?0:1,value:e.inputValue}};_invoker.default.handleBridgeResponse(t,r,o)}))}function prompt(e){return _invoker.default.invoke("prompt",e)}_invoker.default.registerAPI("prompt",{mini:promptHandler,mobile:promptHandler,pc:function(e,t){window.dingtalk.platform.invokeAPI(t.msgId,"device.notification.prompt",e)}}),prompt.version={android:"1.3.2",ios:"1.3.2",pc:"1.3.2"},module.exports=exports.default,module.exports.default=exports.default;