@mjhls/mjh-framework 1.0.238 → 1.0.240

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/AdSlot-c472fff6.js +1192 -0
  3. package/dist/cjs/DeckContent.js +6 -5
  4. package/dist/cjs/DeckQueue.js +5 -5
  5. package/dist/cjs/{Dfp-045b016b.js → Dfp-7a5533f9.js} +1 -1
  6. package/dist/cjs/{GridContent-53e78cbf.js → GridContent-f9e3fff5.js} +7 -7
  7. package/dist/cjs/GridContent.js +8 -7
  8. package/dist/cjs/MasterDeck.js +331 -13
  9. package/dist/cjs/{Normal-a94a1ec8.js → Normal-0497eb61.js} +5 -5
  10. package/dist/cjs/QueueDeckExpanded.js +2 -2
  11. package/dist/cjs/TemplateNormal.js +6 -5
  12. package/dist/cjs/VideoSeriesListing.js +2 -2
  13. package/dist/cjs/{debounce-bbca43c4.js → debounce-783eb233.js} +3 -0
  14. package/dist/cjs/{get-af2516a4.js → get-1f91592f.js} +1 -1
  15. package/dist/cjs/index.js +118 -842
  16. package/dist/cjs/{inherits-5b5ca8db.js → inherits-9898af5a.js} +2 -4
  17. package/dist/cjs/{main-d9a1b014.js → main-0ea1b808.js} +51 -0
  18. package/dist/cjs/{MasterDeck-91c6ad85.js → promise-b96c61f8.js} +7 -340
  19. package/dist/cjs/{toConsumableArray-7e4caf3c.js → toConsumableArray-f05a306f.js} +5 -52
  20. package/dist/esm/AdSlot-bdd7a629.js +1183 -0
  21. package/dist/esm/DeckContent.js +11 -10
  22. package/dist/esm/DeckQueue.js +9 -9
  23. package/dist/esm/{Dfp-01f14ae3.js → Dfp-71879c9d.js} +5 -5
  24. package/dist/esm/{GridContent-f5bc4d75.js → GridContent-d4f5457e.js} +8 -8
  25. package/dist/esm/GridContent.js +13 -12
  26. package/dist/esm/MasterDeck.js +333 -15
  27. package/dist/esm/{Normal-357f00d1.js → Normal-e1855047.js} +6 -6
  28. package/dist/esm/QueueDeckExpanded.js +7 -7
  29. package/dist/esm/{TaxonomyCard-f74512cb.js → TaxonomyCard-ee1a22ae.js} +1 -1
  30. package/dist/esm/TaxonomyCard.js +3 -3
  31. package/dist/esm/TemplateNormal.js +10 -9
  32. package/dist/esm/{Ustream-62a07a32.js → Ustream-d51b9b11.js} +1 -1
  33. package/dist/esm/Ustream.js +5 -5
  34. package/dist/esm/VideoSeriesListing.js +5 -5
  35. package/dist/esm/{_to-object-86553f76.js → _to-object-b9b796ec.js} +1 -1
  36. package/dist/esm/{core.get-iterator-method-709061dc.js → core.get-iterator-method-31c1fb1a.js} +2 -2
  37. package/dist/esm/{debounce-fa7fbf11.js → debounce-806f886b.js} +3 -1
  38. package/dist/esm/{extends-7f88fa22.js → extends-dbbe308d.js} +1 -1
  39. package/dist/esm/{get-8d382479.js → get-b2201dc8.js} +1 -1
  40. package/dist/esm/index.js +124 -850
  41. package/dist/esm/{inherits-a82a4471.js → inherits-a75c8a1c.js} +5 -6
  42. package/dist/esm/{main-eecf7b27.js → main-155ec04f.js} +48 -1
  43. package/dist/esm/{MasterDeck-5dd97a66.js → promise-683a9c54.js} +6 -335
  44. package/dist/esm/{slicedToArray-eb7eca9e.js → slicedToArray-d0a9593a.js} +3 -3
  45. package/dist/esm/{toConsumableArray-08d50169.js → toConsumableArray-eb308ede.js} +5 -49
  46. package/dist/esm/{web.dom.iterable-f05d2f57.js → web.dom.iterable-3be50d6c.js} +2 -2
  47. package/package.json +3 -2
  48. package/dist/cjs/AdSlot-1fe1c231.js +0 -69
  49. package/dist/esm/AdSlot-017b8051.js +0 -64
@@ -0,0 +1,1192 @@
1
+ 'use strict';
2
+
3
+ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
4
+
5
+ var _commonjsHelpers = require('./_commonjsHelpers-06173234.js');
6
+ var _toObject = require('./_to-object-329a650b.js');
7
+ var debounce = require('./debounce-783eb233.js');
8
+ var main = require('./main-0ea1b808.js');
9
+ var React = require('react');
10
+ var React__default = _interopDefault(React);
11
+ var index = require('./index-fa3cec70.js');
12
+ var PropTypes = _interopDefault(require('prop-types'));
13
+ var slicedToArray = require('./slicedToArray-e38fb29d.js');
14
+ var promise = require('./promise-b96c61f8.js');
15
+
16
+ var runtime = _commonjsHelpers.createCommonjsModule(function (module) {
17
+ /**
18
+ * Copyright (c) 2014-present, Facebook, Inc.
19
+ *
20
+ * This source code is licensed under the MIT license found in the
21
+ * LICENSE file in the root directory of this source tree.
22
+ */
23
+
24
+ !(function(global) {
25
+
26
+ var Op = Object.prototype;
27
+ var hasOwn = Op.hasOwnProperty;
28
+ var undefined$1; // More compressible than void 0.
29
+ var $Symbol = typeof Symbol === "function" ? Symbol : {};
30
+ var iteratorSymbol = $Symbol.iterator || "@@iterator";
31
+ var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
32
+ var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
33
+ var runtime = global.regeneratorRuntime;
34
+ if (runtime) {
35
+ {
36
+ // If regeneratorRuntime is defined globally and we're in a module,
37
+ // make the exports object identical to regeneratorRuntime.
38
+ module.exports = runtime;
39
+ }
40
+ // Don't bother evaluating the rest of this file if the runtime was
41
+ // already defined globally.
42
+ return;
43
+ }
44
+
45
+ // Define the runtime globally (as expected by generated code) as either
46
+ // module.exports (if we're in a module) or a new, empty object.
47
+ runtime = global.regeneratorRuntime = module.exports ;
48
+
49
+ function wrap(innerFn, outerFn, self, tryLocsList) {
50
+ // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
51
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
52
+ var generator = Object.create(protoGenerator.prototype);
53
+ var context = new Context(tryLocsList || []);
54
+
55
+ // The ._invoke method unifies the implementations of the .next,
56
+ // .throw, and .return methods.
57
+ generator._invoke = makeInvokeMethod(innerFn, self, context);
58
+
59
+ return generator;
60
+ }
61
+ runtime.wrap = wrap;
62
+
63
+ // Try/catch helper to minimize deoptimizations. Returns a completion
64
+ // record like context.tryEntries[i].completion. This interface could
65
+ // have been (and was previously) designed to take a closure to be
66
+ // invoked without arguments, but in all the cases we care about we
67
+ // already have an existing method we want to call, so there's no need
68
+ // to create a new function object. We can even get away with assuming
69
+ // the method takes exactly one argument, since that happens to be true
70
+ // in every case, so we don't have to touch the arguments object. The
71
+ // only additional allocation required is the completion record, which
72
+ // has a stable shape and so hopefully should be cheap to allocate.
73
+ function tryCatch(fn, obj, arg) {
74
+ try {
75
+ return { type: "normal", arg: fn.call(obj, arg) };
76
+ } catch (err) {
77
+ return { type: "throw", arg: err };
78
+ }
79
+ }
80
+
81
+ var GenStateSuspendedStart = "suspendedStart";
82
+ var GenStateSuspendedYield = "suspendedYield";
83
+ var GenStateExecuting = "executing";
84
+ var GenStateCompleted = "completed";
85
+
86
+ // Returning this object from the innerFn has the same effect as
87
+ // breaking out of the dispatch switch statement.
88
+ var ContinueSentinel = {};
89
+
90
+ // Dummy constructor functions that we use as the .constructor and
91
+ // .constructor.prototype properties for functions that return Generator
92
+ // objects. For full spec compliance, you may wish to configure your
93
+ // minifier not to mangle the names of these two functions.
94
+ function Generator() {}
95
+ function GeneratorFunction() {}
96
+ function GeneratorFunctionPrototype() {}
97
+
98
+ // This is a polyfill for %IteratorPrototype% for environments that
99
+ // don't natively support it.
100
+ var IteratorPrototype = {};
101
+ IteratorPrototype[iteratorSymbol] = function () {
102
+ return this;
103
+ };
104
+
105
+ var getProto = Object.getPrototypeOf;
106
+ var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
107
+ if (NativeIteratorPrototype &&
108
+ NativeIteratorPrototype !== Op &&
109
+ hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
110
+ // This environment has a native %IteratorPrototype%; use it instead
111
+ // of the polyfill.
112
+ IteratorPrototype = NativeIteratorPrototype;
113
+ }
114
+
115
+ var Gp = GeneratorFunctionPrototype.prototype =
116
+ Generator.prototype = Object.create(IteratorPrototype);
117
+ GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
118
+ GeneratorFunctionPrototype.constructor = GeneratorFunction;
119
+ GeneratorFunctionPrototype[toStringTagSymbol] =
120
+ GeneratorFunction.displayName = "GeneratorFunction";
121
+
122
+ // Helper for defining the .next, .throw, and .return methods of the
123
+ // Iterator interface in terms of a single ._invoke method.
124
+ function defineIteratorMethods(prototype) {
125
+ ["next", "throw", "return"].forEach(function(method) {
126
+ prototype[method] = function(arg) {
127
+ return this._invoke(method, arg);
128
+ };
129
+ });
130
+ }
131
+
132
+ runtime.isGeneratorFunction = function(genFun) {
133
+ var ctor = typeof genFun === "function" && genFun.constructor;
134
+ return ctor
135
+ ? ctor === GeneratorFunction ||
136
+ // For the native GeneratorFunction constructor, the best we can
137
+ // do is to check its .name property.
138
+ (ctor.displayName || ctor.name) === "GeneratorFunction"
139
+ : false;
140
+ };
141
+
142
+ runtime.mark = function(genFun) {
143
+ if (Object.setPrototypeOf) {
144
+ Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
145
+ } else {
146
+ genFun.__proto__ = GeneratorFunctionPrototype;
147
+ if (!(toStringTagSymbol in genFun)) {
148
+ genFun[toStringTagSymbol] = "GeneratorFunction";
149
+ }
150
+ }
151
+ genFun.prototype = Object.create(Gp);
152
+ return genFun;
153
+ };
154
+
155
+ // Within the body of any async function, `await x` is transformed to
156
+ // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
157
+ // `hasOwn.call(value, "__await")` to determine if the yielded value is
158
+ // meant to be awaited.
159
+ runtime.awrap = function(arg) {
160
+ return { __await: arg };
161
+ };
162
+
163
+ function AsyncIterator(generator) {
164
+ function invoke(method, arg, resolve, reject) {
165
+ var record = tryCatch(generator[method], generator, arg);
166
+ if (record.type === "throw") {
167
+ reject(record.arg);
168
+ } else {
169
+ var result = record.arg;
170
+ var value = result.value;
171
+ if (value &&
172
+ typeof value === "object" &&
173
+ hasOwn.call(value, "__await")) {
174
+ return Promise.resolve(value.__await).then(function(value) {
175
+ invoke("next", value, resolve, reject);
176
+ }, function(err) {
177
+ invoke("throw", err, resolve, reject);
178
+ });
179
+ }
180
+
181
+ return Promise.resolve(value).then(function(unwrapped) {
182
+ // When a yielded Promise is resolved, its final value becomes
183
+ // the .value of the Promise<{value,done}> result for the
184
+ // current iteration. If the Promise is rejected, however, the
185
+ // result for this iteration will be rejected with the same
186
+ // reason. Note that rejections of yielded Promises are not
187
+ // thrown back into the generator function, as is the case
188
+ // when an awaited Promise is rejected. This difference in
189
+ // behavior between yield and await is important, because it
190
+ // allows the consumer to decide what to do with the yielded
191
+ // rejection (swallow it and continue, manually .throw it back
192
+ // into the generator, abandon iteration, whatever). With
193
+ // await, by contrast, there is no opportunity to examine the
194
+ // rejection reason outside the generator function, so the
195
+ // only option is to throw it from the await expression, and
196
+ // let the generator function handle the exception.
197
+ result.value = unwrapped;
198
+ resolve(result);
199
+ }, reject);
200
+ }
201
+ }
202
+
203
+ var previousPromise;
204
+
205
+ function enqueue(method, arg) {
206
+ function callInvokeWithMethodAndArg() {
207
+ return new Promise(function(resolve, reject) {
208
+ invoke(method, arg, resolve, reject);
209
+ });
210
+ }
211
+
212
+ return previousPromise =
213
+ // If enqueue has been called before, then we want to wait until
214
+ // all previous Promises have been resolved before calling invoke,
215
+ // so that results are always delivered in the correct order. If
216
+ // enqueue has not been called before, then it is important to
217
+ // call invoke immediately, without waiting on a callback to fire,
218
+ // so that the async generator function has the opportunity to do
219
+ // any necessary setup in a predictable way. This predictability
220
+ // is why the Promise constructor synchronously invokes its
221
+ // executor callback, and why async functions synchronously
222
+ // execute code before the first await. Since we implement simple
223
+ // async functions in terms of async generators, it is especially
224
+ // important to get this right, even though it requires care.
225
+ previousPromise ? previousPromise.then(
226
+ callInvokeWithMethodAndArg,
227
+ // Avoid propagating failures to Promises returned by later
228
+ // invocations of the iterator.
229
+ callInvokeWithMethodAndArg
230
+ ) : callInvokeWithMethodAndArg();
231
+ }
232
+
233
+ // Define the unified helper method that is used to implement .next,
234
+ // .throw, and .return (see defineIteratorMethods).
235
+ this._invoke = enqueue;
236
+ }
237
+
238
+ defineIteratorMethods(AsyncIterator.prototype);
239
+ AsyncIterator.prototype[asyncIteratorSymbol] = function () {
240
+ return this;
241
+ };
242
+ runtime.AsyncIterator = AsyncIterator;
243
+
244
+ // Note that simple async functions are implemented on top of
245
+ // AsyncIterator objects; they just return a Promise for the value of
246
+ // the final result produced by the iterator.
247
+ runtime.async = function(innerFn, outerFn, self, tryLocsList) {
248
+ var iter = new AsyncIterator(
249
+ wrap(innerFn, outerFn, self, tryLocsList)
250
+ );
251
+
252
+ return runtime.isGeneratorFunction(outerFn)
253
+ ? iter // If outerFn is a generator, return the full iterator.
254
+ : iter.next().then(function(result) {
255
+ return result.done ? result.value : iter.next();
256
+ });
257
+ };
258
+
259
+ function makeInvokeMethod(innerFn, self, context) {
260
+ var state = GenStateSuspendedStart;
261
+
262
+ return function invoke(method, arg) {
263
+ if (state === GenStateExecuting) {
264
+ throw new Error("Generator is already running");
265
+ }
266
+
267
+ if (state === GenStateCompleted) {
268
+ if (method === "throw") {
269
+ throw arg;
270
+ }
271
+
272
+ // Be forgiving, per 25.3.3.3.3 of the spec:
273
+ // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
274
+ return doneResult();
275
+ }
276
+
277
+ context.method = method;
278
+ context.arg = arg;
279
+
280
+ while (true) {
281
+ var delegate = context.delegate;
282
+ if (delegate) {
283
+ var delegateResult = maybeInvokeDelegate(delegate, context);
284
+ if (delegateResult) {
285
+ if (delegateResult === ContinueSentinel) continue;
286
+ return delegateResult;
287
+ }
288
+ }
289
+
290
+ if (context.method === "next") {
291
+ // Setting context._sent for legacy support of Babel's
292
+ // function.sent implementation.
293
+ context.sent = context._sent = context.arg;
294
+
295
+ } else if (context.method === "throw") {
296
+ if (state === GenStateSuspendedStart) {
297
+ state = GenStateCompleted;
298
+ throw context.arg;
299
+ }
300
+
301
+ context.dispatchException(context.arg);
302
+
303
+ } else if (context.method === "return") {
304
+ context.abrupt("return", context.arg);
305
+ }
306
+
307
+ state = GenStateExecuting;
308
+
309
+ var record = tryCatch(innerFn, self, context);
310
+ if (record.type === "normal") {
311
+ // If an exception is thrown from innerFn, we leave state ===
312
+ // GenStateExecuting and loop back for another invocation.
313
+ state = context.done
314
+ ? GenStateCompleted
315
+ : GenStateSuspendedYield;
316
+
317
+ if (record.arg === ContinueSentinel) {
318
+ continue;
319
+ }
320
+
321
+ return {
322
+ value: record.arg,
323
+ done: context.done
324
+ };
325
+
326
+ } else if (record.type === "throw") {
327
+ state = GenStateCompleted;
328
+ // Dispatch the exception by looping back around to the
329
+ // context.dispatchException(context.arg) call above.
330
+ context.method = "throw";
331
+ context.arg = record.arg;
332
+ }
333
+ }
334
+ };
335
+ }
336
+
337
+ // Call delegate.iterator[context.method](context.arg) and handle the
338
+ // result, either by returning a { value, done } result from the
339
+ // delegate iterator, or by modifying context.method and context.arg,
340
+ // setting context.delegate to null, and returning the ContinueSentinel.
341
+ function maybeInvokeDelegate(delegate, context) {
342
+ var method = delegate.iterator[context.method];
343
+ if (method === undefined$1) {
344
+ // A .throw or .return when the delegate iterator has no .throw
345
+ // method always terminates the yield* loop.
346
+ context.delegate = null;
347
+
348
+ if (context.method === "throw") {
349
+ if (delegate.iterator.return) {
350
+ // If the delegate iterator has a return method, give it a
351
+ // chance to clean up.
352
+ context.method = "return";
353
+ context.arg = undefined$1;
354
+ maybeInvokeDelegate(delegate, context);
355
+
356
+ if (context.method === "throw") {
357
+ // If maybeInvokeDelegate(context) changed context.method from
358
+ // "return" to "throw", let that override the TypeError below.
359
+ return ContinueSentinel;
360
+ }
361
+ }
362
+
363
+ context.method = "throw";
364
+ context.arg = new TypeError(
365
+ "The iterator does not provide a 'throw' method");
366
+ }
367
+
368
+ return ContinueSentinel;
369
+ }
370
+
371
+ var record = tryCatch(method, delegate.iterator, context.arg);
372
+
373
+ if (record.type === "throw") {
374
+ context.method = "throw";
375
+ context.arg = record.arg;
376
+ context.delegate = null;
377
+ return ContinueSentinel;
378
+ }
379
+
380
+ var info = record.arg;
381
+
382
+ if (! info) {
383
+ context.method = "throw";
384
+ context.arg = new TypeError("iterator result is not an object");
385
+ context.delegate = null;
386
+ return ContinueSentinel;
387
+ }
388
+
389
+ if (info.done) {
390
+ // Assign the result of the finished delegate to the temporary
391
+ // variable specified by delegate.resultName (see delegateYield).
392
+ context[delegate.resultName] = info.value;
393
+
394
+ // Resume execution at the desired location (see delegateYield).
395
+ context.next = delegate.nextLoc;
396
+
397
+ // If context.method was "throw" but the delegate handled the
398
+ // exception, let the outer generator proceed normally. If
399
+ // context.method was "next", forget context.arg since it has been
400
+ // "consumed" by the delegate iterator. If context.method was
401
+ // "return", allow the original .return call to continue in the
402
+ // outer generator.
403
+ if (context.method !== "return") {
404
+ context.method = "next";
405
+ context.arg = undefined$1;
406
+ }
407
+
408
+ } else {
409
+ // Re-yield the result returned by the delegate method.
410
+ return info;
411
+ }
412
+
413
+ // The delegate iterator is finished, so forget it and continue with
414
+ // the outer generator.
415
+ context.delegate = null;
416
+ return ContinueSentinel;
417
+ }
418
+
419
+ // Define Generator.prototype.{next,throw,return} in terms of the
420
+ // unified ._invoke helper method.
421
+ defineIteratorMethods(Gp);
422
+
423
+ Gp[toStringTagSymbol] = "Generator";
424
+
425
+ // A Generator should always return itself as the iterator object when the
426
+ // @@iterator function is called on it. Some browsers' implementations of the
427
+ // iterator prototype chain incorrectly implement this, causing the Generator
428
+ // object to not be returned from this call. This ensures that doesn't happen.
429
+ // See https://github.com/facebook/regenerator/issues/274 for more details.
430
+ Gp[iteratorSymbol] = function() {
431
+ return this;
432
+ };
433
+
434
+ Gp.toString = function() {
435
+ return "[object Generator]";
436
+ };
437
+
438
+ function pushTryEntry(locs) {
439
+ var entry = { tryLoc: locs[0] };
440
+
441
+ if (1 in locs) {
442
+ entry.catchLoc = locs[1];
443
+ }
444
+
445
+ if (2 in locs) {
446
+ entry.finallyLoc = locs[2];
447
+ entry.afterLoc = locs[3];
448
+ }
449
+
450
+ this.tryEntries.push(entry);
451
+ }
452
+
453
+ function resetTryEntry(entry) {
454
+ var record = entry.completion || {};
455
+ record.type = "normal";
456
+ delete record.arg;
457
+ entry.completion = record;
458
+ }
459
+
460
+ function Context(tryLocsList) {
461
+ // The root entry object (effectively a try statement without a catch
462
+ // or a finally block) gives us a place to store values thrown from
463
+ // locations where there is no enclosing try statement.
464
+ this.tryEntries = [{ tryLoc: "root" }];
465
+ tryLocsList.forEach(pushTryEntry, this);
466
+ this.reset(true);
467
+ }
468
+
469
+ runtime.keys = function(object) {
470
+ var keys = [];
471
+ for (var key in object) {
472
+ keys.push(key);
473
+ }
474
+ keys.reverse();
475
+
476
+ // Rather than returning an object with a next method, we keep
477
+ // things simple and return the next function itself.
478
+ return function next() {
479
+ while (keys.length) {
480
+ var key = keys.pop();
481
+ if (key in object) {
482
+ next.value = key;
483
+ next.done = false;
484
+ return next;
485
+ }
486
+ }
487
+
488
+ // To avoid creating an additional object, we just hang the .value
489
+ // and .done properties off the next function object itself. This
490
+ // also ensures that the minifier will not anonymize the function.
491
+ next.done = true;
492
+ return next;
493
+ };
494
+ };
495
+
496
+ function values(iterable) {
497
+ if (iterable) {
498
+ var iteratorMethod = iterable[iteratorSymbol];
499
+ if (iteratorMethod) {
500
+ return iteratorMethod.call(iterable);
501
+ }
502
+
503
+ if (typeof iterable.next === "function") {
504
+ return iterable;
505
+ }
506
+
507
+ if (!isNaN(iterable.length)) {
508
+ var i = -1, next = function next() {
509
+ while (++i < iterable.length) {
510
+ if (hasOwn.call(iterable, i)) {
511
+ next.value = iterable[i];
512
+ next.done = false;
513
+ return next;
514
+ }
515
+ }
516
+
517
+ next.value = undefined$1;
518
+ next.done = true;
519
+
520
+ return next;
521
+ };
522
+
523
+ return next.next = next;
524
+ }
525
+ }
526
+
527
+ // Return an iterator with no values.
528
+ return { next: doneResult };
529
+ }
530
+ runtime.values = values;
531
+
532
+ function doneResult() {
533
+ return { value: undefined$1, done: true };
534
+ }
535
+
536
+ Context.prototype = {
537
+ constructor: Context,
538
+
539
+ reset: function(skipTempReset) {
540
+ this.prev = 0;
541
+ this.next = 0;
542
+ // Resetting context._sent for legacy support of Babel's
543
+ // function.sent implementation.
544
+ this.sent = this._sent = undefined$1;
545
+ this.done = false;
546
+ this.delegate = null;
547
+
548
+ this.method = "next";
549
+ this.arg = undefined$1;
550
+
551
+ this.tryEntries.forEach(resetTryEntry);
552
+
553
+ if (!skipTempReset) {
554
+ for (var name in this) {
555
+ // Not sure about the optimal order of these conditions:
556
+ if (name.charAt(0) === "t" &&
557
+ hasOwn.call(this, name) &&
558
+ !isNaN(+name.slice(1))) {
559
+ this[name] = undefined$1;
560
+ }
561
+ }
562
+ }
563
+ },
564
+
565
+ stop: function() {
566
+ this.done = true;
567
+
568
+ var rootEntry = this.tryEntries[0];
569
+ var rootRecord = rootEntry.completion;
570
+ if (rootRecord.type === "throw") {
571
+ throw rootRecord.arg;
572
+ }
573
+
574
+ return this.rval;
575
+ },
576
+
577
+ dispatchException: function(exception) {
578
+ if (this.done) {
579
+ throw exception;
580
+ }
581
+
582
+ var context = this;
583
+ function handle(loc, caught) {
584
+ record.type = "throw";
585
+ record.arg = exception;
586
+ context.next = loc;
587
+
588
+ if (caught) {
589
+ // If the dispatched exception was caught by a catch block,
590
+ // then let that catch block handle the exception normally.
591
+ context.method = "next";
592
+ context.arg = undefined$1;
593
+ }
594
+
595
+ return !! caught;
596
+ }
597
+
598
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
599
+ var entry = this.tryEntries[i];
600
+ var record = entry.completion;
601
+
602
+ if (entry.tryLoc === "root") {
603
+ // Exception thrown outside of any try block that could handle
604
+ // it, so set the completion value of the entire function to
605
+ // throw the exception.
606
+ return handle("end");
607
+ }
608
+
609
+ if (entry.tryLoc <= this.prev) {
610
+ var hasCatch = hasOwn.call(entry, "catchLoc");
611
+ var hasFinally = hasOwn.call(entry, "finallyLoc");
612
+
613
+ if (hasCatch && hasFinally) {
614
+ if (this.prev < entry.catchLoc) {
615
+ return handle(entry.catchLoc, true);
616
+ } else if (this.prev < entry.finallyLoc) {
617
+ return handle(entry.finallyLoc);
618
+ }
619
+
620
+ } else if (hasCatch) {
621
+ if (this.prev < entry.catchLoc) {
622
+ return handle(entry.catchLoc, true);
623
+ }
624
+
625
+ } else if (hasFinally) {
626
+ if (this.prev < entry.finallyLoc) {
627
+ return handle(entry.finallyLoc);
628
+ }
629
+
630
+ } else {
631
+ throw new Error("try statement without catch or finally");
632
+ }
633
+ }
634
+ }
635
+ },
636
+
637
+ abrupt: function(type, arg) {
638
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
639
+ var entry = this.tryEntries[i];
640
+ if (entry.tryLoc <= this.prev &&
641
+ hasOwn.call(entry, "finallyLoc") &&
642
+ this.prev < entry.finallyLoc) {
643
+ var finallyEntry = entry;
644
+ break;
645
+ }
646
+ }
647
+
648
+ if (finallyEntry &&
649
+ (type === "break" ||
650
+ type === "continue") &&
651
+ finallyEntry.tryLoc <= arg &&
652
+ arg <= finallyEntry.finallyLoc) {
653
+ // Ignore the finally entry if control is not jumping to a
654
+ // location outside the try/catch block.
655
+ finallyEntry = null;
656
+ }
657
+
658
+ var record = finallyEntry ? finallyEntry.completion : {};
659
+ record.type = type;
660
+ record.arg = arg;
661
+
662
+ if (finallyEntry) {
663
+ this.method = "next";
664
+ this.next = finallyEntry.finallyLoc;
665
+ return ContinueSentinel;
666
+ }
667
+
668
+ return this.complete(record);
669
+ },
670
+
671
+ complete: function(record, afterLoc) {
672
+ if (record.type === "throw") {
673
+ throw record.arg;
674
+ }
675
+
676
+ if (record.type === "break" ||
677
+ record.type === "continue") {
678
+ this.next = record.arg;
679
+ } else if (record.type === "return") {
680
+ this.rval = this.arg = record.arg;
681
+ this.method = "return";
682
+ this.next = "end";
683
+ } else if (record.type === "normal" && afterLoc) {
684
+ this.next = afterLoc;
685
+ }
686
+
687
+ return ContinueSentinel;
688
+ },
689
+
690
+ finish: function(finallyLoc) {
691
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
692
+ var entry = this.tryEntries[i];
693
+ if (entry.finallyLoc === finallyLoc) {
694
+ this.complete(entry.completion, entry.afterLoc);
695
+ resetTryEntry(entry);
696
+ return ContinueSentinel;
697
+ }
698
+ }
699
+ },
700
+
701
+ "catch": function(tryLoc) {
702
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
703
+ var entry = this.tryEntries[i];
704
+ if (entry.tryLoc === tryLoc) {
705
+ var record = entry.completion;
706
+ if (record.type === "throw") {
707
+ var thrown = record.arg;
708
+ resetTryEntry(entry);
709
+ }
710
+ return thrown;
711
+ }
712
+ }
713
+
714
+ // The context.catch method must only be called with a location
715
+ // argument that corresponds to a known catch block.
716
+ throw new Error("illegal catch attempt");
717
+ },
718
+
719
+ delegateYield: function(iterable, resultName, nextLoc) {
720
+ this.delegate = {
721
+ iterator: values(iterable),
722
+ resultName: resultName,
723
+ nextLoc: nextLoc
724
+ };
725
+
726
+ if (this.method === "next") {
727
+ // Deliberately forget the last sent value so that we don't
728
+ // accidentally pass it on to the delegate.
729
+ this.arg = undefined$1;
730
+ }
731
+
732
+ return ContinueSentinel;
733
+ }
734
+ };
735
+ })(
736
+ // In sloppy mode, unbound `this` refers to the global object, fallback to
737
+ // Function constructor if we're in global strict mode. That is sadly a form
738
+ // of indirect eval which violates Content Security Policy.
739
+ (function() { return this })() || Function("return this")()
740
+ );
741
+ });
742
+
743
+ /**
744
+ * Copyright (c) 2014-present, Facebook, Inc.
745
+ *
746
+ * This source code is licensed under the MIT license found in the
747
+ * LICENSE file in the root directory of this source tree.
748
+ */
749
+
750
+ // This method of obtaining a reference to the global object needs to be
751
+ // kept identical to the way it is obtained in runtime.js
752
+ var g = (function() { return this })() || Function("return this")();
753
+
754
+ // Use `getOwnPropertyNames` because not all browsers support calling
755
+ // `hasOwnProperty` on the global `self` object in a worker. See #183.
756
+ var hadRuntime = g.regeneratorRuntime &&
757
+ Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0;
758
+
759
+ // Save the old regeneratorRuntime in case it needs to be restored later.
760
+ var oldRuntime = hadRuntime && g.regeneratorRuntime;
761
+
762
+ // Force reevalutation of runtime.js.
763
+ g.regeneratorRuntime = undefined;
764
+
765
+ var runtimeModule = runtime;
766
+
767
+ if (hadRuntime) {
768
+ // Restore the original runtime.
769
+ g.regeneratorRuntime = oldRuntime;
770
+ } else {
771
+ // Remove the global property added by runtime.js.
772
+ try {
773
+ delete g.regeneratorRuntime;
774
+ } catch(e) {
775
+ g.regeneratorRuntime = undefined;
776
+ }
777
+ }
778
+
779
+ var regenerator = runtimeModule;
780
+
781
+ var $JSON = _toObject._core.JSON || (_toObject._core.JSON = { stringify: JSON.stringify });
782
+ var stringify = function stringify(it) { // eslint-disable-line no-unused-vars
783
+ return $JSON.stringify.apply($JSON, arguments);
784
+ };
785
+
786
+ var stringify$1 = _commonjsHelpers.createCommonjsModule(function (module) {
787
+ module.exports = { "default": stringify, __esModule: true };
788
+ });
789
+
790
+ var _JSON$stringify = _commonjsHelpers.unwrapExports(stringify$1);
791
+
792
+ var asyncToGenerator = _commonjsHelpers.createCommonjsModule(function (module, exports) {
793
+
794
+ exports.__esModule = true;
795
+
796
+
797
+
798
+ var _promise2 = _interopRequireDefault(promise.promise);
799
+
800
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
801
+
802
+ exports.default = function (fn) {
803
+ return function () {
804
+ var gen = fn.apply(this, arguments);
805
+ return new _promise2.default(function (resolve, reject) {
806
+ function step(key, arg) {
807
+ try {
808
+ var info = gen[key](arg);
809
+ var value = info.value;
810
+ } catch (error) {
811
+ reject(error);
812
+ return;
813
+ }
814
+
815
+ if (info.done) {
816
+ resolve(value);
817
+ } else {
818
+ return _promise2.default.resolve(value).then(function (value) {
819
+ step("next", value);
820
+ }, function (err) {
821
+ step("throw", err);
822
+ });
823
+ }
824
+ }
825
+
826
+ return step("next");
827
+ });
828
+ };
829
+ };
830
+ });
831
+
832
+ var _asyncToGenerator = _commonjsHelpers.unwrapExports(asyncToGenerator);
833
+
834
+ var faunadb = require('faunadb');
835
+
836
+ var _require = require('faunadb'),
837
+ q = _require.query;
838
+
839
+ var shortid = require('shortid');
840
+ var moment = require('moment');
841
+ var cookie = require('react-cookies'); // client side cookie handler
842
+
843
+ var _require2 = require('cookie'),
844
+ serialize = _require2.serialize; // cookie serializer
845
+
846
+
847
+ var serverCookies = require('next-cookies'); // server side cookie handler
848
+ var request = require('superagent');
849
+ require("babel-polyfill");
850
+ // server key for beam
851
+ // fnADs4Gtx6ACEgKgwlNo-eNSIrdwykH9Zj74GsDI
852
+
853
+ var beam_domain = 'https://beam.mjhlifesciences.com';
854
+
855
+ var Beam = {
856
+ proc_url: function proc_url() {
857
+ var $_GET = {};
858
+ document.location.search.replace(/\??(?:([^=]+)=([^&]*)&?)/g, function () {
859
+ function decode(s) {
860
+ return decodeURIComponent(s.split("+").join(" "));
861
+ }
862
+ $_GET[decode(arguments[1])] = decode(arguments[2]);
863
+ });
864
+
865
+ return $_GET;
866
+ },
867
+ proc_eKey: function proc_eKey($_GET) {
868
+ var eKey = "N/A";
869
+
870
+ if ($_GET["eKey"]) {
871
+ eKey = $_GET["eKey"];
872
+ } else if (typeof window.eKey !== 'undefined') {
873
+ eKey = window.eKey;
874
+ }
875
+
876
+ return eKey;
877
+ },
878
+ proc_source: function proc_source() {
879
+ var referrer = "N/A";
880
+
881
+ if (encodeURIComponent(document.referrer)) {
882
+ referrer = encodeURIComponent(document.referrer);
883
+ }
884
+
885
+ return referrer;
886
+ },
887
+ proc_meta: function proc_meta() {
888
+ var data = {};
889
+
890
+ //keyword processing
891
+ var element = document.querySelector('meta[name="keywords"]');
892
+
893
+ data.keywords = "N/A";
894
+
895
+ if (element && element.getAttribute("content")) {
896
+ data.keywords = element.getAttribute("content");
897
+ }
898
+
899
+ //title processing
900
+ data.title = "N/A";
901
+ if (document.title !== "undefined") {
902
+ data.title = document.title;
903
+ }
904
+
905
+ return data;
906
+ },
907
+ proc_host: function proc_host() {
908
+ var data = {};
909
+ data.domain = window.location.hostname;
910
+ data.uri = window.location.pathname;
911
+ data.host = window.location.host;
912
+ data.protocol = window.location.protocol;
913
+
914
+ if (window.location.search) {
915
+ data.uri = data.uri + window.location.search;
916
+ }
917
+
918
+ return data;
919
+ },
920
+ get_beam: function get_beam(deviceType) {
921
+ var beam = {};
922
+ beam.eKey = this.proc_eKey(this.proc_url());
923
+ beam.source = this.proc_source();
924
+ beam.meta = this.proc_meta();
925
+ beam.host = this.proc_host();
926
+ beam.device = deviceType;
927
+ return beam;
928
+ },
929
+
930
+
931
+ /* for client use */
932
+ report_beam_event: function report_beam_event(action, deviceType) {
933
+ var _this = this;
934
+
935
+ return _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
936
+ var beam, response, res;
937
+ return regenerator.wrap(function _callee$(_context) {
938
+ while (1) {
939
+ switch (_context.prev = _context.next) {
940
+ case 0:
941
+ beam = _this.get_beam(deviceType);
942
+ _context.next = 3;
943
+ return fetch(beam_domain + '/api/beam/event', {
944
+ headers: {
945
+ 'Content-Type': 'application/json',
946
+ 'Accept': 'application/json'
947
+ },
948
+ method: 'post',
949
+ credentials: "include",
950
+ body: _JSON$stringify({
951
+ event: 'Beam',
952
+ action: action,
953
+ beam: _JSON$stringify(beam)
954
+ })
955
+ });
956
+
957
+ case 3:
958
+ response = _context.sent;
959
+ _context.next = 6;
960
+ return response.json();
961
+
962
+ case 6:
963
+ res = _context.sent;
964
+
965
+ if (res.error) {
966
+ console.error('Beam reporting error:', res.error);
967
+ }
968
+
969
+ case 8:
970
+ case 'end':
971
+ return _context.stop();
972
+ }
973
+ }
974
+ }, _callee, _this);
975
+ }))();
976
+ },
977
+ report_beam_ad: function report_beam_ad(action, deviceType, cID, lID, campID, adSize, slotId) {
978
+ var _this2 = this;
979
+
980
+ return _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2() {
981
+ var beam, data, response, res;
982
+ return regenerator.wrap(function _callee2$(_context2) {
983
+ while (1) {
984
+ switch (_context2.prev = _context2.next) {
985
+ case 0:
986
+ beam = _this2.get_beam(deviceType);
987
+ data = {};
988
+
989
+ data.campaignId = campID;
990
+ data.lineItemId = lID;
991
+ data.creativeId = cID;
992
+ data.size = adSize;
993
+ data.slotId = slotId;
994
+
995
+ _context2.next = 9;
996
+ return fetch(beam_domain + '/api/beam/ad', {
997
+ headers: {
998
+ 'Content-Type': 'application/json',
999
+ 'Accept': 'application/json'
1000
+ },
1001
+ method: 'post',
1002
+ credentials: "include",
1003
+ body: _JSON$stringify({
1004
+ event: 'DFP',
1005
+ action: action,
1006
+ beam: _JSON$stringify(beam),
1007
+ data: _JSON$stringify(data)
1008
+ })
1009
+ });
1010
+
1011
+ case 9:
1012
+ response = _context2.sent;
1013
+ _context2.next = 12;
1014
+ return response.json();
1015
+
1016
+ case 12:
1017
+ res = _context2.sent;
1018
+
1019
+ if (res.error) {
1020
+ console.error('Beam AD reporting error:', res.error);
1021
+ }
1022
+
1023
+ case 14:
1024
+ case 'end':
1025
+ return _context2.stop();
1026
+ }
1027
+ }
1028
+ }, _callee2, _this2);
1029
+ }))();
1030
+ },
1031
+ report_beam_video: function report_beam_video(action, deviceType, duration, current, segment) {
1032
+ var _this3 = this;
1033
+
1034
+ return _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee3() {
1035
+ var beam, data, response, res;
1036
+ return regenerator.wrap(function _callee3$(_context3) {
1037
+ while (1) {
1038
+ switch (_context3.prev = _context3.next) {
1039
+ case 0:
1040
+ beam = _this3.get_beam(deviceType);
1041
+ data = {};
1042
+
1043
+ data.duration = duration;
1044
+ data.queue = Math.floor(duration / 10);
1045
+ data.segment = segment;
1046
+ data.current = current;
1047
+
1048
+ _context3.next = 8;
1049
+ return fetch(beam_domain + '/api/beam/video', {
1050
+ headers: {
1051
+ 'Content-Type': 'application/json',
1052
+ 'Accept': 'application/json'
1053
+ },
1054
+ method: 'post',
1055
+ credentials: "include",
1056
+ body: _JSON$stringify({
1057
+ event: 'DFP',
1058
+ action: action,
1059
+ beam: _JSON$stringify(beam),
1060
+ data: _JSON$stringify(data)
1061
+ })
1062
+ });
1063
+
1064
+ case 8:
1065
+ response = _context3.sent;
1066
+ _context3.next = 11;
1067
+ return response.json();
1068
+
1069
+ case 11:
1070
+ res = _context3.sent;
1071
+
1072
+ if (res.error) {
1073
+ console.error('Beam AD reporting error:', res.error);
1074
+ }
1075
+
1076
+ case 13:
1077
+ case 'end':
1078
+ return _context3.stop();
1079
+ }
1080
+ }
1081
+ }, _callee3, _this3);
1082
+ }))();
1083
+ }
1084
+ };
1085
+
1086
+ var DFPAdSlot = function DFPAdSlot(_ref) {
1087
+ var adUnit = _ref.adUnit,
1088
+ sizeMapping = _ref.sizeMapping,
1089
+ className = _ref.className,
1090
+ slotId = _ref.slotId,
1091
+ sizes = _ref.sizes,
1092
+ _ref$targeting = _ref.targeting,
1093
+ targeting = _ref$targeting === undefined ? {} : _ref$targeting;
1094
+
1095
+ var _useState = React.useState(false),
1096
+ _useState2 = slicedToArray._slicedToArray(_useState, 2),
1097
+ adRendered = _useState2[0],
1098
+ setAdRendered = _useState2[1];
1099
+
1100
+ var _useState3 = React.useState(false),
1101
+ _useState4 = slicedToArray._slicedToArray(_useState3, 2),
1102
+ adRefreshable = _useState4[0],
1103
+ setAdRefreshable = _useState4[1];
1104
+
1105
+ var _useState5 = React.useState(false),
1106
+ _useState6 = slicedToArray._slicedToArray(_useState5, 2),
1107
+ adHasFocus = _useState6[0],
1108
+ setAdHasFocus = _useState6[1];
1109
+
1110
+ var handleVisibilityChange = debounce.debounce_1(function (_ref2) {
1111
+ var event = _ref2.event;
1112
+
1113
+ if (event.inViewPercentage <= 0) {
1114
+ setAdRefreshable(false);
1115
+ } else {
1116
+ setAdRefreshable(true);
1117
+ }
1118
+ }, 500);
1119
+
1120
+ return React__default.createElement(
1121
+ 'div',
1122
+ { className: className },
1123
+ React__default.createElement(index.lib_2, {
1124
+ slotId: slotId,
1125
+ sizes: sizes,
1126
+ adUnit: adUnit,
1127
+ sizeMapping: sizeMapping,
1128
+ targetingArguments: targeting,
1129
+ onSlotRender: function onSlotRender(eventData) {
1130
+ setAdRendered(true);
1131
+ if (eventData && eventData.event) {
1132
+ var cID = eventData.event.creativeId;
1133
+ var lID = eventData.event.lineItemId;
1134
+ var campID = eventData.event.campaignId;
1135
+ var adSize = eventData.event.size.length > 1 ? eventData.event.size[0] + 'x' + eventData.event.size[1] : '';
1136
+ var slot_id = eventData.slotId ? eventData.slotId : '';
1137
+
1138
+ Beam.report_beam_ad('Impression', main.main_16, cID, lID, campID, adSize, slot_id);
1139
+
1140
+ var slot_div = document.getElementById(eventData.slotId);
1141
+ if (slot_div) {
1142
+ slot_div.addEventListener('mouseenter', function () {
1143
+ var timeoutId = slot_div.getAttribute('timeoutId');
1144
+ clearTimeout(timeoutId);
1145
+ slot_div.setAttribute('hasFocus', 'yes');
1146
+ });
1147
+
1148
+ slot_div.addEventListener('mouseleave', function () {
1149
+ var timeoutId = setTimeout(function () {
1150
+ slot_div.setAttribute('hasFocus', 'no');
1151
+ }, 60);
1152
+ slot_div.setAttribute('timeoutId', timeoutId);
1153
+ });
1154
+
1155
+ document.addEventListener('visibilitychange', function () {
1156
+ if (!document.hidden) {
1157
+ return;
1158
+ }
1159
+
1160
+ var hasFocus = slot_div.getAttribute('hasFocus');
1161
+ if (hasFocus == 'yes' && document.hidden) {
1162
+ console.log('AD Clicked:', eventData.slotId);
1163
+ slot_div.setAttribute('hasFocus', 'no');
1164
+ Beam.report_beam_ad('Click', main.main_16, cID, lID, campID, adSize, slotId);
1165
+ }
1166
+ });
1167
+ } else {
1168
+ console.error('slot div not found:', slotId);
1169
+ }
1170
+ }
1171
+ },
1172
+ onSlotVisibilityChanged: handleVisibilityChange,
1173
+ shouldRefresh: function shouldRefresh() {
1174
+ if (adRendered && adRefreshable) return true;else return false;
1175
+ }
1176
+ })
1177
+ );
1178
+ };
1179
+
1180
+ DFPAdSlot.propTypes = {
1181
+ adUnit: PropTypes.string.isRequired,
1182
+ slotId: PropTypes.string,
1183
+ className: PropTypes.string,
1184
+ sizeMapping: PropTypes.array,
1185
+ sizes: PropTypes.array
1186
+ };
1187
+
1188
+ exports.Beam = Beam;
1189
+ exports.DFPAdSlot = DFPAdSlot;
1190
+ exports._JSON$stringify = _JSON$stringify;
1191
+ exports._asyncToGenerator = _asyncToGenerator;
1192
+ exports.regenerator = regenerator;