@egjs/axes
Advanced tools
Comparing version 2.7.0 to 2.7.1
@@ -8,5 +8,5 @@ /* | ||
@version 2.7.0 | ||
@version 2.7.1 | ||
*/ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("@egjs/hammerjs"),require("@egjs/agent"),require("@egjs/component")):"function"==typeof define&&define.amd?define(["@egjs/hammerjs","@egjs/agent","@egjs/component"],e):(t.eg=t.eg||{},t.eg.Axes=e(t.Hammer,t.getAgent,t.eg.Component))}(this,function(h,t,e){"use strict";var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function n(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var s,g=function(){return(g=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var s in e=arguments[n])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t}).apply(this,arguments)};function l(t,e,n,i){var s=t,r=[!n[0]&&i?e[0]-i[0]:e[0],!n[1]&&i?e[1]+i[1]:e[1]],s=Math.max(r[0],s);return Math.min(r[1],s)}function r(t,e){return t<e[0]||t>e[1]}function u(t,e,n){return n[1]&&t>e[1]||n[0]&&t<e[0]}function v(t,e,n){var i=t,s=e[0],r=e[1],o=r-s;return n[1]&&r<t&&(i=(i-r)%o+s),n[0]&&t<s&&(i=(i-s)%o+r),i}function o(t){for(var e=[],n=0,i=t.length;n<i;n++)e.push(t[n]);return e}function a(t,e){var n,i;return void 0===e&&(e=!1),"string"==typeof t?(i=t.match(/^<([a-z]+)\s*([^>]*)>/)?((n=document.createElement("div")).innerHTML=t,o(n.childNodes)):o(document.querySelectorAll(t)),e||(i=1<=i.length?i[0]:void 0)):t!==s&&(!t.nodeName||1!==t.nodeType&&9!==t.nodeType)?"jQuery"in s&&t instanceof jQuery||t.constructor.prototype.jquery?i=e?t.toArray():t.get(0):Array.isArray(t)&&(i=t.map(function(t){return a(t)}),e||(i=1<=i.length?i[0]:void 0)):i=t,i}var c,m,E=(s="undefined"==typeof window?{navigator:{userAgent:""}}:window).requestAnimationFrame||s.webkitRequestAnimationFrame,d=s.cancelAnimationFrame||s.webkitCancelAnimationFrame;function _(t,e){var n={};for(var i in t)i&&(n[i]=e(t[i],i));return n}function f(t,e){var n={};for(var i in t)i&&e(t[i],i)&&(n[i]=t[i]);return n}function p(t,e){for(var n in t)if(n&&!e(t[n],n))return!1;return!0}function b(t,n){return p(t,function(t,e){return t===n[e]})}E&&!d?(c={},m=E,E=function(e){var n=m(function(t){c[n]&&e(t)});return c[n]=!0,n},d=function(t){delete c[t]}):E&&d||(E=function(t){return s.setTimeout(function(){t(s.performance&&s.performance.now&&s.performance.now()||(new Date).getTime())},16)},d=s.clearTimeout);var x={};function T(t,e){var n,i;return x[e]||(x[e]=(i=(n=e)<1?Math.pow(10,I(n)):1,function(t){return 0===n?0:Math.round(Math.round(t/n)*n*i)/i})),x[e](t)}function P(t,n){if(!t||!n)return t;var i="number"==typeof n;return _(t,function(t,e){return T(t,i?n:n[e])})}function I(t){if(!isFinite(t))return 0;var e=t+"";if(0<=e.indexOf("e")){for(var n=0,i=1;Math.round(t*i)/i!==t;)i*=10,n++;return n}return 0<=e.indexOf(".")?e.length-e.indexOf(".")-1:0}function y(t,e,n){return Math.max(Math.min(t,n),e)}var O=function(){function t(t){var e=t.options,n=t.itm,i=t.em,s=t.axm;this.options=e,this.itm=n,this.em=i,this.axm=s,this.animationEnd=this.animationEnd.bind(this)}var e=t.prototype;return e.getDuration=function(r,t,e){var n,o=this;return y(void 0!==e?e:(n=_(t,function(t,e){return n=Math.abs(t-r[e]),i=o.options.deceleration,(s=Math.sqrt(n/i*2))<100?0:s;var n,i,s}),Object.keys(n).reduce(function(t,e){return Math.max(t,n[e])},-1/0)),this.options.minimumDuration,this.options.maximumDuration)},e.createAnimationParam=function(t,e,n){var i=this.axm.get(),s=t,r=n&&n.event||null;return{depaPos:i,destPos:s,duration:y(e,this.options.minimumDuration,this.options.maximumDuration),delta:this.axm.getDelta(i,s),inputEvent:r,input:n&&n.input||null,isTrusted:!!r,done:this.animationEnd}},e.grab=function(t,e){var n,i,s;this._animateParam&&t.length&&(n=this.axm.get(t),p(i=this.axm.map(n,function(t,e){return v(t,e.range,e.circular)}),function(t,e){return n[e]===t})||this.em.triggerChange(i,!1,n,e,!!e),this._animateParam=null,this._raf&&(s=this._raf,d(s)),this._raf=null,this.em.triggerAnimationEnd(!(!e||!e.event)))},e.getEventInfo=function(){return this._animateParam&&this._animateParam.input&&this._animateParam.inputEvent?{input:this._animateParam.input,event:this._animateParam.inputEvent}:null},e.restore=function(t){var e=this.axm.get(),n=this.axm.map(e,function(t,e){return Math.min(e.range[1],Math.max(e.range[0],t))});this.animateTo(n,this.getDuration(e,n),t)},e.animationEnd=function(){var t=this.getEventInfo();this._animateParam=null;var e=this.axm.filter(this.axm.get(),function(t,e){return u(t,e.range,e.circular)});0<Object.keys(e).length&&this.setTo(this.axm.map(e,function(t,e){return v(t,e.range,e.circular)})),this.itm.setInterrupt(!1),this.em.triggerAnimationEnd(!!t),this.axm.isOutside()?this.restore(t):this.finish(!!t)},e.finish=function(t){this._animateParam=null,this.itm.setInterrupt(!1),this.em.triggerFinish(t)},e.animateLoop=function(s,r){var h,u,c,m,l,d,f,p;s.duration?(this._animateParam=g({},s),h=this._animateParam,u=this,c=h.destPos,m=h.depaPos,l=0,d=_(m,function(t,e){return t<=c[e]?1:-1}),f=_(c,function(t){return t}),p=(new Date).getTime(),h.startTime=p,function t(){u._raf=null;var e=(new Date).getTime(),o=(e-h.startTime)/s.duration,a=u.easing(o),n=u.axm.map(m,function(t,e,n){var i,s=1<=o?c[n]:t+h.delta[n]*(a-l),r=v(s,e.range,e.circular);return s!==r&&(i=d[n]*(e.range[1]-e.range[0]),c[n]-=i,m[n]-=i),r}),i=!u.em.triggerChange(n,!1,m);if(m=n,p=e,1<=(l=a))return b(c=u.getFinalPos(c,f),u.axm.get(Object.keys(c)))||u.em.triggerChange(c,!0,m),void r();i?u.finish(!1):u._raf=E(t)}()):(this.em.triggerChange(s.destPos,!0),r())},e.getFinalPos=function(t,n){var i=this;return _(t,function(t,e){return t>=n[e]-1e-6&&t<=n[e]+1e-6?n[e]:T(t,i.getRoundUnit(t,e))})},e.getRoundUnit=function(t,e){var n,i,s=this.options.round,r=null;return s||(n=this.axm.getAxisOptions(e),i=Math.max(I(n.range[0]),I(n.range[1]),I(t)),r=1/Math.pow(10,i)),r||s},e.getUserControll=function(t){var e=t.setTo();return e.destPos=this.axm.get(e.destPos),e.duration=y(e.duration,this.options.minimumDuration,this.options.maximumDuration),e},e.animateTo=function(t,e,n){var i,s=this,r=this.createAnimationParam(t,e,n),o=g({},r.depaPos),a=this.em.triggerAnimationStart(r),h=this.getUserControll(r);!a&&this.axm.every(h.destPos,function(t,e){return u(t,e.range,e.circular)})&&console.warn("You can't stop the 'animation' event when 'circular' is true."),a&&!b(h.destPos,o)&&(i=n&&n.event||null,this.animateLoop({depaPos:o,destPos:h.destPos,duration:h.duration,delta:this.axm.getDelta(o,h.destPos),isTrusted:!!i,inputEvent:i,input:n&&n.input||null},function(){return s.animationEnd()}))},e.easing=function(t){return 1<t?1:this.options.easing(t)},e.setTo=function(t,e){void 0===e&&(e=0);var n=Object.keys(t);this.grab(n);var i=this.axm.get(n);if(b(t,i))return this;this.itm.setInterrupt(!0);var s=f(t,function(t,e){return i[e]!==t});return Object.keys(s).length&&(b(s=this.axm.map(s,function(t,e){var n=e.range,i=e.circular;return i&&(i[0]||i[1])?t:l(t,n,i)}),i)||(0<e?this.animateTo(s,e):(this.em.triggerChange(s),this.finish(!1)))),this},e.setBy=function(n,t){return void 0===t&&(t=0),this.setTo(_(this.axm.get(Object.keys(n)),function(t,e){return t+n[e]}),t)},t}(),R=function(){function t(t){this.axes=t}var e=t.prototype;return e.triggerHold=function(t,e){var n=this.getRoundPos(t).roundPos;this.axes.trigger("hold",{pos:n,input:e.input||null,inputEvent:e.event||null,isTrusted:!0})},e.triggerRelease=function(t){var e=this.getRoundPos(t.destPos,t.depaPos),n=e.roundPos,i=e.roundDepa;t.destPos=n,t.depaPos=i,t.setTo=this.createUserControll(t.destPos,t.duration),this.axes.trigger("release",t)},e.triggerChange=function(t,e,n,i,s){void 0===s&&(s=!1);var r=this.am,o=r.axm,a=r.getEventInfo(),h=this.getRoundPos(t,n),u=h.roundPos,c=h.roundDepa,m=o.moveTo(u,c),l=i&&i.event||a&&a.event||null,d={pos:m.pos,delta:m.delta,holding:s,inputEvent:l,isTrusted:!!l,input:i&&i.input||a&&a.input||null,set:l?this.createUserControll(m.pos):function(){}},f=this.axes.trigger("change",d);return l&&o.set(d.set().destPos),f},e.triggerAnimationStart=function(t){var e=this.getRoundPos(t.destPos,t.depaPos),n=e.roundPos,i=e.roundDepa;return t.destPos=n,t.depaPos=i,t.setTo=this.createUserControll(t.destPos,t.duration),this.axes.trigger("animationStart",t)},e.triggerAnimationEnd=function(t){void 0===t&&(t=!1),this.axes.trigger("animationEnd",{isTrusted:t})},e.triggerFinish=function(t){void 0===t&&(t=!1),this.axes.trigger("finish",{isTrusted:t})},e.createUserControll=function(t,e){void 0===e&&(e=0);var n={destPos:g({},t),duration:e};return function(t,e){return t&&(n.destPos=g({},t)),void 0!==e&&(n.duration=e),n}},e.setAnimationManager=function(t){this.am=t},e.destroy=function(){this.axes.off()},e.getRoundPos=function(t,e){var n=this.axes.options.round;return{roundPos:P(t,n),roundDepa:P(e,n)}},t}(),D=function(){function t(t){this.options=t,this._prevented=!1}var e=t.prototype;return e.isInterrupting=function(){return this.options.interruptable||this._prevented},e.isInterrupted=function(){return!this.options.interruptable&&this._prevented},e.setInterrupt=function(t){this.options.interruptable||(this._prevented=t)},t}(),A=function(){function t(t,e){var n=this;this.axis=t,this.options=e,this._complementOptions(),this._pos=Object.keys(this.axis).reduce(function(t,e){return t[e]=n.axis[e].range[0],t},{})}var e=t.prototype;return e._complementOptions=function(){var s=this;Object.keys(this.axis).forEach(function(i){s.axis[i]=g({range:[0,100],bounce:[0,0],circular:[!1,!1]},s.axis[i]),["bounce","circular"].forEach(function(t){var e=s.axis,n=e[i][t];/string|number|boolean/.test(typeof n)&&(e[i][t]=[n,n])})})},e.getDelta=function(t,e){var n=this.get(t);return _(this.get(e),function(t,e){return t-n[e]})},e.get=function(t){var n=this;return t&&Array.isArray(t)?t.reduce(function(t,e){return e&&e in n._pos&&(t[e]=n._pos[e]),t},{}):g({},this._pos,t||{})},e.moveTo=function(n,i){void 0===i&&(i=this._pos);var t=_(this._pos,function(t,e){return e in n&&e in i?n[e]-i[e]:0});return this.set(this.map(n,function(t,e){return e?v(t,e.range,e.circular):0})),{pos:g({},this._pos),delta:t}},e.set=function(t){for(var e in t)e&&e in this._pos&&(this._pos[e]=t[e])},e.every=function(t,n){var i=this.axis;return p(t,function(t,e){return n(t,i[e],e)})},e.filter=function(t,n){var i=this.axis;return f(t,function(t,e){return n(t,i[e],e)})},e.map=function(t,n){var i=this.axis;return _(t,function(t,e){return n(t,i[e],e)})},e.isOutside=function(t){return!this.every(t?this.get(t):this._pos,function(t,e){return!r(t,e.range)})},e.getAxisOptions=function(t){return this.axis[t]},t}(),C=function(){function t(t){var e=t.options,n=t.itm,i=t.em,s=t.axm,r=t.am;this.isOutside=!1,this.moveDistance=null,this.isStopped=!1,this.options=e,this.itm=n,this.em=i,this.axm=s,this.am=r}var e=t.prototype;return e.atOutside=function(t){var o=this;if(this.isOutside)return this.axm.map(t,function(t,e){var n=e.range[0]-e.bounce[0],i=e.range[1]+e.bounce[1];return i<t?i:t<n?n:t});var a=this.am.easing(1e-5)/1e-5;return this.axm.map(t,function(t,e){var n=e.range[0],i=e.range[1],s=e.bounce,r=e.circular;return r&&(r[0]||r[1])?t:t<n?n-o.am.easing((n-t)/(s[0]*a))*s[0]:i<t?i+o.am.easing((t-i)/(s[1]*a))*s[1]:t})},e.get=function(t){return this.axm.get(t.axes)},e.hold=function(t,e){var n;!this.itm.isInterrupted()&&t.axes.length&&(n={input:t,event:e},this.isStopped=!1,this.itm.setInterrupt(!0),this.am.grab(t.axes,n),this.moveDistance||this.em.triggerHold(this.axm.get(),n),this.isOutside=this.axm.isOutside(t.axes),this.moveDistance=this.axm.get(t.axes))},e.change=function(t,e,n){var i,s;this.isStopped||!this.itm.isInterrupting()||this.axm.every(n,function(t){return 0===t})||(s=_(i=this.moveDistance||this.axm.get(t.axes),function(t,e){return t+(n[e]||0)}),this.moveDistance&&(this.moveDistance=s),this.isOutside&&this.axm.every(i,function(t,e){return!r(t,e.range)})&&(this.isOutside=!1),i=this.atOutside(i),s=this.atOutside(s),this.em.triggerChange(s,!1,i,{input:t,event:e},!0)||(this.isStopped=!0,this.moveDistance=null,this.am.finish(!1)))},e.release=function(t,e,n,i){var s,r,o,a,h,u,c,m;!this.isStopped&&this.itm.isInterrupting()&&this.moveDistance&&(s=this.axm.get(t.axes),r=this.axm.get(),o=this.axm.get(this.axm.map(n,function(t,e,n){return e.circular&&(e.circular[0]||e.circular[1])?s[n]+t:l(s[n]+t,e.range,e.circular,e.bounce)})),0===(a=this.am.getDuration(o,s,i))&&(o=g({},r)),h={depaPos:r,destPos:o,duration:a,delta:this.axm.getDelta(r,o),inputEvent:e,input:t,isTrusted:!0},this.em.triggerRelease(h),this.moveDistance=null,m={input:t,event:e},(c=b((u=this.am.getUserControll(h)).destPos,r))||0===u.duration?(c||this.em.triggerChange(u.destPos,!1,r,m,!0),this.itm.setInterrupt(!1),this.axm.isOutside()?this.am.restore(m):this.em.triggerFinish(!0)):this.am.animateTo(u.destPos,u.duration,m))},t}(),w="ontouchstart"in s&&-1<t(s.navigator.userAgent).browser.name.indexOf("safari"),N=function(){if("undefined"==typeof document)return"";for(var t=(document.head||document.getElementsByTagName("head")[0]).style,e=["transform","webkitTransform","msTransform","mozTransform"],n=0,i=e.length;n<i;n++)if(e[n]in t)return e[n];return""}(),M=function(s){function t(t,e,n){void 0===t&&(t={}),void 0===e&&(e={});var i=s.call(this)||this;return i.axis=t,i._inputs=[],i.options=g({easing:function(t){return 1-Math.pow(1-t,3)},interruptable:!0,maximumDuration:1/0,minimumDuration:0,deceleration:6e-4,round:null},e),i.itm=new D(i.options),i.axm=new A(i.axis,i.options),i.em=new R(i),i.am=new O(i),i.io=new C(i),i.em.setAnimationManager(i.am),n&&i.em.triggerChange(n),i}n(t,s);var e=t.prototype;return e.connect=function(t,e){var n,i="string"==typeof t?t.split(" "):t.concat();return~this._inputs.indexOf(e)&&this.disconnect(e),"hammer"in e&&((n=this._inputs.filter(function(t){return t.hammer&&t.element===e.element})).length&&(e.hammer=n[0].hammer)),e.mapAxes(i),e.connect(this.io),this._inputs.push(e),this},e.disconnect=function(t){var e;return t?0<=(e=this._inputs.indexOf(t))&&(this._inputs[e].disconnect(),this._inputs.splice(e,1)):(this._inputs.forEach(function(t){return t.disconnect()}),this._inputs=[]),this},e.get=function(t){return this.axm.get(t)},e.setTo=function(t,e){return void 0===e&&(e=0),this.am.setTo(t,e),this},e.setBy=function(t,e){return void 0===e&&(e=0),this.am.setBy(t,e),this},e.isBounceArea=function(t){return this.axm.isOutside(t)},e.destroy=function(){this.disconnect(),this.em.destroy()},t.VERSION="2.7.0",t.TRANSFORM=N,t.DIRECTION_NONE=h.DIRECTION_NONE,t.DIRECTION_LEFT=h.DIRECTION_LEFT,t.DIRECTION_RIGHT=h.DIRECTION_RIGHT,t.DIRECTION_UP=h.DIRECTION_UP,t.DIRECTION_DOWN=h.DIRECTION_DOWN,t.DIRECTION_HORIZONTAL=h.DIRECTION_HORIZONTAL,t.DIRECTION_VERTICAL=h.DIRECTION_VERTICAL,t.DIRECTION_ALL=h.DIRECTION_ALL,t}(e),L="PointerEvent"in s||"MSPointerEvent"in s,S="ontouchstart"in s,H="_EGJS_AXES_INPUTTYPE_";function j(i,t){return t.reduce(function(t,e,n){return i[n]&&(t[i[n]]=e),t},{})}function F(t,e){try{return new h.Manager(t,g({},e))}catch(t){return null}}function z(t){void 0===t&&(t=[]);var e=!1,n=!1,i=!1;return t.forEach(function(t){switch(t){case"mouse":n=!0;break;case"touch":e=S;break;case"pointer":i=L}}),i?h.PointerEventInput:e&&n?h.TouchMouseInput:e?h.TouchInput:n?h.MouseInput:null}function k(t,e,n){return n?!!(e===h.DIRECTION_ALL||e&t&&n&t):!!(e&t)}var Y=function(){function t(t,e){if(this.axes=[],this.hammer=null,this.element=null,this.panRecognizer=null,this.isRightEdge=!1,this.rightEdgeTimer=0,this.panFlag=!1,void 0===h.Manager)throw new Error("The Hammerjs must be loaded before eg.Axes.PanInput.\nhttp://hammerjs.github.io/");this.element=a(t),this.options=g({inputType:["touch","mouse","pointer"],scale:[1,1],thresholdAngle:45,threshold:0,iOSEdgeSwipeThreshold:30,hammerManagerOptions:{cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",userDrag:"none"}}},e),this.onHammerInput=this.onHammerInput.bind(this),this.onPanmove=this.onPanmove.bind(this),this.onPanend=this.onPanend.bind(this)}var e=t.prototype;return e.mapAxes=function(t){var e=!!t[0],n=!!t[1];this._direction=e&&n?h.DIRECTION_ALL:e?h.DIRECTION_HORIZONTAL:n?h.DIRECTION_VERTICAL:h.DIRECTION_NONE,this.axes=t},e.connect=function(t){var e={direction:this._direction,threshold:this.options.threshold};if(this.hammer)this.removeRecognizer(),this.dettachEvent();else{var n=(n=this.element[H])||String(Math.round(Math.random()*(new Date).getTime())),i=z(this.options.inputType);if(!i)throw new Error("Wrong inputType parameter!");this.hammer=F(this.element,g({inputClass:i},this.options.hammerManagerOptions)),this.element[H]=n}return this.panRecognizer=new h.Pan(e),this.hammer.add(this.panRecognizer),this.attachEvent(t),this},e.disconnect=function(){return this.removeRecognizer(),this.hammer&&this.dettachEvent(),this._direction=h.DIRECTION_NONE,this},e.destroy=function(){this.disconnect(),this.hammer&&0===this.hammer.recognizers.length&&this.hammer.destroy(),delete this.element[H],this.element=null,this.hammer=null},e.enable=function(){return this.hammer&&(this.hammer.get("pan").options.enable=!0),this},e.disable=function(){return this.hammer&&(this.hammer.get("pan").options.enable=!1),this},e.isEnable=function(){return!(!this.hammer||!this.hammer.get("pan").options.enable)},e.removeRecognizer=function(){this.hammer&&this.panRecognizer&&(this.hammer.remove(this.panRecognizer),this.panRecognizer=null)},e.onHammerInput=function(t){var e;this.isEnable()&&(t.isFirst?(this.panFlag=!1)!==t.srcEvent.cancelable&&(e=this.options.iOSEdgeSwipeThreshold,this.observer.hold(this,t),this.isRightEdge=w&&t.center.x>window.innerWidth-e,this.panFlag=!0):t.isFinal&&this.onPanend(t))},e.onPanmove=function(t){var e=this;if(this.panFlag){var n,i=function(t,e){if(e<0||90<e)return h.DIRECTION_NONE;var n=Math.abs(t);return e<n&&n<180-e?h.DIRECTION_VERTICAL:h.DIRECTION_HORIZONTAL}(t.angle,this.options.thresholdAngle),s=this.hammer.session.prevInput;if(s&&w){if(t.center.x<0)return void this.onPanend(g({},s,{velocityX:0,velocityY:0,offsetX:0,offsetY:0}));this.isRightEdge&&(clearTimeout(this.rightEdgeTimer),n=this.options.iOSEdgeSwipeThreshold,t.deltaX<-n?this.isRightEdge=!1:this.rightEdgeTimer=window.setTimeout(function(){e.onPanend(g({},s,{velocityX:0,velocityY:0,offsetX:0,offsetY:0}))},100))}s?(t.offsetX=t.deltaX-s.deltaX,t.offsetY=t.deltaY-s.deltaY):(t.offsetX=0,t.offsetY=0);var r,o=this.getOffset([t.offsetX,t.offsetY],[k(h.DIRECTION_HORIZONTAL,this._direction,i),k(h.DIRECTION_VERTICAL,this._direction,i)]),a=o.some(function(t){return 0!==t});a&&(!1!==(r=t.srcEvent).cancelable&&r.preventDefault(),r.stopPropagation()),(t.preventSystemEvent=a)&&this.observer.change(this,t,j(this.axes,o))}},e.onPanend=function(t){var e,n,i,s,r;this.panFlag&&(clearTimeout(this.rightEdgeTimer),this.panFlag=!1,e=this.getOffset([Math.abs(t.velocityX)*(t.deltaX<0?-1:1),Math.abs(t.velocityY)*(t.deltaY<0?-1:1)],[k(h.DIRECTION_HORIZONTAL,this._direction),k(h.DIRECTION_VERTICAL,this._direction)]),n=e,i=this.observer.options.deceleration,s=Math.sqrt(n[0]*n[0]+n[1]*n[1]),r=Math.abs(s/-i),e=[n[0]/2*r,n[1]/2*r],this.observer.release(this,t,j(this.axes,e)))},e.attachEvent=function(t){this.observer=t,this.hammer.on("hammer.input",this.onHammerInput).on("panstart panmove",this.onPanmove)},e.dettachEvent=function(){this.hammer.off("hammer.input",this.onHammerInput).off("panstart panmove",this.onPanmove),this.observer=null},e.getOffset=function(t,e){var n=[0,0],i=this.options.scale;return e[0]&&(n[0]=t[0]*i[0]),e[1]&&(n[1]=t[1]*i[1]),n},t}(),X=function(i){function t(t,e){var n=i.call(this,t,e)||this;return n.prevQuadrant=null,n.lastDiff=0,n}n(t,i);var e=t.prototype;return e.mapAxes=function(t){this._direction=M.DIRECTION_ALL,this.axes=t},e.onHammerInput=function(t){this.isEnable()&&(t.isFirst?(this.observer.hold(this,t),this.onPanstart(t)):t.isFinal&&this.onPanend(t))},e.onPanstart=function(t){var e=this.element.getBoundingClientRect();this.coefficientForDistanceToAngle=360/(e.width*Math.PI),this.rotateOrigin=[e.left+(e.width-1)/2,e.top+(e.height-1)/2],this.prevAngle=null,this.triggerChange(t)},e.onPanmove=function(t){this.triggerChange(t)},e.onPanend=function(t){this.triggerChange(t),this.triggerAnimation(t)},e.triggerChange=function(t){var e=this.getAngle(t.center.x,t.center.y),n=this.getQuadrant(t.center.x,t.center.y),i=this.getDifference(this.prevAngle,e,this.prevQuadrant,n);this.prevAngle=e,this.prevQuadrant=n,0!==i&&(this.lastDiff=i,this.observer.change(this,t,j(this.axes,[-i])))},e.triggerAnimation=function(t){var e=t.velocityX,n=t.velocityY,i=Math.sqrt(e*e+n*n)*(0<this.lastDiff?-1:1),s=i/2*Math.abs(i/-this.observer.options.deceleration);this.observer.release(this,t,j(this.axes,[s*this.coefficientForDistanceToAngle]))},e.getDifference=function(t,e,n,i){var s=null===t?0:1===n&&4===i?-t-(360-e):4===n&&1===i?360-t+e:e-t;return s},e.getPosFromOrigin=function(t,e){return{x:t-this.rotateOrigin[0],y:this.rotateOrigin[1]-e}},e.getAngle=function(t,e){var n=this.getPosFromOrigin(t,e),i=n.x,s=n.y,r=180*Math.atan2(s,i)/Math.PI;return r<0?360+r:r},e.getQuadrant=function(t,e){var n=this.getPosFromOrigin(t,e),i=n.x,s=n.y,r=0;return 0<=i&&0<=s?r=1:i<0&&0<=s?r=2:i<0&&s<0?r=3:0<=i&&s<0&&(r=4),r},t}(Y),K=function(){function t(t,e){if(this.axes=[],this.hammer=null,this.element=null,this._base=null,this._prev=null,this.pinchRecognizer=null,void 0===h.Manager)throw new Error("The Hammerjs must be loaded before eg.Axes.PinchInput.\nhttp://hammerjs.github.io/");this.element=a(t),this.options=g({scale:1,threshold:0,inputType:["touch","pointer"],hammerManagerOptions:{cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",userDrag:"none"}}},e),this.onPinchStart=this.onPinchStart.bind(this),this.onPinchMove=this.onPinchMove.bind(this),this.onPinchEnd=this.onPinchEnd.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this.axes=t},e.connect=function(t){var e={threshold:this.options.threshold};if(this.hammer)this.removeRecognizer(),this.dettachEvent();else{var n=(n=this.element[H])||String(Math.round(Math.random()*(new Date).getTime())),i=z(this.options.inputType);if(!i)throw new Error("Wrong inputType parameter!");this.hammer=F(this.element,g({inputClass:i},this.options.hammerManagerOptions)),this.element[H]=n}return this.pinchRecognizer=new h.Pinch(e),this.hammer.add(this.pinchRecognizer),this.attachEvent(t),this},e.disconnect=function(){return this.removeRecognizer(),this.hammer&&(this.hammer.remove(this.pinchRecognizer),this.pinchRecognizer=null,this.dettachEvent()),this},e.destroy=function(){this.disconnect(),this.hammer&&0===this.hammer.recognizers.length&&this.hammer.destroy(),delete this.element[H],this.element=null,this.hammer=null},e.removeRecognizer=function(){this.hammer&&this.pinchRecognizer&&(this.hammer.remove(this.pinchRecognizer),this.pinchRecognizer=null)},e.onPinchStart=function(t){this._base=this.observer.get(this)[this.axes[0]];var e=this.getOffset(t.scale);this.observer.hold(this,t),this.observer.change(this,t,j(this.axes,[e])),this._prev=t.scale},e.onPinchMove=function(t){var e=this.getOffset(t.scale,this._prev);this.observer.change(this,t,j(this.axes,[e])),this._prev=t.scale},e.onPinchEnd=function(t){var e=this.getOffset(t.scale,this._prev);this.observer.change(this,t,j(this.axes,[e])),this.observer.release(this,t,j(this.axes,[0]),0),this._base=null,this._prev=null},e.getOffset=function(t,e){return void 0===e&&(e=1),this._base*(t-e)*this.options.scale},e.attachEvent=function(t){this.observer=t,this.hammer.on("pinchstart",this.onPinchStart).on("pinchmove",this.onPinchMove).on("pinchend",this.onPinchEnd)},e.dettachEvent=function(){this.hammer.off("pinchstart",this.onPinchStart).off("pinchmove",this.onPinchMove).off("pinchend",this.onPinchEnd),this.observer=null,this._prev=null},e.enable=function(){return this.hammer&&(this.hammer.get("pinch").options.enable=!0),this},e.disable=function(){return this.hammer&&(this.hammer.get("pinch").options.enable=!1),this},e.isEnable=function(){return!(!this.hammer||!this.hammer.get("pinch").options.enable)},t}(),U=function(){function t(t,e){this.axes=[],this.element=null,this._isEnabled=!1,this._isHolded=!1,this._timer=null,this.element=a(t),this.options=g({scale:1,useNormalized:!0},e),this.onWheel=this.onWheel.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this.axes=t},e.connect=function(t){return this.dettachEvent(),this.attachEvent(t),this},e.disconnect=function(){return this.dettachEvent(),this},e.destroy=function(){this.disconnect(),this.element=null},e.onWheel=function(t){var e,n=this;this._isEnabled&&(t.preventDefault(),0!==t.deltaY&&(this._isHolded||(this.observer.hold(this,t),this._isHolded=!0),e=(0<t.deltaY?-1:1)*this.options.scale*(this.options.useNormalized?1:Math.abs(t.deltaY)),this.observer.change(this,t,j(this.axes,[e])),clearTimeout(this._timer),this._timer=setTimeout(function(){n._isHolded&&(n._isHolded=!1,n.observer.release(n,t,j(n.axes,[0])))},50)))},e.attachEvent=function(t){this.observer=t,this.element.addEventListener("wheel",this.onWheel),this._isEnabled=!0},e.dettachEvent=function(){this.element.removeEventListener("wheel",this.onWheel),this._isEnabled=!1,this.observer=null,this._timer&&(clearTimeout(this._timer),this._timer=null)},e.enable=function(){return this._isEnabled=!0,this},e.disable=function(){return this._isEnabled=!1,this},e.isEnable=function(){return this._isEnabled},t}(),W=function(){function t(t,e){this.axes=[],this.element=null,this._isEnabled=!1,this._isHolded=!1,this._timer=null,this.element=a(t),this.options=g({scale:[1,1]},e),this.onKeydown=this.onKeydown.bind(this),this.onKeyup=this.onKeyup.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this.axes=t},e.connect=function(t){return this.dettachEvent(),"0"!==this.element.getAttribute("tabindex")&&this.element.setAttribute("tabindex","0"),this.attachEvent(t),this},e.disconnect=function(){return this.dettachEvent(),this},e.destroy=function(){this.disconnect(),this.element=null},e.onKeydown=function(t){if(this._isEnabled){var e,n=!0,i=1,s=-1;switch(t.keyCode){case 37:case 65:i=-1;break;case 39:case 68:break;case 40:case 83:i=-1,s=1;break;case 38:case 87:s=1;break;default:n=!1}(-1===s&&!this.axes[0]||1===s&&!this.axes[1])&&(n=!1),n&&(e=-1===s?[this.options.scale[0]*i,0]:[0,this.options.scale[1]*i],this._isHolded||(this.observer.hold(this,event),this._isHolded=!0),clearTimeout(this._timer),this.observer.change(this,event,j(this.axes,e)))}},e.onKeyup=function(t){var e=this;this._isHolded&&(clearTimeout(this._timer),this._timer=setTimeout(function(){e.observer.release(e,t,j(e.axes,[0,0])),e._isHolded=!1},80))},e.attachEvent=function(t){this.observer=t,this.element.addEventListener("keydown",this.onKeydown,!1),this.element.addEventListener("keypress",this.onKeydown,!1),this.element.addEventListener("keyup",this.onKeyup,!1),this._isEnabled=!0},e.dettachEvent=function(){this.element.removeEventListener("keydown",this.onKeydown,!1),this.element.removeEventListener("keypress",this.onKeydown,!1),this.element.removeEventListener("keyup",this.onKeyup,!1),this._isEnabled=!1,this.observer=null},e.enable=function(){return this._isEnabled=!0,this},e.disable=function(){return this._isEnabled=!1,this},e.isEnable=function(){return this._isEnabled},t}();return M.PanInput=Y,M.RotatePanInput=X,M.PinchInput=K,M.WheelInput=U,M.MoveKeyInput=W,M}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("@egjs/hammerjs"),require("@egjs/agent"),require("@egjs/component")):"function"==typeof define&&define.amd?define(["@egjs/hammerjs","@egjs/agent","@egjs/component"],e):(t.eg=t.eg||{},t.eg.Axes=e(t.Hammer,t.getAgent,t.eg.Component))}(this,function(h,t,e){"use strict";var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function n(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var s,g=function(){return(g=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var s in e=arguments[n])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t}).apply(this,arguments)};function l(t,e,n,i){var s=t,r=[!n[0]&&i?e[0]-i[0]:e[0],!n[1]&&i?e[1]+i[1]:e[1]],s=Math.max(r[0],s);return Math.min(r[1],s)}function r(t,e){return t<e[0]||t>e[1]}function u(t,e,n){return n[1]&&t>e[1]||n[0]&&t<e[0]}function v(t,e,n){var i=t,s=e[0],r=e[1],o=r-s;return n[1]&&r<t&&(i=(i-r)%o+s),n[0]&&t<s&&(i=(i-s)%o+r),i}function o(t){for(var e=[],n=0,i=t.length;n<i;n++)e.push(t[n]);return e}function a(t,e){var n,i;return void 0===e&&(e=!1),"string"==typeof t?(i=t.match(/^<([a-z]+)\s*([^>]*)>/)?((n=document.createElement("div")).innerHTML=t,o(n.childNodes)):o(document.querySelectorAll(t)),e||(i=1<=i.length?i[0]:void 0)):t!==s&&(!t.nodeName||1!==t.nodeType&&9!==t.nodeType)?"jQuery"in s&&t instanceof jQuery||t.constructor.prototype.jquery?i=e?t.toArray():t.get(0):Array.isArray(t)&&(i=t.map(function(t){return a(t)}),e||(i=1<=i.length?i[0]:void 0)):i=t,i}var c,m,E=(s="undefined"==typeof window?{navigator:{userAgent:""}}:window).requestAnimationFrame||s.webkitRequestAnimationFrame,d=s.cancelAnimationFrame||s.webkitCancelAnimationFrame;function _(t,e){var n={};for(var i in t)i&&(n[i]=e(t[i],i));return n}function f(t,e){var n={};for(var i in t)i&&e(t[i],i)&&(n[i]=t[i]);return n}function p(t,e){for(var n in t)if(n&&!e(t[n],n))return!1;return!0}function b(t,n){return p(t,function(t,e){return t===n[e]})}E&&!d?(c={},m=E,E=function(e){var n=m(function(t){c[n]&&e(t)});return c[n]=!0,n},d=function(t){delete c[t]}):E&&d||(E=function(t){return s.setTimeout(function(){t(s.performance&&s.performance.now&&s.performance.now()||(new Date).getTime())},16)},d=s.clearTimeout);var x={};function T(t,e){var n,i;return x[e]||(x[e]=(i=(n=e)<1?Math.pow(10,I(n)):1,function(t){return 0===n?0:Math.round(Math.round(t/n)*n*i)/i})),x[e](t)}function P(t,n){if(!t||!n)return t;var i="number"==typeof n;return _(t,function(t,e){return T(t,i?n:n[e])})}function I(t){if(!isFinite(t))return 0;var e=t+"";if(0<=e.indexOf("e")){for(var n=0,i=1;Math.round(t*i)/i!==t;)i*=10,n++;return n}return 0<=e.indexOf(".")?e.length-e.indexOf(".")-1:0}function y(t,e,n){return Math.max(Math.min(t,n),e)}var O=function(){function t(t){var e=t.options,n=t.itm,i=t.em,s=t.axm;this.options=e,this.itm=n,this.em=i,this.axm=s,this.animationEnd=this.animationEnd.bind(this)}var e=t.prototype;return e.getDuration=function(r,t,e){var n,o=this;return y(void 0!==e?e:(n=_(t,function(t,e){return n=Math.abs(t-r[e]),i=o.options.deceleration,(s=Math.sqrt(n/i*2))<100?0:s;var n,i,s}),Object.keys(n).reduce(function(t,e){return Math.max(t,n[e])},-1/0)),this.options.minimumDuration,this.options.maximumDuration)},e.createAnimationParam=function(t,e,n){var i=this.axm.get(),s=t,r=n&&n.event||null;return{depaPos:i,destPos:s,duration:y(e,this.options.minimumDuration,this.options.maximumDuration),delta:this.axm.getDelta(i,s),inputEvent:r,input:n&&n.input||null,isTrusted:!!r,done:this.animationEnd}},e.grab=function(t,e){var n,i,s;this._animateParam&&t.length&&(n=this.axm.get(t),p(i=this.axm.map(n,function(t,e){return v(t,e.range,e.circular)}),function(t,e){return n[e]===t})||this.em.triggerChange(i,!1,n,e,!!e),this._animateParam=null,this._raf&&(s=this._raf,d(s)),this._raf=null,this.em.triggerAnimationEnd(!(!e||!e.event)))},e.getEventInfo=function(){return this._animateParam&&this._animateParam.input&&this._animateParam.inputEvent?{input:this._animateParam.input,event:this._animateParam.inputEvent}:null},e.restore=function(t){var e=this.axm.get(),n=this.axm.map(e,function(t,e){return Math.min(e.range[1],Math.max(e.range[0],t))});this.animateTo(n,this.getDuration(e,n),t)},e.animationEnd=function(){var t=this.getEventInfo();this._animateParam=null;var e=this.axm.filter(this.axm.get(),function(t,e){return u(t,e.range,e.circular)});0<Object.keys(e).length&&this.setTo(this.axm.map(e,function(t,e){return v(t,e.range,e.circular)})),this.itm.setInterrupt(!1),this.em.triggerAnimationEnd(!!t),this.axm.isOutside()?this.restore(t):this.finish(!!t)},e.finish=function(t){this._animateParam=null,this.itm.setInterrupt(!1),this.em.triggerFinish(t)},e.animateLoop=function(s,r){var h,u,c,m,l,d,f,p;s.duration?(this._animateParam=g({},s),h=this._animateParam,u=this,c=h.destPos,m=h.depaPos,l=0,d=_(m,function(t,e){return t<=c[e]?1:-1}),f=_(c,function(t){return t}),p=(new Date).getTime(),h.startTime=p,function t(){u._raf=null;var e=(new Date).getTime(),o=(e-h.startTime)/s.duration,a=u.easing(o),n=u.axm.map(m,function(t,e,n){var i,s=1<=o?c[n]:t+h.delta[n]*(a-l),r=v(s,e.range,e.circular);return s!==r&&(i=d[n]*(e.range[1]-e.range[0]),c[n]-=i,m[n]-=i),r}),i=!u.em.triggerChange(n,!1,m);if(m=n,p=e,1<=(l=a))return b(c=u.getFinalPos(c,f),u.axm.get(Object.keys(c)))||u.em.triggerChange(c,!0,m),void r();i?u.finish(!1):u._raf=E(t)}()):(this.em.triggerChange(s.destPos,!0),r())},e.getFinalPos=function(t,n){var i=this;return _(t,function(t,e){return t>=n[e]-1e-6&&t<=n[e]+1e-6?n[e]:T(t,i.getRoundUnit(t,e))})},e.getRoundUnit=function(t,e){var n,i,s=this.options.round,r=null;return s||(n=this.axm.getAxisOptions(e),i=Math.max(I(n.range[0]),I(n.range[1]),I(t)),r=1/Math.pow(10,i)),r||s},e.getUserControll=function(t){var e=t.setTo();return e.destPos=this.axm.get(e.destPos),e.duration=y(e.duration,this.options.minimumDuration,this.options.maximumDuration),e},e.animateTo=function(t,e,n){var i,s=this,r=this.createAnimationParam(t,e,n),o=g({},r.depaPos),a=this.em.triggerAnimationStart(r),h=this.getUserControll(r);!a&&this.axm.every(h.destPos,function(t,e){return u(t,e.range,e.circular)})&&console.warn("You can't stop the 'animation' event when 'circular' is true."),a&&!b(h.destPos,o)&&(i=n&&n.event||null,this.animateLoop({depaPos:o,destPos:h.destPos,duration:h.duration,delta:this.axm.getDelta(o,h.destPos),isTrusted:!!i,inputEvent:i,input:n&&n.input||null},function(){return s.animationEnd()}))},e.easing=function(t){return 1<t?1:this.options.easing(t)},e.setTo=function(t,e){void 0===e&&(e=0);var n=Object.keys(t);this.grab(n);var i=this.axm.get(n);if(b(t,i))return this;this.itm.setInterrupt(!0);var s=f(t,function(t,e){return i[e]!==t});return Object.keys(s).length&&(b(s=this.axm.map(s,function(t,e){var n=e.range,i=e.circular;return i&&(i[0]||i[1])?t:l(t,n,i)}),i)||(0<e?this.animateTo(s,e):(this.em.triggerChange(s),this.finish(!1)))),this},e.setBy=function(n,t){return void 0===t&&(t=0),this.setTo(_(this.axm.get(Object.keys(n)),function(t,e){return t+n[e]}),t)},t}(),R=function(){function t(t){this.axes=t}var e=t.prototype;return e.triggerHold=function(t,e){var n=this.getRoundPos(t).roundPos;this.axes.trigger("hold",{pos:n,input:e.input||null,inputEvent:e.event||null,isTrusted:!0})},e.triggerRelease=function(t){var e=this.getRoundPos(t.destPos,t.depaPos),n=e.roundPos,i=e.roundDepa;t.destPos=n,t.depaPos=i,t.setTo=this.createUserControll(t.destPos,t.duration),this.axes.trigger("release",t)},e.triggerChange=function(t,e,n,i,s){void 0===s&&(s=!1);var r=this.am,o=r.axm,a=r.getEventInfo(),h=this.getRoundPos(t,n),u=h.roundPos,c=h.roundDepa,m=o.moveTo(u,c),l=i&&i.event||a&&a.event||null,d={pos:m.pos,delta:m.delta,holding:s,inputEvent:l,isTrusted:!!l,input:i&&i.input||a&&a.input||null,set:l?this.createUserControll(m.pos):function(){}},f=this.axes.trigger("change",d);return l&&o.set(d.set().destPos),f},e.triggerAnimationStart=function(t){var e=this.getRoundPos(t.destPos,t.depaPos),n=e.roundPos,i=e.roundDepa;return t.destPos=n,t.depaPos=i,t.setTo=this.createUserControll(t.destPos,t.duration),this.axes.trigger("animationStart",t)},e.triggerAnimationEnd=function(t){void 0===t&&(t=!1),this.axes.trigger("animationEnd",{isTrusted:t})},e.triggerFinish=function(t){void 0===t&&(t=!1),this.axes.trigger("finish",{isTrusted:t})},e.createUserControll=function(t,e){void 0===e&&(e=0);var n={destPos:g({},t),duration:e};return function(t,e){return t&&(n.destPos=g({},t)),void 0!==e&&(n.duration=e),n}},e.setAnimationManager=function(t){this.am=t},e.destroy=function(){this.axes.off()},e.getRoundPos=function(t,e){var n=this.axes.options.round;return{roundPos:P(t,n),roundDepa:P(e,n)}},t}(),D=function(){function t(t){this.options=t,this._prevented=!1}var e=t.prototype;return e.isInterrupting=function(){return this.options.interruptable||this._prevented},e.isInterrupted=function(){return!this.options.interruptable&&this._prevented},e.setInterrupt=function(t){this.options.interruptable||(this._prevented=t)},t}(),A=function(){function t(t,e){var n=this;this.axis=t,this.options=e,this._complementOptions(),this._pos=Object.keys(this.axis).reduce(function(t,e){return t[e]=n.axis[e].range[0],t},{})}var e=t.prototype;return e._complementOptions=function(){var s=this;Object.keys(this.axis).forEach(function(i){s.axis[i]=g({range:[0,100],bounce:[0,0],circular:[!1,!1]},s.axis[i]),["bounce","circular"].forEach(function(t){var e=s.axis,n=e[i][t];/string|number|boolean/.test(typeof n)&&(e[i][t]=[n,n])})})},e.getDelta=function(t,e){var n=this.get(t);return _(this.get(e),function(t,e){return t-n[e]})},e.get=function(t){var n=this;return t&&Array.isArray(t)?t.reduce(function(t,e){return e&&e in n._pos&&(t[e]=n._pos[e]),t},{}):g({},this._pos,t||{})},e.moveTo=function(n,i){void 0===i&&(i=this._pos);var t=_(this._pos,function(t,e){return e in n&&e in i?n[e]-i[e]:0});return this.set(this.map(n,function(t,e){return e?v(t,e.range,e.circular):0})),{pos:g({},this._pos),delta:t}},e.set=function(t){for(var e in t)e&&e in this._pos&&(this._pos[e]=t[e])},e.every=function(t,n){var i=this.axis;return p(t,function(t,e){return n(t,i[e],e)})},e.filter=function(t,n){var i=this.axis;return f(t,function(t,e){return n(t,i[e],e)})},e.map=function(t,n){var i=this.axis;return _(t,function(t,e){return n(t,i[e],e)})},e.isOutside=function(t){return!this.every(t?this.get(t):this._pos,function(t,e){return!r(t,e.range)})},e.getAxisOptions=function(t){return this.axis[t]},t}(),C=function(){function t(t){var e=t.options,n=t.itm,i=t.em,s=t.axm,r=t.am;this.isOutside=!1,this.moveDistance=null,this.isStopped=!1,this.options=e,this.itm=n,this.em=i,this.axm=s,this.am=r}var e=t.prototype;return e.atOutside=function(t){var o=this;if(this.isOutside)return this.axm.map(t,function(t,e){var n=e.range[0]-e.bounce[0],i=e.range[1]+e.bounce[1];return i<t?i:t<n?n:t});var a=this.am.easing(1e-5)/1e-5;return this.axm.map(t,function(t,e){var n=e.range[0],i=e.range[1],s=e.bounce,r=e.circular;return r&&(r[0]||r[1])?t:t<n?n-o.am.easing((n-t)/(s[0]*a))*s[0]:i<t?i+o.am.easing((t-i)/(s[1]*a))*s[1]:t})},e.get=function(t){return this.axm.get(t.axes)},e.hold=function(t,e){var n;!this.itm.isInterrupted()&&t.axes.length&&(n={input:t,event:e},this.isStopped=!1,this.itm.setInterrupt(!0),this.am.grab(t.axes,n),this.moveDistance||this.em.triggerHold(this.axm.get(),n),this.isOutside=this.axm.isOutside(t.axes),this.moveDistance=this.axm.get(t.axes))},e.change=function(t,e,n){var i,s;this.isStopped||!this.itm.isInterrupting()||this.axm.every(n,function(t){return 0===t})||(s=_(i=this.moveDistance||this.axm.get(t.axes),function(t,e){return t+(n[e]||0)}),this.moveDistance&&(this.moveDistance=s),this.isOutside&&this.axm.every(i,function(t,e){return!r(t,e.range)})&&(this.isOutside=!1),i=this.atOutside(i),s=this.atOutside(s),this.em.triggerChange(s,!1,i,{input:t,event:e},!0)||(this.isStopped=!0,this.moveDistance=null,this.am.finish(!1)))},e.release=function(t,e,n,i){var s,r,o,a,h,u,c,m;!this.isStopped&&this.itm.isInterrupting()&&this.moveDistance&&(s=this.axm.get(t.axes),r=this.axm.get(),o=this.axm.get(this.axm.map(n,function(t,e,n){return e.circular&&(e.circular[0]||e.circular[1])?s[n]+t:l(s[n]+t,e.range,e.circular,e.bounce)})),0===(a=this.am.getDuration(o,s,i))&&(o=g({},r)),h={depaPos:r,destPos:o,duration:a,delta:this.axm.getDelta(r,o),inputEvent:e,input:t,isTrusted:!0},this.em.triggerRelease(h),this.moveDistance=null,m={input:t,event:e},(c=b((u=this.am.getUserControll(h)).destPos,r))||0===u.duration?(c||this.em.triggerChange(u.destPos,!1,r,m,!0),this.itm.setInterrupt(!1),this.axm.isOutside()?this.am.restore(m):this.em.triggerFinish(!0)):this.am.animateTo(u.destPos,u.duration,m))},t}(),w="ontouchstart"in s&&"safari"===t().browser.name,N=function(){if("undefined"==typeof document)return"";for(var t=(document.head||document.getElementsByTagName("head")[0]).style,e=["transform","webkitTransform","msTransform","mozTransform"],n=0,i=e.length;n<i;n++)if(e[n]in t)return e[n];return""}(),M=function(s){function t(t,e,n){void 0===t&&(t={}),void 0===e&&(e={});var i=s.call(this)||this;return i.axis=t,i._inputs=[],i.options=g({easing:function(t){return 1-Math.pow(1-t,3)},interruptable:!0,maximumDuration:1/0,minimumDuration:0,deceleration:6e-4,round:null},e),i.itm=new D(i.options),i.axm=new A(i.axis,i.options),i.em=new R(i),i.am=new O(i),i.io=new C(i),i.em.setAnimationManager(i.am),n&&i.em.triggerChange(n),i}n(t,s);var e=t.prototype;return e.connect=function(t,e){var n,i="string"==typeof t?t.split(" "):t.concat();return~this._inputs.indexOf(e)&&this.disconnect(e),"hammer"in e&&((n=this._inputs.filter(function(t){return t.hammer&&t.element===e.element})).length&&(e.hammer=n[0].hammer)),e.mapAxes(i),e.connect(this.io),this._inputs.push(e),this},e.disconnect=function(t){var e;return t?0<=(e=this._inputs.indexOf(t))&&(this._inputs[e].disconnect(),this._inputs.splice(e,1)):(this._inputs.forEach(function(t){return t.disconnect()}),this._inputs=[]),this},e.get=function(t){return this.axm.get(t)},e.setTo=function(t,e){return void 0===e&&(e=0),this.am.setTo(t,e),this},e.setBy=function(t,e){return void 0===e&&(e=0),this.am.setBy(t,e),this},e.isBounceArea=function(t){return this.axm.isOutside(t)},e.destroy=function(){this.disconnect(),this.em.destroy()},t.VERSION="2.7.1",t.TRANSFORM=N,t.DIRECTION_NONE=h.DIRECTION_NONE,t.DIRECTION_LEFT=h.DIRECTION_LEFT,t.DIRECTION_RIGHT=h.DIRECTION_RIGHT,t.DIRECTION_UP=h.DIRECTION_UP,t.DIRECTION_DOWN=h.DIRECTION_DOWN,t.DIRECTION_HORIZONTAL=h.DIRECTION_HORIZONTAL,t.DIRECTION_VERTICAL=h.DIRECTION_VERTICAL,t.DIRECTION_ALL=h.DIRECTION_ALL,t}(e),L="PointerEvent"in s||"MSPointerEvent"in s,S="ontouchstart"in s,H="_EGJS_AXES_INPUTTYPE_";function j(i,t){return t.reduce(function(t,e,n){return i[n]&&(t[i[n]]=e),t},{})}function F(t,e){try{return new h.Manager(t,g({},e))}catch(t){return null}}function z(t){void 0===t&&(t=[]);var e=!1,n=!1,i=!1;return t.forEach(function(t){switch(t){case"mouse":n=!0;break;case"touch":e=S;break;case"pointer":i=L}}),i?h.PointerEventInput:e&&n?h.TouchMouseInput:e?h.TouchInput:n?h.MouseInput:null}function k(t,e,n){return n?!!(e===h.DIRECTION_ALL||e&t&&n&t):!!(e&t)}var Y=function(){function t(t,e){if(this.axes=[],this.hammer=null,this.element=null,this.panRecognizer=null,this.isRightEdge=!1,this.rightEdgeTimer=0,this.panFlag=!1,void 0===h.Manager)throw new Error("The Hammerjs must be loaded before eg.Axes.PanInput.\nhttp://hammerjs.github.io/");this.element=a(t),this.options=g({inputType:["touch","mouse","pointer"],scale:[1,1],thresholdAngle:45,threshold:0,iOSEdgeSwipeThreshold:30,hammerManagerOptions:{cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",userDrag:"none"}}},e),this.onHammerInput=this.onHammerInput.bind(this),this.onPanmove=this.onPanmove.bind(this),this.onPanend=this.onPanend.bind(this)}var e=t.prototype;return e.mapAxes=function(t){var e=!!t[0],n=!!t[1];this._direction=e&&n?h.DIRECTION_ALL:e?h.DIRECTION_HORIZONTAL:n?h.DIRECTION_VERTICAL:h.DIRECTION_NONE,this.axes=t},e.connect=function(t){var e={direction:this._direction,threshold:this.options.threshold};if(this.hammer)this.removeRecognizer(),this.dettachEvent();else{var n=(n=this.element[H])||String(Math.round(Math.random()*(new Date).getTime())),i=z(this.options.inputType);if(!i)throw new Error("Wrong inputType parameter!");this.hammer=F(this.element,g({inputClass:i},this.options.hammerManagerOptions)),this.element[H]=n}return this.panRecognizer=new h.Pan(e),this.hammer.add(this.panRecognizer),this.attachEvent(t),this},e.disconnect=function(){return this.removeRecognizer(),this.hammer&&this.dettachEvent(),this._direction=h.DIRECTION_NONE,this},e.destroy=function(){this.disconnect(),this.hammer&&0===this.hammer.recognizers.length&&this.hammer.destroy(),delete this.element[H],this.element=null,this.hammer=null},e.enable=function(){return this.hammer&&(this.hammer.get("pan").options.enable=!0),this},e.disable=function(){return this.hammer&&(this.hammer.get("pan").options.enable=!1),this},e.isEnable=function(){return!(!this.hammer||!this.hammer.get("pan").options.enable)},e.removeRecognizer=function(){this.hammer&&this.panRecognizer&&(this.hammer.remove(this.panRecognizer),this.panRecognizer=null)},e.onHammerInput=function(t){var e;this.isEnable()&&(t.isFirst?(this.panFlag=!1)!==t.srcEvent.cancelable&&(e=this.options.iOSEdgeSwipeThreshold,this.observer.hold(this,t),this.isRightEdge=w&&t.center.x>window.innerWidth-e,this.panFlag=!0):t.isFinal&&this.onPanend(t))},e.onPanmove=function(t){var e=this;if(this.panFlag){var n,i=function(t,e){if(e<0||90<e)return h.DIRECTION_NONE;var n=Math.abs(t);return e<n&&n<180-e?h.DIRECTION_VERTICAL:h.DIRECTION_HORIZONTAL}(t.angle,this.options.thresholdAngle),s=this.hammer.session.prevInput;if(s&&w){if(t.center.x<0)return void this.onPanend(g({},s,{velocityX:0,velocityY:0,offsetX:0,offsetY:0}));this.isRightEdge&&(clearTimeout(this.rightEdgeTimer),n=this.options.iOSEdgeSwipeThreshold,t.deltaX<-n?this.isRightEdge=!1:this.rightEdgeTimer=window.setTimeout(function(){e.onPanend(g({},s,{velocityX:0,velocityY:0,offsetX:0,offsetY:0}))},100))}s?(t.offsetX=t.deltaX-s.deltaX,t.offsetY=t.deltaY-s.deltaY):(t.offsetX=0,t.offsetY=0);var r,o=this.getOffset([t.offsetX,t.offsetY],[k(h.DIRECTION_HORIZONTAL,this._direction,i),k(h.DIRECTION_VERTICAL,this._direction,i)]),a=o.some(function(t){return 0!==t});a&&(!1!==(r=t.srcEvent).cancelable&&r.preventDefault(),r.stopPropagation()),(t.preventSystemEvent=a)&&this.observer.change(this,t,j(this.axes,o))}},e.onPanend=function(t){var e,n,i,s,r;this.panFlag&&(clearTimeout(this.rightEdgeTimer),this.panFlag=!1,e=this.getOffset([Math.abs(t.velocityX)*(t.deltaX<0?-1:1),Math.abs(t.velocityY)*(t.deltaY<0?-1:1)],[k(h.DIRECTION_HORIZONTAL,this._direction),k(h.DIRECTION_VERTICAL,this._direction)]),n=e,i=this.observer.options.deceleration,s=Math.sqrt(n[0]*n[0]+n[1]*n[1]),r=Math.abs(s/-i),e=[n[0]/2*r,n[1]/2*r],this.observer.release(this,t,j(this.axes,e)))},e.attachEvent=function(t){this.observer=t,this.hammer.on("hammer.input",this.onHammerInput).on("panstart panmove",this.onPanmove)},e.dettachEvent=function(){this.hammer.off("hammer.input",this.onHammerInput).off("panstart panmove",this.onPanmove),this.observer=null},e.getOffset=function(t,e){var n=[0,0],i=this.options.scale;return e[0]&&(n[0]=t[0]*i[0]),e[1]&&(n[1]=t[1]*i[1]),n},t}(),X=function(i){function t(t,e){var n=i.call(this,t,e)||this;return n.prevQuadrant=null,n.lastDiff=0,n}n(t,i);var e=t.prototype;return e.mapAxes=function(t){this._direction=M.DIRECTION_ALL,this.axes=t},e.onHammerInput=function(t){this.isEnable()&&(t.isFirst?(this.observer.hold(this,t),this.onPanstart(t)):t.isFinal&&this.onPanend(t))},e.onPanstart=function(t){var e=this.element.getBoundingClientRect();this.coefficientForDistanceToAngle=360/(e.width*Math.PI),this.rotateOrigin=[e.left+(e.width-1)/2,e.top+(e.height-1)/2],this.prevAngle=null,this.triggerChange(t)},e.onPanmove=function(t){this.triggerChange(t)},e.onPanend=function(t){this.triggerChange(t),this.triggerAnimation(t)},e.triggerChange=function(t){var e=this.getAngle(t.center.x,t.center.y),n=this.getQuadrant(t.center.x,t.center.y),i=this.getDifference(this.prevAngle,e,this.prevQuadrant,n);this.prevAngle=e,this.prevQuadrant=n,0!==i&&(this.lastDiff=i,this.observer.change(this,t,j(this.axes,[-i])))},e.triggerAnimation=function(t){var e=t.velocityX,n=t.velocityY,i=Math.sqrt(e*e+n*n)*(0<this.lastDiff?-1:1),s=i/2*Math.abs(i/-this.observer.options.deceleration);this.observer.release(this,t,j(this.axes,[s*this.coefficientForDistanceToAngle]))},e.getDifference=function(t,e,n,i){var s=null===t?0:1===n&&4===i?-t-(360-e):4===n&&1===i?360-t+e:e-t;return s},e.getPosFromOrigin=function(t,e){return{x:t-this.rotateOrigin[0],y:this.rotateOrigin[1]-e}},e.getAngle=function(t,e){var n=this.getPosFromOrigin(t,e),i=n.x,s=n.y,r=180*Math.atan2(s,i)/Math.PI;return r<0?360+r:r},e.getQuadrant=function(t,e){var n=this.getPosFromOrigin(t,e),i=n.x,s=n.y,r=0;return 0<=i&&0<=s?r=1:i<0&&0<=s?r=2:i<0&&s<0?r=3:0<=i&&s<0&&(r=4),r},t}(Y),K=function(){function t(t,e){if(this.axes=[],this.hammer=null,this.element=null,this._base=null,this._prev=null,this.pinchRecognizer=null,void 0===h.Manager)throw new Error("The Hammerjs must be loaded before eg.Axes.PinchInput.\nhttp://hammerjs.github.io/");this.element=a(t),this.options=g({scale:1,threshold:0,inputType:["touch","pointer"],hammerManagerOptions:{cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",userDrag:"none"}}},e),this.onPinchStart=this.onPinchStart.bind(this),this.onPinchMove=this.onPinchMove.bind(this),this.onPinchEnd=this.onPinchEnd.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this.axes=t},e.connect=function(t){var e={threshold:this.options.threshold};if(this.hammer)this.removeRecognizer(),this.dettachEvent();else{var n=(n=this.element[H])||String(Math.round(Math.random()*(new Date).getTime())),i=z(this.options.inputType);if(!i)throw new Error("Wrong inputType parameter!");this.hammer=F(this.element,g({inputClass:i},this.options.hammerManagerOptions)),this.element[H]=n}return this.pinchRecognizer=new h.Pinch(e),this.hammer.add(this.pinchRecognizer),this.attachEvent(t),this},e.disconnect=function(){return this.removeRecognizer(),this.hammer&&(this.hammer.remove(this.pinchRecognizer),this.pinchRecognizer=null,this.dettachEvent()),this},e.destroy=function(){this.disconnect(),this.hammer&&0===this.hammer.recognizers.length&&this.hammer.destroy(),delete this.element[H],this.element=null,this.hammer=null},e.removeRecognizer=function(){this.hammer&&this.pinchRecognizer&&(this.hammer.remove(this.pinchRecognizer),this.pinchRecognizer=null)},e.onPinchStart=function(t){this._base=this.observer.get(this)[this.axes[0]];var e=this.getOffset(t.scale);this.observer.hold(this,t),this.observer.change(this,t,j(this.axes,[e])),this._prev=t.scale},e.onPinchMove=function(t){var e=this.getOffset(t.scale,this._prev);this.observer.change(this,t,j(this.axes,[e])),this._prev=t.scale},e.onPinchEnd=function(t){var e=this.getOffset(t.scale,this._prev);this.observer.change(this,t,j(this.axes,[e])),this.observer.release(this,t,j(this.axes,[0]),0),this._base=null,this._prev=null},e.getOffset=function(t,e){return void 0===e&&(e=1),this._base*(t-e)*this.options.scale},e.attachEvent=function(t){this.observer=t,this.hammer.on("pinchstart",this.onPinchStart).on("pinchmove",this.onPinchMove).on("pinchend",this.onPinchEnd)},e.dettachEvent=function(){this.hammer.off("pinchstart",this.onPinchStart).off("pinchmove",this.onPinchMove).off("pinchend",this.onPinchEnd),this.observer=null,this._prev=null},e.enable=function(){return this.hammer&&(this.hammer.get("pinch").options.enable=!0),this},e.disable=function(){return this.hammer&&(this.hammer.get("pinch").options.enable=!1),this},e.isEnable=function(){return!(!this.hammer||!this.hammer.get("pinch").options.enable)},t}(),U=function(){function t(t,e){this.axes=[],this.element=null,this._isEnabled=!1,this._isHolded=!1,this._timer=null,this.element=a(t),this.options=g({scale:1,useNormalized:!0},e),this.onWheel=this.onWheel.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this.axes=t},e.connect=function(t){return this.dettachEvent(),this.attachEvent(t),this},e.disconnect=function(){return this.dettachEvent(),this},e.destroy=function(){this.disconnect(),this.element=null},e.onWheel=function(t){var e,n=this;this._isEnabled&&(t.preventDefault(),0!==t.deltaY&&(this._isHolded||(this.observer.hold(this,t),this._isHolded=!0),e=(0<t.deltaY?-1:1)*this.options.scale*(this.options.useNormalized?1:Math.abs(t.deltaY)),this.observer.change(this,t,j(this.axes,[e])),clearTimeout(this._timer),this._timer=setTimeout(function(){n._isHolded&&(n._isHolded=!1,n.observer.release(n,t,j(n.axes,[0])))},50)))},e.attachEvent=function(t){this.observer=t,this.element.addEventListener("wheel",this.onWheel),this._isEnabled=!0},e.dettachEvent=function(){this.element.removeEventListener("wheel",this.onWheel),this._isEnabled=!1,this.observer=null,this._timer&&(clearTimeout(this._timer),this._timer=null)},e.enable=function(){return this._isEnabled=!0,this},e.disable=function(){return this._isEnabled=!1,this},e.isEnable=function(){return this._isEnabled},t}(),W=function(){function t(t,e){this.axes=[],this.element=null,this._isEnabled=!1,this._isHolded=!1,this._timer=null,this.element=a(t),this.options=g({scale:[1,1]},e),this.onKeydown=this.onKeydown.bind(this),this.onKeyup=this.onKeyup.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this.axes=t},e.connect=function(t){return this.dettachEvent(),"0"!==this.element.getAttribute("tabindex")&&this.element.setAttribute("tabindex","0"),this.attachEvent(t),this},e.disconnect=function(){return this.dettachEvent(),this},e.destroy=function(){this.disconnect(),this.element=null},e.onKeydown=function(t){if(this._isEnabled){var e,n=!0,i=1,s=-1;switch(t.keyCode){case 37:case 65:i=-1;break;case 39:case 68:break;case 40:case 83:i=-1,s=1;break;case 38:case 87:s=1;break;default:n=!1}(-1===s&&!this.axes[0]||1===s&&!this.axes[1])&&(n=!1),n&&(e=-1===s?[this.options.scale[0]*i,0]:[0,this.options.scale[1]*i],this._isHolded||(this.observer.hold(this,event),this._isHolded=!0),clearTimeout(this._timer),this.observer.change(this,event,j(this.axes,e)))}},e.onKeyup=function(t){var e=this;this._isHolded&&(clearTimeout(this._timer),this._timer=setTimeout(function(){e.observer.release(e,t,j(e.axes,[0,0])),e._isHolded=!1},80))},e.attachEvent=function(t){this.observer=t,this.element.addEventListener("keydown",this.onKeydown,!1),this.element.addEventListener("keypress",this.onKeydown,!1),this.element.addEventListener("keyup",this.onKeyup,!1),this._isEnabled=!0},e.dettachEvent=function(){this.element.removeEventListener("keydown",this.onKeydown,!1),this.element.removeEventListener("keypress",this.onKeydown,!1),this.element.removeEventListener("keyup",this.onKeyup,!1),this._isEnabled=!1,this.observer=null},e.enable=function(){return this._isEnabled=!0,this},e.disable=function(){return this._isEnabled=!1,this},e.isEnable=function(){return this._isEnabled},t}();return M.PanInput=Y,M.RotatePanInput=X,M.PinchInput=K,M.WheelInput=U,M.MoveKeyInput=W,M}); | ||
//# sourceMappingURL=axes.min.js.map |
@@ -8,3 +8,3 @@ /* | ||
@version 2.7.0 | ||
@version 2.7.1 | ||
@@ -14,3 +14,3 @@ All-in-one packaged file for ease use of '@egjs/axes' with below dependencies. | ||
*/ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t.eg=t.eg||{},t.eg.Axes=e())}(this,function(){"use strict";var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function n(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var v=function(){return(v=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function a(t){return void 0===t}var r,t=function(){var t=function(){function t(){this._eventHandler={},this.options={}}var e=t.prototype;return e.trigger=function(t,e){void 0===e&&(e={});var n=this._eventHandler[t]||[];if(!(0<n.length))return!0;n=n.concat(),e.eventType=t;var i=!1,r=[e],s=0;e.stop=function(){i=!0},e.currentTarget=this;for(var o=arguments.length,a=new Array(2<o?o-2:0),h=2;h<o;h++)a[h-2]=arguments[h];for(1<=a.length&&(r=r.concat(a)),s=0;n[s];s++)n[s].apply(this,r);return!i},e.once=function(r,s){if("object"==typeof r&&a(s)){var t,e=r;for(t in e)this.once(t,e[t]);return this}var o;return"string"==typeof r&&"function"==typeof s&&(o=this).on(r,function t(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];s.apply(o,n),o.off(r,t)}),this},e.hasOn=function(t){return!!this._eventHandler[t]},e.on=function(t,e){if("object"==typeof t&&a(e)){var n,i=t;for(n in i)this.on(n,i[n]);return this}var r;return"string"==typeof t&&"function"==typeof e&&(a(r=this._eventHandler[t])&&(this._eventHandler[t]=[],r=this._eventHandler[t]),r.push(e)),this},e.off=function(t,e){if(a(t))return this._eventHandler={},this;if(a(e)){if("string"==typeof t)return this._eventHandler[t]=void 0,this;var n,i=t;for(n in i)this.off(n,i[n]);return this}var r=this._eventHandler[t];if(r)for(var s,o=0;void 0!==(s=r[o]);o++)if(s===e){r=r.splice(o,1);break}return this},t}();return t.VERSION="2.1.2",t}();function f(t,e,n,i){var r=t,s=[!n[0]&&i?e[0]-i[0]:e[0],!n[1]&&i?e[1]+i[1]:e[1]],r=Math.max(s[0],r);return Math.min(s[1],r)}function s(t,e){return t<e[0]||t>e[1]}function u(t,e,n){return n[1]&&t>e[1]||n[0]&&t<e[0]}function g(t,e,n){var i=t,r=e[0],s=e[1],o=s-r;return n[1]&&s<t&&(i=(i-s)%o+r),n[0]&&t<r&&(i=(i-r)%o+s),i}function o(t){for(var e=[],n=0,i=t.length;n<i;n++)e.push(t[n]);return e}function h(t,e){var n,i;return void 0===e&&(e=!1),"string"==typeof t?(i=t.match(/^<([a-z]+)\s*([^>]*)>/)?((n=document.createElement("div")).innerHTML=t,o(n.childNodes)):o(document.querySelectorAll(t)),e||(i=1<=i.length?i[0]:void 0)):t!==r&&(!t.nodeName||1!==t.nodeType&&9!==t.nodeType)?"jQuery"in r&&t instanceof jQuery||t.constructor.prototype.jquery?i=e?t.toArray():t.get(0):Array.isArray(t)&&(i=t.map(function(t){return h(t)}),e||(i=1<=i.length?i[0]:void 0)):i=t,i}var c,l,y=(r="undefined"==typeof window?{navigator:{userAgent:""}}:window).requestAnimationFrame||r.webkitRequestAnimationFrame,d=r.cancelAnimationFrame||r.webkitCancelAnimationFrame;function b(t,e){var n={};for(var i in t)i&&(n[i]=e(t[i],i));return n}function p(t,e){var n={};for(var i in t)i&&e(t[i],i)&&(n[i]=t[i]);return n}function m(t,e){for(var n in t)if(n&&!e(t[n],n))return!1;return!0}function E(t,n){return m(t,function(t,e){return t===n[e]})}y&&!d?(c={},l=y,y=function(e){var n=l(function(t){c[n]&&e(t)});return c[n]=!0,n},d=function(t){delete c[t]}):y&&d||(y=function(t){return r.setTimeout(function(){t(r.performance&&r.performance.now&&r.performance.now()||(new Date).getTime())},16)},d=r.clearTimeout);var x={};function w(t,e){var n,i;return x[e]||(x[e]=(i=(n=e)<1?Math.pow(10,T(n)):1,function(t){return 0===n?0:Math.round(Math.round(t/n)*n*i)/i})),x[e](t)}function P(t,n){if(!t||!n)return t;var i="number"==typeof n;return b(t,function(t,e){return w(t,i?n:n[e])})}function T(t){if(!isFinite(t))return 0;var e=t+"";if(0<=e.indexOf("e")){for(var n=0,i=1;Math.round(t*i)/i!==t;)i*=10,n++;return n}return 0<=e.indexOf(".")?e.length-e.indexOf(".")-1:0}function _(t,e,n){return Math.max(Math.min(t,n),e)}var O=function(){function t(t){var e=t.options,n=t.itm,i=t.em,r=t.axm;this.options=e,this.itm=n,this.em=i,this.axm=r,this.animationEnd=this.animationEnd.bind(this)}var e=t.prototype;return e.getDuration=function(s,t,e){var n,o=this;return _(void 0!==e?e:(n=b(t,function(t,e){return n=Math.abs(t-s[e]),i=o.options.deceleration,(r=Math.sqrt(n/i*2))<100?0:r;var n,i,r}),Object.keys(n).reduce(function(t,e){return Math.max(t,n[e])},-1/0)),this.options.minimumDuration,this.options.maximumDuration)},e.createAnimationParam=function(t,e,n){var i=this.axm.get(),r=t,s=n&&n.event||null;return{depaPos:i,destPos:r,duration:_(e,this.options.minimumDuration,this.options.maximumDuration),delta:this.axm.getDelta(i,r),inputEvent:s,input:n&&n.input||null,isTrusted:!!s,done:this.animationEnd}},e.grab=function(t,e){var n,i,r;this._animateParam&&t.length&&(n=this.axm.get(t),m(i=this.axm.map(n,function(t,e){return g(t,e.range,e.circular)}),function(t,e){return n[e]===t})||this.em.triggerChange(i,!1,n,e,!!e),this._animateParam=null,this._raf&&(r=this._raf,d(r)),this._raf=null,this.em.triggerAnimationEnd(!(!e||!e.event)))},e.getEventInfo=function(){return this._animateParam&&this._animateParam.input&&this._animateParam.inputEvent?{input:this._animateParam.input,event:this._animateParam.inputEvent}:null},e.restore=function(t){var e=this.axm.get(),n=this.axm.map(e,function(t,e){return Math.min(e.range[1],Math.max(e.range[0],t))});this.animateTo(n,this.getDuration(e,n),t)},e.animationEnd=function(){var t=this.getEventInfo();this._animateParam=null;var e=this.axm.filter(this.axm.get(),function(t,e){return u(t,e.range,e.circular)});0<Object.keys(e).length&&this.setTo(this.axm.map(e,function(t,e){return g(t,e.range,e.circular)})),this.itm.setInterrupt(!1),this.em.triggerAnimationEnd(!!t),this.axm.isOutside()?this.restore(t):this.finish(!!t)},e.finish=function(t){this._animateParam=null,this.itm.setInterrupt(!1),this.em.triggerFinish(t)},e.animateLoop=function(r,s){var h,u,c,l,f,d,p,m;r.duration?(this._animateParam=v({},r),h=this._animateParam,u=this,c=h.destPos,l=h.depaPos,f=0,d=b(l,function(t,e){return t<=c[e]?1:-1}),p=b(c,function(t){return t}),m=(new Date).getTime(),h.startTime=m,function t(){u._raf=null;var e=(new Date).getTime(),o=(e-h.startTime)/r.duration,a=u.easing(o),n=u.axm.map(l,function(t,e,n){var i,r=1<=o?c[n]:t+h.delta[n]*(a-f),s=g(r,e.range,e.circular);return r!==s&&(i=d[n]*(e.range[1]-e.range[0]),c[n]-=i,l[n]-=i),s}),i=!u.em.triggerChange(n,!1,l);if(l=n,m=e,1<=(f=a))return E(c=u.getFinalPos(c,p),u.axm.get(Object.keys(c)))||u.em.triggerChange(c,!0,l),void s();i?u.finish(!1):u._raf=y(t)}()):(this.em.triggerChange(r.destPos,!0),s())},e.getFinalPos=function(t,n){var i=this;return b(t,function(t,e){return t>=n[e]-1e-6&&t<=n[e]+1e-6?n[e]:w(t,i.getRoundUnit(t,e))})},e.getRoundUnit=function(t,e){var n,i,r=this.options.round,s=null;return r||(n=this.axm.getAxisOptions(e),i=Math.max(T(n.range[0]),T(n.range[1]),T(t)),s=1/Math.pow(10,i)),s||r},e.getUserControll=function(t){var e=t.setTo();return e.destPos=this.axm.get(e.destPos),e.duration=_(e.duration,this.options.minimumDuration,this.options.maximumDuration),e},e.animateTo=function(t,e,n){var i,r=this,s=this.createAnimationParam(t,e,n),o=v({},s.depaPos),a=this.em.triggerAnimationStart(s),h=this.getUserControll(s);!a&&this.axm.every(h.destPos,function(t,e){return u(t,e.range,e.circular)})&&console.warn("You can't stop the 'animation' event when 'circular' is true."),a&&!E(h.destPos,o)&&(i=n&&n.event||null,this.animateLoop({depaPos:o,destPos:h.destPos,duration:h.duration,delta:this.axm.getDelta(o,h.destPos),isTrusted:!!i,inputEvent:i,input:n&&n.input||null},function(){return r.animationEnd()}))},e.easing=function(t){return 1<t?1:this.options.easing(t)},e.setTo=function(t,e){void 0===e&&(e=0);var n=Object.keys(t);this.grab(n);var i=this.axm.get(n);if(E(t,i))return this;this.itm.setInterrupt(!0);var r=p(t,function(t,e){return i[e]!==t});return Object.keys(r).length&&(E(r=this.axm.map(r,function(t,e){var n=e.range,i=e.circular;return i&&(i[0]||i[1])?t:f(t,n,i)}),i)||(0<e?this.animateTo(r,e):(this.em.triggerChange(r),this.finish(!1)))),this},e.setBy=function(n,t){return void 0===t&&(t=0),this.setTo(b(this.axm.get(Object.keys(n)),function(t,e){return t+n[e]}),t)},t}(),S=function(){function t(t){this.axes=t}var e=t.prototype;return e.triggerHold=function(t,e){var n=this.getRoundPos(t).roundPos;this.axes.trigger("hold",{pos:n,input:e.input||null,inputEvent:e.event||null,isTrusted:!0})},e.triggerRelease=function(t){var e=this.getRoundPos(t.destPos,t.depaPos),n=e.roundPos,i=e.roundDepa;t.destPos=n,t.depaPos=i,t.setTo=this.createUserControll(t.destPos,t.duration),this.axes.trigger("release",t)},e.triggerChange=function(t,e,n,i,r){void 0===r&&(r=!1);var s=this.am,o=s.axm,a=s.getEventInfo(),h=this.getRoundPos(t,n),u=h.roundPos,c=h.roundDepa,l=o.moveTo(u,c),f=i&&i.event||a&&a.event||null,d={pos:l.pos,delta:l.delta,holding:r,inputEvent:f,isTrusted:!!f,input:i&&i.input||a&&a.input||null,set:f?this.createUserControll(l.pos):function(){}},p=this.axes.trigger("change",d);return f&&o.set(d.set().destPos),p},e.triggerAnimationStart=function(t){var e=this.getRoundPos(t.destPos,t.depaPos),n=e.roundPos,i=e.roundDepa;return t.destPos=n,t.depaPos=i,t.setTo=this.createUserControll(t.destPos,t.duration),this.axes.trigger("animationStart",t)},e.triggerAnimationEnd=function(t){void 0===t&&(t=!1),this.axes.trigger("animationEnd",{isTrusted:t})},e.triggerFinish=function(t){void 0===t&&(t=!1),this.axes.trigger("finish",{isTrusted:t})},e.createUserControll=function(t,e){void 0===e&&(e=0);var n={destPos:v({},t),duration:e};return function(t,e){return t&&(n.destPos=v({},t)),void 0!==e&&(n.duration=e),n}},e.setAnimationManager=function(t){this.am=t},e.destroy=function(){this.axes.off()},e.getRoundPos=function(t,e){var n=this.axes.options.round;return{roundPos:P(t,n),roundDepa:P(e,n)}},t}(),A=function(){function t(t){this.options=t,this._prevented=!1}var e=t.prototype;return e.isInterrupting=function(){return this.options.interruptable||this._prevented},e.isInterrupted=function(){return!this.options.interruptable&&this._prevented},e.setInterrupt=function(t){this.options.interruptable||(this._prevented=t)},t}(),M=function(){function t(t,e){var n=this;this.axis=t,this.options=e,this._complementOptions(),this._pos=Object.keys(this.axis).reduce(function(t,e){return t[e]=n.axis[e].range[0],t},{})}var e=t.prototype;return e._complementOptions=function(){var r=this;Object.keys(this.axis).forEach(function(i){r.axis[i]=v({range:[0,100],bounce:[0,0],circular:[!1,!1]},r.axis[i]),["bounce","circular"].forEach(function(t){var e=r.axis,n=e[i][t];/string|number|boolean/.test(typeof n)&&(e[i][t]=[n,n])})})},e.getDelta=function(t,e){var n=this.get(t);return b(this.get(e),function(t,e){return t-n[e]})},e.get=function(t){var n=this;return t&&Array.isArray(t)?t.reduce(function(t,e){return e&&e in n._pos&&(t[e]=n._pos[e]),t},{}):v({},this._pos,t||{})},e.moveTo=function(n,i){void 0===i&&(i=this._pos);var t=b(this._pos,function(t,e){return e in n&&e in i?n[e]-i[e]:0});return this.set(this.map(n,function(t,e){return e?g(t,e.range,e.circular):0})),{pos:v({},this._pos),delta:t}},e.set=function(t){for(var e in t)e&&e in this._pos&&(this._pos[e]=t[e])},e.every=function(t,n){var i=this.axis;return m(t,function(t,e){return n(t,i[e],e)})},e.filter=function(t,n){var i=this.axis;return p(t,function(t,e){return n(t,i[e],e)})},e.map=function(t,n){var i=this.axis;return b(t,function(t,e){return n(t,i[e],e)})},e.isOutside=function(t){return!this.every(t?this.get(t):this._pos,function(t,e){return!s(t,e.range)})},e.getAxisOptions=function(t){return this.axis[t]},t}(),I=function(){function t(t){var e=t.options,n=t.itm,i=t.em,r=t.axm,s=t.am;this.isOutside=!1,this.moveDistance=null,this.isStopped=!1,this.options=e,this.itm=n,this.em=i,this.axm=r,this.am=s}var e=t.prototype;return e.atOutside=function(t){var o=this;if(this.isOutside)return this.axm.map(t,function(t,e){var n=e.range[0]-e.bounce[0],i=e.range[1]+e.bounce[1];return i<t?i:t<n?n:t});var a=this.am.easing(1e-5)/1e-5;return this.axm.map(t,function(t,e){var n=e.range[0],i=e.range[1],r=e.bounce,s=e.circular;return s&&(s[0]||s[1])?t:t<n?n-o.am.easing((n-t)/(r[0]*a))*r[0]:i<t?i+o.am.easing((t-i)/(r[1]*a))*r[1]:t})},e.get=function(t){return this.axm.get(t.axes)},e.hold=function(t,e){var n;!this.itm.isInterrupted()&&t.axes.length&&(n={input:t,event:e},this.isStopped=!1,this.itm.setInterrupt(!0),this.am.grab(t.axes,n),this.moveDistance||this.em.triggerHold(this.axm.get(),n),this.isOutside=this.axm.isOutside(t.axes),this.moveDistance=this.axm.get(t.axes))},e.change=function(t,e,n){var i,r;this.isStopped||!this.itm.isInterrupting()||this.axm.every(n,function(t){return 0===t})||(r=b(i=this.moveDistance||this.axm.get(t.axes),function(t,e){return t+(n[e]||0)}),this.moveDistance&&(this.moveDistance=r),this.isOutside&&this.axm.every(i,function(t,e){return!s(t,e.range)})&&(this.isOutside=!1),i=this.atOutside(i),r=this.atOutside(r),this.em.triggerChange(r,!1,i,{input:t,event:e},!0)||(this.isStopped=!0,this.moveDistance=null,this.am.finish(!1)))},e.release=function(t,e,n,i){var r,s,o,a,h,u,c,l;!this.isStopped&&this.itm.isInterrupting()&&this.moveDistance&&(r=this.axm.get(t.axes),s=this.axm.get(),o=this.axm.get(this.axm.map(n,function(t,e,n){return e.circular&&(e.circular[0]||e.circular[1])?r[n]+t:f(r[n]+t,e.range,e.circular,e.bounce)})),0===(a=this.am.getDuration(o,r,i))&&(o=v({},s)),h={depaPos:s,destPos:o,duration:a,delta:this.axm.getDelta(s,o),inputEvent:e,input:t,isTrusted:!0},this.em.triggerRelease(h),this.moveDistance=null,l={input:t,event:e},(c=E((u=this.am.getUserControll(h)).destPos,s))||0===u.duration?(c||this.em.triggerChange(u.destPos,!1,s,l,!0),this.itm.setInterrupt(!1),this.axm.isOutside()?this.am.restore(l):this.em.triggerFinish(!0)):this.am.animateTo(u.destPos,u.duration,l))},t}();function D(){return(D=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 R(t,e){t.prototype=Object.create(e.prototype),(t.prototype.constructor=t).__proto__=e}function C(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var z,F="function"!=typeof Object.assign?function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var i=arguments[n];if(null!=i)for(var r in i)i.hasOwnProperty(r)&&(e[r]=i[r])}return e}:Object.assign,k=["","webkit","Moz","MS","ms","o"],e="undefined"==typeof document?{style:{}}:document.createElement("div"),H="function",Y=Math.round,W=Math.abs,X=Date.now;function j(t,e){for(var n,i,r=e[0].toUpperCase()+e.slice(1),s=0;s<k.length;){if((i=(n=k[s])?n+r:e)in t)return i;s++}}z="undefined"==typeof window?{}:window;var N=j(e.style,"touchAction"),L=void 0!==N;var q="compute",U="manipulation",V="none",B="pan-x",K="pan-y",Q=function(){if(!L)return!1;var e={},n=z.CSS&&z.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(t){return e[t]=!n||z.CSS.supports("touch-action",t)}),e}(),G="ontouchstart"in z,J=void 0!==j(z,"PointerEvent"),Z=G&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),$="touch",tt="mouse",et=25,nt=1,it=4,rt=8,st=1,ot=2,at=4,ht=8,ut=16,ct=ot|at,lt=ht|ut,ft=ct|lt,dt=["x","y"],pt=["clientX","clientY"];function mt(t,e,n){var i;if(t)if(t.forEach)t.forEach(e,n);else if(void 0!==t.length)for(i=0;i<t.length;)e.call(n,t[i],i,t),i++;else for(i in t)t.hasOwnProperty(i)&&e.call(n,t[i],i,t)}function vt(t,e){return typeof t===H?t.apply(e&&e[0]||void 0,e):t}function gt(t,e){return-1<t.indexOf(e)}var yt=function(){function t(t,e){this.manager=t,this.set(e)}var e=t.prototype;return e.set=function(t){t===q&&(t=this.compute()),L&&this.manager.element.style&&Q[t]&&(this.manager.element.style[N]=t),this.actions=t.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.compute=function(){var e=[];return mt(this.manager.recognizers,function(t){vt(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))}),function(t){if(gt(t,V))return V;var e=gt(t,B),n=gt(t,K);return e&&n?V:e||n?e?B:K:gt(t,U)?U:"auto"}(e.join(" "))},e.preventDefaults=function(t){var e=t.srcEvent,n=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var i=this.actions,r=gt(i,V)&&!Q[V],s=gt(i,K)&&!Q[K],o=gt(i,B)&&!Q[B];if(r){var a=1===t.pointers.length,h=t.distance<2,u=t.deltaTime<250;if(a&&h&&u)return}if(!o||!s)return r||s&&n&ct||o&&n<?this.preventSrc(e):void 0}},e.preventSrc=function(t){this.manager.session.prevented=!0,t.preventDefault()},t}();function bt(t,e){for(;t;){if(t===e)return!0;t=t.parentNode}return!1}function Et(t){var e=t.length;if(1===e)return{x:Y(t[0].clientX),y:Y(t[0].clientY)};for(var n=0,i=0,r=0;r<e;)n+=t[r].clientX,i+=t[r].clientY,r++;return{x:Y(n/e),y:Y(i/e)}}function xt(t){for(var e=[],n=0;n<t.pointers.length;)e[n]={clientX:Y(t.pointers[n].clientX),clientY:Y(t.pointers[n].clientY)},n++;return{timeStamp:X(),pointers:e,center:Et(e),deltaX:t.deltaX,deltaY:t.deltaY}}function wt(t,e,n){var i=e[(n=n||dt)[0]]-t[n[0]],r=e[n[1]]-t[n[1]];return Math.sqrt(i*i+r*r)}function Pt(t,e,n){var i=e[(n=n||dt)[0]]-t[n[0]],r=e[n[1]]-t[n[1]];return 180*Math.atan2(r,i)/Math.PI}function Tt(t,e){return t===e?st:W(t)>=W(e)?t<0?ot:at:e<0?ht:ut}function _t(t,e,n){return{x:e/t||0,y:n/t||0}}function Ot(t,e){var n=t.session,i=e.pointers,r=i.length;n.firstInput||(n.firstInput=xt(e)),1<r&&!n.firstMultiple?n.firstMultiple=xt(e):1===r&&(n.firstMultiple=!1);var s,o,a,h,u,c,l=n.firstInput,f=n.firstMultiple,d=f?f.center:l.center,p=e.center=Et(i);e.timeStamp=X(),e.deltaTime=e.timeStamp-l.timeStamp,e.angle=Pt(d,p),e.distance=wt(d,p),s=n,a=(o=e).center,h=s.offsetDelta||{},u=s.prevDelta||{},c=s.prevInput||{},o.eventType!==nt&&c.eventType!==it||(u=s.prevDelta={x:c.deltaX||0,y:c.deltaY||0},h=s.offsetDelta={x:a.x,y:a.y}),o.deltaX=u.x+(a.x-h.x),o.deltaY=u.y+(a.y-h.y),e.offsetDirection=Tt(e.deltaX,e.deltaY);var m,v,g,y,b,E,x,w,P,T,_,O,S,A,M,I=_t(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=I.x,e.overallVelocityY=I.y,e.overallVelocity=W(I.x)>W(I.y)?I.x:I.y,e.scale=f?(m=f.pointers,wt((v=i)[0],v[1],pt)/wt(m[0],m[1],pt)):1,e.rotation=f?(g=f.pointers,Pt((y=i)[1],y[0],pt)+Pt(g[1],g[0],pt)):0,e.maxPointers=!n.prevInput||e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers,E=e,A=(b=n).lastInterval||E,M=E.timeStamp-A.timeStamp,E.eventType!==rt&&(et<M||void 0===A.velocity)?(T=(P=_t(M,x=E.deltaX-A.deltaX,w=E.deltaY-A.deltaY)).x,_=P.y,O=W(P.x)>W(P.y)?P.x:P.y,S=Tt(x,w),b.lastInterval=E):(O=A.velocity,T=A.velocityX,_=A.velocityY,S=A.direction),E.velocity=O,E.velocityX=T,E.velocityY=_,E.direction=S;var D=t.element,R=e.srcEvent,C=R.composedPath?R.composedPath()[0]:R.path?R.path[0]:R.target;bt(C,D)&&(D=C),e.target=D}function St(t,e,n){var i=n.pointers.length,r=n.changedPointers.length,s=e&nt&&i-r==0,o=e&(it|rt)&&i-r==0;n.isFirst=!!s,n.isFinal=!!o,s&&(t.session={}),n.eventType=e,Ot(t,n),t.emit("hammer.input",n),t.recognize(n),t.session.prevInput=n}function At(t){return t.trim().split(/\s+/g)}function Mt(e,t,n){mt(At(t),function(t){e.addEventListener(t,n,!1)})}function It(e,t,n){mt(At(t),function(t){e.removeEventListener(t,n,!1)})}function Dt(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||window}var Rt=function(){function t(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){vt(e.options.enable,[e])&&n.handler(t)},this.init()}var e=t.prototype;return e.handler=function(){},e.init=function(){this.evEl&&Mt(this.element,this.evEl,this.domHandler),this.evTarget&&Mt(this.target,this.evTarget,this.domHandler),this.evWin&&Mt(Dt(this.element),this.evWin,this.domHandler)},e.destroy=function(){this.evEl&&It(this.element,this.evEl,this.domHandler),this.evTarget&&It(this.target,this.evTarget,this.domHandler),this.evWin&&It(Dt(this.element),this.evWin,this.domHandler)},t}();function Ct(t,e,n){if(t.indexOf&&!n)return t.indexOf(e);for(var i=0;i<t.length;){if(n&&t[i][n]==e||!n&&t[i]===e)return i;i++}return-1}var zt={pointerdown:nt,pointermove:2,pointerup:it,pointercancel:rt,pointerout:rt},Ft={2:$,3:"pen",4:tt,5:"kinect"},kt="pointerdown",Ht="pointermove pointerup pointercancel";z.MSPointerEvent&&!z.PointerEvent&&(kt="MSPointerDown",Ht="MSPointerMove MSPointerUp MSPointerCancel");var Yt=function(n){function i(){var t,e=i.prototype;return e.evEl=kt,e.evWin=Ht,(t=n.apply(this,arguments)||this).store=t.manager.session.pointerEvents=[],t}return R(i,n),i.prototype.handler=function(t){var e=this.store,n=!1,i=t.type.toLowerCase().replace("ms",""),r=zt[i],s=Ft[t.pointerType]||t.pointerType,o=s===$,a=Ct(e,t.pointerId,"pointerId");r&nt&&(0===t.button||o)?a<0&&(e.push(t),a=e.length-1):r&(it|rt)&&(n=!0),a<0||(e[a]=t,this.callback(this.manager,r,{pointers:e,changedPointers:[t],pointerType:s,srcEvent:t}),n&&e.splice(a,1))},i}(Rt);function Wt(t){return Array.prototype.slice.call(t,0)}function Xt(t,n,e){for(var i=[],r=[],s=0;s<t.length;){var o=n?t[s][n]:t[s];Ct(r,o)<0&&i.push(t[s]),r[s]=o,s++}return e&&(i=n?i.sort(function(t,e){return t[n]>e[n]}):i.sort()),i}var jt={touchstart:nt,touchmove:2,touchend:it,touchcancel:rt},Nt="touchstart touchmove touchend touchcancel",Lt=function(e){function n(){var t;return n.prototype.evTarget=Nt,(t=e.apply(this,arguments)||this).targetIds={},t}return R(n,e),n.prototype.handler=function(t){var e=jt[t.type],n=function(t,e){var n,i,r=Wt(t.touches),s=this.targetIds;if(e&(2|nt)&&1===r.length)return s[r[0].identifier]=!0,[r,r];var o=Wt(t.changedTouches),a=[],h=this.target;if(i=r.filter(function(t){return bt(t.target,h)}),e===nt)for(n=0;n<i.length;)s[i[n].identifier]=!0,n++;n=0;for(;n<o.length;)s[o[n].identifier]&&a.push(o[n]),e&(it|rt)&&delete s[o[n].identifier],n++;return a.length?[Xt(i.concat(a),"identifier",!0),a]:void 0}.call(this,t,e);n&&this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:$,srcEvent:t})},n}(Rt);var qt={mousedown:nt,mousemove:2,mouseup:it},Ut="mousedown",Vt="mousemove mouseup",Bt=function(n){function i(){var t,e=i.prototype;return e.evEl=Ut,e.evWin=Vt,(t=n.apply(this,arguments)||this).pressed=!1,t}return R(i,n),i.prototype.handler=function(t){var e=qt[t.type];e&nt&&0===t.button&&(this.pressed=!0),2&e&&1!==t.which&&(e=it),this.pressed&&(e&it&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:tt,srcEvent:t}))},i}(Rt),Kt=2500,Qt=25;function Gt(t){var e,n,i=t.changedPointers[0];i.identifier===this.primaryTouch&&(e={x:i.clientX,y:i.clientY},n=this.lastTouches,this.lastTouches.push(e),setTimeout(function(){var t=n.indexOf(e);-1<t&&n.splice(t,1)},Kt))}var Jt=function(){return function(n){function t(t,e){var s=n.call(this,t,e)||this;return s.handler=function(t,e,n){var i=n.pointerType===$,r=n.pointerType===tt;if(!(r&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)(function(t,e){t&nt?(this.primaryTouch=e.changedPointers[0].identifier,Gt.call(this,e)):t&(it|rt)&&Gt.call(this,e)}).call(C(C(s)),e,n);else if(r&&function(t){for(var e=t.srcEvent.clientX,n=t.srcEvent.clientY,i=0;i<this.lastTouches.length;i++){var r=this.lastTouches[i],s=Math.abs(e-r.x),o=Math.abs(n-r.y);if(s<=Qt&&o<=Qt)return!0}return!1}.call(C(C(s)),n))return;s.callback(t,e,n)}},s.touch=new Lt(s.manager,s.handler),s.mouse=new Bt(s.manager,s.handler),s.primaryTouch=null,s.lastTouches=[],s}return R(t,n),t.prototype.destroy=function(){this.touch.destroy(),this.mouse.destroy()},t}(Rt)}();function Zt(t,e,n){return Array.isArray(t)&&(mt(t,n[e],n),1)}var $t=1;function te(t,e){var n=e.manager;return n?n.get(t):t}function ee(t){return 16&t?"cancel":8&t?"end":4&t?"move":2&t?"start":""}var ne=function(){function t(t){void 0===t&&(t={}),this.options=D({enable:!0},t),this.id=$t++,this.manager=null,this.state=1,this.simultaneous={},this.requireFail=[]}var e=t.prototype;return e.set=function(t){return F(this.options,t),this.manager&&this.manager.touchAction.update(),this},e.recognizeWith=function(t){if(Zt(t,"recognizeWith",this))return this;var e=this.simultaneous;return e[(t=te(t,this)).id]||(e[t.id]=t).recognizeWith(this),this},e.dropRecognizeWith=function(t){return Zt(t,"dropRecognizeWith",this)||(t=te(t,this),delete this.simultaneous[t.id]),this},e.requireFailure=function(t){if(Zt(t,"requireFailure",this))return this;var e=this.requireFail;return-1===Ct(e,t=te(t,this))&&(e.push(t),t.requireFailure(this)),this},e.dropRequireFailure=function(t){if(Zt(t,"dropRequireFailure",this))return this;t=te(t,this);var e=Ct(this.requireFail,t);return-1<e&&this.requireFail.splice(e,1),this},e.hasRequireFailures=function(){return 0<this.requireFail.length},e.canRecognizeWith=function(t){return!!this.simultaneous[t.id]},e.emit=function(e){var n=this,t=this.state;function i(t){n.manager.emit(t,e)}t<8&&i(n.options.event+ee(t)),i(n.options.event),e.additionalEvent&&i(e.additionalEvent),8<=t&&i(n.options.event+ee(t))},e.tryEmit=function(t){if(this.canEmit())return this.emit(t);this.state=32},e.canEmit=function(){for(var t=0;t<this.requireFail.length;){if(!(33&this.requireFail[t].state))return!1;t++}return!0},e.recognize=function(t){var e=F({},t);if(!vt(this.options.enable,[this,e]))return this.reset(),void(this.state=32);56&this.state&&(this.state=1),this.state=this.process(e),30&this.state&&this.tryEmit(e)},e.process=function(){},e.getTouchAction=function(){},e.reset=function(){},t}(),ie=function(e){function t(t){return void 0===t&&(t={}),e.call(this,D({pointers:1},t))||this}R(t,e);var n=t.prototype;return n.attrTest=function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},n.process=function(t){var e=this.state,n=t.eventType,i=6&e,r=this.attrTest(t);return i&&(n&rt||!r)?16|e:i||r?n&it?8|e:2&e?4|e:2:32},t}(ne);function re(t){return t===ut?"down":t===ht?"up":t===ot?"left":t===at?"right":""}var se=function(n){function t(t){var e;return void 0===t&&(t={}),(e=n.call(this,D({event:"pan",threshold:10,pointers:1,direction:ft},t))||this).pX=null,e.pY=null,e}R(t,n);var e=t.prototype;return e.getTouchAction=function(){var t=this.options.direction,e=[];return t&ct&&e.push(K),t<&&e.push(B),e},e.directionTest=function(t){var e=this.options,n=!0,i=t.distance,r=t.direction,s=t.deltaX,o=t.deltaY;return r&e.direction||(i=e.direction&ct?(r=0===s?st:s<0?ot:at,n=s!==this.pX,Math.abs(t.deltaX)):(r=0===o?st:o<0?ht:ut,n=o!==this.pY,Math.abs(t.deltaY))),t.direction=r,n&&i>e.threshold&&r&e.direction},e.attrTest=function(t){return ie.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},e.emit=function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=re(t.direction);e&&(t.additionalEvent=this.options.event+e),n.prototype.emit.call(this,t)},t}(ie),oe=function(n){function t(t){return void 0===t&&(t={}),n.call(this,D({event:"pinch",threshold:0,pointers:2},t))||this}R(t,n);var e=t.prototype;return e.getTouchAction=function(){return[V]},e.attrTest=function(t){return n.prototype.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},e.emit=function(t){var e;1!==t.scale&&(e=t.scale<1?"in":"out",t.additionalEvent=this.options.event+e),n.prototype.emit.call(this,t)},t}(ie),ae={domEvents:!1,touchAction:q,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function he(n,i){var r,s=n.element;s.style&&(mt(n.options.cssProps,function(t,e){r=j(s.style,e),i?(n.oldCssProps[r]=s.style[r],s.style[r]=t):s.style[r]=n.oldCssProps[r]||""}),i||(n.oldCssProps={}))}var ue=function(){function t(t,e){var n,i,r=this;this.options=F({},ae,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=(i=(n=this).options.inputClass,new(i||(J?Yt:Z?Lt:G?Jt:Bt))(n,St)),this.touchAction=new yt(this,this.options.touchAction),he(this,!0),mt(this.options.recognizers,function(t){var e=r.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])},this)}var e=t.prototype;return e.set=function(t){return F(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},e.stop=function(t){this.session.stopped=t?2:1},e.recognize=function(t){var e,n=this.session;if(!n.stopped){this.touchAction.preventDefaults(t);var i=this.recognizers,r=n.curRecognizer;(!r||r&&8&r.state)&&(r=n.curRecognizer=null);for(var s=0;s<i.length;)e=i[s],2===n.stopped||r&&e!==r&&!e.canRecognizeWith(r)?e.reset():e.recognize(t),!r&&14&e.state&&(r=n.curRecognizer=e),s++}},e.get=function(t){if(t instanceof ne)return t;for(var e=this.recognizers,n=0;n<e.length;n++)if(e[n].options.event===t)return e[n];return null},e.add=function(t){if(Zt(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),(t.manager=this).touchAction.update(),t},e.remove=function(t){if(Zt(t,"remove",this))return this;var e,n,i=this.get(t);return!t||-1!==(n=Ct(e=this.recognizers,i))&&(e.splice(n,1),this.touchAction.update()),this},e.on=function(t,e){if(void 0===t||void 0===e)return this;var n=this.handlers;return mt(At(t),function(t){n[t]=n[t]||[],n[t].push(e)}),this},e.off=function(t,e){if(void 0===t)return this;var n=this.handlers;return mt(At(t),function(t){e?n[t]&&n[t].splice(Ct(n[t],e),1):delete n[t]}),this},e.emit=function(t,e){var n,i,r;this.options.domEvents&&(n=t,i=e,(r=document.createEvent("Event")).initEvent(n,!0,!0),(r.gesture=i).target.dispatchEvent(r));var s=this.handlers[t]&&this.handlers[t].slice();if(s&&s.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var o=0;o<s.length;)s[o](e),o++}},e.destroy=function(){this.element&&he(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},t}();function ce(i,t,e){var r="DEPRECATED METHOD: "+t+"\n"+e+" AT \n";return function(){var t=new Error("get-stack-trace"),e=t&&t.stack?t.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",n=window.console&&(window.console.warn||window.console.log);return n&&n.call(window.console,r,e),i.apply(this,arguments)}}var le=ce(function(t,e,n){for(var i=Object.keys(e),r=0;r<i.length;)(!n||n&&void 0===t[i[r]])&&(t[i[r]]=e[i[r]]),r++;return t},"extend","Use `assign`.");ce(function(t,e){return le(t,e,!0)},"merge","Use `assign`.");var fe="undefined"!=typeof window&&window||{},de=fe.navigator,pe={browser:[{criteria:"PhantomJS",identity:"PhantomJS"},{criteria:/Whale/,identity:"Whale",versionSearch:"Whale"},{criteria:/Edge/,identity:"Edge",versionSearch:"Edge"},{criteria:/MSIE|Trident|Windows Phone/,identity:"IE",versionSearch:"IEMobile|MSIE|rv"},{criteria:/MiuiBrowser/,identity:"MIUI Browser",versionSearch:"MiuiBrowser"},{criteria:/SamsungBrowser/,identity:"Samsung Internet",versionSearch:"SamsungBrowser"},{criteria:/SAMSUNG /,identity:"Samsung Internet",versionSearch:"Version"},{criteria:/Chrome|CriOS/,identity:"Chrome"},{criteria:/Android/,identity:"Android Browser",versionSearch:"Version"},{criteria:/iPhone|iPad/,identity:"Safari",versionSearch:"Version"},{criteria:"Apple",identity:"Safari",versionSearch:"Version"},{criteria:"Firefox",identity:"Firefox"}],os:[{criteria:/Windows Phone/,identity:"Windows Phone",versionSearch:"Windows Phone"},{criteria:"Windows 2000",identity:"Window",versionAlias:"5.0"},{criteria:/Windows NT/,identity:"Window",versionSearch:"Windows NT"},{criteria:/iPhone|iPad/,identity:"iOS",versionSearch:"iPhone OS|CPU OS"},{criteria:"Mac",versionSearch:"OS X",identity:"MAC"},{criteria:/Android/,identity:"Android"},{criteria:/Tizen/,identity:"Tizen"},{criteria:/Web0S/,identity:"WebOS"}],webview:[{criteria:/iPhone|iPad/,browserVersionSearch:"Version",webviewBrowserVersion:/-1/},{criteria:/iPhone|iPad|Android/,webviewToken:/NAVER|DAUM|; wv/}],defaultString:{browser:{version:"-1",name:"unknown"},os:{version:"-1",name:"unknown"}}};function me(t,e){for(var n=[],i=0;i<t.length;i++)e(t[i])&&n.push(t[i]);return n}var ve=void 0;function ge(t,e){return e&&e.test?!!e.test(t):-1<t.indexOf(e)}function ye(t,e){var n=me(t,function(t){return ge(ve,t.criteria)})[0];return n&&n.identity||e.name}function be(t,i){return me(t,function(t){var e=t.criteria,n=new RegExp(t.identity,"i").test(i);return!!(e?n&&ge(ve,e):n)})[0]}function Ee(t,e){var n=pe.defaultString.browser.version,i=new RegExp("("+t+")","i").exec(e);if(!i)return n;var r,s=i.index,o=i[0];return-1<s&&(r=s+o.length+1,n=e.substring(r).split(" ")[0].replace(/_/g,".").replace(/;|\)/g,"")),n}function xe(t){var e;if(t)return Ee((e=t,be(pe.browser,e)||{criteria:e,versionSearch:e,identity:e}).versionSearch||t,ve)}function we(){var e,t=pe.webview;return function(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return!0;return!1}(me(t,function(t){return ge(ve,t.criteria)}),function(t){return e=Ee(t.browserVersionSearch,ve),!(!ge(ve,t.webviewToken)&&!ge(e,t.webviewBrowserVersion))})}function Pe(t){var e,n=(e=t,be(pe.os,e)||{}),i=pe.defaultString.os.version,r=void 0;if(t){if(n.versionAlias)return n.versionAlias;var s=new RegExp("("+(n.versionSearch||t)+")\\s([\\d_\\.]+|\\d_0)","i");return s.exec(ve)&&(r=s.exec(ve)[2].replace(/_/g,".").replace(/;|\)/g,"")),r||i}}function Te(){var t=ye(pe.os,pe.defaultString.os);return{name:t,version:Pe(t)}}function _e(){var t=ye(pe.browser,pe.defaultString.browser);return{name:t,version:xe(t),webview:we()}}function Oe(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:de.userAgent;ve=t;var e={os:Te(),browser:_e(),isMobile:-1!==ve.indexOf("Mobi")};return e.browser.name=e.browser.name.toLowerCase(),e.os.name=e.os.name.toLowerCase(),e.os.version=e.os.version.toLowerCase(),"ios"===e.os.name&&e.browser.webview&&(e.browser.version="-1"),e}Oe.VERSION="2.1.6";var Se="ontouchstart"in r&&-1<Oe(r.navigator.userAgent).browser.name.indexOf("safari"),Ae=function(){if("undefined"==typeof document)return"";for(var t=(document.head||document.getElementsByTagName("head")[0]).style,e=["transform","webkitTransform","msTransform","mozTransform"],n=0,i=e.length;n<i;n++)if(e[n]in t)return e[n];return""}(),Me=function(r){function t(t,e,n){void 0===t&&(t={}),void 0===e&&(e={});var i=r.call(this)||this;return i.axis=t,i._inputs=[],i.options=v({easing:function(t){return 1-Math.pow(1-t,3)},interruptable:!0,maximumDuration:1/0,minimumDuration:0,deceleration:6e-4,round:null},e),i.itm=new A(i.options),i.axm=new M(i.axis,i.options),i.em=new S(i),i.am=new O(i),i.io=new I(i),i.em.setAnimationManager(i.am),n&&i.em.triggerChange(n),i}n(t,r);var e=t.prototype;return e.connect=function(t,e){var n,i="string"==typeof t?t.split(" "):t.concat();return~this._inputs.indexOf(e)&&this.disconnect(e),"hammer"in e&&((n=this._inputs.filter(function(t){return t.hammer&&t.element===e.element})).length&&(e.hammer=n[0].hammer)),e.mapAxes(i),e.connect(this.io),this._inputs.push(e),this},e.disconnect=function(t){var e;return t?0<=(e=this._inputs.indexOf(t))&&(this._inputs[e].disconnect(),this._inputs.splice(e,1)):(this._inputs.forEach(function(t){return t.disconnect()}),this._inputs=[]),this},e.get=function(t){return this.axm.get(t)},e.setTo=function(t,e){return void 0===e&&(e=0),this.am.setTo(t,e),this},e.setBy=function(t,e){return void 0===e&&(e=0),this.am.setBy(t,e),this},e.isBounceArea=function(t){return this.axm.isOutside(t)},e.destroy=function(){this.disconnect(),this.em.destroy()},t.VERSION="2.7.0",t.TRANSFORM=Ae,t.DIRECTION_NONE=st,t.DIRECTION_LEFT=ot,t.DIRECTION_RIGHT=at,t.DIRECTION_UP=ht,t.DIRECTION_DOWN=ut,t.DIRECTION_HORIZONTAL=ct,t.DIRECTION_VERTICAL=lt,t.DIRECTION_ALL=ft,t}(t),Ie="PointerEvent"in r||"MSPointerEvent"in r,De="ontouchstart"in r,Re="_EGJS_AXES_INPUTTYPE_";function Ce(i,t){return t.reduce(function(t,e,n){return i[n]&&(t[i[n]]=e),t},{})}function ze(t,e){try{return new ue(t,v({},e))}catch(t){return null}}function Fe(t){void 0===t&&(t=[]);var e=!1,n=!1,i=!1;return t.forEach(function(t){switch(t){case"mouse":n=!0;break;case"touch":e=De;break;case"pointer":i=Ie}}),i?Yt:e&&n?Jt:e?Lt:n?Bt:null}function ke(t,e,n){return n?!!(e===ft||e&t&&n&t):!!(e&t)}var He=function(){function t(t,e){if(this.axes=[],this.hammer=null,this.element=null,this.panRecognizer=null,this.isRightEdge=!1,this.rightEdgeTimer=0,this.panFlag=!1,void 0===ue)throw new Error("The Hammerjs must be loaded before eg.Axes.PanInput.\nhttp://hammerjs.github.io/");this.element=h(t),this.options=v({inputType:["touch","mouse","pointer"],scale:[1,1],thresholdAngle:45,threshold:0,iOSEdgeSwipeThreshold:30,hammerManagerOptions:{cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",userDrag:"none"}}},e),this.onHammerInput=this.onHammerInput.bind(this),this.onPanmove=this.onPanmove.bind(this),this.onPanend=this.onPanend.bind(this)}var e=t.prototype;return e.mapAxes=function(t){var e=!!t[0],n=!!t[1];this._direction=e&&n?ft:e?ct:n?lt:st,this.axes=t},e.connect=function(t){var e={direction:this._direction,threshold:this.options.threshold};if(this.hammer)this.removeRecognizer(),this.dettachEvent();else{var n=(n=this.element[Re])||String(Math.round(Math.random()*(new Date).getTime())),i=Fe(this.options.inputType);if(!i)throw new Error("Wrong inputType parameter!");this.hammer=ze(this.element,v({inputClass:i},this.options.hammerManagerOptions)),this.element[Re]=n}return this.panRecognizer=new se(e),this.hammer.add(this.panRecognizer),this.attachEvent(t),this},e.disconnect=function(){return this.removeRecognizer(),this.hammer&&this.dettachEvent(),this._direction=st,this},e.destroy=function(){this.disconnect(),this.hammer&&0===this.hammer.recognizers.length&&this.hammer.destroy(),delete this.element[Re],this.element=null,this.hammer=null},e.enable=function(){return this.hammer&&(this.hammer.get("pan").options.enable=!0),this},e.disable=function(){return this.hammer&&(this.hammer.get("pan").options.enable=!1),this},e.isEnable=function(){return!(!this.hammer||!this.hammer.get("pan").options.enable)},e.removeRecognizer=function(){this.hammer&&this.panRecognizer&&(this.hammer.remove(this.panRecognizer),this.panRecognizer=null)},e.onHammerInput=function(t){var e;this.isEnable()&&(t.isFirst?(this.panFlag=!1)!==t.srcEvent.cancelable&&(e=this.options.iOSEdgeSwipeThreshold,this.observer.hold(this,t),this.isRightEdge=Se&&t.center.x>window.innerWidth-e,this.panFlag=!0):t.isFinal&&this.onPanend(t))},e.onPanmove=function(t){var e=this;if(this.panFlag){var n,i=function(t,e){if(e<0||90<e)return st;var n=Math.abs(t);return e<n&&n<180-e?lt:ct}(t.angle,this.options.thresholdAngle),r=this.hammer.session.prevInput;if(r&&Se){if(t.center.x<0)return void this.onPanend(v({},r,{velocityX:0,velocityY:0,offsetX:0,offsetY:0}));this.isRightEdge&&(clearTimeout(this.rightEdgeTimer),n=this.options.iOSEdgeSwipeThreshold,t.deltaX<-n?this.isRightEdge=!1:this.rightEdgeTimer=window.setTimeout(function(){e.onPanend(v({},r,{velocityX:0,velocityY:0,offsetX:0,offsetY:0}))},100))}r?(t.offsetX=t.deltaX-r.deltaX,t.offsetY=t.deltaY-r.deltaY):(t.offsetX=0,t.offsetY=0);var s,o=this.getOffset([t.offsetX,t.offsetY],[ke(ct,this._direction,i),ke(lt,this._direction,i)]),a=o.some(function(t){return 0!==t});a&&(!1!==(s=t.srcEvent).cancelable&&s.preventDefault(),s.stopPropagation()),(t.preventSystemEvent=a)&&this.observer.change(this,t,Ce(this.axes,o))}},e.onPanend=function(t){var e,n,i,r,s;this.panFlag&&(clearTimeout(this.rightEdgeTimer),this.panFlag=!1,e=this.getOffset([Math.abs(t.velocityX)*(t.deltaX<0?-1:1),Math.abs(t.velocityY)*(t.deltaY<0?-1:1)],[ke(ct,this._direction),ke(lt,this._direction)]),n=e,i=this.observer.options.deceleration,r=Math.sqrt(n[0]*n[0]+n[1]*n[1]),s=Math.abs(r/-i),e=[n[0]/2*s,n[1]/2*s],this.observer.release(this,t,Ce(this.axes,e)))},e.attachEvent=function(t){this.observer=t,this.hammer.on("hammer.input",this.onHammerInput).on("panstart panmove",this.onPanmove)},e.dettachEvent=function(){this.hammer.off("hammer.input",this.onHammerInput).off("panstart panmove",this.onPanmove),this.observer=null},e.getOffset=function(t,e){var n=[0,0],i=this.options.scale;return e[0]&&(n[0]=t[0]*i[0]),e[1]&&(n[1]=t[1]*i[1]),n},t}(),Ye=function(i){function t(t,e){var n=i.call(this,t,e)||this;return n.prevQuadrant=null,n.lastDiff=0,n}n(t,i);var e=t.prototype;return e.mapAxes=function(t){this._direction=Me.DIRECTION_ALL,this.axes=t},e.onHammerInput=function(t){this.isEnable()&&(t.isFirst?(this.observer.hold(this,t),this.onPanstart(t)):t.isFinal&&this.onPanend(t))},e.onPanstart=function(t){var e=this.element.getBoundingClientRect();this.coefficientForDistanceToAngle=360/(e.width*Math.PI),this.rotateOrigin=[e.left+(e.width-1)/2,e.top+(e.height-1)/2],this.prevAngle=null,this.triggerChange(t)},e.onPanmove=function(t){this.triggerChange(t)},e.onPanend=function(t){this.triggerChange(t),this.triggerAnimation(t)},e.triggerChange=function(t){var e=this.getAngle(t.center.x,t.center.y),n=this.getQuadrant(t.center.x,t.center.y),i=this.getDifference(this.prevAngle,e,this.prevQuadrant,n);this.prevAngle=e,this.prevQuadrant=n,0!==i&&(this.lastDiff=i,this.observer.change(this,t,Ce(this.axes,[-i])))},e.triggerAnimation=function(t){var e=t.velocityX,n=t.velocityY,i=Math.sqrt(e*e+n*n)*(0<this.lastDiff?-1:1),r=i/2*Math.abs(i/-this.observer.options.deceleration);this.observer.release(this,t,Ce(this.axes,[r*this.coefficientForDistanceToAngle]))},e.getDifference=function(t,e,n,i){var r=null===t?0:1===n&&4===i?-t-(360-e):4===n&&1===i?360-t+e:e-t;return r},e.getPosFromOrigin=function(t,e){return{x:t-this.rotateOrigin[0],y:this.rotateOrigin[1]-e}},e.getAngle=function(t,e){var n=this.getPosFromOrigin(t,e),i=n.x,r=n.y,s=180*Math.atan2(r,i)/Math.PI;return s<0?360+s:s},e.getQuadrant=function(t,e){var n=this.getPosFromOrigin(t,e),i=n.x,r=n.y,s=0;return 0<=i&&0<=r?s=1:i<0&&0<=r?s=2:i<0&&r<0?s=3:0<=i&&r<0&&(s=4),s},t}(He),We=function(){function t(t,e){if(this.axes=[],this.hammer=null,this.element=null,this._base=null,this._prev=null,this.pinchRecognizer=null,void 0===ue)throw new Error("The Hammerjs must be loaded before eg.Axes.PinchInput.\nhttp://hammerjs.github.io/");this.element=h(t),this.options=v({scale:1,threshold:0,inputType:["touch","pointer"],hammerManagerOptions:{cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",userDrag:"none"}}},e),this.onPinchStart=this.onPinchStart.bind(this),this.onPinchMove=this.onPinchMove.bind(this),this.onPinchEnd=this.onPinchEnd.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this.axes=t},e.connect=function(t){var e={threshold:this.options.threshold};if(this.hammer)this.removeRecognizer(),this.dettachEvent();else{var n=(n=this.element[Re])||String(Math.round(Math.random()*(new Date).getTime())),i=Fe(this.options.inputType);if(!i)throw new Error("Wrong inputType parameter!");this.hammer=ze(this.element,v({inputClass:i},this.options.hammerManagerOptions)),this.element[Re]=n}return this.pinchRecognizer=new oe(e),this.hammer.add(this.pinchRecognizer),this.attachEvent(t),this},e.disconnect=function(){return this.removeRecognizer(),this.hammer&&(this.hammer.remove(this.pinchRecognizer),this.pinchRecognizer=null,this.dettachEvent()),this},e.destroy=function(){this.disconnect(),this.hammer&&0===this.hammer.recognizers.length&&this.hammer.destroy(),delete this.element[Re],this.element=null,this.hammer=null},e.removeRecognizer=function(){this.hammer&&this.pinchRecognizer&&(this.hammer.remove(this.pinchRecognizer),this.pinchRecognizer=null)},e.onPinchStart=function(t){this._base=this.observer.get(this)[this.axes[0]];var e=this.getOffset(t.scale);this.observer.hold(this,t),this.observer.change(this,t,Ce(this.axes,[e])),this._prev=t.scale},e.onPinchMove=function(t){var e=this.getOffset(t.scale,this._prev);this.observer.change(this,t,Ce(this.axes,[e])),this._prev=t.scale},e.onPinchEnd=function(t){var e=this.getOffset(t.scale,this._prev);this.observer.change(this,t,Ce(this.axes,[e])),this.observer.release(this,t,Ce(this.axes,[0]),0),this._base=null,this._prev=null},e.getOffset=function(t,e){return void 0===e&&(e=1),this._base*(t-e)*this.options.scale},e.attachEvent=function(t){this.observer=t,this.hammer.on("pinchstart",this.onPinchStart).on("pinchmove",this.onPinchMove).on("pinchend",this.onPinchEnd)},e.dettachEvent=function(){this.hammer.off("pinchstart",this.onPinchStart).off("pinchmove",this.onPinchMove).off("pinchend",this.onPinchEnd),this.observer=null,this._prev=null},e.enable=function(){return this.hammer&&(this.hammer.get("pinch").options.enable=!0),this},e.disable=function(){return this.hammer&&(this.hammer.get("pinch").options.enable=!1),this},e.isEnable=function(){return!(!this.hammer||!this.hammer.get("pinch").options.enable)},t}(),Xe=function(){function t(t,e){this.axes=[],this.element=null,this._isEnabled=!1,this._isHolded=!1,this._timer=null,this.element=h(t),this.options=v({scale:1,useNormalized:!0},e),this.onWheel=this.onWheel.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this.axes=t},e.connect=function(t){return this.dettachEvent(),this.attachEvent(t),this},e.disconnect=function(){return this.dettachEvent(),this},e.destroy=function(){this.disconnect(),this.element=null},e.onWheel=function(t){var e,n=this;this._isEnabled&&(t.preventDefault(),0!==t.deltaY&&(this._isHolded||(this.observer.hold(this,t),this._isHolded=!0),e=(0<t.deltaY?-1:1)*this.options.scale*(this.options.useNormalized?1:Math.abs(t.deltaY)),this.observer.change(this,t,Ce(this.axes,[e])),clearTimeout(this._timer),this._timer=setTimeout(function(){n._isHolded&&(n._isHolded=!1,n.observer.release(n,t,Ce(n.axes,[0])))},50)))},e.attachEvent=function(t){this.observer=t,this.element.addEventListener("wheel",this.onWheel),this._isEnabled=!0},e.dettachEvent=function(){this.element.removeEventListener("wheel",this.onWheel),this._isEnabled=!1,this.observer=null,this._timer&&(clearTimeout(this._timer),this._timer=null)},e.enable=function(){return this._isEnabled=!0,this},e.disable=function(){return this._isEnabled=!1,this},e.isEnable=function(){return this._isEnabled},t}(),je=function(){function t(t,e){this.axes=[],this.element=null,this._isEnabled=!1,this._isHolded=!1,this._timer=null,this.element=h(t),this.options=v({scale:[1,1]},e),this.onKeydown=this.onKeydown.bind(this),this.onKeyup=this.onKeyup.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this.axes=t},e.connect=function(t){return this.dettachEvent(),"0"!==this.element.getAttribute("tabindex")&&this.element.setAttribute("tabindex","0"),this.attachEvent(t),this},e.disconnect=function(){return this.dettachEvent(),this},e.destroy=function(){this.disconnect(),this.element=null},e.onKeydown=function(t){if(this._isEnabled){var e,n=!0,i=1,r=-1;switch(t.keyCode){case 37:case 65:i=-1;break;case 39:case 68:break;case 40:case 83:i=-1,r=1;break;case 38:case 87:r=1;break;default:n=!1}(-1===r&&!this.axes[0]||1===r&&!this.axes[1])&&(n=!1),n&&(e=-1===r?[this.options.scale[0]*i,0]:[0,this.options.scale[1]*i],this._isHolded||(this.observer.hold(this,event),this._isHolded=!0),clearTimeout(this._timer),this.observer.change(this,event,Ce(this.axes,e)))}},e.onKeyup=function(t){var e=this;this._isHolded&&(clearTimeout(this._timer),this._timer=setTimeout(function(){e.observer.release(e,t,Ce(e.axes,[0,0])),e._isHolded=!1},80))},e.attachEvent=function(t){this.observer=t,this.element.addEventListener("keydown",this.onKeydown,!1),this.element.addEventListener("keypress",this.onKeydown,!1),this.element.addEventListener("keyup",this.onKeyup,!1),this._isEnabled=!0},e.dettachEvent=function(){this.element.removeEventListener("keydown",this.onKeydown,!1),this.element.removeEventListener("keypress",this.onKeydown,!1),this.element.removeEventListener("keyup",this.onKeyup,!1),this._isEnabled=!1,this.observer=null},e.enable=function(){return this._isEnabled=!0,this},e.disable=function(){return this._isEnabled=!1,this},e.isEnable=function(){return this._isEnabled},t}();return Me.PanInput=He,Me.RotatePanInput=Ye,Me.PinchInput=We,Me.WheelInput=Xe,Me.MoveKeyInput=je,Me}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t.eg=t.eg||{},t.eg.Axes=e())}(this,function(){"use strict";var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function n(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var v=function(){return(v=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function a(t){return void 0===t}var r,t=function(){var t=function(){function t(){this._eventHandler={},this.options={}}var e=t.prototype;return e.trigger=function(t,e){void 0===e&&(e={});var n=this._eventHandler[t]||[];if(!(0<n.length))return!0;n=n.concat(),e.eventType=t;var i=!1,r=[e],s=0;e.stop=function(){i=!0},e.currentTarget=this;for(var o=arguments.length,a=new Array(2<o?o-2:0),h=2;h<o;h++)a[h-2]=arguments[h];for(1<=a.length&&(r=r.concat(a)),s=0;n[s];s++)n[s].apply(this,r);return!i},e.once=function(r,s){if("object"==typeof r&&a(s)){var t,e=r;for(t in e)this.once(t,e[t]);return this}var o;return"string"==typeof r&&"function"==typeof s&&(o=this).on(r,function t(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];s.apply(o,n),o.off(r,t)}),this},e.hasOn=function(t){return!!this._eventHandler[t]},e.on=function(t,e){if("object"==typeof t&&a(e)){var n,i=t;for(n in i)this.on(n,i[n]);return this}var r;return"string"==typeof t&&"function"==typeof e&&(a(r=this._eventHandler[t])&&(this._eventHandler[t]=[],r=this._eventHandler[t]),r.push(e)),this},e.off=function(t,e){if(a(t))return this._eventHandler={},this;if(a(e)){if("string"==typeof t)return this._eventHandler[t]=void 0,this;var n,i=t;for(n in i)this.off(n,i[n]);return this}var r=this._eventHandler[t];if(r)for(var s,o=0;void 0!==(s=r[o]);o++)if(s===e){r=r.splice(o,1);break}return this},t}();return t.VERSION="2.1.2",t}();function p(t,e,n,i){var r=t,s=[!n[0]&&i?e[0]-i[0]:e[0],!n[1]&&i?e[1]+i[1]:e[1]],r=Math.max(s[0],r);return Math.min(s[1],r)}function s(t,e){return t<e[0]||t>e[1]}function u(t,e,n){return n[1]&&t>e[1]||n[0]&&t<e[0]}function g(t,e,n){var i=t,r=e[0],s=e[1],o=s-r;return n[1]&&s<t&&(i=(i-s)%o+r),n[0]&&t<r&&(i=(i-r)%o+s),i}function o(t){for(var e=[],n=0,i=t.length;n<i;n++)e.push(t[n]);return e}function h(t,e){var n,i;return void 0===e&&(e=!1),"string"==typeof t?(i=t.match(/^<([a-z]+)\s*([^>]*)>/)?((n=document.createElement("div")).innerHTML=t,o(n.childNodes)):o(document.querySelectorAll(t)),e||(i=1<=i.length?i[0]:void 0)):t!==r&&(!t.nodeName||1!==t.nodeType&&9!==t.nodeType)?"jQuery"in r&&t instanceof jQuery||t.constructor.prototype.jquery?i=e?t.toArray():t.get(0):Array.isArray(t)&&(i=t.map(function(t){return h(t)}),e||(i=1<=i.length?i[0]:void 0)):i=t,i}var c,l,y=(r="undefined"==typeof window?{navigator:{userAgent:""}}:window).requestAnimationFrame||r.webkitRequestAnimationFrame,f=r.cancelAnimationFrame||r.webkitCancelAnimationFrame;function b(t,e){var n={};for(var i in t)i&&(n[i]=e(t[i],i));return n}function d(t,e){var n={};for(var i in t)i&&e(t[i],i)&&(n[i]=t[i]);return n}function m(t,e){for(var n in t)if(n&&!e(t[n],n))return!1;return!0}function x(t,n){return m(t,function(t,e){return t===n[e]})}y&&!f?(c={},l=y,y=function(e){var n=l(function(t){c[n]&&e(t)});return c[n]=!0,n},f=function(t){delete c[t]}):y&&f||(y=function(t){return r.setTimeout(function(){t(r.performance&&r.performance.now&&r.performance.now()||(new Date).getTime())},16)},f=r.clearTimeout);var w={};function E(t,e){var n,i;return w[e]||(w[e]=(i=(n=e)<1?Math.pow(10,P(n)):1,function(t){return 0===n?0:Math.round(Math.round(t/n)*n*i)/i})),w[e](t)}function T(t,n){if(!t||!n)return t;var i="number"==typeof n;return b(t,function(t,e){return E(t,i?n:n[e])})}function P(t){if(!isFinite(t))return 0;var e=t+"";if(0<=e.indexOf("e")){for(var n=0,i=1;Math.round(t*i)/i!==t;)i*=10,n++;return n}return 0<=e.indexOf(".")?e.length-e.indexOf(".")-1:0}function _(t,e,n){return Math.max(Math.min(t,n),e)}var O=function(){function t(t){var e=t.options,n=t.itm,i=t.em,r=t.axm;this.options=e,this.itm=n,this.em=i,this.axm=r,this.animationEnd=this.animationEnd.bind(this)}var e=t.prototype;return e.getDuration=function(s,t,e){var n,o=this;return _(void 0!==e?e:(n=b(t,function(t,e){return n=Math.abs(t-s[e]),i=o.options.deceleration,(r=Math.sqrt(n/i*2))<100?0:r;var n,i,r}),Object.keys(n).reduce(function(t,e){return Math.max(t,n[e])},-1/0)),this.options.minimumDuration,this.options.maximumDuration)},e.createAnimationParam=function(t,e,n){var i=this.axm.get(),r=t,s=n&&n.event||null;return{depaPos:i,destPos:r,duration:_(e,this.options.minimumDuration,this.options.maximumDuration),delta:this.axm.getDelta(i,r),inputEvent:s,input:n&&n.input||null,isTrusted:!!s,done:this.animationEnd}},e.grab=function(t,e){var n,i,r;this._animateParam&&t.length&&(n=this.axm.get(t),m(i=this.axm.map(n,function(t,e){return g(t,e.range,e.circular)}),function(t,e){return n[e]===t})||this.em.triggerChange(i,!1,n,e,!!e),this._animateParam=null,this._raf&&(r=this._raf,f(r)),this._raf=null,this.em.triggerAnimationEnd(!(!e||!e.event)))},e.getEventInfo=function(){return this._animateParam&&this._animateParam.input&&this._animateParam.inputEvent?{input:this._animateParam.input,event:this._animateParam.inputEvent}:null},e.restore=function(t){var e=this.axm.get(),n=this.axm.map(e,function(t,e){return Math.min(e.range[1],Math.max(e.range[0],t))});this.animateTo(n,this.getDuration(e,n),t)},e.animationEnd=function(){var t=this.getEventInfo();this._animateParam=null;var e=this.axm.filter(this.axm.get(),function(t,e){return u(t,e.range,e.circular)});0<Object.keys(e).length&&this.setTo(this.axm.map(e,function(t,e){return g(t,e.range,e.circular)})),this.itm.setInterrupt(!1),this.em.triggerAnimationEnd(!!t),this.axm.isOutside()?this.restore(t):this.finish(!!t)},e.finish=function(t){this._animateParam=null,this.itm.setInterrupt(!1),this.em.triggerFinish(t)},e.animateLoop=function(r,s){var h,u,c,l,p,f,d,m;r.duration?(this._animateParam=v({},r),h=this._animateParam,u=this,c=h.destPos,l=h.depaPos,p=0,f=b(l,function(t,e){return t<=c[e]?1:-1}),d=b(c,function(t){return t}),m=(new Date).getTime(),h.startTime=m,function t(){u._raf=null;var e=(new Date).getTime(),o=(e-h.startTime)/r.duration,a=u.easing(o),n=u.axm.map(l,function(t,e,n){var i,r=1<=o?c[n]:t+h.delta[n]*(a-p),s=g(r,e.range,e.circular);return r!==s&&(i=f[n]*(e.range[1]-e.range[0]),c[n]-=i,l[n]-=i),s}),i=!u.em.triggerChange(n,!1,l);if(l=n,m=e,1<=(p=a))return x(c=u.getFinalPos(c,d),u.axm.get(Object.keys(c)))||u.em.triggerChange(c,!0,l),void s();i?u.finish(!1):u._raf=y(t)}()):(this.em.triggerChange(r.destPos,!0),s())},e.getFinalPos=function(t,n){var i=this;return b(t,function(t,e){return t>=n[e]-1e-6&&t<=n[e]+1e-6?n[e]:E(t,i.getRoundUnit(t,e))})},e.getRoundUnit=function(t,e){var n,i,r=this.options.round,s=null;return r||(n=this.axm.getAxisOptions(e),i=Math.max(P(n.range[0]),P(n.range[1]),P(t)),s=1/Math.pow(10,i)),s||r},e.getUserControll=function(t){var e=t.setTo();return e.destPos=this.axm.get(e.destPos),e.duration=_(e.duration,this.options.minimumDuration,this.options.maximumDuration),e},e.animateTo=function(t,e,n){var i,r=this,s=this.createAnimationParam(t,e,n),o=v({},s.depaPos),a=this.em.triggerAnimationStart(s),h=this.getUserControll(s);!a&&this.axm.every(h.destPos,function(t,e){return u(t,e.range,e.circular)})&&console.warn("You can't stop the 'animation' event when 'circular' is true."),a&&!x(h.destPos,o)&&(i=n&&n.event||null,this.animateLoop({depaPos:o,destPos:h.destPos,duration:h.duration,delta:this.axm.getDelta(o,h.destPos),isTrusted:!!i,inputEvent:i,input:n&&n.input||null},function(){return r.animationEnd()}))},e.easing=function(t){return 1<t?1:this.options.easing(t)},e.setTo=function(t,e){void 0===e&&(e=0);var n=Object.keys(t);this.grab(n);var i=this.axm.get(n);if(x(t,i))return this;this.itm.setInterrupt(!0);var r=d(t,function(t,e){return i[e]!==t});return Object.keys(r).length&&(x(r=this.axm.map(r,function(t,e){var n=e.range,i=e.circular;return i&&(i[0]||i[1])?t:p(t,n,i)}),i)||(0<e?this.animateTo(r,e):(this.em.triggerChange(r),this.finish(!1)))),this},e.setBy=function(n,t){return void 0===t&&(t=0),this.setTo(b(this.axm.get(Object.keys(n)),function(t,e){return t+n[e]}),t)},t}(),A=function(){function t(t){this.axes=t}var e=t.prototype;return e.triggerHold=function(t,e){var n=this.getRoundPos(t).roundPos;this.axes.trigger("hold",{pos:n,input:e.input||null,inputEvent:e.event||null,isTrusted:!0})},e.triggerRelease=function(t){var e=this.getRoundPos(t.destPos,t.depaPos),n=e.roundPos,i=e.roundDepa;t.destPos=n,t.depaPos=i,t.setTo=this.createUserControll(t.destPos,t.duration),this.axes.trigger("release",t)},e.triggerChange=function(t,e,n,i,r){void 0===r&&(r=!1);var s=this.am,o=s.axm,a=s.getEventInfo(),h=this.getRoundPos(t,n),u=h.roundPos,c=h.roundDepa,l=o.moveTo(u,c),p=i&&i.event||a&&a.event||null,f={pos:l.pos,delta:l.delta,holding:r,inputEvent:p,isTrusted:!!p,input:i&&i.input||a&&a.input||null,set:p?this.createUserControll(l.pos):function(){}},d=this.axes.trigger("change",f);return p&&o.set(f.set().destPos),d},e.triggerAnimationStart=function(t){var e=this.getRoundPos(t.destPos,t.depaPos),n=e.roundPos,i=e.roundDepa;return t.destPos=n,t.depaPos=i,t.setTo=this.createUserControll(t.destPos,t.duration),this.axes.trigger("animationStart",t)},e.triggerAnimationEnd=function(t){void 0===t&&(t=!1),this.axes.trigger("animationEnd",{isTrusted:t})},e.triggerFinish=function(t){void 0===t&&(t=!1),this.axes.trigger("finish",{isTrusted:t})},e.createUserControll=function(t,e){void 0===e&&(e=0);var n={destPos:v({},t),duration:e};return function(t,e){return t&&(n.destPos=v({},t)),void 0!==e&&(n.duration=e),n}},e.setAnimationManager=function(t){this.am=t},e.destroy=function(){this.axes.off()},e.getRoundPos=function(t,e){var n=this.axes.options.round;return{roundPos:T(t,n),roundDepa:T(e,n)}},t}(),D=function(){function t(t){this.options=t,this._prevented=!1}var e=t.prototype;return e.isInterrupting=function(){return this.options.interruptable||this._prevented},e.isInterrupted=function(){return!this.options.interruptable&&this._prevented},e.setInterrupt=function(t){this.options.interruptable||(this._prevented=t)},t}(),I=function(){function t(t,e){var n=this;this.axis=t,this.options=e,this._complementOptions(),this._pos=Object.keys(this.axis).reduce(function(t,e){return t[e]=n.axis[e].range[0],t},{})}var e=t.prototype;return e._complementOptions=function(){var r=this;Object.keys(this.axis).forEach(function(i){r.axis[i]=v({range:[0,100],bounce:[0,0],circular:[!1,!1]},r.axis[i]),["bounce","circular"].forEach(function(t){var e=r.axis,n=e[i][t];/string|number|boolean/.test(typeof n)&&(e[i][t]=[n,n])})})},e.getDelta=function(t,e){var n=this.get(t);return b(this.get(e),function(t,e){return t-n[e]})},e.get=function(t){var n=this;return t&&Array.isArray(t)?t.reduce(function(t,e){return e&&e in n._pos&&(t[e]=n._pos[e]),t},{}):v({},this._pos,t||{})},e.moveTo=function(n,i){void 0===i&&(i=this._pos);var t=b(this._pos,function(t,e){return e in n&&e in i?n[e]-i[e]:0});return this.set(this.map(n,function(t,e){return e?g(t,e.range,e.circular):0})),{pos:v({},this._pos),delta:t}},e.set=function(t){for(var e in t)e&&e in this._pos&&(this._pos[e]=t[e])},e.every=function(t,n){var i=this.axis;return m(t,function(t,e){return n(t,i[e],e)})},e.filter=function(t,n){var i=this.axis;return d(t,function(t,e){return n(t,i[e],e)})},e.map=function(t,n){var i=this.axis;return b(t,function(t,e){return n(t,i[e],e)})},e.isOutside=function(t){return!this.every(t?this.get(t):this._pos,function(t,e){return!s(t,e.range)})},e.getAxisOptions=function(t){return this.axis[t]},t}(),M=function(){function t(t){var e=t.options,n=t.itm,i=t.em,r=t.axm,s=t.am;this.isOutside=!1,this.moveDistance=null,this.isStopped=!1,this.options=e,this.itm=n,this.em=i,this.axm=r,this.am=s}var e=t.prototype;return e.atOutside=function(t){var o=this;if(this.isOutside)return this.axm.map(t,function(t,e){var n=e.range[0]-e.bounce[0],i=e.range[1]+e.bounce[1];return i<t?i:t<n?n:t});var a=this.am.easing(1e-5)/1e-5;return this.axm.map(t,function(t,e){var n=e.range[0],i=e.range[1],r=e.bounce,s=e.circular;return s&&(s[0]||s[1])?t:t<n?n-o.am.easing((n-t)/(r[0]*a))*r[0]:i<t?i+o.am.easing((t-i)/(r[1]*a))*r[1]:t})},e.get=function(t){return this.axm.get(t.axes)},e.hold=function(t,e){var n;!this.itm.isInterrupted()&&t.axes.length&&(n={input:t,event:e},this.isStopped=!1,this.itm.setInterrupt(!0),this.am.grab(t.axes,n),this.moveDistance||this.em.triggerHold(this.axm.get(),n),this.isOutside=this.axm.isOutside(t.axes),this.moveDistance=this.axm.get(t.axes))},e.change=function(t,e,n){var i,r;this.isStopped||!this.itm.isInterrupting()||this.axm.every(n,function(t){return 0===t})||(r=b(i=this.moveDistance||this.axm.get(t.axes),function(t,e){return t+(n[e]||0)}),this.moveDistance&&(this.moveDistance=r),this.isOutside&&this.axm.every(i,function(t,e){return!s(t,e.range)})&&(this.isOutside=!1),i=this.atOutside(i),r=this.atOutside(r),this.em.triggerChange(r,!1,i,{input:t,event:e},!0)||(this.isStopped=!0,this.moveDistance=null,this.am.finish(!1)))},e.release=function(t,e,n,i){var r,s,o,a,h,u,c,l;!this.isStopped&&this.itm.isInterrupting()&&this.moveDistance&&(r=this.axm.get(t.axes),s=this.axm.get(),o=this.axm.get(this.axm.map(n,function(t,e,n){return e.circular&&(e.circular[0]||e.circular[1])?r[n]+t:p(r[n]+t,e.range,e.circular,e.bounce)})),0===(a=this.am.getDuration(o,r,i))&&(o=v({},s)),h={depaPos:s,destPos:o,duration:a,delta:this.axm.getDelta(s,o),inputEvent:e,input:t,isTrusted:!0},this.em.triggerRelease(h),this.moveDistance=null,l={input:t,event:e},(c=x((u=this.am.getUserControll(h)).destPos,s))||0===u.duration?(c||this.em.triggerChange(u.destPos,!1,s,l,!0),this.itm.setInterrupt(!1),this.axm.isOutside()?this.am.restore(l):this.em.triggerFinish(!0)):this.am.animateTo(u.destPos,u.duration,l))},t}();function R(){return(R=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 C(t,e){t.prototype=Object.create(e.prototype),(t.prototype.constructor=t).__proto__=e}function S(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var z,k="function"!=typeof Object.assign?function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var i=arguments[n];if(null!=i)for(var r in i)i.hasOwnProperty(r)&&(e[r]=i[r])}return e}:Object.assign,F=["","webkit","Moz","MS","ms","o"],e="undefined"==typeof document?{style:{}}:document.createElement("div"),H="function",j=Math.round,Y=Math.abs,X=Date.now;function L(t,e){for(var n,i,r=e[0].toUpperCase()+e.slice(1),s=0;s<F.length;){if((i=(n=F[s])?n+r:e)in t)return i;s++}}z="undefined"==typeof window?{}:window;var W=L(e.style,"touchAction"),N=void 0!==W;var q="compute",V="manipulation",U="none",K="pan-x",Q="pan-y",B=function(){if(!N)return!1;var e={},n=z.CSS&&z.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(t){return e[t]=!n||z.CSS.supports("touch-action",t)}),e}(),G="ontouchstart"in z,Z=void 0!==L(z,"PointerEvent"),J=G&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),$="touch",tt="mouse",et=25,nt=1,it=4,rt=8,st=1,ot=2,at=4,ht=8,ut=16,ct=ot|at,lt=ht|ut,pt=ct|lt,ft=["x","y"],dt=["clientX","clientY"];function mt(t,e,n){var i;if(t)if(t.forEach)t.forEach(e,n);else if(void 0!==t.length)for(i=0;i<t.length;)e.call(n,t[i],i,t),i++;else for(i in t)t.hasOwnProperty(i)&&e.call(n,t[i],i,t)}function vt(t,e){return typeof t===H?t.apply(e&&e[0]||void 0,e):t}function gt(t,e){return-1<t.indexOf(e)}var yt=function(){function t(t,e){this.manager=t,this.set(e)}var e=t.prototype;return e.set=function(t){t===q&&(t=this.compute()),N&&this.manager.element.style&&B[t]&&(this.manager.element.style[W]=t),this.actions=t.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.compute=function(){var e=[];return mt(this.manager.recognizers,function(t){vt(t.options.enable,[t])&&(e=e.concat(t.getTouchAction()))}),function(t){if(gt(t,U))return U;var e=gt(t,K),n=gt(t,Q);return e&&n?U:e||n?e?K:Q:gt(t,V)?V:"auto"}(e.join(" "))},e.preventDefaults=function(t){var e=t.srcEvent,n=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var i=this.actions,r=gt(i,U)&&!B[U],s=gt(i,Q)&&!B[Q],o=gt(i,K)&&!B[K];if(r){var a=1===t.pointers.length,h=t.distance<2,u=t.deltaTime<250;if(a&&h&&u)return}if(!o||!s)return r||s&&n&ct||o&&n<?this.preventSrc(e):void 0}},e.preventSrc=function(t){this.manager.session.prevented=!0,t.preventDefault()},t}();function bt(t,e){for(;t;){if(t===e)return!0;t=t.parentNode}return!1}function xt(t){var e=t.length;if(1===e)return{x:j(t[0].clientX),y:j(t[0].clientY)};for(var n=0,i=0,r=0;r<e;)n+=t[r].clientX,i+=t[r].clientY,r++;return{x:j(n/e),y:j(i/e)}}function wt(t){for(var e=[],n=0;n<t.pointers.length;)e[n]={clientX:j(t.pointers[n].clientX),clientY:j(t.pointers[n].clientY)},n++;return{timeStamp:X(),pointers:e,center:xt(e),deltaX:t.deltaX,deltaY:t.deltaY}}function Et(t,e,n){var i=e[(n=n||ft)[0]]-t[n[0]],r=e[n[1]]-t[n[1]];return Math.sqrt(i*i+r*r)}function Tt(t,e,n){var i=e[(n=n||ft)[0]]-t[n[0]],r=e[n[1]]-t[n[1]];return 180*Math.atan2(r,i)/Math.PI}function Pt(t,e){return t===e?st:Y(t)>=Y(e)?t<0?ot:at:e<0?ht:ut}function _t(t,e,n){return{x:e/t||0,y:n/t||0}}function Ot(t,e){var n=t.session,i=e.pointers,r=i.length;n.firstInput||(n.firstInput=wt(e)),1<r&&!n.firstMultiple?n.firstMultiple=wt(e):1===r&&(n.firstMultiple=!1);var s,o,a,h,u,c,l=n.firstInput,p=n.firstMultiple,f=p?p.center:l.center,d=e.center=xt(i);e.timeStamp=X(),e.deltaTime=e.timeStamp-l.timeStamp,e.angle=Tt(f,d),e.distance=Et(f,d),s=n,a=(o=e).center,h=s.offsetDelta||{},u=s.prevDelta||{},c=s.prevInput||{},o.eventType!==nt&&c.eventType!==it||(u=s.prevDelta={x:c.deltaX||0,y:c.deltaY||0},h=s.offsetDelta={x:a.x,y:a.y}),o.deltaX=u.x+(a.x-h.x),o.deltaY=u.y+(a.y-h.y),e.offsetDirection=Pt(e.deltaX,e.deltaY);var m,v,g,y,b,x,w,E,T,P,_,O,A,D,I,M=_t(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=M.x,e.overallVelocityY=M.y,e.overallVelocity=Y(M.x)>Y(M.y)?M.x:M.y,e.scale=p?(m=p.pointers,Et((v=i)[0],v[1],dt)/Et(m[0],m[1],dt)):1,e.rotation=p?(g=p.pointers,Tt((y=i)[1],y[0],dt)+Tt(g[1],g[0],dt)):0,e.maxPointers=!n.prevInput||e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers,x=e,D=(b=n).lastInterval||x,I=x.timeStamp-D.timeStamp,x.eventType!==rt&&(et<I||void 0===D.velocity)?(P=(T=_t(I,w=x.deltaX-D.deltaX,E=x.deltaY-D.deltaY)).x,_=T.y,O=Y(T.x)>Y(T.y)?T.x:T.y,A=Pt(w,E),b.lastInterval=x):(O=D.velocity,P=D.velocityX,_=D.velocityY,A=D.direction),x.velocity=O,x.velocityX=P,x.velocityY=_,x.direction=A;var R=t.element,C=e.srcEvent,S=C.composedPath?C.composedPath()[0]:C.path?C.path[0]:C.target;bt(S,R)&&(R=S),e.target=R}function At(t,e,n){var i=n.pointers.length,r=n.changedPointers.length,s=e&nt&&i-r==0,o=e&(it|rt)&&i-r==0;n.isFirst=!!s,n.isFinal=!!o,s&&(t.session={}),n.eventType=e,Ot(t,n),t.emit("hammer.input",n),t.recognize(n),t.session.prevInput=n}function Dt(t){return t.trim().split(/\s+/g)}function It(e,t,n){mt(Dt(t),function(t){e.addEventListener(t,n,!1)})}function Mt(e,t,n){mt(Dt(t),function(t){e.removeEventListener(t,n,!1)})}function Rt(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||window}var Ct=function(){function t(e,t){var n=this;this.manager=e,this.callback=t,this.element=e.element,this.target=e.options.inputTarget,this.domHandler=function(t){vt(e.options.enable,[e])&&n.handler(t)},this.init()}var e=t.prototype;return e.handler=function(){},e.init=function(){this.evEl&&It(this.element,this.evEl,this.domHandler),this.evTarget&&It(this.target,this.evTarget,this.domHandler),this.evWin&&It(Rt(this.element),this.evWin,this.domHandler)},e.destroy=function(){this.evEl&&Mt(this.element,this.evEl,this.domHandler),this.evTarget&&Mt(this.target,this.evTarget,this.domHandler),this.evWin&&Mt(Rt(this.element),this.evWin,this.domHandler)},t}();function St(t,e,n){if(t.indexOf&&!n)return t.indexOf(e);for(var i=0;i<t.length;){if(n&&t[i][n]==e||!n&&t[i]===e)return i;i++}return-1}var zt={pointerdown:nt,pointermove:2,pointerup:it,pointercancel:rt,pointerout:rt},kt={2:$,3:"pen",4:tt,5:"kinect"},Ft="pointerdown",Ht="pointermove pointerup pointercancel";z.MSPointerEvent&&!z.PointerEvent&&(Ft="MSPointerDown",Ht="MSPointerMove MSPointerUp MSPointerCancel");var jt=function(n){function i(){var t,e=i.prototype;return e.evEl=Ft,e.evWin=Ht,(t=n.apply(this,arguments)||this).store=t.manager.session.pointerEvents=[],t}return C(i,n),i.prototype.handler=function(t){var e=this.store,n=!1,i=t.type.toLowerCase().replace("ms",""),r=zt[i],s=kt[t.pointerType]||t.pointerType,o=s===$,a=St(e,t.pointerId,"pointerId");r&nt&&(0===t.button||o)?a<0&&(e.push(t),a=e.length-1):r&(it|rt)&&(n=!0),a<0||(e[a]=t,this.callback(this.manager,r,{pointers:e,changedPointers:[t],pointerType:s,srcEvent:t}),n&&e.splice(a,1))},i}(Ct);function Yt(t){return Array.prototype.slice.call(t,0)}function Xt(t,n,e){for(var i=[],r=[],s=0;s<t.length;){var o=n?t[s][n]:t[s];St(r,o)<0&&i.push(t[s]),r[s]=o,s++}return e&&(i=n?i.sort(function(t,e){return t[n]>e[n]}):i.sort()),i}var Lt={touchstart:nt,touchmove:2,touchend:it,touchcancel:rt},Wt="touchstart touchmove touchend touchcancel",Nt=function(e){function n(){var t;return n.prototype.evTarget=Wt,(t=e.apply(this,arguments)||this).targetIds={},t}return C(n,e),n.prototype.handler=function(t){var e=Lt[t.type],n=function(t,e){var n,i,r=Yt(t.touches),s=this.targetIds;if(e&(2|nt)&&1===r.length)return s[r[0].identifier]=!0,[r,r];var o=Yt(t.changedTouches),a=[],h=this.target;if(i=r.filter(function(t){return bt(t.target,h)}),e===nt)for(n=0;n<i.length;)s[i[n].identifier]=!0,n++;n=0;for(;n<o.length;)s[o[n].identifier]&&a.push(o[n]),e&(it|rt)&&delete s[o[n].identifier],n++;return a.length?[Xt(i.concat(a),"identifier",!0),a]:void 0}.call(this,t,e);n&&this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:$,srcEvent:t})},n}(Ct);var qt={mousedown:nt,mousemove:2,mouseup:it},Vt="mousedown",Ut="mousemove mouseup",Kt=function(n){function i(){var t,e=i.prototype;return e.evEl=Vt,e.evWin=Ut,(t=n.apply(this,arguments)||this).pressed=!1,t}return C(i,n),i.prototype.handler=function(t){var e=qt[t.type];e&nt&&0===t.button&&(this.pressed=!0),2&e&&1!==t.which&&(e=it),this.pressed&&(e&it&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:tt,srcEvent:t}))},i}(Ct),Qt=2500,Bt=25;function Gt(t){var e,n,i=t.changedPointers[0];i.identifier===this.primaryTouch&&(e={x:i.clientX,y:i.clientY},n=this.lastTouches,this.lastTouches.push(e),setTimeout(function(){var t=n.indexOf(e);-1<t&&n.splice(t,1)},Qt))}var Zt=function(){return function(n){function t(t,e){var s=n.call(this,t,e)||this;return s.handler=function(t,e,n){var i=n.pointerType===$,r=n.pointerType===tt;if(!(r&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)(function(t,e){t&nt?(this.primaryTouch=e.changedPointers[0].identifier,Gt.call(this,e)):t&(it|rt)&&Gt.call(this,e)}).call(S(S(s)),e,n);else if(r&&function(t){for(var e=t.srcEvent.clientX,n=t.srcEvent.clientY,i=0;i<this.lastTouches.length;i++){var r=this.lastTouches[i],s=Math.abs(e-r.x),o=Math.abs(n-r.y);if(s<=Bt&&o<=Bt)return!0}return!1}.call(S(S(s)),n))return;s.callback(t,e,n)}},s.touch=new Nt(s.manager,s.handler),s.mouse=new Kt(s.manager,s.handler),s.primaryTouch=null,s.lastTouches=[],s}return C(t,n),t.prototype.destroy=function(){this.touch.destroy(),this.mouse.destroy()},t}(Ct)}();function Jt(t,e,n){return Array.isArray(t)&&(mt(t,n[e],n),1)}var $t=1;function te(t,e){var n=e.manager;return n?n.get(t):t}function ee(t){return 16&t?"cancel":8&t?"end":4&t?"move":2&t?"start":""}var ne=function(){function t(t){void 0===t&&(t={}),this.options=R({enable:!0},t),this.id=$t++,this.manager=null,this.state=1,this.simultaneous={},this.requireFail=[]}var e=t.prototype;return e.set=function(t){return k(this.options,t),this.manager&&this.manager.touchAction.update(),this},e.recognizeWith=function(t){if(Jt(t,"recognizeWith",this))return this;var e=this.simultaneous;return e[(t=te(t,this)).id]||(e[t.id]=t).recognizeWith(this),this},e.dropRecognizeWith=function(t){return Jt(t,"dropRecognizeWith",this)||(t=te(t,this),delete this.simultaneous[t.id]),this},e.requireFailure=function(t){if(Jt(t,"requireFailure",this))return this;var e=this.requireFail;return-1===St(e,t=te(t,this))&&(e.push(t),t.requireFailure(this)),this},e.dropRequireFailure=function(t){if(Jt(t,"dropRequireFailure",this))return this;t=te(t,this);var e=St(this.requireFail,t);return-1<e&&this.requireFail.splice(e,1),this},e.hasRequireFailures=function(){return 0<this.requireFail.length},e.canRecognizeWith=function(t){return!!this.simultaneous[t.id]},e.emit=function(e){var n=this,t=this.state;function i(t){n.manager.emit(t,e)}t<8&&i(n.options.event+ee(t)),i(n.options.event),e.additionalEvent&&i(e.additionalEvent),8<=t&&i(n.options.event+ee(t))},e.tryEmit=function(t){if(this.canEmit())return this.emit(t);this.state=32},e.canEmit=function(){for(var t=0;t<this.requireFail.length;){if(!(33&this.requireFail[t].state))return!1;t++}return!0},e.recognize=function(t){var e=k({},t);if(!vt(this.options.enable,[this,e]))return this.reset(),void(this.state=32);56&this.state&&(this.state=1),this.state=this.process(e),30&this.state&&this.tryEmit(e)},e.process=function(){},e.getTouchAction=function(){},e.reset=function(){},t}(),ie=function(e){function t(t){return void 0===t&&(t={}),e.call(this,R({pointers:1},t))||this}C(t,e);var n=t.prototype;return n.attrTest=function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},n.process=function(t){var e=this.state,n=t.eventType,i=6&e,r=this.attrTest(t);return i&&(n&rt||!r)?16|e:i||r?n&it?8|e:2&e?4|e:2:32},t}(ne);function re(t){return t===ut?"down":t===ht?"up":t===ot?"left":t===at?"right":""}var se=function(n){function t(t){var e;return void 0===t&&(t={}),(e=n.call(this,R({event:"pan",threshold:10,pointers:1,direction:pt},t))||this).pX=null,e.pY=null,e}C(t,n);var e=t.prototype;return e.getTouchAction=function(){var t=this.options.direction,e=[];return t&ct&&e.push(Q),t<&&e.push(K),e},e.directionTest=function(t){var e=this.options,n=!0,i=t.distance,r=t.direction,s=t.deltaX,o=t.deltaY;return r&e.direction||(i=e.direction&ct?(r=0===s?st:s<0?ot:at,n=s!==this.pX,Math.abs(t.deltaX)):(r=0===o?st:o<0?ht:ut,n=o!==this.pY,Math.abs(t.deltaY))),t.direction=r,n&&i>e.threshold&&r&e.direction},e.attrTest=function(t){return ie.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},e.emit=function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=re(t.direction);e&&(t.additionalEvent=this.options.event+e),n.prototype.emit.call(this,t)},t}(ie),oe=function(n){function t(t){return void 0===t&&(t={}),n.call(this,R({event:"pinch",threshold:0,pointers:2},t))||this}C(t,n);var e=t.prototype;return e.getTouchAction=function(){return[U]},e.attrTest=function(t){return n.prototype.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},e.emit=function(t){var e;1!==t.scale&&(e=t.scale<1?"in":"out",t.additionalEvent=this.options.event+e),n.prototype.emit.call(this,t)},t}(ie),ae={domEvents:!1,touchAction:q,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function he(n,i){var r,s=n.element;s.style&&(mt(n.options.cssProps,function(t,e){r=L(s.style,e),i?(n.oldCssProps[r]=s.style[r],s.style[r]=t):s.style[r]=n.oldCssProps[r]||""}),i||(n.oldCssProps={}))}var ue=function(){function t(t,e){var n,i,r=this;this.options=k({},ae,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=(i=(n=this).options.inputClass,new(i||(Z?jt:J?Nt:G?Zt:Kt))(n,At)),this.touchAction=new yt(this,this.options.touchAction),he(this,!0),mt(this.options.recognizers,function(t){var e=r.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])},this)}var e=t.prototype;return e.set=function(t){return k(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},e.stop=function(t){this.session.stopped=t?2:1},e.recognize=function(t){var e,n=this.session;if(!n.stopped){this.touchAction.preventDefaults(t);var i=this.recognizers,r=n.curRecognizer;(!r||r&&8&r.state)&&(r=n.curRecognizer=null);for(var s=0;s<i.length;)e=i[s],2===n.stopped||r&&e!==r&&!e.canRecognizeWith(r)?e.reset():e.recognize(t),!r&&14&e.state&&(r=n.curRecognizer=e),s++}},e.get=function(t){if(t instanceof ne)return t;for(var e=this.recognizers,n=0;n<e.length;n++)if(e[n].options.event===t)return e[n];return null},e.add=function(t){if(Jt(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),(t.manager=this).touchAction.update(),t},e.remove=function(t){if(Jt(t,"remove",this))return this;var e,n,i=this.get(t);return!t||-1!==(n=St(e=this.recognizers,i))&&(e.splice(n,1),this.touchAction.update()),this},e.on=function(t,e){if(void 0===t||void 0===e)return this;var n=this.handlers;return mt(Dt(t),function(t){n[t]=n[t]||[],n[t].push(e)}),this},e.off=function(t,e){if(void 0===t)return this;var n=this.handlers;return mt(Dt(t),function(t){e?n[t]&&n[t].splice(St(n[t],e),1):delete n[t]}),this},e.emit=function(t,e){var n,i,r;this.options.domEvents&&(n=t,i=e,(r=document.createEvent("Event")).initEvent(n,!0,!0),(r.gesture=i).target.dispatchEvent(r));var s=this.handlers[t]&&this.handlers[t].slice();if(s&&s.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var o=0;o<s.length;)s[o](e),o++}},e.destroy=function(){this.element&&he(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},t}();function ce(i,t,e){var r="DEPRECATED METHOD: "+t+"\n"+e+" AT \n";return function(){var t=new Error("get-stack-trace"),e=t&&t.stack?t.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",n=window.console&&(window.console.warn||window.console.log);return n&&n.call(window.console,r,e),i.apply(this,arguments)}}var le=ce(function(t,e,n){for(var i=Object.keys(e),r=0;r<i.length;)(!n||n&&void 0===t[i[r]])&&(t[i[r]]=e[i[r]]),r++;return t},"extend","Use `assign`.");ce(function(t,e){return le(t,e,!0)},"merge","Use `assign`.");function pe(t,e){for(var n=t.length,i=0;i<n;++i)if(e(t[i],i))return!0;return!1}function fe(t,e){for(var n=t.length,i=0;i<n;++i)if(e(t[i],i))return t[i];return null}function de(t,e){try{return new RegExp(t,"g").exec(e)}catch(t){return null}}function me(t){return t.replace(/_/g,".")}function ve(t,r){var s=null,o="-1";return pe(t,function(t){var e,n,i=de("("+t.test+")((?:\\/|\\s|:)([0-9|\\.|_]+))?",r);return i&&!t.brand&&(s=t,o=i[3]||"-1",t.versionAlias?o=t.versionAlias:t.versionTest&&(e=t.versionTest.toLowerCase(),n=de("("+e+")((?:\\/|\\s|:)([0-9|\\.|_]+))?",r),o=(n?n[3]:"")||o),o=me(o),1)}),{preset:s,version:o}}function ge(t,n){return fe(t,function(t){var e=t.brand;return de(""+n.test,e.toLowerCase())})}var ye=[{test:"phantomjs",id:"phantomjs"},{test:"whale",id:"whale"},{test:"edgios|edge|edg",id:"edge"},{test:"msie|trident|windows phone",id:"ie",versionTest:"iemobile|msie|rv"},{test:"miuibrowser",id:"miui browser"},{test:"samsungbrowser",id:"samsung internet"},{test:"samsung",id:"samsung internet",versionTest:"version"},{test:"chrome|crios",id:"chrome"},{test:"firefox|fxios",id:"firefox"},{test:"android",id:"android browser",versionTest:"version"},{test:"safari|iphone|ipad|ipod",id:"safari",versionTest:"version"}],be=[{test:"(?=.*applewebkit/(53[0-7]|5[0-2]|[0-4]))(?=.*\\schrome)",id:"chrome"},{test:"chromium",id:"chrome"},{test:"whale",id:"chrome",brand:!0}],xe=[{test:"applewebkit",id:"webkit"}],we=[{test:"(?=(iphone|ipad))(?!(.*version))",id:"webview"},{test:"(?=(android|iphone|ipad))(?=.*(naver|daum|; wv))",id:"webview"},{test:"webview",id:"webview"}],Ee=[{test:"windows phone",id:"windows phone"},{test:"windows 2000",id:"window",versionAlias:"5.0"},{test:"windows nt",id:"window"},{test:"iphone|ipad|ipod",id:"ios",versionTest:"iphone os|cpu os"},{test:"mac os x",id:"mac"},{test:"android",id:"android"},{test:"tizen",id:"tizen"},{test:"webos|web0s",id:"webos"}];function Te(t){var e=function(t){var e=t;if(void 0===e){if("undefined"==typeof navigator||!navigator)return"";e=navigator.userAgent||""}return e.toLowerCase()}(t),n=!!/mobi/g.exec(e),i={name:"unknown",version:"-1",majorVersion:-1,webview:!!ve(we,e).preset,chromium:!!ve(be,e).preset,webkit:!1},r={name:"unknown",version:"-1",majorVersion:-1},s=ve(ye,e),o=s.preset,a=s.version,h=ve(Ee,e),u=h.preset,c=h.version;return i.webkit=!i.chromium&&!!ve(xe,e).preset,u&&(r.name=u.id,r.version=c,r.majorVersion=parseInt(c,10)),o&&(i.name=o.id,i.version=a,i.webview&&"ios"===r.name&&"safari"!==i.name&&(i.webview=!1)),i.majorVersion=parseInt(i.version,10),{browser:i,os:r,isMobile:n,isHints:!1}}var Pe,_e,Oe,Ae,De,Ie,Me,Re,Ce,Se,ze="ontouchstart"in r&&"safari"===(void 0===Pe&&function(){if("undefined"!=typeof navigator&&navigator&&navigator.userAgentData){var t=navigator.userAgentData,e=t.brands||t.uaList;return e&&e.length}}()?(De=navigator.userAgentData,Ie=(De.uaList||De.brands).slice(),Me=De.mobile||!1,Re=Ie[0],Ce={name:Re.brand,version:Re.version,majorVersion:-1,webkit:!1,webview:pe(we,function(t){return ge(Ie,t)}),chromium:pe(be,function(t){return ge(Ie,t)})},Se={name:"unknown",version:"-1",majorVersion:-1},Ce.webkit=!Ce.chromium&&pe(xe,function(t){return ge(Ie,t)}),_e&&(Oe=_e.platform.toLowerCase(),Ae=fe(Ee,function(t){return new RegExp(""+t.test,"g").exec(Oe)}),Se.name=Ae?Ae.id:Oe,Se.version=_e.platformVersion),pe(ye,function(t){var e=ge(Ie,t);return e&&(Ce.name=t.id,Ce.version=_e?_e.uaFullVersion:e.version,1)}),"Linux armv8l"===navigator.platform?Se.name="android":Ce.webkit&&(Se.name=Me?"ios":"mac"),"ios"===Se.name&&Ce.webview&&(Ce.version="-1"),Se.version=me(Se.version),Ce.version=me(Ce.version),Se.majorVersion=parseInt(Se.version,10),Ce.majorVersion=parseInt(Ce.version,10),{browser:Ce,os:Se,isMobile:Me,isHints:!0}):Te(Pe)).browser.name,ke=function(){if("undefined"==typeof document)return"";for(var t=(document.head||document.getElementsByTagName("head")[0]).style,e=["transform","webkitTransform","msTransform","mozTransform"],n=0,i=e.length;n<i;n++)if(e[n]in t)return e[n];return""}(),Fe=function(r){function t(t,e,n){void 0===t&&(t={}),void 0===e&&(e={});var i=r.call(this)||this;return i.axis=t,i._inputs=[],i.options=v({easing:function(t){return 1-Math.pow(1-t,3)},interruptable:!0,maximumDuration:1/0,minimumDuration:0,deceleration:6e-4,round:null},e),i.itm=new D(i.options),i.axm=new I(i.axis,i.options),i.em=new A(i),i.am=new O(i),i.io=new M(i),i.em.setAnimationManager(i.am),n&&i.em.triggerChange(n),i}n(t,r);var e=t.prototype;return e.connect=function(t,e){var n,i="string"==typeof t?t.split(" "):t.concat();return~this._inputs.indexOf(e)&&this.disconnect(e),"hammer"in e&&((n=this._inputs.filter(function(t){return t.hammer&&t.element===e.element})).length&&(e.hammer=n[0].hammer)),e.mapAxes(i),e.connect(this.io),this._inputs.push(e),this},e.disconnect=function(t){var e;return t?0<=(e=this._inputs.indexOf(t))&&(this._inputs[e].disconnect(),this._inputs.splice(e,1)):(this._inputs.forEach(function(t){return t.disconnect()}),this._inputs=[]),this},e.get=function(t){return this.axm.get(t)},e.setTo=function(t,e){return void 0===e&&(e=0),this.am.setTo(t,e),this},e.setBy=function(t,e){return void 0===e&&(e=0),this.am.setBy(t,e),this},e.isBounceArea=function(t){return this.axm.isOutside(t)},e.destroy=function(){this.disconnect(),this.em.destroy()},t.VERSION="2.7.1",t.TRANSFORM=ke,t.DIRECTION_NONE=st,t.DIRECTION_LEFT=ot,t.DIRECTION_RIGHT=at,t.DIRECTION_UP=ht,t.DIRECTION_DOWN=ut,t.DIRECTION_HORIZONTAL=ct,t.DIRECTION_VERTICAL=lt,t.DIRECTION_ALL=pt,t}(t),He="PointerEvent"in r||"MSPointerEvent"in r,je="ontouchstart"in r,Ye="_EGJS_AXES_INPUTTYPE_";function Xe(i,t){return t.reduce(function(t,e,n){return i[n]&&(t[i[n]]=e),t},{})}function Le(t,e){try{return new ue(t,v({},e))}catch(t){return null}}function We(t){void 0===t&&(t=[]);var e=!1,n=!1,i=!1;return t.forEach(function(t){switch(t){case"mouse":n=!0;break;case"touch":e=je;break;case"pointer":i=He}}),i?jt:e&&n?Zt:e?Nt:n?Kt:null}function Ne(t,e,n){return n?!!(e===pt||e&t&&n&t):!!(e&t)}var qe=function(){function t(t,e){if(this.axes=[],this.hammer=null,this.element=null,this.panRecognizer=null,this.isRightEdge=!1,this.rightEdgeTimer=0,this.panFlag=!1,void 0===ue)throw new Error("The Hammerjs must be loaded before eg.Axes.PanInput.\nhttp://hammerjs.github.io/");this.element=h(t),this.options=v({inputType:["touch","mouse","pointer"],scale:[1,1],thresholdAngle:45,threshold:0,iOSEdgeSwipeThreshold:30,hammerManagerOptions:{cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",userDrag:"none"}}},e),this.onHammerInput=this.onHammerInput.bind(this),this.onPanmove=this.onPanmove.bind(this),this.onPanend=this.onPanend.bind(this)}var e=t.prototype;return e.mapAxes=function(t){var e=!!t[0],n=!!t[1];this._direction=e&&n?pt:e?ct:n?lt:st,this.axes=t},e.connect=function(t){var e={direction:this._direction,threshold:this.options.threshold};if(this.hammer)this.removeRecognizer(),this.dettachEvent();else{var n=(n=this.element[Ye])||String(Math.round(Math.random()*(new Date).getTime())),i=We(this.options.inputType);if(!i)throw new Error("Wrong inputType parameter!");this.hammer=Le(this.element,v({inputClass:i},this.options.hammerManagerOptions)),this.element[Ye]=n}return this.panRecognizer=new se(e),this.hammer.add(this.panRecognizer),this.attachEvent(t),this},e.disconnect=function(){return this.removeRecognizer(),this.hammer&&this.dettachEvent(),this._direction=st,this},e.destroy=function(){this.disconnect(),this.hammer&&0===this.hammer.recognizers.length&&this.hammer.destroy(),delete this.element[Ye],this.element=null,this.hammer=null},e.enable=function(){return this.hammer&&(this.hammer.get("pan").options.enable=!0),this},e.disable=function(){return this.hammer&&(this.hammer.get("pan").options.enable=!1),this},e.isEnable=function(){return!(!this.hammer||!this.hammer.get("pan").options.enable)},e.removeRecognizer=function(){this.hammer&&this.panRecognizer&&(this.hammer.remove(this.panRecognizer),this.panRecognizer=null)},e.onHammerInput=function(t){var e;this.isEnable()&&(t.isFirst?(this.panFlag=!1)!==t.srcEvent.cancelable&&(e=this.options.iOSEdgeSwipeThreshold,this.observer.hold(this,t),this.isRightEdge=ze&&t.center.x>window.innerWidth-e,this.panFlag=!0):t.isFinal&&this.onPanend(t))},e.onPanmove=function(t){var e=this;if(this.panFlag){var n,i=function(t,e){if(e<0||90<e)return st;var n=Math.abs(t);return e<n&&n<180-e?lt:ct}(t.angle,this.options.thresholdAngle),r=this.hammer.session.prevInput;if(r&&ze){if(t.center.x<0)return void this.onPanend(v({},r,{velocityX:0,velocityY:0,offsetX:0,offsetY:0}));this.isRightEdge&&(clearTimeout(this.rightEdgeTimer),n=this.options.iOSEdgeSwipeThreshold,t.deltaX<-n?this.isRightEdge=!1:this.rightEdgeTimer=window.setTimeout(function(){e.onPanend(v({},r,{velocityX:0,velocityY:0,offsetX:0,offsetY:0}))},100))}r?(t.offsetX=t.deltaX-r.deltaX,t.offsetY=t.deltaY-r.deltaY):(t.offsetX=0,t.offsetY=0);var s,o=this.getOffset([t.offsetX,t.offsetY],[Ne(ct,this._direction,i),Ne(lt,this._direction,i)]),a=o.some(function(t){return 0!==t});a&&(!1!==(s=t.srcEvent).cancelable&&s.preventDefault(),s.stopPropagation()),(t.preventSystemEvent=a)&&this.observer.change(this,t,Xe(this.axes,o))}},e.onPanend=function(t){var e,n,i,r,s;this.panFlag&&(clearTimeout(this.rightEdgeTimer),this.panFlag=!1,e=this.getOffset([Math.abs(t.velocityX)*(t.deltaX<0?-1:1),Math.abs(t.velocityY)*(t.deltaY<0?-1:1)],[Ne(ct,this._direction),Ne(lt,this._direction)]),n=e,i=this.observer.options.deceleration,r=Math.sqrt(n[0]*n[0]+n[1]*n[1]),s=Math.abs(r/-i),e=[n[0]/2*s,n[1]/2*s],this.observer.release(this,t,Xe(this.axes,e)))},e.attachEvent=function(t){this.observer=t,this.hammer.on("hammer.input",this.onHammerInput).on("panstart panmove",this.onPanmove)},e.dettachEvent=function(){this.hammer.off("hammer.input",this.onHammerInput).off("panstart panmove",this.onPanmove),this.observer=null},e.getOffset=function(t,e){var n=[0,0],i=this.options.scale;return e[0]&&(n[0]=t[0]*i[0]),e[1]&&(n[1]=t[1]*i[1]),n},t}(),Ve=function(i){function t(t,e){var n=i.call(this,t,e)||this;return n.prevQuadrant=null,n.lastDiff=0,n}n(t,i);var e=t.prototype;return e.mapAxes=function(t){this._direction=Fe.DIRECTION_ALL,this.axes=t},e.onHammerInput=function(t){this.isEnable()&&(t.isFirst?(this.observer.hold(this,t),this.onPanstart(t)):t.isFinal&&this.onPanend(t))},e.onPanstart=function(t){var e=this.element.getBoundingClientRect();this.coefficientForDistanceToAngle=360/(e.width*Math.PI),this.rotateOrigin=[e.left+(e.width-1)/2,e.top+(e.height-1)/2],this.prevAngle=null,this.triggerChange(t)},e.onPanmove=function(t){this.triggerChange(t)},e.onPanend=function(t){this.triggerChange(t),this.triggerAnimation(t)},e.triggerChange=function(t){var e=this.getAngle(t.center.x,t.center.y),n=this.getQuadrant(t.center.x,t.center.y),i=this.getDifference(this.prevAngle,e,this.prevQuadrant,n);this.prevAngle=e,this.prevQuadrant=n,0!==i&&(this.lastDiff=i,this.observer.change(this,t,Xe(this.axes,[-i])))},e.triggerAnimation=function(t){var e=t.velocityX,n=t.velocityY,i=Math.sqrt(e*e+n*n)*(0<this.lastDiff?-1:1),r=i/2*Math.abs(i/-this.observer.options.deceleration);this.observer.release(this,t,Xe(this.axes,[r*this.coefficientForDistanceToAngle]))},e.getDifference=function(t,e,n,i){var r=null===t?0:1===n&&4===i?-t-(360-e):4===n&&1===i?360-t+e:e-t;return r},e.getPosFromOrigin=function(t,e){return{x:t-this.rotateOrigin[0],y:this.rotateOrigin[1]-e}},e.getAngle=function(t,e){var n=this.getPosFromOrigin(t,e),i=n.x,r=n.y,s=180*Math.atan2(r,i)/Math.PI;return s<0?360+s:s},e.getQuadrant=function(t,e){var n=this.getPosFromOrigin(t,e),i=n.x,r=n.y,s=0;return 0<=i&&0<=r?s=1:i<0&&0<=r?s=2:i<0&&r<0?s=3:0<=i&&r<0&&(s=4),s},t}(qe),Ue=function(){function t(t,e){if(this.axes=[],this.hammer=null,this.element=null,this._base=null,this._prev=null,this.pinchRecognizer=null,void 0===ue)throw new Error("The Hammerjs must be loaded before eg.Axes.PinchInput.\nhttp://hammerjs.github.io/");this.element=h(t),this.options=v({scale:1,threshold:0,inputType:["touch","pointer"],hammerManagerOptions:{cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",userDrag:"none"}}},e),this.onPinchStart=this.onPinchStart.bind(this),this.onPinchMove=this.onPinchMove.bind(this),this.onPinchEnd=this.onPinchEnd.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this.axes=t},e.connect=function(t){var e={threshold:this.options.threshold};if(this.hammer)this.removeRecognizer(),this.dettachEvent();else{var n=(n=this.element[Ye])||String(Math.round(Math.random()*(new Date).getTime())),i=We(this.options.inputType);if(!i)throw new Error("Wrong inputType parameter!");this.hammer=Le(this.element,v({inputClass:i},this.options.hammerManagerOptions)),this.element[Ye]=n}return this.pinchRecognizer=new oe(e),this.hammer.add(this.pinchRecognizer),this.attachEvent(t),this},e.disconnect=function(){return this.removeRecognizer(),this.hammer&&(this.hammer.remove(this.pinchRecognizer),this.pinchRecognizer=null,this.dettachEvent()),this},e.destroy=function(){this.disconnect(),this.hammer&&0===this.hammer.recognizers.length&&this.hammer.destroy(),delete this.element[Ye],this.element=null,this.hammer=null},e.removeRecognizer=function(){this.hammer&&this.pinchRecognizer&&(this.hammer.remove(this.pinchRecognizer),this.pinchRecognizer=null)},e.onPinchStart=function(t){this._base=this.observer.get(this)[this.axes[0]];var e=this.getOffset(t.scale);this.observer.hold(this,t),this.observer.change(this,t,Xe(this.axes,[e])),this._prev=t.scale},e.onPinchMove=function(t){var e=this.getOffset(t.scale,this._prev);this.observer.change(this,t,Xe(this.axes,[e])),this._prev=t.scale},e.onPinchEnd=function(t){var e=this.getOffset(t.scale,this._prev);this.observer.change(this,t,Xe(this.axes,[e])),this.observer.release(this,t,Xe(this.axes,[0]),0),this._base=null,this._prev=null},e.getOffset=function(t,e){return void 0===e&&(e=1),this._base*(t-e)*this.options.scale},e.attachEvent=function(t){this.observer=t,this.hammer.on("pinchstart",this.onPinchStart).on("pinchmove",this.onPinchMove).on("pinchend",this.onPinchEnd)},e.dettachEvent=function(){this.hammer.off("pinchstart",this.onPinchStart).off("pinchmove",this.onPinchMove).off("pinchend",this.onPinchEnd),this.observer=null,this._prev=null},e.enable=function(){return this.hammer&&(this.hammer.get("pinch").options.enable=!0),this},e.disable=function(){return this.hammer&&(this.hammer.get("pinch").options.enable=!1),this},e.isEnable=function(){return!(!this.hammer||!this.hammer.get("pinch").options.enable)},t}(),Ke=function(){function t(t,e){this.axes=[],this.element=null,this._isEnabled=!1,this._isHolded=!1,this._timer=null,this.element=h(t),this.options=v({scale:1,useNormalized:!0},e),this.onWheel=this.onWheel.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this.axes=t},e.connect=function(t){return this.dettachEvent(),this.attachEvent(t),this},e.disconnect=function(){return this.dettachEvent(),this},e.destroy=function(){this.disconnect(),this.element=null},e.onWheel=function(t){var e,n=this;this._isEnabled&&(t.preventDefault(),0!==t.deltaY&&(this._isHolded||(this.observer.hold(this,t),this._isHolded=!0),e=(0<t.deltaY?-1:1)*this.options.scale*(this.options.useNormalized?1:Math.abs(t.deltaY)),this.observer.change(this,t,Xe(this.axes,[e])),clearTimeout(this._timer),this._timer=setTimeout(function(){n._isHolded&&(n._isHolded=!1,n.observer.release(n,t,Xe(n.axes,[0])))},50)))},e.attachEvent=function(t){this.observer=t,this.element.addEventListener("wheel",this.onWheel),this._isEnabled=!0},e.dettachEvent=function(){this.element.removeEventListener("wheel",this.onWheel),this._isEnabled=!1,this.observer=null,this._timer&&(clearTimeout(this._timer),this._timer=null)},e.enable=function(){return this._isEnabled=!0,this},e.disable=function(){return this._isEnabled=!1,this},e.isEnable=function(){return this._isEnabled},t}(),Qe=function(){function t(t,e){this.axes=[],this.element=null,this._isEnabled=!1,this._isHolded=!1,this._timer=null,this.element=h(t),this.options=v({scale:[1,1]},e),this.onKeydown=this.onKeydown.bind(this),this.onKeyup=this.onKeyup.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this.axes=t},e.connect=function(t){return this.dettachEvent(),"0"!==this.element.getAttribute("tabindex")&&this.element.setAttribute("tabindex","0"),this.attachEvent(t),this},e.disconnect=function(){return this.dettachEvent(),this},e.destroy=function(){this.disconnect(),this.element=null},e.onKeydown=function(t){if(this._isEnabled){var e,n=!0,i=1,r=-1;switch(t.keyCode){case 37:case 65:i=-1;break;case 39:case 68:break;case 40:case 83:i=-1,r=1;break;case 38:case 87:r=1;break;default:n=!1}(-1===r&&!this.axes[0]||1===r&&!this.axes[1])&&(n=!1),n&&(e=-1===r?[this.options.scale[0]*i,0]:[0,this.options.scale[1]*i],this._isHolded||(this.observer.hold(this,event),this._isHolded=!0),clearTimeout(this._timer),this.observer.change(this,event,Xe(this.axes,e)))}},e.onKeyup=function(t){var e=this;this._isHolded&&(clearTimeout(this._timer),this._timer=setTimeout(function(){e.observer.release(e,t,Xe(e.axes,[0,0])),e._isHolded=!1},80))},e.attachEvent=function(t){this.observer=t,this.element.addEventListener("keydown",this.onKeydown,!1),this.element.addEventListener("keypress",this.onKeydown,!1),this.element.addEventListener("keyup",this.onKeyup,!1),this._isEnabled=!0},e.dettachEvent=function(){this.element.removeEventListener("keydown",this.onKeydown,!1),this.element.removeEventListener("keypress",this.onKeydown,!1),this.element.removeEventListener("keyup",this.onKeyup,!1),this._isEnabled=!1,this.observer=null},e.enable=function(){return this._isEnabled=!0,this},e.disable=function(){return this._isEnabled=!1,this},e.isEnable=function(){return this._isEnabled},t}();return Fe.PanInput=qe,Fe.RotatePanInput=Ve,Fe.PinchInput=Ue,Fe.WheelInput=Ke,Fe.MoveKeyInput=Qe,Fe}); | ||
//# sourceMappingURL=axes.pkgd.min.js.map |
@@ -13,4 +13,3 @@ // export const DIRECTION_NONE = 1; | ||
export var IOS_EDGE_THRESHOLD = 30; | ||
export var IS_IOS_SAFARI = "ontouchstart" in window | ||
&& getAgent(window.navigator.userAgent).browser.name.indexOf("safari") > -1; | ||
export var IS_IOS_SAFARI = "ontouchstart" in window && getAgent().browser.name === "safari"; | ||
export var TRANSFORM = (function () { | ||
@@ -17,0 +16,0 @@ if (typeof document === "undefined") { |
{ | ||
"name": "@egjs/axes", | ||
"version": "2.7.0", | ||
"version": "2.7.1", | ||
"description": "A module used to change the information of user action entered by various input devices such as touch screen or mouse into the logical virtual coordinates. You can easily create a UI that responds to user actions.", | ||
@@ -44,3 +44,3 @@ "sideEffects": false, | ||
"dependencies": { | ||
"@egjs/agent": "^2.1.5", | ||
"@egjs/agent": "^2.2.1", | ||
"@egjs/component": "^2.1.2", | ||
@@ -47,0 +47,0 @@ "@egjs/hammerjs": "^2.0.15" |
@@ -28,4 +28,3 @@ // export const DIRECTION_NONE = 1; | ||
export const IOS_EDGE_THRESHOLD = 30; | ||
export const IS_IOS_SAFARI = "ontouchstart" in window | ||
&& getAgent(window.navigator.userAgent).browser.name.indexOf("safari") > -1; | ||
export const IS_IOS_SAFARI = "ontouchstart" in window && getAgent().browser.name === "safari"; | ||
@@ -32,0 +31,0 @@ export const TRANSFORM = (() => { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16798
1539422
Updated@egjs/agent@^2.2.1