Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@egjs/flicking

Package Overview
Dependencies
Maintainers
8
Versions
151
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@egjs/flicking - npm Package Compare versions

Comparing version 3.5.0 to 3.5.1

doc/eg.Flicking.html

8

declaration/components/PanelManager.d.ts

@@ -38,7 +38,7 @@ import Panel from "./Panel";

findFirstPanelFrom(index: number): Panel | undefined;
private addNewClones(index, originalPanels, deleteCount, nextSibling);
private updateIndex(insertingIndex);
private insertNewPanels(newPanels, siblingElement);
private shouldRender();
private addNewClones;
private updateIndex;
private insertNewPanels;
private shouldRender;
}
export default PanelManager;

@@ -85,22 +85,22 @@ import Flicking from "../Flicking";

appendUncachedPanelElements(panels: Panel[]): void;
private updateClonePanels();
private getVisibleIndexOf(panel);
private build();
private setElements();
private applyCSSValue();
private setMoveType();
private setAxesInstance();
private refreshPanels();
private setDefaultPanel();
private clonePanels();
private moveToDefaultPanel();
private updateSize();
private updateOriginalPanelPositions();
private updateClonedPanelPositions();
private updateScrollArea();
private checkNeedPanel(axesEvent?);
private triggerNeedPanel(params);
private updateVisiblePanels();
private checkVisiblePanelChange(prevVisiblePanels, newVisiblePanels);
private resizePanels(panels);
private updateClonePanels;
private getVisibleIndexOf;
private build;
private setElements;
private applyCSSValue;
private setMoveType;
private setAxesInstance;
private refreshPanels;
private setDefaultPanel;
private clonePanels;
private moveToDefaultPanel;
private updateSize;
private updateOriginalPanelPositions;
private updateClonedPanelPositions;
private updateScrollArea;
private checkNeedPanel;
private triggerNeedPanel;
private updateVisiblePanels;
private checkVisiblePanelChange;
private resizePanels;
}

@@ -43,4 +43,4 @@ import Component from "@egjs/component";

sync(diffInfo: SyncResult): this;
private listenInput();
private listenResize();
private listenInput;
private listenResize;
private triggerEvent;

@@ -47,0 +47,0 @@ private moveCamera;

@@ -9,4 +9,4 @@ import { MoveTypeStringOption, MoveTypeContext, DestinationInfo } from "../types";

protected calcBrinkOfChange(ctx: MoveTypeContext): number;
private findRestorePanelInCircularMode(ctx);
private findRestorePanelInCircularMode;
}
export default MoveType;

@@ -9,4 +9,4 @@ import MoveType from "./MoveType";

protected findSnappedPanel(ctx: MoveTypeContext): DestinationInfo;
private findAdjacentPanel(ctx);
private findAdjacentPanel;
}
export default Snap;

@@ -7,6 +7,6 @@ import State from "./State";

readonly playing: boolean;
onHold(e: any, {viewport, triggerEvent, transitTo}: FlickingContext): void;
onChange(e: any, {moveCamera, transitTo}: FlickingContext): void;
onFinish(e: any, {flicking, viewport, triggerEvent, transitTo}: FlickingContext): void;
onHold(e: any, { viewport, triggerEvent, transitTo }: FlickingContext): void;
onChange(e: any, { moveCamera, transitTo }: FlickingContext): void;
onFinish(e: any, { flicking, viewport, triggerEvent, transitTo }: FlickingContext): void;
}
export default AnimatingState;

@@ -7,6 +7,6 @@ import State from "./State";

readonly playing: boolean;
onAnimationEnd(e: any, {transitTo}: FlickingContext): void;
onChange(e: any, {viewport, transitTo}: FlickingContext): void;
onRelease(e: any, {transitTo}: FlickingContext): void;
onAnimationEnd(e: any, { transitTo }: FlickingContext): void;
onChange(e: any, { viewport, transitTo }: FlickingContext): void;
onRelease(e: any, { transitTo }: FlickingContext): void;
}
export default DisabledState;

@@ -7,5 +7,5 @@ import State from "./State";

readonly playing: boolean;
onChange(e: any, {moveCamera, transitTo}: FlickingContext): void;
onChange(e: any, { moveCamera, transitTo }: FlickingContext): void;
onRelease(e: any, context: FlickingContext): void;
}
export default DraggingState;

@@ -10,4 +10,4 @@ import State from "./State";

onRelease(e: any, context: FlickingContext): void;
onFinish(e: any, {viewport, triggerEvent, transitTo}: FlickingContext): void;
onFinish(e: any, { viewport, triggerEvent, transitTo }: FlickingContext): void;
}
export default HoldingState;

@@ -8,5 +8,5 @@ import State from "./State";

onEnter(): void;
onHold(e: any, {flicking, viewport, triggerEvent, transitTo}: FlickingContext): void;
onHold(e: any, { flicking, viewport, triggerEvent, transitTo }: FlickingContext): void;
onChange(e: any, context: FlickingContext): void;
}
export default IdleState;

@@ -8,5 +8,5 @@ import Panel from "../components/Panel";

lastPosition: number;
readonly abstract type: ValueOf<StateType>;
readonly abstract holding: boolean;
readonly abstract playing: boolean;
abstract readonly type: ValueOf<StateType>;
abstract readonly holding: boolean;
abstract readonly playing: boolean;
onEnter(prevState: State): void;

@@ -13,0 +13,0 @@ onExit(nextState: State): void;

@@ -7,5 +7,5 @@ /*

repository: https://github.com/naver/egjs-flicking
version: 3.5.0
version: 3.5.1
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@egjs/component"),require("@egjs/axes")):"function"==typeof define&&define.amd?define(["@egjs/component","@egjs/axes"],t):((e=e||self).eg=e.eg||{},e.eg.Flicking=t(e.eg.Component,e.eg.Axes))}(this,function(e,r){"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)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function a(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var l={SNAP:"snap",FREE_SCROLL:"freeScroll"},o={snap:{type:"snap",count:1},freeScroll:{type:"freeScroll"}},s="undefined"!=typeof document,v={classPrefix:"eg-flick",deceleration:.0075,horizontal:!0,circular:!1,infinite:!1,infiniteThreshold:0,lastIndex:1/0,threshold:40,duration:100,panelEffect:function(e){return 1-Math.pow(1-e,3)},defaultIndex:0,inputType:["touch","mouse"],thresholdAngle:45,bounce:10,autoResize:!1,adaptive:!1,zIndex:2e3,bound:!1,overflow:!1,hanger:"50%",anchor:"50%",gap:0,moveType:o.snap,useOffset:!1,isEqualSize:!1,isConstantSize:!1,renderOnlyVisible:!1,renderExternal:!1,iOSEdgeSwipeThreshold:30,collectStatistics:!0},h={position:"relative",zIndex:v.zIndex,overflow:"hidden"},c={width:"100%",height:"100%",willChange:"transform"},u={position:"absolute"},A={HOLD_START:"holdStart",HOLD_END:"holdEnd",MOVE_START:"moveStart",MOVE:"move",MOVE_END:"moveEnd",CHANGE:"change",RESTORE:"restore",SELECT:"select",NEED_PANEL:"needPanel",VISIBLE_CHANGE:"visibleChange"},f={HOLD:"hold",CHANGE:"change",RELEASE:"release",ANIMATION_END:"animationEnd",FINISH:"finish"},w=0,g=1,p=2,M=3,z=4,T={PREV:"PREV",NEXT:"NEXT"},t={prev:!0,next:!0,moveTo:!0,getIndex:!0,getAllPanels:!0,getCurrentPanel:!0,getElement:!0,getPanel:!0,getPanelCount:!0,getStatus:!0,getVisiblePanels:!0,enableInput:!0,disableInput:!0,destroy:!0,resize:!0,setStatus:!0,isPlaying:!0},d=function(){var e={webkitTransform:"-webkit-transform",msTransform:"-ms-transform",MozTransform:"-moz-transform",OTransform:"-o-transform",transform:"transform"};if(!s)return{name:e.transform,has3d:!0};var t=document.documentElement.style,n="";for(var i in e)i in t&&(n=i);if(!n)throw new Error("Browser doesn't support CSS3 2D Transforms.");var r=document.createElement("div");document.documentElement.insertBefore(r,null),r.style[n]="translate3d(1px, 1px, 1px)";var a=window.getComputedStyle(r).getPropertyValue(e[n]);r.parentElement.removeChild(r);var o={name:n,has3d:0<a.length&&"none"!==a};return d=function(){return o},o},P=d();function m(i){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return e.forEach(function(n){Object.keys(n).forEach(function(e){var t=n[e];i[e]=t})}),i}function x(e){Array.isArray(e)||(e=[e]);var n=[];return e.forEach(function(e){if(E(e)){var t=document.createElement("div");for(t.innerHTML=e,n.push.apply(n,y(t.children));t.firstChild;)t.removeChild(t.firstChild)}else n.push(e)}),n}function E(e){return"string"==typeof e}function C(e,t){return e.classList?e.classList.contains(t):0<=e.className.split(" ").indexOf(t)}function S(t,n){Object.keys(n).forEach(function(e){t.style[e]=n[e]})}function I(e,t,n){return Math.max(Math.min(e,n),t)}function b(e,t,n){return t<=e&&e<=n}function y(e){return[].slice.call(e)}function N(e,t,n){var i=null!=n?n:t/2,r=/(?:(\+|\-)\s*)?(\d+(?:\.\d+)?(%|px)?)/g;if("number"==typeof e)return I(e,0,t);for(var a=0,o=0,s=r.exec(e);null!=s;){var l=s[1],h=s[2],c=s[3],u=parseFloat(h);if(a<=0&&(l=l||"+"),!l)return i;"%"===c&&(u=u/100*t),o+="+"===l?u:-u,++a,s=r.exec(e)}return 0===a?i:I(o,0,t)}function R(e,t){var n=t[0],i=t[1],r=t[2];return i<e&&r-i?(e-i)/(r-i):e<i&&i-n?(e-i)/(i-n):e!==i&&r-n?(e-n)/(r-n):0}function O(e,t){for(var n=0;n<e.length;n+=1){var i=e[n];if(i&&t(i))return n}return-1}function k(e){for(var t=[],n=0;n<e;n+=1)t[n]=n;return t}function B(e,t,n,i){var r=i?n-t+1:n-t;if(e<t)e=n-(i?(t-e-1)%r:(t-e)%r);else if(n<e){e=t+(i?(e-n-1)%r:(e-n)%r)}return e}function V(e,t){t.className?e.setAttribute("class",t.className):e.removeAttribute("class"),t.style?e.setAttribute("style",t.style):e.removeAttribute("style")}function H(e,t){var n;if(t)n={x:0,y:0,width:e.offsetWidth,height:e.offsetHeight};else{var i=e.getBoundingClientRect();n={x:i.left,y:i.top,width:i.width,height:i.height}}return n}var L=function(){function l(e,t,n){this.viewport=n,this.prevSibling=null,this.nextSibling=null,this.clonedPanels=[],this.state={index:t,position:0,relativeAnchorPosition:0,size:0,isClone:!1,isVirtual:!1,cloneIndex:-1,originalStyle:{className:"",style:""},cachedBbox:null},this.setElement(e)}var e=l.prototype;return e.resize=function(e){var n=this.state,t=this.viewport.options,i=e||this.getBbox();this.state.cachedBbox=i;var r=n.size;n.size=t.horizontal?i.width:i.height,r!==n.size&&(n.relativeAnchorPosition=N(t.anchor,n.size)),n.isClone||this.clonedPanels.forEach(function(e){var t=e.state;t.size=n.size,t.cachedBbox=n.cachedBbox,t.relativeAnchorPosition=n.relativeAnchorPosition})},e.unCacheBbox=function(){this.state.cachedBbox=null},e.getProgress=function(){var e=this.viewport,t=e.options,n=e.panelManager.getPanelCount(),i=e.getScrollAreaSize();return(t.circular?Math.floor(this.getPosition()/i)*n:0)+this.getIndex()-e.getCurrentProgress()},e.getOutsetProgress=function(){var e=this.viewport,t=[-this.getSize(),e.getRelativeHangerPosition()-this.getRelativeAnchorPosition(),e.getSize()];return R(this.getPosition()-e.getCameraPosition(),t)},e.getVisibleRatio=function(){var e=this.viewport,t=this.getSize(),n=this.getPosition()-e.getCameraPosition(),i=n+t,r=Math.min(e.getSize(),i)-Math.max(n,0);return 0<=r?r/t:0},e.focus=function(e){var t=this.viewport,n=t.getCurrentPanel();if(t.getHangerPosition()!==this.getAnchorPosition()&&n){var i=n.getPosition()===this.getPosition()?"":A.CHANGE;t.moveTo(this,t.findEstimatedPosition(this),i,null,e)}},e.update=function(t,e){void 0===t&&(t=null),void 0===e&&(e=!0);var n=this.getIdenticalPanels();t&&n.forEach(function(e){t(e.getElement())}),e&&(n.forEach(function(e){e.unCacheBbox()}),this.viewport.addVisiblePanel(this),this.viewport.resize())},e.prev=function(){var e=this.viewport.options,t=this.prevSibling;if(!t)return null;var n=this.getIndex(),i=this.getPosition(),r=t.getIndex(),a=t.getPosition(),o=t.getSize(),s=1<n-r,l=e.infinite&&0<n&&n<r;if(s||l)return null;var h=i-o-e.gap,c=t;return a!==h&&(c=t.clone(t.getCloneIndex(),!0)).setPosition(h),c},e.next=function(){var e=this.viewport,t=e.options,n=this.nextSibling,i=e.panelManager.getLastIndex();if(!n)return null;var r=this.getIndex(),a=this.getPosition(),o=n.getIndex(),s=n.getPosition(),l=1<o-r,h=t.infinite&&r<i&&o<r;if(l||h)return null;var c=a+this.getSize()+t.gap,u=n;return s!==c&&(u=n.clone(n.getCloneIndex(),!0)).setPosition(c),u},e.insertBefore=function(e){var t=this.viewport,n=x(e),i=t.panelManager.firstPanel(),r=this.prevSibling,a=r&&i.getIndex()!==this.getIndex()?Math.max(r.getIndex()+1,this.getIndex()-n.length):Math.max(this.getIndex()-n.length,0);return t.insert(a,n)},e.insertAfter=function(e){return this.viewport.insert(this.getIndex()+1,e)},e.remove=function(){return this.viewport.remove(this.getIndex()),this},e.destroy=function(e){if(!e.preserveUI){var t=this.state.originalStyle;V(this.element,t)}for(var n in this)this[n]=null},e.getElement=function(){return this.element},e.getAnchorPosition=function(){return this.state.position+this.state.relativeAnchorPosition},e.getRelativeAnchorPosition=function(){return this.state.relativeAnchorPosition},e.getIndex=function(){return this.state.index},e.getPosition=function(){return this.state.position},e.getSize=function(){return this.state.size},e.getBbox=function(){var e=this.state,t=this.viewport,n=this.element,i=t.options;if(n){if(!e.cachedBbox){var r=Boolean(n.parentNode),a=t.getCameraElement();r||(a.appendChild(n),t.addVisiblePanel(this)),e.cachedBbox=H(n,i.useOffset),!r&&t.options.renderExternal&&a.removeChild(n)}}else e.cachedBbox={x:0,y:0,width:0,height:0};return e.cachedBbox},e.isClone=function(){return this.state.isClone},e.getOverlappedClass=function(e){for(var t=this.element,n=0,i=e;n<i.length;n++){var r=i[n];if(C(t,r))return r}},e.getCloneIndex=function(){return this.state.cloneIndex},e.getClonedPanels=function(){return this.state.isClone?this.original.getClonedPanels():this.clonedPanels},e.getIdenticalPanels=function(){return this.state.isClone?this.original.getIdenticalPanels():[this].concat(this.clonedPanels)},e.getOriginalPanel=function(){return this.state.isClone?this.original:this},e.setIndex=function(t){this.state.index=t,this.clonedPanels.forEach(function(e){return e.state.index=t})},e.setPosition=function(e){return this.state.position=e,this},e.setPositionCSS=function(e){if(void 0===e&&(e=0),this.element){var t=this.state,n=t.position,i=this.viewport.options,r=this.element.style,a=i.horizontal?r.left:r.top,o=n-e+"px";t.isVirtual||a===o||(i.horizontal?r.left=o:r.top=o)}},e.clone=function(e,t,n){void 0===t&&(t=!1);var i=this.state,r=this.viewport,a=n;!a&&this.element&&(a=t?this.element:this.element.cloneNode(!0));var o=new l(a,i.index,r),s=o.state;return o.original=i.isClone?this.original:this,s.isClone=!0,s.isVirtual=t,s.cloneIndex=e,s.size=i.size,s.relativeAnchorPosition=i.relativeAnchorPosition,s.originalStyle=i.originalStyle,s.cachedBbox=i.cachedBbox,t?(o.prevSibling=this.prevSibling,o.nextSibling=this.nextSibling):this.clonedPanels.push(o),o},e.removeElement=function(){if(!this.viewport.options.renderExternal){var e=this.element;e.parentNode&&e.parentNode.removeChild(e)}this.state.isClone||this.removeClonedPanelsAfter(0)},e.removeClonedPanelsAfter=function(e){var t=this.viewport.options,n=this.clonedPanels.splice(e);t.renderExternal||n.forEach(function(e){e.removeElement()})},e.setElement=function(e){if(e){var t,n,i=this.element;if(e!==i){var r=this.viewport.options;if(i)r.horizontal?e.style.left=i.style.left:e.style.top=i.style.top;else{var a=this.state.originalStyle;a.className=e.getAttribute("class"),a.style=e.getAttribute("style")}this.element=e,r.classPrefix&&(t=e,n=r.classPrefix+"-panel",t.classList?t.classList.add(n):C(t,n)||(t.className=(t.className+" "+n).replace(/\s{2,}/g," "))),S(this.element,u)}}},l}(),D=function(){function e(e,t){this.cameraElement=e,this.panels=[],this.clones=[],this.range={min:-1,max:-1},this.length=0,this.cloneCount=0,this.options=t,this.lastIndex=t.lastIndex}var t=e.prototype;return t.firstPanel=function(){return this.panels[this.range.min]},t.lastPanel=function(){return this.panels[this.range.max]},t.allPanels=function(){return this.panels.concat(this.clones.reduce(function(e,t){return e.concat(t)},[]))},t.originalPanels=function(){return this.panels},t.clonedPanels=function(){return this.clones},t.replacePanels=function(e,t){this.panels=e,this.clones=t,this.range={min:O(e,function(e){return Boolean(e)}),max:e.length-1},this.length=e.filter(function(e){return Boolean(e)}).length},t.has=function(e){return!!this.panels[e]},t.get=function(e){return this.panels[e]},t.getPanelCount=function(){return this.length},t.getLastIndex=function(){return this.lastIndex},t.getRange=function(){return this.range},t.getCloneCount=function(){return this.cloneCount},t.setLastIndex=function(e){this.lastIndex=e;var t=this.firstPanel(),n=this.lastPanel();if(t&&n){var i=this.range;if(n.getIndex()>e){var r=this.panels.splice(e+1);this.length-=r.length;var a=r.filter(function(e){return!!e})[0].prevSibling;i.max=a?a.getIndex():i.min=-1,this.shouldRender()&&r.forEach(function(e){return e.removeElement()})}}},t.setCloneCount=function(e){this.cloneCount=e},t.insert=function(n,e){var i=this.panels,t=this.range,r=this.options.circular,a=this.lastIndex,o=this.findFirstPanelFrom(n),s=this.firstPanel(),l=o?o.getElement():r&&s?s.getClonedPanels()[0].getElement():null;this.insertNewPanels(e,l);var h=e.length;if(n>t.max)e.forEach(function(e,t){i[n+t]=e});else{var c=i.slice(n,n+e.length),u=O(c,function(e){return!!e});if(u<0&&(u=c.length),h=e.length-u,i.splice.apply(i,[n,u].concat(e)),i.length>a+1){var g=i.splice(a+1).filter(function(e){return Boolean(e)});this.length-=g.length;var f=a-O(this.panels.concat().reverse(),function(e){return!!e});this.panels.splice(f+1),this.range.max=f,this.shouldRender()&&g.forEach(function(e){return e.removeElement()})}}if(0<h&&i.slice(n+e.length).forEach(function(e){e.setIndex(e.getIndex()+h)}),this.length+=e.length,this.updateIndex(n),r){this.addNewClones(n,e,e.length-h,o);var d=this.clones,p=this.panels.length;d[0]&&d[0].length>a+1&&d.forEach(function(e){e.splice(p)})}return h},t.replace=function(e,t){var n=this.panels,i=this.range,r=this.options.circular,a=this.findFirstPanelFrom(e+t.length),o=this.firstPanel(),s=a?a.getElement():r&&o?o.getClonedPanels()[0].getElement():null;this.insertNewPanels(t,s),e>i.max&&(n[e]=null);var l=n.splice.apply(n,[e,t.length].concat(t)),h=l.filter(function(e){return Boolean(e)}).length;return this.length+=t.length-h,this.updateIndex(e),r&&this.addNewClones(e,t,t.length,a),this.shouldRender()&&l.forEach(function(e){return e&&e.removeElement()}),l},t.remove=function(t,n){void 0===n&&(n=1);var e=this.options.circular,i=this.panels,r=this.clones;n=Math.max(n,0);var a=i.splice(t,n).filter(function(e){return!!e});this.shouldRender()&&a.forEach(function(e){return e.removeElement()}),e&&r.forEach(function(e){e.splice(t,n)}),i.slice(t).forEach(function(e){e.setIndex(e.getIndex()-n)});var o=i.length-1;if(!i[o]){var s=O(i.concat().reverse(),function(e){return!!e});o=s<0?-1:o-s,i.splice(o+1),e&&r.forEach(function(e){e.splice(o+1)})}return this.range={min:O(i,function(e){return!!e}),max:o},this.length-=a.length,this.length<=0&&(this.clones=[],this.cloneCount=0),a},t.chainAllPanels=function(){var r=this.allPanels().filter(function(e){return!!e}),e=r.length;if(!(e<=1)){r.slice(1,r.length-1).forEach(function(e,t){var n=r[t],i=r[t+2];e.prevSibling=n,e.nextSibling=i});var t=r[0],n=r[e-1];t.prevSibling=null,t.nextSibling=r[1],n.prevSibling=r[e-2],n.nextSibling=null,this.options.circular&&((t.prevSibling=n).nextSibling=t)}},t.insertClones=function(e,n,t,i){void 0===i&&(i=0);var r=this.clones,a=this.lastIndex;if(r[e]){var o=r[e];n>=o.length?t.forEach(function(e,t){o[n+t]=e}):(o.splice.apply(o,[n,i].concat(t)),t.length>a+1&&t.splice(a+1))}else{var s=[];t.forEach(function(e,t){s[n+t]=e}),r[e]=s}},t.removeClonesAfter=function(t){this.panels.forEach(function(e){e.removeClonedPanelsAfter(t)}),this.clones.splice(t)},t.findPanelOf=function(e){for(var t=0,n=this.allPanels();t<n.length;t++){var i=n[t];if(i)if(i.getElement().contains(e))return i}},t.findFirstPanelFrom=function(e){for(var t=0,n=this.panels.slice(e);t<n.length;t++){var i=n[t];if(i&&i.getIndex()>=e&&i.getElement().parentNode)return i}},t.addNewClones=function(a,o,s,e){for(var l=this,h=this.cameraElement,t=this.getCloneCount(),n=this.lastPanel(),c=n?n.getClonedPanels():[],u=e?e.getClonedPanels():[],i=function(n){var e=u[n],t=c[n],i=e?e.getElement():t?t.getElement().nextElementSibling:null,r=o.map(function(e){var t=e.clone(n);return l.shouldRender()&&h.insertBefore(t.getElement(),i),t});g.insertClones(n,a,r,s)},g=this,r=0,f=k(t);r<f.length;r++){i(f[r])}},t.updateIndex=function(e){var t=this.panels,n=this.range,i=t.length-1;i>n.max&&(n.max=i),(e<n.min||n.min<0)&&(n.min=e)},t.insertNewPanels=function(e,t){if(this.shouldRender()){var n=document.createDocumentFragment();e.forEach(function(e){return n.appendChild(e.getElement())}),this.cameraElement.insertBefore(n,t)}},t.shouldRender=function(){var e=this.options;return!e.renderExternal&&!e.renderOnlyVisible},e}(),n=function(){function e(){this.delta=0,this.direction=null,this.targetPanel=null,this.lastPosition=0}var t=e.prototype;return t.onEnter=function(e){this.delta=e.delta,this.direction=e.direction,this.targetPanel=e.targetPanel,this.lastPosition=e.lastPosition},t.onExit=function(e){},t.onHold=function(e,t){},t.onChange=function(e,t){},t.onRelease=function(e,t){},t.onAnimationEnd=function(e,t){},t.onFinish=function(e,t){},e}(),_=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=w,e.holding=!1,e.playing=!1,e}a(e,t);var n=e.prototype;return n.onEnter=function(){this.direction=null,this.targetPanel=null,this.delta=0,this.lastPosition=0},n.onHold=function(e,t){var n=t.flicking,i=t.viewport,r=t.triggerEvent,a=t.transitTo;if(n.getPanelCount()<=0)return i.options.infinite&&i.moveCamera(i.getCameraPosition(),e),void a(z);this.lastPosition=i.getCameraPosition(),r(A.HOLD_START,e,!0).onSuccess(function(){a(g)}).onStopped(function(){a(z)})},n.onChange=function(e,t){var n=t.triggerEvent,i=t.transitTo;n(A.MOVE_START,e,!1).onSuccess(function(){i(M).onChange(e,t)}).onStopped(function(){i(z)})},e}(n),F=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=g,e.holding=!0,e.playing=!0,e.releaseEvent=null,e}a(e,t);var n=e.prototype;return n.onChange=function(e,t){var n=t.flicking,i=t.triggerEvent,r=t.transitTo,a=n.options.horizontal?e.inputEvent.offsetX:e.inputEvent.offsetY;this.direction=a<0?T.NEXT:T.PREV,i(A.MOVE_START,e,!0).onSuccess(function(){r(p).onChange(e,t)}).onStopped(function(){r(z)})},n.onRelease=function(e,t){var n=t.viewport,i=t.triggerEvent,r=t.transitTo;if(i(A.HOLD_END,e,!0),0!==e.delta.flick)return e.setTo({flick:n.getCameraPosition()},0),void r(w);this.releaseEvent=e},n.onFinish=function(e,t){var n=t.viewport,i=t.triggerEvent;if((0,t.transitTo)(w),this.releaseEvent){var r,a=this.releaseEvent.inputEvent.srcEvent;if("touchend"===a.type){var o=a.changedTouches[0];r=document.elementFromPoint(o.clientX,o.clientY)}else r=a.target;var s=n.panelManager.findPanelOf(r),l=n.getCameraPosition();if(s){var h=s.getPosition();i(A.SELECT,null,!0,{direction:l<h?T.NEXT:h<l?T.PREV:null,index:s.getIndex(),panel:s})}}},e}(n),G=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=p,e.holding=!0,e.playing=!0,e}a(e,t);var n=e.prototype;return n.onChange=function(e,t){var n=t.moveCamera,i=t.transitTo;e.delta.flick&&n(e).onStopped(function(){i(z)})},n.onRelease=function(e,t){var n=t.flicking,i=t.viewport,r=t.triggerEvent,a=t.transitTo,o=t.stopCamera,s=this.delta,l=Math.abs(s),h=n.options,c=h.horizontal,u=i.moveType,g=e.inputEvent,f=c?g.velocityX:g.velocityY,d=c?g.deltaX:g.deltaY,p=1<Math.abs(f)?f<0:0<l?0<s:d<0,v=i.options.bound?Math.max(l,Math.abs(d)):l,P=g.deltaX?Math.abs(180*Math.atan(g.deltaY/g.deltaX)/Math.PI):90,m=c?P<=h.thresholdAngle:P>h.thresholdAngle,x=v>=h.threshold&&m,E={viewport:i,axesEvent:e,state:this,swipeDistance:v,isNextDirection:p};r(A.HOLD_END,e,!0);var C=this.targetPanel;if(!x&&C){var S=u.findPanelWhenInterrupted(E);return i.moveTo(S.panel,S.destPos,S.eventType,e,S.duration),void a(M)}var b=i.getCurrentPanel(),I=i.getNearestPanel();if(!b||!I)return e.stop(),void a(w);var y=x?u.findTargetPanel(E):u.findRestorePanel(E);i.moveTo(y.panel,y.destPos,y.eventType,e,y.duration).onSuccess(function(){a(M)}).onStopped(function(){a(z),o(e)})},e}(n),X=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=M,e.holding=!1,e.playing=!0,e}a(e,t);var n=e.prototype;return n.onHold=function(e,t){var n=t.viewport,i=t.triggerEvent,r=t.transitTo,a=n.options,o=n.getScrollArea(),s=n.getScrollAreaSize(),l=Math.floor((this.lastPosition+this.delta-o.prev)/s),h=this.targetPanel;if(a.circular&&0!==l&&h){var c=n.panelManager.getCloneCount(),u=h.getPosition(),g=B(h.getCloneIndex()-l,-1,c-1,!0),f=u-l*s,d=h.getIdenticalPanels()[g+1].clone(g,!0);d.setPosition(f),this.targetPanel=d}this.delta=0,this.lastPosition=n.getCameraPosition(),n.setCurrentPanel(n.getNearestPanel()),i(A.HOLD_START,e,!0).onSuccess(function(){r(p)}).onStopped(function(){r(z)})},n.onChange=function(e,t){var n=t.moveCamera,i=t.transitTo;e.delta.flick&&n(e).onStopped(function(){i(z)})},n.onFinish=function(e,t){var n=t.flicking,i=t.viewport,r=t.triggerEvent,a=t.transitTo,o=e&&e.isTrusted;i.options.bound?i.setCurrentPanel(this.targetPanel):i.setCurrentPanel(i.getNearestPanel()),n.options.adaptive&&i.updateAdaptiveSize(),a(w),i.updateCameraPosition(),r(A.MOVE_END,e,o,{direction:this.direction})},e}(n),j=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=z,e.holding=!1,e.playing=!0,e}a(e,t);var n=e.prototype;return n.onAnimationEnd=function(e,t){(0,t.transitTo)(w)},n.onChange=function(e,t){var n=t.viewport,i=t.transitTo;e.stop(),n.updateAxesPosition(n.getCameraPosition()),i(w)},n.onRelease=function(e,t){var n=t.transitTo;0===e.delta.flick&&n(w)},e}(n),q=function(){function e(){var i=this;this.state=new _,this.transitTo=function(e){var t=i.state;if(t.type!==e){var n=void 0;switch(e){case w:n=new _;break;case g:n=new F;break;case p:n=new G;break;case M:n=new X;break;case z:n=new j}t.onExit(n),n.onEnter(t),i.state=n}return i.state}}var t=e.prototype;return t.fire=function(e,t,n){var i=this.state;switch(e){case f.HOLD:i.onHold(t,n);break;case f.CHANGE:i.onChange(t,n);break;case f.RELEASE:i.onRelease(t,n);break;case f.ANIMATION_END:i.onAnimationEnd(t,n);break;case f.FINISH:i.onFinish(t,n)}},t.getState=function(){return this.state},e}(),Y=function(n){function e(e){var t=n.call(this)||this;return t.type=l.SNAP,t.count=e,t}a(e,n);var t=e.prototype;return t.findTargetPanel=function(e){var t=e.viewport,n=e.axesEvent,i=e.swipeDistance,r=this.count,a=Math.abs(n.delta.flick),o=t.getCurrentPanel(),s=t.getNearestPanel(),l=this.calcBrinkOfChange(e),h=s.getIndex()===o.getIndex(),c=t.canSetBoundMode()&&h,u=!t.isOutOfBound()&&(i<=l||c);return 1<r&&l<a?this.findSnappedPanel(e):u?this.findAdjacentPanel(e):{panel:s,duration:t.options.duration,destPos:t.findEstimatedPosition(s),eventType:i<=l||t.isOutOfBound()&&h?A.RESTORE:A.CHANGE}},t.findSnappedPanel=function(e){for(var t=e.axesEvent,n=e.viewport,i=e.state,r=e.isNextDirection,a=Math.abs(t.delta.flick),o=this.calcBrinkOfChange(e),s=this.count,l=n.options,h=n.getScrollAreaSize(),c=l.gap/2,u=t.destPos.flick+n.getRelativeHangerPosition(),g=n.getNearestPanel(),f=g.getCloneIndex()+1,d=0;d<s;){var p=g.getOriginalPanel(),v=p.getPosition()+f*h,P=p.getSize();if(r&&u<v+P+c||!r&&v-c<u)break;var m=r?g.nextSibling:g.prevSibling;if(!m)break;var x=g.getIndex(),E=m.getIndex();(r&&E<=x||!r&&x<=E)&&(f=r?f+1:f-1),g=m,d+=1}var C=g.getOriginalPanel().getPosition();0!==f&&(g=g.clone(g.getCloneIndex(),!0)).setPosition(C+f*h);var S=n.options.duration,b=I(t.duration,S,S*d);return{panel:g,destPos:n.findEstimatedPosition(g),duration:b,eventType:Math.max(a,i.delta)>o?A.CHANGE:A.RESTORE}},t.findAdjacentPanel=function(e){var t=e.viewport,n=e.isNextDirection,i=t.options,r=t.getCurrentIndex(),a=t.panelManager.get(r),o=t.getHangerPosition(),s=t.getScrollArea(),l=a.getIdenticalPanels()[1],h=i.circular&&Math.abs(a.getAnchorPosition()-o)>Math.abs(l.getAnchorPosition()-o)?l:a,c=h.getPosition(),u=n?h.nextSibling:h.prevSibling,g=u?A.CHANGE:A.RESTORE,f=u||h,d=f.getRelativeAnchorPosition(),p=(i.circular?n?c+h.getSize()+d+i.gap:c-(f.getSize()-d)-i.gap:f.getAnchorPosition())-t.getRelativeHangerPosition();return{panel:f,destPos:t.canSetBoundMode()?I(p,s.prev,s.next):p,duration:i.duration,eventType:g}},e}(function(){function e(){}var t=e.prototype;return t.is=function(e){return e===this.type},t.findRestorePanel=function(e){var t=e.viewport,n=t.options,i=n.circular?this.findRestorePanelInCircularMode(e):t.getCurrentPanel();return{panel:i,destPos:t.findEstimatedPosition(i),duration:n.duration,eventType:A.RESTORE}},t.findPanelWhenInterrupted=function(e){var t=e.state,n=e.viewport,i=t.targetPanel;return{panel:i,destPos:n.findEstimatedPosition(i),duration:n.options.duration,eventType:""}},t.calcBrinkOfChange=function(e){var t=e.viewport,n=e.isNextDirection,i=t.options,r=t.getCurrentPanel(),a=i.gap/2,o=r.getRelativeAnchorPosition(),s=n?r.getSize()-o+a:o+a;return s=Math.max(s,i.threshold)},t.findRestorePanelInCircularMode=function(e){var t=e.viewport,n=t.getCurrentPanel().getOriginalPanel(),i=t.getHangerPosition(),r=n.getIdenticalPanels()[1],a=Math.abs(n.getAnchorPosition()-i)>Math.abs(r.getAnchorPosition()-i);return!e.isNextDirection&&a?r:n},e}()),U=function(u){function e(){var e=u.call(this,1/0)||this;return e.type=l.FREE_SCROLL,e}a(e,u);var t=e.prototype;return t.findTargetPanel=function(e){var t=e.axesEvent,n=e.state,i=e.viewport,r=t.destPos.flick,a=this.calcBrinkOfChange(e),o=i.getScrollArea(),s=i.getCurrentPanel(),l=i.options;if(a<Math.abs(t.delta.flick+n.delta)){var h=u.prototype.findSnappedPanel.call(this,e);return h.duration=t.duration,h.destPos=r,h.eventType=l.circular||h.panel!==s?A.CHANGE:"",h}var c=l.circular?B(r,o.prev,o.next,!1):r;return c=I(c,o.prev,o.next),c+=i.getRelativeHangerPosition(),{panel:i.findNearestPanelAt(c),destPos:r,duration:t.duration,eventType:""}},t.findRestorePanel=function(e){return this.findTargetPanel(e)},t.findPanelWhenInterrupted=function(e){var t=e.viewport;return{panel:t.getNearestPanel(),destPos:t.getCameraPosition(),duration:0,eventType:""}},t.calcBrinkOfChange=function(e){var t=e.viewport,n=e.isNextDirection,i=t.options,r=t.getCurrentPanel(),a=i.gap/2,o=t.stateMachine.getState().lastPosition,s=r.getPosition(),l=o+t.getRelativeHangerPosition(),h=t.getScrollAreaSize(),c=n?s+r.getSize()-l+a:l-s+a;return c=Math.abs(c%h),Math.min(c,h-c)},e}(Y),W=function(){function e(e,t,n){var i=this;this.plugins=[],this.stopCamera=function(e){e&&e.setTo&&e.setTo({flick:i.state.position},0),i.stateMachine.transitTo(w)},this.flicking=e,this.triggerEvent=n,this.state={size:0,position:0,panelMaintainRatio:0,relativeHangerPosition:0,positionOffset:0,scrollArea:{prev:0,next:0},translate:P,infiniteThreshold:0,checkedIndexes:[],isAdaptiveCached:!1,isViewportGiven:!1,isCameraGiven:!1,originalViewportStyle:{className:null,style:null},originalCameraStyle:{className:null,style:null},cachedBbox:null},this.options=t,this.stateMachine=new q,this.visiblePanels=[],this.panelBboxes={},this.build()}var t=e.prototype;return t.moveTo=function(e,t,n,i,r){var a=this;void 0===r&&(r=this.options.duration);var o,s=this.state,l=this.stateMachine.getState(),h=s.position,c=!!i&&i.isTrusted,u=t===h?null:h<t?T.NEXT:T.PREV;return(o=n===A.CHANGE?this.triggerEvent(A.CHANGE,i,c,{index:e.getIndex(),panel:e,direction:u}):n===A.RESTORE?this.triggerEvent(A.RESTORE,i,c):{onSuccess:function(e){return e(),this},onStopped:function(){return this}}).onSuccess(function(){l.delta=0,l.lastPosition=a.getCameraPosition(),l.targetPanel=e,l.direction=t===h?null:h<t?T.NEXT:T.PREV,t===h&&(a.nearestPanel=e,a.currentPanel=e),i&&i.setTo?i.setTo({flick:t},r):a.axes.setTo({flick:t},r)}),o},t.moveCamera=function(e,t){var n=this.state,i=this.options,r=n.translate.name,a=n.scrollArea;i.circular&&!b(e,a.prev,a.next)&&(e=B(e,a.prev,a.next,!1)),n.position=e,this.nearestPanel=this.findNearestPanel();var o=this.nearestPanel,s=o?o.getPosition():0;if(o){var l=this.getHangerPosition(),h=o.getPosition(),c=o.getSize(),u=i.gap/2;n.panelMaintainRatio=(l-h+u)/(c+2*u)}else n.panelMaintainRatio=0;this.checkNeedPanel(t),e+=(o?o.getPosition():0)-s,n.position=e,this.updateVisiblePanels();var g=i.renderOnlyVisible?n.positionOffset:0,f=(i.horizontal?[-(e-g),0]:[0,-(e-g)]).map(function(e){return Math.round(e)+"px"}).join(", ");this.cameraElement.style[r]=n.translate.has3d?"translate3d("+f+", 0px)":"translate("+f+")"},t.unCacheBbox=function(){var e=this.state,t=this.options;e.cachedBbox=null,this.visiblePanels=[];var n=this.viewportElement;t.horizontal?n.style.height="":n.style.width="",e.isAdaptiveCached=!1,this.panelBboxes={}},t.resize=function(){this.updateSize(),this.updateOriginalPanelPositions(),this.updateAdaptiveSize(),this.updateScrollArea(),this.updateClonePanels(),this.updateCameraPosition(),this.updatePlugins()},t.findNearestPanel=function(){var e=this.state,t=this.panelManager,n=this.getHangerPosition();return this.isOutOfBound()?e.position<=e.scrollArea.prev?t.firstPanel():t.lastPanel():this.findNearestPanelAt(n)},t.findNearestPanelAt=function(e){for(var t,n=1/0,i=0,r=this.panelManager.allPanels();i<r.length;i++){var a=r[i];if(a){var o=a.getPosition(),s=o+a.getSize(),l=b(e,o,s)?0:Math.min(Math.abs(o-e),Math.abs(s-e));if(n<l)break;if(l===n&&Math.abs(e-t.getAnchorPosition())<Math.abs(e-a.getAnchorPosition()))break;n=l,t=a}}return t},t.findNearestIdenticalPanel=function(e){var i=e,r=1/0,a=this.getHangerPosition();return e.getIdenticalPanels().forEach(function(e){var t=e.getAnchorPosition(),n=Math.abs(t-a);n<r&&(i=e,r=n)}),i},t.findShortestPositionToPanel=function(e){var t=this.state,n=this.options,i=e.getAnchorPosition(),r=this.getHangerPosition(),a=Math.abs(r-i),o=t.scrollArea.next-t.scrollArea.prev;if(n.circular)return a<=o-a?i-t.relativeHangerPosition:r<i?i-t.relativeHangerPosition-o:i-t.relativeHangerPosition+o;var s=i-t.relativeHangerPosition;return this.canSetBoundMode()?I(s,t.scrollArea.prev,t.scrollArea.next):s},t.findEstimatedPosition=function(e){var t=this.getScrollArea(),n=e.getAnchorPosition()-this.getRelativeHangerPosition();return n=this.canSetBoundMode()?I(n,t.prev,t.next):n},t.addVisiblePanel=function(e){this.getVisibleIndexOf(e)<0&&this.visiblePanels.push(e)},t.enable=function(){this.panInput.enable()},t.disable=function(){this.panInput.disable()},t.insert=function(r,e){var n=this,t=this.panelManager.getLastIndex();if(r<0||t<r)return[];var a=this.state,i=this.options,o=x(e).map(function(e,t){return new L(e,r+t,n)}).slice(0,t-r+1);if(o.length<=0)return[];var s=this.panelManager.insert(r,o);if(this.resizePanels(o),!this.currentPanel){this.currentPanel=o[0],this.nearestPanel=o[0];var l=o[0],h=this.findEstimatedPosition(l);a.position=h,this.updateAxesPosition(h),a.panelMaintainRatio=(l.getRelativeAnchorPosition()+i.gap/2)/(l.getSize()+i.gap)}return this.updateCheckedIndexes({min:r,max:r}),a.checkedIndexes.forEach(function(e,t){var n=e[0],i=e[1];r<n&&a.checkedIndexes.splice(t,1,[n+s,i+s])}),this.resize(),o},t.replace=function(n,e){var i=this,t=this.state,r=this.options,a=this.panelManager,o=a.getLastIndex();if(n<0||o<n)return[];var s=x(e).map(function(e,t){return new L(e,n+t,i)}).slice(0,o-n+1);if(s.length<=0)return[];a.replace(n,s).forEach(function(e){var t=i.getVisibleIndexOf(e);-1<t&&i.visiblePanels.splice(t,1)}),this.resizePanels(s);var l=this.currentPanel;if(!l){this.currentPanel=s[0],this.nearestPanel=s[0];var h=s[0],c=this.findEstimatedPosition(h);t.position=c,this.updateAxesPosition(c),t.panelMaintainRatio=(h.getRelativeAnchorPosition()+r.gap/2)/(h.getSize()+r.gap)}else b(l.getIndex(),n,n+s.length-1)&&(this.currentPanel=a.get(l.getIndex()));return this.updateCheckedIndexes({min:n,max:n+s.length-1}),this.resize(),s},t.remove=function(e,t){void 0===t&&(t=1);var n=this.state;e=Math.max(e,0);var i=this.panelManager,r=this.getCurrentIndex(),a=i.remove(e,t);if(b(r,e,e+t-1)){var o=Math.max(e-1,i.getRange().min);this.currentPanel=i.get(o)}0<t&&(this.updateCheckedIndexes({min:e-1,max:e+t}),this.visiblePanels=[]),i.getPanelCount()<=0&&(this.currentPanel=void 0,this.nearestPanel=void 0),this.resize();var s=n.scrollArea;if(n.position<s.prev||n.position>s.next){var l=B(n.position,s.prev,s.next,!1);this.moveCamera(l),this.updateAxesPosition(l)}return a},t.updateAdaptiveSize=function(){var e=this.state,t=this.options,i=t.horizontal,n=this.getCurrentPanel();if(n){var r=t.adaptive||!e.isAdaptiveCached,a=this.viewportElement.style;if(r){var o=void 0;if(t.adaptive){var s=n.getBbox();o=i?s.height:s.width}else{o=this.panelManager.originalPanels().reduce(function(e,t){var n=t.getBbox();return Math.max(e,i?n.height:n.width)},0)}if(!e.isAdaptiveCached){var l=this.updateBbox();o=Math.max(o,i?l.height:l.width),e.isAdaptiveCached=!0}var h=o+"px";i?(a.height=h,e.cachedBbox.height=o):(a.width=h,e.cachedBbox.width=o)}}},t.updateCameraPosition=function(){var e=this.state,t=this.getCurrentPanel(),n=this.stateMachine.getState(),i=this.moveType.is(l.FREE_SCROLL),r=this.getRelativeHangerPosition(),a=this.options.gap/2;if(n.holding||n.playing)this.updateVisiblePanels();else{var o;if(i){var s=this.getNearestPanel();o=s?s.getPosition()-a+(s.getSize()+2*a)*e.panelMaintainRatio-r:this.getCameraPosition()}else o=t?t.getAnchorPosition()-r:this.getCameraPosition();this.canSetBoundMode()&&(o=I(o,e.scrollArea.prev,e.scrollArea.next)),this.updateAxesPosition(o),this.moveCamera(o)}},t.updateBbox=function(){var e=this.state,t=this.options,n=this.viewportElement;return e.cachedBbox||(e.cachedBbox=H(n,t.useOffset)),e.cachedBbox},t.updatePlugins=function(){var t=this;this.plugins.forEach(function(e){e.update&&e.update(t.flicking)})},t.destroy=function(t){var e=this.state,n=this.flicking.getElement(),i=this.viewportElement,r=this.cameraElement,a=this.panelManager.originalPanels();if(this.removePlugins(this.plugins),!t.preserveUI&&(V(i,e.originalViewportStyle),V(r,e.originalCameraStyle),!e.isCameraGiven&&!this.options.renderExternal)){var o=e.isViewportGiven?i:n,s=e.isViewportGiven?r:i;a.forEach(function(e){o.appendChild(e.getElement())}),o.removeChild(s)}for(var l in this.axes.destroy(),this.panInput.destroy(),a.forEach(function(e){e.destroy(t)}),this)this[l]=null},t.restore=function(e){var t=e.panels,n=this.options.defaultIndex,i=this.cameraElement,r=this.panelManager;i.innerHTML=t.map(function(e){return e.html}).join(""),this.refreshPanels();var a=r.originalPanels(),o=[];t.forEach(function(e,t){var n=a[t];n.setIndex(e.index),o[e.index]=n}),r.replacePanels(o,[]),r.setCloneCount(0);var s=r.getPanelCount();this.nearestPanel=0<s?(this.currentPanel=r.get(e.index)||r.get(n)||r.firstPanel(),this.currentPanel):void(this.currentPanel=void 0),this.visiblePanels=o.filter(function(e){return Boolean(e)}),this.resize(),this.axes.setTo({flick:e.position},0),this.moveCamera(e.position)},t.calcVisiblePanels=function(){var e=this.panelManager.allPanels();if(this.options.renderOnlyVisible){var t=this.getCameraPosition(),n=this.getSize(),i=this.nearestPanel,r=function(e,t,n){for(var i=[],r=e;;){var a=t(r);if(!a||n(a))break;i.push(a),r=a}return i},a=this.panelManager.getPanelCount(),o=function(e){return e.getIndex()+(e.getCloneIndex()+1)*a},s=r(i,function(e){var t=e.nextSibling;return t&&t.getPosition()>=e.getPosition()?t:null},function(e){return e.getPosition()>=t+n}),l=r(i,function(e){var t=e.prevSibling;return t&&t.getPosition()<=e.getPosition()?t:null},function(e){return e.getPosition()+e.getSize()<=t});return[i].concat(s,l).sort(function(e,t){return o(e)-o(t)})}return e.filter(function(e){var t=e.getOutsetProgress();return-1<t&&t<1})},t.getCurrentPanel=function(){return this.currentPanel},t.getCurrentIndex=function(){var e=this.currentPanel;return e?e.getIndex():-1},t.getNearestPanel=function(){return this.nearestPanel},t.getCurrentProgress=function(){var e=this.stateMachine.getState(),t=e.playing||e.holding?this.nearestPanel:this.currentPanel,n=this.panelManager;if(!t)return NaN;var i=this.getScrollArea(),r=i.prev,a=i.next,o=this.getCameraPosition(),s=this.isOutOfBound(),l=t.prevSibling,h=t.nextSibling,c=this.getHangerPosition(),u=t.getAnchorPosition();s&&l&&h&&o<a&&c-l.getAnchorPosition()<u-c&&(h=(t=l).nextSibling,l=t.prevSibling,u=t.getAnchorPosition());var g=t.getIndex()+(t.getCloneIndex()+1)*n.getPanelCount(),f=t.getSize();if(s){var d=this.getRelativeHangerPosition();a+d<u?c=u+c-d-a:u<r+d&&(c=u+c-d-r)}var p=u<=c,v=this.options.gap,P=u,m=u;p?m=h?h.getAnchorPosition():u+f+v:P=l?l.getAnchorPosition():u-f-v;var x=(c-P)/(m-P);return(p?g:l?l.getIndex():g-1)+x},t.updateAxesPosition=function(e){var t=this.axes;t.off(),t.setTo({flick:e},0),t.on(this.axesHandlers)},t.getSize=function(){return this.state.size},t.getScrollArea=function(){return this.state.scrollArea},t.isOutOfBound=function(){var e=this.state,t=this.options,n=e.scrollArea;return!t.circular&&t.bound&&(e.position<=n.prev||e.position>=n.next)},t.canSetBoundMode=function(){var e=this.options;return e.bound&&!e.circular},t.getViewportElement=function(){return this.viewportElement},t.getCameraElement=function(){return this.cameraElement},t.getScrollAreaSize=function(){var e=this.state.scrollArea;return e.next-e.prev},t.getRelativeHangerPosition=function(){return this.state.relativeHangerPosition},t.getHangerPosition=function(){return this.state.position+this.state.relativeHangerPosition},t.getCameraPosition=function(){return this.state.position},t.getPositionOffset=function(){return this.state.positionOffset},t.getCheckedIndexes=function(){return this.state.checkedIndexes},t.getVisiblePanels=function(){return this.visiblePanels},t.setCurrentPanel=function(e){this.currentPanel=e},t.setLastIndex=function(e){var t=this.currentPanel,n=this.panelManager;n.setLastIndex(e),t&&t.getIndex()>e&&(this.currentPanel=n.lastPanel()),this.resize()},t.setVisiblePanels=function(e){this.visiblePanels=e},t.connectAxesHandler=function(e){var t=this.axes;this.axesHandlers=e,t.on(e)},t.addPlugins=function(e){var t=this,n=[].concat(e);return n.forEach(function(e){e.init(t.flicking)}),this.plugins=this.plugins.concat(n),this},t.removePlugins=function(e){var n=this,i=this.plugins;return[].concat(e).forEach(function(e){var t=i.indexOf(e);-1<t&&i.splice(t,1),e.destroy(n.flicking)}),this},t.updateCheckedIndexes=function(r){var a=this.state,o=0;a.checkedIndexes.concat().forEach(function(e,t){var n=e[0],i=e[1];r.min<=i&&r.max>=n&&(a.checkedIndexes.splice(t-o,1),o++)})},t.appendUncachedPanelElements=function(e){var n=this,i=this.options,r=document.createDocumentFragment();if(i.isEqualSize){var t=this.visiblePanels,a=i.isEqualSize,o={};this.visiblePanels=[],Object.keys(this.panelBboxes).forEach(function(e){o[e]=!0}),e.forEach(function(e){var t=e.getOverlappedClass(a);t&&!o[t]?(i.renderExternal||r.appendChild(e.getElement()),n.visiblePanels.push(e),o[t]=!0):t||(i.renderExternal||r.appendChild(e.getElement()),n.visiblePanels.push(e))}),t.forEach(function(e){n.addVisiblePanel(e)})}else i.renderExternal||e.forEach(function(e){return r.appendChild(e.getElement())}),this.visiblePanels=e.filter(function(e){return Boolean(e)});i.renderExternal||this.cameraElement.appendChild(r)},t.updateClonePanels=function(){var e=this.panelManager;this.options.circular&&0<e.getPanelCount()&&(this.clonePanels(),this.updateClonedPanelPositions()),e.chainAllPanels()},t.getVisibleIndexOf=function(t){return O(this.visiblePanels,function(e){return e===t})},t.build=function(){this.setElements(),this.applyCSSValue(),this.setMoveType(),this.setAxesInstance(),this.refreshPanels(),this.setDefaultPanel(),this.resize(),this.moveToDefaultPanel()},t.setElements=function(){var e=this.state,t=this.options,n=this.flicking.getElement(),i=t.classPrefix,r=n.children[0],a=r&&C(r,i+"-viewport"),o=a?r:document.createElement("div"),s=a?o.children[0]:n.children[0],l=s&&C(s,i+"-camera"),h=l?s:document.createElement("div");l?e.originalCameraStyle={className:h.getAttribute("class"),style:h.getAttribute("style")}:(h.className=i+"-camera",y(a?o.children:n.children).forEach(function(e){h.appendChild(e)}));a?e.originalViewportStyle={className:o.getAttribute("class"),style:o.getAttribute("style")}:(o.className=i+"-viewport",n.appendChild(o)),l&&a||o.appendChild(h),this.viewportElement=o,this.cameraElement=h,e.isViewportGiven=a,e.isCameraGiven=l},t.applyCSSValue=function(){var e=this.options,t=this.viewportElement,n=this.cameraElement,i=this.viewportElement.style;S(t,h),S(n,c),t.style.zIndex=""+e.zIndex,e.horizontal?(i.minHeight="100%",i.width="100%"):(i.minWidth="100%",i.height="100%"),e.overflow&&(i.overflow="visible"),this.panelManager=new D(this.cameraElement,e)},t.setMoveType=function(){var e=this.options.moveType;switch(e.type){case l.SNAP:this.moveType=new Y(e.count);break;case l.FREE_SCROLL:this.moveType=new U;break;default:throw new Error("moveType is not correct!")}},t.setAxesInstance=function(){var e=this.state,t=this.options,n=e.scrollArea,i=t.horizontal;this.axes=new r({flick:{range:[n.prev,n.next],circular:t.circular,bounce:[0,0]}},{easing:t.panelEffect,deceleration:t.deceleration,interruptable:!0}),this.panInput=new r.PanInput(this.viewportElement,{inputType:t.inputType,thresholdAngle:t.thresholdAngle,iOSEdgeSwipeThreshold:t.iOSEdgeSwipeThreshold,scale:t.horizontal?[-1,0]:[0,-1]}),this.axes.connect(i?["flick",""]:["","flick"],this.panInput)},t.refreshPanels=function(){var n=this,e=this.panelManager,t=y(this.cameraElement.children).map(function(e,t){return new L(e,t,n)});e.replacePanels(t,[]),this.visiblePanels=t.filter(function(e){return Boolean(e)})},t.setDefaultPanel=function(){var e=this.options,t=this.panelManager,n=this.panelManager.getRange(),i=I(e.defaultIndex,n.min,n.max);this.currentPanel=t.get(i)},t.clonePanels=function(){var e=this.state,t=this.options,r=this.panelManager,n=t.gap,i=e.size,a=r.firstPanel(),o=r.lastPanel();if(a){for(var s,l=r.originalPanels(),h=l.concat().reverse(),c=o.getPosition()+o.getSize()-a.getPosition()+n,u=a.getRelativeAnchorPosition(),g=this.getRelativeHangerPosition(),f=(g-u)%c,d=0,p=0,v=h;p<v.length;p++){if((C=v[p])&&f<=(d+=C.getSize()+n)){s=C;break}}for(var P,m=(i-g+u)%c,x=d=0,E=l;x<E.length;x++){var C;if((C=E[x])&&m<=(d+=C.getSize()+n)){P=C;break}}var S=0!==s.getIndex()&&s.getIndex()<=P.getIndex(),b=Math.ceil((g+a.getSize()-u)/c)+Math.ceil((i-g+u)/c)-1+(S?1:0),I=r.getCloneCount();if(r.setCloneCount(b),!t.renderExternal)if(I<b)for(var y=function(t){var e,n=l.map(function(e){return e.clone(t)}),i=document.createDocumentFragment();n.forEach(function(e){return i.appendChild(e.getElement())}),A.cameraElement.appendChild(i),(e=A.visiblePanels).push.apply(e,n.filter(function(e){return Boolean(e)})),r.insertClones(t,0,n)},A=this,w=I;w<b;w++)y(w);else b<I&&r.removeClonesAfter(b)}},t.moveToDefaultPanel=function(){var e=this.state,t=this.panelManager,n=this.options,i=this.panelManager.getRange(),r=I(n.defaultIndex,i.min,i.max),a=t.get(r),o=0;a&&(o=a.getAnchorPosition()-e.relativeHangerPosition,o=this.canSetBoundMode()?I(o,e.scrollArea.prev,e.scrollArea.next):o),this.moveCamera(o),this.axes.setTo({flick:o},0)},t.updateSize=function(){var e=this.state,t=this.options,n=this.panelManager.originalPanels().filter(function(e){return Boolean(e)}),i=this.updateBbox(),r=e.size;e.size=t.horizontal?i.width:i.height,r!==e.size&&(e.relativeHangerPosition=N(t.hanger,e.size),e.infiniteThreshold=N(t.infiniteThreshold,e.size)),n.length<=0||this.resizePanels(n)},t.updateOriginalPanelPositions=function(){var i=this.options.gap,e=this.panelManager,t=e.firstPanel(),n=e.originalPanels();if(t){var r=this.currentPanel,a=this.nearestPanel,o=this.stateMachine.getState(),s=this.state.scrollArea,l=t.getPosition(),h=t;if(a)h=!b(o.lastPosition+o.delta,s.prev,s.next)?r:a;else 0<t.getIndex()&&(h=r);var c=n.slice(0,h.getIndex()+(h.getCloneIndex()+1)*n.length).reduce(function(e,t){return e+t.getSize()+i},0);l=h.getPosition()-c,n.forEach(function(e){var t=l,n=e.getSize();e.setPosition(t),l+=n+i}),this.options.renderOnlyVisible||n.forEach(function(e){return e.setPositionCSS()})}},t.updateClonedPanelPositions=function(){var e=this.state,t=this.options,n=this.panelManager,i=n.clonedPanels().reduce(function(e,t){return e.concat(t)},[]).filter(function(e){return Boolean(e)}),r=e.scrollArea,a=n.firstPanel(),o=n.lastPanel();if(a){for(var s=o.getPosition()+o.getSize()-a.getPosition()+t.gap,l=0,h=i;l<h.length;l++){var c=(p=h[l]).getOriginalPanel(),u=s*(p.getCloneIndex()+1)+c.getPosition();p.setPosition(u)}for(var g=a.getPosition(),f=0,d=i.concat().reverse();f<d.length;f++){var p,v=(p=d[f]).getSize(),P=g-v-t.gap;if(P+v<=r.prev)break;p.setPosition(P),g=P}this.options.renderOnlyVisible||i.forEach(function(e){e.setPositionCSS()})}},t.updateScrollArea=function(){var e=this.state,t=this.panelManager,n=this.options,i=this.axes,r=t.firstPanel(),a=t.lastPanel(),o=e.relativeHangerPosition;if(r)if(this.canSetBoundMode()){if((h=a.getPosition()+a.getSize()-r.getPosition())>=e.size)e.scrollArea={prev:r.getPosition(),next:a.getPosition()+a.getSize()-e.size};else{var s=N(n.anchor,h),l=r.getPosition()+I(s,h-(e.size-o),o);e.scrollArea={prev:l-o,next:l-o}}}else if(n.circular){var h=a.getPosition()+a.getSize()-r.getPosition()+n.gap;e.scrollArea={prev:r.getAnchorPosition()-o,next:h+r.getAnchorPosition()-o}}else e.scrollArea={prev:r.getAnchorPosition()-o,next:a.getAnchorPosition()-o};else e.scrollArea={prev:0,next:0};var c,u,g=e.size,f=n.bounce;if((u=f)&&u.constructor===Array)c=f.map(function(e){return N(e,g,v.bounce)});else{var d=N(f,g,v.bounce);c=[d,d]}var p=i.axis.flick;p.range=[e.scrollArea.prev,e.scrollArea.next],p.bounce=c},t.checkNeedPanel=function(e){var t=this.state,n=this.options,i=this.panelManager,r=this.currentPanel,a=this.nearestPanel,o=this.stateMachine.getState();if(n.infinite){var s=n.gap,l=t.infiniteThreshold,h=i.getLastIndex();if(!(h<0))if(r&&a){for(var c=a.getPosition(),u=o.holding||o.playing?a:r;u;){var g=u.getIndex(),f=u.nextSibling,d=!(g===(E=i.lastPanel()).getIndex())&&f?f.getIndex():h+1,p=a.getPosition(),v=u.getPosition()+u.getSize()-(p-c)+s-l<=t.position+t.size;if(1<d-g&&v&&this.triggerNeedPanel({axesEvent:e,siblingPanel:u,direction:T.NEXT,indexRange:{min:g+1,max:d-1,length:d-g-1}}),n.circular&&g===h&&v){var P=(x=i.firstPanel())?x.getIndex():-1;0<P&&this.triggerNeedPanel({axesEvent:e,siblingPanel:u,direction:T.NEXT,indexRange:{min:0,max:P-1,length:P}})}var m=i.lastPanel();if(m&&g===m.getIndex()||!v)break;u=u.nextSibling}for(u=a;u;){var x,E,C=t.position,S=u.getIndex(),b=u.prevSibling,I=!(S===(x=i.firstPanel()).getIndex())&&b?b.getIndex():-1;p=a.getPosition(),v=C<=u.getPosition()-(p-c)-s+l;if(1<S-I&&v&&this.triggerNeedPanel({axesEvent:e,siblingPanel:u,direction:T.PREV,indexRange:{min:I+1,max:S-1,length:S-I-1}}),n.circular&&0===S&&v)if((E=i.lastPanel())&&E.getIndex()<h){var y=E.getIndex();this.triggerNeedPanel({axesEvent:e,siblingPanel:u,direction:T.PREV,indexRange:{min:y+1,max:h,length:h-y}})}var A=i.firstPanel();if(A&&S===A.getIndex()||!v)break;u=u.prevSibling}}else this.triggerNeedPanel({axesEvent:e,siblingPanel:null,direction:null,indexRange:{min:0,max:h,length:h+1}})}},t.triggerNeedPanel=function(e){var r=this,t=e.axesEvent,a=e.siblingPanel,o=e.direction,s=e.indexRange,l=this.options,n=this.state.checkedIndexes,i=n.some(function(e){var t=e[0],n=e[1];return t===s.min||n===s.max}),h=this.flicking.hasOn(A.NEED_PANEL);if(!i&&h){n.push([s.min,s.max]);var c=a?a.getIndex():0,u=!!t&&t.isTrusted;this.triggerEvent(A.NEED_PANEL,t,u,{index:c,panel:a,direction:o,range:s,fill:function(e){var t=r.panelManager;if(!a)return r.insert(t.getRange().max+1,e);var n=x(e),i=o===T.NEXT?n.slice(0,s.length):n.slice(-s.length);return o===T.NEXT?l.circular&&c===t.getLastIndex()?r.insert(0,i):a.insertAfter(i):o===T.PREV?l.circular&&0===c?r.insert(s.max-i.length+1,i):a.insertBefore(i):r.insert(0,i)}})}},t.updateVisiblePanels=function(){var t=this.state,e=this.options,n=this.panelManager,i=this.stateMachine.getState(),r=this.cameraElement,a=e.renderExternal;if(e.renderOnlyVisible)if(this.nearestPanel){var o=this.visiblePanels,s=this.calcVisiblePanels(),l=this.checkVisiblePanelChange(o,s),h=l.addedPanels,c=l.removedPanels;if(!(h.length<=0&&c.length<=0)){if(i.holding)s.push.apply(s,c);else{var u=s[0].getPosition();t.positionOffset=u}if(s.forEach(function(e){e.setPositionCSS(t.positionOffset)}),!a){i.holding||c.forEach(function(e){var t=e.getElement();t.parentNode&&r.removeChild(t)});var g=document.createDocumentFragment();h.forEach(function(e){g.appendChild(e.getElement())}),r.appendChild(g)}var f=s[0],d=s[s.length-1],p=function(e){return e.getIndex()+(e.getCloneIndex()+1)*n.getPanelCount()},v={min:p(f),max:p(d)};this.visiblePanels=s,this.flicking.trigger(A.VISIBLE_CHANGE,{type:A.VISIBLE_CHANGE,range:v})}}else for(this.visiblePanels=[];r.firstChild;)r.removeChild(r.firstChild)},t.checkVisiblePanelChange=function(i,r){var a=i.map(function(){return 0}),o=r.map(function(){return 0});return i.forEach(function(n,i){r.forEach(function(e,t){n===e&&(a[i]++,o[t]++)})}),{removedPanels:a.reduce(function(e,t,n){return 0===t?e.concat([i[n]]):e},[]),addedPanels:o.reduce(function(e,t,n){return 0===t?e.concat([r[n]]):e},[])}},t.resizePanels=function(e){var t=this.options,n=this.panelBboxes;if(!0!==t.isEqualSize)if(t.isEqualSize){var i=t.isEqualSize;e.forEach(function(e){var t=e.getOverlappedClass(i);t?(e.resize(n[t]),n[t]=e.getBbox()):e.resize()})}else e.forEach(function(e){e.resize()});else{if(!n.default){var r=e[0];n.default=r.getBbox()}var a=n.default;e.forEach(function(e){e.resize(a)})}},e}(),J=function(g){function e(e,t){void 0===t&&(t={});var n,u=g.call(this)||this;if(u.isPanelChangedAtBeforeSync=!1,u.resize=function(){var e=u.viewport,t=u.options,n=u.getElement(),i=e.panelManager.allPanels();t.isConstantSize||i.forEach(function(e){return e.unCacheBbox()});var r=t.renderOnlyVisible&&!t.isConstantSize&&!0!==t.isEqualSize,a=n.parentElement,o=a.style.height;return a.style.height=a.offsetHeight+"px",e.unCacheBbox(),e.updateBbox(),r&&e.appendUncachedPanelElements(i),e.resize(),a.style.height=o,u},u.triggerEvent=function(e,t,n,i){void 0===i&&(i={});var r=u.viewport,a=!0;if(r){var o=r.stateMachine.getState(),s=r.getScrollArea(),l=s.prev,h=s.next,c=R(r.getCameraPosition(),[l,l,h]);u.options.circular&&(c%=1),a=!g.prototype.trigger.call(u,e,m({type:e,index:u.getIndex(),panel:u.getCurrentPanel(),direction:o.direction,holding:o.holding,progress:c,axesEvent:t,isTrusted:n},i))}return{onSuccess:function(e){return a||e(),this},onStopped:function(e){return a&&e(),this}}},u.moveCamera=function(e){var t=u.viewport,n=t.stateMachine.getState(),i=u.options,r=e.pos.flick,a=t.getCameraPosition();if(e.isTrusted&&n.holding){var o=i.horizontal?e.inputEvent.offsetX:e.inputEvent.offsetY,s=r-a,l=o<0===r<a;if(i.circular&&l)s=(0<s?-1:1)*(t.getScrollAreaSize()-Math.abs(s));var h=0===s?n.direction:0<s?T.NEXT:T.PREV;n.direction=h}return n.delta+=e.delta.flick,t.moveCamera(r,e),u.triggerEvent(A.MOVE,e,e.isTrusted).onStopped(function(){t.moveCamera(a,e)})},E(e)){if(!(n=document.querySelector(e)))throw new Error("Base element doesn't exist.")}else{if(!e.nodeName||1!==e.nodeType)throw new Error("Element should be provided in string or HTMLElement.");n=e}u.wrapper=n,u.options=m({},v,t);var i=u.options,r=i.moveType;return r in o&&(i.moveType=o[r]),u.viewport=new W(u,u.options,u.triggerEvent),u.listenInput(),u.listenResize(),u}a(e,g);var t=e.prototype;return t.prev=function(e){var t=this.getCurrentPanel(),n=this.viewport.stateMachine.getState();if(t&&n.type===w){var i=t.prev();i&&i.focus(e)}return this},t.next=function(e){var t=this.getCurrentPanel(),n=this.viewport.stateMachine.getState();if(t&&n.type===w){var i=t.next();i&&i.focus(e)}return this},t.moveTo=function(e,t){var n=this.viewport,i=n.panelManager.get(e),r=n.stateMachine.getState();if(!i||r.type!==w)return this;var a=i.getAnchorPosition(),o=n.getHangerPosition(),s=i;if(this.options.circular){var l=n.getScrollAreaSize(),h=[a-l,a,a+l].reduce(function(e,t){return Math.abs(t-o)<Math.abs(e-o)?t:e},1/0)-i.getRelativeAnchorPosition(),c=i.getIdenticalPanels(),u=h-a;0<u?s=c[1]:u<0&&(s=c[c.length-1]),(s=s.clone(s.getCloneIndex(),!0)).setPosition(h)}var g=this.getIndex();if(o===s.getAnchorPosition()&&g===e)return this;var f=i.getIndex()===n.getCurrentIndex()?"":A.CHANGE;return n.moveTo(s,n.findEstimatedPosition(s),f,null,t),this},t.getIndex=function(){return this.viewport.getCurrentIndex()},t.getElement=function(){return this.wrapper},t.getCurrentPanel=function(){var e=this.viewport.getCurrentPanel();return e||null},t.getPanel=function(e){var t=this.viewport.panelManager.get(e);return t||null},t.getAllPanels=function(e){var t=this.viewport.panelManager;return(e?t.allPanels():t.originalPanels()).filter(function(e){return!!e})},t.getVisiblePanels=function(){return this.viewport.calcVisiblePanels()},t.getPanelCount=function(){return this.viewport.panelManager.getPanelCount()},t.getCloneCount=function(){return this.viewport.panelManager.getCloneCount()},t.getLastIndex=function(){return this.viewport.panelManager.getLastIndex()},t.setLastIndex=function(e){return this.viewport.setLastIndex(e),this},t.isPlaying=function(){return this.viewport.stateMachine.getState().playing},t.enableInput=function(){return this.viewport.enable(),this},t.disableInput=function(){return this.viewport.disable(),this},t.getStatus=function(){var e=this.viewport,t=e.panelManager.originalPanels().filter(function(e){return!!e}).map(function(e){return{html:e.getElement().outerHTML,index:e.getIndex()}});return{index:e.getCurrentIndex(),panels:t,position:e.getCameraPosition()}},t.setStatus=function(e){this.viewport.restore(e)},t.addPlugins=function(e){return this.viewport.addPlugins(e),this},t.removePlugins=function(e){return this.viewport.removePlugins(e),this},t.destroy=function(e){for(var t in void 0===e&&(e={}),this.off(),this.options.autoResize&&window.removeEventListener("resize",this.resize),this.viewport.destroy(e),this)this[t]=null},t.prepend=function(e){var t=this.viewport,n=x(e),i=Math.max(t.panelManager.getRange().min-n.length,0);return t.insert(i,n)},t.append=function(e){var t=this.viewport;return t.insert(t.panelManager.getRange().max+1,e)},t.replace=function(e,t){return this.viewport.replace(e,t)},t.remove=function(e,t){return void 0===t&&(t=1),this.viewport.remove(e,t)},t.getRenderingIndexes=function(e){var t=this.viewport,n=t.getVisiblePanels(),i=e.maintained.reduce(function(e,t){var n=t[0],i=t[1];return e[n]=i,e},{}),r=e.prevList.length,a=e.list.length,o=e.added,s=n.map(function(e){return(t=e).getIndex()+(t.getCloneIndex()+1)*r;var t}),l=(s=s.filter(function(e){return null!=i[e%r]}).map(function(e){var t=Math.floor(e/r);return i[e%r]+a*t})).concat(o),h=t.panelManager.allPanels();return t.setVisiblePanels(l.map(function(e){return h[e]})),l},t.beforeSync=function(e){var t=this,n=e.maintained,o=e.added,i=e.changed,a=e.removed,r=this.viewport,s=r.panelManager,l=this.options.circular,h=s.getCloneCount(),c=s.clonedPanels(),u=r.getVisiblePanels().filter(function(t){return O(a,function(e){return e===t.getIndex()})<0});if(r.setVisiblePanels(u),o.length<=0&&a.length<=0&&i.length<=0&&h===c.length)return this;var g=s.originalPanels(),f=[],d=k(h).map(function(){return[]});n.forEach(function(e){var t=e[0],n=e[1];f[n]=g[t],f[n].setIndex(n)}),o.forEach(function(e){f[e]=new L(null,e,t.viewport)}),l&&k(h).forEach(function(i){var r=c[i],a=d[i];n.forEach(function(e){var t=e[0],n=e[1];a[n]=r?r[t]:f[n].clone(i,!1),a[n].setIndex(n)}),o.forEach(function(e){var t=f[e];a[e]=t.clone(i,!1)})}),o.forEach(function(e){r.updateCheckedIndexes({min:e,max:e})}),a.forEach(function(e){r.updateCheckedIndexes({min:e-1,max:e+1})});var p=r.getCheckedIndexes();p.forEach(function(e,t){var n=e[0],i=e[1],r=o.filter(function(e){return e<n&&s.has(e)}).length-a.filter(function(e){return e<n}).length;p.splice(t,1,[n+r,i+r])}),0<i.length&&n.forEach(function(e){var t=e[1];r.updateCheckedIndexes({min:t,max:t})}),s.replacePanels(f,d),this.isPanelChangedAtBeforeSync=!0},t.sync=function(e){var i=e.list,t=e.maintained,n=e.added,r=e.changed,a=e.removed;if(n.length<=0&&a.length<=0&&r.length<=0)return this;var o=this.viewport,s=this.options,l=s.renderOnlyVisible,h=s.circular,c=o.panelManager;if(!l){var u=c.getRange(),g=e;if(h){var f=u.max,d=i.length/(c.getCloneCount()+1)>>0,p=n.filter(function(e){return e<d}),v=a.filter(function(e){return e<=f});g={added:p,maintained:t.filter(function(e){return e[0]<=f}),removed:v,changed:r.filter(function(e){return e[0]<=f})}}this.beforeSync(g)}var P=l?o.getVisiblePanels():this.getAllPanels(!0);return n.forEach(function(e){var t=i[e],n=P[e];n.setElement(t),n.unCacheBbox()}),this.isPanelChangedAtBeforeSync&&(o.setVisiblePanels([]),this.isPanelChangedAtBeforeSync=!1),o.resize(),this},t.listenInput=function(){var n=this,e=n.viewport,i=e.stateMachine;n.eventContext={flicking:n,viewport:n.viewport,transitTo:i.transitTo,triggerEvent:n.triggerEvent,moveCamera:n.moveCamera,stopCamera:e.stopCamera};var r={},t=function(e){var t=f[e];r[t]=function(e){return i.fire(t,e,n.eventContext)}};for(var a in f)t(a);n.viewport.connectAxesHandler(r)},t.listenResize=function(){this.options.autoResize&&window.addEventListener("resize",this.resize)},e.VERSION="3.5.0",e.DIRECTION=T,e.EVENTS=A,e}(e);return J.withFlickingMethods=function(e,a){Object.keys(t).forEach(function(r){e[r]||(e[r]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n,i=(n=this[a])[r].apply(n,e);return i===this[a]?this:i})})},J.DEFAULT_OPTIONS=v,J.MOVE_TYPE=l,J});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@egjs/component"),require("@egjs/axes")):"function"==typeof define&&define.amd?define(["@egjs/component","@egjs/axes"],t):((e=e||self).eg=e.eg||{},e.eg.Flicking=t(e.eg.Component,e.eg.Axes))}(this,function(e,r){"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)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function a(e,t){function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var c={SNAP:"snap",FREE_SCROLL:"freeScroll"},o={snap:{type:"snap",count:1},freeScroll:{type:"freeScroll"}},s="undefined"!=typeof document,v={classPrefix:"eg-flick",deceleration:.0075,horizontal:!0,circular:!1,infinite:!1,infiniteThreshold:0,lastIndex:1/0,threshold:40,duration:100,panelEffect:function(e){return 1-Math.pow(1-e,3)},defaultIndex:0,inputType:["touch","mouse"],thresholdAngle:45,bounce:10,autoResize:!1,adaptive:!1,zIndex:2e3,bound:!1,overflow:!1,hanger:"50%",anchor:"50%",gap:0,moveType:o.snap,useOffset:!1,isEqualSize:!1,isConstantSize:!1,renderOnlyVisible:!1,renderExternal:!1,iOSEdgeSwipeThreshold:30,collectStatistics:!0},l={position:"relative",zIndex:v.zIndex,overflow:"hidden"},h={width:"100%",height:"100%",willChange:"transform"},u={position:"absolute"},y={HOLD_START:"holdStart",HOLD_END:"holdEnd",MOVE_START:"moveStart",MOVE:"move",MOVE_END:"moveEnd",CHANGE:"change",RESTORE:"restore",SELECT:"select",NEED_PANEL:"needPanel",VISIBLE_CHANGE:"visibleChange"},f={HOLD:"hold",CHANGE:"change",RELEASE:"release",ANIMATION_END:"animationEnd",FINISH:"finish"},w=0,g=1,p=2,M=3,z=4,T={PREV:"PREV",NEXT:"NEXT"},t={prev:!0,next:!0,moveTo:!0,getIndex:!0,getAllPanels:!0,getCurrentPanel:!0,getElement:!0,getPanel:!0,getPanelCount:!0,getStatus:!0,getVisiblePanels:!0,enableInput:!0,disableInput:!0,destroy:!0,resize:!0,setStatus:!0,isPlaying:!0},d=function(){var e={webkitTransform:"-webkit-transform",msTransform:"-ms-transform",MozTransform:"-moz-transform",OTransform:"-o-transform",transform:"transform"};if(!s)return{name:e.transform,has3d:!0};var t=document.documentElement.style,n="";for(var i in e)i in t&&(n=i);if(!n)throw new Error("Browser doesn't support CSS3 2D Transforms.");var r=document.createElement("div");document.documentElement.insertBefore(r,null),r.style[n]="translate3d(1px, 1px, 1px)";var a=window.getComputedStyle(r).getPropertyValue(e[n]);r.parentElement.removeChild(r);var o={name:n,has3d:0<a.length&&"none"!==a};return d=function(){return o},o},P=d();function m(i){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return e.forEach(function(n){Object.keys(n).forEach(function(e){var t=n[e];i[e]=t})}),i}function x(e){Array.isArray(e)||(e=[e]);var n=[];return e.forEach(function(e){if(E(e)){var t=document.createElement("div");for(t.innerHTML=e,n.push.apply(n,A(t.children));t.firstChild;)t.removeChild(t.firstChild)}else n.push(e)}),n}function E(e){return"string"==typeof e}function C(e,t){return e.classList?e.classList.contains(t):0<=e.className.split(" ").indexOf(t)}function S(t,n){Object.keys(n).forEach(function(e){t.style[e]=n[e]})}function I(e,t,n){return Math.max(Math.min(e,n),t)}function b(e,t,n){return t<=e&&e<=n}function A(e){return[].slice.call(e)}function N(e,t,n){var i=null!=n?n:t/2,r=/(?:(\+|\-)\s*)?(\d+(?:\.\d+)?(%|px)?)/g;if("number"==typeof e)return I(e,0,t);for(var a=0,o=0,s=r.exec(e);null!=s;){var l=s[1],h=s[2],c=s[3],u=parseFloat(h);if(a<=0&&(l=l||"+"),!l)return i;"%"===c&&(u=u/100*t),o+="+"===l?u:-u,++a,s=r.exec(e)}return 0===a?i:I(o,0,t)}function R(e,t){var n=t[0],i=t[1],r=t[2];return i<e&&r-i?(e-i)/(r-i):e<i&&i-n?(e-i)/(i-n):e!==i&&r-n?(e-n)/(r-n):0}function O(e,t){for(var n=0;n<e.length;n+=1){var i=e[n];if(i&&t(i))return n}return-1}function k(e){for(var t=[],n=0;n<e;n+=1)t[n]=n;return t}function B(e,t,n,i){var r=i?n-t+1:n-t;return e<t?e=n-(i?(t-e-1)%r:(t-e)%r):n<e&&(e=t+(i?(e-n-1)%r:(e-n)%r)),e}function V(e,t){t.className?e.setAttribute("class",t.className):e.removeAttribute("class"),t.style?e.setAttribute("style",t.style):e.removeAttribute("style")}function H(e,t){var n;return t?{x:0,y:0,width:e.offsetWidth,height:e.offsetHeight}:{x:(n=e.getBoundingClientRect()).left,y:n.top,width:n.width,height:n.height}}var L=function(){function l(e,t,n){this.viewport=n,this.prevSibling=null,this.nextSibling=null,this.clonedPanels=[],this.state={index:t,position:0,relativeAnchorPosition:0,size:0,isClone:!1,isVirtual:!1,cloneIndex:-1,originalStyle:{className:"",style:""},cachedBbox:null},this.setElement(e)}var e=l.prototype;return e.resize=function(e){var n=this.state,t=this.viewport.options,i=e||this.getBbox();this.state.cachedBbox=i;var r=n.size;n.size=t.horizontal?i.width:i.height,r!==n.size&&(n.relativeAnchorPosition=N(t.anchor,n.size)),n.isClone||this.clonedPanels.forEach(function(e){var t=e.state;t.size=n.size,t.cachedBbox=n.cachedBbox,t.relativeAnchorPosition=n.relativeAnchorPosition})},e.unCacheBbox=function(){this.state.cachedBbox=null},e.getProgress=function(){var e=this.viewport,t=e.options,n=e.panelManager.getPanelCount(),i=e.getScrollAreaSize();return(t.circular?Math.floor(this.getPosition()/i)*n:0)+this.getIndex()-e.getCurrentProgress()},e.getOutsetProgress=function(){var e=this.viewport,t=[-this.getSize(),e.getRelativeHangerPosition()-this.getRelativeAnchorPosition(),e.getSize()];return R(this.getPosition()-e.getCameraPosition(),t)},e.getVisibleRatio=function(){var e=this.viewport,t=this.getSize(),n=this.getPosition()-e.getCameraPosition(),i=n+t,r=Math.min(e.getSize(),i)-Math.max(n,0);return 0<=r?r/t:0},e.focus=function(e){var t,n=this.viewport,i=n.getCurrentPanel();n.getHangerPosition()!==this.getAnchorPosition()&&i&&(t=i.getPosition()===this.getPosition()?"":y.CHANGE,n.moveTo(this,n.findEstimatedPosition(this),t,null,e))},e.update=function(t,e){void 0===t&&(t=null),void 0===e&&(e=!0);var n=this.getIdenticalPanels();t&&n.forEach(function(e){t(e.getElement())}),e&&(n.forEach(function(e){e.unCacheBbox()}),this.viewport.addVisiblePanel(this),this.viewport.resize())},e.prev=function(){var e=this.viewport.options,t=this.prevSibling;if(!t)return null;var n=this.getIndex(),i=this.getPosition(),r=t.getIndex(),a=t.getPosition(),o=t.getSize(),s=1<n-r,l=e.infinite&&0<n&&n<r;if(s||l)return null;var h=i-o-e.gap,c=t;return a!==h&&(c=t.clone(t.getCloneIndex(),!0)).setPosition(h),c},e.next=function(){var e=this.viewport,t=e.options,n=this.nextSibling,i=e.panelManager.getLastIndex();if(!n)return null;var r=this.getIndex(),a=this.getPosition(),o=n.getIndex(),s=n.getPosition(),l=1<o-r,h=t.infinite&&r<i&&o<r;if(l||h)return null;var c=a+this.getSize()+t.gap,u=n;return s!==c&&(u=n.clone(n.getCloneIndex(),!0)).setPosition(c),u},e.insertBefore=function(e){var t=this.viewport,n=x(e),i=t.panelManager.firstPanel(),r=this.prevSibling,a=r&&i.getIndex()!==this.getIndex()?Math.max(r.getIndex()+1,this.getIndex()-n.length):Math.max(this.getIndex()-n.length,0);return t.insert(a,n)},e.insertAfter=function(e){return this.viewport.insert(this.getIndex()+1,e)},e.remove=function(){return this.viewport.remove(this.getIndex()),this},e.destroy=function(e){var t;for(var n in e.preserveUI||(t=this.state.originalStyle,V(this.element,t)),this)this[n]=null},e.getElement=function(){return this.element},e.getAnchorPosition=function(){return this.state.position+this.state.relativeAnchorPosition},e.getRelativeAnchorPosition=function(){return this.state.relativeAnchorPosition},e.getIndex=function(){return this.state.index},e.getPosition=function(){return this.state.position},e.getSize=function(){return this.state.size},e.getBbox=function(){var e,t,n=this.state,i=this.viewport,r=this.element,a=i.options;return r?n.cachedBbox||(e=Boolean(r.parentNode),t=i.getCameraElement(),e||(t.appendChild(r),i.addVisiblePanel(this)),n.cachedBbox=H(r,a.useOffset),!e&&i.options.renderExternal&&t.removeChild(r)):n.cachedBbox={x:0,y:0,width:0,height:0},n.cachedBbox},e.isClone=function(){return this.state.isClone},e.getOverlappedClass=function(e){for(var t=this.element,n=0,i=e;n<i.length;n++){var r=i[n];if(C(t,r))return r}},e.getCloneIndex=function(){return this.state.cloneIndex},e.getClonedPanels=function(){return this.state.isClone?this.original.getClonedPanels():this.clonedPanels},e.getIdenticalPanels=function(){return this.state.isClone?this.original.getIdenticalPanels():[this].concat(this.clonedPanels)},e.getOriginalPanel=function(){return this.state.isClone?this.original:this},e.setIndex=function(t){this.state.index=t,this.clonedPanels.forEach(function(e){return e.state.index=t})},e.setPosition=function(e){return this.state.position=e,this},e.setPositionCSS=function(e){var t,n,i,r,a,o;void 0===e&&(e=0),this.element&&(n=(t=this.state).position,i=this.viewport.options,r=this.element.style,a=i.horizontal?r.left:r.top,o=n-e+"px",t.isVirtual||a===o||(i.horizontal?r.left=o:r.top=o))},e.clone=function(e,t,n){void 0===t&&(t=!1);var i=this.state,r=this.viewport,a=n;!a&&this.element&&(a=t?this.element:this.element.cloneNode(!0));var o=new l(a,i.index,r),s=o.state;return o.original=i.isClone?this.original:this,s.isClone=!0,s.isVirtual=t,s.cloneIndex=e,s.size=i.size,s.relativeAnchorPosition=i.relativeAnchorPosition,s.originalStyle=i.originalStyle,s.cachedBbox=i.cachedBbox,t?(o.prevSibling=this.prevSibling,o.nextSibling=this.nextSibling):this.clonedPanels.push(o),o},e.removeElement=function(){var e;this.viewport.options.renderExternal||(e=this.element).parentNode&&e.parentNode.removeChild(e),this.state.isClone||this.removeClonedPanelsAfter(0)},e.removeClonedPanelsAfter=function(e){var t=this.viewport.options,n=this.clonedPanels.splice(e);t.renderExternal||n.forEach(function(e){e.removeElement()})},e.setElement=function(e){var t,n,i,r,a;!e||e!==(t=this.element)&&(n=this.viewport.options,t?n.horizontal?e.style.left=t.style.left:e.style.top=t.style.top:((i=this.state.originalStyle).className=e.getAttribute("class"),i.style=e.getAttribute("style")),this.element=e,n.classPrefix&&(r=e,a=n.classPrefix+"-panel",r.classList?r.classList.add(a):C(r,a)||(r.className=(r.className+" "+a).replace(/\s{2,}/g," "))),S(this.element,u))},l}(),D=function(){function e(e,t){this.cameraElement=e,this.panels=[],this.clones=[],this.range={min:-1,max:-1},this.length=0,this.cloneCount=0,this.options=t,this.lastIndex=t.lastIndex}var t=e.prototype;return t.firstPanel=function(){return this.panels[this.range.min]},t.lastPanel=function(){return this.panels[this.range.max]},t.allPanels=function(){return this.panels.concat(this.clones.reduce(function(e,t){return e.concat(t)},[]))},t.originalPanels=function(){return this.panels},t.clonedPanels=function(){return this.clones},t.replacePanels=function(e,t){this.panels=e,this.clones=t,this.range={min:O(e,function(e){return Boolean(e)}),max:e.length-1},this.length=e.filter(function(e){return Boolean(e)}).length},t.has=function(e){return!!this.panels[e]},t.get=function(e){return this.panels[e]},t.getPanelCount=function(){return this.length},t.getLastIndex=function(){return this.lastIndex},t.getRange=function(){return this.range},t.getCloneCount=function(){return this.cloneCount},t.setLastIndex=function(e){this.lastIndex=e;var t,n,i,r=this.firstPanel(),a=this.lastPanel();r&&a&&(t=this.range,a.getIndex()>e&&(n=this.panels.splice(e+1),this.length-=n.length,(i=n.filter(function(e){return!!e})[0].prevSibling)?t.max=i.getIndex():(t.min=-1,t.max=-1),this.shouldRender()&&n.forEach(function(e){return e.removeElement()})))},t.setCloneCount=function(e){this.cloneCount=e},t.insert=function(n,e){var i=this.panels,t=this.range,r=this.options.circular,a=this.lastIndex,o=this.findFirstPanelFrom(n),s=this.firstPanel(),l=o?o.getElement():r&&s?s.getClonedPanels()[0].getElement():null;this.insertNewPanels(e,l);var h,c,u,g,f,d,p=e.length;return n>t.max?e.forEach(function(e,t){i[n+t]=e}):((c=O(h=i.slice(n,n+e.length),function(e){return e}))<0&&(c=h.length),p=e.length-c,i.splice.apply(i,[n,c].concat(e)),i.length>a+1&&(u=i.splice(a+1).filter(function(e){return Boolean(e)}),this.length-=u.length,g=a-O(this.panels.concat().reverse(),function(e){return e}),this.panels.splice(1+g),this.range.max=g,this.shouldRender()&&u.forEach(function(e){return e.removeElement()}))),0<p&&i.slice(n+e.length).forEach(function(e){e.setIndex(e.getIndex()+p)}),this.length+=e.length,this.updateIndex(n),r&&(this.addNewClones(n,e,e.length-p,o),f=this.clones,d=this.panels.length,f[0]&&f[0].length>a+1&&f.forEach(function(e){e.splice(d)})),p},t.replace=function(e,t){var n=this.panels,i=this.range,r=this.options.circular,a=this.findFirstPanelFrom(e+t.length),o=this.firstPanel(),s=a?a.getElement():r&&o?o.getClonedPanels()[0].getElement():null;this.insertNewPanels(t,s),e>i.max&&(n[e]=null);var l=n.splice.apply(n,[e,t.length].concat(t)),h=l.filter(function(e){return Boolean(e)}).length;return this.length+=t.length-h,this.updateIndex(e),r&&this.addNewClones(e,t,t.length,a),this.shouldRender()&&l.forEach(function(e){return e&&e.removeElement()}),l},t.remove=function(t,n){void 0===n&&(n=1);var e=this.options.circular,i=this.panels,r=this.clones;n=Math.max(n,0);var a=i.splice(t,n).filter(function(e){return!!e});this.shouldRender()&&a.forEach(function(e){return e.removeElement()}),e&&r.forEach(function(e){e.splice(t,n)}),i.slice(t).forEach(function(e){e.setIndex(e.getIndex()-n)});var o,s=i.length-1;return i[s]||(o=O(i.concat().reverse(),function(e){return e}),s=o<0?-1:s-o,i.splice(s+1),e&&r.forEach(function(e){e.splice(s+1)})),this.range={min:O(i,function(e){return e}),max:s},this.length-=a.length,this.length<=0&&(this.clones=[],this.cloneCount=0),a},t.chainAllPanels=function(){var e,t,r=this.allPanels().filter(function(e){return!!e}),n=r.length;n<=1||(r.slice(1,r.length-1).forEach(function(e,t){var n=r[t],i=r[t+2];e.prevSibling=n,e.nextSibling=i}),e=r[0],t=r[n-1],e.prevSibling=null,e.nextSibling=r[1],t.prevSibling=r[n-2],t.nextSibling=null,this.options.circular&&((e.prevSibling=t).nextSibling=e))},t.insertClones=function(e,n,t,i){void 0===i&&(i=0);var r,a,o=this.clones,s=this.lastIndex;o[e]?(r=o[e],n>=r.length?t.forEach(function(e,t){r[n+t]=e}):(r.splice.apply(r,[n,i].concat(t)),t.length>s+1&&t.splice(s+1))):(a=[],t.forEach(function(e,t){a[n+t]=e}),o[e]=a)},t.removeClonesAfter=function(t){this.panels.forEach(function(e){e.removeClonedPanelsAfter(t)}),this.clones.splice(t)},t.findPanelOf=function(e){for(var t=0,n=this.allPanels();t<n.length;t++){var i=n[t];if(i)if(i.getElement().contains(e))return i}},t.findFirstPanelFrom=function(e){for(var t=0,n=this.panels.slice(e);t<n.length;t++){var i=n[t];if(i&&i.getIndex()>=e&&i.getElement().parentNode)return i}},t.addNewClones=function(a,o,s,e){for(var l=this,h=this.cameraElement,t=this.getCloneCount(),n=this.lastPanel(),c=n?n.getClonedPanels():[],u=e?e.getClonedPanels():[],g=this,i=0,r=k(t);i<r.length;i++){!function(n){var e=u[n],t=c[n],i=e?e.getElement():t?t.getElement().nextElementSibling:null,r=o.map(function(e){var t=e.clone(n);return l.shouldRender()&&h.insertBefore(t.getElement(),i),t});g.insertClones(n,a,r,s)}(r[i])}},t.updateIndex=function(e){var t=this.panels,n=this.range,i=t.length-1;i>n.max&&(n.max=i),(e<n.min||n.min<0)&&(n.min=e)},t.insertNewPanels=function(e,t){var n;this.shouldRender()&&(n=document.createDocumentFragment(),e.forEach(function(e){return n.appendChild(e.getElement())}),this.cameraElement.insertBefore(n,t))},t.shouldRender=function(){var e=this.options;return!e.renderExternal&&!e.renderOnlyVisible},e}(),n=function(){function e(){this.delta=0,this.direction=null,this.targetPanel=null,this.lastPosition=0}var t=e.prototype;return t.onEnter=function(e){this.delta=e.delta,this.direction=e.direction,this.targetPanel=e.targetPanel,this.lastPosition=e.lastPosition},t.onExit=function(e){},t.onHold=function(e,t){},t.onChange=function(e,t){},t.onRelease=function(e,t){},t.onAnimationEnd=function(e,t){},t.onFinish=function(e,t){},e}(),_=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=w,e.holding=!1,e.playing=!1,e}a(e,t);var n=e.prototype;return n.onEnter=function(){this.direction=null,this.targetPanel=null,this.delta=0,this.lastPosition=0},n.onHold=function(e,t){var n=t.flicking,i=t.viewport,r=t.triggerEvent,a=t.transitTo;if(n.getPanelCount()<=0)return i.options.infinite&&i.moveCamera(i.getCameraPosition(),e),void a(z);this.lastPosition=i.getCameraPosition(),r(y.HOLD_START,e,!0).onSuccess(function(){a(g)}).onStopped(function(){a(z)})},n.onChange=function(e,t){var n=t.triggerEvent,i=t.transitTo;n(y.MOVE_START,e,!1).onSuccess(function(){i(M).onChange(e,t)}).onStopped(function(){i(z)})},e}(n),F=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=g,e.holding=!0,e.playing=!0,e.releaseEvent=null,e}a(e,t);var n=e.prototype;return n.onChange=function(e,t){var n=t.flicking,i=t.triggerEvent,r=t.transitTo,a=n.options.horizontal?e.inputEvent.offsetX:e.inputEvent.offsetY;this.direction=a<0?T.NEXT:T.PREV,i(y.MOVE_START,e,!0).onSuccess(function(){r(p).onChange(e,t)}).onStopped(function(){r(z)})},n.onRelease=function(e,t){var n=t.viewport,i=t.triggerEvent,r=t.transitTo;if(i(y.HOLD_END,e,!0),0!==e.delta.flick)return e.setTo({flick:n.getCameraPosition()},0),void r(w);this.releaseEvent=e},n.onFinish=function(e,t){var n,i,r,a,o,s,l=t.viewport,h=t.triggerEvent;(0,t.transitTo)(w),this.releaseEvent&&(r="touchend"===(n=this.releaseEvent.inputEvent.srcEvent).type?(i=n.changedTouches[0],document.elementFromPoint(i.clientX,i.clientY)):n.target,a=l.panelManager.findPanelOf(r),o=l.getCameraPosition(),a&&(s=a.getPosition(),h(y.SELECT,null,!0,{direction:o<s?T.NEXT:s<o?T.PREV:null,index:a.getIndex(),panel:a})))},e}(n),G=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=p,e.holding=!0,e.playing=!0,e}a(e,t);var n=e.prototype;return n.onChange=function(e,t){var n=t.moveCamera,i=t.transitTo;e.delta.flick&&n(e).onStopped(function(){i(z)})},n.onRelease=function(e,t){var n=t.flicking,i=t.viewport,r=t.triggerEvent,a=t.transitTo,o=t.stopCamera,s=this.delta,l=Math.abs(s),h=n.options,c=h.horizontal,u=i.moveType,g=e.inputEvent,f=c?g.velocityX:g.velocityY,d=c?g.deltaX:g.deltaY,p=1<Math.abs(f)?f<0:0<l?0<s:d<0,v=i.options.bound?Math.max(l,Math.abs(d)):l,P=g.deltaX?Math.abs(180*Math.atan(g.deltaY/g.deltaX)/Math.PI):90,m=c?P<=h.thresholdAngle:P>h.thresholdAngle,x=v>=h.threshold&&m,E={viewport:i,axesEvent:e,state:this,swipeDistance:v,isNextDirection:p};r(y.HOLD_END,e,!0);var C=this.targetPanel;if(!x&&C){var S=u.findPanelWhenInterrupted(E);return i.moveTo(S.panel,S.destPos,S.eventType,e,S.duration),void a(M)}var b=i.getCurrentPanel(),I=i.getNearestPanel();if(!b||!I)return e.stop(),void a(w);var A=x?u.findTargetPanel(E):u.findRestorePanel(E);i.moveTo(A.panel,A.destPos,A.eventType,e,A.duration).onSuccess(function(){a(M)}).onStopped(function(){a(z),o(e)})},e}(n),X=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=M,e.holding=!1,e.playing=!0,e}a(e,t);var n=e.prototype;return n.onHold=function(e,t){var n,i,r,a,o,s=t.viewport,l=t.triggerEvent,h=t.transitTo,c=s.options,u=s.getScrollArea(),g=s.getScrollAreaSize(),f=Math.floor((this.lastPosition+this.delta-u.prev)/g),d=this.targetPanel;c.circular&&0!==f&&d&&(n=s.panelManager.getCloneCount(),i=d.getPosition(),r=B(d.getCloneIndex()-f,-1,n-1,!0),a=i-f*g,(o=d.getIdenticalPanels()[r+1].clone(r,!0)).setPosition(a),this.targetPanel=o),this.delta=0,this.lastPosition=s.getCameraPosition(),s.setCurrentPanel(s.getNearestPanel()),l(y.HOLD_START,e,!0).onSuccess(function(){h(p)}).onStopped(function(){h(z)})},n.onChange=function(e,t){var n=t.moveCamera,i=t.transitTo;e.delta.flick&&n(e).onStopped(function(){i(z)})},n.onFinish=function(e,t){var n=t.flicking,i=t.viewport,r=t.triggerEvent,a=t.transitTo,o=e&&e.isTrusted;i.options.bound?i.setCurrentPanel(this.targetPanel):i.setCurrentPanel(i.getNearestPanel()),n.options.adaptive&&i.updateAdaptiveSize(),a(w),i.updateCameraPosition(),r(y.MOVE_END,e,o,{direction:this.direction})},e}(n),j=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type=z,e.holding=!1,e.playing=!0,e}a(e,t);var n=e.prototype;return n.onAnimationEnd=function(e,t){(0,t.transitTo)(w)},n.onChange=function(e,t){var n=t.viewport,i=t.transitTo;e.stop(),n.updateAxesPosition(n.getCameraPosition()),i(w)},n.onRelease=function(e,t){var n=t.transitTo;0===e.delta.flick&&n(w)},e}(n),q=function(){function e(){var i=this;this.state=new _,this.transitTo=function(e){var t=i.state;if(t.type!==e){var n=void 0;switch(e){case w:n=new _;break;case g:n=new F;break;case p:n=new G;break;case M:n=new X;break;case z:n=new j}t.onExit(n),n.onEnter(t),i.state=n}return i.state}}var t=e.prototype;return t.fire=function(e,t,n){var i=this.state;switch(e){case f.HOLD:i.onHold(t,n);break;case f.CHANGE:i.onChange(t,n);break;case f.RELEASE:i.onRelease(t,n);break;case f.ANIMATION_END:i.onAnimationEnd(t,n);break;case f.FINISH:i.onFinish(t,n)}},t.getState=function(){return this.state},e}(),Y=function(n){function e(e){var t=n.call(this)||this;return t.type=c.SNAP,t.count=e,t}a(e,n);var t=e.prototype;return t.findTargetPanel=function(e){var t=e.viewport,n=e.axesEvent,i=e.swipeDistance,r=this.count,a=Math.abs(n.delta.flick),o=t.getCurrentPanel(),s=t.getNearestPanel(),l=this.calcBrinkOfChange(e),h=s.getIndex()===o.getIndex(),c=t.canSetBoundMode()&&h,u=!t.isOutOfBound()&&(i<=l||c);return 1<r&&l<a?this.findSnappedPanel(e):u?this.findAdjacentPanel(e):{panel:s,duration:t.options.duration,destPos:t.findEstimatedPosition(s),eventType:i<=l||t.isOutOfBound()&&h?y.RESTORE:y.CHANGE}},t.findSnappedPanel=function(e){for(var t=e.axesEvent,n=e.viewport,i=e.state,r=e.isNextDirection,a=Math.abs(t.delta.flick),o=this.calcBrinkOfChange(e),s=this.count,l=n.options,h=n.getScrollAreaSize(),c=l.gap/2,u=t.destPos.flick+n.getRelativeHangerPosition(),g=n.getNearestPanel(),f=g.getCloneIndex()+1,d=0;d<s;){var p=g.getOriginalPanel(),v=p.getPosition()+f*h,P=p.getSize();if(r&&u<v+P+c||!r&&v-c<u)break;var m=r?g.nextSibling:g.prevSibling;if(!m)break;var x=g.getIndex(),E=m.getIndex();(r&&E<=x||!r&&x<=E)&&(f=r?f+1:f-1),g=m,d+=1}var C=g.getOriginalPanel().getPosition();0!==f&&(g=g.clone(g.getCloneIndex(),!0)).setPosition(C+f*h);var S=n.options.duration,b=I(t.duration,S,S*d);return{panel:g,destPos:n.findEstimatedPosition(g),duration:b,eventType:Math.max(a,i.delta)>o?y.CHANGE:y.RESTORE}},t.findAdjacentPanel=function(e){var t=e.viewport,n=e.isNextDirection,i=t.options,r=t.getCurrentIndex(),a=t.panelManager.get(r),o=t.getHangerPosition(),s=t.getScrollArea(),l=a.getIdenticalPanels()[1],h=i.circular&&Math.abs(a.getAnchorPosition()-o)>Math.abs(l.getAnchorPosition()-o)?l:a,c=h.getPosition(),u=n?h.nextSibling:h.prevSibling,g=u?y.CHANGE:y.RESTORE,f=u||h,d=f.getRelativeAnchorPosition(),p=(i.circular?n?c+h.getSize()+d+i.gap:c-(f.getSize()-d)-i.gap:f.getAnchorPosition())-t.getRelativeHangerPosition();return{panel:f,destPos:t.canSetBoundMode()?I(p,s.prev,s.next):p,duration:i.duration,eventType:g}},e}(function(){function e(){}var t=e.prototype;return t.is=function(e){return e===this.type},t.findRestorePanel=function(e){var t=e.viewport,n=t.options,i=n.circular?this.findRestorePanelInCircularMode(e):t.getCurrentPanel();return{panel:i,destPos:t.findEstimatedPosition(i),duration:n.duration,eventType:y.RESTORE}},t.findPanelWhenInterrupted=function(e){var t=e.state,n=e.viewport,i=t.targetPanel;return{panel:i,destPos:n.findEstimatedPosition(i),duration:n.options.duration,eventType:""}},t.calcBrinkOfChange=function(e){var t=e.viewport,n=e.isNextDirection,i=t.options,r=t.getCurrentPanel(),a=i.gap/2,o=r.getRelativeAnchorPosition(),s=n?r.getSize()-o+a:o+a;return s=Math.max(s,i.threshold)},t.findRestorePanelInCircularMode=function(e){var t=e.viewport,n=t.getCurrentPanel().getOriginalPanel(),i=t.getHangerPosition(),r=n.getIdenticalPanels()[1],a=Math.abs(n.getAnchorPosition()-i)>Math.abs(r.getAnchorPosition()-i);return!e.isNextDirection&&a?r:n},e}()),U=function(u){function e(){var e=u.call(this,1/0)||this;return e.type=c.FREE_SCROLL,e}a(e,u);var t=e.prototype;return t.findTargetPanel=function(e){var t=e.axesEvent,n=e.state,i=e.viewport,r=t.destPos.flick,a=this.calcBrinkOfChange(e),o=i.getScrollArea(),s=i.getCurrentPanel(),l=i.options;if(a<Math.abs(t.delta.flick+n.delta)){var h=u.prototype.findSnappedPanel.call(this,e);return h.duration=t.duration,h.destPos=r,h.eventType=l.circular||h.panel!==s?y.CHANGE:"",h}var c=I(c=l.circular?B(r,o.prev,o.next,!1):r,o.prev,o.next);return c+=i.getRelativeHangerPosition(),{panel:i.findNearestPanelAt(c),destPos:r,duration:t.duration,eventType:""}},t.findRestorePanel=function(e){return this.findTargetPanel(e)},t.findPanelWhenInterrupted=function(e){var t=e.viewport;return{panel:t.getNearestPanel(),destPos:t.getCameraPosition(),duration:0,eventType:""}},t.calcBrinkOfChange=function(e){var t=e.viewport,n=e.isNextDirection,i=t.options,r=t.getCurrentPanel(),a=i.gap/2,o=t.stateMachine.getState().lastPosition,s=r.getPosition(),l=o+t.getRelativeHangerPosition(),h=t.getScrollAreaSize(),c=n?s+r.getSize()-l+a:l-s+a,c=Math.abs(c%h);return Math.min(c,h-c)},e}(Y),W=function(){function e(e,t,n){var i=this;this.plugins=[],this.stopCamera=function(e){e&&e.setTo&&e.setTo({flick:i.state.position},0),i.stateMachine.transitTo(w)},this.flicking=e,this.triggerEvent=n,this.state={size:0,position:0,panelMaintainRatio:0,relativeHangerPosition:0,positionOffset:0,scrollArea:{prev:0,next:0},translate:P,infiniteThreshold:0,checkedIndexes:[],isAdaptiveCached:!1,isViewportGiven:!1,isCameraGiven:!1,originalViewportStyle:{className:null,style:null},originalCameraStyle:{className:null,style:null},cachedBbox:null},this.options=t,this.stateMachine=new q,this.visiblePanels=[],this.panelBboxes={},this.build()}var t=e.prototype;return t.moveTo=function(e,t,n,i,r){var a=this;void 0===r&&(r=this.options.duration);var o=this.state,s=this.stateMachine.getState(),l=o.position,h=!!i&&i.isTrusted,c=t===l?null:l<t?T.NEXT:T.PREV,u=n===y.CHANGE?this.triggerEvent(y.CHANGE,i,h,{index:e.getIndex(),panel:e,direction:c}):n===y.RESTORE?this.triggerEvent(y.RESTORE,i,h):{onSuccess:function(e){return e(),this},onStopped:function(){return this}};return u.onSuccess(function(){s.delta=0,s.lastPosition=a.getCameraPosition(),s.targetPanel=e,s.direction=t===l?null:l<t?T.NEXT:T.PREV,t===l&&(a.nearestPanel=e,a.currentPanel=e),i&&i.setTo?i.setTo({flick:t},r):a.axes.setTo({flick:t},r)}),u},t.moveCamera=function(e,t){var n=this.state,i=this.options,r=n.translate.name,a=n.scrollArea;i.circular&&!b(e,a.prev,a.next)&&(e=B(e,a.prev,a.next,!1)),n.position=e,this.nearestPanel=this.findNearestPanel();var o,s,l,h,c=this.nearestPanel,u=c?c.getPosition():0;c?(o=this.getHangerPosition(),s=c.getPosition(),l=c.getSize(),h=i.gap/2,n.panelMaintainRatio=(o-s+h)/(l+2*h)):n.panelMaintainRatio=0,this.checkNeedPanel(t),e+=(c?c.getPosition():0)-u,n.position=e,this.updateVisiblePanels();var g=i.renderOnlyVisible?n.positionOffset:0,f=(i.horizontal?[-(e-g),0]:[0,-(e-g)]).map(function(e){return Math.round(e)+"px"}).join(", ");this.cameraElement.style[r]=n.translate.has3d?"translate3d("+f+", 0px)":"translate("+f+")"},t.unCacheBbox=function(){var e=this.state,t=this.options;e.cachedBbox=null,this.visiblePanels=[];var n=this.viewportElement;t.horizontal?n.style.height="":n.style.width="",e.isAdaptiveCached=!1,this.panelBboxes={}},t.resize=function(){this.updateSize(),this.updateOriginalPanelPositions(),this.updateAdaptiveSize(),this.updateScrollArea(),this.updateClonePanels(),this.updateCameraPosition(),this.updatePlugins()},t.findNearestPanel=function(){var e=this.state,t=this.panelManager,n=this.getHangerPosition();return this.isOutOfBound()?e.position<=e.scrollArea.prev?t.firstPanel():t.lastPanel():this.findNearestPanelAt(n)},t.findNearestPanelAt=function(e){for(var t,n=1/0,i=0,r=this.panelManager.allPanels();i<r.length;i++){var a=r[i];if(a){var o=a.getPosition(),s=o+a.getSize(),l=b(e,o,s)?0:Math.min(Math.abs(o-e),Math.abs(s-e));if(n<l)break;if(l===n&&Math.abs(e-t.getAnchorPosition())<Math.abs(e-a.getAnchorPosition()))break;n=l,t=a}}return t},t.findNearestIdenticalPanel=function(e){var i=e,r=1/0,a=this.getHangerPosition();return e.getIdenticalPanels().forEach(function(e){var t=e.getAnchorPosition(),n=Math.abs(t-a);n<r&&(i=e,r=n)}),i},t.findShortestPositionToPanel=function(e){var t=this.state,n=this.options,i=e.getAnchorPosition(),r=this.getHangerPosition(),a=Math.abs(r-i),o=t.scrollArea.next-t.scrollArea.prev;if(n.circular)return a<=o-a?i-t.relativeHangerPosition:r<i?i-t.relativeHangerPosition-o:i-t.relativeHangerPosition+o;var s=i-t.relativeHangerPosition;return this.canSetBoundMode()?I(s,t.scrollArea.prev,t.scrollArea.next):s},t.findEstimatedPosition=function(e){var t=this.getScrollArea(),n=e.getAnchorPosition()-this.getRelativeHangerPosition();return n=this.canSetBoundMode()?I(n,t.prev,t.next):n},t.addVisiblePanel=function(e){this.getVisibleIndexOf(e)<0&&this.visiblePanels.push(e)},t.enable=function(){this.panInput.enable()},t.disable=function(){this.panInput.disable()},t.insert=function(r,e){var n=this,t=this.panelManager.getLastIndex();if(r<0||t<r)return[];var a=this.state,i=this.options,o=x(e).map(function(e,t){return new L(e,r+t,n)}).slice(0,t-r+1);if(o.length<=0)return[];var s,l,h=this.panelManager.insert(r,o);return this.resizePanels(o),this.currentPanel||(this.currentPanel=o[0],this.nearestPanel=o[0],s=o[0],l=this.findEstimatedPosition(s),a.position=l,this.updateAxesPosition(l),a.panelMaintainRatio=(s.getRelativeAnchorPosition()+i.gap/2)/(s.getSize()+i.gap)),this.updateCheckedIndexes({min:r,max:r}),a.checkedIndexes.forEach(function(e,t){var n=e[0],i=e[1];r<n&&a.checkedIndexes.splice(t,1,[n+h,i+h])}),this.resize(),o},t.replace=function(n,e){var i=this,t=this.state,r=this.options,a=this.panelManager,o=a.getLastIndex();if(n<0||o<n)return[];var s=x(e).map(function(e,t){return new L(e,n+t,i)}).slice(0,o-n+1);if(s.length<=0)return[];a.replace(n,s).forEach(function(e){var t=i.getVisibleIndexOf(e);-1<t&&i.visiblePanels.splice(t,1)}),this.resizePanels(s);var l,h,c=this.currentPanel;return!c?(this.currentPanel=s[0],this.nearestPanel=s[0],l=s[0],h=this.findEstimatedPosition(l),t.position=h,this.updateAxesPosition(h),t.panelMaintainRatio=(l.getRelativeAnchorPosition()+r.gap/2)/(l.getSize()+r.gap)):b(c.getIndex(),n,n+s.length-1)&&(this.currentPanel=a.get(c.getIndex())),this.updateCheckedIndexes({min:n,max:n+s.length-1}),this.resize(),s},t.remove=function(e,t){void 0===t&&(t=1);var n=this.state;e=Math.max(e,0);var i,r=this.panelManager,a=this.getCurrentIndex(),o=r.remove(e,t);b(a,e,e+t-1)&&(i=Math.max(e-1,r.getRange().min),this.currentPanel=r.get(i)),0<t&&(this.updateCheckedIndexes({min:e-1,max:e+t}),this.visiblePanels=[]),r.getPanelCount()<=0&&(this.currentPanel=void 0,this.nearestPanel=void 0),this.resize();var s,l=n.scrollArea;return(n.position<l.prev||n.position>l.next)&&(s=B(n.position,l.prev,l.next,!1),this.moveCamera(s),this.updateAxesPosition(s)),o},t.updateAdaptiveSize=function(){var e,t,n,i,r,a,o=this.state,s=this.options,l=s.horizontal,h=this.getCurrentPanel();h&&(e=s.adaptive||!o.isAdaptiveCached,t=this.viewportElement.style,e&&(i=void 0,i=s.adaptive?(n=h.getBbox(),l?n.height:n.width):this.panelManager.originalPanels().reduce(function(e,t){var n=t.getBbox();return Math.max(e,l?n.height:n.width)},0),o.isAdaptiveCached||(r=this.updateBbox(),i=Math.max(i,l?r.height:r.width),o.isAdaptiveCached=!0),a=i+"px",l?(t.height=a,o.cachedBbox.height=i):(t.width=a,o.cachedBbox.width=i)))},t.updateCameraPosition=function(){var e,t,n,i=this.state,r=this.getCurrentPanel(),a=this.getCameraPosition(),o=this.stateMachine.getState(),s=this.moveType.is(c.FREE_SCROLL),l=this.getRelativeHangerPosition(),h=this.options.gap/2;o.holding||o.playing?this.updateVisiblePanels():(n=s?(e=this.canSetBoundMode()&&(a===i.scrollArea.prev||a===i.scrollArea.next),t=this.getNearestPanel(),e||!t?a:t.getPosition()-h+(t.getSize()+2*h)*i.panelMaintainRatio-l):r?r.getAnchorPosition()-l:a,this.canSetBoundMode()&&(n=I(n,i.scrollArea.prev,i.scrollArea.next)),this.updateAxesPosition(n),this.moveCamera(n))},t.updateBbox=function(){var e=this.state,t=this.options,n=this.viewportElement;return e.cachedBbox||(e.cachedBbox=H(n,t.useOffset)),e.cachedBbox},t.updatePlugins=function(){var t=this;this.plugins.forEach(function(e){e.update&&e.update(t.flicking)})},t.destroy=function(t){var n,e,i=this.state,r=this.flicking.getElement(),a=this.viewportElement,o=this.cameraElement,s=this.panelManager.originalPanels();for(var l in this.removePlugins(this.plugins),t.preserveUI||(V(a,i.originalViewportStyle),V(o,i.originalCameraStyle),i.isCameraGiven||this.options.renderExternal||(n=i.isViewportGiven?a:r,e=i.isViewportGiven?o:a,s.forEach(function(e){n.appendChild(e.getElement())}),n.removeChild(e))),this.axes.destroy(),this.panInput.destroy(),s.forEach(function(e){e.destroy(t)}),this)this[l]=null},t.restore=function(e){var t=e.panels,n=this.options.defaultIndex,i=this.cameraElement,r=this.panelManager;i.innerHTML=t.map(function(e){return e.html}).join(""),this.refreshPanels();var a=r.originalPanels(),o=[];t.forEach(function(e,t){var n=a[t];n.setIndex(e.index),o[e.index]=n}),r.replacePanels(o,[]),r.setCloneCount(0),0<r.getPanelCount()?(this.currentPanel=r.get(e.index)||r.get(n)||r.firstPanel(),this.nearestPanel=this.currentPanel):(this.currentPanel=void 0,this.nearestPanel=void 0),this.visiblePanels=o.filter(function(e){return Boolean(e)}),this.resize(),this.axes.setTo({flick:e.position},0),this.moveCamera(e.position)},t.calcVisiblePanels=function(){var e=this.panelManager.allPanels();if(this.options.renderOnlyVisible){var t=this.getCameraPosition(),n=this.getSize(),i=this.nearestPanel,r=function(e,t,n){for(var i=[],r=e;;){var a=t(r);if(!a||n(a))break;i.push(a),r=a}return i},a=this.panelManager.getPanelCount(),o=function(e){return e.getIndex()+(e.getCloneIndex()+1)*a},s=r(i,function(e){var t=e.nextSibling;return t&&t.getPosition()>=e.getPosition()?t:null},function(e){return e.getPosition()>=t+n}),l=r(i,function(e){var t=e.prevSibling;return t&&t.getPosition()<=e.getPosition()?t:null},function(e){return e.getPosition()+e.getSize()<=t});return[i].concat(s,l).sort(function(e,t){return o(e)-o(t)})}return e.filter(function(e){var t=e.getOutsetProgress();return-1<t&&t<1})},t.getCurrentPanel=function(){return this.currentPanel},t.getCurrentIndex=function(){var e=this.currentPanel;return e?e.getIndex():-1},t.getNearestPanel=function(){return this.nearestPanel},t.getCurrentProgress=function(){var e=this.stateMachine.getState(),t=e.playing||e.holding?this.nearestPanel:this.currentPanel,n=this.panelManager;if(!t)return NaN;var i=this.getScrollArea(),r=i.prev,a=i.next,o=this.getCameraPosition(),s=this.isOutOfBound(),l=t.prevSibling,h=t.nextSibling,c=this.getHangerPosition(),u=t.getAnchorPosition();s&&l&&h&&o<a&&c-l.getAnchorPosition()<u-c&&(h=(t=l).nextSibling,l=t.prevSibling,u=t.getAnchorPosition());var g,f=t.getIndex()+(t.getCloneIndex()+1)*n.getPanelCount(),d=t.getSize();s&&(a+(g=this.getRelativeHangerPosition())<u?c=u+c-g-a:u<r+g&&(c=u+c-g-r));var p=u<=c,v=this.options.gap,P=u,m=u;p?m=h?h.getAnchorPosition():u+d+v:P=l?l.getAnchorPosition():u-d-v;var x=(c-P)/(m-P);return(p?f:l?l.getIndex():f-1)+x},t.updateAxesPosition=function(e){var t=this.axes;t.off(),t.setTo({flick:e},0),t.on(this.axesHandlers)},t.getSize=function(){return this.state.size},t.getScrollArea=function(){return this.state.scrollArea},t.isOutOfBound=function(){var e=this.state,t=this.options,n=e.scrollArea;return!t.circular&&t.bound&&(e.position<=n.prev||e.position>=n.next)},t.canSetBoundMode=function(){var e=this.options;return e.bound&&!e.circular},t.getViewportElement=function(){return this.viewportElement},t.getCameraElement=function(){return this.cameraElement},t.getScrollAreaSize=function(){var e=this.state.scrollArea;return e.next-e.prev},t.getRelativeHangerPosition=function(){return this.state.relativeHangerPosition},t.getHangerPosition=function(){return this.state.position+this.state.relativeHangerPosition},t.getCameraPosition=function(){return this.state.position},t.getPositionOffset=function(){return this.state.positionOffset},t.getCheckedIndexes=function(){return this.state.checkedIndexes},t.getVisiblePanels=function(){return this.visiblePanels},t.setCurrentPanel=function(e){this.currentPanel=e},t.setLastIndex=function(e){var t=this.currentPanel,n=this.panelManager;n.setLastIndex(e),t&&t.getIndex()>e&&(this.currentPanel=n.lastPanel()),this.resize()},t.setVisiblePanels=function(e){this.visiblePanels=e},t.connectAxesHandler=function(e){var t=this.axes;this.axesHandlers=e,t.on(e)},t.addPlugins=function(e){var t=this,n=[].concat(e);return n.forEach(function(e){e.init(t.flicking)}),this.plugins=this.plugins.concat(n),this},t.removePlugins=function(e){var n=this,i=this.plugins;return[].concat(e).forEach(function(e){var t=i.indexOf(e);-1<t&&i.splice(t,1),e.destroy(n.flicking)}),this},t.updateCheckedIndexes=function(r){var a=this.state,o=0;a.checkedIndexes.concat().forEach(function(e,t){var n=e[0],i=e[1];r.min<=i&&r.max>=n&&(a.checkedIndexes.splice(t-o,1),o++)})},t.appendUncachedPanelElements=function(e){var t,n,i,r=this,a=this.options,o=document.createDocumentFragment();a.isEqualSize?(t=this.visiblePanels,n=a.isEqualSize,i={},this.visiblePanels=[],Object.keys(this.panelBboxes).forEach(function(e){i[e]=!0}),e.forEach(function(e){var t=e.getOverlappedClass(n);t&&!i[t]?(a.renderExternal||o.appendChild(e.getElement()),r.visiblePanels.push(e),i[t]=!0):t||(a.renderExternal||o.appendChild(e.getElement()),r.visiblePanels.push(e))}),t.forEach(function(e){r.addVisiblePanel(e)})):(a.renderExternal||e.forEach(function(e){return o.appendChild(e.getElement())}),this.visiblePanels=e.filter(function(e){return Boolean(e)})),a.renderExternal||this.cameraElement.appendChild(o)},t.updateClonePanels=function(){var e=this.panelManager;this.options.circular&&0<e.getPanelCount()&&(this.clonePanels(),this.updateClonedPanelPositions()),e.chainAllPanels()},t.getVisibleIndexOf=function(t){return O(this.visiblePanels,function(e){return e===t})},t.build=function(){this.setElements(),this.applyCSSValue(),this.setMoveType(),this.setAxesInstance(),this.refreshPanels(),this.setDefaultPanel(),this.resize(),this.moveToDefaultPanel()},t.setElements=function(){var e=this.state,t=this.options,n=this.flicking.getElement(),i=t.classPrefix,r=n.children[0],a=r&&C(r,i+"-viewport"),o=a?r:document.createElement("div"),s=a?o.children[0]:n.children[0],l=s&&C(s,i+"-camera"),h=l?s:document.createElement("div");l?e.originalCameraStyle={className:h.getAttribute("class"),style:h.getAttribute("style")}:(h.className=i+"-camera",A(a?o.children:n.children).forEach(function(e){h.appendChild(e)})),a?e.originalViewportStyle={className:o.getAttribute("class"),style:o.getAttribute("style")}:(o.className=i+"-viewport",n.appendChild(o)),l&&a||o.appendChild(h),this.viewportElement=o,this.cameraElement=h,e.isViewportGiven=a,e.isCameraGiven=l},t.applyCSSValue=function(){var e=this.options,t=this.viewportElement,n=this.cameraElement,i=this.viewportElement.style;S(t,l),S(n,h),t.style.zIndex=""+e.zIndex,e.horizontal?(i.minHeight="100%",i.width="100%"):(i.minWidth="100%",i.height="100%"),e.overflow&&(i.overflow="visible"),this.panelManager=new D(this.cameraElement,e)},t.setMoveType=function(){var e=this.options.moveType;switch(e.type){case c.SNAP:this.moveType=new Y(e.count);break;case c.FREE_SCROLL:this.moveType=new U;break;default:throw new Error("moveType is not correct!")}},t.setAxesInstance=function(){var e=this.state,t=this.options,n=e.scrollArea,i=t.horizontal;this.axes=new r({flick:{range:[n.prev,n.next],circular:t.circular,bounce:[0,0]}},{easing:t.panelEffect,deceleration:t.deceleration,interruptable:!0}),this.panInput=new r.PanInput(this.viewportElement,{inputType:t.inputType,thresholdAngle:t.thresholdAngle,iOSEdgeSwipeThreshold:t.iOSEdgeSwipeThreshold,scale:t.horizontal?[-1,0]:[0,-1]}),this.axes.connect(i?["flick",""]:["","flick"],this.panInput)},t.refreshPanels=function(){var n=this,e=this.panelManager,t=A(this.cameraElement.children).map(function(e,t){return new L(e,t,n)});e.replacePanels(t,[]),this.visiblePanels=t.filter(function(e){return Boolean(e)})},t.setDefaultPanel=function(){var e=this.options,t=this.panelManager,n=this.panelManager.getRange(),i=I(e.defaultIndex,n.min,n.max);this.currentPanel=t.get(i)},t.clonePanels=function(){var e=this.state,t=this.options,r=this.panelManager,n=t.gap,i=e.size,a=r.firstPanel(),o=r.lastPanel();if(a){for(var s,l=r.originalPanels(),h=l.concat().reverse(),c=o.getPosition()+o.getSize()-a.getPosition()+n,u=a.getRelativeAnchorPosition(),g=this.getRelativeHangerPosition(),f=(g-u)%c,d=0,p=0,v=h;p<v.length;p++){if((m=v[p])&&f<=(d+=m.getSize()+n)){s=m;break}}for(var P,m,x=(i-g+u)%c,d=0,E=0,C=l;E<C.length;E++){if((m=C[E])&&x<=(d+=m.getSize()+n)){P=m;break}}var S=0!==s.getIndex()&&s.getIndex()<=P.getIndex(),b=Math.ceil((g+a.getSize()-u)/c)+Math.ceil((i-g+u)/c)-1+(S?1:0),I=r.getCloneCount();if(r.setCloneCount(b),!t.renderExternal)if(I<b)for(var A=this,y=I;y<b;y++)!function(t){var e,n=l.map(function(e){return e.clone(t)}),i=document.createDocumentFragment();n.forEach(function(e){return i.appendChild(e.getElement())}),A.cameraElement.appendChild(i),(e=A.visiblePanels).push.apply(e,n.filter(function(e){return Boolean(e)})),r.insertClones(t,0,n)}(y);else b<I&&r.removeClonesAfter(b)}},t.moveToDefaultPanel=function(){var e=this.state,t=this.panelManager,n=this.options,i=this.panelManager.getRange(),r=I(n.defaultIndex,i.min,i.max),a=t.get(r),o=0;a&&(o=a.getAnchorPosition()-e.relativeHangerPosition,o=this.canSetBoundMode()?I(o,e.scrollArea.prev,e.scrollArea.next):o),this.moveCamera(o),this.axes.setTo({flick:o},0)},t.updateSize=function(){var e=this.state,t=this.options,n=this.panelManager.originalPanels().filter(function(e){return Boolean(e)}),i=this.updateBbox(),r=e.size;e.size=t.horizontal?i.width:i.height,r!==e.size&&(e.relativeHangerPosition=N(t.hanger,e.size),e.infiniteThreshold=N(t.infiniteThreshold,e.size)),n.length<=0||this.resizePanels(n)},t.updateOriginalPanelPositions=function(){var e,t,n,i,r,a,o,s=this.options.gap,l=this.panelManager,h=l.firstPanel(),c=l.originalPanels();h&&(e=this.currentPanel,t=this.nearestPanel,n=this.stateMachine.getState(),i=this.state.scrollArea,o=h.getPosition(),r=h,t?r=!b(n.lastPosition+n.delta,i.prev,i.next)?e:t:0<h.getIndex()&&(r=e),a=c.slice(0,r.getIndex()+(r.getCloneIndex()+1)*c.length).reduce(function(e,t){return e+t.getSize()+s},0),o=r.getPosition()-a,c.forEach(function(e){var t=o,n=e.getSize();e.setPosition(t),o+=n+s}),this.options.renderOnlyVisible||c.forEach(function(e){return e.setPositionCSS()}))},t.updateClonedPanelPositions=function(){var e=this.state,t=this.options,n=this.panelManager,i=n.clonedPanels().reduce(function(e,t){return e.concat(t)},[]).filter(function(e){return Boolean(e)}),r=e.scrollArea,a=n.firstPanel(),o=n.lastPanel();if(a){for(var s=o.getPosition()+o.getSize()-a.getPosition()+t.gap,l=0,h=i;l<h.length;l++){var c=(p=h[l]).getOriginalPanel(),u=s*(p.getCloneIndex()+1)+c.getPosition();p.setPosition(u)}for(var g=a.getPosition(),f=0,d=i.concat().reverse();f<d.length;f++){var p,v=(p=d[f]).getSize(),P=g-v-t.gap;if(P+v<=r.prev)break;p.setPosition(P),g=P}this.options.renderOnlyVisible||i.forEach(function(e){e.setPositionCSS()})}},t.updateScrollArea=function(){var e,t,n,i=this.state,r=this.panelManager,a=this.options,o=this.axes,s=r.firstPanel(),l=r.lastPanel(),h=i.relativeHangerPosition;s?this.canSetBoundMode()?(n=l.getPosition()+l.getSize()-s.getPosition())>=i.size?i.scrollArea={prev:s.getPosition(),next:l.getPosition()+l.getSize()-i.size}:(e=N(a.anchor,n),t=s.getPosition()+I(e,n-(i.size-h),h),i.scrollArea={prev:t-h,next:t-h}):a.circular?(n=l.getPosition()+l.getSize()-s.getPosition()+a.gap,i.scrollArea={prev:s.getAnchorPosition()-h,next:n+s.getAnchorPosition()-h}):i.scrollArea={prev:s.getAnchorPosition()-h,next:l.getAnchorPosition()-h}:i.scrollArea={prev:0,next:0};var c,u,g,f=i.size,d=a.bounce;u=(g=d)&&g.constructor===Array?d.map(function(e){return N(e,f,v.bounce)}):[c=N(d,f,v.bounce),c];var p=o.axis.flick;p.range=[i.scrollArea.prev,i.scrollArea.next],p.bounce=u},t.checkNeedPanel=function(e){var t=this.state,n=this.options,i=this.panelManager,r=this.currentPanel,a=this.nearestPanel,o=this.stateMachine.getState();if(n.infinite){var s=n.gap,l=t.infiniteThreshold,h=i.getLastIndex();if(!(h<0))if(r&&a){for(var c=a.getPosition(),u=o.holding||o.playing?a:r;u;){var g,f=u.getIndex(),d=u.nextSibling,p=!(f===(E=i.lastPanel()).getIndex())&&d?d.getIndex():h+1,v=a.getPosition(),P=u.getPosition()+u.getSize()-(v-c)+s-l<=t.position+t.size;1<p-f&&P&&this.triggerNeedPanel({axesEvent:e,siblingPanel:u,direction:T.NEXT,indexRange:{min:f+1,max:p-1,length:p-f-1}}),n.circular&&f===h&&P&&(0<(g=(x=i.firstPanel())?x.getIndex():-1)&&this.triggerNeedPanel({axesEvent:e,siblingPanel:u,direction:T.NEXT,indexRange:{min:0,max:g-1,length:g}}));var m=i.lastPanel();if(m&&f===m.getIndex()||!P)break;u=u.nextSibling}for(u=a;u;){var x,E,C,S=t.position,b=u.getIndex(),I=u.prevSibling,A=!(b===(x=i.firstPanel()).getIndex())&&I?I.getIndex():-1,v=a.getPosition(),P=S<=u.getPosition()-(v-c)-s+l;1<b-A&&P&&this.triggerNeedPanel({axesEvent:e,siblingPanel:u,direction:T.PREV,indexRange:{min:A+1,max:b-1,length:b-A-1}}),n.circular&&0===b&&P&&(E=i.lastPanel())&&E.getIndex()<h&&(C=E.getIndex(),this.triggerNeedPanel({axesEvent:e,siblingPanel:u,direction:T.PREV,indexRange:{min:C+1,max:h,length:h-C}}));var y=i.firstPanel();if(y&&b===y.getIndex()||!P)break;u=u.prevSibling}}else this.triggerNeedPanel({axesEvent:e,siblingPanel:null,direction:null,indexRange:{min:0,max:h,length:h+1}})}},t.triggerNeedPanel=function(e){var r,t,a=this,n=e.axesEvent,o=e.siblingPanel,s=e.direction,l=e.indexRange,h=this.options,i=this.state.checkedIndexes,c=i.some(function(e){var t=e[0],n=e[1];return t===l.min||n===l.max}),u=this.flicking.hasOn(y.NEED_PANEL);!c&&u&&(i.push([l.min,l.max]),r=o?o.getIndex():0,t=!!n&&n.isTrusted,this.triggerEvent(y.NEED_PANEL,n,t,{index:r,panel:o,direction:s,range:l,fill:function(e){var t=a.panelManager;if(!o)return a.insert(t.getRange().max+1,e);var n=x(e),i=s===T.NEXT?n.slice(0,l.length):n.slice(-l.length);return s===T.NEXT?h.circular&&r===t.getLastIndex()?a.insert(0,i):o.insertAfter(i):s===T.PREV?h.circular&&0===r?a.insert(l.max-i.length+1,i):o.insertBefore(i):a.insert(0,i)}}))},t.updateVisiblePanels=function(){var t=this.state,e=this.options,n=this.panelManager,i=this.stateMachine.getState(),r=this.cameraElement,a=e.renderExternal;if(e.renderOnlyVisible)if(this.nearestPanel){var o,s,l,h,c,u,g=this.visiblePanels,f=this.calcVisiblePanels(),d=this.checkVisiblePanelChange(g,f),p=d.addedPanels,v=d.removedPanels;p.length<=0&&v.length<=0||(i.holding?f.push.apply(f,v):(o=f[0].getPosition(),t.positionOffset=o),f.forEach(function(e){e.setPositionCSS(t.positionOffset)}),a||(i.holding||v.forEach(function(e){var t=e.getElement();t.parentNode&&r.removeChild(t)}),s=document.createDocumentFragment(),p.forEach(function(e){s.appendChild(e.getElement())}),r.appendChild(s)),l=f[0],h=f[f.length-1],u={min:(c=function(e){return e.getIndex()+(e.getCloneIndex()+1)*n.getPanelCount()})(l),max:c(h)},this.visiblePanels=f,this.flicking.trigger(y.VISIBLE_CHANGE,{type:y.VISIBLE_CHANGE,range:u}))}else for(this.visiblePanels=[];r.firstChild;)r.removeChild(r.firstChild)},t.checkVisiblePanelChange=function(i,r){var a=i.map(function(){return 0}),o=r.map(function(){return 0});return i.forEach(function(n,i){r.forEach(function(e,t){n===e&&(a[i]++,o[t]++)})}),{removedPanels:a.reduce(function(e,t,n){return 0===t?e.concat([i[n]]):e},[]),addedPanels:o.reduce(function(e,t,n){return 0===t?e.concat([r[n]]):e},[])}},t.resizePanels=function(e){var n,t,i,r=this.options,a=this.panelBboxes;!0!==r.isEqualSize?r.isEqualSize?(n=r.isEqualSize,e.forEach(function(e){var t=e.getOverlappedClass(n);t?(e.resize(a[t]),a[t]=e.getBbox()):e.resize()})):e.forEach(function(e){e.resize()}):(a.default||(t=e[0],a.default=t.getBbox()),i=a.default,e.forEach(function(e){e.resize(i)}))},e}(),J=function(g){function e(e,t){void 0===t&&(t={});var n,u=g.call(this)||this;if(u.isPanelChangedAtBeforeSync=!1,u.resize=function(){var e=u.viewport,t=u.options,n=u.getElement(),i=e.panelManager.allPanels();t.isConstantSize||i.forEach(function(e){return e.unCacheBbox()});var r=t.renderOnlyVisible&&!t.isConstantSize&&!0!==t.isEqualSize,a=n.parentElement,o=a.style.height;return a.style.height=a.offsetHeight+"px",e.unCacheBbox(),e.updateBbox(),r&&e.appendUncachedPanelElements(i),e.resize(),a.style.height=o,u},u.triggerEvent=function(e,t,n,i){void 0===i&&(i={});var r,a,o,s,l,h=u.viewport,c=!0;return h&&(r=h.stateMachine.getState(),o=(a=h.getScrollArea()).prev,s=a.next,l=R(h.getCameraPosition(),[o,o,s]),u.options.circular&&(l%=1),c=!g.prototype.trigger.call(u,e,m({type:e,index:u.getIndex(),panel:u.getCurrentPanel(),direction:r.direction,holding:r.holding,progress:l,axesEvent:t,isTrusted:n},i))),{onSuccess:function(e){return c||e(),this},onStopped:function(e){return c&&e(),this}}},u.moveCamera=function(e){var t,n,i,r,a=u.viewport,o=a.stateMachine.getState(),s=u.options,l=e.pos.flick,h=a.getCameraPosition();return e.isTrusted&&o.holding&&(t=s.horizontal?e.inputEvent.offsetX:e.inputEvent.offsetY,i=l-h,n=t<0==l<h,s.circular&&n&&(i=(0<i?-1:1)*(a.getScrollAreaSize()-Math.abs(i))),r=0===i?o.direction:0<i?T.NEXT:T.PREV,o.direction=r),o.delta+=e.delta.flick,a.moveCamera(l,e),u.triggerEvent(y.MOVE,e,e.isTrusted).onStopped(function(){a.moveCamera(h,e)})},E(e)){if(!(n=document.querySelector(e)))throw new Error("Base element doesn't exist.")}else{if(!e.nodeName||1!==e.nodeType)throw new Error("Element should be provided in string or HTMLElement.");n=e}u.wrapper=n,u.options=m({},v,t);var i=u.options,r=i.moveType;return r in o&&(i.moveType=o[r]),u.viewport=new W(u,u.options,u.triggerEvent),u.listenInput(),u.listenResize(),u}a(e,g);var t=e.prototype;return t.prev=function(e){var t,n=this.getCurrentPanel(),i=this.viewport.stateMachine.getState();return!n||i.type!==w||(t=n.prev())&&t.focus(e),this},t.next=function(e){var t,n=this.getCurrentPanel(),i=this.viewport.stateMachine.getState();return!n||i.type!==w||(t=n.next())&&t.focus(e),this},t.moveTo=function(e,t){var n=this.viewport,i=n.panelManager.get(e),r=n.stateMachine.getState();if(!i||r.type!==w)return this;var a,o,s,l,h=i.getAnchorPosition(),c=n.getHangerPosition(),u=i;this.options.circular&&(o=[h-(a=n.getScrollAreaSize()),h,h+a].reduce(function(e,t){return Math.abs(t-c)<Math.abs(e-c)?t:e},1/0)-i.getRelativeAnchorPosition(),s=i.getIdenticalPanels(),0<(l=o-h)?u=s[1]:l<0&&(u=s[s.length-1]),(u=u.clone(u.getCloneIndex(),!0)).setPosition(o));var g=this.getIndex();if(c===u.getAnchorPosition()&&g===e)return this;var f=i.getIndex()===n.getCurrentIndex()?"":y.CHANGE;return n.moveTo(u,n.findEstimatedPosition(u),f,null,t),this},t.getIndex=function(){return this.viewport.getCurrentIndex()},t.getElement=function(){return this.wrapper},t.getCurrentPanel=function(){var e=this.viewport.getCurrentPanel();return e||null},t.getPanel=function(e){var t=this.viewport.panelManager.get(e);return t||null},t.getAllPanels=function(e){var t=this.viewport.panelManager;return(e?t.allPanels():t.originalPanels()).filter(function(e){return!!e})},t.getVisiblePanels=function(){return this.viewport.calcVisiblePanels()},t.getPanelCount=function(){return this.viewport.panelManager.getPanelCount()},t.getCloneCount=function(){return this.viewport.panelManager.getCloneCount()},t.getLastIndex=function(){return this.viewport.panelManager.getLastIndex()},t.setLastIndex=function(e){return this.viewport.setLastIndex(e),this},t.isPlaying=function(){return this.viewport.stateMachine.getState().playing},t.enableInput=function(){return this.viewport.enable(),this},t.disableInput=function(){return this.viewport.disable(),this},t.getStatus=function(){var e=this.viewport,t=e.panelManager.originalPanels().filter(function(e){return!!e}).map(function(e){return{html:e.getElement().outerHTML,index:e.getIndex()}});return{index:e.getCurrentIndex(),panels:t,position:e.getCameraPosition()}},t.setStatus=function(e){this.viewport.restore(e)},t.addPlugins=function(e){return this.viewport.addPlugins(e),this},t.removePlugins=function(e){return this.viewport.removePlugins(e),this},t.destroy=function(e){for(var t in void 0===e&&(e={}),this.off(),this.options.autoResize&&window.removeEventListener("resize",this.resize),this.viewport.destroy(e),this)this[t]=null},t.prepend=function(e){var t=this.viewport,n=x(e),i=Math.max(t.panelManager.getRange().min-n.length,0);return t.insert(i,n)},t.append=function(e){var t=this.viewport;return t.insert(t.panelManager.getRange().max+1,e)},t.replace=function(e,t){return this.viewport.replace(e,t)},t.remove=function(e,t){return void 0===t&&(t=1),this.viewport.remove(e,t)},t.getRenderingIndexes=function(e){var t=this.viewport,n=t.getVisiblePanels(),i=e.maintained.reduce(function(e,t){var n=t[0],i=t[1];return e[n]=i,e},{}),r=e.prevList.length,a=e.list.length,o=e.added,s=n.map(function(e){return(t=e).getIndex()+(t.getCloneIndex()+1)*r;var t}).filter(function(e){return null!=i[e%r]}).map(function(e){var t=Math.floor(e/r);return i[e%r]+a*t}).concat(o),l=t.panelManager.allPanels();return t.setVisiblePanels(s.map(function(e){return l[e]})),s},t.beforeSync=function(e){var t=this,n=e.maintained,o=e.added,i=e.changed,a=e.removed,r=this.viewport,s=r.panelManager,l=this.options.circular,h=s.getCloneCount(),c=s.clonedPanels(),u=r.getVisiblePanels().filter(function(t){return O(a,function(e){return e===t.getIndex()})<0});if(r.setVisiblePanels(u),o.length<=0&&a.length<=0&&i.length<=0&&h===c.length)return this;var g=s.originalPanels(),f=[],d=k(h).map(function(){return[]});n.forEach(function(e){var t=e[0],n=e[1];f[n]=g[t],f[n].setIndex(n)}),o.forEach(function(e){f[e]=new L(null,e,t.viewport)}),l&&k(h).forEach(function(i){var r=c[i],a=d[i];n.forEach(function(e){var t=e[0],n=e[1];a[n]=r?r[t]:f[n].clone(i,!1),a[n].setIndex(n)}),o.forEach(function(e){var t=f[e];a[e]=t.clone(i,!1)})}),o.forEach(function(e){r.updateCheckedIndexes({min:e,max:e})}),a.forEach(function(e){r.updateCheckedIndexes({min:e-1,max:e+1})});var p=r.getCheckedIndexes();p.forEach(function(e,t){var n=e[0],i=e[1],r=o.filter(function(e){return e<n&&s.has(e)}).length-a.filter(function(e){return e<n}).length;p.splice(t,1,[n+r,i+r])}),0<i.length&&n.forEach(function(e){var t=e[1];r.updateCheckedIndexes({min:t,max:t})}),s.replacePanels(f,d),this.isPanelChangedAtBeforeSync=!0},t.sync=function(e){var i=e.list,t=e.maintained,n=e.added,r=e.changed,a=e.removed;if(n.length<=0&&a.length<=0&&r.length<=0)return this;var o,s,l,h,c,u,g=this.viewport,f=this.options,d=f.renderOnlyVisible,p=f.circular,v=g.panelManager;d||(o=v.getRange(),u=e,p&&(s=o.max,l=i.length/(v.getCloneCount()+1)>>0,h=n.filter(function(e){return e<l}),c=a.filter(function(e){return e<=s}),u={added:h,maintained:t.filter(function(e){return e[0]<=s}),removed:c,changed:r.filter(function(e){return e[0]<=s})}),this.beforeSync(u));var P=d?g.getVisiblePanels():this.getAllPanels(!0);return n.forEach(function(e){var t=i[e],n=P[e];n.setElement(t),n.unCacheBbox()}),this.isPanelChangedAtBeforeSync&&(g.setVisiblePanels([]),this.isPanelChangedAtBeforeSync=!1),g.resize(),this},t.listenInput=function(){var n=this,e=n.viewport,i=e.stateMachine;n.eventContext={flicking:n,viewport:n.viewport,transitTo:i.transitTo,triggerEvent:n.triggerEvent,moveCamera:n.moveCamera,stopCamera:e.stopCamera};var r={};for(var t in f)!function(e){var t=f[e];r[t]=function(e){return i.fire(t,e,n.eventContext)}}(t);n.viewport.connectAxesHandler(r)},t.listenResize=function(){this.options.autoResize&&window.addEventListener("resize",this.resize)},e.VERSION="3.5.1",e.DIRECTION=T,e.EVENTS=y,e}(e);return J.withFlickingMethods=function(e,a){Object.keys(t).forEach(function(r){e[r]||(e[r]=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=(e=this[a])[r].apply(e,t);return i===this[a]?this:i})})},J.DEFAULT_OPTIONS=v,J.MOVE_TYPE=c,J});
//# sourceMappingURL=flicking.min.js.map
{
"name": "@egjs/flicking",
"version": "3.5.0",
"version": "3.5.1",
"description": "Everyday 30 million people experience. It's reliable, flexible and extendable carousel.",

@@ -50,7 +50,9 @@ "main": "dist/flicking.js",

"devDependencies": {
"@daybrush/jsdoc": "^0.3.7",
"@daybrush/jsdoc": "^0.3.8",
"@egjs/build-helper": "0.0.5",
"@egjs/release-helper": "0.0.3",
"@types/chai": "^4.0.10",
"@types/karma-chai": "^0.1.1",
"@types/mocha": "^5.2.5",
"@types/node": "^14.0.27",
"@types/sinon": "^7.0.3",

@@ -57,0 +59,0 @@ "chai": "^4.2.0",

@@ -151,3 +151,3 @@ <h1 align=center style="max-width: 100%;">

## 🌐 Supported Browsers
|<img width="20" src="https://simpleicons.org/icons/internetexplorer.svg" alt="IE" />|<img width="20" src="https://simpleicons.org/icons/googlechrome.svg" alt="Chrome" />|<img width="20" src="https://simpleicons.org/icons/mozillafirefox.svg" alt="Firefox" />|<img width="20" src="https://simpleicons.org/icons/safari.svg" alt="Safari" />|<img width="20" src="https://simpleicons.org/icons/apple.svg" alt="iOS" />|<img width="20" src="https://simpleicons.org/icons/android.svg" alt="Android">|
|<img width="20" src="https://simpleicons.org/icons/internetexplorer.svg" alt="IE" />|<img width="20" src="https://simpleicons.org/icons/googlechrome.svg" alt="Chrome" />|<img width="20" src="https://simpleicons.org/icons/firefoxbrowser.svg" alt="Firefox" />|<img width="20" src="https://simpleicons.org/icons/safari.svg" alt="Safari" />|<img width="20" src="https://simpleicons.org/icons/apple.svg" alt="iOS" />|<img width="20" src="https://simpleicons.org/icons/android.svg" alt="Android">|
|:---:|:---:|:---:|:---:|:---:|:---:|

@@ -154,0 +154,0 @@ |10+|Latest|Latest|Latest|7+|4+|

@@ -591,2 +591,3 @@ /**

const currentPanel = this.getCurrentPanel();
const cameraPosition = this.getCameraPosition();
const currentState = this.stateMachine.getState();

@@ -604,11 +605,13 @@ const isFreeScroll = this.moveType.is(MOVE_TYPE.FREE_SCROLL);

if (isFreeScroll) {
const positionBounded = this.canSetBoundMode() && (cameraPosition === state.scrollArea.prev || cameraPosition === state.scrollArea.next);
const nearestPanel = this.getNearestPanel();
newPosition = nearestPanel
? nearestPanel.getPosition() - halfGap + (nearestPanel.getSize() + 2 * halfGap) * state.panelMaintainRatio - relativeHangerPosition
: this.getCameraPosition();
// Preserve camera position if it is bound to scroll area limit
newPosition = positionBounded || !nearestPanel
? cameraPosition
: nearestPanel.getPosition() - halfGap + (nearestPanel.getSize() + 2 * halfGap) * state.panelMaintainRatio - relativeHangerPosition;
} else {
newPosition = currentPanel
? currentPanel.getAnchorPosition() - relativeHangerPosition
: this.getCameraPosition();
: cameraPosition;
}

@@ -615,0 +618,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc