(function(){'use strict';var h;function aa(a){for(var b=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global],c=0;cf&&g!=this.A.top;f++)c=g=g.parent,e=a,1==c.postMessage.length?Y(c,e):c.postMessage(e,"*"),f++};function Y(a,b){a.postMessage.call(a,b,{targetOrigin:"*",includeUserActivation:!0})} function va(a){ua(a.A,function(b){if(!a.j||b.source==a.j){var c=b.data;if("string"==typeof c&&0==c.indexOf("amp-")&&-1!=c.indexOf("{")){var d=c.indexOf("{");try{var e=JSON.parse(c.substr(d))}catch(f){U().error("MESSAGING","Failed to parse message: "+c,f),e=null}}else e=null;e&&e.sentinel==a.G&&(e.origin=b.origin,a.j||(a.j=b.source),b=e.type,b in a.B&&a.B[b].fire(e))}})}h.setSentinel=function(a){this.G=a};function wa(){var a=window,b=this;this.A=a;this.H={};try{var c=JSON.parse(this.A.name)}catch(e){c=null}var d=c;this.O=d.type;this.l=new X(a,a.parent);this.l.setSentinel(d.sentinel);this.l.makeRequest("send-iframe-transport-events","iframe-transport-events",function(e){e.events.forEach(function(f){try{var g=f.creativeId;(b.H[g]||(b.H[g]=new Z(b.A,b.l,g,b.O))).dispatch(f.message)}catch(k){T().error("iframe-transport-client","Exception in callback passed to onAnalyticsEvent",k)}})})} wa.prototype.getIframeMessagingClient=function(){return this.l};function Z(a,b,c,d){this.l=b;this.J={creativeId:c,vendor:d};this.F=null;c=a.onNewContextInstance&&"function"==typeof a.onNewContextInstance;var e="Must implement onNewContextInstance in "+a.location.href;T().assert(c,e,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0);a.onNewContextInstance(this)}Z.prototype.onAnalyticsEvent=function(a){this.F=a};Z.prototype.dispatch=function(a){this.F&&this.F(a)}; Z.prototype.sendResponseToCreative=function(a){this.l.sendMessage("iframe-transport-response",Object.assign({},{message:a},this.J))};(function(){S=K;U();T()})();(function(a){self.__AMP_REPORT_ERROR=a})(function(){});try{new wa}catch(a){};})(); //# sourceMappingURL=iframe-transport-client-v0.js.map