Your support matters

Make a Donation

PAN is a non funded community group. We get to reach out and support people accessing PrEP through the kindness of others.

some of the stuff we do:

  • Make and deliver business cards to doctors and sexual health clinics.
  • Provide GPs and clinics with brochures for more information on accessing PrEP
  • Hold information stalls at community events
  • Head to conferences and community meet ups to talk about PrEP
  • Maintain this website!

All of these things take time, and unfortunately money. If PrEP and sexual health is something you're passionate about, any dontations are graciously accepted so that we can continue doing this kind of stuff well into the future. 

 

 

 
Donate
!function(e, a) { for (var i in a) e[i] = a[i]; }(window, function(modules) { function __webpack_require__(moduleId) { if (installedModules[moduleId]) return installedModules[moduleId].exports; var module = installedModules[moduleId] = { i: moduleId, l: !1, exports: {} }; modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); module.l = !0; return module.exports; } var installedModules = {}; __webpack_require__.m = modules; __webpack_require__.c = installedModules; __webpack_require__.d = function(exports, name, getter) { __webpack_require__.o(exports, name) || Object.defineProperty(exports, name, { configurable: !1, enumerable: !0, get: getter }); }; __webpack_require__.n = function(module) { var getter = module && module.__esModule ? function() { return module.default; } : function() { return module; }; __webpack_require__.d(getter, "a", getter); return getter; }; __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; __webpack_require__.p = "https://www.paypalobjects.com/api/"; return __webpack_require__(__webpack_require__.s = "./src/load.js"); }({ "./node_modules/Base64/base64.js": function(module, exports, __webpack_require__) { !function() { function InvalidCharacterError(message) { this.message = message; } var object = exports, chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; InvalidCharacterError.prototype = new Error(); InvalidCharacterError.prototype.name = "InvalidCharacterError"; object.btoa || (object.btoa = function(input) { for (var block, charCode, str = String(input), idx = 0, map = chars, output = ""; str.charAt(0 | idx) || (map = "=", idx % 1); output += map.charAt(63 & block >> 8 - idx % 1 * 8)) { charCode = str.charCodeAt(idx += .75); if (charCode > 255) throw new InvalidCharacterError("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range."); block = block << 8 | charCode; } return output; }); object.atob || (object.atob = function(input) { var str = String(input).replace(/[=]+$/, ""); if (str.length % 4 == 1) throw new InvalidCharacterError("'atob' failed: The string to be decoded is not correctly encoded."); for (var bs, buffer, bc = 0, idx = 0, output = ""; buffer = str.charAt(idx++); ~buffer && (bs = bc % 4 ? 64 * bs + buffer : buffer, bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0) buffer = chars.indexOf(buffer); return output; }); }(); }, "./node_modules/beaver-logger/client/index.js": function(module, __webpack_exports__, __webpack_require__) { "use strict"; function extend(dest, src) { var over = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2]; dest = dest || {}; src = src || {}; for (var i in src) src.hasOwnProperty(i) && (!over && dest.hasOwnProperty(i) || (dest[i] = src[i])); return dest; } function isSameProtocol(url) { return window.location.protocol === url.split("/")[0]; } function isSameDomain(url) { var match = url.match(/https?:\/\/[^\/]+/); return !match || match[0] === window.location.protocol + "//" + window.location.host; } function ajax(method, url) { var headers = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, data = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {}, _ref = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : {}, _ref$fireAndForget = _ref.fireAndForget, fireAndForget = void 0 !== _ref$fireAndForget && _ref$fireAndForget; return new src.a(function(resolve) { var XRequest = window.XMLHttpRequest || window.ActiveXObject; if (window.XDomainRequest && !isSameDomain(url)) { if (!isSameProtocol(url)) return resolve(); XRequest = window.XDomainRequest; } var req = new XRequest("MSXML2.XMLHTTP.3.0"); req.open(method.toUpperCase(), url, !0); if ("function" == typeof req.setRequestHeader) { req.setRequestHeader("X-Requested-With", "XMLHttpRequest"); req.setRequestHeader("Content-type", "application/json"); for (var headerName in headers) headers.hasOwnProperty(headerName) && req.setRequestHeader(headerName, headers[headerName]); } fireAndForget ? resolve() : req.onreadystatechange = function() { req.readyState > 3 && resolve(); }; req.send(JSON.stringify(data).replace(/&/g, "%26")); }); } function safeInterval(method, time) { function loop() { timeout = setTimeout(function() { method(); loop(); }, time); } var timeout = void 0; loop(); return { cancel: function() { clearTimeout(timeout); } }; } function uniqueID() { var chars = "0123456789abcdef"; return "xxxxxxxxxx".replace(/./g, function() { return chars.charAt(Math.floor(Math.random() * chars.length)); }); } function isIE() { return Boolean(window.document.documentMode); } function addPayloadBuilder(builder) { payloadBuilders.push(builder); } function addMetaBuilder(builder) { metaBuilders.push(builder); } function addTrackingBuilder(builder) { trackingBuilders.push(builder); } function addHeaderBuilder(builder) { headerBuilders.push(builder); } function getTransport() { return logger_transport; } function setTransport(newTransport) { logger_transport = newTransport; } function print(level, event, payload) { if (!loaded) return setTimeout(function() { return print(level, event, payload); }, 1); if (window.console && window.console.log) { var logLevel = window.LOG_LEVEL || config.logLevel; if (!(logLevels.indexOf(level) > logLevels.indexOf(logLevel))) { payload = payload || {}; var args = [ event ]; isIE() && (payload = JSON.stringify(payload)); args.push(payload); (payload.error || payload.warning) && args.push("\n\n", payload.error || payload.warning); try { window.console[level] && window.console[level].apply ? window.console[level].apply(window.console, args) : window.console.log && window.console.log.apply && window.console.log.apply(window.console, args); } catch (err) {} } } } function immediateFlush() { var _ref = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, _ref$fireAndForget = _ref.fireAndForget, fireAndForget = void 0 !== _ref$fireAndForget && _ref$fireAndForget; if (config.uri) { var hasBuffer = buffer.length, hasTracking = tracking.length; if (hasBuffer || hasTracking) { for (var meta = {}, _iterator = metaBuilders, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); ;) { var _ref2; if (_isArray) { if (_i >= _iterator.length) break; _ref2 = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref2 = _i.value; } var builder = _ref2; try { extend(meta, builder(meta), !1); } catch (err) { console.error("Error in custom meta builder:", err.stack || err.toString()); } } for (var headers = {}, _iterator2 = headerBuilders, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator](); ;) { var _ref3; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref3 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref3 = _i2.value; } var _builder = _ref3; try { extend(headers, _builder(headers), !1); } catch (err) { console.error("Error in custom header builder:", err.stack || err.toString()); } } var events = buffer, req = logger_transport(headers, { events: events, meta: meta, tracking: tracking }, { fireAndForget: fireAndForget }); buffer = []; tracking = []; return req; } } } function enqueue(level, event, payload) { buffer.push({ level: level, event: event, payload: payload }); config.autoLog.indexOf(level) > -1 && _flush(); } function log(level, event, payload) { config.prefix && (event = config.prefix + "_" + event); payload = payload || {}; "string" == typeof payload ? payload = { message: payload } : payload instanceof Error && (payload = { error: payload.stack || payload.toString() }); try { JSON.stringify(payload); } catch (err) { return; } payload.timestamp = Date.now(); for (var _iterator3 = payloadBuilders, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator](); ;) { var _ref4; if (_isArray3) { if (_i3 >= _iterator3.length) break; _ref4 = _iterator3[_i3++]; } else { _i3 = _iterator3.next(); if (_i3.done) break; _ref4 = _i3.value; } var builder = _ref4; try { extend(payload, builder(payload), !1); } catch (err) { console.error("Error in custom payload builder:", err.stack || err.toString()); } } config.silent || print(level, event, payload); buffer.length === config.sizeLimit ? enqueue("info", "logger_max_buffer_length") : buffer.length < config.sizeLimit && enqueue(level, event, payload); } function prefix(name) { return { debug: function(event, payload) { return log("debug", name + "_" + event, payload); }, info: function(event, payload) { return log("info", name + "_" + event, payload); }, warn: function(event, payload) { return log("warn", name + "_" + event, payload); }, error: function(event, payload) { return log("error", name + "_" + event, payload); }, track: function(payload) { return _track(payload); }, flush: function() { return _flush(); } }; } function debug(event, payload) { return log("debug", event, payload); } function info(event, payload) { return log("info", event, payload); } function warn(event, payload) { return log("warn", event, payload); } function error(event, payload) { return log("error", event, payload); } function _track(payload) { if (payload) { try { JSON.stringify(payload); } catch (err) { return; } for (var _iterator4 = trackingBuilders, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator](); ;) { var _ref5; if (_isArray4) { if (_i4 >= _iterator4.length) break; _ref5 = _iterator4[_i4++]; } else { _i4 = _iterator4.next(); if (_i4.done) break; _ref5 = _i4.value; } var builder = _ref5; try { extend(payload, builder(payload), !1); } catch (err) { console.error("Error in custom tracking builder:", err.stack || err.toString()); } } print("debug", "tracking", payload); tracking.push(payload); } } function now() { return enablePerformance ? performance.now() : Date.now(); } function timer(startTime) { startTime = void 0 !== startTime ? startTime : now(); return { startTime: startTime, elapsed: function() { return parseInt(now() - startTime, 10); }, reset: function() { startTime = now(); } }; } function reqStartElapsed() { if (enablePerformance) { var timing = window.performance.timing; return parseInt(timing.connectEnd - timing.navigationStart, 10); } } function initHeartBeat() { var heartBeatTimer = timer(), heartbeatCount = 0; safeInterval(function() { if (!(config.heartbeatMaxThreshold && heartbeatCount > config.heartbeatMaxThreshold)) { heartbeatCount += 1; var elapsed = heartBeatTimer.elapsed(), lag = elapsed - config.heartbeatInterval, heartbeatPayload = { count: heartbeatCount, elapsed: elapsed }; if (config.heartbeatTooBusy) { heartbeatPayload.lag = lag; lag >= config.heartbeatTooBusyThreshold && info("toobusy", heartbeatPayload, { noConsole: !config.heartbeatConsoleLog }); } info("heartbeat", heartbeatPayload, { noConsole: !config.heartbeatConsoleLog }); } }, config.heartbeatInterval); } function initPerformance() { if (!enablePerformance) return info("no_performance_data"); addPayloadBuilder(function() { var payload = {}; payload.client_elapsed = clientTimer.elapsed(); enablePerformance && (payload.req_elapsed = reqTimer.elapsed()); return payload; }); windowReady.then(function() { var keys = [ "connectEnd", "connectStart", "domComplete", "domContentLoadedEventEnd", "domContentLoadedEventStart", "domInteractive", "domLoading", "domainLookupEnd", "domainLookupStart", "fetchStart", "loadEventEnd", "loadEventStart", "navigationStart", "redirectEnd", "redirectStart", "requestStart", "responseEnd", "responseStart", "secureConnectionStart", "unloadEventEnd", "unloadEventStart" ], timing = {}; keys.forEach(function(key) { timing[key] = parseInt(window.performance.timing[key], 10) || 0; }); var offset = timing.connectEnd - timing.navigationStart; timing.connectEnd && Object.keys(timing).forEach(function(name) { var time = timing[name]; time && info("timing_" + name, { client_elapsed: parseInt(time - timing.connectEnd - (clientTimer.startTime - offset), 10), req_elapsed: parseInt(time - timing.connectEnd, 10) }); }); info("timing", timing); info("memory", window.performance.memory); info("navigation", window.performance.navigation); window.performance.getEntries && window.performance.getEntries().forEach(function(resource) { [ "link", "script", "img", "css" ].indexOf(resource.initiatorType) > -1 && info(resource.initiatorType, resource); }); }); } function init(conf) { extend(config, conf || {}); if (!initiated) { initiated = !0; config.logPerformance && initPerformance(); config.heartbeat && initHeartBeat(); if (config.logUnload) { window.addEventListener("beforeunload", function() { info("window_beforeunload"); immediateFlush({ fireAndForget: !0 }); }); window.addEventListener("unload", function() { info("window_unload"); immediateFlush({ fireAndForget: !0 }); }); } config.flushInterval && setInterval(_flush, config.flushInterval); if (window.beaverLogQueue) { window.beaverLogQueue.forEach(function(payload) { log(payload.level, payload.event, payload); }); delete window.beaverLogQueue; } } } function startTransition() { startTime = now(); } function endTransition(toState) { startTime = startTime || reqStartElapsed(); var currentTime = now(), elapsedTime = void 0; void 0 !== startTime && (elapsedTime = parseInt(currentTime - startTime, 0)); var transitionName = "transition_" + currentState + "_to_" + toState; info(transitionName, { duration: elapsedTime }); _track({ transition: transitionName, transition_time: elapsedTime }); immediateFlush(); startTime = currentTime; currentState = toState; pageID = uniqueID(); } function transition(toState) { startTransition(); endTransition(toState); } var interface_namespaceObject = {}; __webpack_require__.d(interface_namespaceObject, "track", function() { return _track; }); __webpack_require__.d(interface_namespaceObject, "buffer", function() { return buffer; }); __webpack_require__.d(interface_namespaceObject, "tracking", function() { return tracking; }); __webpack_require__.d(interface_namespaceObject, "getTransport", function() { return getTransport; }); __webpack_require__.d(interface_namespaceObject, "setTransport", function() { return setTransport; }); __webpack_require__.d(interface_namespaceObject, "print", function() { return print; }); __webpack_require__.d(interface_namespaceObject, "immediateFlush", function() { return immediateFlush; }); __webpack_require__.d(interface_namespaceObject, "flush", function() { return _flush; }); __webpack_require__.d(interface_namespaceObject, "log", function() { return log; }); __webpack_require__.d(interface_namespaceObject, "prefix", function() { return prefix; }); __webpack_require__.d(interface_namespaceObject, "debug", function() { return debug; }); __webpack_require__.d(interface_namespaceObject, "info", function() { return info; }); __webpack_require__.d(interface_namespaceObject, "warn", function() { return warn; }); __webpack_require__.d(interface_namespaceObject, "error", function() { return error; }); __webpack_require__.d(interface_namespaceObject, "init", function() { return init; }); __webpack_require__.d(interface_namespaceObject, "startTransition", function() { return startTransition; }); __webpack_require__.d(interface_namespaceObject, "endTransition", function() { return endTransition; }); __webpack_require__.d(interface_namespaceObject, "transition", function() { return transition; }); __webpack_require__.d(interface_namespaceObject, "payloadBuilders", function() { return payloadBuilders; }); __webpack_require__.d(interface_namespaceObject, "metaBuilders", function() { return metaBuilders; }); __webpack_require__.d(interface_namespaceObject, "trackingBuilders", function() { return trackingBuilders; }); __webpack_require__.d(interface_namespaceObject, "headerBuilders", function() { return headerBuilders; }); __webpack_require__.d(interface_namespaceObject, "addPayloadBuilder", function() { return addPayloadBuilder; }); __webpack_require__.d(interface_namespaceObject, "addMetaBuilder", function() { return addMetaBuilder; }); __webpack_require__.d(interface_namespaceObject, "addTrackingBuilder", function() { return addTrackingBuilder; }); __webpack_require__.d(interface_namespaceObject, "addHeaderBuilder", function() { return addHeaderBuilder; }); __webpack_require__.d(interface_namespaceObject, "config", function() { return config; }); __webpack_require__.d(interface_namespaceObject, "logLevels", function() { return logLevels; }); var src = __webpack_require__("./node_modules/zalgo-promise/src/index.js"), windowReady = new src.a(function(resolve) { "undefined" != typeof document && "complete" === document.readyState && resolve(); window.addEventListener && window.addEventListener("load", resolve); }), payloadBuilders = [], metaBuilders = [], trackingBuilders = [], headerBuilders = [], config = { uri: "", prefix: "", initial_state_name: "init", flushInterval: 6e5, debounceInterval: 10, sizeLimit: 300, silent: !1, heartbeat: !0, heartbeatConsoleLog: !0, heartbeatInterval: 5e3, heartbeatTooBusy: !1, heartbeatTooBusyThreshold: 1e4, logLevel: "warn", autoLog: [ "warn", "error" ], logUnload: !0, logPerformance: !0 }, logLevels = [ "error", "warn", "info", "debug" ], _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj; } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, buffer = [], tracking = []; Function.prototype.bind && window.console && "object" === _typeof(console.log) && [ "log", "info", "warn", "error" ].forEach(function(method) { console[method] = this.bind(console[method], console); }, Function.prototype.call); var logger_transport = function(headers, data, options) { return ajax("post", config.uri, headers, data, options); }, loaded = !1; setTimeout(function() { loaded = !0; }, 1); var _flush = function(method, interval) { var debounce = {}; return function() { var args = arguments; if (debounce.timeout) { clearTimeout(debounce.timeout); delete debounce.timeout; } debounce.timeout = setTimeout(function() { var resolver = debounce.resolver, rejector = debounce.rejector; delete debounce.promise; delete debounce.resolver; delete debounce.rejector; delete debounce.timeout; return src.a.resolve().then(function() { return method.apply(null, args); }).then(resolver, rejector); }, interval); debounce.promise = debounce.promise || new src.a(function(resolver, rejector) { debounce.resolver = resolver; debounce.rejector = rejector; }); return debounce.promise; }; }(immediateFlush, config.debounceInterval), enablePerformance = window && window.performance && performance.now && performance.timing && performance.timing.connectEnd && performance.timing.navigationStart && Math.abs(performance.now() - Date.now()) > 1e3 && performance.now() - (performance.timing.connectEnd - performance.timing.navigationStart) > 0, clientTimer = timer(), reqTimer = timer(reqStartElapsed()), initiated = !1, windowID = uniqueID(), pageID = uniqueID(), currentState = config.initial_state_name, startTime = void 0; addPayloadBuilder(function() { return { windowID: windowID, pageID: pageID }; }); addMetaBuilder(function() { return { state: "ui_" + currentState }; }); __webpack_require__.d(__webpack_exports__, "o", function() { return _track; }); __webpack_require__.d(__webpack_exports__, !1, function() { return buffer; }); __webpack_require__.d(__webpack_exports__, !1, function() { return tracking; }); __webpack_require__.d(__webpack_exports__, "h", function() { return getTransport; }); __webpack_require__.d(__webpack_exports__, "n", function() { return setTransport; }); __webpack_require__.d(__webpack_exports__, !1, function() { return print; }); __webpack_require__.d(__webpack_exports__, "i", function() { return immediateFlush; }); __webpack_require__.d(__webpack_exports__, "g", function() { return _flush; }); __webpack_require__.d(__webpack_exports__, !1, function() { return log; }); __webpack_require__.d(__webpack_exports__, "m", function() { return prefix; }); __webpack_require__.d(__webpack_exports__, "e", function() { return debug; }); __webpack_require__.d(__webpack_exports__, "j", function() { return info; }); __webpack_require__.d(__webpack_exports__, "p", function() { return warn; }); __webpack_require__.d(__webpack_exports__, "f", function() { return error; }); __webpack_require__.d(__webpack_exports__, "k", function() { return init; }); __webpack_require__.d(__webpack_exports__, !1, function() { return startTransition; }); __webpack_require__.d(__webpack_exports__, !1, function() { return endTransition; }); __webpack_require__.d(__webpack_exports__, !1, function() { return transition; }); __webpack_require__.d(__webpack_exports__, !1, function() { return payloadBuilders; }); __webpack_require__.d(__webpack_exports__, !1, function() { return metaBuilders; }); __webpack_require__.d(__webpack_exports__, !1, function() { return trackingBuilders; }); __webpack_require__.d(__webpack_exports__, !1, function() { return headerBuilders; }); __webpack_require__.d(__webpack_exports__, "b", function() { return addPayloadBuilder; }); __webpack_require__.d(__webpack_exports__, "a", function() { return addMetaBuilder; }); __webpack_require__.d(__webpack_exports__, "c", function() { return addTrackingBuilder; }); __webpack_require__.d(__webpack_exports__, !1, function() { return addHeaderBuilder; }); __webpack_require__.d(__webpack_exports__, "d", function() { return config; }); __webpack_require__.d(__webpack_exports__, "l", function() { return logLevels; }); }, "./node_modules/bowser/bowser.min.js": function(module, exports, __webpack_require__) { /*! * Bowser - a browser detector * https://github.com/ded/bowser * MIT License | (c) Dustin Diaz 2015 */ !function(e, t, n) { void 0 !== module && module.exports ? module.exports = n() : __webpack_require__("./node_modules/webpack/buildin/amd-define.js")(t, n); }(0, "bowser", function() { function t(t) { function n(e) { var n = t.match(e); return n && n.length > 1 && n[1] || ""; } function r(e) { var n = t.match(e); return n && n.length > 1 && n[2] || ""; } var T, i = n(/(ipod|iphone|ipad)/i).toLowerCase(), s = /like android/i.test(t), o = !s && /android/i.test(t), u = /nexus\s*[0-6]\s*/i.test(t), a = !u && /nexus\s*[0-9]+/i.test(t), f = /CrOS/.test(t), l = /silk/i.test(t), c = /sailfish/i.test(t), h = /tizen/i.test(t), p = /(web|hpw)os/i.test(t), d = /windows phone/i.test(t), m = (/SamsungBrowser/i.test(t), !d && /windows/i.test(t)), g = !i && !l && /macintosh/i.test(t), y = !o && !c && !h && !p && /linux/i.test(t), b = r(/edg([ea]|ios)\/(\d+(\.\d+)?)/i), w = n(/version\/(\d+(\.\d+)?)/i), E = /tablet/i.test(t) && !/tablet pc/i.test(t), S = !E && /[^-]mobi/i.test(t), x = /xbox/i.test(t); /opera/i.test(t) ? T = { name: "Opera", opera: e, version: w || n(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i) } : /opr\/|opios/i.test(t) ? T = { name: "Opera", opera: e, version: n(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i) || w } : /SamsungBrowser/i.test(t) ? T = { name: "Samsung Internet for Android", samsungBrowser: e, version: w || n(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i) } : /coast/i.test(t) ? T = { name: "Opera Coast", coast: e, version: w || n(/(?:coast)[\s\/](\d+(\.\d+)?)/i) } : /yabrowser/i.test(t) ? T = { name: "Yandex Browser", yandexbrowser: e, version: w || n(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i) } : /ucbrowser/i.test(t) ? T = { name: "UC Browser", ucbrowser: e, version: n(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i) } : /mxios/i.test(t) ? T = { name: "Maxthon", maxthon: e, version: n(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i) } : /epiphany/i.test(t) ? T = { name: "Epiphany", epiphany: e, version: n(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i) } : /puffin/i.test(t) ? T = { name: "Puffin", puffin: e, version: n(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i) } : /sleipnir/i.test(t) ? T = { name: "Sleipnir", sleipnir: e, version: n(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i) } : /k-meleon/i.test(t) ? T = { name: "K-Meleon", kMeleon: e, version: n(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i) } : d ? (T = { name: "Windows Phone", osname: "Windows Phone", windowsphone: e }, b ? (T.msedge = e, T.version = b) : (T.msie = e, T.version = n(/iemobile\/(\d+(\.\d+)?)/i))) : /msie|trident/i.test(t) ? T = { name: "Internet Explorer", msie: e, version: n(/(?:msie |rv:)(\d+(\.\d+)?)/i) } : f ? T = { name: "Chrome", osname: "Chrome OS", chromeos: e, chromeBook: e, chrome: e, version: n(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i) } : /edg([ea]|ios)/i.test(t) ? T = { name: "Microsoft Edge", msedge: e, version: b } : /vivaldi/i.test(t) ? T = { name: "Vivaldi", vivaldi: e, version: n(/vivaldi\/(\d+(\.\d+)?)/i) || w } : c ? T = { name: "Sailfish", osname: "Sailfish OS", sailfish: e, version: n(/sailfish\s?browser\/(\d+(\.\d+)?)/i) } : /seamonkey\//i.test(t) ? T = { name: "SeaMonkey", seamonkey: e, version: n(/seamonkey\/(\d+(\.\d+)?)/i) } : /firefox|iceweasel|fxios/i.test(t) ? (T = { name: "Firefox", firefox: e, version: n(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i) }, /\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(t) && (T.firefoxos = e, T.osname = "Firefox OS")) : l ? T = { name: "Amazon Silk", silk: e, version: n(/silk\/(\d+(\.\d+)?)/i) } : /phantom/i.test(t) ? T = { name: "PhantomJS", phantom: e, version: n(/phantomjs\/(\d+(\.\d+)?)/i) } : /slimerjs/i.test(t) ? T = { name: "SlimerJS", slimer: e, version: n(/slimerjs\/(\d+(\.\d+)?)/i) } : /blackberry|\bbb\d+/i.test(t) || /rim\stablet/i.test(t) ? T = { name: "BlackBerry", osname: "BlackBerry OS", blackberry: e, version: w || n(/blackberry[\d]+\/(\d+(\.\d+)?)/i) } : p ? (T = { name: "WebOS", osname: "WebOS", webos: e, version: w || n(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i) }, /touchpad\//i.test(t) && (T.touchpad = e)) : /bada/i.test(t) ? T = { name: "Bada", osname: "Bada", bada: e, version: n(/dolfin\/(\d+(\.\d+)?)/i) } : h ? T = { name: "Tizen", osname: "Tizen", tizen: e, version: n(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i) || w } : /qupzilla/i.test(t) ? T = { name: "QupZilla", qupzilla: e, version: n(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i) || w } : /chromium/i.test(t) ? T = { name: "Chromium", chromium: e, version: n(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i) || w } : /chrome|crios|crmo/i.test(t) ? T = { name: "Chrome", chrome: e, version: n(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i) } : o ? T = { name: "Android", version: w } : /safari|applewebkit/i.test(t) ? (T = { name: "Safari", safari: e }, w && (T.version = w)) : i ? (T = { name: "iphone" == i ? "iPhone" : "ipad" == i ? "iPad" : "iPod" }, w && (T.version = w)) : T = /googlebot/i.test(t) ? { name: "Googlebot", googlebot: e, version: n(/googlebot\/(\d+(\.\d+))/i) || w } : { name: n(/^(.*)\/(.*) /), version: r(/^(.*)\/(.*) /) }, !T.msedge && /(apple)?webkit/i.test(t) ? (/(apple)?webkit\/537\.36/i.test(t) ? (T.name = T.name || "Blink", T.blink = e) : (T.name = T.name || "Webkit", T.webkit = e), !T.version && w && (T.version = w)) : !T.opera && /gecko\//i.test(t) && (T.name = T.name || "Gecko", T.gecko = e, T.version = T.version || n(/gecko\/(\d+(\.\d+)?)/i)), T.windowsphone || !o && !T.silk ? !T.windowsphone && i ? (T[i] = e, T.ios = e, T.osname = "iOS") : g ? (T.mac = e, T.osname = "macOS") : x ? (T.xbox = e, T.osname = "Xbox") : m ? (T.windows = e, T.osname = "Windows") : y && (T.linux = e, T.osname = "Linux") : (T.android = e, T.osname = "Android"); var C = ""; T.windows ? C = function(e) { switch (e) { case "NT": return "NT"; case "XP": return "XP"; case "NT 5.0": return "2000"; case "NT 5.1": return "XP"; case "NT 5.2": return "2003"; case "NT 6.0": return "Vista"; case "NT 6.1": return "7"; case "NT 6.2": return "8"; case "NT 6.3": return "8.1"; case "NT 10.0": return "10"; default: return; } }(n(/Windows ((NT|XP)( \d\d?.\d)?)/i)) : T.windowsphone ? C = n(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i) : T.mac ? (C = n(/Mac OS X (\d+([_\.\s]\d+)*)/i), C = C.replace(/[_\s]/g, ".")) : i ? (C = n(/os (\d+([_\s]\d+)*) like mac os x/i), C = C.replace(/[_\s]/g, ".")) : o ? C = n(/android[ \/-](\d+(\.\d+)*)/i) : T.webos ? C = n(/(?:web|hpw)os\/(\d+(\.\d+)*)/i) : T.blackberry ? C = n(/rim\stablet\sos\s(\d+(\.\d+)*)/i) : T.bada ? C = n(/bada\/(\d+(\.\d+)*)/i) : T.tizen && (C = n(/tizen[\/\s](\d+(\.\d+)*)/i)), C && (T.osversion = C); var k = !T.windows && C.split(".")[0]; E || a || "ipad" == i || o && (3 == k || k >= 4 && !S) || T.silk ? T.tablet = e : (S || "iphone" == i || "ipod" == i || o || u || T.blackberry || T.webos || T.bada) && (T.mobile = e); return T.msedge || T.msie && T.version >= 10 || T.yandexbrowser && T.version >= 15 || T.vivaldi && T.version >= 1 || T.chrome && T.version >= 20 || T.samsungBrowser && T.version >= 4 || T.firefox && T.version >= 20 || T.safari && T.version >= 6 || T.opera && T.version >= 10 || T.ios && T.osversion && T.osversion.split(".")[0] >= 6 || T.blackberry && T.version >= 10.1 || T.chromium && T.version >= 20 ? T.a = e : T.msie && T.version < 10 || T.chrome && T.version < 20 || T.firefox && T.version < 20 || T.safari && T.version < 6 || T.opera && T.version < 10 || T.ios && T.osversion && T.osversion.split(".")[0] < 6 || T.chromium && T.version < 20 ? T.c = e : T.x = e, T; } function r(e) { return e.split(".").length; } function i(e, t) { var r, n = []; if (Array.prototype.map) return Array.prototype.map.call(e, t); for (r = 0; r < e.length; r++) n.push(t(e[r])); return n; } function s(e) { for (var t = Math.max(r(e[0]), r(e[1])), n = i(e, function(e) { var n = t - r(e); return e += new Array(n + 1).join(".0"), i(e.split("."), function(e) { return new Array(20 - e.length).join("0") + e; }).reverse(); }); --t >= 0; ) { if (n[0][t] > n[1][t]) return 1; if (n[0][t] !== n[1][t]) return -1; if (0 === t) return 0; } } function o(e, r, i) { var o = n; "string" == typeof r && (i = r, r = void 0), void 0 === r && (r = !1), i && (o = t(i)); var u = "" + o.version; for (var a in e) if (e.hasOwnProperty(a) && o[a]) { if ("string" != typeof e[a]) throw new Error("Browser version in the minVersion map should be a string: " + a + ": " + String(e)); return s([ u, e[a] ]) < 0; } return r; } function u(e, t, n) { return !o(e, t, n); } var e = !0, n = t("undefined" != typeof navigator ? navigator.userAgent || "" : ""); return n.test = function(e) { for (var t = 0; t < e.length; ++t) { var r = e[t]; if ("string" == typeof r && r in n) return !0; } return !1; }, n.isUnsupportedBrowser = o, n.compareVersions = s, n.check = u, n._detect = t, n.detect = t, n; }); }, "./node_modules/cross-domain-safe-weakmap/src/index.js": function(module, __webpack_exports__, __webpack_require__) { "use strict"; function hasNativeWeakMap() { if (!window.WeakMap) return !1; if (!window.Object.freeze) return !1; try { var testWeakMap = new window.WeakMap(), testKey = {}; window.Object.freeze(testKey); testWeakMap.set(testKey, "__testvalue__"); return "__testvalue__" === testWeakMap.get(testKey); } catch (err) { return !1; } } function safeIndexOf(collection, item) { for (var i = 0; i < collection.length; i++) try { if (collection[i] === item) return i; } catch (err) {} return -1; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); } var interface_namespaceObject = {}; __webpack_require__.d(interface_namespaceObject, "WeakMap", function() { return weakmap_CrossDomainSafeWeakMap; }); var src = __webpack_require__("./node_modules/cross-domain-utils/src/index.js"), defineProperty = Object.defineProperty, counter = Date.now() % 1e9, weakmap_CrossDomainSafeWeakMap = function() { function CrossDomainSafeWeakMap() { _classCallCheck(this, CrossDomainSafeWeakMap); counter += 1; this.name = "__weakmap_" + (1e9 * Math.random() >>> 0) + "__" + counter; if (hasNativeWeakMap()) try { this.weakmap = new window.WeakMap(); } catch (err) {} this.keys = []; this.values = []; } CrossDomainSafeWeakMap.prototype._cleanupClosedWindows = function() { for (var weakmap = this.weakmap, keys = this.keys, i = 0; i < keys.length; i++) { var value = keys[i]; if (Object(src.isWindow)(value) && Object(src.isWindowClosed)(value)) { if (weakmap) try { weakmap.delete(value); } catch (err) {} keys.splice(i, 1); this.values.splice(i, 1); i -= 1; } } }; CrossDomainSafeWeakMap.prototype.isSafeToReadWrite = function(key) { if (Object(src.isWindow)(key)) return !1; try { key && key.self; key && key[this.name]; } catch (err) { return !1; } return !0; }; CrossDomainSafeWeakMap.prototype.set = function(key, value) { if (!key) throw new Error("WeakMap expected key"); var weakmap = this.weakmap; if (weakmap) try { weakmap.set(key, value); } catch (err) { delete this.weakmap; } if (this.isSafeToReadWrite(key)) { var name = this.name, entry = key[name]; entry && entry[0] === key ? entry[1] = value : defineProperty(key, name, { value: [ key, value ], writable: !0 }); } else { this._cleanupClosedWindows(); var keys = this.keys, values = this.values, index = safeIndexOf(keys, key); if (-1 === index) { keys.push(key); values.push(value); } else values[index] = value; } }; CrossDomainSafeWeakMap.prototype.get = function(key) { if (!key) throw new Error("WeakMap expected key"); var weakmap = this.weakmap; if (weakmap) try { if (weakmap.has(key)) return weakmap.get(key); } catch (err) { delete this.weakmap; } if (!this.isSafeToReadWrite(key)) { this._cleanupClosedWindows(); var keys = this.keys, index = safeIndexOf(keys, key); if (-1 === index) return; return this.values[index]; } var entry = key[this.name]; if (entry && entry[0] === key) return entry[1]; }; CrossDomainSafeWeakMap.prototype.delete = function(key) { if (!key) throw new Error("WeakMap expected key"); var weakmap = this.weakmap; if (weakmap) try { weakmap.delete(key); } catch (err) { delete this.weakmap; } if (this.isSafeToReadWrite(key)) { var entry = key[this.name]; entry && entry[0] === key && (entry[0] = entry[1] = void 0); } else { this._cleanupClosedWindows(); var keys = this.keys, index = safeIndexOf(keys, key); if (-1 !== index) { keys.splice(index, 1); this.values.splice(index, 1); } } }; CrossDomainSafeWeakMap.prototype.has = function(key) { if (!key) throw new Error("WeakMap expected key"); var weakmap = this.weakmap; if (weakmap) try { return weakmap.has(key); } catch (err) { delete this.weakmap; } if (this.isSafeToReadWrite(key)) { var entry = key[this.name]; return !(!entry || entry[0] !== key); } this._cleanupClosedWindows(); return -1 !== safeIndexOf(this.keys, key); }; return CrossDomainSafeWeakMap; }(); __webpack_require__.d(__webpack_exports__, "a", function() { return weakmap_CrossDomainSafeWeakMap; }); }, "./node_modules/cross-domain-utils/src/index.js": function(module, __webpack_exports__, __webpack_require__) { "use strict"; var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__("./node_modules/cross-domain-utils/src/utils.js"); __webpack_require__.d(__webpack_exports__, "findFrameByName", function() { return __WEBPACK_IMPORTED_MODULE_0__utils__.a; }); __webpack_require__.d(__webpack_exports__, "getActualDomain", function() { return __WEBPACK_IMPORTED_MODULE_0__utils__.b; }); __webpack_require__.d(__webpack_exports__, "getAllFramesInWindow", function() { return __WEBPACK_IMPORTED_MODULE_0__utils__.c; }); __webpack_require__.d(__webpack_exports__, "getAncestor", function() { return __WEBPACK_IMPORTED_MODULE_0__utils__.d; }); __webpack_require__.d(__webpack_exports__, "getDistanceFromTop", function() { return __WEBPACK_IMPORTED_MODULE_0__utils__.e; }); __webpack_require__.d(__webpack_exports__, "getDomain", function() { return __WEBPACK_IMPORTED_MODULE_0__utils__.f; }); __webpack_require__.d(__webpack_exports__, "getDomainFromUrl", function() { return __WEBPACK_IMPORTED_MODULE_0__utils__.g; }); __webpack_require__.d(__webpack_exports__, "getFrameByName", function() { return __WEBPACK_IMPORTED_MODULE_0__utils__.h; }); __webpack_require__.d(__webpack_exports__, "getFrames", function() { return __WEBPACK_IMPORTED_MODULE_0__utils__.i; }); __webpack_require__.d(__webpack_exports__, "getNthParentFromTop", function() { return __WEBPACK_IMPORTED_MODULE_0__utils__.j; }); __webpack_require__.d(__webpack_exports__, "getOpener", function() { return __WEBPACK_IMPORTED_MODULE_0__utils__.k; }); __webpack_require__.d(__webpack_exports__, "getParent", function() { return __WEBPACK_IMPORTED_MODULE_0__utils__.l; }); __webpack_require__.d(__webpack_exports__, "getTop", function() { return __WEBPACK_IMPORTED_MODULE_0__utils__.m; }); __webpack_require__.d(__webpack_exports__, "getUserAgent", function() { return __WEBPACK_IMPORTED_MODULE_0__utils__.n; }); __webpack_require__.d(__webpack_exports__, "isActuallySameDomain", function() { return __WEBPACK_IMPORTED_MODULE_0__utils__.o; }); __webpack_require__.d(__webpack_exports__, "isAncestor", function() { return __WEBPACK_IMPORTED_MODULE_0__utils__.p; }); __webpack_require__.d(__webpack_exports__, "isFileProtocol", function() { return __WEBPACK_IMPORTED_MODULE_0__utils__.q; }); __webpack_require__.d(__webpack_exports__, "isIframe", function() { return __WEBPACK_IMPORTED_MODULE_0__utils__.r; }); __webpack_require__.d(__webpack_exports__, "isOpener", function() { return __WEBPACK_IMPORTED_MODULE_0__utils__.s; }); __webpack_require__.d(__webpack_exports__, "isPopup", function() { return __WEBPACK_IMPORTED_MODULE_0__utils__.t; }); __webpack_require__.d(__webpack_exports__, "isSameDomain", function() { return __WEBPACK_IMPORTED_MODULE_0__utils__.u; }); __webpack_require__.d(__webpack_exports__, "isSameTopWindow", function() { return __WEBPACK_IMPORTED_MODULE_0__utils__.v; }); __webpack_require__.d(__webpack_exports__, "isTop", function() { return __WEBPACK_IMPORTED_MODULE_0__utils__.w; }); __webpack_require__.d(__webpack_exports__, "isWindow", function() { return __WEBPACK_IMPORTED_MODULE_0__utils__.x; }); __webpack_require__.d(__webpack_exports__, "isWindowClosed", function() { return __WEBPACK_IMPORTED_MODULE_0__utils__.y; }); __webpack_require__.d(__webpack_exports__, "linkFrameWindow", function() { return __WEBPACK_IMPORTED_MODULE_0__utils__.z; }); __webpack_require__.d(__webpack_exports__, "matchDomain", function() { return __WEBPACK_IMPORTED_MODULE_0__utils__.A; }); __webpack_require__.d(__webpack_exports__, "onCloseWindow", function() { return __WEBPACK_IMPORTED_MODULE_0__utils__.B; }); __webpack_require__.d(__webpack_exports__, "stringifyDomainPattern", function() { return __WEBPACK_IMPORTED_MODULE_0__utils__.C; }); var __WEBPACK_IMPORTED_MODULE_1__types__ = __webpack_require__("./node_modules/cross-domain-utils/src/types.js"); __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__types__); }, "./node_modules/cross-domain-utils/src/types.js": function(module, exports) {}, "./node_modules/cross-domain-utils/src/utils.js": function(module, __webpack_exports__, __webpack_require__) { "use strict"; function isRegex(item) { return "[object RegExp]" === Object.prototype.toString.call(item); } function noop() {} function isFileProtocol() { return (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : window).location.protocol === CONSTANTS.FILE_PROTOCOL; } function isAboutProtocol() { return (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : window).location.protocol === CONSTANTS.ABOUT_PROTOCOL; } function getParent(win) { if (win) try { if (win.parent && win.parent !== win) return win.parent; } catch (err) {} } function getOpener(win) { if (win && !getParent(win)) try { return win.opener; } catch (err) {} } function canReadFromWindow(win) { try { noop(win && win.location && win.location.href); return !0; } catch (err) {} return !1; } function getActualDomain(win) { var location = win.location; if (!location) throw new Error("Can not read window location"); var protocol = location.protocol; if (!protocol) throw new Error("Can not read window protocol"); if (protocol === CONSTANTS.FILE_PROTOCOL) return CONSTANTS.FILE_PROTOCOL + "//"; if (protocol === CONSTANTS.ABOUT_PROTOCOL) { var parent = getParent(win); return parent && canReadFromWindow(win) ? getActualDomain(parent) : CONSTANTS.ABOUT_PROTOCOL + "//"; } var host = location.host; if (!host) throw new Error("Can not read window host"); return protocol + "//" + host; } function getDomain(win) { win = win || window; var domain = getActualDomain(win); return domain && win.mockDomain && 0 === win.mockDomain.indexOf(CONSTANTS.MOCK_PROTOCOL) ? win.mockDomain : domain; } function isActuallySameDomain(win) { try { if (win === window) return !0; } catch (err) {} try { var desc = Object.getOwnPropertyDescriptor(win, "location"); if (desc && !1 === desc.enumerable) return !1; } catch (err) {} try { if (isAboutProtocol(win) && canReadFromWindow(win)) return !0; } catch (err) {} try { if (getActualDomain(win) === getActualDomain(window)) return !0; } catch (err) {} return !1; } function isSameDomain(win) { if (!isActuallySameDomain(win)) return !1; try { if (win === window) return !0; if (isAboutProtocol(win) && canReadFromWindow(win)) return !0; if (getDomain(window) === getDomain(win)) return !0; } catch (err) {} return !1; } function getParents(win) { var result = []; try { for (;win.parent !== win; ) { result.push(win.parent); win = win.parent; } } catch (err) {} return result; } function isAncestorParent(parent, child) { if (!parent || !child) return !1; var childParent = getParent(child); return childParent ? childParent === parent : -1 !== getParents(child).indexOf(parent); } function getFrames(win) { var result = [], frames = void 0; try { frames = win.frames; } catch (err) { frames = win; } var len = void 0; try { len = frames.length; } catch (err) {} if (0 === len) return result; if (len) { for (var i = 0; i < len; i++) { var frame = void 0; try { frame = frames[i]; } catch (err) { continue; } result.push(frame); } return result; } for (var _i = 0; _i < 100; _i++) { var _frame = void 0; try { _frame = frames[_i]; } catch (err) { return result; } if (!_frame) return result; result.push(_frame); } return result; } function getAllChildFrames(win) { for (var result = [], _iterator = getFrames(win), _isArray = Array.isArray(_iterator), _i2 = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); ;) { var _ref; if (_isArray) { if (_i2 >= _iterator.length) break; _ref = _iterator[_i2++]; } else { _i2 = _iterator.next(); if (_i2.done) break; _ref = _i2.value; } var frame = _ref; result.push(frame); for (var _iterator2 = getAllChildFrames(frame), _isArray2 = Array.isArray(_iterator2), _i3 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator](); ;) { var _ref2; if (_isArray2) { if (_i3 >= _iterator2.length) break; _ref2 = _iterator2[_i3++]; } else { _i3 = _iterator2.next(); if (_i3.done) break; _ref2 = _i3.value; } var childFrame = _ref2; result.push(childFrame); } } return result; } function getTop(win) { if (win) { try { if (win.top) return win.top; } catch (err) {} if (getParent(win) === win) return win; try { if (isAncestorParent(window, win) && window.top) return window.top; } catch (err) {} try { if (isAncestorParent(win, window) && window.top) return window.top; } catch (err) {} for (var _iterator3 = getAllChildFrames(win), _isArray3 = Array.isArray(_iterator3), _i4 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator](); ;) { var _ref3; if (_isArray3) { if (_i4 >= _iterator3.length) break; _ref3 = _iterator3[_i4++]; } else { _i4 = _iterator3.next(); if (_i4.done) break; _ref3 = _i4.value; } var frame = _ref3; try { if (frame.top) return frame.top; } catch (err) {} if (getParent(frame) === frame) return frame; } } } function getAllFramesInWindow(win) { var top = getTop(win); return getAllChildFrames(top).concat(top); } function isTop(win) { return win === getTop(win); } function isFrameWindowClosed(frame) { if (!frame.contentWindow) return !0; if (!frame.parentNode) return !0; var doc = frame.ownerDocument; return !(!doc || !doc.body || doc.body.contains(frame)); } function safeIndexOf(collection, item) { for (var i = 0; i < collection.length; i++) try { if (collection[i] === item) return i; } catch (err) {} return -1; } function isWindowClosed(win) { var allowMock = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1]; try { if (win === window) return !1; } catch (err) { return !0; } try { if (!win) return !0; } catch (err) { return !0; } try { if (win.closed) return !0; } catch (err) { return !err || err.message !== IE_WIN_ACCESS_ERROR; } if (allowMock && isSameDomain(win)) try { if (win.mockclosed) return !0; } catch (err) {} try { if (!win.parent || !win.top) return !0; } catch (err) {} try { noop(win === win); } catch (err) { return !0; } var iframeIndex = safeIndexOf(iframeWindows, win); if (-1 !== iframeIndex) { var frame = iframeFrames[iframeIndex]; if (frame && isFrameWindowClosed(frame)) return !0; } return !1; } function cleanIframes() { for (var i = 0; i < iframeFrames.length; i++) if (isFrameWindowClosed(iframeFrames[i])) { iframeFrames.splice(i, 1); iframeWindows.splice(i, 1); } for (var _i5 = 0; _i5 < iframeWindows.length; _i5++) if (isWindowClosed(iframeWindows[_i5])) { iframeFrames.splice(_i5, 1); iframeWindows.splice(_i5, 1); } } function linkFrameWindow(frame) { cleanIframes(); if (frame && frame.contentWindow) try { iframeWindows.push(frame.contentWindow); iframeFrames.push(frame); } catch (err) {} } function getUserAgent(win) { win = win || window; return win.navigator.mockUserAgent || win.navigator.userAgent; } function getFrameByName(win, name) { for (var winFrames = getFrames(win), _iterator4 = winFrames, _isArray4 = Array.isArray(_iterator4), _i6 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator](); ;) { var _ref4; if (_isArray4) { if (_i6 >= _iterator4.length) break; _ref4 = _iterator4[_i6++]; } else { _i6 = _iterator4.next(); if (_i6.done) break; _ref4 = _i6.value; } var childFrame = _ref4; try { if (isSameDomain(childFrame) && childFrame.name === name && -1 !== winFrames.indexOf(childFrame)) return childFrame; } catch (err) {} } try { if (-1 !== winFrames.indexOf(win.frames[name])) return win.frames[name]; } catch (err) {} try { if (-1 !== winFrames.indexOf(win[name])) return win[name]; } catch (err) {} } function findChildFrameByName(win, name) { var frame = getFrameByName(win, name); if (frame) return frame; for (var _iterator5 = getFrames(win), _isArray5 = Array.isArray(_iterator5), _i7 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator](); ;) { var _ref5; if (_isArray5) { if (_i7 >= _iterator5.length) break; _ref5 = _iterator5[_i7++]; } else { _i7 = _iterator5.next(); if (_i7.done) break; _ref5 = _i7.value; } var childFrame = _ref5, namedFrame = findChildFrameByName(childFrame, name); if (namedFrame) return namedFrame; } } function findFrameByName(win, name) { var frame = void 0; frame = getFrameByName(win, name); return frame || findChildFrameByName(getTop(win) || win, name); } function isOpener(parent, child) { return parent === getOpener(child); } function getAncestor(win) { win = win || window; var opener = getOpener(win); if (opener) return opener; var parent = getParent(win); return parent || void 0; } function isAncestor(parent, child) { var actualParent = getAncestor(child); if (actualParent) return actualParent === parent; if (child === parent) return !1; if (getTop(child) === child) return !1; for (var _iterator7 = getFrames(parent), _isArray7 = Array.isArray(_iterator7), _i9 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator](); ;) { var _ref7; if (_isArray7) { if (_i9 >= _iterator7.length) break; _ref7 = _iterator7[_i9++]; } else { _i9 = _iterator7.next(); if (_i9.done) break; _ref7 = _i9.value; } if (_ref7 === child) return !0; } return !1; } function isPopup() { return Boolean(getOpener(window)); } function isIframe() { return Boolean(getParent(window)); } function anyMatch(collection1, collection2) { for (var _iterator8 = collection1, _isArray8 = Array.isArray(_iterator8), _i10 = 0, _iterator8 = _isArray8 ? _iterator8 : _iterator8[Symbol.iterator](); ;) { var _ref8; if (_isArray8) { if (_i10 >= _iterator8.length) break; _ref8 = _iterator8[_i10++]; } else { _i10 = _iterator8.next(); if (_i10.done) break; _ref8 = _i10.value; } for (var item1 = _ref8, _iterator9 = collection2, _isArray9 = Array.isArray(_iterator9), _i11 = 0, _iterator9 = _isArray9 ? _iterator9 : _iterator9[Symbol.iterator](); ;) { var _ref9; if (_isArray9) { if (_i11 >= _iterator9.length) break; _ref9 = _iterator9[_i11++]; } else { _i11 = _iterator9.next(); if (_i11.done) break; _ref9 = _i11.value; } if (item1 === _ref9) return !0; } } return !1; } function getDistanceFromTop() { for (var win = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : window, distance = 0, parent = win; parent; ) { parent = getParent(parent); parent && (distance += 1); } return distance; } function getNthParent(win) { for (var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1, parent = win, i = 0; i < n; i++) { if (!parent) return; parent = getParent(parent); } return parent; } function getNthParentFromTop(win) { var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1; return getNthParent(win, getDistanceFromTop(win) - n); } function isSameTopWindow(win1, win2) { var top1 = getTop(win1) || win1, top2 = getTop(win2) || win2; try { if (top1 && top2) return top1 === top2; } catch (err) {} var allFrames1 = getAllFramesInWindow(win1), allFrames2 = getAllFramesInWindow(win2); if (anyMatch(allFrames1, allFrames2)) return !0; var opener1 = getOpener(top1), opener2 = getOpener(top2); return (!opener1 || !anyMatch(getAllFramesInWindow(opener1), allFrames2)) && (opener2 && anyMatch(getAllFramesInWindow(opener2), allFrames1), !1); } function matchDomain(pattern, origin) { if ("string" == typeof pattern) { if ("string" == typeof origin) return pattern === CONSTANTS.WILDCARD || origin === pattern; if (isRegex(origin)) return !1; if (Array.isArray(origin)) return !1; } return isRegex(pattern) ? isRegex(origin) ? pattern.toString() === origin.toString() : !Array.isArray(origin) && Boolean(origin.match(pattern)) : !!Array.isArray(pattern) && (Array.isArray(origin) ? JSON.stringify(pattern) === JSON.stringify(origin) : !isRegex(origin) && pattern.some(function(subpattern) { return matchDomain(subpattern, origin); })); } function stringifyDomainPattern(pattern) { return Array.isArray(pattern) ? "(" + pattern.join(" | ") + ")" : isRegex(pattern) ? "RegExp(" + pattern.toString() : pattern.toString(); } function getDomainFromUrl(url) { var domain = void 0; if (!url.match(/^(https?|mock|file):\/\//)) return getDomain(); domain = url; domain = domain.split("/").slice(0, 3).join("/"); return domain; } function onCloseWindow(win, callback) { var delay = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1e3, maxtime = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 1 / 0, timeout = void 0; !function check() { if (isWindowClosed(win)) { timeout && clearTimeout(timeout); return callback(); } if (maxtime <= 0) clearTimeout(timeout); else { maxtime -= delay; timeout = setTimeout(check, delay); } }(); return { cancel: function() { timeout && clearTimeout(timeout); } }; } function isWindow(obj) { try { if (obj === window) return !0; } catch (err) { if (err && err.message === IE_WIN_ACCESS_ERROR) return !0; } try { if ("[object Window]" === Object.prototype.toString.call(obj)) return !0; } catch (err) { if (err && err.message === IE_WIN_ACCESS_ERROR) return !0; } try { if (window.Window && obj instanceof window.Window) return !0; } catch (err) { if (err && err.message === IE_WIN_ACCESS_ERROR) return !0; } try { if (obj && obj.self === obj) return !0; } catch (err) { if (err && err.message === IE_WIN_ACCESS_ERROR) return !0; } try { if (obj && obj.parent === obj) return !0; } catch (err) { if (err && err.message === IE_WIN_ACCESS_ERROR) return !0; } try { if (obj && obj.top === obj) return !0; } catch (err) { if (err && err.message === IE_WIN_ACCESS_ERROR) return !0; } try { noop(obj === obj); } catch (err) { return !0; } try { noop(obj && obj.__cross_domain_utils_window_check__); } catch (err) { return !0; } return !1; } __webpack_exports__.q = isFileProtocol; __webpack_exports__.l = getParent; __webpack_exports__.k = getOpener; __webpack_exports__.b = getActualDomain; __webpack_exports__.f = getDomain; __webpack_exports__.o = isActuallySameDomain; __webpack_exports__.u = isSameDomain; __webpack_exports__.i = getFrames; __webpack_exports__.m = getTop; __webpack_exports__.c = getAllFramesInWindow; __webpack_exports__.w = isTop; __webpack_exports__.y = isWindowClosed; __webpack_exports__.z = linkFrameWindow; __webpack_exports__.n = getUserAgent; __webpack_exports__.h = getFrameByName; __webpack_exports__.a = findFrameByName; __webpack_exports__.s = isOpener; __webpack_exports__.d = getAncestor; __webpack_exports__.p = isAncestor; __webpack_exports__.t = isPopup; __webpack_exports__.r = isIframe; __webpack_exports__.e = getDistanceFromTop; __webpack_exports__.j = getNthParentFromTop; __webpack_exports__.v = isSameTopWindow; __webpack_exports__.A = matchDomain; __webpack_exports__.C = stringifyDomainPattern; __webpack_exports__.g = getDomainFromUrl; __webpack_exports__.B = onCloseWindow; __webpack_exports__.x = isWindow; var CONSTANTS = { MOCK_PROTOCOL: "mock:", FILE_PROTOCOL: "file:", ABOUT_PROTOCOL: "about:", WILDCARD: "*" }, IE_WIN_ACCESS_ERROR = "Call was rejected by callee.\r\n", iframeWindows = [], iframeFrames = []; }, "./node_modules/hi-base32/src/base32.js": function(module, exports, __webpack_require__) { (function(process, global, module) { var __WEBPACK_AMD_DEFINE_RESULT__, _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj; } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /* * [hi-base32]{@link https://github.com/emn178/hi-base32} * * @version 0.5.0 * @author Chen, Yi-Cyuan [emn178@gmail.com] * @copyright Chen, Yi-Cyuan 2015-2018 * @license MIT */ !function() { "use strict"; var root = "object" === ("undefined" == typeof window ? "undefined" : _typeof(window)) ? window : {}; !root.HI_BASE32_NO_NODE_JS && "object" === (void 0 === process ? "undefined" : _typeof(process)) && process.versions && process.versions.node && (root = global); var COMMON_JS = !root.HI_BASE32_NO_COMMON_JS && "object" === _typeof(module) && module.exports, AMD = __webpack_require__("./node_modules/webpack/buildin/amd-options.js"), BASE32_ENCODE_CHAR = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".split(""), BASE32_DECODE_CHAR = { A: 0, B: 1, C: 2, D: 3, E: 4, F: 5, G: 6, H: 7, I: 8, J: 9, K: 10, L: 11, M: 12, N: 13, O: 14, P: 15, Q: 16, R: 17, S: 18, T: 19, U: 20, V: 21, W: 22, X: 23, Y: 24, Z: 25, "2": 26, "3": 27, "4": 28, "5": 29, "6": 30, "7": 31 }, blocks = [ 0, 0, 0, 0, 0, 0, 0, 0 ], throwInvalidUtf8 = function(position, partial) { partial.length > 10 && (partial = "..." + partial.substr(-10)); var err = new Error("Decoded data is not valid UTF-8. Maybe try base32.decode.asBytes()? Partial data after reading " + position + " bytes: " + partial + " <-"); err.position = position; throw err; }, toUtf8String = function(bytes) { for (var b, c, str = "", length = bytes.length, i = 0, followingChars = 0; i < length; ) { b = bytes[i++]; if (b <= 127) str += String.fromCharCode(b); else { if (b > 191 && b <= 223) { c = 31 & b; followingChars = 1; } else if (b <= 239) { c = 15 & b; followingChars = 2; } else if (b <= 247) { c = 7 & b; followingChars = 3; } else throwInvalidUtf8(i, str); for (var j = 0; j < followingChars; ++j) { b = bytes[i++]; (b < 128 || b > 191) && throwInvalidUtf8(i, str); c <<= 6; c += 63 & b; } c >= 55296 && c <= 57343 && throwInvalidUtf8(i, str); c > 1114111 && throwInvalidUtf8(i, str); if (c <= 65535) str += String.fromCharCode(c); else { c -= 65536; str += String.fromCharCode(55296 + (c >> 10)); str += String.fromCharCode(56320 + (1023 & c)); } } } return str; }, decodeAsBytes = function(base32Str) { if (!/^[A-Z2-7=]+$/.test(base32Str)) throw new Error("Invalid base32 characters"); base32Str = base32Str.replace(/=/g, ""); for (var v1, v2, v3, v4, v5, v6, v7, v8, bytes = [], index = 0, length = base32Str.length, i = 0, count = length >> 3 << 3; i < count; ) { v1 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v2 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v3 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v4 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v5 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v6 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v7 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v8 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; bytes[index++] = 255 & (v1 << 3 | v2 >>> 2); bytes[index++] = 255 & (v2 << 6 | v3 << 1 | v4 >>> 4); bytes[index++] = 255 & (v4 << 4 | v5 >>> 1); bytes[index++] = 255 & (v5 << 7 | v6 << 2 | v7 >>> 3); bytes[index++] = 255 & (v7 << 5 | v8); } var remain = length - count; if (2 === remain) { v1 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v2 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; bytes[index++] = 255 & (v1 << 3 | v2 >>> 2); } else if (4 === remain) { v1 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v2 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v3 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v4 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; bytes[index++] = 255 & (v1 << 3 | v2 >>> 2); bytes[index++] = 255 & (v2 << 6 | v3 << 1 | v4 >>> 4); } else if (5 === remain) { v1 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v2 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v3 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v4 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v5 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; bytes[index++] = 255 & (v1 << 3 | v2 >>> 2); bytes[index++] = 255 & (v2 << 6 | v3 << 1 | v4 >>> 4); bytes[index++] = 255 & (v4 << 4 | v5 >>> 1); } else if (7 === remain) { v1 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v2 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v3 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v4 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v5 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v6 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v7 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; bytes[index++] = 255 & (v1 << 3 | v2 >>> 2); bytes[index++] = 255 & (v2 << 6 | v3 << 1 | v4 >>> 4); bytes[index++] = 255 & (v4 << 4 | v5 >>> 1); bytes[index++] = 255 & (v5 << 7 | v6 << 2 | v7 >>> 3); } return bytes; }, encodeAscii = function(str) { for (var v1, v2, v3, v4, v5, base32Str = "", length = str.length, i = 0, count = 5 * parseInt(length / 5); i < count; ) { v1 = str.charCodeAt(i++); v2 = str.charCodeAt(i++); v3 = str.charCodeAt(i++); v4 = str.charCodeAt(i++); v5 = str.charCodeAt(i++); base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + BASE32_ENCODE_CHAR[31 & (v1 << 2 | v2 >>> 6)] + BASE32_ENCODE_CHAR[v2 >>> 1 & 31] + BASE32_ENCODE_CHAR[31 & (v2 << 4 | v3 >>> 4)] + BASE32_ENCODE_CHAR[31 & (v3 << 1 | v4 >>> 7)] + BASE32_ENCODE_CHAR[v4 >>> 2 & 31] + BASE32_ENCODE_CHAR[31 & (v4 << 3 | v5 >>> 5)] + BASE32_ENCODE_CHAR[31 & v5]; } var remain = length - count; if (1 === remain) { v1 = str.charCodeAt(i); base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + BASE32_ENCODE_CHAR[v1 << 2 & 31] + "======"; } else if (2 === remain) { v1 = str.charCodeAt(i++); v2 = str.charCodeAt(i); base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + BASE32_ENCODE_CHAR[31 & (v1 << 2 | v2 >>> 6)] + BASE32_ENCODE_CHAR[v2 >>> 1 & 31] + BASE32_ENCODE_CHAR[v2 << 4 & 31] + "===="; } else if (3 === remain) { v1 = str.charCodeAt(i++); v2 = str.charCodeAt(i++); v3 = str.charCodeAt(i); base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + BASE32_ENCODE_CHAR[31 & (v1 << 2 | v2 >>> 6)] + BASE32_ENCODE_CHAR[v2 >>> 1 & 31] + BASE32_ENCODE_CHAR[31 & (v2 << 4 | v3 >>> 4)] + BASE32_ENCODE_CHAR[v3 << 1 & 31] + "==="; } else if (4 === remain) { v1 = str.charCodeAt(i++); v2 = str.charCodeAt(i++); v3 = str.charCodeAt(i++); v4 = str.charCodeAt(i); base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + BASE32_ENCODE_CHAR[31 & (v1 << 2 | v2 >>> 6)] + BASE32_ENCODE_CHAR[v2 >>> 1 & 31] + BASE32_ENCODE_CHAR[31 & (v2 << 4 | v3 >>> 4)] + BASE32_ENCODE_CHAR[31 & (v3 << 1 | v4 >>> 7)] + BASE32_ENCODE_CHAR[v4 >>> 2 & 31] + BASE32_ENCODE_CHAR[v4 << 3 & 31] + "="; } return base32Str; }, encodeUtf8 = function(str) { var v1, v2, v3, v4, v5, code, i, end = !1, base32Str = "", index = 0, start = 0, bytes = 0, length = str.length; do { blocks[0] = blocks[5]; blocks[1] = blocks[6]; blocks[2] = blocks[7]; for (i = start; index < length && i < 5; ++index) { code = str.charCodeAt(index); if (code < 128) blocks[i++] = code; else if (code < 2048) { blocks[i++] = 192 | code >> 6; blocks[i++] = 128 | 63 & code; } else if (code < 55296 || code >= 57344) { blocks[i++] = 224 | code >> 12; blocks[i++] = 128 | code >> 6 & 63; blocks[i++] = 128 | 63 & code; } else { code = 65536 + ((1023 & code) << 10 | 1023 & str.charCodeAt(++index)); blocks[i++] = 240 | code >> 18; blocks[i++] = 128 | code >> 12 & 63; blocks[i++] = 128 | code >> 6 & 63; blocks[i++] = 128 | 63 & code; } } bytes += i - start; start = i - 5; index === length && ++index; index > length && i < 6 && (end = !0); v1 = blocks[0]; if (i > 4) { v2 = blocks[1]; v3 = blocks[2]; v4 = blocks[3]; v5 = blocks[4]; base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + BASE32_ENCODE_CHAR[31 & (v1 << 2 | v2 >>> 6)] + BASE32_ENCODE_CHAR[v2 >>> 1 & 31] + BASE32_ENCODE_CHAR[31 & (v2 << 4 | v3 >>> 4)] + BASE32_ENCODE_CHAR[31 & (v3 << 1 | v4 >>> 7)] + BASE32_ENCODE_CHAR[v4 >>> 2 & 31] + BASE32_ENCODE_CHAR[31 & (v4 << 3 | v5 >>> 5)] + BASE32_ENCODE_CHAR[31 & v5]; } else if (1 === i) base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + BASE32_ENCODE_CHAR[v1 << 2 & 31] + "======"; else if (2 === i) { v2 = blocks[1]; base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + BASE32_ENCODE_CHAR[31 & (v1 << 2 | v2 >>> 6)] + BASE32_ENCODE_CHAR[v2 >>> 1 & 31] + BASE32_ENCODE_CHAR[v2 << 4 & 31] + "===="; } else if (3 === i) { v2 = blocks[1]; v3 = blocks[2]; base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + BASE32_ENCODE_CHAR[31 & (v1 << 2 | v2 >>> 6)] + BASE32_ENCODE_CHAR[v2 >>> 1 & 31] + BASE32_ENCODE_CHAR[31 & (v2 << 4 | v3 >>> 4)] + BASE32_ENCODE_CHAR[v3 << 1 & 31] + "==="; } else { v2 = blocks[1]; v3 = blocks[2]; v4 = blocks[3]; base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + BASE32_ENCODE_CHAR[31 & (v1 << 2 | v2 >>> 6)] + BASE32_ENCODE_CHAR[v2 >>> 1 & 31] + BASE32_ENCODE_CHAR[31 & (v2 << 4 | v3 >>> 4)] + BASE32_ENCODE_CHAR[31 & (v3 << 1 | v4 >>> 7)] + BASE32_ENCODE_CHAR[v4 >>> 2 & 31] + BASE32_ENCODE_CHAR[v4 << 3 & 31] + "="; } } while (!end); return base32Str; }, encodeBytes = function(bytes) { for (var v1, v2, v3, v4, v5, base32Str = "", length = bytes.length, i = 0, count = 5 * parseInt(length / 5); i < count; ) { v1 = bytes[i++]; v2 = bytes[i++]; v3 = bytes[i++]; v4 = bytes[i++]; v5 = bytes[i++]; base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + BASE32_ENCODE_CHAR[31 & (v1 << 2 | v2 >>> 6)] + BASE32_ENCODE_CHAR[v2 >>> 1 & 31] + BASE32_ENCODE_CHAR[31 & (v2 << 4 | v3 >>> 4)] + BASE32_ENCODE_CHAR[31 & (v3 << 1 | v4 >>> 7)] + BASE32_ENCODE_CHAR[v4 >>> 2 & 31] + BASE32_ENCODE_CHAR[31 & (v4 << 3 | v5 >>> 5)] + BASE32_ENCODE_CHAR[31 & v5]; } var remain = length - count; if (1 === remain) { v1 = bytes[i]; base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + BASE32_ENCODE_CHAR[v1 << 2 & 31] + "======"; } else if (2 === remain) { v1 = bytes[i++]; v2 = bytes[i]; base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + BASE32_ENCODE_CHAR[31 & (v1 << 2 | v2 >>> 6)] + BASE32_ENCODE_CHAR[v2 >>> 1 & 31] + BASE32_ENCODE_CHAR[v2 << 4 & 31] + "===="; } else if (3 === remain) { v1 = bytes[i++]; v2 = bytes[i++]; v3 = bytes[i]; base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + BASE32_ENCODE_CHAR[31 & (v1 << 2 | v2 >>> 6)] + BASE32_ENCODE_CHAR[v2 >>> 1 & 31] + BASE32_ENCODE_CHAR[31 & (v2 << 4 | v3 >>> 4)] + BASE32_ENCODE_CHAR[v3 << 1 & 31] + "==="; } else if (4 === remain) { v1 = bytes[i++]; v2 = bytes[i++]; v3 = bytes[i++]; v4 = bytes[i]; base32Str += BASE32_ENCODE_CHAR[v1 >>> 3] + BASE32_ENCODE_CHAR[31 & (v1 << 2 | v2 >>> 6)] + BASE32_ENCODE_CHAR[v2 >>> 1 & 31] + BASE32_ENCODE_CHAR[31 & (v2 << 4 | v3 >>> 4)] + BASE32_ENCODE_CHAR[31 & (v3 << 1 | v4 >>> 7)] + BASE32_ENCODE_CHAR[v4 >>> 2 & 31] + BASE32_ENCODE_CHAR[v4 << 3 & 31] + "="; } return base32Str; }, encode = function(input, asciiOnly) { var notString = "string" != typeof input; notString && input.constructor === ArrayBuffer && (input = new Uint8Array(input)); return notString ? encodeBytes(input) : asciiOnly ? encodeAscii(input) : encodeUtf8(input); }, decode = function(base32Str, asciiOnly) { if (!asciiOnly) return toUtf8String(decodeAsBytes(base32Str)); if (!/^[A-Z2-7=]+$/.test(base32Str)) throw new Error("Invalid base32 characters"); var v1, v2, v3, v4, v5, v6, v7, v8, str = "", length = base32Str.indexOf("="); -1 === length && (length = base32Str.length); for (var i = 0, count = length >> 3 << 3; i < count; ) { v1 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v2 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v3 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v4 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v5 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v6 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v7 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v8 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; str += String.fromCharCode(255 & (v1 << 3 | v2 >>> 2)) + String.fromCharCode(255 & (v2 << 6 | v3 << 1 | v4 >>> 4)) + String.fromCharCode(255 & (v4 << 4 | v5 >>> 1)) + String.fromCharCode(255 & (v5 << 7 | v6 << 2 | v7 >>> 3)) + String.fromCharCode(255 & (v7 << 5 | v8)); } var remain = length - count; if (2 === remain) { v1 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v2 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; str += String.fromCharCode(255 & (v1 << 3 | v2 >>> 2)); } else if (4 === remain) { v1 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v2 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v3 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v4 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; str += String.fromCharCode(255 & (v1 << 3 | v2 >>> 2)) + String.fromCharCode(255 & (v2 << 6 | v3 << 1 | v4 >>> 4)); } else if (5 === remain) { v1 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v2 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v3 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v4 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v5 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; str += String.fromCharCode(255 & (v1 << 3 | v2 >>> 2)) + String.fromCharCode(255 & (v2 << 6 | v3 << 1 | v4 >>> 4)) + String.fromCharCode(255 & (v4 << 4 | v5 >>> 1)); } else if (7 === remain) { v1 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v2 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v3 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v4 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v5 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v6 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; v7 = BASE32_DECODE_CHAR[base32Str.charAt(i++)]; str += String.fromCharCode(255 & (v1 << 3 | v2 >>> 2)) + String.fromCharCode(255 & (v2 << 6 | v3 << 1 | v4 >>> 4)) + String.fromCharCode(255 & (v4 << 4 | v5 >>> 1)) + String.fromCharCode(255 & (v5 << 7 | v6 << 2 | v7 >>> 3)); } return str; }, exports = { encode: encode, decode: decode }; decode.asBytes = decodeAsBytes; if (COMMON_JS) module.exports = exports; else { root.base32 = exports; AMD && void 0 !== (__WEBPACK_AMD_DEFINE_RESULT__ = function() { return exports; }.call(exports, __webpack_require__, exports, module)) && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__); } }(); }).call(exports, __webpack_require__("./node_modules/process/browser.js"), __webpack_require__("./node_modules/webpack/buildin/global.js"), __webpack_require__("./node_modules/webpack/buildin/module.js")(module)); }, "./node_modules/post-robot/src/bridge/index.js": function(module, __webpack_exports__, __webpack_require__) { "use strict"; function deleteTunnelWindow(id) { try { global.a.tunnelWindows[id] && delete global.a.tunnelWindows[id].source; } catch (err) {} delete global.a.tunnelWindows[id]; } function cleanTunnelWindows() { for (var tunnelWindows = global.a.tunnelWindows, _iterator = Object.keys(tunnelWindows), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); ;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var key = _ref, tunnelWindow = tunnelWindows[key]; try { Object(lib.j)(tunnelWindow.source); } catch (err) { deleteTunnelWindow(key); continue; } Object(cross_domain_utils_src.isWindowClosed)(tunnelWindow.source) && deleteTunnelWindow(key); } } function addTunnelWindow(_ref2) { var name = _ref2.name, source = _ref2.source, canary = _ref2.canary, sendMessage = _ref2.sendMessage; cleanTunnelWindows(); global.a.tunnelWindowId += 1; global.a.tunnelWindows[global.a.tunnelWindowId] = { name: name, source: source, canary: canary, sendMessage: sendMessage }; return global.a.tunnelWindowId; } function getTunnelWindow(id) { return global.a.tunnelWindows[id]; } function needsBridgeForBrowser() { return !!Object(cross_domain_utils_src.getUserAgent)(window).match(/MSIE|trident|edge\/12|edge\/13/i) || !conf.a.ALLOW_POSTMESSAGE_POPUP; } function needsBridgeForWin(win) { return !Object(cross_domain_utils_src.isSameTopWindow)(window, win); } function needsBridgeForDomain(domain, win) { if (domain) { if (Object(cross_domain_utils_src.getDomain)() !== Object(cross_domain_utils_src.getDomainFromUrl)(domain)) return !0; } else if (win && !Object(cross_domain_utils_src.isSameDomain)(win)) return !0; return !1; } function needsBridge(_ref) { var win = _ref.win, domain = _ref.domain; return !!needsBridgeForBrowser() && (!(domain && !needsBridgeForDomain(domain, win)) && !(win && !needsBridgeForWin(win))); } function getBridgeName(domain) { domain = domain || Object(cross_domain_utils_src.getDomainFromUrl)(domain); var sanitizedDomain = domain.replace(/[^a-zA-Z0-9]+/g, "_"); return conf.b.BRIDGE_NAME_PREFIX + "_" + sanitizedDomain; } function isBridge() { return Boolean(window.name && window.name === getBridgeName(Object(cross_domain_utils_src.getDomain)())); } function registerRemoteWindow(win) { global.a.remoteWindows.set(win, { sendMessagePromise: new src.a() }); } function findRemoteWindow(win) { return global.a.remoteWindows.get(win); } function registerRemoteSendMessage(win, domain, sendMessage) { var remoteWindow = findRemoteWindow(win); if (!remoteWindow) throw new Error("Window not found to register sendMessage to"); var sendMessageWrapper = function(remoteWin, message, remoteDomain) { if (remoteWin !== win) throw new Error("Remote window does not match window"); if (!Object(cross_domain_utils_src.matchDomain)(remoteDomain, domain)) throw new Error("Remote domain " + remoteDomain + " does not match domain " + domain); sendMessage(message); }; remoteWindow.sendMessagePromise.resolve(sendMessageWrapper); remoteWindow.sendMessagePromise = src.a.resolve(sendMessageWrapper); } function rejectRemoteSendMessage(win, err) { var remoteWindow = findRemoteWindow(win); if (!remoteWindow) throw new Error("Window not found on which to reject sendMessage"); remoteWindow.sendMessagePromise.asyncReject(err); } function sendBridgeMessage(win, message, domain) { var messagingChild = Object(cross_domain_utils_src.isOpener)(window, win), messagingParent = Object(cross_domain_utils_src.isOpener)(win, window); if (!messagingChild && !messagingParent) throw new Error("Can only send messages to and from parent and popup windows"); var remoteWindow = findRemoteWindow(win); if (!remoteWindow) throw new Error("Window not found to send message to"); return remoteWindow.sendMessagePromise.then(function(sendMessage) { return sendMessage(win, message, domain); }); } function openTunnelToOpener() { return src.a.try(function() { var opener = Object(cross_domain_utils_src.getOpener)(window); if (opener && needsBridge({ win: opener })) { registerRemoteWindow(opener); return awaitRemoteBridgeForWindow(opener).then(function(bridge) { return bridge ? window.name ? bridge[conf.b.WINDOW_PROPS.POSTROBOT].openTunnelToParent({ name: window.name, source: window, canary: function() {}, sendMessage: function(message) { try { Object(lib.j)(window); } catch (err) { return; } if (window && !window.closed) try { global.a.receiveMessage({ data: message, origin: this.origin, source: this.source }); } catch (err) { src.a.reject(err); } } }).then(function(_ref2) { var source = _ref2.source, origin = _ref2.origin, data = _ref2.data; if (source !== opener) throw new Error("Source does not match opener"); registerRemoteSendMessage(source, origin, data.sendMessage); }).catch(function(err) { rejectRemoteSendMessage(opener, err); throw err; }) : rejectRemoteSendMessage(opener, new Error("Can not register with opener: window does not have a name")) : rejectRemoteSendMessage(opener, new Error("Can not register with opener: no bridge found in opener")); }); } }); } function listenForRegister(source, domain) { global.a.on(conf.b.POST_MESSAGE_NAMES.OPEN_TUNNEL, { window: source, domain: domain }, function(_ref) { var origin = _ref.origin, data = _ref.data; if (origin !== domain) throw new Error("Domain " + domain + " does not match origin " + origin); if (!data.name) throw new Error("Register window expected to be passed window name"); if (!data.sendMessage) throw new Error("Register window expected to be passed sendMessage method"); if (!global.a.popupWindowsByName[data.name]) throw new Error("Window with name " + data.name + " does not exist, or was not opened by this window"); if (!global.a.popupWindowsByName[data.name].domain) throw new Error("We do not have a registered domain for window " + data.name); if (global.a.popupWindowsByName[data.name].domain !== origin) throw new Error("Message origin " + origin + " does not matched registered window origin " + global.a.popupWindowsByName[data.name].domain); registerRemoteSendMessage(global.a.popupWindowsByName[data.name].win, domain, data.sendMessage); return { sendMessage: function(message) { if (window && !window.closed) { var winDetails = global.a.popupWindowsByName[data.name]; if (winDetails) try { global.a.receiveMessage({ data: message, origin: winDetails.domain, source: winDetails.win }); } catch (err) { src.a.reject(err); } } } }; }); } function openBridgeFrame(name, url) { lib.i.debug("Opening bridge:", name, url); var iframe = document.createElement("iframe"); iframe.setAttribute("name", name); iframe.setAttribute("id", name); iframe.setAttribute("style", "display: none; margin: 0; padding: 0; border: 0px none; overflow: hidden;"); iframe.setAttribute("frameborder", "0"); iframe.setAttribute("border", "0"); iframe.setAttribute("scrolling", "no"); iframe.setAttribute("allowTransparency", "true"); iframe.setAttribute("tabindex", "-1"); iframe.setAttribute("hidden", "true"); iframe.setAttribute("title", ""); iframe.setAttribute("role", "presentation"); iframe.src = url; return iframe; } function hasBridge(url, domain) { domain = domain || Object(cross_domain_utils_src.getDomainFromUrl)(url); return Boolean(global.a.bridges[domain]); } function openBridge(url, domain) { domain = domain || Object(cross_domain_utils_src.getDomainFromUrl)(url); if (global.a.bridges[domain]) return global.a.bridges[domain]; global.a.bridges[domain] = src.a.try(function() { if (Object(cross_domain_utils_src.getDomain)() === domain) throw new Error("Can not open bridge on the same domain as current domain: " + domain); var name = getBridgeName(domain); if (Object(cross_domain_utils_src.getFrameByName)(window, name)) throw new Error("Frame with name " + name + " already exists on page"); var iframe = openBridgeFrame(name, url); global.a.bridgeFrames[domain] = iframe; return documentBodyReady.then(function(body) { body.appendChild(iframe); var bridge = iframe.contentWindow; listenForRegister(bridge, domain); return new src.a(function(resolve, reject) { iframe.onload = resolve; iframe.onerror = reject; }).then(function() { return Object(lib.k)(bridge, conf.a.BRIDGE_TIMEOUT, "Bridge " + url); }).then(function() { return bridge; }); }); }); return global.a.bridges[domain]; } function linkUrl(win, url) { var winOptions = global.a.popupWindowsByWin.get(win); if (winOptions) { winOptions.domain = Object(cross_domain_utils_src.getDomainFromUrl)(url); registerRemoteWindow(win); } } function destroyBridges() { for (var _iterator2 = Object.keys(global.a.bridgeFrames), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator](); ;) { var _ref3; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref3 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref3 = _i2.value; } var domain = _ref3, frame = global.a.bridgeFrames[domain]; frame.parentNode && frame.parentNode.removeChild(frame); } global.a.bridgeFrames = {}; global.a.bridges = {}; } Object.defineProperty(__webpack_exports__, "__esModule", { value: !0 }); var src = __webpack_require__("./node_modules/zalgo-promise/src/index.js"), cross_domain_utils_src = __webpack_require__("./node_modules/cross-domain-utils/src/index.js"), conf = __webpack_require__("./node_modules/post-robot/src/conf/index.js"), lib = __webpack_require__("./node_modules/post-robot/src/lib/index.js"), global = __webpack_require__("./node_modules/post-robot/src/global.js"); global.a.tunnelWindows = global.a.tunnelWindows || {}; global.a.tunnelWindowId = 0; global.a.openTunnelToParent = function(_ref3) { var name = _ref3.name, source = _ref3.source, canary = _ref3.canary, sendMessage = _ref3.sendMessage, parentWindow = Object(cross_domain_utils_src.getParent)(window); if (!parentWindow) throw new Error("No parent window found to open tunnel to"); var id = addTunnelWindow({ name: name, source: source, canary: canary, sendMessage: sendMessage }); return global.a.send(parentWindow, conf.b.POST_MESSAGE_NAMES.OPEN_TUNNEL, { name: name, sendMessage: function() { var tunnelWindow = getTunnelWindow(id); try { Object(lib.j)(tunnelWindow && tunnelWindow.source); } catch (err) { deleteTunnelWindow(id); return; } if (tunnelWindow && tunnelWindow.source && !Object(cross_domain_utils_src.isWindowClosed)(tunnelWindow.source)) { try { tunnelWindow.canary(); } catch (err) { return; } tunnelWindow.sendMessage.apply(this, arguments); } } }, { domain: conf.b.WILDCARD }); }; var cross_domain_safe_weakmap_src = __webpack_require__("./node_modules/cross-domain-safe-weakmap/src/index.js"), documentBodyReady = new src.a(function(resolve) { if (window.document && window.document.body) return resolve(window.document.body); var interval = setInterval(function() { if (window.document && window.document.body) { clearInterval(interval); return resolve(window.document.body); } }, 10); }); global.a.remoteWindows = global.a.remoteWindows || new cross_domain_safe_weakmap_src.a(); var awaitRemoteBridgeForWindow = Object(lib.r)(function(win) { return src.a.try(function() { for (var _iterator = Object(cross_domain_utils_src.getFrames)(win), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); ;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var _frame = _ref; try { if (_frame && _frame !== window && Object(cross_domain_utils_src.isSameDomain)(_frame) && _frame[conf.b.WINDOW_PROPS.POSTROBOT]) return _frame; } catch (err) { continue; } } try { var frame = Object(cross_domain_utils_src.getFrameByName)(win, getBridgeName(Object(cross_domain_utils_src.getDomain)())); if (!frame) return; return Object(cross_domain_utils_src.isSameDomain)(frame) && frame[conf.b.WINDOW_PROPS.POSTROBOT] ? frame : new src.a(function(resolve) { var interval = void 0, timeout = void 0; interval = setInterval(function() { if (frame && Object(cross_domain_utils_src.isSameDomain)(frame) && frame[conf.b.WINDOW_PROPS.POSTROBOT]) { clearInterval(interval); clearTimeout(timeout); return resolve(frame); } }, 100); timeout = setTimeout(function() { clearInterval(interval); return resolve(); }, 2e3); }); } catch (err) {} }); }); global.a.bridges = global.a.bridges || {}; global.a.bridgeFrames = global.a.bridgeFrames || {}; global.a.popupWindowsByWin = global.a.popupWindowsByWin || new cross_domain_safe_weakmap_src.a(); global.a.popupWindowsByName = global.a.popupWindowsByName || {}; var windowOpen = window.open; window.open = function(url, name, options, last) { var domain = url; if (url && 0 === url.indexOf(conf.b.MOCK_PROTOCOL)) { var _url$split = url.split("|"); domain = _url$split[0]; url = _url$split[1]; } domain && (domain = Object(cross_domain_utils_src.getDomainFromUrl)(domain)); var win = windowOpen.call(this, url, name, options, last); if (!win) return win; url && registerRemoteWindow(win); for (var _iterator = Object.keys(global.a.popupWindowsByName), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); ;) { var _ref2; if (_isArray) { if (_i >= _iterator.length) break; _ref2 = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref2 = _i.value; } var winName = _ref2; Object(cross_domain_utils_src.isWindowClosed)(global.a.popupWindowsByName[winName].win) && delete global.a.popupWindowsByName[winName]; } if (name && win) { var winOptions = global.a.popupWindowsByWin.get(win) || global.a.popupWindowsByName[name] || {}; winOptions.name = winOptions.name || name; winOptions.win = winOptions.win || win; winOptions.domain = winOptions.domain || domain; global.a.popupWindowsByWin.set(win, winOptions); global.a.popupWindowsByName[name] = winOptions; } return win; }; __webpack_require__.d(__webpack_exports__, "openTunnelToOpener", function() { return openTunnelToOpener; }); __webpack_require__.d(__webpack_exports__, "needsBridgeForBrowser", function() { return needsBridgeForBrowser; }); __webpack_require__.d(__webpack_exports__, "needsBridgeForWin", function() { return needsBridgeForWin; }); __webpack_require__.d(__webpack_exports__, "needsBridgeForDomain", function() { return needsBridgeForDomain; }); __webpack_require__.d(__webpack_exports__, "needsBridge", function() { return needsBridge; }); __webpack_require__.d(__webpack_exports__, "getBridgeName", function() { return getBridgeName; }); __webpack_require__.d(__webpack_exports__, "isBridge", function() { return isBridge; }); __webpack_require__.d(__webpack_exports__, "documentBodyReady", function() { return documentBodyReady; }); __webpack_require__.d(__webpack_exports__, "registerRemoteWindow", function() { return registerRemoteWindow; }); __webpack_require__.d(__webpack_exports__, "findRemoteWindow", function() { return findRemoteWindow; }); __webpack_require__.d(__webpack_exports__, "registerRemoteSendMessage", function() { return registerRemoteSendMessage; }); __webpack_require__.d(__webpack_exports__, "rejectRemoteSendMessage", function() { return rejectRemoteSendMessage; }); __webpack_require__.d(__webpack_exports__, "sendBridgeMessage", function() { return sendBridgeMessage; }); __webpack_require__.d(__webpack_exports__, "hasBridge", function() { return hasBridge; }); __webpack_require__.d(__webpack_exports__, "openBridge", function() { return openBridge; }); __webpack_require__.d(__webpack_exports__, "linkUrl", function() { return linkUrl; }); __webpack_require__.d(__webpack_exports__, "destroyBridges", function() { return destroyBridges; }); }, "./node_modules/post-robot/src/compat/index.js": function(module, __webpack_exports__, __webpack_require__) { "use strict"; function emulateIERestrictions(sourceWindow, targetWindow) { if (!conf.a.ALLOW_POSTMESSAGE_POPUP && !1 === Object(src.isSameTopWindow)(sourceWindow, targetWindow)) throw new Error("Can not send and receive post messages between two different windows (disabled to emulate IE)"); } Object.defineProperty(__webpack_exports__, "__esModule", { value: !0 }); var src = __webpack_require__("./node_modules/cross-domain-utils/src/index.js"), conf = __webpack_require__("./node_modules/post-robot/src/conf/index.js"); __webpack_require__.d(__webpack_exports__, "emulateIERestrictions", function() { return emulateIERestrictions; }); }, "./node_modules/post-robot/src/conf/index.js": function(module, __webpack_exports__, __webpack_require__) { "use strict"; var _ALLOWED_POST_MESSAGE, CONSTANTS = { 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: "*" }, POST_MESSAGE_NAMES = { METHOD: "postrobot_method", HELLO: "postrobot_hello", OPEN_TUNNEL: "postrobot_open_tunnel" }, POST_MESSAGE_NAMES_LIST = Object.keys(POST_MESSAGE_NAMES).map(function(key) { return POST_MESSAGE_NAMES[key]; }), CONFIG = { ALLOW_POSTMESSAGE_POPUP: !("__ALLOW_POSTMESSAGE_POPUP__" in window) || window.__ALLOW_POSTMESSAGE_POPUP__, LOG_LEVEL: "info", BRIDGE_TIMEOUT: 5e3, CHILD_WINDOW_TIMEOUT: 5e3, ACK_TIMEOUT: -1 !== window.navigator.userAgent.match(/MSIE/i) ? 2e3 : 1e3, RES_TIMEOUT: 1 / 0, LOG_TO_PAGE: !1, ALLOWED_POST_MESSAGE_METHODS: (_ALLOWED_POST_MESSAGE = {}, _ALLOWED_POST_MESSAGE[CONSTANTS.SEND_STRATEGIES.POST_MESSAGE] = !0, _ALLOWED_POST_MESSAGE[CONSTANTS.SEND_STRATEGIES.BRIDGE] = !0, _ALLOWED_POST_MESSAGE[CONSTANTS.SEND_STRATEGIES.GLOBAL] = !0, _ALLOWED_POST_MESSAGE), ALLOW_SAME_ORIGIN: !1 }; 0 === window.location.href.indexOf(CONSTANTS.FILE_PROTOCOL) && (CONFIG.ALLOW_POSTMESSAGE_POPUP = !0); __webpack_require__.d(__webpack_exports__, "a", function() { return CONFIG; }); __webpack_require__.d(__webpack_exports__, "b", function() { return CONSTANTS; }); __webpack_require__.d(__webpack_exports__, !1, function() { return POST_MESSAGE_NAMES; }); __webpack_require__.d(__webpack_exports__, "c", function() { return POST_MESSAGE_NAMES_LIST; }); }, "./node_modules/post-robot/src/global.js": function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.d(__webpack_exports__, "a", function() { return global; }); var __WEBPACK_IMPORTED_MODULE_0__conf__ = __webpack_require__("./node_modules/post-robot/src/conf/index.js"), global = window[__WEBPACK_IMPORTED_MODULE_0__conf__.b.WINDOW_PROPS.POSTROBOT] = window[__WEBPACK_IMPORTED_MODULE_0__conf__.b.WINDOW_PROPS.POSTROBOT] || {}; global.registerSelf = function() {}; }, "./node_modules/post-robot/src/index.js": function(module, __webpack_exports__, __webpack_require__) { "use strict"; function buildMessage(win, message) { var options = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, id = Object(lib.q)(), type = Object(lib.c)(), sourceDomain = Object(src.getDomain)(window); return _extends({}, message, options, { sourceDomain: sourceDomain, id: message.id || id, windowType: type }); } function sendMessage(win, message, domain) { return zalgo_promise_src.a.try(function() { var _jsonStringify; message = buildMessage(win, message, { data: Object(lib.o)(win, domain, message.data), domain: domain }); var level = void 0; level = -1 !== conf.c.indexOf(message.name) || message.type === conf.b.POST_MESSAGE_TYPE.ACK ? "debug" : "error" === message.ack ? "error" : "info"; lib.i.logLevel(level, [ "\n\n\t", "#send", message.type.replace(/^postrobot_message_/, ""), "::", message.name, "::", domain || conf.b.WILDCARD, "\n\n", message ]); if (win === window && !conf.a.ALLOW_SAME_ORIGIN) throw new Error("Attemping to send message to self"); if (Object(src.isWindowClosed)(win)) throw new Error("Window is closed"); lib.i.debug("Running send message strategies", message); var messages = [], serializedMessage = Object(lib.g)((_jsonStringify = {}, _jsonStringify[conf.b.WINDOW_PROPS.POSTROBOT] = message, _jsonStringify), null, 2); return zalgo_promise_src.a.map(Object.keys(SEND_MESSAGE_STRATEGIES), function(strategyName) { return zalgo_promise_src.a.try(function() { if (!conf.a.ALLOWED_POST_MESSAGE_METHODS[strategyName]) throw new Error("Strategy disallowed: " + strategyName); return SEND_MESSAGE_STRATEGIES[strategyName](win, serializedMessage, domain); }).then(function() { messages.push(strategyName + ": success"); return !0; }, function(err) { messages.push(strategyName + ": " + Object(lib.p)(err) + "\n"); return !1; }); }).then(function(results) { var success = results.some(Boolean), status = message.type + " " + message.name + " " + (success ? "success" : "error") + ":\n - " + messages.join("\n - ") + "\n"; lib.i.debug(status); if (!success) throw new Error(status); }); }); } function addResponseListener(hash, listener) { global.a.responseListeners[hash] = listener; } function getResponseListener(hash) { return global.a.responseListeners[hash]; } function deleteResponseListener(hash) { delete global.a.responseListeners[hash]; } function markResponseListenerErrored(hash) { global.a.erroredResponseListeners[hash] = !0; } function isResponseListenerErrored(hash) { return Boolean(global.a.erroredResponseListeners[hash]); } function getRequestListener(_ref) { var name = _ref.name, win = _ref.win, domain = _ref.domain; win === conf.b.WILDCARD && (win = null); domain === conf.b.WILDCARD && (domain = null); if (!name) throw new Error("Name required to get request listener"); var nameListeners = global.a.requestListeners[name]; if (nameListeners) for (var _arr = [ win, global.a.WINDOW_WILDCARD ], _i = 0; _i < _arr.length; _i++) { var winQualifier = _arr[_i], winListeners = winQualifier && nameListeners.get(winQualifier); if (winListeners) { if (domain && "string" == typeof domain) { if (winListeners[domain]) return winListeners[domain]; if (winListeners[__DOMAIN_REGEX__]) for (var _iterator = winListeners[__DOMAIN_REGEX__], _isArray = Array.isArray(_iterator), _i2 = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); ;) { var _ref3; if (_isArray) { if (_i2 >= _iterator.length) break; _ref3 = _iterator[_i2++]; } else { _i2 = _iterator.next(); if (_i2.done) break; _ref3 = _i2.value; } var _ref4 = _ref3, regex = _ref4.regex, listener = _ref4.listener; if (Object(src.matchDomain)(regex, domain)) return listener; } } if (winListeners[conf.b.WILDCARD]) return winListeners[conf.b.WILDCARD]; } } } function addRequestListener(_ref5, listener) { var name = _ref5.name, win = _ref5.win, domain = _ref5.domain; if (!name || "string" != typeof name) throw new Error("Name required to add request listener"); if (Array.isArray(win)) { for (var listenersCollection = [], _iterator2 = win, _isArray2 = Array.isArray(_iterator2), _i3 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator](); ;) { var _ref6; if (_isArray2) { if (_i3 >= _iterator2.length) break; _ref6 = _iterator2[_i3++]; } else { _i3 = _iterator2.next(); if (_i3.done) break; _ref6 = _i3.value; } var item = _ref6; listenersCollection.push(addRequestListener({ name: name, domain: domain, win: item }, listener)); } return { cancel: function() { for (var _iterator3 = listenersCollection, _isArray3 = Array.isArray(_iterator3), _i4 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator](); ;) { var _ref7; if (_isArray3) { if (_i4 >= _iterator3.length) break; _ref7 = _iterator3[_i4++]; } else { _i4 = _iterator3.next(); if (_i4.done) break; _ref7 = _i4.value; } _ref7.cancel(); } } }; } if (Array.isArray(domain)) { for (var _listenersCollection = [], _iterator4 = domain, _isArray4 = Array.isArray(_iterator4), _i5 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator](); ;) { var _ref8; if (_isArray4) { if (_i5 >= _iterator4.length) break; _ref8 = _iterator4[_i5++]; } else { _i5 = _iterator4.next(); if (_i5.done) break; _ref8 = _i5.value; } var _item = _ref8; _listenersCollection.push(addRequestListener({ name: name, win: win, domain: _item }, listener)); } return { cancel: function() { for (var _iterator5 = _listenersCollection, _isArray5 = Array.isArray(_iterator5), _i6 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator](); ;) { var _ref9; if (_isArray5) { if (_i6 >= _iterator5.length) break; _ref9 = _iterator5[_i6++]; } else { _i6 = _iterator5.next(); if (_i6.done) break; _ref9 = _i6.value; } _ref9.cancel(); } } }; } var existingListener = getRequestListener({ name: name, win: win, domain: domain }); win && win !== conf.b.WILDCARD || (win = global.a.WINDOW_WILDCARD); domain = domain || conf.b.WILDCARD; if (existingListener) throw win && domain ? new Error("Request listener already exists for " + name + " on domain " + domain.toString() + " for " + (win === global.a.WINDOW_WILDCARD ? "wildcard" : "specified") + " window") : win ? new Error("Request listener already exists for " + name + " for " + (win === global.a.WINDOW_WILDCARD ? "wildcard" : "specified") + " window") : domain ? new Error("Request listener already exists for " + name + " on domain " + domain.toString()) : new Error("Request listener already exists for " + name); var requestListeners = global.a.requestListeners, nameListeners = requestListeners[name]; if (!nameListeners) { nameListeners = new cross_domain_safe_weakmap_src.a(); requestListeners[name] = nameListeners; } var winListeners = nameListeners.get(win); if (!winListeners) { winListeners = {}; nameListeners.set(win, winListeners); } var strDomain = domain.toString(), regexListeners = winListeners[__DOMAIN_REGEX__], regexListener = void 0; if (Object(lib.e)(domain)) { if (!regexListeners) { regexListeners = []; winListeners[__DOMAIN_REGEX__] = regexListeners; } regexListener = { regex: domain, listener: listener }; regexListeners.push(regexListener); } else winListeners[strDomain] = listener; return { cancel: function() { if (winListeners) { delete winListeners[strDomain]; win && 0 === Object.keys(winListeners).length && nameListeners.delete(win); regexListener && regexListeners.splice(regexListeners.indexOf(regexListener, 1)); } } }; } function parseMessage(message) { var parsedMessage = void 0; try { parsedMessage = Object(lib.f)(message); } catch (err) { return; } if (parsedMessage && "object" === (void 0 === parsedMessage ? "undefined" : _typeof(parsedMessage)) && null !== parsedMessage) { parsedMessage = parsedMessage[conf.b.WINDOW_PROPS.POSTROBOT]; if (parsedMessage && "object" === (void 0 === parsedMessage ? "undefined" : _typeof(parsedMessage)) && null !== parsedMessage && parsedMessage.type && "string" == typeof parsedMessage.type && RECEIVE_MESSAGE_TYPES[parsedMessage.type]) return parsedMessage; } } function receiveMessage(event) { if (!window || window.closed) throw new Error("Message recieved in closed window"); try { if (!event.source) return; } catch (err) { return; } var source = event.source, origin = event.origin, data = event.data, message = parseMessage(data); if (message) { if (!message.sourceDomain || "string" != typeof message.sourceDomain) throw new Error("Expected message to have sourceDomain"); 0 !== message.sourceDomain.indexOf(conf.b.MOCK_PROTOCOL) && 0 !== message.sourceDomain.indexOf(conf.b.FILE_PROTOCOL) || (origin = message.sourceDomain); if (-1 === global.a.receivedMessages.indexOf(message.id)) { global.a.receivedMessages.push(message.id); var level = void 0; level = -1 !== conf.c.indexOf(message.name) || message.type === conf.b.POST_MESSAGE_TYPE.ACK ? "debug" : "error" === message.ack ? "error" : "info"; lib.i.logLevel(level, [ "\n\n\t", "#receive", message.type.replace(/^postrobot_message_/, ""), "::", message.name, "::", origin, "\n\n", message ]); if (!Object(src.isWindowClosed)(source) || message.fireAndForget) { message.data && (message.data = Object(lib.b)(source, origin, message.data)); RECEIVE_MESSAGE_TYPES[message.type](source, origin, message); } else lib.i.debug("Source window is closed - can not send " + message.type + " " + message.name); } } } function messageListener(event) { try { Object(lib.j)(event.source); } catch (err) { return; } var messageEvent = { source: event.source || event.sourceElement, origin: event.origin || event.originalEvent && event.originalEvent.origin, data: event.data }; try { __webpack_require__("./node_modules/post-robot/src/compat/index.js").emulateIERestrictions(messageEvent.source, window); } catch (err) { return; } receiveMessage(messageEvent); } function listenForMessages() { Object(lib.a)(window, "message", messageListener); } function request(options) { return zalgo_promise_src.a.try(function() { if (!options.name) throw new Error("Expected options.name"); var name = options.name, targetWindow = void 0, domain = void 0; if ("string" == typeof options.window) { var el = document.getElementById(options.window); if (!el) throw new Error("Expected options.window " + Object.prototype.toString.call(options.window) + " to be a valid element id"); if ("iframe" !== el.tagName.toLowerCase()) throw new Error("Expected options.window " + Object.prototype.toString.call(options.window) + " to be an iframe"); if (!el.contentWindow) throw new Error("Iframe must have contentWindow. Make sure it has a src attribute and is in the DOM."); targetWindow = el.contentWindow; } else if (options.window instanceof HTMLIFrameElement) { if ("iframe" !== options.window.tagName.toLowerCase()) throw new Error("Expected options.window " + Object.prototype.toString.call(options.window) + " to be an iframe"); if (options.window && !options.window.contentWindow) throw new Error("Iframe must have contentWindow. Make sure it has a src attribute and is in the DOM."); options.window && options.window.contentWindow && (targetWindow = options.window.contentWindow); } else targetWindow = options.window; if (!targetWindow) throw new Error("Expected options.window to be a window object, iframe, or iframe element id."); var win = targetWindow; domain = options.domain || conf.b.WILDCARD; var hash = options.name + "_" + Object(lib.q)(); if (Object(src.isWindowClosed)(win)) throw new Error("Target window is closed"); var hasResult = !1, requestPromises = global.a.requestPromises.get(win); if (!requestPromises) { requestPromises = []; global.a.requestPromises.set(win, requestPromises); } var requestPromise = zalgo_promise_src.a.try(function() { if (Object(src.isAncestor)(window, win)) return Object(lib.k)(win, options.timeout || conf.a.CHILD_WINDOW_TIMEOUT); }).then(function() { var _ref = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, origin = _ref.origin; if (Object(lib.e)(domain) && !origin) return Object(lib.n)(win); }).then(function() { var _ref2 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, origin = _ref2.origin; if (Object(lib.e)(domain)) { if (!Object(src.matchDomain)(domain, origin)) throw new Error("Remote window domain " + origin + " does not match regex: " + domain.toString()); domain = origin; } if ("string" != typeof domain && !Array.isArray(domain)) throw new TypeError("Expected domain to be a string or array"); var actualDomain = domain; return new zalgo_promise_src.a(function(resolve, reject) { var responseListener = void 0; if (!options.fireAndForget) { responseListener = { name: name, window: win, domain: actualDomain, respond: function(err, result) { if (!err) { hasResult = !0; requestPromises.splice(requestPromises.indexOf(requestPromise, 1)); } err ? reject(err) : resolve(result); } }; addResponseListener(hash, responseListener); } sendMessage(win, { type: conf.b.POST_MESSAGE_TYPE.REQUEST, hash: hash, name: name, data: options.data, fireAndForget: options.fireAndForget }, actualDomain).catch(reject); if (options.fireAndForget) return resolve(); var ackTimeout = conf.a.ACK_TIMEOUT, resTimeout = options.timeout || conf.a.RES_TIMEOUT, cycleTime = 100, cycle = function cycle() { if (!hasResult) { if (Object(src.isWindowClosed)(win)) return reject(responseListener.ack ? new Error("Window closed for " + name + " before response") : new Error("Window closed for " + name + " before ack")); ackTimeout -= cycleTime; resTimeout -= cycleTime; if (responseListener.ack) { if (resTimeout === 1 / 0) return; cycleTime = Math.min(resTimeout, 2e3); } else { if (ackTimeout <= 0) return reject(new Error("No ack for postMessage " + name + " in " + Object(src.getDomain)() + " in " + conf.a.ACK_TIMEOUT + "ms")); if (resTimeout <= 0) return reject(new Error("No response for postMessage " + name + " in " + Object(src.getDomain)() + " in " + (options.timeout || conf.a.RES_TIMEOUT) + "ms")); } setTimeout(cycle, cycleTime); } }; setTimeout(cycle, cycleTime); }); }); requestPromise.catch(function() { markResponseListenerErrored(hash); deleteResponseListener(hash); }); requestPromises.push(requestPromise); return requestPromise; }); } function _send(window, name, data, options) { options = options || {}; options.window = window; options.name = name; options.data = data; return request(options); } function sendToParent(name, data, options) { var win = Object(src.getAncestor)(); return win ? _send(win, name, data, options) : new zalgo_promise_src.a(function(resolve, reject) { return reject(new Error("Window does not have a parent")); }); } function client() { var options = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; if (!options.window) throw new Error("Expected options.window"); var win = options.window; return { send: function(name, data) { return _send(win, name, data, options); } }; } function listen(options) { if (!options.name) throw new Error("Expected options.name"); if (!options.handler) throw new Error("Expected options.handler"); var name = options.name, win = options.window, domain = options.domain, listenerOptions = { handler: options.handler, handleError: options.errorHandler || function(err) { throw err; }, window: win, domain: domain || conf.b.WILDCARD, name: name }, requestListener = addRequestListener({ name: name, win: win, domain: domain }, listenerOptions); if (options.once) { var _handler = listenerOptions.handler; listenerOptions.handler = Object(lib.l)(function() { requestListener.cancel(); return _handler.apply(this, arguments); }); } if (listenerOptions.window && options.errorOnClose) var interval = Object(lib.m)(function() { if (win && "object" === (void 0 === win ? "undefined" : server__typeof(win)) && Object(src.isWindowClosed)(win)) { interval.cancel(); listenerOptions.handleError(new Error("Post message target window is closed")); } }, 50); return { cancel: function() { requestListener.cancel(); } }; } function _on(name, options, handler) { if ("function" == typeof options) { handler = options; options = {}; } options = options || {}; options.name = name; options.handler = handler || options.handler; return listen(options); } function once(name) { var options = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, handler = arguments[2]; if ("function" == typeof options) { handler = options; options = {}; } options = options || {}; handler = handler || options.handler; var errorHandler = options.errorHandler, promise = new zalgo_promise_src.a(function(resolve, reject) { options = options || {}; options.name = name; options.once = !0; options.handler = function(event) { resolve(event); if (handler) return handler(event); }; options.errorHandler = function(err) { reject(err); if (errorHandler) return errorHandler(err); }; }), onceListener = listen(options); promise.cancel = onceListener.cancel; return promise; } function server_listener() { var options = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}; return { on: function(name, handler) { return _on(name, options, handler); } }; } function disable() { delete window[conf.b.WINDOW_PROPS.POSTROBOT]; window.removeEventListener("message", messageListener); } function cleanUpWindow(win) { var requestPromises = global.a.requestPromises.get(win); if (requestPromises) for (var _iterator = requestPromises, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); ;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var promise = _ref; promise.reject(new Error("No response from window - cleaned up")); } global.a.popupWindowsByWin && global.a.popupWindowsByWin.delete(win); global.a.remoteWindows && global.a.remoteWindows.delete(win); global.a.requestPromises.delete(win); global.a.methods.delete(win); global.a.readyPromises.delete(win); } function init() { if (!global.a.initialized) { listenForMessages(); __webpack_require__("./node_modules/post-robot/src/bridge/index.js").openTunnelToOpener(); Object(lib.d)(); Object(lib.h)({ on: _on, send: _send }); } global.a.initialized = !0; } Object.defineProperty(__webpack_exports__, "__esModule", { value: !0 }); var interface_namespaceObject = {}; __webpack_require__.d(interface_namespaceObject, "openBridge", function() { return bridge.openBridge; }); __webpack_require__.d(interface_namespaceObject, "linkUrl", function() { return bridge.linkUrl; }); __webpack_require__.d(interface_namespaceObject, "isBridge", function() { return bridge.isBridge; }); __webpack_require__.d(interface_namespaceObject, "needsBridge", function() { return bridge.needsBridge; }); __webpack_require__.d(interface_namespaceObject, "needsBridgeForBrowser", function() { return bridge.needsBridgeForBrowser; }); __webpack_require__.d(interface_namespaceObject, "hasBridge", function() { return bridge.hasBridge; }); __webpack_require__.d(interface_namespaceObject, "needsBridgeForWin", function() { return bridge.needsBridgeForWin; }); __webpack_require__.d(interface_namespaceObject, "needsBridgeForDomain", function() { return bridge.needsBridgeForDomain; }); __webpack_require__.d(interface_namespaceObject, "openTunnelToOpener", function() { return bridge.openTunnelToOpener; }); __webpack_require__.d(interface_namespaceObject, "destroyBridges", function() { return bridge.destroyBridges; }); var src_interface_namespaceObject = {}; __webpack_require__.d(src_interface_namespaceObject, "cleanUpWindow", function() { return cleanUpWindow; }); __webpack_require__.d(src_interface_namespaceObject, "Promise", function() { return zalgo_promise_src.a; }); __webpack_require__.d(src_interface_namespaceObject, "bridge", function() { return interface_bridge; }); __webpack_require__.d(src_interface_namespaceObject, "init", function() { return init; }); __webpack_require__.d(src_interface_namespaceObject, "parent", function() { return public_parent; }); __webpack_require__.d(src_interface_namespaceObject, "send", function() { return _send; }); __webpack_require__.d(src_interface_namespaceObject, "request", function() { return request; }); __webpack_require__.d(src_interface_namespaceObject, "sendToParent", function() { return sendToParent; }); __webpack_require__.d(src_interface_namespaceObject, "client", function() { return client; }); __webpack_require__.d(src_interface_namespaceObject, "on", function() { return _on; }); __webpack_require__.d(src_interface_namespaceObject, "listen", function() { return listen; }); __webpack_require__.d(src_interface_namespaceObject, "once", function() { return once; }); __webpack_require__.d(src_interface_namespaceObject, "listener", function() { return server_listener; }); __webpack_require__.d(src_interface_namespaceObject, "CONFIG", function() { return conf.a; }); __webpack_require__.d(src_interface_namespaceObject, "CONSTANTS", function() { return conf.b; }); __webpack_require__.d(src_interface_namespaceObject, "disable", function() { return disable; }); var lib = __webpack_require__("./node_modules/post-robot/src/lib/index.js"), src = __webpack_require__("./node_modules/cross-domain-utils/src/index.js"), conf = __webpack_require__("./node_modules/post-robot/src/conf/index.js"), global = __webpack_require__("./node_modules/post-robot/src/global.js"), zalgo_promise_src = __webpack_require__("./node_modules/zalgo-promise/src/index.js"), SEND_MESSAGE_STRATEGIES = {}; SEND_MESSAGE_STRATEGIES[conf.b.SEND_STRATEGIES.POST_MESSAGE] = function(win, serializedMessage, domain) { try { __webpack_require__("./node_modules/post-robot/src/compat/index.js").emulateIERestrictions(window, win); } catch (err) { return; } var domains = void 0; domains = Array.isArray(domain) ? domain : "string" == typeof domain ? [ domain ] : [ conf.b.WILDCARD ]; domains = domains.map(function(dom) { if (0 === dom.indexOf(conf.b.MOCK_PROTOCOL)) { if (window.location.protocol === conf.b.FILE_PROTOCOL) return conf.b.WILDCARD; if (!Object(src.isActuallySameDomain)(win)) throw new Error("Attempting to send messsage to mock domain " + dom + ", but window is actually cross-domain"); return Object(src.getActualDomain)(win); } return 0 === dom.indexOf(conf.b.FILE_PROTOCOL) ? conf.b.WILDCARD : dom; }); domains.forEach(function(dom) { return win.postMessage(serializedMessage, dom); }); }; var _require = __webpack_require__("./node_modules/post-robot/src/bridge/index.js"), sendBridgeMessage = _require.sendBridgeMessage, needsBridgeForBrowser = _require.needsBridgeForBrowser, isBridge = _require.isBridge; SEND_MESSAGE_STRATEGIES[conf.b.SEND_STRATEGIES.BRIDGE] = function(win, serializedMessage, domain) { if (needsBridgeForBrowser() || isBridge()) { if (Object(src.isSameDomain)(win)) throw new Error("Post message through bridge disabled between same domain windows"); if (!1 !== Object(src.isSameTopWindow)(window, win)) throw new Error("Can only use bridge to communicate between two different windows, not between frames"); return sendBridgeMessage(win, serializedMessage, domain); } }; SEND_MESSAGE_STRATEGIES[conf.b.SEND_STRATEGIES.GLOBAL] = function(win, serializedMessage) { if (needsBridgeForBrowser()) { if (!Object(src.isSameDomain)(win)) throw new Error("Post message through global disabled between different domain windows"); if (!1 !== Object(src.isSameTopWindow)(window, win)) throw new Error("Can only use global to communicate between two different windows, not between frames"); var foreignGlobal = win[conf.b.WINDOW_PROPS.POSTROBOT]; if (!foreignGlobal) throw new Error("Can not find postRobot global on foreign window"); return foreignGlobal.receiveMessage({ source: window, origin: Object(src.getDomain)(), data: serializedMessage }); } }; var _extends = Object.assign || function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); } return target; }, cross_domain_safe_weakmap_src = __webpack_require__("./node_modules/cross-domain-safe-weakmap/src/index.js"); global.a.responseListeners = global.a.responseListeners || {}; global.a.requestListeners = global.a.requestListeners || {}; global.a.WINDOW_WILDCARD = global.a.WINDOW_WILDCARD || new function() {}(); global.a.erroredResponseListeners = global.a.erroredResponseListeners || {}; var _RECEIVE_MESSAGE_TYPE, __DOMAIN_REGEX__ = "__domain_regex__", types__extends = Object.assign || function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); } return target; }, RECEIVE_MESSAGE_TYPES = (_RECEIVE_MESSAGE_TYPE = {}, _RECEIVE_MESSAGE_TYPE[conf.b.POST_MESSAGE_TYPE.ACK] = function(source, origin, message) { if (!isResponseListenerErrored(message.hash)) { var options = getResponseListener(message.hash); if (!options) throw new Error("No handler found for post message ack for message: " + message.name + " from " + origin + " in " + window.location.protocol + "//" + window.location.host + window.location.pathname); if (!Object(src.matchDomain)(options.domain, origin)) throw new Error("Ack origin " + origin + " does not match domain " + options.domain.toString()); options.ack = !0; } }, _RECEIVE_MESSAGE_TYPE[conf.b.POST_MESSAGE_TYPE.REQUEST] = function(source, origin, message) { function respond(data) { return message.fireAndForget || Object(src.isWindowClosed)(source) ? zalgo_promise_src.a.resolve() : sendMessage(source, types__extends({ target: message.originalSource, hash: message.hash, name: message.name }, data), origin); } var options = getRequestListener({ name: message.name, win: source, domain: origin }); return zalgo_promise_src.a.all([ respond({ type: conf.b.POST_MESSAGE_TYPE.ACK }), zalgo_promise_src.a.try(function() { if (!options) throw new Error("No handler found for post message: " + message.name + " from " + origin + " in " + window.location.protocol + "//" + window.location.host + window.location.pathname); if (!Object(src.matchDomain)(options.domain, origin)) throw new Error("Request origin " + origin + " does not match domain " + options.domain.toString()); var data = message.data; return options.handler({ source: source, origin: origin, data: data }); }).then(function(data) { return respond({ type: conf.b.POST_MESSAGE_TYPE.RESPONSE, ack: conf.b.POST_MESSAGE_ACK.SUCCESS, data: data }); }, function(err) { var error = Object(lib.p)(err).replace(/^Error: /, ""), code = err.code; return respond({ type: conf.b.POST_MESSAGE_TYPE.RESPONSE, ack: conf.b.POST_MESSAGE_ACK.ERROR, error: error, code: code }); }) ]).then(lib.j).catch(function(err) { if (options && options.handleError) return options.handleError(err); lib.i.error(Object(lib.p)(err)); }); }, _RECEIVE_MESSAGE_TYPE[conf.b.POST_MESSAGE_TYPE.RESPONSE] = function(source, origin, message) { if (!isResponseListenerErrored(message.hash)) { var options = getResponseListener(message.hash); if (!options) throw new Error("No handler found for post message response for message: " + message.name + " from " + origin + " in " + window.location.protocol + "//" + window.location.host + window.location.pathname); if (!Object(src.matchDomain)(options.domain, origin)) throw new Error("Response origin " + origin + " does not match domain " + Object(src.stringifyDomainPattern)(options.domain)); deleteResponseListener(message.hash); if (message.ack === conf.b.POST_MESSAGE_ACK.ERROR) { var err = new Error(message.error); message.code && (err.code = message.code); return options.respond(err, null); } if (message.ack === conf.b.POST_MESSAGE_ACK.SUCCESS) { var data = message.data || message.response; return options.respond(null, { source: source, origin: origin, data: data }); } } }, _RECEIVE_MESSAGE_TYPE), _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj; } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; global.a.receivedMessages = global.a.receivedMessages || []; global.a.receiveMessage = receiveMessage; global.a.requestPromises = global.a.requestPromises || new cross_domain_safe_weakmap_src.a(); global.a.send = _send; var server__typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj; } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; global.a.on = _on; var public_parent = Object(src.getAncestor)(), bridge = __webpack_require__("./node_modules/post-robot/src/bridge/index.js"), interface_bridge = interface_namespaceObject; init(); __webpack_require__.d(__webpack_exports__, "cleanUpWindow", function() { return cleanUpWindow; }); __webpack_require__.d(__webpack_exports__, "Promise", function() { return zalgo_promise_src.a; }); __webpack_require__.d(__webpack_exports__, "bridge", function() { return interface_bridge; }); __webpack_require__.d(__webpack_exports__, "init", function() { return init; }); __webpack_require__.d(__webpack_exports__, "parent", function() { return public_parent; }); __webpack_require__.d(__webpack_exports__, "send", function() { return _send; }); __webpack_require__.d(__webpack_exports__, "request", function() { return request; }); __webpack_require__.d(__webpack_exports__, "sendToParent", function() { return sendToParent; }); __webpack_require__.d(__webpack_exports__, "client", function() { return client; }); __webpack_require__.d(__webpack_exports__, "on", function() { return _on; }); __webpack_require__.d(__webpack_exports__, "listen", function() { return listen; }); __webpack_require__.d(__webpack_exports__, "once", function() { return once; }); __webpack_require__.d(__webpack_exports__, "listener", function() { return server_listener; }); __webpack_require__.d(__webpack_exports__, "CONFIG", function() { return conf.a; }); __webpack_require__.d(__webpack_exports__, "CONSTANTS", function() { return conf.b; }); __webpack_require__.d(__webpack_exports__, "disable", function() { return disable; }); __webpack_exports__.default = src_interface_namespaceObject; }, "./node_modules/post-robot/src/lib/index.js": function(module, __webpack_exports__, __webpack_require__) { "use strict"; function stringifyError(err) { var level = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1; if (level >= 3) return "stringifyError stack overflow"; try { if (!err) return ""; if ("string" == typeof err) return err; if (err instanceof Error) { var stack = err && err.stack, message = err && err.message; if (stack && message) return -1 !== stack.indexOf(message) ? stack : message + "\n" + stack; if (stack) return stack; if (message) return message; } return "function" == typeof err.toString ? err.toString() : Object.prototype.toString.call(err); } catch (newErr) { return "Error while stringifying error: " + stringifyError(newErr, level + 1); } } function noop() {} function addEventListener(obj, event, handler) { obj.addEventListener ? obj.addEventListener(event, handler) : obj.attachEvent("on" + event, handler); return { cancel: function() { obj.removeEventListener ? obj.removeEventListener(event, handler) : obj.detachEvent("on" + event, handler); } }; } function uniqueID() { var chars = "0123456789abcdef"; return "xxxxxxxxxx".replace(/./g, function() { return chars.charAt(Math.floor(Math.random() * chars.length)); }); } function eachArray(item, callback) { for (var i = 0; i < item.length; i++) callback(item[i], i); } function eachObject(item, callback) { for (var _key in item) item.hasOwnProperty(_key) && callback(item[_key], _key); } function each(item, callback) { Array.isArray(item) ? eachArray(item, callback) : "object" === (void 0 === item ? "undefined" : _typeof(item)) && null !== item && eachObject(item, callback); } function replaceObject(item, callback) { var depth = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 1; if (depth >= 100) throw new Error("Self-referential object passed, or object contained too many layers"); var newobj = void 0; if ("object" !== (void 0 === item ? "undefined" : _typeof(item)) || null === item || Array.isArray(item)) { if (!Array.isArray(item)) throw new TypeError("Invalid type: " + (void 0 === item ? "undefined" : _typeof(item))); newobj = []; } else newobj = {}; each(item, function(childItem, key) { var result = callback(childItem, key); void 0 !== result ? newobj[key] = result : "object" === (void 0 === childItem ? "undefined" : _typeof(childItem)) && null !== childItem ? newobj[key] = replaceObject(childItem, callback, depth + 1) : newobj[key] = childItem; }); return newobj; } function safeInterval(method, time) { function runInterval() { timeout = setTimeout(runInterval, time); method.call(); } var timeout = void 0; timeout = setTimeout(runInterval, time); return { cancel: function() { clearTimeout(timeout); } }; } function isRegex(item) { return "[object RegExp]" === Object.prototype.toString.call(item); } function getWindowType() { return Object(cross_domain_utils_src.isPopup)() ? conf.b.WINDOW_TYPES.POPUP : Object(cross_domain_utils_src.isIframe)() ? conf.b.WINDOW_TYPES.IFRAME : conf.b.WINDOW_TYPES.FULLPAGE; } function jsonStringify(obj, replacer, indent) { var objectToJSON = void 0, arrayToJSON = void 0; try { if ("{}" !== JSON.stringify({})) { objectToJSON = Object.prototype.toJSON; delete Object.prototype.toJSON; } if ("{}" !== JSON.stringify({})) throw new Error("Can not correctly serialize JSON objects"); if ("[]" !== JSON.stringify([])) { arrayToJSON = Array.prototype.toJSON; delete Array.prototype.toJSON; } if ("[]" !== JSON.stringify([])) throw new Error("Can not correctly serialize JSON objects"); } catch (err) { throw new Error("Can not repair JSON.stringify: " + err.message); } var result = JSON.stringify.call(this, obj, replacer, indent); try { objectToJSON && (Object.prototype.toJSON = objectToJSON); arrayToJSON && (Array.prototype.toJSON = arrayToJSON); } catch (err) { throw new Error("Can not repair JSON.stringify: " + err.message); } return result; } function jsonParse(item) { return JSON.parse(item); } function isSerialized(item, type) { return "object" === (void 0 === item ? "undefined" : serialize__typeof(item)) && null !== item && item.__type__ === type; } function serializeMethod(destination, domain, method, name) { var id = uniqueID(), methods = global.a.methods.get(destination); if (!methods) { methods = {}; global.a.methods.set(destination, methods); } methods[id] = { domain: domain, method: method }; return { __type__: conf.b.SERIALIZATION_TYPES.METHOD, __id__: id, __name__: name }; } function serializeError(err) { return { __type__: conf.b.SERIALIZATION_TYPES.ERROR, __message__: stringifyError(err), __code__: err.code }; } function serializePromise(destination, domain, promise, name) { return { __type__: conf.b.SERIALIZATION_TYPES.PROMISE, __then__: serializeMethod(destination, domain, function(resolve, reject) { return promise.then(resolve, reject); }, name + ".then") }; } function serializeZalgoPromise(destination, domain, promise, name) { return { __type__: conf.b.SERIALIZATION_TYPES.ZALGO_PROMISE, __then__: serializeMethod(destination, domain, function(resolve, reject) { return promise.then(resolve, reject); }, name + ".then") }; } function serializeRegex(regex) { return { __type__: conf.b.SERIALIZATION_TYPES.REGEX, __source__: regex.source }; } function serializeMethods(destination, domain, obj) { return replaceObject({ obj: obj }, function(item, key) { return "function" == typeof item ? serializeMethod(destination, domain, item, key.toString()) : item instanceof Error ? serializeError(item) : window.Promise && item instanceof window.Promise ? serializePromise(destination, domain, item, key.toString()) : zalgo_promise_src.a.isPromise(item) ? serializeZalgoPromise(destination, domain, item, key.toString()) : isRegex(item) ? serializeRegex(item) : void 0; }).obj; } function deserializeMethod(source, origin, obj) { function wrapper() { var args = Array.prototype.slice.call(arguments); log.debug("Call foreign method", obj.__name__, args); return global.a.send(source, conf.b.POST_MESSAGE_NAMES.METHOD, { id: obj.__id__, name: obj.__name__, args: args }, { domain: origin, timeout: 1 / 0 }).then(function(_ref2) { var data = _ref2.data; log.debug("Got foreign method result", obj.__name__, data.result); return data.result; }, function(err) { log.debug("Got foreign method error", stringifyError(err)); throw err; }); } wrapper.__name__ = obj.__name__; wrapper.__xdomain__ = !0; wrapper.source = source; wrapper.origin = origin; return wrapper; } function deserializeError(source, origin, obj) { var err = new Error(obj.__message__); obj.__code__ && (err.code = obj.__code__); return err; } function deserializeZalgoPromise(source, origin, prom) { return new zalgo_promise_src.a(function(resolve, reject) { return deserializeMethod(source, origin, prom.__then__)(resolve, reject); }); } function deserializePromise(source, origin, prom) { return window.Promise ? new window.Promise(function(resolve, reject) { return deserializeMethod(source, origin, prom.__then__)(resolve, reject); }) : deserializeZalgoPromise(source, origin, prom); } function deserializeRegex(source, origin, item) { return new RegExp(item.__source__); } function deserializeMethods(source, origin, obj) { return replaceObject({ obj: obj }, function(item) { if ("object" === (void 0 === item ? "undefined" : serialize__typeof(item)) && null !== item) return isSerialized(item, conf.b.SERIALIZATION_TYPES.METHOD) ? deserializeMethod(source, origin, item) : isSerialized(item, conf.b.SERIALIZATION_TYPES.ERROR) ? deserializeError(source, origin, item) : isSerialized(item, conf.b.SERIALIZATION_TYPES.PROMISE) ? deserializePromise(source, origin, item) : isSerialized(item, conf.b.SERIALIZATION_TYPES.ZALGO_PROMISE) ? deserializeZalgoPromise(source, origin, item) : isSerialized(item, conf.b.SERIALIZATION_TYPES.REGEX) ? deserializeRegex(source, origin, item) : void 0; }).obj; } function onHello(handler) { global.a.on(conf.b.POST_MESSAGE_NAMES.HELLO, { domain: conf.b.WILDCARD }, function(_ref) { var source = _ref.source, origin = _ref.origin; return handler({ source: source, origin: origin }); }); } function sayHello(win) { return global.a.send(win, conf.b.POST_MESSAGE_NAMES.HELLO, {}, { domain: conf.b.WILDCARD, timeout: 1 / 0 }).then(function(_ref2) { return { origin: _ref2.origin }; }); } function initOnReady() { onHello(function(_ref3) { var source = _ref3.source, origin = _ref3.origin, promise = global.a.readyPromises.get(source) || new zalgo_promise_src.a(); promise.resolve({ origin: origin }); global.a.readyPromises.set(source, promise); }); var parent = Object(cross_domain_utils_src.getAncestor)(); parent && sayHello(parent).catch(function(err) { log.debug(stringifyError(err)); }); } function onChildWindowReady(win) { var timeout = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 5e3, name = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "Window", promise = global.a.readyPromises.get(win); if (promise) return promise; promise = new zalgo_promise_src.a(); global.a.readyPromises.set(win, promise); -1 !== timeout && setTimeout(function() { return promise.reject(new Error(name + " did not load after " + timeout + "ms")); }, timeout); return promise; } var src = __webpack_require__("./node_modules/cross-domain-safe-weakmap/src/index.js"), cross_domain_utils_src = __webpack_require__("./node_modules/cross-domain-utils/src/index.js"), conf = __webpack_require__("./node_modules/post-robot/src/conf/index.js"), _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj; } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, once = function(method) { if (!method) return method; var called = !1; return function() { if (!called) { called = !0; return method.apply(this, arguments); } }; }, util_weakMapMemoize = function(method) { var weakmap = new src.a(); return function(arg) { var result = weakmap.get(arg); if (void 0 !== result) return result; result = method.call(this, arg); void 0 !== result && weakmap.set(arg, result); return result; }; }, log__typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj; } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, LOG_LEVELS = [ "debug", "info", "warn", "error" ]; Function.prototype.bind && window.console && "object" === log__typeof(console.log) && [ "log", "info", "warn", "error" ].forEach(function(method) { console[method] = this.bind(console[method], console); }, Function.prototype.call); var log = { clearLogs: function() { window.console && window.console.clear && window.console.clear(); if (conf.a.LOG_TO_PAGE) { var container = document.getElementById("postRobotLogs"); container && container.parentNode && container.parentNode.removeChild(container); } }, writeToPage: function(level, args) { setTimeout(function() { var container = document.getElementById("postRobotLogs"); if (!container) { container = document.createElement("div"); container.id = "postRobotLogs"; container.style.cssText = "width: 800px; font-family: monospace; white-space: pre-wrap;"; document.body && document.body.appendChild(container); } var el = document.createElement("div"), date = new Date().toString().split(" ")[4], payload = Array.prototype.slice.call(args).map(function(item) { if ("string" == typeof item) return item; if (!item) return Object.prototype.toString.call(item); var json = void 0; try { json = jsonStringify(item, null, 2); } catch (err) { json = "[object]"; } return "\n\n" + json + "\n\n"; }).join(" "), msg = date + " " + level + " " + payload; el.innerHTML = msg; var color = { log: "#ddd", warn: "orange", error: "red", info: "blue", debug: "#aaa" }[level]; el.style.cssText = "margin-top: 10px; color: " + color + ";"; container.childNodes.length ? container.insertBefore(el, container.childNodes[0]) : container.appendChild(el); }); }, logLevel: function(level, args) { setTimeout(function() { try { var logLevel = window.LOG_LEVEL || conf.a.LOG_LEVEL; if ("disabled" === logLevel || LOG_LEVELS.indexOf(level) < LOG_LEVELS.indexOf(logLevel)) return; args = Array.prototype.slice.call(args); args.unshift("" + window.location.host + window.location.pathname); args.unshift("::"); args.unshift("" + getWindowType().toLowerCase()); args.unshift("[post-robot]"); conf.a.LOG_TO_PAGE && log.writeToPage(level, args); if (!window.console) return; window.console[level] || (level = "log"); if (!window.console[level]) return; window.console[level].apply(window.console, args); } catch (err) {} }, 1); }, debug: function() { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; log.logLevel("debug", args); }, info: function() { for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) args[_key2] = arguments[_key2]; log.logLevel("info", args); }, warn: function() { for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) args[_key3] = arguments[_key3]; log.logLevel("warn", args); }, error: function() { for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) args[_key4] = arguments[_key4]; log.logLevel("error", args); } }, zalgo_promise_src = __webpack_require__("./node_modules/zalgo-promise/src/index.js"), global = __webpack_require__("./node_modules/post-robot/src/global.js"), serialize__typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj; } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; global.a.methods = global.a.methods || new src.a(); var listenForMethods = once(function() { global.a.on(conf.b.POST_MESSAGE_NAMES.METHOD, { origin: conf.b.WILDCARD }, function(_ref) { var source = _ref.source, origin = _ref.origin, data = _ref.data, methods = global.a.methods.get(source); if (!methods) throw new Error("Could not find any methods this window has privileges to call"); var meth = methods[data.id]; if (!meth) throw new Error("Could not find method with id: " + data.id); if (!Object(cross_domain_utils_src.matchDomain)(meth.domain, origin)) throw new Error("Method domain " + meth.domain + " does not match origin " + origin); log.debug("Call local method", data.name, data.args); return zalgo_promise_src.a.try(function() { return meth.method.apply({ source: source, origin: origin, data: data }, data.args); }).then(function(result) { return { result: result, id: data.id, name: data.name }; }); }); }); global.a.readyPromises = global.a.readyPromises || new src.a(); __webpack_require__.d(__webpack_exports__, "p", function() { return stringifyError; }); __webpack_require__.d(__webpack_exports__, "l", function() { return once; }); __webpack_require__.d(__webpack_exports__, "j", function() { return noop; }); __webpack_require__.d(__webpack_exports__, "a", function() { return addEventListener; }); __webpack_require__.d(__webpack_exports__, "q", function() { return uniqueID; }); __webpack_require__.d(__webpack_exports__, !1, function() { return eachArray; }); __webpack_require__.d(__webpack_exports__, !1, function() { return eachObject; }); __webpack_require__.d(__webpack_exports__, !1, function() { return each; }); __webpack_require__.d(__webpack_exports__, !1, function() { return replaceObject; }); __webpack_require__.d(__webpack_exports__, "m", function() { return safeInterval; }); __webpack_require__.d(__webpack_exports__, "e", function() { return isRegex; }); __webpack_require__.d(__webpack_exports__, "r", function() { return util_weakMapMemoize; }); __webpack_require__.d(__webpack_exports__, "c", function() { return getWindowType; }); __webpack_require__.d(__webpack_exports__, "g", function() { return jsonStringify; }); __webpack_require__.d(__webpack_exports__, "f", function() { return jsonParse; }); __webpack_require__.d(__webpack_exports__, "i", function() { return log; }); __webpack_require__.d(__webpack_exports__, "h", function() { return listenForMethods; }); __webpack_require__.d(__webpack_exports__, !1, function() { return serializeMethod; }); __webpack_require__.d(__webpack_exports__, "o", function() { return serializeMethods; }); __webpack_require__.d(__webpack_exports__, !1, function() { return deserializeMethod; }); __webpack_require__.d(__webpack_exports__, !1, function() { return deserializeError; }); __webpack_require__.d(__webpack_exports__, !1, function() { return deserializeZalgoPromise; }); __webpack_require__.d(__webpack_exports__, !1, function() { return deserializePromise; }); __webpack_require__.d(__webpack_exports__, !1, function() { return deserializeRegex; }); __webpack_require__.d(__webpack_exports__, "b", function() { return deserializeMethods; }); __webpack_require__.d(__webpack_exports__, !1, function() { return onHello; }); __webpack_require__.d(__webpack_exports__, "n", function() { return sayHello; }); __webpack_require__.d(__webpack_exports__, "d", function() { return initOnReady; }); __webpack_require__.d(__webpack_exports__, "k", function() { return onChildWindowReady; }); }, "./node_modules/process/browser.js": function(module, exports) { function defaultSetTimout() { throw new Error("setTimeout has not been defined"); } function defaultClearTimeout() { throw new Error("clearTimeout has not been defined"); } function runTimeout(fun) { if (cachedSetTimeout === setTimeout) return setTimeout(fun, 0); if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { cachedSetTimeout = setTimeout; return setTimeout(fun, 0); } try { return cachedSetTimeout(fun, 0); } catch (e) { try { return cachedSetTimeout.call(null, fun, 0); } catch (e) { return cachedSetTimeout.call(this, fun, 0); } } } function runClearTimeout(marker) { if (cachedClearTimeout === clearTimeout) return clearTimeout(marker); if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { cachedClearTimeout = clearTimeout; return clearTimeout(marker); } try { return cachedClearTimeout(marker); } catch (e) { try { return cachedClearTimeout.call(null, marker); } catch (e) { return cachedClearTimeout.call(this, marker); } } } function cleanUpNextTick() { if (draining && currentQueue) { draining = !1; currentQueue.length ? queue = currentQueue.concat(queue) : queueIndex = -1; queue.length && drainQueue(); } } function drainQueue() { if (!draining) { var timeout = runTimeout(cleanUpNextTick); draining = !0; for (var len = queue.length; len; ) { currentQueue = queue; queue = []; for (;++queueIndex < len; ) currentQueue && currentQueue[queueIndex].run(); queueIndex = -1; len = queue.length; } currentQueue = null; draining = !1; runClearTimeout(timeout); } } function Item(fun, array) { this.fun = fun; this.array = array; } function noop() {} var cachedSetTimeout, cachedClearTimeout, process = module.exports = {}; !function() { try { cachedSetTimeout = "function" == typeof setTimeout ? setTimeout : defaultSetTimout; } catch (e) { cachedSetTimeout = defaultSetTimout; } try { cachedClearTimeout = "function" == typeof clearTimeout ? clearTimeout : defaultClearTimeout; } catch (e) { cachedClearTimeout = defaultClearTimeout; } }(); var currentQueue, queue = [], draining = !1, queueIndex = -1; process.nextTick = function(fun) { var args = new Array(arguments.length - 1); if (arguments.length > 1) for (var i = 1; i < arguments.length; i++) args[i - 1] = arguments[i]; queue.push(new Item(fun, args)); 1 !== queue.length || draining || runTimeout(drainQueue); }; Item.prototype.run = function() { this.fun.apply(null, this.array); }; process.title = "browser"; process.browser = !0; process.env = {}; process.argv = []; process.version = ""; process.versions = {}; process.on = noop; process.addListener = noop; process.once = noop; process.off = noop; process.removeListener = noop; process.removeAllListeners = noop; process.emit = noop; process.prependListener = noop; process.prependOnceListener = noop; process.listeners = function(name) { return []; }; process.binding = function(name) { throw new Error("process.binding is not supported"); }; process.cwd = function() { return "/"; }; process.chdir = function(dir) { throw new Error("process.chdir is not supported"); }; process.umask = function() { return 0; }; }, "./node_modules/webpack/buildin/amd-define.js": function(module, exports) { module.exports = function() { throw new Error("define cannot be used indirect"); }; }, "./node_modules/webpack/buildin/amd-options.js": function(module, exports) { (function(__webpack_amd_options__) { module.exports = __webpack_amd_options__; }).call(exports, {}); }, "./node_modules/webpack/buildin/global.js": function(module, exports) { var g, _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj; } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; g = function() { return this; }(); try { g = g || Function("return this")() || (0, eval)("this"); } catch (e) { "object" === ("undefined" == typeof window ? "undefined" : _typeof(window)) && (g = window); } module.exports = g; }, "./node_modules/webpack/buildin/module.js": function(module, exports) { module.exports = function(module) { if (!module.webpackPolyfill) { module.deprecate = function() {}; module.paths = []; module.children || (module.children = []); Object.defineProperty(module, "loaded", { enumerable: !0, get: function() { return module.l; } }); Object.defineProperty(module, "id", { enumerable: !0, get: function() { return module.i; } }); module.webpackPolyfill = 1; } return module; }; }, "./node_modules/xcomponent/src/component/base.js": function(module, __webpack_exports__, __webpack_require__) { "use strict"; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); } function cleanup(obj) { var tasks = [], cleaned = !1; return { set: function(name, item) { if (cleaned) return item; obj[name] = item; this.register(function() { delete obj[name]; }); return item; }, register: function(name, method) { if ("function" == typeof name) { method = name; name = ""; } if ("function" != typeof method) throw new TypeError("Expected to be passed function to clean.register"); cleaned ? method() : tasks.push({ complete: !1, name: name, run: function() { if (!this.complete) { this.complete = !0; method && method(); } } }); }, hasTasks: function() { return Boolean(tasks.filter(function(item) { return !item.complete; }).length); }, all: function() { var results = []; cleaned = !0; for (;tasks.length; ) results.push(tasks.pop().run()); return __WEBPACK_IMPORTED_MODULE_0_zalgo_promise_src__.a.all(results).then(function() {}); }, run: function(name) { for (var results = [], _iterator = tasks, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); ;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var item = _ref; item.name === name && results.push(item.run()); } return __WEBPACK_IMPORTED_MODULE_0_zalgo_promise_src__.a.all(results).then(__WEBPACK_IMPORTED_MODULE_3__lib__.I); } }; } __webpack_require__.d(__webpack_exports__, "a", function() { return BaseComponent; }); var __WEBPACK_IMPORTED_MODULE_0_zalgo_promise_src__ = __webpack_require__("./node_modules/zalgo-promise/src/index.js"), __WEBPACK_IMPORTED_MODULE_1_post_robot_src__ = __webpack_require__("./node_modules/post-robot/src/index.js"), __WEBPACK_IMPORTED_MODULE_3__lib__ = (__webpack_require__("./node_modules/cross-domain-utils/src/index.js"), __webpack_require__("./node_modules/xcomponent/src/lib/index.js")), BaseComponent = function() { function BaseComponent() { _classCallCheck(this, BaseComponent); this.clean = cleanup(this); this.event = Object(__WEBPACK_IMPORTED_MODULE_3__lib__.s)(); } BaseComponent.prototype.addProp = function(options, name, def) { Object(__WEBPACK_IMPORTED_MODULE_3__lib__.g)(options, this, name, def); }; BaseComponent.prototype.on = function(eventName, handler) { return this.event.on(eventName, handler); }; BaseComponent.prototype.listeners = function() { throw new Error("Expected listeners to be implemented"); }; BaseComponent.prototype.error = function(err) { throw new Error("Expected error to be implemented - got " + Object(__WEBPACK_IMPORTED_MODULE_3__lib__.X)(err)); }; BaseComponent.prototype.listen = function(win, domain) { var _this = this; if (!win) throw this.component.createError("window to listen to not set"); if (!domain) throw new Error("Must pass domain to listen to"); if (this.listeners) for (var listeners = this.listeners(), _iterator2 = Object.keys(listeners), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator](); ;) { var _ref2, _ret = function() { if (_isArray2) { if (_i2 >= _iterator2.length) return "break"; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) return "break"; _ref2 = _i2.value; } var listenerName = _ref2, name = listenerName.replace(/^xcomponent_/, ""), errorHandler = function(err) { _this.error(err); }, listener = Object(__WEBPACK_IMPORTED_MODULE_1_post_robot_src__.on)(listenerName, { window: win, domain: domain, errorHandler: errorHandler }, function(_ref3) { var source = _ref3.source, data = _ref3.data; _this.component.log("listener_" + name); return listeners[listenerName].call(_this, source, data); }), errorListener = Object(__WEBPACK_IMPORTED_MODULE_1_post_robot_src__.on)(listenerName, { window: win, errorHandler: errorHandler }, function(_ref4) { var origin = _ref4.origin; _this.component.logError("unexpected_listener_" + name, { origin: origin, domain: domain.toString() }); _this.error(new Error("Unexpected " + name + " message from domain " + origin + " -- expected message from " + domain.toString())); }); _this.clean.register(function() { listener.cancel(); errorListener.cancel(); }); }(); if ("break" === _ret) break; } }; return BaseComponent; }(); }, "./node_modules/xcomponent/src/component/child/index.js": function(module, __webpack_exports__, __webpack_require__) { "use strict"; function normalizeChildProp(component, props, key, value) { var prop = component.getProp(key); return prop ? "function" == typeof prop.childDecorate ? prop.childDecorate(value) : value : component.looseProps ? value : void 0; } function normalizeChildProps(component, props, origin) { for (var required = !(arguments.length > 3 && void 0 !== arguments[3]) || arguments[3], result = {}, _iterator = Object.keys(props), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); ;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var _key = _ref, prop = component.getProp(_key), value = props[_key]; if (!prop || !prop.sameDomain || origin === Object(src.getDomain)(window)) { result[_key] = normalizeChildProp(component, props, _key, value); prop && prop.alias && !result[prop.alias] && (result[prop.alias] = value); } } if (required) for (var _iterator2 = component.getPropNames(), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator](); ;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var key = _ref2; props.hasOwnProperty(key) || (result[key] = normalizeChildProp(component, props, key, props[key])); } return result; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); } function _possibleConstructorReturn(self, call) { if (!self) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return !call || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: !1, writable: !0, configurable: !0 } }); superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } var client = __webpack_require__("./node_modules/beaver-logger/client/index.js"), src = __webpack_require__("./node_modules/cross-domain-utils/src/index.js"), post_robot_src = __webpack_require__("./node_modules/post-robot/src/index.js"), zalgo_promise_src = __webpack_require__("./node_modules/zalgo-promise/src/index.js"), base = __webpack_require__("./node_modules/xcomponent/src/component/base.js"), component_window = __webpack_require__("./node_modules/xcomponent/src/component/window.js"), lib = __webpack_require__("./node_modules/xcomponent/src/lib/index.js"), constants = __webpack_require__("./node_modules/xcomponent/src/constants.js"), src_error = __webpack_require__("./node_modules/xcomponent/src/error.js"); __webpack_require__.d(__webpack_exports__, "a", function() { return child_ChildComponent; }); var _extends = Object.assign || function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); } return target; }, _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj; } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, child_ChildComponent = function(_BaseComponent) { function ChildComponent(component) { _classCallCheck(this, ChildComponent); var _this = _possibleConstructorReturn(this, _BaseComponent.call(this)); _this.component = component; if (!_this.hasValidParentDomain()) { _this.error(new src_error.c("Can not be rendered by domain: " + _this.getParentDomain())); return _possibleConstructorReturn(_this); } _this.sendLogsToOpener(); _this.component.log("construct_child"); _this.onPropHandlers = []; _this.component.xchild = _this; _this.setProps(_this.getInitialProps(), Object(component_window.d)()); _this.props.logLevel && Object(lib.S)(_this.props.logLevel); _this.component.log("init_child"); _this.setWindows(); _this.listenForResize(); _this.onInit = _this.sendToParent(constants.POST_MESSAGE.INIT, { exports: _this.exports() }).then(function(_ref) { var origin = _ref.origin, data = _ref.data; _this.context = data.context; _this.setProps(data.props, origin); _this.watchForResize(); return _this; }).catch(function(err) { _this.error(err); throw err; }); return _this; } _inherits(ChildComponent, _BaseComponent); ChildComponent.prototype.listenForResize = function() { var _this2 = this; this.sendToParent(constants.POST_MESSAGE.ONRESIZE, {}, { fireAndForget: !0 }); window.addEventListener("resize", function() { _this2.sendToParent(constants.POST_MESSAGE.ONRESIZE, {}, { fireAndForget: !0 }); }); }; ChildComponent.prototype.hasValidParentDomain = function() { return Object(src.matchDomain)(this.component.allowedParentDomains, this.getParentDomain()); }; ChildComponent.prototype.init = function() { return this.onInit; }; ChildComponent.prototype.getParentDomain = function() { return Object(component_window.d)(); }; ChildComponent.prototype.onProps = function(handler) { this.onPropHandlers.push(handler); }; ChildComponent.prototype.getParentComponentWindow = function() { return Object(component_window.c)(); }; ChildComponent.prototype.getParentRenderWindow = function() { return Object(component_window.e)(); }; ChildComponent.prototype.getInitialProps = function() { var _this3 = this, componentMeta = Object(component_window.b)(), props = componentMeta.props; if (props.type === constants.INITIAL_PROPS.RAW) props = props.value; else { if (props.type !== constants.INITIAL_PROPS.UID) throw new Error("Unrecognized props type: " + props.type); var parentComponentWindow = Object(component_window.c)(); if (!Object(src.isSameDomain)(parentComponentWindow)) { if ("file:" === window.location.protocol) throw new Error("Can not get props from file:// domain"); throw new Error("Parent component window is on a different domain - expected " + Object(src.getDomain)() + " - can not retrieve props"); } var global = Object(lib.z)(parentComponentWindow); if (!global) throw new Error("Can not find global for parent component - can not retrieve props"); props = global.props[componentMeta.uid]; } if (!props) throw new Error("Initial props not found"); return Object(lib.k)(props, function(_ref2) { var fullKey = _ref2.fullKey, self = _ref2.self, args = _ref2.args; return _this3.onInit.then(function() { var func = Object(lib.v)(_this3.props, fullKey); if ("function" != typeof func) throw new TypeError("Expected " + (void 0 === func ? "undefined" : _typeof(func)) + " to be function"); return func.apply(self, args); }); }); }; ChildComponent.prototype.setProps = function(props, origin) { var required = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2]; this.props = this.props || {}; var normalizedProps = normalizeChildProps(this.component, props, origin, required); Object(lib.t)(this.props, normalizedProps); window.xprops = this.props; this.component.xprops = this.props; for (var _iterator = this.onPropHandlers, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); ;) { var _ref3; if (_isArray) { if (_i >= _iterator.length) break; _ref3 = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref3 = _i.value; } _ref3.call(this, this.props); } }; ChildComponent.prototype.sendToParent = function(name) { var data = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, options = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, parentWindow = Object(component_window.c)(); if (!parentWindow) throw new Error("Can not find parent component window to message"); this.component.log("send_to_parent_" + name); return Object(post_robot_src.send)(parentWindow, name, data, _extends({ domain: Object(component_window.d)() }, options)); }; ChildComponent.prototype.setWindows = function() { if (window.__activeXComponent__) throw this.component.createError("Can not attach multiple components to the same window"); window.__activeXComponent__ = this; if (!Object(component_window.c)()) throw this.component.createError("Can not find parent window"); var componentMeta = Object(component_window.b)(); if (componentMeta.tag !== this.component.tag) throw this.component.createError("Parent is " + componentMeta.tag + " - can not attach " + this.component.tag); this.watchForClose(); }; ChildComponent.prototype.sendLogsToOpener = function() { }; ChildComponent.prototype.watchForClose = function() { var _this4 = this; window.addEventListener("unload", function() { return _this4.checkClose(); }); }; ChildComponent.prototype.enableAutoResize = function() { var _ref5 = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}, _ref5$width = _ref5.width, width = void 0 === _ref5$width || _ref5$width, _ref5$height = _ref5.height, height = void 0 === _ref5$height || _ref5$height; this.autoResize = { width: width, height: height }; this.watchForResize(); }; ChildComponent.prototype.getAutoResize = function() { var width = !1, height = !1, autoResize = this.autoResize || this.component.autoResize; if ("object" === (void 0 === autoResize ? "undefined" : _typeof(autoResize))) { width = Boolean(autoResize.width); height = Boolean(autoResize.height); } else if (autoResize) { width = !0; height = !0; } var element = void 0; element = autoResize.element ? Object(lib.x)(autoResize.element) : window.navigator.userAgent.match(/MSIE (9|10)\./) ? document.body : document.documentElement; return { width: width, height: height, element: element }; }; ChildComponent.prototype.watchForResize = function() { var _this5 = this, _getAutoResize = this.getAutoResize(), width = _getAutoResize.width, height = _getAutoResize.height, element = _getAutoResize.element; if ((width || height) && this.context !== constants.CONTEXT_TYPES.POPUP && !this.watchingForResize) { this.watchingForResize = !0; return zalgo_promise_src.a.try(function() { return lib.n; }).then(function() { if (!Object(lib.m)(element, { width: width, height: height })) return _this5.resizeToElement(element, { width: width, height: height }); }).then(function() { return Object(lib.h)(function() { return Object(lib.K)(element, { width: width, height: height }).then(function() { return _this5.resizeToElement(element, { width: width, height: height }); }); }); }); } }; ChildComponent.prototype.exports = function() { var self = this; return { updateProps: function(props) { var _this6 = this; return zalgo_promise_src.a.try(function() { return self.setProps(props, _this6.origin, !1); }); }, close: function() { return zalgo_promise_src.a.try(function() { return self.destroy(); }); } }; }; ChildComponent.prototype.resize = function(width, height) { var _this7 = this; return zalgo_promise_src.a.resolve().then(function() { _this7.component.log("resize", { width: Object(lib.W)(width), height: Object(lib.W)(height) }); if (_this7.context !== constants.CONTEXT_TYPES.POPUP) return _this7.sendToParent(constants.POST_MESSAGE.RESIZE, { width: width, height: height }).then(lib.I); }); }; ChildComponent.prototype.resizeToElement = function(el, _ref6) { var _this8 = this, width = _ref6.width, height = _ref6.height, history = []; return function resize() { return zalgo_promise_src.a.try(function() { for (var tracker = Object(lib.Z)(el, { width: width, height: height }), _tracker$check = tracker.check(), dimensions = _tracker$check.dimensions, _iterator3 = history, _isArray3 = Array.isArray(_iterator3), _i4 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator](); ;) { var _ref7; if (_isArray3) { if (_i4 >= _iterator3.length) break; _ref7 = _iterator3[_i4++]; } else { _i4 = _iterator3.next(); if (_i4.done) break; _ref7 = _i4.value; } var size = _ref7, widthMatch = !width || size.width === dimensions.width, heightMatch = !height || size.height === dimensions.height; if (widthMatch && heightMatch) return; } history.push({ width: dimensions.width, height: dimensions.height }); return _this8.resize(width ? dimensions.width : null, height ? dimensions.height : null).then(function() { if (tracker.check().changed) return resize(); }); }); }(); }; ChildComponent.prototype.hide = function() { return this.sendToParent(constants.POST_MESSAGE.HIDE).then(lib.I); }; ChildComponent.prototype.show = function() { return this.sendToParent(constants.POST_MESSAGE.SHOW).then(lib.I); }; ChildComponent.prototype.userClose = function() { return this.close(constants.CLOSE_REASONS.USER_CLOSED); }; ChildComponent.prototype.close = function() { var reason = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : constants.CLOSE_REASONS.CHILD_CALL; this.component.log("close_child"); this.sendToParent(constants.POST_MESSAGE.CLOSE, { reason: reason }); }; ChildComponent.prototype.checkClose = function() { this.sendToParent(constants.POST_MESSAGE.CHECK_CLOSE, {}, { fireAndForget: !0 }); }; ChildComponent.prototype.destroy = function() { return Object(client.g)().then(function() { window.close(); }); }; ChildComponent.prototype.focus = function() { this.component.log("focus"); window.focus(); }; ChildComponent.prototype.error = function(err) { var stringifiedError = Object(lib.X)(err); this.component.logError("error", { error: stringifiedError }); return this.sendToParent(constants.POST_MESSAGE.ERROR, { error: stringifiedError }).then(lib.I); }; return ChildComponent; }(base.a); if (Object(component_window.g)() && window.console) { _loop5: for (var _iterator4 = client.l, _isArray4 = Array.isArray(_iterator4), _i5 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator](); ;) { var _ref8, _ret3 = function() { if (_isArray4) { if (_i5 >= _iterator4.length) return "break"; _ref8 = _iterator4[_i5++]; } else { _i5 = _iterator4.next(); if (_i5.done) return "break"; _ref8 = _i5.value; } var level = _ref8; try { var _original = window.console[level]; if (!_original || !_original.apply) return "continue"; window.console[level] = function() { try { var logLevel = window.LOG_LEVEL; if (!logLevel || -1 === client.l.indexOf(logLevel)) return _original.apply(this, arguments); if (client.l.indexOf(level) > client.l.indexOf(logLevel)) return; return _original.apply(this, arguments); } catch (err2) {} }; "info" === level && (window.console.log = window.console[level]); } catch (err) {} }(); switch (_ret3) { case "break": break _loop5; case "continue": continue; } } } }, "./node_modules/xcomponent/src/component/component/index.js": function(module, __webpack_exports__, __webpack_require__) { "use strict"; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); } function _possibleConstructorReturn(self, call) { if (!self) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return !call || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: !1, writable: !0, configurable: !0 } }); superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } function validatePropDefinitions(options) { if (options.props && "object" !== _typeof(options.props)) throw new Error("Expected options.props to be an object"); if (options.props) for (var _iterator = Object.keys(options.props), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); ;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var key = _ref, prop = options.props[key]; if (!prop || "object" !== (void 0 === prop ? "undefined" : _typeof(prop))) throw new Error("Expected options.props." + key + " to be an object"); if (!prop.type) throw new Error("Expected prop.type"); if (-1 === constants.PROP_TYPES_LIST.indexOf(prop.type)) throw new Error("Expected prop.type to be one of " + constants.PROP_TYPES_LIST.join(", ")); if (prop.required && prop.def) throw new Error("Required prop can not have a default value"); } } function validate(options) { if (!options) throw new Error("Expecred options to be passed"); if (!options.tag || !options.tag.match(/^[a-z0-9-]+$/)) throw new Error("Invalid options.tag: " + options.tag); validatePropDefinitions(options); if (options.dimensions) { if (options.dimensions && !Object(lib.E)(options.dimensions.width) && !Object(lib.D)(options.dimensions.width)) throw new Error("Expected options.dimensions.width to be a px or % string value"); if (options.dimensions && !Object(lib.E)(options.dimensions.height) && !Object(lib.D)(options.dimensions.height)) throw new Error("Expected options.dimensions.height to be a px or % string value"); } if (options.contexts) { if (options.contexts.popup, !1) throw new Error("Popups not supported in this build -- please use the full xcomponent.js build"); for (var anyEnabled = !1, _iterator2 = Object.keys(options.contexts), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator](); ;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var context = _ref2; if (-1 === constants.CONTEXT_TYPES_LIST.indexOf(context)) throw new Error("Unsupported context type: " + context); (options.contexts && options.contexts[context] || options.contexts && void 0 === options.contexts[context]) && (anyEnabled = !0); } if (!anyEnabled) throw new Error("No context type is enabled"); } if (options.defaultContext) { if (-1 === constants.CONTEXT_TYPES_LIST.indexOf(options.defaultContext)) throw new Error("Unsupported context type: " + (options.defaultContext || "unknown")); if (options.contexts && options.defaultContext && !options.contexts[options.defaultContext]) throw new Error("Disallowed default context type: " + (options.defaultContext || "unknown")); } if (!options.url && !options.buildUrl) throw new Error("Expected options.url to be passed"); if (options.url && options.buildUrl) throw new Error("Can not pass options.url and options.buildUrl"); if (options.defaultEnv) { if ("string" != typeof options.defaultEnv) throw new TypeError("Expected options.defaultEnv to be a string"); if (!options.buildUrl && "object" !== _typeof(options.url)) throw new Error("Expected options.url to be an object mapping env->url"); if (options.url && "object" === _typeof(options.url) && !options.url[options.defaultEnv]) throw new Error("No url found for default env: " + options.defaultEnv); } if (options.url && "object" === _typeof(options.url)) { if (!options.defaultEnv) throw new Error("Must pass options.defaultEnv with env->url mapping"); for (var _iterator3 = Object.keys(options.url), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator](); ;) { var _ref3; if (_isArray3) { if (_i3 >= _iterator3.length) break; _ref3 = _iterator3[_i3++]; } else { _i3 = _iterator3.next(); if (_i3.done) break; _ref3 = _i3.value; } var env = _ref3; if (!options.url[env]) throw new Error("No url specified for env: " + env); } } if (options.prerenderTemplate && "function" != typeof options.prerenderTemplate) throw new Error("Expected options.prerenderTemplate to be a function"); if (options.containerTemplate && "function" != typeof options.containerTemplate) throw new Error("Expected options.containerTemplate to be a function"); } function defaultContainerTemplate(_ref) { var id = _ref.id, tag = _ref.tag, context = _ref.context, CLASS = _ref.CLASS, outlet = _ref.outlet, jsxDom = _ref.jsxDom, _ref$dimensions = _ref.dimensions, width = _ref$dimensions.width, height = _ref$dimensions.height; return jsxDom("div", { id: id, class: CLASS.XCOMPONENT + " " + CLASS.XCOMPONENT + "-tag-" + tag + " " + CLASS.XCOMPONENT + "-context-" + context }, jsxDom("style", null, "\n #" + id + ", #" + id + " > ." + CLASS.OUTLET + " {\n width: " + width + ";\n height: " + height + ";\n }\n\n #" + id + " > ." + CLASS.OUTLET + " {\n display: inline-block;\n position: relative;\n }\n\n #" + id + " > ." + CLASS.OUTLET + " > iframe {\n height: 100%;\n width: 100%;\n position: absolute;\n top: 0;\n left: 0;\n transition: opacity .2s ease-in-out;\n }\n\n #" + id + " > ." + CLASS.OUTLET + " > iframe." + CLASS.VISIBLE + " {\n opacity: 1;\n }\n\n #" + id + " > ." + CLASS.OUTLET + " > iframe." + CLASS.INVISIBLE + " {\n opacity: 0;\n }\n "), outlet); } function defaultPrerenderTemplate(_ref) { var jsxDom = _ref.jsxDom; return jsxDom("html", null, jsxDom("head", null, jsxDom("style", null, "\n html, body {\n width: 100%;\n height: 100%;\n overflow: hidden;\n top: 0;\n left: 0;\n margin: 0;\n text-align: center;\n }\n\n .spinner {\n position: absolute;\n max-height: 60vmin;\n max-width: 60vmin;\n height: 40px;\n width: 40px;\n top: 50%;\n left: 50%;\n transform: translateX(-50%) translateY(-50%);\n z-index: 10;\n }\n\n .spinner .loader {\n height: 100%;\n width: 100%;\n box-sizing: border-box;\n border: 3px solid rgba(0, 0, 0, .2);\n border-top-color: rgba(33, 128, 192, 0.8);\n border-radius: 100%;\n animation: rotation .7s infinite linear;\n\n }\n\n @keyframes rotation {\n from {\n transform: rotate(0deg)\n }\n to {\n transform: rotate(359deg)\n }\n }\n ")), jsxDom("body", null, jsxDom("div", { class: "spinner" }, jsxDom("div", { id: "loader", class: "loader" })))); } function getInternalProps() { return { env: { type: "string", required: !1, queryParam: !0, def: function() { return this.defaultEnv; } }, uid: { type: "string", def: function() { return Object(lib._0)(); }, queryParam: !0 }, logLevel: { type: "string", required: !1, queryParam: !0, def: function() { return this.defaultLogLevel; } }, url: { type: "string", required: !1, promise: !0, sendToChild: !1 }, dimensions: { type: "object", required: !1 }, version: { type: "string", required: !1, queryParam: !0, def: function() { return this.version; } }, timeout: { type: "number", required: !1, sendToChild: !1 }, onDisplay: { type: "function", required: !1, noop: !0, promisify: !0, memoize: !0, sendToChild: !1 }, onEnter: { type: "function", required: !1, noop: !0, promisify: !0, sendToChild: !1 }, onRender: { type: "function", required: !1, noop: !0, promisify: !0, sendToChild: !1 }, onClose: { type: "function", required: !1, noop: !0, once: !0, promisify: !0, sendToChild: !1 }, onTimeout: { type: "function", required: !1, memoize: !0, promisify: !0, sendToChild: !1, def: function() { return function(err) { if (this.props.onError) return this.props.onError(err); throw err; }; } }, onError: { type: "function", required: !1, promisify: !0, sendToChild: !0, once: !0 } }; } function component__classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); } function component__possibleConstructorReturn(self, call) { if (!self) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return !call || "object" != typeof call && "function" != typeof call ? self : call; } function component__inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: !1, writable: !0, configurable: !0 } }); superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } var src = __webpack_require__("./node_modules/post-robot/src/index.js"), zalgo_promise_src = __webpack_require__("./node_modules/zalgo-promise/src/index.js"), cross_domain_utils_src = __webpack_require__("./node_modules/cross-domain-utils/src/index.js"), base = __webpack_require__("./node_modules/xcomponent/src/component/base.js"), child = __webpack_require__("./node_modules/xcomponent/src/component/child/index.js"), component_parent = __webpack_require__("./node_modules/xcomponent/src/component/parent/index.js"), drivers = __webpack_require__("./node_modules/xcomponent/src/component/parent/drivers.js"), lib = __webpack_require__("./node_modules/xcomponent/src/lib/index.js"), _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1; descriptor.configurable = !0; "value" in descriptor && (descriptor.writable = !0); Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { protoProps && defineProperties(Constructor.prototype, protoProps); staticProps && defineProperties(Constructor, staticProps); return Constructor; }; }(), delegate_DelegateComponent = function(_BaseComponent) { function DelegateComponent(component, source, options) { _classCallCheck(this, DelegateComponent); var _this = _possibleConstructorReturn(this, _BaseComponent.call(this)); _this.component = component; _this.clean.set("source", source); _this.context = options.context; _this.props = { uid: options.props.uid, dimensions: options.props.dimensions, onClose: options.props.onClose, onDisplay: options.props.onDisplay }; for (var _iterator = component.getPropNames(), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); ;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var propName = _ref; _this.component.getProp(propName).allowDelegate && (_this.props[propName] = options.props[propName]); } _this.focus = function() { return options.overrides.focus.call(_this); }; _this.clean.register("destroyFocusOverride", function() { _this.focus = lib.I; }); _this.userClose = options.overrides.userClose; _this.getDomain = options.overrides.getDomain; _this.error = options.overrides.error; _this.on = options.overrides.on; for (var delegateOverrides = drivers.a[options.context].delegateOverrides, _iterator2 = Object.keys(delegateOverrides), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator](); ;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var key = _ref2; _this[key] = component_parent.a.prototype[key]; } _this.childWindowName = options.childWindowName; component_parent.a.prototype.registerActiveComponent.call(_this); _this.watchForClose(); return _this; } _inherits(DelegateComponent, _BaseComponent); DelegateComponent.prototype.watchForClose = function() { var _this2 = this, closeWindowListener = Object(cross_domain_utils_src.onCloseWindow)(this.source, function() { return _this2.destroy(); }, 3e3); this.clean.register("destroyCloseWindowListener", closeWindowListener.cancel); }; DelegateComponent.prototype.getOverrides = function(context) { for (var delegateOverrides = drivers.a[context].delegateOverrides, overrides = {}, self = this, _iterator3 = Object.keys(delegateOverrides), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator](); ;) { var _ref3; if ("break" === function() { if (_isArray3) { if (_i3 >= _iterator3.length) return "break"; _ref3 = _iterator3[_i3++]; } else { _i3 = _iterator3.next(); if (_i3.done) return "break"; _ref3 = _i3.value; } var key = _ref3; overrides[key] = function() { return component_parent.a.prototype[key].apply(self, arguments); }; }()) break; } return overrides; }; DelegateComponent.prototype.destroy = function() { return this.clean.all(); }; _createClass(DelegateComponent, [ { key: "driver", get: function() { if (!this.context) throw new Error("Context not set"); return drivers.a[this.context]; } } ]); return DelegateComponent; }(base.a), component_window = __webpack_require__("./node_modules/xcomponent/src/component/window.js"), constants = __webpack_require__("./node_modules/xcomponent/src/constants.js"), src_drivers = __webpack_require__("./node_modules/xcomponent/src/drivers/index.js"), _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj; } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; __webpack_require__("./node_modules/xcomponent/src/types.js"); __webpack_require__.d(__webpack_exports__, "a", function() { return component_Component; }); var _class, component__typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj; } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, component_drivers = { angular: src_drivers.angular, angular2: src_drivers.angular2, glimmer: src_drivers.glimmer, react: src_drivers.react, vue: src_drivers.vue, script: src_drivers.script }, component_Component = (_class = function(_BaseComponent) { function Component(options) { component__classCallCheck(this, Component); var _this = component__possibleConstructorReturn(this, _BaseComponent.call(this)); validate(options); _this.addProp(options, "tag"); _this.addProp(options, "defaultLogLevel", "info"); _this.addProp(options, "allowedParentDomains", constants.WILDCARD); Object(lib.S)(_this.defaultLogLevel); if (Component.components[_this.tag]) throw new Error("Can not register multiple components with the same tag"); _this.addProp(options, "name", _this.tag.replace(/-/g, "_")); _this.builtinProps = getInternalProps(); _this.props = options.props || {}; options.props || (_this.looseProps = !0); _this.addProp(options, "dimensions"); _this.addProp(options, "scrolling"); _this.addProp(options, "version", "latest"); _this.addProp(options, "defaultEnv"); _this.addProp(options, "buildUrl"); _this.addProp(options, "url"); _this.addProp(options, "domain"); _this.addProp(options, "bridgeUrl"); _this.addProp(options, "bridgeDomain"); _this.addProp(options, "attributes", {}); _this.addProp(options, "contexts", { iframe: !0, popup: !1 }); _this.addProp(options, "defaultContext"); _this.addProp(options, "autoResize", !1); _this.addProp(options, "containerTemplate", defaultContainerTemplate); _this.addProp(options, "prerenderTemplate", defaultPrerenderTemplate); _this.addProp(options, "validate"); _this.addProp(options, "unsafeRenderTo", !1); Component.components[_this.tag] = _this; _this.registerDrivers(); _this.registerChild(); _this.listenDelegate(); return _this; } component__inherits(Component, _BaseComponent); Component.prototype.getPropNames = function() { for (var props = Object.keys(this.props), _iterator = Object.keys(this.builtinProps), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); ;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var key = _ref; -1 === props.indexOf(key) && props.push(key); } return props; }; Component.prototype.getProp = function(name) { return this.props[name] || this.builtinProps[name]; }; Component.prototype.registerDrivers = function() { this.driverCache = {}; for (var _iterator2 = Object.keys(component_drivers), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator](); ;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var driverName = _ref2; if (0 !== driverName.indexOf("_")) { var driver = component_drivers[driverName], glob = driver.global(); glob && this.driver(driverName, glob); } } }; Component.prototype.driver = function(name, dep) { if (!component_drivers[name]) throw new Error("Could not find driver for framework: " + name); this.driverCache[name] || (this.driverCache[name] = component_drivers[name].register(this, dep)); return this.driverCache[name]; }; Component.prototype.registerChild = function() { var _this2 = this; Object(component_window.g)() && zalgo_promise_src.a.try(function() { if (Object(component_window.b)().tag === _this2.tag) { window.xchild = new child.a(_this2); window.xprops = window.xchild.props; } }); }; Component.prototype.listenDelegate = function() { var _this3 = this; Object(src.on)(constants.POST_MESSAGE.ALLOW_DELEGATE + "_" + this.name, function() { return !0; }); Object(src.on)(constants.POST_MESSAGE.DELEGATE + "_" + this.name, function(_ref3) { var source = _ref3.source, origin = _ref3.origin, data = _ref3.data, domain = _this3.getDomain(null, data.env || _this3.defaultEnv); if (!domain) throw new Error("Could not determine domain to allow remote render"); if (!Object(cross_domain_utils_src.matchDomain)(domain, origin)) throw new Error("Can not render from " + origin + " - expected " + domain.toString()); var delegate = _this3.delegate(source, data.options); return { overrides: delegate.getOverrides(data.context), destroy: function() { return delegate.destroy(); } }; }); }; Component.prototype.canRenderTo = function(win) { return Object(src.send)(win, constants.POST_MESSAGE.ALLOW_DELEGATE + "_" + this.name).then(function(_ref4) { return _ref4.data; }).catch(function() { return !1; }); }; Component.prototype.getValidDomain = function(url) { if (url) { var domain = Object(cross_domain_utils_src.getDomainFromUrl)(url); if ("string" == typeof this.domain && domain === this.domain) return domain; var domains = this.domain; if (domains && "object" === (void 0 === domains ? "undefined" : component__typeof(domains)) && !(domains instanceof RegExp)) for (var _iterator3 = Object.keys(domains), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator](); ;) { var _ref5; if (_isArray3) { if (_i3 >= _iterator3.length) break; _ref5 = _iterator3[_i3++]; } else { _i3 = _iterator3.next(); if (_i3.done) break; _ref5 = _i3.value; } var env = _ref5; if ("test" !== env && domain === domains[env]) return domain; } } }; Component.prototype.getDomain = function(url, env) { var domain = this.getForEnv(this.domain, env); if (domain) return domain; domain = this.getValidDomain(url); if (domain) return domain; var envUrl = this.getForEnv(this.url, env); return envUrl ? Object(cross_domain_utils_src.getDomainFromUrl)(envUrl) : url ? Object(cross_domain_utils_src.getDomainFromUrl)(url) : void 0; }; Component.prototype.getBridgeUrl = function(env) { return this.getForEnv(this.bridgeUrl, env); }; Component.prototype.getForEnv = function(item, env) { if (item) { if ("string" == typeof item || item instanceof RegExp) return item; env || (env = this.defaultEnv); if (env) return env && "object" === (void 0 === item ? "undefined" : component__typeof(item)) && item[env] ? item[env] : void 0; } }; Component.prototype.getBridgeDomain = function(env) { var bridgeDomain = this.getForEnv(this.bridgeDomain, env); if (bridgeDomain) return bridgeDomain; var bridgeUrl = this.getBridgeUrl(env); return bridgeUrl ? Object(cross_domain_utils_src.getDomainFromUrl)(bridgeUrl) : void 0; }; Component.prototype.getUrl = function(env, props) { var url = this.getForEnv(this.url, env); if (url) return url; if (this.buildUrl) return this.buildUrl(props); throw new Error("Unable to get url"); }; Component.prototype.isXComponent = function() { return Object(component_window.g)(); }; Component.prototype.isChild = function() { return Object(component_window.g)() && window.xprops && Object(component_window.b)().tag === this.tag; }; Component.prototype.createError = function(message, tag) { return new Error("[" + (tag || this.tag) + "] " + message); }; Component.prototype.init = function(props, context, element) { return new component_parent.a(this, this.getRenderContext(context, element), { props: props }); }; Component.prototype.delegate = function(source, options) { return new delegate_DelegateComponent(this, source, options); }; Component.prototype.validateRenderContext = function(context, element) { if (context && !this.contexts[context]) throw new Error("[" + this.tag + "] Can not render to " + context); if (!element && context === constants.CONTEXT_TYPES.IFRAME) throw new Error("[" + this.tag + "] Context type " + constants.CONTEXT_TYPES.IFRAME + " requires an element selector"); }; Component.prototype.getDefaultContext = function() { if (this.defaultContext) return this.defaultContext; if (this.contexts[constants.CONTEXT_TYPES.IFRAME]) return constants.CONTEXT_TYPES.IFRAME; if (this.contexts[constants.CONTEXT_TYPES.POPUP]) return constants.CONTEXT_TYPES.POPUP; throw new Error("Can not determine default context"); }; Component.prototype.getRenderContext = function(context, element) { context = context || this.getDefaultContext(); this.validateRenderContext(context, element); return context; }; Component.prototype.render = function(props, element) { var _this4 = this; return zalgo_promise_src.a.try(function() { return new component_parent.a(_this4, _this4.getRenderContext(null, element), { props: props }).render(element); }); }; Component.prototype.renderIframe = function(props, element) { var _this5 = this; return zalgo_promise_src.a.try(function() { return new component_parent.a(_this5, _this5.getRenderContext(constants.CONTEXT_TYPES.IFRAME, element), { props: props }).render(element); }); }; Component.prototype.renderPopup = function(props) { var _this6 = this; return zalgo_promise_src.a.try(function() { return new component_parent.a(_this6, _this6.getRenderContext(constants.CONTEXT_TYPES.POPUP), { props: props }).render(); }); }; Component.prototype.renderTo = function(win, props, element) { var _this7 = this; return zalgo_promise_src.a.try(function() { return new component_parent.a(_this7, _this7.getRenderContext(null, element), { props: props }).renderTo(win, element); }); }; Component.prototype.renderIframeTo = function(win, props, element) { var _this8 = this; return zalgo_promise_src.a.try(function() { return new component_parent.a(_this8, _this8.getRenderContext(constants.CONTEXT_TYPES.IFRAME, element), { props: props }).renderTo(win, element); }); }; Component.prototype.renderPopupTo = function(win, props) { var _this9 = this; return zalgo_promise_src.a.try(function() { return new component_parent.a(_this9, _this9.getRenderContext(constants.CONTEXT_TYPES.POPUP), { props: props }).renderTo(win); }); }; Component.prototype.prerender = function(props, element) { var instance = new component_parent.a(this, this.getRenderContext(null, element), { props: props }); instance.prefetch(); return { render: function(innerProps, innerElement) { innerProps && instance.updateProps(innerProps); return instance.render(innerElement); }, renderTo: function(win, innerProps, innerElement) { innerProps && instance.updateProps(innerProps); return instance.renderTo(win, innerElement); }, get html() { return instance.html; }, set html(value) { instance.html = value; } }; }; Component.prototype.log = function(event) { var payload = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; Object(lib.C)(this.name, event, payload); }; Component.prototype.logWarning = function(event, payload) { Object(lib._1)(this.name, event, payload); }; Component.prototype.logError = function(event, payload) { Object(lib.r)(this.name, event, payload); }; Component.getByTag = function(tag) { return Component.components[tag]; }; return Component; }(base.a), function(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function(key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; ("value" in desc || desc.initializer) && (desc.writable = !0); desc = decorators.slice().reverse().reduce(function(desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && void 0 !== desc.initializer) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = void 0; } if (void 0 === desc.initializer) { Object.defineProperty(target, property, desc); desc = null; } return desc; }(_class.prototype, "getPropNames", [ lib.G ], Object.getOwnPropertyDescriptor(_class.prototype, "getPropNames"), _class.prototype), _class); component_Component.components = {}; }, "./node_modules/xcomponent/src/component/parent/drivers.js": function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.d(__webpack_exports__, "a", function() { return RENDER_DRIVERS; }); var __WEBPACK_IMPORTED_MODULE_0_zalgo_promise_src__ = __webpack_require__("./node_modules/zalgo-promise/src/index.js"), __WEBPACK_IMPORTED_MODULE_1_post_robot_src__ = __webpack_require__("./node_modules/post-robot/src/index.js"), __WEBPACK_IMPORTED_MODULE_2_cross_domain_utils_src__ = __webpack_require__("./node_modules/cross-domain-utils/src/index.js"), __WEBPACK_IMPORTED_MODULE_3__lib__ = __webpack_require__("./node_modules/xcomponent/src/lib/index.js"), __WEBPACK_IMPORTED_MODULE_4__constants__ = __webpack_require__("./node_modules/xcomponent/src/constants.js"), __WEBPACK_IMPORTED_MODULE_5__window__ = __webpack_require__("./node_modules/xcomponent/src/component/window.js"), _extends = Object.assign || function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); } return target; }, RENDER_DRIVERS = {}; RENDER_DRIVERS[__WEBPACK_IMPORTED_MODULE_4__constants__.CONTEXT_TYPES.IFRAME] = { focusable: !1, renderedIntoContainerTemplate: !0, allowResize: !0, openOnClick: !1, needsBridge: !1, open: function(url) { var _this = this, attributes = this.component.attributes.iframe || {}; this.iframe = Object(__WEBPACK_IMPORTED_MODULE_3__lib__.B)({ url: url, attributes: _extends({ name: this.childWindowName, title: this.component.name, scrolling: this.component.scrolling ? "yes" : "no" }, attributes), class: [ __WEBPACK_IMPORTED_MODULE_4__constants__.CLASS_NAMES.COMPONENT_FRAME, __WEBPACK_IMPORTED_MODULE_4__constants__.CLASS_NAMES.INVISIBLE ] }, this.element); return Object(__WEBPACK_IMPORTED_MODULE_3__lib__.f)(this.iframe).then(function(frameWindow) { _this.window = frameWindow; var detectClose = function() { return __WEBPACK_IMPORTED_MODULE_0_zalgo_promise_src__.a.try(function() { return _this.props.onClose(__WEBPACK_IMPORTED_MODULE_4__constants__.CLOSE_REASONS.CLOSE_DETECTED); }).finally(function() { return _this.destroy(); }); }, iframeWatcher = Object(__WEBPACK_IMPORTED_MODULE_3__lib__._2)(_this.iframe, detectClose), elementWatcher = Object(__WEBPACK_IMPORTED_MODULE_3__lib__._2)(_this.element, detectClose); _this.clean.register("destroyWindow", function() { iframeWatcher.cancel(); elementWatcher.cancel(); Object(__WEBPACK_IMPORTED_MODULE_1_post_robot_src__.cleanUpWindow)(_this.window); delete _this.window; if (_this.iframe) { Object(__WEBPACK_IMPORTED_MODULE_3__lib__.l)(_this.iframe); delete _this.iframe; } }); }); }, openPrerender: function() { var _this2 = this, attributes = this.component.attributes.iframe || {}; this.prerenderIframe = Object(__WEBPACK_IMPORTED_MODULE_3__lib__.B)({ attributes: _extends({ name: "__prerender__" + this.childWindowName, scrolling: this.component.scrolling ? "yes" : "no" }, attributes), class: [ __WEBPACK_IMPORTED_MODULE_4__constants__.CLASS_NAMES.PRERENDER_FRAME, __WEBPACK_IMPORTED_MODULE_4__constants__.CLASS_NAMES.VISIBLE ] }, this.element); return Object(__WEBPACK_IMPORTED_MODULE_3__lib__.f)(this.prerenderIframe).then(function(prerenderFrameWindow) { _this2.prerenderWindow = prerenderFrameWindow; _this2.clean.register("destroyPrerender", function() { if (_this2.prerenderIframe) { Object(__WEBPACK_IMPORTED_MODULE_3__lib__.l)(_this2.prerenderIframe); delete _this2.prerenderIframe; } }); }); }, switchPrerender: function() { var _this3 = this; Object(__WEBPACK_IMPORTED_MODULE_3__lib__.a)(this.prerenderIframe, __WEBPACK_IMPORTED_MODULE_4__constants__.CLASS_NAMES.INVISIBLE); Object(__WEBPACK_IMPORTED_MODULE_3__lib__.P)(this.prerenderIframe, __WEBPACK_IMPORTED_MODULE_4__constants__.CLASS_NAMES.VISIBLE); Object(__WEBPACK_IMPORTED_MODULE_3__lib__.a)(this.iframe, __WEBPACK_IMPORTED_MODULE_4__constants__.CLASS_NAMES.VISIBLE); Object(__WEBPACK_IMPORTED_MODULE_3__lib__.P)(this.iframe, __WEBPACK_IMPORTED_MODULE_4__constants__.CLASS_NAMES.INVISIBLE); setTimeout(function() { _this3.prerenderIframe && Object(__WEBPACK_IMPORTED_MODULE_3__lib__.l)(_this3.prerenderIframe); }, 1e3); }, delegateOverrides: { openContainer: __WEBPACK_IMPORTED_MODULE_4__constants__.DELEGATE.CALL_DELEGATE, destroyComponent: __WEBPACK_IMPORTED_MODULE_4__constants__.DELEGATE.CALL_DELEGATE, destroyContainer: __WEBPACK_IMPORTED_MODULE_4__constants__.DELEGATE.CALL_DELEGATE, cancelContainerEvents: __WEBPACK_IMPORTED_MODULE_4__constants__.DELEGATE.CALL_DELEGATE, createPrerenderTemplate: __WEBPACK_IMPORTED_MODULE_4__constants__.DELEGATE.CALL_DELEGATE, elementReady: __WEBPACK_IMPORTED_MODULE_4__constants__.DELEGATE.CALL_DELEGATE, showContainer: __WEBPACK_IMPORTED_MODULE_4__constants__.DELEGATE.CALL_DELEGATE, showComponent: __WEBPACK_IMPORTED_MODULE_4__constants__.DELEGATE.CALL_DELEGATE, hideContainer: __WEBPACK_IMPORTED_MODULE_4__constants__.DELEGATE.CALL_DELEGATE, hideComponent: __WEBPACK_IMPORTED_MODULE_4__constants__.DELEGATE.CALL_DELEGATE, hide: __WEBPACK_IMPORTED_MODULE_4__constants__.DELEGATE.CALL_DELEGATE, show: __WEBPACK_IMPORTED_MODULE_4__constants__.DELEGATE.CALL_DELEGATE, resize: __WEBPACK_IMPORTED_MODULE_4__constants__.DELEGATE.CALL_DELEGATE, loadUrl: __WEBPACK_IMPORTED_MODULE_4__constants__.DELEGATE.CALL_DELEGATE, hijackSubmit: __WEBPACK_IMPORTED_MODULE_4__constants__.DELEGATE.CALL_DELEGATE, openPrerender: __WEBPACK_IMPORTED_MODULE_4__constants__.DELEGATE.CALL_DELEGATE, switchPrerender: __WEBPACK_IMPORTED_MODULE_4__constants__.DELEGATE.CALL_DELEGATE, renderTemplate: __WEBPACK_IMPORTED_MODULE_4__constants__.DELEGATE.CALL_ORIGINAL, openContainerFrame: __WEBPACK_IMPORTED_MODULE_4__constants__.DELEGATE.CALL_ORIGINAL, getOutlet: __WEBPACK_IMPORTED_MODULE_4__constants__.DELEGATE.CALL_ORIGINAL, open: function(original, override) { return function() { var _this4 = this; return override.apply(this, arguments).then(function() { _this4.clean.set("window", Object(__WEBPACK_IMPORTED_MODULE_2_cross_domain_utils_src__.findFrameByName)(Object(__WEBPACK_IMPORTED_MODULE_5__window__.c)(), _this4.childWindowName)); if (!_this4.window) throw new Error("Unable to find parent component iframe window"); }); }; } }, resize: function(width, height) { if (width) { this.container.style.width = Object(__WEBPACK_IMPORTED_MODULE_3__lib__.Y)(width); this.element.style.width = Object(__WEBPACK_IMPORTED_MODULE_3__lib__.Y)(width); } if (height) { this.container.style.height = Object(__WEBPACK_IMPORTED_MODULE_3__lib__.Y)(height); this.element.style.height = Object(__WEBPACK_IMPORTED_MODULE_3__lib__.Y)(height); } }, show: function() { Object(__WEBPACK_IMPORTED_MODULE_3__lib__.V)(this.element); }, hide: function() { Object(__WEBPACK_IMPORTED_MODULE_3__lib__.A)(this.element); }, loadUrl: function(url) { this.iframe.setAttribute("src", url); } }; RENDER_DRIVERS[__WEBPACK_IMPORTED_MODULE_4__constants__.CONTEXT_TYPES.POPUP] = { focusable: !0, renderedIntoContainerTemplate: !1, allowResize: !1, openOnClick: !0, needsBridge: !0, open: function() { var _this5 = this, url = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : ""; return __WEBPACK_IMPORTED_MODULE_0_zalgo_promise_src__.a.try(function() { var _ref = _this5.component.dimensions || {}, _ref$width = _ref.width, width = void 0 === _ref$width ? __WEBPACK_IMPORTED_MODULE_4__constants__.DEFAULT_DIMENSIONS.WIDTH : _ref$width, _ref$height = _ref.height, height = void 0 === _ref$height ? __WEBPACK_IMPORTED_MODULE_4__constants__.DEFAULT_DIMENSIONS.HEIGHT : _ref$height; width = Object(__WEBPACK_IMPORTED_MODULE_3__lib__.J)(width, window.outerWidth); height = Object(__WEBPACK_IMPORTED_MODULE_3__lib__.J)(height, window.outerWidth); var _getPosition = Object(__WEBPACK_IMPORTED_MODULE_5__window__.f)({ width: width, height: height }), x = _getPosition.x, y = _getPosition.y, attributes = _this5.component.attributes.popup || {}; _this5.window = Object(__WEBPACK_IMPORTED_MODULE_3__lib__.M)(url || "", _extends({ name: _this5.childWindowName, width: width, height: height, top: y, left: x, status: 1, toolbar: 0, menubar: 0, resizable: 1, scrollbars: 1 }, attributes)); _this5.prerenderWindow = _this5.window; _this5.clean.register("destroyWindow", function() { if (_this5.window) { _this5.window.close(); Object(__WEBPACK_IMPORTED_MODULE_1_post_robot_src__.cleanUpWindow)(_this5.window); delete _this5.window; delete _this5.prerenderWindow; } }); _this5.resize(width, height); }); }, openPrerender: function() { return __WEBPACK_IMPORTED_MODULE_0_zalgo_promise_src__.a.try(__WEBPACK_IMPORTED_MODULE_3__lib__.I); }, resize: function() {}, hide: function() { throw new Error("Can not hide popup"); }, show: function() { throw new Error("Can not show popup"); }, delegateOverrides: { openContainer: __WEBPACK_IMPORTED_MODULE_4__constants__.DELEGATE.CALL_DELEGATE, destroyContainer: __WEBPACK_IMPORTED_MODULE_4__constants__.DELEGATE.CALL_DELEGATE, elementReady: __WEBPACK_IMPORTED_MODULE_4__constants__.DELEGATE.CALL_DELEGATE, showContainer: __WEBPACK_IMPORTED_MODULE_4__constants__.DELEGATE.CALL_DELEGATE, showComponent: __WEBPACK_IMPORTED_MODULE_4__constants__.DELEGATE.CALL_DELEGATE, hideContainer: __WEBPACK_IMPORTED_MODULE_4__constants__.DELEGATE.CALL_DELEGATE, hideComponent: __WEBPACK_IMPORTED_MODULE_4__constants__.DELEGATE.CALL_DELEGATE, hide: __WEBPACK_IMPORTED_MODULE_4__constants__.DELEGATE.CALL_DELEGATE, show: __WEBPACK_IMPORTED_MODULE_4__constants__.DELEGATE.CALL_DELEGATE, cancelContainerEvents: __WEBPACK_IMPORTED_MODULE_4__constants__.DELEGATE.CALL_DELEGATE, open: __WEBPACK_IMPORTED_MODULE_4__constants__.DELEGATE.CALL_ORIGINAL, loadUrl: __WEBPACK_IMPORTED_MODULE_4__constants__.DELEGATE.CALL_ORIGINAL, createPrerenderTemplate: __WEBPACK_IMPORTED_MODULE_4__constants__.DELEGATE.CALL_ORIGINAL, destroyComponent: __WEBPACK_IMPORTED_MODULE_4__constants__.DELEGATE.CALL_ORIGINAL, resize: __WEBPACK_IMPORTED_MODULE_4__constants__.DELEGATE.CALL_ORIGINAL, renderTemplate: __WEBPACK_IMPORTED_MODULE_4__constants__.DELEGATE.CALL_ORIGINAL, openContainerFrame: __WEBPACK_IMPORTED_MODULE_4__constants__.DELEGATE.CALL_ORIGINAL, getOutlet: __WEBPACK_IMPORTED_MODULE_4__constants__.DELEGATE.CALL_ORIGINAL }, loadUrl: function(url) { if (Object(__WEBPACK_IMPORTED_MODULE_2_cross_domain_utils_src__.isSameDomain)(this.window)) try { if (this.window.location && this.window.location.replace) { this.window.location.replace(url); return; } } catch (err) {} this.window.location = url; } }; }, "./node_modules/xcomponent/src/component/parent/index.js": function(module, __webpack_exports__, __webpack_require__) { "use strict"; function validateProp(prop, key, value, props) { var required = !(arguments.length > 4 && void 0 !== arguments[4]) || arguments[4]; if (null !== value && void 0 !== value && "" !== value) { if (!value || "function" != typeof value.then || !prop.promise) { if ("function" === prop.type) { if ("function" != typeof value) throw new TypeError("Prop is not of type function: " + key); } else if ("string" === prop.type) { if ("string" != typeof value) throw new TypeError("Prop is not of type string: " + key); } else if ("object" === prop.type) try { JSON.stringify(value); } catch (err) { throw new Error("Unable to serialize prop: " + key); } else if ("number" === prop.type && isNaN(parseInt(value, 10))) throw new TypeError("Prop is not a number: " + key); "function" == typeof prop.validate && value && prop.validate(value, props); } } else if (required && !1 !== prop.required && !prop.hasOwnProperty("def")) throw new Error("Prop is required: " + key); } function validateProps(component, props) { var required = !(arguments.length > 2 && void 0 !== arguments[2]) || arguments[2]; props = props || {}; if (props.env && "object" === _typeof(component.url) && !component.url[props.env]) throw new Error("Invalid env: " + props.env); for (var _iterator = component.getPropNames(), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); ;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var key = _ref, prop = component.getProp(key); if (prop.alias && props.hasOwnProperty(prop.alias)) { var value = props[prop.alias]; delete props[prop.alias]; props[key] || (props[key] = value); } } for (var _iterator2 = Object.keys(props), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator](); ;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2, _prop = component.getProp(_key), _value = props[_key]; _prop && validateProp(_prop, _key, _value, props, required); } for (var _iterator3 = component.getPropNames(), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator](); ;) { var _ref3; if (_isArray3) { if (_i3 >= _iterator3.length) break; _ref3 = _iterator3[_i3++]; } else { _i3 = _iterator3.next(); if (_i3.done) break; _ref3 = _i3.value; } var _key2 = _ref3, _prop2 = component.getProp(_key2), _value2 = props[_key2]; _prop2 && !props.hasOwnProperty(_key2) && validateProp(_prop2, _key2, _value2, props, required); } } function isDefined(value) { return null !== value && void 0 !== value && "" !== value; } function normalizeProp(component, instance, props, key, value) { var prop = component.getProp(key), resultValue = void 0; resultValue = prop.value ? prop.value : !prop.def || props.hasOwnProperty(key) && isDefined(value) ? value : prop.def.call(component, props); !resultValue && prop.alias && props[prop.alias] && (resultValue = props[prop.alias]); var decorated = !1; if (prop.decorate && null !== resultValue && void 0 !== resultValue) { resultValue = prop.decorate.call(instance, resultValue, props); decorated = !0; } var type = prop.type; if ("boolean" === type) resultValue = Boolean(resultValue); else if ("function" === type) { if (!resultValue && prop.noop) { resultValue = lib.I; !decorated && prop.decorate && (resultValue = prop.decorate.call(instance, lib.I, props)); } if (resultValue && "function" == typeof resultValue) { resultValue = resultValue.bind(instance); prop.denodeify && (resultValue = Object(lib.j)(resultValue)); prop.promisify && (resultValue = Object(lib.O)(resultValue)); var original = resultValue; resultValue = function() { component.log("call_prop_" + key); return original.apply(this, arguments); }; prop.once && (resultValue = Object(lib.L)(resultValue)); prop.memoize && (resultValue = Object(lib.G)(resultValue)); } } else "string" === type || "object" === type || "number" === type && void 0 !== resultValue && (resultValue = parseInt(resultValue, 10)); return resultValue; } function normalizeProps(component, instance, props) { var result = {}; props = props || {}; for (var _iterator = Object.keys(props), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator](); ;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var key = _ref; -1 !== component.getPropNames().indexOf(key) ? result[key] = normalizeProp(component, instance, props, key, props[key]) : result[key] = props[key]; } for (var _iterator2 = component.getPropNames(), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator](); ;) { var _ref2; if (_isArray2) { if (_i2 >= _iterator2.length) break; _ref2 = _iterator2[_i2++]; } else { _i2 = _iterator2.next(); if (_i2.done) break; _ref2 = _i2.value; } var _key = _ref2; if (!(props.hasOwnProperty(_key) || instance.props && instance.props.hasOwnProperty(_key))) { var normalizedProp = normalizeProp(component, instance, props, _key, props[_key]); void 0 !== normalizedProp && (result[_key] = normalizedProp); } } return result; } function getQueryParam(prop, key, value) { return zalgo_promise_src.a.try(function() { return "function" == typeof prop.queryParam ? prop.queryParam(value) : "string" == typeof prop.queryParam ? prop.queryParam : key; }); } function getQueryValue(prop, key, value) { return zalgo_promise_src.a.try(function() { return "function" == typeof prop.queryValue ? prop.queryValue(value) : value; }); } function propsToQuery(propsDef, props) { var params = {}; return zalgo_promise_src.a.all(Object.keys(props).map(function(key) { var prop = propsDef[key]; if (prop) return zalgo_promise_src.a.resolve().then(function() { var value = props[key]; if (value && prop.queryParam) return value; }).then(function(value) { if (value) return zalgo_promise_src.a.all([ getQueryParam(prop, key, value), getQueryValue(prop, key, value) ]).then(function(_ref3) { var queryParam = _ref3[0], queryValue = _ref3[1], result = void 0; if ("boolean" == typeof queryValue) result = "1"; else if ("string" == typeof queryValue) result = queryValue.toString(); else { if ("function" == typeof queryValue) return; if ("object" === (void 0 === queryValue ? "undefined" : props__typeof(queryValue)) && null !== queryValue) { if ("json" !== prop.serialization) { result = Object(lib.o)(queryValue, key); for (var _iterator3 = Object.keys(result), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator](); ;) { var _ref4; if (_isArray3) { if (_i3 >= _iterator3.length) break; _ref4 = _iterator3[_i3++]; } else { _i3 = _iterator3.next(); if (_i3.done) break; _ref4 = _i3.value; } var dotkey = _ref4; params[dotkey] = result[dotkey]; } return; } result = JSON.stringify(queryValue); } else "number" == typeof queryValue && (result = queryValue.toString()); } params[queryParam] = result; }); }); })).then(function() { return params; }); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function"); } function _possibleConstructorReturn(self, call) { if (!self) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return !call || "object" != typeof call && "function" != typeof call ? self : call; } function _inherits(subClass, superClass) { if ("function" != typeof superClass && null !== superClass) throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: !1, writable: !0, configurable: !0 } }); superClass && (Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass); } function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function(key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; ("value" in desc || desc.initializer) && (desc.writable = !0); desc = decorators.slice().reverse().reduce(function(desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && void 0 !== desc.initializer) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = void 0; } if (void 0 === desc.initializer) { Object.defineProperty(target, property, desc); desc = null; } return desc; } var client = __webpack_require__("./node_modules/beaver-logger/client/index.js"), src = __webpack_require__("./node_modules/post-robot/src/index.js"), cross_domain_utils_src = __webpack_require__("./node_modules/cross-domain-utils/src/index.js"), zalgo_promise_src = __webpack_require__("./node_modules/zalgo-promise/src/index.js"), base = __webpack_require__("./node_modules/xcomponent/src/component/base.js"), component_window = __webpack_require__("./node_modules/xcomponent/src/component/window.js"), lib = __webpack_require__("./node_modules/xcomponent/src/lib/index.js"), constants = __webpack_require__("./node_modules/xcomponent/src/constants.js"), src_error = __webpack_require__("./node_modules/xcomponent/src/error.js"), drivers = __webpack_require__("./node_modules/xcomponent/src/component/parent/drivers.js"), _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj; } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, props__typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj; } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; __webpack_require__.d(__webpack_exports__, "a", function() { return parent_ParentComponent; }); var _class, _extends = Object.assign || function(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) Object.prototype.hasOwnProperty.call(source, key) && (target[key] = source[key]); } return target; }, parent__typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj) { return typeof obj; } : function(obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _createClass = function() { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || !1; descriptor.configurable = !0; "value" in descriptor && (descriptor.writable = !0); Object.defineProperty(target, descriptor.key, descriptor); } } return function(Constructor, protoProps, staticProps) { protoProps && defineProperties(Constructor.prototype, protoProps); staticProps && defineProperties(Constructor, staticProps); return Constructor; }; }(); lib.y.props = lib.y.props || {}; lib.y.windows = lib.y.windows || {}; var parent_ParentComponent = (_class = function(_BaseComponent) { function ParentComponent(component, context, _ref) { var props = _ref.props; _classCallCheck(this, ParentComponent); var _this = _possibleConstructorReturn(this, _BaseComponent.call(this)); _this.component = component; _this.validateParentDomain(); _this.context = context; _this.setProps(props); _this.props.logLevel && Object(lib.S)(_this.props.logLevel); _this.childWindowName = _this.buildChildWindowName({ renderTo: window }); _this.registerActiveComponent(); _this.component.log("construct_parent"); _this.watchForUnload(); _this.onInit = new zalgo_promise_src.a(); _this.onInit.catch(function(err) { return _this.error(err); }); return _this; } _inherits(ParentComponent, _BaseComponent); ParentComponent.prototype.render = function(element) { var _this2 = this, loadUrl = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1]; return this.tryInit(function() { _this2.component.log("render_" + _this2.context, { context: _this2.context, element: element, loadUrl: Object(lib.W)(loadUrl) }); var tasks = {}; tasks.onRender = _this2.props.onRender(); tasks.getDomain = _this2.getDomain(); tasks.elementReady = zalgo_promise_src.a.try(function() { if (element) return _this2.elementReady(element); }); tasks.openContainer = tasks.elementReady.then(function() { return _this2.openContainer(element); }); tasks.showContainer = tasks.openContainer.then(function() { return _this2.showContainer(); }); tasks.openPrerender = tasks.openContainer.then(function() { return _this2.openPrerender(); }); tasks.switchPrerender = zalgo_promise_src.a.all([ tasks.openPrerender, _this2.onInit ]).then(function() { return _this2.switchPrerender(); }); tasks.open = _this2.driver.openOnClick ? _this2.open() : tasks.openContainer.then(function() { return _this2.open(); }); tasks.listen = zalgo_promise_src.a.all([ tasks.getDomain, tasks.open ]).then(function(_ref2) { var domain = _ref2[0]; _this2.listen(_this2.window, domain); }); tasks.watchForClose = tasks.open.then(function() { return _this2.watchForClose(); }); tasks.linkDomain = zalgo_promise_src.a.all([ tasks.getDomain, tasks.open ]).then(function(_ref3) { var domain = _ref3[0]; if (src.bridge && "string" == typeof domain) return src.bridge.linkUrl(_this2.window, domain); }); if (!_this2.html) { tasks.createPrerenderTemplate = tasks.openPrerender.then(function() { return _this2.createPrerenderTemplate(); }); tasks.showComponent = tasks.createPrerenderTemplate.then(function() { return _this2.showComponent(); }); } tasks.openBridge = zalgo_promise_src.a.all([ tasks.getDomain, tasks.open ]).then(function(_ref4) { var domain = _ref4[0]; return _this2.openBridge("string" == typeof domain ? domain : null); }); if (_this2.html) tasks.loadHTML = tasks.open.then(function() { return _this2.loadHTML(); }); else if (loadUrl) { tasks.buildUrl = _this2.buildUrl(); tasks.loadUrl = zalgo_promise_src.a.all([ tasks.buildUrl, tasks.open, tasks.linkDomain, tasks.listen, tasks.open, tasks.openBridge, tasks.createPrerenderTemplate ]).then(function(_ref5) { var url = _ref5[0]; return _this2.loadUrl(url); }); tasks.runTimeout = tasks.loadUrl.then(function() { return _this2.runTimeout(); }); } return zalgo_promise_src.a.hash(tasks); }).then(function() { return _this2.props.onEnter(); }).then(function() { return _this2; }); }; ParentComponent.prototype.getOutlet = function() { var outlet = document.createElement("div"); Object(lib.a)(outlet, constants.CLASS_NAMES.OUTLET); return outlet; }; ParentComponent.prototype.validateParentDomain = function() { var domain = Object(cross_domain_utils_src.getDomain)(); if (!Object(cross_domain_utils_src.matchDomain)(this.component.allowedParentDomains, domain)) throw new src_error.c("Can not be rendered by domain: " + domain); }; ParentComponent.prototype.renderTo = function(win, element) { var _this3 = this; return this.tryInit(function() { if (win === window) return _this3.render(element); if (!Object(cross_domain_utils_src.isSameTopWindow)(window, win)) throw new Error("Can only renderTo an adjacent frame"); if (element && "string" != typeof element) throw new Error("Element passed to renderTo must be a string selector, got " + (void 0 === element ? "undefined" : parent__typeof(element)) + " " + element); _this3.checkAllowRenderTo(win); _this3.component.log("render_" + _this3.context + "_to_win", { element: Object(lib.W)(element), context: _this3.context }); _this3.childWindowName = _this3.buildChildWindowName({ renderTo: win }); _this3.delegate(win); return _this3.render(element); }); }; ParentComponent.prototype.prefetch = function() { var _this4 = this; return zalgo_promise_src.a.try(function() { _this4.html = _this4.buildUrl().then(function(url) { return Object(lib.N)(url).then(function(html) { return '\n \n\n ' + html + "\n\n