@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.
- package/README.md +1 -1
- package/dist/cjs/AdSlot-c472fff6.js +1192 -0
- package/dist/cjs/DeckContent.js +6 -5
- package/dist/cjs/DeckQueue.js +5 -5
- package/dist/cjs/{Dfp-045b016b.js → Dfp-7a5533f9.js} +1 -1
- package/dist/cjs/{GridContent-53e78cbf.js → GridContent-f9e3fff5.js} +7 -7
- package/dist/cjs/GridContent.js +8 -7
- package/dist/cjs/MasterDeck.js +331 -13
- package/dist/cjs/{Normal-a94a1ec8.js → Normal-0497eb61.js} +5 -5
- package/dist/cjs/QueueDeckExpanded.js +2 -2
- package/dist/cjs/TemplateNormal.js +6 -5
- package/dist/cjs/VideoSeriesListing.js +2 -2
- package/dist/cjs/{debounce-bbca43c4.js → debounce-783eb233.js} +3 -0
- package/dist/cjs/{get-af2516a4.js → get-1f91592f.js} +1 -1
- package/dist/cjs/index.js +118 -842
- package/dist/cjs/{inherits-5b5ca8db.js → inherits-9898af5a.js} +2 -4
- package/dist/cjs/{main-d9a1b014.js → main-0ea1b808.js} +51 -0
- package/dist/cjs/{MasterDeck-91c6ad85.js → promise-b96c61f8.js} +7 -340
- package/dist/cjs/{toConsumableArray-7e4caf3c.js → toConsumableArray-f05a306f.js} +5 -52
- package/dist/esm/AdSlot-bdd7a629.js +1183 -0
- package/dist/esm/DeckContent.js +11 -10
- package/dist/esm/DeckQueue.js +9 -9
- package/dist/esm/{Dfp-01f14ae3.js → Dfp-71879c9d.js} +5 -5
- package/dist/esm/{GridContent-f5bc4d75.js → GridContent-d4f5457e.js} +8 -8
- package/dist/esm/GridContent.js +13 -12
- package/dist/esm/MasterDeck.js +333 -15
- package/dist/esm/{Normal-357f00d1.js → Normal-e1855047.js} +6 -6
- package/dist/esm/QueueDeckExpanded.js +7 -7
- package/dist/esm/{TaxonomyCard-f74512cb.js → TaxonomyCard-ee1a22ae.js} +1 -1
- package/dist/esm/TaxonomyCard.js +3 -3
- package/dist/esm/TemplateNormal.js +10 -9
- package/dist/esm/{Ustream-62a07a32.js → Ustream-d51b9b11.js} +1 -1
- package/dist/esm/Ustream.js +5 -5
- package/dist/esm/VideoSeriesListing.js +5 -5
- package/dist/esm/{_to-object-86553f76.js → _to-object-b9b796ec.js} +1 -1
- package/dist/esm/{core.get-iterator-method-709061dc.js → core.get-iterator-method-31c1fb1a.js} +2 -2
- package/dist/esm/{debounce-fa7fbf11.js → debounce-806f886b.js} +3 -1
- package/dist/esm/{extends-7f88fa22.js → extends-dbbe308d.js} +1 -1
- package/dist/esm/{get-8d382479.js → get-b2201dc8.js} +1 -1
- package/dist/esm/index.js +124 -850
- package/dist/esm/{inherits-a82a4471.js → inherits-a75c8a1c.js} +5 -6
- package/dist/esm/{main-eecf7b27.js → main-155ec04f.js} +48 -1
- package/dist/esm/{MasterDeck-5dd97a66.js → promise-683a9c54.js} +6 -335
- package/dist/esm/{slicedToArray-eb7eca9e.js → slicedToArray-d0a9593a.js} +3 -3
- package/dist/esm/{toConsumableArray-08d50169.js → toConsumableArray-eb308ede.js} +5 -49
- package/dist/esm/{web.dom.iterable-f05d2f57.js → web.dom.iterable-3be50d6c.js} +2 -2
- package/package.json +3 -2
- package/dist/cjs/AdSlot-1fe1c231.js +0 -69
- package/dist/esm/AdSlot-017b8051.js +0 -64
package/dist/esm/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { c as createCommonjsModule,
|
|
2
|
-
import { _ as
|
|
3
|
-
import './web.dom.iterable-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import './
|
|
7
|
-
import
|
|
1
|
+
import { c as createCommonjsModule, a as commonjsGlobal, g as getCjsExportFromNamespace, u as unwrapExports } from './_commonjsHelpers-0c4b6f40.js';
|
|
2
|
+
import { _ as _objectKeys, a as _toObject, b as _core } from './_to-object-b9b796ec.js';
|
|
3
|
+
import './web.dom.iterable-3be50d6c.js';
|
|
4
|
+
import { d as debounce_1 } from './debounce-806f886b.js';
|
|
5
|
+
import { m as main_36, a as main_16, b as main_35 } from './main-155ec04f.js';
|
|
6
|
+
import { _ as _toConsumableArray, a as _Array$from } from './toConsumableArray-eb308ede.js';
|
|
7
|
+
import './core.get-iterator-method-31c1fb1a.js';
|
|
8
|
+
import { _ as _extends$2 } from './extends-dbbe308d.js';
|
|
9
|
+
import { _ as _objectSap, a as _inherits$1, b as _classCallCheck$1, c as _possibleConstructorReturn$1, d as _Object$getPrototypeOf, e as _createClass$1 } from './inherits-a75c8a1c.js';
|
|
8
10
|
import React__default, { useState, useEffect, useRef } from 'react';
|
|
9
11
|
import { l as lib_3, a as lib_1 } from './index-fa84ea96.js';
|
|
10
12
|
import PropTypes from 'prop-types';
|
|
@@ -15,23 +17,22 @@ import 'react-bootstrap/Card';
|
|
|
15
17
|
import { m as moment, I as InfiniteScroll, V as VisibilitySensor } from './visibility-sensor-336093e1.js';
|
|
16
18
|
import Link from 'next/link';
|
|
17
19
|
import Router, { useRouter } from 'next/router';
|
|
18
|
-
import { d as debounce_1 } from './debounce-fa7fbf11.js';
|
|
19
20
|
import 'react-dom';
|
|
20
21
|
import { i as imageUrlBuilder } from './index-3849e3fe.js';
|
|
21
22
|
import './index-5f9f807a.js';
|
|
22
|
-
import { m as main_36, a as main_35 } from './main-eecf7b27.js';
|
|
23
23
|
import { h as html_decode_1, c as clean_html_1 } from './entities-7cc3bf45.js';
|
|
24
|
-
import { _ as _slicedToArray } from './slicedToArray-
|
|
25
|
-
import { D as DFPAdSlot } from './AdSlot-
|
|
26
|
-
export { D as AdSlot } from './AdSlot-
|
|
24
|
+
import { _ as _slicedToArray } from './slicedToArray-d0a9593a.js';
|
|
25
|
+
import { _ as _JSON$stringify, a as _asyncToGenerator, r as regenerator, D as DFPAdSlot, B as Beam } from './AdSlot-bdd7a629.js';
|
|
26
|
+
export { D as AdSlot, B as Beam } from './AdSlot-bdd7a629.js';
|
|
27
|
+
import './promise-683a9c54.js';
|
|
27
28
|
export { default as DeckContent } from './DeckContent.js';
|
|
28
|
-
import './get-
|
|
29
|
-
export { A as AD, G as GridContent } from './GridContent-
|
|
29
|
+
import './get-b2201dc8.js';
|
|
30
|
+
export { A as AD, G as GridContent } from './GridContent-d4f5457e.js';
|
|
30
31
|
export { default as DeckQueue } from './DeckQueue.js';
|
|
31
32
|
import 'react-bootstrap/Media';
|
|
32
33
|
export { default as ThumbnailCard } from './ThumbnailCard.js';
|
|
33
|
-
import { B as BlockContent } from './TaxonomyCard-
|
|
34
|
-
export { T as TaxonomyCard } from './TaxonomyCard-
|
|
34
|
+
import { B as BlockContent } from './TaxonomyCard-ee1a22ae.js';
|
|
35
|
+
export { T as TaxonomyCard } from './TaxonomyCard-ee1a22ae.js';
|
|
35
36
|
import GroupDeck from './GroupDeck.js';
|
|
36
37
|
export { default as GroupDeck } from './GroupDeck.js';
|
|
37
38
|
import { g as getYoutubeId } from './YoutubeGroup-1b3eca73.js';
|
|
@@ -40,16 +41,15 @@ import { Spinner as Spinner$1, Container as Container$1, Row as Row$1, Col as Co
|
|
|
40
41
|
export { default as QueueDeckExpanded } from './QueueDeckExpanded.js';
|
|
41
42
|
import { I as IoMdArrowDropdown } from './index.esm-536609db.js';
|
|
42
43
|
export { default as VideoSeriesListing } from './VideoSeriesListing.js';
|
|
43
|
-
|
|
44
|
-
export { M as MasterDeck } from './MasterDeck-5dd97a66.js';
|
|
44
|
+
export { default as MasterDeck } from './MasterDeck.js';
|
|
45
45
|
import Button from 'react-bootstrap/Button';
|
|
46
46
|
export { default as PublicationDeck } from './PublicationDeck.js';
|
|
47
47
|
export { default as IssueDeck } from './IssueDeck.js';
|
|
48
48
|
import 'react-bootstrap/Badge';
|
|
49
49
|
export { default as IssueContentDeck } from './IssueContentDeck.js';
|
|
50
50
|
import Spinner from 'react-bootstrap/Spinner';
|
|
51
|
-
import { M as MdPictureAsPdf, T as TemplateNormal } from './Normal-
|
|
52
|
-
export { A as AD728x90, C as Column1, a as Column2, b as Column3, f as HamMagazine, H as Header, L as LeftNav, e as NavDvm, c as NavMagazine, N as NavNative, d as NavNormal, P as PageFilter, S as Search, g as SideFooter, T as TemplateNormal } from './Normal-
|
|
51
|
+
import { M as MdPictureAsPdf, T as TemplateNormal } from './Normal-e1855047.js';
|
|
52
|
+
export { A as AD728x90, C as Column1, a as Column2, b as Column3, f as HamMagazine, H as Header, L as LeftNav, e as NavDvm, c as NavMagazine, N as NavNative, d as NavNormal, P as PageFilter, S as Search, g as SideFooter, T as TemplateNormal } from './Normal-e1855047.js';
|
|
53
53
|
import 'react-bootstrap/ListGroup';
|
|
54
54
|
import Head from 'next/head';
|
|
55
55
|
import Accordion from 'react-bootstrap/Accordion';
|
|
@@ -65,19 +65,8 @@ import Carousel$1 from 'react-bootstrap/Carousel';
|
|
|
65
65
|
import Breadcrumb from 'react-bootstrap/Breadcrumb';
|
|
66
66
|
import DropdownButton from 'react-bootstrap/DropdownButton';
|
|
67
67
|
import Dropdown from 'react-bootstrap/Dropdown';
|
|
68
|
-
import { F as FaLongArrowAltRight } from './Ustream-
|
|
69
|
-
export { U as Ustream } from './Ustream-
|
|
70
|
-
|
|
71
|
-
var $JSON = _core.JSON || (_core.JSON = { stringify: JSON.stringify });
|
|
72
|
-
var stringify = function stringify(it) { // eslint-disable-line no-unused-vars
|
|
73
|
-
return $JSON.stringify.apply($JSON, arguments);
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
var stringify$1 = createCommonjsModule(function (module) {
|
|
77
|
-
module.exports = { "default": stringify, __esModule: true };
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
var _JSON$stringify = unwrapExports(stringify$1);
|
|
68
|
+
import { F as FaLongArrowAltRight } from './Ustream-d51b9b11.js';
|
|
69
|
+
export { U as Ustream } from './Ustream-d51b9b11.js';
|
|
81
70
|
|
|
82
71
|
var momentTimezone = createCommonjsModule(function (module) {
|
|
83
72
|
//! moment-timezone.js
|
|
@@ -1630,12 +1619,12 @@ var latest = {
|
|
|
1630
1619
|
};
|
|
1631
1620
|
|
|
1632
1621
|
var latest$1 = /*#__PURE__*/Object.freeze({
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1622
|
+
__proto__: null,
|
|
1623
|
+
version: version,
|
|
1624
|
+
zones: zones,
|
|
1625
|
+
links: links,
|
|
1626
|
+
countries: countries,
|
|
1627
|
+
'default': latest
|
|
1639
1628
|
});
|
|
1640
1629
|
|
|
1641
1630
|
var require$$1 = getCjsExportFromNamespace(latest$1);
|
|
@@ -2088,813 +2077,6 @@ var EventsDeck = function EventsDeck(_ref) {
|
|
|
2088
2077
|
}
|
|
2089
2078
|
};
|
|
2090
2079
|
|
|
2091
|
-
var runtime = createCommonjsModule(function (module) {
|
|
2092
|
-
/**
|
|
2093
|
-
* Copyright (c) 2014-present, Facebook, Inc.
|
|
2094
|
-
*
|
|
2095
|
-
* This source code is licensed under the MIT license found in the
|
|
2096
|
-
* LICENSE file in the root directory of this source tree.
|
|
2097
|
-
*/
|
|
2098
|
-
|
|
2099
|
-
!(function(global) {
|
|
2100
|
-
|
|
2101
|
-
var Op = Object.prototype;
|
|
2102
|
-
var hasOwn = Op.hasOwnProperty;
|
|
2103
|
-
var undefined$1; // More compressible than void 0.
|
|
2104
|
-
var $Symbol = typeof Symbol === "function" ? Symbol : {};
|
|
2105
|
-
var iteratorSymbol = $Symbol.iterator || "@@iterator";
|
|
2106
|
-
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
|
|
2107
|
-
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
2108
|
-
var runtime = global.regeneratorRuntime;
|
|
2109
|
-
if (runtime) {
|
|
2110
|
-
{
|
|
2111
|
-
// If regeneratorRuntime is defined globally and we're in a module,
|
|
2112
|
-
// make the exports object identical to regeneratorRuntime.
|
|
2113
|
-
module.exports = runtime;
|
|
2114
|
-
}
|
|
2115
|
-
// Don't bother evaluating the rest of this file if the runtime was
|
|
2116
|
-
// already defined globally.
|
|
2117
|
-
return;
|
|
2118
|
-
}
|
|
2119
|
-
|
|
2120
|
-
// Define the runtime globally (as expected by generated code) as either
|
|
2121
|
-
// module.exports (if we're in a module) or a new, empty object.
|
|
2122
|
-
runtime = global.regeneratorRuntime = module.exports ;
|
|
2123
|
-
|
|
2124
|
-
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
2125
|
-
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
|
|
2126
|
-
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
|
|
2127
|
-
var generator = Object.create(protoGenerator.prototype);
|
|
2128
|
-
var context = new Context(tryLocsList || []);
|
|
2129
|
-
|
|
2130
|
-
// The ._invoke method unifies the implementations of the .next,
|
|
2131
|
-
// .throw, and .return methods.
|
|
2132
|
-
generator._invoke = makeInvokeMethod(innerFn, self, context);
|
|
2133
|
-
|
|
2134
|
-
return generator;
|
|
2135
|
-
}
|
|
2136
|
-
runtime.wrap = wrap;
|
|
2137
|
-
|
|
2138
|
-
// Try/catch helper to minimize deoptimizations. Returns a completion
|
|
2139
|
-
// record like context.tryEntries[i].completion. This interface could
|
|
2140
|
-
// have been (and was previously) designed to take a closure to be
|
|
2141
|
-
// invoked without arguments, but in all the cases we care about we
|
|
2142
|
-
// already have an existing method we want to call, so there's no need
|
|
2143
|
-
// to create a new function object. We can even get away with assuming
|
|
2144
|
-
// the method takes exactly one argument, since that happens to be true
|
|
2145
|
-
// in every case, so we don't have to touch the arguments object. The
|
|
2146
|
-
// only additional allocation required is the completion record, which
|
|
2147
|
-
// has a stable shape and so hopefully should be cheap to allocate.
|
|
2148
|
-
function tryCatch(fn, obj, arg) {
|
|
2149
|
-
try {
|
|
2150
|
-
return { type: "normal", arg: fn.call(obj, arg) };
|
|
2151
|
-
} catch (err) {
|
|
2152
|
-
return { type: "throw", arg: err };
|
|
2153
|
-
}
|
|
2154
|
-
}
|
|
2155
|
-
|
|
2156
|
-
var GenStateSuspendedStart = "suspendedStart";
|
|
2157
|
-
var GenStateSuspendedYield = "suspendedYield";
|
|
2158
|
-
var GenStateExecuting = "executing";
|
|
2159
|
-
var GenStateCompleted = "completed";
|
|
2160
|
-
|
|
2161
|
-
// Returning this object from the innerFn has the same effect as
|
|
2162
|
-
// breaking out of the dispatch switch statement.
|
|
2163
|
-
var ContinueSentinel = {};
|
|
2164
|
-
|
|
2165
|
-
// Dummy constructor functions that we use as the .constructor and
|
|
2166
|
-
// .constructor.prototype properties for functions that return Generator
|
|
2167
|
-
// objects. For full spec compliance, you may wish to configure your
|
|
2168
|
-
// minifier not to mangle the names of these two functions.
|
|
2169
|
-
function Generator() {}
|
|
2170
|
-
function GeneratorFunction() {}
|
|
2171
|
-
function GeneratorFunctionPrototype() {}
|
|
2172
|
-
|
|
2173
|
-
// This is a polyfill for %IteratorPrototype% for environments that
|
|
2174
|
-
// don't natively support it.
|
|
2175
|
-
var IteratorPrototype = {};
|
|
2176
|
-
IteratorPrototype[iteratorSymbol] = function () {
|
|
2177
|
-
return this;
|
|
2178
|
-
};
|
|
2179
|
-
|
|
2180
|
-
var getProto = Object.getPrototypeOf;
|
|
2181
|
-
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
2182
|
-
if (NativeIteratorPrototype &&
|
|
2183
|
-
NativeIteratorPrototype !== Op &&
|
|
2184
|
-
hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
|
|
2185
|
-
// This environment has a native %IteratorPrototype%; use it instead
|
|
2186
|
-
// of the polyfill.
|
|
2187
|
-
IteratorPrototype = NativeIteratorPrototype;
|
|
2188
|
-
}
|
|
2189
|
-
|
|
2190
|
-
var Gp = GeneratorFunctionPrototype.prototype =
|
|
2191
|
-
Generator.prototype = Object.create(IteratorPrototype);
|
|
2192
|
-
GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
|
|
2193
|
-
GeneratorFunctionPrototype.constructor = GeneratorFunction;
|
|
2194
|
-
GeneratorFunctionPrototype[toStringTagSymbol] =
|
|
2195
|
-
GeneratorFunction.displayName = "GeneratorFunction";
|
|
2196
|
-
|
|
2197
|
-
// Helper for defining the .next, .throw, and .return methods of the
|
|
2198
|
-
// Iterator interface in terms of a single ._invoke method.
|
|
2199
|
-
function defineIteratorMethods(prototype) {
|
|
2200
|
-
["next", "throw", "return"].forEach(function(method) {
|
|
2201
|
-
prototype[method] = function(arg) {
|
|
2202
|
-
return this._invoke(method, arg);
|
|
2203
|
-
};
|
|
2204
|
-
});
|
|
2205
|
-
}
|
|
2206
|
-
|
|
2207
|
-
runtime.isGeneratorFunction = function(genFun) {
|
|
2208
|
-
var ctor = typeof genFun === "function" && genFun.constructor;
|
|
2209
|
-
return ctor
|
|
2210
|
-
? ctor === GeneratorFunction ||
|
|
2211
|
-
// For the native GeneratorFunction constructor, the best we can
|
|
2212
|
-
// do is to check its .name property.
|
|
2213
|
-
(ctor.displayName || ctor.name) === "GeneratorFunction"
|
|
2214
|
-
: false;
|
|
2215
|
-
};
|
|
2216
|
-
|
|
2217
|
-
runtime.mark = function(genFun) {
|
|
2218
|
-
if (Object.setPrototypeOf) {
|
|
2219
|
-
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
|
|
2220
|
-
} else {
|
|
2221
|
-
genFun.__proto__ = GeneratorFunctionPrototype;
|
|
2222
|
-
if (!(toStringTagSymbol in genFun)) {
|
|
2223
|
-
genFun[toStringTagSymbol] = "GeneratorFunction";
|
|
2224
|
-
}
|
|
2225
|
-
}
|
|
2226
|
-
genFun.prototype = Object.create(Gp);
|
|
2227
|
-
return genFun;
|
|
2228
|
-
};
|
|
2229
|
-
|
|
2230
|
-
// Within the body of any async function, `await x` is transformed to
|
|
2231
|
-
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
|
|
2232
|
-
// `hasOwn.call(value, "__await")` to determine if the yielded value is
|
|
2233
|
-
// meant to be awaited.
|
|
2234
|
-
runtime.awrap = function(arg) {
|
|
2235
|
-
return { __await: arg };
|
|
2236
|
-
};
|
|
2237
|
-
|
|
2238
|
-
function AsyncIterator(generator) {
|
|
2239
|
-
function invoke(method, arg, resolve, reject) {
|
|
2240
|
-
var record = tryCatch(generator[method], generator, arg);
|
|
2241
|
-
if (record.type === "throw") {
|
|
2242
|
-
reject(record.arg);
|
|
2243
|
-
} else {
|
|
2244
|
-
var result = record.arg;
|
|
2245
|
-
var value = result.value;
|
|
2246
|
-
if (value &&
|
|
2247
|
-
typeof value === "object" &&
|
|
2248
|
-
hasOwn.call(value, "__await")) {
|
|
2249
|
-
return Promise.resolve(value.__await).then(function(value) {
|
|
2250
|
-
invoke("next", value, resolve, reject);
|
|
2251
|
-
}, function(err) {
|
|
2252
|
-
invoke("throw", err, resolve, reject);
|
|
2253
|
-
});
|
|
2254
|
-
}
|
|
2255
|
-
|
|
2256
|
-
return Promise.resolve(value).then(function(unwrapped) {
|
|
2257
|
-
// When a yielded Promise is resolved, its final value becomes
|
|
2258
|
-
// the .value of the Promise<{value,done}> result for the
|
|
2259
|
-
// current iteration. If the Promise is rejected, however, the
|
|
2260
|
-
// result for this iteration will be rejected with the same
|
|
2261
|
-
// reason. Note that rejections of yielded Promises are not
|
|
2262
|
-
// thrown back into the generator function, as is the case
|
|
2263
|
-
// when an awaited Promise is rejected. This difference in
|
|
2264
|
-
// behavior between yield and await is important, because it
|
|
2265
|
-
// allows the consumer to decide what to do with the yielded
|
|
2266
|
-
// rejection (swallow it and continue, manually .throw it back
|
|
2267
|
-
// into the generator, abandon iteration, whatever). With
|
|
2268
|
-
// await, by contrast, there is no opportunity to examine the
|
|
2269
|
-
// rejection reason outside the generator function, so the
|
|
2270
|
-
// only option is to throw it from the await expression, and
|
|
2271
|
-
// let the generator function handle the exception.
|
|
2272
|
-
result.value = unwrapped;
|
|
2273
|
-
resolve(result);
|
|
2274
|
-
}, reject);
|
|
2275
|
-
}
|
|
2276
|
-
}
|
|
2277
|
-
|
|
2278
|
-
var previousPromise;
|
|
2279
|
-
|
|
2280
|
-
function enqueue(method, arg) {
|
|
2281
|
-
function callInvokeWithMethodAndArg() {
|
|
2282
|
-
return new Promise(function(resolve, reject) {
|
|
2283
|
-
invoke(method, arg, resolve, reject);
|
|
2284
|
-
});
|
|
2285
|
-
}
|
|
2286
|
-
|
|
2287
|
-
return previousPromise =
|
|
2288
|
-
// If enqueue has been called before, then we want to wait until
|
|
2289
|
-
// all previous Promises have been resolved before calling invoke,
|
|
2290
|
-
// so that results are always delivered in the correct order. If
|
|
2291
|
-
// enqueue has not been called before, then it is important to
|
|
2292
|
-
// call invoke immediately, without waiting on a callback to fire,
|
|
2293
|
-
// so that the async generator function has the opportunity to do
|
|
2294
|
-
// any necessary setup in a predictable way. This predictability
|
|
2295
|
-
// is why the Promise constructor synchronously invokes its
|
|
2296
|
-
// executor callback, and why async functions synchronously
|
|
2297
|
-
// execute code before the first await. Since we implement simple
|
|
2298
|
-
// async functions in terms of async generators, it is especially
|
|
2299
|
-
// important to get this right, even though it requires care.
|
|
2300
|
-
previousPromise ? previousPromise.then(
|
|
2301
|
-
callInvokeWithMethodAndArg,
|
|
2302
|
-
// Avoid propagating failures to Promises returned by later
|
|
2303
|
-
// invocations of the iterator.
|
|
2304
|
-
callInvokeWithMethodAndArg
|
|
2305
|
-
) : callInvokeWithMethodAndArg();
|
|
2306
|
-
}
|
|
2307
|
-
|
|
2308
|
-
// Define the unified helper method that is used to implement .next,
|
|
2309
|
-
// .throw, and .return (see defineIteratorMethods).
|
|
2310
|
-
this._invoke = enqueue;
|
|
2311
|
-
}
|
|
2312
|
-
|
|
2313
|
-
defineIteratorMethods(AsyncIterator.prototype);
|
|
2314
|
-
AsyncIterator.prototype[asyncIteratorSymbol] = function () {
|
|
2315
|
-
return this;
|
|
2316
|
-
};
|
|
2317
|
-
runtime.AsyncIterator = AsyncIterator;
|
|
2318
|
-
|
|
2319
|
-
// Note that simple async functions are implemented on top of
|
|
2320
|
-
// AsyncIterator objects; they just return a Promise for the value of
|
|
2321
|
-
// the final result produced by the iterator.
|
|
2322
|
-
runtime.async = function(innerFn, outerFn, self, tryLocsList) {
|
|
2323
|
-
var iter = new AsyncIterator(
|
|
2324
|
-
wrap(innerFn, outerFn, self, tryLocsList)
|
|
2325
|
-
);
|
|
2326
|
-
|
|
2327
|
-
return runtime.isGeneratorFunction(outerFn)
|
|
2328
|
-
? iter // If outerFn is a generator, return the full iterator.
|
|
2329
|
-
: iter.next().then(function(result) {
|
|
2330
|
-
return result.done ? result.value : iter.next();
|
|
2331
|
-
});
|
|
2332
|
-
};
|
|
2333
|
-
|
|
2334
|
-
function makeInvokeMethod(innerFn, self, context) {
|
|
2335
|
-
var state = GenStateSuspendedStart;
|
|
2336
|
-
|
|
2337
|
-
return function invoke(method, arg) {
|
|
2338
|
-
if (state === GenStateExecuting) {
|
|
2339
|
-
throw new Error("Generator is already running");
|
|
2340
|
-
}
|
|
2341
|
-
|
|
2342
|
-
if (state === GenStateCompleted) {
|
|
2343
|
-
if (method === "throw") {
|
|
2344
|
-
throw arg;
|
|
2345
|
-
}
|
|
2346
|
-
|
|
2347
|
-
// Be forgiving, per 25.3.3.3.3 of the spec:
|
|
2348
|
-
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
|
|
2349
|
-
return doneResult();
|
|
2350
|
-
}
|
|
2351
|
-
|
|
2352
|
-
context.method = method;
|
|
2353
|
-
context.arg = arg;
|
|
2354
|
-
|
|
2355
|
-
while (true) {
|
|
2356
|
-
var delegate = context.delegate;
|
|
2357
|
-
if (delegate) {
|
|
2358
|
-
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
2359
|
-
if (delegateResult) {
|
|
2360
|
-
if (delegateResult === ContinueSentinel) continue;
|
|
2361
|
-
return delegateResult;
|
|
2362
|
-
}
|
|
2363
|
-
}
|
|
2364
|
-
|
|
2365
|
-
if (context.method === "next") {
|
|
2366
|
-
// Setting context._sent for legacy support of Babel's
|
|
2367
|
-
// function.sent implementation.
|
|
2368
|
-
context.sent = context._sent = context.arg;
|
|
2369
|
-
|
|
2370
|
-
} else if (context.method === "throw") {
|
|
2371
|
-
if (state === GenStateSuspendedStart) {
|
|
2372
|
-
state = GenStateCompleted;
|
|
2373
|
-
throw context.arg;
|
|
2374
|
-
}
|
|
2375
|
-
|
|
2376
|
-
context.dispatchException(context.arg);
|
|
2377
|
-
|
|
2378
|
-
} else if (context.method === "return") {
|
|
2379
|
-
context.abrupt("return", context.arg);
|
|
2380
|
-
}
|
|
2381
|
-
|
|
2382
|
-
state = GenStateExecuting;
|
|
2383
|
-
|
|
2384
|
-
var record = tryCatch(innerFn, self, context);
|
|
2385
|
-
if (record.type === "normal") {
|
|
2386
|
-
// If an exception is thrown from innerFn, we leave state ===
|
|
2387
|
-
// GenStateExecuting and loop back for another invocation.
|
|
2388
|
-
state = context.done
|
|
2389
|
-
? GenStateCompleted
|
|
2390
|
-
: GenStateSuspendedYield;
|
|
2391
|
-
|
|
2392
|
-
if (record.arg === ContinueSentinel) {
|
|
2393
|
-
continue;
|
|
2394
|
-
}
|
|
2395
|
-
|
|
2396
|
-
return {
|
|
2397
|
-
value: record.arg,
|
|
2398
|
-
done: context.done
|
|
2399
|
-
};
|
|
2400
|
-
|
|
2401
|
-
} else if (record.type === "throw") {
|
|
2402
|
-
state = GenStateCompleted;
|
|
2403
|
-
// Dispatch the exception by looping back around to the
|
|
2404
|
-
// context.dispatchException(context.arg) call above.
|
|
2405
|
-
context.method = "throw";
|
|
2406
|
-
context.arg = record.arg;
|
|
2407
|
-
}
|
|
2408
|
-
}
|
|
2409
|
-
};
|
|
2410
|
-
}
|
|
2411
|
-
|
|
2412
|
-
// Call delegate.iterator[context.method](context.arg) and handle the
|
|
2413
|
-
// result, either by returning a { value, done } result from the
|
|
2414
|
-
// delegate iterator, or by modifying context.method and context.arg,
|
|
2415
|
-
// setting context.delegate to null, and returning the ContinueSentinel.
|
|
2416
|
-
function maybeInvokeDelegate(delegate, context) {
|
|
2417
|
-
var method = delegate.iterator[context.method];
|
|
2418
|
-
if (method === undefined$1) {
|
|
2419
|
-
// A .throw or .return when the delegate iterator has no .throw
|
|
2420
|
-
// method always terminates the yield* loop.
|
|
2421
|
-
context.delegate = null;
|
|
2422
|
-
|
|
2423
|
-
if (context.method === "throw") {
|
|
2424
|
-
if (delegate.iterator.return) {
|
|
2425
|
-
// If the delegate iterator has a return method, give it a
|
|
2426
|
-
// chance to clean up.
|
|
2427
|
-
context.method = "return";
|
|
2428
|
-
context.arg = undefined$1;
|
|
2429
|
-
maybeInvokeDelegate(delegate, context);
|
|
2430
|
-
|
|
2431
|
-
if (context.method === "throw") {
|
|
2432
|
-
// If maybeInvokeDelegate(context) changed context.method from
|
|
2433
|
-
// "return" to "throw", let that override the TypeError below.
|
|
2434
|
-
return ContinueSentinel;
|
|
2435
|
-
}
|
|
2436
|
-
}
|
|
2437
|
-
|
|
2438
|
-
context.method = "throw";
|
|
2439
|
-
context.arg = new TypeError(
|
|
2440
|
-
"The iterator does not provide a 'throw' method");
|
|
2441
|
-
}
|
|
2442
|
-
|
|
2443
|
-
return ContinueSentinel;
|
|
2444
|
-
}
|
|
2445
|
-
|
|
2446
|
-
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
2447
|
-
|
|
2448
|
-
if (record.type === "throw") {
|
|
2449
|
-
context.method = "throw";
|
|
2450
|
-
context.arg = record.arg;
|
|
2451
|
-
context.delegate = null;
|
|
2452
|
-
return ContinueSentinel;
|
|
2453
|
-
}
|
|
2454
|
-
|
|
2455
|
-
var info = record.arg;
|
|
2456
|
-
|
|
2457
|
-
if (! info) {
|
|
2458
|
-
context.method = "throw";
|
|
2459
|
-
context.arg = new TypeError("iterator result is not an object");
|
|
2460
|
-
context.delegate = null;
|
|
2461
|
-
return ContinueSentinel;
|
|
2462
|
-
}
|
|
2463
|
-
|
|
2464
|
-
if (info.done) {
|
|
2465
|
-
// Assign the result of the finished delegate to the temporary
|
|
2466
|
-
// variable specified by delegate.resultName (see delegateYield).
|
|
2467
|
-
context[delegate.resultName] = info.value;
|
|
2468
|
-
|
|
2469
|
-
// Resume execution at the desired location (see delegateYield).
|
|
2470
|
-
context.next = delegate.nextLoc;
|
|
2471
|
-
|
|
2472
|
-
// If context.method was "throw" but the delegate handled the
|
|
2473
|
-
// exception, let the outer generator proceed normally. If
|
|
2474
|
-
// context.method was "next", forget context.arg since it has been
|
|
2475
|
-
// "consumed" by the delegate iterator. If context.method was
|
|
2476
|
-
// "return", allow the original .return call to continue in the
|
|
2477
|
-
// outer generator.
|
|
2478
|
-
if (context.method !== "return") {
|
|
2479
|
-
context.method = "next";
|
|
2480
|
-
context.arg = undefined$1;
|
|
2481
|
-
}
|
|
2482
|
-
|
|
2483
|
-
} else {
|
|
2484
|
-
// Re-yield the result returned by the delegate method.
|
|
2485
|
-
return info;
|
|
2486
|
-
}
|
|
2487
|
-
|
|
2488
|
-
// The delegate iterator is finished, so forget it and continue with
|
|
2489
|
-
// the outer generator.
|
|
2490
|
-
context.delegate = null;
|
|
2491
|
-
return ContinueSentinel;
|
|
2492
|
-
}
|
|
2493
|
-
|
|
2494
|
-
// Define Generator.prototype.{next,throw,return} in terms of the
|
|
2495
|
-
// unified ._invoke helper method.
|
|
2496
|
-
defineIteratorMethods(Gp);
|
|
2497
|
-
|
|
2498
|
-
Gp[toStringTagSymbol] = "Generator";
|
|
2499
|
-
|
|
2500
|
-
// A Generator should always return itself as the iterator object when the
|
|
2501
|
-
// @@iterator function is called on it. Some browsers' implementations of the
|
|
2502
|
-
// iterator prototype chain incorrectly implement this, causing the Generator
|
|
2503
|
-
// object to not be returned from this call. This ensures that doesn't happen.
|
|
2504
|
-
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
|
2505
|
-
Gp[iteratorSymbol] = function() {
|
|
2506
|
-
return this;
|
|
2507
|
-
};
|
|
2508
|
-
|
|
2509
|
-
Gp.toString = function() {
|
|
2510
|
-
return "[object Generator]";
|
|
2511
|
-
};
|
|
2512
|
-
|
|
2513
|
-
function pushTryEntry(locs) {
|
|
2514
|
-
var entry = { tryLoc: locs[0] };
|
|
2515
|
-
|
|
2516
|
-
if (1 in locs) {
|
|
2517
|
-
entry.catchLoc = locs[1];
|
|
2518
|
-
}
|
|
2519
|
-
|
|
2520
|
-
if (2 in locs) {
|
|
2521
|
-
entry.finallyLoc = locs[2];
|
|
2522
|
-
entry.afterLoc = locs[3];
|
|
2523
|
-
}
|
|
2524
|
-
|
|
2525
|
-
this.tryEntries.push(entry);
|
|
2526
|
-
}
|
|
2527
|
-
|
|
2528
|
-
function resetTryEntry(entry) {
|
|
2529
|
-
var record = entry.completion || {};
|
|
2530
|
-
record.type = "normal";
|
|
2531
|
-
delete record.arg;
|
|
2532
|
-
entry.completion = record;
|
|
2533
|
-
}
|
|
2534
|
-
|
|
2535
|
-
function Context(tryLocsList) {
|
|
2536
|
-
// The root entry object (effectively a try statement without a catch
|
|
2537
|
-
// or a finally block) gives us a place to store values thrown from
|
|
2538
|
-
// locations where there is no enclosing try statement.
|
|
2539
|
-
this.tryEntries = [{ tryLoc: "root" }];
|
|
2540
|
-
tryLocsList.forEach(pushTryEntry, this);
|
|
2541
|
-
this.reset(true);
|
|
2542
|
-
}
|
|
2543
|
-
|
|
2544
|
-
runtime.keys = function(object) {
|
|
2545
|
-
var keys = [];
|
|
2546
|
-
for (var key in object) {
|
|
2547
|
-
keys.push(key);
|
|
2548
|
-
}
|
|
2549
|
-
keys.reverse();
|
|
2550
|
-
|
|
2551
|
-
// Rather than returning an object with a next method, we keep
|
|
2552
|
-
// things simple and return the next function itself.
|
|
2553
|
-
return function next() {
|
|
2554
|
-
while (keys.length) {
|
|
2555
|
-
var key = keys.pop();
|
|
2556
|
-
if (key in object) {
|
|
2557
|
-
next.value = key;
|
|
2558
|
-
next.done = false;
|
|
2559
|
-
return next;
|
|
2560
|
-
}
|
|
2561
|
-
}
|
|
2562
|
-
|
|
2563
|
-
// To avoid creating an additional object, we just hang the .value
|
|
2564
|
-
// and .done properties off the next function object itself. This
|
|
2565
|
-
// also ensures that the minifier will not anonymize the function.
|
|
2566
|
-
next.done = true;
|
|
2567
|
-
return next;
|
|
2568
|
-
};
|
|
2569
|
-
};
|
|
2570
|
-
|
|
2571
|
-
function values(iterable) {
|
|
2572
|
-
if (iterable) {
|
|
2573
|
-
var iteratorMethod = iterable[iteratorSymbol];
|
|
2574
|
-
if (iteratorMethod) {
|
|
2575
|
-
return iteratorMethod.call(iterable);
|
|
2576
|
-
}
|
|
2577
|
-
|
|
2578
|
-
if (typeof iterable.next === "function") {
|
|
2579
|
-
return iterable;
|
|
2580
|
-
}
|
|
2581
|
-
|
|
2582
|
-
if (!isNaN(iterable.length)) {
|
|
2583
|
-
var i = -1, next = function next() {
|
|
2584
|
-
while (++i < iterable.length) {
|
|
2585
|
-
if (hasOwn.call(iterable, i)) {
|
|
2586
|
-
next.value = iterable[i];
|
|
2587
|
-
next.done = false;
|
|
2588
|
-
return next;
|
|
2589
|
-
}
|
|
2590
|
-
}
|
|
2591
|
-
|
|
2592
|
-
next.value = undefined$1;
|
|
2593
|
-
next.done = true;
|
|
2594
|
-
|
|
2595
|
-
return next;
|
|
2596
|
-
};
|
|
2597
|
-
|
|
2598
|
-
return next.next = next;
|
|
2599
|
-
}
|
|
2600
|
-
}
|
|
2601
|
-
|
|
2602
|
-
// Return an iterator with no values.
|
|
2603
|
-
return { next: doneResult };
|
|
2604
|
-
}
|
|
2605
|
-
runtime.values = values;
|
|
2606
|
-
|
|
2607
|
-
function doneResult() {
|
|
2608
|
-
return { value: undefined$1, done: true };
|
|
2609
|
-
}
|
|
2610
|
-
|
|
2611
|
-
Context.prototype = {
|
|
2612
|
-
constructor: Context,
|
|
2613
|
-
|
|
2614
|
-
reset: function(skipTempReset) {
|
|
2615
|
-
this.prev = 0;
|
|
2616
|
-
this.next = 0;
|
|
2617
|
-
// Resetting context._sent for legacy support of Babel's
|
|
2618
|
-
// function.sent implementation.
|
|
2619
|
-
this.sent = this._sent = undefined$1;
|
|
2620
|
-
this.done = false;
|
|
2621
|
-
this.delegate = null;
|
|
2622
|
-
|
|
2623
|
-
this.method = "next";
|
|
2624
|
-
this.arg = undefined$1;
|
|
2625
|
-
|
|
2626
|
-
this.tryEntries.forEach(resetTryEntry);
|
|
2627
|
-
|
|
2628
|
-
if (!skipTempReset) {
|
|
2629
|
-
for (var name in this) {
|
|
2630
|
-
// Not sure about the optimal order of these conditions:
|
|
2631
|
-
if (name.charAt(0) === "t" &&
|
|
2632
|
-
hasOwn.call(this, name) &&
|
|
2633
|
-
!isNaN(+name.slice(1))) {
|
|
2634
|
-
this[name] = undefined$1;
|
|
2635
|
-
}
|
|
2636
|
-
}
|
|
2637
|
-
}
|
|
2638
|
-
},
|
|
2639
|
-
|
|
2640
|
-
stop: function() {
|
|
2641
|
-
this.done = true;
|
|
2642
|
-
|
|
2643
|
-
var rootEntry = this.tryEntries[0];
|
|
2644
|
-
var rootRecord = rootEntry.completion;
|
|
2645
|
-
if (rootRecord.type === "throw") {
|
|
2646
|
-
throw rootRecord.arg;
|
|
2647
|
-
}
|
|
2648
|
-
|
|
2649
|
-
return this.rval;
|
|
2650
|
-
},
|
|
2651
|
-
|
|
2652
|
-
dispatchException: function(exception) {
|
|
2653
|
-
if (this.done) {
|
|
2654
|
-
throw exception;
|
|
2655
|
-
}
|
|
2656
|
-
|
|
2657
|
-
var context = this;
|
|
2658
|
-
function handle(loc, caught) {
|
|
2659
|
-
record.type = "throw";
|
|
2660
|
-
record.arg = exception;
|
|
2661
|
-
context.next = loc;
|
|
2662
|
-
|
|
2663
|
-
if (caught) {
|
|
2664
|
-
// If the dispatched exception was caught by a catch block,
|
|
2665
|
-
// then let that catch block handle the exception normally.
|
|
2666
|
-
context.method = "next";
|
|
2667
|
-
context.arg = undefined$1;
|
|
2668
|
-
}
|
|
2669
|
-
|
|
2670
|
-
return !! caught;
|
|
2671
|
-
}
|
|
2672
|
-
|
|
2673
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
2674
|
-
var entry = this.tryEntries[i];
|
|
2675
|
-
var record = entry.completion;
|
|
2676
|
-
|
|
2677
|
-
if (entry.tryLoc === "root") {
|
|
2678
|
-
// Exception thrown outside of any try block that could handle
|
|
2679
|
-
// it, so set the completion value of the entire function to
|
|
2680
|
-
// throw the exception.
|
|
2681
|
-
return handle("end");
|
|
2682
|
-
}
|
|
2683
|
-
|
|
2684
|
-
if (entry.tryLoc <= this.prev) {
|
|
2685
|
-
var hasCatch = hasOwn.call(entry, "catchLoc");
|
|
2686
|
-
var hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
2687
|
-
|
|
2688
|
-
if (hasCatch && hasFinally) {
|
|
2689
|
-
if (this.prev < entry.catchLoc) {
|
|
2690
|
-
return handle(entry.catchLoc, true);
|
|
2691
|
-
} else if (this.prev < entry.finallyLoc) {
|
|
2692
|
-
return handle(entry.finallyLoc);
|
|
2693
|
-
}
|
|
2694
|
-
|
|
2695
|
-
} else if (hasCatch) {
|
|
2696
|
-
if (this.prev < entry.catchLoc) {
|
|
2697
|
-
return handle(entry.catchLoc, true);
|
|
2698
|
-
}
|
|
2699
|
-
|
|
2700
|
-
} else if (hasFinally) {
|
|
2701
|
-
if (this.prev < entry.finallyLoc) {
|
|
2702
|
-
return handle(entry.finallyLoc);
|
|
2703
|
-
}
|
|
2704
|
-
|
|
2705
|
-
} else {
|
|
2706
|
-
throw new Error("try statement without catch or finally");
|
|
2707
|
-
}
|
|
2708
|
-
}
|
|
2709
|
-
}
|
|
2710
|
-
},
|
|
2711
|
-
|
|
2712
|
-
abrupt: function(type, arg) {
|
|
2713
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
2714
|
-
var entry = this.tryEntries[i];
|
|
2715
|
-
if (entry.tryLoc <= this.prev &&
|
|
2716
|
-
hasOwn.call(entry, "finallyLoc") &&
|
|
2717
|
-
this.prev < entry.finallyLoc) {
|
|
2718
|
-
var finallyEntry = entry;
|
|
2719
|
-
break;
|
|
2720
|
-
}
|
|
2721
|
-
}
|
|
2722
|
-
|
|
2723
|
-
if (finallyEntry &&
|
|
2724
|
-
(type === "break" ||
|
|
2725
|
-
type === "continue") &&
|
|
2726
|
-
finallyEntry.tryLoc <= arg &&
|
|
2727
|
-
arg <= finallyEntry.finallyLoc) {
|
|
2728
|
-
// Ignore the finally entry if control is not jumping to a
|
|
2729
|
-
// location outside the try/catch block.
|
|
2730
|
-
finallyEntry = null;
|
|
2731
|
-
}
|
|
2732
|
-
|
|
2733
|
-
var record = finallyEntry ? finallyEntry.completion : {};
|
|
2734
|
-
record.type = type;
|
|
2735
|
-
record.arg = arg;
|
|
2736
|
-
|
|
2737
|
-
if (finallyEntry) {
|
|
2738
|
-
this.method = "next";
|
|
2739
|
-
this.next = finallyEntry.finallyLoc;
|
|
2740
|
-
return ContinueSentinel;
|
|
2741
|
-
}
|
|
2742
|
-
|
|
2743
|
-
return this.complete(record);
|
|
2744
|
-
},
|
|
2745
|
-
|
|
2746
|
-
complete: function(record, afterLoc) {
|
|
2747
|
-
if (record.type === "throw") {
|
|
2748
|
-
throw record.arg;
|
|
2749
|
-
}
|
|
2750
|
-
|
|
2751
|
-
if (record.type === "break" ||
|
|
2752
|
-
record.type === "continue") {
|
|
2753
|
-
this.next = record.arg;
|
|
2754
|
-
} else if (record.type === "return") {
|
|
2755
|
-
this.rval = this.arg = record.arg;
|
|
2756
|
-
this.method = "return";
|
|
2757
|
-
this.next = "end";
|
|
2758
|
-
} else if (record.type === "normal" && afterLoc) {
|
|
2759
|
-
this.next = afterLoc;
|
|
2760
|
-
}
|
|
2761
|
-
|
|
2762
|
-
return ContinueSentinel;
|
|
2763
|
-
},
|
|
2764
|
-
|
|
2765
|
-
finish: function(finallyLoc) {
|
|
2766
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
2767
|
-
var entry = this.tryEntries[i];
|
|
2768
|
-
if (entry.finallyLoc === finallyLoc) {
|
|
2769
|
-
this.complete(entry.completion, entry.afterLoc);
|
|
2770
|
-
resetTryEntry(entry);
|
|
2771
|
-
return ContinueSentinel;
|
|
2772
|
-
}
|
|
2773
|
-
}
|
|
2774
|
-
},
|
|
2775
|
-
|
|
2776
|
-
"catch": function(tryLoc) {
|
|
2777
|
-
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
2778
|
-
var entry = this.tryEntries[i];
|
|
2779
|
-
if (entry.tryLoc === tryLoc) {
|
|
2780
|
-
var record = entry.completion;
|
|
2781
|
-
if (record.type === "throw") {
|
|
2782
|
-
var thrown = record.arg;
|
|
2783
|
-
resetTryEntry(entry);
|
|
2784
|
-
}
|
|
2785
|
-
return thrown;
|
|
2786
|
-
}
|
|
2787
|
-
}
|
|
2788
|
-
|
|
2789
|
-
// The context.catch method must only be called with a location
|
|
2790
|
-
// argument that corresponds to a known catch block.
|
|
2791
|
-
throw new Error("illegal catch attempt");
|
|
2792
|
-
},
|
|
2793
|
-
|
|
2794
|
-
delegateYield: function(iterable, resultName, nextLoc) {
|
|
2795
|
-
this.delegate = {
|
|
2796
|
-
iterator: values(iterable),
|
|
2797
|
-
resultName: resultName,
|
|
2798
|
-
nextLoc: nextLoc
|
|
2799
|
-
};
|
|
2800
|
-
|
|
2801
|
-
if (this.method === "next") {
|
|
2802
|
-
// Deliberately forget the last sent value so that we don't
|
|
2803
|
-
// accidentally pass it on to the delegate.
|
|
2804
|
-
this.arg = undefined$1;
|
|
2805
|
-
}
|
|
2806
|
-
|
|
2807
|
-
return ContinueSentinel;
|
|
2808
|
-
}
|
|
2809
|
-
};
|
|
2810
|
-
})(
|
|
2811
|
-
// In sloppy mode, unbound `this` refers to the global object, fallback to
|
|
2812
|
-
// Function constructor if we're in global strict mode. That is sadly a form
|
|
2813
|
-
// of indirect eval which violates Content Security Policy.
|
|
2814
|
-
(function() { return this })() || Function("return this")()
|
|
2815
|
-
);
|
|
2816
|
-
});
|
|
2817
|
-
|
|
2818
|
-
/**
|
|
2819
|
-
* Copyright (c) 2014-present, Facebook, Inc.
|
|
2820
|
-
*
|
|
2821
|
-
* This source code is licensed under the MIT license found in the
|
|
2822
|
-
* LICENSE file in the root directory of this source tree.
|
|
2823
|
-
*/
|
|
2824
|
-
|
|
2825
|
-
// This method of obtaining a reference to the global object needs to be
|
|
2826
|
-
// kept identical to the way it is obtained in runtime.js
|
|
2827
|
-
var g = (function() { return this })() || Function("return this")();
|
|
2828
|
-
|
|
2829
|
-
// Use `getOwnPropertyNames` because not all browsers support calling
|
|
2830
|
-
// `hasOwnProperty` on the global `self` object in a worker. See #183.
|
|
2831
|
-
var hadRuntime = g.regeneratorRuntime &&
|
|
2832
|
-
Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0;
|
|
2833
|
-
|
|
2834
|
-
// Save the old regeneratorRuntime in case it needs to be restored later.
|
|
2835
|
-
var oldRuntime = hadRuntime && g.regeneratorRuntime;
|
|
2836
|
-
|
|
2837
|
-
// Force reevalutation of runtime.js.
|
|
2838
|
-
g.regeneratorRuntime = undefined;
|
|
2839
|
-
|
|
2840
|
-
var runtimeModule = runtime;
|
|
2841
|
-
|
|
2842
|
-
if (hadRuntime) {
|
|
2843
|
-
// Restore the original runtime.
|
|
2844
|
-
g.regeneratorRuntime = oldRuntime;
|
|
2845
|
-
} else {
|
|
2846
|
-
// Remove the global property added by runtime.js.
|
|
2847
|
-
try {
|
|
2848
|
-
delete g.regeneratorRuntime;
|
|
2849
|
-
} catch(e) {
|
|
2850
|
-
g.regeneratorRuntime = undefined;
|
|
2851
|
-
}
|
|
2852
|
-
}
|
|
2853
|
-
|
|
2854
|
-
var regenerator = runtimeModule;
|
|
2855
|
-
|
|
2856
|
-
var asyncToGenerator = createCommonjsModule(function (module, exports) {
|
|
2857
|
-
|
|
2858
|
-
exports.__esModule = true;
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
var _promise2 = _interopRequireDefault(promise);
|
|
2863
|
-
|
|
2864
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2865
|
-
|
|
2866
|
-
exports.default = function (fn) {
|
|
2867
|
-
return function () {
|
|
2868
|
-
var gen = fn.apply(this, arguments);
|
|
2869
|
-
return new _promise2.default(function (resolve, reject) {
|
|
2870
|
-
function step(key, arg) {
|
|
2871
|
-
try {
|
|
2872
|
-
var info = gen[key](arg);
|
|
2873
|
-
var value = info.value;
|
|
2874
|
-
} catch (error) {
|
|
2875
|
-
reject(error);
|
|
2876
|
-
return;
|
|
2877
|
-
}
|
|
2878
|
-
|
|
2879
|
-
if (info.done) {
|
|
2880
|
-
resolve(value);
|
|
2881
|
-
} else {
|
|
2882
|
-
return _promise2.default.resolve(value).then(function (value) {
|
|
2883
|
-
step("next", value);
|
|
2884
|
-
}, function (err) {
|
|
2885
|
-
step("throw", err);
|
|
2886
|
-
});
|
|
2887
|
-
}
|
|
2888
|
-
}
|
|
2889
|
-
|
|
2890
|
-
return step("next");
|
|
2891
|
-
});
|
|
2892
|
-
};
|
|
2893
|
-
};
|
|
2894
|
-
});
|
|
2895
|
-
|
|
2896
|
-
var _asyncToGenerator = unwrapExports(asyncToGenerator);
|
|
2897
|
-
|
|
2898
2080
|
var corsProxy$1 = 'https://cors-anywhere.herokuapp.com/';
|
|
2899
2081
|
var itemsPerPage = 10;
|
|
2900
2082
|
|
|
@@ -6098,6 +5280,28 @@ var YouTubePlayer = function YouTubePlayer(_ref) {
|
|
|
6098
5280
|
|
|
6099
5281
|
var id = getYoutubeId(url);
|
|
6100
5282
|
|
|
5283
|
+
var _useState = useState(false),
|
|
5284
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
5285
|
+
playReported = _useState2[0],
|
|
5286
|
+
setPlayReported = _useState2[1];
|
|
5287
|
+
|
|
5288
|
+
var _useState3 = useState(false),
|
|
5289
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
5290
|
+
endReported = _useState4[0],
|
|
5291
|
+
setEndReported = _useState4[1];
|
|
5292
|
+
|
|
5293
|
+
var _useState5 = useState(null),
|
|
5294
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
5295
|
+
intervalID = _useState6[0],
|
|
5296
|
+
setIntervalID = _useState6[1];
|
|
5297
|
+
|
|
5298
|
+
var _useState7 = useState(null),
|
|
5299
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
5300
|
+
segmentData = _useState8[0],
|
|
5301
|
+
setSegemntData = _useState8[1];
|
|
5302
|
+
|
|
5303
|
+
var queueProgress = [];
|
|
5304
|
+
|
|
6101
5305
|
var opts = {
|
|
6102
5306
|
width: '100%',
|
|
6103
5307
|
playerVars: {
|
|
@@ -6105,7 +5309,77 @@ var YouTubePlayer = function YouTubePlayer(_ref) {
|
|
|
6105
5309
|
}
|
|
6106
5310
|
};
|
|
6107
5311
|
|
|
6108
|
-
|
|
5312
|
+
useEffect(function () {
|
|
5313
|
+
if (segmentData) {
|
|
5314
|
+
console.log('Video Segment', segmentData);
|
|
5315
|
+
Beam.report_beam_video('Segment', main_16, segmentData.duration, segmentData.current, segmentData.segment);
|
|
5316
|
+
}
|
|
5317
|
+
}, [segmentData]);
|
|
5318
|
+
|
|
5319
|
+
var handlePlayPercent = function handlePlayPercent(player) {
|
|
5320
|
+
var current = player.getCurrentTime();
|
|
5321
|
+
var duration = player.getDuration();
|
|
5322
|
+
var queue = Math.floor(duration / 10);
|
|
5323
|
+
var segment = Math.floor(current / queue);
|
|
5324
|
+
|
|
5325
|
+
if (!queueProgress.includes(segment)) {
|
|
5326
|
+
setSegemntData({
|
|
5327
|
+
current: current,
|
|
5328
|
+
duration: duration,
|
|
5329
|
+
queue: queue,
|
|
5330
|
+
segment: segment
|
|
5331
|
+
});
|
|
5332
|
+
queueProgress.push(segment);
|
|
5333
|
+
}
|
|
5334
|
+
};
|
|
5335
|
+
|
|
5336
|
+
var handleOnPlay = function handleOnPlay(event) {
|
|
5337
|
+
// report play
|
|
5338
|
+
if (!playReported) {
|
|
5339
|
+
console.log('Video Play', event);
|
|
5340
|
+
|
|
5341
|
+
var player = event.target;
|
|
5342
|
+
var current = player.getCurrentTime();
|
|
5343
|
+
var duration = player.getDuration();
|
|
5344
|
+
var queue = Math.floor(duration / 10);
|
|
5345
|
+
var segment = Math.floor(current / queue);
|
|
5346
|
+
|
|
5347
|
+
Beam.report_beam_video('Play', main_16, duration, current, segment);
|
|
5348
|
+
setPlayReported(true);
|
|
5349
|
+
var _intervalID = setInterval(function () {
|
|
5350
|
+
handlePlayPercent(event.target);
|
|
5351
|
+
}, 1000);
|
|
5352
|
+
setIntervalID(_intervalID);
|
|
5353
|
+
}
|
|
5354
|
+
};
|
|
5355
|
+
|
|
5356
|
+
var handleOnEnd = function handleOnEnd(event) {
|
|
5357
|
+
if (!endReported) {
|
|
5358
|
+
console.log('Video End', event);
|
|
5359
|
+
var player = event.target;
|
|
5360
|
+
var current = player.getCurrentTime();
|
|
5361
|
+
var duration = player.getDuration();
|
|
5362
|
+
var queue = Math.floor(duration / 10);
|
|
5363
|
+
var segment = Math.floor(current / queue);
|
|
5364
|
+
|
|
5365
|
+
Beam.report_beam_video('End', main_16, duration, current, segment);
|
|
5366
|
+
setEndReported(true);
|
|
5367
|
+
clearInterval(intervalID);
|
|
5368
|
+
}
|
|
5369
|
+
};
|
|
5370
|
+
|
|
5371
|
+
var handleOnPause = function handleOnPause(event) {
|
|
5372
|
+
console.log('Video Pause');
|
|
5373
|
+
var player = event.target;
|
|
5374
|
+
var current = player.getCurrentTime();
|
|
5375
|
+
var duration = player.getDuration();
|
|
5376
|
+
var queue = Math.floor(duration / 10);
|
|
5377
|
+
var segment = Math.floor(current / queue);
|
|
5378
|
+
|
|
5379
|
+
Beam.report_beam_video('Pause', main_16, duration, current, segment);
|
|
5380
|
+
};
|
|
5381
|
+
|
|
5382
|
+
return React__default.createElement(YouTube, { videoId: id, opts: opts, onPlay: handleOnPlay, onPause: handleOnPause, onEnd: handleOnEnd });
|
|
6109
5383
|
};
|
|
6110
5384
|
|
|
6111
5385
|
var Sidebar = function Sidebar(_ref) {
|
|
@@ -6630,10 +5904,10 @@ function datasetify(elem) {
|
|
|
6630
5904
|
props.push({ name: "data-" + key, value: ds[key] });
|
|
6631
5905
|
}
|
|
6632
5906
|
|
|
6633
|
-
return props.length ? stringify
|
|
5907
|
+
return props.length ? stringify(props) : ""
|
|
6634
5908
|
}
|
|
6635
5909
|
|
|
6636
|
-
function stringify
|
|
5910
|
+
function stringify(list) {
|
|
6637
5911
|
var attributes = [];
|
|
6638
5912
|
list.forEach(function (tuple) {
|
|
6639
5913
|
var name = tuple.name;
|
|
@@ -6669,7 +5943,7 @@ function properties(elem) {
|
|
|
6669
5943
|
props.push({ name: "class", value: elem.className });
|
|
6670
5944
|
}
|
|
6671
5945
|
|
|
6672
|
-
return props.length ? stringify
|
|
5946
|
+
return props.length ? stringify(props) : ""
|
|
6673
5947
|
}
|
|
6674
5948
|
|
|
6675
5949
|
function escapeText(s) {
|