@egjs/view360
Version:
360 integrated viewing solution from inside-out view to outside-in view. It provides user-friendly service by rotating 360 degrees through various user interaction such as motion sensor and touch.
9 lines • 155 kB
JavaScript
/*
Copyright (c) 2017-present NAVER Corp.
name: @egjs/view360
license: MIT
author: NAVER Corp.
repository: https://github.com/naver/egjs-view360
version: 3.6.4
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):((t="undefined"!=typeof globalThis?globalThis:t||self).eg=t.eg||{},t.eg.view360=e())}(this,function(){"use strict";var i="3.6.4",r=function(t,e){return(r=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 s(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var h=function(){return(h=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 n(t,a,s,u){return new(s=s||Promise)(function(n,e){function i(t){try{o(u.next(t))}catch(t){e(t)}}function r(t){try{o(u.throw(t))}catch(t){e(t)}}function o(t){var e;t.done?n(t.value):((e=t.value)instanceof s?e:new s(function(t){t(e)})).then(i,r)}o((u=u.apply(t,a||[])).next())})}function o(n,i){var r,o,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)};return"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,o&&(a=2&e[0]?o.return:e[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,e[1])).done)return a;switch(o=0,a&&(e=[2&e[0],a.value]),e[0]){case 0:case 1:a=e;break;case 4:return s.label++,{value:e[1],done:!1};case 5:s.label++,o=e[1],e=[0];continue;case 7:e=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===e[0]||2===e[0])){s=0;continue}if(3===e[0]&&(!a||e[1]>a[0]&&e[1]<a[3])){s.label=e[1];break}if(6===e[0]&&s.label<a[1]){s.label=a[1],a=e;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(e);break}a[2]&&s.ops.pop(),s.trys.pop();continue}e=i.call(n,s)}catch(t){e=[6,t],o=0}finally{r=a=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}}function d(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function f(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,o=n.call(t),a=[];try{for(;(void 0===e||0<e--)&&!(i=o.next()).done;)a.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return a}(arguments[e]));return t}function c(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function a(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,o=n.call(t),a=[];try{for(;(void 0===e||0<e--)&&!(i=o.next()).done;)a.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return a}(arguments[e]));return t}function l(t){return void 0===t}var u=function(){function t(t,e){var n,i;if(this._canceled=!1,e)try{for(var r=c(Object.keys(e)),o=r.next();!o.done;o=r.next()){var a=o.value;this[a]=e[a]}}catch(t){n={error:t}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}this.eventType=t}var e=t.prototype;return e.stop=function(){this._canceled=!0},e.isCanceled=function(){return this._canceled},t}(),_=function(){function t(){this._eventHandler={}}var e=t.prototype;return e.trigger=function(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];var i=e instanceof u?e.eventType:e,i=a(this._eventHandler[i]||[]);return i.length<=0||(e instanceof u?(e.currentTarget=this,i.forEach(function(t){t(e)})):i.forEach(function(t){t.apply(void 0,a(n))})),this},e.once=function(n,i){var r,o=this;if("object"==typeof n&&l(i)){var t,e=n;for(t in e)this.once(t,e[t]);return this}return"string"==typeof n&&"function"==typeof i&&(r=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];i.apply(void 0,a(t)),o.off(n,r)},this.on(n,r)),this},e.hasOn=function(t){return!!this._eventHandler[t]},e.on=function(t,e){if("object"==typeof t&&l(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&&(r=this._eventHandler[t],l(r)&&(this._eventHandler[t]=[],r=this._eventHandler[t]),r.push(e)),this},e.off=function(t,e){var n,i;if(l(t))return this._eventHandler={},this;if(l(e)){if("string"==typeof t)return delete this._eventHandler[t],this;var r,o=t;for(r in o)this.off(r,o[r]);return this}var a=this._eventHandler[t];if(a){var s=0;try{for(var u=c(a),h=u.next();!h.done;h=u.next()){if(h.value===e){a.splice(s,1),a.length<=0&&delete this._eventHandler[t];break}s++}}catch(t){n={error:t}}finally{try{h&&!h.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}return this},t.VERSION="3.0.2",t}(),p=u;var e=setTimeout;function v(t){return Boolean(t&&void 0!==t.length)}function g(){}function m(t){if(!(this instanceof m))throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],R(t,this)}function y(n,i){for(;3===n._state;)n=n._value;0!==n._state?(n._handled=!0,m._immediateFn(function(){var t,e=1===n._state?i.onFulfilled:i.onRejected;if(null!==e){try{t=e(n._value)}catch(t){return void x(i.promise,t)}E(i.promise,t)}else(1===n._state?E:x)(i.promise,n._value)})):n._deferreds.push(i)}function E(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof m)return e._state=3,e._value=t,void w(e);if("function"==typeof n)return void R((i=n,r=t,function(){i.apply(r,arguments)}),e)}e._state=1,e._value=t,w(e)}catch(t){x(e,t)}var i,r}function x(t,e){t._state=2,t._value=e,w(t)}function w(t){2===t._state&&0===t._deferreds.length&&m._immediateFn(function(){t._handled||m._unhandledRejectionFn(t._value)});for(var e=0,n=t._deferreds.length;e<n;e++)y(t,t._deferreds[e]);t._deferreds=null}function T(t,e,n){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=n}function R(t,e){var n=!1;try{t(function(t){n||(n=!0,E(e,t))},function(t){n||(n=!0,x(e,t))})}catch(t){if(n)return;n=!0,x(e,t)}}function b(t,e){for(var n=t.length,i=0;i<n;++i)if(e(t[i],i))return!0;return!1}function C(t,e){for(var n=t.length,i=0;i<n;++i)if(e(t[i],i))return t[i];return null}function P(t,e){try{return new RegExp(t,"g").exec(e)}catch(t){return null}}function M(t){return t.replace(/_/g,".")}function I(t,n){var i=null,r="-1";return b(t,function(t){var e=P("("+t.test+")((?:\\/|\\s|:)([0-9|\\.|_]+))?",n);return e&&!t.brand&&(i=t,r=e[3]||"-1",t.versionAlias?r=t.versionAlias:t.versionTest&&(t=t.versionTest.toLowerCase(),r=((t=P("("+t+")((?:\\/|\\s|:)([0-9|\\.|_]+))?",t=n))?t[3]:"")||r),r=M(r),1)}),{preset:i,version:r}}function O(t,e){return C(t,function(t){t=t.brand;return P(""+e.test,t.toLowerCase())})}m.prototype.catch=function(t){return this.then(null,t)},m.prototype.then=function(t,e){var n=new this.constructor(g);return y(this,new T(t,e,n)),n},m.prototype.finally=function(e){var n=this.constructor;return this.then(function(t){return n.resolve(e()).then(function(){return t})},function(t){return n.resolve(e()).then(function(){return n.reject(t)})})},m.all=function(e){return new m(function(r,o){if(!v(e))return o(new TypeError("Promise.all accepts an array"));var a=Array.prototype.slice.call(e);if(0===a.length)return r([]);var s=a.length;for(var t=0;t<a.length;t++)!function e(n,t){try{if(t&&("object"==typeof t||"function"==typeof t)){var i=t.then;if("function"==typeof i)return void i.call(t,function(t){e(n,t)},o)}a[n]=t,0==--s&&r(a)}catch(t){o(t)}}(t,a[t])})},m.allSettled=function(n){return new this(function(r,t){if(!n||void 0===n.length)return t(new TypeError(typeof n+" "+n+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var o=Array.prototype.slice.call(n);if(0===o.length)return r([]);var a=o.length;for(var e=0;e<o.length;e++)!function e(n,t){if(t&&("object"==typeof t||"function"==typeof t)){var i=t.then;if("function"==typeof i)return void i.call(t,function(t){e(n,t)},function(t){o[n]={status:"rejected",reason:t},0==--a&&r(o)})}o[n]={status:"fulfilled",value:t},0==--a&&r(o)}(e,o[e])})},m.resolve=function(e){return e&&"object"==typeof e&&e.constructor===m?e:new m(function(t){t(e)})},m.reject=function(n){return new m(function(t,e){e(n)})},m.race=function(r){return new m(function(t,e){if(!v(r))return e(new TypeError("Promise.race accepts an array"));for(var n=0,i=r.length;n<i;n++)m.resolve(r[n]).then(t,e)})},m._immediateFn="function"==typeof setImmediate?function(t){setImmediate(t)}:function(t){e(t,0)},m._unhandledRejectionFn=function(t){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",t)};var A=[{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"}],S=[{test:"(?=.*applewebkit/(53[0-7]|5[0-2]|[0-4]))(?=.*\\schrome)",id:"chrome"},{test:"chromium",id:"chrome"},{test:"whale",id:"chrome",brand:!0}],D=[{test:"applewebkit",id:"webkit"}],V=[{test:"(?=(iphone|ipad))(?!(.*version))",id:"webview"},{test:"(?=(android|iphone|ipad))(?=.*(naver|daum|; wv))",id:"webview"},{test:"webview",id:"webview"}],L=[{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 F(t){var e=function(t){if(void 0===t){if("undefined"==typeof navigator||!navigator)return"";t=navigator.userAgent||""}return t.toLowerCase()}(t),n=!!/mobi/g.exec(e),i={name:"unknown",version:"-1",majorVersion:-1,webview:!!I(V,e).preset,chromium:!!I(S,e).preset,webkit:!1},r={name:"unknown",version:"-1",majorVersion:-1},o=I(A,e),a=o.preset,s=o.version,t=I(L,e),o=t.preset,t=t.version;return i.webkit=!i.chromium&&!!I(D,e).preset,o&&(r.name=o.id,r.version=t,r.majorVersion=parseInt(t,10)),a&&(i.name=a.id,i.version=s,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}}function N(t){return void 0===t&&function(){if("undefined"!=typeof navigator&&navigator&&navigator.userAgentData){var t=navigator.userAgentData,t=t.brands||t.uaList;return t&&t.length}}()?(i=((s=navigator.userAgentData).uaList||s.brands).slice(),r=s.mobile||!1,o=i[0],a={name:o.brand,version:o.version,majorVersion:-1,webkit:!1,webview:b(V,function(t){return O(i,t)}),chromium:b(S,function(t){return O(i,t)})},s={name:"unknown",version:"-1",majorVersion:-1},a.webkit=!a.chromium&&b(D,function(t){return O(i,t)}),n&&(e=n.platform.toLowerCase(),o=C(L,function(t){return new RegExp(""+t.test,"g").exec(e)}),s.name=o?o.id:e,s.version=n.platformVersion),b(A,function(t){var e=O(i,t);return e&&(a.name=t.id,a.version=n?n.uaFullVersion:e.version,1)}),"Linux armv8l"===navigator.platform?s.name="android":a.webkit&&(s.name=r?"ios":"mac"),"ios"===s.name&&a.webview&&(a.version="-1"),s.version=M(s.version),a.version=M(a.version),s.majorVersion=parseInt(s.version,10),a.majorVersion=parseInt(a.version,10),{browser:a,os:s,isMobile:r,isHints:!0}):F(t);var n,e,i,r,o,a,s}var k="undefined"!=typeof window&&window.Math===Math?window:"undefined"!=typeof self&&self.Math===Math?self:Function("return this")(),U=k.document,Q=k.navigator,t=N(),B=t.os.name,z=t.browser.name,W="ios"===B,X="mac"===B&&"safari"===z;k.Float32Array=void 0!==k.Float32Array?k.Float32Array:k.Array;k.Float32Array,k.getComputedStyle;var j=k.navigator&&k.navigator.userAgent,G="ontouchstart"in k,Y="ondevicemotion"in k,H=k.DeviceMotionEvent,q=k.devicePixelRatio,K=function(){for(var t,e=null!==(t=null==U?void 0:U.documentElement.style)&&void 0!==t?t:{},n=["transform","webkitTransform","msTransform","mozTransform"],i=0,r=n.length;i<r;i++)if(n[i]in e)return n[i];return""}(),Z=k.CSS&&k.CSS.supports&&k.CSS.supports("will-change","transform"),J=!1,$=function(){var t=window.navigator;t.xr&&(t.xr.isSessionSupported?t.xr.isSessionSupported("immersive-vr").then(function(t){J=t}).catch(function(){}):t.xr.supportsSession&&t.xr.supportsSession("immersive-vr").then(function(t){J=t}).catch(function(){}))};var tt="__observers__",et=function(){function t(t){this._emitter=new _,this._current=t}var e=t.prototype;return Object.defineProperty(e,"current",{get:function(){return this._current},set:function(t){var e=t!==this._current;this._current=t,e&&this._emitter.trigger("update",t)},enumerable:!1,configurable:!0}),e.subscribe=function(t){this._emitter.on("update",t)},e.unsubscribe=function(t){this._emitter.off("update",t)},t}();function nt(t){return t[tt]||(t[tt]={}),t[tt]}function it(t,e,n){t=nt(t);return t[e]||(t[e]=new et(n)),t[e]}function rt(t){t.subscribe=function(t,e){it(this,t).subscribe(e)},t.unsubscribe=function(t,e){var n,i=this;if(!t)return n=nt(this),void Object.keys(n).forEach(function(t){i.unsubscribe(t)});t in this&&it(this,t).unsubscribe(e)}}function ot(t){rt(t.prototype)}var at=function(t,e){return(at=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 st(t,e){function n(){this.constructor=t}at(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var ut,ht=function(){return(ht=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)};ut="undefined"==typeof window?{navigator:{userAgent:""}}:window;function ct(t){for(var e=[],n=0,i=t.length;n<i;n++)e.push(t[n]);return e}var lt,dt,ft="left",_t="right",pt="middle",vt="ontouchstart"in ut&&"safari"===N().browser.name,gt=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""}(),mt={"user-select":"none","-webkit-user-drag":"none"},yt=function(t,e){var n;return void 0===e&&(e=!1),"string"==typeof t?(n=t.match(/^<([a-z]+)\s*([^>]*)>/)?((n=document.createElement("div")).innerHTML=t,ct(n.childNodes)):ct(document.querySelectorAll(t)),e||(n=1<=n.length?n[0]:void 0)):t===ut?n=t:"value"in t||"current"in t?n=t.value||t.current:!t.nodeName||1!==t.nodeType&&9!==t.nodeType?"jQuery"in ut&&t instanceof jQuery||t.constructor.prototype.jquery?n=e?t.toArray():t.get(0):Array.isArray(t)&&(n=t.map(function(t){return yt(t)}),e||(n=1<=n.length?n[0]:void 0)):n=t,n},Et=ut.requestAnimationFrame||ut.webkitRequestAnimationFrame,xt=ut.cancelAnimationFrame||ut.webkitCancelAnimationFrame;Et&&!xt?(lt={},dt=Et,Et=function(e){var n=dt(function(t){lt[n]&&e(t)});return lt[n]=!0,n},xt=function(t){delete lt[t]}):Et&&xt||(Et=function(t){return ut.setTimeout(function(){t(ut.performance&&ut.performance.now&&ut.performance.now()||(new Date).getTime())},16)},xt=ut.clearTimeout);function wt(t,e){var n,i={};for(n in t)n&&(i[n]=e(t[n],n));return i}function Tt(t,e){var n,i={};for(n in t)n&&e(t[n],n)&&(i[n]=t[n]);return i}function Rt(t,e){for(var n in t)if(n&&!e(t[n],n))return!1;return!0}function bt(t,n){return Rt(t,function(t,e){return t===n[e]})}function Ct(t,e){return Bt[e]||(Bt[e]=zt(e)),Bt[e](t)}function Pt(t,n){return t&&n?wt(t,function(t,e){return Ct(t,"number"==typeof n?n:n[e])}):t}function Mt(t){if(!isFinite(t))return 0;var e="".concat(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 It(e){var n=!0;return Object.keys(mt).forEach(function(t){e&&e[t]===mt[t]||(n=!1)}),n}function Ot(t,e){return t&&e?30:t?6:e?24:1}function At(t,e,n){return n?!!(30===e||e&t&&n&t):!!(e&t)}function St(e,t,n){var i,r=((r={})[1]="auto",r[30]="none",r[24]="pan-x",r[6]="pan-y",r),o={};return e&&e.style&&(n=t.touchAction||r[n],i=ht(ht({},mt),{"touch-action":"none"===e.style["touch-action"]?"none":n}),Object.keys(i).forEach(function(t){o[t]=e.style[t],e.style[t]=i[t]})),o}function Dt(e,n){e&&e.style&&n&&Object.keys(n).forEach(function(t){e.style[t]=n[t]})}function Vt(t,e,n,i){return e=[!n[0]&&i?e[0]-i[0]:e[0],!n[1]&&i?e[1]+i[1]:e[1]],t=Math.max(e[0],t),t=Math.min(e[1],t)}function Lt(t,e){return t<e[0]||t>e[1]}function Ft(t,e,n){return n[1]&&t>e[1]||n[0]&&t<e[0]}function Nt(t,e,n){var i=t,r=e[0],o=e[1],e=o-r;return n[1]&&o<t&&(i=(i-o)%e+r),n[0]&&t<r&&(i=(i-r)%e+o),i}function kt(t,e){return!!(!e||-1<e.indexOf("any")||-1<e.indexOf("none")&&!t.shiftKey&&!t.ctrlKey&&!t.altKey&&!t.metaKey||-1<e.indexOf("shift")&&t.shiftKey||-1<e.indexOf("ctrl")&&t.ctrlKey||-1<e.indexOf("alt")&&t.altKey||-1<e.indexOf("meta")&&t.metaKey)}function Ut(i,t){return t.reduce(function(t,e,n){return i[n]&&(t[i[n]]=e),t},{})}function Qt(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=Gt;break;case"pointer":i=qt}}),i?new Jt:e&&n?new $t:e?new Zt:n?new Kt:null}var Bt={},zt=function(e){var n=e<1?Math.pow(10,Mt(e)):1;return function(t){return 0===e?0:Math.round(Math.round(t/e)*e*n)/n}},Wt=function(){function t(t){this._axes=t}var e=t.prototype;return e.hold=function(t,e){t=this._getRoundPos(t).roundPos;this._axes.trigger(new p("hold",{pos:t,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,e=e.roundDepa;t.destPos=n,t.depaPos=e,t.setTo=this._createUserControll(t.destPos,t.duration),this._axes.trigger(new p("release",ht(ht({},t),{bounceRatio:this._getBounceRatio(n)})))},e.triggerChange=function(t,e,n,i){var r=this;void 0===i&&(i=!1);var o=this.animationManager,a=o.axisManager,o=o.getEventInfo(),t=this._getRoundPos(t,e),e=t.roundPos,t=t.roundDepa,s=a.moveTo(e,t),t=(null==n?void 0:n.event)||(null==o?void 0:o.event)||null,n={pos:s.pos,delta:s.delta,bounceRatio:this._getBounceRatio(s.pos),holding:i,inputEvent:t,isTrusted:!!t,input:(null==n?void 0:n.input)||(null==o?void 0:o.input)||null,set:t?this._createUserControll(s.pos):function(){}},o=new p("change",n);return this._axes.trigger(o),Object.keys(s.pos).forEach(function(t){var e=s.pos[t];it(r._axes,t,e).current=e}),t&&a.set(n.set().destPos),!o.isCanceled()},e.triggerAnimationStart=function(t){var e=this._getRoundPos(t.destPos,t.depaPos),n=e.roundPos,e=e.roundDepa;t.destPos=n,t.depaPos=e,t.setTo=this._createUserControll(t.destPos,t.duration);t=new p("animationStart",t);return this._axes.trigger(t),!t.isCanceled()},e.triggerAnimationEnd=function(t){void 0===t&&(t=!1),this._axes.trigger(new p("animationEnd",{isTrusted:t}))},e.triggerFinish=function(t){void 0===t&&(t=!1),this._axes.trigger(new p("finish",{isTrusted:t}))},e.setAnimationManager=function(t){this.animationManager=t},e.destroy=function(){this._axes.off()},e._createUserControll=function(t,e){void 0===e&&(e=0);var n={destPos:ht({},t),duration:e};return function(t,e){return t&&(n.destPos=ht({},t)),void 0!==e&&(n.duration=e),n}},e._getRoundPos=function(t,e){var n=this._axes.options.round;return{roundPos:Pt(t,n),roundDepa:Pt(e,n)}},e._getBounceRatio=function(t){return this._axes.axisManager.map(t,function(t,e){return t<e.range[0]&&0!==e.bounce[0]?(e.range[0]-t)/e.bounce[0]:t>e.range[1]&&0!==e.bounce[1]?(t-e.range[1])/e.bounce[1]:0})},t}(),Xt=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}(),jt=function(){function t(t){var n=this;this._axis=t,this._complementOptions(),this._pos=Object.keys(this._axis).reduce(function(t,e){return t[e]=n._axis[e].startPos,t},{})}var e=t.prototype;return e.getDelta=function(t,e){var n=this.get(t);return wt(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},{}):ht(ht({},this._pos),t||{})},e.moveTo=function(n,i){void 0===i&&(i=this._pos);var t=wt(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?Nt(t,e.range,e.circular):0})),{pos:ht({},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 Rt(t,function(t,e){return n(t,i[e],e)})},e.filter=function(t,n){var i=this._axis;return Tt(t,function(t,e){return n(t,i[e],e)})},e.map=function(t,n){var i=this._axis;return wt(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!Lt(t,e.range)})},e.getAxisOptions=function(t){return this._axis[t]},e.setAxis=function(e){var n=this;Object.keys(e).forEach(function(t){if(!n._axis[t])throw new Error("Axis ".concat(t," does not exist in Axes instance"));n._axis[t]=ht(ht({},n._axis[t]),e[t])}),this._complementOptions()},e._complementOptions=function(){var r=this;Object.keys(this._axis).forEach(function(i){r._axis[i]=ht({range:[0,100],startPos:r._axis[i].range[0],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])})})},t}(),Gt="ontouchstart"in ut,Yt="PointerEvent"in ut,Ht="MSPointerEvent"in ut,qt=Yt||Ht,t=function(){function t(){var e=this;this._stopContextMenu=function(t){t.preventDefault(),ut.removeEventListener("contextmenu",e._stopContextMenu)}}var e=t.prototype;return e.extendEvent=function(t){var e=this.prevEvent,n=this._getCenter(t),i=e?this._getMovement(t):{x:0,y:0},r=e?this._getScale(t):1,o=e?(d=n.x-e.center.x,l=n.y-e.center.y,180*Math.atan2(l,d)/Math.PI):0,a=e?e.deltaX+i.x:i.x,s=e?e.deltaY+i.y:i.y,u=i.x,h=i.y,c=this._latestInterval,l=Date.now(),d=c?l-c.timestamp:0,i=e?e.velocityX:0,e=e?e.velocityY:0;return(!c||16<=d)&&(c&&(i=(d=[(a-c.deltaX)/d,(s-c.deltaY)/d])[0],e=d[1]),this._latestInterval={timestamp:l,deltaX:a,deltaY:s}),{srcEvent:t,scale:r,angle:o,center:n,deltaX:a,deltaY:s,offsetX:u,offsetY:h,velocityX:i,velocityY:e,preventSystemEvent:!0}},e._getDistance=function(t,e){var n=e.clientX-t.clientX,t=e.clientY-t.clientY;return Math.sqrt(n*n+t*t)},e._getButton=function(t){var e={1:ft,2:_t,4:pt},t=this._isTouchEvent(t)?ft:e[t.buttons];return t||null},e._isTouchEvent=function(t){return t.type&&-1<t.type.indexOf("touch")},e._isValidButton=function(t,e){return-1<e.indexOf(t)},e._isValidEvent=function(t,e,n){return(!e||kt(t,e))&&(!n||this._isValidButton(this._getButton(t),n))},e._preventMouseButton=function(t,e){e===_t?ut.addEventListener("contextmenu",this._stopContextMenu):e===pt&&t.preventDefault()},t}(),Kt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=["mousedown"],t.move=["mousemove"],t.end=["mouseup"],t}st(t,e);var n=t.prototype;return n.onEventStart=function(t,e,n){var i=this._getButton(t);return this._isValidEvent(t,e,n)?(this._preventMouseButton(t,i),this.extendEvent(t)):null},n.onEventMove=function(t,e,n){return this._isValidEvent(t,e,n)?this.extendEvent(t):null},n.onEventEnd=function(){},n.onRelease=function(){this.prevEvent=null},n.getTouches=function(t,e){if(e){var n={1:ft,2:pt,3:_t};return this._isValidButton(n[t.which],e)&&-1===this.end.indexOf(t.type)?1:0}return 0},n._getScale=function(){return 1},n._getCenter=function(t){return{x:t.clientX,y:t.clientY}},n._getMovement=function(t){var e=this.prevEvent.srcEvent;return{x:t.clientX-e.clientX,y:t.clientY-e.clientY}},t}(t),Zt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=["touchstart"],t.move=["touchmove"],t.end=["touchend","touchcancel"],t}st(t,e);var n=t.prototype;return n.onEventStart=function(t,e){return this._baseTouches=t.touches,this._isValidEvent(t,e)?this.extendEvent(t):null},n.onEventMove=function(t,e){return this._isValidEvent(t,e)?this.extendEvent(t):null},n.onEventEnd=function(t){this._baseTouches=t.touches},n.onRelease=function(){this.prevEvent=null,this._baseTouches=null},n.getTouches=function(t){return t.touches.length},n._getScale=function(t){return 2!==t.touches.length||this._baseTouches.length<2?null:this._getDistance(t.touches[0],t.touches[1])/this._getDistance(this._baseTouches[0],this._baseTouches[1])},n._getCenter=function(t){return{x:t.touches[0].clientX,y:t.touches[0].clientY}},n._getMovement=function(t){var e=this.prevEvent.srcEvent;return t.touches[0].identifier!==e.touches[0].identifier?{x:0,y:0}:{x:t.touches[0].clientX-e.touches[0].clientX,y:t.touches[0].clientY-e.touches[0].clientY}},t}(t),Jt=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=Yt?["pointerdown"]:["MSPointerDown"],t.move=Yt?["pointermove"]:["MSPointerMove"],t.end=Yt?["pointerup","pointercancel"]:["MSPointerUp","MSPointerCancel"],t._firstInputs=[],t._recentInputs=[],t}st(t,e);var n=t.prototype;return n.onEventStart=function(t,e,n){var i=this._getButton(t);return this._isValidEvent(t,e,n)?(this._preventMouseButton(t,i),this._updatePointerEvent(t),this.extendEvent(t)):null},n.onEventMove=function(t,e,n){return this._isValidEvent(t,e,n)?(this._updatePointerEvent(t),this.extendEvent(t)):null},n.onEventEnd=function(t){this._removePointerEvent(t)},n.onRelease=function(){this.prevEvent=null,this._firstInputs=[],this._recentInputs=[]},n.getTouches=function(){return this._recentInputs.length},n._getScale=function(){return 2!==this._recentInputs.length?null:this._getDistance(this._recentInputs[0],this._recentInputs[1])/this._getDistance(this._firstInputs[0],this._firstInputs[1])},n._getCenter=function(t){return{x:t.clientX,y:t.clientY}},n._getMovement=function(t){var e=this.prevEvent.srcEvent;return t.pointerId!==e.pointerId?{x:0,y:0}:{x:t.clientX-e.clientX,y:t.clientY-e.clientY}},n._updatePointerEvent=function(n){var i=this,r=!1;this._recentInputs.forEach(function(t,e){t.pointerId===n.pointerId&&(r=!0,i._recentInputs[e]=n)}),r||(this._firstInputs.push(n),this._recentInputs.push(n))},n._removePointerEvent=function(e){this._firstInputs=this._firstInputs.filter(function(t){return t.pointerId!==e.pointerId}),this._recentInputs=this._recentInputs.filter(function(t){return t.pointerId!==e.pointerId})},t}(t),$t=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.start=["mousedown","touchstart"],t.move=["mousemove","touchmove"],t.end=["mouseup","touchend","touchcancel"],t}st(t,e);var n=t.prototype;return n.onEventStart=function(t,e,n){var i=this._getButton(t);return this._isTouchEvent(t)&&(this._baseTouches=t.touches),this._isValidEvent(t,e,n)?(this._preventMouseButton(t,i),this.extendEvent(t)):null},n.onEventMove=function(t,e,n){return this._isValidEvent(t,e,n)?this.extendEvent(t):null},n.onEventEnd=function(t){this._isTouchEvent(t)&&(this._baseTouches=t.touches)},n.onRelease=function(){this.prevEvent=null,this._baseTouches=null},n.getTouches=function(t){return this._isTouchEvent(t)?t.touches.length:0},n._getScale=function(t){return this._isTouchEvent(t)?2!==t.touches.length||this._baseTouches.length<2?1:this._getDistance(t.touches[0],t.touches[1])/this._getDistance(this._baseTouches[0],this._baseTouches[1]):this.prevEvent.scale},n._getCenter=function(t){return this._isTouchEvent(t)?{x:t.touches[0].clientX,y:t.touches[0].clientY}:{x:t.clientX,y:t.clientY}},n._getMovement=function(t){var e=this,n=[t,this.prevEvent.srcEvent].map(function(t){return e._isTouchEvent(t)?{id:t.touches[0].identifier,x:t.touches[0].clientX,y:t.touches[0].clientY}:{id:null,x:t.clientX,y:t.clientY}}),t=n[0],n=n[1];return t.id===n.id?{x:t.x-n.x,y:t.y-n.y}:{x:0,y:0}},t}(t);function te(t){return-1<t.indexOf("touch")&&{passive:!1}}function ee(t,e,n){return Math.max(Math.min(t,n),e)}var ne=function(){function t(t){var e=t.options,n=t.interruptManager,i=t.eventManager,r=t.axisManager,t=t.animationManager;this._isOutside=!1,this._moveDistance=null,this._isStopped=!1,this.options=e,this._interruptManager=n,this._eventManager=i,this._axisManager=r,this._animationManager=t}var e=t.prototype;return e.get=function(t){return this._axisManager.get(t.axes)},e.hold=function(t,e){!this._interruptManager.isInterrupted()&&t.axes.length&&(e={input:t,event:e},this._isStopped=!1,this._interruptManager.setInterrupt(!0),this._animationManager.stopAnimation(e),this._moveDistance||this._eventManager.hold(this._axisManager.get(),e),this._isOutside=this._axisManager.isOutside(t.axes),this._moveDistance=this._axisManager.get(t.axes))},e.change=function(t,e,n,i){var r,o,a;this._isStopped||!this._interruptManager.isInterrupting()||this._axisManager.every(n,function(t){return 0===t})||((r=e.srcEvent||e).__childrenAxesAlreadyChanged||(o=this._moveDistance||this._axisManager.get(t.axes),a=wt(o,function(t,e){return t+(n[e]||0)}),this._moveDistance&&(this._moveDistance=this._axisManager.map(a,function(t,e){var n=e.circular,e=e.range;return n&&(n[0]||n[1])?Nt(t,e,n):t})),this._isOutside&&this._axisManager.every(o,function(t,e){return!Lt(t,e.range)})&&(this._isOutside=!1),o=this._atOutside(o),a=this._atOutside(a),this.options.nested&&this._isEndofAxis(n,o,a)||(r.__childrenAxesAlreadyChanged=!0),e={input:t,event:e},i?(i=this._animationManager.getDuration(a,o),this._animationManager.animateTo(a,i,e)):this._eventManager.triggerChange(a,o,e,!0)||(this._isStopped=!0,this._moveDistance=null,this._animationManager.finish(!1))))},e.release=function(t,e,n,i){var r,o,a;!this._isStopped&&this._interruptManager.isInterrupting()&&this._moveDistance&&((r=e.srcEvent||e).__childrenAxesAlreadyReleased&&(n=n.map(function(){return 0})),o=this._axisManager.get(t.axes),a=this._axisManager.get(),n=this._animationManager.getDisplacement(n),n=Ut(t.axes,n),n=this._axisManager.get(this._axisManager.map(n,function(t,e,n){return e.circular&&(e.circular[0]||e.circular[1])?o[n]+t:Vt(o[n]+t,e.range,e.circular,e.bounce)})),r.__childrenAxesAlreadyReleased=!0,0===(i=this._animationManager.getDuration(n,o,i))&&(n=ht({},a)),n={depaPos:a,destPos:n,duration:i,delta:this._axisManager.getDelta(a,n),inputEvent:e,input:t,isTrusted:!0},this._eventManager.triggerRelease(n),this._moveDistance=null,n=this._animationManager.getUserControl(n),t={input:t,event:e},(e=bt(n.destPos,a))||0===n.duration?(e||this._eventManager.triggerChange(n.destPos,a,t,!0),this._interruptManager.setInterrupt(!1),this._axisManager.isOutside()?this._animationManager.restore(t):this._eventManager.triggerFinish(!0)):this._animationManager.animateTo(n.destPos,n.duration,t))},e._atOutside=function(t){var o=this;return this._isOutside?this._axisManager.map(t,function(t,e){var n=e.range[0]-e.bounce[0],e=e.range[1]+e.bounce[1];return e<t?e:t<n?n:t}):this._axisManager.map(t,function(t,e){var n=e.range[0],i=e.range[1],r=e.bounce,e=e.circular;return e[0]&&t<n||e[1]&&i<t?t:t<n?n-o._animationManager.interpolate(n-t,r[0]):i<t?i+o._animationManager.interpolate(t-i,r[1]):t})},e._isEndofAxis=function(r,o,a){return this._axisManager.every(o,function(t,e,n){return 0===r[n]||o[n]===a[n]&&(i=t,n=e.range,t=e.bounce,!(e=e.circular)[0]&&i===n[0]-t[0]||!e[1]&&i===n[1]+t[1]);var i})},t}(),ie=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._useDuration=!0,t}st(t,e);var n=t.prototype;return n.interpolate=function(t,e){var n=this._easing(1e-5)/1e-5;return this._easing(t/(e*n))*e},n.updateAnimation=function(t){var e,n,i,r,o=this._animateParam;o&&(e=(new Date).getTime()-o.startTime,n=(null==t?void 0:t.destPos)||o.destPos,i=null!==(r=null==t?void 0:t.duration)&&void 0!==r?r:o.duration,null!=t&&t.restart||i<=e?this.setTo(n,i-e):(null!=t&&t.destPos&&(r=this.axisManager.get(),this._initialEasingPer=this._prevEasingPer,o.delta=this.axisManager.getDelta(r,n),o.destPos=n),null!=t&&t.duration&&(t=(e+this._durationOffset)/o.duration,this._durationOffset=t*i-e,o.duration=i)))},n._initState=function(t){return this._initialEasingPer=0,this._prevEasingPer=0,this._durationOffset=0,{pos:t.depaPos,easingPer:0,finished:!1}},n._getNextState=function(t){var r=this,o=this._animateParam,a=t.pos,s=o.destPos,u=wt(a,function(t,e){return t<=s[e]?1:-1}),h=((new Date).getTime()-o.startTime+this._durationOffset)/o.duration,c=this._easing(h);return{pos:this.axisManager.map(a,function(t,e,n){var i=1<=h?s[n]:t+o.delta[n]*(c-r._prevEasingPer)/(1-r._initialEasingPer),t=Nt(i,e.range,e.circular);return i!==t&&(e=u[n]*(e.range[1]-e.range[0]),s[n]-=e,a[n]-=e),t}),easingPer:this._prevEasingPer=c,finished:1<=c}},n._easing=function(t){return 1<t?1:this._options.easing(t)},t}(function(){function t(t){var e=t.options,n=t.interruptManager,i=t.eventManager,t=t.axisManager;this._options=e,this.interruptManager=n,this.eventManager=i,this.axisManager=t,this.animationEnd=this.animationEnd.bind(this)}var e=t.prototype;return e.getDuration=function(n,t,e){var i,r=this;return t=void 0!==e?e:(i=wt(t,function(t,e){return function(t,e){e=Math.sqrt(t/e*2);return e<100?0:e}(Math.abs(t-n[e]),r._options.deceleration)}),Object.keys(i).reduce(function(t,e){return Math.max(t,i[e])},-1/0)),ee(t,this._options.minimumDuration,this._options.maximumDuration)},e.getDisplacement=function(t){var e=Math.pow(t.reduce(function(t,e){return t+e*e},0),1/t.length),n=Math.abs(e/-this._options.deceleration);return t.map(function(t){return t/2*n})},e.stopAnimation=function(t){var n,e;this._animateParam&&(n=this.axisManager.get(),e=this.axisManager.map(n,function(t,e){return Nt(t,e.range,e.circular)}),Rt(e,function(t,e){return n[e]===t})||this.eventManager.triggerChange(e,n,t,!!t),this._animateParam=null,this._raf&&(e=this._raf,xt(e)),this._raf=null,this.eventManager.triggerAnimationEnd(!(null==t||!t.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.axisManager.get(),n=this.axisManager.map(e,function(t,e){return Math.min(e.range[1],Math.max(e.range[0],t))});this.stopAnimation(),this.animateTo(n,this.getDuration(e,n),t)},e.animationEnd=function(){var t=this.getEventInfo();this._animateParam=null;var e=this.axisManager.filter(this.axisManager.get(),function(t,e){return Ft(t,e.range,e.circular)});0<Object.keys(e).length&&this.setTo(this.axisManager.map(e,function(t,e){return Nt(t,e.range,e.circular)})),this.interruptManager.setInterrupt(!1),this.eventManager.triggerAnimationEnd(!!t),this.axisManager.isOutside()?this.restore(t):this.finish(!!t)},e.finish=function(t){this._animateParam=null,this.interruptManager.setInterrupt(!1),this.eventManager.triggerFinish(t)},e.getUserControl=function(t){t=t.setTo();return t.destPos=this.axisManager.get(t.destPos),t.duration=ee(t.duration,this._options.minimumDuration,this._options.maximumDuration),t},e.animateTo=function(t,e,n){var i=this;this.stopAnimation();var r=this._createAnimationParam(t,e,n),t=ht({},r.depaPos),e=this.eventManager.triggerAnimationStart(r),r=this.getUserControl(r);!e&&this.axisManager.every(r.destPos,function(t,e){return Ft(t,e.range,e.circular)})&&console.warn("You can't stop the 'animation' event when 'circular' is true."),e&&!bt(r.destPos,t)&&(e=(null==n?void 0:n.event)||null,this._animateLoop({depaPos:t,destPos:r.destPos,duration:r.duration,delta:this.axisManager.getDelta(t,r.destPos),isTrusted:!!e,inputEvent:e,input:(null==n?void 0:n.input)||null},function(){return i.animationEnd()}))},e.setTo=function(t,e){void 0===e&&(e=0);var n=Object.keys(t),i=this.axisManager.get(n);if(bt(t,i))return this;this.interruptManager.setInterrupt(!0);t=Tt(t,function(t,e){return i[e]!==t});return Object.keys(t).length?(t=this.axisManager.map(t,function(t,e){var n=e.range,e=e.circular;return e&&(e[0]||e[1])?t:Vt(t,n,e)}),bt(t,i)||(0<e?this.animateTo(t,e):(this.stopAnimation(),this.eventManager.triggerChange(t),this.finish(!1))),this):this},e.setBy=function(n,t){return void 0===t&&(t=0),this.setTo(wt(this.axisManager.get(Object.keys(n)),function(t,e){return t+n[e]}),t)},e._createAnimationParam=function(t,e,n){var i=this.axisManager.get(),r=t,t=(null==n?void 0:n.event)||null;return{depaPos:i,destPos:r,duration:ee(e,this._options.minimumDuration,this._options.maximumDuration),delta:this.axisManager.getDelta(i,r),inputEvent:t,input:(null==n?void 0:n.input)||null,isTrusted:!!t,done:this.animationEnd}},e._animateLoop=function(t,i){var r,o,a,s=this;t.duration?(this._animateParam=ht(ht({},t),{startTime:(new Date).getTime()}),r=wt(t.destPos,function(t){return t}),o=this._initState(this._animateParam),(a=function(){s._raf=null;var t=s._animateParam,e=s._getNextState(o),n=!s.eventManager.triggerChange(e.pos,o.pos);(o=e).finished?(t.destPos=s._getFinalPos(t.destPos,r),bt(t.destPos,s.axisManager.get(Object.keys(t.destPos)))||s.eventManager.triggerChange(t.destPos,e.pos),i()):n?s.finish(!1):s._raf=Et(a)})()):(this.eventManager.triggerChange(t.destPos),i())},e._getFinalPos=function(t,n){var i=this;return wt(t,function(t,e){if(t>=n[e]-1e-6&&t<=n[e]+1e-6)return n[e];e=i._getRoundUnit(t,e);return Ct(t,e)})},e._getRoundUnit=function(t,e){var n=this._options.round,i=null;return n||(e=this.axisManager.getAxisOptions(e),t=Math.max(Mt(e.range[0]),Mt(e.range[1]),Mt(t)),i=1/Math.pow(10,t)),i||n},t}()),re=function(r){function t(t,e,n){void 0===t&&(t={}),void 0===e&&(e={}),void 0===n&&(n={});var i=r.call(this)||this;return i.axis=t,i._inputs=[],i.options=ht({easing:function(t){return 1-Math.pow(1-t,3)},interruptable:!0,maximumDuration:1/0,minimumDuration:0,deceleration:6e-4,round:null,nested:!1},e),Object.keys(n).forEach(function(t){i.axis[t].startPos=n[t]}),i.interruptManager=new Xt(i.options),i.axisManager=new jt(i.axis),i.eventManager=new Wt(i),i.animationManager=new ie(i),i.inputObserver=new ne(i),i.eventManager.setAnimationManager(i.animationManager),i.eventManager.triggerChange(i.axisManager.get()),i}st(t,r);var e=t.prototype;return e.connect=function(t,e){t="string"==typeof t?t.split(" "):t.concat();return~this._inputs.indexOf(e)&&this.disconnect(e),e.mapAxes(t),e.connect(this.inputObserver),this._inputs.push(e),this},e.disconnect=function(t){return t?0<=(t=this._inputs.indexOf(t))&&(this._inputs[t].disconnect(),this._inputs.splice(t,1)):(this._inputs.forEach(function(t){return t.disconnect()}),this._inputs=[]),this},e.get=function(t){return this.axisManager.get(t)},e.setTo=function(t,e){return void 0===e&&(e=0),this.animationManager.setTo(t,e),this},e.setBy=function(t,e){return void 0===e&&(e=0),this.animationManager.setBy(t,e),this},e.setOptions=function(t){return this.options=ht(ht({},this.options),t),this},e.setAxis=function(t){return this.axisManager.setAxis(t),this},e.stopAnimation=function(){return this.animationManager.stopAnimation(),this.animationManager.finish(!1),this},e.updateAnimation=function(t){return this.animationManager.updateAnimation(t),this},e.isBounceArea=function(t){return this.axisManager.isOutside(t)},e.destroy=function(){this.disconnect(),this.eventManager.destroy()},t.VERSION="3.8.3",t.TRANSFORM=gt,t.DIRECTION_NONE=1,t.DIRECTION_LEFT=2,t.DIRECTION_RIGHT=4,t.DIRECTION_UP=8,t.DIRECTION_DOWN=16,t.DIRECTION_HORIZONTAL=6,t.DIRECTION_VERTICAL=24,t.DIRECTION_ALL=30,function(t,e,n,i){var r,o=arguments.length,a=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,i);else for(var s=t.length-1;0<=s;s--)(r=t[s])&&(a=(o<3?r(a):3<o?r(e,n,a):r(e,n))||a);return 3<o&&a&&Object.defineProperty(e,n,a),a}([ot],t)}(_),oe=function(){function t(t,e){var n=this;this.axes=[],this.element=null,this._enabled=!1,this._activeEvent=null,this._atRightEdge=!1,this._rightEdgeTimer=0,this._dragged=!1,this._isOverThreshold=!1,this._preventClickWhenDragged=function(t){n._dragged&&(t.preventDefault(),t.stopPropagation()),n._dragged=!1},this._voidFunction=function(){},this.element=yt(t),this.options=ht({inputType:["touch","mouse","pointer"],inputKey:["any"],inputButton:[ft],scale:[1,1],thresholdAngle:45,threshold:0,preventClickOnDrag:!1,iOSEdgeSwipeThreshold:30,releaseOnScroll:!1,touchAction:null},e),this._onPanstart=this._onPanstart.bind(this),this._onPanmove=this._onPanmove.bind(this),this._onPanend=this._onPanend.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this._direction=Ot(!!t[0],!!t[1]),this.axes=t},e.connect=function(t){return this._activeEvent&&(this._detachElementEvent(),this._detachWindowEvent(this._activeEvent)),this._attachElementEvent(t),this._originalCssProps=St(this.element,this.options,this._direction),this},e.disconnect=function(){return this._detachElementEvent(),this._detachWindowEvent(this._activeEvent),It(this._originalCssProps)||Dt(this.element,this._originalCssProps),this._direction=1,this},e.destroy=function(){this.disconnect(),this.element=null},e.enable=function(){return this._enabled=!0,this},e.disable=function(){return this._enabled=!1,this},e.isEnabled=function(){return this._enabled},e.release=function(){var t=this._activeEvent,e=t.prevEvent;return t.onRelease(),this._observer.release(this,e,[0,0]),this._detachWindowEvent(t),this},e._onPanstart=function(t){var e=this.options,n=e.inputKey,i=e.inputButton,e=this._activeEvent,n=e.onEventStart(t,n,i);!n||!this._enabled||1<e.getTouches(t,i)||!1!==n.srcEvent.cancelable&&(i=this.options.iOSEdgeSwipeThreshold,this._dragged=!1,this._isOverThreshold=!1,this._observer.hold(this,n),this._atRightEdge=vt&&n.center.x>window.innerWidth-i,this._attachWindowEvent(e),e.prevEvent=n)},e._onPanmove=function(t){var e=this,n=this.options,i=n.iOSEdgeSwipeThreshold,r=n.preventClickOnDrag,o=n.releaseOnScroll,a=n.inputKey,s=n.inputButton,u=n.threshold,h=n.thresholdAngle,n=this._activeEvent,a=n.onEventMove(t,a,s),s=n.getTouches(t,s);if(0===s||o&&a&&!a.srcEvent.cancelable)this._onPanend(t);else if(a&&this._enabled&&!(1<s)){s=function(t,e){if(e<0||90<e)return 1;t=Math.abs(t);return e<t&&t<180-e?24:6}(a.angle,h),h=At(6,this._direction,s),s=At(24,this._direction,s);if(n.prevEvent&&vt){if(a.center.x<0)return void this.release();this._atRightEdge&&(clearTimeout(this._rightEdgeTimer),a.deltaX<-i?this._atRightEdge=!1:this._rightEdgeTimer=window.setTimeout(function(){return e.release()},100))}i=this._getDistance([a.deltaX,a.deltaY],[h,s]),h=this._getOffset([a.offsetX,a.offsetY],[h,s]),s=h.some(function(t){return 0!==t});s&&(!1!==a.srcEvent.cancelable&&a.srcEvent.preventDefault(),a.srcEvent.stopPropagation()),(a.preventSystemEvent=s)&&(this._isOverThreshold||u<=i)&&(this._dragged=r,this._isOverThreshold=!0,this._observer.change(this,a,Ut(this.axes,h))),n.prevEvent=a}},e._onPanend=function(t){var e=this.options.inputButton,n=this._activeEvent;n.onEventEnd(t),this._enabled&&0===n.getTouches(t,e)&&(this._detachWindowEvent(n),clearTimeout(this._rightEdgeTimer),t=n.prevEvent,e=this._isOverThreshold?this._getOffset([Math.abs(t.velocityX)*(t.offsetX<0?-1:1),Math.abs(t.velocityY)*(t.offsetY<0?-1:1)],[At(6,this._direction),At(24,this._direction)]):[0,0],n.onRelease(),this._observer.release(this,t,e))},e._attachWindowEvent=function(t){var e=this;null!=t&&t.move.forEach(function(t){window.addEventListener(t,e._onPanmove,te(t))}),null!=t&&t.end.forEach(function(t){window.addEventListener(t,e._onPanend,te(t))})},e._detachWindowEvent=function(t){var e=this;null!=t&&t.move.forEach(function(t){window.removeEventListener(t,e._onPanmove)}),null!=t&&t.end.forEach(function(t){window.removeEventListener(t,e._onPanend)})},e._getOffset=function(t,e){var n=this.options.scale;return[e[0]?t[0]*n[0]:0,e[1]?t[1]*n[1]:0]},e._getDistance=function(t,e){return Math.sqrt(Number(e[0])*Math.pow(t[0],2)+Number(e[1])*Math.pow(t[1],2))},e._attachElementEvent=function(t){var e=this,n=Qt(this.options.inputType),i=this.element;if(n){if(!i)throw new Error("Element to connect input does not exist.");this._observer=t,this._enabled=!0,this._activeEvent=n,i.addEventListener("click",this._preventClickWhenDragged,!0),n.start.forEach(function(t){i.addEventListener(t,e._onPanstart)}),n.move.forEach(function(t){i.addEventListener(t,e._voidFunction)})}},e._detachElementEvent=function(){var e=this,t=this._activeEvent,n=this.element;n&&(n.removeEventListener("click",this._preventClickWhenDragged,!0),null!=t&&t.start.forEach(function(t){n.removeEventListener(t,e._onPanstart)}),null!=t&&t.move.forEach(function(t){n.removeEventListener(t,e._voidFunction)})),this._enabled=!1,this._observer=null},t}(),ae=function(){function t(t,e){this.axes=[],this.element=null,this._pinchFlag=!1,this._enabled=!1,this._activeEvent=null,this._isOverThreshold=!1,this.element=yt(t),this.options=ht({scale:1,threshold:0,inputType:["touch","pointer"],touchAction:"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){return this._activeEvent&&this._detachEvent(),this._attachEvent(t),this._originalCssProps=St(this.element,this.options,30),this},e.disconnect=function(){return this._detachEvent(),It(this._originalCssProps)||Dt(this.element,this._originalCssProps),this},e.destroy=function(){this.disconnect(),this.element=null},e.enable=function(){return this._enabled=!0,this},e.disable=function(){return this._enabled=!1,this},e.isEnabled=function(){return this._enabled},e._onPinchStart=function(t){var e=this._activeEvent,n=e.onEventStart(t);n&&this._enabled&&2===e.getTouches(t)&&(this._baseValue=this._observer.get(this)[this.axes[0]],this._observer.hold(this,t),this._pinchFlag=!0,this._isOverThreshold=!1,e.prevEvent=n)},e._onPinchMove=function(t){var e,n,i=this.options.threshold,r=this._activeEvent,o=r.onEventMove(t);o&&this._pinchFlag&&this._enabled&&2===r.getTouches(t)&&(e=this._getDistance(o.scale),n=this._getOffset(o.scale,r.prevEvent.scale),(this._isOverThreshold||i<=e)&&(this._isOverThreshold=!0,this._observer.change(this,t,Ut(this.axes,[n]))),r.prevEvent=o)},e._onPinchEnd=function(t){var e=this._activeEvent;e.onEventEnd(t),!this._pinchFlag||!this._enabled||2<=e.getTouches(t)||(e.onRelease(),this._observer.release(this,t,[0],0),this._baseValue=null,this._pinchFlag=!1)},e._attachEvent=function(t){var e=this,n=Qt(this.options.inputType),i=this.element;if(n){if(!i)throw new Error("Element to connect input does not exist.");this._observer=t,this._enabled=!0,(this._activeEvent=n).start.forEach(function(t){i.addEventListener(t,e._onPinchStart,!1)}),n.move.forEach(function(t){i.addEventListener(t,e._onPinchMove,!1)}),n.end.forEach(function(t){i.addEventListener(t,e._onPinchEnd,!1)})}},e._detachEvent=function(){var e=this,t=this._activeEvent,n=this.element;n&&(null!=t&&t.start.forEach(function(t){n.removeEventListener(t,e._onPinchStart,!1)}),null!=t&&t.move.forEach(function(t){n.removeEventListener(t,e._onPinchMove,!1)}),null!=t&&t.end.forEach(function(t){n.removeEventListener(t,e._onPinchEnd,!1)})),this._enabled=!1,this._observer=null},e._getOffset=function(t,e){return void 0===e&&(e=1),this._baseValue*(t-e)*this.options.scale},e._getDistance=function(t){return Math.abs(t-1)},t}(),se=function(){function t(t,e){this.axes=[],this.element=null,this._enabled=!1,this._holding=!1,this._timer=null,this.element=yt(t),this.options=ht({inputKey:["any"],scale:1,releaseDelay:300,useNormalized:!0,useAnimation:!1},e),this._onWheel=this._onWheel.bind(this)}var e=t.prototype;return e.mapAxes=function(t){this._direction=Ot(!!t[1],!!t[0]),this.axes=t},e.connect=function(t){return this._detachEvent(),this._attachEvent(t),this},e.disconnect=function(){return this._detachEvent(),this},e.destroy=function(){this.disconnect(),this.element=null},e.enable=function(){return this._enabled=!0,this},e.disable=function(){return this._enabled=!1,this},e.isEnabled=function(){return this._enabled},e._onWheel=function(t){var e,n=this;this._enabled&&kt(t,this.options.inputKey)&&(0===(e=this._getOffset([t.deltaY,t.deltaX],[At(24,this._direction),At(6,this._direction)]))[0]&&0===e[1]||(t.preventDefault(),this._holding||(this._observer.hold(this,t),this._holding=!0),this._observer.change(this,t,Ut(this.axes,e),this.options.useAnimation),clearTimeout(this._timer),this._timer=setTimeout(function(){n._holding&&(n._holding=!1,n._observer.release(n,t,[0]))},this.options.releaseDelay)))},e._getOffset=function(t,e){var n=this.options.scale,i=this.options.useNormalized;return[e[0]&&t[0]?(0<t[0]?-1:1)*(i?1:Math.abs(t[0]))*n:0,e[1]&&t[1]?(0<t[1]?-1:1)*(i?1:Math.abs(t[1]))*n:0]},e._attachEvent=function(t){var e=this.element;if(!e)throw new Error("Element to connect input does not exist.");this._observer=t,e.addEventListener("wheel",this._onWheel),this._enabled=!0},e._detachEvent=function(){this.element&&this.element.removeEventListener("wheel",this._onWheel),this._enabled=!1,this._observer=null,this._timer&&(clearTimeout(this._timer),this._timer=null)},t}(),ue