UNPKG

130 kBJavaScriptView Raw
1/*
2Copyright (c) 2015-present NAVER Corp.
3name: @egjs/flicking
4license: MIT
5author: NAVER Corp.
6repository: https://github.com/naver/egjs-flicking
7version: 4.3.0
8*/
9!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Flicking=t()}(this,function(){"use strict";var i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var r=function(){return(r=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function h(e,a,s,u){return new(s=s||Promise)(function(n,t){function i(e){try{o(u.next(e))}catch(e){t(e)}}function r(e){try{o(u.throw(e))}catch(e){t(e)}}function o(e){var t;e.done?n(e.value):((t=e.value)instanceof s?t:new s(function(e){e(t)})).then(i,r)}o((u=u.apply(e,a||[])).next())})}function m(n,i){var r,o,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,o&&(a=2&t[0]?o.return:t[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,t[1])).done)return a;switch(o=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,o=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=i.call(n,s)}catch(e){t=[6,e],o=0}finally{r=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}}function l(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&i>=e.length?void 0:e)&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function f(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,r,o=n.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(i=o.next()).done;)a.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return a}function d(e,t){for(var n=0,i=t.length,r=e.length;n<i;n++,r++)e[r]=t[n];return e}function p(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&i>=e.length?void 0:e)&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function s(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,r,o=n.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(i=o.next()).done;)a.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return a}(arguments[t]));return e}function g(e){return void 0===e}function e(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return e.forEach(function(t){Object.keys(t).forEach(function(e){n[e]=t[e]})}),n}function _(e,t){if(!e)throw new H(C.NOT_ATTACHED_TO_FLICKING(t),I.NOT_ATTACHED_TO_FLICKING);return e}function o(e){return[].slice.call(e)}function u(e,t){var n;if(z(e))switch(e){case S.PREV:n=0;break;case S.CENTER:n=.5*t;break;case S.NEXT:n=t;break;default:if(null==(n=c(e,t)))throw new H(C.WRONG_OPTION("align",e),I.WRONG_OPTION)}else n=e;return n}function c(e,t){return null==(e=j(e))?null:e.percentage*t+e.absolute}function v(e,t){return e===t?D.NONE:e<t?D.NEXT:D.PREV}function y(e){Array.isArray(e)||(e=[e]);var n=[];return e.forEach(function(e){if(z(e)){var t=document.createElement("div");for(t.innerHTML=e,n.push.apply(n,d([],f(o(t.children))));t.firstChild;)t.removeChild(t.firstChild)}else{if(!e||e.nodeType!==Node.ELEMENT_NODE)throw new H(C.WRONG_TYPE(e,["HTMLElement","string"]),I.WRONG_TYPE);n.push(e)}}),n}function b(e,t){return L(e<0?e+t:e,0,t)}function E(e,t){var n,i;try{for(var r=l(e),o=r.next();!o.done;o=r.next())if(o.value===t)return 1}catch(e){n={error:e}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}}function P(e,t,n){var i=n-t;return e<t?e=n-(t-e)%i:n<e&&(e=t+(e-n)%i),e}function T(e,t,n){return(e-t)/(n-t)}function O(e){return window.getComputedStyle(e)||e.currentStyle}function x(e,t,n){return t<=e&&e<=n}var n,R=function(){function e(e,t){var n,i;if(this.eventType=e,this._canceled=!1,t)try{for(var r=p(Object.keys(t)),o=r.next();!o.done;o=r.next()){var a=o.value;this[a]=t[a]}}catch(e){n={error:e}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}}var t=e.prototype;return t.stop=function(){this._canceled=!0},t.isCanceled=function(){return this._canceled},e}(),t=function(){function e(){this._eventHandler={}}var t=e.prototype;return t.trigger=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];var i=t instanceof R?t.eventType:t,i=s(this._eventHandler[i]||[]);return i.length<=0||(t instanceof R?(t.currentTarget=this,i.forEach(function(e){e(t)})):i.forEach(function(e){e.apply(void 0,s(n))})),this},t.once=function(n,i){var r,o=this;if("object"==typeof n&&g(i)){var e,t=n;for(e in t)this.once(e,t[e]);return this}return"string"==typeof n&&"function"==typeof i&&this.on(n,r=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];i.apply(void 0,s(e)),o.off(n,r)}),this},t.hasOn=function(e){return!!this._eventHandler[e]},t.on=function(e,t){if("object"==typeof e&&g(t)){var n,i=e;for(n in i)this.on(n,i[n]);return this}var r;return"string"==typeof e&&"function"==typeof t&&(r=this._eventHandler[e],g(r)&&(this._eventHandler[e]=[],r=this._eventHandler[e]),r.push(t)),this},t.off=function(e,t){var n,i;if(g(e))return this._eventHandler={},this;if(g(t)){if("string"==typeof e)return delete this._eventHandler[e],this;var r,o=e;for(r in o)this.off(r,o[r]);return this}var a=this._eventHandler[e];if(a){var s=0;try{for(var u=p(a),c=u.next();!c.done;c=u.next()){if(c.value===t){a.splice(s,1),a.length<=0&&delete this._eventHandler[e];break}s++}}catch(e){n={error:e}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}return this},e.VERSION="3.0.1",e}(),w=R,I={WRONG_TYPE:0,ELEMENT_NOT_FOUND:1,VAL_MUST_NOT_NULL:2,NOT_ATTACHED_TO_FLICKING:3,WRONG_OPTION:4,INDEX_OUT_OF_RANGE:5,POSITION_NOT_REACHABLE:6,TRANSFORM_NOT_SUPPORTED:7,STOP_CALLED_BY_USER:8,ANIMATION_INTERRUPTED:9,ANIMATION_ALREADY_PLAYING:10,NOT_ALLOWED_IN_FRAMEWORK:11,NOT_INITIALIZED:12,NO_ACTIVE:13},C={WRONG_TYPE:function(e,t){return e+"("+typeof e+") is not a "+t.map(function(e){return'"'+e+'"'}).join(" or ")+"."},ELEMENT_NOT_FOUND:function(e){return'Element with selector "'+e+'" not found.'},VAL_MUST_NOT_NULL:function(e,t){return t+" should be provided. Given: "+e},NOT_ATTACHED_TO_FLICKING:function(e){return e+' is not attached to the Flicking instance. "init()" should be called first.'},WRONG_OPTION:function(e,t){return'Option "'+e+'" is not in correct format, given: '+t},INDEX_OUT_OF_RANGE:function(e,t,n){return'Index "'+e+'" is out of range: should be between '+t+" and "+n+"."},POSITION_NOT_REACHABLE:function(e){return'Position "'+e+'" is not reachable.'},TRANSFORM_NOT_SUPPORTED:"Browser does not support CSS transform.",STOP_CALLED_BY_USER:"Event stop() is called by user.",ANIMATION_INTERRUPTED:"Animation is interrupted by user input.",ANIMATION_ALREADY_PLAYING:"Animation is already playing.",NOT_ALLOWED_IN_FRAMEWORK:"This behavior is not allowed in the frameworks like React, Vue, or Angular.",NOT_INITIALIZED:"Flicking is not initialized yet, call init() first.",NO_ACTIVE:"There's no active panel that Flicking has selected. This may be due to the absence of any panels."},N={READY:"ready",BEFORE_RESIZE:"beforeResize",AFTER_RESIZE:"afterResize",HOLD_START:"holdStart",HOLD_END:"holdEnd",MOVE_START:"moveStart",MOVE:"move",MOVE_END:"moveEnd",WILL_CHANGE:"willChange",CHANGED:"changed",WILL_RESTORE:"willRestore",RESTORED:"restored",SELECT:"select",NEED_PANEL:"needPanel",VISIBLE_CHANGE:"visibleChange",REACH_EDGE:"reachEdge",PANEL_CHANGE:"panelChange"},S={PREV:"prev",CENTER:"center",NEXT:"next"},D={PREV:"PREV",NEXT:"NEXT",NONE:null},k={SNAP:"snap",FREE_SCROLL:"freeScroll",STRICT:"strict"},A={__proto__:null,EVENTS:N,ALIGN:S,DIRECTION:D,MOVE_TYPE:k,ERROR_CODE:I},L=function(e,t,n){return Math.max(Math.min(e,n),t)},j=function(e){var t=/(?:(\+|\-)\s*)?(\d+(?:\.\d+)?(%|px)?)/g;if("number"==typeof e)return{percentage:0,absolute:e};for(var n={percentage:0,absolute:0},i=0,r=t.exec(e);null!=r;){var o=r[1],a=r[2],s=r[3],a=parseFloat(a);if(!(o=i<=0?o||"+":o))return null;o="+"===o?1:-1;"%"===s?n.percentage+=a/100*o:n.absolute+=o*a,++i,r=t.exec(e)}return 0===i?null:n},z=function(e){return"string"==typeof e},M=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},H=(a(F,n=Error),F);function F(e,t){e=n.call(this,e)||this;return M(e,F.prototype),e.name="FlickingError",e.code=t,e}var V=(On=G.prototype,Object.defineProperty(On,"element",{get:function(){return this._el},enumerable:!1,configurable:!0}),Object.defineProperty(On,"width",{get:function(){return this._width-this._padding.left-this._padding.right},enumerable:!1,configurable:!0}),Object.defineProperty(On,"height",{get:function(){return this._height-this._padding.top-this._padding.bottom},enumerable:!1,configurable:!0}),Object.defineProperty(On,"padding",{get:function(){return this._padding},enumerable:!1,configurable:!0}),On.setSize=function(e){var t=e.width,n=e.height,i=this._el,r=this._padding,e=this._isBorderBoxSizing;null!=t&&(z(t)?i.style.width=t:(t=e?t+r.left+r.right:t,i.style.width=t+"px")),null!=n&&(z(n)?i.style.height=n:(n=e?n+r.top+r.bottom:n,i.style.height=n+"px")),this.resize()},On.resize=function(){var e=this._el,t=O(e);this._width=e.clientWidth,this._height=e.clientHeight,this._padding={left:parseFloat(t.paddingLeft),right:parseFloat(t.paddingRight),top:parseFloat(t.paddingTop),bottom:parseFloat(t.paddingBottom)},this._isBorderBoxSizing="border-box"===t.boxSizing},G);function G(e){this._el=e,this._width=0,this._height=0,this._padding={left:0,right:0,top:0,bottom:0},this._isBorderBoxSizing=!1}function X(){return(X=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n,i=arguments[t];for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e}).apply(this,arguments)}function Y(e,t){e.prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t}function W(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var B="function"!=typeof Object.assign?function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var i=arguments[n];if(null!=i)for(var r in i)i.hasOwnProperty(r)&&(t[r]=i[r])}return t}:Object.assign,U=["","webkit","Moz","MS","ms","o"],q="undefined"==typeof document?{style:{}}:document.createElement("div"),K=Math.round,Z=Math.abs,J=Date.now;function Q(e,t){for(var n,i=t[0].toUpperCase()+t.slice(1),r=0;r<U.length;){if((n=(n=U[r])?n+i:t)in e)return n;r++}}var $="undefined"==typeof window?{}:window,ee=Q(q.style,"touchAction"),te=void 0!==ee;var ne="compute",ie="manipulation",re="none",oe="pan-x",ae="pan-y",se=function(){if(!te)return!1;var t={},n=$.CSS&&$.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(e){return t[e]=!n||$.CSS.supports("touch-action",e)}),t}(),ue="ontouchstart"in $,ce=void 0!==Q($,"PointerEvent"),le=ue&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),he="touch",fe="mouse",de=1,pe=4,ge=8,ve=["x","y"],me=["clientX","clientY"];function _e(e,t,n){if(e)if(e.forEach)e.forEach(t,n);else if(void 0!==e.length)for(i=0;i<e.length;)t.call(n,e[i],i,e),i++;else for(var i in e)e.hasOwnProperty(i)&&t.call(n,e[i],i,e)}function ye(e,t){return"function"==typeof e?e.apply(t&&t[0]||void 0,t):e}function be(e,t){return-1<e.indexOf(t)}var Ee=function(){function e(e,t){this.manager=e,this.set(t)}var t=e.prototype;return t.set=function(e){e===ne&&(e=this.compute()),te&&this.manager.element.style&&se[e]&&(this.manager.element.style[ee]=e),this.actions=e.toLowerCase().trim()},t.update=function(){this.set(this.manager.options.touchAction)},t.compute=function(){var t=[];return _e(this.manager.recognizers,function(e){ye(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))}),function(e){if(be(e,re))return re;var t=be(e,oe),n=be(e,ae);return t&&n?re:t||n?t?oe:ae:be(e,ie)?ie:"auto"}(t.join(" "))},t.preventDefaults=function(e){var t=e.srcEvent,n=e.offsetDirection;if(this.manager.session.prevented)t.preventDefault();else{var i=this.actions,r=be(i,re)&&!se[re],o=be(i,ae)&&!se[ae],a=be(i,oe)&&!se[oe];if(r){var s=1===e.pointers.length,i=e.distance<2,e=e.deltaTime<250;if(s&&i&&e)return}if(!a||!o)return r||o&&6&n||a&&24&n?this.preventSrc(t):void 0}},t.preventSrc=function(e){this.manager.session.prevented=!0,e.preventDefault()},e}();function Pe(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function Te(e){var t=e.length;if(1===t)return{x:K(e[0].clientX),y:K(e[0].clientY)};for(var n=0,i=0,r=0;r<t;)n+=e[r].clientX,i+=e[r].clientY,r++;return{x:K(n/t),y:K(i/t)}}function Oe(e){for(var t=[],n=0;n<e.pointers.length;)t[n]={clientX:K(e.pointers[n].clientX),clientY:K(e.pointers[n].clientY)},n++;return{timeStamp:J(),pointers:t,center:Te(t),deltaX:e.deltaX,deltaY:e.deltaY}}function xe(e,t,n){var i=t[(n=n||ve)[0]]-e[n[0]],n=t[n[1]]-e[n[1]];return Math.sqrt(i*i+n*n)}function Re(e,t,n){var i=t[(n=n||ve)[0]]-e[n[0]],n=t[n[1]]-e[n[1]];return 180*Math.atan2(n,i)/Math.PI}function we(e,t){return e===t?1:Z(e)>=Z(t)?e<0?2:4:t<0?8:16}function Ae(e,t,n){return{x:t/e||0,y:n/e||0}}function Ie(e,t){var n=e.session,i=t.pointers,r=i.length;n.firstInput||(n.firstInput=Oe(t)),1<r&&!n.firstMultiple?n.firstMultiple=Oe(t):1===r&&(n.firstMultiple=!1);var o,a,s=n.firstInput,u=n.firstMultiple,c=(u||s).center,l=t.center=Te(i);t.timeStamp=J(),t.deltaTime=t.timeStamp-s.timeStamp,t.angle=Re(c,l),t.distance=xe(c,l),o=n,r=(a=t).center,s=o.offsetDelta||{},c=o.prevDelta||{},l=o.prevInput||{},a.eventType!==de&&l.eventType!==pe||(c=o.prevDelta={x:l.deltaX||0,y:l.deltaY||0},s=o.offsetDelta={x:r.x,y:r.y}),a.deltaX=c.x+(r.x-s.x),a.deltaY=c.y+(r.y-s.y),t.offsetDirection=we(t.deltaX,t.deltaY);var h,f,d,p,s=Ae(t.deltaTime,t.deltaX,t.deltaY);t.overallVelocityX=s.x,t.overallVelocityY=s.y,t.overallVelocity=Z(s.x)>Z(s.y)?s.x:s.y,t.scale=u?(s=u.pointers,xe(i[0],i[1],me)/xe(s[0],s[1],me)):1,t.rotation=u?(p=u.pointers,Re(i[1],i[0],me)+Re(p[1],p[0],me)):0,t.maxPointers=!n.prevInput||t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers,u=t,p=(i=n).lastInterval||u,n=u.timeStamp-p.timeStamp,u.eventType!==ge&&(25<n||void 0===p.velocity)?(h=(d=Ae(n,n=u.deltaX-p.deltaX,g=u.deltaY-p.deltaY)).x,f=d.y,d=Z(d.x)>Z(d.y)?d.x:d.y,g=we(n,g),i.lastInterval=u):(d=p.velocity,h=p.velocityX,f=p.velocityY,g=p.direction),u.velocity=d,u.velocityX=h,u.velocityY=f,u.direction=g;var g=e.element,e=t.srcEvent,e=e.composedPath?e.composedPath()[0]:e.path?e.path[0]:e.target;Pe(e,g)&&(g=e),t.target=g}function Ce(e,t,n){var i=n.pointers.length,r=n.changedPointers.length,o=t&de&&i-r==0,r=t&(pe|ge)&&i-r==0;n.isFirst=!!o,n.isFinal=!!r,o&&(e.session={}),n.eventType=t,Ie(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function Ne(e){return e.trim().split(/\s+/g)}function Se(t,e,n){_e(Ne(e),function(e){t.addEventListener(e,n,!1)})}function De(t,e,n){_e(Ne(e),function(e){t.removeEventListener(e,n,!1)})}function ke(e){e=e.ownerDocument||e;return e.defaultView||e.parentWindow||window}var Le=function(){function e(t,e){var n=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){ye(t.options.enable,[t])&&n.handler(e)},this.init()}var t=e.prototype;return t.handler=function(){},t.init=function(){this.evEl&&Se(this.element,this.evEl,this.domHandler),this.evTarget&&Se(this.target,this.evTarget,this.domHandler),this.evWin&&Se(ke(this.element),this.evWin,this.domHandler)},t.destroy=function(){this.evEl&&De(this.element,this.evEl,this.domHandler),this.evTarget&&De(this.target,this.evTarget,this.domHandler),this.evWin&&De(ke(this.element),this.evWin,this.domHandler)},e}();function je(e,t,n){if(e.indexOf&&!n)return e.indexOf(t);for(var i=0;i<e.length;){if(n&&e[i][n]==t||!n&&e[i]===t)return i;i++}return-1}var ze={pointerdown:de,pointermove:2,pointerup:pe,pointercancel:ge,pointerout:ge},Me={2:he,3:"pen",4:fe,5:"kinect"},He="pointerdown",Fe="pointermove pointerup pointercancel";$.MSPointerEvent&&!$.PointerEvent&&(He="MSPointerDown",Fe="MSPointerMove MSPointerUp MSPointerCancel");var Ve=function(t){function n(){var e=n.prototype;return e.evEl=He,e.evWin=Fe,(e=t.apply(this,arguments)||this).store=e.manager.session.pointerEvents=[],e}return Y(n,t),n.prototype.handler=function(e){var t=this.store,n=!1,i=e.type.toLowerCase().replace("ms",""),r=ze[i],o=Me[e.pointerType]||e.pointerType,a=o===he,i=je(t,e.pointerId,"pointerId");r&de&&(0===e.button||a)?i<0&&(t.push(e),i=t.length-1):r&(pe|ge)&&(n=!0),i<0||(t[i]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),n&&t.splice(i,1))},n}(Le);function Ge(e){return Array.prototype.slice.call(e,0)}function Xe(e,n,t){for(var i=[],r=[],o=0;o<e.length;){var a=n?e[o][n]:e[o];je(r,a)<0&&i.push(e[o]),r[o]=a,o++}return i=t?n?i.sort(function(e,t){return e[n]>t[n]}):i.sort():i}var Ye={touchstart:de,touchmove:2,touchend:pe,touchcancel:ge},We=function(t){function n(){var e;return n.prototype.evTarget="touchstart touchmove touchend touchcancel",(e=t.apply(this,arguments)||this).targetIds={},e}return Y(n,t),n.prototype.handler=function(e){var t=Ye[e.type],n=function(e,t){var n,i,r=Ge(e.touches),o=this.targetIds;if(t&(2|de)&&1===r.length)return o[r[0].identifier]=!0,[r,r];var a=Ge(e.changedTouches),s=[],u=this.target;if(i=r.filter(function(e){return Pe(e.target,u)}),t===de)for(n=0;n<i.length;)o[i[n].identifier]=!0,n++;n=0;for(;n<a.length;)o[a[n].identifier]&&s.push(a[n]),t&(pe|ge)&&delete o[a[n].identifier],n++;if(s.length)return[Xe(i.concat(s),"identifier",!0),s]}.call(this,e,t);n&&this.callback(this.manager,t,{pointers:n[0],changedPointers:n[1],pointerType:he,srcEvent:e})},n}(Le);var Be={mousedown:de,mousemove:2,mouseup:pe},Ue=function(t){function n(){var e=n.prototype;return e.evEl="mousedown",e.evWin="mousemove mouseup",(e=t.apply(this,arguments)||this).pressed=!1,e}return Y(n,t),n.prototype.handler=function(e){var t=Be[e.type];t&de&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=pe),this.pressed&&(t&pe&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:fe,srcEvent:e}))},n}(Le),qe=2500,Ke=25;function Ze(e){var t,n,e=e.changedPointers[0];e.identifier===this.primaryTouch&&(t={x:e.clientX,y:e.clientY},n=this.lastTouches,this.lastTouches.push(t),setTimeout(function(){var e=n.indexOf(t);-1<e&&n.splice(e,1)},qe))}var Je=function(){return function(n){function e(e,t){var o=n.call(this,e,t)||this;return o.handler=function(e,t,n){var i=n.pointerType===he,r=n.pointerType===fe;if(!(r&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(i)!function(e,t){e&de?(this.primaryTouch=t.changedPointers[0].identifier,Ze.call(this,t)):e&(pe|ge)&&Ze.call(this,t)}.call(W(W(o)),t,n);else if(r&&function(e){for(var t=e.srcEvent.clientX,n=e.srcEvent.clientY,i=0;i<this.lastTouches.length;i++){var r=this.lastTouches[i],o=Math.abs(t-r.x),r=Math.abs(n-r.y);if(o<=Ke&&r<=Ke)return!0}return!1}.call(W(W(o)),n))return;o.callback(e,t,n)}},o.touch=new We(o.manager,o.handler),o.mouse=new Ue(o.manager,o.handler),o.primaryTouch=null,o.lastTouches=[],o}return Y(e,n),e.prototype.destroy=function(){this.touch.destroy(),this.mouse.destroy()},e}(Le)}();function Qe(e,t,n){return Array.isArray(e)&&(_e(e,n[t],n),1)}var $e=1;function et(e,t){t=t.manager;return t?t.get(e):e}function tt(e){return 16&e?"cancel":8&e?"end":4&e?"move":2&e?"start":""}var nt=function(){function e(e){this.options=X({enable:!0},e=void 0===e?{}:e),this.id=$e++,this.manager=null,this.state=1,this.simultaneous={},this.requireFail=[]}var t=e.prototype;return t.set=function(e){return B(this.options,e),this.manager&&this.manager.touchAction.update(),this},t.recognizeWith=function(e){if(Qe(e,"recognizeWith",this))return this;var t=this.simultaneous;return t[(e=et(e,this)).id]||(t[e.id]=e).recognizeWith(this),this},t.dropRecognizeWith=function(e){return Qe(e,"dropRecognizeWith",this)||(e=et(e,this),delete this.simultaneous[e.id]),this},t.requireFailure=function(e){if(Qe(e,"requireFailure",this))return this;var t=this.requireFail;return-1===je(t,e=et(e,this))&&(t.push(e),e.requireFailure(this)),this},t.dropRequireFailure=function(e){if(Qe(e,"dropRequireFailure",this))return this;e=et(e,this);e=je(this.requireFail,e);return-1<e&&this.requireFail.splice(e,1),this},t.hasRequireFailures=function(){return 0<this.requireFail.length},t.canRecognizeWith=function(e){return!!this.simultaneous[e.id]},t.emit=function(t){var n=this,e=this.state;function i(e){n.manager.emit(e,t)}e<8&&i(n.options.event+tt(e)),i(n.options.event),t.additionalEvent&&i(t.additionalEvent),8<=e&&i(n.options.event+tt(e))},t.tryEmit=function(e){if(this.canEmit())return this.emit(e);this.state=32},t.canEmit=function(){for(var e=0;e<this.requireFail.length;){if(!(33&this.requireFail[e].state))return!1;e++}return!0},t.recognize=function(e){e=B({},e);if(!ye(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)},t.process=function(e){},t.getTouchAction=function(){},t.reset=function(){},e}(),it=function(t){function e(e){return(e=t.call(this,X({event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},e=void 0===e?{}:e))||this).pTime=!1,e.pCenter=!1,e._timer=null,e._input=null,e.count=0,e}Y(e,t);var n=e.prototype;return n.getTouchAction=function(){return[ie]},n.process=function(e){var t=this,n=this.options,i=e.pointers.length===n.pointers,r=e.distance<n.threshold,o=e.deltaTime<n.time;if(this.reset(),e.eventType&de&&0===this.count)return this.failTimeout();if(r&&o&&i){if(e.eventType!==pe)return this.failTimeout();o=!this.pTime||e.timeStamp-this.pTime<n.interval,i=!this.pCenter||xe(this.pCenter,e.center)<n.posThreshold;if(this.pTime=e.timeStamp,this.pCenter=e.center,i&&o?this.count+=1:this.count=1,this._input=e,0==this.count%n.taps)return this.hasRequireFailures()?(this._timer=setTimeout(function(){t.state=8,t.tryEmit()},n.interval),2):8}return 32},n.failTimeout=function(){var e=this;return this._timer=setTimeout(function(){e.state=32},this.options.interval),32},n.reset=function(){clearTimeout(this._timer)},n.emit=function(){8===this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},e}(nt),rt=function(t){function e(e){return t.call(this,X({pointers:1},e=void 0===e?{}:e))||this}Y(e,t);var n=e.prototype;return n.attrTest=function(e){var t=this.options.pointers;return 0===t||e.pointers.length===t},n.process=function(e){var t=this.state,n=e.eventType,i=6&t,e=this.attrTest(e);return i&&(n&ge||!e)?16|t:i||e?n&pe?8|t:2&t?4|t:2:32},e}(nt);function ot(e){return 16===e?"down":8===e?"up":2===e?"left":4===e?"right":""}var at=function(n){function e(e){return(e=n.call(this,X({event:"pan",threshold:10,pointers:1,direction:30},e=void 0===e?{}:e))||this).pX=null,e.pY=null,e}Y(e,n);var t=e.prototype;return t.getTouchAction=function(){var e=this.options.direction,t=[];return 6&e&&t.push(ae),24&e&&t.push(oe),t},t.directionTest=function(e){var t=this.options,n=!0,i=e.distance,r=e.direction,o=e.deltaX,a=e.deltaY;return r&t.direction||(i=6&t.direction?(r=0===o?1:o<0?2:4,n=o!==this.pX,Math.abs(e.deltaX)):(r=0===a?1:a<0?8:16,n=a!==this.pY,Math.abs(e.deltaY))),e.direction=r,n&&i>t.threshold&&r&t.direction},t.attrTest=function(e){return rt.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},t.emit=function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=ot(e.direction);t&&(e.additionalEvent=this.options.event+t),n.prototype.emit.call(this,e)},e}(rt),st=function(i){function e(e){return i.call(this,X({event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},e=void 0===e?{}:e))||this}Y(e,i);var t=e.prototype;return t.getTouchAction=function(){return at.prototype.getTouchAction.call(this)},t.attrTest=function(e){var t,n=this.options.direction;return 30&n?t=e.overallVelocity:6&n?t=e.overallVelocityX:24&n&&(t=e.overallVelocityY),i.prototype.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers===this.options.pointers&&Z(t)>this.options.velocity&&e.eventType&pe},t.emit=function(e){var t=ot(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)},e}(rt),ut=function(n){function e(e){return n.call(this,X({event:"pinch",threshold:0,pointers:2},e=void 0===e?{}:e))||this}Y(e,n);var t=e.prototype;return t.getTouchAction=function(){return[re]},t.attrTest=function(e){return n.prototype.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},t.emit=function(e){var t;1!==e.scale&&(t=e.scale<1?"in":"out",e.additionalEvent=this.options.event+t),n.prototype.emit.call(this,e)},e}(rt),ct=function(t){function e(e){return t.call(this,X({event:"rotate",threshold:0,pointers:2},e=void 0===e?{}:e))||this}Y(e,t);var n=e.prototype;return n.getTouchAction=function(){return[re]},n.attrTest=function(e){return t.prototype.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)},e}(rt),lt=function(t){function e(e){return(e=t.call(this,X({event:"press",pointers:1,time:251,threshold:9},e=void 0===e?{}:e))||this)._timer=null,e._input=null,e}Y(e,t);var n=e.prototype;return n.getTouchAction=function(){return["auto"]},n.process=function(e){var t=this,n=this.options,i=e.pointers.length===n.pointers,r=e.distance<n.threshold,o=e.deltaTime>n.time;if(this._input=e,!r||!i||e.eventType&(pe|ge)&&!o)this.reset();else if(e.eventType&de)this.reset(),this._timer=setTimeout(function(){t.state=8,t.tryEmit()},n.time);else if(e.eventType&pe)return 8;return 32},n.reset=function(){clearTimeout(this._timer)},n.emit=function(e){8===this.state&&(e&&e.eventType&pe?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=J(),this.manager.emit(this.options.event,this._input)))},e}(nt),ht={domEvents:!1,touchAction:ne,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},ft=[[ct,{enable:!1}],[ut,{enable:!1},["rotate"]],[st,{direction:6}],[at,{direction:6},["swipe"]],[it],[it,{event:"doubletap",taps:2},["tap"]],[lt]];function dt(n,i){var r,o=n.element;o.style&&(_e(n.options.cssProps,function(e,t){r=Q(o.style,t),i?(n.oldCssProps[r]=o.style[r],o.style[r]=e):o.style[r]=n.oldCssProps[r]||""}),i||(n.oldCssProps={}))}var pt=function(){function e(e,t){var n=this;this.options=B({},ht,t||{}),this.options.inputTarget=this.options.inputTarget||e,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=e,this.input=new((e=this).options.inputClass||(ce?Ve:le?We:ue?Je:Ue))(e,Ce),this.touchAction=new Ee(this,this.options.touchAction),dt(this,!0),_e(this.options.recognizers,function(e){var t=n.add(new e[0](e[1]));e[2]&&t.recognizeWith(e[2]),e[3]&&t.requireFailure(e[3])},this)}var t=e.prototype;return t.set=function(e){return B(this.options,e),e.touchAction&&this.touchAction.update(),e.inputTarget&&(this.input.destroy(),this.input.target=e.inputTarget,this.input.init()),this},t.stop=function(e){this.session.stopped=e?2:1},t.recognize=function(e){var t,n=this.session;if(!n.stopped){this.touchAction.preventDefaults(e);var i=this.recognizers,r=n.curRecognizer;(!r||8&r.state)&&(r=n.curRecognizer=null);for(var o=0;o<i.length;)t=i[o],2===n.stopped||r&&t!==r&&!t.canRecognizeWith(r)?t.reset():t.recognize(e),!r&&14&t.state&&(r=n.curRecognizer=t),o++}},t.get=function(e){if(e instanceof nt)return e;for(var t=this.recognizers,n=0;n<t.length;n++)if(t[n].options.event===e)return t[n];return null},t.add=function(e){if(Qe(e,"add",this))return this;var t=this.get(e.options.event);return t&&this.remove(t),this.recognizers.push(e),(e.manager=this).touchAction.update(),e},t.remove=function(e){if(Qe(e,"remove",this))return this;var t=this.get(e);return!e||-1!==(t=je(e=this.recognizers,t))&&(e.splice(t,1),this.touchAction.update()),this},t.on=function(e,t){if(void 0===e||void 0===t)return this;var n=this.handlers;return _e(Ne(e),function(e){n[e]=n[e]||[],n[e].push(t)}),this},t.off=function(e,t){if(void 0===e)return this;var n=this.handlers;return _e(Ne(e),function(e){t?n[e]&&n[e].splice(je(n[e],t),1):delete n[e]}),this},t.emit=function(e,t){var n,i,r;this.options.domEvents&&(n=e,i=t,(r=document.createEvent("Event")).initEvent(n,!0,!0),(r.gesture=i).target.dispatchEvent(r));var o=this.handlers[e]&&this.handlers[e].slice();if(o&&o.length){t.type=e,t.preventDefault=function(){t.srcEvent.preventDefault()};for(var a=0;a<o.length;)o[a](t),a++}},t.destroy=function(){this.element&&dt(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},e}(),gt={touchstart:de,touchmove:2,touchend:pe,touchcancel:ge},vt=function(t){function n(){var e=n.prototype;return e.evTarget="touchstart",e.evWin="touchstart touchmove touchend touchcancel",(e=t.apply(this,arguments)||this).started=!1,e}return Y(n,t),n.prototype.handler=function(e){var t,n=gt[e.type];n===de&&(this.started=!0),this.started&&(t=function(e,t){var n=Ge(e.touches),e=Ge(e.changedTouches);t&(pe|ge)&&(n=Xe(n.concat(e),"identifier",!0));return[n,e]}.call(this,e,n),n&(pe|ge)&&t[0].length-t[1].length==0&&(this.started=!1),this.callback(this.manager,n,{pointers:t[0],changedPointers:t[1],pointerType:he,srcEvent:e}))},n}(Le);function mt(n,e,t){var i="DEPRECATED METHOD: "+e+"\n"+t+" AT \n";return function(){var e=new Error("get-stack-trace"),t=e&&e.stack?e.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",e=window.console&&(window.console.warn||window.console.log);return e&&e.call(window.console,i,t),n.apply(this,arguments)}}var _t=mt(function(e,t,n){for(var i=Object.keys(t),r=0;r<i.length;)n&&void 0!==e[i[r]]||(e[i[r]]=t[i[r]]),r++;return e},"extend","Use `assign`."),yt=mt(function(e,t){return _t(e,t,!0)},"merge","Use `assign`.");function bt(e,t,n){var i=t.prototype,t=e.prototype=Object.create(i);t.constructor=e,t._super=i,n&&B(t,n)}function Et(e,t){return function(){return e.apply(t,arguments)}}function Pt(e,t){for(var n=e.length,i=0;i<n;++i)if(t(e[i],i))return!0;return!1}function Tt(e,t){for(var n=e.length,i=0;i<n;++i)if(t(e[i],i))return e[i];return null}function Ot(e,t){try{return new RegExp(e,"g").exec(t)}catch(e){return null}}function xt(e){return e.replace(/_/g,".")}function Rt(e,n){var i=null,r="-1";return Pt(e,function(e){var t=Ot("("+e.test+")((?:\\/|\\s|:)([0-9|\\.|_]+))?",n);return t&&!e.brand&&(i=e,r=t[3]||"-1",e.versionAlias?r=e.versionAlias:e.versionTest&&(e=e.versionTest.toLowerCase(),r=((e=Ot("("+e+")((?:\\/|\\s|:)([0-9|\\.|_]+))",e=n))?e[3]:"")||r),r=xt(r),1)}),{preset:i,version:r}}function wt(e,n){var i={brand:"",version:"-1"};return Pt(e,function(e){var t=At(n,e);return t&&(i.brand=e.id,i.version=e.versionAlias||t.version,"-1"!==i.version)}),i}function At(e,t){return Tt(e,function(e){e=e.brand;return Ot(""+t.test,e.toLowerCase())})}(function(){function e(e,t){return void 0===t&&(t={}),new pt(e,X({recognizers:ft.concat()},t))}return e.VERSION="2.0.17-rc",e.DIRECTION_ALL=30,e.DIRECTION_DOWN=16,e.DIRECTION_LEFT=2,e.DIRECTION_RIGHT=4,e.DIRECTION_UP=8,e.DIRECTION_HORIZONTAL=6,e.DIRECTION_VERTICAL=24,e.DIRECTION_NONE=1,e.DIRECTION_DOWN=16,e.INPUT_START=de,e.INPUT_MOVE=2,e.INPUT_END=pe,e.INPUT_CANCEL=ge,e.STATE_POSSIBLE=1,e.STATE_BEGAN=2,e.STATE_CHANGED=4,e.STATE_ENDED=8,e.STATE_RECOGNIZED=8,e.STATE_CANCELLED=16,e.STATE_FAILED=32,e.Manager=pt,e.Input=Le,e.TouchAction=Ee,e.TouchInput=We,e.MouseInput=Ue,e.PointerEventInput=Ve,e.TouchMouseInput=Je,e.SingleTouchInput=vt,e.Recognizer=nt,e.AttrRecognizer=rt,e.Tap=it,e.Pan=at,e.Swipe=st,e.Pinch=ut,e.Rotate=ct,e.Press=lt,e.on=Se,e.off=De,e.each=_e,e.merge=yt,e.extend=_t,e.bindFn=Et,e.assign=B,e.inherit=bt,e.bindFn=Et,e.prefixed=Q,e.toArray=Ge,e.inArray=je,e.uniqueArray=Xe,e.splitStr=Ne,e.boolOrFn=ye,e.hasParent=Pe,e.addEventListeners=Se,e.removeEventListeners=De,e.defaults=B({},ht,{preset:ft}),e})().defaults;var It=[{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"}],Ct=[{test:"(?=.*applewebkit/(53[0-7]|5[0-2]|[0-4]))(?=.*\\schrome)",id:"chrome",versionTest:"chrome"},{test:"chromium",id:"chrome"},{test:"whale",id:"chrome",versionAlias:"-1",brand:!0}],Nt=[{test:"applewebkit",id:"webkit",versionTest:"applewebkit|safari"}],St=[{test:"(?=(iphone|ipad))(?!(.*version))",id:"webview"},{test:"(?=(android|iphone|ipad))(?=.*(naver|daum|; wv))",id:"webview"},{test:"webview",id:"webview"}],Dt=[{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 kt(e){var t=function(e){if(void 0===e){if("undefined"==typeof navigator||!navigator)return"";e=navigator.userAgent||""}return e.toLowerCase()}(e),n=!!/mobi/g.exec(t),i={name:"unknown",version:"-1",majorVersion:-1,webview:!!Rt(St,t).preset,chromium:!1,chromiumVersion:"-1",webkit:!1,webkitVersion:"-1"},r={name:"unknown",version:"-1",majorVersion:-1},o=Rt(It,t),a=o.preset,s=o.version,u=Rt(Dt,t),e=u.preset,o=u.version,u=Rt(Ct,t);return i.chromium=!!u.preset,i.chromiumVersion=u.version,i.chromium||(t=Rt(Nt,t),i.webkit=!!t.preset,i.webkitVersion=t.version),e&&(r.name=e.id,r.version=o,r.majorVersion=parseInt(o,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 Lt(e){return void 0===e}var jt=function(){function e(){this.options={},this._eventHandler={}}var t=e.prototype;return t.trigger=function(e){for(var t=this,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];if(!(0<(a=this._eventHandler[e]||[]).length))return!0;var r=n[0]||{},o=n.slice(1),a=a.concat(),s=!1;r.eventType=e,r.stop=function(){s=!0},r.currentTarget=this;var u=[r];return 1<=o.length&&(u=u.concat(o)),a.forEach(function(e){e.apply(t,u)}),!s},t.once=function(n,i){var r,o=this;if("object"==typeof n&&Lt(i)){var e,t=n;for(e in t)this.once(e,t[e]);return this}return"string"==typeof n&&"function"==typeof i&&this.on(n,r=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];i.apply(o,e),o.off(n,r)}),this},t.hasOn=function(e){return!!this._eventHandler[e]},t.on=function(e,t){if("object"==typeof e&&Lt(t)){var n,i=e;for(n in i)this.on(n,i[n]);return this}var r;return"string"==typeof e&&"function"==typeof t&&(Lt(r=this._eventHandler[e])&&(this._eventHandler[e]=[],r=this._eventHandler[e]),r.push(t)),this},t.off=function(e,t){var n,i;if(Lt(e))return this._eventHandler={},this;if(Lt(t)){if("string"==typeof e)return delete this._eventHandler[e],this;var r,o=e;for(r in o)this.off(r,o[r]);return this}var a=this._eventHandler[e];if(a){var s=0;try{for(var u=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&i>=e.length?void 0:e)&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(a),c=u.next();!c.done;c=u.next()){if(c.value===t){a.splice(s,1);break}s++}}catch(e){n={error:e}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}return this},e.VERSION="2.2.2",e}(),zt=function(e,t){return(zt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};var Mt=function(){return(Mt=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function Ht(e,t,n,i){var t=[!n[0]&&i?t[0]-i[0]:t[0],!n[1]&&i?t[1]+i[1]:t[1]],r=Math.max(t[0],e);return Math.min(t[1],r)}function Ft(e,t){return e<t[0]||e>t[1]}function Vt(e,t,n){return n[1]&&e>t[1]||n[0]&&e<t[0]}function Gt(e,t,n){var i=e,r=t[0],o=t[1],t=o-r;return n[1]&&o<e&&(i=(i-o)%t+r),i=n[0]&&e<r?(i-r)%t+o:i}function Xt(e){for(var t=[],n=0,i=e.length;n<i;n++)t.push(e[n]);return t}var Yt,Wt,Bt,Ut=(Yt="undefined"==typeof window?{navigator:{userAgent:""}}:window).requestAnimationFrame||Yt.webkitRequestAnimationFrame,qt=Yt.cancelAnimationFrame||Yt.webkitCancelAnimationFrame;function Kt(e,t){var n,i={};for(n in e)n&&(i[n]=t(e[n],n));return i}function Zt(e,t){var n,i={};for(n in e)n&&t(e[n],n)&&(i[n]=e[n]);return i}function Jt(e,t){for(var n in e)if(n&&!t(e[n],n))return!1;return!0}function Qt(e,n){return Jt(e,function(e,t){return e===n[t]})}Ut&&!qt?(Wt={},Bt=Ut,Ut=function(t){var n=Bt(function(e){Wt[n]&&t(e)});return Wt[n]=!0,n},qt=function(e){delete Wt[e]}):Ut&&qt||(Ut=function(e){return Yt.setTimeout(function(){e(Yt.performance&&Yt.performance.now&&Yt.performance.now()||(new Date).getTime())},16)},qt=Yt.clearTimeout);var $t={};function en(e,t){var n,i;return $t[t]||($t[t]=(i=(n=t)<1?Math.pow(10,nn(n)):1,function(e){return 0===n?0:Math.round(Math.round(e/n)*n*i)/i})),$t[t](e)}function tn(e,n){if(!e||!n)return e;var i="number"==typeof n;return Kt(e,function(e,t){return en(e,i?n:n[t])})}function nn(e){if(!isFinite(e))return 0;var t=e+"";if(0<=t.indexOf("e")){for(var n=0,i=1;Math.round(e*i)/i!==e;)i*=10,n++;return n}return 0<=t.indexOf(".")?t.length-t.indexOf(".")-1:0}function rn(e,t,n){return Math.max(Math.min(e,n),t)}var on,an=function(){function e(e){var t=e.options,n=e.itm,i=e.em,e=e.axm;this.options=t,this.itm=n,this.em=i,this.axm=e,this.animationEnd=this.animationEnd.bind(this)}var t=e.prototype;return t.getDuration=function(n,e,t){var i,r=this;return rn(void 0!==t?t:(i=Kt(e,function(e,t){return e=Math.abs(e-n[t]),t=r.options.deceleration,(t=Math.sqrt(e/t*2))<100?0:t}),Object.keys(i).reduce(function(e,t){return Math.max(e,i[t])},-1/0)),this.options.minimumDuration,this.options.maximumDuration)},t.createAnimationParam=function(e,t,n){var i=this.axm.get(),r=e,e=n&&n.event||null;return{depaPos:i,destPos:r,duration:rn(t,this.options.minimumDuration,this.options.maximumDuration),delta:this.axm.getDelta(i,r),inputEvent:e,input:n&&n.input||null,isTrusted:!!e,done:this.animationEnd}},t.grab=function(e,t){var n;this._animateParam&&e.length&&(n=this.axm.get(e),Jt(e=this.axm.map(n,function(e,t){return Gt(e,t.range,t.circular)}),function(e,t){return n[t]===e})||this.em.triggerChange(e,!1,n,t,!!t),this._animateParam=null,this._raf&&(e=this._raf,qt(e)),this._raf=null,this.em.triggerAnimationEnd(!(!t||!t.event)))},t.getEventInfo=function(){return this._animateParam&&this._animateParam.input&&this._animateParam.inputEvent?{input:this._animateParam.input,event:this._animateParam.inputEvent}:null},t.restore=function(e){var t=this.axm.get(),n=this.axm.map(t,function(e,t){return Math.min(t.range[1],Math.max(t.range[0],e))});this.animateTo(n,this.getDuration(t,n),e)},t.animationEnd=function(){var e=this.getEventInfo();this._animateParam=null;var t=this.axm.filter(this.axm.get(),function(e,t){return Vt(e,t.range,t.circular)});0<Object.keys(t).length&&this.setTo(this.axm.map(t,function(e,t){return Gt(e,t.range,t.circular)})),this.itm.setInterrupt(!1),this.em.triggerAnimationEnd(!!e),this.axm.isOutside()?this.restore(e):this.finish(!!e)},t.finish=function(e){this._animateParam=null,this.itm.setInterrupt(!1),this.em.triggerFinish(e)},t.animateLoop=function(a,s){var u,c,l,h,f,d,p,g;a.duration?(this._animateParam=Mt({},a),u=this._animateParam,c=this,l=u.destPos,h=u.depaPos,f=0,d=Kt(h,function(e,t){return e<=l[t]?1:-1}),p=Kt(l,function(e){return e}),g=(new Date).getTime(),u.startTime=g,function e(){c._raf=null;var t=(new Date).getTime(),r=(t-u.startTime)/a.duration,o=c.easing(r),n=c.axm.map(h,function(e,t,n){var i=1<=r?l[n]:e+u.delta[n]*(o-f),e=Gt(i,t.range,t.circular);return i!==e&&(t=d[n]*(t.range[1]-t.range[0]),l[n]-=t,h[n]-=t),e}),i=!c.em.triggerChange(n,!1,h);h=n,g=t,1<=(f=o)?(Qt(l=c.getFinalPos(l,p),c.axm.get(Object.keys(l)))||c.em.triggerChange(l,!0,h),s()):i?c.finish(!1):c._raf=Ut(e)}()):(this.em.triggerChange(a.destPos,!0),s())},t.getFinalPos=function(e,n){var i=this;return Kt(e,function(e,t){return e>=n[t]-1e-6&&e<=n[t]+1e-6?n[t]:en(e,i.getRoundUnit(e,t))})},t.getRoundUnit=function(e,t){var n=this.options.round,i=null;return n||(t=this.axm.getAxisOptions(t),e=Math.max(nn(t.range[0]),nn(t.range[1]),nn(e)),i=1/Math.pow(10,e)),i||n},t.getUserControll=function(e){e=e.setTo();return e.destPos=this.axm.get(e.destPos),e.duration=rn(e.duration,this.options.minimumDuration,this.options.maximumDuration),e},t.animateTo=function(e,t,n){var i=this,r=this.createAnimationParam(e,t,n),e=Mt({},r.depaPos),t=this.em.triggerAnimationStart(r),r=this.getUserControll(r);!t&&this.axm.every(r.destPos,function(e,t){return Vt(e,t.range,t.circular)})&&console.warn("You can't stop the 'animation' event when 'circular' is true."),t&&!Qt(r.destPos,e)&&(t=n&&n.event||null,this.animateLoop({depaPos:e,destPos:r.destPos,duration:r.duration,delta:this.axm.getDelta(e,r.destPos),isTrusted:!!t,inputEvent:t,input:n&&n.input||null},function(){return i.animationEnd()}))},t.easing=function(e){return 1<e?1:this.options.easing(e)},t.setTo=function(e,t){void 0===t&&(t=0);var n=Object.keys(e);this.grab(n);var i=this.axm.get(n);if(Qt(e,i))return this;this.itm.setInterrupt(!0);e=Zt(e,function(e,t){return i[t]!==e});return Object.keys(e).length&&(Qt(e=this.axm.map(e,function(e,t){var n=t.range,t=t.circular;return t&&(t[0]||t[1])?e:Ht(e,n,t)}),i)||(0<t?this.animateTo(e,t):(this.em.triggerChange(e),this.finish(!1)))),this},t.setBy=function(n,e){return void 0===e&&(e=0),this.setTo(Kt(this.axm.get(Object.keys(n)),function(e,t){return e+n[t]}),e)},e}(),sn=function(){function e(e){this.axes=e}var t=e.prototype;return t.triggerHold=function(e,t){e=this.getRoundPos(e).roundPos;this.axes.trigger("hold",{pos:e,input:t.input||null,inputEvent:t.event||null,isTrusted:!0})},t.triggerRelease=function(e){var t=this.getRoundPos(e.destPos,e.depaPos),n=t.roundPos,t=t.roundDepa;e.destPos=n,e.depaPos=t,e.setTo=this.createUserControll(e.destPos,e.duration),this.axes.trigger("release",e)},t.triggerChange=function(e,t,n,i,r){void 0===r&&(r=!1);var o=this.am,a=o.axm,o=o.getEventInfo(),e=this.getRoundPos(e,n),n=e.roundPos,e=e.roundDepa,n=a.moveTo(n,e),e=i&&i.event||o&&o.event||null,o={pos:n.pos,delta:n.delta,holding:r,inputEvent:e,isTrusted:!!e,input:i&&i.input||o&&o.input||null,set:e?this.createUserControll(n.pos):function(){}},n=this.axes.trigger("change",o);return e&&a.set(o.set().destPos),n},t.triggerAnimationStart=function(e){var t=this.getRoundPos(e.destPos,e.depaPos),n=t.roundPos,t=t.roundDepa;return e.destPos=n,e.depaPos=t,e.setTo=this.createUserControll(e.destPos,e.duration),this.axes.trigger("animationStart",e)},t.triggerAnimationEnd=function(e){this.axes.trigger("animationEnd",{isTrusted:e=void 0===e?!1:e})},t.triggerFinish=function(e){this.axes.trigger("finish",{isTrusted:e=void 0===e?!1:e})},t.createUserControll=function(e,t){void 0===t&&(t=0);var n={destPos:Mt({},e),duration:t};return function(e,t){return e&&(n.destPos=Mt({},e)),void 0!==t&&(n.duration=t),n}},t.setAnimationManager=function(e){this.am=e},t.destroy=function(){this.axes.off()},t.getRoundPos=function(e,t){var n=this.axes.options.round;return{roundPos:tn(e,n),roundDepa:tn(t,n)}},e}(),un=function(){function e(e){this.options=e,this._prevented=!1}var t=e.prototype;return t.isInterrupting=function(){return this.options.interruptable||this._prevented},t.isInterrupted=function(){return!this.options.interruptable&&this._prevented},t.setInterrupt=function(e){this.options.interruptable||(this._prevented=e)},e}(),cn=function(){function e(e,t){var n=this;this.axis=e,this.options=t,this._complementOptions(),this._pos=Object.keys(this.axis).reduce(function(e,t){return e[t]=n.axis[t].range[0],e},{})}var t=e.prototype;return t._complementOptions=function(){var r=this;Object.keys(this.axis).forEach(function(i){r.axis[i]=Mt({range:[0,100],bounce:[0,0],circular:[!1,!1]},r.axis[i]),["bounce","circular"].forEach(function(e){var t=r.axis,n=t[i][e];/string|number|boolean/.test(typeof n)&&(t[i][e]=[n,n])})})},t.getDelta=function(e,t){var n=this.get(e);return Kt(this.get(t),function(e,t){return e-n[t]})},t.get=function(e){var n=this;return e&&Array.isArray(e)?e.reduce(function(e,t){return t&&t in n._pos&&(e[t]=n._pos[t]),e},{}):Mt(Mt({},this._pos),e||{})},t.moveTo=function(n,i){void 0===i&&(i=this._pos);var e=Kt(this._pos,function(e,t){return t in n&&t in i?n[t]-i[t]:0});return this.set(this.map(n,function(e,t){return t?Gt(e,t.range,t.circular):0})),{pos:Mt({},this._pos),delta:e}},t.set=function(e){for(var t in e)t&&t in this._pos&&(this._pos[t]=e[t])},t.every=function(e,n){var i=this.axis;return Jt(e,function(e,t){return n(e,i[t],t)})},t.filter=function(e,n){var i=this.axis;return Zt(e,function(e,t){return n(e,i[t],t)})},t.map=function(e,n){var i=this.axis;return Kt(e,function(e,t){return n(e,i[t],t)})},t.isOutside=function(e){return!this.every(e?this.get(e):this._pos,function(e,t){return!Ft(e,t.range)})},t.getAxisOptions=function(e){return this.axis[e]},e}(),ln=function(){function e(e){var t=e.options,n=e.itm,i=e.em,r=e.axm,e=e.am;this.isOutside=!1,this.moveDistance=null,this.isStopped=!1,this.options=t,this.itm=n,this.em=i,this.axm=r,this.am=e}var t=e.prototype;return t.atOutside=function(e){var o=this;if(this.isOutside)return this.axm.map(e,function(e,t){var n=t.range[0]-t.bounce[0],t=t.range[1]+t.bounce[1];return t<e?t:e<n?n:e});var a=this.am.easing(1e-5)/1e-5;return this.axm.map(e,function(e,t){var n=t.range[0],i=t.range[1],r=t.bounce,t=t.circular;return t&&(t[0]||t[1])?e:e<n?n-o.am.easing((n-e)/(r[0]*a))*r[0]:i<e?i+o.am.easing((e-i)/(r[1]*a))*r[1]:e})},t.get=function(e){return this.axm.get(e.axes)},t.hold=function(e,t){!this.itm.isInterrupted()&&e.axes.length&&(this.isStopped=!(t={input:e,event:t}),this.itm.setInterrupt(!0),this.am.grab(e.axes,t),this.moveDistance||this.em.triggerHold(this.axm.get(),t),this.isOutside=this.axm.isOutside(e.axes),this.moveDistance=this.axm.get(e.axes))},t.change=function(e,t,n){var i,r;this.isStopped||!this.itm.isInterrupting()||this.axm.every(n,function(e){return 0===e})||(r=Kt(i=this.moveDistance||this.axm.get(e.axes),function(e,t){return e+(n[t]||0)}),this.moveDistance&&(this.moveDistance=r),this.isOutside&&this.axm.every(i,function(e,t){return!Ft(e,t.range)})&&(this.isOutside=!1),i=this.atOutside(i),r=this.atOutside(r),this.em.triggerChange(r,!1,i,{input:e,event:t},!0)||(this.isStopped=!0,this.moveDistance=null,this.am.finish(!1)))},t.release=function(e,t,n,i){var r,o;!this.isStopped&&this.itm.isInterrupting()&&this.moveDistance&&(r=this.axm.get(e.axes),o=this.axm.get(),n=this.axm.get(this.axm.map(n,function(e,t,n){return t.circular&&(t.circular[0]||t.circular[1])?r[n]+e:Ht(r[n]+e,t.range,t.circular,t.bounce)})),n={depaPos:o,destPos:n=0===(i=this.am.getDuration(n,r,i))?Mt({},o):n,duration:i,delta:this.axm.getDelta(o,n),inputEvent:t,input:e,isTrusted:!0},this.em.triggerRelease(n),this.moveDistance=null,e={input:e,event:t},(n=Qt((t=this.am.getUserControll(n)).destPos,o))||0===t.duration?(n||this.em.triggerChange(t.destPos,!1,o,e,!0),this.itm.setInterrupt(!1),this.axm.isOutside()?this.am.restore(e):this.em.triggerFinish(!0)):this.am.animateTo(t.destPos,t.duration,e))},e}(),hn="ontouchstart"in Yt&&"safari"===(void 0===on&&function(){if("undefined"!=typeof navigator&&navigator&&navigator.userAgentData){var e=navigator.userAgentData,e=e.brands||e.uaList;return e&&e.length}}()?function(e){var t=((r=navigator.userAgentData).uaList||r.brands).slice(),n=r.mobile||!1,i={name:(a=t[0]).brand,version:a.version,majorVersion:-1,webkit:!1,webkitVersion:"-1",chromium:!1,chromiumVersion:"-1",webview:!!wt(St,t).brand},r={name:"unknown",version:"-1",majorVersion:-1};i.webkit=!i.chromium&&Pt(Nt,function(e){return At(t,e)});var o,a=wt(Ct,t);i.chromium=!!a.brand,i.chromiumVersion=a.version,i.chromium||(a=wt(Nt,t),i.webkit=!!a.brand,i.webkitVersion=a.version),e&&(o=e.platform.toLowerCase(),s=Tt(Dt,function(e){return new RegExp(""+e.test,"g").exec(o)}),r.name=s?s.id:o,r.version=e.platformVersion);var s=wt(It,t);return s.brand&&(i.name=s.brand,i.version=e?e.uaFullVersion:s.version),"Linux armv8l"===navigator.platform?r.name="android":i.webkit&&(r.name=n?"ios":"mac"),"ios"===r.name&&i.webview&&(i.version="-1"),r.version=xt(r.version),i.version=xt(i.version),r.majorVersion=parseInt(r.version,10),i.majorVersion=parseInt(i.version,10),{browser:i,os:r,isMobile:n,isHints:!0}}():kt(on)).browser.name,fn=function(){if("undefined"==typeof document)return"";for(var e=(document.head||document.getElementsByTagName("head")[0]).style,t=["transform","webkitTransform","msTransform","mozTransform"],n=0,i=t.length;n<i;n++)if(t[n]in e)return t[n];return""}(),dn=function(r){function e(){this.constructor=t}var t;function n(e,t,n){void 0===e&&(e={}),void 0===t&&(t={});var i=r.call(this)||this;return i.axis=e,i._inputs=[],i.options=Mt({easing:function(e){return 1-Math.pow(1-e,3)},interruptable:!0,maximumDuration:1/0,minimumDuration:0,deceleration:6e-4,round:null},t),i.itm=new un(i.options),i.axm=new cn(i.axis,i.options),i.em=new sn(i),i.am=new an(i),i.io=new ln(i),i.em.setAnimationManager(i.am),n&&i.em.triggerChange(n),i}zt(t=n,i=r),t.prototype=null===i?Object.create(i):(e.prototype=i.prototype,new e);var i=n.prototype;return i.connect=function(e,t){var n="string"==typeof e?e.split(" "):e.concat();return~this._inputs.indexOf(t)&&this.disconnect(t),"hammer"in t&&((e=this._inputs.filter(function(e){return e.hammer&&e.element===t.element})).length&&(t.hammer=e[0].hammer)),t.mapAxes(n),t.connect(this.io),this._inputs.push(t),this},i.disconnect=function(e){return e?0<=(e=this._inputs.indexOf(e))&&(this._inputs[e].disconnect(),this._inputs.splice(e,1)):(this._inputs.forEach(function(e){return e.disconnect()}),this._inputs=[]),this},i.get=function(e){return this.axm.get(e)},i.setTo=function(e,t){return this.am.setTo(e,t=void 0===t?0:t),this},i.setBy=function(e,t){return this.am.setBy(e,t=void 0===t?0:t),this},i.isBounceArea=function(e){return this.axm.isOutside(e)},i.destroy=function(){this.disconnect(),this.em.destroy()},n.VERSION="2.8.0",n.TRANSFORM=fn,n.DIRECTION_NONE=1,n.DIRECTION_LEFT=2,n.DIRECTION_RIGHT=4,n.DIRECTION_UP=8,n.DIRECTION_DOWN=16,n.DIRECTION_HORIZONTAL=6,n.DIRECTION_VERTICAL=24,n.DIRECTION_ALL=30,n}(jt),pn="PointerEvent"in Yt||"MSPointerEvent"in Yt,gn="ontouchstart"in Yt,vn="_EGJS_AXES_INPUTTYPE_";function mn(i,e){return e.reduce(function(e,t,n){return i[n]&&(e[i[n]]=t),e},{})}function _n(e,t,n){return n?!!(30===t||t&e&&n&e):!!(t&e)}var yn,bn=function(){function e(e,t){if(this.axes=[],this.hammer=null,this.element=null,this.panRecognizer=null,this.isRightEdge=!1,this.rightEdgeTimer=0,this.panFlag=!1,void 0===pt)throw new Error("The Hammerjs must be loaded before eg.Axes.PanInput.\nhttp://hammerjs.github.io/");this.element=function t(e,n){var i;return void 0===n&&(n=!1),"string"==typeof e?(i=e.match(/^<([a-z]+)\s*([^>]*)>/)?((i=document.createElement("div")).innerHTML=e,Xt(i.childNodes)):Xt(document.querySelectorAll(e)),n||(i=1<=i.length?i[0]:void 0)):e===Yt||e.nodeName&&(1===e.nodeType||9===e.nodeType)?i=e:"jQuery"in Yt&&e instanceof jQuery||e.constructor.prototype.jquery?i=n?e.toArray():e.get(0):Array.isArray(e)&&(i=e.map(function(e){return t(e)}),n||(i=1<=i.length?i[0]:void 0)),i}(e),this.options=Mt({inputType:["touch","mouse","pointer"],scale:[1,1],thresholdAngle:45,threshold:0,iOSEdgeSwipeThreshold:30,releaseOnScroll:!1,hammerManagerOptions:{cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",userDrag:"none"}}},t),this.onHammerInput=this.onHammerInput.bind(this),this.onPanmove=this.onPanmove.bind(this),this.onPanend=this.onPanend.bind(this)}var t=e.prototype;return t.mapAxes=function(e){var t=!!e[0],n=!!e[1];this._direction=t&&n?30:t?6:n?24:1,this.axes=e},t.connect=function(e){var t,n,i,r={direction:this._direction,threshold:this.options.threshold};if(this.hammer)this.removeRecognizer(),this.dettachEvent();else{var o=(o=this.element[vn])||String(Math.round(Math.random()*(new Date).getTime())),a=(a=this.options.inputType,i=n=t=!1,(a=void 0===a?[]:a).forEach(function(e){switch(e){case"mouse":n=!0;break;case"touch":t=gn;break;case"pointer":i=pn}}),i?Ve:t&&n?Je:t?We:n?Ue:null);if(!a)throw new Error("Wrong inputType parameter!");this.hammer=function(e,t){try{return new pt(e,Mt({},t))}catch(e){return null}}(this.element,Mt({inputClass:a},this.options.hammerManagerOptions)),this.element[vn]=o}return this.panRecognizer=new at(r),this.hammer.add(this.panRecognizer),this.attachEvent(e),this},t.disconnect=function(){return this.removeRecognizer(),this.hammer&&this.dettachEvent(),this._direction=1,this},t.destroy=function(){this.disconnect(),this.hammer&&0===this.hammer.recognizers.length&&this.hammer.destroy(),delete this.element[vn],this.element=null,this.hammer=null},t.enable=function(){return this.hammer&&(this.hammer.get("pan").options.enable=!0),this},t.disable=function(){return this.hammer&&(this.hammer.get("pan").options.enable=!1),this},t.isEnable=function(){return!(!this.hammer||!this.hammer.get("pan").options.enable)},t.removeRecognizer=function(){this.hammer&&this.panRecognizer&&(this.hammer.remove(this.panRecognizer),this.panRecognizer=null)},t.onHammerInput=function(e){var t;this.isEnable()&&(e.isFirst?(this.panFlag=!1)!==e.srcEvent.cancelable&&(t=this.options.iOSEdgeSwipeThreshold,this.observer.hold(this,e),this.isRightEdge=hn&&e.center.x>window.innerWidth-t,this.panFlag=!0):e.isFinal&&this.onPanend(e))},t.onPanmove=function(e){var t=this;if(this.panFlag){var n,i=this.options,r=i.iOSEdgeSwipeThreshold,o=i.releaseOnScroll,i=(n=e.angle,(i=this.options.thresholdAngle)<0||90<i?1:(n=Math.abs(n),i<n&&n<180-i?24:6)),a=this.hammer.session.prevInput;if(!o||e.srcEvent.cancelable){if(a&&hn){if(e.center.x<0)return void this.onPanend(Mt(Mt({},a),{velocityX:0,velocityY:0,offsetX:0,offsetY:0}));this.isRightEdge&&(clearTimeout(this.rightEdgeTimer),e.deltaX<-r?this.isRightEdge=!1:this.rightEdgeTimer=window.setTimeout(function(){t.onPanend(Mt(Mt({},a),{velocityX:0,velocityY:0,offsetX:0,offsetY:0}))},100))}a?(e.offsetX=e.deltaX-a.deltaX,e.offsetY=e.deltaY-a.deltaY):(e.offsetX=0,e.offsetY=0);o=this.getOffset([e.offsetX,e.offsetY],[_n(6,this._direction,i),_n(24,this._direction,i)]),r=o.some(function(e){return 0!==e});r&&(!1!==(i=e.srcEvent).cancelable&&i.preventDefault(),i.stopPropagation()),(e.preventSystemEvent=r)&&this.observer.change(this,e,mn(this.axes,o))}else this.onPanend(Mt(Mt({},e),{velocityX:0,velocityY:0,offsetX:0,offsetY:0}))}},t.onPanend=function(e){var t,n,i,r;this.panFlag&&(clearTimeout(this.rightEdgeTimer),this.panFlag=!1,t=this.getOffset([Math.abs(e.velocityX)*(e.deltaX<0?-1:1),Math.abs(e.velocityY)*(e.deltaY<0?-1:1)],[_n(6,this._direction),_n(24,this._direction)]),n=t,i=this.observer.options.deceleration,r=Math.sqrt(n[0]*n[0]+n[1]*n[1]),i=Math.abs(r/-i),t=[n[0]/2*i,n[1]/2*i],this.observer.release(this,e,mn(this.axes,t)))},t.attachEvent=function(e){this.observer=e,this.hammer.on("hammer.input",this.onHammerInput).on("panstart panmove",this.onPanmove)},t.dettachEvent=function(){this.hammer.off("hammer.input",this.onHammerInput).off("panstart panmove",this.onPanmove),this.observer=null},t.getOffset=function(e,t){var n=[0,0],i=this.options.scale;return t[0]&&(n[0]=e[0]*i[0]),t[1]&&(n[1]=e[1]*i[1]),n},e}(),En=dn,Pn={HOLD:"hold",CHANGE:"change",RELEASE:"release",ANIMATION_END:"animationEnd",FINISH:"finish"},Tn="flick";(Ln=yn=yn||{})[Ln.IDLE=0]="IDLE",Ln[Ln.HOLDING=1]="HOLDING",Ln[Ln.DRAGGING=2]="DRAGGING",Ln[Ln.ANIMATING=3]="ANIMATING",Ln[Ln.DISABLED=4]="DISABLED";var On=(qn=xn.prototype,Object.defineProperty(qn,"delta",{get:function(){return this._delta},enumerable:!1,configurable:!0}),Object.defineProperty(qn,"targetPanel",{get:function(){return this._targetPanel},set:function(e){this._targetPanel=e},enumerable:!1,configurable:!0}),qn.onEnter=function(e){this._delta=e._delta,this._targetPanel=e._targetPanel},qn.onHold=function(e){},qn.onChange=function(e){},qn.onRelease=function(e){},qn.onAnimationEnd=function(e){},qn.onFinish=function(e){},qn._moveToChangedPosition=function(e){var t,n=e.flicking,i=e.axesEvent,r=e.transitTo,o=i.delta[Tn];o&&(this._delta+=o,e=(t=n.camera).position,o=i.pos[Tn],o=n.circularEnabled?P(o,t.range.min,t.range.max):o,t.lookAt(o),i=new w(N.MOVE,{isTrusted:i.isTrusted,holding:this.holding,direction:v(0,i.delta[Tn]),axesEvent:i}),n.trigger(i),i.isCanceled()&&(t.lookAt(e),r(yn.DISABLED)))},xn);function xn(){this._delta=0,this._targetPanel=null}var Rn=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.holding=!1,e.animating=!1,e}a(e,t);var n=e.prototype;return n.onEnter=function(){this._delta=0,this._targetPanel=null},n.onHold=function(e){var t=e.flicking,n=e.axesEvent,e=e.transitTo;t.renderer.panelCount<=0?e(yn.DISABLED):(n=new w(N.HOLD_START,{axesEvent:n}),t.trigger(n),n.isCanceled()?e(yn.DISABLED):e(yn.HOLDING))},n.onChange=function(e){var t=e.flicking,n=e.axesEvent,i=e.transitTo,r=t.control.controller.animatingContext,n=new w(N.MOVE_START,{isTrusted:n.isTrusted,holding:this.holding,direction:v(r.start,r.end),axesEvent:n});t.trigger(n),n.isCanceled()?i(yn.DISABLED):i(yn.ANIMATING).onChange(e)},e}(On),wn=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.holding=!0,e.animating=!1,e._releaseEvent=null,e}a(e,t);var n=e.prototype;return n.onChange=function(e){var t=e.flicking,n=e.axesEvent,i=e.transitTo,r=n.inputEvent,r=t.horizontal?r.offsetX:r.offsetY,n=new w(N.MOVE_START,{isTrusted:n.isTrusted,holding:this.holding,direction:v(0,-r),axesEvent:n});t.trigger(n),n.isCanceled()?i(yn.DISABLED):i(yn.DRAGGING).onChange(e)},n.onRelease=function(e){var t=e.flicking,n=e.axesEvent,e=e.transitTo;if(t.trigger(new w(N.HOLD_END,{axesEvent:n})),0!==n.delta.flick)return n.setTo({flick:t.camera.position},0),void e(yn.IDLE);this._releaseEvent=n},n.onFinish=function(e){var t=e.flicking;if((0,e.transitTo)(yn.IDLE),this._releaseEvent){var n,i=this._releaseEvent.inputEvent.srcEvent;n="touchend"===i.type?(e=i.changedTouches[0],document.elementFromPoint(e.clientX,e.clientY)):i.target;var r,o,i=t.renderer.panels,a=null;try{for(var s=l(i),u=s.next();!u.done;u=s.next()){var c=u.value;if(c.contains(n)){a=c;break}}}catch(e){o={error:e}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(o)throw o.error}}a&&(r=t.camera.position,o=a.position,t.trigger(new w(N.SELECT,{index:a.index,panel:a,direction:v(r,o)})))}},e}(On),An=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.holding=!0,e.animating=!0,e}a(e,t);var n=e.prototype;return n.onChange=function(e){this._moveToChangedPosition(e)},n.onRelease=function(e){var t=e.flicking,n=e.axesEvent,i=e.transitTo;t.trigger(new w(N.HOLD_END,{axesEvent:n})),t.renderer.panelCount<=0?i(yn.IDLE):(i(yn.ANIMATING),e=t.control,i=n.destPos[Tn],t=Math.max(n.duration,t.duration),e.moveToPosition(i,t,n))},e}(On),In=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.holding=!1,e.animating=!0,e}a(e,t);var n=e.prototype;return n.onHold=function(e){var t=e.flicking,n=e.axesEvent,e=e.transitTo;this._delta=0,t.control.updateInput();n=new w(N.HOLD_START,{axesEvent:n});t.trigger(n),n.isCanceled()?e(yn.DISABLED):e(yn.DRAGGING)},n.onChange=function(e){this._moveToChangedPosition(e)},n.onFinish=function(e){var t=e.flicking,n=e.axesEvent,i=e.transitTo,r=t.control,e=r.controller.animatingContext;i(yn.IDLE),t.trigger(new w(N.MOVE_END,{isTrusted:n.isTrusted,direction:v(e.start,e.end),axesEvent:n})),r.setActive(this._targetPanel,r.activePanel,n.isTrusted)},e}(On),Cn=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.holding=!1,e.animating=!0,e}a(e,t);var n=e.prototype;return n.onAnimationEnd=function(e){(0,e.transitTo)(yn.IDLE)},n.onChange=function(e){var t=e.axesEvent,e=e.transitTo;t.stop(),e(yn.IDLE)},n.onRelease=function(e){var t=e.axesEvent,e=e.transitTo;0===t.delta.flick&&e(yn.IDLE)},e}(On),Nn=(q=Sn.prototype,Object.defineProperty(q,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),q.fire=function(e,t){var n=this._state,i=r(r({},t),{transitTo:this.transitTo});switch(e){case Pn.HOLD:n.onHold(i);break;case Pn.CHANGE:n.onChange(i);break;case Pn.RELEASE:n.onRelease(i);break;case Pn.ANIMATION_END:n.onAnimationEnd(i);break;case Pn.FINISH:n.onFinish(i)}},Sn);function Sn(){var n=this;this.transitTo=function(e){var t;switch(e){case yn.IDLE:t=new Rn;break;case yn.HOLDING:t=new wn;break;case yn.DRAGGING:t=new An;break;case yn.ANIMATING:t=new In;break;case yn.DISABLED:t=new Cn}return t.onEnter(n._state),n._state=t,n._state},this._state=new Rn}var Dn=(jt=kn.prototype,Object.defineProperty(jt,"axes",{get:function(){return this._axes},enumerable:!1,configurable:!0}),Object.defineProperty(jt,"stateMachine",{get:function(){return this._stateMachine},enumerable:!1,configurable:!0}),Object.defineProperty(jt,"state",{get:function(){return this._stateMachine.state},enumerable:!1,configurable:!0}),Object.defineProperty(jt,"animatingContext",{get:function(){return this._animatingContext},enumerable:!1,configurable:!0}),Object.defineProperty(jt,"controlParams",{get:function(){var e=this._axes;if(!e)return{range:{min:0,max:0},position:0,circular:!1};e=e.axis[Tn];return{range:{min:e.range[0],max:e.range[1]},circular:e.circular[0],position:this.position}},enumerable:!1,configurable:!0}),Object.defineProperty(jt,"enabled",{get:function(){var e;return null!==(e=null===(e=this._panInput)||void 0===e?void 0:e.isEnable())&&void 0!==e&&e},enumerable:!1,configurable:!0}),Object.defineProperty(jt,"position",{get:function(){var e;return null!==(e=null===(e=this._axes)||void 0===e?void 0:e.get([Tn])[Tn])&&void 0!==e?e:0},enumerable:!1,configurable:!0}),Object.defineProperty(jt,"range",{get:function(){var e;return null!==(e=null===(e=this._axes)||void 0===e?void 0:e.axis[Tn].range)&&void 0!==e?e:[0,0]},enumerable:!1,configurable:!0}),Object.defineProperty(jt,"bounce",{get:function(){var e;return null===(e=this._axes)||void 0===e?void 0:e.axis[Tn].bounce},enumerable:!1,configurable:!0}),jt.init=function(n){var e,i=this;this._flicking=n,this._axes=new En(((e={})[Tn]={range:[0,0],circular:!1,bounce:[0,0]},e),{deceleration:n.deceleration,interruptable:n.interruptable,easing:n.easing}),this._panInput=new bn(n.viewport.element,{inputType:n.inputType,iOSEdgeSwipeThreshold:n.iOSEdgeSwipeThreshold,scale:n.horizontal?[-1,0]:[0,-1],releaseOnScroll:!0});var r=this._axes;r.connect(n.horizontal?[Tn,""]:["",Tn],this._panInput);for(var t in Pn)!function(e){var t=Pn[e];r.on(t,function(e){i._stateMachine.fire(t,{flicking:n,axesEvent:e})})}(t);return this},jt.destroy=function(){var e;this._axes&&(this.removePreventClickHandler(),this._axes.destroy()),null!==(e=this._panInput)&&void 0!==e&&e.destroy(),this._resetInternalValues()},jt.enable=function(){var e;return null!==(e=this._panInput)&&void 0!==e&&e.enable(),this},jt.disable=function(){var e;return null!==(e=this._panInput)&&void 0!==e&&e.disable(),this},jt.update=function(e){var t,n,i=_(this._flicking,"Control"),r=i.camera,o=this._axes,a=o.axis[Tn];return a.circular=[e.circular,e.circular],a.range=[e.range.min,e.range.max],a.bounce=(t=i.bounce,n=r.size,(Array.isArray(t)?t.map(function(e){return c(e,n)}):[r=c(t,n),r]).map(function(e){if(null==e)throw new H(C.WRONG_OPTION("bounce",t),I.WRONG_OPTION);return e})),o.axm.set(((o={})[Tn]=e.position,o)),this},jt.addPreventClickHandler=function(){var e=_(this._flicking,"Control"),t=this._axes,e=e.camera.element;return t.on(Pn.HOLD,this._onAxesHold),t.on(Pn.CHANGE,this._onAxesChange),e.addEventListener("click",this._preventClickWhenDragged,!0),this},jt.removePreventClickHandler=function(){var e=_(this._flicking,"Control"),t=this._axes,e=e.camera.element;return t.off(Pn.HOLD,this._onAxesHold),t.off(Pn.CHANGE,this._onAxesChange),e.removeEventListener("click",this._preventClickWhenDragged,!0),this},jt.animateTo=function(t,n,i){var r=this,o=this._axes;if(!o)return Promise.reject(new H(C.NOT_ATTACHED_TO_FLICKING("Control"),I.NOT_ATTACHED_TO_FLICKING));var e=o.get([Tn])[Tn];if(e===t)return(s=_(this._flicking,"Control")).camera.lookAt(t),Promise.resolve();this._animatingContext={start:e,end:t,offset:0};function a(){var e;o.once(Pn.FINISH,function(){r._animatingContext={start:0,end:0,offset:0}}),i?i.setTo(((e={})[Tn]=t,e),n):o.setTo(((e={})[Tn]=t,e),n)}if(0!==n)return new Promise(function(e,t){function n(){o.off(Pn.FINISH,i),t(new H(C.ANIMATION_INTERRUPTED,I.ANIMATION_INTERRUPTED))}var i=function(){o.off(Pn.HOLD,n),e()};o.once(Pn.FINISH,i),o.once(Pn.HOLD,n),a()});var e=(s=_(this._flicking,"Control")).camera;a();var s=s.circularEnabled?P(t,e.range.min,e.range.max):t;return o.axm.set(((e={})[Tn]=s,e)),Promise.resolve()},jt._resetInternalValues=function(){this._flicking=null,this._axes=null,this._panInput=null,this._animatingContext={start:0,end:0,offset:0},this._dragged=!1},kn);function kn(){var t=this;this._onAxesHold=function(){t._dragged=!1},this._onAxesChange=function(){t._dragged=!0},this._preventClickWhenDragged=function(e){t._dragged&&(e.preventDefault(),e.stopPropagation()),t._dragged=!1},this._resetInternalValues(),this._stateMachine=new Nn}var Ln=(dn=jn.prototype,Object.defineProperty(dn,"controller",{get:function(){return this._controller},enumerable:!1,configurable:!0}),Object.defineProperty(dn,"activeIndex",{get:function(){var e;return null!==(e=null===(e=this._activePanel)||void 0===e?void 0:e.index)&&void 0!==e?e:-1},enumerable:!1,configurable:!0}),Object.defineProperty(dn,"activePanel",{get:function(){return this._activePanel},enumerable:!1,configurable:!0}),Object.defineProperty(dn,"animating",{get:function(){return this._controller.state.animating},enumerable:!1,configurable:!0}),Object.defineProperty(dn,"holding",{get:function(){return this._controller.state.holding},enumerable:!1,configurable:!0}),dn.init=function(e){return this._flicking=e,this._controller.init(e),this},dn.destroy=function(){this._controller.destroy(),this._flicking=null,this._activePanel=null},dn.enable=function(){return this._controller.enable(),this},dn.disable=function(){return this._controller.disable(),this},dn.updatePosition=function(e){var t=_(this._flicking,"Control").camera,n=this._activePanel;n&&t.lookAt(t.clampToReachablePosition(n.position))},dn.updateInput=function(){var e=_(this._flicking,"Control").camera;return this._controller.update(e.controlParams),this},dn.resetActive=function(){return this._activePanel=null,this},dn.moveToPanel=function(a,e){var s=e.duration,t=e.direction,u=void 0===t?D.NONE:t,c=e.axesEvent;return h(this,void 0,void 0,function(){var t,n,i,r,o;return m(this,function(e){return t=_(this._flicking,"Control"),o=t.camera,n=a.position,i=o.findNearestAnchor(n),a.removed||!i?[2,Promise.reject(new H(C.POSITION_NOT_REACHABLE(a.position),I.POSITION_NOT_REACHABLE))]:(o.canReach(a)?t.circularEnabled&&(r=this._controller.position,o=o.rangeDiff,n=[n,n+o,n-o].filter(function(e){return u===D.NONE||(u===D.PREV?e<=r:r<=e)}).reduce(function(e,t){return Math.abs(r-t)<Math.abs(r-e)?t:e},1/0)):(n=i.position,a=i.panel),this._triggerIndexChangeEvent(a,a.position,c),[2,this._animateToPosition({position:n,duration:s,newActivePanel:a,axesEvent:c})])})})},dn.setActive=function(e,t,n){var i,r=_(this._flicking,"Control");this._activePanel=e,r.camera.updateAdaptiveHeight(),e!==t?r.trigger(new w(N.CHANGED,{index:e.index,panel:e,prevIndex:null!==(i=null==t?void 0:t.index)&&void 0!==i?i:-1,prevPanel:t,isTrusted:n,direction:t?v(t.position,e.position):D.NONE})):r.trigger(new w(N.RESTORED,{isTrusted:n}))},dn._triggerIndexChangeEvent=function(e,t,n){var i=_(this._flicking,"Control"),r=e!==this._activePanel?N.WILL_CHANGE:N.WILL_RESTORE,o=i.camera,a=this._activePanel,t=new w(r,{index:e.index,panel:e,isTrusted:(null==n?void 0:n.isTrusted)||!1,direction:v(null!==(a=null==a?void 0:a.position)&&void 0!==a?a:o.position,t)});if(i.trigger(t),t.isCanceled())throw new H(C.STOP_CALLED_BY_USER,I.STOP_CALLED_BY_USER)},dn._animateToPosition=function(e){var r=e.position,o=e.duration,a=e.newActivePanel,s=e.axesEvent;return h(this,void 0,void 0,function(){var t,n,i=this;return m(this,function(e){return t=_(this._flicking,"Control"),n=function(){return i._controller.animateTo(r,o,s)},this._controller.state.targetPanel=a,o<=0?[2,n()]:[2,n().then(function(){return h(i,void 0,void 0,function(){return m(this,function(e){switch(e.label){case 0:return[4,t.renderer.render()];case 1:return e.sent(),[2]}})})}).catch(function(e){if(!(s&&e instanceof H&&e.code===I.ANIMATION_INTERRUPTED))throw e})]})})},jn);function jn(){this._flicking=null,this._controller=new Dn,this._activePanel=null}var zn=(qn=Mn.prototype,Object.defineProperty(qn,"index",{get:function(){return this._index},enumerable:!1,configurable:!0}),Object.defineProperty(qn,"position",{get:function(){return this._pos},enumerable:!1,configurable:!0}),Object.defineProperty(qn,"panel",{get:function(){return this._panel},enumerable:!1,configurable:!0}),Mn);function Mn(e){var t=e.index,n=e.position,e=e.panel;this._index=t,this._pos=n,this._panel=e}var Hn=function(n){function e(e){var t=(void 0===e?{}:e).count,e=void 0===t?1/0:t,t=n.call(this)||this;return t._count=e,t}a(e,n);var t=e.prototype;return Object.defineProperty(t,"count",{get:function(){return this._count},set:function(e){this._count=e},enumerable:!1,configurable:!0}),t.moveToPosition=function(u,c,l){return h(this,void 0,void 0,function(){var t,n,i,r,o,a,s;return m(this,function(e){return t=_(this._flicking,"Control"),n=t.camera,o=n.findActiveAnchor(),s=n.findNearestAnchor(n.position),a=t.control.controller.state,o&&s?(i=this._calcSnapThreshold(u,o),r=t.animating?a.delta:u-n.position,o=Math.abs(r),a=l&&0!==l.delta[Tn]?Math.abs(l.delta[Tn]):o,s=i<=a&&0<a?this._findSnappedAnchor(u,s):o>=t.threshold&&0<o?this._findAdjacentAnchor(r,s):s,this._triggerIndexChangeEvent(s.panel,u,l),[2,this._animateToPosition({position:n.clampToReachablePosition(s.position),duration:c,newActivePanel:s.panel,axesEvent:l})]):[2,Promise.reject(new H(C.POSITION_NOT_REACHABLE(u),I.POSITION_NOT_REACHABLE))]})})},t._findSnappedAnchor=function(e,t){var n=_(this._flicking,"Control"),i=n.camera,r=this._count,o=i.position,a=i.clampToReachablePosition(e),s=i.findAnchorIncludePosition(a);if(!t||!s)throw new H(C.POSITION_NOT_REACHABLE(e),I.POSITION_NOT_REACHABLE);if(!isFinite(r))return s;var u=n.panelCount,c=i.anchorPoints,l=Math.sign(e-o)*Math.floor(Math.abs(e-o)/i.rangeDiff);o<e&&s.index<t.index||s.position>t.position&&s.index===t.index?l+=1:(e<o&&s.index>t.index||s.position<t.position&&s.index===t.index)&&--l;a=s.index+l*u;if(Math.abs(a-t.index)<=r){var h=c[s.index];return new zn({index:h.index,position:h.position+l*i.rangeDiff,panel:h.panel})}if(n.circularEnabled){h=c[h=t.index+Math.sign(e-o)*r,(n=u)<=h?h%n:h<0?b((h+1)%n-1,n):h],u=Math.floor(r/u);return o<e&&h.index<t.index?u+=1:e<o&&h.index>t.index&&--u,new zn({index:h.index,position:h.position+u*i.rangeDiff,panel:h.panel})}return c[L(t.index+Math.sign(e-o)*r,0,c.length-1)]},t._findAdjacentAnchor=function(e,t){var n=_(this._flicking,"Control").camera;return null!==(n=0<e?n.getNextAnchor(t):n.getPrevAnchor(t))&&void 0!==n?n:t},t._calcSnapThreshold=function(e,t){var n=e>t.position,i=t.panel,e=i.size,t=i.alignPosition;return n?e-t+i.margin.next:t+i.margin.prev},e}(Ln),Fn=function(n){function e(e){var t=(void 0===e?{}:e).stopAtEdge,e=void 0===t||t,t=n.call(this)||this;return t._stopAtEdge=e,t}a(e,n);var t=e.prototype;return Object.defineProperty(t,"stopAtEdge",{get:function(){return this._stopAtEdge},set:function(e){this._stopAtEdge=e},enumerable:!1,configurable:!0}),t.updatePosition=function(e){var t=_(this._flicking,"Control").camera,n=this._activePanel;n&&(e=(n=n.range).min+(n.max-n.min)*e,t.lookAt(t.clampToReachablePosition(e)))},t.moveToPosition=function(i,r,o){return h(this,void 0,void 0,function(){var t,n;return m(this,function(e){return t=_(this._flicking,"Control"),n=t.camera,t=n.clampToReachablePosition(i),(n=n.findAnchorIncludePosition(t))?((n=n.panel)!==this._activePanel&&this._triggerIndexChangeEvent(n,i,o),[2,this._animateToPosition({position:this._stopAtEdge?t:i,duration:r,newActivePanel:n,axesEvent:o})]):[2,Promise.reject(new H(C.POSITION_NOT_REACHABLE(i),I.POSITION_NOT_REACHABLE))]})})},e}(Ln),Vn=function(r){function e(e){var e=(void 0===e?{}:e).count,e=void 0===e?1:e,i=r.call(this)||this;return i.setActive=function(e,t,n){r.prototype.setActive.call(i,e,t,n),i.updateInput()},i._count=e,i._resetIndexRange(),i}a(e,r);var t=e.prototype;return Object.defineProperty(t,"count",{get:function(){return this._count},set:function(e){this._count=e},enumerable:!1,configurable:!0}),t.destroy=function(){r.prototype.destroy.call(this),this._resetIndexRange()},t.updateInput=function(){var e=_(this._flicking,"Control"),t=e.camera,n=e.renderer,i=this._controller,r=t.controlParams,o=this._count,a=i.state.animating?null===(l=t.findNearestAnchor(t.position))||void 0===l?void 0:l.panel:this._activePanel;if(!a)return i.update(r),this._resetIndexRange(),this;var s=r.range,u=a.position,c=a.index,l=n.panelCount,a=c-o,o=c+o;a<0&&(a=e.circularEnabled?b((a+1)%l-1,l):L(a,0,l-1)),l<=o&&(o=e.circularEnabled?o%l:L(o,0,l-1));a=n.panels[a],n=n.panels[o],o=Math.max(a.position,s.min),s=Math.min(n.position,s.max);return u<o&&(o-=t.rangeDiff),s<u&&(s+=t.rangeDiff),r.range={min:o,max:s},r.circular&&(r.position<o&&(r.position+=t.rangeDiff),r.position>s&&(r.position-=t.rangeDiff)),r.circular=!1,i.update(r),this._indexRange={min:a.index,max:n.index},this},t.moveToPosition=function(p,g,v){return h(this,void 0,void 0,function(){var t,n,i,r,o,a,s,u,c,l,h,f,d;return m(this,function(e){return l=_(this._flicking,"Control"),t=l.camera,n=this._activePanel,f=this._controller.range,i=this._indexRange,r=t.range,c=L(t.clampToReachablePosition(p),f[0],f[1]),(o=t.findAnchorIncludePosition(c))&&n?(h=n.position,a=Math.abs(p-h)>=l.threshold,s=h<p?t.getNextAnchor(o):t.getPrevAnchor(o),f=t.anchorPoints,c=f[0],l=f[f.length-1],h=p<=r.min&&x(c.panel.index,i.min,i.max),f=p>=r.max&&x(l.panel.index,i.min,i.max),h||f?(d=p<r.min?c:l,u=d.panel,d=d.position):a&&o.position!==n.position?(u=o.panel,d=o.position):a&&s&&x(s.index,i.min,i.max)?(u=s.panel,d=s.position):(d=t.clampToReachablePosition(n.position),u=n),this._triggerIndexChangeEvent(u,p,v),[2,this._animateToPosition({position:d,duration:g,newActivePanel:u,axesEvent:v})]):[2,Promise.reject(new H(C.POSITION_NOT_REACHABLE(p),I.POSITION_NOT_REACHABLE))]})})},t._resetIndexRange=function(){this._indexRange={min:0,max:0}},e}(Ln),q={__proto__:null,Control:Ln,SnapControl:Hn,FreeControl:Fn,StrictControl:Vn,AxesController:Dn,State:On,IdleState:Rn,HoldingState:wn,DraggingState:An,AnimatingState:In,DisabledState:Cn,StateMachine:Nn},dn=(jt=Gn.prototype,Object.defineProperty(jt,"element",{get:function(){return this._el},enumerable:!1,configurable:!0}),Object.defineProperty(jt,"position",{get:function(){return this._position},enumerable:!1,configurable:!0}),Object.defineProperty(jt,"alignPosition",{get:function(){return this._alignPos},enumerable:!1,configurable:!0}),Object.defineProperty(jt,"offset",{get:function(){return this._offset},enumerable:!1,configurable:!0}),Object.defineProperty(jt,"range",{get:function(){return this._range},enumerable:!1,configurable:!0}),Object.defineProperty(jt,"rangeDiff",{get:function(){return this._range.max-this._range.min},enumerable:!1,configurable:!0}),Object.defineProperty(jt,"visiblePanels",{get:function(){return this._visiblePanels},enumerable:!1,configurable:!0}),Object.defineProperty(jt,"visibleRange",{get:function(){return{min:this._position-this._alignPos,max:this._position-this._alignPos+this.size}},enumerable:!1,configurable:!0}),Object.defineProperty(jt,"anchorPoints",{get:function(){return this._anchors},enumerable:!1,configurable:!0}),Object.defineProperty(jt,"controlParams",{get:function(){return{range:this._range,position:this._position,circular:!1}},enumerable:!1,configurable:!0}),Object.defineProperty(jt,"atEdge",{get:function(){return this._position<=this._range.min||this._position>=this._range.max},enumerable:!1,configurable:!0}),Object.defineProperty(jt,"size",{get:function(){var e=this._flicking;return e?e.horizontal?e.viewport.width:e.viewport.height:0},enumerable:!1,configurable:!0}),Object.defineProperty(jt,"progress",{get:function(){var e=this._flicking,t=this._position+this._offset,n=this.findNearestAnchor(this._position);if(!e||!n)return NaN;var i=n.panel,r=i.position+i.offset,o=e.control.controller.bounce,a=this.range,n=a.min,e=a.max,a=this.rangeDiff;if(t===r)return i.index;if(t<r){var s=i.prev(),s=s?s.position+s.offset:n-o[0];return r<s&&(s-=a),i.index-1+T(t,s,r)}s=i.next(),o=s?s.position+s.offset:e+o[1];return o<r&&(o+=a),i.index+T(t,r,o)},enumerable:!1,configurable:!0}),Object.defineProperty(jt,"align",{get:function(){return this._align},set:function(e){this._align=e},enumerable:!1,configurable:!0}),jt.init=function(e){e=(this._flicking=e).viewport.element;return function(e,t){if(null==e)throw new H(C.VAL_MUST_NOT_NULL(e,t),I.VAL_MUST_NOT_NULL)}(e.firstElementChild,"First element child of the viewport element"),this._el=e.firstElementChild,this._checkTranslateSupport(),this},jt.destroy=function(){return this._flicking=null,this._resetInternalValues(),this},jt.lookAt=function(e){var t=this._position;this._position=e,this._refreshVisiblePanels(),this._checkNeedPanel(),this._checkReachEnd(t,e),this._applyTransform()},jt.getPrevAnchor=function(e){return this._anchors[e.index-1]||null},jt.getNextAnchor=function(e){return this._anchors[e.index+1]||null},jt.getProgressInPanel=function(e){e=e.range;return(this._position-e.min)/(e.max-e.min)},jt.findAnchorIncludePosition=function(n){return this._anchors.filter(function(e){return e.panel.includePosition(n,!0)}).reduce(function(e,t){return e&&Math.abs(e.position-n)<Math.abs(t.position-n)?e:t},null)},jt.findNearestAnchor=function(e){var t=this._anchors;if(t.length<=0)return null;for(var n=1/0,i=0;i<t.length;i++){var r=t[i],r=Math.abs(r.position-e);if(n<r)return t[i-1];n=r}return t[t.length-1]},jt.findActiveAnchor=function(){var t=_(this._flicking,"Camera").control.activeIndex;return function(e,t){var n,i;try{for(var r=l(e),o=r.next();!o.done;o=r.next()){var a=o.value;if(t(a))return a}}catch(e){n={error:e}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}return null}(this._anchors,function(e){return e.panel.index===t})},jt.clampToReachablePosition=function(e){var t=this._range;return L(e,t.min,t.max)},jt.canReach=function(e){var t=this._range;if(e.removed)return!1;e=e.position;return e>=t.min&&e<=t.max},jt.canSee=function(e){var t=this.visibleRange;return e.includeRange(t.min,t.max,!1)},jt.updateAlignPos=function(){var e=this._align,e="object"==typeof e?e.camera:e;return this._alignPos=u(e,this.size),this},jt.updateAnchors=function(){var e=_(this._flicking,"Camera").renderer.panels;return this._anchors=e.map(function(e,t){return new zn({index:t,position:e.position,panel:e})}),this},jt.updateAdaptiveHeight=function(){var e=_(this._flicking,"Camera"),t=e.control.activePanel;e.horizontal&&e.adaptive&&t&&e.viewport.setSize({height:t.height})},jt.updateOffset=function(){var e=_(this._flicking,"Camera").panels.filter(function(e){return!e.rendered}),t=this._position;this._offset=e.filter(function(e){return e.position+e.offset<t}).reduce(function(e,t){return e+t.sizeIncludingMargin},0),this._applyTransform()},jt.resetNeedPanelHistory=function(){return this._needPanelTriggered={prev:!1,next:!1},this},jt._resetInternalValues=function(){this._position=0,this._alignPos=0,this._offset=0,this._range={min:0,max:0},this._visiblePanels=[],this._anchors=[],this._needPanelTriggered={prev:!1,next:!1}},jt._refreshVisiblePanels=function(){var t=this,e=_(this._flicking,"Camera"),n=e.renderer.panels.filter(function(e){return t.canSee(e)}),i=this._visiblePanels,r=(this._visiblePanels=n).filter(function(e){return!E(i,e)}),o=i.filter(function(e){return!E(n,e)});(0<r.length||0<o.length)&&e.renderer.render().then(function(){e.trigger(new w(N.VISIBLE_CHANGE,{added:r,removed:o,visiblePanels:n}))})},jt._checkNeedPanel=function(){var e=this._needPanelTriggered;if(!e.prev||!e.next){var t=_(this._flicking,"Camera"),n=t.renderer.panels;if(n.length<=0)return e.prev||(t.trigger(new w(N.NEED_PANEL,{direction:D.PREV})),e.prev=!0),void(e.next||(t.trigger(new w(N.NEED_PANEL,{direction:D.NEXT})),e.next=!0));var i=this._position,r=this.size,o=this._range,a=t.needPanelThreshold,s=i-this._alignPos,u=s+r,r=n[0],n=n[n.length-1];e.prev||(s<=r.range.min+a||i<=o.min+a)&&(t.trigger(new w(N.NEED_PANEL,{direction:D.PREV})),e.prev=!0),e.next||(n.range.max-a<=u||i>=o.max-a)&&(t.trigger(new w(N.NEED_PANEL,{direction:D.NEXT})),e.next=!0)}},jt._checkReachEnd=function(e,t){var n=_(this._flicking,"Camera"),i=this._range,r=e>i.min&&e<i.max,e=t>i.min&&t<i.max;r&&!e&&(i=t<=i.min?D.PREV:D.NEXT,n.trigger(new w(N.REACH_EDGE,{direction:i})))},jt._applyTransform=function(){var e=this._el,t=_(this._flicking,"Camera"),n=this._position-this._alignPos-this._offset;e.style[this._transform]=t.horizontal?"translate("+-n+"px)":"translate(0, "+-n+"px)"},Gn);function Gn(e){var s=this,e=(void 0===e?{}:e).align,e=void 0===e?S.CENTER:e;this._checkTranslateSupport=function(){var t,e,n=document.documentElement.style,i="";try{for(var r=l(["webkitTransform","msTransform","MozTransform","OTransform","transform"]),o=r.next();!o.done;o=r.next()){var a=o.value;a in n&&(i=a)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}if(!i)throw new H(C.TRANSFORM_NOT_SUPPORTED,I.TRANSFORM_NOT_SUPPORTED);s._transform=i},this._flicking=null,this._resetInternalValues(),this._align=e}var Xn,Yn=(a(Wn,Xn=dn),Wn.prototype.updateRange=function(){var e=_(this._flicking,"Camera").renderer,t=e.getPanel(0),e=e.getPanel(e.panelCount-1);return this._range={min:null!==(t=null==t?void 0:t.position)&&void 0!==t?t:0,max:null!==(e=null==e?void 0:e.position)&&void 0!==e?e:0},this},Wn);function Wn(){return null!==Xn&&Xn.apply(this,arguments)||this}var Bn=function(o){function e(){var e=null!==o&&o.apply(this,arguments)||this;return e._circularOffset=0,e._circularEnabled=!1,e}a(e,o);var t=e.prototype;return Object.defineProperty(t,"offset",{get:function(){return this._offset-this._circularOffset},enumerable:!1,configurable:!0}),Object.defineProperty(t,"controlParams",{get:function(){return{range:this._range,position:this._position,circular:this._circularEnabled}},enumerable:!1,configurable:!0}),t.getPrevAnchor=function(e){if(!this._circularEnabled||0!==e.index)return o.prototype.getPrevAnchor.call(this,e);var t=this._anchors,e=this.rangeDiff,t=t[t.length-1];return new zn({index:t.index,position:t.position-e,panel:t.panel})},t.getNextAnchor=function(e){var t=this._anchors;if(!this._circularEnabled||e.index!==t.length-1)return o.prototype.getNextAnchor.call(this,e);e=this.rangeDiff,t=t[0];return new zn({index:t.index,position:t.position+e,panel:t.panel})},t.findAnchorIncludePosition=function(e){if(!this._circularEnabled)return o.prototype.findAnchorIncludePosition.call(this,e);var t=this._range,n=P(e,t.min,t.max),i=o.prototype.findAnchorIncludePosition.call(this,n);if(!i)return null;n=this.rangeDiff;if(e<t.min){var r=-Math.floor((t.min-e)/n)-1;return new zn({index:i.index,position:i.position+n*r,panel:i.panel})}if(e>t.max){r=Math.floor((e-t.max)/n)+1;return new zn({index:i.index,position:i.position+n*r,panel:i.panel})}return i},t.clampToReachablePosition=function(e){return this._circularEnabled?e:o.prototype.clampToReachablePosition.call(this,e)},t.canReach=function(e){return!e.removed&&(!!this._circularEnabled||o.prototype.canReach.call(this,e))},t.canSee=function(e){var t=this._range,n=this.rangeDiff,i=this.visibleRange,r=o.prototype.canSee.call(this,e);return this._circularEnabled?i.min<t.min?r||e.includeRange(i.min+n,i.max+n,!1):i.max>t.max?r||e.includeRange(i.min-n,i.max-n,!1):r:r},t.updateRange=function(){var e=_(this._flicking,"Camera").renderer.panels;if(e.length<=0)return this._resetInternalValues(),this;var t=e[0],n=e[e.length-1],i=t.range.min-t.margin.prev,r=n.range.max+n.margin.next,o=this.size,a=r-i,s=e.every(function(e){return a-e.size>=o});return(this._circularEnabled=s)?(this._range={min:i,max:r},e.forEach(function(e){return e.updateCircularToggleDirection()})):this._range={min:t.position,max:n.position},this._updateCircularOffset(),this},t.lookAt=function(t){var e=_(this._flicking,"Camera"),n=this._position;if(t===n)return o.prototype.lookAt.call(this,t);var i=e.renderer.panels.map(function(e){return e.toggle(n,t)});return this._position=t,i.some(function(e){return e})&&(this._updateCircularOffset(),e.renderer.render()),o.prototype.lookAt.call(this,t)},t._applyTransform=function(){var e=this._el,t=_(this._flicking,"Camera"),n=this._position-this._alignPos-this._offset+this._circularOffset;e.style[this._transform]=t.horizontal?"translate("+-n+"px)":"translate(0, "+-n+"px)"},t._resetInternalValues=function(){o.prototype._resetInternalValues.call(this),this._circularOffset=0,this._circularEnabled=!1},t._calcPanelAreaSum=function(e){return e.reduce(function(e,t){return e+t.sizeIncludingMargin},0)},t._updateCircularOffset=function(){var e,t,n;this._circularEnabled?(e=_(this._flicking,"Camera"),t=[],n=[],e.panels.filter(function(e){return e.toggled}).forEach(function(e){(e.toggleDirection===D.PREV?t:n).push(e)}),this._circularOffset=this._calcPanelAreaSum(t)-this._calcPanelAreaSum(n)):this._circularOffset=0},e}(dn),Un=function(i){function e(){return null!==i&&i.apply(this,arguments)||this}a(e,i);var t=e.prototype;return t.updateRange=function(){var e=_(this._flicking,"Camera").renderer,t=this._alignPos,n=e.getPanel(0),i=e.getPanel(e.panelCount-1);if(!n||!i)return this._range={min:0,max:0},this;var r=this.size,e=n.range.min,n=i.range.max,i=e+t,t=n-r+t;return r<n-e?this._range={min:i,max:t}:(e="object"==typeof(e=this._align)?e.camera:e,i=i+u(e,t-i),this._range={min:i,max:i}),this},t.updateAnchors=function(){var t=this,e=_(this._flicking,"Camera").renderer.panels;if(e.length<=0)return this._anchors=[],this;var n,i,r,o,a=this._range,s=e.filter(function(e){return t.canReach(e)});return 0<s.length?(n=s[0].position!==a.min,i=s[s.length-1].position!==a.max,r=n?1:0,o=s.map(function(e,t){return new zn({index:t+r,position:e.position,panel:e})}),n&&o.splice(0,0,new zn({index:0,position:a.min,panel:e[s[0].index-1]})),i&&o.push(new zn({index:o.length,position:a.max,panel:e[s[s.length-1].index+1]})),this._anchors=o):a.min!==a.max?(s=(o=(s=this._findNearestPanel(a.min,e)).index===e.length-1?s.prev():s).next(),this._anchors=[new zn({index:0,position:a.min,panel:o}),new zn({index:1,position:a.max,panel:s})]):this._anchors=[new zn({index:0,position:a.min,panel:this._findNearestPanel(a.min,e)})],this},t.findAnchorIncludePosition=function(e){var t=this._range,n=this._anchors;return n.length<=0?null:e<=t.min?n[0]:e>=t.max?n[n.length-1]:i.prototype.findAnchorIncludePosition.call(this,e)},t._findNearestPanel=function(e,t){for(var n=1/0,i=0;i<t.length;i++){var r=t[i],r=Math.abs(r.position-e);if(n<r)return t[i-1];n=r}return t[t.length-1]},e}(dn),qn={__proto__:null,Camera:dn,LinearCamera:Yn,CircularCamera:Bn,BoundCamera:Un};function Kn(e){return void 0===e}var Ln=function(){function e(){this.options={},this._eventHandler={}}var t=e.prototype;return t.trigger=function(e){for(var t=this,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];if(!(0<(a=this._eventHandler[e]||[]).length))return!0;var r=n[0]||{},o=n.slice(1),a=a.concat(),s=!1;r.eventType=e,r.stop=function(){s=!0},r.currentTarget=this;var u=[r];return 1<=o.length&&(u=u.concat(o)),a.forEach(function(e){e.apply(t,u)}),!s},t.once=function(n,i){var r,o=this;if("object"==typeof n&&Kn(i)){var e,t=n;for(e in t)this.once(e,t[e]);return this}return"string"==typeof n&&"function"==typeof i&&this.on(n,r=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];i.apply(o,e),o.off(n,r)}),this},t.hasOn=function(e){return!!this._eventHandler[e]},t.on=function(e,t){if("object"==typeof e&&Kn(t)){var n,i=e;for(n in i)this.on(n,i[n]);return this}var r;return"string"==typeof e&&"function"==typeof t&&(Kn(r=this._eventHandler[e])&&(this._eventHandler[e]=[],r=this._eventHandler[e]),r.push(t)),this},t.off=function(e,t){var n,i;if(Kn(e))return this._eventHandler={},this;if(Kn(t)){if("string"==typeof e)return delete this._eventHandler[e],this;var r,o=e;for(r in o)this.off(r,o[r]);return this}var a=this._eventHandler[e];if(a){var s=0;try{for(var u=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&i>=e.length?void 0:e)&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(a),c=u.next();!c.done;c=u.next()){if(c.value===t){a.splice(s,1);break}s++}}catch(e){n={error:e}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}return this},e.VERSION="2.2.2",e}(),Zn=function(e,t){return(Zn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function Jn(e,t){function n(){this.constructor=e}Zn(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Qn=function(){return(Qn=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};var On="undefined"!=typeof window,jt=On?window.navigator.userAgent:"",$n=On&&!!("getComputedStyle"in window),ei=/MSIE|Trident|Windows Phone|Edge/.test(jt),ti=On&&!!("addEventListener"in document),ni="width",ii="height";function ri(e,t){return e.getAttribute(t)||""}function oi(e){return[].slice.call(e)}function ai(e){return"loading"in e&&"lazy"===e.getAttribute("loading")}function si(e,t,n){ti?e.addEventListener(t,n,!1):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}function ui(e,t,n){e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}function ci(e,t){var n=e["client"+t]||e["offset"+t];return parseFloat(n||(e=e,(($n?window.getComputedStyle(e):e.currentStyle)||{})[t.toLowerCase()]))||0}function li(e,t,n){var i=oi(e.querySelectorAll(function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var i=Array(e),r=0,t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,r++)i[r]=o[a];return i}(["["+n+"skip] ["+n+"width]"],t.map(function(e){return["["+n+"skip] "+e,e+"["+n+"skip]","["+n+"width] "+e].join(", ")})).join(", ")));return oi(e.querySelectorAll("["+n+"width], "+t.join(", "))).filter(function(e){return-1===i.indexOf(e)})}var hi=[];function fi(e,t){hi.length||si(window,"resize",pi),e.__PREFIX__=t,hi.push(e),di(e)}function di(e,t){void 0===t&&(t="data-");var n,i=e.__PREFIX__||t,r=parseInt(ri(e,""+i+ni),10)||0,t=parseInt(ri(e,""+i+ii),10)||0;ri(e,i+"fixed")===ii?(n=ci(e,"Height")||t,e.style[ni]=r/t*n+"px"):(n=ci(e,"Width")||r,e.style[ii]=t/r*n+"px")}function pi(){hi.forEach(function(e){di(e)})}var dn=function(r){function e(e,t){void 0===t&&(t={});var n,i=r.call(this)||this;return i.isReady=!1,i.isPreReady=!1,i.hasDataSize=!1,i.hasLoading=!1,i.isSkip=!1,i.onCheck=function(e){i.clear(),e&&"error"===e.type&&i.onError(i.element);e=!i.hasDataSize&&!i.hasLoading;i.onReady(e)},i.options=Qn({prefix:"data-"},t),i.element=e,i.hasDataSize=(t=i.options.prefix,!!e.getAttribute((t=void 0===t?"data-":t)+"width")),i.hasLoading=ai(e),i.isSkip=!!i.element.getAttribute((n=void 0===n?"data-":n)+"skip"),i}Jn(e,r);var t=e.prototype;return t.check=function(){return this.isSkip||!this.checkElement()?(this.onAlreadyReady(!0),!1):(this.hasDataSize&&fi(this.element,this.options.prefix),(this.hasDataSize||this.hasLoading)&&this.onAlreadyPreReady(),!0)},t.addEvents=function(){var t=this,n=this.element;this.constructor.EVENTS.forEach(function(e){si(n,e,t.onCheck)})},t.clear=function(){var t=this,n=this.element;this.constructor.EVENTS.forEach(function(e){ui(n,e,t.onCheck)}),this.removeAutoSizer()},t.destroy=function(){this.clear(),this.off()},t.removeAutoSizer=function(){var e,t,n;this.hasDataSize&&(n=this.options.prefix,e=this.element,t=n,(n=hi.indexOf(e))<0||(t=ri(e,t+"fixed"),delete e.__PREFIX__,e.style[t===ii?ni:ii]="",hi.splice(n,1),hi.length||ui(window,"resize",pi)))},t.onError=function(e){this.trigger("error",{element:this.element,target:e})},t.onPreReady=function(){this.isPreReady||(this.isPreReady=!0,this.trigger("preReady",{element:this.element,hasLoading:this.hasLoading,isSkip:this.isSkip}))},t.onReady=function(e){this.isReady||((e=!this.isPreReady&&e)&&(this.isPreReady=!0),this.removeAutoSizer(),this.isReady=!0,this.trigger("ready",{element:this.element,withPreReady:e,hasLoading:this.hasLoading,isSkip:this.isSkip}))},t.onAlreadyError=function(e){var t=this;setTimeout(function(){t.onError(e)})},t.onAlreadyPreReady=function(){var e=this;setTimeout(function(){e.onPreReady()})},t.onAlreadyReady=function(e){var t=this;setTimeout(function(){t.onReady(e)})},e.EVENTS=[],e}(Ln),gi=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}Jn(t,e);var n=t.prototype;return n.setHasLoading=function(e){this.hasLoading=e},n.check=function(){return this.isSkip?(this.onAlreadyReady(!0),!1):(this.hasDataSize?(fi(this.element,this.options.prefix),this.onAlreadyPreReady()):this.trigger("requestChildren"),!0)},n.checkElement=function(){return!0},n.destroy=function(){this.clear(),this.trigger("requestDestroy"),this.off()},n.onAlreadyPreReady=function(){e.prototype.onAlreadyPreReady.call(this),this.trigger("reqeustReadyChildren")},t.EVENTS=[],t}(dn),jt=function(n){function e(e){void 0===e&&(e={});var t=n.call(this)||this;return t.readyCount=0,t.preReadyCount=0,t.totalCount=0,t.totalErrorCount=0,t.isPreReadyOver=!0,t.elementInfos=[],t.options=Qn({loaders:{},prefix:"data-"},e),t}Jn(e,n);var t=e.prototype;return t.check=function(e){var o=this,n=this.options.prefix;this.clear(),this.elementInfos=oi(e).map(function(e,r){var t=o.getLoader(e,{prefix:n});return t.check(),t.on("error",function(e){o.onError(r,e.target)}).on("preReady",function(e){var t=o.elementInfos[r];t.hasLoading=e.hasLoading,t.isSkip=e.isSkip;e=o.checkPreReady(r);o.onPreReadyElement(r),e&&o.onPreReady()}).on("ready",function(e){var t=e.withPreReady,n=e.hasLoading,i=e.isSkip,e=o.elementInfos[r];e.hasLoading=n,e.isSkip=i;e=t&&o.checkPreReady(r),i=o.checkReady(r);t&&o.onPreReadyElement(r),o.onReadyElement(r),e&&o.onPreReady(),i&&o.onReady()}),{loader:t,element:e,hasLoading:!1,hasError:!1,isPreReady:!1,isReady:!1,isSkip:!1}});e=this.elementInfos.length;return(this.totalCount=e)||setTimeout(function(){o.onPreReady(),o.onReady()}),this},t.getTotalCount=function(){return this.totalCount},t.isPreReady=function(){return this.elementInfos.every(function(e){return e.isPreReady})},t.isReady=function(){return this.elementInfos.every(function(e){return e.isReady})},t.hasError=function(){return 0<this.totalErrorCount},t.clear=function(){this.isPreReadyOver=!1,this.totalCount=0,this.preReadyCount=0,this.readyCount=0,this.totalErrorCount=0,this.elementInfos.forEach(function(e){!e.isReady&&e.loader&&e.loader.destroy()}),this.elementInfos=[]},t.destroy=function(){this.clear(),this.off()},t.getLoader=function(t,e){var n=this,i=t.tagName.toLowerCase(),r=this.options.loaders,o=Object.keys(r);if(r[i])return new r[i](t,e);var a=new gi(t,e),s=oi(t.querySelectorAll(o.join(", ")));a.setHasLoading(s.some(ai));var u=!1,c=this.clone().on("error",function(e){a.onError(e.target)}).on("ready",function(){a.onReady(u)});return a.on("requestChildren",function(){var e=li(t,o,n.options.prefix);c.check(e).on("preReady",function(e){(u=e.isReady)||a.onPreReady()})}).on("reqeustReadyChildren",function(){c.check(s)}).on("requestDestroy",function(){c.destroy()}),a},t.clone=function(){return new e(Qn({},this.options))},t.checkPreReady=function(e){return this.elementInfos[e].isPreReady=!0,++this.preReadyCount,!(this.preReadyCount<this.totalCount)},t.checkReady=function(e){return this.elementInfos[e].isReady=!0,++this.readyCount,!(this.readyCount<this.totalCount)},t.onError=function(e,t){var n=this.elementInfos[e];n.hasError=!0,this.trigger("error",{element:n.element,index:e,target:t,errorCount:this.getErrorCount(),totalErrorCount:++this.totalErrorCount})},t.onPreReadyElement=function(e){var t=this.elementInfos[e];this.trigger("preReadyElement",{element:t.element,index:e,preReadyCount:this.preReadyCount,readyCount:this.readyCount,totalCount:this.totalCount,isPreReady:this.isPreReady(),isReady:this.isReady(),hasLoading:t.hasLoading,isSkip:t.isSkip})},t.onPreReady=function(){this.isPreReadyOver=!0,this.trigger("preReady",{readyCount:this.readyCount,totalCount:this.totalCount,isReady:this.isReady(),hasLoading:this.hasLoading()})},t.onReadyElement=function(e){var t=this.elementInfos[e];this.trigger("readyElement",{index:e,element:t.element,hasError:t.hasError,errorCount:this.getErrorCount(),totalErrorCount:this.totalErrorCount,preReadyCount:this.preReadyCount,readyCount:this.readyCount,totalCount:this.totalCount,isPreReady:this.isPreReady(),isReady:this.isReady(),hasLoading:t.hasLoading,isPreReadyOver:this.isPreReadyOver,isSkip:t.isSkip})},t.onReady=function(){this.trigger("ready",{errorCount:this.getErrorCount(),totalErrorCount:this.totalErrorCount,totalCount:this.totalCount})},t.getErrorCount=function(){return this.elementInfos.filter(function(e){return e.hasError}).length},t.hasLoading=function(){return this.elementInfos.some(function(e){return e.hasLoading})},e}(Ln),vi=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Jn(t,e),t.prototype.checkElement=function(){var e=this.element,t=e.getAttribute("src");if(e.complete){if(t)return e.naturalWidth||this.onAlreadyError(e),!1;this.onAlreadyPreReady()}return this.addEvents(),ei&&e.setAttribute("src",t),!0},t.EVENTS=["load","error"],t}(dn),mi=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Jn(t,e),t.prototype.checkElement=function(){var e=this.element;return!(1<=e.readyState)&&(e.error?(this.onAlreadyError(e),!1):(this.addEvents(),!0))},t.EVENTS=["loadedmetadata","error"],t}(dn),_i=function(t){function e(e){return t.call(this,Qn({loaders:{img:vi,video:mi}},e=void 0===e?{}:e))||this}return Jn(e,t),e}(jt),Ln=(On=yi.prototype,Object.defineProperty(On,"panels",{get:function(){return this._panels},enumerable:!1,configurable:!0}),Object.defineProperty(On,"panelCount",{get:function(){return this._panels.length},enumerable:!1,configurable:!0}),Object.defineProperty(On,"align",{get:function(){return this._align},set:function(e){this._align=e;var t=this._getPanelAlign();this._panels.forEach(function(e){e.align=t})},enumerable:!1,configurable:!0}),On.init=function(e){return this._flicking=e,this._collectPanels(),this},On.destroy=function(){this._flicking=null,this._panels=[]},On.getPanel=function(e){return this._panels[e]||null},On.updatePanelSize=function(){var e=_(this._flicking,"Renderer");return 0<e.panelsPerView?this._updatePanelSizeByGrid(e):e.panels.forEach(function(e){return e.resize()}),this},On.batchInsert=function(){for(var o=this,e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var a=this._panels,s=_(this._flicking,"Renderer"),n=s.control,u=this._getPanelAlign(),i=e.reduce(function(e,t){var n=b(t.index,a.length),i=a.slice(n),r=t.elements.map(function(e,t){return o._createPanel(e,{index:n+t,align:u,flicking:s})});return a.splice.apply(a,d([n,0],f(r))),o._insertPanelElements(r,null!==(t=i[0])&&void 0!==t?t:null),r.forEach(function(e){return e.resize()}),i.forEach(function(e){e.increaseIndex(r.length),e.updatePosition()}),d(d([],f(e)),f(r))},[]);return i.length<=0?[]:(this._updateCameraAndControl(),this.render(),0<i.length&&!n.animating&&n.moveToPanel(n.activePanel||i[0],{duration:0}).catch(function(){}),s.camera.updateOffset(),s.trigger(new w(N.PANEL_CHANGE,{added:i,removed:[]})),this.checkPanelContentsReady(i),i)},On.batchRemove=function(){for(var o=this,e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var a=this._panels,n=_(this._flicking,"Renderer"),i=n.camera,s=n.control,u=s.activePanel,r=s.activeIndex,c=e.reduce(function(e,t){var n=t.index,i=t.deleteCount,t=b(n,a.length),n=a.slice(t+i),r=a.splice(t,i);return r.length<=0?[]:(n.forEach(function(e){e.decreaseIndex(r.length),e.updatePosition()}),o._removePanelElements(r),r.forEach(function(e){return e.destroy()}),o._updateCameraAndControl(),E(r,u)&&s.resetActive(),d(d([],f(e)),f(r)))},[]);return this.render(),0<c.length&&!s.animating&&((r=E(c,u)?a[r]||a[a.length-1]:u)?s.moveToPanel(r,{duration:0}).catch(function(){}):i.lookAt(0)),n.camera.updateOffset(),n.trigger(new w(N.PANEL_CHANGE,{added:[],removed:c})),c},On.checkPanelContentsReady=function(o){var a,s=this,e=_(this._flicking,"Renderer").resizeOnContentsReady,u=this._panels;e&&((o=o.filter(function(e){return!!e.element.querySelector("img, video")})).length<=0||(a=new _i,o.forEach(function(e){e.loading=!0}),a.on("readyElement",function(e){var t,n,i,r=s._flicking;r?(t=o[e.index],n=r.camera,e=(i=r.control).activePanel?n.getProgressInPanel(i.activePanel):0,t.loading=!1,t.resize(),u.slice(t.index+1).forEach(function(e){return e.updatePosition()}),r.initialized&&(n.updateRange(),n.updateAnchors(),i.animating||(i.updatePosition(e),i.updateInput()))):a.destroy()}),a.on("preReady",function(e){s._flicking&&s.render(),e.readyCount===e.totalCount&&a.destroy()}),a.on("ready",function(){s._flicking&&s.render(),a.destroy()}),a.check(o.map(function(e){return e.element}))))},On._getPanelAlign=function(){var e=this._align;return"object"==typeof e?e.panel:e},On._updateCameraAndControl=function(){var e=_(this._flicking,"Renderer"),t=e.camera,e=e.control;t.updateRange(),t.updateAnchors(),t.resetNeedPanelHistory(),e.updateInput()},On._updateRenderingPanels=function(){var e=_(this._flicking,"Renderer");e.renderOnlyVisible?this._showOnlyVisiblePanels(e):e.panels.forEach(function(e){return e.markForShow()})},On._showOnlyVisiblePanels=function(t){var e=t.renderer.panels,n=t.camera,i=n.visiblePanels.reduce(function(e,t){return e[t.index]=!0,e},{});e.forEach(function(e){e.index in i||e.loading?e.markForShow():t.holding||e.markForHide()}),n.updateOffset()},On._updatePanelSizeByGrid=function(e){var t,n,i=e.panels,r=e.panelsPerView;if(r<=0)throw new H(C.WRONG_OPTION("panelsPerView",r),I.WRONG_OPTION);i.length<=0||((i=i[0]).resize(),r=(e.camera.size-(i.margin.prev+i.margin.next)*(r-1))/r,t=e.horizontal?{width:r}:{height:r},n={size:r,height:i.height,margin:i.margin},e.noPanelStyleOverride||e.panels.forEach(function(e){return e.setSize(t)}),e.panels.forEach(function(e){return e.resize(n)}))},yi);function yi(e){e=(void 0===e?{}:e).align,e=void 0===e?S.CENTER:e;this._flicking=null,this._panels=[],this._align=e}dn=bi.prototype,Object.defineProperty(dn,"index",{get:function(){return this._index},enumerable:!1,configurable:!0}),Object.defineProperty(dn,"position",{get:function(){return this._pos+this._alignPos},enumerable:!1,configurable:!0}),Object.defineProperty(dn,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),Object.defineProperty(dn,"sizeIncludingMargin",{get:function(){return this._size+this._margin.prev+this._margin.next},enumerable:!1,configurable:!0}),Object.defineProperty(dn,"height",{get:function(){return this._height},enumerable:!1,configurable:!0}),Object.defineProperty(dn,"margin",{get:function(){return this._margin},enumerable:!1,configurable:!0}),Object.defineProperty(dn,"alignPosition",{get:function(){return this._alignPos},enumerable:!1,configurable:!0}),Object.defineProperty(dn,"removed",{get:function(){return this._removed},enumerable:!1,configurable:!0}),Object.defineProperty(dn,"loading",{get:function(){return this._loading},set:function(e){this._loading=e},enumerable:!1,configurable:!0}),Object.defineProperty(dn,"range",{get:function(){return{min:this._pos,max:this._pos+this._size}},enumerable:!1,configurable:!0}),Object.defineProperty(dn,"toggled",{get:function(){return this._toggled},enumerable:!1,configurable:!0}),Object.defineProperty(dn,"toggleDirection",{get:function(){return this._toggleDirection},enumerable:!1,configurable:!0}),Object.defineProperty(dn,"offset",{get:function(){var e=this._toggleDirection,t=this._flicking.camera.rangeDiff;return e!==D.NONE&&this._toggled?e===D.PREV?-t:t:0},enumerable:!1,configurable:!0}),Object.defineProperty(dn,"progress",{get:function(){var e=this._flicking;return this.index-e.camera.progress},enumerable:!1,configurable:!0}),Object.defineProperty(dn,"outsetProgress",{get:function(){var e=this.position+this.offset,t=this._alignPos,n=this._flicking.camera,i=n.position;if(i===e)return 0;if(i<e){var r=e+(n.size-n.alignPosition)+t;return-T(i,e,r)}t=e-(n.alignPosition+this._size-t);return 1-T(i,t,e)},enumerable:!1,configurable:!0}),Object.defineProperty(dn,"visibleRatio",{get:function(){var e=this.range,t=this._size,n=this.offset,i=this._flicking.camera.visibleRange,r=e.min+n,e=e.max+n;if(e<=i.min||r>=i.max)return 0;n=t;return i.min>r&&(n-=i.min-r),i.max<e&&(n-=e-i.max),n/t},enumerable:!1,configurable:!0}),Object.defineProperty(dn,"align",{get:function(){return this._align},set:function(e){this._align=e},enumerable:!1,configurable:!0}),dn.resize=function(e){var t=this.element,n=O(t),i=this._flicking.horizontal;return e?(this._size=e.size,this._margin=r({},e.margin),this._height=e.height):(this._size=i?t.offsetWidth:t.offsetHeight,this._margin=i?{prev:parseFloat(n.marginLeft||"0"),next:parseFloat(n.marginRight||"0")}:{prev:parseFloat(n.marginTop||"0"),next:parseFloat(n.marginBottom||"0")},this._height=i?t.offsetHeight:this._size),this.updatePosition(),this._updateAlignPos(),this},dn.setSize=function(e){var t=e.width,n=e.height,e=this.element;return null!=t&&(z(t)?e.style.width=t:e.style.width=t+"px"),null!=n&&(z(n)?e.style.height=n:e.style.height=n+"px"),this},dn.contains=function(e){var t;return!(null===(t=this.element)||void 0===t||!t.contains(e))},dn.destroy=function(){this._resetInternalStates(),this._removed=!0},dn.includePosition=function(e,t){return this.includeRange(e,e,t=void 0===t?!1:t)},dn.includeRange=function(e,t,n){var i=this._margin,r=this.range;return(n=void 0===n?!1:n)&&(r.min-=i.prev,r.max+=i.next),t>=r.min&&e<=r.max},dn.focus=function(e){return this._flicking.moveTo(this._index,e)},dn.prev=function(){var e=this._index,t=this._flicking,n=t.renderer,i=n.panelCount;return 1===i?null:t.circularEnabled?n.getPanel(0===e?i-1:e-1):n.getPanel(e-1)},dn.next=function(){var e=this._index,t=this._flicking,n=t.renderer,i=n.panelCount;return 1===i?null:t.circularEnabled?n.getPanel(e===i-1?0:e+1):n.getPanel(e+1)},dn.increaseIndex=function(e){return this._index+=Math.max(e,0),this},dn.decreaseIndex=function(e){return this._index-=Math.max(e,0),this},dn.updatePosition=function(){var e=this._flicking.renderer.panels[this._index-1];return this._pos=e?e.range.max+e.margin.next+this._margin.prev:this._margin.prev,this},dn.toggle=function(e,t){var n=this._toggleDirection,i=this._togglePosition;if(n===D.NONE||t===e)return!1;var r=this._toggled;return e<t?e<=i&&i<=t&&(this._toggled=n===D.NEXT):i<=e&&t<=i&&(this._toggled=n!==D.NEXT),r!==this._toggled},dn.updateCircularToggleDirection=function(){var e=this._flicking;if(!e.circularEnabled)return this._toggleDirection=D.NONE,this._toggled=!1,this;var t=e.camera,n=t.range,i=t.alignPosition,r=t.visibleRange,o=r.max-r.min,e=n.min-i,r=n.max-i+o,r=this.includeRange(r-o,r,!1),e=this.includeRange(e,e+o,!1);return this._toggled=!1,r?(this._toggleDirection=D.PREV,this._togglePosition=this.range.max+n.min-n.max+i,this.toggle(1/0,t.position)):e?(this._toggleDirection=D.NEXT,this._togglePosition=this.range.min+n.max-o+i,this.toggle(-1/0,t.position)):(this._toggleDirection=D.NONE,this._togglePosition=0),this},dn._updateAlignPos=function(){this._alignPos=u(this._align,this._size)},dn._resetInternalStates=function(){this._size=0,this._pos=0,this._margin={prev:0,next:0},this._height=0,this._alignPos=0,this._toggled=!1,this._togglePosition=0,this._toggleDirection=D.NONE},jt=bi;function bi(e){var t=e.index,n=e.align,e=e.flicking;this._index=t,this._flicking=e,this._align=n,this._removed=!1,this._loading=!1,this._resetInternalStates()}var Ei,Pi=function(n){function e(e){var t=n.call(this,e)||this;return t._el=e.el,t._rendered=!0,t}a(e,n);var t=e.prototype;return Object.defineProperty(t,"element",{get:function(){return this._el},enumerable:!1,configurable:!0}),Object.defineProperty(t,"rendered",{get:function(){return this._rendered},enumerable:!1,configurable:!0}),t.markForShow=function(){this._rendered=!0},t.markForHide=function(){this._rendered=!1},e}(jt),Ti=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}a(t,e);var n=t.prototype;return n.render=function(){return h(this,void 0,void 0,function(){var t,n,i;return m(this,function(e){return i=_(this._flicking,"Renderer"),t=i.camera.element,n=this._panels.filter(function(e){return e.element.parentElement===t}),this._updateRenderingPanels(),i=this._getRenderingPanelsByOrder(),this._removePanelElements(n.filter(function(e){return!e.rendered})),this._insertPanelElements(i.filter(function(e){return e.element.parentElement!==t}),null),this._resetPanelElementOrder(i),[2]})})},n.forceRenderAllPanels=function(){return h(this,void 0,void 0,function(){var t,n;return m(this,function(e){return t=_(this._flicking,"Renderer"),t=t.camera,t=t.element,n=document.createDocumentFragment(),this._panels.forEach(function(e){return n.appendChild(e.element)}),this._removeAllChildsFromCamera(),t.appendChild(n),[2]})})},n._collectPanels=function(){var n=_(this._flicking,"Renderer"),t=n.camera.element;o(t.childNodes).forEach(function(e){e.nodeType===Node.TEXT_NODE&&t.removeChild(e)});var i=this._getPanelAlign(),e=o(t.children);this._panels=e.map(function(e,t){return new Pi({flicking:n,el:e,index:t,align:i})})},n._createPanel=function(e,t){return new Pi(r({el:e},t))},n._insertPanelElements=function(e,t){var n=_(this._flicking,"Renderer").camera.element,t=(null==t?void 0:t.element)||null,i=document.createDocumentFragment();return e.forEach(function(e){return i.appendChild(e.element)}),n.insertBefore(i,t),this},n._removePanelElements=function(e){var t=_(this._flicking,"Renderer").camera.element;return e.forEach(function(e){t.removeChild(e.element)}),this},n._resetPanelElementOrder=function(e){var n=_(this._flicking,"Renderer").camera.element,i=d([],f(e)).reverse();i.forEach(function(e,t){t=i[t-1],t=t?t.element:null;e.element.nextElementSibling!==t&&n.insertBefore(e.element,t)})},n._removeAllChildsFromCamera=function(){for(var e=_(this._flicking,"Renderer").camera.element;e.firstChild;)e.removeChild(e.firstChild)},n._getRenderingPanelsByOrder=function(){return _(this._flicking,"Renderer").renderer.panels.filter(function(e){return e.rendered}).sort(function(e,t){return e.position+e.offset-(t.position+t.offset)})},t}(Ln),On=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}a(t,e);var n=t.prototype;return n._insertPanelElements=function(e,t){},n._removePanelElements=function(e){},t}(Ln),dn={__proto__:null,Renderer:Ln,VanillaRenderer:Ti,ExternalRenderer:On},Oi=function(A){function e(e,t){var n=void 0===t?{}:t,i=n.align,r=void 0===i?S.CENTER:i,o=n.defaultIndex,a=void 0===o?0:o,s=n.horizontal,u=void 0===s||s,c=n.circular,l=void 0!==c&&c,h=n.bound,f=void 0!==h&&h,d=n.adaptive,p=void 0!==d&&d,g=n.panelsPerView,v=void 0===g?-1:g,m=n.noPanelStyleOverride,_=void 0!==m&&m,y=n.resizeOnContentsReady,b=void 0!==y&&y,E=n.needPanelThreshold,P=void 0===E?0:E,T=n.preventEventsBeforeInit,O=void 0===T||T,x=n.deceleration,R=void 0===x?.0075:x,w=n.duration,t=void 0===w?500:w,i=n.easing,o=void 0===i?function(e){return 1-Math.pow(1-e,3)}:i,s=n.inputType,c=void 0===s?["mouse","touch"]:s,h=n.moveType,d=void 0===h?"snap":h,g=n.threshold,m=void 0===g?40:g,y=n.interruptable,E=void 0===y||y,T=n.bounce,x=void 0===T?"20%":T,w=n.iOSEdgeSwipeThreshold,i=void 0===w?30:w,s=n.preventClickOnDrag,h=void 0===s||s,g=n.disableOnInit,y=void 0!==g&&g,T=n.renderOnlyVisible,w=void 0!==T&&T,s=n.autoInit,g=void 0===s||s,T=n.autoResize,s=void 0===T||T,T=n.renderExternal,n=void 0===T?null:T,T=A.call(this)||this;return T._initialized=!1,T._plugins=[],T._align=r,T._defaultIndex=a,T._horizontal=u,T._circular=l,T._bound=f,T._adaptive=p,T._panelsPerView=v,T._noPanelStyleOverride=_,T._resizeOnContentsReady=b,T._needPanelThreshold=P,T._preventEventsBeforeInit=O,T._deceleration=R,T._duration=t,T._easing=o,T._inputType=c,T._moveType=d,T._threshold=m,T._interruptable=E,T._bounce=x,T._iOSEdgeSwipeThreshold=i,T._preventClickOnDrag=h,T._disableOnInit=y,T._renderOnlyVisible=w,T._autoResize=s,T._autoInit=g,T._renderExternal=n,T._viewport=new V(function(e,t){var n=null;if(z(e)){t=(t||document).querySelector(e);if(!t)throw new H(C.ELEMENT_NOT_FOUND(e),I.ELEMENT_NOT_FOUND);n=t}else e&&e.nodeType===Node.ELEMENT_NODE&&(n=e);if(!n)throw new H(C.WRONG_TYPE(e,["HTMLElement","string"]),I.WRONG_TYPE);return n}(e)),T._renderer=T._createRenderer(),T._camera=T._createCamera(),T._control=T._createControl(),T.resize=T.resize.bind(T),T._autoInit&&T.init(),T}a(e,A);var t=e.prototype;return Object.defineProperty(t,"control",{get:function(){return this._control},enumerable:!1,configurable:!0}),Object.defineProperty(t,"camera",{get:function(){return this._camera},enumerable:!1,configurable:!0}),Object.defineProperty(t,"renderer",{get:function(){return this._renderer},enumerable:!1,configurable:!0}),Object.defineProperty(t,"viewport",{get:function(){return this._viewport},enumerable:!1,configurable:!0}),Object.defineProperty(t,"initialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),Object.defineProperty(t,"circularEnabled",{get:function(){return this._camera.controlParams.circular},enumerable:!1,configurable:!0}),Object.defineProperty(t,"index",{get:function(){return this._control.activeIndex},enumerable:!1,configurable:!0}),Object.defineProperty(t,"element",{get:function(){return this._viewport.element},enumerable:!1,configurable:!0}),Object.defineProperty(t,"currentPanel",{get:function(){return this._control.activePanel},enumerable:!1,configurable:!0}),Object.defineProperty(t,"panels",{get:function(){return this._renderer.panels},enumerable:!1,configurable:!0}),Object.defineProperty(t,"panelCount",{get:function(){return this._renderer.panelCount},enumerable:!1,configurable:!0}),Object.defineProperty(t,"visiblePanels",{get:function(){return this._camera.visiblePanels},enumerable:!1,configurable:!0}),Object.defineProperty(t,"animating",{get:function(){return this._control.animating},enumerable:!1,configurable:!0}),Object.defineProperty(t,"holding",{get:function(){return this._control.holding},enumerable:!1,configurable:!0}),Object.defineProperty(t,"activePlugins",{get:function(){return this._plugins},enumerable:!1,configurable:!0}),Object.defineProperty(t,"align",{get:function(){return this._align},set:function(e){this._align=e,this._renderer.align=e,this._camera.align=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultIndex",{get:function(){return this._defaultIndex},set:function(e){this._defaultIndex=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"horizontal",{get:function(){return this._horizontal},set:function(e){this._horizontal=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"circular",{get:function(){return this._circular},set:function(e){this._circular=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"bound",{get:function(){return this._bound},set:function(e){this._bound=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"adaptive",{get:function(){return this._adaptive},set:function(e){this._adaptive=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"panelsPerView",{get:function(){return this._panelsPerView},set:function(e){this._panelsPerView=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"noPanelStyleOverride",{get:function(){return this._noPanelStyleOverride},set:function(e){this._noPanelStyleOverride=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"resizeOnContentsReady",{get:function(){return this._resizeOnContentsReady},set:function(e){this._resizeOnContentsReady=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"needPanelThreshold",{get:function(){return this._needPanelThreshold},set:function(e){this._needPanelThreshold=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"preventEventsBeforeInit",{get:function(){return this._preventEventsBeforeInit},set:function(e){this._preventEventsBeforeInit=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"deceleration",{get:function(){return this._deceleration},set:function(e){this._deceleration=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"easing",{get:function(){return this._easing},set:function(e){this._easing=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"duration",{get:function(){return this._duration},set:function(e){this._duration=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"inputType",{get:function(){return this._inputType},set:function(e){this._inputType=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"moveType",{get:function(){return this._moveType},set:function(e){this._moveType=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"threshold",{get:function(){return this._threshold},set:function(e){this._threshold=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"interruptable",{get:function(){return this._interruptable},set:function(e){this._interruptable=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"bounce",{get:function(){return this._bounce},set:function(e){this._bounce=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"iOSEdgeSwipeThreshold",{get:function(){return this._iOSEdgeSwipeThreshold},set:function(e){this._iOSEdgeSwipeThreshold=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"preventClickOnDrag",{get:function(){return this._preventClickOnDrag},set:function(e){var t;e!==this._preventClickOnDrag&&(t=this._control.controller,e?t.addPreventClickHandler():t.removePreventClickHandler(),this._preventClickOnDrag=e)},enumerable:!1,configurable:!0}),Object.defineProperty(t,"disableOnInit",{get:function(){return this._disableOnInit},set:function(e){this._disableOnInit=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"renderOnlyVisible",{get:function(){return this._renderOnlyVisible},set:function(e){this._renderOnlyVisible=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"autoInit",{get:function(){return this._autoInit},enumerable:!1,configurable:!0}),Object.defineProperty(t,"autoResize",{get:function(){return this._autoResize},set:function(e){this._autoResize=e},enumerable:!1,configurable:!0}),Object.defineProperty(t,"renderExternal",{get:function(){return this._renderExternal},enumerable:!1,configurable:!0}),t.init=function(){return h(this,void 0,void 0,function(){var t,n,i,r,o,a=this;return m(this,function(e){switch(e.label){case 0:return this._initialized?[2]:(t=this._camera,n=this._renderer,i=this._control,r=this.trigger,o=this._preventEventsBeforeInit,t.init(this),n.init(this),i.init(this),o&&(this.trigger=function(){return a}),[4,this.resize()]);case 1:return e.sent(),[4,this._moveToInitialPanel()];case 2:return e.sent(),this._autoResize&&window.addEventListener("resize",this.resize),this._preventClickOnDrag&&i.controller.addPreventClickHandler(),this._disableOnInit&&this.disableInput(),n.checkPanelContentsReady(n.panels),this._plugins.forEach(function(e){return e.init(a)}),this._initialized=!0,o&&(this.trigger=r),this.trigger(new w(N.READY)),[2]}})})},t.destroy=function(){this.off(),window.removeEventListener("resize",this.resize),this._control.destroy(),this._camera.destroy(),this._renderer.destroy(),this._plugins.forEach(function(e){return e.destroy()}),this._initialized=!1},t.prev=function(e){var t;return void 0===e&&(e=this._duration),this.moveTo(null!==(t=null===(t=null===(t=this._control.activePanel)||void 0===t?void 0:t.prev())||void 0===t?void 0:t.index)&&void 0!==t?t:-1,e,D.PREV)},t.next=function(e){var t;return void 0===e&&(e=this._duration),this.moveTo(null!==(t=null===(t=null===(t=this._control.activePanel)||void 0===t?void 0:t.next())||void 0===t?void 0:t.index)&&void 0!==t?t:this._renderer.panelCount,e,D.NEXT)},t.moveTo=function(e,t,n){void 0===t&&(t=this._duration),void 0===n&&(n=D.NONE);var i=this._renderer,r=i.panelCount,i=i.getPanel(e);return i?this._control.animating?Promise.reject(new H(C.ANIMATION_ALREADY_PLAYING,I.ANIMATION_ALREADY_PLAYING)):this._control.moveToPanel(i,{duration:t,direction:n}):Promise.reject(new H(C.INDEX_OUT_OF_RANGE(e,0,r-1),I.INDEX_OUT_OF_RANGE))},t.getPanel=function(e){return this._renderer.getPanel(e)},t.enableInput=function(){return this._control.enable(),this},t.disableInput=function(){return this._control.disable(),this},t.getStatus=function(e){var t=void 0===e?{}:e,n=t.index,i=void 0===n||n,r=t.position,e=void 0===r||r,n=t.includePanelHTML,o=void 0!==n&&n,r=t.visiblePanelsOnly,n=void 0!==r&&r,t=this._camera,r={panels:(n?this.visiblePanels:this.panels).map(function(e){var t={index:e.index};return o&&(t.html=e.element.outerHTML),t})};return i&&(r.index=this.index),!e||(e=t.findNearestAnchor(t.position))&&(r.position={panel:e.panel.index,progressInPanel:t.getProgressInPanel(e.panel)}),n&&(n=this.visiblePanels,r.visibleOffset=null!==(n=null===(n=n[0])||void 0===n?void 0:n.index)&&void 0!==n?n:0),r},t.setStatus=function(e){if(!this._initialized)throw new H(C.NOT_INITIALIZED,I.NOT_INITIALIZED);var t=e.index,n=e.position,i=e.visibleOffset,r=e.panels,o=this._renderer,a=this._control;null!==(e=r[0])&&void 0!==e&&e.html&&!this._renderExternal&&(o.batchRemove({index:0,deleteCount:this.panels.length}),o.batchInsert({index:0,elements:y(r.map(function(e){return e.html}))})),t&&this.moveTo(i?t-i:t,0).catch(function(){}),n&&this._moveType===k.FREE_SCROLL&&(t=n.panel,n=n.progressInPanel,n=(t=o.panels[i?t-i:t].range).min+(t.max-t.min)*n,a.moveToPosition(n,0).catch(function(){}))},t.addPlugins=function(){for(var e,t=this,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return this._initialized&&n.forEach(function(e){return e.init(t)}),(e=this._plugins).push.apply(e,d([],f(n))),this},t.removePlugins=function(){for(var n=this,e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.forEach(function(t){var e=function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n;return-1}(n._plugins,function(e){return e===t});0<=e&&(t.destroy(),n._plugins.splice(e,1))}),this},t.resize=function(){return h(this,void 0,void 0,function(){var t,n,i,r,o,a,s,u,c;return m(this,function(e){switch(e.label){case 0:return t=this._viewport,n=this._renderer,i=this._camera,r=this._control,c=r.activePanel,o=t.width,a=t.height,s=c?i.getProgressInPanel(c):0,this.trigger(new w(N.BEFORE_RESIZE,{width:o,height:a,element:t.element})),t.resize(),[4,n.forceRenderAllPanels()];case 1:return e.sent(),n.updatePanelSize(),i.updateAlignPos(),i.updateRange(),i.updateAnchors(),[4,n.render()];case 2:return e.sent(),r.animating||(r.updatePosition(s),r.updateInput()),u=t.width,c=t.height,c=u!==o||c!==a,this.trigger(new w(N.AFTER_RESIZE,{width:t.width,height:t.height,prev:{width:o,height:a},sizeChanged:c,element:t.element})),[2]}})})},t.append=function(e){return this.insert(this._renderer.panelCount,e)},t.prepend=function(e){return this.insert(0,e)},t.insert=function(e,t){if(this._renderExternal)throw new H(C.NOT_ALLOWED_IN_FRAMEWORK,I.NOT_ALLOWED_IN_FRAMEWORK);return this._renderer.batchInsert({index:e,elements:y(t)})},t.remove=function(e,t){if(void 0===t&&(t=1),this._renderExternal)throw new H(C.NOT_ALLOWED_IN_FRAMEWORK,I.NOT_ALLOWED_IN_FRAMEWORK);return this._renderer.batchRemove({index:e,deleteCount:t})},t._createControl=function(){var e,t=this._moveType,n=Object.keys(k).map(function(e){return k[e]}),i=Array.isArray(t)?t[0]:t,r=Array.isArray(t)&&null!==(e=t[1])&&void 0!==e?e:{};if(!E(n,i))throw new H(C.WRONG_OPTION("moveType",JSON.stringify(t)),I.WRONG_OPTION);switch(i){case k.SNAP:return new Hn(r);case k.FREE_SCROLL:return new Fn(r);case k.STRICT:return new Vn(r)}},t._createCamera=function(){var e={align:this._align};return this._circular?(this._bound&&console.warn('"circular" and "bound" option cannot be used together, ignoring bound.'),new Bn(e)):new(this._bound?Un:Yn)(e)},t._createRenderer=function(){var e={align:this._align},t=this._renderExternal;return t?new t.renderer(r(r({},e),t.rendererOptions)):new Ti(e)},t._moveToInitialPanel=function(){return h(this,void 0,void 0,function(){var t,n;return m(this,function(e){return n=this._renderer,t=this._control,(n=n.getPanel(this._defaultIndex)||n.getPanel(0))?(t.setActive(n,null,!1),[2,t.moveToPanel(n,{duration:0})]):[2]})})},e.VERSION="4.3.0",e}(t),Ln=(a(xi,Ei=jt),xi);function xi(e){var t=Ei.call(this,e)||this;return t._externalComponent=e.externalComponent,t}function Ri(e,n,i,t,r){e.batchInsert.apply(e,d([],f(n.added.slice(t,r).map(function(e,t){return{index:e,elements:[i[t+n.prevList.length]]}}))))}function wi(e,t,n){n=e.panels.slice(t,n),e.batchRemove({index:t,deleteCount:n.length})}var Ai=function(e){if("number"==typeof e)return e+"px";switch(e){case S.CENTER:return"50%";case S.NEXT:return"100%";case S.PREV:return"0%";default:return e}},On={__proto__:null,withFlickingMethods:function(r,o){[t.prototype,Oi.prototype].forEach(function(n){Object.getOwnPropertyNames(n).filter(function(e){return!r[e]&&!e.startsWith("_")&&"constructor"!==e}).forEach(function(e){var t,i=Object.getOwnPropertyDescriptor(n,e);i.value?Object.defineProperty(r,e,{value:function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return(e=i.value).call.apply(e,d([this[o]],f(t)))}}):(t={},i.get&&(t.get=function(){var e;return null===(e=i.get)||void 0===e?void 0:e.call(this[o])}),i.set&&(t.set=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return null===(e=i.set)||void 0===e?void 0:e.call.apply(e,d([this[o]],f(t)))}),Object.defineProperty(r,e,t))})})},sync:function(e,n,i){var t,r,o,a,s=e.renderer,u=s.panels;0<n.removed.length&&(r=t=-1,n.removed.forEach(function(e){t<0&&(t=e),r=0<=r&&e!==r-1?(wi(s,r,t+1),t=e):e}),wi(s,r,t+1)),n.ordered.forEach(function(e){var t,n=f(e,2),i=n[0],r=n[1],e=u[i],n=r-i;0<n?(t=u.slice(i+1,r+1),e.increaseIndex(n),t.forEach(function(e){return e.decreaseIndex(1)})):(t=u.slice(r,i),e.decreaseIndex(-n),t.forEach(function(e){return e.increaseIndex(1)})),e.resize()}),0<n.ordered.length&&u.sort(function(e,t){return e.index-t.index}),0<n.added.length&&(a=o=-1,n.added.forEach(function(e,t){o<0&&(o=t),a=0<=a&&e!==a+1?(Ri(s,n,i,o,t+1),o=-1):e}),0<=o&&Ri(s,n,i,o))},getRenderingPanels:function(e,t){var n=t.removed.reduce(function(e,t){return e[t]=!0,e},{}),i=t.maintained.reduce(function(e,t){var n=f(t,2),t=n[0],n=n[1];return e[t]=n,e},{});return d(d([],f(e.panels.filter(function(e){return!n[e.index]}).sort(function(e,t){return e.position+e.offset-(t.position+t.offset)}).map(function(e){return t.list[i[e.index]]}))),f(t.added.map(function(e){return t.list[e]})))},getDefaultCameraTransform:function(e,t,n){void 0===t&&(t=!0);var i,i=(i="object"==typeof(i=e=void 0===e?S.CENTER:e)?i.camera:i,Ai(i)),e=(e="object"==typeof(e=e)?e.panel:e,j(Ai(e)));if(null==e)return"";e="calc("+i+" - ("+(n||"0px")+" * "+e.percentage+") - "+e.absolute+"px)";return t?"translate("+e+")":"translate(0, "+e+")"}};return e(Oi,{__proto__:null,Viewport:V,FlickingError:H,AnchorPoint:zn,Panel:jt,ElementPanel:Pi,ExternalPanel:Ln}),e(Oi,qn),e(Oi,q),e(Oi,dn),e(Oi,A),e(Oi,On),Oi});
10//# sourceMappingURL=flicking.pkgd.min.js.map