eligius 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/dist/action/endable-action.d.ts +1 -1
  3. package/dist/configuration/types.d.ts +1 -1
  4. package/dist/controllers/metadata/{EventListenerController.d.ts → event-listener-controller.d.ts} +1 -1
  5. package/dist/controllers/metadata/index.d.ts +7 -0
  6. package/dist/controllers/metadata/{LabelController.d.ts → label-controller.d.ts} +1 -1
  7. package/dist/controllers/metadata/{LottieController.d.ts → lottie-controller.d.ts} +1 -1
  8. package/dist/controllers/metadata/{NavigationController.d.ts → navigation-controller.d.ts} +1 -1
  9. package/dist/controllers/metadata/{ProgressbarController.d.ts → progressbar-controller.d.ts} +1 -1
  10. package/dist/controllers/metadata/{RoutingController.d.ts → routing-controller.d.ts} +1 -1
  11. package/dist/controllers/metadata/{SubtitlesController.d.ts → subtitles-controller.d.ts} +1 -1
  12. package/dist/eligius.cjs.development.js +1231 -1087
  13. package/dist/eligius.cjs.development.js.map +1 -1
  14. package/dist/eligius.cjs.production.min.js +1 -1
  15. package/dist/eligius.cjs.production.min.js.map +1 -1
  16. package/dist/eligius.esm.js +1212 -1071
  17. package/dist/eligius.esm.js.map +1 -1
  18. package/dist/operation/add-class.d.ts +6 -0
  19. package/dist/operation/add-controller-to-element.d.ts +6 -1
  20. package/dist/operation/add-globals-to-operation.d.ts +7 -0
  21. package/dist/operation/animate-with-class.d.ts +8 -0
  22. package/dist/operation/animate.d.ts +7 -0
  23. package/dist/operation/broadcast-event.d.ts +7 -0
  24. package/dist/operation/clear-element.d.ts +3 -0
  25. package/dist/operation/clear-operation-data.d.ts +4 -0
  26. package/dist/operation/create-element.d.ts +8 -0
  27. package/dist/operation/custom-function.d.ts +7 -0
  28. package/dist/operation/end-action.d.ts +6 -0
  29. package/dist/operation/end-loop.d.ts +8 -1
  30. package/dist/operation/extend-controller.d.ts +3 -0
  31. package/dist/operation/get-controller-from-element.d.ts +6 -0
  32. package/dist/operation/get-controller-instance.d.ts +8 -0
  33. package/dist/operation/get-element-dimensions.d.ts +19 -1
  34. package/dist/operation/get-import.d.ts +8 -1
  35. package/dist/operation/helper/merge-operation-data.d.ts +1 -1
  36. package/dist/operation/helper/modify-dimensions.d.ts +15 -0
  37. package/dist/operation/load-json.d.ts +10 -0
  38. package/dist/operation/log.d.ts +6 -0
  39. package/dist/operation/remove-class.d.ts +6 -0
  40. package/dist/operation/remove-controller-from-element.d.ts +6 -0
  41. package/dist/operation/remove-element.d.ts +6 -0
  42. package/dist/operation/remove-properties-from-operation-data.d.ts +6 -0
  43. package/dist/operation/reparent-element.d.ts +7 -0
  44. package/dist/operation/request-action.d.ts +7 -0
  45. package/dist/operation/resize-action.d.ts +6 -0
  46. package/dist/operation/select-element.d.ts +10 -0
  47. package/dist/operation/set-element-attributes.d.ts +7 -1
  48. package/dist/operation/set-element-content.d.ts +13 -1
  49. package/dist/operation/set-operation-data.d.ts +7 -0
  50. package/dist/operation/set-style.d.ts +9 -2
  51. package/dist/operation/start-action.d.ts +10 -0
  52. package/dist/operation/start-loop.d.ts +10 -0
  53. package/dist/operation/toggle-class.d.ts +6 -0
  54. package/dist/operation/toggle-element.d.ts +6 -0
  55. package/dist/operation/types.d.ts +1 -1
  56. package/dist/operation/wait.d.ts +6 -0
  57. package/dist/timelineproviders/index.d.ts +0 -1
  58. package/package.json +47 -46
@@ -1,2 +1,2 @@
1
- "use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var e=require("ts-is-present"),n=t(require("lottie-web")),i=t(require("jquery")),r=t(require("mousetrap")),o=require("uuid");function s(t){return e.isDefined(t)?JSON.parse(JSON.stringify(t)):t}require("mediaelement");var a=function(){function t(t,e,n){this.name=t,this.startOperations=e,this.eventbus=n,this.id=""}var e=t.prototype;return e.start=function(t){var e=this,n={currentIndex:-1,eventbus:this.eventbus};return new Promise((function(i,r){e.executeOperation(e.startOperations,0,i,r,t,n)})).catch((function(t){throw console.error("Error in action start '"+e.name+"'"),console.error(t),t}))},e.executeOperation=function(t,e,n,i,r,o){var a,u=this;if(void 0===r&&(r={}),void 0!==o.newIndex&&(e=o.newIndex,delete o.newIndex),o.currentIndex=e,o.skipNextOperation&&(e<t.length?this.executeOperation(t,++e,n,i,r,o):n(r)),e<t.length){var l=t[e],c=l.operationData?s(l.operationData):{},h=Object.assign(r,c),d=l.instance.call(o,h);"object"==typeof(a=d)&&"function"==typeof a.then?d.then((function(r){u.executeOperation(t,++e,n,i,r,o)})).catch((function(t){i(t)})):this.executeOperation(t,++e,n,i,d,o)}else n(r)},t}();function u(t,e,n,i,r,o,s){try{var a=t[o](s),u=a.value}catch(t){return void n(t)}a.done?e(u):Promise.resolve(u).then(i,r)}function l(t){return function(){var e=this,n=arguments;return new Promise((function(i,r){var o=t.apply(e,n);function s(t){u(o,i,r,s,a,"next",t)}function a(t){u(o,i,r,s,a,"throw",t)}s(void 0)}))}}function c(){return(c=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}function h(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,(Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var d=function(t){function e(e,n,i,r){var o;return(o=t.call(this,e,n,r)||this).endOperations=i,o}return h(e,t),e.prototype.end=function(t){var e=this;if(this.endOperations.length){var n={currentIndex:-1,eventbus:this.eventbus};return new Promise((function(i,r){e.executeOperation(e.endOperations,0,i,r,t,n)})).catch((function(t){throw console.error("Error in action end '"+e.name+"'"),t}))}return new Promise((function(e){e(t)}))},e}(a),p=function(t){function e(e,n,i,r,o){var s;return(s=t.call(this,e,n,i,o)||this).duration=r,s.active=!1,s}h(e,t);var n=e.prototype;return n.start=function(e){return!this.active||this.duration.end<0?(this.active=this.duration.end>-1,t.prototype.start.call(this,e)):new Promise((function(t){t()}))},n.end=function(e){return this.active=!1,t.prototype.end.call(this,e)},e}(d);function v(t,e){if(!t)throw Error("properties arg cannot be null");if(!e)throw Error("sourceObject arg cannot be null");var n=e,i=null;return t.forEach((function(e,r){if(r===t.length-1){var o=e.split("+");o.length>1&&(e=o[0],i=o[1])}n=n[e]})),i?n+i:n}var f=function(){function t(t,e){this.importer=t,this.eventbus=e}return t.prototype.process=function(t,n){if(function t(n,i,r){e.isDefined(n)&&(Array.isArray(n)?n.forEach((function(e){t(e,i,r)})):Object.keys(n).forEach((function(e){!function(e,n,i,r){var o,s=n[e];if("string"==typeof s){if(s.startsWith("config:")){var a=s.substr(7,s.length);n[e]=(o=i,v(a.split("."),o))}else if(s.startsWith("template:")){var u=s.substr(9,s.length);n[e]=r.import(u)[u]}else if(s.startsWith("json:")){var l=s.substr(5,s.length),c=r.import(l)[l];n[e]=c}}else"object"==typeof s&&t(n[e],i,r)}(e,n,i,r)})))}(t,t,this.importer),!e.isDefined(t.timelineProviderSettings))throw new Error("Configuration incomplete: it needs to have at least one timeline provider setting");var i={id:t.id,engine:c({},t.engine),timelineProviderSettings:s(t.timelineProviderSettings),containerSelector:t.containerSelector,language:t.language,layoutTemplate:t.layoutTemplate,availableLanguages:s(t.availableLanguages),actions:y(t.actions,this.importer,this.eventbus),initActions:y(t.initActions,this.importer,this.eventbus),labels:s(t.labels),timelineFlow:s(t.timelineFlow),timelines:m(t.timelines,this.importer,this.eventbus)},r=[];return t.eventActions&&n&&(r=function(t,e,n,i){return t.map((function(t){return _(t,n)})).map((function(n,r){var o=t[r],s=o.eventName,u=o.eventTopic,l=new a(n.name,n.startOperations,i);return e.registerAction(l,s,u),l}))}(t.eventActions,n,this.importer,this.eventbus)),[i.actions.concat(r).reduce((function(t,e){var n;return c({},t,((n={})[e.name]=e,n))}),{}),i]},t}();function m(t,e,n){var i=b.bind(null,e,n);return t.map((function(t){return c({},t,{timelineActions:t.timelineActions.map(i)})}))}function E(t,e){return{id:e.id,systemName:e.systemName,operationData:s(e.operationData),instance:t.import(e.systemName)[e.systemName]}}function _(t,e){var n=E.bind(null,e);return{id:t.id,name:t.name,startOperations:t.startOperations.map(n)}}function g(t,e){var n=E.bind(null,e);return c({},_(t,e),{endOperations:t.endOperations.map(n)})}function b(t,e,n){var i,r=g(n,t),o={end:null!=(i=n.duration.end)?i:-1,start:n.duration.start},s=r.id,a=new p(r.name,r.startOperations,r.endOperations,o,e);return a.id=s,a}function y(t,e,n){return t.map((function(t){return g(t,e)})).map((function(t){var e=new d(t.name,t.startOperations,t.endOperations,n);return e.id=t.id,e}))}var T,L=(function(t){var e=function(t){var e=Object.prototype,n=e.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},r=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function a(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{a({},"")}catch(t){a=function(t,e,n){return t[e]=n}}function u(t,e,n,i){var r=Object.create((e&&e.prototype instanceof h?e:h).prototype),o=new L(i||[]);return r._invoke=function(t,e,n){var i="suspendedStart";return function(r,o){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===r)throw o;return{value:void 0,done:!0}}for(n.method=r,n.arg=o;;){var s=n.delegate;if(s){var a=b(s,n);if(a){if(a===c)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===i)throw i="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i="executing";var u=l(t,e,n);if("normal"===u.type){if(i=n.done?"completed":"suspendedYield",u.arg===c)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i="completed",n.method="throw",n.arg=u.arg)}}}(t,n,o),r}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var c={};function h(){}function d(){}function p(){}var v={};v[r]=function(){return this};var f=Object.getPrototypeOf,m=f&&f(f(I([])));m&&m!==e&&n.call(m,r)&&(v=m);var E=p.prototype=h.prototype=Object.create(v);function _(t){["next","throw","return"].forEach((function(e){a(t,e,(function(t){return this._invoke(e,t)}))}))}function g(t,e){var i;this._invoke=function(r,o){function s(){return new e((function(i,s){!function i(r,o,s,a){var u=l(t[r],t,o);if("throw"!==u.type){var c=u.arg,h=c.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){i("next",t,s,a)}),(function(t){i("throw",t,s,a)})):e.resolve(h).then((function(t){c.value=t,s(c)}),(function(t){return i("throw",t,s,a)}))}a(u.arg)}(r,o,i,s)}))}return i=i?i.then(s,s):s()}}function b(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,b(t,e),"throw"===e.method))return c;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var i=l(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,c;var r=i.arg;return r?r.done?(e[t.resultName]=r.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,c):r:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,c)}function y(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(y,this),this.reset(!0)}function I(t){if(t){var e=t[r];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function e(){for(;++i<t.length;)if(n.call(t,i))return e.value=t[i],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:x}}function x(){return{value:void 0,done:!0}}return d.prototype=E.constructor=p,p.constructor=d,d.displayName=a(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,a(t,s,"GeneratorFunction")),t.prototype=Object.create(E),t},t.awrap=function(t){return{__await:t}},_(g.prototype),g.prototype[o]=function(){return this},t.AsyncIterator=g,t.async=function(e,n,i,r,o){void 0===o&&(o=Promise);var s=new g(u(e,n,i,r),o);return t.isGeneratorFunction(n)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},_(E),a(E,s,"Generator"),E[r]=function(){return this},E.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var i=e.pop();if(i in t)return n.value=i,n.done=!1,n}return n.done=!0,n}},t.values=I,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(T),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function i(n,i){return s.type="throw",s.arg=t,e.next=n,i&&(e.method="next",e.arg=void 0),!!i}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var a=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(t,e){for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=t,s.arg=e,o?(this.method="next",this.next=o.finallyLoc,c):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),c},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),c}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var i=n.completion;if("throw"===i.type){var r=i.arg;T(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:I(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),c}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}}(T={exports:{}}),T.exports),I=function(){};I.PLAY_TOGGLE_REQUEST="timeline-play-toggle-request",I.PLAY_REQUEST="timeline-play-request",I.STOP_REQUEST="timeline-stop-request",I.PAUSE_REQUEST="timeline-pause-request",I.SEEK_REQUEST="timeline-seek-request",I.RESIZE_REQUEST="timeline-resize-request",I.CONTAINER_REQUEST="timeline-container-request",I.DURATION_REQUEST="timeline-duration-request",I.REQUEST_CURRENT_TIMELINE="timeline-request-current-timeline",I.DURATION="timeline-duration",I.TIME="timeline-time",I.SEEKED="timeline-seeked",I.COMPLETE="timeline-complete",I.PLAY="timeline-play",I.STOP="timeline-stop",I.PAUSE="timeline-pause",I.SEEK="timeline-seek",I.RESIZE="timeline-resize",I.POSITION_UPDATE="timeline-position-update",I.TIME_UPDATE="timeline-time-update",I.CURRENT_TIMELINE_CHANGE="timeline-current-timeline-change",I.FIRST_FRAME="timeline-firstframe",I.REQUEST_INSTANCE="request-instance",I.REQUEST_ACTION="request-action",I.REQUEST_FUNCTION="request-function",I.REQUEST_TIMELINE_URI="request-timeline-uri",I.BEFORE_REQUEST_TIMELINE_URI="before-request-timeline-uri",I.REQUEST_ENGINE_ROOT="request-engine-root",I.REQUEST_CURRENT_TIMELINE_POSITION="request-current-timeline-position",I.REQUEST_TIMELINE_CLEANUP="request-timeline-cleanup",I.EXECUTE_TIMELINEACTION="execute-timelineaction",I.RESIZE_TIMELINEACTION="resize-timelineaction",I.REQUEST_LABEL_COLLECTION="request-label-collection",I.REQUEST_LABEL_COLLECTIONS="request-label-collections",I.REQUEST_CURRENT_LANGUAGE="request-current-language",I.LANGUAGE_CHANGE="language-change";var x=function(){function t(){this.name="EventListenerController"}var e=t.prototype;return e.init=function(t){this.operationData={selectedElement:t.selectedElement,eventName:t.eventName,actions:t.actions.slice(),actionOperationData:t.actionOperationData?s(t.actionOperationData):void 0}},e.attach=function(t){var e=this;if(this.operationData){var n=this.operationData,i=n.selectedElement,r=n.actions,o=n.eventName;this.actionInstanceInfos||(this.actionInstanceInfos=[],r.forEach((function(n){var i,r=e._isStartAction(n);t.broadcast(I.REQUEST_ACTION,[r[1],(i=r[0],function(t){var n;null==(n=e.actionInstanceInfos)||n.push({start:i,action:t})})])})),i.on(o,this._eventHandler.bind(this)))}},e._isStartAction=function(t){return"end:"===t.substr(0,"end:".length)?[!1,t.substr("end:".length)]:[!0,t]},e._eventHandler=function(t){if(this.operationData&&this.actionInstanceInfos){var e=this.operationData.actionOperationData?s(this.operationData.actionOperationData):{};t.target&&(e.targetValue=t.target.value),this._executeAction(this.actionInstanceInfos,e,0)}},e._executeAction=function(){var t=l(L.mark((function t(e,n,i){var r,o,s;return L.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(i<e.length)){t.next=8;break}return o=(r=e[i]).action,s=r.start?o.start.bind(o):o.end.bind(o),t.next=6,s(n);case 6:this._executeAction(e,Object.assign(n,t.sent),++i);case 8:case"end":return t.stop()}}),t,this)})));return function(e,n,i){return t.apply(this,arguments)}}(),e.detach=function(t){var e;null==(e=this.operationData)||e.selectedElement.off(this.operationData.eventName)},t}(),w=function(){function t(){this.listeners=[],this.currentLanguage=null,this.operationData=null,this.labelData={},this.name="LabelController"}var e=t.prototype;return e.init=function(t){this.operationData=Object.assign({},t)},e.attach=function(t){var e=this;this.operationData&&(t.broadcast(I.REQUEST_CURRENT_LANGUAGE,[function(t){e.currentLanguage=t}]),t.broadcast(I.REQUEST_LABEL_COLLECTION,[this.operationData.labelId,function(t){e.createTextDataLookup(t)}]),this.setLabel(),this.listeners.push(t.on(I.LANGUAGE_CHANGE,this.handleLanguageChange.bind(this))))},e.setLabel=function(){var t;this.currentLanguage&&(null==(t=this.operationData)||t.selectedElement.html(this.labelData[this.currentLanguage]))},e.detach=function(t){this.listeners.forEach((function(t){t()}))},e.handleLanguageChange=function(t){this.currentLanguage=t,this.setLabel()},e.createTextDataLookup=function(t){var e=this;t.forEach((function(t){e.labelData[t.languageCode]=t.label}))},t}(),P=function(){function t(){this.name="LottieController",this.currentLanguage=null,this.labelData={},this.listeners=[],this.animationItem=null,this.operationData=null,this.serializedData=null,this.serializedIEData=null,this.freezePosition=-1,this.endPosition=-1}var e=t.prototype;return e.init=function(t){this.operationData={selectedElement:t.selectedElement,renderer:t.renderer,loop:t.loop,autoplay:t.autoplay,animationData:t.animationData,json:t.json,labelIds:t.labelIds,viewBox:t.viewBox,iefallback:t.iefallback},t.url.indexOf("[")>-1&&this.parseFilename(t.url),this.serializedData=this.operationData.json?JSON.stringify(this.operationData.json):JSON.stringify(this.operationData.animationData),this.operationData.iefallback&&(this.serializedIEData=JSON.stringify(this.operationData.iefallback))},e.parseFilename=function(t){var e=this;t.substr(t.indexOf("[")+1,t.indexOf("]")-t.indexOf("[")-1).split(",").forEach((function(t){var n=t.split("=");"freeze"===n[0]?e.freezePosition=+n[1]:"end"===n[0]&&(e.endPosition=+n[1])}))},e.attach=function(t){if(this.operationData){var e=this.operationData.labelIds;if(e&&e.length){var n={};t.broadcast(I.REQUEST_CURRENT_LANGUAGE,[n]),this.currentLanguage=n.language,this.listeners.push(t.on(I.LANGUAGE_CHANGE,this.handleLanguageChange.bind(this))),t.broadcast(I.REQUEST_LABEL_COLLECTIONS,[this.operationData.labelIds,n]),this.createTextDataLookup(n.labelCollections)}this.createAnimation()}},e.detach=function(t){this.listeners.forEach((function(t){t()})),this.animationItem&&(this.endPosition>-1?(this.animationItem.addEventListener("complete",this.destroy.bind(this)),this.animationItem.playSegments([this.freezePosition,this.endPosition],!0)):this.animationItem.destroy())},e.destroy=function(){this.animationItem&&(this.animationItem.destroy(),this.animationItem=null)},e.createAnimation=function(){var t,e=this;if(this.operationData&&this.serializedData){null==(t=this.animationItem)||t.destroy();var i=this.isIE()&&this.serializedIEData?this.serializedIEData:this.serializedData,r=this.operationData.labelIds;r&&r.length&&r.forEach((function(t){var n;i=i.split("!!"+t+"!!").join(e.labelData[t][null!=(n=e.currentLanguage)?n:""])}));var o=JSON.parse(i);this.animationItem=n.loadAnimation({autoplay:this.operationData.autoplay,container:this.operationData.selectedElement[0],loop:this.operationData.loop,rendererSettings:this.operationData.renderer,animationData:o}),this.endPosition<0&&(this.endPosition=this.animationItem.timeCompleted),this.freezePosition>-1&&this.animationItem.playSegments([0,this.freezePosition],!0),this.operationData.viewBox&&this.operationData.selectedElement.find("svg").attr("viewBox",this.operationData.viewBox)}},e.createTextDataLookup=function(t){var e=this;t.forEach((function(t,n){t.forEach((function(t){e.operationData&&(e.labelData[e.operationData.labelIds[n]][t.code]=t.label)}))}))},e.handleLanguageChange=function(t){this.currentLanguage=t,this.createAnimation()},e.isIE=function(){var t=!!window.document.documentMode;return!t&&!!window.StyleMedia||t},t}(),N=function(){function t(){this.name="NavigationController",this.navigation=[],this.navLookup={},this.navVidIdLookup={},this.ctrlLookup={},this.activeNavigationPoint=null,this.labelControllers=[],this.eventhandlers=[],this.eventbus=null,this.container=null}var e=t.prototype;return e.init=function(t){this.container=t.selectedElement,this.navigation=this.buildNavigationData(t.json)},e.attach=function(t){this.container&&(this.eventbus=t,this.eventhandlers.push(t.on("navigate-to-video-url",this.handleNavigateVideoUrl.bind(this))),this.eventhandlers.push(t.on("highlight-navigation",this.highlightMenu.bind(this))),this.eventhandlers.push(t.on("request-current-navigation",this.handleRequestCurrentNavigation.bind(this))),this.eventhandlers.push(t.on("video-complete",this.handleVideoComplete.bind(this))),this.buildHtml(this.container,this.navigation),this.initHistory.bind(this))},e.initHistory=function(){this.activeNavigationPoint=this.navVidIdLookup[0];var t=this.getQueryVariable(0),e=0;t&&(e=this.navLookup[t].videoUrlIndex),this.highlightMenu(e)},e.getQueryVariable=function(t){var e=window.location.href,n=e.indexOf("#");if(n>-1){var i=e.substring(n+2);if(i)return i.split("/")[t]}return null},e.handleRequestCurrentNavigation=function(t){if(this.activeNavigationPoint){var e=this.ctrlLookup[this.activeNavigationPoint.labelId];t({navigationData:this.activeNavigationPoint,title:e.labelData[e.currentLanguage||""]})}else t(null)},e.detach=function(t){this.eventhandlers.forEach((function(t){t()})),this.labelControllers.forEach((function(e){e.detach(t)})),this.labelControllers.length=0,this.eventbus=null,this.container=null,window.onpopstate=null},e.pushCurrentState=function(t){var e;if(void 0===t&&(t=-1),this.activeNavigationPoint){var n=this.ctrlLookup[this.activeNavigationPoint.labelId];if(n){var i={navigationData:this.activeNavigationPoint,title:n.labelData[n.currentLanguage||""],position:-1};t>-1&&(i.position=t),null==(e=this.eventbus)||e.broadcast("push-history-state",[i])}}},e.buildHtml=function(t,e){var n=i("<ul/>");e.forEach(this.addNavElement.bind(this,n)),t.append(n)},e.addNavElement=function(t,e){if(e.visible){var n=i("<li/>"),r=i("<a href='javascript:;' id='nav_"+e.videoUrlIndex+"'/>");if(n.append(r),this.addLabel(r,e.labelId),this.addClickHandler(r,e.videoUrlIndex),e.children){var o=i("<ul/>");e.children.forEach(this.addNavElement.bind(this,o)),n.append(o)}t.append(n)}},e.addClickHandler=function(t,e){t.mouseup(this.menuMouseupHandler.bind(this,e))},e.menuMouseupHandler=function(t){var e,n=this.navVidIdLookup[t];n&&(null==(e=this.eventbus)||e.broadcast("request-video-url",[n.videoUrlIndex]),this.handleNavigateVideoUrl(n.videoUrlIndex))},e.handleNavigateVideoUrl=function(t,e){var n;void 0===e&&(e=0),this.highlightMenu(t),null==(n=this.eventbus)||n.broadcast("request-video-url",[t,e]),this.activeNavigationPoint=this.navVidIdLookup[t],this.pushCurrentState(e)},e.highlightMenu=function(t){var e=i("#nav_"+t);e.length&&(i(".current-menu-item").removeClass("current-menu-item"),e.addClass("current-menu-item"))},e.handleVideoComplete=function(t){var e,n,i=this.navVidIdLookup[t];i.autoNext?null==(e=this.eventbus)||e.broadcast("request-video-url",[i.next.videoUrlIndex]):null==(n=this.eventbus)||n.broadcast("request-video-cleanup")},e.addLabel=function(t,e){var n,i=this,r={selectedElement:t,labelId:e};null==(n=this.eventbus)||n.broadcast("request-instance",["LabelController",function(t){t.init(r),t.attach(i.eventbus),i.labelControllers.push(t),i.ctrlLookup[e]=t}])},e.buildNavigationData=function(t){var e=this,n=[];return t.navigationData.forEach((function(n,i){e.navLookup[n.id]=n,e.navVidIdLookup[n.videoUrlIndex]=n,n.previous=t.navigationData[i-1]})),t.navigationData.forEach((function(n,i){n.nextId?(n.next=e.navLookup[n.nextId],delete n.nextId):n.next=t.navigationData[i+1]})),t.roots.forEach((function(t){var i=e.navLookup[t];i.children&&(i.children=i.children.map((function(t){return e.navLookup[t]}))),n.push(i)})),n},t}(),S=function(){function t(){this.name="ProgressbarController",this.selectedElement=null,this.textElement=null,this.detachers=[]}var e=t.prototype;return e.init=function(t){this.selectedElement=t.selectedElement,this.textElement=t.textElement},e.attach=function(t){var e,n=this;this.detachers.push(t.on(I.POSITION_UPDATE,this.positionUpdateHandler.bind(this)));var i=this.clickHandler.bind(this);null==(e=this.selectedElement)||e.on("click",i),this.detachers.push((function(){var t;return null==(t=n.selectedElement)?void 0:t.off("click")}),i)},e.detach=function(t){this.detachers.forEach((function(t){t()}))},e.positionUpdateHandler=function(t){var e,n,i=100/t.duration*t.position;null==(e=this.selectedElement)||e.css("width",i+"%"),null==(n=this.textElement)||n.text(Math.floor(i)+"%")},e.clickHandler=function(){},t}(),A=function(){function t(){this.name="RoutingController",this.navLookup={},this.navVidIdLookup={},this.navigation=null,this.eventhandlers=[],this.eventbus=null}var e=t.prototype;return e.init=function(t){this.navigation=this.buildNavigationData(t.json)},e.attach=function(t){this.eventhandlers.push(t.on("before-request-video-url",this.handleBeforeRequestVideoUrl.bind(this))),this.eventhandlers.push(t.on("push-history-state",this.handlePushHistoryState.bind(this))),this.eventbus=t,window.onpopstate=this.handlePopstate.bind(this);var e=this.getQueryVariable(0);if(e){var n=this.navLookup[e],i=+this.getQueryVariable(1);this.eventbus.broadcast("request-video-url",[n.videoUrlIndex,i,!0])}else window.history.pushState({navigationId:this.navigation[0].id},"","#/"+this.navigation[0].id)},e.handlePopstate=function(t){var e,n,i,r,o=null!=(e=null==(n=t.state)?void 0:n.position)?e:0,s=this.navLookup[t.state?t.state.navigationId:this.navigation[0].id];null==(i=this.eventbus)||i.broadcast("highlight-navigation",[s.videoUrlIndex]),null==(r=this.eventbus)||r.broadcast("request-video-url",[s.videoUrlIndex,o,!0])},e.detach=function(t){this.eventhandlers&&this.eventhandlers.forEach((function(t){t()})),this.eventbus=null},e.handleBeforeRequestVideoUrl=function(t,e,n){var i,r=this;void 0===n&&(n=!1),(n=void 0!==n&&n)||null==(i=this.eventbus)||i.broadcast("request-current-navigation",[function(t){r.pushState(t)}])},e.getQueryVariable=function(t){var e=window.location.href,n=e.indexOf("#");if(n>-1){var i=e.substring(n+2);if(i)return i.split("/")[t]}return""},e.handlePushHistoryState=function(t){this.pushState(t)},e.pushState=function(t){if(t&&t.navigationData&&t.navigationData.visible){var e,n=void 0!==t.position?t.position:-1;n<0&&(null==(e=this.eventbus)||e.broadcast("request-current-video-position",[function(t){n=t>3?t-3:0}]));var i=window.history.state;i&&i.navigationId!==t.navigationData.id?window.history.pushState({navigationId:t.navigationData.id,position:n},t.title,"#/"+t.navigationData.id+"/"+n):i&&i.navigationId===t.navigationData.id?window.history.replaceState({navigationId:i.navigationId,position:n},t.title,"#/"+i.navigationId+"/"+n):window.history.pushState({navigationId:t.navigationData.id,position:n},t.title,"#/"+t.navigationData.id+"/"+n),window.document.title=t.title}},e.buildNavigationData=function(t){var e=this,n=[];return t.navigationData.forEach((function(n,i){e.navLookup[n.id]=n,e.navVidIdLookup[n.videoUrlIndex]=n,n.previous=t.navigationData[i-1]})),t.navigationData.forEach((function(n,i){n.nextId?(n.next=e.navLookup[n.nextId],delete n.nextId):n.next=t.navigationData[i+1]})),t.roots.forEach((function(t){var i=e.navLookup[t];i.children&&(i.children=i.children.map((function(t){return e.navLookup[t]}))),n.push(i)})),n},t}(),O=function(){function t(){this.actionLookup={},this.currentLanguage=null,this.lastFunc=null,this.name="SubtitlesController"}var e=t.prototype;return e.attach=function(t){var e=t.on(I.TIME,this.onTimeHandler.bind(this)),n=t.on(I.SEEKED,this.onSeekedHandler.bind(this)),i=t.on(I.LANGUAGE_CHANGE,this.languageChangeHandler.bind(this));this.internalDetach=this.internalDetach.bind(this,[e,i,n])},e.detach=function(t){this.internalDetach()},e.internalDetach=function(t){t&&t.forEach((function(t){t()}))},e.languageChangeHandler=function(t){this.currentLanguage=t,this.lastFunc&&this.lastFunc()},e.removeTitle=function(t){null==t||t.empty(),this.lastFunc=null},e.onTimeHandler=function(t){var e=this.actionLookup[t.position];e&&(e(),this.lastFunc=e)},e.onSeekedHandler=function(t){for(var e=t.position,n=this.actionLookup[e];!n&&--e>=0;)n=this.actionLookup[e];n?(n(),this.lastFunc=n):this.removeTitle()},e.setTitle=function(t,e){this.currentLanguage&&t.html(e[this.currentLanguage])},e.createActionLookup=function(t,e){for(var n=t.subtitleData,i=n[0].titles,r={},o=0,s=i.length;o<s;o++){for(var a={},u=0,l=n.length;u<l;u++){var c=n[u];a[c.lang]=c.titles[o].text}r[i[o].duration.start]=this.setTitle.bind(this,e,a),r[i[o].duration.end]=this.removeTitle}return r},e.init=function(t){var e=t.selectedElement;this.removeTitle=this.removeTitle.bind(this,e),this.currentLanguage=t.language,this.actionLookup=this.createActionLookup(t,e)},t}(),R={__proto__:null,EventListenerController:x,LabelController:w,LottieController:P,NavigationController:N,ProgressbarController:S,RoutingController:A,SubtitlesController:O},U=function(){function t(t,e,n,i){this.configuration=t,this.eventbus=e,this.timelineProviders=n,this._languageManager=i,this._timeLineActionsLookup={},this._eventbusListeners=[],this._currentTimelineUri="",this._activeTimelineProvider=void 0,this._lastPosition=-1}var e=t.prototype;return e.init=function(){this._createLayoutTemplate(),this._addInitialisationListeners();var t=this.configuration.timelines;return this._currentTimelineUri=t&&t.length?t[0].uri:"",this._createTimelineLookup(),this._eventbusListeners.push(this.eventbus.on(I.TIME,this._onTimeHandler.bind(this,Math.floor))),this._eventbusListeners.push(this.eventbus.on(I.SEEK,this._onSeekHandler.bind(this,Math.floor))),this._initializeTimelineProvider()},e._createLayoutTemplate=function(){var t=this.configuration.containerSelector,e=i(t);if(!e||!e.length)throw new Error("Container selector not found: "+t);var n=this.configuration.layoutTemplate;n&&n.length?e.html(n):console.warn("layoutTemplate is empty, unable to create layout")},e._initializeTimelineProvider=function(){var t,e=this;if(null==(t=this.configuration.timelines)||!t.length)throw new Error("No timelines present");var n=this.configuration.timelines[0],i=this.timelineProviders[n.type];if(!i)throw new Error("No timeline provider configured for type "+n.type);return this._activeTimelineProvider&&this._activeTimelineProvider.destroy(),this._activeTimelineProvider=i.provider,new Promise(function(){var t=l(L.mark((function t(n){return L.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e._activeTimelineProvider){t.next=8;break}return t.next=3,e._activeTimelineProvider.init();case 3:return t.next=5,e._executeActions(e.configuration.initActions,"start");case 5:n(e._activeTimelineProvider),t.next=9;break;case 8:throw new Error("NO ACTIVE TIMELINE PROVIDER");case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},e._cleanUp=function(){var t=l(L.mark((function t(){return L.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._cleanUpTimeline();case 2:return t.next=4,this._executeActions(this.configuration.initActions,"end");case 4:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),e.destroy=function(){var t=l(L.mark((function t(){return L.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._cleanUp();case 2:this._activeTimelineProvider=void 0,this._eventbusListeners.forEach((function(t){return t()})),this.timelineProviders&&Object.values(this.timelineProviders).forEach((function(t){return t.provider.destroy()}));case 5:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),e._addInitialisationListeners=function(){this._eventbusListeners.push(this.eventbus.on(I.REQUEST_ENGINE_ROOT,this._handleRequestEngineRoot.bind(this,this.configuration.containerSelector))),this._eventbusListeners.push(this.eventbus.on(I.REQUEST_TIMELINE_URI,this._handleRequestTimelineUri.bind(this))),this._eventbusListeners.push(this.eventbus.on(I.REQUEST_CURRENT_TIMELINE_POSITION,this._handleRequestTimelinePosition.bind(this,Math.floor))),this._eventbusListeners.push(this.eventbus.on(I.REQUEST_TIMELINE_CLEANUP,this._handleTimelineComplete.bind(this))),this._eventbusListeners.push(this.eventbus.on(I.EXECUTE_TIMELINEACTION,this._handleExecuteTimelineAction.bind(this))),this._eventbusListeners.push(this.eventbus.on(I.RESIZE_TIMELINEACTION,this._resizeTimelineAction.bind(this))),this._eventbusListeners.push(this.eventbus.on(I.REQUEST_CURRENT_TIMELINE,this._requestCurrentTimeline.bind(this)))},e._createTimelineLookup=function(){var t=this;this.configuration.timelines&&this.configuration.timelines.forEach((function(e){e.timelineActions.forEach(t._addTimelineAction.bind(t,e.uri))}))},e._addTimelineAction=function(t,e){var n,i=e.duration.start,r=this._initializeTimelinePosition(this._initializeUriLookup(this._timeLineActionsLookup,t),i),o=e.start.bind(e);null!=(n=e.id)&&n.length&&(o.id=e.id,o.isStart=!0),r.push(o);var s=e.duration.end;if(s<0&&(s=e.duration.end=Infinity),isFinite(s)){var a,u=this._initializeTimelinePosition(this._timeLineActionsLookup[t],s),l=e.end.bind(e);null!=(a=e.id)&&a.length&&(l.id=e.id),u.push(l)}},e._initializeUriLookup=function(t,e){return t[e]||(t[e]={}),t[e]},e._initializeTimelinePosition=function(t,e){return t[e]||(t[e]=[]),t[e]},e._executeActions=function(){var t=l(L.mark((function t(e,n,i){var r;return L.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0===i&&(i=0),!(e&&i<e.length)){t.next=6;break}return r=e[i],t.next=5,r[n]();case 5:return t.abrupt("return",this._executeActions(e,n,++i));case 6:return t.abrupt("return",new Promise((function(t){t()})));case 7:case"end":return t.stop()}}),t,this)})));return function(e,n,i){return t.apply(this,arguments)}}(),e._handleRequestEngineRoot=function(t,e){e(i(t))},e._handleRequestTimelineUri=function(){var t=l(L.mark((function t(e,n,i){var r,o,s,a=this;return L.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._activeTimelineProvider){t.next=2;break}return t.abrupt("return");case 2:return this._activeTimelineProvider.stop(),t.next=6,this._cleanUpTimeline();case 6:if((o=this.configuration.timelines.find((function(t){return t.uri===e})))&&this._activeTimelineProvider&&this._currentTimelineUri!==o.uri){t.next=9;break}return t.abrupt("return");case 9:this._currentTimelineUri=o.uri,this.eventbus.broadcast(I.CURRENT_TIMELINE_CHANGE,[this._currentTimelineUri]),this._activeTimelineProvider!==(s=this.timelineProviders[o.type]).provider&&(this._activeTimelineProvider.destroy(),this._activeTimelineProvider=s.provider),this._activeTimelineProvider.loop=o.loop,n=null!=(r=n)?r:0,!this._activeTimelineProvider.loop&&n>0&&this.eventbus.once(I.FIRST_FRAME,(function(){a._activeTimelineProvider&&(a._activeTimelineProvider.pause(),a.eventbus.broadcast(I.DURATION,[a._activeTimelineProvider.getDuration()]),a._executeStartActions().then((function(){var t,e;n=null!=(t=n)?t:0,null==(e=a._activeTimelineProvider)||e.seek(n),a._onSeekHandler(Math.floor,{offset:n})})))})),this._activeTimelineProvider.playlistItem(e);case 17:case"end":return t.stop()}}),t,this)})));return function(e,n,i){return t.apply(this,arguments)}}(),e._cleanUpTimeline=function(){return this._executeRelevantActions(this._getActiveActions,"end")},e._executeStartActions=function(){return this._executeRelevantActions(this._getActionsForPosition.bind(this,0),"start")},e._getActionsForPosition=function(t,e){return e.filter((function(e){return!e.active&&e.duration.start<=t&&e.duration.end>=t}))},e._getActiveActions=function(t){return t.filter((function(t){return t.active})).sort((function(t,e){return e.duration.start<t.duration.start?-1:e.duration.start>t.duration.start?1:0}))},e._executeRelevantActions=function(t,e){var n=this._getRelevantTimelineActions(),i=t.apply(this,[n]);return this._executeActions(i,e,0)},e._handleRequestTimelinePosition=function(t,e){var n;e(t((null==(n=this._activeTimelineProvider)?void 0:n.getPosition())||-1))},e._handleTimelineComplete=function(){this._cleanUpTimeline()},e._handleExecuteTimelineAction=function(t,e,n){var i=this._getTimelineActionsForUri(t),r=null==i?void 0:i[e];r&&(n?r.start():r.end())},e._resizeTimelineAction=function(){console.error("no resizing implemented")},e._getRelevantTimelineActions=function(){return this._getTimelineActionsForUri(this._currentTimelineUri)},e._requestCurrentTimeline=function(t){t(this._currentTimelineUri)},e._getTimelineActionsForUri=function(t){var e,n=this.configuration.timelines.find((function(e){return e.uri===t}));return null!=(e=null==n?void 0:n.timelineActions)?e:[]},e._onTimeHandler=function(t,e){if(!isNaN(e.position)){var n,i,r=t(e.position);this._lastPosition!==r&&(this._executeActionsForPosition(r),this.eventbus.broadcast(I.POSITION_UPDATE,[r,null==(i=this._activeTimelineProvider)?void 0:i.getDuration()])),this.eventbus.broadcast(I.TIME_UPDATE,[e.position,null==(n=this._activeTimelineProvider)?void 0:n.getDuration()])}},e._onSeekHandler=function(t,e){var n=this;if(!isNaN(e.offset)){var i=t(e.offset);this._executeSeekActions(i).then((function(){var t;null==(t=n._activeTimelineProvider)||t.start()}))}},e._executeActionsForPosition=function(t){this._lastPosition=t;var e=this._timeLineActionsLookup[this._currentTimelineUri];if(e){var n=e[t];null==n||n.forEach((function(t){t()}))}},e._executeSeekActions=function(t){var e=this,n=this._getRelevantTimelineActions();if(!n)return Promise.resolve();var i=this._getActiveActions(n),r=this._getActionsForPosition(t,n),o=this._executeActions(i,"end",0);return new Promise((function(t){o.then((function(){e._executeActions(r,"start",0).then((function(){t()}))}))}))},t}(),D=function(){function t(){this._actionRegistry={}}var e=t.prototype;return e.registerAction=function(t,e,n){n&&n.length&&(e=e+":"+n),this._actionRegistry[e]||(this._actionRegistry[e]=[]),this._actionRegistry[e].push(t)},e.handleEvent=function(t,e,n){e&&e.length&&(t=t+":"+e);var i=this._actionRegistry[t];if(i){var r={eventArgs:n};i.forEach((function(t){t.start(r)}))}},t}(),C=function(){function t(){this.eventHandlers={},this.eventInterceptors={},this.eventListeners=[],this.clear()}var e=t.prototype;return e.clear=function(){this.eventHandlers={},this.eventListeners=[],this.eventInterceptors={}},e._getEventInterceptors=function(t,e){return e&&e.length&&(t=t+":"+e),this.eventInterceptors[t]||(this.eventInterceptors[t]=[]),this.eventInterceptors[t]},e._getEventHandlers=function(t,e){return e&&e.length&&(t=t+":"+e),this.eventHandlers[t]||(this.eventHandlers[t]=[]),this.eventHandlers[t]},e.on=function(t,e,n){var i=this;return this._getEventHandlers(t,n).push(e),function(){i.off(t,e,n)}},e.once=function(t,e,n){var i=this;this.on(t,(function r(){e.apply(void 0,arguments),i.off(t,r,n)}),n)},e.off=function(t,e,n){var i=this._getEventHandlers(t,n);if(i){var r=i.indexOf(e);r>-1&&i.splice(r,1)}},e.broadcast=function(t,e){this._callHandlers(t,void 0,e)},e.broadcastForTopic=function(t,e,n){this._callHandlers(t,e,n)},e.registerEventlistener=function(t){this.eventListeners.push(t)},e.registerInterceptor=function(t,e,n){this._getEventInterceptors(t,n).push(e)},e._callHandlers=function(t,e,n){void 0===n&&(n=[]);var i,r=this._getEventHandlers(t,e);r&&(this._getEventInterceptors(t,e).forEach((function(t){n=t.intercept(n)})),this.eventListeners.forEach((function(i){i.handleEvent(t,e,n)})),null!=(i=n)&&i.length?r.forEach((function(t){return t.apply(void 0,n)})):r.forEach((function(t){return t()})))},t}(),k=function(){function t(t){this.eventbus=t}return t.prototype.intercept=function(t){return this.eventbus.broadcast(I.BEFORE_REQUEST_TIMELINE_URI,t.slice()),t},t}(),q={__proto__:null,ActionRegistryEventbusListener:D,Eventbus:C,RequestVideoUriInterceptor:k},Q=function(){function t(t,e,n){if(this._currentLanguage=t,this._eventbus=n,this._labelLookup={},this._eventbusListeners=[],!t||!t.length)throw new Error("language ctor arg cannot be null or have zero length");if(!e)throw new Error("labels ctor arg cannot be null");if(!n)throw new Error("eventbus ctor arg cannot be null");this._setRootElementLang(t),this._createLabelLookup(e),this._addEventbusListeners(n)}var e=t.prototype;return e._addEventbusListeners=function(t){this._eventbusListeners.push(t.on(I.REQUEST_LABEL_COLLECTION,this._handleRequestLabelCollection.bind(this))),this._eventbusListeners.push(t.on(I.REQUEST_LABEL_COLLECTIONS,this._handleRequestLabelCollections.bind(this))),this._eventbusListeners.push(t.on(I.REQUEST_CURRENT_LANGUAGE,this._handleRequestCurrentLanguage.bind(this))),this._eventbusListeners.push(t.on(I.LANGUAGE_CHANGE,this._handleLanguageChange.bind(this)))},e._handleRequestCurrentLanguage=function(t){t(this._currentLanguage)},e._handleRequestLabelCollection=function(t,e){e(this._labelLookup[t])},e._handleRequestLabelCollections=function(t,e){var n=this;e(t.map((function(t){return n._labelLookup[t]})))},e._handleLanguageChange=function(t){t&&t.length?(this._currentLanguage=t,this._setRootElementLang(this._currentLanguage)):console.error("Language cannot be changed to null or empty string")},e._setRootElementLang=function(t){var e=this;this._eventbus.broadcast(I.REQUEST_ENGINE_ROOT,[function(n){var r=e._extractLanguageFromCulture(t);i(n).attr("lang",r)}])},e._extractLanguageFromCulture=function(t){return t.indexOf("-")>-1?t.split("-").shift():t},e._createLabelLookup=function(t){var e=this;t.forEach((function(t){e._labelLookup[t.id]=t.labels}))},t}(),F=function(){function t(t,e,n){this.resizeTimeout=-1,this.actionsLookup={},this.importer=t,this.eventbus=n||new C,this.eventbus.on(I.REQUEST_INSTANCE,this._requestInstanceHandler.bind(this)),this.eventbus.on(I.REQUEST_ACTION,this._requestActionHandler.bind(this)),this.eventbus.on(I.REQUEST_FUNCTION,this._requestFunctionHandler.bind(this)),i(e).resize(this._resizeHandler.bind(this))}var e=t.prototype;return e.destroy=function(){this.eventbus.clear()},e._resizeHandler=function(){var t=this;this.resizeTimeout&&clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout((function(){t.eventbus.broadcast(I.RESIZE)}),200)},e._importSystemEntryWithEventbusDependency=function(t){return new(this._importSystemEntry(t))(this.eventbus)},e._importSystemEntry=function(t){return this.importer.import(t)[t]},e._requestInstanceHandler=function(t,e){e(this._importSystemEntryWithEventbusDependency(t))},e._requestFunctionHandler=function(t,e){e(this._importSystemEntry(t))},e._requestActionHandler=function(t,e){var n=this.actionsLookup[t];n?e(n):(console.error("Unknown action: "+t),e(null))},e.createEngine=function(t,e){var n,i=this,o=this._importSystemEntry(t.engine.systemName),s=void 0;null!=(n=t.eventActions)&&n.length&&(s=new D,this.eventbus.registerEventlistener(s)),this.eventbus.registerInterceptor(I.REQUEST_TIMELINE_URI,new k(this.eventbus));var a=(e=e||new f(this.importer,this.eventbus)).process(t,s),u=a[1];this.actionsLookup=a[0];var l=this._createTimelineProviders(u,this.eventbus),c=new Q(t.language,t.labels,this.eventbus),h=new o(u,this.eventbus,l,c);return r.bind("space",(function(t){return t.preventDefault(),i.eventbus.broadcast(I.PLAY_TOGGLE_REQUEST),!1})),h},e._createTimelineProviders=function(t,e){var n=this;return Object.entries(t.timelineProviderSettings).reduce((function(i,r){var o=r[0],s=r[1];if(!s)return i;var a=n._importSystemEntry(s.systemName);return i[o]={id:s.id,vendor:s.vendor,provider:new a(e,t)},i}),{})},t}(),H=function(t){return t.selectedElement.addClass(t.className),t},M=function(t,e){return e.data(t)}.bind(null,"eligiusEngineControllers");function j(t,e){return Object.assign(t,e)}function z(t,e,n){t(n?j(e,n):e)}var G=function(t){var e,n,i=t.controllerInstance;n=i,(e=t.selectedElement).data("eligiusEngineControllers")||e.data("eligiusEngineControllers",[]),M(e).push(n),i.init(t);var r=i.attach(this.eventbus);return r?new Promise((function(e,n){r.then((function(n){z(e,t,n)}),n)})):t},V=function(t){var e=t.animationEasing,n=t.selectedElement,i=t.animationProperties,r=t.animationDuration;return new Promise((function(o,s){try{e?n.animate(i,r,e,(function(){z(o,{},t)})):n.animate(i,r,(function(){z(o,{},t)}))}catch(t){s(t)}}))},B=function(t){var e=t.selectedElement,n=t.className,i=t.removeClass;i=void 0===i||i;var r=new Promise((function(r,o){try{e.one("webkitAnimationEnd oanimationend oAnimationEnd msAnimationEnd animationEnd",(function(){i&&e.removeClass(n),z(r,{},t)}))}catch(t){o(t)}}));return e.addClass(n),r};function K(t,e){if("string"==typeof e&&e.toLowerCase().startsWith("operationdata.")){var n=e.split(".");return n.shift(),v(n,t)}return e}var Y=function(t){var e=t.eventTopic,n=t.eventName,i=function(t,e){if(e){var n=K.bind(null,t);return e.map(n)}}(t,t.eventArgs);return e?this.eventbus.broadcastForTopic(n,e,i):this.eventbus.broadcast(n,i),function(t){delete t.eventName,delete t.eventTopic,delete t.eventArgs}(t),t},W=function(t){return t.selectedElement.empty(),t},J=function(t){var e=t.properties;return e?(e.forEach((function(e){delete t[e]})),delete t.properties,t):{}},Z=[];function X(t,e){var n=e!==t?s(e):e;return function t(e,n,r){if(!(Z.indexOf(e)>-1)){Z.push(e);try{Object.entries(e).forEach((function(e){var o=e[1];o instanceof i||("string"==typeof o?n[e[0]]=r(o):Array.isArray(o)?o.forEach((function(e,n,i){"string"==typeof e?i[n]=r(e):t(e,e,r)})):"object"==typeof o&&t(o,o,r))}))}finally{var o=Z.indexOf(e);Z.splice(o,1)}}}(e,n,K.bind(null,t)),n}var $=function(t){var e=(t=X(t,t)).elementName,n=t.attributes,r=t.text,o=t.propertyName,s=void 0===o?"template":o,a=n?" "+Object.entries(n).map((function(t){return t[0]+'="'+t[1]+'"'})).join(" "):"",u=i(r?"<"+e+a+">"+r+"</"+e+">":"<"+e+a+"/>");return t[s]=u,delete t.propertyName,t},tt=function(){function t(t,e){this.eventbus=t,this.config=e,this._paused=!1,this._player=null,this._currentLoopHandler=null,this._eventbusListeners=[],this._playlist=[],this._videoElementId=o.v4(),this.loop=!1,this._addEventListeners()}var e=t.prototype;return e._extractUrls=function(t){return t.timelines.filter((function(t){return"mediaplayer"===t.type})).map((function(t){return t.uri}))},e.init=function(){var t=this,e=this.config.timelineProviderSettings.mediaplayer;if(!e)throw new Error("No settings found for 'mediaplayer' timeline provider");var n=e.selector,r=this._extractUrls(this.config),o=window.jwplayer,s=i("#"+n);if(!s.length)throw new Error("videoplayer selector '"+n+"' not found");var a=s.innerWidth(),u=s.innerHeight();return 0===a&&(a=100),0===u&&(u=300),this._player=o(n),this._player.setup({file:r[0],image:e.poster,height:u,width:a,controls:!0,autostart:!1,displaytitle:!1,displaydescription:!1,nextUpDisplay:!1,abouttext:"Eligius",aboutlink:"http://www.google.com",stretching:"fill",repeat:!1}),this._playlist.length=0,r.forEach((function(n){t._playlist.push({file:n,title:n,image:e.poster})})),new Promise((function(e){t._player.once("ready",(function(){t._handlePlayerReady(e)})),t._player.load(t._playlist)}))},e._handlePlayerReady=function(t){var e=this;this._player.once("firstFrame",(function(){e._player.pause(),e.eventbus.broadcast(I.DURATION,[e.getDuration()]),t(e)})),this._player.on(I.TIME,this._loopHandler.bind(this,Math.floor)),this._player.on(I.SEEKED,this._seekedHandler.bind(this)),this._player.on(I.COMPLETE,this._handlePlayerComplete.bind(this)),setTimeout((function(){e._player.play()}),10)},e._handlePlayerComplete=function(){this.loop||(this.stop(),this.eventbus.broadcast(I.COMPLETE,[this._player.getPlaylistIndex()]))},e._seekedHandler=function(){this.eventbus.broadcast(I.SEEKED,[this.getPosition(),this.getDuration()])},e.destroy=function(){this._player.remove(),this._eventbusListeners.forEach((function(t){return t()}))},e._loopHandler=function(t,e){var n=t(e.position);this.loop&&n===t(this._player.getDuration()-1)&&this.seek(0)},e._timeResetLoopHandler=function(){this.loop&&this.seek(0)},e._addEventListeners=function(){this._eventbusListeners.push(this.eventbus.on(I.PLAY_TOGGLE_REQUEST,this.toggleplay.bind(this))),this._eventbusListeners.push(this.eventbus.on(I.PLAY_REQUEST,this.start.bind(this))),this._eventbusListeners.push(this.eventbus.on(I.STOP_REQUEST,this.stop.bind(this))),this._eventbusListeners.push(this.eventbus.on(I.PAUSE_REQUEST,this.pause.bind(this))),this._eventbusListeners.push(this.eventbus.on(I.SEEK_REQUEST,this.seek.bind(this))),this._eventbusListeners.push(this.eventbus.on(I.RESIZE_REQUEST,this.resize.bind(this))),this._eventbusListeners.push(this.eventbus.on(I.CONTAINER_REQUEST,this._container.bind(this))),this._eventbusListeners.push(this.eventbus.on(I.DURATION_REQUEST,this.duration.bind(this)))},e._container=function(t){var e="";"html5"!==this._player.getProvider().name&&(e="_wrapper"),t(i("#"+this._videoElementId+e))},e.toggleplay=function(){this._paused?this.start():this.pause()},e.start=function(){this._paused=!1,this._player.play(),this.eventbus.broadcast(I.PLAY)},e.stop=function(){this._paused=!1,this._player.stop(),this.eventbus.broadcast(I.STOP)},e.pause=function(){this._paused=!0,this._player.pause(),this.eventbus.broadcast(I.PAUSE)},e.seek=function(t){var e=this._player.getPosition();this._player.seek(t),this.eventbus.broadcast(I.SEEK,[t,e,this._player.getDuration()])},e.resize=function(t,e){this._player.resize(t,e),this.eventbus.broadcast(I.RESIZE,[t,e])},e.duration=function(t){t(Math.floor(this.getDuration()))},e.playlistItem=function(t){var e=this._playlist.findIndex((function(e){return e.file===t}));e>-1&&this._player.playlistItem(e)},e.getPosition=function(){return this._player.getPosition()},e.getPlaylistIndex=function(){return this._player.getPlaylistIndex()},e.getState=function(){return this._player.getState()},e.getDuration=function(){return this._player.getDuration()},e.getMute=function(){return this._player.getMute()},e.getVolume=function(){return this._player.getVolume()},e.setMute=function(t){this._player.setMute(t)},e.setVolume=function(t){this._player.setVolume(t)},t}(),et=window.MediaElementPlayer,nt=function(){function t(t,e){this.eventbus=t,this.config=e,this._videoElementId=o.v4(),this._eventbusListeners=[],this._playlist=[],this._length=0,this._urls=[],this.loop=!1,this._addEventListeners()}var e=t.prototype;return e._addEventListeners=function(){this._eventbusListeners.push(this.eventbus.on(I.PLAY_REQUEST,this.start.bind(this))),this._eventbusListeners.push(this.eventbus.on(I.STOP_REQUEST,this.stop.bind(this))),this._eventbusListeners.push(this.eventbus.on(I.PAUSE_REQUEST,this.pause.bind(this))),this._eventbusListeners.push(this.eventbus.on(I.SEEK_REQUEST,this.seek.bind(this))),this._eventbusListeners.push(this.eventbus.on(I.RESIZE_REQUEST,this.resize.bind(this))),this._eventbusListeners.push(this.eventbus.on(I.CONTAINER_REQUEST,this._container.bind(this))),this._eventbusListeners.push(this.eventbus.on(I.DURATION_REQUEST,this.duration.bind(this)))},e._extractUrls=function(t){return t.timelines.filter((function(t){return"mediaplayer"===t.type})).map((function(t){return t.uri}))},e.init=function(){var t=this;this._urls=this._extractUrls(this.config),this._addVideoElements("",this._urls);var e=this;return new Promise((function(n){var i=document.getElementById(t._videoElementId);e.player=new et(i,{success:function(e,i,r){e.addEventListener("timeupdate",t._timeUpdateHandler.bind(t)),r.loop=t.loop,r.controlsAreVisible=!1,r.controlsEnabled=!1,n()}})}))},e._timeUpdateHandler=function(){this.player&&(this.eventbus.broadcast(I.TIME,[{position:this.player.currentTime}]),this.eventbus.broadcast(I.POSITION_UPDATE,[{position:this.player.currentTime,duration:this.player.duration}]))},e._addVideoElements=function(t,e){var n=this,r=["<video class='mejs__player' id="+this._videoElementId+' data-mejsoptions=\'{"preload": "true"}\'>'];e.forEach((function(t){r.push("<source src='"+t+"' type='"+n._extractFileType(t)+"'/>")})),r.push("</video>"),i(t).append(r.join(""))},e._extractFileType=function(t){var e=t.lastIndexOf(".");return"video/"+t.substr(e+1)},e.playlistItem=function(t){var e;null==(e=this.player)||e.setSrc(t)},e.start=function(){var t;null==(t=this.player)||t.play()},e.stop=function(){var t;null==(t=this.player)||t.stop()},e.destroy=function(){var t,e,n;null!=(t=this.player)&&t.paused||null==(n=this.player)||n.pause(),null==(e=this.player)||e.remove(),i("#"+this._videoElementId).remove(),this._eventbusListeners.forEach((function(t){return t()}))},e.pause=function(){var t;null==(t=this.player)||t.pause()},e.seek=function(t){var e;null==(e=this.player)||e.setCurrentTime(t)},e.resize=function(){},e.duration=function(t){t(this.getDuration())},e.getDuration=function(){var t;return(null==(t=this.player)?void 0:t.duration)||-1},e.getPosition=function(){var t;return(null==(t=this.player)?void 0:t.getCurrentTime())||-1},e._container=function(t){t(i("#"+this._videoElementId))},t}(),it=function(){function t(t,e){this.eventbus=t,this.config=e,this._requestID=-1,this._last=0,this._currentPosition=0,this._updateBound=this._update.bind(this),this._eventbusListeners=[],this._firstFrame=!0,this._granularity=1e3,this.playState="stopped",this.loop=!1,this.eventbus=t,this.config=e,this._playlist=this._extractPlaylist(e),this._currentPlaylistItem=this._playlist[0]}var e=t.prototype;return e._extractPlaylist=function(t){return t.timelines.filter((function(t){return"animation"===t.type}))},e.playlistItem=function(t){if(null!==t&&t.length&&0!==this._playlist.length){var e=this._playlist.find((function(e){return e.uri===t}));if(!e)throw new Error("Unknown playlist uri: "+t);this._currentPlaylistItem=e,this._firstFrame=!0}},e._addEventListeners=function(){this._eventbusListeners.push(this.eventbus.on(I.PLAY_TOGGLE_REQUEST,this.toggleplay.bind(this))),this._eventbusListeners.push(this.eventbus.on(I.PLAY_REQUEST,this.start.bind(this))),this._eventbusListeners.push(this.eventbus.on(I.STOP_REQUEST,this.stop.bind(this))),this._eventbusListeners.push(this.eventbus.on(I.PAUSE_REQUEST,this.pause.bind(this))),this._eventbusListeners.push(this.eventbus.on(I.SEEK_REQUEST,this.seek.bind(this))),this._eventbusListeners.push(this.eventbus.on(I.RESIZE_REQUEST,this._resize.bind(this))),this._eventbusListeners.push(this.eventbus.on(I.CONTAINER_REQUEST,this._container.bind(this))),this._eventbusListeners.push(this.eventbus.on(I.DURATION_REQUEST,this.requestDurationHandler.bind(this)))},e._update=function(t){if("running"===this.playState){if(!this._last||t-this._last>=this._granularity){if(!this._last&&this._firstFrame&&(this._firstFrame=!1,this.eventbus.broadcast(I.FIRST_FRAME)),this._last=t,this._currentPosition++,this._currentPosition>this._currentPlaylistItem.duration){if(!this.loop)return this.stop(),void this.eventbus.broadcast(I.COMPLETE);this._reset()}this.eventbus.broadcast(I.TIME,[{position:this._currentPosition}]),this.eventbus.broadcast(I.POSITION_UPDATE,[{position:this._currentPosition,duration:this._currentPlaylistItem.duration}])}this._requestID=requestAnimationFrame(this._updateBound)}},e._start=function(){this._requestID&&"running"===this.playState||(this.playState="running",this._requestID=requestAnimationFrame(this._updateBound))},e._reset=function(){this._cancelAnimationFrame(),this._last=0,this._currentPosition=0},e._resize=function(){console.error("Not implemented yet")},e._container=function(t){t(this._containerElement)},e._cancelAnimationFrame=function(){this._requestID&&(cancelAnimationFrame(this._requestID),this._requestID=-1,this._last=0,this._currentPosition=0)},e.init=function(){if(this._addEventListeners(),this._currentPlaylistItem=this._playlist[0],this._containerElement=i(this._currentPlaylistItem.selector),!this._containerElement.length)throw new Error("timeline selector '"+this._currentPlaylistItem.selector+"' not found");return new Promise((function(t){t()}))},e.destroy=function(){this.stop(),this._eventbusListeners.forEach((function(t){return t()})),this._containerElement=void 0},e.toggleplay=function(){"running"!==this.playState?this.start():this.pause()},e.start=function(){this._start(),this.eventbus.broadcast(I.PLAY)},e.stop=function(){this._cancelAnimationFrame(),this.playState="stopped",this.eventbus.broadcast(I.STOP)},e.pause=function(){this.playState="paused",this.eventbus.broadcast(I.PAUSE)},e.seek=function(t){t<0||t>this._currentPlaylistItem.duration||(this.eventbus.broadcast(I.SEEK,[t,this._currentPosition,this.getDuration()]),this._currentPosition=t,this.eventbus.broadcast(I.SEEKED,[this._currentPosition,this.getDuration()]),this.eventbus.broadcast(I.TIME,[{position:this.getPosition()}]),this.eventbus.broadcast(I.POSITION_UPDATE,[{position:this._currentPosition,duration:this._currentPlaylistItem.duration}]))},e.getPosition=function(){return this._currentPosition},e.getDuration=function(){return this._currentPlaylistItem.duration},e.requestDurationHandler=function(t){t(this._currentPlaylistItem.duration)},t}(),rt=function(t){var e=this,n=t.systemName;return new Promise((function(i,r){e.eventbus.broadcast(I.REQUEST_FUNCTION,[n,function(n){var o=n(t,e.eventbus);o?o.then((function(){z(i,{},t)}),r):z(i,{},t)}])}))},ot=function(t){var e=t.actionInstance,n=t.actionOperationData;return delete t.actionOperationData,new Promise((function(i,r){t=j(t,n),e.end(t).then((function(){Object.keys(n).forEach((function(e){delete t[e]})),z(i,t)}),r)}))},st=function(t){return this.skipNextOperation?delete this.skipNextOperation:void 0!==this.loopIndex&&void 0!==this.loopLength&&this.loopIndex<this.loopLength?(this.loopIndex=this.loopIndex+1,this.newIndex=this.startIndex):(delete this.loopIndex,delete this.loopLength,delete this.startIndex,delete this.newIndex),t},at=function(t){return t.controllerInstance=Object.assign(t.controllerInstance,t.controllerExtension),t},ut=function(t){var e=t.controllerName,n=M(t.selectedElement).find((function(t){return t.name===e}));return n||console.warn("controller for name '"+e+"' was not found on the given element"),t.controllerInstance=n,t},lt=function(t){var e=t.systemName,n=t.propertyName,i=void 0===n?"controllerInstance":n;return t[i]=null,this.eventbus.broadcast(I.REQUEST_INSTANCE,[e,function(e){t[i]=e}]),delete t.propertyName,t},ct=function(t){var e,n,i=t.selectedElement,r=t.modifier,o={width:null!=(e=i.innerWidth())?e:0,height:null!=(n=i.innerHeight())?n:0};return 0===o.height&&(o.height=o.width),r&&r.length&&function(t,e){var n=null;if(e.indexOf("|")>-1){var i=e.split("|");e=i[0],n=i[1]}var r=e.substr(0,1),o=function(t){var e=1,n=t.substr(t.length-1,1);"h"!==n&&"w"!==n&&"%"!==n&&(n=null);var i="%"===n;return i&&"h"!==(n=t.substr(t.length-(e=2),1))&&"w"!==n&&(n=null,e=1),[n,e,i]}(e),s=o[0],a=o[2],u=parseInt(e.substr(1,null!==s?e.length-o[1]-1:e.length),10),l=u,c=u;a&&(l=t.width/100*u,c=t.height/100*u),t=function(t,e,n,i,r){switch(e){case"+":switch(n){case"h":t.height+=r;break;case"w":t.width+=i;break;default:t.height+=r,t.width+=i}break;case"-":switch(n){case"h":t.height-=r;break;case"w":t.width-=i;break;default:t.height-=r,t.width-=i}break;case"/":switch(n){case"h":t.height/=r;break;case"w":t.width/=i;break;default:t.height/=r,t.width/=i}break;case"*":switch(n){case"h":t.height*=r;break;case"w":t.width*=i;break;default:t.height*=r,t.width*=i}break;default:console.error("Unknown operator found: "+e)}return t}(t,r,s,l,c),n&&function(t,e){var n=t.substr(0,1),i=t.substr(t.indexOf("[")+1,t.indexOf("]")-t.indexOf("[")-1).split("=")[1].split("-");"h"===n?e.height=e.width/+i[0]*+i[1]:"w"===n&&(e.width=e.height/+i[1]*+i[0])}(n,t)}(o,r),t.dimensions=o,t},ht=function(t){return this.eventbus.broadcast(I.REQUEST_FUNCTION,[t.systemName,function(e){t.importedInstance=e}]),delete t.systemName,t},dt={},pt=function(t){var e=t.url,n=t.propertyName,i=void 0===n?"json":n;return t.cache&&dt[e]?(t[i]=dt[e],delete t.propertyName,t):new Promise((function(n,r){fetch(e).then(function(){var r=l(L.mark((function r(o){var s;return L.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,o.json();case 2:s=t[i]=r.sent,delete t.propertyName,dt[e]=s,n(t);case 7:case"end":return r.stop()}}),r)})));return function(t){return r.apply(this,arguments)}}()).catch(r)}))},vt=function(t){return console.group("Operation info"),console.dir({context:this}),console.dir({operationData:t}),console.groupEnd(),t},ft=function(t){return t.selectedElement.removeClass(t.className),t},mt=function(t){var e=t.controllerName,n=M(t.selectedElement),i=null==n?void 0:n.find((function(t){return t.name===e}));if(i){var r=n.indexOf(i);n.splice(r,1),i.detach(this.eventbus)}return t},Et=function(t){return t.selectedElement.remove(),t},_t=function(t){return t.propertyNames.forEach((function(e){delete t[e]})),delete t.propertyNames,t},gt=function(t){var e=t.newParentSelector;return t.selectedElement.remove().appendTo(e),t},bt=function(t){return this.eventbus.broadcast(I.REQUEST_ACTION,[t.systemName,function(e){t.actionInstance=e}]),t},yt=function(t){var e=t.actionInstance;return t=j(t,t.actionOperationData),e.resize?e.resize(t):t};function Tt(t,e,n,i){var r=t.find(e);r.length||console.warn("selector '"+e+"' wasn't found!"),n[i]=r,n.hasOwnProperty("propertyName")&&delete n.propertyName}var Lt=function(t){var e=t.selector,n=t.propertyName,i=void 0===n?"selectedElement":n,r=t.useSelectedElementAsRoot,o=void 0!==r&&r;if(!e)throw new Error("selector is undefined!");return o&&t[i]?(Tt(t[i],e,t,i),t):(this.eventbus.broadcast(I.REQUEST_ENGINE_ROOT,[function(n){Tt(n,e,t,i)}]),t)},It=function(t){var e=t.attributes,n=t.selectedElement;return Object.keys(e).forEach((function(t){n.attr(t,e[t])})),t},xt=function(t){var e=t.insertionType,n=t.selectedElement,i=t.template;switch(!0){case void 0===e:n.html(i);break;case"append"===e:n.append(i);break;case"prepend"===e:n.prepend(i)}return delete t.insertionType,t},wt=function(t){var e=t.override,n=X(t,t.properties);return delete t.properties,e?n:Object.assign(t,n)},Pt=function(t){var e=t.propertyName,n=void 0===e?"selectedElement":e,i=X(t,t.properties);return t[n].css(i),delete t.propertyName,t},Nt=function(t){var e=t.actionInstance,n=t.actionOperationData;return delete t.actionOperationData,new Promise((function(i,r){t=j(t,n),e.start(t).then((function(){Object.keys(n).forEach((function(e){delete t[e]})),z(i,t)}),r)}))},St=function(t){var e=t.collection,n=t.propertyName,i=void 0===n?"currentItem":n;if("string"==typeof e)throw new Error("Expected collection to be array type, string value was probably not resolved correctly");return void 0===this.loopIndex&&(null!=e&&e.length?(this.loopIndex=0,this.loopLength=e.length-1,this.startIndex=this.currentIndex):this.skipNextOperation=!0),null!=e&&e.length&&void 0!==this.loopIndex&&(t[i]=e[this.loopIndex]),delete t.propertyName,t},At=function(t){return t.selectedElement.toggleClass(t.className),t},Ot=function(t){return t.selectedElement.toggle(),t},Rt=function(t){var e=t.milliseconds;return new Promise((function(n){setTimeout((function(){z(n,t)}),e)}))},Ut={__proto__:null,addClass:H,addControllerToElement:G,animate:V,animateWithClass:B,broadcastEvent:Y,clearElement:W,clearOperationData:J,createElement:$,customFunction:rt,endAction:ot,endLoop:st,extendController:at,getControllerFromElement:ut,getControllerInstance:lt,getElementDimensions:ct,getImport:ht,loadJSON:pt,log:vt,removeClass:ft,removeControllerFromElement:mt,removeElement:Et,removePropertiesFromOperationData:_t,reparentElement:gt,requestAction:bt,resizeAction:yt,selectElement:Lt,setElementAttributes:It,setElementContent:xt,setOperationData:wt,setStyle:Pt,startAction:Nt,startLoop:St,toggleClass:At,toggleElement:Ot,wait:Rt},Dt=R,Ct={__proto__:null,JwPlayerTimelineProvider:tt,MediaElementTimelineProvider:nt,RequestAnimationFrameTimelineProvider:it},kt=q,qt=function(){function t(){this.engines=new Map,this.engines.set("EligiusEngine",U)}var e=t.prototype;return e.getOperationNames=function(){return Object.keys(Ut)},e.getControllerNames=function(){return Object.keys(Dt)},e.getProviderNames=function(){return Object.keys(Ct)},e.import=function(t){var e,n,i,r,o,s=null!=(e=null!=(n=null!=(i=null!=(r=Ut[t])?r:Dt[t])?i:Ct[t])?n:kt[t])?e:this.engines.get(t);return(o={})[t]=s,o},t}();exports.Action=a,exports.ActionRegistryEventbusListener=D,exports.ConfigurationResolver=f,exports.EligiusEngine=U,exports.EndableAction=d,exports.EngineFactory=F,exports.EventListenerController=x,exports.Eventbus=C,exports.JwPlayerTimelineProvider=tt,exports.LabelController=w,exports.LanguageManager=Q,exports.LottieController=P,exports.MediaElementTimelineProvider=nt,exports.NavigationController=N,exports.ProgressbarController=S,exports.RequestAnimationFrameTimelineProvider=it,exports.RequestVideoUriInterceptor=k,exports.RoutingController=A,exports.SubtitlesController=O,exports.TimelineAction=p,exports.TimelineEventNames=I,exports.WebpackResourceImporter=qt,exports.addClass=H,exports.addControllerToElement=G,exports.animate=V,exports.animateWithClass=B,exports.broadcastEvent=Y,exports.clearElement=W,exports.clearOperationData=J,exports.createElement=$,exports.customFunction=rt,exports.endAction=ot,exports.endLoop=st,exports.extendController=at,exports.getControllerFromElement=ut,exports.getControllerInstance=lt,exports.getElementDimensions=ct,exports.getImport=ht,exports.loadJSON=pt,exports.log=vt,exports.removeClass=ft,exports.removeControllerFromElement=mt,exports.removeElement=Et,exports.removePropertiesFromOperationData=_t,exports.reparentElement=gt,exports.requestAction=bt,exports.resizeAction=yt,exports.selectElement=Lt,exports.setElementAttributes=It,exports.setElementContent=xt,exports.setOperationData=wt,exports.setStyle=Pt,exports.startAction=Nt,exports.startLoop=St,exports.toggleClass=At,exports.toggleElement=Ot,exports.wait=Rt;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("ts-is-present"),e=require("lottie-web"),n=require("jquery"),i=require("mousetrap"),r=require("uuid");function o(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var s=o(e),a=o(n),u=o(i);function l(e){return t.isDefined(e)?JSON.parse(JSON.stringify(e)):e}var c=function(){function t(t,e,n){this.name=void 0,this.startOperations=void 0,this.eventbus=void 0,this.id="",this.name=t,this.startOperations=e,this.eventbus=n}var e=t.prototype;return e.start=function(t){var e=this,n={currentIndex:-1,eventbus:this.eventbus};return new Promise((function(i,r){e.executeOperation(e.startOperations,0,i,r,t,n)})).catch((function(t){throw console.error("Error in action start '"+e.name+"'"),console.error(t),t}))},e.executeOperation=function(t,e,n,i,r,o){var s,a=this;if(void 0===r&&(r={}),void 0!==o.newIndex&&(e=o.newIndex,delete o.newIndex),o.currentIndex=e,o.skipNextOperation&&(e<t.length?this.executeOperation(t,++e,n,i,r,o):n(r)),e<t.length){var u=t[e],c=u.operationData?l(u.operationData):{},h=Object.assign(r,c),d=u.instance.call(o,h);"object"==typeof(s=d)&&"function"==typeof s.then?d.then((function(r){a.executeOperation(t,++e,n,i,r,o)})).catch((function(t){i(t)})):this.executeOperation(t,++e,n,i,d,o)}else n(r)},t}();function h(t,e,n,i,r,o,s){try{var a=t[o](s),u=a.value}catch(t){return void n(t)}a.done?e(u):Promise.resolve(u).then(i,r)}function d(t){return function(){var e=this,n=arguments;return new Promise((function(i,r){var o=t.apply(e,n);function s(t){h(o,i,r,s,a,"next",t)}function a(t){h(o,i,r,s,a,"throw",t)}s(void 0)}))}}function p(){return p=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},p.apply(this,arguments)}function v(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,f(t,e)}function f(t,e){return f=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},f(t,e)}var m=function(t){function e(e,n,i,r){var o;return(o=t.call(this,e,n,r)||this).endOperations=void 0,o.endOperations=i,o}return v(e,t),e.prototype.end=function(t){var e=this;if(this.endOperations.length){var n={currentIndex:-1,eventbus:this.eventbus};return new Promise((function(i,r){e.executeOperation(e.endOperations,0,i,r,t,n)})).catch((function(t){throw console.error("Error in action end '"+e.name+"'"),t}))}return new Promise((function(e){e(t)}))},e}(c),g=function(t){function e(e,n,i,r,o){var s;return(s=t.call(this,e,n,i,o)||this).duration=void 0,s.active=!1,s.duration=r,s}v(e,t);var n=e.prototype;return n.start=function(e){return!this.active||this.duration.end<0?(this.active=this.duration.end>-1,t.prototype.start.call(this,e)):new Promise((function(t){t()}))},n.end=function(e){return this.active=!1,t.prototype.end.call(this,e)},e}(m);function E(t,e){if(!t)throw Error("properties arg cannot be null");if(!e)throw Error("sourceObject arg cannot be null");var n=e,i=null;return t.forEach((function(e,r){if(r===t.length-1){var o=e.split("+");o.length>1&&(e=o[0],i=o[1])}n=n[e]})),i?n+i:n}var _=function(){function e(t,e){this.importer=void 0,this.eventbus=void 0,this.importer=t,this.eventbus=e}return e.prototype.process=function(e,n){if(w(e,e,this.importer),!t.isDefined(e.timelineProviderSettings))throw new Error("Configuration incomplete: it needs to have at least one timeline provider setting");var i={id:e.id,engine:p({},e.engine),timelineProviderSettings:l(e.timelineProviderSettings),containerSelector:e.containerSelector,language:e.language,layoutTemplate:e.layoutTemplate,availableLanguages:l(e.availableLanguages),actions:x(e.actions,this.importer,this.eventbus),initActions:x(e.initActions,this.importer,this.eventbus),labels:l(e.labels),timelineFlow:l(e.timelineFlow),timelines:b(e.timelines,this.importer,this.eventbus)},r=[];return e.eventActions&&n&&(r=function(t,e,n,i){return t.map((function(t){return T(t,n)})).map((function(n,r){var o=t[r],s=o.eventName,a=o.eventTopic,u=new c(n.name,n.startOperations,i);return e.registerAction(u,s,a),u}))}(e.eventActions,n,this.importer,this.eventbus)),[i.actions.concat(r).reduce((function(t,e){var n;return p({},t,((n={})[e.name]=e,n))}),{}),i]},e}();function b(t,e,n){var i=I.bind(null,e,n);return t.map((function(t){return p({},t,{timelineActions:t.timelineActions.map(i)})}))}function y(t,e){return{id:e.id,systemName:e.systemName,operationData:l(e.operationData),instance:t.import(e.systemName)[e.systemName]}}function T(t,e){var n=y.bind(null,e);return{id:t.id,name:t.name,startOperations:t.startOperations.map(n)}}function L(t,e){var n=y.bind(null,e);return p({},T(t,e),{endOperations:t.endOperations.map(n)})}function I(t,e,n){var i,r=L(n,t),o={end:null!=(i=n.duration.end)?i:-1,start:n.duration.start},s=r.id,a=new g(r.name,r.startOperations,r.endOperations,o,e);return a.id=s,a}function x(t,e,n){return t.map((function(t){return L(t,e)})).map((function(t){var e=new m(t.name,t.startOperations,t.endOperations,n);return e.id=t.id,e}))}function w(e,n,i){t.isDefined(e)&&(Array.isArray(e)?e.forEach((function(t){w(t,n,i)})):Object.keys(e).forEach((function(t){!function(t,e,n,i){var r,o=e[t];if("string"==typeof o){if(o.startsWith("config:")){var s=o.substr(7,o.length);e[t]=(r=n,E(s.split("."),r))}else if(o.startsWith("template:")){var a=o.substr(9,o.length);e[t]=i.import(a)[a]}else if(o.startsWith("json:")){var u=o.substr(5,o.length),l=i.import(u)[u];e[t]=l}}else"object"==typeof o&&w(e[t],n,i)}(t,e,n,i)})))}var P={exports:{}};!function(t){var e=function(t){var e,n=Object.prototype,i=n.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",s=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,i){var r=Object.create((e&&e.prototype instanceof m?e:m).prototype),o=new N(i||[]);return r._invoke=function(t,e,n){var i=h;return function(r,o){if(i===p)throw new Error("Generator is already running");if(i===v){if("throw"===r)throw o;return S()}for(n.method=r,n.arg=o;;){var s=n.delegate;if(s){var a=x(s,n);if(a){if(a===f)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===h)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=p;var u=c(t,e,n);if("normal"===u.type){if(i=n.done?v:d,u.arg===f)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(i=v,n.method="throw",n.arg=u.arg)}}}(t,n,o),r}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var h="suspendedStart",d="suspendedYield",p="executing",v="completed",f={};function m(){}function g(){}function E(){}var _={};u(_,o,(function(){return this}));var b=Object.getPrototypeOf,y=b&&b(b(A([])));y&&y!==n&&i.call(y,o)&&(_=y);var T=E.prototype=m.prototype=Object.create(_);function L(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function I(t,e){function n(r,o,s,a){var u=c(t[r],t,o);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&i.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,s,a)}),(function(t){n("throw",t,s,a)})):e.resolve(h).then((function(t){l.value=t,s(l)}),(function(t){return n("throw",t,s,a)}))}a(u.arg)}var r;this._invoke=function(t,i){function o(){return new e((function(e,r){n(t,i,e,r)}))}return r=r?r.then(o,o):o()}}function x(t,n){var i=t.iterator[n.method];if(i===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,x(t,n),"throw"===n.method))return f;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var r=c(i,t.iterator,n.arg);if("throw"===r.type)return n.method="throw",n.arg=r.arg,n.delegate=null,f;var o=r.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,f):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,f)}function w(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function A(t){if(t){var n=t[o];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,s=function n(){for(;++r<t.length;)if(i.call(t,r))return n.value=t[r],n.done=!1,n;return n.value=e,n.done=!0,n};return s.next=s}}return{next:S}}function S(){return{value:e,done:!0}}return g.prototype=E,u(T,"constructor",E),u(E,"constructor",g),g.displayName=u(E,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,E):(t.__proto__=E,u(t,a,"GeneratorFunction")),t.prototype=Object.create(T),t},t.awrap=function(t){return{__await:t}},L(I.prototype),u(I.prototype,s,(function(){return this})),t.AsyncIterator=I,t.async=function(e,n,i,r,o){void 0===o&&(o=Promise);var s=new I(l(e,n,i,r),o);return t.isGeneratorFunction(n)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},L(T),u(T,a,"Generator"),u(T,o,(function(){return this})),u(T,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var i=e.pop();if(i in t)return n.value=i,n.done=!1,n}return n.done=!0,n}},t.values=A,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var n in this)"t"===n.charAt(0)&&i.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function r(i,r){return a.type="throw",a.arg=t,n.next=i,r&&(n.method="next",n.arg=e),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return r("end");if(s.tryLoc<=this.prev){var u=i.call(s,"catchLoc"),l=i.call(s,"finallyLoc");if(u&&l){if(this.prev<s.catchLoc)return r(s.catchLoc,!0);if(this.prev<s.finallyLoc)return r(s.finallyLoc)}else if(u){if(this.prev<s.catchLoc)return r(s.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return r(s.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=t,s.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),P(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var i=n.completion;if("throw"===i.type){var r=i.arg;P(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,i){return this.delegate={iterator:A(t),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=e),f}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}}(P);var N=P.exports,A=function(){};A.PLAY_TOGGLE_REQUEST="timeline-play-toggle-request",A.PLAY_REQUEST="timeline-play-request",A.STOP_REQUEST="timeline-stop-request",A.PAUSE_REQUEST="timeline-pause-request",A.SEEK_REQUEST="timeline-seek-request",A.RESIZE_REQUEST="timeline-resize-request",A.CONTAINER_REQUEST="timeline-container-request",A.DURATION_REQUEST="timeline-duration-request",A.REQUEST_CURRENT_TIMELINE="timeline-request-current-timeline",A.DURATION="timeline-duration",A.TIME="timeline-time",A.SEEKED="timeline-seeked",A.COMPLETE="timeline-complete",A.PLAY="timeline-play",A.STOP="timeline-stop",A.PAUSE="timeline-pause",A.SEEK="timeline-seek",A.RESIZE="timeline-resize",A.POSITION_UPDATE="timeline-position-update",A.TIME_UPDATE="timeline-time-update",A.CURRENT_TIMELINE_CHANGE="timeline-current-timeline-change",A.FIRST_FRAME="timeline-firstframe",A.REQUEST_INSTANCE="request-instance",A.REQUEST_ACTION="request-action",A.REQUEST_FUNCTION="request-function",A.REQUEST_TIMELINE_URI="request-timeline-uri",A.BEFORE_REQUEST_TIMELINE_URI="before-request-timeline-uri",A.REQUEST_ENGINE_ROOT="request-engine-root",A.REQUEST_CURRENT_TIMELINE_POSITION="request-current-timeline-position",A.REQUEST_TIMELINE_CLEANUP="request-timeline-cleanup",A.EXECUTE_TIMELINEACTION="execute-timelineaction",A.RESIZE_TIMELINEACTION="resize-timelineaction",A.REQUEST_LABEL_COLLECTION="request-label-collection",A.REQUEST_LABEL_COLLECTIONS="request-label-collections",A.REQUEST_CURRENT_LANGUAGE="request-current-language",A.LANGUAGE_CHANGE="language-change";var S=function(){function t(){this.operationData=void 0,this.actionInstanceInfos=void 0,this.name="EventListenerController"}var e=t.prototype;return e.init=function(t){this.operationData={selectedElement:t.selectedElement,eventName:t.eventName,actions:t.actions.slice(),actionOperationData:t.actionOperationData?l(t.actionOperationData):void 0}},e.attach=function(t){var e=this;if(this.operationData){var n=this.operationData,i=n.selectedElement,r=n.actions,o=n.eventName;this.actionInstanceInfos||(this.actionInstanceInfos=[],r.forEach((function(n){var i,r=e._isStartAction(n);t.broadcast(A.REQUEST_ACTION,[r[1],(i=r[0],function(t){var n;null==(n=e.actionInstanceInfos)||n.push({start:i,action:t})})])})),i.on(o,this._eventHandler.bind(this)))}},e._isStartAction=function(t){return"end:"===t.substr(0,"end:".length)?[!1,t.substr("end:".length)]:[!0,t]},e._eventHandler=function(t){if(this.operationData&&this.actionInstanceInfos){var e=this.operationData.actionOperationData?l(this.operationData.actionOperationData):{};t.target&&(e.targetValue=t.target.value),this._executeAction(this.actionInstanceInfos,e,0)}},e._executeAction=function(){var t=d(N.mark((function t(e,n,i){var r,o,s;return N.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(i<e.length)){t.next=8;break}return o=(r=e[i]).action,s=r.start?o.start.bind(o):o.end.bind(o),t.next=6,s(n);case 6:this._executeAction(e,Object.assign(n,t.sent),++i);case 8:case"end":return t.stop()}}),t,this)})));return function(e,n,i){return t.apply(this,arguments)}}(),e.detach=function(t){var e;null==(e=this.operationData)||e.selectedElement.off(this.operationData.eventName)},t}(),O=function(){function t(){this.listeners=[],this.currentLanguage=null,this.operationData=null,this.labelData={},this.name="LabelController"}var e=t.prototype;return e.init=function(t){this.operationData=Object.assign({},t)},e.attach=function(t){var e=this;this.operationData&&(t.broadcast(A.REQUEST_CURRENT_LANGUAGE,[function(t){e.currentLanguage=t}]),t.broadcast(A.REQUEST_LABEL_COLLECTION,[this.operationData.labelId,function(t){e.createTextDataLookup(t)}]),this.setLabel(),this.listeners.push(t.on(A.LANGUAGE_CHANGE,this.handleLanguageChange.bind(this))))},e.setLabel=function(){var t;this.currentLanguage&&(null==(t=this.operationData)||t.selectedElement.html(this.labelData[this.currentLanguage]))},e.detach=function(t){this.listeners.forEach((function(t){t()}))},e.handleLanguageChange=function(t){this.currentLanguage=t,this.setLabel()},e.createTextDataLookup=function(t){var e=this;t.forEach((function(t){e.labelData[t.languageCode]=t.label}))},t}(),R=function(){function t(){this.name="LottieController",this.currentLanguage=null,this.labelData={},this.listeners=[],this.animationItem=null,this.operationData=null,this.serializedData=null,this.serializedIEData=null,this.freezePosition=-1,this.endPosition=-1}var e=t.prototype;return e.init=function(t){this.operationData={selectedElement:t.selectedElement,renderer:t.renderer,loop:t.loop,autoplay:t.autoplay,animationData:t.animationData,json:t.json,labelIds:t.labelIds,viewBox:t.viewBox,iefallback:t.iefallback},t.url.indexOf("[")>-1&&this.parseFilename(t.url),this.serializedData=this.operationData.json?JSON.stringify(this.operationData.json):JSON.stringify(this.operationData.animationData),this.operationData.iefallback&&(this.serializedIEData=JSON.stringify(this.operationData.iefallback))},e.parseFilename=function(t){var e=this;t.substr(t.indexOf("[")+1,t.indexOf("]")-t.indexOf("[")-1).split(",").forEach((function(t){var n=t.split("=");"freeze"===n[0]?e.freezePosition=+n[1]:"end"===n[0]&&(e.endPosition=+n[1])}))},e.attach=function(t){if(this.operationData){var e=this.operationData.labelIds;if(e&&e.length){var n={};t.broadcast(A.REQUEST_CURRENT_LANGUAGE,[n]),this.currentLanguage=n.language,this.listeners.push(t.on(A.LANGUAGE_CHANGE,this.handleLanguageChange.bind(this))),t.broadcast(A.REQUEST_LABEL_COLLECTIONS,[this.operationData.labelIds,n]),this.createTextDataLookup(n.labelCollections)}this.createAnimation()}},e.detach=function(t){this.listeners.forEach((function(t){t()})),this.animationItem&&(this.endPosition>-1?(this.animationItem.addEventListener("complete",this.destroy.bind(this)),this.animationItem.playSegments([this.freezePosition,this.endPosition],!0)):this.animationItem.destroy())},e.destroy=function(){this.animationItem&&(this.animationItem.destroy(),this.animationItem=null)},e.createAnimation=function(){var t,e=this;if(this.operationData&&this.serializedData){null==(t=this.animationItem)||t.destroy();var n=this.isIE()&&this.serializedIEData?this.serializedIEData:this.serializedData,i=this.operationData.labelIds;i&&i.length&&i.forEach((function(t){var i;n=n.split("!!"+t+"!!").join(e.labelData[t][null!=(i=e.currentLanguage)?i:""])}));var r=JSON.parse(n);this.animationItem=s.default.loadAnimation({autoplay:this.operationData.autoplay,container:this.operationData.selectedElement[0],loop:this.operationData.loop,rendererSettings:this.operationData.renderer,animationData:r}),this.endPosition<0&&(this.endPosition=this.animationItem.timeCompleted),this.freezePosition>-1&&this.animationItem.playSegments([0,this.freezePosition],!0),this.operationData.viewBox&&this.operationData.selectedElement.find("svg").attr("viewBox",this.operationData.viewBox)}},e.createTextDataLookup=function(t){var e=this;t.forEach((function(t,n){t.forEach((function(t){e.operationData&&(e.labelData[e.operationData.labelIds[n]][t.code]=t.label)}))}))},e.handleLanguageChange=function(t){this.currentLanguage=t,this.createAnimation()},e.isIE=function(){var t=!!window.document.documentMode;return!t&&!!window.StyleMedia||t},t}(),U=function(){function t(){this.name="NavigationController",this.navigation=[],this.navLookup={},this.navVidIdLookup={},this.ctrlLookup={},this.activeNavigationPoint=null,this.labelControllers=[],this.eventhandlers=[],this.eventbus=null,this.container=null}var e=t.prototype;return e.init=function(t){this.container=t.selectedElement,this.navigation=this.buildNavigationData(t.json)},e.attach=function(t){this.container&&(this.eventbus=t,this.eventhandlers.push(t.on("navigate-to-video-url",this.handleNavigateVideoUrl.bind(this))),this.eventhandlers.push(t.on("highlight-navigation",this.highlightMenu.bind(this))),this.eventhandlers.push(t.on("request-current-navigation",this.handleRequestCurrentNavigation.bind(this))),this.eventhandlers.push(t.on("video-complete",this.handleVideoComplete.bind(this))),this.buildHtml(this.container,this.navigation),this.initHistory.bind(this))},e.initHistory=function(){this.activeNavigationPoint=this.navVidIdLookup[0];var t=this.getQueryVariable(0),e=0;t&&(e=this.navLookup[t].videoUrlIndex),this.highlightMenu(e)},e.getQueryVariable=function(t){var e=window.location.href,n=e.indexOf("#");if(n>-1){var i=e.substring(n+2);if(i)return i.split("/")[t]}return null},e.handleRequestCurrentNavigation=function(t){if(this.activeNavigationPoint){var e=this.ctrlLookup[this.activeNavigationPoint.labelId];t({navigationData:this.activeNavigationPoint,title:e.labelData[e.currentLanguage||""]})}else t(null)},e.detach=function(t){this.eventhandlers.forEach((function(t){t()})),this.labelControllers.forEach((function(e){e.detach(t)})),this.labelControllers.length=0,this.eventbus=null,this.container=null,window.onpopstate=null},e.pushCurrentState=function(t){var e;if(void 0===t&&(t=-1),this.activeNavigationPoint){var n=this.ctrlLookup[this.activeNavigationPoint.labelId];if(n){var i={navigationData:this.activeNavigationPoint,title:n.labelData[n.currentLanguage||""],position:-1};t>-1&&(i.position=t),null==(e=this.eventbus)||e.broadcast("push-history-state",[i])}}},e.buildHtml=function(t,e){var n=a.default("<ul/>");e.forEach(this.addNavElement.bind(this,n)),t.append(n)},e.addNavElement=function(t,e){if(e.visible){var n=a.default("<li/>"),i=a.default("<a href='javascript:;' id='nav_"+e.videoUrlIndex+"'/>");if(n.append(i),this.addLabel(i,e.labelId),this.addClickHandler(i,e.videoUrlIndex),e.children){var r=a.default("<ul/>");e.children.forEach(this.addNavElement.bind(this,r)),n.append(r)}t.append(n)}},e.addClickHandler=function(t,e){t.mouseup(this.menuMouseupHandler.bind(this,e))},e.menuMouseupHandler=function(t){var e,n=this.navVidIdLookup[t];n&&(null==(e=this.eventbus)||e.broadcast("request-video-url",[n.videoUrlIndex]),this.handleNavigateVideoUrl(n.videoUrlIndex))},e.handleNavigateVideoUrl=function(t,e){var n;void 0===e&&(e=0),this.highlightMenu(t),null==(n=this.eventbus)||n.broadcast("request-video-url",[t,e]),this.activeNavigationPoint=this.navVidIdLookup[t],this.pushCurrentState(e)},e.highlightMenu=function(t){var e=a.default("#nav_"+t);e.length&&(a.default(".current-menu-item").removeClass("current-menu-item"),e.addClass("current-menu-item"))},e.handleVideoComplete=function(t){var e,n,i=this.navVidIdLookup[t];i.autoNext?null==(e=this.eventbus)||e.broadcast("request-video-url",[i.next.videoUrlIndex]):null==(n=this.eventbus)||n.broadcast("request-video-cleanup")},e.addLabel=function(t,e){var n,i=this,r={selectedElement:t,labelId:e};null==(n=this.eventbus)||n.broadcast("request-instance",["LabelController",function(t){t.init(r),t.attach(i.eventbus),i.labelControllers.push(t),i.ctrlLookup[e]=t}])},e.buildNavigationData=function(t){var e=this,n=[];return t.navigationData.forEach((function(n,i){e.navLookup[n.id]=n,e.navVidIdLookup[n.videoUrlIndex]=n,n.previous=t.navigationData[i-1]})),t.navigationData.forEach((function(n,i){n.nextId?(n.next=e.navLookup[n.nextId],delete n.nextId):n.next=t.navigationData[i+1]})),t.roots.forEach((function(t){var i=e.navLookup[t];i.children&&(i.children=i.children.map((function(t){return e.navLookup[t]}))),n.push(i)})),n},t}(),D=function(){function t(){this.name="ProgressbarController",this.selectedElement=null,this.textElement=null,this.detachers=[]}var e=t.prototype;return e.init=function(t){this.selectedElement=t.selectedElement,this.textElement=t.textElement},e.attach=function(t){var e,n=this;this.detachers.push(t.on(A.POSITION_UPDATE,this.positionUpdateHandler.bind(this)));var i=this.clickHandler.bind(this);null==(e=this.selectedElement)||e.on("click",i),this.detachers.push((function(){var t;return null==(t=n.selectedElement)?void 0:t.off("click")}),i)},e.detach=function(t){this.detachers.forEach((function(t){t()}))},e.positionUpdateHandler=function(t){var e,n,i=100/t.duration*t.position;null==(e=this.selectedElement)||e.css("width",i+"%"),null==(n=this.textElement)||n.text(Math.floor(i)+"%")},e.clickHandler=function(){},t}(),C=function(){function t(){this.name="RoutingController",this.navLookup={},this.navVidIdLookup={},this.navigation=null,this.eventhandlers=[],this.eventbus=null}var e=t.prototype;return e.init=function(t){this.navigation=this.buildNavigationData(t.json)},e.attach=function(t){this.eventhandlers.push(t.on("before-request-video-url",this.handleBeforeRequestVideoUrl.bind(this))),this.eventhandlers.push(t.on("push-history-state",this.handlePushHistoryState.bind(this))),this.eventbus=t,window.onpopstate=this.handlePopstate.bind(this);var e=this.getQueryVariable(0);if(e){var n=this.navLookup[e],i=+this.getQueryVariable(1);this.eventbus.broadcast("request-video-url",[n.videoUrlIndex,i,!0])}else window.history.pushState({navigationId:this.navigation[0].id},"","#/"+this.navigation[0].id)},e.handlePopstate=function(t){var e,n,i,r,o=null!=(e=null==(n=t.state)?void 0:n.position)?e:0,s=this.navLookup[t.state?t.state.navigationId:this.navigation[0].id];null==(i=this.eventbus)||i.broadcast("highlight-navigation",[s.videoUrlIndex]),null==(r=this.eventbus)||r.broadcast("request-video-url",[s.videoUrlIndex,o,!0])},e.detach=function(t){this.eventhandlers&&this.eventhandlers.forEach((function(t){t()})),this.eventbus=null},e.handleBeforeRequestVideoUrl=function(t,e,n){var i,r=this;void 0===n&&(n=!1),(n=void 0!==n&&n)||null==(i=this.eventbus)||i.broadcast("request-current-navigation",[function(t){r.pushState(t)}])},e.getQueryVariable=function(t){var e=window.location.href,n=e.indexOf("#");if(n>-1){var i=e.substring(n+2);if(i)return i.split("/")[t]}return""},e.handlePushHistoryState=function(t){this.pushState(t)},e.pushState=function(t){if(t&&t.navigationData&&t.navigationData.visible){var e,n=void 0!==t.position?t.position:-1;n<0&&(null==(e=this.eventbus)||e.broadcast("request-current-video-position",[function(t){n=t>3?t-3:0}]));var i=window.history.state;i&&i.navigationId!==t.navigationData.id?window.history.pushState({navigationId:t.navigationData.id,position:n},t.title,"#/"+t.navigationData.id+"/"+n):i&&i.navigationId===t.navigationData.id?window.history.replaceState({navigationId:i.navigationId,position:n},t.title,"#/"+i.navigationId+"/"+n):window.history.pushState({navigationId:t.navigationData.id,position:n},t.title,"#/"+t.navigationData.id+"/"+n),window.document.title=t.title}},e.buildNavigationData=function(t){var e=this,n=[];return t.navigationData.forEach((function(n,i){e.navLookup[n.id]=n,e.navVidIdLookup[n.videoUrlIndex]=n,n.previous=t.navigationData[i-1]})),t.navigationData.forEach((function(n,i){n.nextId?(n.next=e.navLookup[n.nextId],delete n.nextId):n.next=t.navigationData[i+1]})),t.roots.forEach((function(t){var i=e.navLookup[t];i.children&&(i.children=i.children.map((function(t){return e.navLookup[t]}))),n.push(i)})),n},t}(),k=function(){function t(){this.actionLookup={},this.currentLanguage=null,this.lastFunc=null,this.name="SubtitlesController"}var e=t.prototype;return e.attach=function(t){var e=t.on(A.TIME,this.onTimeHandler.bind(this)),n=t.on(A.SEEKED,this.onSeekedHandler.bind(this)),i=t.on(A.LANGUAGE_CHANGE,this.languageChangeHandler.bind(this));this.internalDetach=this.internalDetach.bind(this,[e,i,n])},e.detach=function(t){this.internalDetach()},e.internalDetach=function(t){t&&t.forEach((function(t){t()}))},e.languageChangeHandler=function(t){this.currentLanguage=t,this.lastFunc&&this.lastFunc()},e.removeTitle=function(t){null==t||t.empty(),this.lastFunc=null},e.onTimeHandler=function(t){var e=this.actionLookup[t.position];e&&(e(),this.lastFunc=e)},e.onSeekedHandler=function(t){for(var e=t.position,n=this.actionLookup[e];!n&&--e>=0;)n=this.actionLookup[e];n?(n(),this.lastFunc=n):this.removeTitle()},e.setTitle=function(t,e){this.currentLanguage&&t.html(e[this.currentLanguage])},e.createActionLookup=function(t,e){for(var n=t.subtitleData,i=n[0].titles,r={},o=0,s=i.length;o<s;o++){for(var a={},u=0,l=n.length;u<l;u++){var c=n[u];a[c.lang]=c.titles[o].text}r[i[o].duration.start]=this.setTitle.bind(this,e,a),r[i[o].duration.end]=this.removeTitle}return r},e.init=function(t){var e=t.selectedElement;this.removeTitle=this.removeTitle.bind(this,e),this.currentLanguage=t.language,this.actionLookup=this.createActionLookup(t,e)},t}(),q={__proto__:null,EventListenerController:S,LabelController:O,LottieController:R,NavigationController:U,ProgressbarController:D,RoutingController:C,SubtitlesController:k},Q=function(){function t(t,e,n,i){this.configuration=void 0,this.eventbus=void 0,this.timelineProviders=void 0,this._languageManager=void 0,this._timeLineActionsLookup={},this._eventbusListeners=[],this._currentTimelineUri="",this._activeTimelineProvider=void 0,this._lastPosition=-1,this.configuration=t,this.eventbus=e,this.timelineProviders=n,this._languageManager=i}var e=t.prototype;return e.init=function(){this._createLayoutTemplate(),this._addInitialisationListeners();var t=this.configuration.timelines;return this._currentTimelineUri=t&&t.length?t[0].uri:"",this._createTimelineLookup(),this._eventbusListeners.push(this.eventbus.on(A.TIME,this._onTimeHandler.bind(this,Math.floor))),this._eventbusListeners.push(this.eventbus.on(A.SEEK,this._onSeekHandler.bind(this,Math.floor))),this._initializeTimelineProvider()},e._createLayoutTemplate=function(){var t=this.configuration.containerSelector,e=a.default(t);if(!e||!e.length)throw new Error("Container selector not found: "+t);var n=this.configuration.layoutTemplate;n&&n.length?e.html(n):console.warn("layoutTemplate is empty, unable to create layout")},e._initializeTimelineProvider=function(){var t,e=this;if(null==(t=this.configuration.timelines)||!t.length)throw new Error("No timelines present");var n=this.configuration.timelines[0],i=this.timelineProviders[n.type];if(!i)throw new Error("No timeline provider configured for type "+n.type);return this._activeTimelineProvider&&this._activeTimelineProvider.destroy(),this._activeTimelineProvider=i.provider,new Promise(function(){var t=d(N.mark((function t(n){return N.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e._activeTimelineProvider){t.next=8;break}return t.next=3,e._activeTimelineProvider.init();case 3:return t.next=5,e._executeActions(e.configuration.initActions,"start");case 5:n(e._activeTimelineProvider),t.next=9;break;case 8:throw new Error("NO ACTIVE TIMELINE PROVIDER");case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())},e._cleanUp=function(){var t=d(N.mark((function t(){return N.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._cleanUpTimeline();case 2:return t.next=4,this._executeActions(this.configuration.initActions,"end");case 4:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),e.destroy=function(){var t=d(N.mark((function t(){return N.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._cleanUp();case 2:this._activeTimelineProvider=void 0,this._eventbusListeners.forEach((function(t){return t()})),this.timelineProviders&&Object.values(this.timelineProviders).forEach((function(t){return t.provider.destroy()}));case 5:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),e._addInitialisationListeners=function(){this._eventbusListeners.push(this.eventbus.on(A.REQUEST_ENGINE_ROOT,this._handleRequestEngineRoot.bind(this,this.configuration.containerSelector))),this._eventbusListeners.push(this.eventbus.on(A.REQUEST_TIMELINE_URI,this._handleRequestTimelineUri.bind(this))),this._eventbusListeners.push(this.eventbus.on(A.REQUEST_CURRENT_TIMELINE_POSITION,this._handleRequestTimelinePosition.bind(this,Math.floor))),this._eventbusListeners.push(this.eventbus.on(A.REQUEST_TIMELINE_CLEANUP,this._handleTimelineComplete.bind(this))),this._eventbusListeners.push(this.eventbus.on(A.EXECUTE_TIMELINEACTION,this._handleExecuteTimelineAction.bind(this))),this._eventbusListeners.push(this.eventbus.on(A.RESIZE_TIMELINEACTION,this._resizeTimelineAction.bind(this))),this._eventbusListeners.push(this.eventbus.on(A.REQUEST_CURRENT_TIMELINE,this._requestCurrentTimeline.bind(this)))},e._createTimelineLookup=function(){var t=this;this.configuration.timelines&&this.configuration.timelines.forEach((function(e){e.timelineActions.forEach(t._addTimelineAction.bind(t,e.uri))}))},e._addTimelineAction=function(t,e){var n,i=e.duration.start,r=this._initializeTimelinePosition(this._initializeUriLookup(this._timeLineActionsLookup,t),i),o=e.start.bind(e);null!=(n=e.id)&&n.length&&(o.id=e.id,o.isStart=!0),r.push(o);var s=e.duration.end;if(s<0&&(s=e.duration.end=Infinity),isFinite(s)){var a,u=this._initializeTimelinePosition(this._timeLineActionsLookup[t],s),l=e.end.bind(e);null!=(a=e.id)&&a.length&&(l.id=e.id),u.push(l)}},e._initializeUriLookup=function(t,e){return t[e]||(t[e]={}),t[e]},e._initializeTimelinePosition=function(t,e){return t[e]||(t[e]=[]),t[e]},e._executeActions=function(){var t=d(N.mark((function t(e,n,i){var r;return N.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0===i&&(i=0),!(e&&i<e.length)){t.next=6;break}return r=e[i],t.next=5,r[n]();case 5:return t.abrupt("return",this._executeActions(e,n,++i));case 6:return t.abrupt("return",new Promise((function(t){t()})));case 7:case"end":return t.stop()}}),t,this)})));return function(e,n,i){return t.apply(this,arguments)}}(),e._handleRequestEngineRoot=function(t,e){e(a.default(t))},e._handleRequestTimelineUri=function(){var t=d(N.mark((function t(e,n,i){var r,o,s,a=this;return N.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._activeTimelineProvider){t.next=2;break}return t.abrupt("return");case 2:return this._activeTimelineProvider.stop(),t.next=6,this._cleanUpTimeline();case 6:if((o=this.configuration.timelines.find((function(t){return t.uri===e})))&&this._activeTimelineProvider&&this._currentTimelineUri!==o.uri){t.next=9;break}return t.abrupt("return");case 9:this._currentTimelineUri=o.uri,this.eventbus.broadcast(A.CURRENT_TIMELINE_CHANGE,[this._currentTimelineUri]),this._activeTimelineProvider!==(s=this.timelineProviders[o.type]).provider&&(this._activeTimelineProvider.destroy(),this._activeTimelineProvider=s.provider),this._activeTimelineProvider.loop=o.loop,n=null!=(r=n)?r:0,!this._activeTimelineProvider.loop&&n>0&&this.eventbus.once(A.FIRST_FRAME,(function(){a._activeTimelineProvider&&(a._activeTimelineProvider.pause(),a.eventbus.broadcast(A.DURATION,[a._activeTimelineProvider.getDuration()]),a._executeStartActions().then((function(){var t,e;n=null!=(t=n)?t:0,null==(e=a._activeTimelineProvider)||e.seek(n),a._onSeekHandler(Math.floor,{offset:n})})))})),this._activeTimelineProvider.playlistItem(e);case 17:case"end":return t.stop()}}),t,this)})));return function(e,n,i){return t.apply(this,arguments)}}(),e._cleanUpTimeline=function(){return this._executeRelevantActions(this._getActiveActions,"end")},e._executeStartActions=function(){return this._executeRelevantActions(this._getActionsForPosition.bind(this,0),"start")},e._getActionsForPosition=function(t,e){return e.filter((function(e){return!e.active&&e.duration.start<=t&&e.duration.end>=t}))},e._getActiveActions=function(t){return t.filter((function(t){return t.active})).sort((function(t,e){return e.duration.start<t.duration.start?-1:e.duration.start>t.duration.start?1:0}))},e._executeRelevantActions=function(t,e){var n=this._getRelevantTimelineActions(),i=t.apply(this,[n]);return this._executeActions(i,e,0)},e._handleRequestTimelinePosition=function(t,e){var n;e(t((null==(n=this._activeTimelineProvider)?void 0:n.getPosition())||-1))},e._handleTimelineComplete=function(){this._cleanUpTimeline()},e._handleExecuteTimelineAction=function(t,e,n){var i=this._getTimelineActionsForUri(t),r=null==i?void 0:i[e];r&&(n?r.start():r.end())},e._resizeTimelineAction=function(){console.error("no resizing implemented")},e._getRelevantTimelineActions=function(){return this._getTimelineActionsForUri(this._currentTimelineUri)},e._requestCurrentTimeline=function(t){t(this._currentTimelineUri)},e._getTimelineActionsForUri=function(t){var e,n=this.configuration.timelines.find((function(e){return e.uri===t}));return null!=(e=null==n?void 0:n.timelineActions)?e:[]},e._onTimeHandler=function(t,e){if(!isNaN(e.position)){var n,i,r=t(e.position);this._lastPosition!==r&&(this._executeActionsForPosition(r),this.eventbus.broadcast(A.POSITION_UPDATE,[r,null==(i=this._activeTimelineProvider)?void 0:i.getDuration()])),this.eventbus.broadcast(A.TIME_UPDATE,[e.position,null==(n=this._activeTimelineProvider)?void 0:n.getDuration()])}},e._onSeekHandler=function(t,e){var n=this;if(!isNaN(e.offset)){var i=t(e.offset);this._executeSeekActions(i).then((function(){var t;null==(t=n._activeTimelineProvider)||t.start()}))}},e._executeActionsForPosition=function(t){this._lastPosition=t;var e=this._timeLineActionsLookup[this._currentTimelineUri];if(e){var n=e[t];null==n||n.forEach((function(t){t()}))}},e._executeSeekActions=function(t){var e=this,n=this._getRelevantTimelineActions();if(!n)return Promise.resolve();var i=this._getActiveActions(n),r=this._getActionsForPosition(t,n),o=this._executeActions(i,"end",0);return new Promise((function(t){o.then((function(){e._executeActions(r,"start",0).then((function(){t()}))}))}))},t}(),F=function(){function t(){this._actionRegistry={}}var e=t.prototype;return e.registerAction=function(t,e,n){n&&n.length&&(e=e+":"+n),this._actionRegistry[e]||(this._actionRegistry[e]=[]),this._actionRegistry[e].push(t)},e.handleEvent=function(t,e,n){e&&e.length&&(t=t+":"+e);var i=this._actionRegistry[t];if(i){var r={eventArgs:n};i.forEach((function(t){t.start(r)}))}},t}(),H=function(){function t(){this.eventHandlers={},this.eventInterceptors={},this.eventListeners=[],this.clear()}var e=t.prototype;return e.clear=function(){this.eventHandlers={},this.eventListeners=[],this.eventInterceptors={}},e._getEventInterceptors=function(t,e){return e&&e.length&&(t=t+":"+e),this.eventInterceptors[t]||(this.eventInterceptors[t]=[]),this.eventInterceptors[t]},e._getEventHandlers=function(t,e){return e&&e.length&&(t=t+":"+e),this.eventHandlers[t]||(this.eventHandlers[t]=[]),this.eventHandlers[t]},e.on=function(t,e,n){var i=this;return this._getEventHandlers(t,n).push(e),function(){i.off(t,e,n)}},e.once=function(t,e,n){var i=this;this.on(t,(function r(){e.apply(void 0,arguments),i.off(t,r,n)}),n)},e.off=function(t,e,n){var i=this._getEventHandlers(t,n);if(i){var r=i.indexOf(e);r>-1&&i.splice(r,1)}},e.broadcast=function(t,e){this._callHandlers(t,void 0,e)},e.broadcastForTopic=function(t,e,n){this._callHandlers(t,e,n)},e.registerEventlistener=function(t){this.eventListeners.push(t)},e.registerInterceptor=function(t,e,n){this._getEventInterceptors(t,n).push(e)},e._callHandlers=function(t,e,n){void 0===n&&(n=[]);var i,r=this._getEventHandlers(t,e);r&&(this._getEventInterceptors(t,e).forEach((function(t){n=t.intercept(n)})),this.eventListeners.forEach((function(i){i.handleEvent(t,e,n)})),null!=(i=n)&&i.length?r.forEach((function(t){return t.apply(void 0,n)})):r.forEach((function(t){return t()})))},t}(),M=function(){function t(t){this.eventbus=void 0,this.eventbus=t}return t.prototype.intercept=function(t){return this.eventbus.broadcast(A.BEFORE_REQUEST_TIMELINE_URI,t.slice()),t},t}(),j={__proto__:null,ActionRegistryEventbusListener:F,Eventbus:H,RequestVideoUriInterceptor:M},G=function(){function t(t,e,n){if(this._currentLanguage=void 0,this._eventbus=void 0,this._labelLookup={},this._eventbusListeners=[],this._currentLanguage=t,this._eventbus=n,!t||!t.length)throw new Error("language ctor arg cannot be null or have zero length");if(!e)throw new Error("labels ctor arg cannot be null");if(!n)throw new Error("eventbus ctor arg cannot be null");this._setRootElementLang(t),this._createLabelLookup(e),this._addEventbusListeners(n)}var e=t.prototype;return e._addEventbusListeners=function(t){this._eventbusListeners.push(t.on(A.REQUEST_LABEL_COLLECTION,this._handleRequestLabelCollection.bind(this))),this._eventbusListeners.push(t.on(A.REQUEST_LABEL_COLLECTIONS,this._handleRequestLabelCollections.bind(this))),this._eventbusListeners.push(t.on(A.REQUEST_CURRENT_LANGUAGE,this._handleRequestCurrentLanguage.bind(this))),this._eventbusListeners.push(t.on(A.LANGUAGE_CHANGE,this._handleLanguageChange.bind(this)))},e._handleRequestCurrentLanguage=function(t){t(this._currentLanguage)},e._handleRequestLabelCollection=function(t,e){e(this._labelLookup[t])},e._handleRequestLabelCollections=function(t,e){var n=this;e(t.map((function(t){return n._labelLookup[t]})))},e._handleLanguageChange=function(t){t&&t.length?(this._currentLanguage=t,this._setRootElementLang(this._currentLanguage)):console.error("Language cannot be changed to null or empty string")},e._setRootElementLang=function(t){var e=this;this._eventbus.broadcast(A.REQUEST_ENGINE_ROOT,[function(n){var i=e._extractLanguageFromCulture(t);a.default(n).attr("lang",i)}])},e._extractLanguageFromCulture=function(t){return t.indexOf("-")>-1?t.split("-").shift():t},e._createLabelLookup=function(t){var e=this;t.forEach((function(t){e._labelLookup[t.id]=t.labels}))},t}(),z=function(){function t(t,e,n){this.resizeTimeout=-1,this.actionsLookup={},this.importer=void 0,this.eventbus=void 0,this.importer=t,this.eventbus=n||new H,this.eventbus.on(A.REQUEST_INSTANCE,this._requestInstanceHandler.bind(this)),this.eventbus.on(A.REQUEST_ACTION,this._requestActionHandler.bind(this)),this.eventbus.on(A.REQUEST_FUNCTION,this._requestFunctionHandler.bind(this)),a.default(e).resize(this._resizeHandler.bind(this))}var e=t.prototype;return e.destroy=function(){this.eventbus.clear()},e._resizeHandler=function(){var t=this;this.resizeTimeout&&clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout((function(){t.eventbus.broadcast(A.RESIZE)}),200)},e._importSystemEntryWithEventbusDependency=function(t){return new(this._importSystemEntry(t))(this.eventbus)},e._importSystemEntry=function(t){return this.importer.import(t)[t]},e._requestInstanceHandler=function(t,e){e(this._importSystemEntryWithEventbusDependency(t))},e._requestFunctionHandler=function(t,e){e(this._importSystemEntry(t))},e._requestActionHandler=function(t,e){var n=this.actionsLookup[t];n?e(n):(console.error("Unknown action: "+t),e(null))},e.createEngine=function(t,e){var n,i=this,r=this._importSystemEntry(t.engine.systemName),o=void 0;null!=(n=t.eventActions)&&n.length&&(o=new F,this.eventbus.registerEventlistener(o)),this.eventbus.registerInterceptor(A.REQUEST_TIMELINE_URI,new M(this.eventbus));var s=(e=e||new _(this.importer,this.eventbus)).process(t,o),a=s[1];this.actionsLookup=s[0];var l=this._createTimelineProviders(a,this.eventbus),c=new G(t.language,t.labels,this.eventbus),h=new r(a,this.eventbus,l,c);return u.default.bind("space",(function(t){return t.preventDefault(),i.eventbus.broadcast(A.PLAY_TOGGLE_REQUEST),!1})),h},e._createTimelineProviders=function(t,e){var n=this;return Object.entries(t.timelineProviderSettings).reduce((function(i,r){var o=r[0],s=r[1];if(!s)return i;var a=n._importSystemEntry(s.systemName);return i[o]={id:s.id,vendor:s.vendor,provider:new a(e,t)},i}),{})},t}(),V=function(t){return t.selectedElement.addClass(t.className),t},B=function(t,e){return e.data(t)}.bind(null,"eligiusEngineControllers");function K(t,e){return Object.assign(t,e)}function Y(t,e,n){t(n?K(e,n):e)}var W=function(t){var e,n,i=t.controllerInstance;n=i,(e=t.selectedElement).data("eligiusEngineControllers")||e.data("eligiusEngineControllers",[]),B(e).push(n),i.init(t);var r=i.attach(this.eventbus);return r?new Promise((function(e,n){r.then((function(n){Y(e,t,n)}),n)})):t},J=function(t){var e=t.animationEasing,n=t.selectedElement,i=t.animationProperties,r=t.animationDuration;return new Promise((function(o,s){try{e?n.animate(i,r,e,(function(){Y(o,{},t)})):n.animate(i,r,(function(){Y(o,{},t)}))}catch(t){s(t)}}))},Z=function(t){var e=t.selectedElement,n=t.className,i=t.removeClass;i=void 0===i||i;var r=new Promise((function(r,o){try{e.one("webkitAnimationEnd oanimationend oAnimationEnd msAnimationEnd animationEnd",(function(){i&&e.removeClass(n),Y(r,{},t)}))}catch(t){o(t)}}));return e.addClass(n),r};function X(t,e){if("string"==typeof e&&e.toLowerCase().startsWith("operationdata.")){var n=e.split(".");return n.shift(),E(n,t)}return e}var $=function(t){var e=t.eventTopic,n=t.eventName,i=function(t,e){if(e){var n=X.bind(null,t);return e.map(n)}}(t,t.eventArgs);return e?this.eventbus.broadcastForTopic(n,e,i):this.eventbus.broadcast(n,i),function(t){delete t.eventName,delete t.eventTopic,delete t.eventArgs}(t),t},tt=function(t){return t.selectedElement.empty(),t},et=function(t){var e=t.properties;return e?(e.forEach((function(e){delete t[e]})),delete t.properties,t):{}},nt=[];function it(t,e){var n=e!==t?l(e):e;return rt(e,n,X.bind(null,t)),n}function rt(t,e,n){if(!(nt.indexOf(t)>-1)){nt.push(t);try{Object.entries(t).forEach((function(t){var i=t[1];i instanceof a.default||("string"==typeof i?e[t[0]]=n(i):Array.isArray(i)?i.forEach((function(t,e,i){"string"==typeof t?i[e]=n(t):rt(t,t,n)})):"object"==typeof i&&rt(i,i,n))}))}finally{var i=nt.indexOf(t);nt.splice(i,1)}}}var ot=function(t){var e=(t=it(t,t)).elementName,n=t.attributes,i=t.text,r=t.propertyName,o=void 0===r?"template":r,s=n?" "+Object.entries(n).map((function(t){return t[0]+'="'+t[1]+'"'})).join(" "):"",u=a.default(i?"<"+e+s+">"+i+"</"+e+">":"<"+e+s+"/>");return t[o]=u,delete t.propertyName,t},st=function(t){var e=this,n=t.systemName;return new Promise((function(i,r){e.eventbus.broadcast(A.REQUEST_FUNCTION,[n,function(n){var o=n(t,e.eventbus);o?o.then((function(){Y(i,{},t)}),r):Y(i,{},t)}])}))},at=function(t){var e=t.actionInstance,n=t.actionOperationData;return delete t.actionOperationData,new Promise((function(i,r){t=K(t,n),e.end(t).then((function(){Object.keys(n).forEach((function(e){delete t[e]})),Y(i,t)}),r)}))},ut=function(t){var e=this;return e.skipNextOperation?delete e.skipNextOperation:void 0!==e.loopIndex&&void 0!==e.loopLength&&e.loopIndex<e.loopLength?(e.loopIndex=e.loopIndex+1,e.newIndex=e.startIndex):(delete e.loopIndex,delete e.loopLength,delete e.startIndex,delete e.newIndex),t},lt=function(t){return t.controllerInstance=Object.assign(t.controllerInstance,t.controllerExtension),t},ct=function(t){var e=t.controllerName,n=B(t.selectedElement).find((function(t){return t.name===e}));return n||console.warn("controller for name '"+e+"' was not found on the given element"),t.controllerInstance=n,t},ht=function(t){var e=t.systemName,n=t.propertyName,i=void 0===n?"controllerInstance":n;return t[i]=null,this.eventbus.broadcast(A.REQUEST_INSTANCE,[e,function(e){t[i]=e}]),delete t.propertyName,t},dt=function(t){var e,n,i=t.selectedElement,r=t.modifier,o={width:null!=(e=i.innerWidth())?e:0,height:null!=(n=i.innerHeight())?n:0};return 0===o.height&&(o.height=o.width),r&&function(t,e){var n=null;if(e.indexOf("|")>-1){var i=e.split("|");e=i[0],n=i[1]}var r=e.substring(0,1),o=function(t){var e=1,n=t.substring(t.length-1,1);"h"!==n&&"w"!==n&&"%"!==n&&(n=null);var i="%"===n;return i&&"h"!==(n=t.substring(t.length-(e=2),1))&&"w"!==n&&(n=null,e=1),[n,e,i]}(e),s=o[0],a=o[2],u=parseInt(e.substring(1,null!==s?e.length-o[1]-1:e.length),10),l=u,c=u;a&&(l=t.width/100*u,c=t.height/100*u),t=function(t,e,n,i,r){switch(e){case"+":switch(n){case"h":t.height+=r;break;case"w":t.width+=i;break;default:t.height+=r,t.width+=i}break;case"-":switch(n){case"h":t.height-=r;break;case"w":t.width-=i;break;default:t.height-=r,t.width-=i}break;case"/":switch(n){case"h":t.height/=r;break;case"w":t.width/=i;break;default:t.height/=r,t.width/=i}break;case"*":switch(n){case"h":t.height*=r;break;case"w":t.width*=i;break;default:t.height*=r,t.width*=i}break;default:console.error("Unknown operator found: "+e)}return t}(t,r,s,l,c),n&&function(t,e){var n=t.substring(0,1),i=t.substring(t.indexOf("[")+1,t.indexOf("]")-t.indexOf("[")-1).split("=")[1].split("-");"h"===n?e.height=e.width/+i[0]*+i[1]:"w"===n&&(e.width=e.height/+i[1]*+i[0])}(n,t)}(o,r),t.dimensions=o,t},pt=function(t){return this.eventbus.broadcast(A.REQUEST_FUNCTION,[t.systemName,function(e){t.importedInstance=e}]),delete t.systemName,t},vt={},ft=function(t){var e=t.url,n=t.propertyName,i=void 0===n?"json":n;return t.cache&&vt[e]?(t[i]=vt[e],delete t.propertyName,t):new Promise((function(n,r){fetch(e).then(function(){var r=d(N.mark((function r(o){var s;return N.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,o.json();case 2:s=t[i]=r.sent,delete t.propertyName,vt[e]=s,n(t);case 7:case"end":return r.stop()}}),r)})));return function(t){return r.apply(this,arguments)}}()).catch(r)}))},mt=function(t){return console.group("Operation info"),console.dir({context:this}),console.dir({operationData:t}),console.groupEnd(),t},gt=function(t){return t.selectedElement.removeClass(t.className),t},Et=function(t){var e=t.controllerName,n=B(t.selectedElement),i=null==n?void 0:n.find((function(t){return t.name===e}));if(i){var r=n.indexOf(i);n.splice(r,1),i.detach(this.eventbus)}return t},_t=function(t){return t.selectedElement.remove(),t},bt=function(t){return t.propertyNames.forEach((function(e){delete t[e]})),delete t.propertyNames,t},yt=function(t){var e=t.newParentSelector;return t.selectedElement.remove().appendTo(e),t},Tt=function(t){return this.eventbus.broadcast(A.REQUEST_ACTION,[t.systemName,function(e){t.actionInstance=e}]),t},Lt=function(t){var e=t.actionInstance;return t=K(t,t.actionOperationData),e.resize?e.resize(t):t};function It(t,e,n,i){var r=t.find(e);r.length||console.warn("selector '"+e+"' wasn't found!"),n[i]=r,n.hasOwnProperty("propertyName")&&delete n.propertyName}var xt=function(t){var e=t.selector,n=t.propertyName,i=void 0===n?"selectedElement":n,r=t.useSelectedElementAsRoot,o=void 0!==r&&r;if(!e)throw new Error("selector is undefined!");return o&&t[i]?(It(t[i],e,t,i),t):(this.eventbus.broadcast(A.REQUEST_ENGINE_ROOT,[function(n){It(n,e,t,i)}]),t)},wt=function(t){var e=t.selectedElement;return Object.entries(t.attributes).forEach((function(t){e.attr(t[0],t[1])})),t},Pt=function(t){var e=t.insertionType,n=void 0===e?"overwrite":e,i=t.selectedElement,r=t.template;switch(!0){case"overwrite"===n:i.html(r);break;case"append"===n:i.append(r);break;case"prepend"===n:i.prepend(r)}return delete t.insertionType,t},Nt=function(t){var e=t.override,n=void 0!==e&&e,i=t.properties;delete t.properties,delete t.override;var r=it(t,i);return n?r:Object.assign(t,r)},At=function(t){var e=t.propertyName,n=void 0===e?"selectedElement":e,i=it(t,t.properties);return t[n].css(i),delete t.propertyName,t},St=function(t){var e=t.actionInstance,n=t.actionOperationData;return delete t.actionOperationData,new Promise((function(i,r){t=K(t,n),e.start(t).then((function(){Object.keys(n).forEach((function(e){delete t[e]})),Y(i,t)}),r)}))},Ot=function(t){var e=this,n=t.collection,i=t.propertyName,r=void 0===i?"currentItem":i;if("string"==typeof n)throw new Error("Expected collection to be array type, string value was probably not resolved correctly");return void 0===e.loopIndex&&(null!=n&&n.length?(e.loopIndex=0,e.loopLength=n.length-1,e.startIndex=e.currentIndex):e.skipNextOperation=!0),null!=n&&n.length&&void 0!==e.loopIndex&&(t[r]=n[e.loopIndex]),delete t.propertyName,t},Rt=function(t){return t.selectedElement.toggleClass(t.className),t},Ut=function(t){return t.selectedElement.toggle(),t},Dt=function(t){var e=t.milliseconds;return new Promise((function(n){setTimeout((function(){Y(n,t)}),e)}))},Ct={__proto__:null,addClass:V,addControllerToElement:W,animate:J,animateWithClass:Z,broadcastEvent:$,clearElement:tt,clearOperationData:et,createElement:ot,customFunction:st,endAction:at,endLoop:ut,extendController:lt,getControllerFromElement:ct,getControllerInstance:ht,getElementDimensions:dt,getImport:pt,loadJSON:ft,log:mt,removeClass:gt,removeControllerFromElement:Et,removeElement:_t,removePropertiesFromOperationData:bt,reparentElement:yt,requestAction:Tt,resizeAction:Lt,selectElement:xt,setElementAttributes:wt,setElementContent:Pt,setOperationData:Nt,setStyle:At,startAction:St,startLoop:Ot,toggleClass:Rt,toggleElement:Ut,wait:Dt},kt=function(){function t(t,e){this.eventbus=void 0,this.config=void 0,this._paused=!1,this._player=null,this._currentLoopHandler=null,this._eventbusListeners=[],this._playlist=[],this._videoElementId=r.v4(),this.loop=!1,this.eventbus=t,this.config=e,this._addEventListeners()}var e=t.prototype;return e._extractUrls=function(t){return t.timelines.filter((function(t){return"mediaplayer"===t.type})).map((function(t){return t.uri}))},e.init=function(){var t=this,e=this.config.timelineProviderSettings.mediaplayer;if(!e)throw new Error("No settings found for 'mediaplayer' timeline provider");var n=e.selector,i=this._extractUrls(this.config),r=window.jwplayer,o=a.default("#"+n);if(!o.length)throw new Error("videoplayer selector '"+n+"' not found");var s=o.innerWidth(),u=o.innerHeight();return 0===s&&(s=100),0===u&&(u=300),this._player=r(n),this._player.setup({file:i[0],image:e.poster,height:u,width:s,controls:!0,autostart:!1,displaytitle:!1,displaydescription:!1,nextUpDisplay:!1,abouttext:"Eligius",aboutlink:"http://www.google.com",stretching:"fill",repeat:!1}),this._playlist.length=0,i.forEach((function(n){t._playlist.push({file:n,title:n,image:e.poster})})),new Promise((function(e){t._player.once("ready",(function(){t._handlePlayerReady(e)})),t._player.load(t._playlist)}))},e._handlePlayerReady=function(t){var e=this;this._player.once("firstFrame",(function(){e._player.pause(),e.eventbus.broadcast(A.DURATION,[e.getDuration()]),t(e)})),this._player.on(A.TIME,this._loopHandler.bind(this,Math.floor)),this._player.on(A.SEEKED,this._seekedHandler.bind(this)),this._player.on(A.COMPLETE,this._handlePlayerComplete.bind(this)),setTimeout((function(){e._player.play()}),10)},e._handlePlayerComplete=function(){this.loop||(this.stop(),this.eventbus.broadcast(A.COMPLETE,[this._player.getPlaylistIndex()]))},e._seekedHandler=function(){this.eventbus.broadcast(A.SEEKED,[this.getPosition(),this.getDuration()])},e.destroy=function(){this._player.remove(),this._eventbusListeners.forEach((function(t){return t()}))},e._loopHandler=function(t,e){var n=t(e.position);this.loop&&n===t(this._player.getDuration()-1)&&this.seek(0)},e._timeResetLoopHandler=function(){this.loop&&this.seek(0)},e._addEventListeners=function(){this._eventbusListeners.push(this.eventbus.on(A.PLAY_TOGGLE_REQUEST,this.toggleplay.bind(this))),this._eventbusListeners.push(this.eventbus.on(A.PLAY_REQUEST,this.start.bind(this))),this._eventbusListeners.push(this.eventbus.on(A.STOP_REQUEST,this.stop.bind(this))),this._eventbusListeners.push(this.eventbus.on(A.PAUSE_REQUEST,this.pause.bind(this))),this._eventbusListeners.push(this.eventbus.on(A.SEEK_REQUEST,this.seek.bind(this))),this._eventbusListeners.push(this.eventbus.on(A.RESIZE_REQUEST,this.resize.bind(this))),this._eventbusListeners.push(this.eventbus.on(A.CONTAINER_REQUEST,this._container.bind(this))),this._eventbusListeners.push(this.eventbus.on(A.DURATION_REQUEST,this.duration.bind(this)))},e._container=function(t){var e="";"html5"!==this._player.getProvider().name&&(e="_wrapper"),t(a.default("#"+this._videoElementId+e))},e.toggleplay=function(){this._paused?this.start():this.pause()},e.start=function(){this._paused=!1,this._player.play(),this.eventbus.broadcast(A.PLAY)},e.stop=function(){this._paused=!1,this._player.stop(),this.eventbus.broadcast(A.STOP)},e.pause=function(){this._paused=!0,this._player.pause(),this.eventbus.broadcast(A.PAUSE)},e.seek=function(t){var e=this._player.getPosition();this._player.seek(t),this.eventbus.broadcast(A.SEEK,[t,e,this._player.getDuration()])},e.resize=function(t,e){this._player.resize(t,e),this.eventbus.broadcast(A.RESIZE,[t,e])},e.duration=function(t){t(Math.floor(this.getDuration()))},e.playlistItem=function(t){var e=this._playlist.findIndex((function(e){return e.file===t}));e>-1&&this._player.playlistItem(e)},e.getPosition=function(){return this._player.getPosition()},e.getPlaylistIndex=function(){return this._player.getPlaylistIndex()},e.getState=function(){return this._player.getState()},e.getDuration=function(){return this._player.getDuration()},e.getMute=function(){return this._player.getMute()},e.getVolume=function(){return this._player.getVolume()},e.setMute=function(t){this._player.setMute(t)},e.setVolume=function(t){this._player.setVolume(t)},t}(),qt=function(){function t(t,e){this.eventbus=void 0,this.config=void 0,this._requestID=-1,this._last=0,this._currentPosition=0,this._updateBound=this._update.bind(this),this._eventbusListeners=[],this._firstFrame=!0,this._currentPlaylistItem=void 0,this._granularity=1e3,this._playlist=void 0,this._containerElement=void 0,this.playState="stopped",this.loop=!1,this.eventbus=t,this.config=e,this.eventbus=t,this.config=e,this._playlist=this._extractPlaylist(e),this._currentPlaylistItem=this._playlist[0]}var e=t.prototype;return e._extractPlaylist=function(t){return t.timelines.filter((function(t){return"animation"===t.type}))},e.playlistItem=function(t){if(null!==t&&t.length&&0!==this._playlist.length){var e=this._playlist.find((function(e){return e.uri===t}));if(!e)throw new Error("Unknown playlist uri: "+t);this._currentPlaylistItem=e,this._firstFrame=!0}},e._addEventListeners=function(){this._eventbusListeners.push(this.eventbus.on(A.PLAY_TOGGLE_REQUEST,this.toggleplay.bind(this))),this._eventbusListeners.push(this.eventbus.on(A.PLAY_REQUEST,this.start.bind(this))),this._eventbusListeners.push(this.eventbus.on(A.STOP_REQUEST,this.stop.bind(this))),this._eventbusListeners.push(this.eventbus.on(A.PAUSE_REQUEST,this.pause.bind(this))),this._eventbusListeners.push(this.eventbus.on(A.SEEK_REQUEST,this.seek.bind(this))),this._eventbusListeners.push(this.eventbus.on(A.RESIZE_REQUEST,this._resize.bind(this))),this._eventbusListeners.push(this.eventbus.on(A.CONTAINER_REQUEST,this._container.bind(this))),this._eventbusListeners.push(this.eventbus.on(A.DURATION_REQUEST,this.requestDurationHandler.bind(this)))},e._update=function(t){if("running"===this.playState){if(!this._last||t-this._last>=this._granularity){if(!this._last&&this._firstFrame&&(this._firstFrame=!1,this.eventbus.broadcast(A.FIRST_FRAME)),this._last=t,this._currentPosition++,this._currentPosition>this._currentPlaylistItem.duration){if(!this.loop)return this.stop(),void this.eventbus.broadcast(A.COMPLETE);this._reset()}this.eventbus.broadcast(A.TIME,[{position:this._currentPosition}]),this.eventbus.broadcast(A.POSITION_UPDATE,[{position:this._currentPosition,duration:this._currentPlaylistItem.duration}])}this._requestID=requestAnimationFrame(this._updateBound)}},e._start=function(){this._requestID&&"running"===this.playState||(this.playState="running",this._requestID=requestAnimationFrame(this._updateBound))},e._reset=function(){this._cancelAnimationFrame(),this._last=0,this._currentPosition=0},e._resize=function(){console.error("Not implemented yet")},e._container=function(t){t(this._containerElement)},e._cancelAnimationFrame=function(){this._requestID&&(cancelAnimationFrame(this._requestID),this._requestID=-1,this._last=0,this._currentPosition=0)},e.init=function(){if(this._addEventListeners(),this._currentPlaylistItem=this._playlist[0],this._containerElement=a.default(this._currentPlaylistItem.selector),!this._containerElement.length)throw new Error("timeline selector '"+this._currentPlaylistItem.selector+"' not found");return new Promise((function(t){t()}))},e.destroy=function(){this.stop(),this._eventbusListeners.forEach((function(t){return t()})),this._containerElement=void 0},e.toggleplay=function(){"running"!==this.playState?this.start():this.pause()},e.start=function(){this._start(),this.eventbus.broadcast(A.PLAY)},e.stop=function(){this._cancelAnimationFrame(),this.playState="stopped",this.eventbus.broadcast(A.STOP)},e.pause=function(){this.playState="paused",this.eventbus.broadcast(A.PAUSE)},e.seek=function(t){t<0||t>this._currentPlaylistItem.duration||(this.eventbus.broadcast(A.SEEK,[t,this._currentPosition,this.getDuration()]),this._currentPosition=t,this.eventbus.broadcast(A.SEEKED,[this._currentPosition,this.getDuration()]),this.eventbus.broadcast(A.TIME,[{position:this.getPosition()}]),this.eventbus.broadcast(A.POSITION_UPDATE,[{position:this._currentPosition,duration:this._currentPlaylistItem.duration}]))},e.getPosition=function(){return this._currentPosition},e.getDuration=function(){return this._currentPlaylistItem.duration},e.requestDurationHandler=function(t){t(this._currentPlaylistItem.duration)},t}(),Qt=Ct,Ft=q,Ht={__proto__:null,JwPlayerTimelineProvider:kt,RequestAnimationFrameTimelineProvider:qt},Mt=j,jt=function(){function t(){this.engines=new Map,this.engines.set("EligiusEngine",Q)}var e=t.prototype;return e.getOperationNames=function(){return Object.keys(Qt)},e.getControllerNames=function(){return Object.keys(Ft)},e.getProviderNames=function(){return Object.keys(Ht)},e.import=function(t){var e,n,i,r,o,s=null!=(e=null!=(n=null!=(i=null!=(r=Qt[t])?r:Ft[t])?i:Ht[t])?n:Mt[t])?e:this.engines.get(t);return(o={})[t]=s,o},t}();exports.Action=c,exports.ActionRegistryEventbusListener=F,exports.ConfigurationResolver=_,exports.EligiusEngine=Q,exports.EndableAction=m,exports.EngineFactory=z,exports.EventListenerController=S,exports.Eventbus=H,exports.JwPlayerTimelineProvider=kt,exports.LabelController=O,exports.LanguageManager=G,exports.LottieController=R,exports.NavigationController=U,exports.ProgressbarController=D,exports.RequestAnimationFrameTimelineProvider=qt,exports.RequestVideoUriInterceptor=M,exports.RoutingController=C,exports.SubtitlesController=k,exports.TimelineAction=g,exports.TimelineEventNames=A,exports.WebpackResourceImporter=jt,exports.addClass=V,exports.addControllerToElement=W,exports.animate=J,exports.animateWithClass=Z,exports.broadcastEvent=$,exports.clearElement=tt,exports.clearOperationData=et,exports.createElement=ot,exports.customFunction=st,exports.endAction=at,exports.endLoop=ut,exports.extendController=lt,exports.getControllerFromElement=ct,exports.getControllerInstance=ht,exports.getElementDimensions=dt,exports.getImport=pt,exports.loadJSON=ft,exports.log=mt,exports.removeClass=gt,exports.removeControllerFromElement=Et,exports.removeElement=_t,exports.removePropertiesFromOperationData=bt,exports.reparentElement=yt,exports.requestAction=Tt,exports.resizeAction=Lt,exports.selectElement=xt,exports.setElementAttributes=wt,exports.setElementContent=Pt,exports.setOperationData=Nt,exports.setStyle=At,exports.startAction=St,exports.startLoop=Ot,exports.toggleClass=Rt,exports.toggleElement=Ut,exports.wait=Dt;
2
2
  //# sourceMappingURL=eligius.cjs.production.min.js.map