var Message=function(){function n(){}n.is=function(n){return typeof n=="object"&&typeof n.destination=="string"&&n.content!=undefined};n.send=function(t,i,e){if(n.is(t)&&e==undefined){e=i;if(!e)e=window;var s=t.destination.split("#",2);t={destination:s[1],content:t.content};e.postMessage(t,s[0])}else if(typeof e!="string"){if(!e)e=window;if(typeof t=="string")n.send({destination:t,content:i},e)}};n.listen=function(t,i,e){var s=t.split("#",2);var o="";if(s.length==2){t=s[0];o=s[1]}(e||window).addEventListener("message",(function(e){var s=e.data;if(n.is(s)&&(t=="*"||e.origin==t)&&(o==""||s.destination==o))i(s.destination,s.content)}))};return n}();export{Message as M};