UNPKG

193 kBSource Map (JSON)View Raw
1{"version":3,"file":"axes.pkgd.min.js","sources":["../src/browser.ts","../src/utils.ts","../src/const.ts","../src/Coordinate.ts","../src/eventInput/EventInput.ts","../src/inputType/InputType.ts","../src/EventManager.ts","../src/InterruptManager.ts","../src/AxisManager.ts","../src/eventInput/MouseEventInput.ts","../src/eventInput/TouchEventInput.ts","../src/eventInput/PointerEventInput.ts","../src/eventInput/TouchMouseEventInput.ts","../src/animation/AnimationManager.ts","../src/InputObserver.ts","../src/index.umd.ts","../src/animation/EasingManager.ts","../src/Axes.ts","../src/inputType/PanInput.ts","../src/inputType/RotatePanInput.ts","../src/inputType/PinchInput.ts","../src/inputType/WheelInput.ts","../src/inputType/MoveKeyInput.ts","../src/reactive.ts"],"sourcesContent":["/*\n * Copyright (c) 2015 NAVER Corp.\n * egjs projects are licensed under the MIT license\n */\n/* eslint-disable no-new-func, no-nested-ternary */\n\nlet win: any;\n\nif (typeof window === \"undefined\") {\n // window is undefined in node.js\n win = {\n navigator: {\n userAgent: \"\",\n },\n };\n} else {\n win = window;\n}\n/* eslint-enable no-new-func, no-nested-ternary */\n\nexport { win as window };\n","/*\n * Copyright (c) 2015 NAVER Corp.\n * egjs projects are licensed under the MIT license\n */\nimport { window } from \"./browser\";\nimport { PREVENT_DRAG_CSSPROPS } from \"./const\";\nimport { Axis, AxisOption } from \"./AxisManager\";\nimport { PanInputOption } from \"./inputType/PanInput\";\nimport { PinchInputOption } from \"./inputType/PinchInput\";\nimport { ObjectInterface } from \"./types\";\nimport {\n DIRECTION_NONE,\n DIRECTION_VERTICAL,\n DIRECTION_HORIZONTAL,\n DIRECTION_ALL,\n} from \"./const\";\n\ndeclare let jQuery: any;\n\nexport const toArray = (nodes: NodeList): HTMLElement[] => {\n // const el = Array.prototype.slice.call(nodes);\n // for IE8\n const el = [];\n for (let i = 0, len = nodes.length; i < len; i++) {\n el.push(nodes[i]);\n }\n return el;\n};\n\nexport const $ = (param, multi = false) => {\n let el;\n if (typeof param === \"string\") {\n // String (HTML, Selector)\n // check if string is HTML tag format\n const match = param.match(/^<([a-z]+)\\s*([^>]*)>/);\n\n // creating element\n if (match) {\n // HTML\n const dummy = document.createElement(\"div\");\n\n dummy.innerHTML = param;\n el = toArray(dummy.childNodes);\n } else {\n // Selector\n el = toArray(document.querySelectorAll(param));\n }\n if (!multi) {\n el = el.length >= 1 ? el[0] : undefined;\n }\n } else if (param === window) {\n // window\n el = param;\n } else if (\"value\" in param || \"current\" in param) {\n el = param.value! || param.current!;\n } else if (param.nodeName && (param.nodeType === 1 || param.nodeType === 9)) {\n // HTMLElement, Document\n el = param;\n } else if (\n (\"jQuery\" in window && param instanceof jQuery) ||\n param.constructor.prototype.jquery\n ) {\n // jQuery\n el = multi ? param.toArray() : param.get(0);\n } else if (Array.isArray(param)) {\n el = param.map((v) => $(v));\n if (!multi) {\n el = el.length >= 1 ? el[0] : undefined;\n }\n }\n return el;\n};\n\nlet raf = window.requestAnimationFrame || window.webkitRequestAnimationFrame;\nlet caf = window.cancelAnimationFrame || window.webkitCancelAnimationFrame;\nif (raf && !caf) {\n const keyInfo = {};\n const oldraf = raf;\n raf = (callback: FrameRequestCallback) => {\n const wrapCallback = (timestamp: number) => {\n if (keyInfo[key]) {\n callback(timestamp);\n }\n };\n const key = oldraf(wrapCallback);\n keyInfo[key] = true;\n return key;\n };\n caf = (key: number) => {\n delete keyInfo[key];\n };\n} else if (!(raf && caf)) {\n raf = (callback: FrameRequestCallback) => {\n return window.setTimeout(() => {\n callback(\n ((window.performance &&\n window.performance.now &&\n window.performance.now()) as number) || new Date().getTime()\n );\n }, 16);\n };\n caf = window.clearTimeout;\n}\n\n/**\n * A polyfill for the window.requestAnimationFrame() method.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame\n * @private\n */\nexport const requestAnimationFrame = (fp) => {\n return raf(fp);\n};\n/**\n * A polyfill for the window.cancelAnimationFrame() method. It cancels an animation executed through a call to the requestAnimationFrame() method.\n * @param {Number} key − The ID value returned through a call to the requestAnimationFrame() method. <ko>requestAnimationFrame() 메서드가 반환한 아이디 값</ko>\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Window/cancelAnimationFrame\n * @private\n */\nexport const cancelAnimationFrame = (key) => {\n caf(key);\n};\n\nexport const map = <T, U>(\n obj: ObjectInterface<T>,\n callback: (value: T, key: string) => U\n): ObjectInterface<U> => {\n const tranformed: ObjectInterface<U> = {};\n\n for (const k in obj) {\n if (k) {\n tranformed[k] = callback(obj[k], k);\n }\n }\n return tranformed;\n};\n\nexport const filter = <T>(\n obj: ObjectInterface<T>,\n callback: (value: T, key: string) => boolean\n): ObjectInterface<T> => {\n const filtered: ObjectInterface<T> = {};\n\n for (const k in obj) {\n if (k && callback(obj[k], k)) {\n filtered[k] = obj[k];\n }\n }\n return filtered;\n};\nexport const every = <T>(\n obj: ObjectInterface<T>,\n callback: (value: T, key: string) => boolean\n) => {\n for (const k in obj) {\n if (k && !callback(obj[k], k)) {\n return false;\n }\n }\n return true;\n};\nexport const equal = (\n target: ObjectInterface,\n base: ObjectInterface\n): boolean => {\n return every(target, (v, k) => v === base[k]);\n};\n\nconst roundNumFunc = {};\n\nexport const roundNumber = (num: number, roundUnit: number) => {\n // Cache for performance\n if (!roundNumFunc[roundUnit]) {\n roundNumFunc[roundUnit] = getRoundFunc(roundUnit);\n }\n\n return roundNumFunc[roundUnit](num);\n};\n\nexport const roundNumbers = (\n num: ObjectInterface<number>,\n roundUnit: ObjectInterface<number> | number\n): ObjectInterface<number> => {\n if (!num || !roundUnit) {\n return num;\n }\n return map(num, (value, key) =>\n roundNumber(\n value,\n typeof roundUnit === \"number\" ? roundUnit : roundUnit[key]\n )\n );\n};\n\nexport const getDecimalPlace = (val: number): number => {\n if (!isFinite(val)) {\n return 0;\n }\n\n const v = `${val}`;\n\n if (v.indexOf(\"e\") >= 0) {\n // Exponential Format\n // 1e-10, 1e-12\n let p = 0;\n let e = 1;\n\n while (Math.round(val * e) / e !== val) {\n e *= 10;\n p++;\n }\n\n return p;\n }\n\n // In general, following has performance benefit.\n // https://jsperf.com/precision-calculation\n return v.indexOf(\".\") >= 0 ? v.length - v.indexOf(\".\") - 1 : 0;\n};\n\nexport const inversePow = (n: number) => {\n // replace Math.pow(10, -n) to solve floating point issue.\n // eg. Math.pow(10, -4) => 0.00009999999999999999\n return 1 / Math.pow(10, n);\n};\n\nexport const getRoundFunc = (v: number) => {\n const p = v < 1 ? Math.pow(10, getDecimalPlace(v)) : 1;\n\n return (n: number) => {\n if (v === 0) {\n return 0;\n }\n\n return Math.round(Math.round(n / v) * v * p) / p;\n };\n};\n\nexport const getAngle = (posX: number, posY: number) => {\n return (Math.atan2(posY, posX) * 180) / Math.PI;\n};\n\nexport const isCssPropsFromAxes = (originalCssProps: {\n [key: string]: string;\n}) => {\n let same = true;\n Object.keys(PREVENT_DRAG_CSSPROPS).forEach((prop) => {\n if (\n !originalCssProps ||\n originalCssProps[prop] !== PREVENT_DRAG_CSSPROPS[prop]\n ) {\n same = false;\n }\n });\n return same;\n};\n\nexport const getDirection = (\n useHorizontal: boolean,\n useVertical: boolean\n): number => {\n if (useHorizontal && useVertical) {\n return DIRECTION_ALL;\n } else if (useHorizontal) {\n return DIRECTION_HORIZONTAL;\n } else if (useVertical) {\n return DIRECTION_VERTICAL;\n } else {\n return DIRECTION_NONE;\n }\n};\n\nexport const useDirection = (\n checkType: number,\n direction: number,\n userDirection?: number\n): boolean => {\n if (userDirection) {\n return !!(\n direction === DIRECTION_ALL ||\n (direction & checkType && userDirection & checkType)\n );\n } else {\n return !!(direction & checkType);\n }\n};\n\nexport const setCssProps = (\n element: HTMLElement,\n option: PanInputOption | PinchInputOption,\n direction: number\n): { [key: string]: string } => {\n const touchActionMap = {\n [DIRECTION_NONE]: \"auto\",\n [DIRECTION_ALL]: \"none\",\n [DIRECTION_VERTICAL]: \"pan-x\",\n [DIRECTION_HORIZONTAL]: \"pan-y\",\n };\n const oldCssProps = {};\n if (element && element.style) {\n const touchAction = option.touchAction\n ? option.touchAction\n : touchActionMap[direction];\n const newCssProps = {\n ...PREVENT_DRAG_CSSPROPS,\n \"touch-action\":\n element.style[\"touch-action\"] === \"none\" ? \"none\" : touchAction,\n };\n Object.keys(newCssProps).forEach((prop) => {\n oldCssProps[prop] = element.style[prop];\n element.style[prop] = newCssProps[prop];\n });\n }\n return oldCssProps;\n};\n\nexport const revertCssProps = (\n element: HTMLElement,\n originalCssProps: { [key: string]: string }\n): { [key: string]: string } => {\n if (element && element.style && originalCssProps) {\n Object.keys(originalCssProps).forEach((prop) => {\n element.style[prop] = originalCssProps[prop];\n });\n }\n return;\n};\n","/*\n * Copyright (c) 2015 NAVER Corp.\n * egjs projects are licensed under the MIT license\n */\nexport const DIRECTION_NONE = 1;\nexport const DIRECTION_LEFT = 2;\nexport const DIRECTION_RIGHT = 4;\nexport const DIRECTION_HORIZONTAL = 2 | 4;\nexport const DIRECTION_UP = 8;\nexport const DIRECTION_DOWN = 16;\nexport const DIRECTION_VERTICAL = 8 | 16;\nexport const DIRECTION_ALL = 2 | 4 | 8 | 16;\n\nexport const MOUSE_LEFT = \"left\";\nexport const MOUSE_RIGHT = \"right\";\nexport const MOUSE_MIDDLE = \"middle\";\n\nexport const ANY = \"any\";\nexport const NONE = \"none\";\nexport const SHIFT = \"shift\";\nexport const CTRL = \"ctrl\";\nexport const ALT = \"alt\";\nexport const META = \"meta\";\n\nexport const VELOCITY_INTERVAL = 16;\n\nexport const AXES_METHODS = [\n \"connect\",\n \"disconnect\",\n \"get\",\n \"setTo\",\n \"setBy\",\n \"setOptions\",\n \"setAxis\",\n \"stopAnimation\",\n \"updateAnimation\",\n \"isBounceArea\",\n] as const;\n\nexport const AXES_EVENTS = [\n \"hold\",\n \"release\",\n \"change\",\n \"animationStart\",\n \"animationEnd\",\n \"finish\",\n] as const;\n\nimport getAgent from \"@egjs/agent\";\n\nimport { window } from \"./browser\";\n\nexport const IOS_EDGE_THRESHOLD = 30;\nexport const IS_IOS_SAFARI =\n \"ontouchstart\" in window && getAgent().browser.name === \"safari\";\n\nexport const TRANSFORM = (() => {\n if (typeof document === \"undefined\") {\n return \"\";\n }\n const bodyStyle = (document.head || document.getElementsByTagName(\"head\")[0])\n .style;\n const target = [\n \"transform\",\n \"webkitTransform\",\n \"msTransform\",\n \"mozTransform\",\n ];\n for (let i = 0, len = target.length; i < len; i++) {\n if (target[i] in bodyStyle) {\n return target[i];\n }\n }\n return \"\";\n})();\n\nexport const PREVENT_DRAG_CSSPROPS = {\n \"user-select\": \"none\",\n \"-webkit-user-drag\": \"none\",\n};\n","/*\n * Copyright (c) 2015 NAVER Corp.\n * egjs projects are licensed under the MIT license\n */\nexport const getInsidePosition = (\n destPos: number,\n range: number[],\n circular: boolean[],\n bounce?: number[]\n): number => {\n let toDestPos: number = destPos;\n const targetRange: number[] = [\n circular[0] ? range[0] : bounce ? range[0] - bounce[0] : range[0],\n circular[1] ? range[1] : bounce ? range[1] + bounce[1] : range[1],\n ];\n\n toDestPos = Math.max(targetRange[0], toDestPos);\n toDestPos = Math.min(targetRange[1], toDestPos);\n\n return toDestPos;\n};\n\n// determine outside\nexport const isOutside = (pos: number, range: number[]): boolean => {\n return pos < range[0] || pos > range[1];\n};\n\n// determine whether position has reached the maximum moveable area\nexport const isEndofBounce = (\n pos: number,\n range: number[],\n bounce: number[],\n circular: boolean[]\n): boolean => {\n return (\n (!circular[0] && pos === range[0] - bounce[0]) ||\n (!circular[1] && pos === range[1] + bounce[1])\n );\n};\n\nexport const getDuration = (distance: number, deceleration): number => {\n const duration = Math.sqrt((distance / deceleration) * 2);\n\n // when duration is under 100, then value is zero\n return duration < 100 ? 0 : duration;\n};\n\nexport const isCircularable = (\n destPos: number,\n range: number[],\n circular: boolean[]\n): boolean => {\n return (\n (circular[1] && destPos > range[1]) || (circular[0] && destPos < range[0])\n );\n};\n\nexport const getCirculatedPos = (\n pos: number,\n range: number[],\n circular: boolean[]\n): number => {\n let toPos = pos;\n const min = range[0];\n const max = range[1];\n const length = max - min;\n\n if (circular[1] && pos > max) {\n // right\n toPos = ((toPos - max) % length) + min;\n }\n if (circular[0] && pos < min) {\n // left\n toPos = ((toPos - min) % length) + max;\n }\n return toPos;\n};\n","/*\n * Copyright (c) 2015 NAVER Corp.\n * egjs projects are licensed under the MIT license\n */\nimport { ExtendedEvent, InputEventType, LatestInterval } from \"../types\";\nimport { getAngle } from \"../utils\";\nimport { window } from \"../browser\";\nimport {\n ALT,\n ANY,\n CTRL,\n META,\n MOUSE_LEFT,\n MOUSE_MIDDLE,\n MOUSE_RIGHT,\n NONE,\n SHIFT,\n VELOCITY_INTERVAL,\n} from \"../const\";\n\nexport const SUPPORT_TOUCH = \"ontouchstart\" in window;\nexport const SUPPORT_POINTER = \"PointerEvent\" in window;\nexport const SUPPORT_MSPOINTER = \"MSPointerEvent\" in window;\nexport const SUPPORT_POINTER_EVENTS = SUPPORT_POINTER || SUPPORT_MSPOINTER;\n\nexport const isValidKey = (\n event: InputEventType | WheelEvent,\n inputKey?: string[]\n): boolean => {\n if (\n !inputKey ||\n inputKey.indexOf(ANY) > -1 ||\n (inputKey.indexOf(NONE) > -1 &&\n !event.shiftKey &&\n !event.ctrlKey &&\n !event.altKey &&\n !event.metaKey) ||\n (inputKey.indexOf(SHIFT) > -1 && event.shiftKey) ||\n (inputKey.indexOf(CTRL) > -1 && event.ctrlKey) ||\n (inputKey.indexOf(ALT) > -1 && event.altKey) ||\n (inputKey.indexOf(META) > -1 && event.metaKey)\n ) {\n return true;\n }\n return false;\n};\n\nexport abstract class EventInput {\n public prevEvent: ExtendedEvent;\n private _latestInterval: LatestInterval;\n\n public abstract onEventStart(\n event: InputEventType,\n inputButton?: string[]\n ): ExtendedEvent;\n\n public abstract onEventMove(\n event: InputEventType,\n inputButton?: string[]\n ): ExtendedEvent;\n\n public abstract onEventEnd(event: InputEventType): void;\n\n public abstract onRelease(event: InputEventType): void;\n\n public abstract getTouches(\n event: InputEventType,\n inputKey?: string[],\n inputButton?: string[]\n ): number;\n\n protected abstract _getScale(event: InputEventType): number;\n\n protected abstract _getCenter(event: InputEventType): {\n x: number;\n y: number;\n };\n\n protected abstract _getMovement(event: InputEventType): {\n x: number;\n y: number;\n };\n\n public extendEvent(event: InputEventType): ExtendedEvent {\n const prevEvent = this.prevEvent;\n const center = this._getCenter(event);\n const movement = prevEvent ? this._getMovement(event) : { x: 0, y: 0 };\n const scale = prevEvent ? this._getScale(event) : 1;\n const angle = prevEvent\n ? getAngle(center.x - prevEvent.center.x, center.y - prevEvent.center.y)\n : 0;\n const deltaX = prevEvent ? prevEvent.deltaX + movement.x : movement.x;\n const deltaY = prevEvent ? prevEvent.deltaY + movement.y : movement.y;\n const offsetX = movement.x;\n const offsetY = movement.y;\n const latestInterval = this._latestInterval;\n const timeStamp = Date.now();\n const deltaTime = latestInterval ? timeStamp - latestInterval.timestamp : 0;\n let velocityX = prevEvent ? prevEvent.velocityX : 0;\n let velocityY = prevEvent ? prevEvent.velocityY : 0;\n if (!latestInterval || deltaTime >= VELOCITY_INTERVAL) {\n if (latestInterval) {\n [velocityX, velocityY] = [\n (deltaX - latestInterval.deltaX) / deltaTime,\n (deltaY - latestInterval.deltaY) / deltaTime,\n ];\n }\n this._latestInterval = {\n timestamp: timeStamp,\n deltaX,\n deltaY,\n };\n }\n return {\n srcEvent: event,\n scale,\n angle,\n center,\n deltaX,\n deltaY,\n offsetX,\n offsetY,\n velocityX,\n velocityY,\n preventSystemEvent: true,\n };\n }\n\n protected _getDistance(\n start: Touch | PointerEvent,\n end: Touch | PointerEvent\n ): number {\n const x = end.clientX - start.clientX;\n const y = end.clientY - start.clientY;\n return Math.sqrt(x * x + y * y);\n }\n\n protected _getButton(event: InputEventType): string {\n const buttonCodeMap = { 1: MOUSE_LEFT, 2: MOUSE_RIGHT, 4: MOUSE_MIDDLE };\n const button = this._isTouchEvent(event)\n ? MOUSE_LEFT\n : buttonCodeMap[event.buttons];\n return button ? button : null;\n }\n\n protected _isTouchEvent(event: InputEventType): event is TouchEvent {\n return event.type && event.type.indexOf(\"touch\") > -1;\n }\n\n protected _isValidButton(button: string, inputButton: string[]): boolean {\n return inputButton.indexOf(button) > -1;\n }\n\n protected _isValidEvent(\n event: InputEventType,\n inputKey?: string[],\n inputButton?: string[]\n ): boolean {\n return (\n (!inputKey || isValidKey(event, inputKey)) &&\n (!inputButton || this._isValidButton(this._getButton(event), inputButton))\n );\n }\n\n protected _preventMouseButton(event: InputEventType, button: string): void {\n if (button === MOUSE_RIGHT) {\n window.addEventListener(\"contextmenu\", this._stopContextMenu);\n } else if (button === MOUSE_MIDDLE) {\n event.preventDefault();\n }\n }\n\n private _stopContextMenu = (event: InputEventType) => {\n event.preventDefault();\n window.removeEventListener(\"contextmenu\", this._stopContextMenu);\n };\n}\n","/*\n * Copyright (c) 2015 NAVER Corp.\n * egjs projects are licensed under the MIT license\n */\nimport { Axis } from \"../AxisManager\";\nimport { AxesOption } from \"../Axes\";\nimport { ActiveEvent } from \"../types\";\nimport { MouseEventInput } from \"../eventInput/MouseEventInput\";\nimport { TouchEventInput } from \"../eventInput/TouchEventInput\";\nimport { PointerEventInput } from \"../eventInput/PointerEventInput\";\nimport { TouchMouseEventInput } from \"../eventInput/TouchMouseEventInput\";\nimport {\n SUPPORT_POINTER_EVENTS,\n SUPPORT_TOUCH,\n} from \"../eventInput/EventInput\";\n\nexport interface InputType {\n axes: string[];\n element: HTMLElement;\n mapAxes(axes: string[]);\n connect(observer: InputTypeObserver): InputType;\n disconnect();\n destroy();\n enable?();\n disable?();\n isEnable?(): boolean;\n}\n\nexport interface InputTypeObserver {\n options: AxesOption;\n get(inputType: InputType): Axis;\n change(inputType: InputType, event, offset: Axis, useAnimation?: boolean);\n hold(inputType: InputType, event);\n release(\n inputType: InputType,\n event,\n velocity: number[],\n inputDuration?: number\n );\n}\n\nexport const toAxis = (source: string[], offset: number[]): Axis => {\n return offset.reduce((acc, v, i) => {\n if (source[i]) {\n acc[source[i]] = v;\n }\n return acc;\n }, {});\n};\n\nexport const convertInputType = (inputType: string[] = []): ActiveEvent => {\n let hasTouch = false;\n let hasMouse = false;\n let hasPointer = false;\n\n inputType.forEach((v) => {\n switch (v) {\n case \"mouse\":\n hasMouse = true;\n break;\n case \"touch\":\n hasTouch = SUPPORT_TOUCH;\n break;\n case \"pointer\":\n hasPointer = SUPPORT_POINTER_EVENTS;\n // no default\n }\n });\n if (hasPointer) {\n return new PointerEventInput();\n } else if (hasTouch && hasMouse) {\n return new TouchMouseEventInput();\n } else if (hasTouch) {\n return new TouchEventInput();\n } else if (hasMouse) {\n return new MouseEventInput();\n }\n return null;\n};\n\nexport function getAddEventOptions(eventName: string) {\n\t// The passive default value of the touch event is true.\n\t// If not a touch event, return false to support ie11\n\treturn eventName.indexOf(\"touch\") > -1 ? { passive: false } : false;\n}\n","/*\n * Copyright (c) 2015 NAVER Corp.\n * egjs projects are licensed under the MIT license\n */\nimport { ComponentEvent } from \"@egjs/component\";\nimport { getObserver } from \"@cfcs/core\";\n\nimport { InputType } from \"./inputType/InputType\";\nimport { Axis } from \"./AxisManager\";\nimport Axes from \"./Axes\";\nimport { roundNumbers } from \"./utils\";\nimport { AnimationParam, OnAnimationStart, OnRelease } from \"./types\";\nimport { AnimationManager } from \"./animation/AnimationManager\";\n\nexport interface ChangeEventOption {\n input: InputType;\n event;\n}\n\nexport class EventManager {\n public animationManager: AnimationManager;\n public constructor(private _axes: Axes) {}\n /**\n * This event is fired when a user holds an element on the screen of the device.\n * @ko 사용자가 기기의 화면에 손을 대고 있을 때 발생하는 이벤트\n * @event Axes#hold\n * @type {object}\n * @property {Object.<string, number>} pos coordinate <ko>좌표 정보</ko>\n * @property {Object} input The instance of inputType where the event occurred<ko>이벤트가 발생한 inputType 인스턴스</ko>\n * @property {Object} inputEvent The event object received from inputType <ko>inputType으로 부터 받은 이벤트 객체</ko>\n * @property {Boolean} isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call <ko>사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.</ko>\n *\n * @example\n * ```js\n * const axes = new eg.Axes({\n * \"x\": {\n * range: [0, 100]\n * },\n * \"zoom\": {\n * range: [50, 30]\n * }\n * }).on(\"hold\", function(event) {\n * // event.pos\n * // event.input\n * // event.inputEvent\n * // isTrusted\n * });\n * ```\n */\n public hold(pos: Axis, option: ChangeEventOption) {\n const { roundPos } = this._getRoundPos(pos);\n\n this._axes.trigger(\n new ComponentEvent(\"hold\", {\n pos: roundPos,\n input: option.input || null,\n inputEvent: option.event || null,\n isTrusted: true,\n })\n );\n }\n\n /**\n * Specifies the coordinates to move after the 'change' event. It works when the holding value of the change event is true.\n * @ko 'change' 이벤트 이후 이동할 좌표를 지정한다. change이벤트의 holding 값이 true일 경우에 동작한다\n * @param {Object.<string, number>} pos The coordinate to move to <ko>이동할 좌표</ko>\n * @example\n * ```js\n * const axes = new eg.Axes({\n * \"x\": {\n * range: [0, 100]\n * },\n * \"zoom\": {\n * range: [50, 30]\n * }\n * }).on(\"change\", function(event) {\n * event.holding && event.set({x: 10});\n * });\n * ```\n */\n /** Specifies the animation coordinates to move after the 'release' or 'animationStart' events.\n * @ko 'release' 또는 'animationStart' 이벤트 이후 이동할 좌표를 지정한다.\n * @param {Object.<string, number>} pos The coordinate to move to <ko>이동할 좌표</ko>\n * @param {Number} [duration=0] Duration of the animation (unit: ms) <ko>애니메이션 진행 시간(단위: ms)</ko>\n * @example\n * ```js\n * const axes = new eg.Axes({\n * \"x\": {\n * range: [0, 100]\n * },\n * \"zoom\": {\n * range: [50, 30]\n * }\n * }).on(\"animationStart\", function(event) {\n * event.setTo({x: 10}, 2000);\n * });\n * ```\n */\n /**\n * This event is fired when a user release an element on the screen of the device.\n * @ko 사용자가 기기의 화면에서 손을 뗐을 때 발생하는 이벤트\n * @event Axes#release\n * @type {object}\n * @property {Object.<string, number>} depaPos The coordinates when releasing an element<ko>손을 뗐을 때의 좌표 </ko>\n * @property {Object.<string, number>} destPos The coordinates to move to after releasing an element<ko>손을 뗀 뒤에 이동할 좌표</ko>\n * @property {Object.<string, number>} delta The movement variation of coordinate <ko>좌표의 변화량</ko>\n * @property {Object.<string, number>} bounceRatio If the coordinates at the time of release are in the bounce area, the current bounce value divided by the maximum bounce value <ko>손을 뗐을 때의 좌표가 bounce 영역에 있는 경우 현재 bounce된 값을 최대 bounce 값으로 나눈 수치.</ko>\n * @property {Object} inputEvent The event object received from inputType <ko>inputType으로 부터 받은 이벤트 객체</ko>\n * @property {Object} input The instance of inputType where the event occurred<ko>이벤트가 발생한 inputType 인스턴스</ko>\n * @property {setTo} setTo Specifies the animation coordinates to move after the event <ko>이벤트 이후 이동할 애니메이션 좌표를 지정한다</ko>\n * @property {Boolean} isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call <ko>사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.</ko>\n *\n * @example\n * ```js\n * const axes = new eg.Axes({\n * \"x\": {\n * range: [0, 100]\n * },\n * \"zoom\": {\n * range: [50, 30]\n * }\n * }).on(\"release\", function(event) {\n * // event.depaPos\n * // event.destPos\n * // event.delta\n * // event.input\n * // event.inputEvent\n * // event.setTo\n * // event.isTrusted\n *\n * // if you want to change the animation coordinates to move after the 'release' event.\n * event.setTo({x: 10}, 2000);\n * });\n * ```\n */\n public triggerRelease(param: AnimationParam) {\n const { roundPos, roundDepa } = this._getRoundPos(\n param.destPos,\n param.depaPos\n );\n param.destPos = roundPos;\n param.depaPos = roundDepa;\n param.setTo = this._createUserControll(param.destPos, param.duration);\n this._axes.trigger(\n new ComponentEvent(\"release\", {\n ...param,\n bounceRatio: this._getBounceRatio(roundPos),\n } as OnRelease)\n );\n }\n\n /**\n * This event is fired when coordinate changes.\n * @ko 좌표가 변경됐을 때 발생하는 이벤트\n * @event Axes#change\n * @type {object}\n * @property {Object.<string, number>} pos The coordinate <ko>좌표</ko>\n * @property {Object.<string, number>} delta The movement variation of coordinate <ko>좌표의 변화량</ko>\n * @property {Object.<string, number>} bounceRatio If the current coordinates are in the bounce area, the current bounce value divided by the maximum bounce value <ko>현재 좌표가 bounce 영역에 있는 경우 현재 bounce된 값을 최대 bounce 값으로 나눈 수치.</ko>\n * @property {Boolean} holding Indicates whether a user holds an element on the screen of the device.<ko>사용자가 기기의 화면을 누르고 있는지 여부</ko>\n * @property {Object} input The instance of inputType where the event occurred. If the value is changed by animation, it returns 'null'.<ko>이벤트가 발생한 inputType 인스턴스. 애니메이션에 의해 값이 변경될 경우에는 'null'을 반환한다.</ko>\n * @property {Object} inputEvent The event object received from inputType. If the value is changed by animation, it returns 'null'.<ko>inputType으로 부터 받은 이벤트 객체. 애니메이션에 의해 값이 변경될 경우에는 'null'을 반환한다.</ko>\n * @property {set} set Specifies the coordinates to move after the event. It works when the holding value is true <ko>이벤트 이후 이동할 좌표를 지정한다. holding 값이 true일 경우에 동작한다.</ko>\n * @property {Boolean} isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call <ko>사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.</ko>\n *\n * @example\n * ```js\n * const axes = new eg.Axes({\n * \"x\": {\n * range: [0, 100]\n * },\n * \"zoom\": {\n * range: [50, 30]\n * }\n * }).on(\"change\", function(event) {\n * // event.pos\n * // event.delta\n * // event.input\n * // event.inputEvent\n * // event.holding\n * // event.set\n * // event.isTrusted\n *\n * // if you want to change the coordinates to move after the 'change' event.\n * // it works when the holding value of the change event is true.\n * event.holding && event.set({x: 10});\n * });\n * ```\n */\n public triggerChange(\n pos: Axis,\n depaPos?: Axis,\n option?: ChangeEventOption,\n holding: boolean = false\n ) {\n const animationManager = this.animationManager;\n const axisManager = animationManager.axisManager;\n const eventInfo = animationManager.getEventInfo();\n const { roundPos, roundDepa } = this._getRoundPos(pos, depaPos);\n const moveTo = axisManager.moveTo(roundPos, roundDepa);\n const inputEvent = option?.event || eventInfo?.event || null;\n const param = {\n pos: moveTo.pos,\n delta: moveTo.delta,\n bounceRatio: this._getBounceRatio(moveTo.pos),\n holding,\n inputEvent,\n isTrusted: !!inputEvent,\n input: option?.input || eventInfo?.input || null,\n set: inputEvent ? this._createUserControll(moveTo.pos) : () => {}, // eslint-disable-line @typescript-eslint/no-empty-function\n };\n const event = new ComponentEvent(\"change\", param);\n this._axes.trigger(event);\n Object.keys(moveTo.pos).forEach((axis) => {\n const p = moveTo.pos[axis];\n getObserver(this._axes, axis, p).current = p;\n });\n\n if (inputEvent) {\n axisManager.set(\n (param.set() as { destPos: Axis; duration: number }).destPos\n );\n }\n\n return !event.isCanceled();\n }\n\n /**\n * This event is fired when animation starts.\n * @ko 에니메이션이 시작할 때 발생한다.\n * @event Axes#animationStart\n * @type {object}\n * @property {Object.<string, number>} depaPos The coordinates when animation starts<ko>애니메이션이 시작 되었을 때의 좌표 </ko>\n * @property {Object.<string, number>} destPos The coordinates to move to. If you change this value, you can run the animation<ko>이동할 좌표. 이값을 변경하여 애니메이션을 동작시킬수 있다</ko>\n * @property {Object.<string, number>} delta The movement variation of coordinate <ko>좌표의 변화량</ko>\n * @property {Number} duration Duration of the animation (unit: ms). If you change this value, you can control the animation duration time.<ko>애니메이션 진행 시간(단위: ms). 이값을 변경하여 애니메이션의 이동시간을 조절할 수 있다.</ko>\n * @property {Object} input The instance of inputType where the event occurred. If the value is changed by animation, it returns 'null'.<ko>이벤트가 발생한 inputType 인스턴스. 애니메이션에 의해 값이 변경될 경우에는 'null'을 반환한다.</ko>\n * @property {Object} inputEvent The event object received from inputType <ko>inputType으로 부터 받은 이벤트 객체</ko>\n * @property {setTo} setTo Specifies the animation coordinates to move after the event <ko>이벤트 이후 이동할 애니메이션 좌표를 지정한다</ko>\n * @property {Boolean} isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call <ko>사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.</ko>\n *\n * @example\n * ```js\n * const axes = new eg.Axes({\n * \"x\": {\n * range: [0, 100]\n * },\n * \"zoom\": {\n * range: [50, 30]\n * }\n * }).on(\"release\", function(event) {\n * // event.depaPos\n * // event.destPos\n * // event.delta\n * // event.input\n * // event.inputEvent\n * // event.setTo\n * // event.isTrusted\n *\n * // if you want to change the animation coordinates to move after the 'animationStart' event.\n * event.setTo({x: 10}, 2000);\n * });\n * ```\n */\n public triggerAnimationStart(param: AnimationParam): boolean {\n const { roundPos, roundDepa } = this._getRoundPos(\n param.destPos,\n param.depaPos\n );\n param.destPos = roundPos;\n param.depaPos = roundDepa;\n param.setTo = this._createUserControll(param.destPos, param.duration);\n const event = new ComponentEvent(\n \"animationStart\",\n param as OnAnimationStart\n );\n this._axes.trigger(event);\n return !event.isCanceled();\n }\n\n /**\n * This event is fired when animation ends.\n * @ko 에니메이션이 끝났을 때 발생한다.\n * @event Axes#animationEnd\n * @type {object}\n * @property {Boolean} isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call <ko>사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.</ko>\n *\n * @example\n * ```js\n * const axes = new eg.Axes({\n * \"x\": {\n * range: [0, 100]\n * },\n * \"zoom\": {\n * range: [50, 30]\n * }\n * }).on(\"animationEnd\", function(event) {\n * // event.isTrusted\n * });\n * ```\n */\n public triggerAnimationEnd(isTrusted: boolean = false) {\n this._axes.trigger(\n new ComponentEvent(\"animationEnd\", {\n isTrusted,\n })\n );\n }\n\n /**\n * This event is fired when all actions have been completed.\n * @ko 에니메이션이 끝났을 때 발생한다.\n * @event Axes#finish\n * @type {object}\n * @property {Boolean} isTrusted Returns true if an event was generated by the user action, or false if it was caused by a script or API call <ko>사용자의 액션에 의해 이벤트가 발생하였으면 true, 스크립트나 API호출에 의해 발생하였을 경우에는 false를 반환한다.</ko>\n *\n * @example\n * ```js\n * const axes = new eg.Axes({\n * \"x\": {\n * range: [0, 100]\n * },\n * \"zoom\": {\n * range: [50, 30]\n * }\n * }).on(\"finish\", function(event) {\n * // event.isTrusted\n * });\n * ```\n */\n public triggerFinish(isTrusted: boolean = false) {\n this._axes.trigger(\n new ComponentEvent(\"finish\", {\n isTrusted,\n })\n );\n }\n\n public setAnimationManager(animationManager: AnimationManager) {\n this.animationManager = animationManager;\n }\n\n public destroy() {\n this._axes.off();\n }\n\n private _createUserControll(pos: Axis, duration: number = 0) {\n // to controll\n const userControl = {\n destPos: { ...pos },\n duration,\n };\n return (\n toPos?: Axis,\n userDuration?: number\n ): { destPos: Axis; duration: number } => {\n if (toPos) {\n userControl.destPos = { ...toPos };\n }\n if (userDuration !== undefined) {\n userControl.duration = userDuration;\n }\n return userControl;\n };\n }\n\n private _getRoundPos(pos: Axis, depaPos?: Axis) {\n // round value if round exist\n const roundUnit = this._axes.options.round;\n\n // if (round == null) {\n // return {pos, depaPos}; // undefined, undefined\n // }\n return {\n roundPos: roundNumbers(pos, roundUnit),\n roundDepa: roundNumbers(depaPos, roundUnit),\n };\n }\n\n private _getBounceRatio(pos: Axis): Axis {\n return this._axes.axisManager.map(pos, (v, opt) => {\n if (v < opt.range[0] && opt.bounce[0] !== 0) {\n return (opt.range[0] - v) / opt.bounce[0];\n } else if (v > opt.range[1] && opt.bounce[1] !== 0) {\n return (v - opt.range[1]) / opt.bounce[1];\n } else {\n return 0;\n }\n });\n }\n}\n","/*\n * Copyright (c) 2015 NAVER Corp.\n * egjs projects are licensed under the MIT license\n */\nimport { AxesOption } from \"./Axes\";\nexport class InterruptManager {\n private _prevented = false; // check whether the animation event was prevented\n public constructor(private _options: AxesOption) {}\n\n public isInterrupting() {\n // when interruptable is 'true', return value is always 'true'.\n return this._options.interruptable || this._prevented;\n }\n\n public isInterrupted() {\n return !this._options.interruptable && this._prevented;\n }\n\n public setInterrupt(prevented) {\n if (!this._options.interruptable) {\n this._prevented = prevented;\n }\n }\n}\n","/*\n * Copyright (c) 2015 NAVER Corp.\n * egjs projects are licensed under the MIT license\n */\nimport { isOutside, getCirculatedPos } from \"./Coordinate\";\nimport { map, filter, every } from \"./utils\";\nimport { ObjectInterface } from \"./types\";\n\nexport interface Axis {\n [key: string]: number;\n}\n\nexport interface AxisOption {\n range?: number[];\n bounce?: number | number[];\n circular?: boolean | boolean[];\n startPos?: number;\n}\n\nexport class AxisManager {\n private _pos: Axis;\n public constructor(private _axis: ObjectInterface<AxisOption>) {\n this._complementOptions();\n this._pos = Object.keys(this._axis).reduce((pos, v) => {\n pos[v] = this._axis[v].startPos;\n return pos;\n }, {});\n }\n\n public getDelta(depaPos: Axis, destPos: Axis): Axis {\n const fullDepaPos = this.get(depaPos);\n return map(this.get(destPos), (v, k) => v - fullDepaPos[k]);\n }\n\n public get(axes?: string[] | Axis): Axis {\n if (axes && Array.isArray(axes)) {\n return axes.reduce((acc, v) => {\n if (v && v in this._pos) {\n acc[v] = this._pos[v];\n }\n return acc;\n }, {});\n } else {\n return { ...this._pos, ...((axes || {}) as Axis) };\n }\n }\n\n public moveTo(pos: Axis, depaPos: Axis = this._pos): { [key: string]: Axis } {\n const delta = map(this._pos, (v, key) => {\n return key in pos && key in depaPos ? pos[key] - depaPos[key] : 0;\n });\n\n this.set(\n this.map(pos, (v, opt) =>\n opt ? getCirculatedPos(v, opt.range, opt.circular as boolean[]) : 0\n )\n );\n return {\n pos: { ...this._pos },\n delta,\n };\n }\n\n public set(pos: Axis) {\n for (const k in pos) {\n if (k && k in this._pos) {\n this._pos[k] = pos[k];\n }\n }\n }\n\n public every(\n pos: Axis,\n callback: (value: number, options: AxisOption, key: string) => boolean\n ): boolean {\n const axisOptions = this._axis;\n\n return every(pos, (value, key) => callback(value, axisOptions[key], key));\n }\n\n public filter(\n pos: Axis,\n callback: (value: number, options: AxisOption, key: string) => boolean\n ): Axis {\n const axisOptions = this._axis;\n\n return filter(pos, (value, key) => callback(value, axisOptions[key], key));\n }\n\n public map<U>(\n pos: Axis,\n callback: (value: number, options: AxisOption, key: string) => U\n ) {\n const axisOptions = this._axis;\n\n return map<number, U>(pos, (value, key) =>\n callback(value, axisOptions[key], key)\n );\n }\n\n public isOutside(axes?: string[]) {\n return !this.every(\n axes ? this.get(axes) : this._pos,\n (v, opt) => !isOutside(v, opt.range)\n );\n }\n\n public getAxisOptions(key: string) {\n return this._axis[key];\n }\n\n public setAxis(axis: ObjectInterface<AxisOption>) {\n Object.keys(axis).forEach((key) => {\n if (!this._axis[key]) {\n throw new Error(`Axis ${key} does not exist in Axes instance`);\n }\n this._axis[key] = {\n ...this._axis[key],\n ...axis[key],\n };\n });\n this._complementOptions();\n }\n\n /**\n * set up 'css' expression\n * @private\n */\n private _complementOptions() {\n Object.keys(this._axis).forEach((axis) => {\n this._axis[axis] = {\n ...{\n range: [0, 100],\n startPos: this._axis[axis].range[0],\n bounce: [0, 0],\n circular: [false, false],\n },\n ...this._axis[axis],\n };\n\n [\"bounce\", \"circular\"].forEach((v) => {\n const axisOption = this._axis;\n const key = axisOption[axis][v];\n\n if (/string|number|boolean/.test(typeof key)) {\n axisOption[axis][v] = [key, key];\n }\n });\n });\n }\n}\n","/*\n * Copyright (c) 2015 NAVER Corp.\n * egjs projects are licensed under the MIT license\n */\nimport { InputEventType, ExtendedEvent } from \"../types\";\nimport { MOUSE_LEFT, MOUSE_MIDDLE, MOUSE_RIGHT } from \"../const\";\n\nimport { EventInput } from \"./EventInput\";\n\nexport class MouseEventInput extends EventInput {\n public readonly start = [\"mousedown\"];\n public readonly move = [\"mousemove\"];\n public readonly end = [\"mouseup\"];\n\n public onEventStart(\n event: InputEventType,\n inputKey?: string[],\n inputButton?: string[]\n ): ExtendedEvent {\n const button = this._getButton(event);\n if (!this._isValidEvent(event, inputKey, inputButton)) {\n return null;\n }\n this._preventMouseButton(event, button);\n return this.extendEvent(event);\n }\n\n public onEventMove(\n event: InputEventType,\n inputKey?: string[],\n inputButton?: string[]\n ): ExtendedEvent {\n if (!this._isValidEvent(event, inputKey, inputButton)) {\n return null;\n }\n return this.extendEvent(event);\n }\n\n public onEventEnd(): void {\n return;\n }\n\n public onRelease(): void {\n this.prevEvent = null;\n return;\n }\n\n public getTouches(event: InputEventType, inputButton?: string[]): number {\n if (inputButton) {\n const buttonCodeMap = { 1: MOUSE_LEFT, 2: MOUSE_MIDDLE, 3: MOUSE_RIGHT };\n return this._isValidButton(buttonCodeMap[event.which], inputButton) &&\n this.end.indexOf(event.type) === -1\n ? 1\n : 0;\n }\n return 0;\n }\n\n protected _getScale(): number {\n return 1;\n }\n\n protected _getCenter(event: MouseEvent): { x: number; y: number } {\n return {\n x: event.clientX,\n y: event.clientY,\n };\n }\n\n protected _getMovement(event: MouseEvent): { x: number; y: number } {\n const prev = this.prevEvent.srcEvent as MouseEvent;\n return {\n x: event.clientX - prev.clientX,\n y: event.clientY - prev.clientY,\n };\n }\n}\n","/*\n * Copyright (c) 2015 NAVER Corp.\n * egjs projects are licensed under the MIT license\n */\nimport { InputEventType, ExtendedEvent } from \"../types\";\n\nimport { EventInput } from \"./EventInput\";\n\nexport class TouchEventInput extends EventInput {\n public readonly start = [\"touchstart\"];\n public readonly move = [\"touchmove\"];\n public readonly end = [\"touchend\", \"touchcancel\"];\n\n private _baseTouches: TouchList;\n\n public onEventStart(\n event: InputEventType,\n inputKey?: string[]\n ): ExtendedEvent {\n this._baseTouches = (event as TouchEvent).touches;\n if (!this._isValidEvent(event, inputKey)) {\n return null;\n }\n return this.extendEvent(event);\n }\n\n public onEventMove(\n event: InputEventType,\n inputKey?: string[]\n ): ExtendedEvent {\n if (!this._isValidEvent(event, inputKey)) {\n return null;\n }\n return this.extendEvent(event);\n }\n\n public onEventEnd(event: InputEventType): void {\n this._baseTouches = (event as TouchEvent).touches;\n return;\n }\n\n public onRelease(): void {\n this.prevEvent = null;\n this._baseTouches = null;\n return;\n }\n\n public getTouches(event: InputEventType): number {\n return (event as TouchEvent).touches.length;\n }\n\n protected _getScale(event: TouchEvent): number {\n if (event.touches.length !== 2 || this._baseTouches.length < 2) {\n return null; // TODO: consider calculating non-pinch gesture scale\n }\n return (\n this._getDistance(event.touches[0], event.touches[1]) /\n this._getDistance(this._baseTouches[0], this._baseTouches[1])\n );\n }\n\n protected _getCenter(event: TouchEvent): { x: number; y: number } {\n return {\n x: event.touches[0].clientX,\n y: event.touches[0].clientY,\n };\n }\n\n protected _getMovement(event: TouchEvent): { x: number; y: number } {\n const prev = this.prevEvent.srcEvent as TouchEvent;\n if (event.touches[0].identifier !== prev.touches[0].identifier) {\n return {\n x: 0,\n y: 0,\n };\n }\n return {\n x: event.touches[0].clientX - prev.touches[0].clientX,\n y: event.touches[0].clientY - prev.touches[0].clientY,\n };\n }\n}\n","/*\n * Copyright (c) 2015 NAVER Corp.\n * egjs projects are licensed under the MIT license\n */\nimport { InputEventType, ExtendedEvent } from \"../types\";\n\nimport { EventInput, SUPPORT_POINTER } from \"./EventInput\";\n\nexport class PointerEventInput extends EventInput {\n public readonly start = SUPPORT_POINTER ? [\"pointerdown\"] : [\"MSPointerDown\"];\n public readonly move = SUPPORT_POINTER ? [\"pointermove\"] : [\"MSPointerMove\"];\n public readonly end = SUPPORT_POINTER\n ? [\"pointerup\", \"pointercancel\"]\n : [\"MSPointerUp\", \"MSPointerCancel\"];\n\n // store first, recent inputs for each event id\n private _firstInputs: PointerEvent[] = [];\n private _recentInputs: PointerEvent[] = [];\n\n public onEventStart(\n event: InputEventType,\n inputKey?: string[],\n inputButton?: string[]\n ): ExtendedEvent {\n const button = this._getButton(event);\n if (!this._isValidEvent(event, inputKey, inputButton)) {\n return null;\n }\n this._preventMouseButton(event, button);\n this._updatePointerEvent(event as PointerEvent);\n return this.extendEvent(event);\n }\n\n public onEventMove(\n event: InputEventType,\n inputKey?: string[],\n inputButton?: string[]\n ): ExtendedEvent {\n if (!this._isValidEvent(event, inputKey, inputButton)) {\n return null;\n }\n this._updatePointerEvent(event as PointerEvent);\n return this.extendEvent(event);\n }\n\n public onEventEnd(event: InputEventType): void {\n this._removePointerEvent(event as PointerEvent);\n }\n\n public onRelease(): void {\n this.prevEvent = null;\n this._firstInputs = [];\n this._recentInputs = [];\n return;\n }\n\n public getTouches(): number {\n return this._recentInputs.length;\n }\n\n protected _getScale(): number {\n if (this._recentInputs.length !== 2) {\n return null; // TODO: consider calculating non-pinch gesture scale\n }\n return (\n this._getDistance(this._recentInputs[0], this._recentInputs[1]) /\n this._getDistance(this._firstInputs[0], this._firstInputs[1])\n );\n }\n\n protected _getCenter(event: PointerEvent): { x: number; y: number } {\n return {\n x: event.clientX,\n y: event.clientY,\n };\n }\n\n protected _getMovement(event: PointerEvent): { x: number; y: number } {\n const prev = this.prevEvent.srcEvent as PointerEvent;\n if (event.pointerId !== prev.pointerId) {\n return {\n x: 0,\n y: 0,\n };\n }\n return {\n x: event.clientX - prev.clientX,\n y: event.clientY - prev.clientY,\n };\n }\n\n private _updatePointerEvent(event: PointerEvent) {\n let addFlag = false;\n this._recentInputs.forEach((e, i) => {\n if (e.pointerId === event.pointerId) {\n addFlag = true;\n this._recentInputs[i] = event;\n }\n });\n if (!addFlag) {\n this._firstInputs.push(event);\n this._recentInputs.push(event);\n }\n }\n\n private _removePointerEvent(event?: PointerEvent) {\n this._firstInputs = this._firstInputs.filter(\n (x) => x.pointerId !== event.pointerId\n );\n this._recentInputs = this._recentInputs.filter(\n (x) => x.pointerId !== event.pointerId\n );\n }\n}\n","/*\n * Copyright (c) 2015 NAVER Corp.\n * egjs projects are licensed under the MIT license\n */\nimport { InputEventType, ExtendedEvent } from \"../types\";\n\nimport { EventInput } from \"./EventInput\";\n\nexport class TouchMouseEventInput extends EventInput {\n public readonly start = [\"mousedown\", \"touchstart\"];\n public readonly move = [\"mousemove\", \"touchmove\"];\n public readonly end = [\"mouseup\", \"touchend\", \"touchcancel\"];\n\n private _baseTouches: TouchList;\n\n public onEventStart(\n event: InputEventType,\n inputKey?: string[],\n inputButton?: string[]\n ): ExtendedEvent {\n const button = this._getButton(event);\n if (this._isTouchEvent(event)) {\n this._baseTouches = event.touches;\n }\n if (!this._isValidEvent(event, inputKey, inputButton)) {\n return null;\n }\n this._preventMouseButton(event, button);\n return this.extendEvent(event);\n }\n\n public onEventMove(\n event: InputEventType,\n inputKey?: string[],\n inputButton?: string[]\n ): ExtendedEvent {\n if (!this._isValidEvent(event, inputKey, inputButton)) {\n return null;\n }\n return this.extendEvent(event);\n }\n\n public onEventEnd(event: InputEventType): void {\n if (this._isTouchEvent(event)) {\n this._baseTouches = event.touches;\n }\n return;\n }\n\n public onRelease(): void {\n this.prevEvent = null;\n this._baseTouches = null;\n return;\n }\n\n public getTouches(event: InputEventType): number {\n return this._isTouchEvent(event) ? event.touches.length : 0;\n }\n\n protected _getScale(event: MouseEvent | TouchEvent): number {\n if (this._isTouchEvent(event)) {\n if (event.touches.length !== 2 || this._baseTouches.length < 2) {\n return 1; // TODO: consider calculating non-pinch gesture scale\n }\n return (\n this._getDistance(event.touches[0], event.touches[1]) /\n this._getDistance(this._baseTouches[0], this._baseTouches[1])\n );\n }\n return this.prevEvent.scale;\n }\n\n protected _getCenter(event: MouseEvent | TouchEvent): {\n x: number;\n y: number;\n } {\n if (this._isTouchEvent(event)) {\n return {\n x: event.touches[0].clientX,\n y: event.touches[0].clientY,\n };\n }\n return {\n x: event.clientX,\n y: event.clientY,\n };\n }\n\n protected _getMovement(event: MouseEvent | TouchEvent): {\n x: number;\n y: number;\n } {\n const prev = this.prevEvent.srcEvent;\n const [nextSpot, prevSpot] = [event, prev].map((e) => {\n if (this._isTouchEvent(e)) {\n return {\n id: e.touches[0].identifier,\n x: e.touches[0].clientX,\n y: e.touches[0].clientY,\n };\n }\n return {\n id: null,\n x: e.clientX,\n y: e.clientY,\n };\n });\n return nextSpot.id === prevSpot.id\n ? { x: nextSpot.x - prevSpot.x, y: nextSpot.y - prevSpot.y }\n : { x: 0, y: 0 };\n }\n}\n","import {\n getInsidePosition,\n isCircularable,\n getCirculatedPos,\n getDuration,\n} from \"../Coordinate\";\nimport { Axis, AxisManager } from \"../AxisManager\";\nimport { InterruptManager } from \"../InterruptManager\";\nimport { EventManager, ChangeEventOption } from \"../EventManager\";\nimport {\n requestAnimationFrame,\n cancelAnimationFrame,\n map,\n every,\n filter,\n equal,\n roundNumber,\n getDecimalPlace,\n inversePow,\n} from \"../utils\";\nimport { AxesOption } from \"../Axes\";\nimport {\n AnimationParam,\n ObjectInterface,\n UpdateAnimationOption,\n} from \"../types\";\n\nexport interface AnimationState {\n pos: Axis;\n easingPer: number;\n finished: boolean;\n}\n\nconst clamp = (value: number, min: number, max: number): number => {\n return Math.max(Math.min(value, max), min);\n};\n\nexport abstract class AnimationManager {\n public interruptManager: InterruptManager;\n public eventManager: EventManager;\n public axisManager: AxisManager;\n protected _options: AxesOption;\n protected _animateParam: AnimationParam;\n private _raf: number;\n\n public constructor({\n options,\n interruptManager,\n eventManager,\n axisManager,\n }: {\n options: AxesOption;\n interruptManager: InterruptManager;\n eventManager: EventManager;\n axisManager: AxisManager;\n }) {\n this._options = options;\n this.interruptManager = interruptManager;\n this.eventManager = eventManager;\n this.axisManager = axisManager;\n this.animationEnd = this.animationEnd.bind(this);\n }\n\n public abstract interpolate(displacement: number, threshold: number): number;\n\n public abstract updateAnimation(options: UpdateAnimationOption): void;\n\n protected abstract _initState(info: AnimationParam): AnimationState;\n\n protected abstract _getNextState(prevState: AnimationState): AnimationState;\n\n public getDuration(\n depaPos: Axis,\n destPos: Axis,\n wishDuration?: number\n ): number {\n let duration: number;\n if (typeof wishDuration !== \"undefined\") {\n duration = wishDuration;\n } else {\n const durations: Axis = map(destPos, (v, k) =>\n getDuration(Math.abs(v - depaPos[k]), this._options.deceleration)\n );\n duration = Object.keys(durations).reduce(\n (max, v) => Math.max(max, durations[v]),\n -Infinity\n );\n }\n return clamp(\n duration,\n this._options.minimumDuration,\n this._options.maximumDuration\n );\n }\n\n public getDisplacement(velocity: number[]): number[] {\n const totalVelocity = Math.pow(\n velocity.reduce((total, v) => total + v * v, 0),\n 1 / velocity.length\n );\n const duration = Math.abs(totalVelocity / -this._options.deceleration);\n return velocity.map((v) => (v / 2) * duration);\n }\n\n public stopAnimation(option?: ChangeEventOption): void {\n if (this._animateParam) {\n const orgPos: Axis = this.axisManager.get();\n const pos: Axis = this.axisManager.map(orgPos, (v, opt) =>\n getCirculatedPos(v, opt.range, opt.circular as boolean[])\n );\n if (!every(pos, (v, k) => orgPos[k] === v)) {\n this.eventManager.triggerChange(pos, orgPos, option, !!option);\n }\n this._animateParam = null;\n if (this._raf) {\n cancelAnimationFrame(this._raf);\n }\n this._raf = null;\n this.eventManager.triggerAnimationEnd(!!option?.event);\n }\n }\n\n public getEventInfo(): ChangeEventOption {\n if (\n this._animateParam &&\n this._animateParam.input &&\n this._animateParam.inputEvent\n ) {\n return {\n input: this._animateParam.input,\n event: this._animateParam.inputEvent,\n };\n } else {\n return null;\n }\n }\n\n public restore(option: ChangeEventOption): void {\n const pos: Axis = this.axisManager.get();\n const destPos: Axis = this.axisManager.map(pos, (v, opt) =>\n Math.min(opt.range[1], Math.max(opt.range[0], v))\n );\n this.stopAnimation();\n this.animateTo(destPos, this.getDuration(pos, destPos), option);\n }\n\n public animationEnd(): void {\n const beforeParam: ChangeEventOption = this.getEventInfo();\n this._animateParam = null;\n\n // for Circular\n const circularTargets = this.axisManager.filter(\n this.axisManager.get(),\n (v, opt) => isCircularable(v, opt.range, opt.circular as boolean[])\n );\n if (Object.keys(circularTargets).length > 0) {\n this.setTo(\n this.axisManager.map(circularTargets, (v, opt) =>\n getCirculatedPos(v, opt.range, opt.circular as boolean[])\n )\n );\n }\n this.interruptManager.setInterrupt(false);\n this.eventManager.triggerAnimationEnd(!!beforeParam);\n if (this.axisManager.isOutside()) {\n this.restore(beforeParam);\n } else {\n this.finish(!!beforeParam);\n }\n }\n\n public finish(isTrusted: boolean): void {\n this._animateParam = null;\n this.interruptManager.setInterrupt(false);\n this.eventManager.triggerFinish(isTrusted);\n }\n\n public getUserControl(param: AnimationParam): {\n destPos: Axis;\n duration: number;\n } {\n const userWish = param.setTo();\n userWish.destPos = this.axisManager.get(userWish.destPos);\n userWish.duration = clamp(\n userWish.duration,\n this._options.minimumDuration,\n this._options.maximumDuration\n );\n return userWish;\n }\n\n public animateTo(\n destPos: Axis,\n duration: number,\n option?: ChangeEventOption\n ): void {\n this.stopAnimation();\n const param: AnimationParam = this._createAnimationParam(\n destPos,\n duration,\n option\n );\n const depaPos = { ...param.depaPos };\n const retTrigger = this.eventManager.triggerAnimationStart(param);\n\n // to control\n const userWish = this.getUserControl(param);\n\n // You can't stop the 'animationStart' event when 'circular' is true.\n if (\n !retTrigger &&\n this.axisManager.every(userWish.destPos, (v, opt) =>\n isCircularable(v, opt.range, opt.circular as boolean[])\n )\n ) {\n console.warn(\n \"You can't stop the 'animation' event when 'circular' is true.\"\n );\n }\n\n if (retTrigger && !equal(userWish.destPos, depaPos)) {\n const inputEvent = option?.event || null;\n this._animateLoop(\n {\n depaPos,\n destPos: userWish.destPos,\n duration: userWish.duration,\n delta: this.axisManager.getDelta(depaPos, userWish.destPos),\n isTrusted: !!inputEvent,\n inputEvent,\n input: option?.input || null,\n },\n () => this.animationEnd()\n );\n }\n }\n\n public setTo(pos: Axis, duration: number = 0) {\n const axes: string[] = Object.keys(pos);\n const orgPos: Axis = this.axisManager.get(axes);\n\n if (equal(pos, orgPos)) {\n return this;\n }\n this.interruptManager.setInterrupt(true);\n let movedPos = filter(pos, (v, k) => orgPos[k] !== v);\n if (!Object.keys(movedPos).length) {\n return this;\n }\n\n movedPos = this.axisManager.map(movedPos, (v, opt) => {\n const { range, circular } = opt;\n\n if (circular && (circular[0] || circular[1])) {\n return v;\n } else {\n return getInsidePosition(v, range, circular as boolean[]);\n }\n });\n\n if (equal(movedPos, orgPos)) {\n return this;\n }\n\n if (duration > 0) {\n this.animateTo(movedPos, duration);\n } else {\n this.stopAnimation();\n this.eventManager.triggerChange(movedPos);\n this.finish(false);\n }\n\n return this;\n }\n\n public setBy(pos: Axis, duration = 0) {\n return this.setTo(\n map(this.axisManager.get(Object.keys(pos)), (v, k) => v + pos[k]),\n duration\n );\n }\n\n private _createAnimationParam(\n pos: Axis,\n duration: number,\n option?: ChangeEventOption\n ): AnimationParam {\n const depaPos: Axis = this.axisManager.get();\n const destPos: Axis = pos;\n const inputEvent = option?.event || null;\n return {\n depaPos,\n destPos,\n duration: clamp(\n duration,\n this._options.minimumDuration,\n this._options.maximumDuration\n ),\n delta: this.axisManager.getDelta(depaPos, destPos),\n inputEvent,\n input: option?.input || null,\n isTrusted: !!inputEvent,\n done: this.animationEnd,\n };\n }\n\n private _animateLoop(param: AnimationParam, complete: () => void): void {\n if (param.duration) {\n this._animateParam = {\n ...param,\n startTime: new Date().getTime(),\n };\n const originalIntendedPos = map(param.destPos, (v) => v);\n let state = this._initState(this._animateParam);\n\n const loop = () => {\n this._raf = null;\n const animateParam = this._animateParam;\n const nextState = this._getNextState(state);\n const isCanceled = !this.eventManager.triggerChange(\n nextState.pos,\n state.pos\n );\n\n state = nextState;\n\n if (nextState.finished) {\n animateParam.destPos = this._getFinalPos(\n animateParam.destPos,\n originalIntendedPos\n );\n if (\n !equal(\n animateParam.destPos,\n this.axisManager.get(Object.keys(animateParam.destPos))\n )\n ) {\n this.eventManager.triggerChange(\n animateParam.destPos,\n nextState.pos\n );\n }\n complete();\n return;\n } else if (isCanceled) {\n this.finish(false);\n } else {\n this._raf = requestAnimationFrame(loop);\n }\n };\n loop();\n } else {\n this.eventManager.triggerChange(param.destPos);\n complete();\n }\n }\n\n /**\n * Get estimated final value.\n *\n * If destPos is within the 'error range' of the original intended position, the initial intended position is returned.\n * - eg. original intended pos: 100, destPos: 100.0000000004 ==> return 100;\n * If dest Pos is outside the 'range of error' compared to the originally intended pos, it is returned rounded based on the originally intended pos.\n * - eg. original intended pos: 100.123 destPos: 50.12345 => return 50.123\n * @param originalIntendedPos\n * @param destPos\n */\n private _getFinalPos(\n destPos: ObjectInterface<number>,\n originalIntendedPos: ObjectInterface<number>\n ): Axis {\n // compare destPos and originalIntendedPos\n // eslint-disable-next-line @typescript-eslint/naming-convention\n const ERROR_LIMIT = 0.000001;\n const finalPos = map(destPos, (value, key) => {\n if (\n value >= originalIntendedPos[key] - ERROR_LIMIT &&\n value <= originalIntendedPos[key] + ERROR_LIMIT\n ) {\n // In error range, return original intended\n return originalIntendedPos[key];\n } else {\n // Out of error range, return rounded pos.\n const roundUnit = this._getRoundUnit(value, key);\n const result = roundNumber(value, roundUnit);\n return result;\n }\n });\n return finalPos;\n }\n\n private _getRoundUnit(val: number, key: string): number {\n const roundUnit = this._options.round; // manual mode\n let minRoundUnit = null; // auto mode\n\n // auto mode\n if (!roundUnit) {\n // Get minimum round unit\n const options = this.axisManager.getAxisOptions(key);\n minRoundUnit = inversePow(\n Math.max(\n getDecimalPlace(options.range[0]),\n getDecimalPlace(options.range[1]),\n getDecimalPlace(val)\n )\n );\n }\n\n return minRoundUnit || roundUnit;\n }\n}\n","/*\n * Copyright (c) 2015 NAVER Corp.\n * egjs projects are licensed under the MIT license\n */\nimport { InterruptManager } from \"./InterruptManager\";\nimport { InputType, InputTypeObserver, toAxis } from \"./inputType/InputType\";\nimport { EventManager, ChangeEventOption } from \"./EventManager\";\nimport { AxisManager, Axis } from \"./AxisManager\";\nimport { AxesOption } from \"./Axes\";\nimport {\n isOutside,\n getInsidePosition,\n getCirculatedPos,\n isEndofBounce,\n} from \"./Coordinate\";\nimport { map, equal } from \"./utils\";\nimport { AnimationParam } from \"./types\";\nimport { AnimationManager } from \"./animation/AnimationManager\";\n\nexport class InputObserver implements InputTypeObserver {\n public options: AxesOption;\n private _interruptManager: InterruptManager;\n private _eventManager: EventManager;\n private _axisManager: AxisManager;\n private _animationManager: AnimationManager;\n private _isOutside = false;\n private _moveDistance: Axis = null;\n private _isStopped = false;\n public constructor({\n options,\n interruptManager,\n eventManager,\n axisManager,\n animationManager,\n }: {\n options: AxesOption;\n interruptManager: InterruptManager;\n eventManager: EventManager;\n axisManager: AxisManager;\n animationManager: AnimationManager;\n }) {\n this.options = options;\n this._interruptManager = interruptManager;\n this._eventManager = eventManager;\n this._axisManager = axisManager;\n this._animationManager = animationManager;\n }\n\n public get(input: InputType): Axis {\n return this._axisManager.get(input.axes);\n }\n\n public hold(input: InputType, event) {\n if (this._interruptManager.isInterrupted() || !input.axes.length) {\n return;\n }\n const changeOption: ChangeEventOption = {\n input,\n event,\n };\n this._isStopped = false;\n this._interruptManager.setInterrupt(true);\n this._animationManager.stopAnimation(changeOption);\n if (!this._moveDistance) {\n this._eventManager.hold(this._axisManager.get(), changeOption);\n }\n this._isOutside = this._axisManager.isOutside(input.axes);\n this._moveDistance = this._axisManager.get(input.axes);\n }\n\n public change(input: InputType, event, offset: Axis, useAnimation?: boolean) {\n if (\n this._isStopped ||\n !this._interruptManager.isInterrupting() ||\n this._axisManager.every(offset, (v) => v === 0)\n ) {\n return;\n }\n const nativeEvent = event.srcEvent ? event.srcEvent : event;\n if (nativeEvent.__childrenAxesAlreadyChanged) {\n return;\n }\n let depaPos: Axis = this._moveDistance || this._axisManager.get(input.axes);\n let destPos: Axis;\n\n // for outside logic\n destPos = map(depaPos, (v, k) => v + (offset[k] || 0));\n if (this._moveDistance) {\n this._moveDistance = this._axisManager.map(\n destPos,\n (v, { circular, range }) =>\n circular && (circular[0] || circular[1])\n ? getCirculatedPos(v, range, circular as boolean[])\n : v\n );\n }\n // from outside to inside\n if (\n this._isOutside &&\n this._axisManager.every(depaPos, (v, opt) => !isOutside(v, opt.range))\n ) {\n this._isOutside = false;\n }\n depaPos = this._atOutside(depaPos);\n destPos = this._atOutside(destPos);\n\n if (!this.options.nested || !this._isEndofAxis(offset, depaPos, destPos)) {\n nativeEvent.__childrenAxesAlreadyChanged = true;\n }\n\n const changeOption: ChangeEventOption = {\n input,\n event,\n };\n if (useAnimation) {\n const duration = this._animationManager.getDuration(destPos, depaPos);\n this._animationManager.animateTo(destPos, duration, changeOption);\n } else {\n const isCanceled = !this._eventManager.triggerChange(\n destPos,\n depaPos,\n changeOption,\n true\n );\n if (isCanceled) {\n this._isStopped = true;\n this._moveDistance = null;\n this._animationManager.finish(false);\n }\n }\n }\n\n public release(\n input: InputType,\n event,\n velocity: number[],\n inputDuration?: number\n ) {\n if (\n this._isStopped ||\n !this._interruptManager.isInterrupting() ||\n !this._moveDistance\n ) {\n return;\n }\n const nativeEvent = event.srcEvent ? event.srcEvent : event;\n if (nativeEvent.__childrenAxesAlreadyReleased) {\n velocity = velocity.map(() => 0);\n }\n const pos: Axis = this._axisManager.get(input.axes);\n const depaPos: Axis = this._axisManager.get();\n const displacement = this._animationManager.getDisplacement(velocity);\n const offset = toAxis(input.axes, displacement);\n let destPos: Axis = this._axisManager.get(\n this._axisManager.map(offset, (v, opt, k) => {\n if (opt.circular && (opt.circular[0] || opt.circular[1])) {\n return pos[k] + v;\n } else {\n return getInsidePosition(\n pos[k] + v,\n opt.range,\n opt.circular as boolean[],\n opt.bounce as number[]\n );\n }\n })\n );\n nativeEvent.__childrenAxesAlreadyReleased = true;\n const duration = this._animationManager.getDuration(\n destPos,\n pos,\n inputDuration\n );\n\n if (duration === 0) {\n destPos = { ...depaPos };\n }\n // prepare params\n const param: AnimationParam = {\n depaPos,\n destPos,\n duration,\n delta: this._axisManager.getDelta(depaPos, destPos),\n inputEvent: event,\n input,\n isTrusted: true,\n };\n this._eventManager.triggerRelease(param);\n this._moveDistance = null;\n\n // to contol\n const userWish = this._animationManager.getUserControl(param);\n const isEqual = equal(userWish.destPos, depaPos);\n const changeOption: ChangeEventOption = {\n input,\n event,\n };\n if (isEqual || userWish.duration === 0) {\n if (!isEqual) {\n this._eventManager.triggerChange(\n userWish.destPos,\n depaPos,\n changeOption,\n true\n );\n }\n this._interruptManager.setInterrupt(false);\n if (this._axisManager.isOutside()) {\n this._animationManager.restore(changeOption);\n } else {\n this._eventManager.triggerFinish(true);\n }\n } else {\n this._animationManager.animateTo(\n userWish.destPos,\n userWish.duration,\n changeOption\n );\n }\n }\n\n // when move pointer is held in outside\n private _atOutside(pos: Axis) {\n if (this._isOutside) {\n return this._axisManager.map(pos, (v, opt) => {\n const tn = opt.range[0] - (opt.bounce[0] as number);\n const tx = opt.range[1] + (opt.bounce[1] as number);\n return v > tx ? tx : v < tn ? tn : v;\n });\n } else {\n return this._axisManager.map(pos, (v, opt) => {\n const min = opt.range[0];\n const max = opt.range[1];\n const out = opt.bounce;\n const circular = opt.circular;\n\n if ((circular[0] && v < min) || (circular[1] && v > max)) {\n return v;\n } else if (v < min) {\n // left\n return (\n min - this._animationManager.interpolate(min - v, out[0] as number)\n );\n } else if (v > max) {\n // right\n return (\n max + this._animationManager.interpolate(v - max, out[1] as number)\n );\n }\n return v;\n });\n }\n }\n\n private _isEndofAxis(offset: Axis, depaPos: Axis, destPos: Axis) {\n return this._axisManager.every(\n depaPos,\n (value, option, key) =>\n offset[key] === 0 ||\n (depaPos[key] === destPos[key] &&\n isEndofBounce(\n value,\n option.range,\n option.bounce as number[],\n option.circular as boolean[]\n ))\n );\n }\n}\n","/*\n * Copyright (c) 2015 NAVER Corp.\n * egjs projects are licensed under the MIT license\n */\nimport Axes, * as modules from \"./index\";\n\nfor (const name in modules) {\n (Axes as any)[name] = (modules as any)[name];\n}\n\nexport default Axes;\n","import { AxesOption } from \"../Axes\";\nimport { Axis } from \"../AxisManager\";\nimport { getCirculatedPos } from \"../Coordinate\";\nimport { AnimationParam, UpdateAnimationOption } from \"../types\";\nimport { map } from \"../utils\";\n\nimport { AnimationManager, AnimationState } from \"./AnimationManager\";\n\nexport class EasingManager extends AnimationManager {\n protected _useDuration = true;\n protected _options: AxesOption;\n private _durationOffset: number;\n private _initialEasingPer: number;\n private _prevEasingPer: number;\n\n public interpolate(displacement: number, threshold: number): number {\n const initSlope = this._easing(0.00001) / 0.00001;\n return this._easing(displacement / (threshold * initSlope)) * threshold;\n }\n\n public updateAnimation(options: UpdateAnimationOption): void {\n const animateParam = this._animateParam;\n if (!animateParam) {\n return;\n }\n\n const diffTime = new Date().getTime() - animateParam.startTime;\n const pos = options?.destPos || animateParam.destPos;\n const duration = options?.duration ?? animateParam.duration;\n if (options?.restart || duration <= diffTime) {\n this.setTo(pos, duration - diffTime);\n return;\n }\n if (options?.destPos) {\n const currentPos = this.axisManager.get();\n // When destination is changed, new delta should be calculated as remaining percent.\n // For example, moving x:0, y:0 to x:200, y:200 and it has current easing percent of 92%. coordinate is x:184 and y:184\n // If destination changes to x:300, y:300. xdelta:200, ydelta:200 changes to xdelta:116, ydelta:116 and use remaining easingPer as 100%, not 8% as previous.\n // Therefore, original easingPer by time is kept. And divided by (1 - self._initialEasingPer) which means new total easing percent. Like calculating 8% as 100%.\n this._initialEasingPer = this._prevEasingPer;\n animateParam.delta = this.axisManager.getDelta(currentPos, pos);\n animateParam.destPos = pos;\n }\n if (options?.duration) {\n const ratio = (diffTime + this._durationOffset) / animateParam.duration;\n // Use durationOffset for keeping animation ratio after duration is changed.\n // newRatio = (diffTime + newDurationOffset) / newDuration = oldRatio\n // newDurationOffset = oldRatio * newDuration - diffTime\n this._durationOffset = ratio * duration - diffTime;\n animateParam.duration = duration;\n }\n }\n\n protected _initState(info: AnimationParam): AnimationState {\n this._initialEasingPer = 0;\n this._prevEasingPer = 0;\n this._durationOffset = 0;\n return {\n pos: info.depaPos,\n easingPer: 0,\n finished: false,\n };\n }\n\n protected _getNextState(prevState: AnimationState): AnimationState {\n const animateParam = this._animateParam;\n const prevPos = prevState.pos;\n const destPos = animateParam.destPos;\n const directions = map(prevPos, (value, key) => {\n return value <= destPos[key] ? 1 : -1;\n });\n const diffTime = new Date().getTime() - animateParam.startTime;\n const ratio = (diffTime + this._durationOffset) / animateParam.duration;\n const easingPer = this._easing(ratio);\n\n const toPos: Axis = this.axisManager.map(prevPos, (pos, options, key) => {\n const nextPos =\n ratio >= 1\n ? destPos[key]\n : pos +\n (animateParam.delta[key] * (easingPer - this._prevEasingPer)) /\n (1 - this._initialEasingPer);\n\n // Subtract distance from distance already moved.\n // Recalculate the remaining distance.\n // Fix the bouncing phenomenon by changing the range.\n const circulatedPos = getCirculatedPos(\n nextPos,\n options.range,\n options.circular as boolean[]\n );\n if (nextPos !== circulatedPos) {\n // circular\n const rangeOffset =\n directions[key] * (options.range[1] - options.range[0]);\n\n destPos[key] -= rangeOffset;\n prevPos[key] -= rangeOffset;\n }\n return circulatedPos;\n });\n this._prevEasingPer = easingPer;\n return {\n pos: toPos,\n easingPer,\n finished: easingPer >= 1,\n };\n }\n\n private _easing(p: number): number {\n return p > 1 ? 1 : this._options.easing(p);\n }\n}\n","/*\n * Copyright (c) 2015 NAVER Corp.\n * egjs projects are licensed under the MIT license\n */\nimport Component from \"@egjs/component\";\nimport { ReactiveSubscribe } from \"@cfcs/core\";\n\nimport { EventManager } from \"./EventManager\";\nimport { InterruptManager } from \"./InterruptManager\";\nimport { AxisManager, AxisOption, Axis } from \"./AxisManager\";\nimport { InputObserver } from \"./InputObserver\";\nimport {\n TRANSFORM,\n DIRECTION_NONE,\n DIRECTION_LEFT,\n DIRECTION_RIGHT,\n DIRECTION_UP,\n DIRECTION_DOWN,\n DIRECTION_HORIZONTAL,\n DIRECTION_VERTICAL,\n DIRECTION_ALL,\n} from \"./const\";\nimport { InputType } from \"./inputType/InputType\";\nimport {\n AxesEvents,\n AxesReactiveState,\n ObjectInterface,\n UpdateAnimationOption,\n} from \"./types\";\nimport { EasingManager } from \"./animation/EasingManager\";\nimport { AnimationManager } from \"./animation/AnimationManager\";\n\nexport interface AxesOption {\n easing?: (x: number) => number;\n maximumDuration?: number;\n minimumDuration?: number;\n deceleration?: number;\n interruptable?: boolean;\n round?: number;\n nested?: boolean;\n}\n\n/**\n * @typedef {Object} AxisOption The Axis information. The key of the axis specifies the name to use as the logical virtual coordinate system.\n * @ko 축 정보. 축의 키는 논리적인 가상 좌표계로 사용할 이름을 지정한다.\n * @param {Number[]} [range] The range of coordinate <ko>좌표 범위</ko>\n * @param {Number} [range[0]=0] The coordinate of the minimum <ko>최소 좌표</ko>\n * @param {Number} [range[1]=0] The coordinate of the maximum <ko>최대 좌표</ko>\n * @param {Number} [startPos=range[0]] The coordinates to be moved when creating an instance <ko>인스턴스 생성시 이동할 좌표</ko>\n * @param {Number[]} [bounce] The size of bouncing area. The coordinates can exceed the coordinate area as much as the bouncing area based on user action. If the coordinates does not exceed the bouncing area when an element is dragged, the coordinates where bouncing effects are applied are retuned back into the coordinate area<ko>바운스 영역의 크기. 사용자의 동작에 따라 좌표가 좌표 영역을 넘어 바운스 영역의 크기만큼 더 이동할 수 있다. 사용자가 끌어다 놓는 동작을 했을 때 좌표가 바운스 영역에 있으면, 바운스 효과가 적용된 좌표가 다시 좌표 영역 안으로 들어온다</ko>\n * @param {Number} [bounce[0]=0] The size of coordinate of the minimum area <ko>최소 좌표 바운스 영역의 크기</ko>\n * @param {Number} [bounce[1]=0] The size of coordinate of the maximum area <ko>최대 좌표 바운스 영역의 크기</ko>\n * @param {Boolean[]} [circular] Indicates whether a circular element is available. If it is set to \"true\" and an element is dragged outside the coordinate area, the element will appear on the other side.<ko>순환 여부. 'true'로 설정한 방향의 좌표 영역 밖으로 엘리먼트가 이동하면 반대 방향에서 엘리먼트가 나타난다</ko>\n * @param {Boolean} [circular[0]=false] Indicates whether to circulate to the coordinate of the minimum <ko>최소 좌표 방향의 순환 여부</ko>\n * @param {Boolean} [circular[1]=false] Indicates whether to circulate to the coordinate of the maximum <ko>최대 좌표 방향의 순환 여부</ko>\n **/\n\n/**\n * @typedef {Object} AxesOption The option object of the eg.Axes module\n * @ko eg.Axes 모듈의 옵션 객체\n * @param {Function} [easing=easing.easeOutCubic] The easing function to apply to an animation <ko>애니메이션에 적용할 easing 함수</ko>\n * @param {Number} [maximumDuration=Infinity] Maximum duration of the animation <ko>가속도에 의해 애니메이션이 동작할 때의 최대 좌표 이동 시간</ko>\n * @param {Number} [minimumDuration=0] Minimum duration of the animation <ko>가속도에 의해 애니메이션이 동작할 때의 최소 좌표 이동 시간</ko>\n * @param {Number} [deceleration=0.0006] Deceleration of the animation where acceleration is manually enabled by user. A higher value indicates shorter running time. <ko>사용자의 동작으로 가속도가 적용된 애니메이션의 감속도. 값이 높을수록 애니메이션 실행 시간이 짧아진다</ko>\n * @param {Boolean} [interruptable=true] Indicates whether an animation is interruptible.\n * - true: It can be paused or stopped by user action or the API.\n * - false: It cannot be paused or stopped by user action or the API while it is running.\n * <ko>진행 중인 애니메이션 중지 가능 여부.\n * - true: 사용자의 동작이나 API로 애니메이션을 중지할 수 있다.\n * - false: 애니메이션이 진행 중일 때는 사용자의 동작이나 API가 적용되지 않는다</ko>\n * @param {Number} [round=null] Rounding unit. For example, 0.1 rounds to 0.1 decimal point(6.1234 => 6.1), 5 rounds to 5 (93 => 95)\n * [Details](https://github.com/naver/egjs-axes/wiki/round-option)<ko>반올림 단위. 예를 들어 0.1 은 소숫점 0.1 까지 반올림(6.1234 => 6.1), 5 는 5 단위로 반올림(93 => 95).\n * [상세내용](https://github.com/naver/egjs-axes/wiki/round-option)</ko>\n * @param {Boolean} [nested=false] Whether the event propagates to other instances when the coordinates reach the end of the movable area <ko>좌표가 이동 가능한 영역의 끝까지 도달했을 때 다른 인스턴스들로의 이벤트 전파 여부</ko>\n **/\n\n/**\n * A module used to change the information of user action entered by various input devices such as touch screen or mouse into the logical virtual coordinates. You can easily create a UI that responds to user actions.\n * @ko 터치 입력 장치나 마우스와 같은 다양한 입력 장치를 통해 전달 받은 사용자의 동작을 논리적인 가상 좌표로 변경하는 모듈이다. 사용자 동작에 반응하는 UI를 손쉽게 만들수 있다.\n * @extends eg.Component\n *\n * @param {Object.<string, AxisOption>} axis Axis information managed by eg.Axes. The key of the axis specifies the name to use as the logical virtual coordinate system. <ko>eg.Axes가 관리하는 축 정보. 축의 키는 논리적인 가상 좌표계로 사용할 이름을 지정한다.</ko>\n * @param {AxesOption} [options={}] The option object of the eg.Axes module<ko>eg.Axes 모듈의 옵션 객체</ko>\n * @param {Object.<string, number>} [startPos={}] The coordinates to be moved when creating an instance. It is applied with higher priority than startPos of axisOption.<ko>인스턴스 생성시 이동할 좌표, axisOption의 startPos보다 높은 우선순위로 적용된다.</ko>\n *\n * @support {\"ie\": \"10+\", \"ch\" : \"latest\", \"ff\" : \"latest\", \"sf\" : \"latest\", \"edge\" : \"latest\", \"ios\" : \"7+\", \"an\" : \"2.3+ (except 3.x)\"}\n * @example\n * ```js\n * // 1. Initialize eg.Axes\n * const axes = new eg.Axes({\n * something1: {\n * range: [0, 150],\n * bounce: 50\n * },\n * something2: {\n * range: [0, 200],\n * bounce: 100\n * },\n * somethingN: {\n * range: [1, 10],\n * }\n * }, {\n * deceleration : 0.0024\n * });\n *\n * // 2. attach event handler\n * axes.on({\n * \"hold\" : function(evt) {\n * },\n * \"release\" : function(evt) {\n * },\n * \"animationStart\" : function(evt) {\n * },\n * \"animationEnd\" : function(evt) {\n * },\n * \"change\" : function(evt) {\n * }\n * });\n *\n * // 3. Initialize inputTypes\n * const panInputArea = new eg.Axes.PanInput(\"#area\", {\n * scale: [0.5, 1]\n * });\n * const panInputHmove = new eg.Axes.PanInput(\"#hmove\");\n * const panInputVmove = new eg.Axes.PanInput(\"#vmove\");\n * const pinchInputArea = new eg.Axes.PinchInput(\"#area\", {\n * scale: 1.5\n * });\n *\n * // 4. Connect eg.Axes and InputTypes\n * // [PanInput] When the mouse or touchscreen is down and moved.\n * // Connect the 'something2' axis to the mouse or touchscreen x position and\n * // connect the 'somethingN' axis to the mouse or touchscreen y position.\n * axes.connect([\"something2\", \"somethingN\"], panInputArea); // or axes.connect(\"something2 somethingN\", panInputArea);\n *\n * // Connect only one 'something1' axis to the mouse or touchscreen x position.\n * axes.connect([\"something1\"], panInputHmove); // or axes.connect(\"something1\", panInputHmove);\n *\n * // Connect only one 'something2' axis to the mouse or touchscreen y position.\n * axes.connect([\"\", \"something2\"], panInputVmove); // or axes.connect(\" something2\", panInputVmove);\n *\n * // [PinchInput] Connect 'something2' axis when two pointers are moving toward (zoom-in) or away from each other (zoom-out).\n * axes.connect(\"something2\", pinchInputArea);\n * ```\n */\n@ReactiveSubscribe\nclass Axes extends Component<AxesEvents> {\n /**\n * @name VERSION\n * @desc Version info string\n * @ko 버전정보 문자열\n *\n * @constant\n * @type {String}\n * @example\n * ```js\n * eg.Axes.VERSION; // ex) 3.3.3\n * ```\n */\n public static VERSION = \"#__VERSION__#\";\n /* eslint-disable */\n // for tree shaking\n public static PanInput;\n public static PinchInput;\n public static WheelInput;\n public static MoveKeyInput;\n public static RotatePanInput;\n /* eslint-enable */\n\n /**\n * @name TRANSFORM\n * @desc Returns the transform attribute with CSS vendor prefixes.\n * @ko CSS vendor prefixes를 붙인 transform 속성을 반환한다.\n *\n * @constant\n * @type {String}\n * @example\n * ```js\n * eg.Axes.TRANSFORM; // \"transform\" or \"webkitTransform\"\n * ```\n */\n public static TRANSFORM = TRANSFORM;\n /**\n * @name DIRECTION_NONE\n * @constant\n * @type {Number}\n */\n public static DIRECTION_NONE = DIRECTION_NONE;\n /**\n * @name DIRECTION_LEFT\n * @constant\n * @type {Number}\n */\n public static DIRECTION_LEFT = DIRECTION_LEFT;\n /**\n * @name DIRECTION_RIGHT\n * @constant\n * @type {Number}\n */\n public static DIRECTION_RIGHT = DIRECTION_RIGHT;\n /**\n * @name DIRECTION_UP\n * @constant\n * @type {Number}\n */\n public static DIRECTION_UP = DIRECTION_UP;\n /**\n * @name DIRECTION_DOWN\n * @constant\n * @type {Number}\n */\n public static DIRECTION_DOWN = DIRECTION_DOWN;\n /**\n * @name DIRECTION_HORIZONTAL\n * @constant\n * @type {Number}\n */\n public static DIRECTION_HORIZONTAL = DIRECTION_HORIZONTAL;\n /**\n * @name DIRECTION_VERTICAL\n * @constant\n * @type {Number}\n */\n public static DIRECTION_VERTICAL = DIRECTION_VERTICAL;\n /**\n * @name DIRECTION_ALL\n * @constant\n * @type {Number}\n */\n public static DIRECTION_ALL = DIRECTION_ALL;\n\n public options: AxesOption;\n public eventManager: EventManager;\n public axisManager: AxisManager;\n public interruptManager: InterruptManager;\n public animationManager: AnimationManager;\n public inputObserver: InputObserver;\n private _inputs: InputType[] = [];\n\n /**\n *\n */\n public constructor(\n public axis: ObjectInterface<AxisOption> = {},\n options: AxesOption = {},\n startPos: Axis = {}\n ) {\n super();\n this.options = {\n ...{\n easing: (x) => {\n return 1 - Math.pow(1 - x, 3);\n },\n interruptable: true,\n maximumDuration: Infinity,\n minimumDuration: 0,\n deceleration: 0.0006,\n round: null,\n nested: false,\n },\n ...options,\n };\n Object.keys(startPos).forEach((key) => {\n this.axis[key].startPos = startPos[key];\n });\n\n this.interruptManager = new InterruptManager(this.options);\n this.axisManager = new AxisManager(this.axis);\n this.eventManager = new EventManager(this);\n this.animationManager = new EasingManager(this);\n this.inputObserver = new InputObserver(this);\n this.eventManager.setAnimationManager(this.animationManager);\n this.eventManager.triggerChange(this.axisManager.get());\n }\n\n /**\n * Connect the axis of eg.Axes to the inputType.\n * @ko eg.Axes의 축과 inputType을 연결한다\n * @param {(String[]|String)} axes The name of the axis to associate with inputType <ko>inputType과 연결할 축의 이름</ko>\n * @param {Object} inputType The inputType instance to associate with the axis of eg.Axes <ko>eg.Axes의 축과 연결할 inputType 인스턴스</ko>\n * @return {eg.Axes} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>\n * @example\n * ```js\n * const axes = new eg.Axes({\n * \"x\": {\n * range: [0, 100]\n * },\n * \"xOther\": {\n * range: [-100, 100]\n * }\n * });\n *\n * axes.connect(\"x\", new eg.Axes.PanInput(\"#area1\"))\n * .connect(\"x xOther\", new eg.Axes.PanInput(\"#area2\"))\n * .connect(\" xOther\", new eg.Axes.PanInput(\"#area3\"))\n * .connect([\"x\"], new eg.Axes.PanInput(\"#area4\"))\n * .connect([\"xOther\", \"x\"], new eg.Axes.PanInput(\"#area5\"))\n * .connect([\"\", \"xOther\"], new eg.Axes.PanInput(\"#area6\"));\n * ```\n */\n public connect(axes: string[] | string, inputType: InputType) {\n let mapped: string[];\n if (typeof axes === \"string\") {\n mapped = axes.split(\" \");\n } else {\n mapped = axes.concat();\n }\n\n // check same instance\n if (~this._inputs.indexOf(inputType)) {\n this.disconnect(inputType);\n }\n\n inputType.mapAxes(mapped);\n inputType.connect(this.inputObserver);\n this._inputs.push(inputType);\n return this;\n }\n\n /**\n * Disconnect the axis of eg.Axes from the inputType.\n * @ko eg.Axes의 축과 inputType의 연결을 끊는다.\n * @param {Object} [inputType] An inputType instance associated with the axis of eg.Axes <ko>eg.Axes의 축과 연결한 inputType 인스턴스</ko>\n * @return {eg.Axes} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>\n * @example\n * ```js\n * const axes = new eg.Axes({\n * \"x\": {\n * range: [0, 100]\n * },\n * \"xOther\": {\n * range: [-100, 100]\n * }\n * });\n *\n * const input1 = new eg.Axes.PanInput(\"#area1\");\n * const input2 = new eg.Axes.PanInput(\"#area2\");\n * const input3 = new eg.Axes.PanInput(\"#area3\");\n *\n * axes.connect(\"x\", input1);\n * .connect(\"x xOther\", input2)\n * .connect([\"xOther\", \"x\"], input3);\n *\n * axes.disconnect(input1); // disconnects input1\n * axes.disconnect(); // disconnects all of them\n * ```\n */\n public disconnect(inputType?: InputType) {\n if (inputType) {\n const index = this._inputs.indexOf(inputType);\n\n if (index >= 0) {\n this._inputs[index].disconnect();\n this._inputs.splice(index, 1);\n }\n } else {\n this._inputs.forEach((v) => v.disconnect());\n this._inputs = [];\n }\n return this;\n }\n\n /**\n * Returns the current position of the coordinates.\n * @ko 좌표의 현재 위치를 반환한다\n * @param {Object} [axes] The names of the axis <ko>축 이름들</ko>\n * @return {Object.<string, number>} Axis coordinate information <ko>축 좌표 정보</ko>\n * @example\n * ```js\n * const axes = new eg.Axes({\n * \"x\": {\n * range: [0, 100]\n * },\n * \"xOther\": {\n * range: [-100, 100]\n * },\n * \"zoom\": {\n * range: [50, 30]\n * }\n * });\n *\n * axes.get(); // {\"x\": 0, \"xOther\": -100, \"zoom\": 50}\n * axes.get([\"x\", \"zoom\"]); // {\"x\": 0, \"zoom\": 50}\n * ```\n */\n public get(axes?: string[]) {\n return this.axisManager.get(axes);\n }\n\n /**\n * Moves an axis to specific coordinates.\n * @ko 좌표를 이동한다.\n * @param {Object.<string, number>} pos The coordinate to move to <ko>이동할 좌표</ko>\n * @param {Number} [duration=0] Duration of the animation (unit: ms) <ko>애니메이션 진행 시간(단위: ms)</ko>\n * @return {eg.Axes} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>\n * @example\n * ```js\n * const axes = new eg.Axes({\n * \"x\": {\n * range: [0, 100]\n * },\n * \"xOther\": {\n * range: [-100, 100]\n * },\n * \"zoom\": {\n * range: [50, 30]\n * }\n * });\n *\n * axes.setTo({\"x\": 30, \"zoom\": 60});\n * axes.get(); // {\"x\": 30, \"xOther\": -100, \"zoom\": 60}\n *\n * axes.setTo({\"x\": 100, \"xOther\": 60}, 1000); // animatation\n *\n * // after 1000 ms\n * axes.get(); // {\"x\": 100, \"xOther\": 60, \"zoom\": 60}\n * ```\n */\n public setTo(pos: Axis, duration = 0) {\n this.animationManager.setTo(pos, duration);\n return this;\n }\n\n /**\n * Moves an axis from the current coordinates to specific coordinates.\n * @ko 현재 좌표를 기준으로 좌표를 이동한다.\n * @param {Object.<string, number>} pos The coordinate to move to <ko>이동할 좌표</ko>\n * @param {Number} [duration=0] Duration of the animation (unit: ms) <ko>애니메이션 진행 시간(단위: ms)</ko>\n * @return {eg.Axes} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>\n * @example\n * ```js\n * const axes = new eg.Axes({\n * \"x\": {\n * range: [0, 100]\n * },\n * \"xOther\": {\n * range: [-100, 100]\n * },\n * \"zoom\": {\n * range: [50, 30]\n * }\n * });\n *\n * axes.setBy({\"x\": 30, \"zoom\": 10});\n * axes.get(); // {\"x\": 30, \"xOther\": -100, \"zoom\": 60}\n *\n * axes.setBy({\"x\": 70, \"xOther\": 60}, 1000); // animatation\n *\n * // after 1000 ms\n * axes.get(); // {\"x\": 100, \"xOther\": -40, \"zoom\": 60}\n * ```\n */\n public setBy(pos: Axis, duration = 0) {\n this.animationManager.setBy(pos, duration);\n return this;\n }\n\n /**\n * Change the options of Axes instance.\n * @ko 인스턴스의 옵션을 변경한다.\n * @param {AxesOption} options Axes options to change <ko>변경할 옵션 목록</ko>\n * @return {eg.Axes} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>\n * @example\n * ```js\n * const axes = new eg.Axes({\n * \"x\": {\n * range: [0, 100]\n * },\n * }, {\n * round: 10,\n * });\n *\n * axes.setTo({\"x\": 48});\n * axes.get(); // {\"x\": 50}\n *\n * axes.setOptions({\n * round: 1,\n * });\n *\n * axes.setTo({\"x\": 48});\n * axes.get(); // {\"x\": 48}\n * ```\n */\n public setOptions(options: AxesOption) {\n this.options = {\n ...this.options,\n ...options,\n };\n return this;\n }\n\n /**\n * Change the information of an existing axis.\n * @ko 존재하는 축의 정보를 변경한다.\n * @param {Object.<string, AxisOption>} axis Axis options to change <ko>변경할 축의 정보</ko>\n * @return {eg.Axes} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>\n * @example\n * ```js\n * const axes = new eg.Axes({\n * \"x\": {\n * range: [0, 100]\n * },\n * });\n *\n * axes.setTo({\"x\": 150});\n * axes.get(); // {\"x\": 100}\n *\n * axes.setAxis({\n * \"x\": {\n * range: [0, 200]\n * },\n * });\n *\n * axes.setTo({\"x\": 150});\n * axes.get(); // {\"x\": 150}\n * ```\n */\n public setAxis(axis: ObjectInterface<AxisOption>) {\n this.axisManager.setAxis(axis);\n return this;\n }\n\n /**\n * Stop an animation in progress.\n * @ko 재생 중인 애니메이션을 정지한다.\n * @return {eg.Axes} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>\n * @example\n * ```js\n * const axes = new eg.Axes({\n * \"x\": {\n * range: [0, 100]\n * },\n * });\n *\n * axes.setTo({\"x\": 10}, 1000); // start animatation\n *\n * // after 500 ms\n * axes.stopAnimation(); // stop animation during movement.\n * ```\n */\n public stopAnimation() {\n this.animationManager.stopAnimation();\n this.animationManager.finish(false);\n return this;\n }\n\n /**\n * Change the destination of an animation in progress.\n * @ko 재생 중인 애니메이션의 목적지와 진행 시간을 변경한다.\n * @param {UpdateAnimationOption} pos The coordinate to move to <ko>이동할 좌표</ko>\n * @return {eg.Axes} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>\n * @example\n * ```js\n * const axes = new eg.Axes({\n * \"x\": {\n * range: [0, 200]\n * },\n * \"y\": {\n * range: [0, 200]\n * }\n * });\n *\n * axes.setTo({\"x\": 50, \"y\": 50}, 1000); // trigger animation by setTo\n *\n * // after 500 ms\n * axes.updateAnimation({destPos: {\"x\": 100, \"y\": 100}}); // animation will end after 500 ms, at {\"x\": 100, \"y\": 100}\n *\n * // after 500 ms\n * axes.setTo({\"x\": 50, \"y\": 50}, 1000); // trigger animation by setTo\n *\n * // after 700 ms\n * axes.updateAnimation({destPos: {\"x\": 100, \"y\": 100}, duration: 1500, restart: true}); // this works same as axes.setTo({\"x\": 100, \"y\": 100}, 800) since restart is true.\n * ```\n */\n public updateAnimation(options: UpdateAnimationOption) {\n this.animationManager.updateAnimation(options);\n return this;\n }\n\n /**\n * Returns whether there is a coordinate in the bounce area of ​​the target axis.\n * @ko 대상 축 중 bounce영역에 좌표가 존재하는지를 반환한다\n * @param {Object} [axes] The names of the axis <ko>축 이름들</ko>\n * @return {Boolen} Whether the bounce area exists. <ko>bounce 영역 존재 여부</ko>\n * @example\n * ```js\n * const axes = new eg.Axes({\n * \"x\": {\n * range: [0, 100]\n * },\n * \"xOther\": {\n * range: [-100, 100]\n * },\n * \"zoom\": {\n * range: [50, 30]\n * }\n * });\n *\n * axes.isBounceArea([\"x\"]);\n * axes.isBounceArea([\"x\", \"zoom\"]);\n * axes.isBounceArea();\n * ```\n */\n public isBounceArea(axes?: string[]) {\n return this.axisManager.isOutside(axes);\n }\n\n /**\n * Destroys properties, and events used in a module and disconnect all connections to inputTypes.\n * @ko 모듈에 사용한 속성, 이벤트를 해제한다. 모든 inputType과의 연결을 끊는다.\n */\n public destroy() {\n this.disconnect();\n this.eventManager.destroy();\n }\n}\n\ninterface Axes\n extends AxesReactiveState,\n ReactiveSubscribe<AxesReactiveState> {}\n\nexport default Axes;\n","/*\n * Copyright (c) 2015 NAVER Corp.\n * egjs projects are licensed under the MIT license\n */\n/* eslint-disable @typescript-eslint/no-empty-function */\n\nimport {\n $,\n isCssPropsFromAxes,\n setCssProps,\n revertCssProps,\n useDirection,\n getDirection,\n} from \"../utils\";\nimport {\n IS_IOS_SAFARI,\n IOS_EDGE_THRESHOLD,\n DIRECTION_NONE,\n DIRECTION_VERTICAL,\n DIRECTION_HORIZONTAL,\n MOUSE_LEFT,\n ANY,\n} from \"../const\";\nimport { ActiveEvent, ElementType, InputEventType } from \"../types\";\n\nimport {\n convertInputType,\n getAddEventOptions,\n InputType,\n InputTypeObserver,\n toAxis,\n} from \"./InputType\";\n\nexport interface PanInputOption {\n inputType?: string[];\n inputKey?: string[];\n inputButton?: string[];\n scale?: number[];\n thresholdAngle?: number;\n threshold?: number;\n preventClickOnDrag?: boolean;\n iOSEdgeSwipeThreshold?: number;\n releaseOnScroll?: boolean;\n touchAction?: string;\n}\n\n// get user's direction\nexport const getDirectionByAngle = (\n angle: number,\n thresholdAngle: number\n): number => {\n if (thresholdAngle < 0 || thresholdAngle > 90) {\n return DIRECTION_NONE;\n }\n const toAngle = Math.abs(angle);\n\n return toAngle > thresholdAngle && toAngle < 180 - thresholdAngle\n ? DIRECTION_VERTICAL\n : DIRECTION_HORIZONTAL;\n};\n\n/**\n * @typedef {Object} PanInputOption The option object of the eg.Axes.PanInput module.\n * @ko eg.Axes.PanInput 모듈의 옵션 객체\n * @param {String[]} [inputType=[\"touch\", \"mouse\", \"pointer\"]] Types of input devices\n * - touch: Touch screen\n * - mouse: Mouse\n * - pointer: Mouse and touch <ko>입력 장치 종류\n * - touch: 터치 입력 장치\n * - mouse: 마우스\n * - pointer: 마우스 및 터치</ko>\n * @param {String[]} [inputKey=[\"any\"]] List of key combinations to allow input\n * - any: any key\n * - shift: shift key\n * - ctrl: ctrl key and pinch gesture on the trackpad\n * - alt: alt key\n * - meta: meta key\n * - none: none of these keys are pressed <ko>입력을 허용할 키 조합 목록\n * - any: 아무 키\n * - shift: shift 키\n * - ctrl: ctrl 키 및 트랙패드의 pinch 제스쳐\n * - alt: alt 키\n * - meta: meta 키\n * - none: 아무 키도 눌리지 않은 상태 </ko>\n * @param {String[]} [inputButton=[\"left\"]] List of buttons to allow input\n * - left: Left mouse button and normal touch\n * - middle: Mouse wheel press\n * - right: Right mouse button <ko>입력을 허용할 버튼 목록\n * - left: 마우스 왼쪽 버튼\n * - middle: 마우스 휠 눌림\n * - right: 마우스 오른쪽 버튼 </ko>\n * @param {Number[]} [scale] Coordinate scale that a user can move<ko>사용자의 동작으로 이동하는 좌표의 배율</ko>\n * @param {Number} [scale[0]=1] horizontal axis scale <ko>수평축 배율</ko>\n * @param {Number} [scale[1]=1] vertical axis scale <ko>수직축 배율</ko>\n * @param {Number} [thresholdAngle=45] The threshold value that determines whether user action is horizontal or vertical (0~90) <ko>사용자의 동작이 가로 방향인지 세로 방향인지 판단하는 기준 각도(0~90)</ko>\n * @param {Number} [threshold=0] Minimal pan distance required before recognizing <ko>사용자의 Pan 동작을 인식하기 위해산 최소한의 거리</ko>\n * @param {Boolean} [preventClickOnDrag=false] Whether to cancel the {@link https://developer.mozilla.org/en/docs/Web/API/Element/click_event click} event when the user finishes dragging more than 1 pixel <ko>사용자가 1픽셀 이상 드래그를 마쳤을 때 {@link https://developer.mozilla.org/ko/docs/Web/API/Element/click_event click} 이벤트 취소 여부</ko>\n * @param {Number} [iOSEdgeSwipeThreshold=30] Area (px) that can go to the next page when swiping the right edge in iOS safari <ko>iOS Safari에서 오른쪽 엣지를 스와이프 하는 경우 다음 페이지로 넘어갈 수 있는 영역(px)</ko>\n * @param {String} [touchAction=null] Value that overrides the element's \"touch-action\" css property. If set to null, it is automatically set to prevent scrolling in the direction of the connected axis. <ko>엘리먼트의 \"touch-action\" CSS 속성을 덮어쓰는 값. 만약 null로 설정된 경우, 연결된 축 방향으로의 스크롤을 방지하게끔 자동으로 설정된다.</ko>\n **/\n/**\n * A module that passes the amount of change to eg.Axes when the mouse or touchscreen is down and moved. use less than two axes.\n * @ko 마우스나 터치 스크린을 누르고 움직일때의 변화량을 eg.Axes에 전달하는 모듈. 두개 이하의 축을 사용한다.\n *\n * @example\n * ```js\n * const pan = new eg.Axes.PanInput(\"#area\", {\n * inputType: [\"touch\"],\n * scale: [1, 1.3],\n * });\n *\n * // Connect the 'something2' axis to the mouse or touchscreen x position when the mouse or touchscreen is down and moved.\n * // Connect the 'somethingN' axis to the mouse or touchscreen y position when the mouse or touchscreen is down and moved.\n * axes.connect([\"something2\", \"somethingN\"], pan); // or axes.connect(\"something2 somethingN\", pan);\n *\n * // Connect only one 'something1' axis to the mouse or touchscreen x position when the mouse or touchscreen is down and moved.\n * axes.connect([\"something1\"], pan); // or axes.connect(\"something1\", pan);\n *\n * // Connect only one 'something2' axis to the mouse or touchscreen y position when the mouse or touchscreen is down and moved.\n * axes.connect([\"\", \"something2\"], pan); // or axes.connect(\" something2\", pan);\n * ```\n * @param {String|HTMLElement|Ref<HTMLElement>|jQuery} element An element to use the eg.Axes.PanInput module <ko>eg.Axes.PanInput 모듈을 사용할 엘리먼트</ko>\n * @param {PanInputOption} [options={}] The option object of the eg.Axes.PanInput module<ko>eg.Axes.PanInput 모듈의 옵션 객체</ko>\n */\nexport class PanInput implements InputType {\n public options: PanInputOption;\n public axes: string[] = [];\n public element: HTMLElement = null;\n protected _observer: InputTypeObserver;\n protected _direction: number;\n protected _enabled = false;\n protected _activeEvent: ActiveEvent = null;\n private _originalCssProps: { [key: string]: string };\n private _atRightEdge = false;\n private _rightEdgeTimer = 0;\n private _dragged = false;\n private _isOverThreshold = false;\n\n /**\n *\n */\n public constructor(el: ElementType, options?: PanInputOption) {\n this.element = $(el);\n this.options = {\n inputType: [\"touch\", \"mouse\", \"pointer\"],\n inputKey: [ANY],\n inputButton: [MOUSE_LEFT],\n scale: [1, 1],\n thresholdAngle: 45,\n threshold: 0,\n preventClickOnDrag: false,\n iOSEdgeSwipeThreshold: IOS_EDGE_THRESHOLD,\n releaseOnScroll: false,\n touchAction: null,\n ...options,\n };\n this._onPanstart = this._onPanstart.bind(this);\n this._onPanmove = this._onPanmove.bind(this);\n this._onPanend = this._onPanend.bind(this);\n }\n\n public mapAxes(axes: string[]) {\n this._direction = getDirection(!!axes[0], !!axes[1]);\n this.axes = axes;\n }\n\n public connect(observer: InputTypeObserver): InputType {\n if (this._activeEvent) {\n this._detachElementEvent();\n this._detachWindowEvent(this._activeEvent);\n }\n this._attachElementEvent(observer);\n this._originalCssProps = setCssProps(\n this.element,\n this.options,\n this._direction\n );\n return this;\n }\n\n public disconnect() {\n this._detachElementEvent();\n this._detachWindowEvent(this._activeEvent);\n if (!isCssPropsFromAxes(this._originalCssProps)) {\n revertCssProps(this.element, this._originalCssProps);\n }\n this._direction = DIRECTION_NONE;\n return this;\n }\n\n /**\n * Destroys elements, properties, and events used in a module.\n * @ko 모듈에 사용한 엘리먼트와 속성, 이벤트를 해제한다.\n */\n public destroy() {\n this.disconnect();\n this.element = null;\n }\n\n /**\n * Enables input devices\n * @ko 입력 장치를 사용할 수 있게 한다\n * @return {PanInput} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>\n */\n public enable() {\n this._enabled = true;\n return this;\n }\n\n /**\n * Disables input devices\n * @ko 입력 장치를 사용할 수 없게 한다.\n * @return {PanInput} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>\n */\n public disable() {\n this._enabled = false;\n return this;\n }\n\n /**\n * Returns whether to use an input device\n * @ko 입력 장치 사용 여부를 반환한다.\n * @return {Boolean} Whether to use an input device <ko>입력장치 사용여부</ko>\n */\n public isEnabled() {\n return this._enabled;\n }\n\n /**\n * Releases current user input.\n * @ko 사용자의 입력을 강제로 중단시킨다.\n * @return {PanInput} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>\n */\n public release() {\n const activeEvent = this._activeEvent;\n const prevEvent = activeEvent.prevEvent;\n activeEvent.onRelease();\n this._observer.release(this, prevEvent, [0, 0]);\n this._detachWindowEvent(activeEvent);\n return this;\n }\n\n protected _onPanstart(event: InputEventType) {\n const { inputKey, inputButton } = this.options;\n const activeEvent = this._activeEvent;\n const panEvent = activeEvent.onEventStart(event, inputKey, inputButton);\n if (\n !panEvent ||\n !this._enabled ||\n activeEvent.getTouches(event, inputButton) > 1\n ) {\n return;\n }\n if (panEvent.srcEvent.cancelable !== false) {\n const edgeThreshold = this.options.iOSEdgeSwipeThreshold;\n\n this._dragged = false;\n this._isOverThreshold = false;\n this._observer.hold(this, panEvent);\n this._atRightEdge =\n IS_IOS_SAFARI && panEvent.center.x > window.innerWidth - edgeThreshold;\n this._attachWindowEvent(activeEvent);\n activeEvent.prevEvent = panEvent;\n }\n }\n\n protected _onPanmove(event: InputEventType) {\n const {\n iOSEdgeSwipeThreshold,\n preventClickOnDrag,\n releaseOnScroll,\n inputKey,\n inputButton,\n threshold,\n thresholdAngle,\n } = this.options;\n const activeEvent = this._activeEvent;\n const panEvent = activeEvent.onEventMove(event, inputKey, inputButton);\n const touches = activeEvent.getTouches(event, inputButton);\n\n if (\n touches === 0 ||\n (releaseOnScroll && panEvent && !panEvent.srcEvent.cancelable)\n ) {\n this._onPanend(event);\n return;\n }\n\n if (!panEvent || !this._enabled || touches > 1) {\n return;\n }\n\n const userDirection = getDirectionByAngle(panEvent.angle, thresholdAngle);\n const useHorizontal = useDirection(\n DIRECTION_HORIZONTAL,\n this._direction,\n userDirection\n );\n const useVertical = useDirection(\n DIRECTION_VERTICAL,\n this._direction,\n userDirection\n );\n\n if (activeEvent.prevEvent && IS_IOS_SAFARI) {\n const swipeLeftToRight = panEvent.center.x < 0;\n\n if (swipeLeftToRight) {\n // iOS swipe left => right\n this.release();\n return;\n } else if (this._atRightEdge) {\n clearTimeout(this._rightEdgeTimer);\n\n // - is right to left\n const swipeRightToLeft = panEvent.deltaX < -iOSEdgeSwipeThreshold;\n\n if (swipeRightToLeft) {\n this._atRightEdge = false;\n } else {\n // iOS swipe right => left\n this._rightEdgeTimer = window.setTimeout(() => this.release(), 100);\n }\n }\n }\n const distance = this._getDistance(\n [panEvent.deltaX, panEvent.deltaY],\n [useHorizontal, useVertical]\n );\n const offset = this._getOffset(\n [panEvent.offsetX, panEvent.offsetY],\n [useHorizontal, useVertical]\n );\n const prevent = offset.some((v) => v !== 0);\n\n if (prevent) {\n if (panEvent.srcEvent.cancelable !== false) {\n panEvent.srcEvent.preventDefault();\n }\n panEvent.srcEvent.stopPropagation();\n }\n panEvent.preventSystemEvent = prevent;\n if (prevent && (this._isOverThreshold || distance >= threshold)) {\n this._dragged = preventClickOnDrag;\n this._isOverThreshold = true;\n this._observer.change(this, panEvent, toAxis(this.axes, offset));\n }\n activeEvent.prevEvent = panEvent;\n }\n\n protected _onPanend(event: InputEventType) {\n const inputButton = this.options.inputButton;\n const activeEvent = this._activeEvent;\n activeEvent.onEventEnd(event);\n if (!this._enabled || activeEvent.getTouches(event, inputButton) !== 0) {\n return;\n }\n this._detachWindowEvent(activeEvent);\n clearTimeout(this._rightEdgeTimer);\n const prevEvent = activeEvent.prevEvent;\n const velocity = this._isOverThreshold ? this._getOffset(\n [\n Math.abs(prevEvent.velocityX) * (prevEvent.offsetX < 0 ? -1 : 1),\n Math.abs(prevEvent.velocityY) * (prevEvent.offsetY < 0 ? -1 : 1),\n ],\n [\n useDirection(DIRECTION_HORIZONTAL, this._direction),\n useDirection(DIRECTION_VERTICAL, this._direction),\n ]\n ) : [0, 0];\n activeEvent.onRelease();\n this._observer.release(this, prevEvent, velocity);\n }\n\n protected _attachWindowEvent(activeEvent: ActiveEvent) {\n activeEvent?.move.forEach((event) => {\n window.addEventListener(event, this._onPanmove, getAddEventOptions(event));\n });\n activeEvent?.end.forEach((event) => {\n window.addEventListener(event, this._onPanend, getAddEventOptions(event));\n });\n }\n\n protected _detachWindowEvent(activeEvent: ActiveEvent) {\n activeEvent?.move.forEach((event) => {\n window.removeEventListener(event, this._onPanmove);\n });\n activeEvent?.end.forEach((event) => {\n window.removeEventListener(event, this._onPanend);\n });\n }\n\n protected _getOffset(properties: number[], direction: boolean[]): number[] {\n const scale = this.options.scale;\n return [\n direction[0] ? properties[0] * scale[0] : 0,\n direction[1] ? properties[1] * scale[1] : 0,\n ];\n }\n\n private _getDistance(delta: number[], direction: boolean[]): number {\n return Math.sqrt(\n Number(direction[0]) * Math.pow(delta[0], 2) +\n Number(direction[1]) * Math.pow(delta[1], 2)\n );\n }\n\n private _attachElementEvent(observer: InputTypeObserver) {\n const activeEvent = convertInputType(this.options.inputType);\n const element = this.element;\n if (!activeEvent) {\n return;\n }\n if (!element) {\n throw new Error(\"Element to connect input does not exist.\");\n }\n this._observer = observer;\n this._enabled = true;\n this._activeEvent = activeEvent;\n element.addEventListener(\"click\", this._preventClickWhenDragged, true);\n activeEvent.start.forEach((event) => {\n element.addEventListener(event, this._onPanstart);\n });\n // adding event listener to element prevents invalid behavior in iOS Safari\n activeEvent.move.forEach((event) => {\n element.addEventListener(event, this._voidFunction);\n });\n }\n\n private _detachElementEvent() {\n const activeEvent = this._activeEvent;\n const element = this.element;\n if (element) {\n element.removeEventListener(\"click\", this._preventClickWhenDragged, true);\n activeEvent?.start.forEach((event) => {\n element.removeEventListener(event, this._onPanstart);\n });\n activeEvent?.move.forEach((event) => {\n element.removeEventListener(event, this._voidFunction);\n });\n }\n this._enabled = false;\n this._observer = null;\n }\n\n private _preventClickWhenDragged = (e: PointerEvent | MouseEvent) => {\n if (this._dragged) {\n e.preventDefault();\n e.stopPropagation();\n }\n this._dragged = false;\n };\n\n private _voidFunction = () => {};\n}\n","/*\n * Copyright (c) 2015 NAVER Corp.\n * egjs projects are licensed under the MIT license\n */\nimport Axes from \"../Axes\";\nimport { ElementType, ExtendedEvent } from \"../types\";\nimport { getAngle } from \"../utils\";\n\nimport { toAxis } from \"./InputType\";\nimport { PanInput, PanInputOption } from \"./PanInput\";\n\n/**\n * A module that passes the angle moved by touch to Axes and uses one axis of rotation.\n * [Details](https://github.com/naver/egjs-axes/wiki/RotatePanInput)\n * @ko 터치에 의해 움직인 각도를 Axes 에 전달하며 1개의 회전축만 사용한다.\n * [상세내용](https://github.com/naver/egjs-axes/wiki/RotatePanInput-%7C-%ED%95%9C%EA%B5%AD%EC%96%B4)\n *\n * @example\n * ```js\n * const input = new eg.Axes.RotatePanInput(\"#area\");\n *\n * var axes = new eg.Axes({\n *\t// property name('angle') could be anything you want (eg. x, y, z...)\n * \tangle: {\n * \t\trange: [-180, 180] // from -180deg to 180deg\n * \t}\n * });\n *\n * axes.connect(\"angle\", input)\n * ```\n * @param {HTMLElement|String|jQuery} element An element to use the eg.Axes.RotatePanInput module <ko>eg.Axes.RotatePanInput 모듈을 사용할 엘리먼트</ko>\n * @param {PanInputOption} [options] The option object of the eg.Axes.PanInput module<ko>eg.Axes.PanInput 모듈의 옵션 객체</ko>\n * @extends PanInput\n */\nexport class RotatePanInput extends PanInput {\n private _rotateOrigin: number[];\n private _prevAngle: number;\n private _prevQuadrant: number = null;\n private _lastDiff = 0;\n private _coefficientForDistanceToAngle: number;\n\n /**\n *\n */\n public constructor(el: ElementType, options?: PanInputOption) {\n super(el, options);\n }\n\n public mapAxes(axes: string[]) {\n this._direction = Axes.DIRECTION_ALL;\n this.axes = axes;\n }\n\n protected _onPanstart(event: MouseEvent) {\n const { inputKey, inputButton } = this.options;\n const activeEvent = this._activeEvent;\n const panEvent = activeEvent.onEventStart(event, inputKey, inputButton);\n if (!panEvent || !this.isEnabled()) {\n return;\n }\n\n const rect = this.element.getBoundingClientRect();\n\n this._observer.hold(this, panEvent);\n this._attachWindowEvent(activeEvent);\n // TODO: how to do if element is ellipse not circle.\n this._coefficientForDistanceToAngle = 360 / (rect.width * Math.PI); // from 2*pi*r * x / 360\n // TODO: provide a way to set origin like https://developer.mozilla.org/en-US/docs/Web/CSS/transform-origin\n this._rotateOrigin = [\n rect.left + (rect.width - 1) / 2,\n rect.top + (rect.height - 1) / 2,\n ];\n\n // init angle.\n this._prevAngle = null;\n\n this._triggerChange(panEvent);\n activeEvent.prevEvent = panEvent;\n }\n\n protected _onPanmove(event: MouseEvent) {\n const { inputKey, inputButton } = this.options;\n const activeEvent = this._activeEvent;\n const panEvent = activeEvent.onEventMove(event, inputKey, inputButton);\n if (!panEvent || !this.isEnabled()) {\n return;\n }\n\n if (panEvent.srcEvent.cancelable !== false) {\n panEvent.srcEvent.preventDefault();\n }\n panEvent.srcEvent.stopPropagation();\n this._triggerChange(panEvent);\n activeEvent.prevEvent = panEvent;\n }\n\n protected _onPanend(event: MouseEvent) {\n const activeEvent = this._activeEvent;\n activeEvent.onEventEnd(event);\n if (!this.isEnabled()) {\n return;\n }\n const prevEvent = activeEvent.prevEvent;\n this._triggerChange(prevEvent);\n const vx = prevEvent.velocityX;\n const vy = prevEvent.velocityY;\n const velocity =\n Math.sqrt(vx * vx + vy * vy) * (this._lastDiff > 0 ? -1 : 1); // clockwise\n activeEvent.onRelease();\n this._observer.release(this, prevEvent, [\n velocity * this._coefficientForDistanceToAngle,\n ]);\n this._detachWindowEvent(activeEvent);\n }\n\n private _triggerChange(event: ExtendedEvent) {\n const { x, y } = this._getPosFromOrigin(event.center.x, event.center.y);\n const angle = getAngle(x, y);\n const positiveAngle = angle < 0 ? 360 + angle : angle;\n const quadrant = this._getQuadrant(event.center.x, event.center.y);\n const diff = this._getDifference(\n this._prevAngle,\n positiveAngle,\n this._prevQuadrant,\n quadrant\n );\n\n this._prevAngle = positiveAngle;\n this._prevQuadrant = quadrant;\n\n if (diff === 0) {\n return;\n }\n\n this._lastDiff = diff;\n this._observer.change(this, event, toAxis(this.axes, [-diff])); // minus for clockwise\n }\n\n private _getDifference(\n prevAngle: number,\n angle: number,\n prevQuadrant: number,\n quadrant: number\n ) {\n let diff: number;\n\n if (prevAngle === null) {\n diff = 0;\n } else if (prevQuadrant === 1 && quadrant === 4) {\n diff = -prevAngle - (360 - angle);\n } else if (prevQuadrant === 4 && quadrant === 1) {\n diff = 360 - prevAngle + angle;\n } else {\n diff = angle - prevAngle;\n }\n\n return diff;\n }\n\n private _getPosFromOrigin(posX: number, posY: number) {\n return {\n x: posX - this._rotateOrigin[0],\n y: this._rotateOrigin[1] - posY,\n };\n }\n\n private _getQuadrant(posX: number, posY: number) {\n /**\n * Quadrant\n * y(+)\n * |\n * 2 | 1\n * --------------->x(+)\n * 3 | 4\n * |\n */\n const { x, y } = this._getPosFromOrigin(posX, posY);\n let q = 0;\n\n if (x >= 0 && y >= 0) {\n q = 1;\n } else if (x < 0 && y >= 0) {\n q = 2;\n } else if (x < 0 && y < 0) {\n q = 3;\n } else if (x >= 0 && y < 0) {\n q = 4;\n }\n return q;\n }\n}\n","/*\n * Copyright (c) 2015 NAVER Corp.\n * egjs projects are licensed under the MIT license\n */\nimport { $, isCssPropsFromAxes, setCssProps, revertCssProps } from \"../utils\";\nimport { ActiveEvent, ElementType, InputEventType } from \"../types\";\nimport { DIRECTION_ALL } from \"../const\";\n\nimport {\n toAxis,\n convertInputType,\n InputType,\n InputTypeObserver,\n} from \"./InputType\";\n\nexport interface PinchInputOption {\n scale?: number;\n threshold?: number;\n inputType?: string[];\n touchAction?: string;\n}\n\n/**\n * @typedef {Object} PinchInputOption The option object of the eg.Axes.PinchInput module\n * @ko eg.Axes.PinchInput 모듈의 옵션 객체\n * @param {Number} [scale=1] Coordinate scale that a user can move<ko>사용자의 동작으로 이동하는 좌표의 배율</ko>\n * @param {Number} [threshold=0] Minimal scale before recognizing <ko>사용자의 Pinch 동작을 인식하기 위해산 최소한의 배율</ko>\n * @param {String[]} [inputType=[\"touch\", \"pointer\"]] Types of input devices\n * - touch: Touch screen\n * - pointer: Mouse and touch <ko>입력 장치 종류\n * - touch: 터치 입력 장치\n * - pointer: 마우스 및 터치</ko>\n * @param {String} [touchAction=\"none\"] Value that overrides the element's \"touch-action\" css property. It is set to \"none\" to prevent scrolling during touch. <ko>엘리먼트의 \"touch-action\" CSS 속성을 덮어쓰는 값. 터치 도중 스크롤을 방지하기 위해 \"none\" 으로 설정되어 있다.</ko>\n **/\n\n/**\n * A module that passes the amount of change to eg.Axes when two pointers are moving toward (zoom-in) or away from each other (zoom-out). use one axis.\n * @ko 2개의 pointer를 이용하여 zoom-in하거나 zoom-out 하는 동작의 변화량을 eg.Axes에 전달하는 모듈. 한 개 의 축을 사용한다.\n * @example\n * ```js\n * const pinch = new eg.Axes.PinchInput(\"#area\", {\n * scale: 1\n * });\n *\n * // Connect 'something' axis when two pointers are moving toward (zoom-in) or away from each other (zoom-out).\n * axes.connect(\"something\", pinch);\n * ```\n * @param {HTMLElement|String|jQuery} element An element to use the eg.Axes.PinchInput module <ko>eg.Axes.PinchInput 모듈을 사용할 엘리먼트</ko>\n * @param {PinchInputOption} [options] The option object of the eg.Axes.PinchInput module<ko>eg.Axes.PinchInput 모듈의 옵션 객체</ko>\n */\nexport class PinchInput implements InputType {\n public options: PinchInputOption;\n public axes: string[] = [];\n public element: HTMLElement = null;\n private _observer: InputTypeObserver;\n private _pinchFlag = false;\n private _enabled = false;\n private _originalCssProps: { [key: string]: string };\n private _activeEvent: ActiveEvent = null;\n private _baseValue: number;\n private _isOverThreshold = false;\n\n /**\n *\n */\n public constructor(el: ElementType, options?: PinchInputOption) {\n this.element = $(el);\n this.options = {\n scale: 1,\n threshold: 0,\n inputType: [\"touch\", \"pointer\"],\n touchAction: \"none\",\n ...options,\n };\n this._onPinchStart = this._onPinchStart.bind(this);\n this._onPinchMove = this._onPinchMove.bind(this);\n this._onPinchEnd = this._onPinchEnd.bind(this);\n }\n\n public mapAxes(axes: string[]) {\n this.axes = axes;\n }\n\n public connect(observer: InputTypeObserver): InputType {\n if (this._activeEvent) {\n this._detachEvent();\n }\n this._attachEvent(observer);\n this._originalCssProps = setCssProps(\n this.element,\n this.options,\n DIRECTION_ALL\n );\n return this;\n }\n\n public disconnect() {\n this._detachEvent();\n if (!isCssPropsFromAxes(this._originalCssProps)) {\n revertCssProps(this.element, this._originalCssProps);\n }\n return this;\n }\n\n /**\n * Destroys elements, properties, and events used in a module.\n * @ko 모듈에 사용한 엘리먼트와 속성, 이벤트를 해제한다.\n */\n public destroy() {\n this.disconnect();\n this.element = null;\n }\n\n /**\n * Enables input devices\n * @ko 입력 장치를 사용할 수 있게 한다\n * @return {PinchInput} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>\n */\n public enable() {\n this._enabled = true;\n return this;\n }\n\n /**\n * Disables input devices\n * @ko 입력 장치를 사용할 수 없게 한다.\n * @return {PinchInput} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>\n */\n public disable() {\n this._enabled = false;\n return this;\n }\n\n /**\n * Returns whether to use an input device\n * @ko 입력 장치를 사용 여부를 반환한다.\n * @return {Boolean} Whether to use an input device <ko>입력장치 사용여부</ko>\n */\n public isEnabled() {\n return this._enabled;\n }\n\n private _onPinchStart(event: InputEventType) {\n const activeEvent = this._activeEvent;\n const pinchEvent = activeEvent.onEventStart(event);\n if (!pinchEvent || !this._enabled || activeEvent.getTouches(event) !== 2) {\n return;\n }\n\n this._baseValue = this._observer.get(this)[this.axes[0]];\n this._observer.hold(this, event);\n this._pinchFlag = true;\n this._isOverThreshold = false;\n activeEvent.prevEvent = pinchEvent;\n }\n\n private _onPinchMove(event: InputEventType) {\n const threshold = this.options.threshold;\n const activeEvent = this._activeEvent;\n const pinchEvent = activeEvent.onEventMove(event);\n if (\n !pinchEvent ||\n !this._pinchFlag ||\n !this._enabled ||\n activeEvent.getTouches(event) !== 2\n ) {\n return;\n }\n\n const distance = this._getDistance(pinchEvent.scale);\n const offset = this._getOffset(\n pinchEvent.scale,\n activeEvent.prevEvent.scale\n );\n\n if (this._isOverThreshold || distance >= threshold) {\n this._isOverThreshold = true;\n this._observer.change(this, event, toAxis(this.axes, [offset]));\n }\n activeEvent.prevEvent = pinchEvent;\n }\n\n private _onPinchEnd(event: InputEventType) {\n const activeEvent = this._activeEvent;\n activeEvent.onEventEnd(event);\n if (\n !this._pinchFlag ||\n !this._enabled ||\n activeEvent.getTouches(event) >= 2\n ) {\n return;\n }\n\n activeEvent.onRelease();\n this._observer.release(this, event, [0], 0);\n this._baseValue = null;\n this._pinchFlag = false;\n }\n\n private _attachEvent(observer: InputTypeObserver) {\n const activeEvent = convertInputType(this.options.inputType);\n const element = this.element;\n if (!activeEvent) {\n return;\n }\n if (!element) {\n throw new Error(\"Element to connect input does not exist.\");\n }\n this._observer = observer;\n this._enabled = true;\n this._activeEvent = activeEvent;\n activeEvent.start.forEach((event) => {\n element.addEventListener(event, this._onPinchStart, false);\n });\n activeEvent.move.forEach((event) => {\n element.addEventListener(event, this._onPinchMove, false);\n });\n activeEvent.end.forEach((event) => {\n element.addEventListener(event, this._onPinchEnd, false);\n });\n }\n\n private _detachEvent() {\n const activeEvent = this._activeEvent;\n const element = this.element;\n if (element) {\n activeEvent?.start.forEach((event) => {\n element.removeEventListener(event, this._onPinchStart, false);\n });\n activeEvent?.move.forEach((event) => {\n element.removeEventListener(event, this._onPinchMove, false);\n });\n activeEvent?.end.forEach((event) => {\n element.removeEventListener(event, this._onPinchEnd, false);\n });\n }\n this._enabled = false;\n this._observer = null;\n }\n\n private _getOffset(pinchScale: number, prev: number = 1): number {\n return this._baseValue * (pinchScale - prev) * this.options.scale;\n }\n\n private _getDistance(pinchScale: number): number {\n return Math.abs(pinchScale - 1);\n }\n}\n","/*\n * Copyright (c) 2015 NAVER Corp.\n * egjs projects are licensed under the MIT license\n */\nimport { $, getDirection, useDirection } from \"../utils\";\nimport { ANY, DIRECTION_HORIZONTAL, DIRECTION_VERTICAL } from \"../const\";\nimport { ElementType } from \"../types\";\n\nimport { toAxis, InputType, InputTypeObserver } from \"./InputType\";\nimport { isValidKey } from \"../eventInput/EventInput\";\n\nexport interface WheelInputOption {\n inputKey?: string[];\n scale?: number;\n releaseDelay?: number;\n useNormalized?: boolean;\n useAnimation?: boolean;\n}\n\n/**\n * @typedef {Object} WheelInputOption The option object of the eg.Axes.WheelInput module\n * @ko eg.Axes.WheelInput 모듈의 옵션 객체\n * @param {String[]} [inputKey=[\"any\"]] List of key combinations to allow input\n * - any: any key\n * - shift: shift key\n * - ctrl: ctrl key and pinch gesture on the trackpad\n * - alt: alt key\n * - meta: meta key\n * - none: none of these keys are pressed <ko>입력을 허용할 키 조합 목록\n * - any: 아무 키\n * - shift: shift 키\n * - ctrl: ctrl 키 및 트랙패드의 pinch 제스쳐\n * - alt: alt 키\n * - meta: meta 키\n * - none: 아무 키도 눌리지 않은 상태 </ko>\n * @param {Number} [scale=1] Coordinate scale that a user can move<ko>사용자의 동작으로 이동하는 좌표의 배율</ko>\n * @param {Number} [releaseDelay=300] Millisecond that trigger release event after last input<ko>마지막 입력 이후 release 이벤트가 트리거되기까지의 밀리초</ko>\n * @param {Boolean} [useNormalized=true] Whether to calculate scroll speed the same in all browsers<ko>모든 브라우저에서 스크롤 속도를 동일하게 처리할지 여부</ko>\n * @param {Boolean} [useAnimation=false] Whether to process coordinate changes through the mouse wheel as a continuous animation<ko>마우스 휠을 통한 좌표 변화를 연속적인 애니메이션으로 처리할지 여부</ko>\n **/\n\n/**\n * A module that passes the amount of change to eg.Axes when the mouse wheel is moved. use one axis.\n * @ko 마우스 휠이 움직일때의 변화량을 eg.Axes에 전달하는 모듈. 두개 이하의 축을 사용한다.\n *\n * @example\n * ```js\n * const wheel = new eg.Axes.WheelInput(\"#area\", {\n * scale: 1\n * });\n *\n * // Connect only one 'something1' axis to the vertical mouse wheel.\n * axes.connect([\"something1\"], wheel); // or axes.connect(\"something1\", wheel);\n *\n * // Connect only one 'something2' axis to the horizontal mouse wheel.\n * axes.connect([\"\", \"something2\"], wheel); // or axes.connect(\" something2\", pan);\n *\n * // Connect the 'something1' axis to the vertical mouse wheel.\n * // Connect the 'something2' axis to the horizontal mouse wheel.\n * axes.connect([\"something1\", \"something2\"], wheel);\n * ```\n * @param {HTMLElement|String|jQuery} element An element to use the eg.Axes.WheelInput module <ko>eg.Axes.WheelInput 모듈을 사용할 엘리먼트</ko>\n * @param {WheelInputOption} [options] The option object of the eg.Axes.WheelInput module<ko>eg.Axes.WheelInput 모듈의 옵션 객체</ko>\n */\nexport class WheelInput implements InputType {\n public options: WheelInputOption;\n public axes: string[] = [];\n public element: HTMLElement = null;\n private _observer: InputTypeObserver;\n private _direction: number;\n private _enabled = false;\n private _holding = false;\n private _timer: NodeJS.Timeout = null;\n\n /**\n *\n */\n public constructor(el: ElementType, options?: WheelInputOption) {\n this.element = $(el);\n this.options = {\n inputKey: [ANY],\n scale: 1,\n releaseDelay: 300,\n useNormalized: true,\n useAnimation: false,\n ...options,\n };\n this._onWheel = this._onWheel.bind(this);\n }\n\n public mapAxes(axes: string[]) {\n // vertical mouse wheel is mapped into axes[0]\n this._direction = getDirection(!!axes[1], !!axes[0]);\n this.axes = axes;\n }\n\n public connect(observer: InputTypeObserver): InputType {\n this._detachEvent();\n this._attachEvent(observer);\n return this;\n }\n\n public disconnect() {\n this._detachEvent();\n return this;\n }\n\n /**\n * Destroys elements, properties, and events used in a module.\n * @ko 모듈에 사용한 엘리먼트와 속성, 이벤트를 해제한다.\n */\n public destroy() {\n this.disconnect();\n this.element = null;\n }\n\n /**\n * Enables input devices\n * @ko 입력 장치를 사용할 수 있게 한다\n * @return {WheelInput} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>\n */\n public enable() {\n this._enabled = true;\n return this;\n }\n\n /**\n * Disables input devices\n * @ko 입력 장치를 사용할 수 없게 한다.\n * @return {WheelInput} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>\n */\n public disable() {\n this._enabled = false;\n return this;\n }\n\n /**\n * Returns whether to use an input device\n * @ko 입력 장치를 사용 여부를 반환한다.\n * @return {Boolean} Whether to use an input device <ko>입력장치 사용여부</ko>\n */\n public isEnabled() {\n return this._enabled;\n }\n\n private _onWheel(event: WheelEvent) {\n if (!this._enabled || !isValidKey(event, this.options.inputKey)) {\n return;\n }\n\n const offset = this._getOffset(\n [event.deltaY, event.deltaX],\n [\n useDirection(DIRECTION_VERTICAL, this._direction),\n useDirection(DIRECTION_HORIZONTAL, this._direction),\n ]\n );\n\n if (offset[0] === 0 && offset[1] === 0) {\n return;\n }\n event.preventDefault();\n\n if (!this._holding) {\n this._observer.hold(this, event);\n this._holding = true;\n }\n\n this._observer.change(\n this,\n event,\n toAxis(this.axes, offset),\n this.options.useAnimation\n );\n clearTimeout(this._timer);\n\n this._timer = setTimeout(() => {\n if (this._holding) {\n this._holding = false;\n this._observer.release(this, event, [0]);\n }\n }, this.options.releaseDelay);\n }\n\n private _getOffset(properties: number[], direction: boolean[]): number[] {\n const scale = this.options.scale;\n const useNormalized = this.options.useNormalized;\n return [\n direction[0] && properties[0]\n ? (properties[0] > 0 ? -1 : 1) *\n (useNormalized ? 1 : Math.abs(properties[0])) *\n scale\n : 0,\n direction[1] && properties[1]\n ? (properties[1] > 0 ? -1 : 1) *\n (useNormalized ? 1 : Math.abs(properties[1])) *\n scale\n : 0,\n ];\n }\n\n private _attachEvent(observer: InputTypeObserver) {\n const element = this.element;\n if (!element) {\n throw new Error(\"Element to connect input does not exist.\");\n }\n this._observer = observer;\n element.addEventListener(\"wheel\", this._onWheel);\n this._enabled = true;\n }\n\n private _detachEvent() {\n const element = this.element;\n if (element) {\n this.element.removeEventListener(\"wheel\", this._onWheel);\n }\n this._enabled = false;\n this._observer = null;\n\n if (this._timer) {\n clearTimeout(this._timer);\n this._timer = null;\n }\n }\n}\n","/*\n * Copyright (c) 2015 NAVER Corp.\n * egjs projects are licensed under the MIT license\n */\nimport { ElementType } from \"../types\";\nimport { $ } from \"../utils\";\n\nimport { toAxis, InputType, InputTypeObserver } from \"./InputType\";\n\nexport const KEY_LEFT_ARROW = 37;\nexport const KEY_A = 65;\nexport const KEY_UP_ARROW = 38;\nexport const KEY_W = 87;\nexport const KEY_RIGHT_ARROW = 39;\nexport const KEY_D = 68;\nexport const KEY_DOWN_ARROW = 40;\nexport const KEY_S = 83;\n\n/* eslint-disable */\nconst DIRECTION_REVERSE = -1;\nconst DIRECTION_FORWARD = 1;\nconst DIRECTION_HORIZONTAL = -1;\nconst DIRECTION_VERTICAL = 1;\nconst DELAY = 80;\n/* eslint-enable */\n\nexport interface MoveKeyInputOption {\n scale?: number[];\n}\n\n/**\n * @typedef {Object} MoveKeyInputOption The option object of the eg.Axes.MoveKeyInput module\n * @ko eg.Axes.MoveKeyInput 모듈의 옵션 객체\n * @param {Array<Number>} [scale] Coordinate scale that a user can move<ko>사용자의 동작으로 이동하는 좌표의 배율</ko>\n * @param {Number} [scale[0]=1] Coordinate scale for the first axis<ko>첫번째 축의 배율</ko>\n * @param {Number} [scale[1]=1] Coordinate scale for the decond axis<ko>두번째 축의 배율</ko>\n **/\n\n/**\n * A module that passes the amount of change to eg.Axes when the move key stroke is occured. use two axis.\n * @ko 이동키 입력이 발생했을 때의 변화량을 eg.Axes에 전달하는 모듈. 두 개 의 축을 사용한다.\n *\n * @example\n * ```js\n * const moveKey = new eg.Axes.MoveKeyInput(\"#area\", {\n * scale: [1, 1]\n * });\n *\n * // Connect 'x', 'y' axes when the moveKey is pressed.\n * axes.connect([\"x\", \"y\"], moveKey);\n * ```\n * @param {HTMLElement|String|jQuery} element An element to use the eg.Axes.MoveKeyInput module <ko>eg.Axes.MoveKeyInput 모듈을 사용할 엘리먼트</ko>\n * @param {MoveKeyInputOption} [options] The option object of the eg.Axes.MoveKeyInput module<ko>eg.Axes.MoveKeyInput 모듈의 옵션 객체</ko>\n */\nexport class MoveKeyInput implements InputType {\n public options: MoveKeyInputOption;\n public axes: string[] = [];\n public element: HTMLElement = null;\n private _observer: InputTypeObserver;\n private _enabled = false;\n private _holding = false;\n private _timer: NodeJS.Timeout = null;\n\n /**\n *\n */\n public constructor(el: ElementType, options?: MoveKeyInputOption) {\n this.element = $(el);\n this.options = {\n ...{\n scale: [1, 1],\n },\n ...options,\n };\n this._onKeydown = this._onKeydown.bind(this);\n this._onKeyup = this._onKeyup.bind(this);\n }\n\n public mapAxes(axes: string[]) {\n this.axes = axes;\n }\n\n public connect(observer: InputTypeObserver): InputType {\n this._detachEvent();\n\n // add tabindex=\"0\" to the container for making it focusable\n if (this.element.getAttribute(\"tabindex\") !== \"0\") {\n this.element.setAttribute(\"tabindex\", \"0\");\n }\n\n this._attachEvent(observer);\n return this;\n }\n\n public disconnect() {\n this._detachEvent();\n return this;\n }\n\n /**\n * Destroys elements, properties, and events used in a module.\n * @ko 모듈에 사용한 엘리먼트와 속성, 이벤트를 해제한다.\n */\n public destroy() {\n this.disconnect();\n this.element = null;\n }\n\n /**\n * Enables input devices\n * @ko 입력 장치를 사용할 수 있게 한다\n * @return {MoveKeyInput} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>\n */\n public enable() {\n this._enabled = true;\n return this;\n }\n\n /**\n * Disables input devices\n * @ko 입력 장치를 사용할 수 없게 한다.\n * @return {MoveKeyInput} An instance of a module itself <ko>모듈 자신의 인스턴스</ko>\n */\n public disable() {\n this._enabled = false;\n return this;\n }\n\n /**\n * Returns whether to use an input device\n * @ko 입력 장치를 사용 여부를 반환한다.\n * @return {Boolean} Whether to use an input device <ko>입력장치 사용여부</ko>\n */\n public isEnabled() {\n return this._enabled;\n }\n\n private _onKeydown(event: KeyboardEvent) {\n if (!this._enabled) {\n return;\n }\n\n let isMoveKey = true;\n let direction = DIRECTION_FORWARD;\n let move = DIRECTION_HORIZONTAL;\n\n switch (event.keyCode) {\n case KEY_LEFT_ARROW:\n case KEY_A:\n direction = DIRECTION_REVERSE;\n break;\n case KEY_RIGHT_ARROW:\n case KEY_D:\n break;\n case KEY_DOWN_ARROW:\n case KEY_S:\n direction = DIRECTION_REVERSE;\n move = DIRECTION_VERTICAL;\n break;\n case KEY_UP_ARROW:\n case KEY_W:\n move = DIRECTION_VERTICAL;\n break;\n default:\n isMoveKey = false;\n }\n if (\n (move === DIRECTION_HORIZONTAL && !this.axes[0]) ||\n (move === DIRECTION_VERTICAL && !this.axes[1])\n ) {\n isMoveKey = false;\n }\n if (!isMoveKey) {\n return;\n }\n event.preventDefault();\n const offsets =\n move === DIRECTION_HORIZONTAL\n ? [+this.options.scale[0] * direction, 0]\n : [0, +this.options.scale[1] * direction];\n\n if (!this._holding) {\n this._observer.hold(this, event);\n this._holding = true;\n }\n clearTimeout(this._timer);\n this._observer.change(this, event, toAxis(this.axes, offsets));\n }\n\n private _onKeyup(event: KeyboardEvent) {\n if (!this._holding) {\n return;\n }\n clearTimeout(this._timer);\n this._timer = setTimeout(() => {\n this._observer.release(this, event, [0, 0]);\n this._holding = false;\n }, DELAY);\n }\n\n private _attachEvent(observer: InputTypeObserver) {\n const element = this.element;\n if (!element) {\n throw new Error(\"Element to connect input does not exist.\");\n }\n this._observer = observer;\n element.addEventListener(\"keydown\", this._onKeydown, false);\n element.addEventListener(\"keypress\", this._onKeydown, false);\n element.addEventListener(\"keyup\", this._onKeyup, false);\n this._enabled = true;\n }\n\n private _detachEvent() {\n const element = this.element;\n if (element) {\n element.removeEventListener(\"keydown\", this._onKeydown, false);\n element.removeEventListener(\"keypress\", this._onKeydown, false);\n element.removeEventListener(\"keyup\", this._onKeyup, false);\n }\n this._enabled = false;\n this._observer = null;\n }\n}\n","/*\n * Copyright (c) 2015 NAVER Corp.\n * egjs projects are licensed under the MIT license\n */\nimport Axes, { AxesOption } from \"./Axes\";\nimport { AXES_EVENTS, AXES_METHODS } from \"./const\";\nimport { ReactiveAdapter } from \"@cfcs/core\";\nimport {\n AxesEvents,\n AxesMethods,\n AxesReactiveState,\n ObjectInterface,\n} from \"./types\";\nimport { AxisOption } from \"./AxisManager\";\n\nexport interface AxesData {\n axis: ObjectInterface<AxisOption>;\n options: AxesOption;\n}\n\nexport const REACTIVE_AXES: ReactiveAdapter<\n Axes,\n AxesReactiveState,\n keyof AxesMethods,\n AxesData,\n AxesEvents\n> = {\n methods: AXES_METHODS,\n events: AXES_EVENTS,\n created(data) {\n return new Axes(data.axis, data.options);\n },\n on(instance, name, callback) {\n instance.on(name, callback);\n },\n off(instance, name, callback) {\n instance.off(name, callback);\n },\n destroy(instance) {\n instance.destroy();\n },\n};\n"],"names":["win","window","navigator","userAgent","map","obj","callback","k","tranformed","filter","filtered","every","equal","target","base","v","roundNumber","num","roundUnit","roundNumFunc","getRoundFunc","roundNumbers","value","key","getDecimalPlace","val","isFinite","indexOf","p","e","Math","round","length","getAngle","posX","posY","atan2","PI","isCssPropsFromAxes","originalCssProps","same","Object","keys","PREVENT_DRAG_CSSPROPS","forEach","prop","getDirection","useHorizontal","useVertical","DIRECTION_VERTICAL","useDirection","checkType","direction","userDirection","setCssProps","element","option","newCssProps_1","_a","oldCssProps","style","touchAction","touch-action","revertCssProps","getInsidePosition","destPos","range","circular","bounce","targetRange","toDestPos","max","min","isOutside","pos","isCircularable","getCirculatedPos","toPos","isValidKey","event","inputKey","ANY","shiftKey","ctrlKey","altKey","metaKey","toAxis","source","offset","reduce","acc","i","convertInputType","inputType","hasTouch","hasMouse","hasPointer","SUPPORT_TOUCH","SUPPORT_POINTER_EVENTS","PointerEventInput","TouchMouseEventInput","TouchEventInput","MouseEventInput","keyInfo_1","oldraf_1","MOUSE_LEFT","MOUSE_RIGHT","MOUSE_MIDDLE","AXES_METHODS","AXES_EVENTS","IS_IOS_SAFARI","browser","name","TRANSFORM","document","bodyStyle","head","getElementsByTagName","len","user-select","-webkit-user-drag","toArray","nodes","el","push","$","param","multi","match","dummy","createElement","innerHTML","childNodes","querySelectorAll","undefined","current","nodeName","nodeType","jQuery","constructor","prototype","jquery","get","Array","isArray","raf","requestAnimationFrame","webkitRequestAnimationFrame","caf","cancelAnimationFrame","webkitCancelAnimationFrame","timestamp","setTimeout","performance","now","Date","getTime","clearTimeout","pow","n","_axes","this","__proto","roundPos","_getRoundPos","trigger","ComponentEvent","input","inputEvent","isTrusted","depaPos","roundDepa","setTo","_createUserControll","duration","__assign","bounceRatio","_getBounceRatio","holding","animationManager","axisManager","eventInfo","getEventInfo","moveTo","delta","set","axis","getObserver","_this","isCanceled","off","userControl","userDuration","options","opt","_options","interruptable","_prevented","prevented","_axis","_complementOptions","_pos","startPos","fullDepaPos","axes","axisOptions","Error","axisOption","test","SUPPORT_POINTER","SUPPORT_MSPOINTER","preventDefault","removeEventListener","_stopContextMenu","prevEvent","center","_getCenter","movement","_getMovement","x","y","scale","_getScale","angle","deltaX","deltaY","offsetX","offsetY","latestInterval","_latestInterval","timeStamp","deltaTime","velocityX","velocityY","srcEvent","preventSystemEvent","start","end","clientX","clientY","sqrt","buttonCodeMap","1","2","4","button","_isTouchEvent","buttons","type","inputButton","_isValidButton","_getButton","addEventListener","__extends","_isValidEvent","_preventMouseButton","extendEvent","3","which","prev","EventInput","_baseTouches","touches","_getDistance","identifier","_updatePointerEvent","_removePointerEvent","_firstInputs","_recentInputs","pointerId","addFlag","id","nextSpot","prevSpot","getAddEventOptions","eventName","passive","clamp","interruptManager","eventManager","_interruptManager","_eventManager","_axisManager","_animationManager","isInterrupted","_isStopped","changeOption","setInterrupt","stopAnimation","_moveDistance","hold","_isOutside","useAnimation","isInterrupting","nativeEvent","__childrenAxesAlreadyChanged","_atOutside","nested","_isEndofAxis","getDuration","animateTo","triggerChange","finish","velocity","inputDuration","userWish","__childrenAxesAlreadyReleased","displacement","getDisplacement","getDelta","triggerRelease","getUserControl","isEqual","restore","triggerFinish","tn","tx","out","interpolate","threshold","initSlope","_easing","diffTime","ratio","animateParam","_animateParam","startTime","restart","currentPos","_initialEasingPer","_prevEasingPer","_durationOffset","info","easingPer","finished","prevState","prevPos","directions","nextPos","circulatedPos","rangeOffset","easing","animationEnd","bind","wishDuration","durations_1","distance","abs","deceleration","Infinity","minimumDuration","maximumDuration","totalVelocity","total","orgPos_1","_raf","triggerAnimationEnd","beforeParam","circularTargets","_createAnimationParam","retTrigger","triggerAnimationStart","console","warn","_animateLoop","orgPos","movedPos","done","complete","originalIntendedPos_1","state_1","loop_1","_initState","nextState","_getNextState","_getFinalPos","originalIntendedPos","_getRoundUnit","minRoundUnit","getAxisOptions","_super","InterruptManager","AxisManager","EventManager","EasingManager","inputObserver","InputObserver","setAnimationManager","mapped","split","concat","_inputs","disconnect","mapAxes","connect","index","splice","setBy","setAxis","updateAnimation","destroy","Axes","ReactiveSubscribe","Component","_dragged","stopPropagation","thresholdAngle","preventClickOnDrag","iOSEdgeSwipeThreshold","releaseOnScroll","_onPanstart","_onPanmove","_onPanend","_direction","observer","_activeEvent","_detachElementEvent","_detachWindowEvent","_attachElementEvent","_originalCssProps","_enabled","activeEvent","onRelease","_observer","release","panEvent","onEventStart","getTouches","cancelable","edgeThreshold","_isOverThreshold","_atRightEdge","innerWidth","_attachWindowEvent","onEventMove","toAngle","getDirectionByAngle","_rightEdgeTimer","_getOffset","prevent","some","change","onEventEnd","move","properties","Number","_preventClickWhenDragged","_voidFunction","DIRECTION_ALL","isEnabled","rect","getBoundingClientRect","_coefficientForDistanceToAngle","width","_rotateOrigin","left","top","height","_prevAngle","_triggerChange","vy","vx","_lastDiff","_getPosFromOrigin","positiveAngle","quadrant","_getQuadrant","diff","_getDifference","_prevQuadrant","prevAngle","prevQuadrant","q","PanInput","_onPinchStart","_onPinchMove","_onPinchEnd","_detachEvent","_attachEvent","pinchEvent","_baseValue","_pinchFlag","pinchScale","releaseDelay","useNormalized","_onWheel","_holding","_timer","_onKeydown","_onKeyup","getAttribute","setAttribute","offsets","isMoveKey","keyCode","methods","events","created","data","on","instance","modules"],"mappings":";;;;;;;;u2JAUEA,EAFoB,oBAAXC,OAEH,CACJC,UAAW,CACTC,UAAW,KAITF,u0CC0GW,SAANG,EACXC,EACAC,GAEA,IAEWC,EAFLC,EAAiC,GAEvC,IAAWD,KAAKF,EACVE,IACFC,EAAWD,GAAKD,EAASD,EAAIE,GAAIA,IAGrC,OAAOC,EAGa,SAATC,EACXJ,EACAC,GAEA,IAEWC,EAFLG,EAA+B,GAErC,IAAWH,KAAKF,EACVE,GAAKD,EAASD,EAAIE,GAAIA,KACxBG,EAASH,GAAKF,EAAIE,IAGtB,OAAOG,EAEY,SAARC,EACXN,EACAC,GAEA,IAAK,IAAMC,KAAKF,EACd,GAAIE,IAAMD,EAASD,EAAIE,GAAIA,GACzB,OAAO,EAGX,OAAO,EAEY,SAARK,EACXC,EACAC,GAEA,OAAOH,EAAME,EAAQ,SAACE,EAAGR,GAA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