"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.androidWeexBridge=exports.iosWeexBridge=exports.requireModule=void 0;var STATUS_NO_RESULT=0,STATUS_OK=1,STATUS_ERROR=2,WEEX_IOS_BIZ_SUCCESS_CODE="0";exports.requireModule=function(e){return"undefined"!=typeof __weex_require__?__weex_require__("@weex-module/"+e):"undefined"!=typeof weex?weex.requireModule(e):void 0},exports.iosWeexBridge=function(){return Promise.resolve(function(e,o){return new Promise(function(r,n){var s=exports.requireModule("nuvajs-exec"),t=e.split("."),i=t.pop(),_=t.join(".");s.exec({plugin:_,action:i,args:o},function(e){e&&e.errorCode===WEEX_IOS_BIZ_SUCCESS_CODE?("function"==typeof o.onSuccess&&o.onSuccess(e.result),r(e.result)):("function"==typeof o.onFail&&o.onFail(e.result),n(e.result))})})})},exports.androidWeexBridge=function(){return Promise.resolve(function(e,o){return new Promise(function(r,n){var s=exports.requireModule("nuvajs-exec"),t=e.split("."),i=t.pop(),_=t.join(".");s.exec({plugin:_,action:i,args:o},function(e){var s={};try{if(e&&e.__message__)if("object"==typeof e.__message__)s=e.__message__;else try{s=JSON.parse(e.__message__)}catch(o){"string"==typeof e.__message__&&(s=e.__message__)}}catch(e){}e&&parseInt(e.__status__+"",10)===STATUS_OK?("function"==typeof o.onSuccess&&o.onSuccess(s),r(s)):("function"==typeof o.onFail&&o.onFail(s),n(s))})})})};