var lastResumeEvent=null;function onMessageFromNative(msg){var cordova=require("cordova"),action=msg.action;switch(action){case"backbutton":case"menubutton":case"searchbutton":case"pause":case"volumedownbutton":case"volumeupbutton":cordova.fireDocumentEvent(action);break;case"resume":if(1<arguments.length&&msg.pendingResult){if(2===arguments.length)msg.pendingResult.result=arguments[1];else{for(var res=[],i=1;i<arguments.length;i++)res.push(arguments[i]);msg.pendingResult.result=res}lastResumeEvent=msg}cordova.fireDocumentEvent(action,msg);break;default:throw new Error("Unknown event action "+action)}}module.exports={id:"android",bootstrap:function(){var channel=require("cordova/channel"),cordova=require("cordova"),exec=require("cordova/exec"),modulemapper=require("cordova/modulemapper");exec.init(),modulemapper.clobbers("cordova/plugin/android/app","navigator.app");var APP_PLUGIN_NAME=4<=Number(cordova.platformVersion.split(".")[0])?"CoreAndroid":"App";function bindButtonChannel(buttonName){cordova.addDocumentEventHandler(buttonName+"button").onHasSubscribersChange=function(){exec(null,null,APP_PLUGIN_NAME,"overrideButton",[buttonName,1==this.numHandlers])}}cordova.addDocumentEventHandler("backbutton").onHasSubscribersChange=function(){exec(null,null,APP_PLUGIN_NAME,"overrideBackbutton",[1==this.numHandlers])},cordova.addDocumentEventHandler("menubutton"),cordova.addDocumentEventHandler("searchbutton"),bindButtonChannel("volumeup"),bindButtonChannel("volumedown");var cordovaAddEventListener=document.addEventListener;document.addEventListener=function(evt,handler,capture){cordovaAddEventListener(evt,handler,capture),"resume"===evt&&lastResumeEvent&&handler(lastResumeEvent)},channel.onCordovaReady.subscribe(function(){exec(onMessageFromNative,null,APP_PLUGIN_NAME,"messageChannel",[]),exec(null,null,APP_PLUGIN_NAME,"show",[])})}};