New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

post-robot

Package Overview
Dependencies
Maintainers
2
Versions
246
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

post-robot - npm Package Compare versions

Comparing version 8.0.29 to 8.0.30

2

dist/module/conf/config.js

@@ -12,3 +12,3 @@ var _ALLOWED_POST_MESSAGE;

ACK_TIMEOUT: window.navigator.userAgent.match(/MSIE/i) !== -1 && !__TEST__ ? 2000 : 1000,
ACK_TIMEOUT: window.navigator.userAgent.match(/MSIE/i) !== -1 && !__TEST__ ? 10000 : 2000,
RES_TIMEOUT: __TEST__ ? 2000 : -1,

@@ -15,0 +15,0 @@

@@ -1,3 +0,2 @@

!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("postRobot",[],n):"object"==typeof exports?exports.postRobot=n():e.postRobot=n()}("undefined"!=typeof self?self:this,function(){return function(e){var n={};function r(t){if(n[t])return n[t].exports;var o=n[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=n,r.d=function(e,n,t){r.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:t})},r.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(n,"a",n),n},r.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},r.p="",r(r.s=8)}([function(e,n,r){"use strict";var t=r(9);r.d(n,"getActualDomain",function(){return t.a}),r.d(n,"getAncestor",function(){return t.b}),r.d(n,"getDomain",function(){return t.c}),r.d(n,"getDomainFromUrl",function(){return t.d}),r.d(n,"getFrameByName",function(){return t.e}),r.d(n,"getFrames",function(){return t.f}),r.d(n,"getOpener",function(){return t.g}),r.d(n,"getParent",function(){return t.h}),r.d(n,"getUserAgent",function(){return t.i}),r.d(n,"isActuallySameDomain",function(){return t.j}),r.d(n,"isAncestor",function(){return t.k}),r.d(n,"isIframe",function(){return t.l}),r.d(n,"isOpener",function(){return t.m}),r.d(n,"isPopup",function(){return t.n}),r.d(n,"isSameDomain",function(){return t.o}),r.d(n,"isSameTopWindow",function(){return t.p}),r.d(n,"isWindow",function(){return t.q}),r.d(n,"isWindowClosed",function(){return t.r}),r.d(n,"matchDomain",function(){return t.s}),r.d(n,"stringifyDomainPattern",function(){return t.t});var o=r(10);r.n(o)},function(e,n,r){"use strict";var t,o={POST_MESSAGE_TYPE:{REQUEST:"postrobot_message_request",RESPONSE:"postrobot_message_response",ACK:"postrobot_message_ack"},POST_MESSAGE_ACK:{SUCCESS:"success",ERROR:"error"},POST_MESSAGE_NAMES:{METHOD:"postrobot_method",HELLO:"postrobot_ready",OPEN_TUNNEL:"postrobot_open_tunnel"},WINDOW_TYPES:{FULLPAGE:"fullpage",POPUP:"popup",IFRAME:"iframe"},WINDOW_PROPS:{POSTROBOT:"__postRobot__"},SERIALIZATION_TYPES:{METHOD:"postrobot_method",ERROR:"postrobot_error",PROMISE:"postrobot_promise",ZALGO_PROMISE:"postrobot_zalgo_promise",REGEX:"regex"},SEND_STRATEGIES:{POST_MESSAGE:"postrobot_post_message",BRIDGE:"postrobot_bridge",GLOBAL:"postrobot_global"},MOCK_PROTOCOL:"mock:",FILE_PROTOCOL:"file:",BRIDGE_NAME_PREFIX:"__postrobot_bridge__",POSTROBOT_PROXY:"__postrobot_proxy__",WILDCARD:"*"},i={METHOD:"postrobot_method",HELLO:"postrobot_hello",OPEN_TUNNEL:"postrobot_open_tunnel"},a=Object.keys(i).map(function(e){return i[e]}),u={ALLOW_POSTMESSAGE_POPUP:!("__ALLOW_POSTMESSAGE_POPUP__"in window)||window.__ALLOW_POSTMESSAGE_POPUP__,BRIDGE_TIMEOUT:5e3,CHILD_WINDOW_TIMEOUT:5e3,ACK_TIMEOUT:-1!==window.navigator.userAgent.match(/MSIE/i)?2e3:1e3,RES_TIMEOUT:-1,ALLOWED_POST_MESSAGE_METHODS:(t={},t[o.SEND_STRATEGIES.POST_MESSAGE]=!0,t[o.SEND_STRATEGIES.BRIDGE]=!0,t[o.SEND_STRATEGIES.GLOBAL]=!0,t),ALLOW_SAME_ORIGIN:!1};0===window.location.href.indexOf(o.FILE_PROTOCOL)&&(u.ALLOW_POSTMESSAGE_POPUP=!0),r.d(n,"a",function(){return u}),r.d(n,"b",function(){return o}),r.d(n,!1,function(){return i}),r.d(n,!1,function(){return a})},function(e,n,r){"use strict";function t(e){try{if(!e)return!1;if("undefined"!=typeof Promise&&e instanceof Promise)return!0;if("undefined"!=typeof window&&window.Window&&e instanceof window.Window)return!1;if("undefined"!=typeof window&&window.constructor&&e instanceof window.constructor)return!1;var n={}.toString;if(n){var r=n.call(e);if("[object Window]"===r||"[object global]"===r||"[object DOMWindow]"===r)return!1}if("function"==typeof e.then)return!0}catch(e){return!1}return!1}function o(){var e=void 0;if("undefined"!=typeof window)e=window;else{if("undefined"==typeof window)throw new TypeError("Can not find global");e=window}var n=e.__zalgopromise__=e.__zalgopromise__||{};return n.flushPromises=n.flushPromises||[],n.activeCount=n.activeCount||0,n.possiblyUnhandledPromiseHandlers=n.possiblyUnhandledPromiseHandlers||[],n.dispatchedErrors=n.dispatchedErrors||[],n}var i=function(){function e(n){var r=this;if(function(n,r){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}(this),this.resolved=!1,this.rejected=!1,this.errorHandled=!1,this.handlers=[],n){var t=void 0,o=void 0,i=!1,a=!1,u=!1;try{n(function(e){u?r.resolve(e):(i=!0,t=e)},function(e){u?r.reject(e):(a=!0,o=e)})}catch(e){return void this.reject(e)}u=!0,i?this.resolve(t):a&&this.reject(o)}}return e.prototype.resolve=function(e){if(this.resolved||this.rejected)return this;if(t(e))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=e,this.dispatch(),this},e.prototype.reject=function(e){var n=this;if(this.resolved||this.rejected)return this;if(t(e))throw new Error("Can not reject promise with another promise");if(!e){var r=e&&"function"==typeof e.toString?e.toString():Object.prototype.toString.call(e);e=new Error("Expected reject to be called with Error, got "+r)}return this.rejected=!0,this.error=e,this.errorHandled||setTimeout(function(){n.errorHandled||function(e,n){if(-1===o().dispatchedErrors.indexOf(e)){o().dispatchedErrors.push(e),setTimeout(function(){throw e},1);for(var r=0;r<o().possiblyUnhandledPromiseHandlers.length;r++)o().possiblyUnhandledPromiseHandlers[r](e,n)}}(e,n)},1),this.dispatch(),this},e.prototype.asyncReject=function(e){this.errorHandled=!0,this.reject(e)},e.prototype.dispatch=function(){var n=this,r=this.dispatching,i=this.resolved,a=this.rejected,u=this.handlers;if(!r&&(i||a)){this.dispatching=!0,o().activeCount+=1;for(var c=function(r){var o=u[r],c=o.onSuccess,s=o.onError,d=o.promise,f=void 0;if(i)try{f=c?c(n.value):n.value}catch(e){return d.reject(e),"continue"}else if(a){if(!s)return d.reject(n.error),"continue";try{f=s(n.error)}catch(e){return d.reject(e),"continue"}}f instanceof e&&(f.resolved||f.rejected)?(f.resolved?d.resolve(f.value):d.reject(f.error),f.errorHandled=!0):t(f)?f instanceof e&&(f.resolved||f.rejected)?f.resolved?d.resolve(f.value):d.reject(f.error):f.then(function(e){d.resolve(e)},function(e){d.reject(e)}):d.resolve(f)},s=0;s<u.length;s++)c(s);u.length=0,this.dispatching=!1,o().activeCount-=1,0===o().activeCount&&e.flushQueue()}},e.prototype.then=function(n,r){if(n&&"function"!=typeof n&&!n.call)throw new Error("Promise.then expected a function for success handler");if(r&&"function"!=typeof r&&!r.call)throw new Error("Promise.then expected a function for error handler");var t=new e;return this.handlers.push({promise:t,onSuccess:n,onError:r}),this.errorHandled=!0,this.dispatch(),t},e.prototype.catch=function(e){return this.then(void 0,e)},e.prototype.finally=function(n){if(n&&"function"!=typeof n&&!n.call)throw new Error("Promise.finally expected a function");return this.then(function(r){return e.try(n).then(function(){return r})},function(r){return e.try(n).then(function(){throw r})})},e.prototype.timeout=function(e,n){var r=this;if(this.resolved||this.rejected)return this;var t=setTimeout(function(){r.resolved||r.rejected||r.reject(n||new Error("Promise timed out after "+e+"ms"))},e);return this.then(function(e){return clearTimeout(t),e})},e.prototype.toPromise=function(){if("undefined"==typeof Promise)throw new TypeError("Could not find Promise");return Promise.resolve(this)},e.resolve=function(n){return n instanceof e?n:t(n)?new e(function(e,r){return n.then(e,r)}):(new e).resolve(n)},e.reject=function(n){return(new e).reject(n)},e.all=function(n){var r=new e,o=n.length,i=[];if(!o)return r.resolve(i),r;for(var a=function(a){var u=n[a];if(u instanceof e){if(u.resolved)return i[a]=u.value,o-=1,"continue"}else if(!t(u))return i[a]=u,o-=1,"continue";e.resolve(u).then(function(e){i[a]=e,0==(o-=1)&&r.resolve(i)},function(e){r.reject(e)})},u=0;u<n.length;u++)a(u);return 0===o&&r.resolve(i),r},e.hash=function(n){var r={};return e.all(Object.keys(n).map(function(t){return e.resolve(n[t]).then(function(e){r[t]=e})})).then(function(){return r})},e.map=function(n,r){return e.all(n.map(r))},e.onPossiblyUnhandledException=function(e){return function(e){return o().possiblyUnhandledPromiseHandlers.push(e),{cancel:function(){o().possiblyUnhandledPromiseHandlers.splice(o().possiblyUnhandledPromiseHandlers.indexOf(e),1)}}}(e)},e.try=function(n,r,t){if(n&&"function"!=typeof n&&!n.call)throw new Error("Promise.try expected a function");var o=void 0;try{o=n.apply(r,t||[])}catch(n){return e.reject(n)}return e.resolve(o)},e.delay=function(n){return new e(function(e){setTimeout(e,n)})},e.isPromise=function(n){return!!(n&&n instanceof e)||t(n)},e.flush=function(){var n=new e;return o().flushPromises.push(n),0===o().activeCount&&e.flushQueue(),n},e.flushQueue=function(){var e=o().flushPromises;o().flushPromises=[];for(var n=0,r=null==e?0:e.length;n<r;n++)e[n].resolve()},e}();r.d(n,"a",function(){return i})},function(e,n,r){"use strict";r.d(n,"a",function(){return o});var t=r(1),o=window[t.b.WINDOW_PROPS.POSTROBOT]=window[t.b.WINDOW_PROPS.POSTROBOT]||{};o.registerSelf=function(){}},function(e,n,r){"use strict";var t=r(5),o=r(0),i=r(1),a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function u(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(n>=3)return"stringifyError stack overflow";try{if(!e)return"<unknown error: "+Object.prototype.toString.call(e)+">";if("string"==typeof e)return e;if(e instanceof Error){var r=e&&e.stack,t=e&&e.message;if(r&&t)return-1!==r.indexOf(t)?r:t+"\n"+r;if(r)return r;if(t)return t}return"function"==typeof e.toString?e.toString():Object.prototype.toString.call(e)}catch(e){return"Error while stringifying error: "+u(e,n+1)}}var c=function(e){if(!e)return e;var n=!1;return function(){if(!n)return n=!0,e.apply(this,arguments)}};function s(){}function d(e,n,r){return e.addEventListener?e.addEventListener(n,r):e.attachEvent("on"+n,r),{cancel:function(){e.removeEventListener?e.removeEventListener(n,r):e.detachEvent("on"+n,r)}}}function f(){var e="0123456789abcdef";return"xxxxxxxxxx".replace(/./g,function(){return e.charAt(Math.floor(Math.random()*e.length))})}function w(e,n){for(var r=0;r<e.length;r++)n(e[r],r)}function l(e,n){for(var r in e)e.hasOwnProperty(r)&&n(e[r],r)}function m(e,n){Array.isArray(e)?w(e,n):"object"===(void 0===e?"undefined":a(e))&&null!==e&&l(e,n)}function p(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(r>=100)throw new Error("Self-referential object passed, or object contained too many layers");var t=void 0;if("object"!==(void 0===e?"undefined":a(e))||null===e||Array.isArray(e)){if(!Array.isArray(e))throw new TypeError("Invalid type: "+(void 0===e?"undefined":a(e)));t=[]}else t={};return m(e,function(e,o){var i=n(e,o);void 0!==i?t[o]=i:"object"===(void 0===e?"undefined":a(e))&&null!==e?t[o]=p(e,n,r+1):t[o]=e}),t}function h(e,n){var r=void 0;return r=setTimeout(function t(){r=setTimeout(t,n),e.call()},n),{cancel:function(){clearTimeout(r)}}}function O(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var g=function(e){var n=new t.a;return function(r){var t=n.get(r);return void 0!==t?t:(void 0!==(t=e.call(this,r))&&n.set(r,t),t)}};function y(){return Object(o.isPopup)()?i.b.WINDOW_TYPES.POPUP:Object(o.isIframe)()?i.b.WINDOW_TYPES.IFRAME:i.b.WINDOW_TYPES.FULLPAGE}function v(e,n,r){var t=void 0,o=void 0;try{if("{}"!==JSON.stringify({})&&(t=Object.prototype.toJSON,delete Object.prototype.toJSON),"{}"!==JSON.stringify({}))throw new Error("Can not correctly serialize JSON objects");if("[]"!==JSON.stringify([])&&(o=Array.prototype.toJSON,delete Array.prototype.toJSON),"[]"!==JSON.stringify([]))throw new Error("Can not correctly serialize JSON objects")}catch(e){throw new Error("Can not repair JSON.stringify: "+e.message)}var i=JSON.stringify.call(this,e,n,r);try{t&&(Object.prototype.toJSON=t),o&&(Array.prototype.toJSON=o)}catch(e){throw new Error("Can not repair JSON.stringify: "+e.message)}return i}function E(e){return JSON.parse(e)}function b(){return!!Object(o.getUserAgent)(window).match(/MSIE|trident|edge\/12|edge\/13/i)||!i.a.ALLOW_POSTMESSAGE_POPUP}var _=r(2),S=r(3),P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};S.a.methods=S.a.methods||new t.a;var T=c(function(){S.a.on(i.b.POST_MESSAGE_NAMES.METHOD,{origin:i.b.WILDCARD},function(e){var n=e.source,r=e.origin,t=e.data,i=S.a.methods.get(n);if(!i)throw new Error("Could not find any methods this window has privileges to call");var a=i[t.id];if(!a)throw new Error("Could not find method with id: "+t.id);if(!Object(o.matchDomain)(a.domain,r))throw new Error("Method domain "+a.domain+" does not match origin "+r);return _.a.try(function(){return a.method.apply({source:n,origin:r,data:t},t.args)}).then(function(e){return{result:e,id:t.id,name:t.name}})})});function A(e,n){return"object"===(void 0===e?"undefined":P(e))&&null!==e&&e.__type__===n}function W(e,n,r,t){var o=f(),a=S.a.methods.get(e);return a||(a={},S.a.methods.set(e,a)),a[o]={domain:n,method:r},{__type__:i.b.SERIALIZATION_TYPES.METHOD,__id__:o,__name__:t}}function j(e,n,r){return p({obj:r},function(r,t){return"function"==typeof r?W(e,n,r,t.toString()):r instanceof Error?(o=r,{__type__:i.b.SERIALIZATION_TYPES.ERROR,__message__:u(o),__code__:o.code}):window.Promise&&r instanceof window.Promise?function(e,n,r,t){return{__type__:i.b.SERIALIZATION_TYPES.PROMISE,__then__:W(e,n,function(e,n){return r.then(e,n)},t+".then")}}(e,n,r,t.toString()):_.a.isPromise(r)?function(e,n,r,t){return{__type__:i.b.SERIALIZATION_TYPES.ZALGO_PROMISE,__then__:W(e,n,function(e,n){return r.then(e,n)},t+".then")}}(e,n,r,t.toString()):O(r)?(a=r,{__type__:i.b.SERIALIZATION_TYPES.REGEX,__source__:a.source}):void 0;var o,a}).obj}function R(e,n,r){function t(){var t=Array.prototype.slice.call(arguments);return S.a.send(e,i.b.POST_MESSAGE_NAMES.METHOD,{id:r.__id__,name:r.__name__,args:t},{domain:n,timeout:-1}).then(function(e){return e.data.result},function(e){throw e})}return t.__name__=r.__name__,t.__xdomain__=!0,t.source=e,t.origin=n,t}function D(e,n,r){var t=new Error(r.__message__);return r.__code__&&(t.code=r.__code__),t}function I(e,n,r){return new _.a(function(t,o){return R(e,n,r.__then__)(t,o)})}function M(e,n,r){return window.Promise?new window.Promise(function(t,o){return R(e,n,r.__then__)(t,o)}):I(e,n,r)}function L(e,n,r){return new RegExp(r.__source__)}function C(e,n,r){return p({obj:r},function(r){if("object"===(void 0===r?"undefined":P(r))&&null!==r)return A(r,i.b.SERIALIZATION_TYPES.METHOD)?R(e,n,r):A(r,i.b.SERIALIZATION_TYPES.ERROR)?D(0,0,r):A(r,i.b.SERIALIZATION_TYPES.PROMISE)?M(e,n,r):A(r,i.b.SERIALIZATION_TYPES.ZALGO_PROMISE)?I(e,n,r):A(r,i.b.SERIALIZATION_TYPES.REGEX)?L(0,0,r):void 0}).obj}function N(e){S.a.on(i.b.POST_MESSAGE_NAMES.HELLO,{domain:i.b.WILDCARD},function(n){var r=n.source,t=n.origin;return e({source:r,origin:t})})}function B(e){return S.a.send(e,i.b.POST_MESSAGE_NAMES.HELLO,{},{domain:i.b.WILDCARD,timeout:-1}).then(function(e){return{origin:e.origin}})}function x(){N(function(e){var n=e.source,r=e.origin,t=S.a.readyPromises.get(n)||new _.a;t.resolve({origin:r}),S.a.readyPromises.set(n,t)});var e=Object(o.getAncestor)();e&&B(e).catch(s)}function k(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Window",t=S.a.readyPromises.get(e);return t||(t=new _.a,S.a.readyPromises.set(e,t),-1!==n&&setTimeout(function(){return t.reject(new Error(r+" did not load after "+n+"ms"))},n),t)}S.a.readyPromises=S.a.readyPromises||new t.a,r.d(n,"p",function(){return u}),r.d(n,"l",function(){return c}),r.d(n,"j",function(){return s}),r.d(n,"a",function(){return d}),r.d(n,"q",function(){return f}),r.d(n,!1,function(){return w}),r.d(n,!1,function(){return l}),r.d(n,!1,function(){return m}),r.d(n,!1,function(){return p}),r.d(n,"m",function(){return h}),r.d(n,"e",function(){return O}),r.d(n,"r",function(){return g}),r.d(n,"c",function(){return y}),r.d(n,"g",function(){return v}),r.d(n,"f",function(){return E}),r.d(n,"i",function(){return b}),r.d(n,"h",function(){return T}),r.d(n,!1,function(){return W}),r.d(n,"o",function(){return j}),r.d(n,!1,function(){return R}),r.d(n,!1,function(){return D}),r.d(n,!1,function(){return I}),r.d(n,!1,function(){return M}),r.d(n,!1,function(){return L}),r.d(n,"b",function(){return C}),r.d(n,!1,function(){return N}),r.d(n,"n",function(){return B}),r.d(n,"d",function(){return x}),r.d(n,"k",function(){return k})},function(e,n,r){"use strict";r.d({},"WeakMap",function(){return u});var t=r(0);function o(e,n){for(var r=0;r<e.length;r++)try{if(e[r]===n)return r}catch(e){}return-1}var i=Object.defineProperty,a=Date.now()%1e9,u=function(){function e(){if(function(n,r){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}(this),a+=1,this.name="__weakmap_"+(1e9*Math.random()>>>0)+"__"+a,function(){if(!window.WeakMap)return!1;if(!window.Object.freeze)return!1;try{var e=new window.WeakMap,n={};return window.Object.freeze(n),e.set(n,"__testvalue__"),"__testvalue__"===e.get(n)}catch(e){return!1}}())try{this.weakmap=new window.WeakMap}catch(e){}this.keys=[],this.values=[]}return e.prototype._cleanupClosedWindows=function(){for(var e=this.weakmap,n=this.keys,r=0;r<n.length;r++){var o=n[r];if(Object(t.isWindow)(o)&&Object(t.isWindowClosed)(o)){if(e)try{e.delete(o)}catch(e){}n.splice(r,1),this.values.splice(r,1),r-=1}}},e.prototype.isSafeToReadWrite=function(e){if(Object(t.isWindow)(e))return!1;try{e&&e.self,e&&e[this.name]}catch(e){return!1}return!0},e.prototype.set=function(e,n){if(!e)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{r.set(e,n)}catch(e){delete this.weakmap}if(this.isSafeToReadWrite(e)){var t=this.name,a=e[t];a&&a[0]===e?a[1]=n:i(e,t,{value:[e,n],writable:!0})}else{this._cleanupClosedWindows();var u=this.keys,c=this.values,s=o(u,e);-1===s?(u.push(e),c.push(n)):c[s]=n}},e.prototype.get=function(e){if(!e)throw new Error("WeakMap expected key");var n=this.weakmap;if(n)try{if(n.has(e))return n.get(e)}catch(e){delete this.weakmap}if(!this.isSafeToReadWrite(e)){this._cleanupClosedWindows();var r=o(this.keys,e);if(-1===r)return;return this.values[r]}var t=e[this.name];if(t&&t[0]===e)return t[1]},e.prototype.delete=function(e){if(!e)throw new Error("WeakMap expected key");var n=this.weakmap;if(n)try{n.delete(e)}catch(e){delete this.weakmap}if(this.isSafeToReadWrite(e)){var r=e[this.name];r&&r[0]===e&&(r[0]=r[1]=void 0)}else{this._cleanupClosedWindows();var t=this.keys,i=o(t,e);-1!==i&&(t.splice(i,1),this.values.splice(i,1))}},e.prototype.has=function(e){if(!e)throw new Error("WeakMap expected key");var n=this.weakmap;if(n)try{return n.has(e)}catch(e){delete this.weakmap}if(this.isSafeToReadWrite(e)){var r=e[this.name];return!(!r||r[0]!==e)}return this._cleanupClosedWindows(),-1!==o(this.keys,e)},e}();r.d(n,"a",function(){return u})},function(e,n,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t=r(2),o=r(0),i=r(1),a=r(4),u=r(3);function c(e){try{u.a.tunnelWindows[e]&&delete u.a.tunnelWindows[e].source}catch(e){}delete u.a.tunnelWindows[e]}u.a.tunnelWindows=u.a.tunnelWindows||{},u.a.tunnelWindowId=0,u.a.openTunnelToParent=function(e){var n=e.name,r=e.source,t=e.canary,s=e.sendMessage,d=Object(o.getParent)(window);if(!d)throw new Error("No parent window found to open tunnel to");var f=function(e){var n=e.name,r=e.source,t=e.canary,i=e.sendMessage;return function(){for(var e=u.a.tunnelWindows,n=0,r=Object.keys(e),t=null==r?0:r.length;n<t;n++){var i=r[n],s=e[i];try{Object(a.j)(s.source)}catch(e){c(i);continue}Object(o.isWindowClosed)(s.source)&&c(i)}}(),u.a.tunnelWindowId+=1,u.a.tunnelWindows[u.a.tunnelWindowId]={name:n,source:r,canary:t,sendMessage:i},u.a.tunnelWindowId}({name:n,source:r,canary:t,sendMessage:s});return u.a.send(d,i.b.POST_MESSAGE_NAMES.OPEN_TUNNEL,{name:n,sendMessage:function(){var e=function(e){return u.a.tunnelWindows[e]}(f);try{Object(a.j)(e&&e.source)}catch(e){return void c(f)}if(e&&e.source&&!Object(o.isWindowClosed)(e.source)){try{e.canary()}catch(e){return}e.sendMessage.apply(this,arguments)}}},{domain:i.b.WILDCARD})};var s=r(5);function d(){return!!Object(o.getUserAgent)(window).match(/MSIE|trident|edge\/12|edge\/13/i)||!i.a.ALLOW_POSTMESSAGE_POPUP}function f(e){return!Object(o.isSameTopWindow)(window,e)}function w(e,n){if(e){if(Object(o.getDomain)()!==Object(o.getDomainFromUrl)(e))return!0}else if(n&&!Object(o.isSameDomain)(n))return!0;return!1}function l(e){var n=e.win,r=e.domain;return!(!d()||r&&!w(r,n)||n&&!f(n))}function m(e){var n=(e=e||Object(o.getDomainFromUrl)(e)).replace(/[^a-zA-Z0-9]+/g,"_");return i.b.BRIDGE_NAME_PREFIX+"_"+n}function p(){return Boolean(window.name&&window.name===m(Object(o.getDomain)()))}var h=new t.a(function(e){if(window.document&&window.document.body)return e(window.document.body);var n=setInterval(function(){if(window.document&&window.document.body)return clearInterval(n),e(window.document.body)},10)});function O(e){u.a.remoteWindows.set(e,{sendMessagePromise:new t.a})}function g(e){return u.a.remoteWindows.get(e)}function y(e,n,r){var i=g(e);if(!i)throw new Error("Window not found to register sendMessage to");var a=function(t,i,a){if(t!==e)throw new Error("Remote window does not match window");if(!Object(o.matchDomain)(a,n))throw new Error("Remote domain "+a+" does not match domain "+n);r(i)};i.sendMessagePromise.resolve(a),i.sendMessagePromise=t.a.resolve(a)}function v(e,n){var r=g(e);if(!r)throw new Error("Window not found on which to reject sendMessage");r.sendMessagePromise.asyncReject(n)}function E(e,n,r){var t=Object(o.isOpener)(window,e),i=Object(o.isOpener)(e,window);if(!t&&!i)throw new Error("Can only send messages to and from parent and popup windows");var a=g(e);if(!a)throw new Error("Window not found to send message to");return a.sendMessagePromise.then(function(t){return t(e,n,r)})}u.a.remoteWindows=u.a.remoteWindows||new s.a;var b=Object(a.r)(function(e){return t.a.try(function(){for(var n=0,r=Object(o.getFrames)(e),a=null==r?0:r.length;n<a;n++){var u=r[n];try{if(u&&u!==window&&Object(o.isSameDomain)(u)&&u[i.b.WINDOW_PROPS.POSTROBOT])return u}catch(e){continue}}try{var c=Object(o.getFrameByName)(e,m(Object(o.getDomain)()));if(!c)return;return Object(o.isSameDomain)(c)&&c[i.b.WINDOW_PROPS.POSTROBOT]?c:new t.a(function(e){var n=void 0,r=void 0;n=setInterval(function(){if(c&&Object(o.isSameDomain)(c)&&c[i.b.WINDOW_PROPS.POSTROBOT])return clearInterval(n),clearTimeout(r),e(c)},100),r=setTimeout(function(){return clearInterval(n),e()},2e3)})}catch(e){}})});function _(){return t.a.try(function(){var e=Object(o.getOpener)(window);if(e&&l({win:e}))return O(e),b(e).then(function(n){return n?window.name?n[i.b.WINDOW_PROPS.POSTROBOT].openTunnelToParent({name:window.name,source:window,canary:function(){},sendMessage:function(e){try{Object(a.j)(window)}catch(e){return}if(window&&!window.closed)try{u.a.receiveMessage({data:e,origin:this.origin,source:this.source})}catch(e){t.a.reject(e)}}}).then(function(n){var r=n.source,t=n.origin,o=n.data;if(r!==e)throw new Error("Source does not match opener");y(r,t,o.sendMessage)}).catch(function(n){throw v(e,n),n}):v(e,new Error("Can not register with opener: window does not have a name")):v(e,new Error("Can not register with opener: no bridge found in opener"))})})}function S(e,n){return n=n||Object(o.getDomainFromUrl)(e),Boolean(u.a.bridges[n])}function P(e,n){return n=n||Object(o.getDomainFromUrl)(e),u.a.bridges[n]?u.a.bridges[n]:(u.a.bridges[n]=t.a.try(function(){if(Object(o.getDomain)()===n)throw new Error("Can not open bridge on the same domain as current domain: "+n);var r=m(n);if(Object(o.getFrameByName)(window,r))throw new Error("Frame with name "+r+" already exists on page");var c=function(e,n){var r=document.createElement("iframe");return r.setAttribute("name",e),r.setAttribute("id",e),r.setAttribute("style","display: none; margin: 0; padding: 0; border: 0px none; overflow: hidden;"),r.setAttribute("frameborder","0"),r.setAttribute("border","0"),r.setAttribute("scrolling","no"),r.setAttribute("allowTransparency","true"),r.setAttribute("tabindex","-1"),r.setAttribute("hidden","true"),r.setAttribute("title",""),r.setAttribute("role","presentation"),r.src=n,r}(r,e);return u.a.bridgeFrames[n]=c,h.then(function(r){r.appendChild(c);var o=c.contentWindow;return function(e,n){u.a.on(i.b.POST_MESSAGE_NAMES.OPEN_TUNNEL,{window:e,domain:n},function(e){var r=e.origin,o=e.data;if(r!==n)throw new Error("Domain "+n+" does not match origin "+r);if(!o.name)throw new Error("Register window expected to be passed window name");if(!o.sendMessage)throw new Error("Register window expected to be passed sendMessage method");if(!u.a.popupWindowsByName[o.name])throw new Error("Window with name "+o.name+" does not exist, or was not opened by this window");if(!u.a.popupWindowsByName[o.name].domain)throw new Error("We do not have a registered domain for window "+o.name);if(u.a.popupWindowsByName[o.name].domain!==r)throw new Error("Message origin "+r+" does not matched registered window origin "+u.a.popupWindowsByName[o.name].domain);return y(u.a.popupWindowsByName[o.name].win,n,o.sendMessage),{sendMessage:function(e){if(window&&!window.closed){var n=u.a.popupWindowsByName[o.name];if(n)try{u.a.receiveMessage({data:e,origin:n.domain,source:n.win})}catch(e){t.a.reject(e)}}}}})}(o,n),new t.a(function(e,n){c.onload=e,c.onerror=n}).then(function(){return Object(a.k)(o,i.a.BRIDGE_TIMEOUT,"Bridge "+e)}).then(function(){return o})})}),u.a.bridges[n])}u.a.bridges=u.a.bridges||{},u.a.bridgeFrames=u.a.bridgeFrames||{},u.a.popupWindowsByWin=u.a.popupWindowsByWin||new s.a,u.a.popupWindowsByName=u.a.popupWindowsByName||{};var T=window.open;function A(e,n){var r=u.a.popupWindowsByWin.get(e);r&&(r.domain=Object(o.getDomainFromUrl)(n),O(e))}function W(){for(var e=0,n=Object.keys(u.a.bridgeFrames),r=null==n?0:n.length;e<r;e++){var t=n[e],o=u.a.bridgeFrames[t];o.parentNode&&o.parentNode.removeChild(o)}u.a.bridgeFrames={},u.a.bridges={}}window.open=function(e,n,r,t){var a=e;if(e&&0===e.indexOf(i.b.MOCK_PROTOCOL)){var c=e.split("|");a=c[0],e=c[1]}a&&(a=Object(o.getDomainFromUrl)(a));var s=T.call(this,e,n,r,t);if(!s)return s;e&&O(s);for(var d=0,f=Object.keys(u.a.popupWindowsByName),w=null==f?0:f.length;d<w;d++){var l=f[d];Object(o.isWindowClosed)(u.a.popupWindowsByName[l].win)&&delete u.a.popupWindowsByName[l]}if(n&&s){var m=u.a.popupWindowsByWin.get(s)||u.a.popupWindowsByName[n]||{};m.name=m.name||n,m.win=m.win||s,m.domain=m.domain||a,u.a.popupWindowsByWin.set(s,m),u.a.popupWindowsByName[n]=m}return s},r.d(n,"openTunnelToOpener",function(){return _}),r.d(n,"needsBridgeForBrowser",function(){return d}),r.d(n,"needsBridgeForWin",function(){return f}),r.d(n,"needsBridgeForDomain",function(){return w}),r.d(n,"needsBridge",function(){return l}),r.d(n,"getBridgeName",function(){return m}),r.d(n,"isBridge",function(){return p}),r.d(n,"documentBodyReady",function(){return h}),r.d(n,"registerRemoteWindow",function(){return O}),r.d(n,"findRemoteWindow",function(){return g}),r.d(n,"registerRemoteSendMessage",function(){return y}),r.d(n,"rejectRemoteSendMessage",function(){return v}),r.d(n,"sendBridgeMessage",function(){return E}),r.d(n,"hasBridge",function(){return S}),r.d(n,"openBridge",function(){return P}),r.d(n,"linkUrl",function(){return A}),r.d(n,"destroyBridges",function(){return W})},function(e,n,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t=r(0),o=r(1);function i(e,n){if(!o.a.ALLOW_POSTMESSAGE_POPUP&&!1===Object(t.isSameTopWindow)(e,n))throw new Error("Can not send and receive post messages between two different windows (disabled to emulate IE)")}r.d(n,"emulateIERestrictions",function(){return i})},function(e,n,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t={};r.d(t,"cleanUpWindow",function(){return k}),r.d(t,"Promise",function(){return c.a}),r.d(t,"bridge",function(){return G}),r.d(t,"init",function(){return U}),r.d(t,"parent",function(){return x}),r.d(t,"send",function(){return j}),r.d(t,"request",function(){return W}),r.d(t,"sendToParent",function(){return R}),r.d(t,"client",function(){return D}),r.d(t,"on",function(){return L}),r.d(t,"listen",function(){return M}),r.d(t,"once",function(){return C}),r.d(t,"listener",function(){return N}),r.d(t,"CONFIG",function(){return a.a}),r.d(t,"CONSTANTS",function(){return a.b}),r.d(t,"disable",function(){return B});var o=r(4),i=r(0),a=r(1),u=r(3),c=r(2),s={};s[a.b.SEND_STRATEGIES.POST_MESSAGE]=function(e,n,t){try{r(7).emulateIERestrictions(window,e)}catch(e){return}(Array.isArray(t)?t:"string"==typeof t?[t]:[a.b.WILDCARD]).map(function(n){if(0===n.indexOf(a.b.MOCK_PROTOCOL)){if(window.location.protocol===a.b.FILE_PROTOCOL)return a.b.WILDCARD;if(!Object(i.isActuallySameDomain)(e))throw new Error("Attempting to send messsage to mock domain "+n+", but window is actually cross-domain");return Object(i.getActualDomain)(e)}return 0===n.indexOf(a.b.FILE_PROTOCOL)?a.b.WILDCARD:n}).forEach(function(r){return e.postMessage(n,r)})};var d=r(6),f=d.sendBridgeMessage,w=d.needsBridgeForBrowser,l=d.isBridge;s[a.b.SEND_STRATEGIES.BRIDGE]=function(e,n,r){if(w()||l()){if(Object(i.isSameDomain)(e))throw new Error("Post message through bridge disabled between same domain windows");if(!1!==Object(i.isSameTopWindow)(window,e))throw new Error("Can only use bridge to communicate between two different windows, not between frames");return f(e,n,r)}},s[a.b.SEND_STRATEGIES.GLOBAL]=function(e,n){if(Object(o.i)()){if(!Object(i.isSameDomain)(e))throw new Error("Post message through global disabled between different domain windows");if(!1!==Object(i.isSameTopWindow)(window,e))throw new Error("Can only use global to communicate between two different windows, not between frames");var r=e[a.b.WINDOW_PROPS.POSTROBOT];if(!r)throw new Error("Can not find postRobot global on foreign window");return r.receiveMessage({source:window,origin:Object(i.getDomain)(),data:n})}};var m=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e};function p(e,n,r){return c.a.try(function(){var t;if(n=function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},t=Object(o.q)(),a=Object(o.c)(),u=Object(i.getDomain)(window);return m({},n,r,{sourceDomain:u,id:n.id||t,windowType:a})}(e,n,{data:Object(o.o)(e,r,n.data),domain:r}),e===window&&!a.a.ALLOW_SAME_ORIGIN)throw new Error("Attemping to send message to self");if(Object(i.isWindowClosed)(e))throw new Error("Window is closed");var u=[],d=Object(o.g)(((t={})[a.b.WINDOW_PROPS.POSTROBOT]=n,t),null,2);return c.a.map(Object.keys(s),function(n){return c.a.try(function(){if(!a.a.ALLOWED_POST_MESSAGE_METHODS[n])throw new Error("Strategy disallowed: "+n);return s[n](e,d,r)}).then(function(){return u.push(n+": success"),!0},function(e){return u.push(n+": "+Object(o.p)(e)+"\n"),!1})}).then(function(e){var r=e.some(Boolean),t=n.type+" "+n.name+" "+(r?"success":"error")+":\n - "+u.join("\n - ")+"\n";if(!r)throw new Error(t)})})}var h=r(5);u.a.responseListeners=u.a.responseListeners||{},u.a.requestListeners=u.a.requestListeners||{},u.a.WINDOW_WILDCARD=u.a.WINDOW_WILDCARD||new function(){},u.a.erroredResponseListeners=u.a.erroredResponseListeners||{};var O,g="__domain_regex__";function y(e){return u.a.responseListeners[e]}function v(e){delete u.a.responseListeners[e]}function E(e){return Boolean(u.a.erroredResponseListeners[e])}function b(e){var n=e.name,r=e.win,t=e.domain;if(r===a.b.WILDCARD&&(r=null),t===a.b.WILDCARD&&(t=null),!n)throw new Error("Name required to get request listener");var o=u.a.requestListeners[n];if(o)for(var c=0,s=[r,u.a.WINDOW_WILDCARD],d=null==s?0:s.length;c<d;c++){var f=s[c],w=f&&o.get(f);if(w){if(t&&"string"==typeof t){if(w[t])return w[t];if(w[g])for(var l=0,m=w[g],p=null==m?0:m.length;l<p;l++){var h=m[l],O=h.regex,y=h.listener;if(Object(i.matchDomain)(O,t))return y}}if(w[a.b.WILDCARD])return w[a.b.WILDCARD]}}}var _=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e},S=((O={})[a.b.POST_MESSAGE_TYPE.ACK]=function(e,n,r){if(!E(r.hash)){var t=y(r.hash);if(!t)throw new Error("No handler found for post message ack for message: "+r.name+" from "+n+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!Object(i.matchDomain)(t.domain,n))throw new Error("Ack origin "+n+" does not match domain "+t.domain.toString());t.ack=!0}},O[a.b.POST_MESSAGE_TYPE.REQUEST]=function(e,n,r){var t=b({name:r.name,win:e,domain:n});function u(t){return r.fireAndForget||Object(i.isWindowClosed)(e)?c.a.resolve():p(e,_({target:r.originalSource,hash:r.hash,name:r.name},t),n)}return c.a.all([u({type:a.b.POST_MESSAGE_TYPE.ACK}),c.a.try(function(){if(!t)throw new Error("No handler found for post message: "+r.name+" from "+n+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!Object(i.matchDomain)(t.domain,n))throw new Error("Request origin "+n+" does not match domain "+t.domain.toString());var o=r.data;return t.handler({source:e,origin:n,data:o})}).then(function(e){return u({type:a.b.POST_MESSAGE_TYPE.RESPONSE,ack:a.b.POST_MESSAGE_ACK.SUCCESS,data:e})},function(e){var n=Object(o.p)(e).replace(/^Error: /,""),r=e.code;return u({type:a.b.POST_MESSAGE_TYPE.RESPONSE,ack:a.b.POST_MESSAGE_ACK.ERROR,error:n,code:r})})]).then(o.j).catch(function(e){if(t&&t.handleError)return t.handleError(e);throw e})},O[a.b.POST_MESSAGE_TYPE.RESPONSE]=function(e,n,r){if(!E(r.hash)){var t=y(r.hash);if(!t)throw new Error("No handler found for post message response for message: "+r.name+" from "+n+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!Object(i.matchDomain)(t.domain,n))throw new Error("Response origin "+n+" does not match domain "+Object(i.stringifyDomainPattern)(t.domain));if(v(r.hash),r.ack===a.b.POST_MESSAGE_ACK.ERROR){var o=new Error(r.error);return r.code&&(o.code=r.code),t.respond(o,null)}if(r.ack===a.b.POST_MESSAGE_ACK.SUCCESS){var u=r.data||r.response;return t.respond(null,{source:e,origin:n,data:u})}}},O),P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function T(e){if(!window||window.closed)throw new Error("Message recieved in closed window");try{if(!e.source)return}catch(e){return}var n=e.source,r=e.origin,t=function(e){var n=void 0;try{n=Object(o.f)(e)}catch(e){return}if(n&&"object"===(void 0===n?"undefined":P(n))&&null!==n&&(n=n[a.b.WINDOW_PROPS.POSTROBOT])&&"object"===(void 0===n?"undefined":P(n))&&null!==n&&n.type&&"string"==typeof n.type&&S[n.type])return n}(e.data);if(t){if(!t.sourceDomain||"string"!=typeof t.sourceDomain)throw new Error("Expected message to have sourceDomain");0!==t.sourceDomain.indexOf(a.b.MOCK_PROTOCOL)&&0!==t.sourceDomain.indexOf(a.b.FILE_PROTOCOL)||(r=t.sourceDomain),-1===u.a.receivedMessages.indexOf(t.id)&&(u.a.receivedMessages.push(t.id),Object(i.isWindowClosed)(n)&&!t.fireAndForget||(t.data&&(t.data=Object(o.b)(n,r,t.data)),S[t.type](n,r,t)))}}function A(e){try{Object(o.j)(e.source)}catch(e){return}var n={source:e.source||e.sourceElement,origin:e.origin||e.originalEvent&&e.originalEvent.origin,data:e.data};try{r(7).emulateIERestrictions(n.source,window)}catch(e){return}T(n)}function W(e){return c.a.try(function(){if(!e.name)throw new Error("Expected options.name");var n=e.name,r=void 0,t=void 0;if("string"==typeof e.window){var s=document.getElementById(e.window);if(!s)throw new Error("Expected options.window "+Object.prototype.toString.call(e.window)+" to be a valid element id");if("iframe"!==s.tagName.toLowerCase())throw new Error("Expected options.window "+Object.prototype.toString.call(e.window)+" to be an iframe");if(!s.contentWindow)throw new Error("Iframe must have contentWindow. Make sure it has a src attribute and is in the DOM.");r=s.contentWindow}else if(e.window instanceof HTMLIFrameElement){if("iframe"!==e.window.tagName.toLowerCase())throw new Error("Expected options.window "+Object.prototype.toString.call(e.window)+" to be an iframe");if(e.window&&!e.window.contentWindow)throw new Error("Iframe must have contentWindow. Make sure it has a src attribute and is in the DOM.");e.window&&e.window.contentWindow&&(r=e.window.contentWindow)}else r=e.window;if(!r)throw new Error("Expected options.window to be a window object, iframe, or iframe element id.");var d=r;t=e.domain||a.b.WILDCARD;var f=e.name+"_"+Object(o.q)();if(Object(i.isWindowClosed)(d))throw new Error("Target window is closed");var w=!1,l=u.a.requestPromises.get(d);l||(l=[],u.a.requestPromises.set(d,l));var m=c.a.try(function(){if(Object(i.isAncestor)(window,d))return Object(o.k)(d,e.timeout||a.a.CHILD_WINDOW_TIMEOUT)}).then(function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).origin;if(Object(o.e)(t)&&!e)return Object(o.n)(d)}).then(function(){var r=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).origin;if(Object(o.e)(t)){if(!Object(i.matchDomain)(t,r))throw new Error("Remote window domain "+r+" does not match regex: "+t.toString());t=r}if("string"!=typeof t&&!Array.isArray(t))throw new TypeError("Expected domain to be a string or array");var s=t;return new c.a(function(r,t){var o=void 0;if(e.fireAndForget||function(e,n){u.a.responseListeners[e]=n}(f,o={name:n,window:d,domain:s,respond:function(e,n){e||(w=!0,l.splice(l.indexOf(m,1))),e?t(e):r(n)}}),p(d,{type:a.b.POST_MESSAGE_TYPE.REQUEST,hash:f,name:n,data:e.data,fireAndForget:e.fireAndForget},s).catch(t),e.fireAndForget)return r();var c=a.a.ACK_TIMEOUT,h=e.timeout||a.a.RES_TIMEOUT,O=100;setTimeout(function r(){if(!w){if(Object(i.isWindowClosed)(d))return o.ack?t(new Error("Window closed for "+n+" before response")):t(new Error("Window closed for "+n+" before ack"));if(c=Math.max(c-O,0),-1!==h&&(h=Math.max(h-O,0)),o.ack){if(-1===h)return;O=Math.min(h,2e3)}else{if(0===c)return t(new Error("No ack for postMessage "+n+" in "+Object(i.getDomain)()+" in "+a.a.ACK_TIMEOUT+"ms"));if(0===h)return t(new Error("No response for postMessage "+n+" in "+Object(i.getDomain)()+" in "+(e.timeout||a.a.RES_TIMEOUT)+"ms"))}setTimeout(r,O)}},O)})});return m.catch(function(){!function(e){u.a.erroredResponseListeners[e]=!0}(f),v(f)}),l.push(m),m})}function j(e,n,r,t){return(t=t||{}).window=e,t.name=n,t.data=r,W(t)}function R(e,n,r){var t=Object(i.getAncestor)();return t?j(t,e,n,r):new c.a(function(e,n){return n(new Error("Window does not have a parent"))})}function D(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.window)throw new Error("Expected options.window");var n=e.window;return{send:function(r,t){return j(n,r,t,e)}}}u.a.receivedMessages=u.a.receivedMessages||[],u.a.receiveMessage=T,u.a.requestPromises=u.a.requestPromises||new h.a,u.a.send=j;var I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function M(e){if(!e.name)throw new Error("Expected options.name");if(!e.handler)throw new Error("Expected options.handler");var n=e.name,r=e.window,t=e.domain,c={handler:e.handler,handleError:e.errorHandler||function(e){throw e},window:r,domain:t||a.b.WILDCARD,name:n},s=function e(n,r){var t=n.name,i=n.win,c=n.domain;if(!t||"string"!=typeof t)throw new Error("Name required to add request listener");if(Array.isArray(i)){for(var s=[],d=0,f=i,w=null==f?0:f.length;d<w;d++){var l=f[d];s.push(e({name:t,domain:c,win:l},r))}return{cancel:function(){for(var e=0,n=null==s?0:s.length;e<n;e++)s[e].cancel()}}}if(Array.isArray(c)){for(var m=[],p=0,O=c,y=null==O?0:O.length;p<y;p++){var v=O[p];m.push(e({name:t,win:i,domain:v},r))}return{cancel:function(){for(var e=0,n=null==m?0:m.length;e<n;e++)m[e].cancel()}}}var E=b({name:t,win:i,domain:c});if(i&&i!==a.b.WILDCARD||(i=u.a.WINDOW_WILDCARD),c=c||a.b.WILDCARD,E)throw i&&c?new Error("Request listener already exists for "+t+" on domain "+c.toString()+" for "+(i===u.a.WINDOW_WILDCARD?"wildcard":"specified")+" window"):i?new Error("Request listener already exists for "+t+" for "+(i===u.a.WINDOW_WILDCARD?"wildcard":"specified")+" window"):c?new Error("Request listener already exists for "+t+" on domain "+c.toString()):new Error("Request listener already exists for "+t);var _=u.a.requestListeners,S=_[t];S||(S=new h.a,_[t]=S);var P=S.get(i);P||(P={},S.set(i,P));var T=c.toString(),A=P[g],W=void 0;return Object(o.e)(c)?(A||(A=[],P[g]=A),W={regex:c,listener:r},A.push(W)):P[T]=r,{cancel:function(){P&&(delete P[T],i&&0===Object.keys(P).length&&S.delete(i),W&&A.splice(A.indexOf(W,1)))}}}({name:n,win:r,domain:t},c);if(e.once){var d=c.handler;c.handler=Object(o.l)(function(){return s.cancel(),d.apply(this,arguments)})}if(c.window&&e.errorOnClose)var f=Object(o.m)(function(){r&&"object"===(void 0===r?"undefined":I(r))&&Object(i.isWindowClosed)(r)&&(f.cancel(),c.handleError(new Error("Post message target window is closed")))},50);return{cancel:function(){s.cancel()}}}function L(e,n,r){return"function"==typeof n&&(r=n,n={}),(n=n||{}).name=e,n.handler=r||n.handler,M(n)}function C(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments[2];"function"==typeof n&&(r=n,n={}),n=n||{},r=r||n.handler;var t=n.errorHandler,o=new c.a(function(o,i){(n=n||{}).name=e,n.once=!0,n.handler=function(e){if(o(e),r)return r(e)},n.errorHandler=function(e){if(i(e),t)return t(e)}}),i=M(n);return o.cancel=i.cancel,o}function N(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{on:function(n,r){return L(n,e,r)}}}function B(){delete window[a.b.WINDOW_PROPS.POSTROBOT],window.removeEventListener("message",A)}u.a.on=L;var x=Object(i.getAncestor)();function k(e){var n=u.a.requestPromises.get(e);if(n)for(var r=0,t=null==n?0:n.length;r<t;r++)n[r].reject(new Error("No response from window - cleaned up"));u.a.popupWindowsByWin&&u.a.popupWindowsByWin.delete(e),u.a.remoteWindows&&u.a.remoteWindows.delete(e),u.a.requestPromises.delete(e),u.a.methods.delete(e),u.a.readyPromises.delete(e)}var G=r(11);function U(){u.a.initialized||(Object(o.a)(window,"message",A),r(6).openTunnelToOpener(),Object(o.d)(),Object(o.h)({on:L,send:j})),u.a.initialized=!0}U(),r.d(n,"cleanUpWindow",function(){return k}),r.d(n,"Promise",function(){return c.a}),r.d(n,"bridge",function(){return G}),r.d(n,"init",function(){return U}),r.d(n,"parent",function(){return x}),r.d(n,"send",function(){return j}),r.d(n,"request",function(){return W}),r.d(n,"sendToParent",function(){return R}),r.d(n,"client",function(){return D}),r.d(n,"on",function(){return L}),r.d(n,"listen",function(){return M}),r.d(n,"once",function(){return C}),r.d(n,"listener",function(){return N}),r.d(n,"CONFIG",function(){return a.a}),r.d(n,"CONSTANTS",function(){return a.b}),r.d(n,"disable",function(){return B}),n.default=t},function(e,n,r){"use strict";function t(e){return"[object RegExp]"===Object.prototype.toString.call(e)}n.h=u,n.g=c,n.a=d,n.c=f,n.j=w,n.o=l,n.f=p,n.r=function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{if(e===window)return!1}catch(e){return!0}try{if(!e)return!0}catch(e){return!0}try{if(e.closed)return!0}catch(e){return!e||e.message!==i}if(n&&l(e))try{if(e.mockclosed)return!0}catch(e){}try{if(!e.parent||!e.top)return!0}catch(e){}var r=function(e,n){for(var r=0;r<e.length;r++)try{if(e[r]===n)return r}catch(e){}return-1}(y,e);if(-1!==r){var t=v[r];if(t&&function(e){if(!e.contentWindow)return!0;if(!e.parentNode)return!0;var n=e.ownerDocument;return!(!n||!n.body||n.body.contains(e))}(t))return!0}return!1},n.i=function(e){return(e=e||window).navigator.mockUserAgent||e.navigator.userAgent},n.e=function(e,n){for(var r=p(e),t=0,o=null==r?0:r.length;t<o;t++){var i=r[t];try{if(l(i)&&i.name===n&&-1!==r.indexOf(i))return i}catch(e){}}try{if(-1!==r.indexOf(e.frames[n]))return e.frames[n]}catch(e){}try{if(-1!==r.indexOf(e[n]))return e[n]}catch(e){}},n.m=function(e,n){return e===c(n)},n.b=E,n.k=function(e,n){var r=E(n);if(r)return r===e;if(n===e)return!1;if(O(n)===n)return!1;for(var t=0,o=p(e),i=null==o?0:o.length;t<i;t++)if(o[t]===n)return!0;return!1},n.n=function(){return Boolean(c(window))},n.l=function(){return Boolean(u(window))},n.p=function(e,n){var r=O(e)||e,t=O(n)||n;try{if(r&&t)return r===t}catch(e){}var o=g(e),i=g(n);if(b(o,i))return!0;var a=c(r),u=c(t);return!(a&&b(g(a),i)||(u&&b(g(u),o),1))},n.s=function e(n,r){if("string"==typeof n){if("string"==typeof r)return n===o.WILDCARD||r===n;if(t(r))return!1;if(Array.isArray(r))return!1}return t(n)?t(r)?n.toString()===r.toString():!Array.isArray(r)&&Boolean(r.match(n)):!!Array.isArray(n)&&(Array.isArray(r)?JSON.stringify(n)===JSON.stringify(r):!t(r)&&n.some(function(n){return e(n,r)}))},n.t=function(e){return Array.isArray(e)?"("+e.join(" | ")+")":t(e)?"RegExp("+e.toString():e.toString()},n.d=function(e){return e.match(/^(https?|mock|file):\/\//)?e.split("/").slice(0,3).join("/"):f()},n.q=function(e){try{if(e===window)return!0}catch(e){if(e&&e.message===i)return!0}try{if("[object Window]"===Object.prototype.toString.call(e))return!0}catch(e){if(e&&e.message===i)return!0}try{if(window.Window&&e instanceof window.Window)return!0}catch(e){if(e&&e.message===i)return!0}try{if(e&&e.self===e)return!0}catch(e){if(e&&e.message===i)return!0}try{if(e&&e.parent===e)return!0}catch(e){if(e&&e.message===i)return!0}try{if(e&&e.top===e)return!0}catch(e){if(e&&e.message===i)return!0}try{e&&e.__cross_domain_utils_window_check__}catch(e){return!0}return!1};var o={MOCK_PROTOCOL:"mock:",FILE_PROTOCOL:"file:",ABOUT_PROTOCOL:"about:",WILDCARD:"*"},i="Call was rejected by callee.\r\n";function a(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).location.protocol===o.ABOUT_PROTOCOL}function u(e){if(e)try{if(e.parent&&e.parent!==e)return e.parent}catch(e){}}function c(e){if(e&&!u(e))try{return e.opener}catch(e){}}function s(e){try{return e&&e.location&&e.location.href,!0}catch(e){}return!1}function d(e){var n=(e=e||window).location;if(!n)throw new Error("Can not read window location");var r=n.protocol;if(!r)throw new Error("Can not read window protocol");if(r===o.FILE_PROTOCOL)return o.FILE_PROTOCOL+"//";if(r===o.ABOUT_PROTOCOL){var t=u(e);return t&&s(t)?d(t):o.ABOUT_PROTOCOL+"//"}var i=n.host;if(!i)throw new Error("Can not read window host");return r+"//"+i}function f(e){var n=d(e=e||window);return n&&e.mockDomain&&0===e.mockDomain.indexOf(o.MOCK_PROTOCOL)?e.mockDomain:n}function w(e){try{if(e===window)return!0}catch(e){}try{var n=Object.getOwnPropertyDescriptor(e,"location");if(n&&!1===n.enumerable)return!1}catch(e){}try{if(a(e)&&s(e))return!0}catch(e){}try{if(d(e)===d(window))return!0}catch(e){}return!1}function l(e){if(!w(e))return!1;try{if(e===window)return!0;if(a(e)&&s(e))return!0;if(f(window)===f(e))return!0}catch(e){}return!1}function m(e,n){if(!e||!n)return!1;var r=u(n);return r?r===e:-1!==function(e){var n=[];try{for(;e.parent!==e;)n.push(e.parent),e=e.parent}catch(e){}return n}(n).indexOf(e)}function p(e){var n=[],r=void 0;try{r=e.frames}catch(n){r=e}var t=void 0;try{t=r.length}catch(e){}if(0===t)return n;if(t){for(var o=0;o<t;o++){var i=void 0;try{i=r[o]}catch(e){continue}n.push(i)}return n}for(var a=0;a<100;a++){var u=void 0;try{u=r[a]}catch(e){return n}if(!u)return n;n.push(u)}return n}function h(e){for(var n=[],r=0,t=p(e),o=null==t?0:t.length;r<o;r++){var i=t[r];n.push(i);for(var a=0,u=h(i),c=null==u?0:u.length;a<c;a++){var s=u[a];n.push(s)}}return n}function O(e){if(e){try{if(e.top)return e.top}catch(e){}if(u(e)===e)return e;try{if(m(window,e)&&window.top)return window.top}catch(e){}try{if(m(e,window)&&window.top)return window.top}catch(e){}for(var n=0,r=h(e),t=null==r?0:r.length;n<t;n++){var o=r[n];try{if(o.top)return o.top}catch(e){}if(u(o)===o)return o}}}function g(e){var n=O(e);if(!n)throw new Error("Can not determine top window");return[].concat(h(n),[n])}var y=[],v=[];function E(e){return c(e=e||window)||u(e)||void 0}function b(e,n){for(var r=0,t=null==e?0:e.length;r<t;r++)for(var o=e[r],i=0,a=null==n?0:n.length;i<a;i++)if(o===n[i])return!0;return!1}},function(e,n){},function(e,n,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t=r(6);r.d(n,"openBridge",function(){return t.openBridge}),r.d(n,"linkUrl",function(){return t.linkUrl}),r.d(n,"isBridge",function(){return t.isBridge}),r.d(n,"needsBridge",function(){return t.needsBridge}),r.d(n,"needsBridgeForBrowser",function(){return t.needsBridgeForBrowser}),r.d(n,"hasBridge",function(){return t.hasBridge}),r.d(n,"needsBridgeForWin",function(){return t.needsBridgeForWin}),r.d(n,"needsBridgeForDomain",function(){return t.needsBridgeForDomain}),r.d(n,"openTunnelToOpener",function(){return t.openTunnelToOpener}),r.d(n,"destroyBridges",function(){return t.destroyBridges})}])});
//# sourceMappingURL=post-robot.ie.min.js.map
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("postRobot",[],n):"object"==typeof exports?exports.postRobot=n():e.postRobot=n()}("undefined"!=typeof self?self:this,function(){return function(e){var n={};function r(t){if(n[t])return n[t].exports;var o=n[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=n,r.d=function(e,n,t){r.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:t})},r.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(n,"a",n),n},r.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},r.p="",r(r.s=9)}([function(e,n,r){"use strict";var t=r(10);r.d(n,"getActualDomain",function(){return t.a}),r.d(n,"getAncestor",function(){return t.b}),r.d(n,"getDomain",function(){return t.c}),r.d(n,"getDomainFromUrl",function(){return t.d}),r.d(n,"getFrameByName",function(){return t.e}),r.d(n,"getFrames",function(){return t.f}),r.d(n,"getOpener",function(){return t.g}),r.d(n,"getParent",function(){return t.h}),r.d(n,"getUserAgent",function(){return t.i}),r.d(n,"isActuallySameDomain",function(){return t.j}),r.d(n,"isAncestor",function(){return t.k}),r.d(n,"isIframe",function(){return t.l}),r.d(n,"isOpener",function(){return t.m}),r.d(n,"isPopup",function(){return t.n}),r.d(n,"isSameDomain",function(){return t.o}),r.d(n,"isSameTopWindow",function(){return t.p}),r.d(n,"isWindow",function(){return t.q}),r.d(n,"isWindowClosed",function(){return t.r}),r.d(n,"matchDomain",function(){return t.s}),r.d(n,"stringifyDomainPattern",function(){return t.t});var o=r(11);r.n(o),r(7)},function(e,n,r){"use strict";var t,o={POST_MESSAGE_TYPE:{REQUEST:"postrobot_message_request",RESPONSE:"postrobot_message_response",ACK:"postrobot_message_ack"},POST_MESSAGE_ACK:{SUCCESS:"success",ERROR:"error"},POST_MESSAGE_NAMES:{METHOD:"postrobot_method",HELLO:"postrobot_ready",OPEN_TUNNEL:"postrobot_open_tunnel"},WINDOW_TYPES:{FULLPAGE:"fullpage",POPUP:"popup",IFRAME:"iframe"},WINDOW_PROPS:{POSTROBOT:"__postRobot__"},SERIALIZATION_TYPES:{METHOD:"postrobot_method",ERROR:"postrobot_error",PROMISE:"postrobot_promise",ZALGO_PROMISE:"postrobot_zalgo_promise",REGEX:"regex"},SEND_STRATEGIES:{POST_MESSAGE:"postrobot_post_message",BRIDGE:"postrobot_bridge",GLOBAL:"postrobot_global"},MOCK_PROTOCOL:"mock:",FILE_PROTOCOL:"file:",BRIDGE_NAME_PREFIX:"__postrobot_bridge__",POSTROBOT_PROXY:"__postrobot_proxy__",WILDCARD:"*"},i={METHOD:"postrobot_method",HELLO:"postrobot_hello",OPEN_TUNNEL:"postrobot_open_tunnel"},a=Object.keys(i).map(function(e){return i[e]}),u={ALLOW_POSTMESSAGE_POPUP:!("__ALLOW_POSTMESSAGE_POPUP__"in window)||window.__ALLOW_POSTMESSAGE_POPUP__,BRIDGE_TIMEOUT:5e3,CHILD_WINDOW_TIMEOUT:5e3,ACK_TIMEOUT:-1!==window.navigator.userAgent.match(/MSIE/i)?1e4:2e3,RES_TIMEOUT:-1,ALLOWED_POST_MESSAGE_METHODS:(t={},t[o.SEND_STRATEGIES.POST_MESSAGE]=!0,t[o.SEND_STRATEGIES.BRIDGE]=!0,t[o.SEND_STRATEGIES.GLOBAL]=!0,t),ALLOW_SAME_ORIGIN:!1};0===window.location.href.indexOf(o.FILE_PROTOCOL)&&(u.ALLOW_POSTMESSAGE_POPUP=!0),r.d(n,"a",function(){return u}),r.d(n,"b",function(){return o}),r.d(n,!1,function(){return i}),r.d(n,!1,function(){return a})},function(e,n,r){"use strict";function t(e){try{if(!e)return!1;if("undefined"!=typeof Promise&&e instanceof Promise)return!0;if("undefined"!=typeof window&&window.Window&&e instanceof window.Window)return!1;if("undefined"!=typeof window&&window.constructor&&e instanceof window.constructor)return!1;var n={}.toString;if(n){var r=n.call(e);if("[object Window]"===r||"[object global]"===r||"[object DOMWindow]"===r)return!1}if("function"==typeof e.then)return!0}catch(e){return!1}return!1}function o(){var e=void 0;if("undefined"!=typeof window)e=window;else{if("undefined"==typeof window)throw new TypeError("Can not find global");e=window}var n=e.__zalgopromise__=e.__zalgopromise__||{};return n.flushPromises=n.flushPromises||[],n.activeCount=n.activeCount||0,n.possiblyUnhandledPromiseHandlers=n.possiblyUnhandledPromiseHandlers||[],n.dispatchedErrors=n.dispatchedErrors||[],n}var i=function(){function e(n){var r=this;if(function(n,r){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}(this),this.resolved=!1,this.rejected=!1,this.errorHandled=!1,this.handlers=[],n){var t=void 0,o=void 0,i=!1,a=!1,u=!1;try{n(function(e){u?r.resolve(e):(i=!0,t=e)},function(e){u?r.reject(e):(a=!0,o=e)})}catch(e){return void this.reject(e)}u=!0,i?this.resolve(t):a&&this.reject(o)}}return e.prototype.resolve=function(e){if(this.resolved||this.rejected)return this;if(t(e))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=e,this.dispatch(),this},e.prototype.reject=function(e){var n=this;if(this.resolved||this.rejected)return this;if(t(e))throw new Error("Can not reject promise with another promise");if(!e){var r=e&&"function"==typeof e.toString?e.toString():Object.prototype.toString.call(e);e=new Error("Expected reject to be called with Error, got "+r)}return this.rejected=!0,this.error=e,this.errorHandled||setTimeout(function(){n.errorHandled||function(e,n){if(-1===o().dispatchedErrors.indexOf(e)){o().dispatchedErrors.push(e),setTimeout(function(){throw e},1);for(var r=0;r<o().possiblyUnhandledPromiseHandlers.length;r++)o().possiblyUnhandledPromiseHandlers[r](e,n)}}(e,n)},1),this.dispatch(),this},e.prototype.asyncReject=function(e){return this.errorHandled=!0,this.reject(e),this},e.prototype.dispatch=function(){var n=this,r=this.dispatching,i=this.resolved,a=this.rejected,u=this.handlers;if(!r&&(i||a)){this.dispatching=!0,o().activeCount+=1;for(var c=function(r){var o=u[r],c=o.onSuccess,s=o.onError,d=o.promise,f=void 0;if(i)try{f=c?c(n.value):n.value}catch(e){return d.reject(e),"continue"}else if(a){if(!s)return d.reject(n.error),"continue";try{f=s(n.error)}catch(e){return d.reject(e),"continue"}}f instanceof e&&(f.resolved||f.rejected)?(f.resolved?d.resolve(f.value):d.reject(f.error),f.errorHandled=!0):t(f)?f instanceof e&&(f.resolved||f.rejected)?f.resolved?d.resolve(f.value):d.reject(f.error):f.then(function(e){d.resolve(e)},function(e){d.reject(e)}):d.resolve(f)},s=0;s<u.length;s++)c(s);u.length=0,this.dispatching=!1,o().activeCount-=1,0===o().activeCount&&e.flushQueue()}},e.prototype.then=function(n,r){if(n&&"function"!=typeof n&&!n.call)throw new Error("Promise.then expected a function for success handler");if(r&&"function"!=typeof r&&!r.call)throw new Error("Promise.then expected a function for error handler");var t=new e;return this.handlers.push({promise:t,onSuccess:n,onError:r}),this.errorHandled=!0,this.dispatch(),t},e.prototype.catch=function(e){return this.then(void 0,e)},e.prototype.finally=function(n){if(n&&"function"!=typeof n&&!n.call)throw new Error("Promise.finally expected a function");return this.then(function(r){return e.try(n).then(function(){return r})},function(r){return e.try(n).then(function(){throw r})})},e.prototype.timeout=function(e,n){var r=this;if(this.resolved||this.rejected)return this;var t=setTimeout(function(){r.resolved||r.rejected||r.reject(n||new Error("Promise timed out after "+e+"ms"))},e);return this.then(function(e){return clearTimeout(t),e})},e.prototype.toPromise=function(){if("undefined"==typeof Promise)throw new TypeError("Could not find Promise");return Promise.resolve(this)},e.resolve=function(n){return n instanceof e?n:t(n)?new e(function(e,r){return n.then(e,r)}):(new e).resolve(n)},e.reject=function(n){return(new e).reject(n)},e.asyncReject=function(n){return(new e).asyncReject(n)},e.all=function(n){var r=new e,o=n.length,i=[];if(!o)return r.resolve(i),r;for(var a=function(a){var u=n[a];if(u instanceof e){if(u.resolved)return i[a]=u.value,o-=1,"continue"}else if(!t(u))return i[a]=u,o-=1,"continue";e.resolve(u).then(function(e){i[a]=e,0==(o-=1)&&r.resolve(i)},function(e){r.reject(e)})},u=0;u<n.length;u++)a(u);return 0===o&&r.resolve(i),r},e.hash=function(n){var r={};return e.all(Object.keys(n).map(function(t){return e.resolve(n[t]).then(function(e){r[t]=e})})).then(function(){return r})},e.map=function(n,r){return e.all(n.map(r))},e.onPossiblyUnhandledException=function(e){return function(e){return o().possiblyUnhandledPromiseHandlers.push(e),{cancel:function(){o().possiblyUnhandledPromiseHandlers.splice(o().possiblyUnhandledPromiseHandlers.indexOf(e),1)}}}(e)},e.try=function(n,r,t){if(n&&"function"!=typeof n&&!n.call)throw new Error("Promise.try expected a function");var o=void 0;try{o=n.apply(r,t||[])}catch(n){return e.reject(n)}return e.resolve(o)},e.delay=function(n){return new e(function(e){setTimeout(e,n)})},e.isPromise=function(n){return!!(n&&n instanceof e)||t(n)},e.flush=function(){var n=new e;return o().flushPromises.push(n),0===o().activeCount&&e.flushQueue(),n},e.flushQueue=function(){var e=o().flushPromises;o().flushPromises=[];for(var n=0,r=null==e?0:e.length;n<r;n++)e[n].resolve()},e}();r.d(n,"a",function(){return i})},function(e,n,r){"use strict";r.d(n,"a",function(){return o});var t=r(1),o=window[t.b.WINDOW_PROPS.POSTROBOT]=window[t.b.WINDOW_PROPS.POSTROBOT]||{};o.registerSelf=function(){}},function(e,n,r){"use strict";var t=r(5),o=r(0),i=r(1),a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function u(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(n>=3)return"stringifyError stack overflow";try{if(!e)return"<unknown error: "+Object.prototype.toString.call(e)+">";if("string"==typeof e)return e;if(e instanceof Error){var r=e&&e.stack,t=e&&e.message;if(r&&t)return-1!==r.indexOf(t)?r:t+"\n"+r;if(r)return r;if(t)return t}return"function"==typeof e.toString?e.toString():Object.prototype.toString.call(e)}catch(e){return"Error while stringifying error: "+u(e,n+1)}}var c=function(e){if(!e)return e;var n=!1;return function(){if(!n)return n=!0,e.apply(this,arguments)}};function s(){}function d(e,n,r){return e.addEventListener?e.addEventListener(n,r):e.attachEvent("on"+n,r),{cancel:function(){e.removeEventListener?e.removeEventListener(n,r):e.detachEvent("on"+n,r)}}}function f(){var e="0123456789abcdef";return"xxxxxxxxxx".replace(/./g,function(){return e.charAt(Math.floor(Math.random()*e.length))})}function w(e,n){for(var r=0;r<e.length;r++)n(e[r],r)}function l(e,n){for(var r in e)e.hasOwnProperty(r)&&n(e[r],r)}function m(e,n){Array.isArray(e)?w(e,n):"object"===(void 0===e?"undefined":a(e))&&null!==e&&l(e,n)}function h(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(r>=100)throw new Error("Self-referential object passed, or object contained too many layers");var t=void 0;if("object"!==(void 0===e?"undefined":a(e))||null===e||Array.isArray(e)){if(!Array.isArray(e))throw new TypeError("Invalid type: "+(void 0===e?"undefined":a(e)));t=[]}else t={};return m(e,function(e,o){var i=n(e,o);void 0!==i?t[o]=i:"object"===(void 0===e?"undefined":a(e))&&null!==e?t[o]=h(e,n,r+1):t[o]=e}),t}function p(e,n){var r=void 0;return r=setTimeout(function t(){r=setTimeout(t,n),e.call()},n),{cancel:function(){clearTimeout(r)}}}function O(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var g=function(e){var n=new t.a;return function(r){var t=n.get(r);return void 0!==t?t:(void 0!==(t=e.call(this,r))&&n.set(r,t),t)}};function v(){return Object(o.isPopup)()?i.b.WINDOW_TYPES.POPUP:Object(o.isIframe)()?i.b.WINDOW_TYPES.IFRAME:i.b.WINDOW_TYPES.FULLPAGE}function y(e,n,r){var t=void 0,o=void 0;try{if("{}"!==JSON.stringify({})&&(t=Object.prototype.toJSON,delete Object.prototype.toJSON),"{}"!==JSON.stringify({}))throw new Error("Can not correctly serialize JSON objects");if("[]"!==JSON.stringify([])&&(o=Array.prototype.toJSON,delete Array.prototype.toJSON),"[]"!==JSON.stringify([]))throw new Error("Can not correctly serialize JSON objects")}catch(e){throw new Error("Can not repair JSON.stringify: "+e.message)}var i=JSON.stringify.call(this,e,n,r);try{t&&(Object.prototype.toJSON=t),o&&(Array.prototype.toJSON=o)}catch(e){throw new Error("Can not repair JSON.stringify: "+e.message)}return i}function E(e){return JSON.parse(e)}function b(){return!!Object(o.getUserAgent)(window).match(/MSIE|trident|edge\/12|edge\/13/i)||!i.a.ALLOW_POSTMESSAGE_POPUP}var _=r(2),S=r(3),P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};S.a.methods=S.a.methods||new t.a;var T=c(function(){S.a.on(i.b.POST_MESSAGE_NAMES.METHOD,{origin:i.b.WILDCARD},function(e){var n=e.source,r=e.origin,t=e.data,i=S.a.methods.get(n);if(!i)throw new Error("Could not find any methods this window has privileges to call");var a=i[t.id];if(!a)throw new Error("Could not find method with id: "+t.id);if(!Object(o.matchDomain)(a.domain,r))throw new Error("Method domain "+a.domain+" does not match origin "+r);return _.a.try(function(){return a.method.apply({source:n,origin:r,data:t},t.args)}).then(function(e){return{result:e,id:t.id,name:t.name}})})});function A(e,n){return"object"===(void 0===e?"undefined":P(e))&&null!==e&&e.__type__===n}function j(e,n,r,t){var o=f(),a=S.a.methods.get(e);return a||(a={},S.a.methods.set(e,a)),a[o]={domain:n,method:r},{__type__:i.b.SERIALIZATION_TYPES.METHOD,__id__:o,__name__:t}}function W(e,n,r){return h({obj:r},function(r,t){return"function"==typeof r?j(e,n,r,t.toString()):r instanceof Error?(o=r,{__type__:i.b.SERIALIZATION_TYPES.ERROR,__message__:u(o),__code__:o.code}):window.Promise&&r instanceof window.Promise?function(e,n,r,t){return{__type__:i.b.SERIALIZATION_TYPES.PROMISE,__then__:j(e,n,function(e,n){return r.then(e,n)},t+".then")}}(e,n,r,t.toString()):_.a.isPromise(r)?function(e,n,r,t){return{__type__:i.b.SERIALIZATION_TYPES.ZALGO_PROMISE,__then__:j(e,n,function(e,n){return r.then(e,n)},t+".then")}}(e,n,r,t.toString()):O(r)?(a=r,{__type__:i.b.SERIALIZATION_TYPES.REGEX,__source__:a.source}):void 0;var o,a}).obj}function R(e,n,r){function t(){var t=Array.prototype.slice.call(arguments);return S.a.send(e,i.b.POST_MESSAGE_NAMES.METHOD,{id:r.__id__,name:r.__name__,args:t},{domain:n,timeout:-1}).then(function(e){return e.data.result},function(e){throw e})}return t.__name__=r.__name__,t.__xdomain__=!0,t.source=e,t.origin=n,t}function D(e,n,r){var t=new Error(r.__message__);return r.__code__&&(t.code=r.__code__),t}function I(e,n,r){return new _.a(function(t,o){return R(e,n,r.__then__)(t,o)})}function M(e,n,r){return window.Promise?new window.Promise(function(t,o){return R(e,n,r.__then__)(t,o)}):I(e,n,r)}function N(e,n,r){return new RegExp(r.__source__)}function L(e,n,r){return h({obj:r},function(r){if("object"===(void 0===r?"undefined":P(r))&&null!==r)return A(r,i.b.SERIALIZATION_TYPES.METHOD)?R(e,n,r):A(r,i.b.SERIALIZATION_TYPES.ERROR)?D(0,0,r):A(r,i.b.SERIALIZATION_TYPES.PROMISE)?M(e,n,r):A(r,i.b.SERIALIZATION_TYPES.ZALGO_PROMISE)?I(e,n,r):A(r,i.b.SERIALIZATION_TYPES.REGEX)?N(0,0,r):void 0}).obj}function C(e){S.a.on(i.b.POST_MESSAGE_NAMES.HELLO,{domain:i.b.WILDCARD},function(n){var r=n.source,t=n.origin;return e({source:r,origin:t})})}function B(e){return S.a.send(e,i.b.POST_MESSAGE_NAMES.HELLO,{},{domain:i.b.WILDCARD,timeout:-1}).then(function(e){return{origin:e.origin}})}function x(){C(function(e){var n=e.source,r=e.origin,t=S.a.readyPromises.get(n)||new _.a;t.resolve({origin:r}),S.a.readyPromises.set(n,t)});var e=Object(o.getAncestor)();e&&B(e).catch(s)}function k(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Window",t=S.a.readyPromises.get(e);return t||(t=new _.a,S.a.readyPromises.set(e,t),-1!==n&&setTimeout(function(){return t.reject(new Error(r+" did not load after "+n+"ms"))},n),t)}S.a.readyPromises=S.a.readyPromises||new t.a,r.d(n,"p",function(){return u}),r.d(n,"l",function(){return c}),r.d(n,"j",function(){return s}),r.d(n,"a",function(){return d}),r.d(n,"q",function(){return f}),r.d(n,!1,function(){return w}),r.d(n,!1,function(){return l}),r.d(n,!1,function(){return m}),r.d(n,!1,function(){return h}),r.d(n,"m",function(){return p}),r.d(n,"e",function(){return O}),r.d(n,"r",function(){return g}),r.d(n,"c",function(){return v}),r.d(n,"g",function(){return y}),r.d(n,"f",function(){return E}),r.d(n,"i",function(){return b}),r.d(n,"h",function(){return T}),r.d(n,!1,function(){return j}),r.d(n,"o",function(){return W}),r.d(n,!1,function(){return R}),r.d(n,!1,function(){return D}),r.d(n,!1,function(){return I}),r.d(n,!1,function(){return M}),r.d(n,!1,function(){return N}),r.d(n,"b",function(){return L}),r.d(n,!1,function(){return C}),r.d(n,"n",function(){return B}),r.d(n,"d",function(){return x}),r.d(n,"k",function(){return k})},function(e,n,r){"use strict";r.d({},"WeakMap",function(){return u});var t=r(0);function o(e,n){for(var r=0;r<e.length;r++)try{if(e[r]===n)return r}catch(e){}return-1}var i=Object.defineProperty,a=Date.now()%1e9,u=function(){function e(){if(function(n,r){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}(this),a+=1,this.name="__weakmap_"+(1e9*Math.random()>>>0)+"__"+a,function(){if("undefined"==typeof WeakMap)return!1;if(void 0===Object.freeze)return!1;try{var e=new WeakMap,n={};return Object.freeze(n),e.set(n,"__testvalue__"),"__testvalue__"===e.get(n)}catch(e){return!1}}())try{this.weakmap=new WeakMap}catch(e){}this.keys=[],this.values=[]}return e.prototype._cleanupClosedWindows=function(){for(var e=this.weakmap,n=this.keys,r=0;r<n.length;r++){var o=n[r];if(Object(t.isWindow)(o)&&Object(t.isWindowClosed)(o)){if(e)try{e.delete(o)}catch(e){}n.splice(r,1),this.values.splice(r,1),r-=1}}},e.prototype.isSafeToReadWrite=function(e){if(Object(t.isWindow)(e))return!1;try{e&&e.self,e&&e[this.name]}catch(e){return!1}return!0},e.prototype.set=function(e,n){if(!e)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{r.set(e,n)}catch(e){delete this.weakmap}if(this.isSafeToReadWrite(e)){var t=this.name,a=e[t];a&&a[0]===e?a[1]=n:i(e,t,{value:[e,n],writable:!0})}else{this._cleanupClosedWindows();var u=this.keys,c=this.values,s=o(u,e);-1===s?(u.push(e),c.push(n)):c[s]=n}},e.prototype.get=function(e){if(!e)throw new Error("WeakMap expected key");var n=this.weakmap;if(n)try{if(n.has(e))return n.get(e)}catch(e){delete this.weakmap}if(!this.isSafeToReadWrite(e)){this._cleanupClosedWindows();var r=o(this.keys,e);if(-1===r)return;return this.values[r]}var t=e[this.name];if(t&&t[0]===e)return t[1]},e.prototype.delete=function(e){if(!e)throw new Error("WeakMap expected key");var n=this.weakmap;if(n)try{n.delete(e)}catch(e){delete this.weakmap}if(this.isSafeToReadWrite(e)){var r=e[this.name];r&&r[0]===e&&(r[0]=r[1]=void 0)}else{this._cleanupClosedWindows();var t=this.keys,i=o(t,e);-1!==i&&(t.splice(i,1),this.values.splice(i,1))}},e.prototype.has=function(e){if(!e)throw new Error("WeakMap expected key");var n=this.weakmap;if(n)try{if(n.has(e))return!0}catch(e){delete this.weakmap}if(this.isSafeToReadWrite(e)){var r=e[this.name];return!(!r||r[0]!==e)}return this._cleanupClosedWindows(),-1!==o(this.keys,e)},e.prototype.getOrSet=function(e,n){if(this.has(e))return this.get(e);var r=n();return this.set(e,r),r},e}();r.d(n,"a",function(){return u})},function(e,n,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t=r(2),o=r(0),i=r(1),a=r(4),u=r(3);function c(e){try{u.a.tunnelWindows[e]&&delete u.a.tunnelWindows[e].source}catch(e){}delete u.a.tunnelWindows[e]}u.a.tunnelWindows=u.a.tunnelWindows||{},u.a.tunnelWindowId=0,u.a.openTunnelToParent=function(e){var n=e.name,r=e.source,t=e.canary,s=e.sendMessage,d=Object(o.getParent)(window);if(!d)throw new Error("No parent window found to open tunnel to");var f=function(e){var n=e.name,r=e.source,t=e.canary,i=e.sendMessage;return function(){for(var e=u.a.tunnelWindows,n=0,r=Object.keys(e),t=null==r?0:r.length;n<t;n++){var i=r[n],s=e[i];try{Object(a.j)(s.source)}catch(e){c(i);continue}Object(o.isWindowClosed)(s.source)&&c(i)}}(),u.a.tunnelWindowId+=1,u.a.tunnelWindows[u.a.tunnelWindowId]={name:n,source:r,canary:t,sendMessage:i},u.a.tunnelWindowId}({name:n,source:r,canary:t,sendMessage:s});return u.a.send(d,i.b.POST_MESSAGE_NAMES.OPEN_TUNNEL,{name:n,sendMessage:function(){var e=function(e){return u.a.tunnelWindows[e]}(f);try{Object(a.j)(e&&e.source)}catch(e){return void c(f)}if(e&&e.source&&!Object(o.isWindowClosed)(e.source)){try{e.canary()}catch(e){return}e.sendMessage.apply(this,arguments)}}},{domain:i.b.WILDCARD})};var s=r(5);function d(){return!!Object(o.getUserAgent)(window).match(/MSIE|trident|edge\/12|edge\/13/i)||!i.a.ALLOW_POSTMESSAGE_POPUP}function f(e){return!Object(o.isSameTopWindow)(window,e)}function w(e,n){if(e){if(Object(o.getDomain)()!==Object(o.getDomainFromUrl)(e))return!0}else if(n&&!Object(o.isSameDomain)(n))return!0;return!1}function l(e){var n=e.win,r=e.domain;return!(!d()||r&&!w(r,n)||n&&!f(n))}function m(e){var n=(e=e||Object(o.getDomainFromUrl)(e)).replace(/[^a-zA-Z0-9]+/g,"_");return i.b.BRIDGE_NAME_PREFIX+"_"+n}function h(){return Boolean(window.name&&window.name===m(Object(o.getDomain)()))}var p=new t.a(function(e){if(window.document&&window.document.body)return e(window.document.body);var n=setInterval(function(){if(window.document&&window.document.body)return clearInterval(n),e(window.document.body)},10)});function O(e){u.a.remoteWindows.set(e,{sendMessagePromise:new t.a})}function g(e){return u.a.remoteWindows.get(e)}function v(e,n,r){var i=g(e);if(!i)throw new Error("Window not found to register sendMessage to");var a=function(t,i,a){if(t!==e)throw new Error("Remote window does not match window");if(!Object(o.matchDomain)(a,n))throw new Error("Remote domain "+a+" does not match domain "+n);r(i)};i.sendMessagePromise.resolve(a),i.sendMessagePromise=t.a.resolve(a)}function y(e,n){var r=g(e);if(!r)throw new Error("Window not found on which to reject sendMessage");r.sendMessagePromise.asyncReject(n)}function E(e,n,r){var t=Object(o.isOpener)(window,e),i=Object(o.isOpener)(e,window);if(!t&&!i)throw new Error("Can only send messages to and from parent and popup windows");var a=g(e);if(!a)throw new Error("Window not found to send message to");return a.sendMessagePromise.then(function(t){return t(e,n,r)})}u.a.remoteWindows=u.a.remoteWindows||new s.a;var b=Object(a.r)(function(e){return t.a.try(function(){for(var n=0,r=Object(o.getFrames)(e),a=null==r?0:r.length;n<a;n++){var u=r[n];try{if(u&&u!==window&&Object(o.isSameDomain)(u)&&u[i.b.WINDOW_PROPS.POSTROBOT])return u}catch(e){continue}}try{var c=Object(o.getFrameByName)(e,m(Object(o.getDomain)()));if(!c)return;return Object(o.isSameDomain)(c)&&c[i.b.WINDOW_PROPS.POSTROBOT]?c:new t.a(function(e){var n=void 0,r=void 0;n=setInterval(function(){if(c&&Object(o.isSameDomain)(c)&&c[i.b.WINDOW_PROPS.POSTROBOT])return clearInterval(n),clearTimeout(r),e(c)},100),r=setTimeout(function(){return clearInterval(n),e()},2e3)})}catch(e){}})});function _(){return t.a.try(function(){var e=Object(o.getOpener)(window);if(e&&l({win:e}))return O(e),b(e).then(function(n){return n?window.name?n[i.b.WINDOW_PROPS.POSTROBOT].openTunnelToParent({name:window.name,source:window,canary:function(){},sendMessage:function(e){try{Object(a.j)(window)}catch(e){return}if(window&&!window.closed)try{u.a.receiveMessage({data:e,origin:this.origin,source:this.source})}catch(e){t.a.reject(e)}}}).then(function(n){var r=n.source,t=n.origin,o=n.data;if(r!==e)throw new Error("Source does not match opener");v(r,t,o.sendMessage)}).catch(function(n){throw y(e,n),n}):y(e,new Error("Can not register with opener: window does not have a name")):y(e,new Error("Can not register with opener: no bridge found in opener"))})})}function S(e,n){return n=n||Object(o.getDomainFromUrl)(e),Boolean(u.a.bridges[n])}function P(e,n){return n=n||Object(o.getDomainFromUrl)(e),u.a.bridges[n]?u.a.bridges[n]:(u.a.bridges[n]=t.a.try(function(){if(Object(o.getDomain)()===n)throw new Error("Can not open bridge on the same domain as current domain: "+n);var r=m(n);if(Object(o.getFrameByName)(window,r))throw new Error("Frame with name "+r+" already exists on page");var c=function(e,n){var r=document.createElement("iframe");return r.setAttribute("name",e),r.setAttribute("id",e),r.setAttribute("style","display: none; margin: 0; padding: 0; border: 0px none; overflow: hidden;"),r.setAttribute("frameborder","0"),r.setAttribute("border","0"),r.setAttribute("scrolling","no"),r.setAttribute("allowTransparency","true"),r.setAttribute("tabindex","-1"),r.setAttribute("hidden","true"),r.setAttribute("title",""),r.setAttribute("role","presentation"),r.src=n,r}(r,e);return u.a.bridgeFrames[n]=c,p.then(function(r){r.appendChild(c);var o=c.contentWindow;return function(e,n){u.a.on(i.b.POST_MESSAGE_NAMES.OPEN_TUNNEL,{window:e,domain:n},function(e){var r=e.origin,o=e.data;if(r!==n)throw new Error("Domain "+n+" does not match origin "+r);if(!o.name)throw new Error("Register window expected to be passed window name");if(!o.sendMessage)throw new Error("Register window expected to be passed sendMessage method");if(!u.a.popupWindowsByName[o.name])throw new Error("Window with name "+o.name+" does not exist, or was not opened by this window");if(!u.a.popupWindowsByName[o.name].domain)throw new Error("We do not have a registered domain for window "+o.name);if(u.a.popupWindowsByName[o.name].domain!==r)throw new Error("Message origin "+r+" does not matched registered window origin "+u.a.popupWindowsByName[o.name].domain);return v(u.a.popupWindowsByName[o.name].win,n,o.sendMessage),{sendMessage:function(e){if(window&&!window.closed){var n=u.a.popupWindowsByName[o.name];if(n)try{u.a.receiveMessage({data:e,origin:n.domain,source:n.win})}catch(e){t.a.reject(e)}}}}})}(o,n),new t.a(function(e,n){c.onload=e,c.onerror=n}).then(function(){return Object(a.k)(o,i.a.BRIDGE_TIMEOUT,"Bridge "+e)}).then(function(){return o})})}),u.a.bridges[n])}u.a.bridges=u.a.bridges||{},u.a.bridgeFrames=u.a.bridgeFrames||{},u.a.popupWindowsByWin=u.a.popupWindowsByWin||new s.a,u.a.popupWindowsByName=u.a.popupWindowsByName||{};var T=window.open;function A(e,n){var r=u.a.popupWindowsByWin.get(e);r&&(r.domain=Object(o.getDomainFromUrl)(n),O(e))}function j(){for(var e=0,n=Object.keys(u.a.bridgeFrames),r=null==n?0:n.length;e<r;e++){var t=n[e],o=u.a.bridgeFrames[t];o.parentNode&&o.parentNode.removeChild(o)}u.a.bridgeFrames={},u.a.bridges={}}window.open=function(e,n,r,t){var a=e;if(e&&0===e.indexOf(i.b.MOCK_PROTOCOL)){var c=e.split("|");a=c[0],e=c[1]}a&&(a=Object(o.getDomainFromUrl)(a));var s=T.call(this,e,n,r,t);if(!s)return s;e&&O(s);for(var d=0,f=Object.keys(u.a.popupWindowsByName),w=null==f?0:f.length;d<w;d++){var l=f[d];Object(o.isWindowClosed)(u.a.popupWindowsByName[l].win)&&delete u.a.popupWindowsByName[l]}if(n&&s){var m=u.a.popupWindowsByWin.get(s)||u.a.popupWindowsByName[n]||{};m.name=m.name||n,m.win=m.win||s,m.domain=m.domain||a,u.a.popupWindowsByWin.set(s,m),u.a.popupWindowsByName[n]=m}return s},r.d(n,"openTunnelToOpener",function(){return _}),r.d(n,"needsBridgeForBrowser",function(){return d}),r.d(n,"needsBridgeForWin",function(){return f}),r.d(n,"needsBridgeForDomain",function(){return w}),r.d(n,"needsBridge",function(){return l}),r.d(n,"getBridgeName",function(){return m}),r.d(n,"isBridge",function(){return h}),r.d(n,"documentBodyReady",function(){return p}),r.d(n,"registerRemoteWindow",function(){return O}),r.d(n,"findRemoteWindow",function(){return g}),r.d(n,"registerRemoteSendMessage",function(){return v}),r.d(n,"rejectRemoteSendMessage",function(){return y}),r.d(n,"sendBridgeMessage",function(){return E}),r.d(n,"hasBridge",function(){return S}),r.d(n,"openBridge",function(){return P}),r.d(n,"linkUrl",function(){return A}),r.d(n,"destroyBridges",function(){return j})},function(e,n,r){"use strict";r.d(n,"a",function(){return t}),r.d(n,"b",function(){return o});var t={MOCK:"mock:",FILE:"file:",ABOUT:"about:"},o="*"},function(e,n,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t=r(0),o=r(1);function i(e,n){if(!o.a.ALLOW_POSTMESSAGE_POPUP&&!1===Object(t.isSameTopWindow)(e,n))throw new Error("Can not send and receive post messages between two different windows (disabled to emulate IE)")}r.d(n,"emulateIERestrictions",function(){return i})},function(e,n,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t={};r.d(t,"cleanUpWindow",function(){return k}),r.d(t,"Promise",function(){return c.a}),r.d(t,"bridge",function(){return G}),r.d(t,"init",function(){return U}),r.d(t,"parent",function(){return x}),r.d(t,"send",function(){return W}),r.d(t,"request",function(){return j}),r.d(t,"sendToParent",function(){return R}),r.d(t,"client",function(){return D}),r.d(t,"on",function(){return N}),r.d(t,"listen",function(){return M}),r.d(t,"once",function(){return L}),r.d(t,"listener",function(){return C}),r.d(t,"CONFIG",function(){return a.a}),r.d(t,"CONSTANTS",function(){return a.b}),r.d(t,"disable",function(){return B});var o=r(4),i=r(0),a=r(1),u=r(3),c=r(2),s={};s[a.b.SEND_STRATEGIES.POST_MESSAGE]=function(e,n,t){try{r(8).emulateIERestrictions(window,e)}catch(e){return}(Array.isArray(t)?t:"string"==typeof t?[t]:[a.b.WILDCARD]).map(function(n){if(0===n.indexOf(a.b.MOCK_PROTOCOL)){if(window.location.protocol===a.b.FILE_PROTOCOL)return a.b.WILDCARD;if(!Object(i.isActuallySameDomain)(e))throw new Error("Attempting to send messsage to mock domain "+n+", but window is actually cross-domain");return Object(i.getActualDomain)(e)}return 0===n.indexOf(a.b.FILE_PROTOCOL)?a.b.WILDCARD:n}).forEach(function(r){return e.postMessage(n,r)})};var d=r(6),f=d.sendBridgeMessage,w=d.needsBridgeForBrowser,l=d.isBridge;s[a.b.SEND_STRATEGIES.BRIDGE]=function(e,n,r){if(w()||l()){if(Object(i.isSameDomain)(e))throw new Error("Post message through bridge disabled between same domain windows");if(!1!==Object(i.isSameTopWindow)(window,e))throw new Error("Can only use bridge to communicate between two different windows, not between frames");return f(e,n,r)}},s[a.b.SEND_STRATEGIES.GLOBAL]=function(e,n){if(Object(o.i)()){if(!Object(i.isSameDomain)(e))throw new Error("Post message through global disabled between different domain windows");if(!1!==Object(i.isSameTopWindow)(window,e))throw new Error("Can only use global to communicate between two different windows, not between frames");var r=e[a.b.WINDOW_PROPS.POSTROBOT];if(!r)throw new Error("Can not find postRobot global on foreign window");return r.receiveMessage({source:window,origin:Object(i.getDomain)(),data:n})}};var m=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e};function h(e,n,r){return c.a.try(function(){var t;if(n=function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},t=Object(o.q)(),a=Object(o.c)(),u=Object(i.getDomain)(window);return m({},n,r,{sourceDomain:u,id:n.id||t,windowType:a})}(e,n,{data:Object(o.o)(e,r,n.data),domain:r}),e===window&&!a.a.ALLOW_SAME_ORIGIN)throw new Error("Attemping to send message to self");if(Object(i.isWindowClosed)(e))throw new Error("Window is closed");var u=[],d=Object(o.g)(((t={})[a.b.WINDOW_PROPS.POSTROBOT]=n,t),null,2);return c.a.map(Object.keys(s),function(n){return c.a.try(function(){if(!a.a.ALLOWED_POST_MESSAGE_METHODS[n])throw new Error("Strategy disallowed: "+n);return s[n](e,d,r)}).then(function(){return u.push(n+": success"),!0},function(e){return u.push(n+": "+Object(o.p)(e)+"\n"),!1})}).then(function(e){var r=e.some(Boolean),t=n.type+" "+n.name+" "+(r?"success":"error")+":\n - "+u.join("\n - ")+"\n";if(!r)throw new Error(t)})})}var p=r(5);u.a.responseListeners=u.a.responseListeners||{},u.a.requestListeners=u.a.requestListeners||{},u.a.WINDOW_WILDCARD=u.a.WINDOW_WILDCARD||new function(){},u.a.erroredResponseListeners=u.a.erroredResponseListeners||{};var O,g="__domain_regex__";function v(e){return u.a.responseListeners[e]}function y(e){delete u.a.responseListeners[e]}function E(e){return Boolean(u.a.erroredResponseListeners[e])}function b(e){var n=e.name,r=e.win,t=e.domain;if(r===a.b.WILDCARD&&(r=null),t===a.b.WILDCARD&&(t=null),!n)throw new Error("Name required to get request listener");var o=u.a.requestListeners[n];if(o)for(var c=0,s=[r,u.a.WINDOW_WILDCARD],d=null==s?0:s.length;c<d;c++){var f=s[c],w=f&&o.get(f);if(w){if(t&&"string"==typeof t){if(w[t])return w[t];if(w[g])for(var l=0,m=w[g],h=null==m?0:m.length;l<h;l++){var p=m[l],O=p.regex,v=p.listener;if(Object(i.matchDomain)(O,t))return v}}if(w[a.b.WILDCARD])return w[a.b.WILDCARD]}}}var _=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e},S=((O={})[a.b.POST_MESSAGE_TYPE.ACK]=function(e,n,r){if(!E(r.hash)){var t=v(r.hash);if(!t)throw new Error("No handler found for post message ack for message: "+r.name+" from "+n+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!Object(i.matchDomain)(t.domain,n))throw new Error("Ack origin "+n+" does not match domain "+t.domain.toString());t.ack=!0}},O[a.b.POST_MESSAGE_TYPE.REQUEST]=function(e,n,r){var t=b({name:r.name,win:e,domain:n});function u(t){return r.fireAndForget||Object(i.isWindowClosed)(e)?c.a.resolve():h(e,_({target:r.originalSource,hash:r.hash,name:r.name},t),n)}return c.a.all([u({type:a.b.POST_MESSAGE_TYPE.ACK}),c.a.try(function(){if(!t)throw new Error("No handler found for post message: "+r.name+" from "+n+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!Object(i.matchDomain)(t.domain,n))throw new Error("Request origin "+n+" does not match domain "+t.domain.toString());var o=r.data;return t.handler({source:e,origin:n,data:o})}).then(function(e){return u({type:a.b.POST_MESSAGE_TYPE.RESPONSE,ack:a.b.POST_MESSAGE_ACK.SUCCESS,data:e})},function(e){var n=Object(o.p)(e).replace(/^Error: /,""),r=e.code;return u({type:a.b.POST_MESSAGE_TYPE.RESPONSE,ack:a.b.POST_MESSAGE_ACK.ERROR,error:n,code:r})})]).then(o.j).catch(function(e){if(t&&t.handleError)return t.handleError(e);throw e})},O[a.b.POST_MESSAGE_TYPE.RESPONSE]=function(e,n,r){if(!E(r.hash)){var t=v(r.hash);if(!t)throw new Error("No handler found for post message response for message: "+r.name+" from "+n+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!Object(i.matchDomain)(t.domain,n))throw new Error("Response origin "+n+" does not match domain "+Object(i.stringifyDomainPattern)(t.domain));if(y(r.hash),r.ack===a.b.POST_MESSAGE_ACK.ERROR){var o=new Error(r.error);return r.code&&(o.code=r.code),t.respond(o,null)}if(r.ack===a.b.POST_MESSAGE_ACK.SUCCESS){var u=r.data||r.response;return t.respond(null,{source:e,origin:n,data:u})}}},O),P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function T(e){if(!window||window.closed)throw new Error("Message recieved in closed window");try{if(!e.source)return}catch(e){return}var n=e.source,r=e.origin,t=function(e){var n=void 0;try{n=Object(o.f)(e)}catch(e){return}if(n&&"object"===(void 0===n?"undefined":P(n))&&null!==n&&(n=n[a.b.WINDOW_PROPS.POSTROBOT])&&"object"===(void 0===n?"undefined":P(n))&&null!==n&&n.type&&"string"==typeof n.type&&S[n.type])return n}(e.data);if(t){if(!t.sourceDomain||"string"!=typeof t.sourceDomain)throw new Error("Expected message to have sourceDomain");0!==t.sourceDomain.indexOf(a.b.MOCK_PROTOCOL)&&0!==t.sourceDomain.indexOf(a.b.FILE_PROTOCOL)||(r=t.sourceDomain),-1===u.a.receivedMessages.indexOf(t.id)&&(u.a.receivedMessages.push(t.id),Object(i.isWindowClosed)(n)&&!t.fireAndForget||(t.data&&(t.data=Object(o.b)(n,r,t.data)),S[t.type](n,r,t)))}}function A(e){try{Object(o.j)(e.source)}catch(e){return}var n={source:e.source||e.sourceElement,origin:e.origin||e.originalEvent&&e.originalEvent.origin,data:e.data};try{r(8).emulateIERestrictions(n.source,window)}catch(e){return}T(n)}function j(e){return c.a.try(function(){if(!e.name)throw new Error("Expected options.name");var n=e.name,r=void 0,t=void 0;if("string"==typeof e.window){var s=document.getElementById(e.window);if(!s)throw new Error("Expected options.window "+Object.prototype.toString.call(e.window)+" to be a valid element id");if("iframe"!==s.tagName.toLowerCase())throw new Error("Expected options.window "+Object.prototype.toString.call(e.window)+" to be an iframe");if(!s.contentWindow)throw new Error("Iframe must have contentWindow. Make sure it has a src attribute and is in the DOM.");r=s.contentWindow}else if(e.window instanceof HTMLIFrameElement){if("iframe"!==e.window.tagName.toLowerCase())throw new Error("Expected options.window "+Object.prototype.toString.call(e.window)+" to be an iframe");if(e.window&&!e.window.contentWindow)throw new Error("Iframe must have contentWindow. Make sure it has a src attribute and is in the DOM.");e.window&&e.window.contentWindow&&(r=e.window.contentWindow)}else r=e.window;if(!r)throw new Error("Expected options.window to be a window object, iframe, or iframe element id.");var d=r;t=e.domain||a.b.WILDCARD;var f=e.name+"_"+Object(o.q)();if(Object(i.isWindowClosed)(d))throw new Error("Target window is closed");var w=!1,l=u.a.requestPromises.get(d);l||(l=[],u.a.requestPromises.set(d,l));var m=c.a.try(function(){if(Object(i.isAncestor)(window,d))return Object(o.k)(d,e.timeout||a.a.CHILD_WINDOW_TIMEOUT)}).then(function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).origin;if(Object(o.e)(t)&&!e)return Object(o.n)(d)}).then(function(){var r=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).origin;if(Object(o.e)(t)){if(!Object(i.matchDomain)(t,r))throw new Error("Remote window domain "+r+" does not match regex: "+t.toString());t=r}if("string"!=typeof t&&!Array.isArray(t))throw new TypeError("Expected domain to be a string or array");var s=t;return new c.a(function(r,t){var o=void 0;if(e.fireAndForget||function(e,n){u.a.responseListeners[e]=n}(f,o={name:n,window:d,domain:s,respond:function(e,n){e||(w=!0,l.splice(l.indexOf(m,1))),e?t(e):r(n)}}),h(d,{type:a.b.POST_MESSAGE_TYPE.REQUEST,hash:f,name:n,data:e.data,fireAndForget:e.fireAndForget},s).catch(t),e.fireAndForget)return r();var c=a.a.ACK_TIMEOUT,p=e.timeout||a.a.RES_TIMEOUT,O=100;setTimeout(function r(){if(!w){if(Object(i.isWindowClosed)(d))return o.ack?t(new Error("Window closed for "+n+" before response")):t(new Error("Window closed for "+n+" before ack"));if(c=Math.max(c-O,0),-1!==p&&(p=Math.max(p-O,0)),o.ack){if(-1===p)return;O=Math.min(p,2e3)}else{if(0===c)return t(new Error("No ack for postMessage "+n+" in "+Object(i.getDomain)()+" in "+a.a.ACK_TIMEOUT+"ms"));if(0===p)return t(new Error("No response for postMessage "+n+" in "+Object(i.getDomain)()+" in "+(e.timeout||a.a.RES_TIMEOUT)+"ms"))}setTimeout(r,O)}},O)})});return m.catch(function(){!function(e){u.a.erroredResponseListeners[e]=!0}(f),y(f)}),l.push(m),m})}function W(e,n,r,t){return(t=t||{}).window=e,t.name=n,t.data=r,j(t)}function R(e,n,r){var t=Object(i.getAncestor)();return t?W(t,e,n,r):new c.a(function(e,n){return n(new Error("Window does not have a parent"))})}function D(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.window)throw new Error("Expected options.window");var n=e.window;return{send:function(r,t){return W(n,r,t,e)}}}u.a.receivedMessages=u.a.receivedMessages||[],u.a.receiveMessage=T,u.a.requestPromises=u.a.requestPromises||new p.a,u.a.send=W;var I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function M(e){if(!e.name)throw new Error("Expected options.name");if(!e.handler)throw new Error("Expected options.handler");var n=e.name,r=e.window,t=e.domain,c={handler:e.handler,handleError:e.errorHandler||function(e){throw e},window:r,domain:t||a.b.WILDCARD,name:n},s=function e(n,r){var t=n.name,i=n.win,c=n.domain;if(!t||"string"!=typeof t)throw new Error("Name required to add request listener");if(Array.isArray(i)){for(var s=[],d=0,f=i,w=null==f?0:f.length;d<w;d++){var l=f[d];s.push(e({name:t,domain:c,win:l},r))}return{cancel:function(){for(var e=0,n=null==s?0:s.length;e<n;e++)s[e].cancel()}}}if(Array.isArray(c)){for(var m=[],h=0,O=c,v=null==O?0:O.length;h<v;h++){var y=O[h];m.push(e({name:t,win:i,domain:y},r))}return{cancel:function(){for(var e=0,n=null==m?0:m.length;e<n;e++)m[e].cancel()}}}var E=b({name:t,win:i,domain:c});if(i&&i!==a.b.WILDCARD||(i=u.a.WINDOW_WILDCARD),c=c||a.b.WILDCARD,E)throw i&&c?new Error("Request listener already exists for "+t+" on domain "+c.toString()+" for "+(i===u.a.WINDOW_WILDCARD?"wildcard":"specified")+" window"):i?new Error("Request listener already exists for "+t+" for "+(i===u.a.WINDOW_WILDCARD?"wildcard":"specified")+" window"):c?new Error("Request listener already exists for "+t+" on domain "+c.toString()):new Error("Request listener already exists for "+t);var _=u.a.requestListeners,S=_[t];S||(S=new p.a,_[t]=S);var P=S.get(i);P||(P={},S.set(i,P));var T=c.toString(),A=P[g],j=void 0;return Object(o.e)(c)?(A||(A=[],P[g]=A),j={regex:c,listener:r},A.push(j)):P[T]=r,{cancel:function(){P&&(delete P[T],i&&0===Object.keys(P).length&&S.delete(i),j&&A.splice(A.indexOf(j,1)))}}}({name:n,win:r,domain:t},c);if(e.once){var d=c.handler;c.handler=Object(o.l)(function(){return s.cancel(),d.apply(this,arguments)})}if(c.window&&e.errorOnClose)var f=Object(o.m)(function(){r&&"object"===(void 0===r?"undefined":I(r))&&Object(i.isWindowClosed)(r)&&(f.cancel(),c.handleError(new Error("Post message target window is closed")))},50);return{cancel:function(){s.cancel()}}}function N(e,n,r){return"function"==typeof n&&(r=n,n={}),(n=n||{}).name=e,n.handler=r||n.handler,M(n)}function L(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments[2];"function"==typeof n&&(r=n,n={}),n=n||{},r=r||n.handler;var t=n.errorHandler,o=new c.a(function(o,i){(n=n||{}).name=e,n.once=!0,n.handler=function(e){if(o(e),r)return r(e)},n.errorHandler=function(e){if(i(e),t)return t(e)}}),i=M(n);return o.cancel=i.cancel,o}function C(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{on:function(n,r){return N(n,e,r)}}}function B(){delete window[a.b.WINDOW_PROPS.POSTROBOT],window.removeEventListener("message",A)}u.a.on=N;var x=Object(i.getAncestor)();function k(e){var n=u.a.requestPromises.get(e);if(n)for(var r=0,t=null==n?0:n.length;r<t;r++)n[r].reject(new Error("No response from window - cleaned up"));u.a.popupWindowsByWin&&u.a.popupWindowsByWin.delete(e),u.a.remoteWindows&&u.a.remoteWindows.delete(e),u.a.requestPromises.delete(e),u.a.methods.delete(e),u.a.readyPromises.delete(e)}var G=r(12);function U(){u.a.initialized||(Object(o.a)(window,"message",A),r(6).openTunnelToOpener(),Object(o.d)(),Object(o.h)({on:N,send:W})),u.a.initialized=!0}U(),r.d(n,"cleanUpWindow",function(){return k}),r.d(n,"Promise",function(){return c.a}),r.d(n,"bridge",function(){return G}),r.d(n,"init",function(){return U}),r.d(n,"parent",function(){return x}),r.d(n,"send",function(){return W}),r.d(n,"request",function(){return j}),r.d(n,"sendToParent",function(){return R}),r.d(n,"client",function(){return D}),r.d(n,"on",function(){return N}),r.d(n,"listen",function(){return M}),r.d(n,"once",function(){return L}),r.d(n,"listener",function(){return C}),r.d(n,"CONFIG",function(){return a.a}),r.d(n,"CONSTANTS",function(){return a.b}),r.d(n,"disable",function(){return B}),n.default=t},function(e,n,r){"use strict";function t(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var o=r(7);n.h=u,n.g=c,n.a=d,n.c=f,n.j=w,n.o=l,n.f=h,n.r=function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{if(e===window)return!1}catch(e){return!0}try{if(!e)return!0}catch(e){return!0}try{if(e.closed)return!0}catch(e){return!e||e.message!==i}if(n&&l(e))try{if(e.mockclosed)return!0}catch(e){}try{if(!e.parent||!e.top)return!0}catch(e){}var r=function(e,n){for(var r=0;r<e.length;r++)try{if(e[r]===n)return r}catch(e){}return-1}(v,e);if(-1!==r){var t=y[r];if(t&&function(e){if(!e.contentWindow)return!0;if(!e.parentNode)return!0;var n=e.ownerDocument;return!(!n||!n.documentElement||n.documentElement.contains(e))}(t))return!0}return!1},n.i=function(e){return(e=e||window).navigator.mockUserAgent||e.navigator.userAgent},n.e=function(e,n){for(var r=h(e),t=0,o=null==r?0:r.length;t<o;t++){var i=r[t];try{if(l(i)&&i.name===n&&-1!==r.indexOf(i))return i}catch(e){}}try{if(-1!==r.indexOf(e.frames[n]))return e.frames[n]}catch(e){}try{if(-1!==r.indexOf(e[n]))return e[n]}catch(e){}},n.m=function(e,n){return e===c(n)},n.b=E,n.k=function(e,n){var r=E(n);if(r)return r===e;if(n===e)return!1;if(O(n)===n)return!1;for(var t=0,o=h(e),i=null==o?0:o.length;t<i;t++)if(o[t]===n)return!0;return!1},n.n=function(){return Boolean(c(window))},n.l=function(){return Boolean(u(window))},n.p=function(e,n){var r=O(e)||e,t=O(n)||n;try{if(r&&t)return r===t}catch(e){}var o=g(e),i=g(n);if(b(o,i))return!0;var a=c(r),u=c(t);return!(a&&b(g(a),i)||(u&&b(g(u),o),1))},n.s=function e(n,r){if("string"==typeof n){if("string"==typeof r)return n===o.b||r===n;if(t(r))return!1;if(Array.isArray(r))return!1}return t(n)?t(r)?n.toString()===r.toString():!Array.isArray(r)&&Boolean(r.match(n)):!!Array.isArray(n)&&(Array.isArray(r)?JSON.stringify(n)===JSON.stringify(r):!t(r)&&n.some(function(n){return e(n,r)}))},n.t=function(e){return Array.isArray(e)?"("+e.join(" | ")+")":t(e)?"RegExp("+e.toString():e.toString()},n.d=function(e){return e.match(/^(https?|mock|file):\/\//)?e.split("/").slice(0,3).join("/"):f()},n.q=function(e){try{if(e===window)return!0}catch(e){if(e&&e.message===i)return!0}try{if("[object Window]"===Object.prototype.toString.call(e))return!0}catch(e){if(e&&e.message===i)return!0}try{if(window.Window&&e instanceof window.Window)return!0}catch(e){if(e&&e.message===i)return!0}try{if(e&&e.self===e)return!0}catch(e){if(e&&e.message===i)return!0}try{if(e&&e.parent===e)return!0}catch(e){if(e&&e.message===i)return!0}try{if(e&&e.top===e)return!0}catch(e){if(e&&e.message===i)return!0}try{e&&e.__cross_domain_utils_window_check__}catch(e){return!0}return!1};var i="Call was rejected by callee.\r\n";function a(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).location.protocol===o.a.ABOUT}function u(e){if(e)try{if(e.parent&&e.parent!==e)return e.parent}catch(e){}}function c(e){if(e&&!u(e))try{return e.opener}catch(e){}}function s(e){try{return e&&e.location&&e.location.href,!0}catch(e){}return!1}function d(e){var n=(e=e||window).location;if(!n)throw new Error("Can not read window location");var r=n.protocol;if(!r)throw new Error("Can not read window protocol");if(r===o.a.FILE)return o.a.FILE+"//";if(r===o.a.ABOUT){var t=u(e);return t&&s(t)?d(t):o.a.ABOUT+"//"}var i=n.host;if(!i)throw new Error("Can not read window host");return r+"//"+i}function f(e){var n=d(e=e||window);return n&&e.mockDomain&&0===e.mockDomain.indexOf(o.a.MOCK)?e.mockDomain:n}function w(e){try{if(e===window)return!0}catch(e){}try{var n=Object.getOwnPropertyDescriptor(e,"location");if(n&&!1===n.enumerable)return!1}catch(e){}try{if(a(e)&&s(e))return!0}catch(e){}try{if(d(e)===d(window))return!0}catch(e){}return!1}function l(e){if(!w(e))return!1;try{if(e===window)return!0;if(a(e)&&s(e))return!0;if(f(window)===f(e))return!0}catch(e){}return!1}function m(e,n){if(!e||!n)return!1;var r=u(n);return r?r===e:-1!==function(e){var n=[];try{for(;e.parent!==e;)n.push(e.parent),e=e.parent}catch(e){}return n}(n).indexOf(e)}function h(e){var n=[],r=void 0;try{r=e.frames}catch(n){r=e}var t=void 0;try{t=r.length}catch(e){}if(0===t)return n;if(t){for(var o=0;o<t;o++){var i=void 0;try{i=r[o]}catch(e){continue}n.push(i)}return n}for(var a=0;a<100;a++){var u=void 0;try{u=r[a]}catch(e){return n}if(!u)return n;n.push(u)}return n}function p(e){for(var n=[],r=0,t=h(e),o=null==t?0:t.length;r<o;r++){var i=t[r];n.push(i);for(var a=0,u=p(i),c=null==u?0:u.length;a<c;a++){var s=u[a];n.push(s)}}return n}function O(e){if(e){try{if(e.top)return e.top}catch(e){}if(u(e)===e)return e;try{if(m(window,e)&&window.top)return window.top}catch(e){}try{if(m(e,window)&&window.top)return window.top}catch(e){}for(var n=0,r=p(e),t=null==r?0:r.length;n<t;n++){var o=r[n];try{if(o.top)return o.top}catch(e){}if(u(o)===o)return o}}}function g(e){var n=O(e);if(!n)throw new Error("Can not determine top window");return[].concat(p(n),[n])}var v=[],y=[];function E(e){return c(e=e||window)||u(e)||void 0}function b(e,n){for(var r=0,t=null==e?0:e.length;r<t;r++)for(var o=e[r],i=0,a=null==n?0:n.length;i<a;i++)if(o===n[i])return!0;return!1}},function(e,n){},function(e,n,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t=r(6);r.d(n,"openBridge",function(){return t.openBridge}),r.d(n,"linkUrl",function(){return t.linkUrl}),r.d(n,"isBridge",function(){return t.isBridge}),r.d(n,"needsBridge",function(){return t.needsBridge}),r.d(n,"needsBridgeForBrowser",function(){return t.needsBridgeForBrowser}),r.d(n,"hasBridge",function(){return t.hasBridge}),r.d(n,"needsBridgeForWin",function(){return t.needsBridgeForWin}),r.d(n,"needsBridgeForDomain",function(){return t.needsBridgeForDomain}),r.d(n,"openTunnelToOpener",function(){return t.openTunnelToOpener}),r.d(n,"destroyBridges",function(){return t.destroyBridges})}])});
//# sourceMappingURL=post-robot.ie.min.js.map

@@ -1,3 +0,2 @@

!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("postRobot",[],r):"object"==typeof exports?exports.postRobot=r():e.postRobot=r()}("undefined"!=typeof self?self:this,function(){return function(e){var r={};function n(t){if(r[t])return r[t].exports;var o=r[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=r,n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:t})},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,"a",r),r},n.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},n.p="",n(n.s=1)}([function(e,r,n){"use strict";var t=n(2);n.d(r,"getActualDomain",function(){return t.a}),n.d(r,"getAncestor",function(){return t.b}),n.d(r,"getDomain",function(){return t.c}),n.d(r,"getUserAgent",function(){return t.d}),n.d(r,"isActuallySameDomain",function(){return t.e}),n.d(r,"isAncestor",function(){return t.f}),n.d(r,"isIframe",function(){return t.g}),n.d(r,"isPopup",function(){return t.h}),n.d(r,"isWindow",function(){return t.i}),n.d(r,"isWindowClosed",function(){return t.j}),n.d(r,"matchDomain",function(){return t.k}),n.d(r,"stringifyDomainPattern",function(){return t.l});var o=n(3);n.n(o)},function(e,r,n){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),n.d({},"WeakMap",function(){return u});var t={};n.d(t,"cleanUpWindow",function(){return ne}),n.d(t,"Promise",function(){return S}),n.d(t,"bridge",function(){return te}),n.d(t,"init",function(){return oe}),n.d(t,"parent",function(){return re}),n.d(t,"send",function(){return J}),n.d(t,"request",function(){return F}),n.d(t,"sendToParent",function(){return K}),n.d(t,"client",function(){return Z}),n.d(t,"on",function(){return X}),n.d(t,"listen",function(){return Q}),n.d(t,"once",function(){return V}),n.d(t,"listener",function(){return $}),n.d(t,"CONFIG",function(){return l}),n.d(t,"CONSTANTS",function(){return f}),n.d(t,"disable",function(){return ee});var o=n(0);function i(e,r){for(var n=0;n<e.length;n++)try{if(e[n]===r)return n}catch(e){}return-1}var a,s=Object.defineProperty,c=Date.now()%1e9,u=function(){function e(){if(function(r,n){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}(this),c+=1,this.name="__weakmap_"+(1e9*Math.random()>>>0)+"__"+c,function(){if(!window.WeakMap)return!1;if(!window.Object.freeze)return!1;try{var e=new window.WeakMap,r={};return window.Object.freeze(r),e.set(r,"__testvalue__"),"__testvalue__"===e.get(r)}catch(e){return!1}}())try{this.weakmap=new window.WeakMap}catch(e){}this.keys=[],this.values=[]}return e.prototype._cleanupClosedWindows=function(){for(var e=this.weakmap,r=this.keys,n=0;n<r.length;n++){var t=r[n];if(Object(o.isWindow)(t)&&Object(o.isWindowClosed)(t)){if(e)try{e.delete(t)}catch(e){}r.splice(n,1),this.values.splice(n,1),n-=1}}},e.prototype.isSafeToReadWrite=function(e){if(Object(o.isWindow)(e))return!1;try{e&&e.self,e&&e[this.name]}catch(e){return!1}return!0},e.prototype.set=function(e,r){if(!e)throw new Error("WeakMap expected key");var n=this.weakmap;if(n)try{n.set(e,r)}catch(e){delete this.weakmap}if(this.isSafeToReadWrite(e)){var t=this.name,o=e[t];o&&o[0]===e?o[1]=r:s(e,t,{value:[e,r],writable:!0})}else{this._cleanupClosedWindows();var a=this.keys,c=this.values,u=i(a,e);-1===u?(a.push(e),c.push(r)):c[u]=r}},e.prototype.get=function(e){if(!e)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{if(r.has(e))return r.get(e)}catch(e){delete this.weakmap}if(!this.isSafeToReadWrite(e)){this._cleanupClosedWindows();var n=i(this.keys,e);if(-1===n)return;return this.values[n]}var t=e[this.name];if(t&&t[0]===e)return t[1]},e.prototype.delete=function(e){if(!e)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{r.delete(e)}catch(e){delete this.weakmap}if(this.isSafeToReadWrite(e)){var n=e[this.name];n&&n[0]===e&&(n[0]=n[1]=void 0)}else{this._cleanupClosedWindows();var t=this.keys,o=i(t,e);-1!==o&&(t.splice(o,1),this.values.splice(o,1))}},e.prototype.has=function(e){if(!e)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{return r.has(e)}catch(e){delete this.weakmap}if(this.isSafeToReadWrite(e)){var n=e[this.name];return!(!n||n[0]!==e)}return this._cleanupClosedWindows(),-1!==i(this.keys,e)},e}(),f={POST_MESSAGE_TYPE:{REQUEST:"postrobot_message_request",RESPONSE:"postrobot_message_response",ACK:"postrobot_message_ack"},POST_MESSAGE_ACK:{SUCCESS:"success",ERROR:"error"},POST_MESSAGE_NAMES:{METHOD:"postrobot_method",HELLO:"postrobot_ready",OPEN_TUNNEL:"postrobot_open_tunnel"},WINDOW_TYPES:{FULLPAGE:"fullpage",POPUP:"popup",IFRAME:"iframe"},WINDOW_PROPS:{POSTROBOT:"__postRobot__"},SERIALIZATION_TYPES:{METHOD:"postrobot_method",ERROR:"postrobot_error",PROMISE:"postrobot_promise",ZALGO_PROMISE:"postrobot_zalgo_promise",REGEX:"regex"},SEND_STRATEGIES:{POST_MESSAGE:"postrobot_post_message",BRIDGE:"postrobot_bridge",GLOBAL:"postrobot_global"},MOCK_PROTOCOL:"mock:",FILE_PROTOCOL:"file:",BRIDGE_NAME_PREFIX:"__postrobot_bridge__",POSTROBOT_PROXY:"__postrobot_proxy__",WILDCARD:"*"},d={METHOD:"postrobot_method",HELLO:"postrobot_hello",OPEN_TUNNEL:"postrobot_open_tunnel"},l=(Object.keys(d).map(function(e){return d[e]}),{ALLOW_POSTMESSAGE_POPUP:!("__ALLOW_POSTMESSAGE_POPUP__"in window)||window.__ALLOW_POSTMESSAGE_POPUP__,BRIDGE_TIMEOUT:5e3,CHILD_WINDOW_TIMEOUT:5e3,ACK_TIMEOUT:-1!==window.navigator.userAgent.match(/MSIE/i)?2e3:1e3,RES_TIMEOUT:-1,ALLOWED_POST_MESSAGE_METHODS:(a={},a[f.SEND_STRATEGIES.POST_MESSAGE]=!0,a[f.SEND_STRATEGIES.BRIDGE]=!0,a[f.SEND_STRATEGIES.GLOBAL]=!0,a),ALLOW_SAME_ORIGIN:!1});0===window.location.href.indexOf(f.FILE_PROTOCOL)&&(l.ALLOW_POSTMESSAGE_POPUP=!0);var w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function h(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(r>=3)return"stringifyError stack overflow";try{if(!e)return"<unknown error: "+Object.prototype.toString.call(e)+">";if("string"==typeof e)return e;if(e instanceof Error){var n=e&&e.stack,t=e&&e.message;if(n&&t)return-1!==n.indexOf(t)?n:t+"\n"+n;if(n)return n;if(t)return t}return"function"==typeof e.toString?e.toString():Object.prototype.toString.call(e)}catch(e){return"Error while stringifying error: "+h(e,r+1)}}var p=function(e){if(!e)return e;var r=!1;return function(){if(!r)return r=!0,e.apply(this,arguments)}};function m(){}function _(){var e="0123456789abcdef";return"xxxxxxxxxx".replace(/./g,function(){return e.charAt(Math.floor(Math.random()*e.length))})}function y(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(n>=100)throw new Error("Self-referential object passed, or object contained too many layers");var t=void 0;if("object"!==(void 0===e?"undefined":w(e))||null===e||Array.isArray(e)){if(!Array.isArray(e))throw new TypeError("Invalid type: "+(void 0===e?"undefined":w(e)));t=[]}else t={};return function(e,r){Array.isArray(e)?function(e,r){for(var n=0;n<e.length;n++)r(e[n],n)}(e,r):"object"===(void 0===e?"undefined":w(e))&&null!==e&&function(e,r){for(var n in e)e.hasOwnProperty(n)&&r(e[n],n)}(e,r)}(e,function(e,o){var i=r(e,o);void 0!==i?t[o]=i:"object"===(void 0===e?"undefined":w(e))&&null!==e?t[o]=y(e,r,n+1):t[o]=e}),t}function E(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function O(e){try{if(!e)return!1;if("undefined"!=typeof Promise&&e instanceof Promise)return!0;if("undefined"!=typeof window&&window.Window&&e instanceof window.Window)return!1;if("undefined"!=typeof window&&window.constructor&&e instanceof window.constructor)return!1;var r={}.toString;if(r){var n=r.call(e);if("[object Window]"===n||"[object global]"===n||"[object DOMWindow]"===n)return!1}if("function"==typeof e.then)return!0}catch(e){return!1}return!1}function v(){var e=void 0;if("undefined"!=typeof window)e=window;else{if("undefined"==typeof window)throw new TypeError("Can not find global");e=window}var r=e.__zalgopromise__=e.__zalgopromise__||{};return r.flushPromises=r.flushPromises||[],r.activeCount=r.activeCount||0,r.possiblyUnhandledPromiseHandlers=r.possiblyUnhandledPromiseHandlers||[],r.dispatchedErrors=r.dispatchedErrors||[],r}var S=function(){function e(r){var n=this;if(function(r,n){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}(this),this.resolved=!1,this.rejected=!1,this.errorHandled=!1,this.handlers=[],r){var t=void 0,o=void 0,i=!1,a=!1,s=!1;try{r(function(e){s?n.resolve(e):(i=!0,t=e)},function(e){s?n.reject(e):(a=!0,o=e)})}catch(e){return void this.reject(e)}s=!0,i?this.resolve(t):a&&this.reject(o)}}return e.prototype.resolve=function(e){if(this.resolved||this.rejected)return this;if(O(e))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=e,this.dispatch(),this},e.prototype.reject=function(e){var r=this;if(this.resolved||this.rejected)return this;if(O(e))throw new Error("Can not reject promise with another promise");if(!e){var n=e&&"function"==typeof e.toString?e.toString():Object.prototype.toString.call(e);e=new Error("Expected reject to be called with Error, got "+n)}return this.rejected=!0,this.error=e,this.errorHandled||setTimeout(function(){r.errorHandled||function(e,r){if(-1===v().dispatchedErrors.indexOf(e)){v().dispatchedErrors.push(e),setTimeout(function(){throw e},1);for(var n=0;n<v().possiblyUnhandledPromiseHandlers.length;n++)v().possiblyUnhandledPromiseHandlers[n](e,r)}}(e,r)},1),this.dispatch(),this},e.prototype.asyncReject=function(e){this.errorHandled=!0,this.reject(e)},e.prototype.dispatch=function(){var r=this,n=this.dispatching,t=this.resolved,o=this.rejected,i=this.handlers;if(!n&&(t||o)){this.dispatching=!0,v().activeCount+=1;for(var a=function(n){var a=i[n],s=a.onSuccess,c=a.onError,u=a.promise,f=void 0;if(t)try{f=s?s(r.value):r.value}catch(e){return u.reject(e),"continue"}else if(o){if(!c)return u.reject(r.error),"continue";try{f=c(r.error)}catch(e){return u.reject(e),"continue"}}f instanceof e&&(f.resolved||f.rejected)?(f.resolved?u.resolve(f.value):u.reject(f.error),f.errorHandled=!0):O(f)?f instanceof e&&(f.resolved||f.rejected)?f.resolved?u.resolve(f.value):u.reject(f.error):f.then(function(e){u.resolve(e)},function(e){u.reject(e)}):u.resolve(f)},s=0;s<i.length;s++)a(s);i.length=0,this.dispatching=!1,v().activeCount-=1,0===v().activeCount&&e.flushQueue()}},e.prototype.then=function(r,n){if(r&&"function"!=typeof r&&!r.call)throw new Error("Promise.then expected a function for success handler");if(n&&"function"!=typeof n&&!n.call)throw new Error("Promise.then expected a function for error handler");var t=new e;return this.handlers.push({promise:t,onSuccess:r,onError:n}),this.errorHandled=!0,this.dispatch(),t},e.prototype.catch=function(e){return this.then(void 0,e)},e.prototype.finally=function(r){if(r&&"function"!=typeof r&&!r.call)throw new Error("Promise.finally expected a function");return this.then(function(n){return e.try(r).then(function(){return n})},function(n){return e.try(r).then(function(){throw n})})},e.prototype.timeout=function(e,r){var n=this;if(this.resolved||this.rejected)return this;var t=setTimeout(function(){n.resolved||n.rejected||n.reject(r||new Error("Promise timed out after "+e+"ms"))},e);return this.then(function(e){return clearTimeout(t),e})},e.prototype.toPromise=function(){if("undefined"==typeof Promise)throw new TypeError("Could not find Promise");return Promise.resolve(this)},e.resolve=function(r){return r instanceof e?r:O(r)?new e(function(e,n){return r.then(e,n)}):(new e).resolve(r)},e.reject=function(r){return(new e).reject(r)},e.all=function(r){var n=new e,t=r.length,o=[];if(!t)return n.resolve(o),n;for(var i=function(i){var a=r[i];if(a instanceof e){if(a.resolved)return o[i]=a.value,t-=1,"continue"}else if(!O(a))return o[i]=a,t-=1,"continue";e.resolve(a).then(function(e){o[i]=e,0==(t-=1)&&n.resolve(o)},function(e){n.reject(e)})},a=0;a<r.length;a++)i(a);return 0===t&&n.resolve(o),n},e.hash=function(r){var n={};return e.all(Object.keys(r).map(function(t){return e.resolve(r[t]).then(function(e){n[t]=e})})).then(function(){return n})},e.map=function(r,n){return e.all(r.map(n))},e.onPossiblyUnhandledException=function(e){return function(e){return v().possiblyUnhandledPromiseHandlers.push(e),{cancel:function(){v().possiblyUnhandledPromiseHandlers.splice(v().possiblyUnhandledPromiseHandlers.indexOf(e),1)}}}(e)},e.try=function(r,n,t){if(r&&"function"!=typeof r&&!r.call)throw new Error("Promise.try expected a function");var o=void 0;try{o=r.apply(n,t||[])}catch(r){return e.reject(r)}return e.resolve(o)},e.delay=function(r){return new e(function(e){setTimeout(e,r)})},e.isPromise=function(r){return!!(r&&r instanceof e)||O(r)},e.flush=function(){var r=new e;return v().flushPromises.push(r),0===v().activeCount&&e.flushQueue(),r},e.flushQueue=function(){var e=v().flushPromises;v().flushPromises=[];for(var r=0,n=null==e?0:e.length;r<n;r++)e[r].resolve()},e}(),g=window[f.WINDOW_PROPS.POSTROBOT]=window[f.WINDOW_PROPS.POSTROBOT]||{};g.registerSelf=function(){};var P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};g.methods=g.methods||new u;var A=p(function(){g.on(f.POST_MESSAGE_NAMES.METHOD,{origin:f.WILDCARD},function(e){var r=e.source,n=e.origin,t=e.data,i=g.methods.get(r);if(!i)throw new Error("Could not find any methods this window has privileges to call");var a=i[t.id];if(!a)throw new Error("Could not find method with id: "+t.id);if(!Object(o.matchDomain)(a.domain,n))throw new Error("Method domain "+a.domain+" does not match origin "+n);return S.try(function(){return a.method.apply({source:r,origin:n,data:t},t.args)}).then(function(e){return{result:e,id:t.id,name:t.name}})})});function b(e,r){return"object"===(void 0===e?"undefined":P(e))&&null!==e&&e.__type__===r}function T(e,r,n,t){var o=_(),i=g.methods.get(e);return i||(i={},g.methods.set(e,i)),i[o]={domain:r,method:n},{__type__:f.SERIALIZATION_TYPES.METHOD,__id__:o,__name__:t}}function R(e,r,n){function t(){var t=Array.prototype.slice.call(arguments);return g.send(e,f.POST_MESSAGE_NAMES.METHOD,{id:n.__id__,name:n.__name__,args:t},{domain:r,timeout:-1}).then(function(e){return e.data.result},function(e){throw e})}return t.__name__=n.__name__,t.__xdomain__=!0,t.source=e,t.origin=r,t}function I(e,r,n){return new S(function(t,o){return R(e,r,n.__then__)(t,o)})}function W(e){return g.send(e,f.POST_MESSAGE_NAMES.HELLO,{},{domain:f.WILDCARD,timeout:-1}).then(function(e){return{origin:e.origin}})}g.readyPromises=g.readyPromises||new u;var D={};D[f.SEND_STRATEGIES.POST_MESSAGE]=function(e,r,n){(Array.isArray(n)?n:"string"==typeof n?[n]:[f.WILDCARD]).map(function(r){if(0===r.indexOf(f.MOCK_PROTOCOL)){if(window.location.protocol===f.FILE_PROTOCOL)return f.WILDCARD;if(!Object(o.isActuallySameDomain)(e))throw new Error("Attempting to send messsage to mock domain "+r+", but window is actually cross-domain");return Object(o.getActualDomain)(e)}return 0===r.indexOf(f.FILE_PROTOCOL)?f.WILDCARD:r}).forEach(function(n){return e.postMessage(r,n)})};var L=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e};function j(e,r,n){return S.try(function(){var t;if(r=function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},t=_(),i=Object(o.isPopup)()?f.WINDOW_TYPES.POPUP:Object(o.isIframe)()?f.WINDOW_TYPES.IFRAME:f.WINDOW_TYPES.FULLPAGE,a=Object(o.getDomain)(window);return L({},r,n,{sourceDomain:a,id:r.id||t,windowType:i})}(e,r,{data:function(e,n,t){return y({obj:r.data},function(r,t){return"function"==typeof r?T(e,n,r,t.toString()):r instanceof Error?(o=r,{__type__:f.SERIALIZATION_TYPES.ERROR,__message__:h(o),__code__:o.code}):window.Promise&&r instanceof window.Promise?function(e,r,n,t){return{__type__:f.SERIALIZATION_TYPES.PROMISE,__then__:T(e,r,function(e,r){return n.then(e,r)},t+".then")}}(e,n,r,t.toString()):S.isPromise(r)?function(e,r,n,t){return{__type__:f.SERIALIZATION_TYPES.ZALGO_PROMISE,__then__:T(e,r,function(e,r){return n.then(e,r)},t+".then")}}(e,n,r,t.toString()):E(r)?(i=r,{__type__:f.SERIALIZATION_TYPES.REGEX,__source__:i.source}):void 0;var o,i}).obj}(e,n),domain:n}),e===window&&!l.ALLOW_SAME_ORIGIN)throw new Error("Attemping to send message to self");if(Object(o.isWindowClosed)(e))throw new Error("Window is closed");var i=[],a=function(e,r,n){var t=void 0,o=void 0;try{if("{}"!==JSON.stringify({})&&(t=Object.prototype.toJSON,delete Object.prototype.toJSON),"{}"!==JSON.stringify({}))throw new Error("Can not correctly serialize JSON objects");if("[]"!==JSON.stringify([])&&(o=Array.prototype.toJSON,delete Array.prototype.toJSON),"[]"!==JSON.stringify([]))throw new Error("Can not correctly serialize JSON objects")}catch(e){throw new Error("Can not repair JSON.stringify: "+e.message)}var i=JSON.stringify.call(this,e,null,2);try{t&&(Object.prototype.toJSON=t),o&&(Array.prototype.toJSON=o)}catch(e){throw new Error("Can not repair JSON.stringify: "+e.message)}return i}(((t={})[f.WINDOW_PROPS.POSTROBOT]=r,t));return S.map(Object.keys(D),function(r){return S.try(function(){if(!l.ALLOWED_POST_MESSAGE_METHODS[r])throw new Error("Strategy disallowed: "+r);return D[r](e,a,n)}).then(function(){return i.push(r+": success"),!0},function(e){return i.push(r+": "+h(e)+"\n"),!1})}).then(function(e){var n=e.some(Boolean),t=r.type+" "+r.name+" "+(n?"success":"error")+":\n - "+i.join("\n - ")+"\n";if(!n)throw new Error(t)})})}g.responseListeners=g.responseListeners||{},g.requestListeners=g.requestListeners||{},g.WINDOW_WILDCARD=g.WINDOW_WILDCARD||new function(){},g.erroredResponseListeners=g.erroredResponseListeners||{};var C,M="__domain_regex__";function N(e){return g.responseListeners[e]}function x(e){delete g.responseListeners[e]}function k(e){return Boolean(g.erroredResponseListeners[e])}function G(e){var r=e.name,n=e.win,t=e.domain;if(n===f.WILDCARD&&(n=null),t===f.WILDCARD&&(t=null),!r)throw new Error("Name required to get request listener");var i=g.requestListeners[r];if(i)for(var a=0,s=[n,g.WINDOW_WILDCARD],c=null==s?0:s.length;a<c;a++){var u=s[a],d=u&&i.get(u);if(d){if(t&&"string"==typeof t){if(d[t])return d[t];if(d[M])for(var l=0,w=d[M],h=null==w?0:w.length;l<h;l++){var p=w[l],m=p.regex,_=p.listener;if(Object(o.matchDomain)(m,t))return _}}if(d[f.WILDCARD])return d[f.WILDCARD]}}}var U=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},H=((C={})[f.POST_MESSAGE_TYPE.ACK]=function(e,r,n){if(!k(n.hash)){var t=N(n.hash);if(!t)throw new Error("No handler found for post message ack for message: "+n.name+" from "+r+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!Object(o.matchDomain)(t.domain,r))throw new Error("Ack origin "+r+" does not match domain "+t.domain.toString());t.ack=!0}},C[f.POST_MESSAGE_TYPE.REQUEST]=function(e,r,n){var t=G({name:n.name,win:e,domain:r});function i(t){return n.fireAndForget||Object(o.isWindowClosed)(e)?S.resolve():j(e,U({target:n.originalSource,hash:n.hash,name:n.name},t),r)}return S.all([i({type:f.POST_MESSAGE_TYPE.ACK}),S.try(function(){if(!t)throw new Error("No handler found for post message: "+n.name+" from "+r+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!Object(o.matchDomain)(t.domain,r))throw new Error("Request origin "+r+" does not match domain "+t.domain.toString());var i=n.data;return t.handler({source:e,origin:r,data:i})}).then(function(e){return i({type:f.POST_MESSAGE_TYPE.RESPONSE,ack:f.POST_MESSAGE_ACK.SUCCESS,data:e})},function(e){var r=h(e).replace(/^Error: /,""),n=e.code;return i({type:f.POST_MESSAGE_TYPE.RESPONSE,ack:f.POST_MESSAGE_ACK.ERROR,error:r,code:n})})]).then(m).catch(function(e){if(t&&t.handleError)return t.handleError(e);throw e})},C[f.POST_MESSAGE_TYPE.RESPONSE]=function(e,r,n){if(!k(n.hash)){var t=N(n.hash);if(!t)throw new Error("No handler found for post message response for message: "+n.name+" from "+r+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!Object(o.matchDomain)(t.domain,r))throw new Error("Response origin "+r+" does not match domain "+Object(o.stringifyDomainPattern)(t.domain));if(x(n.hash),n.ack===f.POST_MESSAGE_ACK.ERROR){var i=new Error(n.error);return n.code&&(i.code=n.code),t.respond(i,null)}if(n.ack===f.POST_MESSAGE_ACK.SUCCESS){var a=n.data||n.response;return t.respond(null,{source:e,origin:r,data:a})}}},C),B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function Y(e){if(!window||window.closed)throw new Error("Message recieved in closed window");try{if(!e.source)return}catch(e){return}var r=e.source,n=e.origin,t=function(e){var r,n=void 0;try{r=e,n=JSON.parse(r)}catch(e){return}if(n&&"object"===(void 0===n?"undefined":B(n))&&null!==n&&(n=n[f.WINDOW_PROPS.POSTROBOT])&&"object"===(void 0===n?"undefined":B(n))&&null!==n&&n.type&&"string"==typeof n.type&&H[n.type])return n}(e.data);if(t){if(!t.sourceDomain||"string"!=typeof t.sourceDomain)throw new Error("Expected message to have sourceDomain");0!==t.sourceDomain.indexOf(f.MOCK_PROTOCOL)&&0!==t.sourceDomain.indexOf(f.FILE_PROTOCOL)||(n=t.sourceDomain),-1===g.receivedMessages.indexOf(t.id)&&(g.receivedMessages.push(t.id),Object(o.isWindowClosed)(r)&&!t.fireAndForget||(t.data&&(t.data=function(e,r,n){return y({obj:t.data},function(n){var t,o;if("object"===(void 0===n?"undefined":P(n))&&null!==n)return b(n,f.SERIALIZATION_TYPES.METHOD)?R(e,r,n):b(n,f.SERIALIZATION_TYPES.ERROR)?(t=n,o=new Error(t.__message__),t.__code__&&(o.code=t.__code__),o):b(n,f.SERIALIZATION_TYPES.PROMISE)?function(e,r,n){return window.Promise?new window.Promise(function(t,o){return R(e,r,n.__then__)(t,o)}):I(e,r,n)}(e,r,n):b(n,f.SERIALIZATION_TYPES.ZALGO_PROMISE)?I(e,r,n):b(n,f.SERIALIZATION_TYPES.REGEX)?function(e,r,n){return new RegExp(n.__source__)}(0,0,n):void 0}).obj}(r,n)),H[t.type](r,n,t)))}}function q(e){try{e.source}catch(e){return}Y({source:e.source||e.sourceElement,origin:e.origin||e.originalEvent&&e.originalEvent.origin,data:e.data})}function F(e){return S.try(function(){if(!e.name)throw new Error("Expected options.name");var r=e.name,n=void 0,t=void 0;if("string"==typeof e.window){var i=document.getElementById(e.window);if(!i)throw new Error("Expected options.window "+Object.prototype.toString.call(e.window)+" to be a valid element id");if("iframe"!==i.tagName.toLowerCase())throw new Error("Expected options.window "+Object.prototype.toString.call(e.window)+" to be an iframe");if(!i.contentWindow)throw new Error("Iframe must have contentWindow. Make sure it has a src attribute and is in the DOM.");n=i.contentWindow}else if(e.window instanceof HTMLIFrameElement){if("iframe"!==e.window.tagName.toLowerCase())throw new Error("Expected options.window "+Object.prototype.toString.call(e.window)+" to be an iframe");if(e.window&&!e.window.contentWindow)throw new Error("Iframe must have contentWindow. Make sure it has a src attribute and is in the DOM.");e.window&&e.window.contentWindow&&(n=e.window.contentWindow)}else n=e.window;if(!n)throw new Error("Expected options.window to be a window object, iframe, or iframe element id.");var a=n;t=e.domain||f.WILDCARD;var s=e.name+"_"+_();if(Object(o.isWindowClosed)(a))throw new Error("Target window is closed");var c=!1,u=g.requestPromises.get(a);u||(u=[],g.requestPromises.set(a,u));var d=S.try(function(){if(Object(o.isAncestor)(window,a))return function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Window",t=g.readyPromises.get(e);return t||(t=new S,g.readyPromises.set(e,t),-1!==r&&setTimeout(function(){return t.reject(new Error(n+" did not load after "+r+"ms"))},r),t)}(a,e.timeout||l.CHILD_WINDOW_TIMEOUT)}).then(function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).origin;if(E(t)&&!e)return W(a)}).then(function(){var n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).origin;if(E(t)){if(!Object(o.matchDomain)(t,n))throw new Error("Remote window domain "+n+" does not match regex: "+t.toString());t=n}if("string"!=typeof t&&!Array.isArray(t))throw new TypeError("Expected domain to be a string or array");var i=t;return new S(function(n,t){var w=void 0;if(e.fireAndForget||function(e,r){g.responseListeners[e]=r}(s,w={name:r,window:a,domain:i,respond:function(e,r){e||(c=!0,u.splice(u.indexOf(d,1))),e?t(e):n(r)}}),j(a,{type:f.POST_MESSAGE_TYPE.REQUEST,hash:s,name:r,data:e.data,fireAndForget:e.fireAndForget},i).catch(t),e.fireAndForget)return n();var h=l.ACK_TIMEOUT,p=e.timeout||l.RES_TIMEOUT,m=100;setTimeout(function n(){if(!c){if(Object(o.isWindowClosed)(a))return w.ack?t(new Error("Window closed for "+r+" before response")):t(new Error("Window closed for "+r+" before ack"));if(h=Math.max(h-m,0),-1!==p&&(p=Math.max(p-m,0)),w.ack){if(-1===p)return;m=Math.min(p,2e3)}else{if(0===h)return t(new Error("No ack for postMessage "+r+" in "+Object(o.getDomain)()+" in "+l.ACK_TIMEOUT+"ms"));if(0===p)return t(new Error("No response for postMessage "+r+" in "+Object(o.getDomain)()+" in "+(e.timeout||l.RES_TIMEOUT)+"ms"))}setTimeout(n,m)}},m)})});return d.catch(function(){!function(e){g.erroredResponseListeners[e]=!0}(s),x(s)}),u.push(d),d})}function J(e,r,n,t){return(t=t||{}).window=e,t.name=r,t.data=n,F(t)}function K(e,r,n){var t=Object(o.getAncestor)();return t?J(t,e,r,n):new S(function(e,r){return r(new Error("Window does not have a parent"))})}function Z(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.window)throw new Error("Expected options.window");var r=e.window;return{send:function(n,t){return J(r,n,t,e)}}}g.receivedMessages=g.receivedMessages||[],g.receiveMessage=Y,g.requestPromises=g.requestPromises||new u,g.send=J;var z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function Q(e){if(!e.name)throw new Error("Expected options.name");if(!e.handler)throw new Error("Expected options.handler");var r,n,t,i=e.name,a=e.window,s=e.domain,c={handler:e.handler,handleError:e.errorHandler||function(e){throw e},window:a,domain:s||f.WILDCARD,name:i},d=function e(r,n){var t=r.name,o=r.win,i=r.domain;if(!t||"string"!=typeof t)throw new Error("Name required to add request listener");if(Array.isArray(o)){for(var a=[],s=0,c=o,d=null==c?0:c.length;s<d;s++){var l=c[s];a.push(e({name:t,domain:i,win:l},n))}return{cancel:function(){for(var e=0,r=null==a?0:a.length;e<r;e++)a[e].cancel()}}}if(Array.isArray(i)){for(var w=[],h=0,p=i,m=null==p?0:p.length;h<m;h++){var _=p[h];w.push(e({name:t,win:o,domain:_},n))}return{cancel:function(){for(var e=0,r=null==w?0:w.length;e<r;e++)w[e].cancel()}}}var y=G({name:t,win:o,domain:i});if(o&&o!==f.WILDCARD||(o=g.WINDOW_WILDCARD),i=i||f.WILDCARD,y)throw o&&i?new Error("Request listener already exists for "+t+" on domain "+i.toString()+" for "+(o===g.WINDOW_WILDCARD?"wildcard":"specified")+" window"):o?new Error("Request listener already exists for "+t+" for "+(o===g.WINDOW_WILDCARD?"wildcard":"specified")+" window"):i?new Error("Request listener already exists for "+t+" on domain "+i.toString()):new Error("Request listener already exists for "+t);var O=g.requestListeners,v=O[t];v||(v=new u,O[t]=v);var S=v.get(o);S||(S={},v.set(o,S));var P=i.toString(),A=S[M],b=void 0;return E(i)?(A||(A=[],S[M]=A),b={regex:i,listener:n},A.push(b)):S[P]=n,{cancel:function(){S&&(delete S[P],o&&0===Object.keys(S).length&&v.delete(o),b&&A.splice(A.indexOf(b,1)))}}}({name:i,win:a,domain:s},c);if(e.once){var l=c.handler;c.handler=p(function(){return d.cancel(),l.apply(this,arguments)})}if(c.window&&e.errorOnClose)var w=(r=function(){a&&"object"===(void 0===a?"undefined":z(a))&&Object(o.isWindowClosed)(a)&&(w.cancel(),c.handleError(new Error("Post message target window is closed")))},n=50,t=void 0,t=setTimeout(function e(){t=setTimeout(e,n),r.call()},n),{cancel:function(){clearTimeout(t)}});return{cancel:function(){d.cancel()}}}function X(e,r,n){return"function"==typeof r&&(n=r,r={}),(r=r||{}).name=e,r.handler=n||r.handler,Q(r)}function V(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2];"function"==typeof r&&(n=r,r={}),r=r||{},n=n||r.handler;var t=r.errorHandler,o=new S(function(o,i){(r=r||{}).name=e,r.once=!0,r.handler=function(e){if(o(e),n)return n(e)},r.errorHandler=function(e){if(i(e),t)return t(e)}}),i=Q(r);return o.cancel=i.cancel,o}function $(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{on:function(r,n){return X(r,e,n)}}}function ee(){delete window[f.WINDOW_PROPS.POSTROBOT],window.removeEventListener("message",q)}g.on=X;var re=Object(o.getAncestor)();function ne(e){var r=g.requestPromises.get(e);if(r)for(var n=0,t=null==r?0:r.length;n<t;n++)r[n].reject(new Error("No response from window - cleaned up"));g.popupWindowsByWin&&g.popupWindowsByWin.delete(e),g.remoteWindows&&g.remoteWindows.delete(e),g.requestPromises.delete(e),g.methods.delete(e),g.readyPromises.delete(e)}var te=null;function oe(){var e,r,n;g.initialized||(r="message",n=q,(e=window).addEventListener?e.addEventListener(r,n):e.attachEvent("on"+r,n),function(){var e;e=function(e){var r=e.source,n=e.origin,t=g.readyPromises.get(r)||new S;t.resolve({origin:n}),g.readyPromises.set(r,t)},g.on(f.POST_MESSAGE_NAMES.HELLO,{domain:f.WILDCARD},function(r){var n=r.source,t=r.origin;return e({source:n,origin:t})});var r=Object(o.getAncestor)();r&&W(r).catch(m)}(),A({on:X,send:J})),g.initialized=!0}oe(),n.d(r,"cleanUpWindow",function(){return ne}),n.d(r,"Promise",function(){return S}),n.d(r,"bridge",function(){return te}),n.d(r,"init",function(){return oe}),n.d(r,"parent",function(){return re}),n.d(r,"send",function(){return J}),n.d(r,"request",function(){return F}),n.d(r,"sendToParent",function(){return K}),n.d(r,"client",function(){return Z}),n.d(r,"on",function(){return X}),n.d(r,"listen",function(){return Q}),n.d(r,"once",function(){return V}),n.d(r,"listener",function(){return $}),n.d(r,"CONFIG",function(){return l}),n.d(r,"CONSTANTS",function(){return f}),n.d(r,"disable",function(){return ee}),r.default=t},function(e,r,n){"use strict";function t(e){return"[object RegExp]"===Object.prototype.toString.call(e)}r.a=f,r.c=d,r.e=l,r.j=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{if(e===window)return!1}catch(e){return!0}try{if(!e)return!0}catch(e){return!0}try{if(e.closed)return!0}catch(e){return!e||e.message!==i}if(r&&function(e){if(!l(e))return!1;try{if(e===window)return!0;if(a(e)&&u(e))return!0;if(d(window)===d(e))return!0}catch(e){}return!1}(e))try{if(e.mockclosed)return!0}catch(e){}try{if(!e.parent||!e.top)return!0}catch(e){}var n=function(e,r){for(var n=0;n<e.length;n++)try{if(e[n]===r)return n}catch(e){}return-1}(p,e);if(-1!==n){var t=m[n];if(t&&function(e){if(!e.contentWindow)return!0;if(!e.parentNode)return!0;var r=e.ownerDocument;return!(!r||!r.body||r.body.contains(e))}(t))return!0}return!1},r.d=function(e){return(e=e||window).navigator.mockUserAgent||e.navigator.userAgent},r.b=_,r.f=function(e,r){var n=_(r);if(n)return n===e;if(r===e)return!1;if(function(e){if(e){try{if(e.top)return e.top}catch(e){}if(s(e)===e)return e;try{if(w(window,e)&&window.top)return window.top}catch(e){}try{if(w(e,window)&&window.top)return window.top}catch(e){}for(var r=0,n=function e(r){for(var n=[],t=0,o=h(r),i=null==o?0:o.length;t<i;t++){var a=o[t];n.push(a);for(var s=0,c=e(a),u=null==c?0:c.length;s<u;s++){var f=c[s];n.push(f)}}return n}(e),t=null==n?0:n.length;r<t;r++){var o=n[r];try{if(o.top)return o.top}catch(e){}if(s(o)===o)return o}}}(r)===r)return!1;for(var t=0,o=h(e),i=null==o?0:o.length;t<i;t++)if(o[t]===r)return!0;return!1},r.h=function(){return Boolean(c(window))},r.g=function(){return Boolean(s(window))},r.k=function e(r,n){if("string"==typeof r){if("string"==typeof n)return r===o.WILDCARD||n===r;if(t(n))return!1;if(Array.isArray(n))return!1}return t(r)?t(n)?r.toString()===n.toString():!Array.isArray(n)&&Boolean(n.match(r)):!!Array.isArray(r)&&(Array.isArray(n)?JSON.stringify(r)===JSON.stringify(n):!t(n)&&r.some(function(r){return e(r,n)}))},r.l=function(e){return Array.isArray(e)?"("+e.join(" | ")+")":t(e)?"RegExp("+e.toString():e.toString()},r.i=function(e){try{if(e===window)return!0}catch(e){if(e&&e.message===i)return!0}try{if("[object Window]"===Object.prototype.toString.call(e))return!0}catch(e){if(e&&e.message===i)return!0}try{if(window.Window&&e instanceof window.Window)return!0}catch(e){if(e&&e.message===i)return!0}try{if(e&&e.self===e)return!0}catch(e){if(e&&e.message===i)return!0}try{if(e&&e.parent===e)return!0}catch(e){if(e&&e.message===i)return!0}try{if(e&&e.top===e)return!0}catch(e){if(e&&e.message===i)return!0}try{e&&e.__cross_domain_utils_window_check__}catch(e){return!0}return!1};var o={MOCK_PROTOCOL:"mock:",FILE_PROTOCOL:"file:",ABOUT_PROTOCOL:"about:",WILDCARD:"*"},i="Call was rejected by callee.\r\n";function a(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).location.protocol===o.ABOUT_PROTOCOL}function s(e){if(e)try{if(e.parent&&e.parent!==e)return e.parent}catch(e){}}function c(e){if(e&&!s(e))try{return e.opener}catch(e){}}function u(e){try{return e&&e.location&&e.location.href,!0}catch(e){}return!1}function f(e){var r=(e=e||window).location;if(!r)throw new Error("Can not read window location");var n=r.protocol;if(!n)throw new Error("Can not read window protocol");if(n===o.FILE_PROTOCOL)return o.FILE_PROTOCOL+"//";if(n===o.ABOUT_PROTOCOL){var t=s(e);return t&&u(t)?f(t):o.ABOUT_PROTOCOL+"//"}var i=r.host;if(!i)throw new Error("Can not read window host");return n+"//"+i}function d(e){var r=f(e=e||window);return r&&e.mockDomain&&0===e.mockDomain.indexOf(o.MOCK_PROTOCOL)?e.mockDomain:r}function l(e){try{if(e===window)return!0}catch(e){}try{var r=Object.getOwnPropertyDescriptor(e,"location");if(r&&!1===r.enumerable)return!1}catch(e){}try{if(a(e)&&u(e))return!0}catch(e){}try{if(f(e)===f(window))return!0}catch(e){}return!1}function w(e,r){if(!e||!r)return!1;var n=s(r);return n?n===e:-1!==function(e){var r=[];try{for(;e.parent!==e;)r.push(e.parent),e=e.parent}catch(e){}return r}(r).indexOf(e)}function h(e){var r=[],n=void 0;try{n=e.frames}catch(r){n=e}var t=void 0;try{t=n.length}catch(e){}if(0===t)return r;if(t){for(var o=0;o<t;o++){var i=void 0;try{i=n[o]}catch(e){continue}r.push(i)}return r}for(var a=0;a<100;a++){var s=void 0;try{s=n[a]}catch(e){return r}if(!s)return r;r.push(s)}return r}var p=[],m=[];function _(e){return c(e=e||window)||s(e)||void 0}},function(e,r){}])});
//# sourceMappingURL=post-robot.min.js.map
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define("postRobot",[],r):"object"==typeof exports?exports.postRobot=r():e.postRobot=r()}("undefined"!=typeof self?self:this,function(){return function(e){var r={};function n(t){if(r[t])return r[t].exports;var o=r[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=r,n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:t})},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,"a",r),r},n.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},n.p="",n(n.s=2)}([function(e,r,n){"use strict";var t=n(3);n.d(r,"getActualDomain",function(){return t.a}),n.d(r,"getAncestor",function(){return t.b}),n.d(r,"getDomain",function(){return t.c}),n.d(r,"getUserAgent",function(){return t.d}),n.d(r,"isActuallySameDomain",function(){return t.e}),n.d(r,"isAncestor",function(){return t.f}),n.d(r,"isIframe",function(){return t.g}),n.d(r,"isPopup",function(){return t.h}),n.d(r,"isWindow",function(){return t.i}),n.d(r,"isWindowClosed",function(){return t.j}),n.d(r,"matchDomain",function(){return t.k}),n.d(r,"stringifyDomainPattern",function(){return t.l});var o=n(4);n.n(o),n(1)},function(e,r,n){"use strict";n.d(r,"a",function(){return t}),n.d(r,"b",function(){return o});var t={MOCK:"mock:",FILE:"file:",ABOUT:"about:"},o="*"},function(e,r,n){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),n.d({},"WeakMap",function(){return u});var t={};n.d(t,"cleanUpWindow",function(){return ne}),n.d(t,"Promise",function(){return S}),n.d(t,"bridge",function(){return te}),n.d(t,"init",function(){return oe}),n.d(t,"parent",function(){return re}),n.d(t,"send",function(){return J}),n.d(t,"request",function(){return F}),n.d(t,"sendToParent",function(){return K}),n.d(t,"client",function(){return Z}),n.d(t,"on",function(){return X}),n.d(t,"listen",function(){return Q}),n.d(t,"once",function(){return V}),n.d(t,"listener",function(){return $}),n.d(t,"CONFIG",function(){return l}),n.d(t,"CONSTANTS",function(){return f}),n.d(t,"disable",function(){return ee});var o=n(0);function i(e,r){for(var n=0;n<e.length;n++)try{if(e[n]===r)return n}catch(e){}return-1}var a,s=Object.defineProperty,c=Date.now()%1e9,u=function(){function e(){if(function(r,n){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}(this),c+=1,this.name="__weakmap_"+(1e9*Math.random()>>>0)+"__"+c,function(){if("undefined"==typeof WeakMap)return!1;if(void 0===Object.freeze)return!1;try{var e=new WeakMap,r={};return Object.freeze(r),e.set(r,"__testvalue__"),"__testvalue__"===e.get(r)}catch(e){return!1}}())try{this.weakmap=new WeakMap}catch(e){}this.keys=[],this.values=[]}return e.prototype._cleanupClosedWindows=function(){for(var e=this.weakmap,r=this.keys,n=0;n<r.length;n++){var t=r[n];if(Object(o.isWindow)(t)&&Object(o.isWindowClosed)(t)){if(e)try{e.delete(t)}catch(e){}r.splice(n,1),this.values.splice(n,1),n-=1}}},e.prototype.isSafeToReadWrite=function(e){if(Object(o.isWindow)(e))return!1;try{e&&e.self,e&&e[this.name]}catch(e){return!1}return!0},e.prototype.set=function(e,r){if(!e)throw new Error("WeakMap expected key");var n=this.weakmap;if(n)try{n.set(e,r)}catch(e){delete this.weakmap}if(this.isSafeToReadWrite(e)){var t=this.name,o=e[t];o&&o[0]===e?o[1]=r:s(e,t,{value:[e,r],writable:!0})}else{this._cleanupClosedWindows();var a=this.keys,c=this.values,u=i(a,e);-1===u?(a.push(e),c.push(r)):c[u]=r}},e.prototype.get=function(e){if(!e)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{if(r.has(e))return r.get(e)}catch(e){delete this.weakmap}if(!this.isSafeToReadWrite(e)){this._cleanupClosedWindows();var n=i(this.keys,e);if(-1===n)return;return this.values[n]}var t=e[this.name];if(t&&t[0]===e)return t[1]},e.prototype.delete=function(e){if(!e)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{r.delete(e)}catch(e){delete this.weakmap}if(this.isSafeToReadWrite(e)){var n=e[this.name];n&&n[0]===e&&(n[0]=n[1]=void 0)}else{this._cleanupClosedWindows();var t=this.keys,o=i(t,e);-1!==o&&(t.splice(o,1),this.values.splice(o,1))}},e.prototype.has=function(e){if(!e)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{if(r.has(e))return!0}catch(e){delete this.weakmap}if(this.isSafeToReadWrite(e)){var n=e[this.name];return!(!n||n[0]!==e)}return this._cleanupClosedWindows(),-1!==i(this.keys,e)},e.prototype.getOrSet=function(e,r){if(this.has(e))return this.get(e);var n=r();return this.set(e,n),n},e}(),f={POST_MESSAGE_TYPE:{REQUEST:"postrobot_message_request",RESPONSE:"postrobot_message_response",ACK:"postrobot_message_ack"},POST_MESSAGE_ACK:{SUCCESS:"success",ERROR:"error"},POST_MESSAGE_NAMES:{METHOD:"postrobot_method",HELLO:"postrobot_ready",OPEN_TUNNEL:"postrobot_open_tunnel"},WINDOW_TYPES:{FULLPAGE:"fullpage",POPUP:"popup",IFRAME:"iframe"},WINDOW_PROPS:{POSTROBOT:"__postRobot__"},SERIALIZATION_TYPES:{METHOD:"postrobot_method",ERROR:"postrobot_error",PROMISE:"postrobot_promise",ZALGO_PROMISE:"postrobot_zalgo_promise",REGEX:"regex"},SEND_STRATEGIES:{POST_MESSAGE:"postrobot_post_message",BRIDGE:"postrobot_bridge",GLOBAL:"postrobot_global"},MOCK_PROTOCOL:"mock:",FILE_PROTOCOL:"file:",BRIDGE_NAME_PREFIX:"__postrobot_bridge__",POSTROBOT_PROXY:"__postrobot_proxy__",WILDCARD:"*"},d={METHOD:"postrobot_method",HELLO:"postrobot_hello",OPEN_TUNNEL:"postrobot_open_tunnel"},l=(Object.keys(d).map(function(e){return d[e]}),{ALLOW_POSTMESSAGE_POPUP:!("__ALLOW_POSTMESSAGE_POPUP__"in window)||window.__ALLOW_POSTMESSAGE_POPUP__,BRIDGE_TIMEOUT:5e3,CHILD_WINDOW_TIMEOUT:5e3,ACK_TIMEOUT:-1!==window.navigator.userAgent.match(/MSIE/i)?1e4:2e3,RES_TIMEOUT:-1,ALLOWED_POST_MESSAGE_METHODS:(a={},a[f.SEND_STRATEGIES.POST_MESSAGE]=!0,a[f.SEND_STRATEGIES.BRIDGE]=!0,a[f.SEND_STRATEGIES.GLOBAL]=!0,a),ALLOW_SAME_ORIGIN:!1});0===window.location.href.indexOf(f.FILE_PROTOCOL)&&(l.ALLOW_POSTMESSAGE_POPUP=!0);var h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function w(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(r>=3)return"stringifyError stack overflow";try{if(!e)return"<unknown error: "+Object.prototype.toString.call(e)+">";if("string"==typeof e)return e;if(e instanceof Error){var n=e&&e.stack,t=e&&e.message;if(n&&t)return-1!==n.indexOf(t)?n:t+"\n"+n;if(n)return n;if(t)return t}return"function"==typeof e.toString?e.toString():Object.prototype.toString.call(e)}catch(e){return"Error while stringifying error: "+w(e,r+1)}}var p=function(e){if(!e)return e;var r=!1;return function(){if(!r)return r=!0,e.apply(this,arguments)}};function m(){}function y(){var e="0123456789abcdef";return"xxxxxxxxxx".replace(/./g,function(){return e.charAt(Math.floor(Math.random()*e.length))})}function E(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(n>=100)throw new Error("Self-referential object passed, or object contained too many layers");var t=void 0;if("object"!==(void 0===e?"undefined":h(e))||null===e||Array.isArray(e)){if(!Array.isArray(e))throw new TypeError("Invalid type: "+(void 0===e?"undefined":h(e)));t=[]}else t={};return function(e,r){Array.isArray(e)?function(e,r){for(var n=0;n<e.length;n++)r(e[n],n)}(e,r):"object"===(void 0===e?"undefined":h(e))&&null!==e&&function(e,r){for(var n in e)e.hasOwnProperty(n)&&r(e[n],n)}(e,r)}(e,function(e,o){var i=r(e,o);void 0!==i?t[o]=i:"object"===(void 0===e?"undefined":h(e))&&null!==e?t[o]=E(e,r,n+1):t[o]=e}),t}function _(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function v(e){try{if(!e)return!1;if("undefined"!=typeof Promise&&e instanceof Promise)return!0;if("undefined"!=typeof window&&window.Window&&e instanceof window.Window)return!1;if("undefined"!=typeof window&&window.constructor&&e instanceof window.constructor)return!1;var r={}.toString;if(r){var n=r.call(e);if("[object Window]"===n||"[object global]"===n||"[object DOMWindow]"===n)return!1}if("function"==typeof e.then)return!0}catch(e){return!1}return!1}function O(){var e=void 0;if("undefined"!=typeof window)e=window;else{if("undefined"==typeof window)throw new TypeError("Can not find global");e=window}var r=e.__zalgopromise__=e.__zalgopromise__||{};return r.flushPromises=r.flushPromises||[],r.activeCount=r.activeCount||0,r.possiblyUnhandledPromiseHandlers=r.possiblyUnhandledPromiseHandlers||[],r.dispatchedErrors=r.dispatchedErrors||[],r}var S=function(){function e(r){var n=this;if(function(r,n){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}(this),this.resolved=!1,this.rejected=!1,this.errorHandled=!1,this.handlers=[],r){var t=void 0,o=void 0,i=!1,a=!1,s=!1;try{r(function(e){s?n.resolve(e):(i=!0,t=e)},function(e){s?n.reject(e):(a=!0,o=e)})}catch(e){return void this.reject(e)}s=!0,i?this.resolve(t):a&&this.reject(o)}}return e.prototype.resolve=function(e){if(this.resolved||this.rejected)return this;if(v(e))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=e,this.dispatch(),this},e.prototype.reject=function(e){var r=this;if(this.resolved||this.rejected)return this;if(v(e))throw new Error("Can not reject promise with another promise");if(!e){var n=e&&"function"==typeof e.toString?e.toString():Object.prototype.toString.call(e);e=new Error("Expected reject to be called with Error, got "+n)}return this.rejected=!0,this.error=e,this.errorHandled||setTimeout(function(){r.errorHandled||function(e,r){if(-1===O().dispatchedErrors.indexOf(e)){O().dispatchedErrors.push(e),setTimeout(function(){throw e},1);for(var n=0;n<O().possiblyUnhandledPromiseHandlers.length;n++)O().possiblyUnhandledPromiseHandlers[n](e,r)}}(e,r)},1),this.dispatch(),this},e.prototype.asyncReject=function(e){return this.errorHandled=!0,this.reject(e),this},e.prototype.dispatch=function(){var r=this,n=this.dispatching,t=this.resolved,o=this.rejected,i=this.handlers;if(!n&&(t||o)){this.dispatching=!0,O().activeCount+=1;for(var a=function(n){var a=i[n],s=a.onSuccess,c=a.onError,u=a.promise,f=void 0;if(t)try{f=s?s(r.value):r.value}catch(e){return u.reject(e),"continue"}else if(o){if(!c)return u.reject(r.error),"continue";try{f=c(r.error)}catch(e){return u.reject(e),"continue"}}f instanceof e&&(f.resolved||f.rejected)?(f.resolved?u.resolve(f.value):u.reject(f.error),f.errorHandled=!0):v(f)?f instanceof e&&(f.resolved||f.rejected)?f.resolved?u.resolve(f.value):u.reject(f.error):f.then(function(e){u.resolve(e)},function(e){u.reject(e)}):u.resolve(f)},s=0;s<i.length;s++)a(s);i.length=0,this.dispatching=!1,O().activeCount-=1,0===O().activeCount&&e.flushQueue()}},e.prototype.then=function(r,n){if(r&&"function"!=typeof r&&!r.call)throw new Error("Promise.then expected a function for success handler");if(n&&"function"!=typeof n&&!n.call)throw new Error("Promise.then expected a function for error handler");var t=new e;return this.handlers.push({promise:t,onSuccess:r,onError:n}),this.errorHandled=!0,this.dispatch(),t},e.prototype.catch=function(e){return this.then(void 0,e)},e.prototype.finally=function(r){if(r&&"function"!=typeof r&&!r.call)throw new Error("Promise.finally expected a function");return this.then(function(n){return e.try(r).then(function(){return n})},function(n){return e.try(r).then(function(){throw n})})},e.prototype.timeout=function(e,r){var n=this;if(this.resolved||this.rejected)return this;var t=setTimeout(function(){n.resolved||n.rejected||n.reject(r||new Error("Promise timed out after "+e+"ms"))},e);return this.then(function(e){return clearTimeout(t),e})},e.prototype.toPromise=function(){if("undefined"==typeof Promise)throw new TypeError("Could not find Promise");return Promise.resolve(this)},e.resolve=function(r){return r instanceof e?r:v(r)?new e(function(e,n){return r.then(e,n)}):(new e).resolve(r)},e.reject=function(r){return(new e).reject(r)},e.asyncReject=function(r){return(new e).asyncReject(r)},e.all=function(r){var n=new e,t=r.length,o=[];if(!t)return n.resolve(o),n;for(var i=function(i){var a=r[i];if(a instanceof e){if(a.resolved)return o[i]=a.value,t-=1,"continue"}else if(!v(a))return o[i]=a,t-=1,"continue";e.resolve(a).then(function(e){o[i]=e,0==(t-=1)&&n.resolve(o)},function(e){n.reject(e)})},a=0;a<r.length;a++)i(a);return 0===t&&n.resolve(o),n},e.hash=function(r){var n={};return e.all(Object.keys(r).map(function(t){return e.resolve(r[t]).then(function(e){n[t]=e})})).then(function(){return n})},e.map=function(r,n){return e.all(r.map(n))},e.onPossiblyUnhandledException=function(e){return function(e){return O().possiblyUnhandledPromiseHandlers.push(e),{cancel:function(){O().possiblyUnhandledPromiseHandlers.splice(O().possiblyUnhandledPromiseHandlers.indexOf(e),1)}}}(e)},e.try=function(r,n,t){if(r&&"function"!=typeof r&&!r.call)throw new Error("Promise.try expected a function");var o=void 0;try{o=r.apply(n,t||[])}catch(r){return e.reject(r)}return e.resolve(o)},e.delay=function(r){return new e(function(e){setTimeout(e,r)})},e.isPromise=function(r){return!!(r&&r instanceof e)||v(r)},e.flush=function(){var r=new e;return O().flushPromises.push(r),0===O().activeCount&&e.flushQueue(),r},e.flushQueue=function(){var e=O().flushPromises;O().flushPromises=[];for(var r=0,n=null==e?0:e.length;r<n;r++)e[r].resolve()},e}(),g=window[f.WINDOW_PROPS.POSTROBOT]=window[f.WINDOW_PROPS.POSTROBOT]||{};g.registerSelf=function(){};var P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};g.methods=g.methods||new u;var b=p(function(){g.on(f.POST_MESSAGE_NAMES.METHOD,{origin:f.WILDCARD},function(e){var r=e.source,n=e.origin,t=e.data,i=g.methods.get(r);if(!i)throw new Error("Could not find any methods this window has privileges to call");var a=i[t.id];if(!a)throw new Error("Could not find method with id: "+t.id);if(!Object(o.matchDomain)(a.domain,n))throw new Error("Method domain "+a.domain+" does not match origin "+n);return S.try(function(){return a.method.apply({source:r,origin:n,data:t},t.args)}).then(function(e){return{result:e,id:t.id,name:t.name}})})});function A(e,r){return"object"===(void 0===e?"undefined":P(e))&&null!==e&&e.__type__===r}function T(e,r,n,t){var o=y(),i=g.methods.get(e);return i||(i={},g.methods.set(e,i)),i[o]={domain:r,method:n},{__type__:f.SERIALIZATION_TYPES.METHOD,__id__:o,__name__:t}}function R(e,r,n){function t(){var t=Array.prototype.slice.call(arguments);return g.send(e,f.POST_MESSAGE_NAMES.METHOD,{id:n.__id__,name:n.__name__,args:t},{domain:r,timeout:-1}).then(function(e){return e.data.result},function(e){throw e})}return t.__name__=n.__name__,t.__xdomain__=!0,t.source=e,t.origin=r,t}function I(e,r,n){return new S(function(t,o){return R(e,r,n.__then__)(t,o)})}function W(e){return g.send(e,f.POST_MESSAGE_NAMES.HELLO,{},{domain:f.WILDCARD,timeout:-1}).then(function(e){return{origin:e.origin}})}g.readyPromises=g.readyPromises||new u;var j={};j[f.SEND_STRATEGIES.POST_MESSAGE]=function(e,r,n){(Array.isArray(n)?n:"string"==typeof n?[n]:[f.WILDCARD]).map(function(r){if(0===r.indexOf(f.MOCK_PROTOCOL)){if(window.location.protocol===f.FILE_PROTOCOL)return f.WILDCARD;if(!Object(o.isActuallySameDomain)(e))throw new Error("Attempting to send messsage to mock domain "+r+", but window is actually cross-domain");return Object(o.getActualDomain)(e)}return 0===r.indexOf(f.FILE_PROTOCOL)?f.WILDCARD:r}).forEach(function(n){return e.postMessage(r,n)})};var D=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e};function L(e,r,n){return S.try(function(){var t;if(r=function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},t=y(),i=Object(o.isPopup)()?f.WINDOW_TYPES.POPUP:Object(o.isIframe)()?f.WINDOW_TYPES.IFRAME:f.WINDOW_TYPES.FULLPAGE,a=Object(o.getDomain)(window);return D({},r,n,{sourceDomain:a,id:r.id||t,windowType:i})}(e,r,{data:function(e,n,t){return E({obj:r.data},function(r,t){return"function"==typeof r?T(e,n,r,t.toString()):r instanceof Error?(o=r,{__type__:f.SERIALIZATION_TYPES.ERROR,__message__:w(o),__code__:o.code}):window.Promise&&r instanceof window.Promise?function(e,r,n,t){return{__type__:f.SERIALIZATION_TYPES.PROMISE,__then__:T(e,r,function(e,r){return n.then(e,r)},t+".then")}}(e,n,r,t.toString()):S.isPromise(r)?function(e,r,n,t){return{__type__:f.SERIALIZATION_TYPES.ZALGO_PROMISE,__then__:T(e,r,function(e,r){return n.then(e,r)},t+".then")}}(e,n,r,t.toString()):_(r)?(i=r,{__type__:f.SERIALIZATION_TYPES.REGEX,__source__:i.source}):void 0;var o,i}).obj}(e,n),domain:n}),e===window&&!l.ALLOW_SAME_ORIGIN)throw new Error("Attemping to send message to self");if(Object(o.isWindowClosed)(e))throw new Error("Window is closed");var i=[],a=function(e,r,n){var t=void 0,o=void 0;try{if("{}"!==JSON.stringify({})&&(t=Object.prototype.toJSON,delete Object.prototype.toJSON),"{}"!==JSON.stringify({}))throw new Error("Can not correctly serialize JSON objects");if("[]"!==JSON.stringify([])&&(o=Array.prototype.toJSON,delete Array.prototype.toJSON),"[]"!==JSON.stringify([]))throw new Error("Can not correctly serialize JSON objects")}catch(e){throw new Error("Can not repair JSON.stringify: "+e.message)}var i=JSON.stringify.call(this,e,null,2);try{t&&(Object.prototype.toJSON=t),o&&(Array.prototype.toJSON=o)}catch(e){throw new Error("Can not repair JSON.stringify: "+e.message)}return i}(((t={})[f.WINDOW_PROPS.POSTROBOT]=r,t));return S.map(Object.keys(j),function(r){return S.try(function(){if(!l.ALLOWED_POST_MESSAGE_METHODS[r])throw new Error("Strategy disallowed: "+r);return j[r](e,a,n)}).then(function(){return i.push(r+": success"),!0},function(e){return i.push(r+": "+w(e)+"\n"),!1})}).then(function(e){var n=e.some(Boolean),t=r.type+" "+r.name+" "+(n?"success":"error")+":\n - "+i.join("\n - ")+"\n";if(!n)throw new Error(t)})})}g.responseListeners=g.responseListeners||{},g.requestListeners=g.requestListeners||{},g.WINDOW_WILDCARD=g.WINDOW_WILDCARD||new function(){},g.erroredResponseListeners=g.erroredResponseListeners||{};var M,C="__domain_regex__";function N(e){return g.responseListeners[e]}function x(e){delete g.responseListeners[e]}function k(e){return Boolean(g.erroredResponseListeners[e])}function G(e){var r=e.name,n=e.win,t=e.domain;if(n===f.WILDCARD&&(n=null),t===f.WILDCARD&&(t=null),!r)throw new Error("Name required to get request listener");var i=g.requestListeners[r];if(i)for(var a=0,s=[n,g.WINDOW_WILDCARD],c=null==s?0:s.length;a<c;a++){var u=s[a],d=u&&i.get(u);if(d){if(t&&"string"==typeof t){if(d[t])return d[t];if(d[C])for(var l=0,h=d[C],w=null==h?0:h.length;l<w;l++){var p=h[l],m=p.regex,y=p.listener;if(Object(o.matchDomain)(m,t))return y}}if(d[f.WILDCARD])return d[f.WILDCARD]}}}var U=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},H=((M={})[f.POST_MESSAGE_TYPE.ACK]=function(e,r,n){if(!k(n.hash)){var t=N(n.hash);if(!t)throw new Error("No handler found for post message ack for message: "+n.name+" from "+r+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!Object(o.matchDomain)(t.domain,r))throw new Error("Ack origin "+r+" does not match domain "+t.domain.toString());t.ack=!0}},M[f.POST_MESSAGE_TYPE.REQUEST]=function(e,r,n){var t=G({name:n.name,win:e,domain:r});function i(t){return n.fireAndForget||Object(o.isWindowClosed)(e)?S.resolve():L(e,U({target:n.originalSource,hash:n.hash,name:n.name},t),r)}return S.all([i({type:f.POST_MESSAGE_TYPE.ACK}),S.try(function(){if(!t)throw new Error("No handler found for post message: "+n.name+" from "+r+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!Object(o.matchDomain)(t.domain,r))throw new Error("Request origin "+r+" does not match domain "+t.domain.toString());var i=n.data;return t.handler({source:e,origin:r,data:i})}).then(function(e){return i({type:f.POST_MESSAGE_TYPE.RESPONSE,ack:f.POST_MESSAGE_ACK.SUCCESS,data:e})},function(e){var r=w(e).replace(/^Error: /,""),n=e.code;return i({type:f.POST_MESSAGE_TYPE.RESPONSE,ack:f.POST_MESSAGE_ACK.ERROR,error:r,code:n})})]).then(m).catch(function(e){if(t&&t.handleError)return t.handleError(e);throw e})},M[f.POST_MESSAGE_TYPE.RESPONSE]=function(e,r,n){if(!k(n.hash)){var t=N(n.hash);if(!t)throw new Error("No handler found for post message response for message: "+n.name+" from "+r+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!Object(o.matchDomain)(t.domain,r))throw new Error("Response origin "+r+" does not match domain "+Object(o.stringifyDomainPattern)(t.domain));if(x(n.hash),n.ack===f.POST_MESSAGE_ACK.ERROR){var i=new Error(n.error);return n.code&&(i.code=n.code),t.respond(i,null)}if(n.ack===f.POST_MESSAGE_ACK.SUCCESS){var a=n.data||n.response;return t.respond(null,{source:e,origin:r,data:a})}}},M),B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function Y(e){if(!window||window.closed)throw new Error("Message recieved in closed window");try{if(!e.source)return}catch(e){return}var r=e.source,n=e.origin,t=function(e){var r,n=void 0;try{r=e,n=JSON.parse(r)}catch(e){return}if(n&&"object"===(void 0===n?"undefined":B(n))&&null!==n&&(n=n[f.WINDOW_PROPS.POSTROBOT])&&"object"===(void 0===n?"undefined":B(n))&&null!==n&&n.type&&"string"==typeof n.type&&H[n.type])return n}(e.data);if(t){if(!t.sourceDomain||"string"!=typeof t.sourceDomain)throw new Error("Expected message to have sourceDomain");0!==t.sourceDomain.indexOf(f.MOCK_PROTOCOL)&&0!==t.sourceDomain.indexOf(f.FILE_PROTOCOL)||(n=t.sourceDomain),-1===g.receivedMessages.indexOf(t.id)&&(g.receivedMessages.push(t.id),Object(o.isWindowClosed)(r)&&!t.fireAndForget||(t.data&&(t.data=function(e,r,n){return E({obj:t.data},function(n){var t,o;if("object"===(void 0===n?"undefined":P(n))&&null!==n)return A(n,f.SERIALIZATION_TYPES.METHOD)?R(e,r,n):A(n,f.SERIALIZATION_TYPES.ERROR)?(t=n,o=new Error(t.__message__),t.__code__&&(o.code=t.__code__),o):A(n,f.SERIALIZATION_TYPES.PROMISE)?function(e,r,n){return window.Promise?new window.Promise(function(t,o){return R(e,r,n.__then__)(t,o)}):I(e,r,n)}(e,r,n):A(n,f.SERIALIZATION_TYPES.ZALGO_PROMISE)?I(e,r,n):A(n,f.SERIALIZATION_TYPES.REGEX)?function(e,r,n){return new RegExp(n.__source__)}(0,0,n):void 0}).obj}(r,n)),H[t.type](r,n,t)))}}function q(e){try{e.source}catch(e){return}Y({source:e.source||e.sourceElement,origin:e.origin||e.originalEvent&&e.originalEvent.origin,data:e.data})}function F(e){return S.try(function(){if(!e.name)throw new Error("Expected options.name");var r=e.name,n=void 0,t=void 0;if("string"==typeof e.window){var i=document.getElementById(e.window);if(!i)throw new Error("Expected options.window "+Object.prototype.toString.call(e.window)+" to be a valid element id");if("iframe"!==i.tagName.toLowerCase())throw new Error("Expected options.window "+Object.prototype.toString.call(e.window)+" to be an iframe");if(!i.contentWindow)throw new Error("Iframe must have contentWindow. Make sure it has a src attribute and is in the DOM.");n=i.contentWindow}else if(e.window instanceof HTMLIFrameElement){if("iframe"!==e.window.tagName.toLowerCase())throw new Error("Expected options.window "+Object.prototype.toString.call(e.window)+" to be an iframe");if(e.window&&!e.window.contentWindow)throw new Error("Iframe must have contentWindow. Make sure it has a src attribute and is in the DOM.");e.window&&e.window.contentWindow&&(n=e.window.contentWindow)}else n=e.window;if(!n)throw new Error("Expected options.window to be a window object, iframe, or iframe element id.");var a=n;t=e.domain||f.WILDCARD;var s=e.name+"_"+y();if(Object(o.isWindowClosed)(a))throw new Error("Target window is closed");var c=!1,u=g.requestPromises.get(a);u||(u=[],g.requestPromises.set(a,u));var d=S.try(function(){if(Object(o.isAncestor)(window,a))return function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Window",t=g.readyPromises.get(e);return t||(t=new S,g.readyPromises.set(e,t),-1!==r&&setTimeout(function(){return t.reject(new Error(n+" did not load after "+r+"ms"))},r),t)}(a,e.timeout||l.CHILD_WINDOW_TIMEOUT)}).then(function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).origin;if(_(t)&&!e)return W(a)}).then(function(){var n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).origin;if(_(t)){if(!Object(o.matchDomain)(t,n))throw new Error("Remote window domain "+n+" does not match regex: "+t.toString());t=n}if("string"!=typeof t&&!Array.isArray(t))throw new TypeError("Expected domain to be a string or array");var i=t;return new S(function(n,t){var h=void 0;if(e.fireAndForget||function(e,r){g.responseListeners[e]=r}(s,h={name:r,window:a,domain:i,respond:function(e,r){e||(c=!0,u.splice(u.indexOf(d,1))),e?t(e):n(r)}}),L(a,{type:f.POST_MESSAGE_TYPE.REQUEST,hash:s,name:r,data:e.data,fireAndForget:e.fireAndForget},i).catch(t),e.fireAndForget)return n();var w=l.ACK_TIMEOUT,p=e.timeout||l.RES_TIMEOUT,m=100;setTimeout(function n(){if(!c){if(Object(o.isWindowClosed)(a))return h.ack?t(new Error("Window closed for "+r+" before response")):t(new Error("Window closed for "+r+" before ack"));if(w=Math.max(w-m,0),-1!==p&&(p=Math.max(p-m,0)),h.ack){if(-1===p)return;m=Math.min(p,2e3)}else{if(0===w)return t(new Error("No ack for postMessage "+r+" in "+Object(o.getDomain)()+" in "+l.ACK_TIMEOUT+"ms"));if(0===p)return t(new Error("No response for postMessage "+r+" in "+Object(o.getDomain)()+" in "+(e.timeout||l.RES_TIMEOUT)+"ms"))}setTimeout(n,m)}},m)})});return d.catch(function(){!function(e){g.erroredResponseListeners[e]=!0}(s),x(s)}),u.push(d),d})}function J(e,r,n,t){return(t=t||{}).window=e,t.name=r,t.data=n,F(t)}function K(e,r,n){var t=Object(o.getAncestor)();return t?J(t,e,r,n):new S(function(e,r){return r(new Error("Window does not have a parent"))})}function Z(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e.window)throw new Error("Expected options.window");var r=e.window;return{send:function(n,t){return J(r,n,t,e)}}}g.receivedMessages=g.receivedMessages||[],g.receiveMessage=Y,g.requestPromises=g.requestPromises||new u,g.send=J;var z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function Q(e){if(!e.name)throw new Error("Expected options.name");if(!e.handler)throw new Error("Expected options.handler");var r,n,t,i=e.name,a=e.window,s=e.domain,c={handler:e.handler,handleError:e.errorHandler||function(e){throw e},window:a,domain:s||f.WILDCARD,name:i},d=function e(r,n){var t=r.name,o=r.win,i=r.domain;if(!t||"string"!=typeof t)throw new Error("Name required to add request listener");if(Array.isArray(o)){for(var a=[],s=0,c=o,d=null==c?0:c.length;s<d;s++){var l=c[s];a.push(e({name:t,domain:i,win:l},n))}return{cancel:function(){for(var e=0,r=null==a?0:a.length;e<r;e++)a[e].cancel()}}}if(Array.isArray(i)){for(var h=[],w=0,p=i,m=null==p?0:p.length;w<m;w++){var y=p[w];h.push(e({name:t,win:o,domain:y},n))}return{cancel:function(){for(var e=0,r=null==h?0:h.length;e<r;e++)h[e].cancel()}}}var E=G({name:t,win:o,domain:i});if(o&&o!==f.WILDCARD||(o=g.WINDOW_WILDCARD),i=i||f.WILDCARD,E)throw o&&i?new Error("Request listener already exists for "+t+" on domain "+i.toString()+" for "+(o===g.WINDOW_WILDCARD?"wildcard":"specified")+" window"):o?new Error("Request listener already exists for "+t+" for "+(o===g.WINDOW_WILDCARD?"wildcard":"specified")+" window"):i?new Error("Request listener already exists for "+t+" on domain "+i.toString()):new Error("Request listener already exists for "+t);var v=g.requestListeners,O=v[t];O||(O=new u,v[t]=O);var S=O.get(o);S||(S={},O.set(o,S));var P=i.toString(),b=S[C],A=void 0;return _(i)?(b||(b=[],S[C]=b),A={regex:i,listener:n},b.push(A)):S[P]=n,{cancel:function(){S&&(delete S[P],o&&0===Object.keys(S).length&&O.delete(o),A&&b.splice(b.indexOf(A,1)))}}}({name:i,win:a,domain:s},c);if(e.once){var l=c.handler;c.handler=p(function(){return d.cancel(),l.apply(this,arguments)})}if(c.window&&e.errorOnClose)var h=(r=function(){a&&"object"===(void 0===a?"undefined":z(a))&&Object(o.isWindowClosed)(a)&&(h.cancel(),c.handleError(new Error("Post message target window is closed")))},n=50,t=void 0,t=setTimeout(function e(){t=setTimeout(e,n),r.call()},n),{cancel:function(){clearTimeout(t)}});return{cancel:function(){d.cancel()}}}function X(e,r,n){return"function"==typeof r&&(n=r,r={}),(r=r||{}).name=e,r.handler=n||r.handler,Q(r)}function V(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2];"function"==typeof r&&(n=r,r={}),r=r||{},n=n||r.handler;var t=r.errorHandler,o=new S(function(o,i){(r=r||{}).name=e,r.once=!0,r.handler=function(e){if(o(e),n)return n(e)},r.errorHandler=function(e){if(i(e),t)return t(e)}}),i=Q(r);return o.cancel=i.cancel,o}function $(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{on:function(r,n){return X(r,e,n)}}}function ee(){delete window[f.WINDOW_PROPS.POSTROBOT],window.removeEventListener("message",q)}g.on=X;var re=Object(o.getAncestor)();function ne(e){var r=g.requestPromises.get(e);if(r)for(var n=0,t=null==r?0:r.length;n<t;n++)r[n].reject(new Error("No response from window - cleaned up"));g.popupWindowsByWin&&g.popupWindowsByWin.delete(e),g.remoteWindows&&g.remoteWindows.delete(e),g.requestPromises.delete(e),g.methods.delete(e),g.readyPromises.delete(e)}var te=null;function oe(){var e,r,n;g.initialized||(r="message",n=q,(e=window).addEventListener?e.addEventListener(r,n):e.attachEvent("on"+r,n),function(){var e;e=function(e){var r=e.source,n=e.origin,t=g.readyPromises.get(r)||new S;t.resolve({origin:n}),g.readyPromises.set(r,t)},g.on(f.POST_MESSAGE_NAMES.HELLO,{domain:f.WILDCARD},function(r){var n=r.source,t=r.origin;return e({source:n,origin:t})});var r=Object(o.getAncestor)();r&&W(r).catch(m)}(),b({on:X,send:J})),g.initialized=!0}oe(),n.d(r,"cleanUpWindow",function(){return ne}),n.d(r,"Promise",function(){return S}),n.d(r,"bridge",function(){return te}),n.d(r,"init",function(){return oe}),n.d(r,"parent",function(){return re}),n.d(r,"send",function(){return J}),n.d(r,"request",function(){return F}),n.d(r,"sendToParent",function(){return K}),n.d(r,"client",function(){return Z}),n.d(r,"on",function(){return X}),n.d(r,"listen",function(){return Q}),n.d(r,"once",function(){return V}),n.d(r,"listener",function(){return $}),n.d(r,"CONFIG",function(){return l}),n.d(r,"CONSTANTS",function(){return f}),n.d(r,"disable",function(){return ee}),r.default=t},function(e,r,n){"use strict";function t(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var o=n(1);r.a=f,r.c=d,r.e=l,r.j=function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{if(e===window)return!1}catch(e){return!0}try{if(!e)return!0}catch(e){return!0}try{if(e.closed)return!0}catch(e){return!e||e.message!==i}if(r&&function(e){if(!l(e))return!1;try{if(e===window)return!0;if(a(e)&&u(e))return!0;if(d(window)===d(e))return!0}catch(e){}return!1}(e))try{if(e.mockclosed)return!0}catch(e){}try{if(!e.parent||!e.top)return!0}catch(e){}var n=function(e,r){for(var n=0;n<e.length;n++)try{if(e[n]===r)return n}catch(e){}return-1}(p,e);if(-1!==n){var t=m[n];if(t&&function(e){if(!e.contentWindow)return!0;if(!e.parentNode)return!0;var r=e.ownerDocument;return!(!r||!r.documentElement||r.documentElement.contains(e))}(t))return!0}return!1},r.d=function(e){return(e=e||window).navigator.mockUserAgent||e.navigator.userAgent},r.b=y,r.f=function(e,r){var n=y(r);if(n)return n===e;if(r===e)return!1;if(function(e){if(e){try{if(e.top)return e.top}catch(e){}if(s(e)===e)return e;try{if(h(window,e)&&window.top)return window.top}catch(e){}try{if(h(e,window)&&window.top)return window.top}catch(e){}for(var r=0,n=function e(r){for(var n=[],t=0,o=w(r),i=null==o?0:o.length;t<i;t++){var a=o[t];n.push(a);for(var s=0,c=e(a),u=null==c?0:c.length;s<u;s++){var f=c[s];n.push(f)}}return n}(e),t=null==n?0:n.length;r<t;r++){var o=n[r];try{if(o.top)return o.top}catch(e){}if(s(o)===o)return o}}}(r)===r)return!1;for(var t=0,o=w(e),i=null==o?0:o.length;t<i;t++)if(o[t]===r)return!0;return!1},r.h=function(){return Boolean(c(window))},r.g=function(){return Boolean(s(window))},r.k=function e(r,n){if("string"==typeof r){if("string"==typeof n)return r===o.b||n===r;if(t(n))return!1;if(Array.isArray(n))return!1}return t(r)?t(n)?r.toString()===n.toString():!Array.isArray(n)&&Boolean(n.match(r)):!!Array.isArray(r)&&(Array.isArray(n)?JSON.stringify(r)===JSON.stringify(n):!t(n)&&r.some(function(r){return e(r,n)}))},r.l=function(e){return Array.isArray(e)?"("+e.join(" | ")+")":t(e)?"RegExp("+e.toString():e.toString()},r.i=function(e){try{if(e===window)return!0}catch(e){if(e&&e.message===i)return!0}try{if("[object Window]"===Object.prototype.toString.call(e))return!0}catch(e){if(e&&e.message===i)return!0}try{if(window.Window&&e instanceof window.Window)return!0}catch(e){if(e&&e.message===i)return!0}try{if(e&&e.self===e)return!0}catch(e){if(e&&e.message===i)return!0}try{if(e&&e.parent===e)return!0}catch(e){if(e&&e.message===i)return!0}try{if(e&&e.top===e)return!0}catch(e){if(e&&e.message===i)return!0}try{e&&e.__cross_domain_utils_window_check__}catch(e){return!0}return!1};var i="Call was rejected by callee.\r\n";function a(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).location.protocol===o.a.ABOUT}function s(e){if(e)try{if(e.parent&&e.parent!==e)return e.parent}catch(e){}}function c(e){if(e&&!s(e))try{return e.opener}catch(e){}}function u(e){try{return e&&e.location&&e.location.href,!0}catch(e){}return!1}function f(e){var r=(e=e||window).location;if(!r)throw new Error("Can not read window location");var n=r.protocol;if(!n)throw new Error("Can not read window protocol");if(n===o.a.FILE)return o.a.FILE+"//";if(n===o.a.ABOUT){var t=s(e);return t&&u(t)?f(t):o.a.ABOUT+"//"}var i=r.host;if(!i)throw new Error("Can not read window host");return n+"//"+i}function d(e){var r=f(e=e||window);return r&&e.mockDomain&&0===e.mockDomain.indexOf(o.a.MOCK)?e.mockDomain:r}function l(e){try{if(e===window)return!0}catch(e){}try{var r=Object.getOwnPropertyDescriptor(e,"location");if(r&&!1===r.enumerable)return!1}catch(e){}try{if(a(e)&&u(e))return!0}catch(e){}try{if(f(e)===f(window))return!0}catch(e){}return!1}function h(e,r){if(!e||!r)return!1;var n=s(r);return n?n===e:-1!==function(e){var r=[];try{for(;e.parent!==e;)r.push(e.parent),e=e.parent}catch(e){}return r}(r).indexOf(e)}function w(e){var r=[],n=void 0;try{n=e.frames}catch(r){n=e}var t=void 0;try{t=n.length}catch(e){}if(0===t)return r;if(t){for(var o=0;o<t;o++){var i=void 0;try{i=n[o]}catch(e){continue}r.push(i)}return r}for(var a=0;a<100;a++){var s=void 0;try{s=n[a]}catch(e){return r}if(!s)return r;r.push(s)}return r}var p=[],m=[];function y(e){return c(e=e||window)||s(e)||void 0}},function(e,r){}])});
//# sourceMappingURL=post-robot.min.js.map
{
"name": "post-robot",
"version": "8.0.29",
"version": "8.0.30",
"description": "Simple postMessage based server.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -14,3 +14,3 @@ /* @flow */

ACK_TIMEOUT: (window.navigator.userAgent.match(/MSIE/i) !== -1 && !__TEST__) ? 2000 : 1000,
ACK_TIMEOUT: (window.navigator.userAgent.match(/MSIE/i) !== -1 && !__TEST__) ? 10000 : 2000,
RES_TIMEOUT: __TEST__ ? 2000 : -1,

@@ -17,0 +17,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc