text: !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.timelineModule=t():e.timelineModule=t()}(self,(function(){return(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.r(t),e.d(t,{Timeline:()=>ye});var r,o=function(){function e(){var t,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),n=[],(t="_subscriptions")in this?Object.defineProperty(this,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):this[t]=n}var t,r;return t=e,(r=[{key:"on",value:function(e,t){t&&this._subscriptions.push({topic:e,callback:t})}},{key:"off",value:function(e,t){this._subscriptions=this._subscriptions.filter((function(n){return n&&n.callback!=t&&n.topic!=e}))}},{key:"offAll",value:function(){this._subscriptions.length=0}},{key:"emit",value:function(e,t){this._subscriptions.forEach((function(n){n&&n.topic==e&&n.callback&&n.callback(t)}))}}])&&n(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}!function(e){e.None="none",e.Rhomb="rhomb",e.Circle="circle",e.Rect="rect"}(r||(r={}));var s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n;return t=e,n=[{key:"getKeyframeStyle",value:function(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=null;if(e){var a=e;if(void 0!==a[r]){var l=a[r];if(!i)return l;(s=s||[]).push(l)}}if(t&&t.keyframesStyle){var c=t.keyframesStyle;if(void 0!==c[r]){var u=c[r];if(!i)return u;(s=s||[]).push(u)}}var h=n?n.rowsStyle:null;if(h&&h.keyframesStyle){var f=h.keyframesStyle;if(void 0!==f[r]){var _=f[r];if(!i)return _;(s=s||[]).push(_)}}return i&&s&&s.length>0?s[s.length-1]:o}},{key:"getRowStyle",value:function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=null;if(e){var s=e;if(void 0!==s[n]){var a=s[n];if(!o)return a;(i=i||[]).push(a)}}var l=t?t.rowsStyle:null;if(l){var c=l;if(void 0!==c[n]){var u=c[n];if(!o)return u;(i=i||[]).push(u)}}return o&&i&&i.length>0?i[i.length-1]:r}},{key:"keyframeShape",value:function(t,n,o){return e.getKeyframeStyle(t,n,o,"shape",r.Rhomb)}},{key:"keyframeFillColor",value:function(t,n,r){return e.getKeyframeStyle(t,n,r,"fillColor","DarkOrange")}},{key:"keyframeSelectedFillColor",value:function(t,n,r){return e.getKeyframeStyle(t,n,r,"selectedFillColor","red")}},{key:"keyframeStrokeThickness",value:function(t,n,r){return e.getKeyframeStyle(t,n,r,"strokeThickness",.2,!1)}},{key:"keyframeStrokeColor",value:function(t,n,r){return e.getKeyframeStyle(t,n,r,"strokeColor","Black",!1)}},{key:"keyframeSelectedStrokeColor",value:function(t,n,r){return e.getKeyframeStyle(t,n,r,"selectedStrokeColor","Black",!1)}},{key:"getRowHeight",value:function(t,n){return e.getRowStyle(t,n,"height",24)}},{key:"rowGroupHeight",value:function(t,n){return e.getRowStyle(t,n,"groupHeight","auto")}},{key:"groupFillColor",value:function(t,n){return e.getRowStyle(t,n,"groupFillColor")}},{key:"getRowMarginBottom",value:function(t,n){return e.getRowStyle(t,n,"marginBottom",0)}},{key:"getRowFillColor",value:function(t,n){return e.getRowStyle(t,n,"fillColor","#252526")}},{key:"headerHeight",value:function(e){return e?e.headerHeight:30}},{key:"keyframeDraggable",value:function(t,n,r){var o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return e.getKeyframeStyle(t,n,r,"draggable",o,!1)}},{key:"groupDraggable",value:function(t,n){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return e.getRowStyle(t,n,"groupDraggable",r,!1)}}],null&&i(t.prototype,null),n&&i(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var l=[1,2,5,10],c=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n;return t=e,n=[{key:"drawLine",value:function(e,t,n,r,o){e.moveTo(t,n),e.lineTo(r,o)}},{key:"isNumber",value:function(e){return!("number"!=typeof e||isNaN(e)||!Number.isFinite(e))}},{key:"deleteElement",value:function(e,t){var n=e.indexOf(t);return-1!==n?e.splice(n,1):e}},{key:"isOverlap",value:function(e,t,n){return!!n&&n.x<=e&&n.x+n.width>=e&&n.y<=t&&n.y+n.height>=t}},{key:"findGoodStep",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(t<=0||isNaN(t)||!Number.isFinite(t))return t;for(var r=t,o=null,i=e.getPowArgument(t),s=0;s<l.length;s++){var a=l[s],c=a*Math.pow(10,i);if(!n||n%c==0){var u=e.getDistance(t,c);if(0==u||u<=.1&&i>0){o=u,r=c;break}(!o||o>u)&&(o=u,r=c)}}return r}},{key:"keepInBounds",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return e.isNumber(t)&&(e.isNumber(n)&&(t=Math.max(t,n)),e.isNumber(r)&&(t=Math.min(t,r))),t}},{key:"setMinMax",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!n||!t)return t;var o=Math.min(n.getMin?n.getMin():n.min,n.min),i=Math.min(t.getMin?t.getMin():t.min,t.min),s=e.isNumber(o),a=e.isNumber(i);s&&a?t.min=r?Math.min(o,i):Math.max(o,i):s&&(t.min=o);var l=Math.min(n.getMax?n.getMax():n.max,n.max),c=Math.min(t.getMax?t.getMax():t.max,t.max),u=e.isNumber(l),h=e.isNumber(c);return u&&h?t.max=r?Math.max(l,c):Math.min(l,c):u&&(t.max=l),t}},{key:"isRectOverlap",value:function(e,t){return e&&t?e.x>t.x+t.width||t.x>e.x+e.width||e.y<t.y+t.height||t.y<e.y+e.height:(console.log("Rectangles cannot be empty"),!1)}},{key:"getDistance",value:function(e,t,n,r){return null!=n&&null!=r?Math.sqrt(Math.pow(e-n,2)+Math.pow(t-r,2)):Math.abs(e-t)}},{key:"sign",value:function(e){return e>=0?1:-1}},{key:"clearBrowserSelection",value:function(){if(window)if(window.getSelection)window.getSelection().removeAllRanges();else{var e=window.document;e.selection&&e.selection.empty()}}},{key:"getPowArgument",value:function(e){if(!e||0===e||!isFinite(e))return 1;if(e>=10&&e<100)return 1;if(e>=100&&e<1e3)return 2;if(e>=1e3&&e<1e4)return 3;e=Math.abs(e);var t=0,n=this.sign(e);if(e>1){for(;e>=1;)e=Math.floor(e/10),t++;return n*t-1}return e>0?Math.floor(Math.log(e)/Math.log(10)+1)-1:1}}],null&&a(t.prototype,null),n&&a(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var h=function(){function e(){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),(t="_prevented")in this?Object.defineProperty(this,t,{value:false,enumerable:!0,configurable:!0,writable:!0}):this[t]=false}var t,n;return t=e,(n=[{key:"preventDefault",value:function(){this._prevented=!0}},{key:"isPrevented",value:function(){return this._prevented}}])&&u(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function _(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){return d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},d(e,t)}function p(e,t){if(t&&("object"===f(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return v(e)}function v(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var g,b=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}(i,e);var t,n,r,o=(n=i,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=y(n);if(r){var o=y(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return p(this,e)});function i(){var e;_(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return m(v(e=o.call.apply(o,[this].concat(n))),"val",void 0),m(v(e),"prevVal",void 0),m(v(e),"target",void 0),m(v(e),"source",void 0),e}return t=i,Object.defineProperty(t,"prototype",{writable:!1}),t}(h);function w(e){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w(e)}function k(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function x(e,t){return x=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},x(e,t)}function S(e,t){if(t&&("object"===w(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return P(e)}function P(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function M(e){return M=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},M(e)}function C(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}!function(e){e.User="user",e.Programmatically="programmatically",e.SetTimeMethod="setTimeMethod"}(g||(g={}));var R=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&x(e,t)}(i,e);var t,n,r,o=(n=i,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=M(n);if(r){var o=M(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return S(this,e)});function i(){var e;k(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return C(P(e=o.call.apply(o,[this].concat(n))),"val",0),C(P(e),"prevVal",0),C(P(e),"source",g.User),e}return t=i,Object.defineProperty(t,"prototype",{writable:!1}),t}(h);function E(e){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E(e)}function T(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function O(e,t){return O=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},O(e,t)}function D(e,t){if(t&&("object"===E(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return z(e)}function z(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function K(e){return K=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},K(e)}function N(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var j=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&O(e,t)}(i,e);var t,n,r,o=(n=i,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=K(n);if(r){var o=K(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return D(this,e)});function i(){var e;T(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return N(z(e=o.call.apply(o,[this].concat(n))),"selected",[]),N(z(e),"changed",[]),e}return t=i,Object.defineProperty(t,"prototype",{writable:!1}),t}(h);function L(e){return L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},L(e)}function A(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function B(e,t){return B=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},B(e,t)}function V(e,t){if(t&&("object"===L(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return W(e)}function W(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function F(e){return F=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},F(e)}function I(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Z=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&B(e,t)}(i,e);var t,n,r,o=(n=i,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=F(n);if(r){var o=F(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return V(this,e)});function i(){var e;A(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return I(W(e=o.call.apply(o,[this].concat(n))),"args",void 0),I(W(e),"pos",void 0),I(W(e),"elements",void 0),I(W(e),"target",void 0),I(W(e),"val",void 0),I(W(e),"snapVal",void 0),I(W(e),"originalVal",void 0),e}return t=i,Object.defineProperty(t,"prototype",{writable:!1}),t}(h);function H(e){return H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},H(e)}function U(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function G(e,t){return G=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},G(e,t)}function X(e,t){if(t&&("object"===H(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Y(e)}function Y(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function q(e){return q=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},q(e)}function J(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Q,$,ee,te,ne,re,oe=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&G(e,t)}(i,e);var t,n,r,o=(n=i,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=q(n);if(r){var o=q(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return X(this,e)});function i(){var e;U(this,i);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return J(Y(e=o.call.apply(o,[this].concat(n))),"args",void 0),J(Y(e),"pos",void 0),J(Y(e),"elements",void 0),J(Y(e),"target",void 0),J(Y(e),"val",void 0),J(Y(e),"prevVal",void 0),J(Y(e),"snapVal",void 0),J(Y(e),"originalVal",void 0),e}return t=i,Object.defineProperty(t,"prototype",{writable:!1}),t}(h);!function(e){e.Selection="selection",e.Pan="pan",e.Zoom="zoom"}(Q||(Q={})),function(e){e.Timeline="timeline",e.Keyframe="keyframe",e.Group="group",e.Row="row"}($||($={})),function(e){e.Alias="alias",e.AllScroll="all-scroll",e.Auto="auto",e.Cell="cell",e.ContextMenu="context-menu",e.ColResize="col-resize",e.Copy="copy",e.Crosshair="crosshair",e.Default="default",e.EResize="e-resize",e.EWResize="ew-resize",e.Grab="grab",e.Grabbing="grabbing",e.Help="help",e.Move="move",e.NResize="n-resize",e.NEResize="ne-resize",e.NESWResize="nesw-resize",e.NSResize="ns-resize",e.NWResize="nw-resize",e.NWSEResize="nwse-resize",e.NoDrop="no-drop",e.None="none",e.NotAllowed="not-allowed",e.Pointer="pointer",e.Progress="progress",e.RowResize="row-resize",e.SResize="s-resize",e.SEResize="se-resize",e.SWResize="sw-resize",e.Text="text",e.WResize="w-resize",e.Wait="wait",e.ZoomIn="zoom-in",e.ZoomOut="zoom-out"}(ee||(ee={})),function(e){e.None="none",e.Triangle="triangle",e.Rect="rect"}(te||(te={})),function(e){e.Normal="normal",e.Append="append",e.Revert="revert"}(ne||(ne={})),function(e){e.Selected="selected",e.TimeChanged="timechanged",e.KeyframeChanged="keyframeChanged",e.DragStarted="dragStarted",e.Drag="drag",e.DragFinished="dragFinished",e.Scroll="scroll",e.DoubleClick="doubleClick",e.MouseDown="mouseDown"}(re||(re={}));var ie={snapAllKeyframesOnMove:!1,snapEnabled:!0,timelineStyle:{width:2,marginTop:15,capWidth:4,capHeight:10,capType:te.Rect,strokeColor:"DarkOrange",fillColor:"DarkOrange"},stepPx:120,stepVal:1e3,stepSmallPx:30,snapStep:200,leftMargin:25,headerFillColor:"#101011",fillColor:"#101011",labelsColor:"#D5D5D5",tickColor:"#D5D5D5",selectionColor:"White",rowsStyle:{height:24,marginBottom:2,fillColor:"#252526",groupFillColor:"#094771",groupHeight:"auto",keyframesStyle:{fillColor:"DarkOrange",shape:r.Rhomb,selectedFillColor:"red",strokeColor:"black",selectedStrokeColor:"black",strokeThickness:.2,draggable:!0}},headerHeight:30,font:"11px sans-serif",zoom:1,zoomSpeed:.1,zoomMin:.1,zoomMax:8,controlKeyIsMetaKey:!1,scrollContainerClass:"scroll-container",groupsDraggable:!0,keyframesDraggable:!0,min:0,max:Number.MAX_VALUE},se={autoPanSpeed:50,scrollByDragSpeed:.12,clickDetectionMs:120,doubleClickTimeoutMs:400,scrollFinishedTimeoutMs:500,autoPanByScrollPadding:10,clickThreshold:3};function ae(e){return ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ae(e)}function le(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ce(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ue(e,t){return ue=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ue(e,t)}function he(e,t){if(t&&("object"===ae(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return fe(e)}function fe(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _e(){return _e="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=de(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},_e.apply(this,arguments)}function de(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=pe(e)););return e}function pe(e){return pe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},pe(e)}function ve(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ye=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ue(e,t)}(l,e);var t,n,o,i,a=(o=l,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=pe(o);if(i){var n=pe(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return he(this,e)});function l(){var e,t,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return le(this,l),ve(fe(n=a.call(this)),"_container",null),ve(fe(n),"_canvas",null),ve(fe(n),"_scrollContainer",null),ve(fe(n),"_scrollContent",null),ve(fe(n),"_ctx",null),ve(fe(n),"_options",null),ve(fe(n),"_startPos",null),ve(fe(n),"_scrollStartPos",{x:0,y:0}),ve(fe(n),"_currentPos",null),ve(fe(n),"_selectionRect",null),ve(fe(n),"_selectionRectEnabled",!1),ve(fe(n),"_drag",null),ve(fe(n),"_startedDragWithCtrl",!1),ve(fe(n),"_startedDragWithShiftKey",!1),ve(fe(n),"_clickTimeout",0),ve(fe(n),"_lastClickTime",0),ve(fe(n),"_lastClickPoint",null),ve(fe(n),"_consts",se),ve(fe(n),"_clickAllowed",!1),ve(fe(n),"_scrollFinishedTimerRef",null),ve(fe(n),"_val",0),ve(fe(n),"_pixelRatio",1),ve(fe(n),"_currentZoom",0),ve(fe(n),"_intervalRef",null),ve(fe(n),"_autoPanLastActionDate",0),ve(fe(n),"_isPanStarted",!1),ve(fe(n),"_interactionMode",Q.Selection),ve(fe(n),"_lastUsedArgs",null),ve(fe(n),"_model",null),ve(fe(n),"_handleKeyUp",(function(e){n._interactionMode===Q.Zoom&&n._setZoomCursor(e)})),ve(fe(n),"_handleKeyDown",(function(e){n._interactionMode===Q.Zoom&&n._setZoomCursor(e)})),ve(fe(n),"_handleBlurEvent",(function(){n._cleanUpSelection()})),ve(fe(n),"_handleWindowResizeEvent",(function(){n.rescale(),n.redraw()})),ve(fe(n),"_handleScrollEvent",(function(e){n._clearScrollFinishedTimer(),n._scrollFinishedTimerRef=window.setTimeout((function(){n._isPanStarted||(n._scrollFinishedTimerRef&&(clearTimeout(n._scrollFinishedTimerRef),n._scrollFinishedTimerRef=null),n.rescale(),n.redraw())}),n._consts.scrollFinishedTimeoutMs),n.redraw(),n._emitScrollEvent(e)})),ve(fe(n),"_handleWheelEvent",(function(e){if(n._controlKeyPressed(e)){e.preventDefault();var t=Math.max(0,n._getMousePos(n._canvas,e).x||0);n._zoom(c.sign(e.deltaY),n._options.zoomSpeed,t)}else e.preventDefault()})),ve(fe(n),"_handleMouseDownEvent",(function(r){var o=Date.now()-n._lastClickTime<n._consts.doubleClickTimeoutMs;if(c.clearBrowserSelection(),n._startPos=n._trackMousePos(n._canvas,r),n._startPos){n._lastClickPoint&&n._startPos&&c.getDistance(n._lastClickPoint.x,n._lastClickPoint.y,n._startPos.x,n._startPos.y)>n._consts.clickThreshold&&(o=!1),n._lastClickPoint=n._startPos,n._scrollStartPos={x:n._scrollContainer.scrollLeft,y:n._scrollContainer.scrollTop},n._clickAllowed=!0;var i=n.elementFromPoint(n._startPos,Math.max(2,n._startPos.radius)),s=n._findDraggable(i,n._startPos.val),a=new Z;if(a.pos=n._startPos,a.val=n._startPos.val,a.originalVal=n._startPos.originalVal,a.snapVal=n._startPos.snapVal,a.args=r,a.elements=i,a.target=s,o)_e((e=fe(n),pe(l.prototype)),"emit",e).call(e,re.DoubleClick,a);else if(_e((t=fe(n),pe(l.prototype)),"emit",t).call(t,re.MouseDown,a),n._clickTimeout=Date.now(),n._lastClickTime=Date.now(),a.isPrevented())n._cleanUpSelection();else{if(n._currentPos=n._startPos,s&&n._interactionMode!==Q.Zoom)if(n._drag={changed:!1,target:n._setElementDragState(s,s.val),val:s.val,type:s.type,elements:[]},s.type===$.Keyframe)n._startedDragWithCtrl=n._controlKeyPressed(r),n._startedDragWithShiftKey=r.shiftKey,s.keyframe.selected||n._controlKeyPressed(r)||n._selectInternal(s.keyframe),n._drag.elements=n.getSelectedElements().map((function(e){return n._setElementDragState(e,e.val)}));else if(s.type===$.Group){var u=n._drag.target.keyframes;u&&Array.isArray(u)&&(n._drag.elements=u.map((function(e){return n._setElementDragState(n._convertToElement(n._drag.target.row,e),e.val)})))}else n._drag.elements=[n._drag.target];n.redraw()}}})),ve(fe(n),"_handleMouseMoveEvent",(function(e){if(e?n._lastUsedArgs=e:e=n._lastUsedArgs,e){var t=e.changedTouches&&e.changedTouches.length>0;n._currentPos=n._trackMousePos(n._canvas,e),!n._isPanStarted&&n._selectionRect&&n._clickTimeoutIsOver()?n._selectionRectEnabled=n._interactionMode!==Q.Zoom:n._selectionRectEnabled=!1,e=e;var r=n.isLeftButtonClicked(e);if(n._startPos)if(r||t){if(n._drag&&!n._startedDragWithCtrl){var o=n._currentPos.val;if(n._drag.type===$.Timeline)n._setTimeInternal(o,g.User);else if((n._drag.type==$.Keyframe||n._drag.type==$.Group)&&n._drag.elements){var i=Math.floor(o-n._drag.val);if(0!==n._moveElements(i,n._drag.elements,g.User)){if(!n._drag.changed&&(n._drag.prevVal=n._drag.val,n._emitDragStartedEvent().isPrevented()))return n._drag=null,void n._cleanUpSelection();n._drag.changed=!0,n._drag.val+=i,n._emitDragEvent()}}}n._interactionMode!==Q.Pan||n._drag?n._scrollBySelectionOutOfBounds(n._currentPos):(n._isPanStarted=!0,n._setCursor(ee.Grabbing),n._scrollByPan(n._startPos,n._currentPos,n._scrollStartPos)),n.redraw()}else n._cleanUpSelection(),n.redraw();else if(!t){var s=n.elementFromPoint(n._currentPos,Math.max(2,n._currentPos.radius)),a=n._findDraggable(s,n._currentPos.val);if(n._isPanStarted||n._interactionMode===Q.Pan)r?n._setCursor(ee.Grabbing):n._setCursor(ee.Grab);else{if(n._interactionMode===Q.Zoom)return void n._setZoomCursor(e);n._setCursor(ee.Default)}if(a){var l=null;a.type===$.Group?l=l||ee.EWResize:a.type==$.Keyframe?l=l||ee.Pointer:a.type==$.Timeline&&(l=l||ee.EWResize),l&&n._setCursor(l)}}t&&e.preventDefault()}})),ve(fe(n),"_handleMouseUpEvent",(function(e){if(n._startPos){var t=n._trackMousePos(n._canvas,e);if(n._clickAllowed||!n._clickTimeoutIsOver()||n._drag&&(n._startedDragWithCtrl||n._startedDragWithShiftKey))if(n._options&&n._interactionMode===Q.Zoom){var r=n._controlKeyPressed(e)?1:-1,o=Math.max(0,n._getMousePos(n._canvas,e).x||0);n._zoom(r,n._options.zoomSpeed,o)}else n._performClick(t,n._drag);else if(!n._drag&&n._selectionRect&&n._selectionRectEnabled)if(n._interactionMode===Q.Zoom)n._selectionRect.width;else{var i=n._getKeyframesByRectangle(n._selectionRect),s=e.shiftKey?ne.Append:ne.Normal;n.select(i,s)}n._cleanUpSelection(),n.redraw()}})),ve(fe(n),"_redrawInternal",(function(){n._ctx&&(n.valToPx(n._val)>n._scrollContainer.scrollWidth&&(n.rescale(),!n._isPanStarted&&n._drag&&n._drag.type!==$.Timeline&&n.scrollLeft()),n._renderBackground(),n._renderRows(),n._renderHeaderBackground(),n._renderTicks(),n._renderKeyframes(),n._renderSelectionRect(),n._renderTimeline())})),(r||o)&&n.initialize(r,o),n}return t=l,n=[{key:"initialize",value:function(e,t){if(this._model=t,!e||!e.id)throw new Error("Element cannot be empty. Should be string or DOM element.");this._generateContainers(e.id),this._options=this._setOptions(e),this._subscribeOnEvents(),this.rescale(),this.redraw()}},{key:"_generateContainers",value:function(e){if(e instanceof HTMLElement?this._container=e:this._container=document.getElementById(e),!this._container)throw new Error("Element cannot be empty. Should be string or DOM element.");if(this._scrollContainer=document.createElement("div"),this._scrollContent=document.createElement("div"),this._canvas=document.createElement("canvas"),!this._canvas||!this._canvas.getContext)return console.log("Cannot initialize canvas context."),null;this._container.style.position="relative",this._canvas.style.cssText="image-rendering: -moz-crisp-edges;image-rendering: -webkit-crisp-edges;image-rendering: pixelated;image-rendering: crisp-edges;user-select: none;-webkit-user-select: none;-khtml-user-select: none;-moz-user-select: none;-o-user-select: none;user-select: none;touch-action: none;position: relative;-webkit-user-drag: none;-khtml-user-drag: none;-moz-user-drag: none;-o-user-drag: none;user-drag: none;padding: inherit",this._scrollContainer.style.cssText="overflow-y: hidden;overflow-x: scroll;position: absolute;width:  100%;height:  100%;",this._scrollContent.style.width=this._scrollContent.style.height="100%",this._scrollContainer.appendChild(this._scrollContent),this._container.appendChild(this._scrollContainer);var t=this._scrollContainer.offsetWidth-this._scrollContent.clientWidth;this._canvas.style.width=this._canvas.style.height="calc(100% -"+(t||17)+"px)",this._container.appendChild(this._canvas),this._ctx=this._canvas.getContext("2d")}},{key:"_subscribeOnEvents",value:function(){this._container.addEventListener("wheel",this._handleWheelEvent),this._scrollContainer&&this._scrollContainer.addEventListener("scroll",this._handleScrollEvent),document.addEventListener("keyup",this._handleKeyUp,!1),document.addEventListener("keydown",this._handleKeyDown,!1),window.addEventListener("blur",this._handleBlurEvent,!1),window.addEventListener("resize",this._handleWindowResizeEvent,!1),this._canvas.addEventListener("touchstart",this._handleMouseDownEvent,!1),this._canvas.addEventListener("mousedown",this._handleMouseDownEvent,!1),window.addEventListener("mousemove",this._handleMouseMoveEvent,!1),window.addEventListener("touchmove",this._handleMouseMoveEvent,!1),window.addEventListener("mouseup",this._handleMouseUpEvent,!1),window.addEventListener("touchend",this._handleMouseUpEvent,!1)}},{key:"dispose",value:function(){this.offAll(),this._container=null,this._canvas=null,this._scrollContainer=null,this._scrollContent=null,this._ctx=null,this._cleanUpSelection(),this._container.removeEventListener("wheel",this._handleWheelEvent),this._scrollContainer&&this._scrollContainer.removeEventListener("scroll",this._handleScrollEvent),window.removeEventListener("blur",this._handleBlurEvent),window.removeEventListener("resize",this._handleWindowResizeEvent),document.removeEventListener("keydown",this._handleKeyDown),document.removeEventListener("keyup",this._handleKeyUp),this._canvas.removeEventListener("touchstart",this._handleMouseDownEvent),this._canvas.removeEventListener("mousedown",this._handleMouseDownEvent),window.removeEventListener("mousemove",this._handleMouseMoveEvent),window.removeEventListener("touchmove",this._handleMouseMoveEvent),window.removeEventListener("mouseup",this._handleMouseUpEvent),window.removeEventListener("touchend",this._handleMouseUpEvent),this._stopAutoPan(),this._clearScrollFinishedTimer()}},{key:"_setZoomCursor",value:function(e){this._controlKeyPressed(e)?this._setCursor(ee.ZoomOut):this._setCursor(ee.ZoomIn)}},{key:"_clearScrollFinishedTimer",value:function(){this._scrollFinishedTimerRef&&(clearTimeout(this._scrollFinishedTimerRef),this._scrollFinishedTimerRef=null)}},{key:"_controlKeyPressed",value:function(e){return this._options&&void 0!==this._options.controlKeyIsMetaKey?this._options.controlKeyIsMetaKey||this._options.controlKeyIsMetaKey?e.metaKey:e.ctrlKey:e.metaKey||e.ctrlKey}},{key:"_zoom",value:function(e,t,n){if(t>0&&t<=1){n+=.2*c.getDistance(this._width()/2,n);var r=this._width()/n,o=this._fromScreen(n),i=e*this._currentZoom*t;this._currentZoom=this._setZoom(this._currentZoom+i);var s=this.valToPx(o),a=Math.round(s-this._width()/r);a<=0&&(a=0),this._rescaleInternal(a+this._width(),null,"zoom"),this._scrollContainer.scrollLeft!=a&&(this._scrollContainer.scrollLeft=a),this.redraw()}}},{key:"zoomIn",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._options.zoomSpeed;this._zoom(1,e,this._scrollContainer.clientWidth/2)}},{key:"zoomOut",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._options.zoomSpeed;this._zoom(-1,e,this._scrollContainer.clientWidth/2)}},{key:"_setZoom",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t=c.isNumber(t)?t:this._options?this._options.zoomMin:null,n=c.isNumber(n)?n:this._options?this._options.zoomMax:null,c.isNumber(e)?(e=(e=c.keepInBounds(e,t,n))||1,this._currentZoom=e,e):e}},{key:"setZoom",value:function(e){var t=this.getZoom();if(t!==e){var n=this._setZoom(e);if(t!=n)return this.rescale(),this.redraw(),n}return t}},{key:"getZoom",value:function(){return c.isNumber(this._currentZoom)&&this._currentZoom||1}},{key:"_setElementDragState",value:function(e,t){var n=e;return n.prevVal=n.val,void 0!==n.startedVal&&null!==n.startedVal||(n.startedVal=t),void 0!==n.prevVal&&null!==n.prevVal||(n.prevVal=t),n.val=t,n}},{key:"isLeftButtonClicked",value:function(e){return!!e&&1==e.buttons}},{key:"_moveElements",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:g.Programmatically;if(t){var o=!1;if(Math.abs(e)>0){var i={min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER};if(i=c.setMinMax(i,this._options),t.forEach((function(t){var r=c.setMinMax(c.setMinMax({min:i.min,max:i.max},t.keyframe),t.row),o=(n._options&&n._options.snapAllKeyframesOnMove?n.snapVal(t.keyframe.val):t.keyframe.val)+e;c.isNumber(r.min)&&o<r.min&&(e+=c.getDistance(r.min,o)),c.isNumber(r.max)&&o>r.max&&(e-=c.getDistance(r.max,o))})),Math.abs(e)>0&&t.forEach((function(t){var i=t.keyframe.val,s=i+e,a=n._setKeyframePos(t,s,r);o=a!==i})),o)return e}return 0}}},{key:"_height",value:function(){return this._canvas?this._canvas.clientHeight:0}},{key:"_width",value:function(){return this._canvas?this._canvas.clientWidth:0}},{key:"_mapKeyframes",value:function(e){var t=[];if(!e)return t;for(var n=0;n<e.length;n++)t.push(e[n].model||e[n].keyframe);return t}},{key:"_getKeyframesByRectangle",value:function(e){var t=[];return this._forEachKeyframe((function(n){c.isOverlap(n.size.x,n.size.y,e)&&t.push(n.model)})),t}},{key:"_performClick",value:function(e,t){var n=!1;if(t&&t.type===$.Keyframe){var r=ne.Normal;(this._startedDragWithCtrl&&this._controlKeyPressed(e.args)||this._startedDragWithShiftKey&&e.args.shiftKey)&&this._controlKeyPressed(e.args)&&(r=ne.Revert),n=this._selectInternal(this._drag.target.keyframe,r).selectionChanged||n,e.args.shiftKey&&(n=this._setTimeInternal(e.val,g.User)||n)}else n=this._selectInternal(null).selectionChanged||n,n=this._setTimeInternal(e.val,g.User)||n;return n}},{key:"_setKeyframePos",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:g.Programmatically;if(!e||!e.keyframe)return t;if(t=Math.floor(t),e.keyframe&&e.keyframe.val!=t){e.prevVal=e.val,e.val=t,e.keyframe.val=t;var r=this._emitKeyframeChanged(e,n);return r.isPrevented()&&(e.val=r.prevVal,e.keyframe.val=r.prevVal),t}return t}},{key:"_setCursor",value:function(e){this._canvas.style.cursor!=e&&(this._canvas.style.cursor=e)}},{key:"setInteractionMode",value:function(e){this._interactionMode!=e&&(this._interactionMode=e,this._cleanUpSelection())}},{key:"getInteractionMode",value:function(){return this._interactionMode}},{key:"_convertToElement",value:function(e,t){return{type:$.Keyframe,val:t.val,keyframe:t,row:e}}},{key:"getSelectedKeyframes",value:function(){return this._mapKeyframes(this.getSelectedElements())}},{key:"getSelectedElements",value:function(){var e=this,t=[];return this._forEachKeyframe((function(n){n&&n.model.selected&&t.push(e._convertToElement(n.parentRow.model,n.model))})),t}},{key:"getAllKeyframes",value:function(){var e=[];return this._forEachKeyframe((function(t){e.push(t.model)})),e}},{key:"selectAllKeyframes",value:function(){return this.select(this.getAllKeyframes(),ne.Normal)}},{key:"deselectAll",value:function(){return this.select(null)}},{key:"_changeNodeState",value:function(e,t,n){if(t.selected!==n){var r="boolean"!=typeof t.selectable||t.selectable;if(!n||n&&r)return t.selected=n,e.changed.push(t),!0}return!1}},{key:"select",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ne.Normal,n=this._selectInternal(e,t);return n.selectionChanged&&this.redraw(),n}},{key:"_selectInternal",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ne.Normal;e||(e=[]),Array.isArray(e)||(e=[e]);var r={selectionChanged:!1,selected:this.getSelectedKeyframes(),changed:[]},o=e;if(this.getSelectedElements(),o&&n===ne.Append)e.forEach((function(e){t._changeNodeState(r,e,!0)&&e.selected&&r.selected.push(e)}));else if(o&&n===ne.Revert)e.forEach((function(e){r.selected.indexOf(e)>=0?(t._changeNodeState(r,e,!1),c.deleteElement(r.selected,e)):(t._changeNodeState(r,e,!0),e.selected&&r.selected.push(e))}));else if(n===ne.Normal){var i=[];e&&e.forEach((function(e){t._changeNodeState(r,e,!0),e.selected&&i.push(e)})),r.selected.forEach((function(e){o.indexOf(e)>=0||t._changeNodeState(r,e,!1)})),r.changed.length>0&&(i?r.selected=i:r.selected.length=0)}return r.changed.length>0&&(r.selectionChanged=!0,this._emitKeyframesSelected(r)),r}},{key:"_forEachKeyframe",value:function(e){if(e&&this._model){var t=this._calculateModel();t&&t.rows.forEach((function(t){if(t){var n=!0;t.keyframes.forEach((function(t,r){t&&e(t,r,n),n=!1}))}}))}}},{key:"_trackMousePos",value:function(e,t){var n=this._getMousePos(e,t);if(n.originalVal=this._mousePosToVal(n.x,!1),n.snapVal=this._mousePosToVal(n.x,!0),n.val=n.originalVal,this._options&&this._options.snapEnabled&&(n.val=n.snapVal),this._startPos){this._selectionRect||(this._selectionRect={});var r=Math.floor(this._startPos.x+(this._scrollStartPos.x-this.getScrollLeft())),o=Math.floor(this._startPos.y+(this._scrollStartPos.y-this.getScrollTop()));this._selectionRect.x=Math.min(r,n.x),this._selectionRect.y=Math.min(o,n.y),this._selectionRect.width=Math.max(r,n.x)-this._selectionRect.x,this._selectionRect.height=Math.max(o,n.y)-this._selectionRect.y,this._clickAllowed&&(this._clickAllowed=this._selectionRect.height<=this._consts.clickThreshold&&this._selectionRect.width<=this._consts.clickThreshold)}return n}},{key:"_cleanUpSelection",value:function(){this._emitDragFinishedEvent(),this._startPos=null,this._drag=null,this._startedDragWithCtrl=!1,this._startedDragWithShiftKey=!1,this._selectionRect=null,this._clickTimeout=null,this._scrollStartPos=null,this._isPanStarted=!1,this._clickAllowed=!1,this._stopAutoPan()}},{key:"_clickTimeoutIsOver",value:function(){return!!(this._clickTimeout&&Date.now()-this._clickTimeout>this._consts.clickDetectionMs)}},{key:"_startAutoPan",value:function(){var e=this;this._consts.autoPanSpeed&&(this._intervalRef||(this._intervalRef=window.setInterval((function(){e._handleMouseMoveEvent(null)}),this._consts.autoPanSpeed)))}},{key:"_stopAutoPan",value:function(){this._intervalRef&&(clearInterval(this._intervalRef),this._intervalRef=null),this._autoPanLastActionDate=null}},{key:"_checkUpdateSpeedTooFast",value:function(){return!!(this._autoPanLastActionDate&&Date.now()-this._autoPanLastActionDate<=10)||(this._autoPanLastActionDate=Date.now(),!1)}},{key:"_scrollByPan",value:function(e,t,n){if(e&&t){var r=Math.round(e.x-t.x),o=n.x+r;r>0&&this._rescaleInternal(o+this._width()),r>0&&o+this._width()>=this._scrollContainer.scrollWidth-5?this._scrollContainer.scrollLeft=this._scrollContainer.scrollWidth:this._scrollContainer.scrollLeft=o,this._scrollContainer.scrollTop=Math.round(n.y+e.y-t.y)}}},{key:"_scrollBySelectionOutOfBounds",value:function(e){var t=e.x,n=e.y,r=!1,o=0,i=0,s=this._consts.autoPanByScrollPadding,a=t<=s,l=t>=this._width()-s,u=n<=s,h=n>=this._height()-s,f=null,_=null;if(a||l||u||h){if(this._startAutoPan(),this._checkUpdateSpeedTooFast())return!1;var d=isNaN(this._consts.scrollByDragSpeed)?1:this._consts.scrollByDragSpeed;a?o=-c.getDistance(t,s)*d:l&&(o=c.getDistance(t,this._width()-s)*d,f=this.getScrollLeft()+this._width()+o),u?i=-c.getDistance(t,s)*d/4:h&&(i=c.getDistance(t,this._height()-s)*d/4,_=this._scrollContainer.scrollTop+this._height())}else this._stopAutoPan();return(f||_)&&this._rescaleInternal(f,_,"scrollBySelection"),Math.abs(o)>0&&(this._scrollContainer.scrollLeft+=o,r=!0),Math.abs(i)>0&&(this._scrollContainer.scrollTop+=i,r=!0),r}},{key:"pxToVal",value:function(e){if(!this._options)return e;var t=this._options.min;c.isNumber(t)||(t=0),t*=this._currentZoom||1;var n=this._options.stepVal*this._currentZoom||1;return t+e/this._options.stepPx*n}},{key:"_toScreenPx",value:function(e){return this.valToPx(e)-this.getScrollLeft()+this._leftMargin()}},{key:"_fromScreen",value:function(e){return this.pxToVal(this.getScrollLeft()+e-this._leftMargin())}},{key:"valToPx",value:function(e){if(!this._options)return e;var t=this._options.min;c.isNumber(t)||(t=0),t*=this._currentZoom||1;var n=this._options.stepVal*this._currentZoom||1;return(-t+e)*(this._options.stepPx/n)}},{key:"snapVal",value:function(e){if(this._options&&this._options.snapEnabled&&this._options.snapStep){var t=this._options.snapStep,n=e/t,r=Math.round(n),o=Math.abs(this._options.min)/this._options.snapStep,i=c.sign(this._options.min)*(o-Math.floor(o))*this._options.snapStep;e=Math.round(i)+Math.round(r*t)}return c.keepInBounds(e,this._options.min,this._options.max)}},{key:"_mousePosToVal",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Math.min(e,this._width()),r=this._fromScreen(n);return r=Math.round(r),t&&(r=this.snapVal(r)),r}},{key:"_formatUnitsText",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=c.sign(e)<0?"-":"",r=(e=Math.abs(e))/1e3;t&&(r=e);var o=0,i=0,s=0,a=0,l="";return o&&(l+=o+":"),i&&(l+=i+":"),s&&(l+=s+":"),a&&(l+=a+":"),isNaN(r)||(l+=r),n+l}},{key:"_leftMargin",value:function(){return this._options&&this._options.leftMargin||0}},{key:"_renderTicks",value:function(){if(this._ctx&&this._options&&this._ctx.canvas&&this._ctx.canvas.clientWidth>0&&this._ctx.canvas.clientHeight>0&&this._options.stepPx){var e=this._width()-this._leftMargin(),t=this.pxToVal(this.getScrollLeft()),n=this.pxToVal(this.getScrollLeft()+e);if(!isNaN(t)&&!isNaN(n)&&t!==n){if(n<t){var r=n;n=t,t=r}var o=c.getDistance(t,n);if(!(o<=0)){var i=c.findGoodStep(o/(e/this._options.stepPx)),a=c.findGoodStep(o/(e/this._options.stepSmallPx)),l=Math.floor(t/i)*i,u=Math.ceil(n/i)*i+i;if(c.isNumber(i)&&!(i<=0)&&0!==Math.abs(u-l)){var h=0;this._ctx.save();for(var f=s.headerHeight(this._options),_=f/2,d=f/1.3,p=l;p<=u;p+=i){var v=this._getSharp(this._toScreenPx(p));this._ctx.save(),this._ctx.beginPath(),this._ctx.setLineDash([4]),this._ctx.lineWidth=1,this._ctx.strokeStyle=this._options.tickColor,c.drawLine(this._ctx,v,_,v,f),this._ctx.stroke(),this._ctx.fillStyle=this._options.labelsColor,this._options.font&&(this._ctx.font=this._options.font);var y=this._formatUnitsText(p),m=this._ctx.measureText(y),g=v-m.width/2;if((isNaN(h)||h<=g)&&(h=g+m.width,this._ctx.fillText(y,g,10)),this._ctx.restore(),c.isNumber(a)&&!(a<=0))for(var b=p+a;b<p+i;b+=a){var w=this._getSharp(this._toScreenPx(b));this._ctx.beginPath(),this._ctx.lineWidth=this._pixelRatio,this._ctx.strokeStyle=this._options.tickColor,c.drawLine(this._ctx,w,d,w,f),this._ctx.stroke()}}this._ctx.restore()}}}}}},{key:"_calculateModel",value:function(){var e=this,t={rows:[],size:{x:0,y:0,width:0,height:0},min:null,max:null,keyframes:[]};if(!this._model)return t;var n=this._model.rows;if(!n||!Array.isArray(n)||n.length<=0)return t;var r=s.headerHeight(this._options);return n.forEach((function(n,o){if(n&&!n.hidden){var i=s.getRowHeight(n,e._options),a=s.getRowMarginBottom(n,e._options),l=r-(e._scrollContainer?e._scrollContainer.scrollTop:0);r+=i+a,0==o&&(t.size.y=l),t.size.height=Math.max(r+i,t.size.height);var u={size:{x:0,y:l,width:e._canvas?e._width():0,height:i},marginBottom:a,model:n,min:null,max:null,groups:[],keyframes:[]};t.rows.push(u),!n.keyframes||!n.keyframes.forEach||n.keyframes.length<=0||(n&&n.keyframes&&n.keyframes.forEach((function(n){if(n&&!isNaN(n.val)&&!n.hidden){for(var r=null,o=0;o<u.groups.length;o++){var i=u.groups[o];if(n.group===i.group){r=i;break}}r||(r={min:null,max:null,group:n.group,keyframes:[]},u.groups.push(r));var s=e._getKeyframePosition(n,u),a={model:n,parentRow:u,parentGroup:r,size:s},l=null==r.min?n.val:Math.min(n.val,r.min),c=null==r.max?n.val:Math.max(n.val,r.max);isNaN(l)||(r.min=l),isNaN(c)||(r.max=c),u.keyframes.push(a),r.keyframes.push(a),t.keyframes.push(a)}})),u.groups.forEach((function(t){c.setMinMax(u,t,!0);var r=e._getKeyframesGroupSize(n,u.size.y,t.min,t.max);t.size=r})),c.setMinMax(t,u,!0))}})),c.isNumber(t.max)&&(t.size.width=this.valToPx(t.max)),t}},{key:"_renderRows",value:function(){var e=this,t=this._calculateModel();t&&t.rows&&(this._ctx.save(),t.rows.forEach((function(t){if(t){e._ctx.fillStyle=s.getRowFillColor(t.model,e._options);var n=e._cutBounds(t.size);n&&e._ctx.fillRect(n.x,n.y,n.width,n.height);var r=s.groupFillColor(t.model,e._options);t.groups&&t.groups.forEach((function(t){var n=e._cutBounds(t.size);n&&(e._ctx.fillStyle=r,e._ctx.fillRect(n.x,n.y,n.width,n.height))}))}})),this._ctx.restore())}},{key:"_cutBounds",value:function(e){if(!e)return null;var t=this._width(),n=s.headerHeight(this._options),r=this._width();if(c.isRectOverlap(e,{x:0,y:n,width:c.getDistance(0,t),height:c.getDistance(n,r)})){var o=Math.max(e.y,n),i=Math.max(e.x,0),a=e.x-i,l=e.y-o;return{height:e.height+l,width:e.width+a,x:i,y:o,overlapY:Math.abs(l)>0,overlapX:Math.abs(a)>0}}return null}},{key:"_getKeyframesGroupSize",value:function(e,t,n,r){var o=s.rowGroupHeight(e,this._options),i=s.getRowHeight(e,this._options);(!o&&0!==o||isNaN(o)||"auto"==o)&&(o=Math.floor(.7*i)),o>i&&(o=i);var a=i-o,l=this._toScreenPx(n),u=this._toScreenPx(r);return{x:l,y:t+Math.floor(a/2),height:o,width:c.getDistance(l,u)}}},{key:"_getKeyframePosition",value:function(e,t){if(!e)return console.log("keyframe should be defined."),null;var n=e.val;if(isNaN(n))return null;var r=t.size,o=r.y+r.height/2,i=s.getKeyframeStyle(e,t.model,this._options,"height","auto"),a=s.getKeyframeStyle(e,t.model,this._options,"width","auto");return"auto"==i&&(i=r.height/3),"auto"==a&&(a=i),i>0&&!isNaN(n)?{x:Math.floor(this._toScreenPx(n)),y:Math.floor(o),height:i,width:a}:null}},{key:"_renderKeyframes",value:function(){var e=this;this._forEachKeyframe((function(t){var n=t.parentRow.model,o=t.size,i=t.model;if(o){var a=e._getSharp(o.x),l=o.y,c=e._cutBounds({x:a-o.width/2,y:l-o.height/2,width:o.width,height:o.height});if(!c)return;e._ctx.save(),c&&c.overlapY&&(e._ctx.beginPath(),e._ctx.rect(0,s.headerHeight(e._options),e._width(),e._width()),e._ctx.clip());var u=s.keyframeShape(i,n,e._options);if(u===r.None)return;var h=i.selected?s.keyframeSelectedFillColor(i,n,e._options):s.keyframeFillColor(i,n,e._options),f=s.keyframeStrokeThickness(i,n,e._options),_="";f>0&&(_=i.selected?s.keyframeSelectedStrokeColor(i,n,e._options):s.keyframeStrokeColor(i,n,e._options)),u==r.Rhomb?(e._ctx.beginPath(),e._ctx.translate(a,l),e._ctx.rotate(45*Math.PI/180),f>0&&_&&(e._ctx.fillStyle=_,e._ctx.rect(-o.width/2,-o.height/2,o.width,o.height),e._ctx.fill()),e._ctx.fillStyle=h,e._ctx.translate(f,f),e._ctx.rect(-o.width/2,-o.height/2,o.width-2*f,o.height-2*f),e._ctx.fill()):u==r.Circle?(e._ctx.beginPath(),f>0&&_&&(e._ctx.fillStyle=_,e._ctx.arc(a,l,o.height,0,2*Math.PI)),e._ctx.fillStyle=h,e._ctx.arc(a,l,o.height-f,0,2*Math.PI),e._ctx.fill()):u==r.Rect&&(e._ctx.beginPath(),l-=o.height/2,a-=o.width/2,f>0&&_&&(e._ctx.fillStyle=_,e._ctx.rect(a,l,o.width,o.height),e._ctx.fill()),e._ctx.fillStyle=h,e._ctx.rect(a+f,l+f,o.width-f,o.height-f),e._ctx.fill()),e._ctx.restore()}}))}},{key:"_renderSelectionRect",value:function(){this._drag||(this._ctx.save(),this._selectionRect&&this._selectionRectEnabled&&(this._ctx.setLineDash([4]),this._ctx.lineWidth=this._pixelRatio,this._ctx.strokeStyle=this._options.selectionColor,this._ctx.strokeRect(this._getSharp(this._selectionRect.x,1),this._getSharp(this._selectionRect.y,1),Math.floor(this._selectionRect.width),Math.floor(this._selectionRect.height))),this._ctx.restore())}},{key:"_renderBackground",value:function(){this._options.fillColor?(this._ctx.save(),this._ctx.beginPath(),this._ctx.rect(0,0,this._width(),this._height()),this._ctx.fillStyle=this._options.fillColor,this._ctx.fill(),this._ctx.restore()):this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height)}},{key:"_renderTimeline",value:function(){if(this._ctx&&this._options&&this._options.timelineStyle){var e=this._options.timelineStyle;this._ctx.save();var t=e.width||1;this._ctx.lineWidth=t*this._pixelRatio;var n=this._getSharp(this._toScreenPx(this._val),t);this._ctx.strokeStyle=e.strokeColor,this._ctx.fillStyle=e.fillColor;var r=e.marginTop;if(this._ctx.beginPath(),c.drawLine(this._ctx,n,r,n,this._height()),this._ctx.stroke(),e.capHeight&&e.capWidth){var o=e.capWidth,i=e.capHeight;e.capType===te.Triangle?(this._ctx.beginPath(),this._ctx.moveTo(n-o/2,r),this._ctx.lineTo(n+o/2,r),this._ctx.lineTo(n,i),this._ctx.closePath(),this._ctx.stroke()):e.capType===te.Rect&&(this._ctx.fillRect(n-o/2,r,o,i),this._ctx.fill())}this._ctx.restore()}}},{key:"_renderHeaderBackground",value:function(){this._ctx&&this._options&&s.headerHeight(this._options)&&(this._ctx.save(),this._ctx.lineWidth=this._pixelRatio,this._options.headerFillColor?(this._ctx.lineWidth=this._pixelRatio,this._ctx.fillStyle=this._options.headerFillColor,this._ctx.fillRect(0,0,this._width(),s.headerHeight(this._options))):this._ctx.clearRect(0,0,this._width(),s.headerHeight(this._options)),this._ctx.restore())}},{key:"redraw",value:function(){window.requestAnimationFrame?window.requestAnimationFrame(this._redrawInternal):this._redrawInternal()}},{key:"scrollLeft",value:function(){this._scrollContainer.scrollLeft!=this._scrollContainer.scrollWidth&&(this._scrollContainer.scrollLeft=this._scrollContainer.scrollWidth)}},{key:"getRowByY",value:function(e){var t=this._calculateModel();if(t&&t.rows)for(var n=0;n<t.rows.length;n++){var r=t.rows[n].size;if(r&&r.y>=e&&e<=r.y+r.height)return r}return null}},{key:"_getSharp",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return e=Math.round(e),t%2==0?e:e+this._pixelRatio/2}},{key:"getTime",value:function(){return this._val}},{key:"_setTimeInternal",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.Programmatically;if((e=Math.round(e))<this._options.min&&(e=this._options.min),this._val!=e){var n=this._val,r=new R;return r.val=e,r.prevVal=n,r.source=t,this._val=e,this.emit(re.TimeChanged,r),!r.isPrevented()||(this._val=n,!1)}return!1}},{key:"setTime",value:function(e){if(this._drag&&this._drag.type===$.Timeline)return!1;var t=this._setTimeInternal(e,g.SetTimeMethod);return t&&(this.rescale(),this.redraw()),t}},{key:"getOptions",value:function(){return this._options}},{key:"setScrollLeft",value:function(e){this._scrollContainer&&(this._scrollContainer.scrollLeft=e)}},{key:"setScrollTop",value:function(e){this._scrollContainer&&(this._scrollContainer.scrollTop=e)}},{key:"getScrollLeft",value:function(){return this._scrollContainer?this._scrollContainer.scrollLeft:0}},{key:"getScrollTop",value:function(){return this._scrollContainer?this._scrollContainer.scrollTop:0}},{key:"setOptions",value:function(e){return this._options=this._setOptions(e),this.rescale(),this.redraw(),this._options}},{key:"_setOptions",value:function(e){if(this._options=this._mergeOptions(e),this._options.snapStep=c.keepInBounds(this._options.snapStep,0,this._options.stepVal),this._currentZoom=this._setZoom(this._options.zoom,this._options.zoomMin,this._options.zoomMax),this._options.min=c.isNumber(this._options.min)?this._options.min:0,this._options.max=c.isNumber(this._options.max)?this._options.max:Number.MAX_VALUE,this._scrollContainer){var t=this._scrollContainer.classList;this._options.scrollContainerClass&&t.contains(this._options.scrollContainerClass)&&t.add(this._options.scrollContainerClass),this._options.fillColor&&(this._scrollContainer.style.background=this._options.fillColor)}return this._options}},{key:"getModel",value:function(){return this._model}},{key:"setModel",value:function(e){this._model=e,this.rescale(),this.redraw()}},{key:"_getMousePos",value:function(e,t){var n=1,r=0,o=0;if(t.changedTouches&&t.changedTouches.length>0){var i=t.changedTouches[0];r=i.clientX,o=i.clientY,n=Math.max(n,i.radiusX,i.radiusY)}else r=t.clientX,o=t.clientY;var s=e.getBoundingClientRect(),a=e.width/this._pixelRatio/s.width,l=e.height/this._pixelRatio/s.height;return{x:(r-s.left)*a,y:(o-s.top)*l,radius:n,args:t}}},{key:"_updateCanvasScale",value:function(){if(this._scrollContainer&&this._ctx){var e=!1,t=this._scrollContainer.clientWidth*this._pixelRatio,n=this._scrollContainer.clientHeight*this._pixelRatio;return Math.floor(t)!=Math.floor(this._ctx.canvas.width)&&(this._ctx.canvas.width=t,e=!0),Math.floor(n)!=Math.floor(this._ctx.canvas.height)&&(this._ctx.canvas.height=n,e=!0),e&&this._ctx.setTransform(this._pixelRatio,0,0,this._pixelRatio,0,0),e}console.log("control should be initialized first")}},{key:"rescale",value:function(){this._rescaleInternal()}},{key:"_rescaleInternal",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"default";this._updateCanvasScale();var r=this._calculateModel();if(r&&r.size){var o=this._options.stepPx;e=e||0;var i=this.valToPx(this._val),s=0;i>this._width()&&(s="scrollBySelection"==n?Math.floor(i+this._width()+(this._options.stepPx||0)):Math.floor(i+this._width()/1.5));var a=r.size.width+this._leftMargin()+o;e=Math.max(e,a,this.getScrollLeft()+this._width(),s);var l=Math.floor(e)+"px";l!=this._scrollContent.style.minWidth&&(this._scrollContent.style.minWidth=l);var c=(t=Math.max(Math.floor(r.size.height+.2*this._height()),this._scrollContainer.scrollTop+this._height()-1,Math.round(t||0)))+"px";this._scrollContent.style.minHeight!=c&&(this._scrollContent.style.minHeight=c)}}},{key:"_findDraggable",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=function(e){return e===$.Timeline?1:e===$.Keyframe?2:e===$.Group?3:-1},o=e.filter((function(e){if(!e)return!1;if(e.type===$.Keyframe){if(!s.keyframeDraggable(e.keyframe,e.row,t._options))return!1}else if(e.type===$.Group){if(!s.groupDraggable(e.row,t._options))return!1}else if(e.type===$.Row)return!1;return!0})),i=function(e,t){var o=r(e.type),i=r(t.type);return o!==i||null!==n&&(o=c.getDistance(e.val,n))!==(i=c.getDistance(t.val,n))?o<i?1:-1:0},a=o.sort(i);return a.length>0?a[a.length-1]:null}},{key:"elementFromPoint",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;n=Math.max(n,1);var r=[];if(!e)return r;var o=s.headerHeight(this._options),i=this._toScreenPx(this._val),a=0;if(this._options&&this._options.timelineStyle){var l=this._options.timelineStyle;a=Math.max((l.width||1)*this._pixelRatio,(l.capWidth||0)*this._pixelRatio||1)+n}(e.y<=.5*o||e.x>=i-a/2&&e.x<=i+a/2)&&r.push({val:this._val,type:$.Timeline});var u=this._options.snapEnabled;return e.y>=o&&this._options.keyframesDraggable&&this._forEachKeyframe((function(o,i,s){if(s){if(c.isOverlap(e.x,e.y,o.parentRow.size)){var a={val:t._mousePosToVal(e.x,u),keyframes:o.parentRow.model.keyframes,type:$.Row,row:o.parentRow.model};r.push(a)}o.parentRow.groups&&o.parentRow.groups.forEach((function(n){if(c.isOverlap(e.x,e.y,n.size)){var i=t._mapKeyframes(n.keyframes),s={val:t._mousePosToVal(e.x,u),type:$.Group,group:n,row:o.parentRow.model,keyframes:i},a=t.snapVal(n.min);s.val+=n.min-a,r.push(s)}}))}var l=o.size;l&&c.getDistance(l.x,l.y,e.x,e.y)<=l.height+n&&r.push({keyframe:o.model,keyframes:[o.model],val:o.model.val,row:o.parentRow.model,type:$.Keyframe})})),r}},{key:"_mergeOptions",value:function(e){e=e||{};var t=JSON.parse(JSON.stringify(ie));return function e(t,n){if(t&&n)for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&void 0!==n[r]&&("object"===ae(n[r])&&t[r]?e(t[r],n[r]):t[r]=n[r])}(t,e),t}},{key:"onTimeChanged",value:function(e){this.on(re.TimeChanged,e)}},{key:"onDragStarted",value:function(e){this.on(re.DragStarted,e)}},{key:"onDrag",value:function(e){this.on(re.Drag,e)}},{key:"onDragFinished",value:function(e){this.on(re.DragFinished,e)}},{key:"onDoubleClick",value:function(e){this.on(re.DoubleClick,e)}},{key:"onKeyframeChanged",value:function(e){this.on(re.KeyframeChanged,e)}},{key:"onMouseDown",value:function(e){this.on(re.MouseDown,e)}},{key:"onSelected",value:function(e){this.on(re.Selected,e)}},{key:"onScroll",value:function(e){this.on(re.Scroll,e)}},{key:"_emitScrollEvent",value:function(e){var t={args:e,scrollLeft:this.getScrollLeft(),scrollTop:this.getScrollTop(),scrollHeight:this._scrollContainer.scrollHeight,scrollWidth:this._scrollContainer.scrollWidth};return _e(pe(l.prototype),"emit",this).call(this,re.Scroll,t),t}},{key:"_emitKeyframeChanged",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.Programmatically,n=new b;return n.val=e.val,n.prevVal=e.prevVal,n.target=e,n.source=t,this.emit(re.KeyframeChanged,n),n}},{key:"_emitDragStartedEvent",value:function(){var e=this._getDragEventArgs();return this.emit(re.DragStarted,e),e.isPrevented()&&this._preventDrag(e,this._drag,!0),e}},{key:"_emitDragFinishedEvent",value:function(){if(this._drag&&this._drag.changed){var e=this._getDragEventArgs();return this.emit(re.DragFinished,e),e.isPrevented()&&this._preventDrag(e,this._drag,!0),e}return null}},{key:"_preventDrag",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e.elements&&e.elements.forEach((function(e){var t=r?e.startedVal:e.prevVal;n._setKeyframePos(e,t)})),t.val=t.prevVal,e.val=e.prevVal}},{key:"_emitDragEvent",value:function(){if(!this._drag)return null;var e=this._getDragEventArgs();return this.emit(re.Drag,e),e.isPrevented()&&this._preventDrag(e,this._drag,!1),e}},{key:"_emitKeyframesSelected",value:function(e){var t=new j;return t.selected=e.selected,t.changed=e.changed,this.emit(re.Selected,t),t}},{key:"_getDragEventArgs",value:function(){var e=new oe;return this._drag?(e.val=this._currentPos.val,e.originalVal=this._currentPos.originalVal,e.snapVal=this._currentPos.snapVal,e.pos=this._currentPos,e.elements=this._drag.elements,e.target=this._drag.target,e):e}}],n&&ce(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),l}(o);return t})()}));