ar d=this;return new Promise(function(c,e){a||e(Error("Provide a valid Window context to connect to."));b||e(Error("Provide an expected origin for the remote Window or provide the wildcard *."));d.o?e(Error("Already connected.")):d.L?e(Error("Already connecting.")):(d.B=new MessageChannel,d.h=d.B.port1,d.C=d.N.bind(d,d.h,b,c),d.h.addEventListener("message",d.C),d.h.start(),a.postMessage({topic:x.Topics.CONNECT_HANDSHAKE},"*"===b?"*":w(b).origin,[d.B.port2]))})};
f.N=function(a,b,d){this.o=!0;a.removeEventLi