diff --git a/dist/bellhop-umd.js.map b/dist/bellhop-umd.js.map index c862968..02f2e0e 100644 --- a/dist/bellhop-umd.js.map +++ b/dist/bellhop-umd.js.map @@ -1 +1 @@ -{"version":3,"file":"bellhop-umd.js","sources":["../node_modules/@babel/runtime/helpers/typeof.js","../node_modules/@babel/runtime/helpers/classCallCheck.js","../node_modules/@babel/runtime/helpers/createClass.js","../src/BellhopEventDispatcher.js","../node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js","../node_modules/@babel/runtime/helpers/assertThisInitialized.js","../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","../node_modules/@babel/runtime/helpers/getPrototypeOf.js","../node_modules/@babel/runtime/helpers/superPropBase.js","../node_modules/@babel/runtime/helpers/get.js","../node_modules/@babel/runtime/helpers/setPrototypeOf.js","../node_modules/@babel/runtime/helpers/inherits.js","../src/Bellhop.js"],"sourcesContent":["function _typeof2(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof2(obj); }\n\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && _typeof2(Symbol.iterator) === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return _typeof2(obj);\n };\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : _typeof2(obj);\n };\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck;","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nmodule.exports = _createClass;","/**\n * Function with a added priority type\n * @typedef {Function} PriorityFunction\n * @property {number} _priority\n */\n\n/**\n * Generic event dispatcher\n * @class BellhopEventDispatcher\n */\nexport class BellhopEventDispatcher {\n /**\n * The collection of event listeners\n * @property {Object} _listeners\n * @private\n */\n constructor() {\n this._listeners = {};\n }\n\n /**\n * Add an event listener to listen to an event from either the parent or iframe\n * @method on\n * @param {String} name The name of the event to listen\n * @param {PriorityFunction} callback The handler when an event is triggered\n * @param {number} [priority=0] The priority of the event listener. Higher numbers are handled first.\n */\n on(name, callback, priority = 0) {\n if (!this._listeners[name]) {\n this._listeners[name] = [];\n }\n callback._priority = parseInt(priority) || 0;\n\n // If callback is already set to this event\n if (-1 !== this._listeners[name].indexOf(callback)) {\n return;\n }\n\n this._listeners[name].push(callback);\n\n if (this._listeners[name].length > 1) {\n this._listeners[name].sort(this.listenerSorter);\n }\n }\n\n /**\n * @private\n * @param {PriorityFunction} a\n * @param {PriorityFunction} b\n * @returns {number};\n * Sorts listeners added by .on() by priority\n */\n listenerSorter(a, b) {\n return a._priority - b._priority;\n }\n\n /**\n * Remove an event listener\n * @method off\n * @param {String} name The name of event to listen for. If undefined, remove all listeners.\n * @param {Function} [callback] The optional handler when an event is triggered, if no callback\n * is set then all listeners by type are removed\n */\n off(name, callback) {\n if (this._listeners[name] === undefined) {\n return;\n }\n\n if (callback === undefined) {\n delete this._listeners[name];\n return;\n }\n\n const index = this._listeners[name].indexOf(callback);\n\n -1 < index ? this._listeners[name].splice(index, 1) : undefined;\n }\n\n /**\n * Trigger any event handlers for an event type\n * @method trigger\n * @param {object | String} event The event to send\n * @param {object} [data = {}] optional data to send to other areas in the app that are listening for this event\n */\n trigger(event, data = {}) {\n if (typeof event == 'string') {\n event = {\n type: event,\n data: 'object' === typeof data && null !== data ? data : {}\n };\n }\n\n if ('undefined' !== typeof this._listeners[event.type]) {\n for (let i = this._listeners[event.type].length - 1; i >= 0; i--) {\n this._listeners[event.type][i](event);\n }\n }\n }\n\n /**\n * Reset the listeners object\n * @method destroy\n */\n destroy() {\n this._listeners = {};\n }\n}\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunctionPrototype[toStringTagSymbol] =\n GeneratorFunction.displayName = \"GeneratorFunction\";\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n if (!(toStringTagSymbol in genFun)) {\n genFun[toStringTagSymbol] = \"GeneratorFunction\";\n }\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return Promise.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return Promise.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new Promise(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList) {\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList)\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n Gp[toStringTagSymbol] = \"Generator\";\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n","function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nmodule.exports = _assertThisInitialized;","var _typeof = require(\"../helpers/typeof\");\n\nvar assertThisInitialized = require(\"./assertThisInitialized\");\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return assertThisInitialized(self);\n}\n\nmodule.exports = _possibleConstructorReturn;","function _getPrototypeOf(o) {\n module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nmodule.exports = _getPrototypeOf;","var getPrototypeOf = require(\"./getPrototypeOf\");\n\nfunction _superPropBase(object, property) {\n while (!Object.prototype.hasOwnProperty.call(object, property)) {\n object = getPrototypeOf(object);\n if (object === null) break;\n }\n\n return object;\n}\n\nmodule.exports = _superPropBase;","var superPropBase = require(\"./superPropBase\");\n\nfunction _get(target, property, receiver) {\n if (typeof Reflect !== \"undefined\" && Reflect.get) {\n module.exports = _get = Reflect.get;\n } else {\n module.exports = _get = function _get(target, property, receiver) {\n var base = superPropBase(target, property);\n if (!base) return;\n var desc = Object.getOwnPropertyDescriptor(base, property);\n\n if (desc.get) {\n return desc.get.call(receiver);\n }\n\n return desc.value;\n };\n }\n\n return _get(target, property, receiver || target);\n}\n\nmodule.exports = _get;","function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nmodule.exports = _setPrototypeOf;","var setPrototypeOf = require(\"./setPrototypeOf\");\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}\n\nmodule.exports = _inherits;","import { BellhopEventDispatcher } from './BellhopEventDispatcher.js';\n\n/**\n * Abstract communication layer between the iframe\n * and the parent DOM\n * @class Bellhop\n * @extends BellhopEventDispatcher\n */\nexport class Bellhop extends BellhopEventDispatcher {\n /**\n * Creates an instance of Bellhop.\n * @memberof Bellhop\n * @param { string | number } id the id of the Bellhop instance\n * @param { boolean | function } debug whether debug mode should be turned on for the bellhop instance\n */\n constructor(id = (Math.random() * 100) | 0) {\n super();\n\n /**\n * The instance ID for bellhop\n * @property {string} id\n */\n this.id = `BELLHOP:${id}`;\n /**\n * If we are connected to another instance of bellhop\n * @property {Boolean} connected\n * @readOnly\n * @default false\n * @private\n */\n this.connected = false;\n\n /**\n * If this instance represents an iframe instance\n * @property {Boolean} isChild\n * @private\n * @default true\n */\n this.isChild = true;\n\n /**\n * If we are currently trying to connect\n * @property {Boolean} connecting\n * @default false\n * @private\n */\n this.connecting = false;\n\n /**\n * If debug mode is turned on\n * @property {Boolean} debug\n * @default false\n * @private\n */\n this.debug = false;\n\n /**\n * If using cross-domain, the domain to post to\n * @property {string} origin\n * @private\n * @default \"*\"\n */\n this.origin = '*';\n\n /**\n * Save any sends to wait until after we're done\n * @property {Array} _sendLater\n * @private\n */\n this._sendLater = [];\n\n /**\n * The iframe element\n * @property {HTMLIFrameElement} iframe\n * @private\n * @readOnly\n */\n this.iframe = null;\n\n /**\n * The bound receive function\n * @property {Function} receive\n * @private\n */\n this.receive = this.receive.bind(this);\n\n }\n\n /**\n * The connection has been established successfully\n * @event connected\n */\n\n /**\n * Connection could not be established\n * @event failed\n */\n\n /**\n * Handle messages in the window\n * @method receive\n * @param { MessageEvent } message the post message received from another bellhop instance\n * @private\n */\n receive(message) {\n // Ignore messages that don't originate from the target\n // we're connected to\n if (this.target !== message.source) {\n return;\n }\n\n this.logDebugMessage(true, message);\n\n // If this is not the initial connection message\n if (message.data !== 'connected') {\n let data = message.data;\n // Check to see if the data was sent as a stringified json\n if ('string' === typeof data) {\n try {\n data = JSON.parse(data);\n } catch (err) {\n console.error('Bellhop error: ', err);\n }\n }\n if (this.connected && 'object' === typeof data && data.type) {\n\n this.trigger(data);\n }\n return;\n }\n // Else setup the connection\n this.onConnectionReceived(message.data);\n }\n /**\n * @memberof Bellhop\n * @param {object} message the message received from the other bellhop instance\n * @private\n */\n onConnectionReceived(message) {\n this.connecting = false;\n this.connected = true;\n\n // Be polite and respond to the child that we're ready\n if (!this.isChild) {\n this.target.postMessage(message, this.origin);\n }\n\n // If we have any sends waiting to send\n // we are now connected and it should be okay\n for (let i = 0; i < this._sendLater.length; i++) {\n const { type, data } = this._sendLater[i];\n this.send(type, data);\n }\n this._sendLater.length = 0;\n\n // If there is a connection event assigned call it\n this.trigger('connected');\n }\n\n /**\n * Setup the connection\n * @method connect\n * @param {HTMLIFrameElement} iframe The iframe to communicate with. If no value is set, the assumption\n * is that we're the child trying to communcate with our window.parent\n * @param {String} [origin=\"*\"] The domain to communicate with if different from the current.\n * @return {Bellhop} Return instance of current object\n */\n connect(iframe, origin = '*') {\n // Ignore if we're already trying to connect\n if (this.connecting) {\n return;\n }\n\n // Disconnect from any existing connection\n this.disconnect();\n\n // We are trying to connect\n this.connecting = true;\n\n // The iframe if we're the parent\n if (iframe instanceof HTMLIFrameElement) {\n this.iframe = iframe;\n }\n\n // The instance of bellhop is inside the iframe\n this.isChild = iframe === undefined;\n\n this.supported = true;\n if (this.isChild) {\n // for child pages, the window passed must be a different window\n this.supported = window != iframe;\n }\n\n this.origin = origin;\n\n window.addEventListener('message', this.receive);\n\n if (this.isChild) {\n // No parent, can't connect\n if (window === this.target) {\n this.trigger('failed');\n } else {\n // If connect is called after the window is ready\n // we can go ahead and send the connect message\n this.target.postMessage('connected', this.origin);\n }\n }\n }\n\n /**\n * Disconnect if there are any open connections\n * @method disconnect\n */\n disconnect() {\n this.connected = false;\n this.connecting = false;\n this.origin = null;\n this.iframe = null;\n this.isChild = true;\n this._sendLater.length = 0;\n\n window.removeEventListener('message', this.receive);\n }\n\n /**\n * Send an event to the connected instance\n * @method send\n * @param {string} type name/type of the event\n * @param {*} [data = {}] Additional data to send along with event\n */\n send(type, data = {}) {\n if (typeof type !== 'string') {\n throw 'The event type must be a string';\n }\n\n const message = {\n type,\n data\n };\n\n this.logDebugMessage(false, message);\n\n if (this.connecting) {\n this._sendLater.push(message);\n } else {\n this.target.postMessage(JSON.stringify(message), this.origin);\n }\n }\n\n /**\n * A convenience method for sending and listening to create\n * a singular link for fetching data. This is the same as calling send\n * and then getting a response right away with the same event.\n * @method fetch\n * @param {String} event The name of the event\n * @param {Function} callback The callback to call after, takes event object as one argument\n * @param {Object} [data = {}] Optional data to pass along\n * @param {Boolean} [runOnce=false] If we only want to fetch once and then remove the listener\n */\n fetch(event, callback, data = {}, runOnce = false) {\n if (!this.connecting && !this.connected) {\n throw 'No connection, please call connect() first';\n }\n\n const internalCallback = e => {\n if (runOnce) {\n this.off(e.type, internalCallback);\n }\n\n callback(e);\n };\n\n this.on(event, internalCallback);\n this.send(event, data);\n }\n\n /**\n * A convience method for listening to an event and then responding with some data\n * right away. Automatically removes the listener\n * @method respond\n * @param {String} event The name of the event\n * @param {Object | function | Promise | string} [data = {}] The object to pass back.\n * \tMay also be a function; the return value will be sent as data in this case.\n * @param {Boolean} [runOnce=false] If we only want to respond once and then remove the listener\n *\n */\n respond(event, data = {}, runOnce = false) {\n const bellhop = this; //'this' for use inside async function\n /**\n * @ignore\n */\n const internalCallback = async function (event) {\n if (runOnce) {\n bellhop.off(event, internalCallback);\n }\n if (typeof data === 'function') {\n data = data();\n }\n const newData = await data;\n bellhop.send(event.type, newData);\n };\n this.on(event, internalCallback);\n }\n\n /**\n * Send either the default log message or the callback provided if debug\n * is enabled\n * @method logDebugMessage\n */\n logDebugMessage(received = false, message) {\n if (this.debug && typeof this.debug === 'function') {\n this.debug({ isChild: this.isChild, received: false, message: message });\n } else if (this.debug) {\n console.log(`Bellhop Instance (${this.isChild ? 'Child' : 'Parent'}) ${received ? 'Receieved' : 'Sent'}`, message);\n }\n }\n\n /**\n * Destroy and don't user after this\n * @method destroy\n */\n destroy() {\n super.destroy();\n this.disconnect();\n this._sendLater.length = 0;\n }\n\n /**\n *\n * Returns the correct parent element for Bellhop's context\n * @readonly\n * @memberof Bellhop\n */\n get target() {\n return this.isChild ? window.parent : this.iframe.contentWindow;\n }\n}\n"],"names":["_typeof2","obj","Symbol","iterator","constructor","prototype","_typeof","module","instance","Constructor","TypeError","_defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","key","protoProps","staticProps","BellhopEventDispatcher","_listeners","name","callback","priority","this","_priority","parseInt","indexOf","push","sort","listenerSorter","a","b","undefined","index","splice","event","data","type","runtime","exports","Op","hasOwn","hasOwnProperty","$Symbol","iteratorSymbol","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","create","context","Context","_invoke","state","GenStateSuspendedStart","method","arg","GenStateExecuting","Error","GenStateCompleted","doneResult","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","done","GenStateSuspendedYield","value","makeInvokeMethod","fn","call","err","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","AsyncIterator","previousPromise","callInvokeWithMethodAndArg","Promise","resolve","reject","invoke","result","__await","then","unwrapped","error","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","displayName","isGeneratorFunction","genFun","ctor","mark","setPrototypeOf","__proto__","awrap","async","iter","toString","keys","object","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","regeneratorRuntime","accidentalStrictMode","Function","ReferenceError","assertThisInitialized","_getPrototypeOf","o","property","_get","receiver","Reflect","get","base","superPropBase","desc","getOwnPropertyDescriptor","_setPrototypeOf","p","subClass","superClass","Bellhop","id","Math","random","connected","isChild","connecting","debug","origin","_sendLater","iframe","receive","_this","bind","message","source","logDebugMessage","onConnectionReceived","JSON","parse","console","trigger","postMessage","send","disconnect","HTMLIFrameElement","supported","window","addEventListener","removeEventListener","stringify","runOnce","internalCallback","e","_this2","off","on","bellhop","newData","received","log","parent","contentWindow"],"mappings":"ySAASA,EAASC,UAAkFD,EAArD,mBAAXE,QAAoD,iBAApBA,OAAOC,SAAoC,SAAkBF,iBAAqBA,GAA4B,SAAkBA,UAAcA,GAAyB,mBAAXC,QAAyBD,EAAIG,cAAgBF,QAAUD,IAAQC,OAAOG,UAAY,gBAAkBJ,IAA0BA,YAErVK,EAAQL,SACO,mBAAXC,QAAuD,WAA9BF,EAASE,OAAOC,UAClDI,UAAiBD,EAAU,SAAiBL,UACnCD,EAASC,IAGlBM,UAAiBD,EAAU,SAAiBL,UACnCA,GAAyB,mBAAXC,QAAyBD,EAAIG,cAAgBF,QAAUD,IAAQC,OAAOG,UAAY,SAAWL,EAASC,IAIxHK,EAAQL,GAGjBM,UAAiBD,KCVjB,MANA,SAAyBE,EAAUC,QAC3BD,aAAoBC,SAClB,IAAIC,UAAU,sCCFxB,SAASC,EAAkBC,EAAQC,OAC5B,IAAIC,EAAI,EAAGA,EAAID,EAAME,OAAQD,IAAK,KACjCE,EAAaH,EAAMC,GACvBE,EAAWC,WAAaD,EAAWC,aAAc,EACjDD,EAAWE,cAAe,EACtB,UAAWF,IAAYA,EAAWG,UAAW,GACjDC,OAAOC,eAAeT,EAAQI,EAAWM,IAAKN,IAUlD,MANA,SAAsBP,EAAac,EAAYC,UACzCD,GAAYZ,EAAkBF,EAAYJ,UAAWkB,GACrDC,GAAab,EAAkBF,EAAae,GACzCf,GCHIgB,yCAOJC,WAAa,wCAUjBC,EAAMC,OAAUC,yDAAW,EACv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OAASrM,KAAKsK,OAAOgC,qBAtUzB3M"} \ No newline at end of file +{"version":3,"file":"bellhop-umd.js","sources":["../node_modules/@babel/runtime/helpers/typeof.js","../node_modules/@babel/runtime/helpers/classCallCheck.js","../node_modules/@babel/runtime/helpers/createClass.js","../src/BellhopEventDispatcher.js","../node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js","../node_modules/@babel/runtime/helpers/assertThisInitialized.js","../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","../node_modules/@babel/runtime/helpers/getPrototypeOf.js","../node_modules/@babel/runtime/helpers/superPropBase.js","../node_modules/@babel/runtime/helpers/get.js","../node_modules/@babel/runtime/helpers/setPrototypeOf.js","../node_modules/@babel/runtime/helpers/inherits.js","../src/Bellhop.js"],"sourcesContent":["function _typeof2(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof2(obj); }\n\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && _typeof2(Symbol.iterator) === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return _typeof2(obj);\n };\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : _typeof2(obj);\n };\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck;","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nmodule.exports = _createClass;","/**\n * Function with a added priority type\n * @typedef {Function} PriorityFunction\n * @property {number} _priority\n */\n\n/**\n * Generic event dispatcher\n * @class BellhopEventDispatcher\n */\nexport class BellhopEventDispatcher {\n /**\n * The collection of event listeners\n * @property {Object} _listeners\n * @private\n */\n constructor() {\n this._listeners = {};\n }\n\n /**\n * Add an event listener to listen to an event from either the parent or iframe\n * @method on\n * @param {String} name The name of the event to listen\n * @param {PriorityFunction} callback The handler when an event is triggered\n * @param {number} [priority=0] The priority of the event listener. Higher numbers are handled first.\n */\n on(name, callback, priority = 0) {\n if (!this._listeners[name]) {\n this._listeners[name] = [];\n }\n callback._priority = parseInt(priority) || 0;\n\n // If callback is already set to this event\n if (-1 !== this._listeners[name].indexOf(callback)) {\n return;\n }\n\n this._listeners[name].push(callback);\n\n if (this._listeners[name].length > 1) {\n this._listeners[name].sort(this.listenerSorter);\n }\n }\n\n /**\n * @private\n * @param {PriorityFunction} a\n * @param {PriorityFunction} b\n * @returns {number};\n * Sorts listeners added by .on() by priority\n */\n listenerSorter(a, b) {\n return a._priority - b._priority;\n }\n\n /**\n * Remove an event listener\n * @method off\n * @param {String} name The name of event to listen for. If undefined, remove all listeners.\n * @param {Function} [callback] The optional handler when an event is triggered, if no callback\n * is set then all listeners by type are removed\n */\n off(name, callback) {\n if (this._listeners[name] === undefined) {\n return;\n }\n\n if (callback === undefined) {\n delete this._listeners[name];\n return;\n }\n\n const index = this._listeners[name].indexOf(callback);\n\n -1 < index ? this._listeners[name].splice(index, 1) : undefined;\n }\n\n /**\n * Trigger any event handlers for an event type\n * @method trigger\n * @param {object | String} event The event to send\n * @param {object} [data = {}] optional data to send to other areas in the app that are listening for this event\n */\n trigger(event, data = {}) {\n if (typeof event == 'string') {\n event = {\n type: event,\n data: 'object' === typeof data && null !== data ? data : {}\n };\n }\n\n if ('undefined' !== typeof this._listeners[event.type]) {\n for (let i = this._listeners[event.type].length - 1; i >= 0; i--) {\n this._listeners[event.type][i](event);\n }\n }\n }\n\n /**\n * Reset the listeners object\n * @method destroy\n */\n destroy() {\n this._listeners = {};\n }\n}\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunctionPrototype[toStringTagSymbol] =\n GeneratorFunction.displayName = \"GeneratorFunction\";\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n if (!(toStringTagSymbol in genFun)) {\n genFun[toStringTagSymbol] = \"GeneratorFunction\";\n }\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return Promise.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return Promise.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new Promise(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList) {\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList)\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n Gp[toStringTagSymbol] = \"Generator\";\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n","function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nmodule.exports = _assertThisInitialized;","var _typeof = require(\"../helpers/typeof\");\n\nvar assertThisInitialized = require(\"./assertThisInitialized\");\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return assertThisInitialized(self);\n}\n\nmodule.exports = _possibleConstructorReturn;","function _getPrototypeOf(o) {\n module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nmodule.exports = _getPrototypeOf;","var getPrototypeOf = require(\"./getPrototypeOf\");\n\nfunction _superPropBase(object, property) {\n while (!Object.prototype.hasOwnProperty.call(object, property)) {\n object = getPrototypeOf(object);\n if (object === null) break;\n }\n\n return object;\n}\n\nmodule.exports = _superPropBase;","var superPropBase = require(\"./superPropBase\");\n\nfunction _get(target, property, receiver) {\n if (typeof Reflect !== \"undefined\" && Reflect.get) {\n module.exports = _get = Reflect.get;\n } else {\n module.exports = _get = function _get(target, property, receiver) {\n var base = superPropBase(target, property);\n if (!base) return;\n var desc = Object.getOwnPropertyDescriptor(base, property);\n\n if (desc.get) {\n return desc.get.call(receiver);\n }\n\n return desc.value;\n };\n }\n\n return _get(target, property, receiver || target);\n}\n\nmodule.exports = _get;","function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nmodule.exports = _setPrototypeOf;","var setPrototypeOf = require(\"./setPrototypeOf\");\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}\n\nmodule.exports = _inherits;","import { BellhopEventDispatcher } from './BellhopEventDispatcher.js';\n\n/**\n * Abstract communication layer between the iframe\n * and the parent DOM\n * @class Bellhop\n * @extends BellhopEventDispatcher\n */\nexport class Bellhop extends BellhopEventDispatcher {\n /**\n * Creates an instance of Bellhop.\n * @memberof Bellhop\n * @param { string | number } id the id of the Bellhop instance\n */\n constructor(id = (Math.random() * 100) | 0) {\n super();\n\n /**\n * The instance ID for bellhop\n * @property {string} id\n */\n this.id = `BELLHOP:${id}`;\n /**\n * If we are connected to another instance of bellhop\n * @property {Boolean} connected\n * @readOnly\n * @default false\n * @private\n */\n this.connected = false;\n\n /**\n * If this instance represents an iframe instance\n * @property {Boolean} isChild\n * @private\n * @default true\n */\n this.isChild = true;\n\n /**\n * If we are currently trying to connect\n * @property {Boolean} connecting\n * @default false\n * @private\n */\n this.connecting = false;\n\n /**\n * If debug mode is turned on\n * @property {Boolean} debug\n * @default false\n * @private\n */\n this.debug = false;\n\n /**\n * If using cross-domain, the domain to post to\n * @property {string} origin\n * @private\n * @default \"*\"\n */\n this.origin = '*';\n\n /**\n * Save any sends to wait until after we're done\n * @property {Array} _sendLater\n * @private\n */\n this._sendLater = [];\n\n /**\n * The iframe element\n * @property {HTMLIFrameElement} iframe\n * @private\n * @readOnly\n */\n this.iframe = null;\n\n /**\n * The bound receive function\n * @property {Function} receive\n * @private\n */\n this.receive = this.receive.bind(this);\n }\n\n /**\n * The connection has been established successfully\n * @event connected\n */\n\n /**\n * Connection could not be established\n * @event failed\n */\n\n /**\n * Handle messages in the window\n * @method receive\n * @param { MessageEvent } message the post message received from another bellhop instance\n * @private\n */\n receive(message) {\n // Ignore messages that don't originate from the target\n // we're connected to\n if (this.target !== message.source) {\n return;\n }\n\n this.logDebugMessage(true, message);\n\n // If this is not the initial connection message\n if (message.data !== 'connected') {\n let data = message.data;\n // Check to see if the data was sent as a stringified json\n if ('string' === typeof data) {\n try {\n data = JSON.parse(data);\n } catch (err) {\n console.error('Bellhop error: ', err);\n }\n }\n if (this.connected && 'object' === typeof data && data.type) {\n this.trigger(data);\n }\n return;\n }\n // Else setup the connection\n this.onConnectionReceived(message.data);\n }\n /**\n * @memberof Bellhop\n * @param {object} message the message received from the other bellhop instance\n * @private\n */\n onConnectionReceived(message) {\n this.connecting = false;\n this.connected = true;\n\n // Be polite and respond to the child that we're ready\n if (!this.isChild) {\n this.target.postMessage(message, this.origin);\n }\n\n // If we have any sends waiting to send\n // we are now connected and it should be okay\n for (let i = 0; i < this._sendLater.length; i++) {\n const { type, data } = this._sendLater[i];\n this.send(type, data);\n }\n this._sendLater.length = 0;\n\n // If there is a connection event assigned call it\n this.trigger('connected');\n }\n\n /**\n * Setup the connection\n * @method connect\n * @param {HTMLIFrameElement} iframe The iframe to communicate with. If no value is set, the assumption\n * is that we're the child trying to communcate with our window.parent\n * @param {String} [origin=\"*\"] The domain to communicate with if different from the current.\n * @return {Bellhop} Return instance of current object\n */\n connect(iframe, origin = '*') {\n // Ignore if we're already trying to connect\n if (this.connecting) {\n return;\n }\n\n // Disconnect from any existing connection\n this.disconnect();\n\n // We are trying to connect\n this.connecting = true;\n\n // The iframe if we're the parent\n if (iframe instanceof HTMLIFrameElement) {\n this.iframe = iframe;\n }\n\n // The instance of bellhop is inside the iframe\n this.isChild = iframe === undefined;\n\n this.supported = true;\n if (this.isChild) {\n // for child pages, the window passed must be a different window\n this.supported = window != iframe;\n }\n\n this.origin = origin;\n\n window.addEventListener('message', this.receive);\n\n if (this.isChild) {\n // No parent, can't connect\n if (window === this.target) {\n this.trigger('failed');\n } else {\n // If connect is called after the window is ready\n // we can go ahead and send the connect message\n this.target.postMessage('connected', this.origin);\n }\n }\n }\n\n /**\n * Disconnect if there are any open connections\n * @method disconnect\n */\n disconnect() {\n this.connected = false;\n this.connecting = false;\n this.origin = null;\n this.iframe = null;\n this.isChild = true;\n this._sendLater.length = 0;\n\n window.removeEventListener('message', this.receive);\n }\n\n /**\n * Send an event to the connected instance\n * @method send\n * @param {string} type name/type of the event\n * @param {*} [data = {}] Additional data to send along with event\n */\n send(type, data = {}) {\n if (typeof type !== 'string') {\n throw 'The event type must be a string';\n }\n\n const message = {\n type,\n data\n };\n\n this.logDebugMessage(false, message);\n\n if (this.connecting) {\n this._sendLater.push(message);\n } else {\n this.target.postMessage(JSON.stringify(message), this.origin);\n }\n }\n\n /**\n * A convenience method for sending and listening to create\n * a singular link for fetching data. This is the same as calling send\n * and then getting a response right away with the same event.\n * @method fetch\n * @param {String} event The name of the event\n * @param {Function} callback The callback to call after, takes event object as one argument\n * @param {Object} [data = {}] Optional data to pass along\n * @param {Boolean} [runOnce=false] If we only want to fetch once and then remove the listener\n */\n fetch(event, callback, data = {}, runOnce = false) {\n if (!this.connecting && !this.connected) {\n throw 'No connection, please call connect() first';\n }\n\n const internalCallback = e => {\n if (runOnce) {\n this.off(e.type, internalCallback);\n }\n\n callback(e);\n };\n\n this.on(event, internalCallback);\n this.send(event, data);\n }\n\n /**\n * A convience method for listening to an event and then responding with some data\n * right away. Automatically removes the listener\n * @method respond\n * @param {String} event The name of the event\n * @param {Object | function | Promise | string} [data = {}] The object to pass back.\n * \tMay also be a function; the return value will be sent as data in this case.\n * @param {Boolean} [runOnce=false] If we only want to respond once and then remove the listener\n *\n */\n respond(event, data = {}, runOnce = false) {\n const bellhop = this; //'this' for use inside async function\n /**\n * @ignore\n */\n const internalCallback = async function(event) {\n if (runOnce) {\n bellhop.off(event, internalCallback);\n }\n if (typeof data === 'function') {\n data = data();\n }\n const newData = await data;\n bellhop.send(event.type, newData);\n };\n this.on(event, internalCallback);\n }\n\n /**\n * Send either the default log message or the callback provided if debug\n * is enabled\n * @method logDebugMessage\n */\n logDebugMessage(received = false, message) {\n if (this.debug && typeof this.debug === 'function') {\n this.debug({ isChild: this.isChild, received: false, message: message });\n } else if (this.debug) {\n console.log(\n `Bellhop Instance (${this.isChild ? 'Child' : 'Parent'}) ${\n received ? 'Receieved' : 'Sent'\n }`,\n message\n );\n }\n }\n\n /**\n * Destroy and don't user after this\n * @method destroy\n */\n destroy() {\n super.destroy();\n this.disconnect();\n this._sendLater.length = 0;\n }\n\n /**\n *\n * Returns the correct parent element for Bellhop's context\n * @readonly\n * @memberof Bellhop\n */\n get target() {\n return this.isChild ? window.parent : this.iframe.contentWindow;\n }\n}\n"],"names":["_typeof2","obj","Symbol","iterator","constructor","prototype","_typeof","module","instance","Constructor","TypeError","_defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","key","protoProps","staticProps","BellhopEventDispatcher","_listeners","name","callback","priority","this","_priority","parseInt","indexOf","push","sort","listenerSorter","a","b","undefined","index","splice","event","data","type","runtime","exports","Op","hasOwn","hasOwnProperty","$Symbol","iteratorSymbol","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","create","context","Context","_invoke","state","GenStateSuspendedStart","method","arg","GenStateExecuting","Error","GenStateCompleted","doneResult","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","done","GenStateSuspendedYield","value","makeInvokeMethod","fn","call","err","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","AsyncIterator","previousPromise","callInvokeWithMethodAndArg","Promise","resolve","reject","invoke","result","__await","then","unwrapped","error","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","displayName","isGeneratorFunction","genFun","ctor","mark","setPrototypeOf","__proto__","awrap","async","iter","toString","keys","object","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","regeneratorRuntime","accidentalStrictMode","Function","ReferenceError","assertThisInitialized","_getPrototypeOf","o","property","_get","receiver","Reflect","get","base","superPropBase","desc","getOwnPropertyDescriptor","_setPrototypeOf","p","subClass","superClass","Bellhop","id","Math","random","connected","isChild","connecting","debug","origin","_sendLater","iframe","receive","_this","bind","message","source","logDebugMessage","onConnectionReceived","JSON","parse","console","trigger","postMessage","send","disconnect","HTMLIFrameElement","supported","window","addEventListener","removeEventListener","stringify","runOnce","internalCallback","e","_this2","off","on","bellhop","newData","received","log","parent","contentWindow"],"mappings":"ySAASA,EAASC,UAAkFD,EAArD,mBAAXE,QAAoD,iBAApBA,OAAOC,SAAoC,SAAkBF,iBAAqBA,GAA4B,SAAkBA,UAAcA,GAAyB,mBAAXC,QAAyBD,EAAIG,cAAgBF,QAAUD,IAAQC,OAAOG,UAAY,gBAAkBJ,IAA0BA,YAErVK,EAAQL,SACO,mBAAXC,QAAuD,WAA9BF,EAASE,OAAOC,UAClDI,UAAiBD,EAAU,SAAiBL,UACnCD,EAASC,IAGlBM,UAAiBD,EAAU,SAAiBL,UACnCA,GAAyB,mBAAXC,QAAyBD,EAAIG,cAAgBF,QAAUD,IAAQC,OAAOG,UAAY,SAAWL,EAASC,IAIxHK,EAAQL,GAGjBM,UAAiBD,KCVjB,MANA,SAAyBE,EAAUC,QAC3BD,aAAoBC,SAClB,IAAIC,UAAU,sCCFxB,SAASC,EAAkBC,EAAQC,OAC5B,IAAIC,EAAI,EAAGA,EAAID,EAAME,OAAQD,IAAK,KACjCE,EAAaH,EAAMC,GACvBE,EAAWC,WAAaD,EAAWC,aAAc,EACjDD,EAAWE,cAAe,EACtB,UAAWF,IAAYA,EAAWG,UAAW,GACjDC,OAAOC,eAAeT,EAAQI,EAAWM,IAAKN,IAUlD,MANA,SAAsBP,EAAac,EAAYC,UACzCD,GAAYZ,EAAkBF,EAAYJ,UAAWkB,GACrDC,GAAab,EAAkBF,EAAae,GACzCf,GCHIgB,EAAb,uCAOSC,WAAa,wCAUjBC,EAAMC,OAAUC,yDAAW,EACvBC,KAAKJ,WAAWC,UACdD,WAAWC,GAAQ,IAE1BC,EAASG,UAAYC,SAASH,IAAa,GAGtC,IAAMC,KAAKJ,WA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b/dist/bellhop.js.map index 8dc7e75..df81d04 100644 --- a/dist/bellhop.js.map +++ b/dist/bellhop.js.map @@ -1 +1 @@ -{"version":3,"file":"bellhop.js","sources":["../node_modules/@babel/runtime/helpers/typeof.js","../node_modules/@babel/runtime/helpers/classCallCheck.js","../node_modules/@babel/runtime/helpers/createClass.js","../src/BellhopEventDispatcher.js","../node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js","../node_modules/@babel/runtime/helpers/assertThisInitialized.js","../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","../node_modules/@babel/runtime/helpers/getPrototypeOf.js","../node_modules/@babel/runtime/helpers/superPropBase.js","../node_modules/@babel/runtime/helpers/get.js","../node_modules/@babel/runtime/helpers/setPrototypeOf.js","../node_modules/@babel/runtime/helpers/inherits.js","../src/Bellhop.js"],"sourcesContent":["function _typeof2(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof2(obj); }\n\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && _typeof2(Symbol.iterator) === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return _typeof2(obj);\n };\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : _typeof2(obj);\n };\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck;","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nmodule.exports = _createClass;","/**\n * Function with a added priority type\n * @typedef {Function} PriorityFunction\n * @property {number} _priority\n */\n\n/**\n * Generic event dispatcher\n * @class BellhopEventDispatcher\n */\nexport class BellhopEventDispatcher {\n /**\n * The collection of event listeners\n * @property {Object} _listeners\n * @private\n */\n constructor() {\n this._listeners = {};\n }\n\n /**\n * Add an event listener to listen to an event from either the parent or iframe\n * @method on\n * @param {String} name The name of the event to listen\n * @param {PriorityFunction} callback The handler when an event is triggered\n * @param {number} [priority=0] The priority of the event listener. Higher numbers are handled first.\n */\n on(name, callback, priority = 0) {\n if (!this._listeners[name]) {\n this._listeners[name] = [];\n }\n callback._priority = parseInt(priority) || 0;\n\n // If callback is already set to this event\n if (-1 !== this._listeners[name].indexOf(callback)) {\n return;\n }\n\n this._listeners[name].push(callback);\n\n if (this._listeners[name].length > 1) {\n this._listeners[name].sort(this.listenerSorter);\n }\n }\n\n /**\n * @private\n * @param {PriorityFunction} a\n * @param {PriorityFunction} b\n * @returns {number};\n * Sorts listeners added by .on() by priority\n */\n listenerSorter(a, b) {\n return a._priority - b._priority;\n }\n\n /**\n * Remove an event listener\n * @method off\n * @param {String} name The name of event to listen for. If undefined, remove all listeners.\n * @param {Function} [callback] The optional handler when an event is triggered, if no callback\n * is set then all listeners by type are removed\n */\n off(name, callback) {\n if (this._listeners[name] === undefined) {\n return;\n }\n\n if (callback === undefined) {\n delete this._listeners[name];\n return;\n }\n\n const index = this._listeners[name].indexOf(callback);\n\n -1 < index ? this._listeners[name].splice(index, 1) : undefined;\n }\n\n /**\n * Trigger any event handlers for an event type\n * @method trigger\n * @param {object | String} event The event to send\n * @param {object} [data = {}] optional data to send to other areas in the app that are listening for this event\n */\n trigger(event, data = {}) {\n if (typeof event == 'string') {\n event = {\n type: event,\n data: 'object' === typeof data && null !== data ? data : {}\n };\n }\n\n if ('undefined' !== typeof this._listeners[event.type]) {\n for (let i = this._listeners[event.type].length - 1; i >= 0; i--) {\n this._listeners[event.type][i](event);\n }\n }\n }\n\n /**\n * Reset the listeners object\n * @method destroy\n */\n destroy() {\n this._listeners = {};\n }\n}\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunctionPrototype[toStringTagSymbol] =\n GeneratorFunction.displayName = \"GeneratorFunction\";\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n if (!(toStringTagSymbol in genFun)) {\n genFun[toStringTagSymbol] = \"GeneratorFunction\";\n }\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return Promise.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return Promise.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new Promise(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList) {\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList)\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n Gp[toStringTagSymbol] = \"Generator\";\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n","function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nmodule.exports = _assertThisInitialized;","var _typeof = require(\"../helpers/typeof\");\n\nvar assertThisInitialized = require(\"./assertThisInitialized\");\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return assertThisInitialized(self);\n}\n\nmodule.exports = _possibleConstructorReturn;","function _getPrototypeOf(o) {\n module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nmodule.exports = _getPrototypeOf;","var getPrototypeOf = require(\"./getPrototypeOf\");\n\nfunction _superPropBase(object, property) {\n while (!Object.prototype.hasOwnProperty.call(object, property)) {\n object = getPrototypeOf(object);\n if (object === null) break;\n }\n\n return object;\n}\n\nmodule.exports = _superPropBase;","var superPropBase = require(\"./superPropBase\");\n\nfunction _get(target, property, receiver) {\n if (typeof Reflect !== \"undefined\" && Reflect.get) {\n module.exports = _get = Reflect.get;\n } else {\n module.exports = _get = function _get(target, property, receiver) {\n var base = superPropBase(target, property);\n if (!base) return;\n var desc = Object.getOwnPropertyDescriptor(base, property);\n\n if (desc.get) {\n return desc.get.call(receiver);\n }\n\n return desc.value;\n };\n }\n\n return _get(target, property, receiver || target);\n}\n\nmodule.exports = _get;","function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nmodule.exports = _setPrototypeOf;","var setPrototypeOf = require(\"./setPrototypeOf\");\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}\n\nmodule.exports = _inherits;","import { BellhopEventDispatcher } from './BellhopEventDispatcher.js';\n\n/**\n * Abstract communication layer between the iframe\n * and the parent DOM\n * @class Bellhop\n * @extends BellhopEventDispatcher\n */\nexport class Bellhop extends BellhopEventDispatcher {\n /**\n * Creates an instance of Bellhop.\n * @memberof Bellhop\n * @param { string | number } id the id of the Bellhop instance\n */\n constructor(id = (Math.random() * 100) | 0) {\n super();\n\n /**\n * The instance ID for bellhop\n * @property {string} id\n */\n this.id = `BELLHOP:${id}`;\n /**\n * If we are connected to another instance of bellhop\n * @property {Boolean} connected\n * @readOnly\n * @default false\n * @private\n */\n this.connected = false;\n\n /**\n * If this instance represents an iframe instance\n * @property {Boolean} isChild\n * @private\n * @default true\n */\n this.isChild = true;\n\n /**\n * If we are currently trying to connect\n * @property {Boolean} connecting\n * @default false\n * @private\n */\n this.connecting = false;\n\n /**\n * If debug mode is turned on\n * @property {Boolean} debug\n * @default false\n * @private\n */\n this.debug = false;\n\n /**\n * If using cross-domain, the domain to post to\n * @property {string} origin\n * @private\n * @default \"*\"\n */\n this.origin = '*';\n\n /**\n * Save any sends to wait until after we're done\n * @property {Array} _sendLater\n * @private\n */\n this._sendLater = [];\n\n /**\n * The iframe element\n * @property {HTMLIFrameElement} iframe\n * @private\n * @readOnly\n */\n this.iframe = null;\n\n /**\n * The bound receive function\n * @property {Function} receive\n * @private\n */\n this.receive = this.receive.bind(this);\n\n }\n\n /**\n * The connection has been established successfully\n * @event connected\n */\n\n /**\n * Connection could not be established\n * @event failed\n */\n\n /**\n * Handle messages in the window\n * @method receive\n * @param { MessageEvent } message the post message received from another bellhop instance\n * @private\n */\n receive(message) {\n // Ignore messages that don't originate from the target\n // we're connected to\n if (this.target !== message.source) {\n return;\n }\n\n this.logDebugMessage(true, message);\n\n // If this is not the initial connection message\n if (message.data !== 'connected') {\n let data = message.data;\n // Check to see if the data was sent as a stringified json\n if ('string' === typeof data) {\n try {\n data = JSON.parse(data);\n } catch (err) {\n console.error('Bellhop error: ', err);\n }\n }\n if (this.connected && 'object' === typeof data && data.type) {\n\n this.trigger(data);\n }\n return;\n }\n // Else setup the connection\n this.onConnectionReceived(message.data);\n }\n /**\n * @memberof Bellhop\n * @param {object} message the message received from the other bellhop instance\n * @private\n */\n onConnectionReceived(message) {\n this.connecting = false;\n this.connected = true;\n\n // Be polite and respond to the child that we're ready\n if (!this.isChild) {\n this.target.postMessage(message, this.origin);\n }\n\n // If we have any sends waiting to send\n // we are now connected and it should be okay\n for (let i = 0; i < this._sendLater.length; i++) {\n const { type, data } = this._sendLater[i];\n this.send(type, data);\n }\n this._sendLater.length = 0;\n\n // If there is a connection event assigned call it\n this.trigger('connected');\n }\n\n /**\n * Setup the connection\n * @method connect\n * @param {HTMLIFrameElement} iframe The iframe to communicate with. If no value is set, the assumption\n * is that we're the child trying to communcate with our window.parent\n * @param {String} [origin=\"*\"] The domain to communicate with if different from the current.\n * @return {Bellhop} Return instance of current object\n */\n connect(iframe, origin = '*') {\n // Ignore if we're already trying to connect\n if (this.connecting) {\n return;\n }\n\n // Disconnect from any existing connection\n this.disconnect();\n\n // We are trying to connect\n this.connecting = true;\n\n // The iframe if we're the parent\n if (iframe instanceof HTMLIFrameElement) {\n this.iframe = iframe;\n }\n\n // The instance of bellhop is inside the iframe\n this.isChild = iframe === undefined;\n\n this.supported = true;\n if (this.isChild) {\n // for child pages, the window passed must be a different window\n this.supported = window != iframe;\n }\n\n this.origin = origin;\n\n window.addEventListener('message', this.receive);\n\n if (this.isChild) {\n // No parent, can't connect\n if (window === this.target) {\n this.trigger('failed');\n } else {\n // If connect is called after the window is ready\n // we can go ahead and send the connect message\n this.target.postMessage('connected', this.origin);\n }\n }\n }\n\n /**\n * Disconnect if there are any open connections\n * @method disconnect\n */\n disconnect() {\n this.connected = false;\n this.connecting = false;\n this.origin = null;\n this.iframe = null;\n this.isChild = true;\n this._sendLater.length = 0;\n\n window.removeEventListener('message', this.receive);\n }\n\n /**\n * Send an event to the connected instance\n * @method send\n * @param {string} type name/type of the event\n * @param {*} [data = {}] Additional data to send along with event\n */\n send(type, data = {}) {\n if (typeof type !== 'string') {\n throw 'The event type must be a string';\n }\n\n const message = {\n type,\n data\n };\n\n this.logDebugMessage(false, message);\n\n if (this.connecting) {\n this._sendLater.push(message);\n } else {\n this.target.postMessage(JSON.stringify(message), this.origin);\n }\n }\n\n /**\n * A convenience method for sending and listening to create\n * a singular link for fetching data. This is the same as calling send\n * and then getting a response right away with the same event.\n * @method fetch\n * @param {String} event The name of the event\n * @param {Function} callback The callback to call after, takes event object as one argument\n * @param {Object} [data = {}] Optional data to pass along\n * @param {Boolean} [runOnce=false] If we only want to fetch once and then remove the listener\n */\n fetch(event, callback, data = {}, runOnce = false) {\n if (!this.connecting && !this.connected) {\n throw 'No connection, please call connect() first';\n }\n\n const internalCallback = e => {\n if (runOnce) {\n this.off(e.type, internalCallback);\n }\n\n callback(e);\n };\n\n this.on(event, internalCallback);\n this.send(event, data);\n }\n\n /**\n * A convience method for listening to an event and then responding with some data\n * right away. Automatically removes the listener\n * @method respond\n * @param {String} event The name of the event\n * @param {Object | function | Promise | string} [data = {}] The object to pass back.\n * \tMay also be a function; the return value will be sent as data in this case.\n * @param {Boolean} [runOnce=false] If we only want to respond once and then remove the listener\n *\n */\n respond(event, data = {}, runOnce = false) {\n const bellhop = this; //'this' for use inside async function\n /**\n * @ignore\n */\n const internalCallback = async function (event) {\n if (runOnce) {\n bellhop.off(event, internalCallback);\n }\n if (typeof data === 'function') {\n data = data();\n }\n const newData = await data;\n bellhop.send(event.type, newData);\n };\n this.on(event, internalCallback);\n }\n\n /**\n * Send either the default log message or the callback provided if debug\n * is enabled\n * @method logDebugMessage\n */\n logDebugMessage(received = false, message) {\n if (this.debug && typeof this.debug === 'function') {\n this.debug({ isChild: this.isChild, received: false, message: message });\n } else if (this.debug) {\n console.log(`Bellhop Instance (${this.isChild ? 'Child' : 'Parent'}) ${received ? 'Receieved' : 'Sent'}`, message);\n }\n }\n\n /**\n * Destroy and don't user after this\n * @method destroy\n */\n destroy() {\n super.destroy();\n this.disconnect();\n this._sendLater.length = 0;\n }\n\n /**\n *\n * Returns the correct parent element for Bellhop's context\n * @readonly\n * @memberof Bellhop\n */\n get target() {\n return this.isChild ? window.parent : this.iframe.contentWindow;\n }\n}\n"],"names":["_typeof2","obj","Symbol","iterator","constructor","prototype","_typeof","module","instance","Constructor","TypeError","_defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","key","protoProps","staticProps","BellhopEventDispatcher","_listeners","name","callback","priority","this","_priority","parseInt","indexOf","push","sort","listenerSorter","a","b","undefined","index","splice","event","data","type","runtime","exports","Op","hasOwn","hasOwnProperty","$Symbol","iteratorSymbol","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","create","context","Context","_invoke","state","GenStateSuspendedStart","method","arg","GenStateExecuting","Error","GenStateCompleted","doneResult","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","done","GenStateSuspendedYield","value","makeInvokeMethod","fn","call","err","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","AsyncIterator","previousPromise","callInvokeWithMethodAndArg","Promise","resolve","reject","invoke","result","__await","then","unwrapped","error","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","displayName","isGeneratorFunction","genFun","ctor","mark","setPrototypeOf","__proto__","awrap","async","iter","toString","keys","object","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","regeneratorRuntime","accidentalStrictMode","Function","ReferenceError","assertThisInitialized","_getPrototypeOf","o","property","_get","receiver","Reflect","get","base","superPropBase","desc","getOwnPropertyDescriptor","_setPrototypeOf","p","subClass","superClass","Bellhop","id","Math","random","connected","isChild","connecting","debug","origin","_sendLater","iframe","receive","_this","bind","message","source","logDebugMessage","onConnectionReceived","JSON","parse","console","trigger","postMessage","send","disconnect","HTMLIFrameElement","supported","window","addEventListener","removeEventListener","stringify","runOnce","internalCallback","e","_this2","off","on","bellhop","newData","received","log","parent","contentWindow"],"mappings":"2FAASA,EAASC,UAAkFD,EAArD,mBAAXE,QAAoD,iBAApBA,OAAOC,SAAoC,SAAkBF,iBAAqBA,GAA4B,SAAkBA,UAAcA,GAAyB,mBAAXC,QAAyBD,EAAIG,cAAgBF,QAAUD,IAAQC,OAAOG,UAAY,gBAAkBJ,IAA0BA,YAErVK,EAAQL,SACO,mBAAXC,QAAuD,WAA9BF,EAASE,OAAOC,UAClDI,UAAiBD,EAAU,SAAiBL,UACnCD,EAASC,IAGlBM,UAAiBD,EAAU,SAAiBL,UACnCA,GAAyB,mBAAXC,QAAyBD,EAAIG,cAAgBF,QAAUD,IAAQC,OAAOG,UAAY,SAAWL,EAASC,IAIxHK,EAAQL,GAGjBM,UAAiBD,KCVjB,MANA,SAAyBE,EAAUC,QAC3BD,aAAoBC,SAClB,IAAIC,UAAU,sCCFxB,SAASC,EAAkBC,EAAQC,OAC5B,IAAIC,EAAI,EAAGA,EAAID,EAAME,OAAQD,IAAK,KACjCE,EAAaH,EAAMC,GACvBE,EAAWC,WAAaD,EAAWC,aAAc,EACjDD,EAAWE,cAAe,EACtB,UAAWF,IAAYA,EAAWG,UAAW,GACjDC,OAAOC,eAAeT,EAAQI,EAAWM,IAAKN,IAUlD,MANA,SAAsBP,EAAac,EAAYC,UACzCD,GAAYZ,EAAkBF,EAAYJ,UAAWkB,GACrDC,GAAab,EAAkBF,EAAae,GACzCf,GCHIgB,yCAOJC,WAAa,wCAUjBC,EAAMC,OAAUC,yDAAW,EACvBC,KAAKJ,WAAWC,UACdD,WAAWC,GAAQ,IAE1BC,EAASG,UAAYC,SAASH,IAAa,GA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node_modules/@babel/runtime/helpers/typeof.js","../node_modules/@babel/runtime/helpers/classCallCheck.js","../node_modules/@babel/runtime/helpers/createClass.js","../src/BellhopEventDispatcher.js","../node_modules/@babel/runtime/node_modules/regenerator-runtime/runtime.js","../node_modules/@babel/runtime/helpers/assertThisInitialized.js","../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","../node_modules/@babel/runtime/helpers/getPrototypeOf.js","../node_modules/@babel/runtime/helpers/superPropBase.js","../node_modules/@babel/runtime/helpers/get.js","../node_modules/@babel/runtime/helpers/setPrototypeOf.js","../node_modules/@babel/runtime/helpers/inherits.js","../src/Bellhop.js"],"sourcesContent":["function _typeof2(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof2(obj); }\n\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && _typeof2(Symbol.iterator) === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return _typeof2(obj);\n };\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : _typeof2(obj);\n };\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck;","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nmodule.exports = _createClass;","/**\n * Function with a added priority type\n * @typedef {Function} PriorityFunction\n * @property {number} _priority\n */\n\n/**\n * Generic event dispatcher\n * @class BellhopEventDispatcher\n */\nexport class BellhopEventDispatcher {\n /**\n * The collection of event listeners\n * @property {Object} _listeners\n * @private\n */\n constructor() {\n this._listeners = {};\n }\n\n /**\n * Add an event listener to listen to an event from either the parent or iframe\n * @method on\n * @param {String} name The name of the event to listen\n * @param {PriorityFunction} callback The handler when an event is triggered\n * @param {number} [priority=0] The priority of the event listener. Higher numbers are handled first.\n */\n on(name, callback, priority = 0) {\n if (!this._listeners[name]) {\n this._listeners[name] = [];\n }\n callback._priority = parseInt(priority) || 0;\n\n // If callback is already set to this event\n if (-1 !== this._listeners[name].indexOf(callback)) {\n return;\n }\n\n this._listeners[name].push(callback);\n\n if (this._listeners[name].length > 1) {\n this._listeners[name].sort(this.listenerSorter);\n }\n }\n\n /**\n * @private\n * @param {PriorityFunction} a\n * @param {PriorityFunction} b\n * @returns {number};\n * Sorts listeners added by .on() by priority\n */\n listenerSorter(a, b) {\n return a._priority - b._priority;\n }\n\n /**\n * Remove an event listener\n * @method off\n * @param {String} name The name of event to listen for. If undefined, remove all listeners.\n * @param {Function} [callback] The optional handler when an event is triggered, if no callback\n * is set then all listeners by type are removed\n */\n off(name, callback) {\n if (this._listeners[name] === undefined) {\n return;\n }\n\n if (callback === undefined) {\n delete this._listeners[name];\n return;\n }\n\n const index = this._listeners[name].indexOf(callback);\n\n -1 < index ? this._listeners[name].splice(index, 1) : undefined;\n }\n\n /**\n * Trigger any event handlers for an event type\n * @method trigger\n * @param {object | String} event The event to send\n * @param {object} [data = {}] optional data to send to other areas in the app that are listening for this event\n */\n trigger(event, data = {}) {\n if (typeof event == 'string') {\n event = {\n type: event,\n data: 'object' === typeof data && null !== data ? data : {}\n };\n }\n\n if ('undefined' !== typeof this._listeners[event.type]) {\n for (let i = this._listeners[event.type].length - 1; i >= 0; i--) {\n this._listeners[event.type][i](event);\n }\n }\n }\n\n /**\n * Reset the listeners object\n * @method destroy\n */\n destroy() {\n this._listeners = {};\n }\n}\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nvar runtime = (function (exports) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n exports.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunctionPrototype[toStringTagSymbol] =\n GeneratorFunction.displayName = \"GeneratorFunction\";\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }\n\n exports.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n exports.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n if (!(toStringTagSymbol in genFun)) {\n genFun[toStringTagSymbol] = \"GeneratorFunction\";\n }\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n exports.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return Promise.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return Promise.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new Promise(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n exports.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n exports.async = function(innerFn, outerFn, self, tryLocsList) {\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList)\n );\n\n return exports.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n // Note: [\"return\"] must be used for ES3 parsing compatibility.\n if (delegate.iterator[\"return\"]) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n Gp[toStringTagSymbol] = \"Generator\";\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n exports.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n exports.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n\n // Regardless of whether this script is executing as a CommonJS module\n // or not, return the runtime object so that we can declare the variable\n // regeneratorRuntime in the outer scope, which allows this module to be\n // injected easily by `bin/regenerator --include-runtime script.js`.\n return exports;\n\n}(\n // If this script is executing as a CommonJS module, use module.exports\n // as the regeneratorRuntime namespace. Otherwise create a new empty\n // object. Either way, the resulting object will be used to initialize\n // the regeneratorRuntime variable at the top of this file.\n typeof module === \"object\" ? module.exports : {}\n));\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n // This module should not be running in strict mode, so the above\n // assignment should always work unless something is misconfigured. Just\n // in case runtime.js accidentally runs in strict mode, we can escape\n // strict mode using a global Function call. This could conceivably fail\n // if a Content Security Policy forbids using Function, but in that case\n // the proper solution is to fix the accidental strict mode problem. If\n // you've misconfigured your bundler to force strict mode and applied a\n // CSP to forbid Function, and you're not willing to fix either of those\n // problems, please detail your unique predicament in a GitHub issue.\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n}\n","function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nmodule.exports = _assertThisInitialized;","var _typeof = require(\"../helpers/typeof\");\n\nvar assertThisInitialized = require(\"./assertThisInitialized\");\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return assertThisInitialized(self);\n}\n\nmodule.exports = _possibleConstructorReturn;","function _getPrototypeOf(o) {\n module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nmodule.exports = _getPrototypeOf;","var getPrototypeOf = require(\"./getPrototypeOf\");\n\nfunction _superPropBase(object, property) {\n while (!Object.prototype.hasOwnProperty.call(object, property)) {\n object = getPrototypeOf(object);\n if (object === null) break;\n }\n\n return object;\n}\n\nmodule.exports = _superPropBase;","var superPropBase = require(\"./superPropBase\");\n\nfunction _get(target, property, receiver) {\n if (typeof Reflect !== \"undefined\" && Reflect.get) {\n module.exports = _get = Reflect.get;\n } else {\n module.exports = _get = function _get(target, property, receiver) {\n var base = superPropBase(target, property);\n if (!base) return;\n var desc = Object.getOwnPropertyDescriptor(base, property);\n\n if (desc.get) {\n return desc.get.call(receiver);\n }\n\n return desc.value;\n };\n }\n\n return _get(target, property, receiver || target);\n}\n\nmodule.exports = _get;","function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nmodule.exports = _setPrototypeOf;","var setPrototypeOf = require(\"./setPrototypeOf\");\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}\n\nmodule.exports = _inherits;","import { BellhopEventDispatcher } from './BellhopEventDispatcher.js';\n\n/**\n * Abstract communication layer between the iframe\n * and the parent DOM\n * @class Bellhop\n * @extends BellhopEventDispatcher\n */\nexport class Bellhop extends BellhopEventDispatcher {\n /**\n * Creates an instance of Bellhop.\n * @memberof Bellhop\n * @param { string | number } id the id of the Bellhop instance\n */\n constructor(id = (Math.random() * 100) | 0) {\n super();\n\n /**\n * The instance ID for bellhop\n * @property {string} id\n */\n this.id = `BELLHOP:${id}`;\n /**\n * If we are connected to another instance of bellhop\n * @property {Boolean} connected\n * @readOnly\n * @default false\n * @private\n */\n this.connected = false;\n\n /**\n * If this instance represents an iframe instance\n * @property {Boolean} isChild\n * @private\n * @default true\n */\n this.isChild = true;\n\n /**\n * If we are currently trying to connect\n * @property {Boolean} connecting\n * @default false\n * @private\n */\n this.connecting = false;\n\n /**\n * If debug mode is turned on\n * @property {Boolean} debug\n * @default false\n * @private\n */\n this.debug = false;\n\n /**\n * If using cross-domain, the domain to post to\n * @property {string} origin\n * @private\n * @default \"*\"\n */\n this.origin = '*';\n\n /**\n * Save any sends to wait until after we're done\n * @property {Array} _sendLater\n * @private\n */\n this._sendLater = [];\n\n /**\n * The iframe element\n * @property {HTMLIFrameElement} iframe\n * @private\n * @readOnly\n */\n this.iframe = null;\n\n /**\n * The bound receive function\n * @property {Function} receive\n * @private\n */\n this.receive = this.receive.bind(this);\n }\n\n /**\n * The connection has been established successfully\n * @event connected\n */\n\n /**\n * Connection could not be established\n * @event failed\n */\n\n /**\n * Handle messages in the window\n * @method receive\n * @param { MessageEvent } message the post message received from another bellhop instance\n * @private\n */\n receive(message) {\n // Ignore messages that don't originate from the target\n // we're connected to\n if (this.target !== message.source) {\n return;\n }\n\n this.logDebugMessage(true, message);\n\n // If this is not the initial connection message\n if (message.data !== 'connected') {\n let data = message.data;\n // Check to see if the data was sent as a stringified json\n if ('string' === typeof data) {\n try {\n data = JSON.parse(data);\n } catch (err) {\n console.error('Bellhop error: ', err);\n }\n }\n if (this.connected && 'object' === typeof data && data.type) {\n this.trigger(data);\n }\n return;\n }\n // Else setup the connection\n this.onConnectionReceived(message.data);\n }\n /**\n * @memberof Bellhop\n * @param {object} message the message received from the other bellhop instance\n * @private\n */\n onConnectionReceived(message) {\n this.connecting = false;\n this.connected = true;\n\n // Be polite and respond to the child that we're ready\n if (!this.isChild) {\n this.target.postMessage(message, this.origin);\n }\n\n // If we have any sends waiting to send\n // we are now connected and it should be okay\n for (let i = 0; i < this._sendLater.length; i++) {\n const { type, data } = this._sendLater[i];\n this.send(type, data);\n }\n this._sendLater.length = 0;\n\n // If there is a connection event assigned call it\n this.trigger('connected');\n }\n\n /**\n * Setup the connection\n * @method connect\n * @param {HTMLIFrameElement} iframe The iframe to communicate with. If no value is set, the assumption\n * is that we're the child trying to communcate with our window.parent\n * @param {String} [origin=\"*\"] The domain to communicate with if different from the current.\n * @return {Bellhop} Return instance of current object\n */\n connect(iframe, origin = '*') {\n // Ignore if we're already trying to connect\n if (this.connecting) {\n return;\n }\n\n // Disconnect from any existing connection\n this.disconnect();\n\n // We are trying to connect\n this.connecting = true;\n\n // The iframe if we're the parent\n if (iframe instanceof HTMLIFrameElement) {\n this.iframe = iframe;\n }\n\n // The instance of bellhop is inside the iframe\n this.isChild = iframe === undefined;\n\n this.supported = true;\n if (this.isChild) {\n // for child pages, the window passed must be a different window\n this.supported = window != iframe;\n }\n\n this.origin = origin;\n\n window.addEventListener('message', this.receive);\n\n if (this.isChild) {\n // No parent, can't connect\n if (window === this.target) {\n this.trigger('failed');\n } else {\n // If connect is called after the window is ready\n // we can go ahead and send the connect message\n this.target.postMessage('connected', this.origin);\n }\n }\n }\n\n /**\n * Disconnect if there are any open connections\n * @method disconnect\n */\n disconnect() {\n this.connected = false;\n this.connecting = false;\n this.origin = null;\n this.iframe = null;\n this.isChild = true;\n this._sendLater.length = 0;\n\n window.removeEventListener('message', this.receive);\n }\n\n /**\n * Send an event to the connected instance\n * @method send\n * @param {string} type name/type of the event\n * @param {*} [data = {}] Additional data to send along with event\n */\n send(type, data = {}) {\n if (typeof type !== 'string') {\n throw 'The event type must be a string';\n }\n\n const message = {\n type,\n data\n };\n\n this.logDebugMessage(false, message);\n\n if (this.connecting) {\n this._sendLater.push(message);\n } else {\n this.target.postMessage(JSON.stringify(message), this.origin);\n }\n }\n\n /**\n * A convenience method for sending and listening to create\n * a singular link for fetching data. This is the same as calling send\n * and then getting a response right away with the same event.\n * @method fetch\n * @param {String} event The name of the event\n * @param {Function} callback The callback to call after, takes event object as one argument\n * @param {Object} [data = {}] Optional data to pass along\n * @param {Boolean} [runOnce=false] If we only want to fetch once and then remove the listener\n */\n fetch(event, callback, data = {}, runOnce = false) {\n if (!this.connecting && !this.connected) {\n throw 'No connection, please call connect() first';\n }\n\n const internalCallback = e => {\n if (runOnce) {\n this.off(e.type, internalCallback);\n }\n\n callback(e);\n };\n\n this.on(event, internalCallback);\n this.send(event, data);\n }\n\n /**\n * A convience method for listening to an event and then responding with some data\n * right away. Automatically removes the listener\n * @method respond\n * @param {String} event The name of the event\n * @param {Object | function | Promise | string} [data = {}] The object to pass back.\n * \tMay also be a function; the return value will be sent as data in this case.\n * @param {Boolean} [runOnce=false] If we only want to respond once and then remove the listener\n *\n */\n respond(event, data = {}, runOnce = false) {\n const bellhop = this; //'this' for use inside async function\n /**\n * @ignore\n */\n const internalCallback = async function(event) {\n if (runOnce) {\n bellhop.off(event, internalCallback);\n }\n if (typeof data === 'function') {\n data = data();\n }\n const newData = await data;\n bellhop.send(event.type, newData);\n };\n this.on(event, internalCallback);\n }\n\n /**\n * Send either the default log message or the callback provided if debug\n * is enabled\n * @method logDebugMessage\n */\n logDebugMessage(received = false, message) {\n if (this.debug && typeof this.debug === 'function') {\n this.debug({ isChild: this.isChild, received: false, message: message });\n } else if (this.debug) {\n console.log(\n `Bellhop Instance (${this.isChild ? 'Child' : 'Parent'}) ${\n received ? 'Receieved' : 'Sent'\n }`,\n message\n );\n }\n }\n\n /**\n * Destroy and don't user after this\n * @method destroy\n */\n destroy() {\n super.destroy();\n this.disconnect();\n this._sendLater.length = 0;\n }\n\n /**\n *\n * Returns the correct parent element for Bellhop's context\n * @readonly\n * @memberof Bellhop\n */\n get target() {\n return this.isChild ? window.parent : this.iframe.contentWindow;\n }\n}\n"],"names":["_typeof2","obj","Symbol","iterator","constructor","prototype","_typeof","module","instance","Constructor","TypeError","_defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","key","protoProps","staticProps","BellhopEventDispatcher","_listeners","name","callback","priority","this","_priority","parseInt","indexOf","push","sort","listenerSorter","a","b","undefined","index","splice","event","data","type","runtime","exports","Op","hasOwn","hasOwnProperty","$Symbol","iteratorSymbol","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","create","context","Context","_invoke","state","GenStateSuspendedStart","method","arg","GenStateExecuting","Error","GenStateCompleted","doneResult","delegate","delegateResult","maybeInvokeDelegate","ContinueSentinel","sent","_sent","dispatchException","abrupt","record","tryCatch","done","GenStateSuspendedYield","value","makeInvokeMethod","fn","call","err","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","AsyncIterator","previousPromise","callInvokeWithMethodAndArg","Promise","resolve","reject","invoke","result","__await","then","unwrapped","error","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","displayName","isGeneratorFunction","genFun","ctor","mark","setPrototypeOf","__proto__","awrap","async","iter","toString","keys","object","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","thrown","delegateYield","regeneratorRuntime","accidentalStrictMode","Function","ReferenceError","assertThisInitialized","_getPrototypeOf","o","property","_get","receiver","Reflect","get","base","superPropBase","desc","getOwnPropertyDescriptor","_setPrototypeOf","p","subClass","superClass","Bellhop","id","Math","random","connected","isChild","connecting","debug","origin","_sendLater","iframe","receive","_this","bind","message","source","logDebugMessage","onConnectionReceived","JSON","parse","console","trigger","postMessage","send","disconnect","HTMLIFrameElement","supported","window","addEventListener","removeEventListener","stringify","runOnce","internalCallback","e","_this2","off","on","bellhop","newData","received","log","parent","contentWindow"],"mappings":"2FAASA,EAASC,UAAkFD,EAArD,mBAAXE,QAAoD,iBAApBA,OAAOC,SAAoC,SAAkBF,iBAAqBA,GAA4B,SAAkBA,UAAcA,GAAyB,mBAAXC,QAAyBD,EAAIG,cAAgBF,QAAUD,IAAQC,OAAOG,UAAY,gBAAkBJ,IAA0BA,YAErVK,EAAQL,SACO,mBAAXC,QAAuD,WAA9BF,EAASE,OAAOC,UAClDI,UAAiBD,EAAU,SAAiBL,UACnCD,EAASC,IAGlBM,UAAiBD,EAAU,SAAiBL,UACnCA,GAAyB,mBAAXC,QAAyBD,EAAIG,cAAgBF,QAAUD,IAAQC,OAAOG,UAAY,SAAWL,EAASC,IAIxHK,EAAQL,GAGjBM,UAAiBD,KCVjB,MANA,SAAyBE,EAAUC,QAC3BD,aAAoBC,SAClB,IAAIC,UAAU,sCCFxB,SAASC,EAAkBC,EAAQC,OAC5B,IAAIC,EAAI,EAAGA,EAAID,EAAME,OAAQD,IAAK,KACjCE,EAAaH,EAAMC,GACvBE,EAAWC,WAAaD,EAAWC,aAAc,EACjDD,EAAWE,cAAe,EACtB,UAAWF,IAAYA,EAAWG,UAAW,GACjDC,OAAOC,eAAeT,EAAQI,EAAWM,IAAKN,IAUlD,MANA,SAAsBP,EAAac,EAAYC,UACzCD,GAAYZ,EAAkBF,EAAYJ,UAAWkB,GACrDC,GAAab,EAAkBF,EAAae,GACzCf,GCHIgB,EAAb,uCAOSC,WAAa,wCAUjBC,EAAMC,OAAUC,yDAAW,EACvBC,KAAKJ,WAAWC,UACdD,WAAWC,GAAQ,IAE1BC,EAASG,UAAYC,SAASH,IAAa,GAGtC,IAAMC,KAAKJ,WAAWC,GAAMM,QAAQL,UAIpCF,WAAWC,GAAMO,KAAKN,GAEvBE,KAAKJ,WAAWC,GAAMZ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AY,YAAalL,KAAKoK,oDAUzCJ,WAAY,OACZE,YAAa,OACbE,OAAS,UACTE,OAAS,UACTL,SAAU,OACVI,WAAWpL,OAAS,EAEzBsM,OAAOE,oBAAoB,UAAWzL,KAAKuK,sCASxCzJ,OAAMD,yDAAO,MACI,iBAATC,OACH,sCAGF4J,EAAU,CACd5J,KAAAA,EACAD,KAAAA,QAGG+J,iBAAgB,EAAOF,GAExB1K,KAAKkK,gBACFG,WAAWjK,KAAKsK,QAEhB5L,OAAOoM,YAAYJ,KAAKY,UAAUhB,GAAU1K,KAAKoK,sCAcpDxJ,EAAOd,cAAUe,yDAAO,GAAI8K,8DAC3B3L,KAAKkK,aAAelK,KAAKgK,eACtB,iDAGF4B,EAAmB,SAAnBA,EAAmBC,GACnBF,GACFG,EAAKC,IAAIF,EAAE/K,KAAM8K,GAGnB9L,EAAS+L,SAGNG,GAAGpL,EAAOgL,QACVT,KAAKvK,EAAOC,mCAaXD,OAAOC,yDAAO,GAAI8K,0DAClBM,EAAUjM,KAIV4L,EAAmB,SAAnBA,EAAkChL,gFAClC+K,GACFM,EAAQF,IAAInL,EAAOgL,GAED,mBAAT/K,IACTA,EAAOA,sBAEaA,UAAhBqL,SACND,EAAQd,KAAKvK,EAAME,KAAMoL,8CAEtBF,GAAGpL,EAAOgL,iDAQDO,0DAAkBzB,yCAC5B1K,KAAKmK,OAA+B,mBAAfnK,KAAKmK,WACvBA,MAAM,CAAEF,QAASjK,KAAKiK,QAASkC,UAAU,EAAOzB,QAASA,IACrD1K,KAAKmK,OACda,QAAQoB,gCACepM,KAAKiK,QAAU,QAAU,sBAC5CkC,EAAW,YAAc,QAE3BzB,sFAWCU,kBACAf,WAAWpL,OAAS,wCAUlBe,KAAKiK,QAAUsB,OAAOc,OAASrM,KAAKsK,OAAOgC,oBAxUtD"} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 66f8a81..249b569 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "bellhop-iframe", - "version": "3.1.0", + "version": "3.2.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -3777,8 +3777,7 @@ "ansi-regex": { "version": "2.1.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "aproba": { "version": "1.2.0", @@ -3799,14 +3798,12 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -3821,20 +3818,17 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "core-util-is": { "version": "1.0.2", @@ -3951,8 +3945,7 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "ini": { "version": "1.3.5", @@ -3964,7 +3957,6 @@ "version": "1.0.0", "bundled": true, "dev": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -3979,7 +3971,6 @@ "version": "3.0.4", "bundled": true, "dev": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -3987,14 +3978,12 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "minipass": { "version": "2.3.5", "bundled": true, "dev": true, - "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -4013,7 +4002,6 @@ "version": "0.5.1", "bundled": true, "dev": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -4094,8 +4082,7 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "object-assign": { "version": "4.1.1", @@ -4107,7 +4094,6 @@ "version": "1.4.0", "bundled": true, "dev": true, - "optional": true, "requires": { "wrappy": "1" } @@ -4193,8 +4179,7 @@ "safe-buffer": { "version": "5.1.2", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "safer-buffer": { "version": "2.1.2", @@ -4230,7 +4215,6 @@ "version": "1.0.2", "bundled": true, "dev": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -4250,7 +4234,6 @@ "version": "3.0.1", "bundled": true, "dev": true, - "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -4294,14 +4277,12 @@ "wrappy": { "version": "1.0.2", "bundled": true, - "dev": true, - "optional": true + "dev": true }, "yallist": { "version": "3.0.3", "bundled": true, - "dev": true, - "optional": true + "dev": true } } }, @@ -5678,30 +5659,6 @@ "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", "dev": true }, - "lodash.hasin": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/lodash.hasin/-/lodash.hasin-4.5.2.tgz", - "integrity": "sha1-+R41I3jSHvcJC552h8LKNcW01So=", - "dev": true - }, - "lodash.isempty": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.isempty/-/lodash.isempty-4.4.0.tgz", - "integrity": "sha1-b4bL7di+TsmHvpqvM8loTbGzHn4=", - "dev": true - }, - "lodash.isnil": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/lodash.isnil/-/lodash.isnil-4.0.0.tgz", - "integrity": "sha1-SeKM1VkBNFjIFMVHnTxmOiG/qmw=", - "dev": true - }, - "lodash.omitby": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.omitby/-/lodash.omitby-4.6.0.tgz", - "integrity": "sha1-XBX/R1StVVAWtTwEExHo8HkgR5E=", - "dev": true - }, "log-symbols": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", @@ -7279,38 +7236,6 @@ } } }, - "rollup-plugin-prettier": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-prettier/-/rollup-plugin-prettier-0.6.0.tgz", - "integrity": "sha512-BgfyZ1biKcAaRNzfUyG/CeI5dFn+WsygK7kYjuXM6aL4m3t/53ZpJI2ZSMAeaKj6w2dj3CkOYbT0gulwh2SvKA==", - "dev": true, - "requires": { - "diff": "4.0.1", - "lodash.hasin": "4.5.2", - "lodash.isempty": "4.4.0", - "lodash.isnil": "4.0.0", - "lodash.omitby": "4.6.0", - "magic-string": "0.25.1", - "prettier": "^1.0.0" - }, - "dependencies": { - "diff": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz", - "integrity": "sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==", - "dev": true - }, - "magic-string": { - "version": "0.25.1", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.1.tgz", - "integrity": "sha512-sCuTz6pYom8Rlt4ISPFn6wuFodbKMIHUMv4Qko9P17dpxb7s52KJTmRuZZqHdGmLCK9AOcDare039nRIcfdkEg==", - "dev": true, - "requires": { - "sourcemap-codec": "^1.4.1" - } - } - } - }, "rollup-plugin-terser": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-5.1.2.tgz", diff --git a/package.json b/package.json index 6a55641..8bce69d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bellhop-iframe", - "version": "3.1.0", + "version": "3.2.0", "main": "dist/bellhop.js", "module": "dist/bellhop.js", "browser": "dist/bellhop.js", @@ -25,13 +25,13 @@ "karma-requirejs": "^1.1.0", "karma-webpack": "^4.0.2", "mocha": "^6.2.2", + "prettier": "^1.19.1", "requirejs": "^2.3.6", "rollup": "^1.27.5", "rollup-plugin-babel": "^4.3.3", "rollup-plugin-commonjs": "^10.1.0", "rollup-plugin-eslint": "^7.0.0", "rollup-plugin-node-resolve": "^5.2.0", - "rollup-plugin-prettier": "^0.6.0", "rollup-plugin-terser": "^5.1.2", "sinon": "^7.5.0", "uglify": "^0.1.5", @@ -47,6 +47,7 @@ "scripts": { "build": "rollup -c -m", "dev": "rollup -c -w", + "format": "prettier --write src/*.js", "test": "karma start karma.conf.js", "github-test": "karma start --single-run --browsers ChromeHeadless" }, diff --git a/rollup.config.js b/rollup.config.js index b5c7574..2199078 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,17 +1,13 @@ import resolve from 'rollup-plugin-node-resolve'; import commonjs from 'rollup-plugin-commonjs'; import { eslint }from 'rollup-plugin-eslint'; -import prettier from 'rollup-plugin-prettier'; -import { terser } from 'rollup-plugin-terser'; +import { terser } from 'rollup-plugin-terser'; import babel from 'rollup-plugin-babel'; -const prettierConfig = require('./.prettierrc'); - const plugins = [ eslint(), - prettier(prettierConfig), resolve({ - mainFields: ["module", "jsnext:main", "main", "browser"], + mainFields: ['module', 'jsnext:main', 'main', 'browser'], preferBuiltins: false }), commonjs(), diff --git a/src/Bellhop.js b/src/Bellhop.js index 0c44625..292ccec 100644 --- a/src/Bellhop.js +++ b/src/Bellhop.js @@ -82,7 +82,6 @@ export class Bellhop extends BellhopEventDispatcher { * @private */ this.receive = this.receive.bind(this); - } /** @@ -122,7 +121,6 @@ export class Bellhop extends BellhopEventDispatcher { } } if (this.connected && 'object' === typeof data && data.type) { - this.trigger(data); } return; @@ -288,7 +286,7 @@ export class Bellhop extends BellhopEventDispatcher { /** * @ignore */ - const internalCallback = async function (event) { + const internalCallback = async function(event) { if (runOnce) { bellhop.off(event, internalCallback); } @@ -310,7 +308,12 @@ export class Bellhop extends BellhopEventDispatcher { if (this.debug && typeof this.debug === 'function') { this.debug({ isChild: this.isChild, received: false, message: message }); } else if (this.debug) { - console.log(`Bellhop Instance (${this.isChild ? 'Child' : 'Parent'}) ${received ? 'Receieved' : 'Sent'}`, message); + console.log( + `Bellhop Instance (${this.isChild ? 'Child' : 'Parent'}) ${ + received ? 'Receieved' : 'Sent' + }`, + message + ); } }