From 9dfbde7aa0c58379c2ba17a48909676bd6ffda64 Mon Sep 17 00:00:00 2001 From: Nigel Megitt Date: Fri, 17 Sep 2021 12:02:23 +0100 Subject: [PATCH] Update to latest versions (#78) Co-authored-by: Renovate Bot bot@renovateapp.com --- dist/bin/js/bundle.js | 32 ++-- package-lock.json | 418 ++++++++++++++++++++++-------------------- package.json | 17 +- 3 files changed, 241 insertions(+), 226 deletions(-) diff --git a/dist/bin/js/bundle.js b/dist/bin/js/bundle.js index f0e0ebd..ea79b6b 100644 --- a/dist/bin/js/bundle.js +++ b/dist/bin/js/bundle.js @@ -26,7 +26,7 @@ return /******/ (() => { // webpackBootstrap /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.default = void 0;\n\nvar _AudioNub2 = _interopRequireDefault(__webpack_require__(/*! ./AudioNub.es6 */ \"./src/AudioNub.es6\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _get(target, property, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n// import Logger from \"./Logger.es6\";\nvar Logger = __webpack_require__(/*! ./Logger.es6 */ \"./src/Logger.es6\").Logger; // import TextPresenter from \"./TextPresenter.es6\";\n\n\nvar TextPresenter = __webpack_require__(/*! ./TextPresenter.es6 */ \"./src/TextPresenter.es6\").TextPresenter;\n\nvar defaultOutput = null;\n\nvar AdLeafNode = /*#__PURE__*/function (_AudioNub) {\n _inherits(AdLeafNode, _AudioNub);\n\n var _super = _createSuper(AdLeafNode);\n\n function AdLeafNode(parent, node, audioContext) {\n var _this;\n\n _classCallCheck(this, AdLeafNode);\n\n _this = _super.call(this, parent, node, audioContext);\n\n if (!_this._name) {\n _this._name = \"span (anonymous)\";\n }\n\n return _this;\n }\n\n _createClass(AdLeafNode, [{\n key: \"makeDefaultOutput\",\n value: function makeDefaultOutput() {\n if (defaultOutput) {\n defaultOutput.onInactive();\n }\n\n this.onActive();\n defaultOutput = this;\n }\n }, {\n key: \"onActive\",\n value: function onActive() {\n if (!this.isActive) {\n this.output.connect(this.audioContext.destination);\n\n if (defaultOutput && defaultOutput !== this) {\n defaultOutput.onInactive();\n }\n\n Logger.log(\"Active leaf: \".concat(this.pathString));\n }\n\n _get(_getPrototypeOf(AdLeafNode.prototype), \"onActive\", this).call(this);\n\n if (this.value) {\n this.tpKey = TextPresenter.present(this.value, this.pathString);\n }\n }\n }, {\n key: \"onInactive\",\n value: function onInactive() {\n if (this.isActive) {\n if (this.tpKey) {\n TextPresenter.unPresent(this.tpKey);\n }\n\n this.output.disconnect(this.audioContext.destination);\n\n if (defaultOutput && defaultOutput !== this) {\n defaultOutput.onActive();\n }\n\n Logger.log(\"Inactive leaf: \".concat(this.pathString));\n }\n\n _get(_getPrototypeOf(AdLeafNode.prototype), \"onInactive\", this).call(this);\n }\n }]);\n\n return AdLeafNode;\n}(_AudioNub2[\"default\"]);\n\nexports.default = AdLeafNode;\n\n//# sourceURL=webpack://adhere-lib/./src/AdLeafNode.es6?"); +eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n\nvar _AudioNub2 = _interopRequireDefault(__webpack_require__(/*! ./AudioNub.es6 */ \"./src/AudioNub.es6\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _get(target, property, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n// import Logger from \"./Logger.es6\";\nvar Logger = __webpack_require__(/*! ./Logger.es6 */ \"./src/Logger.es6\").Logger; // import TextPresenter from \"./TextPresenter.es6\";\n\n\nvar TextPresenter = __webpack_require__(/*! ./TextPresenter.es6 */ \"./src/TextPresenter.es6\").TextPresenter;\n\nvar defaultOutput = null;\n\nvar AdLeafNode = /*#__PURE__*/function (_AudioNub) {\n _inherits(AdLeafNode, _AudioNub);\n\n var _super = _createSuper(AdLeafNode);\n\n function AdLeafNode(parent, node, audioContext) {\n var _this;\n\n _classCallCheck(this, AdLeafNode);\n\n _this = _super.call(this, parent, node, audioContext);\n\n if (!_this._name) {\n _this._name = \"span (anonymous)\";\n }\n\n return _this;\n }\n\n _createClass(AdLeafNode, [{\n key: \"makeDefaultOutput\",\n value: function makeDefaultOutput() {\n if (defaultOutput) {\n defaultOutput.onInactive();\n }\n\n this.onActive();\n defaultOutput = this;\n }\n }, {\n key: \"onActive\",\n value: function onActive() {\n if (!this.isActive) {\n this.output.connect(this.audioContext.destination);\n\n if (defaultOutput && defaultOutput !== this) {\n defaultOutput.onInactive();\n }\n\n Logger.log(\"Active leaf: \".concat(this.pathString));\n }\n\n _get(_getPrototypeOf(AdLeafNode.prototype), \"onActive\", this).call(this);\n\n if (this.value) {\n this.tpKey = TextPresenter.present(this.value, this.pathString);\n }\n }\n }, {\n key: \"onInactive\",\n value: function onInactive() {\n if (this.isActive) {\n if (this.tpKey) {\n TextPresenter.unPresent(this.tpKey);\n }\n\n this.output.disconnect(this.audioContext.destination);\n\n if (defaultOutput && defaultOutput !== this) {\n defaultOutput.onActive();\n }\n\n Logger.log(\"Inactive leaf: \".concat(this.pathString));\n }\n\n _get(_getPrototypeOf(AdLeafNode.prototype), \"onInactive\", this).call(this);\n }\n }]);\n\n return AdLeafNode;\n}(_AudioNub2[\"default\"]);\n\nexports[\"default\"] = AdLeafNode;\n\n//# sourceURL=webpack://adhere-lib/./src/AdLeafNode.es6?"); /***/ }), @@ -37,7 +37,7 @@ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.default = void 0;\n\nvar _Utils = _interopRequireDefault(__webpack_require__(/*! ./Utils.es6 */ \"./src/Utils.es6\"));\n\nvar _TimingCalculator = _interopRequireDefault(__webpack_require__(/*! ./TimingCalculator.es6 */ \"./src/TimingCalculator.es6\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n//import Logger from \"./Logger.es6\";\nvar Logger = __webpack_require__(/*! ./Logger.es6 */ \"./src/Logger.es6\").Logger;\n\nvar AdNode = /*#__PURE__*/function () {\n function AdNode(parent, xmlNode, audioContext) {\n _classCallCheck(this, AdNode);\n\n this._xmlNode = xmlNode;\n this.parent = parent;\n this.time = {\n begin: _TimingCalculator[\"default\"].computeBegin(xmlNode),\n end: undefined\n };\n this._name = xmlNode.name;\n this._value = xmlNode.value;\n\n if (xmlNode.attributes) {\n this._pitch = _Utils[\"default\"].getAttributeByFullyQualifiedName(xmlNode, \"\".concat(_Utils[\"default\"].NS_TTML_AUDIO_URI, \"%%pitch\"));\n this._speak = _Utils[\"default\"].getAttributeByFullyQualifiedName(xmlNode, \"\".concat(_Utils[\"default\"].NS_TTML_AUDIO_URI, \"%%speak\"));\n this._id = _Utils[\"default\"].getAttributeByFullyQualifiedName(xmlNode, \"\".concat(_Utils[\"default\"].NS_XML_URI, \"%%id\"));\n }\n\n if (audioContext) {\n this.ac = audioContext;\n } // Logger.log(`Constructed an AdNode for ${this.pathString}, value \\\"${this.value}\\\"\n // ${this.begin} --> ${this.end}`); // DEBUG\n\n }\n\n _createClass(AdNode, [{\n key: \"postComputeEnd\",\n value: function postComputeEnd() {\n this.time.end = _TimingCalculator[\"default\"].computeEnd(this._xmlNode); // Logger.log(`postComputeEnd() for ${this.pathString}, value \\\"${this.value}\\\"\n // ${this.begin} --> ${this.end}`); // DEBUG\n\n if (this.children) {\n this.children.forEach(function (c) {\n c.postComputeEnd();\n });\n }\n }\n }, {\n key: \"audioContext\",\n get: function get() {\n if (this.ac) {\n return this.ac;\n }\n\n if (this.parent) {\n return this.parent.audioContext;\n }\n\n return null;\n }\n }, {\n key: \"begin\",\n get: function get() {\n var begin = NaN;\n\n if (this.time) {\n begin = this.time.begin;\n }\n\n return begin;\n }\n }, {\n key: \"end\",\n get: function get() {\n var end = NaN;\n\n if (this.time) {\n end = this.time.end;\n }\n\n return end;\n }\n }, {\n key: \"pitch\",\n get: function get() {\n if (this._pitch || this._pitch === 0) {\n return this._pitch;\n } else if (this.parent) {\n return this.parent.pitch;\n }\n\n return undefined;\n }\n }, {\n key: \"speak\",\n get: function get() {\n if (this._speak) {\n return this._speak;\n } else if (this.parent) {\n return this.parent.speak;\n }\n\n return undefined;\n }\n }, {\n key: \"value\",\n get: function get() {\n return this._value;\n }\n }, {\n key: \"videoMedia\",\n get: function get() {\n return this._videoMedia;\n },\n set: function set(vm) {\n this._videoMedia = vm;\n }\n }, {\n key: \"makeCueObjects\",\n value: function makeCueObjects(arr, videoMedia) {\n var _this = this;\n\n this.videoMedia = videoMedia;\n var b = this.begin;\n var e = !isNaN(this.end) ? this.end : videoMedia.duration;\n var v = this.value;\n\n if (!isNaN(b) && !isNaN(e)) {\n // Logger.log(`Making a cue for ${ this.pathString }, \\\"${ v }\\\",\n // ${b} --> ${e}.`); // DEBUG\n var newCue = new VTTCue(b, e, v);\n\n newCue.onenter = function () {\n return _this.onActive();\n };\n\n newCue.onexit = function () {\n return _this.onInactive();\n };\n\n arr.push(newCue); // } else {\n // Logger.log(`Not making a cue for ${ this.pathString }, \\\"${ v }\\\"\n // because b (${b}) or e (${e}) is NaN.`); // DEBUG\n }\n\n if (this.children) {\n var _iterator = _createForOfIteratorHelper(this.children),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var c = _step.value;\n c.makeCueObjects(arr, videoMedia);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n } //Go down the tree, apply fn(c) to all children\n\n }, {\n key: \"traverse\",\n value: function traverse(fn) {\n fn(this);\n\n if (this.children) {\n var _iterator2 = _createForOfIteratorHelper(this.children),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var c = _step2.value;\n c.traverse(fn);\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n }\n }\n }, {\n key: \"name\",\n get: function get() {\n return this._name;\n }\n }, {\n key: \"pathString\",\n get: function get() {\n return (this.parent ? \"\".concat(this.parent.pathString, \" -> \") : \"\") + \"\".concat(this.name).concat(this.idString);\n }\n }, {\n key: \"idString\",\n get: function get() {\n return this._id ? \" id:\\\"\".concat(this._id, \"\\\"\") : \"\";\n }\n }, {\n key: \"onActive\",\n value: function onActive() {\n this.isActive = true;\n Logger.log(\"Active AdNode: \".concat(this.pathString));\n }\n }, {\n key: \"onInactive\",\n value: function onInactive() {\n this.isActive = false;\n Logger.log(\"Inactive AdNode: \".concat(this.pathString));\n }\n }, {\n key: \"onFinalise\",\n value: function onFinalise() {\n if (this.isActive) {\n this.onInactive();\n }\n }\n }]);\n\n return AdNode;\n}();\n\nexports.default = AdNode;\n\n//# sourceURL=webpack://adhere-lib/./src/AdNode.es6?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n\nvar _Utils = _interopRequireDefault(__webpack_require__(/*! ./Utils.es6 */ \"./src/Utils.es6\"));\n\nvar _TimingCalculator = _interopRequireDefault(__webpack_require__(/*! ./TimingCalculator.es6 */ \"./src/TimingCalculator.es6\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it[\"return\"] != null) it[\"return\"](); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n//import Logger from \"./Logger.es6\";\nvar Logger = __webpack_require__(/*! ./Logger.es6 */ \"./src/Logger.es6\").Logger;\n\nvar AdNode = /*#__PURE__*/function () {\n function AdNode(parent, xmlNode, audioContext) {\n _classCallCheck(this, AdNode);\n\n this._xmlNode = xmlNode;\n this.parent = parent;\n this.time = {\n begin: _TimingCalculator[\"default\"].computeBegin(xmlNode),\n end: undefined\n };\n this._name = xmlNode.name;\n this._value = xmlNode.value;\n\n if (xmlNode.attributes) {\n this._pitch = _Utils[\"default\"].getAttributeByFullyQualifiedName(xmlNode, \"\".concat(_Utils[\"default\"].NS_TTML_AUDIO_URI, \"%%pitch\"));\n this._speak = _Utils[\"default\"].getAttributeByFullyQualifiedName(xmlNode, \"\".concat(_Utils[\"default\"].NS_TTML_AUDIO_URI, \"%%speak\"));\n this._id = _Utils[\"default\"].getAttributeByFullyQualifiedName(xmlNode, \"\".concat(_Utils[\"default\"].NS_XML_URI, \"%%id\"));\n }\n\n if (audioContext) {\n this.ac = audioContext;\n } // Logger.log(`Constructed an AdNode for ${this.pathString}, value \\\"${this.value}\\\"\n // ${this.begin} --> ${this.end}`); // DEBUG\n\n }\n\n _createClass(AdNode, [{\n key: \"postComputeEnd\",\n value: function postComputeEnd() {\n this.time.end = _TimingCalculator[\"default\"].computeEnd(this._xmlNode); // Logger.log(`postComputeEnd() for ${this.pathString}, value \\\"${this.value}\\\"\n // ${this.begin} --> ${this.end}`); // DEBUG\n\n if (this.children) {\n this.children.forEach(function (c) {\n c.postComputeEnd();\n });\n }\n }\n }, {\n key: \"audioContext\",\n get: function get() {\n if (this.ac) {\n return this.ac;\n }\n\n if (this.parent) {\n return this.parent.audioContext;\n }\n\n return null;\n }\n }, {\n key: \"begin\",\n get: function get() {\n var begin = NaN;\n\n if (this.time) {\n begin = this.time.begin;\n }\n\n return begin;\n }\n }, {\n key: \"end\",\n get: function get() {\n var end = NaN;\n\n if (this.time) {\n end = this.time.end;\n }\n\n return end;\n }\n }, {\n key: \"pitch\",\n get: function get() {\n if (this._pitch || this._pitch === 0) {\n return this._pitch;\n } else if (this.parent) {\n return this.parent.pitch;\n }\n\n return undefined;\n }\n }, {\n key: \"speak\",\n get: function get() {\n if (this._speak) {\n return this._speak;\n } else if (this.parent) {\n return this.parent.speak;\n }\n\n return undefined;\n }\n }, {\n key: \"value\",\n get: function get() {\n return this._value;\n }\n }, {\n key: \"videoMedia\",\n get: function get() {\n return this._videoMedia;\n },\n set: function set(vm) {\n this._videoMedia = vm;\n }\n }, {\n key: \"makeCueObjects\",\n value: function makeCueObjects(arr, videoMedia) {\n var _this = this;\n\n this.videoMedia = videoMedia;\n var b = this.begin;\n var e = !isNaN(this.end) ? this.end : videoMedia.duration;\n var v = this.value;\n\n if (!isNaN(b) && !isNaN(e)) {\n // Logger.log(`Making a cue for ${ this.pathString }, \\\"${ v }\\\",\n // ${b} --> ${e}.`); // DEBUG\n var newCue = new VTTCue(b, e, v);\n\n newCue.onenter = function () {\n return _this.onActive();\n };\n\n newCue.onexit = function () {\n return _this.onInactive();\n };\n\n arr.push(newCue); // } else {\n // Logger.log(`Not making a cue for ${ this.pathString }, \\\"${ v }\\\"\n // because b (${b}) or e (${e}) is NaN.`); // DEBUG\n }\n\n if (this.children) {\n var _iterator = _createForOfIteratorHelper(this.children),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var c = _step.value;\n c.makeCueObjects(arr, videoMedia);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n } //Go down the tree, apply fn(c) to all children\n\n }, {\n key: \"traverse\",\n value: function traverse(fn) {\n fn(this);\n\n if (this.children) {\n var _iterator2 = _createForOfIteratorHelper(this.children),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var c = _step2.value;\n c.traverse(fn);\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n }\n }\n }, {\n key: \"name\",\n get: function get() {\n return this._name;\n }\n }, {\n key: \"pathString\",\n get: function get() {\n return (this.parent ? \"\".concat(this.parent.pathString, \" -> \") : \"\") + \"\".concat(this.name).concat(this.idString);\n }\n }, {\n key: \"idString\",\n get: function get() {\n return this._id ? \" id:\\\"\".concat(this._id, \"\\\"\") : \"\";\n }\n }, {\n key: \"onActive\",\n value: function onActive() {\n this.isActive = true;\n Logger.log(\"Active AdNode: \".concat(this.pathString));\n }\n }, {\n key: \"onInactive\",\n value: function onInactive() {\n this.isActive = false;\n Logger.log(\"Inactive AdNode: \".concat(this.pathString));\n }\n }, {\n key: \"onFinalise\",\n value: function onFinalise() {\n if (this.isActive) {\n this.onInactive();\n }\n }\n }]);\n\n return AdNode;\n}();\n\nexports[\"default\"] = AdNode;\n\n//# sourceURL=webpack://adhere-lib/./src/AdNode.es6?"); /***/ }), @@ -48,7 +48,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n})); /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.default = void 0;\n\nvar _AudioNub2 = _interopRequireDefault(__webpack_require__(/*! ./AudioNub.es6 */ \"./src/AudioNub.es6\"));\n\nvar _TimingCalculator = _interopRequireDefault(__webpack_require__(/*! ./TimingCalculator.es6 */ \"./src/TimingCalculator.es6\"));\n\nvar _PlaybackProperties = _interopRequireDefault(__webpack_require__(/*! ./PlaybackProperties.es6 */ \"./src/PlaybackProperties.es6\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _get(target, property, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n// import Logger from \"./Logger.es6\";\nvar Logger = __webpack_require__(/*! ./Logger.es6 */ \"./src/Logger.es6\").Logger;\n\nvar readyStateMap = {\n 0: \"HAVE_NOTHING\",\n 1: \"HAVE_METADATA\",\n 2: \"HAVE_CURRENT_DATA\",\n 3: \"HAVE_FUTURE_DATA\",\n 4: \"HAVE_ENOUGH_DATA\"\n}; // This guy is a little weird - It's the input to it's parent; i.e. in the graph\n// it is the parent, but in the tree (and xml), it's a child.\n// Don't use it for user controlled sources like video elements:\n// instead user AdUserControlledSourceNode for them.\n\nvar AdSourceNode = /*#__PURE__*/function (_AudioNub) {\n _inherits(AdSourceNode, _AudioNub);\n\n var _super = _createSuper(AdSourceNode);\n\n function AdSourceNode(parent, xmlNode, audioContext, mediaPair) {\n var _this;\n\n _classCallCheck(this, AdSourceNode);\n\n _this = _super.call(this, parent, xmlNode, audioContext);\n _this.mediaPair = mediaPair;\n _this.media = mediaPair.media;\n _this.mediaNode = mediaPair.mediaNode;\n\n if (xmlNode.attributes.clipBegin) {\n _this.clipBegin = _TimingCalculator[\"default\"].parseSeconds(xmlNode.attributes.clipBegin) || 0;\n } else {\n _this.clipBegin = 0;\n }\n\n if (xmlNode.attributes.clipEnd) {\n _this.clipEnd = _TimingCalculator[\"default\"].parseSeconds(xmlNode.attributes.clipEnd) || NaN;\n }\n\n return _this;\n }\n\n _createClass(AdSourceNode, [{\n key: \"mediaReadyState\",\n value: function mediaReadyState(m) {\n var readyState = m.readyState;\n return readyStateMap[readyState];\n }\n }, {\n key: \"addDebugEventHandlers\",\n value: function addDebugEventHandlers() {\n var _this2 = this;\n\n var m = this.mediaPair.media;\n\n if (m) {\n m.addEventListener(\"abort\", function () {\n Logger.log(\"Audio source aborted loading. readyState = \".concat(_this2.mediaReadyState(m)));\n });\n m.addEventListener(\"error\", function () {\n Logger.log(\"Audio source error. readyState = \".concat(_this2.mediaReadyState(m)));\n });\n m.addEventListener(\"loadeddata\", function () {\n Logger.log(\"Audio source loaded data. readyState = \".concat(_this2.mediaReadyState(m)));\n });\n m.addEventListener(\"loadstart\", function () {\n Logger.log(\"Audio source loadstart. readyState = \".concat(_this2.mediaReadyState(m)));\n });\n m.addEventListener(\"playing\", function () {\n Logger.log(\"Audio source is playing. readyState = \".concat(_this2.mediaReadyState(m)));\n });\n m.addEventListener(\"progress\", function () {\n Logger.log(\"Audio source making progress. readyState = \".concat(_this2.mediaReadyState(m)));\n });\n m.addEventListener(\"waiting\", function () {\n Logger.log(\"Audio source is waiting for more data. readyState = \".concat(_this2.mediaReadyState(m)));\n });\n }\n }\n }, {\n key: \"end\",\n get: function get() {\n var ret;\n\n var normalEnd = _get(_getPrototypeOf(AdSourceNode.prototype), \"end\", this);\n\n if (this.clipEnd) {\n //The duration of the clip added to the start time, or the span end, whichever comes first.\n ret = Math.min(normalEnd, this.begin + (this.clipEnd - this.clipBegin));\n } else {\n ret = normalEnd;\n } // Logger.log(`AdSourceNode end() super said ${normalEnd} but I'm saying ${ret}`); // DEBUG\n\n\n return ret;\n }\n }, {\n key: \"onActive\",\n value: function onActive() {\n var _this3 = this;\n\n if (this.mediaPair && !this.isActive) {\n Logger.log(\"Active AdSourceNode: \".concat(this.pathString));\n var offset = this.videoMedia.currentTime - this.begin;\n this.media.currentTime = this.clipBegin ? this.clipBegin + offset : offset;\n this.input = this.mediaNode;\n this.gainNode.gain.value = this.gain * _PlaybackProperties[\"default\"].getCurrentGain();\n this.input.connect(this.gainNode);\n Logger.log(\"Connected to media element source with src= \".concat(this.input.mediaElement.currentSrc));\n this.media.play()[\"catch\"](function (e) {\n Logger.log(\"AdSourceNode play rejected with error: \".concat(e, \".\"));\n });\n this.output.connect(this.parent.gainNode); //TODO Make formal with .input\n\n Logger.log(\"Active source into: \".concat(this.parent.name, \"; src: \").concat(this.media.src, \"; from: \").concat(this.media.currentTime, \" including offset of \").concat(offset, \".\"));\n this.startTime = this.media.currentTime;\n this.isActive = true;\n this.gainId = _PlaybackProperties[\"default\"].registerCallback(function (uiGain) {\n //const oldVal = this.gainNode.gain.value;\n //console.info(\"Base gain\", this.gain, \"UI gain\", uiGain);\n _this3.gainNode.gain.value = _this3.gain * uiGain; //console.info(\"Final gain changes from\", oldVal, \"to\", this.gainNode.gain.value);\n });\n }\n }\n }, {\n key: \"onInactive\",\n value: function onInactive() {\n if (this.media && this.isActive) {\n Logger.log(\"Inactive AdSourceNode: \".concat(this.pathString));\n this.media.pause();\n this.input.disconnect(this.gainNode);\n this.input = null;\n this.output.disconnect(this.parent.gainNode);\n Logger.log(\"Inactive source into: \".concat(this.parent.name, \"; src: \").concat(this.media.src));\n this.endTime = this.media.currentTime; // DEBUG: clipBegin/clipEnd\n\n Logger.log( // eslint-disable-next-line max-len\n \"ran source for: \".concat(this.endTime - this.startTime, \" clipBegin: \").concat(this.startTime, \" clipEnd: \").concat(this.endTime));\n this.isActive = false;\n\n _PlaybackProperties[\"default\"].deregisterCallback(this.gainId);\n }\n }\n }, {\n key: \"onPause\",\n value: function onPause() {\n if (this.media && this.isActive) {\n this.media.pause();\n }\n }\n }, {\n key: \"onRestart\",\n value: function onRestart() {\n if (this.media && this.isActive) {\n this.media.play();\n }\n }\n }, {\n key: \"onFinalise\",\n value: function onFinalise() {\n if (this.media) {\n _get(_getPrototypeOf(AdSourceNode.prototype), \"onFinalise\", this).call(this);\n\n var src = this.media.src;\n\n if ((src + \"\").indexOf(\"blob://\") > 0) {\n Logger.log(\"Clear audio src \" + this.media.src);\n this.media.src = \"\";\n URL.revokeObjectURL(src);\n }\n\n if (this.input) {\n this.input.disconnect(this.gainNode);\n }\n }\n }\n }]);\n\n return AdSourceNode;\n}(_AudioNub2[\"default\"]);\n\nexports.default = AdSourceNode;\n\n//# sourceURL=webpack://adhere-lib/./src/AdSourceNode.es6?"); +eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports[\"default\"] = void 0;\n\nvar _AudioNub2 = _interopRequireDefault(__webpack_require__(/*! ./AudioNub.es6 */ \"./src/AudioNub.es6\"));\n\nvar _TimingCalculator = _interopRequireDefault(__webpack_require__(/*! ./TimingCalculator.es6 */ \"./src/TimingCalculator.es6\"));\n\nvar _PlaybackProperties = _interopRequireDefault(__webpack_require__(/*! ./PlaybackProperties.es6 */ \"./src/PlaybackProperties.es6\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _get(target, property, receiver) { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n// import Logger from \"./Logger.es6\";\nvar Logger = __webpack_require__(/*! ./Logger.es6 */ \"./src/Logger.es6\").Logger;\n\nvar readyStateMap = {\n 0: \"HAVE_NOTHING\",\n 1: \"HAVE_METADATA\",\n 2: \"HAVE_CURRENT_DATA\",\n 3: \"HAVE_FUTURE_DATA\",\n 4: \"HAVE_ENOUGH_DATA\"\n}; // This guy is a little weird - It's the input to it's parent; i.e. in the graph\n// it is the parent, but in the tree (and xml), it's a child.\n// Don't use it for user controlled sources like video elements:\n// instead user AdUserControlledSourceNode for them.\n\nvar AdSourceNode = /*#__PURE__*/function (_AudioNub) {\n _inherits(AdSourceNode, _AudioNub);\n\n var _super = _createSuper(AdSourceNode);\n\n function AdSourceNode(parent, xmlNode, audioContext, mediaPair) {\n var _this;\n\n _classCallCheck(this, AdSourceNode);\n\n _this = _super.call(this, parent, xmlNode, audioContext);\n _this.mediaPair = mediaPair;\n _this.media = mediaPair.media;\n _this.mediaNode = mediaPair.mediaNode;\n\n if (xmlNode.attributes.clipBegin) {\n _this.clipBegin = _TimingCalculator[\"default\"].parseSeconds(xmlNode.attributes.clipBegin) || 0;\n } else {\n _this.clipBegin = 0;\n }\n\n if (xmlNode.attributes.clipEnd) {\n _this.clipEnd = _TimingCalculator[\"default\"].parseSeconds(xmlNode.attributes.clipEnd) || NaN;\n }\n\n return _this;\n }\n\n _createClass(AdSourceNode, [{\n key: \"mediaReadyState\",\n value: function mediaReadyState(m) {\n var readyState = m.readyState;\n return readyStateMap[readyState];\n }\n }, {\n key: \"addDebugEventHandlers\",\n value: function addDebugEventHandlers() {\n var _this2 = this;\n\n var m = this.mediaPair.media;\n\n if (m) {\n m.addEventListener(\"abort\", function () {\n Logger.log(\"Audio source aborted loading. readyState = \".concat(_this2.mediaReadyState(m)));\n });\n m.addEventListener(\"error\", function () {\n Logger.log(\"Audio source error. readyState = \".concat(_this2.mediaReadyState(m)));\n });\n m.addEventListener(\"loadeddata\", function () {\n Logger.log(\"Audio source loaded data. readyState = \".concat(_this2.mediaReadyState(m)));\n });\n m.addEventListener(\"loadstart\", function () {\n Logger.log(\"Audio source loadstart. readyState = \".concat(_this2.mediaReadyState(m)));\n });\n m.addEventListener(\"playing\", function () {\n Logger.log(\"Audio source is playing. readyState = \".concat(_this2.mediaReadyState(m)));\n });\n m.addEventListener(\"progress\", function () {\n Logger.log(\"Audio source making progress. readyState = \".concat(_this2.mediaReadyState(m)));\n });\n m.addEventListener(\"waiting\", function () {\n Logger.log(\"Audio source is waiting for more data. readyState = \".concat(_this2.mediaReadyState(m)));\n });\n }\n }\n }, {\n key: \"end\",\n get: function get() {\n var ret;\n\n var normalEnd = _get(_getPrototypeOf(AdSourceNode.prototype), \"end\", this);\n\n if (this.clipEnd) {\n //The duration of the clip added to the start time, or the span end, whichever comes first.\n ret = Math.min(normalEnd, this.begin + (this.clipEnd - this.clipBegin));\n } else {\n ret = normalEnd;\n } // Logger.log(`AdSourceNode end() super said ${normalEnd} but I'm saying ${ret}`); // DEBUG\n\n\n return ret;\n }\n }, {\n key: \"onActive\",\n value: function onActive() {\n var _this3 = this;\n\n if (this.mediaPair && !this.isActive) {\n Logger.log(\"Active AdSourceNode: \".concat(this.pathString));\n var offset = this.videoMedia.currentTime - this.begin;\n this.media.currentTime = this.clipBegin ? this.clipBegin + offset : offset;\n this.input = this.mediaNode;\n this.gainNode.gain.value = this.gain * _PlaybackProperties[\"default\"].getCurrentGain();\n this.input.connect(this.gainNode);\n Logger.log(\"Connected to media element source with src= \".concat(this.input.mediaElement.currentSrc));\n this.media.play()[\"catch\"](function (e) {\n Logger.log(\"AdSourceNode play rejected with error: \".concat(e, \".\"));\n });\n this.output.connect(this.parent.gainNode); //TODO Make formal with .input\n\n Logger.log(\"Active source into: \".concat(this.parent.name, \"; src: \").concat(this.media.src, \"; from: \").concat(this.media.currentTime, \" including offset of \").concat(offset, \".\"));\n this.startTime = this.media.currentTime;\n this.isActive = true;\n this.gainId = _PlaybackProperties[\"default\"].registerCallback(function (uiGain) {\n //const oldVal = this.gainNode.gain.value;\n //console.info(\"Base gain\", this.gain, \"UI gain\", uiGain);\n _this3.gainNode.gain.value = _this3.gain * uiGain; //console.info(\"Final gain changes from\", oldVal, \"to\", this.gainNode.gain.value);\n });\n }\n }\n }, {\n key: \"onInactive\",\n value: function onInactive() {\n if (this.media && this.isActive) {\n Logger.log(\"Inactive AdSourceNode: \".concat(this.pathString));\n this.media.pause();\n this.input.disconnect(this.gainNode);\n this.input = null;\n this.output.disconnect(this.parent.gainNode);\n Logger.log(\"Inactive source into: \".concat(this.parent.name, \"; src: \").concat(this.media.src));\n this.endTime = this.media.currentTime; // DEBUG: clipBegin/clipEnd\n\n Logger.log( // eslint-disable-next-line max-len\n \"ran source for: \".concat(this.endTime - this.startTime, \" clipBegin: \").concat(this.startTime, \" clipEnd: \").concat(this.endTime));\n this.isActive = false;\n\n _PlaybackProperties[\"default\"].deregisterCallback(this.gainId);\n }\n }\n }, {\n key: \"onPause\",\n value: function onPause() {\n if (this.media && this.isActive) {\n this.media.pause();\n }\n }\n }, {\n key: \"onRestart\",\n value: function onRestart() {\n if (this.media && this.isActive) {\n this.media.play();\n }\n }\n }, {\n key: \"onFinalise\",\n value: function onFinalise() {\n if (this.media) {\n _get(_getPrototypeOf(AdSourceNode.prototype), \"onFinalise\", this).call(this);\n\n var src = this.media.src;\n\n if ((src + \"\").indexOf(\"blob://\") > 0) {\n Logger.log(\"Clear audio src \" + this.media.src);\n this.media.src = \"\";\n URL.revokeObjectURL(src);\n }\n\n if (this.input) {\n this.input.disconnect(this.gainNode);\n }\n }\n }\n }]);\n\n return AdSourceNode;\n}(_AudioNub2[\"default\"]);\n\nexports[\"default\"] = AdSourceNode;\n\n//# sourceURL=webpack://adhere-lib/./src/AdSourceNode.es6?"); /***/ }), @@ -59,7 +59,7 @@ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.default = void 0;\n\nvar _AdSourceNode2 = _interopRequireDefault(__webpack_require__(/*! ./AdSourceNode.es6 */ \"./src/AdSourceNode.es6\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n// import Logger from \"./Logger.es6\";\nvar Logger = __webpack_require__(/*! ./Logger.es6 */ \"./src/Logger.es6\").Logger; // This guy is a little weird - It's the input to it's parent; i.e. in the graph\n// it is the parent, but in the tree (and xml), it's a child.\n// This subclass is for user controlled sources like