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 4.0.0 to 4.1.0

1

declaration/const/external.d.ts

@@ -19,2 +19,3 @@ export { CODE as ERROR_CODE } from "./error";

readonly REACH_EDGE: "reachEdge";
readonly PANEL_CHANGE: "panelChange";
};

@@ -21,0 +22,0 @@ export declare const ALIGN: {

5

declaration/Flicking.d.ts

@@ -8,3 +8,3 @@ import Component from "@egjs/component";

import { EVENTS, ALIGN, MOVE_TYPE, DIRECTION } from "./const/external";
import { HoldStartEvent, HoldEndEvent, MoveStartEvent, SelectEvent, MoveEvent, MoveEndEvent, WillChangeEvent, WillRestoreEvent, NeedPanelEvent, VisibleChangeEvent, ReachEdgeEvent, ReadyEvent, AfterResizeEvent, BeforeResizeEvent, ChangedEvent, RestoredEvent } from "./type/event";
import { HoldStartEvent, HoldEndEvent, MoveStartEvent, SelectEvent, MoveEvent, MoveEndEvent, WillChangeEvent, WillRestoreEvent, NeedPanelEvent, VisibleChangeEvent, ReachEdgeEvent, ReadyEvent, AfterResizeEvent, BeforeResizeEvent, ChangedEvent, RestoredEvent, PanelChangeEvent } from "./type/event";
import { LiteralUnion, ValueOf } from "./type/internal";

@@ -29,2 +29,3 @@ import { ElementLike, Plugin, Status, MoveTypeOptions } from "./type/external";

[EVENTS.REACH_EDGE]: ReachEdgeEvent;
[EVENTS.PANEL_CHANGE]: PanelChangeEvent;
}

@@ -172,3 +173,3 @@ export interface FlickingOptions {

removePlugins(...plugins: Plugin[]): this;
resize: () => Promise<void>;
resize(): Promise<void>;
append(element: ElementLike | ElementLike[]): Panel[];

@@ -175,0 +176,0 @@ prepend(element: ElementLike | ElementLike[]): Panel[];

@@ -85,1 +85,5 @@ import { OnChange, OnFinish, OnHold, OnRelease } from "@egjs/axes";

}
export interface PanelChangeEvent<T extends Flicking = Flicking> extends ComponentEvent<{}, typeof EVENTS["PANEL_CHANGE"], T> {
added: Panel[];
removed: Panel[];
}

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

repository: https://github.com/naver/egjs-flicking
version: 4.0.0
version: 4.1.0
*/
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("@egjs/component"),require("@egjs/axes")):"function"==typeof define&&define.amd?define(["@egjs/component","@egjs/axes"],n):(e="undefined"!=typeof globalThis?globalThis:e||self).Flicking=n(e.eg.Component,e.eg.Axes)}(this,function(T,o){"use strict";var i=function(e,n){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])})(e,n)};function a(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function t(){this.constructor=e}i(e,n),e.prototype=null===n?Object.create(n):(t.prototype=n.prototype,new t)}var r=function(){return(r=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var r in n=arguments[t])Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);return e}).apply(this,arguments)};function A(e,a,s,l){return new(s=s||Promise)(function(t,n){function i(e){try{o(l.next(e))}catch(e){n(e)}}function r(e){try{o(l.throw(e))}catch(e){n(e)}}function o(e){var n;e.done?t(e.value):((n=e.value)instanceof s?n:new s(function(e){e(n)})).then(i,r)}o((l=l.apply(e,a||[])).next())})}function N(t,i){var r,o,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:n(0),throw:n(1),return:n(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function n(n){return function(e){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,o&&(a=2&n[0]?o.return:n[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,n[1])).done)return a;switch(o=0,(n=a?[2&n[0],a.value]:n)[0]){case 0:case 1:a=n;break;case 4:return s.label++,{value:n[1],done:!1};case 5:s.label++,o=n[1],n=[0];continue;case 7:n=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===n[0]||2===n[0])){s=0;continue}if(3===n[0]&&(!a||n[1]>a[0]&&n[1]<a[3])){s.label=n[1];break}if(6===n[0]&&s.label<a[1]){s.label=a[1],a=n;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(n);break}a[2]&&s.ops.pop(),s.trys.pop();continue}n=i.call(t,s)}catch(e){n=[6,e],o=0}finally{r=a=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,e])}}}function c(e){var n="function"==typeof Symbol&&Symbol.iterator,t=n&&e[n],i=0;if(t)return t.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&i>=e.length?void 0:e)&&e[i++],done:!e}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function h(e,n){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var i,r,o=t.call(e),a=[];try{for(;(void 0===n||0<n--)&&!(i=o.next()).done;)a.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(t=o.return)&&t.call(o)}finally{if(r)throw r.error}}return a}function f(e,n){for(var t=0,i=n.length,r=e.length;t<i;t++,r++)e[r]=n[t];return e}function e(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.forEach(function(n){Object.keys(n).forEach(function(e){t[e]=n[e]})}),t}function t(e,n,t){return Math.max(Math.min(e,t),n)}function d(e,n){if(!e)throw new I(P(n),C.NOT_ATTACHED_TO_FLICKING);return e}function s(e){return[].slice.call(e)}function l(e,n){var t;if(B(e))switch(e){case H.PREV:t=0;break;case H.CENTER:t=.5*n;break;case H.NEXT:t=n;break;default:if(null==(t=V(e,n)))throw new I(y("align",e),C.WRONG_OPTION)}else t=e;return t}function g(e,n){return e===n?F.NONE:e<n?F.NEXT:F.PREV}function u(e){Array.isArray(e)||(e=[e]);var t=[];return e.forEach(function(e){if(B(e)){var n=document.createElement("div");for(n.innerHTML=e,t.push.apply(t,f([],h(s(n.children))));n.firstChild;)n.removeChild(n.firstChild)}else{if(!e||e.nodeType!==Node.ELEMENT_NODE)throw new I(w(e,["HTMLElement","string"]),C.WRONG_TYPE);t.push(e)}}),t}function p(e,n){return t(e<0?e+n:e,0,n)}function _(e,n){var t,i;try{for(var r=c(e),o=r.next();!o.done;o=r.next())if(o.value===n)return 1}catch(e){t={error:e}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}}function v(e,n,t){return(e-n)/(t-n)}function m(e){return window.getComputedStyle(e)||e.currentStyle}var b,I=function(i){function r(e,n){var t=i.call(this,e)||this;return t.message=e,t.code=n,Object.setPrototypeOf(t,r.prototype),t.name="FlickingError",t}return a(r,i),r}(Error),C={WRONG_TYPE:0,ELEMENT_NOT_FOUND:1,VAL_MUST_NOT_NULL:2,NOT_ATTACHED_TO_FLICKING:3,WRONG_OPTION:4,INDEX_OUT_OF_RANGE:5,POSITION_NOT_REACHABLE:6,TRANSFORM_NOT_SUPPORTED:7,STOP_CALLED_BY_USER:8,ANIMATION_INTERRUPTED:9,ANIMATION_ALREADY_PLAYING:10,NOT_ALLOWED_IN_FRAMEWORK:11,NOT_INITIALIZED:12,NO_ACTIVE:13},w=function(e,n){return e+"("+typeof e+") is not a "+n.map(function(e){return'"'+e+'"'}).join(" or ")+"."},R=function(e){return'Element with selector "'+e+'" not found.'},E=function(e,n){return n+" should be provided. Given: "+e},P=function(e){return e+' is not attached to the Flicking instance. "init()" should be called first.'},y=function(e,n){return'Option "'+e+'" is not in correct format, given: '+n},O=function(e,n,t){return'Index "'+e+'" is out of range: should be between '+n+" and "+t+"."},x=function(e){return'Position "'+e+'" is not reachable.'},k="Browser does not support CSS transform.",S="Event stop() is called by user.",D="Animation is interrupted by user input.",j="Animation is already playing.",L="This behavior is not allowed in the frameworks like React, Vue, or Angular.",z="Flicking is not initialized yet, call init() first.",M={READY:"ready",BEFORE_RESIZE:"beforeResize",AFTER_RESIZE:"afterResize",HOLD_START:"holdStart",HOLD_END:"holdEnd",MOVE_START:"moveStart",MOVE:"move",MOVE_END:"moveEnd",WILL_CHANGE:"willChange",CHANGED:"changed",WILL_RESTORE:"willRestore",RESTORED:"restored",SELECT:"select",NEED_PANEL:"needPanel",VISIBLE_CHANGE:"visibleChange",REACH_EDGE:"reachEdge"},H={PREV:"prev",CENTER:"center",NEXT:"next"},F={PREV:"PREV",NEXT:"NEXT",NONE:null},G={SNAP:"snap",FREE_SCROLL:"freeScroll"},n={__proto__:null,EVENTS:M,ALIGN:H,DIRECTION:F,MOVE_TYPE:G,ERROR_CODE:C},V=function(e,n){var t=/(?:(\+|\-)\s*)?(\d+(?:\.\d+)?(%|px)?)/g;if("number"==typeof e)return e;for(var i=0,r=0,o=t.exec(e);null!=o;){var a=o[1],s=o[2],l=o[3],s=parseFloat(s);if(!(a=i<=0?a||"+":a))return null;"%"===l&&(s=s/100*n),r+="+"===a?s:-s,++i,o=t.exec(e)}return 0===i?null:r},B=function(e){return"string"==typeof e},W=function(){function e(e){this._el=e,this._width=0,this._height=0,this._padding={left:0,right:0,top:0,bottom:0},this._isBorderBoxSizing=!1}var n=e.prototype;return Object.defineProperty(n,"element",{get:function(){return this._el},enumerable:!1,configurable:!0}),Object.defineProperty(n,"width",{get:function(){return this._width-this._padding.left-this._padding.right},enumerable:!1,configurable:!0}),Object.defineProperty(n,"height",{get:function(){return this._height-this._padding.top-this._padding.bottom},enumerable:!1,configurable:!0}),Object.defineProperty(n,"padding",{get:function(){return this._padding},enumerable:!1,configurable:!0}),n.setSize=function(e){var n=e.width,t=e.height,i=this._el,r=this._padding,e=this._isBorderBoxSizing;null!=n&&(B(n)?i.style.width=n:(n=e?n+r.left+r.right:n,i.style.width=n+"px")),null!=t&&(B(t)?i.style.height=t:(t=e?t+r.top+r.bottom:t,i.style.height=t+"px")),this.resize()},n.resize=function(){var e=this._el,n=m(e);this._width=e.offsetWidth,this._height=e.offsetHeight,this._padding={left:parseFloat(n.paddingLeft),right:parseFloat(n.paddingRight),top:parseFloat(n.paddingTop),bottom:parseFloat(n.paddingBottom)},this._isBorderBoxSizing="border-box"===n.boxSizing},e}(),X={HOLD:"hold",CHANGE:"change",RELEASE:"release",ANIMATION_END:"animationEnd",FINISH:"finish"},U="flick";(ce=b=b||{})[ce.IDLE=0]="IDLE",ce[ce.HOLDING=1]="HOLDING",ce[ce.DRAGGING=2]="DRAGGING",ce[ce.ANIMATING=3]="ANIMATING",ce[ce.DISABLED=4]="DISABLED";var Y=function(){function e(){}var n=e.prototype;return n.onHold=function(e){},n.onChange=function(e){},n.onRelease=function(e){},n.onAnimationEnd=function(e){},n.onFinish=function(e){},e}(),K=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.holding=!1,e.animating=!1,e}a(e,n);var t=e.prototype;return t.onHold=function(e){var n=e.flicking,t=e.axesEvent,e=e.transitTo;n.renderer.panelCount<=0?e(b.DISABLED):(t=new T.ComponentEvent(M.HOLD_START,{axesEvent:t}),n.trigger(t),t.isCanceled()?e(b.DISABLED):e(b.HOLDING))},t.onChange=function(e){var n=e.flicking,t=e.axesEvent,i=e.transitTo,r=n.control.controller.animatingContext,t=new T.ComponentEvent(M.MOVE_START,{isTrusted:t.isTrusted,holding:this.holding,direction:g(r.start,r.end),axesEvent:t});n.trigger(t),t.isCanceled()?i(b.DISABLED):i(b.ANIMATING).onChange(e)},e}(Y),Z=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.holding=!0,e.animating=!1,e._releaseEvent=null,e}a(e,n);var t=e.prototype;return t.onChange=function(e){var n=e.flicking,t=e.axesEvent,i=e.transitTo,r=t.inputEvent,r=n.horizontal?r.offsetX:r.offsetY,t=new T.ComponentEvent(M.MOVE_START,{isTrusted:t.isTrusted,holding:this.holding,direction:g(0,-r),axesEvent:t});n.trigger(t),t.isCanceled()?i(b.DISABLED):i(b.DRAGGING).onChange(e)},t.onRelease=function(e){var n=e.flicking,t=e.axesEvent,e=e.transitTo;if(n.trigger(new T.ComponentEvent(M.HOLD_END,{axesEvent:t})),0!==t.delta.flick)return t.setTo({flick:n.camera.position},0),void e(b.IDLE);this._releaseEvent=t},t.onFinish=function(e){var n=e.flicking;if((0,e.transitTo)(b.IDLE),this._releaseEvent){var t,i=this._releaseEvent.inputEvent.srcEvent;t="touchend"===i.type?(e=i.changedTouches[0],document.elementFromPoint(e.clientX,e.clientY)):i.target;var r,o,i=n.renderer.panels,a=null;try{for(var s=c(i),l=s.next();!l.done;l=s.next()){var u=l.value;if(u.contains(t)){a=u;break}}}catch(e){o={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(o)throw o.error}}a&&(r=n.camera.position,o=a.position,n.trigger(new T.ComponentEvent(M.SELECT,{index:a.index,panel:a,direction:g(r,o)})))}},e}(Y),q=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.holding=!0,e.animating=!0,e}a(e,n);var t=e.prototype;return t.onChange=function(e){var n,t=e.flicking,i=e.axesEvent,r=e.transitTo;i.delta[U]&&(e=(n=t.camera).position,n.lookAt(i.pos[U]),i=new T.ComponentEvent(M.MOVE,{isTrusted:i.isTrusted,holding:this.holding,direction:g(0,i.delta[U]),axesEvent:i}),t.trigger(i),i.isCanceled()&&(n.lookAt(e),r(b.DISABLED)))},t.onRelease=function(e){var n=e.flicking,t=e.axesEvent,i=e.transitTo;n.trigger(new T.ComponentEvent(M.HOLD_END,{axesEvent:t})),n.renderer.panelCount<=0?i(b.IDLE):(i(b.ANIMATING),e=n.control,i=t.destPos[U],n=Math.max(t.duration,n.duration),e.moveToPosition(i,n,t))},e}(Y),J=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.holding=!1,e.animating=!0,e}a(e,n);var t=e.prototype;return t.onHold=function(e){var n=e.flicking,t=e.axesEvent,e=e.transitTo,t=new T.ComponentEvent(M.HOLD_START,{axesEvent:t});n.trigger(t),t.isCanceled()?e(b.DISABLED):e(b.DRAGGING)},t.onChange=function(e){var n,t=e.flicking,i=e.axesEvent,r=e.transitTo;i.delta.flick&&(e=(n=t.camera).position,n.lookAt(i.pos.flick),i=new T.ComponentEvent(M.MOVE,{isTrusted:i.isTrusted,holding:this.holding,direction:g(0,i.delta.flick),axesEvent:i}),t.trigger(i),i.isCanceled()&&(t.camera.lookAt(e),r(b.DISABLED)))},t.onFinish=function(e){var n=e.flicking,t=e.axesEvent;(0,e.transitTo)(b.IDLE);e=n.control.controller.animatingContext;n.trigger(new T.ComponentEvent(M.MOVE_END,{isTrusted:t.isTrusted,direction:g(e.start,e.end),axesEvent:t}))},e}(Y),Q=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.holding=!1,e.animating=!0,e}a(e,n);var t=e.prototype;return t.onAnimationEnd=function(e){(0,e.transitTo)(b.IDLE)},t.onChange=function(e){var n=e.axesEvent,e=e.transitTo;n.stop(),e(b.IDLE)},t.onRelease=function(e){var n=e.axesEvent,e=e.transitTo;0===n.delta.flick&&e(b.IDLE)},e}(Y),$=function(){function e(){var t=this;this.transitTo=function(e){var n;switch(e){case b.IDLE:n=new K;break;case b.HOLDING:n=new Z;break;case b.DRAGGING:n=new q;break;case b.ANIMATING:n=new J;break;case b.DISABLED:n=new Q}return t._state=n,t._state},this._state=new K}var n=e.prototype;return Object.defineProperty(n,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),n.fire=function(e,n){var t=this._state,i=r(r({},n),{transitTo:this.transitTo});switch(e){case X.HOLD:t.onHold(i);break;case X.CHANGE:t.onChange(i);break;case X.RELEASE:t.onRelease(i);break;case X.ANIMATION_END:t.onAnimationEnd(i);break;case X.FINISH:t.onFinish(i)}},e}(),ee=function(){function e(){this._resetInternalValues(),this._stateMachine=new $}var n=e.prototype;return Object.defineProperty(n,"axes",{get:function(){return this._axes},enumerable:!1,configurable:!0}),Object.defineProperty(n,"state",{get:function(){return this._stateMachine.state},enumerable:!1,configurable:!0}),Object.defineProperty(n,"animatingContext",{get:function(){return this._animatingContext},enumerable:!1,configurable:!0}),Object.defineProperty(n,"enabled",{get:function(){var e;return null!==(e=null===(e=this._panInput)||void 0===e?void 0:e.isEnable())&&void 0!==e&&e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"position",{get:function(){var e;return null!==(e=null===(e=this._axes)||void 0===e?void 0:e.get([U])[U])&&void 0!==e?e:0},enumerable:!1,configurable:!0}),Object.defineProperty(n,"bounce",{get:function(){var e;return null===(e=this._axes)||void 0===e?void 0:e.axis[U].bounce},enumerable:!1,configurable:!0}),n.init=function(t){var e,i=this;this._flicking=t,this._axes=new o(((e={})[U]={range:[0,0],circular:!1,bounce:[0,0]},e),{deceleration:t.deceleration,interruptable:t.interruptable,easing:t.easing}),this._panInput=new o.PanInput(t.viewport.element,{inputType:t.inputType,iOSEdgeSwipeThreshold:t.iOSEdgeSwipeThreshold,scale:t.horizontal?[-1,0]:[0,-1]});var r=this._axes;r.connect(t.horizontal?[U,""]:["",U],this._panInput);for(var n in X)!function(e){var n=X[e];r.on(n,function(e){i._stateMachine.fire(n,{flicking:t,axesEvent:e})})}(n);return this},n.destroy=function(){var e;null!==(e=this._axes)&&void 0!==e&&e.destroy(),null!==(e=this._panInput)&&void 0!==e&&e.destroy(),this._resetInternalValues()},n.enable=function(){var e;return null!==(e=this._panInput)&&void 0!==e&&e.enable(),this},n.disable=function(){var e;return null!==(e=this._panInput)&&void 0!==e&&e.disable(),this},n.update=function(){var n,t,e=d(this._flicking,"Control"),i=e.camera,r=this._axes,o=i.controlParams,a=r.axis[U];return a.circular=[o.circular,o.circular],a.range=[o.range.min,o.range.max],a.bounce=(n=e.bounce,t=i.size,(Array.isArray(n)?n.map(function(e){return V(e,t)}):[i=V(n,t),i]).map(function(e){if(null==e)throw new I(y("bounce",n),C.WRONG_OPTION);return e})),r.axm.set(((r={})[U]=o.position,r)),this},n.animateTo=function(n,t,r){var i=this,o=this._axes;if(!o)return Promise.reject(new I(P("Control"),C.NOT_ATTACHED_TO_FLICKING));var e=o.get([U])[U];if(e===n)return d(this._flicking,"Control").camera.lookAt(n);this._animatingContext={start:e,end:n,offset:0};function a(){var e;o.once(X.FINISH,function(){i._animatingContext={start:0,end:0,offset:0}}),r?r.setTo(((e={})[U]=n,e),t):o.setTo(((e={})[U]=n,e),t)}return 0===t?(a(),o.axm.set(((e={})[U]=n,e)),Promise.resolve()):new Promise(function(e,n){function t(){o.off(X.HOLD,i),e()}var i=function(){o.off(X.FINISH,t),n(new I(D,C.ANIMATION_INTERRUPTED))};o.once(X.FINISH,t),r||o.once(X.HOLD,i),a()})},n._resetInternalValues=function(){this._flicking=null,this._axes=null,this._panInput=null,this._animatingContext={start:0,end:0,offset:0}},e}(),ne=function(){function e(){var o=this;this._setActive=function(e,n,t){var i,r=d(o._flicking,"Control");o._activePanel=e,r.camera.updateAdaptiveHeight(),e!==n?r.trigger(new T.ComponentEvent(M.CHANGED,{index:e.index,panel:e,prevIndex:null!==(i=null==n?void 0:n.index)&&void 0!==i?i:-1,prevPanel:n,isTrusted:t,direction:n?g(n.position,e.position):F.NONE})):r.trigger(new T.ComponentEvent(M.RESTORED,{isTrusted:t}))},this._flicking=null,this._controller=new ee,this._activePanel=null}var n=e.prototype;return Object.defineProperty(n,"controller",{get:function(){return this._controller},enumerable:!1,configurable:!0}),Object.defineProperty(n,"activeIndex",{get:function(){var e;return null!==(e=null===(e=this._activePanel)||void 0===e?void 0:e.index)&&void 0!==e?e:-1},enumerable:!1,configurable:!0}),Object.defineProperty(n,"activePanel",{get:function(){return this._activePanel},enumerable:!1,configurable:!0}),Object.defineProperty(n,"animating",{get:function(){return this._controller.state.animating},enumerable:!1,configurable:!0}),Object.defineProperty(n,"holding",{get:function(){return this._controller.state.holding},enumerable:!1,configurable:!0}),n.init=function(e){return this._flicking=e,this._controller.init(e),this},n.destroy=function(){this._controller.destroy(),this._flicking=null,this._activePanel=null},n.enable=function(){return this._controller.enable(),this},n.disable=function(){return this._controller.disable(),this},n.updatePosition=function(e){return A(this,void 0,void 0,function(){var n,t;return N(this,function(e){switch(e.label){case 0:return t=d(this._flicking,"Control"),n=t.camera,(t=this._activePanel)?[4,n.lookAt(n.clampToReachablePosition(t.position))]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})},n.updateInput=function(){return this._controller.update(),this},n.resetActive=function(){return this._activePanel=null,this},n.moveToPanel=function(a,e){var s=e.duration,n=e.direction,l=void 0===n?F.NONE:n,u=e.axesEvent;return A(this,void 0,void 0,function(){var n,t,i,r,o;return N(this,function(e){return n=d(this._flicking,"Control"),o=n.camera,t=a.position,i=o.findNearestAnchor(t),a.removed||!i?[2,Promise.reject(new I(x(a.position),C.POSITION_NOT_REACHABLE))]:(o.canReach(a)?n.circularEnabled&&(r=this._controller.position,o=o.rangeDiff,t=[t,t+o,t-o].filter(function(e){return l===F.NONE||(l===F.PREV?e<=r:r<=e)}).reduce(function(e,n){return Math.abs(r-n)<Math.abs(r-e)?n:e},1/0)):(t=i.position,a=i.panel),this._triggerIndexChangeEvent(a,a.position,u),[2,this._animateToPosition({position:t,duration:s,newActivePanel:a,axesEvent:u})])})})},n._triggerIndexChangeEvent=function(e,n,t){var i=d(this._flicking,"Control"),r=e!==this._activePanel?M.WILL_CHANGE:M.WILL_RESTORE,o=i.camera,a=this._activePanel,n=new T.ComponentEvent(r,{index:e.index,panel:e,isTrusted:(null==t?void 0:t.isTrusted)||!1,direction:g(null!==(a=null==a?void 0:a.position)&&void 0!==a?a:o.position,n)});if(i.trigger(n),n.isCanceled())throw new I(S,C.STOP_CALLED_BY_USER)},n._animateToPosition=function(e){var s=e.position,l=e.duration,u=e.newActivePanel,c=e.axesEvent;return A(this,void 0,void 0,function(){var n,t,i,r,o,a=this;return N(this,function(e){return n=d(this._flicking,"Control"),t=this._activePanel,i=function(){return a._controller.animateTo(s,l,c)},r=(null==c?void 0:c.isTrusted)||!1,l<=0?(o=i(),this._setActive(u,t,r),[2,o]):[2,i().then(function(){return A(a,void 0,void 0,function(){return N(this,function(e){switch(e.label){case 0:return this._setActive(u,t,r),[4,n.renderer.render()];case 1:return e.sent(),[2]}})})})]})})},e}(),te=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return a(n,e),n.prototype.moveToPosition=function(l,u,c){return A(this,void 0,void 0,function(){var n,t,i,r,o,a,s;return N(this,function(e){return r=d(this._flicking,"Control"),n=r.camera,t=this._activePanel,o=n.clampToReachablePosition(l),(i=n.findNearestAnchor(o))&&t?(o=t.position,r=Math.abs(l-o)>=r.threshold,o=o<l?n.getNextAnchor(i):n.getPrevAnchor(i),r&&i.position!==t.position?(s=i.panel,a=i.position):r&&o?(s=o.panel,a=o.position):(a=n.clampToReachablePosition(t.position),s=t),this._triggerIndexChangeEvent(s,l,c),[2,this._animateToPosition({position:a,duration:u,newActivePanel:s,axesEvent:c})]):[2,Promise.reject(new I(x(l),C.POSITION_NOT_REACHABLE))]})})},n}(ne),ie=function(t){function e(e){var n=(void 0===e?{}:e).stopAtEdge,e=void 0===n||n,n=t.call(this)||this;return n._stopAtEdge=e,n}a(e,t);var n=e.prototype;return Object.defineProperty(n,"stopAtEdge",{get:function(){return this._stopAtEdge},set:function(e){this._stopAtEdge=e},enumerable:!1,configurable:!0}),n.updatePosition=function(i){return A(this,void 0,void 0,function(){var n,t;return N(this,function(e){switch(e.label){case 0:return(t=d(this._flicking,"Control"),n=t.camera,t=this._activePanel)?(t=t.range,t=t.min+(t.max-t.min)*i,[4,n.lookAt(n.clampToReachablePosition(t))]):[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})},n.moveToPosition=function(i,r,o){return A(this,void 0,void 0,function(){var n,t;return N(this,function(e){return n=d(this._flicking,"Control"),t=n.camera,n=t.clampToReachablePosition(i),(t=t.findAnchorIncludePosition(n))?((t=t.panel)!==this._activePanel&&this._triggerIndexChangeEvent(t,i,o),[2,this._animateToPosition({position:this._stopAtEdge?n:i,duration:r,newActivePanel:t,axesEvent:o})]):[2,Promise.reject(new I(x(i),C.POSITION_NOT_REACHABLE))]})})},e}(ne),re={__proto__:null,Control:ne,SnapControl:te,FreeControl:ie,AxesController:ee,State:Y,IdleState:K,HoldingState:Z,DraggingState:q,AnimatingState:J,DisabledState:Q,StateMachine:$},oe=function(){function e(e){var n=e.index,t=e.position,e=e.panel;this._index=n,this._pos=t,this._panel=e}var n=e.prototype;return Object.defineProperty(n,"index",{get:function(){return this._index},enumerable:!1,configurable:!0}),Object.defineProperty(n,"position",{get:function(){return this._pos},enumerable:!1,configurable:!0}),Object.defineProperty(n,"panel",{get:function(){return this._panel},enumerable:!1,configurable:!0}),e}(),ae=function(){function e(e){var s=this,e=(void 0===e?{}:e).align,e=void 0===e?H.CENTER:e;this._checkTranslateSupport=function(){var n,e,t=document.documentElement.style,i="";try{for(var r=c(["webkitTransform","msTransform","MozTransform","OTransform","transform"]),o=r.next();!o.done;o=r.next()){var a=o.value;a in t&&(i=a)}}catch(e){n={error:e}}finally{try{o&&!o.done&&(e=r.return)&&e.call(r)}finally{if(n)throw n.error}}if(!i)throw new I(k,C.TRANSFORM_NOT_SUPPORTED);s._transform=i},this._flicking=null,this._resetInternalValues(),this._align=e}var n=e.prototype;return Object.defineProperty(n,"element",{get:function(){return this._el},enumerable:!1,configurable:!0}),Object.defineProperty(n,"position",{get:function(){return this._position},enumerable:!1,configurable:!0}),Object.defineProperty(n,"alignPosition",{get:function(){return this._alignPos},enumerable:!1,configurable:!0}),Object.defineProperty(n,"offset",{get:function(){return this._offset},enumerable:!1,configurable:!0}),Object.defineProperty(n,"range",{get:function(){return this._range},enumerable:!1,configurable:!0}),Object.defineProperty(n,"rangeDiff",{get:function(){return this._range.max-this._range.min},enumerable:!1,configurable:!0}),Object.defineProperty(n,"visiblePanels",{get:function(){return this._visiblePanels},enumerable:!1,configurable:!0}),Object.defineProperty(n,"visibleRange",{get:function(){return{min:this._position-this._alignPos,max:this._position-this._alignPos+this.size}},enumerable:!1,configurable:!0}),Object.defineProperty(n,"anchorPoints",{get:function(){return this._anchors},enumerable:!1,configurable:!0}),Object.defineProperty(n,"controlParams",{get:function(){return{range:this._range,position:this._position,circular:!1}},enumerable:!1,configurable:!0}),Object.defineProperty(n,"atEdge",{get:function(){return this._position<=this._range.min||this._position>=this._range.max},enumerable:!1,configurable:!0}),Object.defineProperty(n,"size",{get:function(){var e=this._flicking;return e?e.horizontal?e.viewport.width:e.viewport.height:0},enumerable:!1,configurable:!0}),Object.defineProperty(n,"progress",{get:function(){var e=this._flicking,n=this._position+this._offset,t=this.findNearestAnchor(this._position);if(!e||!t)return NaN;var i=t.panel,r=i.position+i.offset,o=e.control.controller.bounce,a=this.range,t=a.min,e=a.max,a=this.rangeDiff;if(n===r)return i.index;if(n<r){var s=i.prev(),s=s?s.position+s.offset:t-o[0];return r<s&&(s-=a),i.index-1+v(n,s,r)}s=i.next(),o=s?s.position+s.offset:e+o[1];return o<r&&(o+=a),i.index+v(n,r,o)},enumerable:!1,configurable:!0}),Object.defineProperty(n,"align",{get:function(){return this._align},set:function(e){this._align=e},enumerable:!1,configurable:!0}),n.init=function(e){e=(this._flicking=e).viewport.element;return function(e,n){if(null==e)throw new I(E(e,n),C.VAL_MUST_NOT_NULL)}(e.firstElementChild,"First element child of the viewport element"),this._el=e.firstElementChild,this._checkTranslateSupport(),this},n.destroy=function(){return this._flicking=null,this._resetInternalValues(),this},n.lookAt=function(t){return A(this,void 0,void 0,function(){var n;return N(this,function(e){switch(e.label){case 0:return n=this._position,this._position=t,[4,this._refreshVisiblePanels()];case 1:return e.sent(),this._checkNeedPanel(),this._checkReachEnd(n,t),this._applyTransform(),[2]}})})},n.getPrevAnchor=function(e){return this._anchors[e.index-1]||null},n.getNextAnchor=function(e){return this._anchors[e.index+1]||null},n.getProgressInPanel=function(e){e=e.range;return(this._position-e.min)/(e.max-e.min)},n.findAnchorIncludePosition=function(t){return this._anchors.filter(function(e){return e.panel.includePosition(t,!0)}).reduce(function(e,n){return e&&Math.abs(e.position-t)<Math.abs(n.position-t)?e:n},null)},n.findNearestAnchor=function(e){var n=this._anchors;if(n.length<=0)return null;for(var t=1/0,i=0;i<n.length;i++){var r=n[i],r=Math.abs(r.position-e);if(t<r)return n[i-1];t=r}return n[n.length-1]},n.clampToReachablePosition=function(e){var n=this._range;return t(e,n.min,n.max)},n.canReach=function(e){var n=this._range;if(e.removed)return!1;e=e.position;return e>=n.min&&e<=n.max},n.canSee=function(e){var n=this.visibleRange;return e.includeRange(n.min,n.max,!1)},n.updateAlignPos=function(){var e=this._align,e="object"==typeof e?e.camera:e;return this._alignPos=l(e,this.size),this},n.updateAnchors=function(){var e=d(this._flicking,"Camera").renderer.panels;return this._anchors=e.map(function(e,n){return new oe({index:n,position:e.position,panel:e})}),this},n.updateAdaptiveHeight=function(){var e=d(this._flicking,"Camera"),n=e.control.activePanel;e.horizontal&&e.adaptive&&n&&e.viewport.setSize({height:n.height})},n.updateOffset=function(){var e=d(this._flicking,"Camera").panels.filter(function(e){return!e.rendered}),n=this._position;this._offset=e.filter(function(e){return e.position+e.offset<n}).reduce(function(e,n){return e+n.sizeIncludingMargin},0),this._applyTransform()},n.resetNeedPanelHistory=function(){return this._needPanelTriggered={prev:!1,next:!1},this},n._resetInternalValues=function(){this._position=0,this._alignPos=0,this._offset=0,this._range={min:0,max:0},this._visiblePanels=[],this._anchors=[],this._needPanelTriggered={prev:!1,next:!1}},n._refreshVisiblePanels=function(){return A(this,void 0,void 0,function(){var n,t,i,r,o,a=this;return N(this,function(e){switch(e.label){case 0:return n=d(this._flicking,"Camera"),o=n.renderer.panels,t=o.filter(function(e){return a.canSee(e)}),i=this._visiblePanels,this._visiblePanels=t,r=t.filter(function(e){return!_(i,e)}),o=i.filter(function(e){return!_(t,e)}),0<r.length||0<o.length?[4,n.renderer.render()]:[3,2];case 1:e.sent(),n.trigger(new T.ComponentEvent(M.VISIBLE_CHANGE,{added:r,removed:o,visiblePanels:t})),e.label=2;case 2:return[2]}})})},n._checkNeedPanel=function(){var e=this._needPanelTriggered;if(!e.prev||!e.next){var n=d(this._flicking,"Camera"),t=n.renderer.panels;if(t.length<=0)return e.prev||(n.trigger(new T.ComponentEvent(M.NEED_PANEL,{direction:F.PREV})),e.prev=!0),void(e.next||(n.trigger(new T.ComponentEvent(M.NEED_PANEL,{direction:F.NEXT})),e.next=!0));var i=this._position,r=this.size,o=this._range,a=n.needPanelThreshold,s=i-this._alignPos,l=s+r,r=t[0],t=t[t.length-1];e.prev||(s<=r.range.min+a||i<=o.min+a)&&(n.trigger(new T.ComponentEvent(M.NEED_PANEL,{direction:F.PREV})),e.prev=!0),e.next||(t.range.max-a<=l||i>=o.max-a)&&(n.trigger(new T.ComponentEvent(M.NEED_PANEL,{direction:F.NEXT})),e.next=!0)}},n._checkReachEnd=function(e,n){var t=d(this._flicking,"Camera"),i=this._range,r=e>i.min&&e<i.max,e=n>i.min&&n<i.max;r&&!e&&(i=n<=i.min?F.PREV:F.NEXT,t.trigger(new T.ComponentEvent(M.REACH_EDGE,{direction:i})))},n._applyTransform=function(){var e=this._el,n=d(this._flicking,"Camera"),t=this._position-this._alignPos-this._offset;e.style[this._transform]=n.horizontal?"translate("+-t+"px)":"translate(0, "+-t+"px)"},e}(),se=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return a(n,e),n.prototype.updateRange=function(){var e=d(this._flicking,"Camera").renderer,n=e.getPanel(0),e=e.getPanel(e.panelCount-1);return this._range={min:null!==(n=null==n?void 0:n.position)&&void 0!==n?n:0,max:null!==(e=null==e?void 0:e.position)&&void 0!==e?e:0},this},n}(ae),le=function(s){function e(){var e=null!==s&&s.apply(this,arguments)||this;return e._circularOffset=0,e._circularEnabled=!1,e}a(e,s);var n=e.prototype;return Object.defineProperty(n,"offset",{get:function(){return this._offset-this._circularOffset},enumerable:!1,configurable:!0}),Object.defineProperty(n,"controlParams",{get:function(){return{range:this._range,position:this._position,circular:this._circularEnabled}},enumerable:!1,configurable:!0}),n.getPrevAnchor=function(e){if(!this._circularEnabled||0!==e.index)return s.prototype.getPrevAnchor.call(this,e);var n=this._anchors,e=this.rangeDiff,n=n[n.length-1];return new oe({index:n.index,position:n.position-e,panel:n.panel})},n.getNextAnchor=function(e){var n=this._anchors;if(!this._circularEnabled||e.index!==n.length-1)return s.prototype.getNextAnchor.call(this,e);e=this.rangeDiff,n=n[0];return new oe({index:n.index,position:n.position+e,panel:n.panel})},n.findAnchorIncludePosition=function(e){if(!this._circularEnabled)return s.prototype.findAnchorIncludePosition.call(this,e);var n,t,i=this._range,r=(o=e,n=i.min,t=i.max,r=t-n,o<n?o=t-(n-o)%r:t<o&&(o=n+(o-t)%r),o),o=s.prototype.findAnchorIncludePosition.call(this,r);if(!o)return null;var r=this.rangeDiff;if(e<i.min){var a=-Math.floor((i.min-e)/r)-1;return new oe({index:o.index,position:o.position+r*a,panel:o.panel})}if(e>i.max){a=Math.floor((e-i.max)/r)+1;return new oe({index:o.index,position:o.position+r*a,panel:o.panel})}return o},n.clampToReachablePosition=function(e){return this._circularEnabled?e:s.prototype.clampToReachablePosition.call(this,e)},n.canReach=function(e){return!e.removed&&(!!this._circularEnabled||s.prototype.canReach.call(this,e))},n.canSee=function(e){var n=this._range,t=this.rangeDiff,i=this.visibleRange,r=s.prototype.canSee.call(this,e);return this._circularEnabled?i.min<n.min?r||e.includeRange(i.min+t,i.max+t,!1):i.max>n.max?r||e.includeRange(i.min-t,i.max-t,!1):r:r},n.updateRange=function(){var e=d(this._flicking,"Camera").renderer.panels;if(e.length<=0)return this._resetInternalValues(),this;var n=e[0],t=e[e.length-1],i=n.range.min-n.margin.prev,r=t.range.max+t.margin.next,o=this.size,a=r-i,s=e.every(function(e){return a-e.size>=o});return(this._circularEnabled=s)?(this._range={min:i,max:r},e.forEach(function(e){return e.updateCircularToggleDirection()})):this._range={min:n.position,max:t.position},this._updateCircularOffset(),this},n.lookAt=function(r){return A(this,void 0,void 0,function(){var n,t,i;return N(this,function(e){switch(e.label){case 0:return n=d(this._flicking,"Camera"),t=this._position,r!==t?[3,2]:[4,s.prototype.lookAt.call(this,r)];case 1:return[2,e.sent()];case 2:return(i=n.renderer.panels,i=i.map(function(e){return e.toggle(t,r)}),this._position=r,i.some(function(e){return e}))?(this._updateCircularOffset(),[4,n.renderer.render()]):[3,4];case 3:e.sent(),e.label=4;case 4:return[4,s.prototype.lookAt.call(this,r)];case 5:return[2,e.sent()]}})})},n._applyTransform=function(){var e=this._el,n=d(this._flicking,"Camera"),t=this._position-this._alignPos-this._offset+this._circularOffset;e.style[this._transform]=n.horizontal?"translate("+-t+"px)":"translate(0, "+-t+"px)"},n._resetInternalValues=function(){s.prototype._resetInternalValues.call(this),this._circularOffset=0,this._circularEnabled=!1},n._calcPanelAreaSum=function(e){return e.reduce(function(e,n){return e+n.sizeIncludingMargin},0)},n._updateCircularOffset=function(){var e,n,t;this._circularEnabled?(e=d(this._flicking,"Camera"),n=[],t=[],e.panels.filter(function(e){return e.toggled}).forEach(function(e){(e.toggleDirection===F.PREV?n:t).push(e)}),this._circularOffset=this._calcPanelAreaSum(n)-this._calcPanelAreaSum(t)):this._circularOffset=0},e}(ae),ue=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}a(n,e);var t=n.prototype;return t.updateRange=function(){var e=d(this._flicking,"Camera").renderer,n=this._alignPos,t=e.getPanel(0),i=e.getPanel(e.panelCount-1);if(!t||!i)return this._range={min:0,max:0},this;var r=this.size,o=t.range.min,e=i.range.max;return this._range=r<e-o?{min:o+n,max:e-r+n}:{min:t.position,max:i.position},this},t.updateAnchors=function(){var n=this,e=d(this._flicking,"Camera").renderer.panels;if(e.length<=0)return this._anchors=[],this;var t,i,r,o,a=this._range,s=e.filter(function(e){return n.canReach(e)});return 0<s.length?(t=s[0].position!==a.min,i=s[s.length-1].position!==a.max,r=t?1:0,o=s.map(function(e,n){return new oe({index:n+r,position:e.position,panel:e})}),t&&o.splice(0,0,new oe({index:0,position:a.min,panel:e[s[0].index-1]})),i&&o.push(new oe({index:o.length,position:a.max,panel:e[s[s.length-1].index+1]})),this._anchors=o):a.min!==a.max?(s=(o=(s=this._findNearestPanel(a.min,e)).index===e.length-1?s.prev():s).next(),this._anchors=[new oe({index:0,position:a.min,panel:o}),new oe({index:1,position:a.max,panel:s})]):this._anchors=[new oe({index:0,position:a.min,panel:this._findNearestPanel(a.min,e)})],this},t._findNearestPanel=function(e,n){for(var t=1/0,i=0;i<n.length;i++){var r=n[i],r=Math.abs(r.position-e);if(t<r)return n[i-1];t=r}return n[n.length-1]},n}(ae),ce={__proto__:null,Camera:ae,LinearCamera:se,CircularCamera:le,BoundCamera:ue},he=function(){function e(){}return e.prototype.updateRenderingPanels=function(e){e.panels.forEach(function(e){return e.markForShow()})},e}(),ne=function(){function e(e){var n=void 0===e?{}:e,e=n.align,e=void 0===e?H.CENTER:e,n=n.strategy,n=void 0===n?new he:n;this._align=e,this._flicking=null,this._renderingStrategy=n,this._panels=[]}var n=e.prototype;return Object.defineProperty(n,"panels",{get:function(){return this._panels},enumerable:!1,configurable:!0}),Object.defineProperty(n,"panelCount",{get:function(){return this._panels.length},enumerable:!1,configurable:!0}),Object.defineProperty(n,"align",{get:function(){return this._align},set:function(e){this._align=e;var n=this._getPanelAlign();this._panels.forEach(function(e){e.align=n})},enumerable:!1,configurable:!0}),n.init=function(e){return this._flicking=e,this._collectPanels(),this},n.destroy=function(){this._flicking=null,this._panels=[]},n.getPanel=function(e){return this._panels[e]||null},n.updatePanelSize=function(){return this._panels.forEach(function(e){return e.resize()}),this},n.batchInsert=function(){for(var a=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var s=this._panels,l=d(this._flicking,"Renderer"),t=l.control,u=this._getPanelAlign(),i=e.reduce(function(e,n){var t=p(n.index,s.length),i=s.slice(t),r=n.elements.map(function(e){return a._createPanel(e,{index:t,align:u,flicking:l})});s.splice.apply(s,f([t,0],h(r))),r.forEach(function(e){return e.resize()});var o=a._getPanelSizeSum(r);return i.forEach(function(e){e.increaseIndex(r.length),e.increasePosition(o)}),a._insertPanelElements(r,null!==(i=i[0])&&void 0!==i?i:null),f(f([],h(e)),h(r))},[]);return i.length<=0?[]:(this._updateCameraAndControl(),this.render(),0<i.length&&!t.animating&&t.moveToPanel(t.activePanel||i[0],{duration:0}).catch(function(){}),l.camera.updateOffset(),i)},n.batchRemove=function(){for(var a=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var s=this._panels,t=d(this._flicking,"Renderer"),i=t.camera,l=t.control,u=l.activePanel,r=l.activeIndex,o=e.reduce(function(e,n){var t=n.index,i=n.deleteCount,n=p(t,s.length),t=s.slice(n+i),r=s.splice(n,i);if(r.length<=0)return[];var o=a._getPanelSizeSum(r);return t.forEach(function(e){e.decreaseIndex(r.length),e.decreasePosition(o)}),a._removePanelElements(r),r.forEach(function(e){return e.destroy()}),a._updateCameraAndControl(),_(r,u)&&l.resetActive(),f(f([],h(e)),h(r))},[]);return this.render(),0<o.length&&!l.animating&&((r=_(o,u)?s[r]||s[s.length-1]:u)?l.moveToPanel(r,{duration:0}).catch(function(){}):i.lookAt(0)),t.camera.updateOffset(),o},n._getPanelAlign=function(){var e=this._align;return"object"==typeof e?e.panel:e},n._getPanelSizeSum=function(e){var n=e[0],t=e[e.length-1],e=t.margin.next-n.margin.prev;return t.range.max-n.range.min+e},n._updateCameraAndControl=function(){var e=d(this._flicking,"Renderer"),n=e.camera,e=e.control;n.updateRange(),n.updateAnchors(),n.resetNeedPanelHistory(),e.updateInput()},e}(),Y=function(){function e(e){var n=e.index,t=e.align,e=e.flicking;this._index=n,this._flicking=e,this._align=t,this._removed=!1,this._resetInternalStates()}var n=e.prototype;return Object.defineProperty(n,"index",{get:function(){return this._index},enumerable:!1,configurable:!0}),Object.defineProperty(n,"position",{get:function(){return this._pos+this._alignPos},enumerable:!1,configurable:!0}),Object.defineProperty(n,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),Object.defineProperty(n,"sizeIncludingMargin",{get:function(){return this._size+this._margin.prev+this._margin.next},enumerable:!1,configurable:!0}),Object.defineProperty(n,"height",{get:function(){return this._height},enumerable:!1,configurable:!0}),Object.defineProperty(n,"margin",{get:function(){return this._margin},enumerable:!1,configurable:!0}),Object.defineProperty(n,"alignPosition",{get:function(){return this._alignPos},enumerable:!1,configurable:!0}),Object.defineProperty(n,"removed",{get:function(){return this._removed},enumerable:!1,configurable:!0}),Object.defineProperty(n,"range",{get:function(){return{min:this._pos,max:this._pos+this._size}},enumerable:!1,configurable:!0}),Object.defineProperty(n,"toggled",{get:function(){return this._toggled},enumerable:!1,configurable:!0}),Object.defineProperty(n,"toggleDirection",{get:function(){return this._toggleDirection},enumerable:!1,configurable:!0}),Object.defineProperty(n,"offset",{get:function(){var e=this._toggleDirection,n=this._flicking.camera.rangeDiff;return e!==F.NONE&&this._toggled?e===F.PREV?-n:n:0},enumerable:!1,configurable:!0}),Object.defineProperty(n,"progress",{get:function(){var e=this._flicking;return this.index-e.camera.progress},enumerable:!1,configurable:!0}),Object.defineProperty(n,"outsetProgress",{get:function(){var e=this.position+this.offset,n=this._alignPos,t=this._flicking.camera,i=t.position;if(i===e)return 0;if(i<e){var r=e+(t.size-t.alignPosition)+n;return-v(i,e,r)}n=e-(t.alignPosition+this._size-n);return 1-v(i,n,e)},enumerable:!1,configurable:!0}),Object.defineProperty(n,"visibleRatio",{get:function(){var e=this.range,n=this._size,t=this.offset,i=this._flicking.camera.visibleRange,r=e.min+t,e=e.max+t;if(e<=i.min||r>=i.max)return 0;t=n;return i.min>r&&(t-=i.min-r),i.max<e&&(t-=e-i.max),t/n},enumerable:!1,configurable:!0}),Object.defineProperty(n,"align",{get:function(){return this._align},set:function(e){this._align=e},enumerable:!1,configurable:!0}),n.resize=function(){var e=this.element,n=m(e),t=this._flicking,i=t.horizontal,t=t.renderer.panels[this._index-1];return this._size=i?e.offsetWidth:e.offsetHeight,this._margin=i?{prev:parseFloat(n.marginLeft||"0"),next:parseFloat(n.marginRight||"0")}:{prev:parseFloat(n.marginTop||"0"),next:parseFloat(n.marginBottom||"0")},this._pos=t?t.range.max+t.margin.next+this._margin.prev:this._margin.prev,this._height=i?e.offsetHeight:this._size,this._updateAlignPos(),this},n.contains=function(e){return this.element.contains(e)},n.destroy=function(){this._resetInternalStates(),this._removed=!0},n.includePosition=function(e,n){return this.includeRange(e,e,n=void 0===n?!1:n)},n.includeRange=function(e,n,t){var i=this._margin,r=this.range;return(t=void 0===t?!1:t)&&(r.min-=i.prev,r.max+=i.next),n>=r.min&&e<=r.max},n.focus=function(e){return this._flicking.moveTo(this._index,e)},n.prev=function(){var e=this._index,n=this._flicking,t=n.renderer,i=t.panelCount;return 1===i?null:n.circularEnabled?t.getPanel(0===e?i-1:e-1):t.getPanel(e-1)},n.next=function(){var e=this._index,n=this._flicking,t=n.renderer,i=t.panelCount;return 1===i?null:n.circularEnabled?t.getPanel(e===i-1?0:e+1):t.getPanel(e+1)},n.increaseIndex=function(e){return this._index+=Math.max(e,0),this},n.decreaseIndex=function(e){return this._index-=Math.max(e,0),this},n.increasePosition=function(e){return this._moveBy(Math.max(e,0)),this},n.decreasePosition=function(e){return this._moveBy(-Math.max(e,0)),this},n.toggle=function(e,n){var t=this._toggleDirection,i=this._togglePosition;if(t===F.NONE||n===e)return!1;var r=this._toggled;return e<n?e<=i&&i<=n&&(this._toggled=t===F.NEXT):i<=e&&n<=i&&(this._toggled=t!==F.NEXT),r!==this._toggled},n.updateCircularToggleDirection=function(){var e=this._flicking;if(!e.circularEnabled)return this._toggleDirection=F.NONE,this._toggled=!1,this;var n=e.camera,t=n.range,i=n.alignPosition,r=n.visibleRange,o=r.max-r.min,e=t.min-i,r=t.max-i+o,r=this.includeRange(r-o,r,!1),e=this.includeRange(e,e+o,!1);return this._toggled=!1,r?(this._toggleDirection=F.PREV,this._togglePosition=this.range.max+t.min-t.max+i,this.toggle(1/0,n.position)):e?(this._toggleDirection=F.NEXT,this._togglePosition=this.range.min+t.max-o+i,this.toggle(-1/0,n.position)):(this._toggleDirection=F.NONE,this._togglePosition=0),this},n._moveBy=function(e){return this._pos+=e,this},n._updateAlignPos=function(){this._alignPos=l(this._align,this._size)},n._resetInternalStates=function(){this._size=0,this._pos=0,this._margin={prev:0,next:0},this._height=0,this._alignPos=0,this._toggled=!1,this._togglePosition=0,this._toggleDirection=F.NONE},e}(),fe=function(t){function e(e){var n=t.call(this,e)||this;return n._el=e.el,n._rendered=!0,n}a(e,t);var n=e.prototype;return Object.defineProperty(n,"element",{get:function(){return this._el},enumerable:!1,configurable:!0}),Object.defineProperty(n,"rendered",{get:function(){return this._rendered},enumerable:!1,configurable:!0}),n.markForShow=function(){this._rendered=!0},n.markForHide=function(){this._rendered=!1},e}(Y),de=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}a(n,e);var t=n.prototype;return t.render=function(){return A(this,void 0,void 0,function(){var n,t,i,r;return N(this,function(e){return n=this._renderingStrategy,r=d(this._flicking,"Renderer"),t=r.camera.element,i=this._panels.filter(function(e){return e.element.parentElement===t}),n.updateRenderingPanels(r),r=this._getRenderingPanelsByOrder(),this._removePanelElements(i.filter(function(e){return!e.rendered})),this._insertPanelElements(r.filter(function(e){return e.element.parentElement!==t}),null),this._resetPanelElementOrder(r),[2]})})},t.forceRenderAllPanels=function(){return A(this,void 0,void 0,function(){var n,t;return N(this,function(e){return n=d(this._flicking,"Renderer"),n=n.camera,n=n.element,t=document.createDocumentFragment(),this._panels.forEach(function(e){return t.appendChild(e.element)}),this._removeAllChildsFromCamera(),n.appendChild(t),[2]})})},t._collectPanels=function(){var t=d(this._flicking,"Renderer"),n=t.camera.element;s(n.childNodes).forEach(function(e){e.nodeType===Node.TEXT_NODE&&n.removeChild(e)});var i=this._getPanelAlign(),e=s(n.children);this._panels=e.map(function(e,n){return new fe({flicking:t,el:e,index:n,align:i})})},t._createPanel=function(e,n){return new fe(r({el:e},n))},t._insertPanelElements=function(e,n){var t=d(this._flicking,"Renderer").camera.element,n=(null==n?void 0:n.element)||null,i=document.createDocumentFragment();return e.forEach(function(e){return i.appendChild(e.element)}),t.insertBefore(i,n),this},t._removePanelElements=function(e){var n=d(this._flicking,"Renderer").camera.element;return e.forEach(function(e){n.removeChild(e.element)}),this},t._resetPanelElementOrder=function(e){var t=d(this._flicking,"Renderer").camera.element,i=f([],h(e)).reverse();i.forEach(function(e,n){n=i[n-1],n=n?n.element:null;e.element.nextElementSibling!==n&&t.insertBefore(e.element,n)})},t._removeAllChildsFromCamera=function(){for(var e=d(this._flicking,"Renderer").camera.element;e.firstChild;)e.removeChild(e.firstChild)},t._getRenderingPanelsByOrder=function(){return d(this._flicking,"Renderer").renderer.panels.filter(function(e){return e.rendered}).sort(function(e,n){return e.position+e.offset-(n.position+n.offset)})},n}(ne),ae=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}a(n,e);var t=n.prototype;return t._insertPanelElements=function(e,n){},t._removePanelElements=function(e){},n}(ne),ge=function(){function e(){}return e.prototype.updateRenderingPanels=function(n){var e=n.renderer.panels,t=n.camera,i=t.visiblePanels.reduce(function(e,n){return e[n.index]=!0,e},{});e.forEach(function(e){e.index in i?e.markForShow():n.holding||e.markForHide()}),t.updateOffset()},e}(),ne={__proto__:null,Renderer:ne,VanillaRenderer:de,ExternalRenderer:ae,RawRenderingStrategy:he,VisibleRenderingStrategy:ge},ae=function(x){function e(e,n){var t=void 0===n?{}:n,i=t.align,r=void 0===i?H.CENTER:i,o=t.defaultIndex,a=void 0===o?0:o,s=t.horizontal,l=void 0===s||s,u=t.circular,c=void 0!==u&&u,h=t.bound,f=void 0!==h&&h,d=t.adaptive,g=void 0!==d&&d,p=t.needPanelThreshold,_=void 0===p?0:p,v=t.deceleration,m=void 0===v?.0075:v,b=t.duration,E=void 0===b?500:b,P=t.easing,y=void 0===P?function(e){return 1-Math.pow(1-e,3)}:P,n=t.inputType,i=void 0===n?["mouse","touch"]:n,o=t.moveType,s=void 0===o?"snap":o,u=t.threshold,h=void 0===u?40:u,d=t.interruptable,p=void 0===d||d,v=t.bounce,b=void 0===v?"20%":v,P=t.iOSEdgeSwipeThreshold,n=void 0===P?30:P,o=t.preventClickOnDrag,u=void 0===o||o,d=t.disableOnInit,v=void 0!==d&&d,P=t.renderOnlyVisible,o=void 0!==P&&P,d=t.autoInit,P=void 0===d||d,d=t.autoResize,d=void 0===d||d,t=t.renderExternal,t=void 0===t?null:t,O=x.call(this)||this;return O.resize=function(){return A(O,void 0,void 0,function(){var n,t,i,r,o,a,s;return N(this,function(e){switch(e.label){case 0:return n=this._viewport,t=this._renderer,i=this._camera,s=this._control,a=s.activePanel,r=n.width,o=n.height,a=a?i.getProgressInPanel(a):0,this.trigger(new T.ComponentEvent(M.BEFORE_RESIZE,{width:r,height:o,element:n.element})),n.resize(),[4,t.forceRenderAllPanels()];case 1:return e.sent(),t.updatePanelSize(),[4,t.render()];case 2:return e.sent(),i.updateAlignPos(),i.updateRange(),i.updateAnchors(),s.animating?[3,5]:[3,3];case 3:return[4,s.updatePosition(a)];case 4:e.sent(),s.updateInput(),e.label=5;case 5:return a=n.width,s=n.height,s=a!==r||s!==o,this.trigger(new T.ComponentEvent(M.AFTER_RESIZE,{width:n.width,height:n.height,prev:{width:r,height:o},sizeChanged:s,element:n.element})),[2]}})})},O._preventClickWhenDragged=function(e){O._control.animating&&e.preventDefault()},O._initialized=!1,O._plugins=[],O._align=r,O._defaultIndex=a,O._horizontal=l,O._circular=c,O._bound=f,O._adaptive=g,O._needPanelThreshold=_,O._deceleration=m,O._duration=E,O._easing=y,O._inputType=i,O._moveType=s,O._threshold=h,O._interruptable=p,O._bounce=b,O._iOSEdgeSwipeThreshold=n,O._preventClickOnDrag=u,O._disableOnInit=v,O._renderOnlyVisible=o,O._autoResize=d,O._autoInit=P,O._renderExternal=t,O._viewport=new W(function(e,n){var t=null;if(B(e)){n=(n||document).querySelector(e);if(!n)throw new I(R(e),C.ELEMENT_NOT_FOUND);t=n}else e&&e.nodeType===Node.ELEMENT_NODE&&(t=e);if(!t)throw new I(w(e,["HTMLElement","string"]),C.WRONG_TYPE);return t}(e)),O._renderer=O._createRenderer(),O._camera=O._createCamera(),O._control=O._createControl(),O._autoInit&&O.init(),O}a(e,x);var n=e.prototype;return Object.defineProperty(n,"control",{get:function(){return this._control},enumerable:!1,configurable:!0}),Object.defineProperty(n,"camera",{get:function(){return this._camera},enumerable:!1,configurable:!0}),Object.defineProperty(n,"renderer",{get:function(){return this._renderer},enumerable:!1,configurable:!0}),Object.defineProperty(n,"viewport",{get:function(){return this._viewport},enumerable:!1,configurable:!0}),Object.defineProperty(n,"initialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),Object.defineProperty(n,"circularEnabled",{get:function(){return this._camera.controlParams.circular},enumerable:!1,configurable:!0}),Object.defineProperty(n,"index",{get:function(){return this._control.activeIndex},enumerable:!1,configurable:!0}),Object.defineProperty(n,"element",{get:function(){return this._viewport.element},enumerable:!1,configurable:!0}),Object.defineProperty(n,"currentPanel",{get:function(){return this._control.activePanel},enumerable:!1,configurable:!0}),Object.defineProperty(n,"panels",{get:function(){return this._renderer.panels},enumerable:!1,configurable:!0}),Object.defineProperty(n,"panelCount",{get:function(){return this._renderer.panelCount},enumerable:!1,configurable:!0}),Object.defineProperty(n,"visiblePanels",{get:function(){return this._camera.visiblePanels},enumerable:!1,configurable:!0}),Object.defineProperty(n,"animating",{get:function(){return this._control.animating},enumerable:!1,configurable:!0}),Object.defineProperty(n,"holding",{get:function(){return this._control.holding},enumerable:!1,configurable:!0}),Object.defineProperty(n,"activePlugins",{get:function(){return this._plugins},enumerable:!1,configurable:!0}),Object.defineProperty(n,"align",{get:function(){return this._align},set:function(e){this._align=e,this._renderer.align=e,this._camera.align=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"defaultIndex",{get:function(){return this._defaultIndex},set:function(e){this._defaultIndex=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"horizontal",{get:function(){return this._horizontal},set:function(e){this._horizontal=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"circular",{get:function(){return this._circular},set:function(e){this._circular=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"bound",{get:function(){return this._bound},set:function(e){this._bound=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"adaptive",{get:function(){return this._adaptive},set:function(e){this._adaptive=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"needPanelThreshold",{get:function(){return this._needPanelThreshold},enumerable:!1,configurable:!0}),Object.defineProperty(n,"deceleration",{get:function(){return this._deceleration},set:function(e){this._deceleration=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"easing",{get:function(){return this._easing},set:function(e){this._easing=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"duration",{get:function(){return this._duration},set:function(e){this._duration=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"inputType",{get:function(){return this._inputType},set:function(e){this._inputType=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"moveType",{get:function(){return this._moveType},set:function(e){this._moveType=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"threshold",{get:function(){return this._threshold},set:function(e){this._threshold=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"interruptable",{get:function(){return this._interruptable},set:function(e){this._interruptable=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"bounce",{get:function(){return this._bounce},set:function(e){this._bounce=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"iOSEdgeSwipeThreshold",{get:function(){return this._iOSEdgeSwipeThreshold},set:function(e){this._iOSEdgeSwipeThreshold=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"preventClickOnDrag",{get:function(){return this._preventClickOnDrag},set:function(e){this._preventClickOnDrag=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"disableOnInit",{get:function(){return this._disableOnInit},set:function(e){this._disableOnInit=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"renderOnlyVisible",{get:function(){return this._renderOnlyVisible},set:function(e){this._renderOnlyVisible=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"autoInit",{get:function(){return this._autoInit},enumerable:!1,configurable:!0}),Object.defineProperty(n,"autoResize",{get:function(){return this._autoResize},set:function(e){this._autoResize=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"renderExternal",{get:function(){return this._renderExternal},enumerable:!1,configurable:!0}),n.init=function(){return A(this,void 0,void 0,function(){var n,t,i,r,o=this;return N(this,function(e){switch(e.label){case 0:return this._initialized?[2]:(n=this._camera,t=this._renderer,i=this._control,r=this._viewport,n.init(this),t.init(this),i.init(this),[4,this.resize()]);case 1:return e.sent(),this._moveToInitialPanel(),this._autoResize&&window.addEventListener("resize",this.resize),this._preventClickOnDrag&&r.element.addEventListener("click",this._preventClickWhenDragged),this._disableOnInit&&this.disableInput(),this._plugins.forEach(function(e){return e.init(o)}),this._initialized=!0,this.trigger(new T.ComponentEvent(M.READY)),[2]}})})},n.destroy=function(){this._initialized&&(this.off(),window.removeEventListener("resize",this.resize),this._viewport.element.removeEventListener("click",this._preventClickWhenDragged),this._control.destroy(),this._camera.destroy(),this._renderer.destroy(),this._plugins.forEach(function(e){return e.destroy()}),this._initialized=!1)},n.prev=function(e){var n;return void 0===e&&(e=this._duration),this.moveTo(null!==(n=null===(n=null===(n=this._control.activePanel)||void 0===n?void 0:n.prev())||void 0===n?void 0:n.index)&&void 0!==n?n:-1,e,F.PREV)},n.next=function(e){var n;return void 0===e&&(e=this._duration),this.moveTo(null!==(n=null===(n=null===(n=this._control.activePanel)||void 0===n?void 0:n.next())||void 0===n?void 0:n.index)&&void 0!==n?n:this._renderer.panelCount,e,F.NEXT)},n.moveTo=function(e,n,t){void 0===n&&(n=this._duration),void 0===t&&(t=F.NONE);var i=this._renderer,r=i.panelCount,i=i.getPanel(e);return i?this._control.animating?Promise.reject(new I(j,C.ANIMATION_ALREADY_PLAYING)):this._control.moveToPanel(i,{duration:n,direction:t}):Promise.reject(new I(O(e,0,r-1),C.INDEX_OUT_OF_RANGE))},n.getPanel=function(e){return this._renderer.getPanel(e)},n.enableInput=function(){return this._control.enable(),this},n.disableInput=function(){return this._control.disable(),this},n.getStatus=function(e){var n=void 0===e?{}:e,t=n.index,i=void 0===t||t,r=n.position,e=void 0===r||r,t=n.includePanelHTML,o=void 0!==t&&t,r=n.visiblePanelsOnly,t=void 0!==r&&r,n=this._camera,r={panels:(t?this.visiblePanels:this.panels).map(function(e){var n={index:e.index};return o&&(n.html=e.element.outerHTML),n})};return i&&(r.index=this.index),!e||(e=n.findNearestAnchor(n.position))&&(r.position={panel:e.panel.index,progressInPanel:n.getProgressInPanel(e.panel)}),t&&(t=this.visiblePanels,r.visibleOffset=null!==(t=null===(t=t[0])||void 0===t?void 0:t.index)&&void 0!==t?t:0),r},n.setStatus=function(e){if(!this._initialized)throw new I(z,C.NOT_INITIALIZED);var n=e.index,t=e.position,i=e.visibleOffset,r=e.panels,o=this._renderer,a=this._control;null!==(e=r[0])&&void 0!==e&&e.html&&!this._renderExternal&&(o.batchRemove({index:0,deleteCount:this.panels.length}),o.batchInsert({index:0,elements:u(r.map(function(e){return e.html}))})),n&&this.moveTo(i?n-i:n,0).catch(function(){}),t&&this._moveType===G.FREE_SCROLL&&(n=t.panel,t=t.progressInPanel,t=(n=o.panels[i?n-i:n].range).min+(n.max-n.min)*t,a.moveToPosition(t,0).catch(function(){}))},n.addPlugins=function(){for(var e,n=this,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return this._initialized&&t.forEach(function(e){return e.init(n)}),(e=this._plugins).push.apply(e,f([],h(t))),this},n.removePlugins=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return e.forEach(function(n){var e=function(e,n){for(var t=0;t<e.length;t++)if(n(e[t]))return t;return-1}(t._plugins,function(e){return e===n});0<=e&&(n.destroy(),t._plugins.splice(e,1))}),this},n.append=function(e){return this.insert(this._renderer.panelCount,e)},n.prepend=function(e){return this.insert(0,e)},n.insert=function(e,n){if(this._renderExternal)throw new I(L,C.NOT_ALLOWED_IN_FRAMEWORK);return this._renderer.batchInsert({index:e,elements:u(n)})},n.remove=function(e,n){if(void 0===n&&(n=1),this._renderExternal)throw new I(L,C.NOT_ALLOWED_IN_FRAMEWORK);return this._renderer.batchRemove({index:e,deleteCount:n})},n._createControl=function(){var e,n=this._moveType,t=Object.keys(G).map(function(e){return G[e]}),i=Array.isArray(n)?n[0]:n,r=Array.isArray(n)&&null!==(e=n[1])&&void 0!==e?e:{};if(!_(t,i))throw new I(y("moveType",JSON.stringify(n)),C.WRONG_OPTION);switch(i){case G.SNAP:return new te;case G.FREE_SCROLL:return new ie(r)}},n._createCamera=function(){var e={align:this._align};return this._circular?(this._bound&&console.warn('"circular" and "bound" option cannot be used together, ignoring bound.'),new le(e)):new(this._bound?ue:se)(e)},n._createRenderer=function(){var e=new(this._renderOnlyVisible?ge:he),n={align:this._align,strategy:e},e=this._renderExternal;return e?new e.renderer(r(r({},n),e.rendererOptions)):new de(n)},n._moveToInitialPanel=function(){var e=this._renderer,n=this._control,e=e.getPanel(this._defaultIndex)||e.getPanel(0);e&&n.moveToPanel(e,{duration:0})},e.VERSION="4.0.0",e}(T);return e(ae,{__proto__:null,Viewport:W,FlickingError:I,AnchorPoint:oe,Panel:Y,ElementPanel:fe,ExternalPanel:function(t){function e(e){var n=t.call(this,e)||this;return n._externalComponent=e.externalComponent,n}return a(e,t),e}(Y)}),e(ae,ce),e(ae,re),e(ae,ne),e(ae,n),ae});
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n(require("@egjs/component"),require("@egjs/axes")):"function"==typeof define&&define.amd?define(["@egjs/component","@egjs/axes"],n):(e="undefined"!=typeof globalThis?globalThis:e||self).Flicking=n(e.eg.Component,e.eg.Axes)}(this,function(c,o){"use strict";var i=function(e,n){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])})(e,n)};function a(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function t(){this.constructor=e}i(e,n),e.prototype=null===n?Object.create(n):(t.prototype=n.prototype,new t)}var r=function(){return(r=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var r in n=arguments[t])Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);return e}).apply(this,arguments)};function h(e,a,s,l){return new(s=s||Promise)(function(t,n){function i(e){try{o(l.next(e))}catch(e){n(e)}}function r(e){try{o(l.throw(e))}catch(e){n(e)}}function o(e){var n;e.done?t(e.value):((n=e.value)instanceof s?n:new s(function(e){e(n)})).then(i,r)}o((l=l.apply(e,a||[])).next())})}function f(t,i){var r,o,a,s={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:n(0),throw:n(1),return:n(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function n(n){return function(e){return function(n){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,o&&(a=2&n[0]?o.return:n[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,n[1])).done)return a;switch(o=0,(n=a?[2&n[0],a.value]:n)[0]){case 0:case 1:a=n;break;case 4:return s.label++,{value:n[1],done:!1};case 5:s.label++,o=n[1],n=[0];continue;case 7:n=s.ops.pop(),s.trys.pop();continue;default:if(!(a=0<(a=s.trys).length&&a[a.length-1])&&(6===n[0]||2===n[0])){s=0;continue}if(3===n[0]&&(!a||n[1]>a[0]&&n[1]<a[3])){s.label=n[1];break}if(6===n[0]&&s.label<a[1]){s.label=a[1],a=n;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(n);break}a[2]&&s.ops.pop(),s.trys.pop();continue}n=i.call(t,s)}catch(e){n=[6,e],o=0}finally{r=a=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,e])}}}function d(e){var n="function"==typeof Symbol&&Symbol.iterator,t=n&&e[n],i=0;if(t)return t.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&i>=e.length?void 0:e)&&e[i++],done:!e}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(e,n){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var i,r,o=t.call(e),a=[];try{for(;(void 0===n||0<n--)&&!(i=o.next()).done;)a.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(t=o.return)&&t.call(o)}finally{if(r)throw r.error}}return a}function p(e,n){for(var t=0,i=n.length,r=e.length;t<i;t++,r++)e[r]=n[t];return e}function e(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.forEach(function(n){Object.keys(n).forEach(function(e){t[e]=n[e]})}),t}function t(e,n,t){return Math.max(Math.min(e,t),n)}function _(e,n){if(!e)throw new T(x(n),N.NOT_ATTACHED_TO_FLICKING);return e}function s(e){return[].slice.call(e)}function l(e,n){var t;if(B(e))switch(e){case H.PREV:t=0;break;case H.CENTER:t=.5*n;break;case H.NEXT:t=n;break;default:if(null==(t=V(e,n)))throw new T(C("align",e),N.WRONG_OPTION)}else t=e;return t}function v(e,n){return e===n?F.NONE:e<n?F.NEXT:F.PREV}function u(e){Array.isArray(e)||(e=[e]);var t=[];return e.forEach(function(e){if(B(e)){var n=document.createElement("div");for(n.innerHTML=e,t.push.apply(t,p([],g(s(n.children))));n.firstChild;)n.removeChild(n.firstChild)}else{if(!e||e.nodeType!==Node.ELEMENT_NODE)throw new T(A(e,["HTMLElement","string"]),N.WRONG_TYPE);t.push(e)}}),t}function m(e,n){return t(e<0?e+n:e,0,n)}function b(e,n){var t,i;try{for(var r=d(e),o=r.next();!o.done;o=r.next())if(o.value===n)return 1}catch(e){t={error:e}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(t)throw t.error}}}function E(e,n,t){return(e-n)/(t-n)}function P(e){return window.getComputedStyle(e)||e.currentStyle}var y,T=function(i){function r(e,n){var t=i.call(this,e)||this;return t.message=e,t.code=n,Object.setPrototypeOf(t,r.prototype),t.name="FlickingError",t}return a(r,i),r}(Error),N={WRONG_TYPE:0,ELEMENT_NOT_FOUND:1,VAL_MUST_NOT_NULL:2,NOT_ATTACHED_TO_FLICKING:3,WRONG_OPTION:4,INDEX_OUT_OF_RANGE:5,POSITION_NOT_REACHABLE:6,TRANSFORM_NOT_SUPPORTED:7,STOP_CALLED_BY_USER:8,ANIMATION_INTERRUPTED:9,ANIMATION_ALREADY_PLAYING:10,NOT_ALLOWED_IN_FRAMEWORK:11,NOT_INITIALIZED:12,NO_ACTIVE:13},A=function(e,n){return e+"("+typeof e+") is not a "+n.map(function(e){return'"'+e+'"'}).join(" or ")+"."},I=function(e){return'Element with selector "'+e+'" not found.'},O=function(e,n){return n+" should be provided. Given: "+e},x=function(e){return e+' is not attached to the Flicking instance. "init()" should be called first.'},C=function(e,n){return'Option "'+e+'" is not in correct format, given: '+n},w=function(e,n,t){return'Index "'+e+'" is out of range: should be between '+n+" and "+t+"."},R=function(e){return'Position "'+e+'" is not reachable.'},k="Browser does not support CSS transform.",S="Event stop() is called by user.",D="Animation is interrupted by user input.",j="Animation is already playing.",L="This behavior is not allowed in the frameworks like React, Vue, or Angular.",z="Flicking is not initialized yet, call init() first.",M={READY:"ready",BEFORE_RESIZE:"beforeResize",AFTER_RESIZE:"afterResize",HOLD_START:"holdStart",HOLD_END:"holdEnd",MOVE_START:"moveStart",MOVE:"move",MOVE_END:"moveEnd",WILL_CHANGE:"willChange",CHANGED:"changed",WILL_RESTORE:"willRestore",RESTORED:"restored",SELECT:"select",NEED_PANEL:"needPanel",VISIBLE_CHANGE:"visibleChange",REACH_EDGE:"reachEdge",PANEL_CHANGE:"panelChange"},H={PREV:"prev",CENTER:"center",NEXT:"next"},F={PREV:"PREV",NEXT:"NEXT",NONE:null},G={SNAP:"snap",FREE_SCROLL:"freeScroll"},n={__proto__:null,EVENTS:M,ALIGN:H,DIRECTION:F,MOVE_TYPE:G,ERROR_CODE:N},V=function(e,n){var t=/(?:(\+|\-)\s*)?(\d+(?:\.\d+)?(%|px)?)/g;if("number"==typeof e)return e;for(var i=0,r=0,o=t.exec(e);null!=o;){var a=o[1],s=o[2],l=o[3],s=parseFloat(s);if(!(a=i<=0?a||"+":a))return null;"%"===l&&(s=s/100*n),r+="+"===a?s:-s,++i,o=t.exec(e)}return 0===i?null:r},B=function(e){return"string"==typeof e},W=function(){function e(e){this._el=e,this._width=0,this._height=0,this._padding={left:0,right:0,top:0,bottom:0},this._isBorderBoxSizing=!1}var n=e.prototype;return Object.defineProperty(n,"element",{get:function(){return this._el},enumerable:!1,configurable:!0}),Object.defineProperty(n,"width",{get:function(){return this._width-this._padding.left-this._padding.right},enumerable:!1,configurable:!0}),Object.defineProperty(n,"height",{get:function(){return this._height-this._padding.top-this._padding.bottom},enumerable:!1,configurable:!0}),Object.defineProperty(n,"padding",{get:function(){return this._padding},enumerable:!1,configurable:!0}),n.setSize=function(e){var n=e.width,t=e.height,i=this._el,r=this._padding,e=this._isBorderBoxSizing;null!=n&&(B(n)?i.style.width=n:(n=e?n+r.left+r.right:n,i.style.width=n+"px")),null!=t&&(B(t)?i.style.height=t:(t=e?t+r.top+r.bottom:t,i.style.height=t+"px")),this.resize()},n.resize=function(){var e=this._el,n=P(e);this._width=e.offsetWidth,this._height=e.offsetHeight,this._padding={left:parseFloat(n.paddingLeft),right:parseFloat(n.paddingRight),top:parseFloat(n.paddingTop),bottom:parseFloat(n.paddingBottom)},this._isBorderBoxSizing="border-box"===n.boxSizing},e}(),X={HOLD:"hold",CHANGE:"change",RELEASE:"release",ANIMATION_END:"animationEnd",FINISH:"finish"},U="flick";(ce=y=y||{})[ce.IDLE=0]="IDLE",ce[ce.HOLDING=1]="HOLDING",ce[ce.DRAGGING=2]="DRAGGING",ce[ce.ANIMATING=3]="ANIMATING",ce[ce.DISABLED=4]="DISABLED";var Y=function(){function e(){}var n=e.prototype;return n.onHold=function(e){},n.onChange=function(e){},n.onRelease=function(e){},n.onAnimationEnd=function(e){},n.onFinish=function(e){},e}(),K=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.holding=!1,e.animating=!1,e}a(e,n);var t=e.prototype;return t.onHold=function(e){var n=e.flicking,t=e.axesEvent,e=e.transitTo;n.renderer.panelCount<=0?e(y.DISABLED):(t=new c.ComponentEvent(M.HOLD_START,{axesEvent:t}),n.trigger(t),t.isCanceled()?e(y.DISABLED):e(y.HOLDING))},t.onChange=function(e){var n=e.flicking,t=e.axesEvent,i=e.transitTo,r=n.control.controller.animatingContext,t=new c.ComponentEvent(M.MOVE_START,{isTrusted:t.isTrusted,holding:this.holding,direction:v(r.start,r.end),axesEvent:t});n.trigger(t),t.isCanceled()?i(y.DISABLED):i(y.ANIMATING).onChange(e)},e}(Y),Z=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.holding=!0,e.animating=!1,e._releaseEvent=null,e}a(e,n);var t=e.prototype;return t.onChange=function(e){var n=e.flicking,t=e.axesEvent,i=e.transitTo,r=t.inputEvent,r=n.horizontal?r.offsetX:r.offsetY,t=new c.ComponentEvent(M.MOVE_START,{isTrusted:t.isTrusted,holding:this.holding,direction:v(0,-r),axesEvent:t});n.trigger(t),t.isCanceled()?i(y.DISABLED):i(y.DRAGGING).onChange(e)},t.onRelease=function(e){var n=e.flicking,t=e.axesEvent,e=e.transitTo;if(n.trigger(new c.ComponentEvent(M.HOLD_END,{axesEvent:t})),0!==t.delta.flick)return t.setTo({flick:n.camera.position},0),void e(y.IDLE);this._releaseEvent=t},t.onFinish=function(e){var n=e.flicking;if((0,e.transitTo)(y.IDLE),this._releaseEvent){var t,i=this._releaseEvent.inputEvent.srcEvent;t="touchend"===i.type?(e=i.changedTouches[0],document.elementFromPoint(e.clientX,e.clientY)):i.target;var r,o,i=n.renderer.panels,a=null;try{for(var s=d(i),l=s.next();!l.done;l=s.next()){var u=l.value;if(u.contains(t)){a=u;break}}}catch(e){o={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(o)throw o.error}}a&&(r=n.camera.position,o=a.position,n.trigger(new c.ComponentEvent(M.SELECT,{index:a.index,panel:a,direction:v(r,o)})))}},e}(Y),q=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.holding=!0,e.animating=!0,e}a(e,n);var t=e.prototype;return t.onChange=function(e){var n,t=e.flicking,i=e.axesEvent,r=e.transitTo;i.delta[U]&&(e=(n=t.camera).position,n.lookAt(i.pos[U]),i=new c.ComponentEvent(M.MOVE,{isTrusted:i.isTrusted,holding:this.holding,direction:v(0,i.delta[U]),axesEvent:i}),t.trigger(i),i.isCanceled()&&(n.lookAt(e),r(y.DISABLED)))},t.onRelease=function(e){var n=e.flicking,t=e.axesEvent,i=e.transitTo;n.trigger(new c.ComponentEvent(M.HOLD_END,{axesEvent:t})),n.renderer.panelCount<=0?i(y.IDLE):(i(y.ANIMATING),e=n.control,i=t.destPos[U],n=Math.max(t.duration,n.duration),e.moveToPosition(i,n,t))},e}(Y),J=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.holding=!1,e.animating=!0,e}a(e,n);var t=e.prototype;return t.onHold=function(e){var n=e.flicking,t=e.axesEvent,e=e.transitTo,t=new c.ComponentEvent(M.HOLD_START,{axesEvent:t});n.trigger(t),t.isCanceled()?e(y.DISABLED):e(y.DRAGGING)},t.onChange=function(e){var n,t=e.flicking,i=e.axesEvent,r=e.transitTo;i.delta.flick&&(e=(n=t.camera).position,n.lookAt(i.pos.flick),i=new c.ComponentEvent(M.MOVE,{isTrusted:i.isTrusted,holding:this.holding,direction:v(0,i.delta.flick),axesEvent:i}),t.trigger(i),i.isCanceled()&&(t.camera.lookAt(e),r(y.DISABLED)))},t.onFinish=function(e){var n=e.flicking,t=e.axesEvent;(0,e.transitTo)(y.IDLE);e=n.control.controller.animatingContext;n.trigger(new c.ComponentEvent(M.MOVE_END,{isTrusted:t.isTrusted,direction:v(e.start,e.end),axesEvent:t}))},e}(Y),Q=function(n){function e(){var e=null!==n&&n.apply(this,arguments)||this;return e.holding=!1,e.animating=!0,e}a(e,n);var t=e.prototype;return t.onAnimationEnd=function(e){(0,e.transitTo)(y.IDLE)},t.onChange=function(e){var n=e.axesEvent,e=e.transitTo;n.stop(),e(y.IDLE)},t.onRelease=function(e){var n=e.axesEvent,e=e.transitTo;0===n.delta.flick&&e(y.IDLE)},e}(Y),$=function(){function e(){var t=this;this.transitTo=function(e){var n;switch(e){case y.IDLE:n=new K;break;case y.HOLDING:n=new Z;break;case y.DRAGGING:n=new q;break;case y.ANIMATING:n=new J;break;case y.DISABLED:n=new Q}return t._state=n,t._state},this._state=new K}var n=e.prototype;return Object.defineProperty(n,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),n.fire=function(e,n){var t=this._state,i=r(r({},n),{transitTo:this.transitTo});switch(e){case X.HOLD:t.onHold(i);break;case X.CHANGE:t.onChange(i);break;case X.RELEASE:t.onRelease(i);break;case X.ANIMATION_END:t.onAnimationEnd(i);break;case X.FINISH:t.onFinish(i)}},e}(),ee=function(){function e(){this._resetInternalValues(),this._stateMachine=new $}var n=e.prototype;return Object.defineProperty(n,"axes",{get:function(){return this._axes},enumerable:!1,configurable:!0}),Object.defineProperty(n,"state",{get:function(){return this._stateMachine.state},enumerable:!1,configurable:!0}),Object.defineProperty(n,"animatingContext",{get:function(){return this._animatingContext},enumerable:!1,configurable:!0}),Object.defineProperty(n,"enabled",{get:function(){var e;return null!==(e=null===(e=this._panInput)||void 0===e?void 0:e.isEnable())&&void 0!==e&&e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"position",{get:function(){var e;return null!==(e=null===(e=this._axes)||void 0===e?void 0:e.get([U])[U])&&void 0!==e?e:0},enumerable:!1,configurable:!0}),Object.defineProperty(n,"bounce",{get:function(){var e;return null===(e=this._axes)||void 0===e?void 0:e.axis[U].bounce},enumerable:!1,configurable:!0}),n.init=function(t){var e,i=this;this._flicking=t,this._axes=new o(((e={})[U]={range:[0,0],circular:!1,bounce:[0,0]},e),{deceleration:t.deceleration,interruptable:t.interruptable,easing:t.easing}),this._panInput=new o.PanInput(t.viewport.element,{inputType:t.inputType,iOSEdgeSwipeThreshold:t.iOSEdgeSwipeThreshold,scale:t.horizontal?[-1,0]:[0,-1]});var r=this._axes;r.connect(t.horizontal?[U,""]:["",U],this._panInput);for(var n in X)!function(e){var n=X[e];r.on(n,function(e){i._stateMachine.fire(n,{flicking:t,axesEvent:e})})}(n);return this},n.destroy=function(){var e;null!==(e=this._axes)&&void 0!==e&&e.destroy(),null!==(e=this._panInput)&&void 0!==e&&e.destroy(),this._resetInternalValues()},n.enable=function(){var e;return null!==(e=this._panInput)&&void 0!==e&&e.enable(),this},n.disable=function(){var e;return null!==(e=this._panInput)&&void 0!==e&&e.disable(),this},n.update=function(){var n,t,e=_(this._flicking,"Control"),i=e.camera,r=this._axes,o=i.controlParams,a=r.axis[U];return a.circular=[o.circular,o.circular],a.range=[o.range.min,o.range.max],a.bounce=(n=e.bounce,t=i.size,(Array.isArray(n)?n.map(function(e){return V(e,t)}):[i=V(n,t),i]).map(function(e){if(null==e)throw new T(C("bounce",n),N.WRONG_OPTION);return e})),r.axm.set(((r={})[U]=o.position,r)),this},n.animateTo=function(n,t,i){var r=this,o=this._axes;if(!o)return Promise.reject(new T(x("Control"),N.NOT_ATTACHED_TO_FLICKING));var e=o.get([U])[U];if(e===n)return _(this._flicking,"Control").camera.lookAt(n);this._animatingContext={start:e,end:n,offset:0};function a(){var e;o.once(X.FINISH,function(){r._animatingContext={start:0,end:0,offset:0}}),i?i.setTo(((e={})[U]=n,e),t):o.setTo(((e={})[U]=n,e),t)}return 0===t?(a(),o.axm.set(((e={})[U]=n,e)),Promise.resolve()):new Promise(function(e,n){function t(){o.off(X.HOLD,i),e()}var i=function(){o.off(X.FINISH,t),n(new T(D,N.ANIMATION_INTERRUPTED))};o.once(X.FINISH,t),o.once(X.HOLD,i),a()})},n._resetInternalValues=function(){this._flicking=null,this._axes=null,this._panInput=null,this._animatingContext={start:0,end:0,offset:0}},e}(),ne=function(){function e(){var o=this;this._setActive=function(e,n,t){var i,r=_(o._flicking,"Control");o._activePanel=e,r.camera.updateAdaptiveHeight(),e!==n?r.trigger(new c.ComponentEvent(M.CHANGED,{index:e.index,panel:e,prevIndex:null!==(i=null==n?void 0:n.index)&&void 0!==i?i:-1,prevPanel:n,isTrusted:t,direction:n?v(n.position,e.position):F.NONE})):r.trigger(new c.ComponentEvent(M.RESTORED,{isTrusted:t}))},this._flicking=null,this._controller=new ee,this._activePanel=null}var n=e.prototype;return Object.defineProperty(n,"controller",{get:function(){return this._controller},enumerable:!1,configurable:!0}),Object.defineProperty(n,"activeIndex",{get:function(){var e;return null!==(e=null===(e=this._activePanel)||void 0===e?void 0:e.index)&&void 0!==e?e:-1},enumerable:!1,configurable:!0}),Object.defineProperty(n,"activePanel",{get:function(){return this._activePanel},enumerable:!1,configurable:!0}),Object.defineProperty(n,"animating",{get:function(){return this._controller.state.animating},enumerable:!1,configurable:!0}),Object.defineProperty(n,"holding",{get:function(){return this._controller.state.holding},enumerable:!1,configurable:!0}),n.init=function(e){return this._flicking=e,this._controller.init(e),this},n.destroy=function(){this._controller.destroy(),this._flicking=null,this._activePanel=null},n.enable=function(){return this._controller.enable(),this},n.disable=function(){return this._controller.disable(),this},n.updatePosition=function(e){return h(this,void 0,void 0,function(){var n,t;return f(this,function(e){switch(e.label){case 0:return t=_(this._flicking,"Control"),n=t.camera,(t=this._activePanel)?[4,n.lookAt(n.clampToReachablePosition(t.position))]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})},n.updateInput=function(){return this._controller.update(),this},n.resetActive=function(){return this._activePanel=null,this},n.moveToPanel=function(a,e){var s=e.duration,n=e.direction,l=void 0===n?F.NONE:n,u=e.axesEvent;return h(this,void 0,void 0,function(){var n,t,i,r,o;return f(this,function(e){return n=_(this._flicking,"Control"),o=n.camera,t=a.position,i=o.findNearestAnchor(t),a.removed||!i?[2,Promise.reject(new T(R(a.position),N.POSITION_NOT_REACHABLE))]:(o.canReach(a)?n.circularEnabled&&(r=this._controller.position,o=o.rangeDiff,t=[t,t+o,t-o].filter(function(e){return l===F.NONE||(l===F.PREV?e<=r:r<=e)}).reduce(function(e,n){return Math.abs(r-n)<Math.abs(r-e)?n:e},1/0)):(t=i.position,a=i.panel),this._triggerIndexChangeEvent(a,a.position,u),[2,this._animateToPosition({position:t,duration:s,newActivePanel:a,axesEvent:u})])})})},n._triggerIndexChangeEvent=function(e,n,t){var i=_(this._flicking,"Control"),r=e!==this._activePanel?M.WILL_CHANGE:M.WILL_RESTORE,o=i.camera,a=this._activePanel,n=new c.ComponentEvent(r,{index:e.index,panel:e,isTrusted:(null==t?void 0:t.isTrusted)||!1,direction:v(null!==(a=null==a?void 0:a.position)&&void 0!==a?a:o.position,n)});if(i.trigger(n),n.isCanceled())throw new T(S,N.STOP_CALLED_BY_USER)},n._animateToPosition=function(e){var s=e.position,l=e.duration,u=e.newActivePanel,c=e.axesEvent;return h(this,void 0,void 0,function(){var n,t,i,r,o,a=this;return f(this,function(e){return n=_(this._flicking,"Control"),t=this._activePanel,i=function(){return a._controller.animateTo(s,l,c)},r=(null==c?void 0:c.isTrusted)||!1,l<=0?(o=i(),this._setActive(u,t,r),[2,o]):[2,i().then(function(){return h(a,void 0,void 0,function(){return f(this,function(e){switch(e.label){case 0:return this._setActive(u,t,r),[4,n.renderer.render()];case 1:return e.sent(),[2]}})})}).catch(function(e){if(!(c&&e instanceof T&&e.code===N.ANIMATION_INTERRUPTED))throw e})]})})},e}(),te=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return a(n,e),n.prototype.moveToPosition=function(l,u,c){return h(this,void 0,void 0,function(){var n,t,i,r,o,a,s;return f(this,function(e){return r=_(this._flicking,"Control"),n=r.camera,t=this._activePanel,o=n.clampToReachablePosition(l),(i=n.findNearestAnchor(o))&&t?(o=t.position,r=Math.abs(l-o)>=r.threshold,o=o<l?n.getNextAnchor(i):n.getPrevAnchor(i),r&&i.position!==t.position?(s=i.panel,a=i.position):r&&o?(s=o.panel,a=o.position):(a=n.clampToReachablePosition(t.position),s=t),this._triggerIndexChangeEvent(s,l,c),[2,this._animateToPosition({position:a,duration:u,newActivePanel:s,axesEvent:c})]):[2,Promise.reject(new T(R(l),N.POSITION_NOT_REACHABLE))]})})},n}(ne),ie=function(t){function e(e){var n=(void 0===e?{}:e).stopAtEdge,e=void 0===n||n,n=t.call(this)||this;return n._stopAtEdge=e,n}a(e,t);var n=e.prototype;return Object.defineProperty(n,"stopAtEdge",{get:function(){return this._stopAtEdge},set:function(e){this._stopAtEdge=e},enumerable:!1,configurable:!0}),n.updatePosition=function(i){return h(this,void 0,void 0,function(){var n,t;return f(this,function(e){switch(e.label){case 0:return(t=_(this._flicking,"Control"),n=t.camera,t=this._activePanel)?(t=t.range,t=t.min+(t.max-t.min)*i,[4,n.lookAt(n.clampToReachablePosition(t))]):[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})},n.moveToPosition=function(i,r,o){return h(this,void 0,void 0,function(){var n,t;return f(this,function(e){return n=_(this._flicking,"Control"),t=n.camera,n=t.clampToReachablePosition(i),(t=t.findAnchorIncludePosition(n))?((t=t.panel)!==this._activePanel&&this._triggerIndexChangeEvent(t,i,o),[2,this._animateToPosition({position:this._stopAtEdge?n:i,duration:r,newActivePanel:t,axesEvent:o})]):[2,Promise.reject(new T(R(i),N.POSITION_NOT_REACHABLE))]})})},e}(ne),re={__proto__:null,Control:ne,SnapControl:te,FreeControl:ie,AxesController:ee,State:Y,IdleState:K,HoldingState:Z,DraggingState:q,AnimatingState:J,DisabledState:Q,StateMachine:$},oe=function(){function e(e){var n=e.index,t=e.position,e=e.panel;this._index=n,this._pos=t,this._panel=e}var n=e.prototype;return Object.defineProperty(n,"index",{get:function(){return this._index},enumerable:!1,configurable:!0}),Object.defineProperty(n,"position",{get:function(){return this._pos},enumerable:!1,configurable:!0}),Object.defineProperty(n,"panel",{get:function(){return this._panel},enumerable:!1,configurable:!0}),e}(),ae=function(){function e(e){var s=this,e=(void 0===e?{}:e).align,e=void 0===e?H.CENTER:e;this._checkTranslateSupport=function(){var n,e,t=document.documentElement.style,i="";try{for(var r=d(["webkitTransform","msTransform","MozTransform","OTransform","transform"]),o=r.next();!o.done;o=r.next()){var a=o.value;a in t&&(i=a)}}catch(e){n={error:e}}finally{try{o&&!o.done&&(e=r.return)&&e.call(r)}finally{if(n)throw n.error}}if(!i)throw new T(k,N.TRANSFORM_NOT_SUPPORTED);s._transform=i},this._flicking=null,this._resetInternalValues(),this._align=e}var n=e.prototype;return Object.defineProperty(n,"element",{get:function(){return this._el},enumerable:!1,configurable:!0}),Object.defineProperty(n,"position",{get:function(){return this._position},enumerable:!1,configurable:!0}),Object.defineProperty(n,"alignPosition",{get:function(){return this._alignPos},enumerable:!1,configurable:!0}),Object.defineProperty(n,"offset",{get:function(){return this._offset},enumerable:!1,configurable:!0}),Object.defineProperty(n,"range",{get:function(){return this._range},enumerable:!1,configurable:!0}),Object.defineProperty(n,"rangeDiff",{get:function(){return this._range.max-this._range.min},enumerable:!1,configurable:!0}),Object.defineProperty(n,"visiblePanels",{get:function(){return this._visiblePanels},enumerable:!1,configurable:!0}),Object.defineProperty(n,"visibleRange",{get:function(){return{min:this._position-this._alignPos,max:this._position-this._alignPos+this.size}},enumerable:!1,configurable:!0}),Object.defineProperty(n,"anchorPoints",{get:function(){return this._anchors},enumerable:!1,configurable:!0}),Object.defineProperty(n,"controlParams",{get:function(){return{range:this._range,position:this._position,circular:!1}},enumerable:!1,configurable:!0}),Object.defineProperty(n,"atEdge",{get:function(){return this._position<=this._range.min||this._position>=this._range.max},enumerable:!1,configurable:!0}),Object.defineProperty(n,"size",{get:function(){var e=this._flicking;return e?e.horizontal?e.viewport.width:e.viewport.height:0},enumerable:!1,configurable:!0}),Object.defineProperty(n,"progress",{get:function(){var e=this._flicking,n=this._position+this._offset,t=this.findNearestAnchor(this._position);if(!e||!t)return NaN;var i=t.panel,r=i.position+i.offset,o=e.control.controller.bounce,a=this.range,t=a.min,e=a.max,a=this.rangeDiff;if(n===r)return i.index;if(n<r){var s=i.prev(),s=s?s.position+s.offset:t-o[0];return r<s&&(s-=a),i.index-1+E(n,s,r)}s=i.next(),o=s?s.position+s.offset:e+o[1];return o<r&&(o+=a),i.index+E(n,r,o)},enumerable:!1,configurable:!0}),Object.defineProperty(n,"align",{get:function(){return this._align},set:function(e){this._align=e},enumerable:!1,configurable:!0}),n.init=function(e){e=(this._flicking=e).viewport.element;return function(e,n){if(null==e)throw new T(O(e,n),N.VAL_MUST_NOT_NULL)}(e.firstElementChild,"First element child of the viewport element"),this._el=e.firstElementChild,this._checkTranslateSupport(),this},n.destroy=function(){return this._flicking=null,this._resetInternalValues(),this},n.lookAt=function(t){return h(this,void 0,void 0,function(){var n;return f(this,function(e){switch(e.label){case 0:return n=this._position,this._position=t,[4,this._refreshVisiblePanels()];case 1:return e.sent(),this._checkNeedPanel(),this._checkReachEnd(n,t),this._applyTransform(),[2]}})})},n.getPrevAnchor=function(e){return this._anchors[e.index-1]||null},n.getNextAnchor=function(e){return this._anchors[e.index+1]||null},n.getProgressInPanel=function(e){e=e.range;return(this._position-e.min)/(e.max-e.min)},n.findAnchorIncludePosition=function(t){return this._anchors.filter(function(e){return e.panel.includePosition(t,!0)}).reduce(function(e,n){return e&&Math.abs(e.position-t)<Math.abs(n.position-t)?e:n},null)},n.findNearestAnchor=function(e){var n=this._anchors;if(n.length<=0)return null;for(var t=1/0,i=0;i<n.length;i++){var r=n[i],r=Math.abs(r.position-e);if(t<r)return n[i-1];t=r}return n[n.length-1]},n.clampToReachablePosition=function(e){var n=this._range;return t(e,n.min,n.max)},n.canReach=function(e){var n=this._range;if(e.removed)return!1;e=e.position;return e>=n.min&&e<=n.max},n.canSee=function(e){var n=this.visibleRange;return e.includeRange(n.min,n.max,!1)},n.updateAlignPos=function(){var e=this._align,e="object"==typeof e?e.camera:e;return this._alignPos=l(e,this.size),this},n.updateAnchors=function(){var e=_(this._flicking,"Camera").renderer.panels;return this._anchors=e.map(function(e,n){return new oe({index:n,position:e.position,panel:e})}),this},n.updateAdaptiveHeight=function(){var e=_(this._flicking,"Camera"),n=e.control.activePanel;e.horizontal&&e.adaptive&&n&&e.viewport.setSize({height:n.height})},n.updateOffset=function(){var e=_(this._flicking,"Camera").panels.filter(function(e){return!e.rendered}),n=this._position;this._offset=e.filter(function(e){return e.position+e.offset<n}).reduce(function(e,n){return e+n.sizeIncludingMargin},0),this._applyTransform()},n.resetNeedPanelHistory=function(){return this._needPanelTriggered={prev:!1,next:!1},this},n._resetInternalValues=function(){this._position=0,this._alignPos=0,this._offset=0,this._range={min:0,max:0},this._visiblePanels=[],this._anchors=[],this._needPanelTriggered={prev:!1,next:!1}},n._refreshVisiblePanels=function(){return h(this,void 0,void 0,function(){var n,t,i,r,o,a=this;return f(this,function(e){switch(e.label){case 0:return n=_(this._flicking,"Camera"),o=n.renderer.panels,t=o.filter(function(e){return a.canSee(e)}),i=this._visiblePanels,this._visiblePanels=t,r=t.filter(function(e){return!b(i,e)}),o=i.filter(function(e){return!b(t,e)}),0<r.length||0<o.length?[4,n.renderer.render()]:[3,2];case 1:e.sent(),n.trigger(new c.ComponentEvent(M.VISIBLE_CHANGE,{added:r,removed:o,visiblePanels:t})),e.label=2;case 2:return[2]}})})},n._checkNeedPanel=function(){var e=this._needPanelTriggered;if(!e.prev||!e.next){var n=_(this._flicking,"Camera"),t=n.renderer.panels;if(t.length<=0)return e.prev||(n.trigger(new c.ComponentEvent(M.NEED_PANEL,{direction:F.PREV})),e.prev=!0),void(e.next||(n.trigger(new c.ComponentEvent(M.NEED_PANEL,{direction:F.NEXT})),e.next=!0));var i=this._position,r=this.size,o=this._range,a=n.needPanelThreshold,s=i-this._alignPos,l=s+r,r=t[0],t=t[t.length-1];e.prev||(s<=r.range.min+a||i<=o.min+a)&&(n.trigger(new c.ComponentEvent(M.NEED_PANEL,{direction:F.PREV})),e.prev=!0),e.next||(t.range.max-a<=l||i>=o.max-a)&&(n.trigger(new c.ComponentEvent(M.NEED_PANEL,{direction:F.NEXT})),e.next=!0)}},n._checkReachEnd=function(e,n){var t=_(this._flicking,"Camera"),i=this._range,r=e>i.min&&e<i.max,e=n>i.min&&n<i.max;r&&!e&&(i=n<=i.min?F.PREV:F.NEXT,t.trigger(new c.ComponentEvent(M.REACH_EDGE,{direction:i})))},n._applyTransform=function(){var e=this._el,n=_(this._flicking,"Camera"),t=this._position-this._alignPos-this._offset;e.style[this._transform]=n.horizontal?"translate("+-t+"px)":"translate(0, "+-t+"px)"},e}(),se=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return a(n,e),n.prototype.updateRange=function(){var e=_(this._flicking,"Camera").renderer,n=e.getPanel(0),e=e.getPanel(e.panelCount-1);return this._range={min:null!==(n=null==n?void 0:n.position)&&void 0!==n?n:0,max:null!==(e=null==e?void 0:e.position)&&void 0!==e?e:0},this},n}(ae),le=function(s){function e(){var e=null!==s&&s.apply(this,arguments)||this;return e._circularOffset=0,e._circularEnabled=!1,e}a(e,s);var n=e.prototype;return Object.defineProperty(n,"offset",{get:function(){return this._offset-this._circularOffset},enumerable:!1,configurable:!0}),Object.defineProperty(n,"controlParams",{get:function(){return{range:this._range,position:this._position,circular:this._circularEnabled}},enumerable:!1,configurable:!0}),n.getPrevAnchor=function(e){if(!this._circularEnabled||0!==e.index)return s.prototype.getPrevAnchor.call(this,e);var n=this._anchors,e=this.rangeDiff,n=n[n.length-1];return new oe({index:n.index,position:n.position-e,panel:n.panel})},n.getNextAnchor=function(e){var n=this._anchors;if(!this._circularEnabled||e.index!==n.length-1)return s.prototype.getNextAnchor.call(this,e);e=this.rangeDiff,n=n[0];return new oe({index:n.index,position:n.position+e,panel:n.panel})},n.findAnchorIncludePosition=function(e){if(!this._circularEnabled)return s.prototype.findAnchorIncludePosition.call(this,e);var n,t,i=this._range,r=(o=e,n=i.min,t=i.max,r=t-n,o<n?o=t-(n-o)%r:t<o&&(o=n+(o-t)%r),o),o=s.prototype.findAnchorIncludePosition.call(this,r);if(!o)return null;var r=this.rangeDiff;if(e<i.min){var a=-Math.floor((i.min-e)/r)-1;return new oe({index:o.index,position:o.position+r*a,panel:o.panel})}if(e>i.max){a=Math.floor((e-i.max)/r)+1;return new oe({index:o.index,position:o.position+r*a,panel:o.panel})}return o},n.clampToReachablePosition=function(e){return this._circularEnabled?e:s.prototype.clampToReachablePosition.call(this,e)},n.canReach=function(e){return!e.removed&&(!!this._circularEnabled||s.prototype.canReach.call(this,e))},n.canSee=function(e){var n=this._range,t=this.rangeDiff,i=this.visibleRange,r=s.prototype.canSee.call(this,e);return this._circularEnabled?i.min<n.min?r||e.includeRange(i.min+t,i.max+t,!1):i.max>n.max?r||e.includeRange(i.min-t,i.max-t,!1):r:r},n.updateRange=function(){var e=_(this._flicking,"Camera").renderer.panels;if(e.length<=0)return this._resetInternalValues(),this;var n=e[0],t=e[e.length-1],i=n.range.min-n.margin.prev,r=t.range.max+t.margin.next,o=this.size,a=r-i,s=e.every(function(e){return a-e.size>=o});return(this._circularEnabled=s)?(this._range={min:i,max:r},e.forEach(function(e){return e.updateCircularToggleDirection()})):this._range={min:n.position,max:t.position},this._updateCircularOffset(),this},n.lookAt=function(r){return h(this,void 0,void 0,function(){var n,t,i;return f(this,function(e){switch(e.label){case 0:return n=_(this._flicking,"Camera"),t=this._position,r!==t?[3,2]:[4,s.prototype.lookAt.call(this,r)];case 1:return[2,e.sent()];case 2:return(i=n.renderer.panels,i=i.map(function(e){return e.toggle(t,r)}),this._position=r,i.some(function(e){return e}))?(this._updateCircularOffset(),[4,n.renderer.render()]):[3,4];case 3:e.sent(),e.label=4;case 4:return[4,s.prototype.lookAt.call(this,r)];case 5:return[2,e.sent()]}})})},n._applyTransform=function(){var e=this._el,n=_(this._flicking,"Camera"),t=this._position-this._alignPos-this._offset+this._circularOffset;e.style[this._transform]=n.horizontal?"translate("+-t+"px)":"translate(0, "+-t+"px)"},n._resetInternalValues=function(){s.prototype._resetInternalValues.call(this),this._circularOffset=0,this._circularEnabled=!1},n._calcPanelAreaSum=function(e){return e.reduce(function(e,n){return e+n.sizeIncludingMargin},0)},n._updateCircularOffset=function(){var e,n,t;this._circularEnabled?(e=_(this._flicking,"Camera"),n=[],t=[],e.panels.filter(function(e){return e.toggled}).forEach(function(e){(e.toggleDirection===F.PREV?n:t).push(e)}),this._circularOffset=this._calcPanelAreaSum(n)-this._calcPanelAreaSum(t)):this._circularOffset=0},e}(ae),ue=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}a(n,e);var t=n.prototype;return t.updateRange=function(){var e=_(this._flicking,"Camera").renderer,n=this._alignPos,t=e.getPanel(0),i=e.getPanel(e.panelCount-1);if(!t||!i)return this._range={min:0,max:0},this;var r=this.size,o=t.range.min,e=i.range.max;return this._range=r<e-o?{min:o+n,max:e-r+n}:{min:t.position,max:i.position},this},t.updateAnchors=function(){var n=this,e=_(this._flicking,"Camera").renderer.panels;if(e.length<=0)return this._anchors=[],this;var t,i,r,o,a=this._range,s=e.filter(function(e){return n.canReach(e)});return 0<s.length?(t=s[0].position!==a.min,i=s[s.length-1].position!==a.max,r=t?1:0,o=s.map(function(e,n){return new oe({index:n+r,position:e.position,panel:e})}),t&&o.splice(0,0,new oe({index:0,position:a.min,panel:e[s[0].index-1]})),i&&o.push(new oe({index:o.length,position:a.max,panel:e[s[s.length-1].index+1]})),this._anchors=o):a.min!==a.max?(s=(o=(s=this._findNearestPanel(a.min,e)).index===e.length-1?s.prev():s).next(),this._anchors=[new oe({index:0,position:a.min,panel:o}),new oe({index:1,position:a.max,panel:s})]):this._anchors=[new oe({index:0,position:a.min,panel:this._findNearestPanel(a.min,e)})],this},t._findNearestPanel=function(e,n){for(var t=1/0,i=0;i<n.length;i++){var r=n[i],r=Math.abs(r.position-e);if(t<r)return n[i-1];t=r}return n[n.length-1]},n}(ae),ce={__proto__:null,Camera:ae,LinearCamera:se,CircularCamera:le,BoundCamera:ue},he=function(){function e(){}return e.prototype.updateRenderingPanels=function(e){e.panels.forEach(function(e){return e.markForShow()})},e}(),ne=function(){function e(e){var n=void 0===e?{}:e,e=n.align,e=void 0===e?H.CENTER:e,n=n.strategy,n=void 0===n?new he:n;this._align=e,this._flicking=null,this._renderingStrategy=n,this._panels=[]}var n=e.prototype;return Object.defineProperty(n,"panels",{get:function(){return this._panels},enumerable:!1,configurable:!0}),Object.defineProperty(n,"panelCount",{get:function(){return this._panels.length},enumerable:!1,configurable:!0}),Object.defineProperty(n,"align",{get:function(){return this._align},set:function(e){this._align=e;var n=this._getPanelAlign();this._panels.forEach(function(e){e.align=n})},enumerable:!1,configurable:!0}),n.init=function(e){return this._flicking=e,this._collectPanels(),this},n.destroy=function(){this._flicking=null,this._panels=[]},n.getPanel=function(e){return this._panels[e]||null},n.updatePanelSize=function(){return this._panels.forEach(function(e){return e.resize()}),this},n.batchInsert=function(){for(var a=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var s=this._panels,l=_(this._flicking,"Renderer"),t=l.control,u=this._getPanelAlign(),i=e.reduce(function(e,n){var t=m(n.index,s.length),i=s.slice(t),r=n.elements.map(function(e){return a._createPanel(e,{index:t,align:u,flicking:l})});s.splice.apply(s,p([t,0],g(r))),r.forEach(function(e){return e.resize()});var o=a._getPanelSizeSum(r);return i.forEach(function(e){e.increaseIndex(r.length),e.increasePosition(o)}),a._insertPanelElements(r,null!==(i=i[0])&&void 0!==i?i:null),p(p([],g(e)),g(r))},[]);return i.length<=0?[]:(this._updateCameraAndControl(),this.render(),0<i.length&&!t.animating&&t.moveToPanel(t.activePanel||i[0],{duration:0}).catch(function(){}),l.camera.updateOffset(),l.trigger(new c.ComponentEvent(M.PANEL_CHANGE,{added:i,removed:[]})),i)},n.batchRemove=function(){for(var a=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var s=this._panels,t=_(this._flicking,"Renderer"),i=t.camera,l=t.control,u=l.activePanel,r=l.activeIndex,o=e.reduce(function(e,n){var t=n.index,i=n.deleteCount,n=m(t,s.length),t=s.slice(n+i),r=s.splice(n,i);if(r.length<=0)return[];var o=a._getPanelSizeSum(r);return t.forEach(function(e){e.decreaseIndex(r.length),e.decreasePosition(o)}),a._removePanelElements(r),r.forEach(function(e){return e.destroy()}),a._updateCameraAndControl(),b(r,u)&&l.resetActive(),p(p([],g(e)),g(r))},[]);return this.render(),0<o.length&&!l.animating&&((r=b(o,u)?s[r]||s[s.length-1]:u)?l.moveToPanel(r,{duration:0}).catch(function(){}):i.lookAt(0)),t.camera.updateOffset(),t.trigger(new c.ComponentEvent(M.PANEL_CHANGE,{added:[],removed:o})),o},n._getPanelAlign=function(){var e=this._align;return"object"==typeof e?e.panel:e},n._getPanelSizeSum=function(e){var n=e[0],t=e[e.length-1],e=t.margin.next-n.margin.prev;return t.range.max-n.range.min+e},n._updateCameraAndControl=function(){var e=_(this._flicking,"Renderer"),n=e.camera,e=e.control;n.updateRange(),n.updateAnchors(),n.resetNeedPanelHistory(),e.updateInput()},e}(),Y=function(){function e(e){var n=e.index,t=e.align,e=e.flicking;this._index=n,this._flicking=e,this._align=t,this._removed=!1,this._resetInternalStates()}var n=e.prototype;return Object.defineProperty(n,"index",{get:function(){return this._index},enumerable:!1,configurable:!0}),Object.defineProperty(n,"position",{get:function(){return this._pos+this._alignPos},enumerable:!1,configurable:!0}),Object.defineProperty(n,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),Object.defineProperty(n,"sizeIncludingMargin",{get:function(){return this._size+this._margin.prev+this._margin.next},enumerable:!1,configurable:!0}),Object.defineProperty(n,"height",{get:function(){return this._height},enumerable:!1,configurable:!0}),Object.defineProperty(n,"margin",{get:function(){return this._margin},enumerable:!1,configurable:!0}),Object.defineProperty(n,"alignPosition",{get:function(){return this._alignPos},enumerable:!1,configurable:!0}),Object.defineProperty(n,"removed",{get:function(){return this._removed},enumerable:!1,configurable:!0}),Object.defineProperty(n,"range",{get:function(){return{min:this._pos,max:this._pos+this._size}},enumerable:!1,configurable:!0}),Object.defineProperty(n,"toggled",{get:function(){return this._toggled},enumerable:!1,configurable:!0}),Object.defineProperty(n,"toggleDirection",{get:function(){return this._toggleDirection},enumerable:!1,configurable:!0}),Object.defineProperty(n,"offset",{get:function(){var e=this._toggleDirection,n=this._flicking.camera.rangeDiff;return e!==F.NONE&&this._toggled?e===F.PREV?-n:n:0},enumerable:!1,configurable:!0}),Object.defineProperty(n,"progress",{get:function(){var e=this._flicking;return this.index-e.camera.progress},enumerable:!1,configurable:!0}),Object.defineProperty(n,"outsetProgress",{get:function(){var e=this.position+this.offset,n=this._alignPos,t=this._flicking.camera,i=t.position;if(i===e)return 0;if(i<e){var r=e+(t.size-t.alignPosition)+n;return-E(i,e,r)}n=e-(t.alignPosition+this._size-n);return 1-E(i,n,e)},enumerable:!1,configurable:!0}),Object.defineProperty(n,"visibleRatio",{get:function(){var e=this.range,n=this._size,t=this.offset,i=this._flicking.camera.visibleRange,r=e.min+t,e=e.max+t;if(e<=i.min||r>=i.max)return 0;t=n;return i.min>r&&(t-=i.min-r),i.max<e&&(t-=e-i.max),t/n},enumerable:!1,configurable:!0}),Object.defineProperty(n,"align",{get:function(){return this._align},set:function(e){this._align=e},enumerable:!1,configurable:!0}),n.resize=function(){var e=this.element,n=P(e),t=this._flicking,i=t.horizontal,t=t.renderer.panels[this._index-1];return this._size=i?e.offsetWidth:e.offsetHeight,this._margin=i?{prev:parseFloat(n.marginLeft||"0"),next:parseFloat(n.marginRight||"0")}:{prev:parseFloat(n.marginTop||"0"),next:parseFloat(n.marginBottom||"0")},this._pos=t?t.range.max+t.margin.next+this._margin.prev:this._margin.prev,this._height=i?e.offsetHeight:this._size,this._updateAlignPos(),this},n.contains=function(e){return this.element.contains(e)},n.destroy=function(){this._resetInternalStates(),this._removed=!0},n.includePosition=function(e,n){return this.includeRange(e,e,n=void 0===n?!1:n)},n.includeRange=function(e,n,t){var i=this._margin,r=this.range;return(t=void 0===t?!1:t)&&(r.min-=i.prev,r.max+=i.next),n>=r.min&&e<=r.max},n.focus=function(e){return this._flicking.moveTo(this._index,e)},n.prev=function(){var e=this._index,n=this._flicking,t=n.renderer,i=t.panelCount;return 1===i?null:n.circularEnabled?t.getPanel(0===e?i-1:e-1):t.getPanel(e-1)},n.next=function(){var e=this._index,n=this._flicking,t=n.renderer,i=t.panelCount;return 1===i?null:n.circularEnabled?t.getPanel(e===i-1?0:e+1):t.getPanel(e+1)},n.increaseIndex=function(e){return this._index+=Math.max(e,0),this},n.decreaseIndex=function(e){return this._index-=Math.max(e,0),this},n.increasePosition=function(e){return this._moveBy(Math.max(e,0)),this},n.decreasePosition=function(e){return this._moveBy(-Math.max(e,0)),this},n.toggle=function(e,n){var t=this._toggleDirection,i=this._togglePosition;if(t===F.NONE||n===e)return!1;var r=this._toggled;return e<n?e<=i&&i<=n&&(this._toggled=t===F.NEXT):i<=e&&n<=i&&(this._toggled=t!==F.NEXT),r!==this._toggled},n.updateCircularToggleDirection=function(){var e=this._flicking;if(!e.circularEnabled)return this._toggleDirection=F.NONE,this._toggled=!1,this;var n=e.camera,t=n.range,i=n.alignPosition,r=n.visibleRange,o=r.max-r.min,e=t.min-i,r=t.max-i+o,r=this.includeRange(r-o,r,!1),e=this.includeRange(e,e+o,!1);return this._toggled=!1,r?(this._toggleDirection=F.PREV,this._togglePosition=this.range.max+t.min-t.max+i,this.toggle(1/0,n.position)):e?(this._toggleDirection=F.NEXT,this._togglePosition=this.range.min+t.max-o+i,this.toggle(-1/0,n.position)):(this._toggleDirection=F.NONE,this._togglePosition=0),this},n._moveBy=function(e){return this._pos+=e,this},n._updateAlignPos=function(){this._alignPos=l(this._align,this._size)},n._resetInternalStates=function(){this._size=0,this._pos=0,this._margin={prev:0,next:0},this._height=0,this._alignPos=0,this._toggled=!1,this._togglePosition=0,this._toggleDirection=F.NONE},e}(),fe=function(t){function e(e){var n=t.call(this,e)||this;return n._el=e.el,n._rendered=!0,n}a(e,t);var n=e.prototype;return Object.defineProperty(n,"element",{get:function(){return this._el},enumerable:!1,configurable:!0}),Object.defineProperty(n,"rendered",{get:function(){return this._rendered},enumerable:!1,configurable:!0}),n.markForShow=function(){this._rendered=!0},n.markForHide=function(){this._rendered=!1},e}(Y),de=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}a(n,e);var t=n.prototype;return t.render=function(){return h(this,void 0,void 0,function(){var n,t,i,r;return f(this,function(e){return n=this._renderingStrategy,r=_(this._flicking,"Renderer"),t=r.camera.element,i=this._panels.filter(function(e){return e.element.parentElement===t}),n.updateRenderingPanels(r),r=this._getRenderingPanelsByOrder(),this._removePanelElements(i.filter(function(e){return!e.rendered})),this._insertPanelElements(r.filter(function(e){return e.element.parentElement!==t}),null),this._resetPanelElementOrder(r),[2]})})},t.forceRenderAllPanels=function(){return h(this,void 0,void 0,function(){var n,t;return f(this,function(e){return n=_(this._flicking,"Renderer"),n=n.camera,n=n.element,t=document.createDocumentFragment(),this._panels.forEach(function(e){return t.appendChild(e.element)}),this._removeAllChildsFromCamera(),n.appendChild(t),[2]})})},t._collectPanels=function(){var t=_(this._flicking,"Renderer"),n=t.camera.element;s(n.childNodes).forEach(function(e){e.nodeType===Node.TEXT_NODE&&n.removeChild(e)});var i=this._getPanelAlign(),e=s(n.children);this._panels=e.map(function(e,n){return new fe({flicking:t,el:e,index:n,align:i})})},t._createPanel=function(e,n){return new fe(r({el:e},n))},t._insertPanelElements=function(e,n){var t=_(this._flicking,"Renderer").camera.element,n=(null==n?void 0:n.element)||null,i=document.createDocumentFragment();return e.forEach(function(e){return i.appendChild(e.element)}),t.insertBefore(i,n),this},t._removePanelElements=function(e){var n=_(this._flicking,"Renderer").camera.element;return e.forEach(function(e){n.removeChild(e.element)}),this},t._resetPanelElementOrder=function(e){var t=_(this._flicking,"Renderer").camera.element,i=p([],g(e)).reverse();i.forEach(function(e,n){n=i[n-1],n=n?n.element:null;e.element.nextElementSibling!==n&&t.insertBefore(e.element,n)})},t._removeAllChildsFromCamera=function(){for(var e=_(this._flicking,"Renderer").camera.element;e.firstChild;)e.removeChild(e.firstChild)},t._getRenderingPanelsByOrder=function(){return _(this._flicking,"Renderer").renderer.panels.filter(function(e){return e.rendered}).sort(function(e,n){return e.position+e.offset-(n.position+n.offset)})},n}(ne),ae=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}a(n,e);var t=n.prototype;return t._insertPanelElements=function(e,n){},t._removePanelElements=function(e){},n}(ne),ge=function(){function e(){}return e.prototype.updateRenderingPanels=function(n){var e=n.renderer.panels,t=n.camera,i=t.visiblePanels.reduce(function(e,n){return e[n.index]=!0,e},{});e.forEach(function(e){e.index in i?e.markForShow():n.holding||e.markForHide()}),t.updateOffset()},e}(),ne={__proto__:null,Renderer:ne,VanillaRenderer:de,ExternalRenderer:ae,RawRenderingStrategy:he,VisibleRenderingStrategy:ge},ae=function(x){function e(e,n){var t=void 0===n?{}:n,i=t.align,r=void 0===i?H.CENTER:i,o=t.defaultIndex,a=void 0===o?0:o,s=t.horizontal,l=void 0===s||s,u=t.circular,c=void 0!==u&&u,h=t.bound,f=void 0!==h&&h,d=t.adaptive,g=void 0!==d&&d,p=t.needPanelThreshold,_=void 0===p?0:p,v=t.deceleration,m=void 0===v?.0075:v,b=t.duration,E=void 0===b?500:b,P=t.easing,y=void 0===P?function(e){return 1-Math.pow(1-e,3)}:P,n=t.inputType,i=void 0===n?["mouse","touch"]:n,o=t.moveType,s=void 0===o?"snap":o,u=t.threshold,h=void 0===u?40:u,d=t.interruptable,p=void 0===d||d,v=t.bounce,b=void 0===v?"20%":v,P=t.iOSEdgeSwipeThreshold,n=void 0===P?30:P,o=t.preventClickOnDrag,u=void 0===o||o,d=t.disableOnInit,v=void 0!==d&&d,P=t.renderOnlyVisible,o=void 0!==P&&P,d=t.autoInit,P=void 0===d||d,d=t.autoResize,d=void 0===d||d,t=t.renderExternal,t=void 0===t?null:t,O=x.call(this)||this;return O._preventClickWhenDragged=function(e){O._control.animating&&e.preventDefault()},O._initialized=!1,O._plugins=[],O._align=r,O._defaultIndex=a,O._horizontal=l,O._circular=c,O._bound=f,O._adaptive=g,O._needPanelThreshold=_,O._deceleration=m,O._duration=E,O._easing=y,O._inputType=i,O._moveType=s,O._threshold=h,O._interruptable=p,O._bounce=b,O._iOSEdgeSwipeThreshold=n,O._preventClickOnDrag=u,O._disableOnInit=v,O._renderOnlyVisible=o,O._autoResize=d,O._autoInit=P,O._renderExternal=t,O._viewport=new W(function(e,n){var t=null;if(B(e)){n=(n||document).querySelector(e);if(!n)throw new T(I(e),N.ELEMENT_NOT_FOUND);t=n}else e&&e.nodeType===Node.ELEMENT_NODE&&(t=e);if(!t)throw new T(A(e,["HTMLElement","string"]),N.WRONG_TYPE);return t}(e)),O._renderer=O._createRenderer(),O._camera=O._createCamera(),O._control=O._createControl(),O.resize=O.resize.bind(O),O._autoInit&&O.init(),O}a(e,x);var n=e.prototype;return Object.defineProperty(n,"control",{get:function(){return this._control},enumerable:!1,configurable:!0}),Object.defineProperty(n,"camera",{get:function(){return this._camera},enumerable:!1,configurable:!0}),Object.defineProperty(n,"renderer",{get:function(){return this._renderer},enumerable:!1,configurable:!0}),Object.defineProperty(n,"viewport",{get:function(){return this._viewport},enumerable:!1,configurable:!0}),Object.defineProperty(n,"initialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),Object.defineProperty(n,"circularEnabled",{get:function(){return this._camera.controlParams.circular},enumerable:!1,configurable:!0}),Object.defineProperty(n,"index",{get:function(){return this._control.activeIndex},enumerable:!1,configurable:!0}),Object.defineProperty(n,"element",{get:function(){return this._viewport.element},enumerable:!1,configurable:!0}),Object.defineProperty(n,"currentPanel",{get:function(){return this._control.activePanel},enumerable:!1,configurable:!0}),Object.defineProperty(n,"panels",{get:function(){return this._renderer.panels},enumerable:!1,configurable:!0}),Object.defineProperty(n,"panelCount",{get:function(){return this._renderer.panelCount},enumerable:!1,configurable:!0}),Object.defineProperty(n,"visiblePanels",{get:function(){return this._camera.visiblePanels},enumerable:!1,configurable:!0}),Object.defineProperty(n,"animating",{get:function(){return this._control.animating},enumerable:!1,configurable:!0}),Object.defineProperty(n,"holding",{get:function(){return this._control.holding},enumerable:!1,configurable:!0}),Object.defineProperty(n,"activePlugins",{get:function(){return this._plugins},enumerable:!1,configurable:!0}),Object.defineProperty(n,"align",{get:function(){return this._align},set:function(e){this._align=e,this._renderer.align=e,this._camera.align=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"defaultIndex",{get:function(){return this._defaultIndex},set:function(e){this._defaultIndex=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"horizontal",{get:function(){return this._horizontal},set:function(e){this._horizontal=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"circular",{get:function(){return this._circular},set:function(e){this._circular=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"bound",{get:function(){return this._bound},set:function(e){this._bound=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"adaptive",{get:function(){return this._adaptive},set:function(e){this._adaptive=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"needPanelThreshold",{get:function(){return this._needPanelThreshold},enumerable:!1,configurable:!0}),Object.defineProperty(n,"deceleration",{get:function(){return this._deceleration},set:function(e){this._deceleration=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"easing",{get:function(){return this._easing},set:function(e){this._easing=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"duration",{get:function(){return this._duration},set:function(e){this._duration=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"inputType",{get:function(){return this._inputType},set:function(e){this._inputType=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"moveType",{get:function(){return this._moveType},set:function(e){this._moveType=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"threshold",{get:function(){return this._threshold},set:function(e){this._threshold=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"interruptable",{get:function(){return this._interruptable},set:function(e){this._interruptable=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"bounce",{get:function(){return this._bounce},set:function(e){this._bounce=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"iOSEdgeSwipeThreshold",{get:function(){return this._iOSEdgeSwipeThreshold},set:function(e){this._iOSEdgeSwipeThreshold=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"preventClickOnDrag",{get:function(){return this._preventClickOnDrag},set:function(e){this._preventClickOnDrag=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"disableOnInit",{get:function(){return this._disableOnInit},set:function(e){this._disableOnInit=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"renderOnlyVisible",{get:function(){return this._renderOnlyVisible},set:function(e){this._renderOnlyVisible=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"autoInit",{get:function(){return this._autoInit},enumerable:!1,configurable:!0}),Object.defineProperty(n,"autoResize",{get:function(){return this._autoResize},set:function(e){this._autoResize=e},enumerable:!1,configurable:!0}),Object.defineProperty(n,"renderExternal",{get:function(){return this._renderExternal},enumerable:!1,configurable:!0}),n.init=function(){return h(this,void 0,void 0,function(){var n,t,i,r,o=this;return f(this,function(e){switch(e.label){case 0:return this._initialized?[2]:(n=this._camera,t=this._renderer,i=this._control,r=this._viewport,n.init(this),t.init(this),i.init(this),[4,this.resize()]);case 1:return e.sent(),this._moveToInitialPanel(),this._autoResize&&window.addEventListener("resize",this.resize),this._preventClickOnDrag&&r.element.addEventListener("click",this._preventClickWhenDragged),this._disableOnInit&&this.disableInput(),this._plugins.forEach(function(e){return e.init(o)}),this._initialized=!0,this.trigger(new c.ComponentEvent(M.READY)),[2]}})})},n.destroy=function(){this._initialized&&(this.off(),window.removeEventListener("resize",this.resize),this._viewport.element.removeEventListener("click",this._preventClickWhenDragged),this._control.destroy(),this._camera.destroy(),this._renderer.destroy(),this._plugins.forEach(function(e){return e.destroy()}),this._initialized=!1)},n.prev=function(e){var n;return void 0===e&&(e=this._duration),this.moveTo(null!==(n=null===(n=null===(n=this._control.activePanel)||void 0===n?void 0:n.prev())||void 0===n?void 0:n.index)&&void 0!==n?n:-1,e,F.PREV)},n.next=function(e){var n;return void 0===e&&(e=this._duration),this.moveTo(null!==(n=null===(n=null===(n=this._control.activePanel)||void 0===n?void 0:n.next())||void 0===n?void 0:n.index)&&void 0!==n?n:this._renderer.panelCount,e,F.NEXT)},n.moveTo=function(e,n,t){void 0===n&&(n=this._duration),void 0===t&&(t=F.NONE);var i=this._renderer,r=i.panelCount,i=i.getPanel(e);return i?this._control.animating?Promise.reject(new T(j,N.ANIMATION_ALREADY_PLAYING)):this._control.moveToPanel(i,{duration:n,direction:t}):Promise.reject(new T(w(e,0,r-1),N.INDEX_OUT_OF_RANGE))},n.getPanel=function(e){return this._renderer.getPanel(e)},n.enableInput=function(){return this._control.enable(),this},n.disableInput=function(){return this._control.disable(),this},n.getStatus=function(e){var n=void 0===e?{}:e,t=n.index,i=void 0===t||t,r=n.position,e=void 0===r||r,t=n.includePanelHTML,o=void 0!==t&&t,r=n.visiblePanelsOnly,t=void 0!==r&&r,n=this._camera,r={panels:(t?this.visiblePanels:this.panels).map(function(e){var n={index:e.index};return o&&(n.html=e.element.outerHTML),n})};return i&&(r.index=this.index),!e||(e=n.findNearestAnchor(n.position))&&(r.position={panel:e.panel.index,progressInPanel:n.getProgressInPanel(e.panel)}),t&&(t=this.visiblePanels,r.visibleOffset=null!==(t=null===(t=t[0])||void 0===t?void 0:t.index)&&void 0!==t?t:0),r},n.setStatus=function(e){if(!this._initialized)throw new T(z,N.NOT_INITIALIZED);var n=e.index,t=e.position,i=e.visibleOffset,r=e.panels,o=this._renderer,a=this._control;null!==(e=r[0])&&void 0!==e&&e.html&&!this._renderExternal&&(o.batchRemove({index:0,deleteCount:this.panels.length}),o.batchInsert({index:0,elements:u(r.map(function(e){return e.html}))})),n&&this.moveTo(i?n-i:n,0).catch(function(){}),t&&this._moveType===G.FREE_SCROLL&&(n=t.panel,t=t.progressInPanel,t=(n=o.panels[i?n-i:n].range).min+(n.max-n.min)*t,a.moveToPosition(t,0).catch(function(){}))},n.addPlugins=function(){for(var e,n=this,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return this._initialized&&t.forEach(function(e){return e.init(n)}),(e=this._plugins).push.apply(e,p([],g(t))),this},n.removePlugins=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return e.forEach(function(n){var e=function(e,n){for(var t=0;t<e.length;t++)if(n(e[t]))return t;return-1}(t._plugins,function(e){return e===n});0<=e&&(n.destroy(),t._plugins.splice(e,1))}),this},n.resize=function(){return h(this,void 0,void 0,function(){var n,t,i,r,o,a,s;return f(this,function(e){switch(e.label){case 0:return n=this._viewport,t=this._renderer,i=this._camera,s=this._control,a=s.activePanel,r=n.width,o=n.height,a=a?i.getProgressInPanel(a):0,this.trigger(new c.ComponentEvent(M.BEFORE_RESIZE,{width:r,height:o,element:n.element})),n.resize(),[4,t.forceRenderAllPanels()];case 1:return e.sent(),t.updatePanelSize(),[4,t.render()];case 2:return e.sent(),i.updateAlignPos(),i.updateRange(),i.updateAnchors(),s.animating?[3,5]:[3,3];case 3:return[4,s.updatePosition(a)];case 4:e.sent(),s.updateInput(),e.label=5;case 5:return a=n.width,s=n.height,s=a!==r||s!==o,this.trigger(new c.ComponentEvent(M.AFTER_RESIZE,{width:n.width,height:n.height,prev:{width:r,height:o},sizeChanged:s,element:n.element})),[2]}})})},n.append=function(e){return this.insert(this._renderer.panelCount,e)},n.prepend=function(e){return this.insert(0,e)},n.insert=function(e,n){if(this._renderExternal)throw new T(L,N.NOT_ALLOWED_IN_FRAMEWORK);return this._renderer.batchInsert({index:e,elements:u(n)})},n.remove=function(e,n){if(void 0===n&&(n=1),this._renderExternal)throw new T(L,N.NOT_ALLOWED_IN_FRAMEWORK);return this._renderer.batchRemove({index:e,deleteCount:n})},n._createControl=function(){var e,n=this._moveType,t=Object.keys(G).map(function(e){return G[e]}),i=Array.isArray(n)?n[0]:n,r=Array.isArray(n)&&null!==(e=n[1])&&void 0!==e?e:{};if(!b(t,i))throw new T(C("moveType",JSON.stringify(n)),N.WRONG_OPTION);switch(i){case G.SNAP:return new te;case G.FREE_SCROLL:return new ie(r)}},n._createCamera=function(){var e={align:this._align};return this._circular?(this._bound&&console.warn('"circular" and "bound" option cannot be used together, ignoring bound.'),new le(e)):new(this._bound?ue:se)(e)},n._createRenderer=function(){var e=new(this._renderOnlyVisible?ge:he),n={align:this._align,strategy:e},e=this._renderExternal;return e?new e.renderer(r(r({},n),e.rendererOptions)):new de(n)},n._moveToInitialPanel=function(){var e=this._renderer,n=this._control,e=e.getPanel(this._defaultIndex)||e.getPanel(0);e&&n.moveToPanel(e,{duration:0})},e.VERSION="4.1.0",e}(c);return e(ae,{__proto__:null,Viewport:W,FlickingError:T,AnchorPoint:oe,Panel:Y,ElementPanel:fe,ExternalPanel:function(t){function e(e){var n=t.call(this,e)||this;return n._externalComponent=e.externalComponent,n}return a(e,t),e}(Y)}),e(ae,ce),e(ae,re),e(ae,ne),e(ae,n),ae});
//# sourceMappingURL=flicking.min.js.map
{
"name": "@egjs/flicking",
"version": "4.0.0",
"version": "4.1.0",
"description": "Everyday 30 million people experience. It's reliable, flexible and extendable carousel.",

@@ -11,5 +11,5 @@ "main": "dist/flicking.js",

"scripts": {
"dev": "rollup -w --config ./rollup.config.dev.js",
"start": "concurrently \"rollup -w --config ./rollup.config.dev.js\" \"http-serve\"",
"build": "rm -rf ./dist ./declaration && rollup -c && npm run declaration && npm run css && npm run printsizes",
"declaration": "rm -rf declaration && ttsc -p tsconfig.declaration.json",
"declaration": "rm -rf declaration && tsc -p tsconfig.declaration.json",
"css": "postcss css/*.css --use autoprefixer postcss-clean -d dist/ -m",

@@ -16,0 +16,0 @@ "printsizes": "print-sizes ./dist --exclude=\\.map",

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

|[**@egjs/react-flicking**](https://github.com/naver/egjs-flicking/blob/master/packages/react-flicking/README.md)|<a href="https://www.npmjs.com/package/@egjs/react-flicking" target="_blank"><img src="https://img.shields.io/npm/v/@egjs/react-flicking.svg?style=flat-square&color=00d8ff&label=%F0%9F%94%96" alt="version" /></a>|<img width="15" src="https://naver.github.io/egjs-flicking/images/react.svg" valign="middle" alt="React" /> [React](https://reactjs.org/) port of @egjs/flicking|
|[**@egjs/vue-flicking**](https://github.com/naver/egjs-flicking/blob/master/packages/vue-flicking/README.md)|<a href="https://www.npmjs.com/package/@egjs/vue-flicking" target="_blank"><img src="https://img.shields.io/npm/v/@egjs/vue-flicking.svg?style=flat-square&color=42b883&label=%F0%9F%94%96" alt="version" /></a>|<img width="15" src="https://naver.github.io/egjs-flicking/images/vue.svg" valign="middle" alt="Vue.js" /> [Vue.js](https://vuejs.org/v2/guide/index.html) port of @egjs/flicking|
|[**@egjs/vue-flicking**](https://github.com/naver/egjs-flicking/blob/master/packages/vue-flicking/README.md)|<a href="https://www.npmjs.com/package/@egjs/vue-flicking" target="_blank"><img src="https://img.shields.io/npm/v/@egjs/vue-flicking.svg?style=flat-square&color=42b883&label=%F0%9F%94%96" alt="version" /></a>|<img width="15" src="https://naver.github.io/egjs-flicking/images/vue.svg" valign="middle" alt="Vue.js" /> [Vue.js@2](https://vuejs.org/v2/guide/index.html) port of @egjs/flicking|
|[**@egjs/vue3-flicking**](https://github.com/naver/egjs-flicking/blob/master/packages/vue3-flicking/README.md)|<a href="https://www.npmjs.com/package/@egjs/vue3-flicking" target="_blank"><img src="https://img.shields.io/npm/v/@egjs/vue3-flicking.svg?style=flat-square&color=42b883&label=%F0%9F%94%96" alt="version" /></a>|<img width="15" src="https://naver.github.io/egjs-flicking/images/vue.svg" valign="middle" alt="Vue.js" /> [Vue.js@3](https://v3.vuejs.org/) port of @egjs/flicking|
|[**@egjs/preact-flicking**](https://github.com/naver/egjs-flicking/blob/master/packages/preact-flicking/README.md)|<a href="https://www.npmjs.com/package/@egjs/preact-flicking" target="_blank"><img src="https://img.shields.io/npm/v/@egjs/preact-flicking.svg?style=flat-square&color=673ab8&label=%F0%9F%94%96" alt="version" /></a>|<img width="15" src="https://naver.github.io/egjs-flicking/images/preact.svg" valign="middle" alt="Preact" /> [Preact](https://preactjs.com/guide/v10/getting-started) port of @egjs/flicking|

@@ -136,3 +137,3 @@

|:---:|:---:|:---:|:---:|:---:|:---:|
|9+(With polyfill)|Latest|Latest|Latest|7+|4+|
|9+(With polyfill), 11+ for Angular|Latest|Latest|Latest|7+|4+|

@@ -139,0 +140,0 @@ ## 📼 Demos

@@ -1,8 +0,1 @@

/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-disable @typescript-eslint/no-unsafe-call */
import postcss from "rollup-plugin-postcss";
import serve from "rollup-plugin-serve";
import livereload from "rollup-plugin-livereload";
import autoprefixer from "autoprefixer";
const buildHelper = require("./config/build-helper");

@@ -13,21 +6,8 @@

name: "Flicking",
input: "./test/manual/src/App.ts",
output: "./test/manual/dist/app.js",
input: "./src/index.umd.ts",
output: "./dist/flicking.pkgd.js",
format: "umd",
tsconfig: "./test/manual/tsconfig.json",
resolve: true,
plugins: [
postcss({
extract: true,
plugins: [autoprefixer]
}),
serve({
open: true,
port: 3000,
contentBase: "test/manual"
}),
livereload(".")
]
resolve: true
}
]);

@@ -0,1 +1,3 @@

import Component from "@egjs/component";
import Flicking from "../Flicking";

@@ -19,34 +21,33 @@

const withFlickingMethods = (prototype: any, flickingName: string) => {
Object.getOwnPropertyNames(Flicking.prototype)
.filter(name => !prototype[name] && !name.startsWith("_") && name !== "constructor")
.forEach((name: keyof Flicking) => {
const descriptor = Object.getOwnPropertyDescriptor(Flicking.prototype, name)!;
[Component.prototype, Flicking.prototype].forEach(proto => {
Object.getOwnPropertyNames(proto).filter(name => !prototype[name] && !name.startsWith("_") && name !== "constructor")
.forEach((name: string) => {
const descriptor = Object.getOwnPropertyDescriptor(proto, name)!;
if (descriptor.value) {
// Public Function
Object.defineProperty(prototype, name, {
value: function(...args) {
return descriptor.value.call(this[flickingName], ...args);
if (descriptor.value) {
// Public Function
Object.defineProperty(prototype, name, {
value: function(...args) {
return descriptor.value.call(this[flickingName], ...args);
}
});
} else {
const getterDescriptor: { get?: () => any; set?: (val: any) => void } = {};
if (descriptor.get) {
getterDescriptor.get = function() {
return descriptor.get?.call(this[flickingName]);
};
}
});
} else {
const getterDescriptor: { get?: () => any; set?: (val: any) => void } = {};
if (descriptor.get) {
getterDescriptor.get = function() {
return descriptor.get?.call(this[flickingName]);
};
if (descriptor.set) {
getterDescriptor.set = function(...args) {
return descriptor.set?.call(this[flickingName], ...args);
};
}
Object.defineProperty(prototype, name, getterDescriptor);
}
if (descriptor.set) {
getterDescriptor.set = function(...args) {
return descriptor.set?.call(this[flickingName], ...args);
};
}
Object.defineProperty(prototype, name, getterDescriptor);
}
});
});
});
};
export default withFlickingMethods;
/* eslint-enable @typescript-eslint/no-unsafe-member-access */
/* eslint-enable @typescript-eslint/no-unsafe-assignment */

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

* @property {"needPanel"} NEED_PANEL needPanel event<ko>needPanel 이벤트</ko>
* @property {"panelChange"} PANEL_CHANGE panelChange event<ko>panelChange 이벤트</ko>
* @example

@@ -45,3 +46,4 @@ * ```ts

VISIBLE_CHANGE: "visibleChange",
REACH_EDGE: "reachEdge"
REACH_EDGE: "reachEdge",
PANEL_CHANGE: "panelChange"
} as const;

@@ -48,0 +50,0 @@

@@ -260,7 +260,4 @@ /*

axes.once(AXES.EVENT.FINISH, animationFinishHandler);
axes.once(AXES.EVENT.HOLD, interruptionHandler);
if (!axesEvent) {
axes.once(AXES.EVENT.HOLD, interruptionHandler);
}
animate();

@@ -267,0 +264,0 @@ });

@@ -338,2 +338,5 @@ /*

await flicking.renderer.render();
}).catch(err => {
if (axesEvent && err instanceof FlickingError && err.code === ERROR.CODE.ANIMATION_INTERRUPTED) return;
throw err;
});

@@ -340,0 +343,0 @@ }

@@ -16,3 +16,3 @@ /*

import { findIndex, getElement, includes, parseElement } from "./utils";
import { HoldStartEvent, HoldEndEvent, MoveStartEvent, SelectEvent, MoveEvent, MoveEndEvent, WillChangeEvent, WillRestoreEvent, NeedPanelEvent, VisibleChangeEvent, ReachEdgeEvent, ReadyEvent, AfterResizeEvent, BeforeResizeEvent, ChangedEvent, RestoredEvent } from "./type/event";
import { HoldStartEvent, HoldEndEvent, MoveStartEvent, SelectEvent, MoveEvent, MoveEndEvent, WillChangeEvent, WillRestoreEvent, NeedPanelEvent, VisibleChangeEvent, ReachEdgeEvent, ReadyEvent, AfterResizeEvent, BeforeResizeEvent, ChangedEvent, RestoredEvent, PanelChangeEvent } from "./type/event";
import { LiteralUnion, ValueOf } from "./type/internal";

@@ -41,2 +41,3 @@ import { ElementLike, Plugin, Status, MoveTypeOptions } from "./type/external";

[EVENTS.REACH_EDGE]: ReachEdgeEvent;
[EVENTS.PANEL_CHANGE]: PanelChangeEvent;
}

@@ -627,2 +628,4 @@

this.resize = this.resize.bind(this);
if (this._autoInit) {

@@ -1018,3 +1021,3 @@ void this.init();

*/
public resize = async (): Promise<void> => {
public async resize(): Promise<void> {
const viewport = this._viewport;

@@ -1067,3 +1070,3 @@ const renderer = this._renderer;

}));
};
}

@@ -1070,0 +1073,0 @@ /**

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

*/
import { ComponentEvent } from "@egjs/component";
import Flicking, { FlickingOptions } from "../Flicking";
import Panel, { PanelOptions } from "../core/panel/Panel";
import { ALIGN } from "../const/external";
import { ALIGN, EVENTS } from "../const/external";
import { getFlickingAttached, getMinusCompensatedIndex, includes } from "../utils";

@@ -203,2 +205,7 @@

flicking.trigger(new ComponentEvent(EVENTS.PANEL_CHANGE, {
added: allPanelsInserted,
removed: []
}));
return allPanelsInserted;

@@ -275,2 +282,7 @@ }

flicking.trigger(new ComponentEvent(EVENTS.PANEL_CHANGE, {
added: [],
removed: allPanelsRemoved
}));
return allPanelsRemoved;

@@ -277,0 +289,0 @@ }

@@ -264,6 +264,4 @@ /* eslint-disable @typescript-eslint/ban-types */

* @property {string} eventType Name of the event<ko>이벤트명</ko>
* @property {DIRECTION} direction Direction where new panel is needed.
* `DIRECTION.PREV` means panels should be {@link Flicking#prepend prepend}ed and `DIRECTION.NEXT` means panels should be {@link Flicking#append append}ed
* <ko>패널이 필요한 방향.
* `DIRECTION.PREV`의 경우 패널이 {@link Flicking#prepend prepend}되어야 함을 의미하고, `DIRECTION.NEXT`는 패널이 {@link Flicking#append append}되어야 함을 의미한다</ko>
* @property {DIRECTION} direction Direction where new panel is needed. `DIRECTION.PREV` means panels should be {@link Flicking#prepend prepend}ed and `DIRECTION.NEXT` means panels should be {@link Flicking#append append}ed
* <ko>패널이 필요한 방향. `DIRECTION.PREV`의 경우 패널이 {@link Flicking#prepend prepend}되어야 함을 의미하고, `DIRECTION.NEXT`는 패널이 {@link Flicking#append append}되어야 함을 의미한다</ko>
*/

@@ -304,1 +302,16 @@ export interface NeedPanelEvent<T extends Flicking = Flicking> extends ComponentEvent<{}, typeof EVENTS["NEED_PANEL"], T> {

}
/**
* Event that fires when a panel is added or removed
* @ko 패널 추가/제거시에 발생하는 이벤트
* @event Flicking#panelChange
* @type {object}
* @property {Flicking} currentTarget An Flicking instance that triggered this event<ko>이 이벤트를 트리거한 Flicking의 인스턴스</ko>
* @property {string} eventType Name of the event<ko>이벤트명</ko>
* @property {Panel[]} added An array of new panels added<ko>새로 추가된 패널의 배열</ko>
* @property {Panel[]} removed An array of panels removed<ko>제거된 패널의 배열</ko>
*/
export interface PanelChangeEvent<T extends Flicking = Flicking> extends ComponentEvent<{}, typeof EVENTS["PANEL_CHANGE"], T> {
added: Panel[];
removed: Panel[];
}

@@ -9,7 +9,3 @@ {

"skipLibCheck": true,
"strictNullChecks": false,
"plugins": [
{ "transform": "typescript-transform-paths" },
{ "transform": "typescript-transform-paths", "afterDeclarations": true }
]
"strictNullChecks": false
},

@@ -16,0 +12,0 @@ "include": [

@@ -14,2 +14,3 @@ {

"esModuleInterop": false,
"skipLibCheck": true,
"baseUrl": "."

@@ -16,0 +17,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