From a5ef0206c412bd2f1d5d797d686dd983c12176d0 Mon Sep 17 00:00:00 2001 From: N0rdye Date: Sat, 1 Jul 2023 16:47:05 +0500 Subject: [PATCH] lib updates, img sizing fixes --- docker-compose.yaml | 16 +- index.js | 8 +- public/lib/html2canvas.js | 2 +- public/lib/inter.js | 70 +- public/lib/interact.js | 11758 +++++++++++++++++++++++++++++++++++ public/lib/interact.js.map | 1 + public/lib/interact.min.js | 3 - views/admin.ejs | 3 +- views/project.ejs | 8 +- 9 files changed, 11813 insertions(+), 56 deletions(-) create mode 100644 public/lib/interact.js create mode 100644 public/lib/interact.js.map delete mode 100644 public/lib/interact.min.js diff --git a/docker-compose.yaml b/docker-compose.yaml index e1658c3..eda1025 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -17,14 +17,14 @@ services: dockerfile: Dockerfile restart: always ports: - - 80:8080 + - 8080:8080 volumes: - ./:/usr/src/app - # phpmyadmin: - # image: phpmyadmin - # restart: always - # ports: - # - 2000:80 - # environment: - # - PMA_ARBITRARY=1 \ No newline at end of file + phpmyadmin: + image: phpmyadmin + restart: always + ports: + - 2000:80 + environment: + - PMA_ARBITRARY=1 \ No newline at end of file diff --git a/index.js b/index.js index c372829..767dd3f 100644 --- a/index.js +++ b/index.js @@ -20,9 +20,11 @@ const app = express(); // const { mainModule } = require('process'); // const { name } = require('ejs'); +const maxRequestBodySize = '10mb'; app.set('view engine', 'ejs'); app.use(express.urlencoded({ - extended: false + extended: false, + limit: maxRequestBodySize })); app.use(express.static('public')); app.use(cookieParser()); @@ -43,7 +45,7 @@ app.post('/back_login', (req, res) => { db.gv("users","login",`'${ilogin}'`,(udata)=>{udata = udata[0]; if(ipass == udata["pass"]){ console.log(udata["uuid"]+" logged in by login & pass from "+cook["sid"]); - res.cookie("uuid",udata["uuid"],{maxAge:week,path:"/;SameSite=None"}); + res.cookie("uuid",udata["uuid"],{maxAge:week,path:"/;SameSite=Strict"}); // db.sv("users","sids",sids += inp["sid"]+";","uuid",udata["uuid"],()=>{}); db.nr("sids",'`sid`,`uid`',`'${cook["sid"]}','${udata["id"]}'`); @@ -153,7 +155,7 @@ app.post("/sid_log",(req,res) =>{ app.post("/get_sid" , (req,res) =>{ let inp = req.body; let sid = func.get_uuid(inp["name"]); - res.cookie("sid",sid,{maxAge:(week),path:"/;SameSite=None"}); + res.cookie("sid",sid,{maxAge:(week),path:"/;SameSite=Strict"}); res.send({out:"good"}); }); diff --git a/public/lib/html2canvas.js b/public/lib/html2canvas.js index 3ec00e0..987b4fb 100644 --- a/public/lib/html2canvas.js +++ b/public/lib/html2canvas.js @@ -7827,4 +7827,4 @@ return html2canvas; }))); -//# sourceMappingURL=html2canvas.js.map +//# sourceMappingURL=html2canvas.js.map \ No newline at end of file diff --git a/public/lib/inter.js b/public/lib/inter.js index 2695320..f679a0d 100644 --- a/public/lib/inter.js +++ b/public/lib/inter.js @@ -11,41 +11,39 @@ function get_count(clas){ function create(clas,x,y,body,id){ let main_clas = clas.split(" ")[0]; // if (body == null || body == "") body = "[]"; - try{ - load_obj(main_clas,(db_data)=>{ - // let data = db_data; - // body = data["img"]; - // console.log(data["img"].toString()); - // console.log(db_data[0]); - // console.log(clas,x,y,body,parent); - // console.log(id); - // root.innerHTML += "
"+body+"
"; - // let img = document.createElement("img"); - let obj = document.createElement("img"); - obj.id = id; - clas= clas.split(" "); - clas.forEach(cl => { - obj.classList.add(cl); + load_obj(main_clas,(db_data)=>{ + // let data = db_data; + // body = data["img"]; + // console.log(data["img"].toString()); + // console.log(db_data[0]); + // console.log(clas,x,y,body,parent); + // console.log(id); + // root.innerHTML += "
"+body+"
"; + // let img = document.createElement("img"); + let obj = document.createElement("img"); + obj.id = id; + clas= clas.split(" "); + clas.forEach(cl => { + obj.classList.add(cl); + }); + if (db_data == null) { + delete objs[main_clas][id]; + save(()=>{ + goto("/proj/"+proj_name); }); - if (db_data == null) { - delete objs[main_clas][id]; - save(()=>{ - goto("/proj/"+proj_name); - }); - } - else{ - obj.src = db_data["img"]; - obj.title = `${db_data["name"]} \n ${db_data["description"]}`; - } - // obj.innerHTML = body; - // parent.append(obj); - obj.setAttribute("max-width","100px"); - root.append(obj); - set_pos(obj,x,y); - // let obj_doc = document.getElementById(obj); - // console.log(obj_doc.classList); - }) - }catch{} + } + else{ + obj.src = db_data["img"]; + obj.title = `${db_data["name"]} \n ${db_data["description"]}`; + } + // obj.innerHTML = body; + // parent.append(obj); + obj.setAttribute("max-width","100px"); + root.append(obj); + set_pos(obj,x,y); + // let obj_doc = document.getElementById(obj); + // console.log(obj_doc.classList); + }) } function wall_size_change(type,value){ @@ -233,7 +231,7 @@ interact('.createzone').dropzone({ zone.classList.remove('drop-target'); drag.classList.remove('spawn'); let x = zone.getBoundingClientRect().left + window.scrollX - 15; - let y = zone.getBoundingClientRect().top + window.scrollY - 30; + let y = zone.getBoundingClientRect().top + window.scrollY - 32; create(`${zone.classList[0]} drag spawn`,x,y,`${zone.classList[0]}`,`none`); }, ondrop: function (event) {var drag = event.relatedTargetdrag.classList.remove('in_zone');drag.classList.remove('can-drop');}, @@ -244,7 +242,7 @@ function drag_start() { let zones = document.getElementsByClassName("createzone"); Object.entries(zones).forEach(([key, zone]) => { let x = zone.getBoundingClientRect().left - scrollX - 15; - let y = zone.getBoundingClientRect().top - scrollY - 30; + let y = zone.getBoundingClientRect().top - scrollY - 32; // console.log(x,y); create(`${zone.classList[0]} drag spawn`,x,y,`${zone.classList[0]}`,`none`); }); diff --git a/public/lib/interact.js b/public/lib/interact.js new file mode 100644 index 0000000..423ef58 --- /dev/null +++ b/public/lib/interact.js @@ -0,0 +1,11758 @@ +"use strict"; + +function _typeof2(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); } + +/** + * interact.js 1.9.20 + * + * Copyright (c) 2012-present Taye Adeyemi + * Released under the MIT License. + * https://raw.github.com/taye/interact.js/master/LICENSE + */ +(function (f) { + if ((typeof exports === "undefined" ? "undefined" : _typeof2(exports)) === "object" && typeof module !== "undefined") { + module.exports = f(); + } else if (typeof define === "function" && define.amd) { + define([], f); + } else { + var g; + + if (typeof window !== "undefined") { + g = window; + } else if (typeof global !== "undefined") { + g = global; + } else if (typeof self !== "undefined") { + g = self; + } else { + g = this; + } + + g.interact = f(); + } +})(function () { + var define, module, exports; + var _$isWindow_77 = {}; + "use strict"; + + Object.defineProperty(_$isWindow_77, "__esModule", { + value: true + }); + _$isWindow_77["default"] = void 0; + + var _default = function _default(thing) { + return !!(thing && thing.Window) && thing instanceof thing.Window; + }; + + _$isWindow_77["default"] = _default; + var _$window_84 = {}; + "use strict"; + + Object.defineProperty(_$window_84, "__esModule", { + value: true + }); + _$window_84.init = init; + _$window_84.getWindow = getWindow; + _$window_84["default"] = void 0; + /* removed: var _$isWindow_77 = require("./isWindow.js"); */ + + ; + var win = { + realWindow: undefined, + window: undefined, + getWindow: getWindow, + init: init + }; + + function init(window) { + // get wrapped window if using Shadow DOM polyfill + win.realWindow = window; // create a TextNode + + var el = window.document.createTextNode(''); // check if it's wrapped by a polyfill + + if (el.ownerDocument !== window.document && typeof window.wrap === 'function' && window.wrap(el) === el) { + // use wrapped window + window = window.wrap(window); + } + + win.window = window; + } + + if (typeof window === 'undefined') { + win.window = undefined; + win.realWindow = undefined; + } else { + init(window); + } + + function getWindow(node) { + if ((0, _$isWindow_77["default"])(node)) { + return node; + } + + var rootNode = node.ownerDocument || node; + return rootNode.defaultView || win.window; + } + + win.init = init; + var ___default_84 = win; + _$window_84["default"] = ___default_84; + var _$is_76 = {}; + "use strict"; + + Object.defineProperty(_$is_76, "__esModule", { + value: true + }); + _$is_76["default"] = void 0; + /* removed: var _$isWindow_77 = require("./isWindow.js"); */ + + ; + /* removed: var _$window_84 = require("./window.js"); */ + + ; + + function _typeof(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + _typeof = function _typeof(obj) { + return typeof obj; + }; + } else { + _typeof = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + + return _typeof(obj); + } + + var __window_76 = function window(thing) { + return thing === _$window_84["default"].window || (0, _$isWindow_77["default"])(thing); + }; + + var docFrag = function docFrag(thing) { + return object(thing) && thing.nodeType === 11; + }; + + var object = function object(thing) { + return !!thing && _typeof(thing) === 'object'; + }; + + var func = function func(thing) { + return typeof thing === 'function'; + }; + + var number = function number(thing) { + return typeof thing === 'number'; + }; + + var bool = function bool(thing) { + return typeof thing === 'boolean'; + }; + + var string = function string(thing) { + return typeof thing === 'string'; + }; + + var element = function element(thing) { + if (!thing || _typeof(thing) !== 'object') { + return false; + } // eslint-disable-next-line import/no-named-as-default-member + + + var _window = _$window_84["default"].getWindow(thing) || _$window_84["default"].window; + + return /object|function/.test(_typeof(_window.Element)) ? thing instanceof _window.Element // DOM2 + : thing.nodeType === 1 && typeof thing.nodeName === 'string'; + }; + + var plainObject = function plainObject(thing) { + return object(thing) && !!thing.constructor && /function Object\b/.test(thing.constructor.toString()); + }; + + var array = function array(thing) { + return object(thing) && typeof thing.length !== 'undefined' && func(thing.splice); + }; + + var ___default_76 = { + window: __window_76, + docFrag: docFrag, + object: object, + func: func, + number: number, + bool: bool, + string: string, + element: element, + plainObject: plainObject, + array: array + }; + _$is_76["default"] = ___default_76; + var _$plugin_1 = {}; + "use strict"; + + Object.defineProperty(_$plugin_1, "__esModule", { + value: true + }); + _$plugin_1["default"] = void 0; + /* removed: var _$is_76 = require("../../utils/is.js"); */ + + ; + + function install(scope) { + var actions = scope.actions, + Interactable = scope.Interactable, + defaults = scope.defaults; + Interactable.prototype.draggable = drag.draggable; + actions.map.drag = drag; + actions.methodDict.drag = 'draggable'; + defaults.actions.drag = drag.defaults; + } + + function beforeMove(_ref) { + var interaction = _ref.interaction; + + if (interaction.prepared.name !== 'drag') { + return; + } + + var axis = interaction.prepared.axis; + + if (axis === 'x') { + interaction.coords.cur.page.y = interaction.coords.start.page.y; + interaction.coords.cur.client.y = interaction.coords.start.client.y; + interaction.coords.velocity.client.y = 0; + interaction.coords.velocity.page.y = 0; + } else if (axis === 'y') { + interaction.coords.cur.page.x = interaction.coords.start.page.x; + interaction.coords.cur.client.x = interaction.coords.start.client.x; + interaction.coords.velocity.client.x = 0; + interaction.coords.velocity.page.x = 0; + } + } + + function move(_ref2) { + var iEvent = _ref2.iEvent, + interaction = _ref2.interaction; + + if (interaction.prepared.name !== 'drag') { + return; + } + + var axis = interaction.prepared.axis; + + if (axis === 'x' || axis === 'y') { + var opposite = axis === 'x' ? 'y' : 'x'; + iEvent.page[opposite] = interaction.coords.start.page[opposite]; + iEvent.client[opposite] = interaction.coords.start.client[opposite]; + iEvent.delta[opposite] = 0; + } + } + /** + * ```js + * interact(element).draggable({ + * onstart: function (event) {}, + * onmove : function (event) {}, + * onend : function (event) {}, + * + * // the axis in which the first movement must be + * // for the drag sequence to start + * // 'xy' by default - any direction + * startAxis: 'x' || 'y' || 'xy', + * + * // 'xy' by default - don't restrict to one axis (move in any direction) + * // 'x' or 'y' to restrict movement to either axis + * // 'start' to restrict movement to the axis the drag started in + * lockAxis: 'x' || 'y' || 'xy' || 'start', + * + * // max number of drags that can happen concurrently + * // with elements of this Interactable. Infinity by default + * max: Infinity, + * + * // max number of drags that can target the same element+Interactable + * // 1 by default + * maxPerElement: 2 + * }) + * + * var isDraggable = interact('element').draggable(); // true + * ``` + * + * Get or set whether drag actions can be performed on the target + * + * @alias Interactable.prototype.draggable + * + * @param {boolean | object} [options] true/false or An object with event + * listeners to be fired on drag events (object makes the Interactable + * draggable) + * @return {boolean | Interactable} boolean indicating if this can be the + * target of drag events, or this Interctable + */ + + + var draggable = function draggable(options) { + if (_$is_76["default"].object(options)) { + this.options.drag.enabled = options.enabled !== false; + this.setPerAction('drag', options); + this.setOnEvents('drag', options); + + if (/^(xy|x|y|start)$/.test(options.lockAxis)) { + this.options.drag.lockAxis = options.lockAxis; + } + + if (/^(xy|x|y)$/.test(options.startAxis)) { + this.options.drag.startAxis = options.startAxis; + } + + return this; + } + + if (_$is_76["default"].bool(options)) { + this.options.drag.enabled = options; + return this; + } + + return this.options.drag; + }; + + var drag = { + id: 'actions/drag', + install: install, + listeners: { + 'interactions:before-action-move': beforeMove, + 'interactions:action-resume': beforeMove, + // dragmove + 'interactions:action-move': move, + 'auto-start:check': function autoStartCheck(arg) { + var interaction = arg.interaction, + interactable = arg.interactable, + buttons = arg.buttons; + var dragOptions = interactable.options.drag; + + if (!(dragOptions && dragOptions.enabled) || // check mouseButton setting if the pointer is down + interaction.pointerIsDown && /mouse|pointer/.test(interaction.pointerType) && (buttons & interactable.options.drag.mouseButtons) === 0) { + return undefined; + } + + arg.action = { + name: 'drag', + axis: dragOptions.lockAxis === 'start' ? dragOptions.startAxis : dragOptions.lockAxis + }; + return false; + } + }, + draggable: draggable, + beforeMove: beforeMove, + move: move, + defaults: { + startAxis: 'xy', + lockAxis: 'xy' + }, + getCursor: function getCursor() { + return 'move'; + } + }; + var ___default_1 = drag; + _$plugin_1["default"] = ___default_1; + var _$domObjects_70 = {}; + "use strict"; + + Object.defineProperty(_$domObjects_70, "__esModule", { + value: true + }); + _$domObjects_70["default"] = void 0; + var domObjects = { + init: __init_70, + document: null, + DocumentFragment: null, + SVGElement: null, + SVGSVGElement: null, + SVGElementInstance: null, + Element: null, + HTMLElement: null, + Event: null, + Touch: null, + PointerEvent: null + }; + + function blank() {} + + var ___default_70 = domObjects; + _$domObjects_70["default"] = ___default_70; + + function __init_70(window) { + var win = window; + domObjects.document = win.document; + domObjects.DocumentFragment = win.DocumentFragment || blank; + domObjects.SVGElement = win.SVGElement || blank; + domObjects.SVGSVGElement = win.SVGSVGElement || blank; + domObjects.SVGElementInstance = win.SVGElementInstance || blank; + domObjects.Element = win.Element || blank; + domObjects.HTMLElement = win.HTMLElement || domObjects.Element; + domObjects.Event = win.Event; + domObjects.Touch = win.Touch || blank; + domObjects.PointerEvent = win.PointerEvent || win.MSPointerEvent; + } + + var _$browser_67 = {}; + "use strict"; + + Object.defineProperty(_$browser_67, "__esModule", { + value: true + }); + _$browser_67["default"] = void 0; + /* removed: var _$domObjects_70 = require("./domObjects.js"); */ + + ; + /* removed: var _$is_76 = require("./is.js"); */ + + ; + /* removed: var _$window_84 = require("./window.js"); */ + + ; + var browser = { + init: __init_67, + supportsTouch: null, + supportsPointerEvent: null, + isIOS7: null, + isIOS: null, + isIe9: null, + isOperaMobile: null, + prefixedMatchesSelector: null, + pEventTypes: null, + wheelEvent: null + }; + + function __init_67(window) { + var Element = _$domObjects_70["default"].Element; + var navigator = _$window_84["default"].window.navigator; // Does the browser support touch input? + + browser.supportsTouch = 'ontouchstart' in window || _$is_76["default"].func(window.DocumentTouch) && _$domObjects_70["default"].document instanceof window.DocumentTouch; // Does the browser support PointerEvents + + browser.supportsPointerEvent = navigator.pointerEnabled !== false && !!_$domObjects_70["default"].PointerEvent; + browser.isIOS = /iP(hone|od|ad)/.test(navigator.platform); // scrolling doesn't change the result of getClientRects on iOS 7 + + browser.isIOS7 = /iP(hone|od|ad)/.test(navigator.platform) && /OS 7[^\d]/.test(navigator.appVersion); + browser.isIe9 = /MSIE 9/.test(navigator.userAgent); // Opera Mobile must be handled differently + + browser.isOperaMobile = navigator.appName === 'Opera' && browser.supportsTouch && /Presto/.test(navigator.userAgent); // prefix matchesSelector + + browser.prefixedMatchesSelector = 'matches' in Element.prototype ? 'matches' : 'webkitMatchesSelector' in Element.prototype ? 'webkitMatchesSelector' : 'mozMatchesSelector' in Element.prototype ? 'mozMatchesSelector' : 'oMatchesSelector' in Element.prototype ? 'oMatchesSelector' : 'msMatchesSelector'; + browser.pEventTypes = browser.supportsPointerEvent ? _$domObjects_70["default"].PointerEvent === window.MSPointerEvent ? { + up: 'MSPointerUp', + down: 'MSPointerDown', + over: 'mouseover', + out: 'mouseout', + move: 'MSPointerMove', + cancel: 'MSPointerCancel' + } : { + up: 'pointerup', + down: 'pointerdown', + over: 'pointerover', + out: 'pointerout', + move: 'pointermove', + cancel: 'pointercancel' + } : null; // because Webkit and Opera still use 'mousewheel' event type + + browser.wheelEvent = 'onmousewheel' in _$domObjects_70["default"].document ? 'mousewheel' : 'wheel'; + } + + var ___default_67 = browser; + _$browser_67["default"] = ___default_67; + var _$domUtils_71 = {}; + "use strict"; + + Object.defineProperty(_$domUtils_71, "__esModule", { + value: true + }); + _$domUtils_71.nodeContains = nodeContains; + _$domUtils_71.closest = closest; + _$domUtils_71.parentNode = parentNode; + _$domUtils_71.matchesSelector = matchesSelector; + _$domUtils_71.indexOfDeepestElement = indexOfDeepestElement; + _$domUtils_71.matchesUpTo = matchesUpTo; + _$domUtils_71.getActualElement = getActualElement; + _$domUtils_71.getScrollXY = getScrollXY; + _$domUtils_71.getElementClientRect = getElementClientRect; + _$domUtils_71.getElementRect = getElementRect; + _$domUtils_71.getPath = getPath; + _$domUtils_71.trySelector = trySelector; + /* removed: var _$browser_67 = require("./browser.js"); */ + + ; + /* removed: var _$domObjects_70 = require("./domObjects.js"); */ + + ; + /* removed: var _$is_76 = require("./is.js"); */ + + ; + /* removed: var _$window_84 = require("./window.js"); */ + + ; + + function nodeContains(parent, child) { + while (child) { + if (child === parent) { + return true; + } + + child = child.parentNode; + } + + return false; + } + + function closest(element, selector) { + while (_$is_76["default"].element(element)) { + if (matchesSelector(element, selector)) { + return element; + } + + element = parentNode(element); + } + + return null; + } + + function parentNode(node) { + var parent = node.parentNode; + + if (_$is_76["default"].docFrag(parent)) { + // skip past #shado-root fragments + // tslint:disable-next-line + while ((parent = parent.host) && _$is_76["default"].docFrag(parent)) { + continue; + } + + return parent; + } + + return parent; + } + + function matchesSelector(element, selector) { + // remove /deep/ from selectors if shadowDOM polyfill is used + if (_$window_84["default"].window !== _$window_84["default"].realWindow) { + selector = selector.replace(/\/deep\//g, ' '); + } + + return element[_$browser_67["default"].prefixedMatchesSelector](selector); + } + + var getParent = function getParent(el) { + return el.parentNode || el.host; + }; // Test for the element that's "above" all other qualifiers + + + function indexOfDeepestElement(elements) { + var deepestNodeParents = []; + var deepestNodeIndex; + + for (var i = 0; i < elements.length; i++) { + var currentNode = elements[i]; + var deepestNode = elements[deepestNodeIndex]; // node may appear in elements array multiple times + + if (!currentNode || i === deepestNodeIndex) { + continue; + } + + if (!deepestNode) { + deepestNodeIndex = i; + continue; + } + + var currentNodeParent = getParent(currentNode); + var deepestNodeParent = getParent(deepestNode); // check if the deepest or current are document.documentElement/rootElement + // - if the current node is, do nothing and continue + + if (currentNodeParent === currentNode.ownerDocument) { + continue; + } // - if deepest is, update with the current node and continue to next + else if (deepestNodeParent === currentNode.ownerDocument) { + deepestNodeIndex = i; + continue; + } // compare zIndex of siblings + + + if (currentNodeParent === deepestNodeParent) { + if (zIndexIsHigherThan(currentNode, deepestNode)) { + deepestNodeIndex = i; + } + + continue; + } // populate the ancestry array for the latest deepest node + + + deepestNodeParents = deepestNodeParents.length ? deepestNodeParents : getNodeParents(deepestNode); + var ancestryStart = void 0; // if the deepest node is an HTMLElement and the current node is a non root svg element + + if (deepestNode instanceof _$domObjects_70["default"].HTMLElement && currentNode instanceof _$domObjects_70["default"].SVGElement && !(currentNode instanceof _$domObjects_70["default"].SVGSVGElement)) { + // TODO: is this check necessary? Was this for HTML elements embedded in SVG? + if (currentNode === deepestNodeParent) { + continue; + } + + ancestryStart = currentNode.ownerSVGElement; + } else { + ancestryStart = currentNode; + } + + var currentNodeParents = getNodeParents(ancestryStart, deepestNode.ownerDocument); + var commonIndex = 0; // get (position of closest common ancestor) + 1 + + while (currentNodeParents[commonIndex] && currentNodeParents[commonIndex] === deepestNodeParents[commonIndex]) { + commonIndex++; + } + + var parents = [currentNodeParents[commonIndex - 1], currentNodeParents[commonIndex], deepestNodeParents[commonIndex]]; + var child = parents[0].lastChild; + + while (child) { + if (child === parents[1]) { + deepestNodeIndex = i; + deepestNodeParents = currentNodeParents; + break; + } else if (child === parents[2]) { + break; + } + + child = child.previousSibling; + } + } + + return deepestNodeIndex; + } + + function getNodeParents(node, limit) { + var parents = []; + var parent = node; + var parentParent; + + while ((parentParent = getParent(parent)) && parent !== limit && parentParent !== parent.ownerDocument) { + parents.unshift(parent); + parent = parentParent; + } + + return parents; + } + + function zIndexIsHigherThan(higherNode, lowerNode) { + var higherIndex = parseInt((0, _$window_84.getWindow)(higherNode).getComputedStyle(higherNode).zIndex, 10) || 0; + var lowerIndex = parseInt((0, _$window_84.getWindow)(lowerNode).getComputedStyle(lowerNode).zIndex, 10) || 0; + return higherIndex >= lowerIndex; + } + + function matchesUpTo(element, selector, limit) { + while (_$is_76["default"].element(element)) { + if (matchesSelector(element, selector)) { + return true; + } + + element = parentNode(element); + + if (element === limit) { + return matchesSelector(element, selector); + } + } + + return false; + } + + function getActualElement(element) { + return element instanceof _$domObjects_70["default"].SVGElementInstance ? element.correspondingUseElement : element; + } + + function getScrollXY(relevantWindow) { + relevantWindow = relevantWindow || _$window_84["default"].window; + return { + x: relevantWindow.scrollX || relevantWindow.document.documentElement.scrollLeft, + y: relevantWindow.scrollY || relevantWindow.document.documentElement.scrollTop + }; + } + + function getElementClientRect(element) { + var clientRect = element instanceof _$domObjects_70["default"].SVGElement ? element.getBoundingClientRect() : element.getClientRects()[0]; + return clientRect && { + left: clientRect.left, + right: clientRect.right, + top: clientRect.top, + bottom: clientRect.bottom, + width: clientRect.width || clientRect.right - clientRect.left, + height: clientRect.height || clientRect.bottom - clientRect.top + }; + } + + function getElementRect(element) { + var clientRect = getElementClientRect(element); + + if (!_$browser_67["default"].isIOS7 && clientRect) { + var scroll = getScrollXY(_$window_84["default"].getWindow(element)); + clientRect.left += scroll.x; + clientRect.right += scroll.x; + clientRect.top += scroll.y; + clientRect.bottom += scroll.y; + } + + return clientRect; + } + + function getPath(node) { + var path = []; + + while (node) { + path.push(node); + node = parentNode(node); + } + + return path; + } + + function trySelector(value) { + if (!_$is_76["default"].string(value)) { + return false; + } // an exception will be raised if it is invalid + + + _$domObjects_70["default"].document.querySelector(value); + + return true; + } + + var _$extend_73 = {}; + "use strict"; + + Object.defineProperty(_$extend_73, "__esModule", { + value: true + }); + _$extend_73["default"] = extend; + + function extend(dest, source) { + for (var prop in source) { + dest[prop] = source[prop]; + } + + var ret = dest; + return ret; + } + + var _$rect_83 = {}; + "use strict"; + + Object.defineProperty(_$rect_83, "__esModule", { + value: true + }); + _$rect_83.getStringOptionResult = getStringOptionResult; + _$rect_83.resolveRectLike = resolveRectLike; + _$rect_83.rectToXY = rectToXY; + _$rect_83.xywhToTlbr = xywhToTlbr; + _$rect_83.tlbrToXywh = tlbrToXywh; + _$rect_83.addEdges = addEdges; + /* removed: var _$domUtils_71 = require("./domUtils.js"); */ + + ; + /* removed: var _$extend_73 = require("./extend.js"); */ + + ; + /* removed: var _$is_76 = require("./is.js"); */ + + ; + + function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); + } + + function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); + } + + function _iterableToArray(iter) { + if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); + } + + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) return _arrayLikeToArray(arr); + } + + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + + for (var i = 0, arr2 = new Array(len); i < len; i++) { + arr2[i] = arr[i]; + } + + return arr2; + } + + function getStringOptionResult(value, target, element) { + if (value === 'parent') { + return (0, _$domUtils_71.parentNode)(element); + } + + if (value === 'self') { + return target.getRect(element); + } + + return (0, _$domUtils_71.closest)(element, value); + } + + function resolveRectLike(value, target, element, functionArgs) { + var returnValue = value; + + if (_$is_76["default"].string(returnValue)) { + returnValue = getStringOptionResult(returnValue, target, element); + } else if (_$is_76["default"].func(returnValue)) { + returnValue = returnValue.apply(void 0, _toConsumableArray(functionArgs)); + } + + if (_$is_76["default"].element(returnValue)) { + returnValue = (0, _$domUtils_71.getElementRect)(returnValue); + } + + return returnValue; + } + + function rectToXY(rect) { + return rect && { + x: 'x' in rect ? rect.x : rect.left, + y: 'y' in rect ? rect.y : rect.top + }; + } + + function xywhToTlbr(rect) { + if (rect && !('left' in rect && 'top' in rect)) { + rect = (0, _$extend_73["default"])({}, rect); + rect.left = rect.x || 0; + rect.top = rect.y || 0; + rect.right = rect.right || rect.left + rect.width; + rect.bottom = rect.bottom || rect.top + rect.height; + } + + return rect; + } + + function tlbrToXywh(rect) { + if (rect && !('x' in rect && 'y' in rect)) { + rect = (0, _$extend_73["default"])({}, rect); + rect.x = rect.left || 0; + rect.y = rect.top || 0; + rect.width = rect.width || (rect.right || 0) - rect.x; + rect.height = rect.height || (rect.bottom || 0) - rect.y; + } + + return rect; + } + + function addEdges(edges, rect, delta) { + if (edges.left) { + rect.left += delta.x; + } + + if (edges.right) { + rect.right += delta.x; + } + + if (edges.top) { + rect.top += delta.y; + } + + if (edges.bottom) { + rect.bottom += delta.y; + } + + rect.width = rect.right - rect.left; + rect.height = rect.bottom - rect.top; + } + + var _$getOriginXY_74 = {}; + "use strict"; + + Object.defineProperty(_$getOriginXY_74, "__esModule", { + value: true + }); + _$getOriginXY_74["default"] = ___default_74; + /* removed: var _$rect_83 = require("./rect.js"); */ + + ; + + function ___default_74(target, element, actionName) { + var actionOptions = target.options[actionName]; + var actionOrigin = actionOptions && actionOptions.origin; + var origin = actionOrigin || target.options.origin; + var originRect = (0, _$rect_83.resolveRectLike)(origin, target, element, [target && element]); + return (0, _$rect_83.rectToXY)(originRect) || { + x: 0, + y: 0 + }; + } + + var _$normalizeListeners_79 = {}; + "use strict"; + + Object.defineProperty(_$normalizeListeners_79, "__esModule", { + value: true + }); + _$normalizeListeners_79["default"] = normalize; + /* removed: var _$extend_73 = require("./extend.js"); */ + + ; + /* removed: var _$is_76 = require("./is.js"); */ + + ; + + function normalize(type, listeners, result) { + result = result || {}; + + if (_$is_76["default"].string(type) && type.search(' ') !== -1) { + type = split(type); + } + + if (_$is_76["default"].array(type)) { + return type.reduce(function (acc, t) { + return (0, _$extend_73["default"])(acc, normalize(t, listeners, result)); + }, result); + } // ({ type: fn }) -> ('', { type: fn }) + + + if (_$is_76["default"].object(type)) { + listeners = type; + type = ''; + } + + if (_$is_76["default"].func(listeners)) { + result[type] = result[type] || []; + result[type].push(listeners); + } else if (_$is_76["default"].array(listeners)) { + for (var _i = 0; _i < listeners.length; _i++) { + var _ref; + + _ref = listeners[_i]; + var l = _ref; + normalize(type, l, result); + } + } else if (_$is_76["default"].object(listeners)) { + for (var prefix in listeners) { + var combinedTypes = split(prefix).map(function (p) { + return "".concat(type).concat(p); + }); + normalize(combinedTypes, listeners[prefix], result); + } + } + + return result; + } + + function split(type) { + return type.trim().split(/ +/); + } + + var _$hypot_75 = {}; + "use strict"; + + Object.defineProperty(_$hypot_75, "__esModule", { + value: true + }); + _$hypot_75["default"] = void 0; + + var ___default_75 = function _default(x, y) { + return Math.sqrt(x * x + y * y); + }; + + _$hypot_75["default"] = ___default_75; + var _$pointerExtend_80 = {}; + "use strict"; + + Object.defineProperty(_$pointerExtend_80, "__esModule", { + value: true + }); + _$pointerExtend_80["default"] = void 0; + + function pointerExtend(dest, source) { + for (var prop in source) { + var prefixedPropREs = pointerExtend.prefixedPropREs; + var deprecated = false; // skip deprecated prefixed properties + + for (var vendor in prefixedPropREs) { + if (prop.indexOf(vendor) === 0 && prefixedPropREs[vendor].test(prop)) { + deprecated = true; + break; + } + } + + if (!deprecated && typeof source[prop] !== 'function') { + dest[prop] = source[prop]; + } + } + + return dest; + } + + pointerExtend.prefixedPropREs = { + webkit: /(Movement[XY]|Radius[XY]|RotationAngle|Force)$/, + moz: /(Pressure)$/ + }; + var ___default_80 = pointerExtend; + _$pointerExtend_80["default"] = ___default_80; + var _$pointerUtils_81 = {}; + "use strict"; + + Object.defineProperty(_$pointerUtils_81, "__esModule", { + value: true + }); + _$pointerUtils_81.copyCoords = copyCoords; + _$pointerUtils_81.setCoordDeltas = setCoordDeltas; + _$pointerUtils_81.setCoordVelocity = setCoordVelocity; + _$pointerUtils_81.setZeroCoords = setZeroCoords; + _$pointerUtils_81.isNativePointer = isNativePointer; + _$pointerUtils_81.getXY = getXY; + _$pointerUtils_81.getPageXY = getPageXY; + _$pointerUtils_81.getClientXY = getClientXY; + _$pointerUtils_81.getPointerId = getPointerId; + _$pointerUtils_81.setCoords = setCoords; + _$pointerUtils_81.getTouchPair = getTouchPair; + _$pointerUtils_81.pointerAverage = pointerAverage; + _$pointerUtils_81.touchBBox = touchBBox; + _$pointerUtils_81.touchDistance = touchDistance; + _$pointerUtils_81.touchAngle = touchAngle; + _$pointerUtils_81.getPointerType = getPointerType; + _$pointerUtils_81.getEventTargets = getEventTargets; + _$pointerUtils_81.newCoords = newCoords; + _$pointerUtils_81.coordsToEvent = coordsToEvent; + Object.defineProperty(_$pointerUtils_81, "pointerExtend", { + enumerable: true, + get: function get() { + return _$pointerExtend_80["default"]; + } + }); + /* removed: var _$browser_67 = require("./browser.js"); */ + + ; + /* removed: var _$domObjects_70 = require("./domObjects.js"); */ + + ; + /* removed: var _$domUtils_71 = require("./domUtils.js"); */ + + ; + /* removed: var _$hypot_75 = require("./hypot.js"); */ + + ; + /* removed: var _$is_76 = require("./is.js"); */ + + ; + /* removed: var _$pointerExtend_80 = require("./pointerExtend.js"); */ + + ; + + function copyCoords(dest, src) { + dest.page = dest.page || {}; + dest.page.x = src.page.x; + dest.page.y = src.page.y; + dest.client = dest.client || {}; + dest.client.x = src.client.x; + dest.client.y = src.client.y; + dest.timeStamp = src.timeStamp; + } + + function setCoordDeltas(targetObj, prev, cur) { + targetObj.page.x = cur.page.x - prev.page.x; + targetObj.page.y = cur.page.y - prev.page.y; + targetObj.client.x = cur.client.x - prev.client.x; + targetObj.client.y = cur.client.y - prev.client.y; + targetObj.timeStamp = cur.timeStamp - prev.timeStamp; + } + + function setCoordVelocity(targetObj, delta) { + var dt = Math.max(delta.timeStamp / 1000, 0.001); + targetObj.page.x = delta.page.x / dt; + targetObj.page.y = delta.page.y / dt; + targetObj.client.x = delta.client.x / dt; + targetObj.client.y = delta.client.y / dt; + targetObj.timeStamp = dt; + } + + function setZeroCoords(targetObj) { + targetObj.page.x = 0; + targetObj.page.y = 0; + targetObj.client.x = 0; + targetObj.client.y = 0; + } + + function isNativePointer(pointer) { + return pointer instanceof _$domObjects_70["default"].Event || pointer instanceof _$domObjects_70["default"].Touch; + } // Get specified X/Y coords for mouse or event.touches[0] + + + function getXY(type, pointer, xy) { + xy = xy || {}; + type = type || 'page'; + xy.x = pointer[type + 'X']; + xy.y = pointer[type + 'Y']; + return xy; + } + + function getPageXY(pointer, page) { + page = page || { + x: 0, + y: 0 + }; // Opera Mobile handles the viewport and scrolling oddly + + if (_$browser_67["default"].isOperaMobile && isNativePointer(pointer)) { + getXY('screen', pointer, page); + page.x += window.scrollX; + page.y += window.scrollY; + } else { + getXY('page', pointer, page); + } + + return page; + } + + function getClientXY(pointer, client) { + client = client || {}; + + if (_$browser_67["default"].isOperaMobile && isNativePointer(pointer)) { + // Opera Mobile handles the viewport and scrolling oddly + getXY('screen', pointer, client); + } else { + getXY('client', pointer, client); + } + + return client; + } + + function getPointerId(pointer) { + return _$is_76["default"].number(pointer.pointerId) ? pointer.pointerId : pointer.identifier; + } + + function setCoords(targetObj, pointers, timeStamp) { + var pointer = pointers.length > 1 ? pointerAverage(pointers) : pointers[0]; + var tmpXY = {}; + getPageXY(pointer, tmpXY); + targetObj.page.x = tmpXY.x; + targetObj.page.y = tmpXY.y; + getClientXY(pointer, tmpXY); + targetObj.client.x = tmpXY.x; + targetObj.client.y = tmpXY.y; + targetObj.timeStamp = timeStamp; + } + + function getTouchPair(event) { + var touches = []; // array of touches is supplied + + if (_$is_76["default"].array(event)) { + touches[0] = event[0]; + touches[1] = event[1]; + } // an event + else { + if (event.type === 'touchend') { + if (event.touches.length === 1) { + touches[0] = event.touches[0]; + touches[1] = event.changedTouches[0]; + } else if (event.touches.length === 0) { + touches[0] = event.changedTouches[0]; + touches[1] = event.changedTouches[1]; + } + } else { + touches[0] = event.touches[0]; + touches[1] = event.touches[1]; + } + } + + return touches; + } + + function pointerAverage(pointers) { + var average = { + pageX: 0, + pageY: 0, + clientX: 0, + clientY: 0, + screenX: 0, + screenY: 0 + }; + + for (var _i = 0; _i < pointers.length; _i++) { + var _ref; + + _ref = pointers[_i]; + var pointer = _ref; + + for (var _prop in average) { + average[_prop] += pointer[_prop]; + } + } + + for (var prop in average) { + average[prop] /= pointers.length; + } + + return average; + } + + function touchBBox(event) { + if (!event.length && !(event.touches && event.touches.length > 1)) { + return null; + } + + var touches = getTouchPair(event); + var minX = Math.min(touches[0].pageX, touches[1].pageX); + var minY = Math.min(touches[0].pageY, touches[1].pageY); + var maxX = Math.max(touches[0].pageX, touches[1].pageX); + var maxY = Math.max(touches[0].pageY, touches[1].pageY); + return { + x: minX, + y: minY, + left: minX, + top: minY, + right: maxX, + bottom: maxY, + width: maxX - minX, + height: maxY - minY + }; + } + + function touchDistance(event, deltaSource) { + var sourceX = deltaSource + 'X'; + var sourceY = deltaSource + 'Y'; + var touches = getTouchPair(event); + var dx = touches[0][sourceX] - touches[1][sourceX]; + var dy = touches[0][sourceY] - touches[1][sourceY]; + return (0, _$hypot_75["default"])(dx, dy); + } + + function touchAngle(event, deltaSource) { + var sourceX = deltaSource + 'X'; + var sourceY = deltaSource + 'Y'; + var touches = getTouchPair(event); + var dx = touches[1][sourceX] - touches[0][sourceX]; + var dy = touches[1][sourceY] - touches[0][sourceY]; + var angle = 180 * Math.atan2(dy, dx) / Math.PI; + return angle; + } + + function getPointerType(pointer) { + return _$is_76["default"].string(pointer.pointerType) ? pointer.pointerType : _$is_76["default"].number(pointer.pointerType) ? [undefined, undefined, 'touch', 'pen', 'mouse'][pointer.pointerType] // if the PointerEvent API isn't available, then the "pointer" must + // be either a MouseEvent, TouchEvent, or Touch object + : /touch/.test(pointer.type) || pointer instanceof _$domObjects_70["default"].Touch ? 'touch' : 'mouse'; + } // [ event.target, event.currentTarget ] + + + function getEventTargets(event) { + var path = _$is_76["default"].func(event.composedPath) ? event.composedPath() : event.path; + return [_$domUtils_71.getActualElement(path ? path[0] : event.target), _$domUtils_71.getActualElement(event.currentTarget)]; + } + + function newCoords() { + return { + page: { + x: 0, + y: 0 + }, + client: { + x: 0, + y: 0 + }, + timeStamp: 0 + }; + } + + function coordsToEvent(coords) { + var event = { + coords: coords, + + get page() { + return this.coords.page; + }, + + get client() { + return this.coords.client; + }, + + get timeStamp() { + return this.coords.timeStamp; + }, + + get pageX() { + return this.coords.page.x; + }, + + get pageY() { + return this.coords.page.y; + }, + + get clientX() { + return this.coords.client.x; + }, + + get clientY() { + return this.coords.client.y; + }, + + get pointerId() { + return this.coords.pointerId; + }, + + get target() { + return this.coords.target; + }, + + get type() { + return this.coords.type; + }, + + get pointerType() { + return this.coords.pointerType; + }, + + get buttons() { + return this.coords.buttons; + }, + + preventDefault: function preventDefault() {} + }; + return event; + } + + var _$BaseEvent_15 = {}; + "use strict"; + + Object.defineProperty(_$BaseEvent_15, "__esModule", { + value: true + }); + _$BaseEvent_15["default"] = _$BaseEvent_15.BaseEvent = void 0; + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } + + var BaseEvent = /*#__PURE__*/function () { + function BaseEvent(interaction) { + _classCallCheck(this, BaseEvent); + + this.type = void 0; + this.target = void 0; + this.currentTarget = void 0; + this.interactable = void 0; + this._interaction = void 0; + this.timeStamp = void 0; + this.immediatePropagationStopped = false; + this.propagationStopped = false; + this._interaction = interaction; + } + + _createClass(BaseEvent, [{ + key: "preventDefault", + value: function preventDefault() {} + /** + * Don't call any other listeners (even on the current target) + */ + + }, { + key: "stopPropagation", + value: function stopPropagation() { + this.propagationStopped = true; + } + /** + * Don't call listeners on the remaining targets + */ + + }, { + key: "stopImmediatePropagation", + value: function stopImmediatePropagation() { + this.immediatePropagationStopped = this.propagationStopped = true; + } + }]); + + return BaseEvent; + }(); // defined outside of class definition to avoid assignment of undefined during + // construction + // getters and setters defined here to support typescript 3.6 and below which + // don't support getter and setters in .d.ts files + + + _$BaseEvent_15.BaseEvent = BaseEvent; + Object.defineProperty(BaseEvent.prototype, 'interaction', { + get: function get() { + return this._interaction._proxy; + }, + set: function set() {} + }); + var ___default_15 = BaseEvent; + _$BaseEvent_15["default"] = ___default_15; + var _$arr_66 = {}; + "use strict"; + + Object.defineProperty(_$arr_66, "__esModule", { + value: true + }); + _$arr_66.find = _$arr_66.findIndex = _$arr_66.from = _$arr_66.merge = _$arr_66.remove = _$arr_66.contains = void 0; + + var contains = function contains(array, target) { + return array.indexOf(target) !== -1; + }; + + _$arr_66.contains = contains; + + var remove = function remove(array, target) { + return array.splice(array.indexOf(target), 1); + }; + + _$arr_66.remove = remove; + + var merge = function merge(target, source) { + for (var _i = 0; _i < source.length; _i++) { + var _ref; + + _ref = source[_i]; + var item = _ref; + target.push(item); + } + + return target; + }; + + _$arr_66.merge = merge; + + var from = function from(source) { + return merge([], source); + }; + + _$arr_66.from = from; + + var findIndex = function findIndex(array, func) { + for (var i = 0; i < array.length; i++) { + if (func(array[i], i, array)) { + return i; + } + } + + return -1; + }; + + _$arr_66.findIndex = findIndex; + + var find = function find(array, func) { + return array[findIndex(array, func)]; + }; + + _$arr_66.find = find; + var _$DropEvent_2 = {}; + "use strict"; + + Object.defineProperty(_$DropEvent_2, "__esModule", { + value: true + }); + _$DropEvent_2.DropEvent = void 0; + /* removed: var _$BaseEvent_15 = require("../../core/BaseEvent.js"); */ + + ; + /* removed: var _$arr_66 = require("../../utils/arr.js"); */ + + ; + + function ___typeof_2(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + ___typeof_2 = function _typeof(obj) { + return typeof obj; + }; + } else { + ___typeof_2 = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + + return ___typeof_2(obj); + } + + function ___classCallCheck_2(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function ___defineProperties_2(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function ___createClass_2(Constructor, protoProps, staticProps) { + if (protoProps) ___defineProperties_2(Constructor.prototype, protoProps); + if (staticProps) ___defineProperties_2(Constructor, staticProps); + return Constructor; + } + + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function"); + } + + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + writable: true, + configurable: true + } + }); + if (superClass) _setPrototypeOf(subClass, superClass); + } + + function _setPrototypeOf(o, p) { + _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + + return _setPrototypeOf(o, p); + } + + function _createSuper(Derived) { + var hasNativeReflectConstruct = _isNativeReflectConstruct(); + + return function () { + var Super = _getPrototypeOf(Derived), + result; + + if (hasNativeReflectConstruct) { + var NewTarget = _getPrototypeOf(this).constructor; + + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + + return _possibleConstructorReturn(this, result); + }; + } + + function _possibleConstructorReturn(self, call) { + if (call && (___typeof_2(call) === "object" || typeof call === "function")) { + return call; + } + + return _assertThisInitialized(self); + } + + function _assertThisInitialized(self) { + if (self === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return self; + } + + function _isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === "function") return true; + + try { + Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); + return true; + } catch (e) { + return false; + } + } + + function _getPrototypeOf(o) { + _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return _getPrototypeOf(o); + } + + var DropEvent = /*#__PURE__*/function (_BaseEvent) { + _inherits(DropEvent, _BaseEvent); + + var _super = _createSuper(DropEvent); + /** + * Class of events fired on dropzones during drags with acceptable targets. + */ + + + function DropEvent(dropState, dragEvent, type) { + var _this; + + ___classCallCheck_2(this, DropEvent); + + _this = _super.call(this, dragEvent._interaction); + _this.target = void 0; + _this.dropzone = void 0; + _this.dragEvent = void 0; + _this.relatedTarget = void 0; + _this.draggable = void 0; + _this.timeStamp = void 0; + _this.propagationStopped = false; + _this.immediatePropagationStopped = false; + + var _ref = type === 'dragleave' ? dropState.prev : dropState.cur, + element = _ref.element, + dropzone = _ref.dropzone; + + _this.type = type; + _this.target = element; + _this.currentTarget = element; + _this.dropzone = dropzone; + _this.dragEvent = dragEvent; + _this.relatedTarget = dragEvent.target; + _this.draggable = dragEvent.interactable; + _this.timeStamp = dragEvent.timeStamp; + return _this; + } + /** + * If this is a `dropactivate` event, the dropzone element will be + * deactivated. + * + * If this is a `dragmove` or `dragenter`, a `dragleave` will be fired on the + * dropzone element and more. + */ + + + ___createClass_2(DropEvent, [{ + key: "reject", + value: function reject() { + var _this2 = this; + + var dropState = this._interaction.dropState; + + if (this.type !== 'dropactivate' && (!this.dropzone || dropState.cur.dropzone !== this.dropzone || dropState.cur.element !== this.target)) { + return; + } + + dropState.prev.dropzone = this.dropzone; + dropState.prev.element = this.target; + dropState.rejected = true; + dropState.events.enter = null; + this.stopImmediatePropagation(); + + if (this.type === 'dropactivate') { + var activeDrops = dropState.activeDrops; + + var index = _$arr_66.findIndex(activeDrops, function (_ref2) { + var dropzone = _ref2.dropzone, + element = _ref2.element; + return dropzone === _this2.dropzone && element === _this2.target; + }); + + dropState.activeDrops.splice(index, 1); + var deactivateEvent = new DropEvent(dropState, this.dragEvent, 'dropdeactivate'); + deactivateEvent.dropzone = this.dropzone; + deactivateEvent.target = this.target; + this.dropzone.fire(deactivateEvent); + } else { + this.dropzone.fire(new DropEvent(dropState, this.dragEvent, 'dragleave')); + } + } + }, { + key: "preventDefault", + value: function preventDefault() {} + }, { + key: "stopPropagation", + value: function stopPropagation() { + this.propagationStopped = true; + } + }, { + key: "stopImmediatePropagation", + value: function stopImmediatePropagation() { + this.immediatePropagationStopped = this.propagationStopped = true; + } + }]); + + return DropEvent; + }(_$BaseEvent_15.BaseEvent); + + _$DropEvent_2.DropEvent = DropEvent; + var _$plugin_3 = {}; + "use strict"; + + Object.defineProperty(_$plugin_3, "__esModule", { + value: true + }); + _$plugin_3["default"] = void 0; + /* removed: var _$domUtils_71 = require("../../utils/domUtils.js"); */ + + ; + /* removed: var _$extend_73 = require("../../utils/extend.js"); */ + + ; + /* removed: var _$getOriginXY_74 = require("../../utils/getOriginXY.js"); */ + + ; + /* removed: var _$is_76 = require("../../utils/is.js"); */ + + ; + /* removed: var _$normalizeListeners_79 = require("../../utils/normalizeListeners.js"); */ + + ; + /* removed: var _$pointerUtils_81 = require("../../utils/pointerUtils.js"); */ + + ; + /* removed: var _$plugin_1 = require("../drag/plugin.js"); */ + + ; + /* removed: var _$DropEvent_2 = require("./DropEvent.js"); */ + + ; + + function __install_3(scope) { + var actions = scope.actions, + interact = scope.interactStatic, + Interactable = scope.Interactable, + defaults = scope.defaults; + scope.usePlugin(_$plugin_1["default"]); + /** + * + * ```js + * interact('.drop').dropzone({ + * accept: '.can-drop' || document.getElementById('single-drop'), + * overlap: 'pointer' || 'center' || zeroToOne + * } + * ``` + * + * Returns or sets whether draggables can be dropped onto this target to + * trigger drop events + * + * Dropzones can receive the following events: + * - `dropactivate` and `dropdeactivate` when an acceptable drag starts and ends + * - `dragenter` and `dragleave` when a draggable enters and leaves the dropzone + * - `dragmove` when a draggable that has entered the dropzone is moved + * - `drop` when a draggable is dropped into this dropzone + * + * Use the `accept` option to allow only elements that match the given CSS + * selector or element. The value can be: + * + * - **an Element** - only that element can be dropped into this dropzone. + * - **a string**, - the element being dragged must match it as a CSS selector. + * - **`null`** - accept options is cleared - it accepts any element. + * + * Use the `overlap` option to set how drops are checked for. The allowed + * values are: + * + * - `'pointer'`, the pointer must be over the dropzone (default) + * - `'center'`, the draggable element's center must be over the dropzone + * - a number from 0-1 which is the `(intersection area) / (draggable area)`. + * e.g. `0.5` for drop to happen when half of the area of the draggable is + * over the dropzone + * + * Use the `checker` option to specify a function to check if a dragged element + * is over this Interactable. + * + * @param {boolean | object | null} [options] The new options to be set. + * @return {boolean | Interactable} The current setting or this Interactable + */ + + Interactable.prototype.dropzone = function (options) { + return dropzoneMethod(this, options); + }; + /** + * ```js + * interact(target) + * .dropChecker(function(dragEvent, // related dragmove or dragend event + * event, // TouchEvent/PointerEvent/MouseEvent + * dropped, // bool result of the default checker + * dropzone, // dropzone Interactable + * dropElement, // dropzone elemnt + * draggable, // draggable Interactable + * draggableElement) {// draggable element + * + * return dropped && event.target.hasAttribute('allow-drop') + * } + * ``` + */ + + + Interactable.prototype.dropCheck = function (dragEvent, event, draggable, draggableElement, dropElement, rect) { + return dropCheckMethod(this, dragEvent, event, draggable, draggableElement, dropElement, rect); + }; + /** + * Returns or sets whether the dimensions of dropzone elements are calculated + * on every dragmove or only on dragstart for the default dropChecker + * + * @param {boolean} [newValue] True to check on each move. False to check only + * before start + * @return {boolean | interact} The current setting or interact + */ + + + interact.dynamicDrop = function (newValue) { + if (_$is_76["default"].bool(newValue)) { + // if (dragging && scope.dynamicDrop !== newValue && !newValue) { + // calcRects(dropzones) + // } + scope.dynamicDrop = newValue; + return interact; + } + + return scope.dynamicDrop; + }; + + (0, _$extend_73["default"])(actions.phaselessTypes, { + dragenter: true, + dragleave: true, + dropactivate: true, + dropdeactivate: true, + dropmove: true, + drop: true + }); + actions.methodDict.drop = 'dropzone'; + scope.dynamicDrop = false; + defaults.actions.drop = drop.defaults; + } + + function collectDrops(_ref, draggableElement) { + var interactables = _ref.interactables; + var drops = []; // collect all dropzones and their elements which qualify for a drop + + for (var _i = 0; _i < interactables.list.length; _i++) { + var _ref2; + + _ref2 = interactables.list[_i]; + var dropzone = _ref2; + + if (!dropzone.options.drop.enabled) { + continue; + } + + var accept = dropzone.options.drop.accept; // test the draggable draggableElement against the dropzone's accept setting + + if (_$is_76["default"].element(accept) && accept !== draggableElement || _$is_76["default"].string(accept) && !_$domUtils_71.matchesSelector(draggableElement, accept) || _$is_76["default"].func(accept) && !accept({ + dropzone: dropzone, + draggableElement: draggableElement + })) { + continue; + } // query for new elements if necessary + + + var dropElements = _$is_76["default"].string(dropzone.target) ? dropzone._context.querySelectorAll(dropzone.target) : _$is_76["default"].array(dropzone.target) ? dropzone.target : [dropzone.target]; + + for (var _i2 = 0; _i2 < dropElements.length; _i2++) { + var _ref3; + + _ref3 = dropElements[_i2]; + var dropzoneElement = _ref3; + + if (dropzoneElement !== draggableElement) { + drops.push({ + dropzone: dropzone, + element: dropzoneElement + }); + } + } + } + + return drops; + } + + function fireActivationEvents(activeDrops, event) { + // loop through all active dropzones and trigger event + for (var _i3 = 0; _i3 < activeDrops.slice().length; _i3++) { + var _ref4; + + _ref4 = activeDrops.slice()[_i3]; + var _ref5 = _ref4, + dropzone = _ref5.dropzone, + element = _ref5.element; + event.dropzone = dropzone; // set current element as event target + + event.target = element; + dropzone.fire(event); + event.propagationStopped = event.immediatePropagationStopped = false; + } + } // return a new array of possible drops. getActiveDrops should always be + // called when a drag has just started or a drag event happens while + // dynamicDrop is true + + + function getActiveDrops(scope, dragElement) { + // get dropzones and their elements that could receive the draggable + var activeDrops = collectDrops(scope, dragElement); + + for (var _i4 = 0; _i4 < activeDrops.length; _i4++) { + var _ref6; + + _ref6 = activeDrops[_i4]; + var activeDrop = _ref6; + activeDrop.rect = activeDrop.dropzone.getRect(activeDrop.element); + } + + return activeDrops; + } + + function getDrop(_ref7, dragEvent, pointerEvent) { + var dropState = _ref7.dropState, + draggable = _ref7.interactable, + dragElement = _ref7.element; + var validDrops = []; // collect all dropzones and their elements which qualify for a drop + + for (var _i5 = 0; _i5 < dropState.activeDrops.length; _i5++) { + var _ref8; + + _ref8 = dropState.activeDrops[_i5]; + var _ref9 = _ref8, + dropzone = _ref9.dropzone, + dropzoneElement = _ref9.element, + rect = _ref9.rect; + validDrops.push(dropzone.dropCheck(dragEvent, pointerEvent, draggable, dragElement, dropzoneElement, rect) ? dropzoneElement : null); + } // get the most appropriate dropzone based on DOM depth and order + + + var dropIndex = _$domUtils_71.indexOfDeepestElement(validDrops); + + return dropState.activeDrops[dropIndex] || null; + } + + function getDropEvents(interaction, _pointerEvent, dragEvent) { + var dropState = interaction.dropState; + var dropEvents = { + enter: null, + leave: null, + activate: null, + deactivate: null, + move: null, + drop: null + }; + + if (dragEvent.type === 'dragstart') { + dropEvents.activate = new _$DropEvent_2.DropEvent(dropState, dragEvent, 'dropactivate'); + dropEvents.activate.target = null; + dropEvents.activate.dropzone = null; + } + + if (dragEvent.type === 'dragend') { + dropEvents.deactivate = new _$DropEvent_2.DropEvent(dropState, dragEvent, 'dropdeactivate'); + dropEvents.deactivate.target = null; + dropEvents.deactivate.dropzone = null; + } + + if (dropState.rejected) { + return dropEvents; + } + + if (dropState.cur.element !== dropState.prev.element) { + // if there was a previous dropzone, create a dragleave event + if (dropState.prev.dropzone) { + dropEvents.leave = new _$DropEvent_2.DropEvent(dropState, dragEvent, 'dragleave'); + dragEvent.dragLeave = dropEvents.leave.target = dropState.prev.element; + dragEvent.prevDropzone = dropEvents.leave.dropzone = dropState.prev.dropzone; + } // if dropzone is not null, create a dragenter event + + + if (dropState.cur.dropzone) { + dropEvents.enter = new _$DropEvent_2.DropEvent(dropState, dragEvent, 'dragenter'); + dragEvent.dragEnter = dropState.cur.element; + dragEvent.dropzone = dropState.cur.dropzone; + } + } + + if (dragEvent.type === 'dragend' && dropState.cur.dropzone) { + dropEvents.drop = new _$DropEvent_2.DropEvent(dropState, dragEvent, 'drop'); + dragEvent.dropzone = dropState.cur.dropzone; + dragEvent.relatedTarget = dropState.cur.element; + } + + if (dragEvent.type === 'dragmove' && dropState.cur.dropzone) { + dropEvents.move = new _$DropEvent_2.DropEvent(dropState, dragEvent, 'dropmove'); + dropEvents.move.dragmove = dragEvent; + dragEvent.dropzone = dropState.cur.dropzone; + } + + return dropEvents; + } + + function fireDropEvents(interaction, events) { + var dropState = interaction.dropState; + var activeDrops = dropState.activeDrops, + cur = dropState.cur, + prev = dropState.prev; + + if (events.leave) { + prev.dropzone.fire(events.leave); + } + + if (events.move) { + cur.dropzone.fire(events.move); + } + + if (events.enter) { + cur.dropzone.fire(events.enter); + } + + if (events.drop) { + cur.dropzone.fire(events.drop); + } + + if (events.deactivate) { + fireActivationEvents(activeDrops, events.deactivate); + } + + dropState.prev.dropzone = cur.dropzone; + dropState.prev.element = cur.element; + } + + function onEventCreated(_ref10, scope) { + var interaction = _ref10.interaction, + iEvent = _ref10.iEvent, + event = _ref10.event; + + if (iEvent.type !== 'dragmove' && iEvent.type !== 'dragend') { + return; + } + + var dropState = interaction.dropState; + + if (scope.dynamicDrop) { + dropState.activeDrops = getActiveDrops(scope, interaction.element); + } + + var dragEvent = iEvent; + var dropResult = getDrop(interaction, dragEvent, event); // update rejected status + + dropState.rejected = dropState.rejected && !!dropResult && dropResult.dropzone === dropState.cur.dropzone && dropResult.element === dropState.cur.element; + dropState.cur.dropzone = dropResult && dropResult.dropzone; + dropState.cur.element = dropResult && dropResult.element; + dropState.events = getDropEvents(interaction, event, dragEvent); + } + + function dropzoneMethod(interactable, options) { + if (_$is_76["default"].object(options)) { + interactable.options.drop.enabled = options.enabled !== false; + + if (options.listeners) { + var normalized = (0, _$normalizeListeners_79["default"])(options.listeners); // rename 'drop' to '' as it will be prefixed with 'drop' + + var corrected = Object.keys(normalized).reduce(function (acc, type) { + var correctedType = /^(enter|leave)/.test(type) ? "drag".concat(type) : /^(activate|deactivate|move)/.test(type) ? "drop".concat(type) : type; + acc[correctedType] = normalized[type]; + return acc; + }, {}); + interactable.off(interactable.options.drop.listeners); + interactable.on(corrected); + interactable.options.drop.listeners = corrected; + } + + if (_$is_76["default"].func(options.ondrop)) { + interactable.on('drop', options.ondrop); + } + + if (_$is_76["default"].func(options.ondropactivate)) { + interactable.on('dropactivate', options.ondropactivate); + } + + if (_$is_76["default"].func(options.ondropdeactivate)) { + interactable.on('dropdeactivate', options.ondropdeactivate); + } + + if (_$is_76["default"].func(options.ondragenter)) { + interactable.on('dragenter', options.ondragenter); + } + + if (_$is_76["default"].func(options.ondragleave)) { + interactable.on('dragleave', options.ondragleave); + } + + if (_$is_76["default"].func(options.ondropmove)) { + interactable.on('dropmove', options.ondropmove); + } + + if (/^(pointer|center)$/.test(options.overlap)) { + interactable.options.drop.overlap = options.overlap; + } else if (_$is_76["default"].number(options.overlap)) { + interactable.options.drop.overlap = Math.max(Math.min(1, options.overlap), 0); + } + + if ('accept' in options) { + interactable.options.drop.accept = options.accept; + } + + if ('checker' in options) { + interactable.options.drop.checker = options.checker; + } + + return interactable; + } + + if (_$is_76["default"].bool(options)) { + interactable.options.drop.enabled = options; + return interactable; + } + + return interactable.options.drop; + } + + function dropCheckMethod(interactable, dragEvent, event, draggable, draggableElement, dropElement, rect) { + var dropped = false; // if the dropzone has no rect (eg. display: none) + // call the custom dropChecker or just return false + + if (!(rect = rect || interactable.getRect(dropElement))) { + return interactable.options.drop.checker ? interactable.options.drop.checker(dragEvent, event, dropped, interactable, dropElement, draggable, draggableElement) : false; + } + + var dropOverlap = interactable.options.drop.overlap; + + if (dropOverlap === 'pointer') { + var origin = (0, _$getOriginXY_74["default"])(draggable, draggableElement, 'drag'); + + var page = _$pointerUtils_81.getPageXY(dragEvent); + + page.x += origin.x; + page.y += origin.y; + var horizontal = page.x > rect.left && page.x < rect.right; + var vertical = page.y > rect.top && page.y < rect.bottom; + dropped = horizontal && vertical; + } + + var dragRect = draggable.getRect(draggableElement); + + if (dragRect && dropOverlap === 'center') { + var cx = dragRect.left + dragRect.width / 2; + var cy = dragRect.top + dragRect.height / 2; + dropped = cx >= rect.left && cx <= rect.right && cy >= rect.top && cy <= rect.bottom; + } + + if (dragRect && _$is_76["default"].number(dropOverlap)) { + var overlapArea = Math.max(0, Math.min(rect.right, dragRect.right) - Math.max(rect.left, dragRect.left)) * Math.max(0, Math.min(rect.bottom, dragRect.bottom) - Math.max(rect.top, dragRect.top)); + var overlapRatio = overlapArea / (dragRect.width * dragRect.height); + dropped = overlapRatio >= dropOverlap; + } + + if (interactable.options.drop.checker) { + dropped = interactable.options.drop.checker(dragEvent, event, dropped, interactable, dropElement, draggable, draggableElement); + } + + return dropped; + } + + var drop = { + id: 'actions/drop', + install: __install_3, + listeners: { + 'interactions:before-action-start': function interactionsBeforeActionStart(_ref11) { + var interaction = _ref11.interaction; + + if (interaction.prepared.name !== 'drag') { + return; + } + + interaction.dropState = { + cur: { + dropzone: null, + element: null + }, + prev: { + dropzone: null, + element: null + }, + rejected: null, + events: null, + activeDrops: [] + }; + }, + 'interactions:after-action-start': function interactionsAfterActionStart(_ref12, scope) { + var interaction = _ref12.interaction, + event = _ref12.event, + dragEvent = _ref12.iEvent; + + if (interaction.prepared.name !== 'drag') { + return; + } + + var dropState = interaction.dropState; // reset active dropzones + + dropState.activeDrops = null; + dropState.events = null; + dropState.activeDrops = getActiveDrops(scope, interaction.element); + dropState.events = getDropEvents(interaction, event, dragEvent); + + if (dropState.events.activate) { + fireActivationEvents(dropState.activeDrops, dropState.events.activate); + scope.fire('actions/drop:start', { + interaction: interaction, + dragEvent: dragEvent + }); + } + }, + // FIXME proper signal types + 'interactions:action-move': onEventCreated, + 'interactions:action-end': onEventCreated, + 'interactions:after-action-move': function fireDropAfterMove(_ref13, scope) { + var interaction = _ref13.interaction, + dragEvent = _ref13.iEvent; + + if (interaction.prepared.name !== 'drag') { + return; + } + + fireDropEvents(interaction, interaction.dropState.events); + scope.fire('actions/drop:move', { + interaction: interaction, + dragEvent: dragEvent + }); + interaction.dropState.events = {}; + }, + 'interactions:after-action-end': function interactionsAfterActionEnd(_ref14, scope) { + var interaction = _ref14.interaction, + dragEvent = _ref14.iEvent; + + if (interaction.prepared.name !== 'drag') { + return; + } + + fireDropEvents(interaction, interaction.dropState.events); + scope.fire('actions/drop:end', { + interaction: interaction, + dragEvent: dragEvent + }); + }, + 'interactions:stop': function interactionsStop(_ref15) { + var interaction = _ref15.interaction; + + if (interaction.prepared.name !== 'drag') { + return; + } + + var dropState = interaction.dropState; + + if (dropState) { + dropState.activeDrops = null; + dropState.events = null; + dropState.cur.dropzone = null; + dropState.cur.element = null; + dropState.prev.dropzone = null; + dropState.prev.element = null; + dropState.rejected = false; + } + } + }, + getActiveDrops: getActiveDrops, + getDrop: getDrop, + getDropEvents: getDropEvents, + fireDropEvents: fireDropEvents, + defaults: { + enabled: false, + accept: null, + overlap: 'pointer' + } + }; + var ___default_3 = drop; + _$plugin_3["default"] = ___default_3; + var _$plugin_4 = {}; + "use strict"; + + Object.defineProperty(_$plugin_4, "__esModule", { + value: true + }); + _$plugin_4["default"] = void 0; + /* removed: var _$is_76 = require("../../utils/is.js"); */ + + ; + /* removed: var _$pointerUtils_81 = require("../../utils/pointerUtils.js"); */ + + ; + + function __install_4(scope) { + var actions = scope.actions, + Interactable = scope.Interactable, + defaults = scope.defaults; + /** + * ```js + * interact(element).gesturable({ + * onstart: function (event) {}, + * onmove : function (event) {}, + * onend : function (event) {}, + * + * // limit multiple gestures. + * // See the explanation in {@link Interactable.draggable} example + * max: Infinity, + * maxPerElement: 1, + * }) + * + * var isGestureable = interact(element).gesturable() + * ``` + * + * Gets or sets whether multitouch gestures can be performed on the target + * + * @param {boolean | object} [options] true/false or An object with event + * listeners to be fired on gesture events (makes the Interactable gesturable) + * @return {boolean | Interactable} A boolean indicating if this can be the + * target of gesture events, or this Interactable + */ + + Interactable.prototype.gesturable = function (options) { + if (_$is_76["default"].object(options)) { + this.options.gesture.enabled = options.enabled !== false; + this.setPerAction('gesture', options); + this.setOnEvents('gesture', options); + return this; + } + + if (_$is_76["default"].bool(options)) { + this.options.gesture.enabled = options; + return this; + } + + return this.options.gesture; + }; + + actions.map.gesture = gesture; + actions.methodDict.gesture = 'gesturable'; + defaults.actions.gesture = gesture.defaults; + } + + function updateGestureProps(_ref) { + var interaction = _ref.interaction, + iEvent = _ref.iEvent, + phase = _ref.phase; + + if (interaction.prepared.name !== 'gesture') { + return; + } + + var pointers = interaction.pointers.map(function (p) { + return p.pointer; + }); + var starting = phase === 'start'; + var ending = phase === 'end'; + var deltaSource = interaction.interactable.options.deltaSource; + iEvent.touches = [pointers[0], pointers[1]]; + + if (starting) { + iEvent.distance = _$pointerUtils_81.touchDistance(pointers, deltaSource); + iEvent.box = _$pointerUtils_81.touchBBox(pointers); + iEvent.scale = 1; + iEvent.ds = 0; + iEvent.angle = _$pointerUtils_81.touchAngle(pointers, deltaSource); + iEvent.da = 0; + interaction.gesture.startDistance = iEvent.distance; + interaction.gesture.startAngle = iEvent.angle; + } else if (ending) { + var prevEvent = interaction.prevEvent; + iEvent.distance = prevEvent.distance; + iEvent.box = prevEvent.box; + iEvent.scale = prevEvent.scale; + iEvent.ds = 0; + iEvent.angle = prevEvent.angle; + iEvent.da = 0; + } else { + iEvent.distance = _$pointerUtils_81.touchDistance(pointers, deltaSource); + iEvent.box = _$pointerUtils_81.touchBBox(pointers); + iEvent.scale = iEvent.distance / interaction.gesture.startDistance; + iEvent.angle = _$pointerUtils_81.touchAngle(pointers, deltaSource); + iEvent.ds = iEvent.scale - interaction.gesture.scale; + iEvent.da = iEvent.angle - interaction.gesture.angle; + } + + interaction.gesture.distance = iEvent.distance; + interaction.gesture.angle = iEvent.angle; + + if (_$is_76["default"].number(iEvent.scale) && iEvent.scale !== Infinity && !isNaN(iEvent.scale)) { + interaction.gesture.scale = iEvent.scale; + } + } + + var gesture = { + id: 'actions/gesture', + before: ['actions/drag', 'actions/resize'], + install: __install_4, + listeners: { + 'interactions:action-start': updateGestureProps, + 'interactions:action-move': updateGestureProps, + 'interactions:action-end': updateGestureProps, + 'interactions:new': function interactionsNew(_ref2) { + var interaction = _ref2.interaction; + interaction.gesture = { + angle: 0, + distance: 0, + scale: 1, + startAngle: 0, + startDistance: 0 + }; + }, + 'auto-start:check': function autoStartCheck(arg) { + if (arg.interaction.pointers.length < 2) { + return undefined; + } + + var gestureOptions = arg.interactable.options.gesture; + + if (!(gestureOptions && gestureOptions.enabled)) { + return undefined; + } + + arg.action = { + name: 'gesture' + }; + return false; + } + }, + defaults: {}, + getCursor: function getCursor() { + return ''; + } + }; + var ___default_4 = gesture; + _$plugin_4["default"] = ___default_4; + var _$plugin_6 = {}; + "use strict"; + + Object.defineProperty(_$plugin_6, "__esModule", { + value: true + }); + _$plugin_6["default"] = void 0; + /* removed: var _$domUtils_71 = require("../../utils/domUtils.js"); */ + + ; + /* removed: var _$extend_73 = require("../../utils/extend.js"); */ + + ; + /* removed: var _$is_76 = require("../../utils/is.js"); */ + + ; + + function __install_6(scope) { + var actions = scope.actions, + browser = scope.browser, + Interactable = scope.Interactable, + defaults = scope.defaults; // Less Precision with touch input + + resize.cursors = initCursors(browser); + resize.defaultMargin = browser.supportsTouch || browser.supportsPointerEvent ? 20 : 10; + /** + * ```js + * interact(element).resizable({ + * onstart: function (event) {}, + * onmove : function (event) {}, + * onend : function (event) {}, + * + * edges: { + * top : true, // Use pointer coords to check for resize. + * left : false, // Disable resizing from left edge. + * bottom: '.resize-s',// Resize if pointer target matches selector + * right : handleEl // Resize if pointer target is the given Element + * }, + * + * // Width and height can be adjusted independently. When `true`, width and + * // height are adjusted at a 1:1 ratio. + * square: false, + * + * // Width and height can be adjusted independently. When `true`, width and + * // height maintain the aspect ratio they had when resizing started. + * preserveAspectRatio: false, + * + * // a value of 'none' will limit the resize rect to a minimum of 0x0 + * // 'negate' will allow the rect to have negative width/height + * // 'reposition' will keep the width/height positive by swapping + * // the top and bottom edges and/or swapping the left and right edges + * invert: 'none' || 'negate' || 'reposition' + * + * // limit multiple resizes. + * // See the explanation in the {@link Interactable.draggable} example + * max: Infinity, + * maxPerElement: 1, + * }) + * + * var isResizeable = interact(element).resizable() + * ``` + * + * Gets or sets whether resize actions can be performed on the target + * + * @param {boolean | object} [options] true/false or An object with event + * listeners to be fired on resize events (object makes the Interactable + * resizable) + * @return {boolean | Interactable} A boolean indicating if this can be the + * target of resize elements, or this Interactable + */ + + Interactable.prototype.resizable = function (options) { + return resizable(this, options, scope); + }; + + actions.map.resize = resize; + actions.methodDict.resize = 'resizable'; + defaults.actions.resize = resize.defaults; + } + + function resizeChecker(arg) { + var interaction = arg.interaction, + interactable = arg.interactable, + element = arg.element, + rect = arg.rect, + buttons = arg.buttons; + + if (!rect) { + return undefined; + } + + var page = (0, _$extend_73["default"])({}, interaction.coords.cur.page); + var resizeOptions = interactable.options.resize; + + if (!(resizeOptions && resizeOptions.enabled) || // check mouseButton setting if the pointer is down + interaction.pointerIsDown && /mouse|pointer/.test(interaction.pointerType) && (buttons & resizeOptions.mouseButtons) === 0) { + return undefined; + } // if using resize.edges + + + if (_$is_76["default"].object(resizeOptions.edges)) { + var resizeEdges = { + left: false, + right: false, + top: false, + bottom: false + }; + + for (var edge in resizeEdges) { + resizeEdges[edge] = checkResizeEdge(edge, resizeOptions.edges[edge], page, interaction._latestPointer.eventTarget, element, rect, resizeOptions.margin || resize.defaultMargin); + } + + resizeEdges.left = resizeEdges.left && !resizeEdges.right; + resizeEdges.top = resizeEdges.top && !resizeEdges.bottom; + + if (resizeEdges.left || resizeEdges.right || resizeEdges.top || resizeEdges.bottom) { + arg.action = { + name: 'resize', + edges: resizeEdges + }; + } + } else { + var right = resizeOptions.axis !== 'y' && page.x > rect.right - resize.defaultMargin; + var bottom = resizeOptions.axis !== 'x' && page.y > rect.bottom - resize.defaultMargin; + + if (right || bottom) { + arg.action = { + name: 'resize', + axes: (right ? 'x' : '') + (bottom ? 'y' : '') + }; + } + } + + return arg.action ? false : undefined; + } + + function resizable(interactable, options, scope) { + if (_$is_76["default"].object(options)) { + interactable.options.resize.enabled = options.enabled !== false; + interactable.setPerAction('resize', options); + interactable.setOnEvents('resize', options); + + if (_$is_76["default"].string(options.axis) && /^x$|^y$|^xy$/.test(options.axis)) { + interactable.options.resize.axis = options.axis; + } else if (options.axis === null) { + interactable.options.resize.axis = scope.defaults.actions.resize.axis; + } + + if (_$is_76["default"].bool(options.preserveAspectRatio)) { + interactable.options.resize.preserveAspectRatio = options.preserveAspectRatio; + } else if (_$is_76["default"].bool(options.square)) { + interactable.options.resize.square = options.square; + } + + return interactable; + } + + if (_$is_76["default"].bool(options)) { + interactable.options.resize.enabled = options; + return interactable; + } + + return interactable.options.resize; + } + + function checkResizeEdge(name, value, page, element, interactableElement, rect, margin) { + // false, '', undefined, null + if (!value) { + return false; + } // true value, use pointer coords and element rect + + + if (value === true) { + // if dimensions are negative, "switch" edges + var width = _$is_76["default"].number(rect.width) ? rect.width : rect.right - rect.left; + var height = _$is_76["default"].number(rect.height) ? rect.height : rect.bottom - rect.top; // don't use margin greater than half the relevent dimension + + margin = Math.min(margin, Math.abs((name === 'left' || name === 'right' ? width : height) / 2)); + + if (width < 0) { + if (name === 'left') { + name = 'right'; + } else if (name === 'right') { + name = 'left'; + } + } + + if (height < 0) { + if (name === 'top') { + name = 'bottom'; + } else if (name === 'bottom') { + name = 'top'; + } + } + + if (name === 'left') { + return page.x < (width >= 0 ? rect.left : rect.right) + margin; + } + + if (name === 'top') { + return page.y < (height >= 0 ? rect.top : rect.bottom) + margin; + } + + if (name === 'right') { + return page.x > (width >= 0 ? rect.right : rect.left) - margin; + } + + if (name === 'bottom') { + return page.y > (height >= 0 ? rect.bottom : rect.top) - margin; + } + } // the remaining checks require an element + + + if (!_$is_76["default"].element(element)) { + return false; + } + + return _$is_76["default"].element(value) // the value is an element to use as a resize handle + ? value === element // otherwise check if element matches value as selector + : _$domUtils_71.matchesUpTo(element, value, interactableElement); + } + + function initCursors(browser) { + return browser.isIe9 ? { + x: 'e-resize', + y: 's-resize', + xy: 'se-resize', + top: 'n-resize', + left: 'w-resize', + bottom: 's-resize', + right: 'e-resize', + topleft: 'se-resize', + bottomright: 'se-resize', + topright: 'ne-resize', + bottomleft: 'ne-resize' + } : { + x: 'ew-resize', + y: 'ns-resize', + xy: 'nwse-resize', + top: 'ns-resize', + left: 'ew-resize', + bottom: 'ns-resize', + right: 'ew-resize', + topleft: 'nwse-resize', + bottomright: 'nwse-resize', + topright: 'nesw-resize', + bottomleft: 'nesw-resize' + }; + } + + function start(_ref) { + var iEvent = _ref.iEvent, + interaction = _ref.interaction; + + if (interaction.prepared.name !== 'resize' || !interaction.prepared.edges) { + return; + } + + var resizeEvent = iEvent; + var rect = interaction.rect; + interaction._rects = { + start: (0, _$extend_73["default"])({}, rect), + corrected: (0, _$extend_73["default"])({}, rect), + previous: (0, _$extend_73["default"])({}, rect), + delta: { + left: 0, + right: 0, + width: 0, + top: 0, + bottom: 0, + height: 0 + } + }; + resizeEvent.edges = interaction.prepared.edges; + resizeEvent.rect = interaction._rects.corrected; + resizeEvent.deltaRect = interaction._rects.delta; + } + + function __move_6(_ref2) { + var iEvent = _ref2.iEvent, + interaction = _ref2.interaction; + + if (interaction.prepared.name !== 'resize' || !interaction.prepared.edges) { + return; + } + + var resizeEvent = iEvent; + var resizeOptions = interaction.interactable.options.resize; + var invert = resizeOptions.invert; + var invertible = invert === 'reposition' || invert === 'negate'; // eslint-disable-next-line no-shadow + + var current = interaction.rect; + var _interaction$_rects = interaction._rects, + startRect = _interaction$_rects.start, + corrected = _interaction$_rects.corrected, + deltaRect = _interaction$_rects.delta, + previous = _interaction$_rects.previous; + (0, _$extend_73["default"])(previous, corrected); + + if (invertible) { + // if invertible, copy the current rect + (0, _$extend_73["default"])(corrected, current); + + if (invert === 'reposition') { + // swap edge values if necessary to keep width/height positive + if (corrected.top > corrected.bottom) { + var swap = corrected.top; + corrected.top = corrected.bottom; + corrected.bottom = swap; + } + + if (corrected.left > corrected.right) { + var _swap = corrected.left; + corrected.left = corrected.right; + corrected.right = _swap; + } + } + } else { + // if not invertible, restrict to minimum of 0x0 rect + corrected.top = Math.min(current.top, startRect.bottom); + corrected.bottom = Math.max(current.bottom, startRect.top); + corrected.left = Math.min(current.left, startRect.right); + corrected.right = Math.max(current.right, startRect.left); + } + + corrected.width = corrected.right - corrected.left; + corrected.height = corrected.bottom - corrected.top; + + for (var edge in corrected) { + deltaRect[edge] = corrected[edge] - previous[edge]; + } + + resizeEvent.edges = interaction.prepared.edges; + resizeEvent.rect = corrected; + resizeEvent.deltaRect = deltaRect; + } + + function end(_ref3) { + var iEvent = _ref3.iEvent, + interaction = _ref3.interaction; + + if (interaction.prepared.name !== 'resize' || !interaction.prepared.edges) { + return; + } + + var resizeEvent = iEvent; + resizeEvent.edges = interaction.prepared.edges; + resizeEvent.rect = interaction._rects.corrected; + resizeEvent.deltaRect = interaction._rects.delta; + } + + function updateEventAxes(_ref4) { + var iEvent = _ref4.iEvent, + interaction = _ref4.interaction; + + if (interaction.prepared.name !== 'resize' || !interaction.resizeAxes) { + return; + } + + var options = interaction.interactable.options; + var resizeEvent = iEvent; + + if (options.resize.square) { + if (interaction.resizeAxes === 'y') { + resizeEvent.delta.x = resizeEvent.delta.y; + } else { + resizeEvent.delta.y = resizeEvent.delta.x; + } + + resizeEvent.axes = 'xy'; + } else { + resizeEvent.axes = interaction.resizeAxes; + + if (interaction.resizeAxes === 'x') { + resizeEvent.delta.y = 0; + } else if (interaction.resizeAxes === 'y') { + resizeEvent.delta.x = 0; + } + } + } + + var resize = { + id: 'actions/resize', + before: ['actions/drag'], + install: __install_6, + listeners: { + 'interactions:new': function interactionsNew(_ref5) { + var interaction = _ref5.interaction; + interaction.resizeAxes = 'xy'; + }, + 'interactions:action-start': function interactionsActionStart(arg) { + start(arg); + updateEventAxes(arg); + }, + 'interactions:action-move': function interactionsActionMove(arg) { + __move_6(arg); + + updateEventAxes(arg); + }, + 'interactions:action-end': end, + 'auto-start:check': resizeChecker + }, + defaults: { + square: false, + preserveAspectRatio: false, + axis: 'xy', + // use default margin + margin: NaN, + // object with props left, right, top, bottom which are + // true/false values to resize when the pointer is over that edge, + // CSS selectors to match the handles for each direction + // or the Elements for each handle + edges: null, + // a value of 'none' will limit the resize rect to a minimum of 0x0 + // 'negate' will alow the rect to have negative width/height + // 'reposition' will keep the width/height positive by swapping + // the top and bottom edges and/or swapping the left and right edges + invert: 'none' + }, + cursors: null, + getCursor: function getCursor(_ref6) { + var edges = _ref6.edges, + axis = _ref6.axis, + name = _ref6.name; + var cursors = resize.cursors; + var result = null; + + if (axis) { + result = cursors[name + axis]; + } else if (edges) { + var cursorKey = ''; + var _arr = ['top', 'bottom', 'left', 'right']; + + for (var _i = 0; _i < _arr.length; _i++) { + var edge = _arr[_i]; + + if (edges[edge]) { + cursorKey += edge; + } + } + + result = cursors[cursorKey]; + } + + return result; + }, + defaultMargin: null + }; + var ___default_6 = resize; + _$plugin_6["default"] = ___default_6; + var _$plugin_5 = {}; + "use strict"; + + Object.defineProperty(_$plugin_5, "__esModule", { + value: true + }); + _$plugin_5["default"] = void 0; + /* removed: var _$plugin_1 = require("./drag/plugin.js"); */ + + ; + /* removed: var _$plugin_3 = require("./drop/plugin.js"); */ + + ; + /* removed: var _$plugin_4 = require("./gesture/plugin.js"); */ + + ; + /* removed: var _$plugin_6 = require("./resize/plugin.js"); */ + + ; + var ___default_5 = { + id: 'actions', + install: function install(scope) { + scope.usePlugin(_$plugin_4["default"]); + scope.usePlugin(_$plugin_6["default"]); + scope.usePlugin(_$plugin_1["default"]); + scope.usePlugin(_$plugin_3["default"]); + } + }; + _$plugin_5["default"] = ___default_5; + var _$plugin_7 = {}; + "use strict"; + + Object.defineProperty(_$plugin_7, "__esModule", { + value: true + }); + _$plugin_7["default"] = void 0; + var ___default_7 = {}; + _$plugin_7["default"] = ___default_7; + var _$raf_82 = {}; + "use strict"; + + Object.defineProperty(_$raf_82, "__esModule", { + value: true + }); + _$raf_82["default"] = void 0; + var lastTime = 0; + + var _request; + + var _cancel; + + function __init_82(window) { + _request = window.requestAnimationFrame; + _cancel = window.cancelAnimationFrame; + + if (!_request) { + var vendors = ['ms', 'moz', 'webkit', 'o']; + + for (var _i = 0; _i < vendors.length; _i++) { + var vendor = vendors[_i]; + _request = window["".concat(vendor, "RequestAnimationFrame")]; + _cancel = window["".concat(vendor, "CancelAnimationFrame")] || window["".concat(vendor, "CancelRequestAnimationFrame")]; + } + } + + if (!_request) { + _request = function request(callback) { + var currTime = Date.now(); + var timeToCall = Math.max(0, 16 - (currTime - lastTime)); // eslint-disable-next-line standard/no-callback-literal + + var token = setTimeout(function () { + callback(currTime + timeToCall); + }, timeToCall); + lastTime = currTime + timeToCall; + return token; + }; + + _cancel = function cancel(token) { + return clearTimeout(token); + }; + } + } + + var ___default_82 = { + request: function request(callback) { + return _request(callback); + }, + cancel: function cancel(token) { + return _cancel(token); + }, + init: __init_82 + }; + _$raf_82["default"] = ___default_82; + var _$plugin_8 = {}; + "use strict"; + + Object.defineProperty(_$plugin_8, "__esModule", { + value: true + }); + _$plugin_8.getContainer = getContainer; + _$plugin_8.getScroll = getScroll; + _$plugin_8.getScrollSize = getScrollSize; + _$plugin_8.getScrollSizeDelta = getScrollSizeDelta; + _$plugin_8["default"] = void 0; + /* removed: var _$domUtils_71 = require("../utils/domUtils.js"); */ + + ; + /* removed: var _$is_76 = require("../utils/is.js"); */ + + ; + /* removed: var _$raf_82 = require("../utils/raf.js"); */ + + ; + /* removed: var _$rect_83 = require("../utils/rect.js"); */ + + ; + /* removed: var _$window_84 = require("../utils/window.js"); */ + + ; + + function __install_8(scope) { + var defaults = scope.defaults, + actions = scope.actions; + scope.autoScroll = autoScroll; + + autoScroll.now = function () { + return scope.now(); + }; + + actions.phaselessTypes.autoscroll = true; + defaults.perAction.autoScroll = autoScroll.defaults; + } + + var autoScroll = { + defaults: { + enabled: false, + margin: 60, + // the item that is scrolled (Window or HTMLElement) + container: null, + // the scroll speed in pixels per second + speed: 300 + }, + now: Date.now, + interaction: null, + i: 0, + // the handle returned by window.setInterval + // Direction each pulse is to scroll in + x: 0, + y: 0, + isScrolling: false, + prevTime: 0, + margin: 0, + speed: 0, + start: function start(interaction) { + autoScroll.isScrolling = true; + + _$raf_82["default"].cancel(autoScroll.i); + + interaction.autoScroll = autoScroll; + autoScroll.interaction = interaction; + autoScroll.prevTime = autoScroll.now(); + autoScroll.i = _$raf_82["default"].request(autoScroll.scroll); + }, + stop: function stop() { + autoScroll.isScrolling = false; + + if (autoScroll.interaction) { + autoScroll.interaction.autoScroll = null; + } + + _$raf_82["default"].cancel(autoScroll.i); + }, + // scroll the window by the values in scroll.x/y + scroll: function scroll() { + var interaction = autoScroll.interaction; + var interactable = interaction.interactable, + element = interaction.element; + var actionName = interaction.prepared.name; + var options = interactable.options[actionName].autoScroll; + var container = getContainer(options.container, interactable, element); + var now = autoScroll.now(); // change in time in seconds + + var dt = (now - autoScroll.prevTime) / 1000; // displacement + + var s = options.speed * dt; + + if (s >= 1) { + var scrollBy = { + x: autoScroll.x * s, + y: autoScroll.y * s + }; + + if (scrollBy.x || scrollBy.y) { + var prevScroll = getScroll(container); + + if (_$is_76["default"].window(container)) { + container.scrollBy(scrollBy.x, scrollBy.y); + } else if (container) { + container.scrollLeft += scrollBy.x; + container.scrollTop += scrollBy.y; + } + + var curScroll = getScroll(container); + var delta = { + x: curScroll.x - prevScroll.x, + y: curScroll.y - prevScroll.y + }; + + if (delta.x || delta.y) { + interactable.fire({ + type: 'autoscroll', + target: element, + interactable: interactable, + delta: delta, + interaction: interaction, + container: container + }); + } + } + + autoScroll.prevTime = now; + } + + if (autoScroll.isScrolling) { + _$raf_82["default"].cancel(autoScroll.i); + + autoScroll.i = _$raf_82["default"].request(autoScroll.scroll); + } + }, + check: function check(interactable, actionName) { + var options = interactable.options; + return options[actionName].autoScroll && options[actionName].autoScroll.enabled; + }, + onInteractionMove: function onInteractionMove(_ref) { + var interaction = _ref.interaction, + pointer = _ref.pointer; + + if (!(interaction.interacting() && autoScroll.check(interaction.interactable, interaction.prepared.name))) { + return; + } + + if (interaction.simulation) { + autoScroll.x = autoScroll.y = 0; + return; + } + + var top; + var right; + var bottom; + var left; + var interactable = interaction.interactable, + element = interaction.element; + var actionName = interaction.prepared.name; + var options = interactable.options[actionName].autoScroll; + var container = getContainer(options.container, interactable, element); + + if (_$is_76["default"].window(container)) { + left = pointer.clientX < autoScroll.margin; + top = pointer.clientY < autoScroll.margin; + right = pointer.clientX > container.innerWidth - autoScroll.margin; + bottom = pointer.clientY > container.innerHeight - autoScroll.margin; + } else { + var rect = _$domUtils_71.getElementClientRect(container); + + left = pointer.clientX < rect.left + autoScroll.margin; + top = pointer.clientY < rect.top + autoScroll.margin; + right = pointer.clientX > rect.right - autoScroll.margin; + bottom = pointer.clientY > rect.bottom - autoScroll.margin; + } + + autoScroll.x = right ? 1 : left ? -1 : 0; + autoScroll.y = bottom ? 1 : top ? -1 : 0; + + if (!autoScroll.isScrolling) { + // set the autoScroll properties to those of the target + autoScroll.margin = options.margin; + autoScroll.speed = options.speed; + autoScroll.start(interaction); + } + } + }; + + function getContainer(value, interactable, element) { + return (_$is_76["default"].string(value) ? (0, _$rect_83.getStringOptionResult)(value, interactable, element) : value) || (0, _$window_84.getWindow)(element); + } + + function getScroll(container) { + if (_$is_76["default"].window(container)) { + container = window.document.body; + } + + return { + x: container.scrollLeft, + y: container.scrollTop + }; + } + + function getScrollSize(container) { + if (_$is_76["default"].window(container)) { + container = window.document.body; + } + + return { + x: container.scrollWidth, + y: container.scrollHeight + }; + } + + function getScrollSizeDelta(_ref2, func) { + var interaction = _ref2.interaction, + element = _ref2.element; + var scrollOptions = interaction && interaction.interactable.options[interaction.prepared.name].autoScroll; + + if (!scrollOptions || !scrollOptions.enabled) { + func(); + return { + x: 0, + y: 0 + }; + } + + var scrollContainer = getContainer(scrollOptions.container, interaction.interactable, element); + var prevSize = getScroll(scrollContainer); + func(); + var curSize = getScroll(scrollContainer); + return { + x: curSize.x - prevSize.x, + y: curSize.y - prevSize.y + }; + } + + var autoScrollPlugin = { + id: 'auto-scroll', + install: __install_8, + listeners: { + 'interactions:new': function interactionsNew(_ref3) { + var interaction = _ref3.interaction; + interaction.autoScroll = null; + }, + 'interactions:destroy': function interactionsDestroy(_ref4) { + var interaction = _ref4.interaction; + interaction.autoScroll = null; + autoScroll.stop(); + + if (autoScroll.interaction) { + autoScroll.interaction = null; + } + }, + 'interactions:stop': autoScroll.stop, + 'interactions:action-move': function interactionsActionMove(arg) { + return autoScroll.onInteractionMove(arg); + } + } + }; + var ___default_8 = autoScrollPlugin; + _$plugin_8["default"] = ___default_8; + var _$misc_78 = {}; + "use strict"; + + Object.defineProperty(_$misc_78, "__esModule", { + value: true + }); + _$misc_78.warnOnce = warnOnce; + _$misc_78.copyAction = copyAction; + /* removed: var _$window_84 = require("./window.js"); */ + + ; + + function warnOnce(method, message) { + var warned = false; + return function () { + if (!warned) { + _$window_84["default"].window.console.warn(message); + + warned = true; + } + + return method.apply(this, arguments); + }; + } + + function copyAction(dest, src) { + dest.name = src.name; + dest.axis = src.axis; + dest.edges = src.edges; + return dest; + } + + var _$InteractableMethods_9 = {}; + "use strict"; + + Object.defineProperty(_$InteractableMethods_9, "__esModule", { + value: true + }); + _$InteractableMethods_9["default"] = void 0; + /* removed: var _$is_76 = require("../utils/is.js"); */ + + ; + /* removed: var _$misc_78 = require("../utils/misc.js"); */ + + ; + + function __install_9(scope) { + var Interactable = scope.Interactable; + + Interactable.prototype.getAction = function getAction(pointer, event, interaction, element) { + var action = defaultActionChecker(this, event, interaction, element, scope); + + if (this.options.actionChecker) { + return this.options.actionChecker(pointer, event, action, this, element, interaction); + } + + return action; + }; + /** + * ```js + * interact(element, { ignoreFrom: document.getElementById('no-action') }) + * // or + * interact(element).ignoreFrom('input, textarea, a') + * ``` + * @deprecated + * If the target of the `mousedown`, `pointerdown` or `touchstart` event or any + * of it's parents match the given CSS selector or Element, no + * drag/resize/gesture is started. + * + * Don't use this method. Instead set the `ignoreFrom` option for each action + * or for `pointerEvents` + * + * @example + * interact(targett) + * .draggable({ + * ignoreFrom: 'input, textarea, a[href]'', + * }) + * .pointerEvents({ + * ignoreFrom: '[no-pointer]', + * }) + * + * @param {string | Element | null} [newValue] a CSS selector string, an + * Element or `null` to not ignore any elements + * @return {string | Element | object} The current ignoreFrom value or this + * Interactable + */ + + + Interactable.prototype.ignoreFrom = (0, _$misc_78.warnOnce)(function (newValue) { + return this._backCompatOption('ignoreFrom', newValue); + }, 'Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue}).'); + /** + * @deprecated + * + * A drag/resize/gesture is started only If the target of the `mousedown`, + * `pointerdown` or `touchstart` event or any of it's parents match the given + * CSS selector or Element. + * + * Don't use this method. Instead set the `allowFrom` option for each action + * or for `pointerEvents` + * + * @example + * interact(targett) + * .resizable({ + * allowFrom: '.resize-handle', + * .pointerEvents({ + * allowFrom: '.handle',, + * }) + * + * @param {string | Element | null} [newValue] a CSS selector string, an + * Element or `null` to allow from any element + * @return {string | Element | object} The current allowFrom value or this + * Interactable + */ + + Interactable.prototype.allowFrom = (0, _$misc_78.warnOnce)(function (newValue) { + return this._backCompatOption('allowFrom', newValue); + }, 'Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue}).'); + /** + * ```js + * interact('.resize-drag') + * .resizable(true) + * .draggable(true) + * .actionChecker(function (pointer, event, action, interactable, element, interaction) { + * + * if (interact.matchesSelector(event.target, '.drag-handle')) { + * // force drag with handle target + * action.name = drag + * } + * else { + * // resize from the top and right edges + * action.name = 'resize' + * action.edges = { top: true, right: true } + * } + * + * return action + * }) + * ``` + * + * Returns or sets the function used to check action to be performed on + * pointerDown + * + * @param {function | null} [checker] A function which takes a pointer event, + * defaultAction string, interactable, element and interaction as parameters + * and returns an object with name property 'drag' 'resize' or 'gesture' and + * optionally an `edges` object with boolean 'top', 'left', 'bottom' and right + * props. + * @return {Function | Interactable} The checker function or this Interactable + */ + + Interactable.prototype.actionChecker = actionChecker; + /** + * Returns or sets whether the the cursor should be changed depending on the + * action that would be performed if the mouse were pressed and dragged. + * + * @param {boolean} [newValue] + * @return {boolean | Interactable} The current setting or this Interactable + */ + + Interactable.prototype.styleCursor = styleCursor; + } + + function defaultActionChecker(interactable, event, interaction, element, scope) { + var rect = interactable.getRect(element); + var buttons = event.buttons || { + 0: 1, + 1: 4, + 3: 8, + 4: 16 + }[event.button]; + var arg = { + action: null, + interactable: interactable, + interaction: interaction, + element: element, + rect: rect, + buttons: buttons + }; + scope.fire('auto-start:check', arg); + return arg.action; + } + + function styleCursor(newValue) { + if (_$is_76["default"].bool(newValue)) { + this.options.styleCursor = newValue; + return this; + } + + if (newValue === null) { + delete this.options.styleCursor; + return this; + } + + return this.options.styleCursor; + } + + function actionChecker(checker) { + if (_$is_76["default"].func(checker)) { + this.options.actionChecker = checker; + return this; + } + + if (checker === null) { + delete this.options.actionChecker; + return this; + } + + return this.options.actionChecker; + } + + var ___default_9 = { + id: 'auto-start/interactableMethods', + install: __install_9 + }; + _$InteractableMethods_9["default"] = ___default_9; + var _$base_10 = {}; + "use strict"; + + Object.defineProperty(_$base_10, "__esModule", { + value: true + }); + _$base_10["default"] = void 0; + /* removed: var _$domUtils_71 = require("../utils/domUtils.js"); */ + + ; + /* removed: var _$extend_73 = require("../utils/extend.js"); */ + + ; + /* removed: var _$is_76 = require("../utils/is.js"); */ + + ; + /* removed: var _$misc_78 = require("../utils/misc.js"); */ + + ; + /* removed: var _$InteractableMethods_9 = require("./InteractableMethods.js"); */ + + ; + + function __install_10(scope) { + var interact = scope.interactStatic, + defaults = scope.defaults; + scope.usePlugin(_$InteractableMethods_9["default"]); + defaults.base.actionChecker = null; + defaults.base.styleCursor = true; + (0, _$extend_73["default"])(defaults.perAction, { + manualStart: false, + max: Infinity, + maxPerElement: 1, + allowFrom: null, + ignoreFrom: null, + // only allow left button by default + // see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons#Return_value + mouseButtons: 1 + }); + /** + * Returns or sets the maximum number of concurrent interactions allowed. By + * default only 1 interaction is allowed at a time (for backwards + * compatibility). To allow multiple interactions on the same Interactables and + * elements, you need to enable it in the draggable, resizable and gesturable + * `'max'` and `'maxPerElement'` options. + * + * @alias module:interact.maxInteractions + * + * @param {number} [newValue] Any number. newValue <= 0 means no interactions. + */ + + interact.maxInteractions = function (newValue) { + return maxInteractions(newValue, scope); + }; + + scope.autoStart = { + // Allow this many interactions to happen simultaneously + maxInteractions: Infinity, + withinInteractionLimit: withinInteractionLimit, + cursorElement: null + }; + } + + function prepareOnDown(_ref, scope) { + var interaction = _ref.interaction, + pointer = _ref.pointer, + event = _ref.event, + eventTarget = _ref.eventTarget; + + if (interaction.interacting()) { + return; + } + + var actionInfo = getActionInfo(interaction, pointer, event, eventTarget, scope); + prepare(interaction, actionInfo, scope); + } + + function prepareOnMove(_ref2, scope) { + var interaction = _ref2.interaction, + pointer = _ref2.pointer, + event = _ref2.event, + eventTarget = _ref2.eventTarget; + + if (interaction.pointerType !== 'mouse' || interaction.pointerIsDown || interaction.interacting()) { + return; + } + + var actionInfo = getActionInfo(interaction, pointer, event, eventTarget, scope); + prepare(interaction, actionInfo, scope); + } + + function startOnMove(arg, scope) { + var interaction = arg.interaction; + + if (!interaction.pointerIsDown || interaction.interacting() || !interaction.pointerWasMoved || !interaction.prepared.name) { + return; + } + + scope.fire('autoStart:before-start', arg); + var interactable = interaction.interactable; + var actionName = interaction.prepared.name; + + if (actionName && interactable) { + // check manualStart and interaction limit + if (interactable.options[actionName].manualStart || !withinInteractionLimit(interactable, interaction.element, interaction.prepared, scope)) { + interaction.stop(); + } else { + interaction.start(interaction.prepared, interactable, interaction.element); + setInteractionCursor(interaction, scope); + } + } + } + + function clearCursorOnStop(_ref3, scope) { + var interaction = _ref3.interaction; + var interactable = interaction.interactable; + + if (interactable && interactable.options.styleCursor) { + setCursor(interaction.element, '', scope); + } + } // Check if the current interactable supports the action. + // If so, return the validated action. Otherwise, return null + + + function validateAction(action, interactable, element, eventTarget, scope) { + if (interactable.testIgnoreAllow(interactable.options[action.name], element, eventTarget) && interactable.options[action.name].enabled && withinInteractionLimit(interactable, element, action, scope)) { + return action; + } + + return null; + } + + function validateMatches(interaction, pointer, event, matches, matchElements, eventTarget, scope) { + for (var i = 0, len = matches.length; i < len; i++) { + var match = matches[i]; + var matchElement = matchElements[i]; + var matchAction = match.getAction(pointer, event, interaction, matchElement); + + if (!matchAction) { + continue; + } + + var action = validateAction(matchAction, match, matchElement, eventTarget, scope); + + if (action) { + return { + action: action, + interactable: match, + element: matchElement + }; + } + } + + return { + action: null, + interactable: null, + element: null + }; + } + + function getActionInfo(interaction, pointer, event, eventTarget, scope) { + var matches = []; + var matchElements = []; + var element = eventTarget; + + function pushMatches(interactable) { + matches.push(interactable); + matchElements.push(element); + } + + while (_$is_76["default"].element(element)) { + matches = []; + matchElements = []; + scope.interactables.forEachMatch(element, pushMatches); + var actionInfo = validateMatches(interaction, pointer, event, matches, matchElements, eventTarget, scope); + + if (actionInfo.action && !actionInfo.interactable.options[actionInfo.action.name].manualStart) { + return actionInfo; + } + + element = _$domUtils_71.parentNode(element); + } + + return { + action: null, + interactable: null, + element: null + }; + } + + function prepare(interaction, _ref4, scope) { + var action = _ref4.action, + interactable = _ref4.interactable, + element = _ref4.element; + action = action || { + name: null + }; + interaction.interactable = interactable; + interaction.element = element; + (0, _$misc_78.copyAction)(interaction.prepared, action); + interaction.rect = interactable && action.name ? interactable.getRect(element) : null; + setInteractionCursor(interaction, scope); + scope.fire('autoStart:prepared', { + interaction: interaction + }); + } + + function withinInteractionLimit(interactable, element, action, scope) { + var options = interactable.options; + var maxActions = options[action.name].max; + var maxPerElement = options[action.name].maxPerElement; + var autoStartMax = scope.autoStart.maxInteractions; + var activeInteractions = 0; + var interactableCount = 0; + var elementCount = 0; // no actions if any of these values == 0 + + if (!(maxActions && maxPerElement && autoStartMax)) { + return false; + } + + for (var _i = 0; _i < scope.interactions.list.length; _i++) { + var _ref5; + + _ref5 = scope.interactions.list[_i]; + var interaction = _ref5; + var otherAction = interaction.prepared.name; + + if (!interaction.interacting()) { + continue; + } + + activeInteractions++; + + if (activeInteractions >= autoStartMax) { + return false; + } + + if (interaction.interactable !== interactable) { + continue; + } + + interactableCount += otherAction === action.name ? 1 : 0; + + if (interactableCount >= maxActions) { + return false; + } + + if (interaction.element === element) { + elementCount++; + + if (otherAction === action.name && elementCount >= maxPerElement) { + return false; + } + } + } + + return autoStartMax > 0; + } + + function maxInteractions(newValue, scope) { + if (_$is_76["default"].number(newValue)) { + scope.autoStart.maxInteractions = newValue; + return this; + } + + return scope.autoStart.maxInteractions; + } + + function setCursor(element, cursor, scope) { + var prevCursorElement = scope.autoStart.cursorElement; + + if (prevCursorElement && prevCursorElement !== element) { + prevCursorElement.style.cursor = ''; + } + + element.ownerDocument.documentElement.style.cursor = cursor; + element.style.cursor = cursor; + scope.autoStart.cursorElement = cursor ? element : null; + } + + function setInteractionCursor(interaction, scope) { + var interactable = interaction.interactable, + element = interaction.element, + prepared = interaction.prepared; + + if (!(interaction.pointerType === 'mouse' && interactable && interactable.options.styleCursor)) { + // clear previous target element cursor + if (scope.autoStart.cursorElement) { + setCursor(scope.autoStart.cursorElement, '', scope); + } + + return; + } + + var cursor = ''; + + if (prepared.name) { + var cursorChecker = interactable.options[prepared.name].cursorChecker; + + if (_$is_76["default"].func(cursorChecker)) { + cursor = cursorChecker(prepared, interactable, element, interaction._interacting); + } else { + cursor = scope.actions.map[prepared.name].getCursor(prepared); + } + } + + setCursor(interaction.element, cursor || '', scope); + } + + var autoStart = { + id: 'auto-start/base', + before: ['actions'], + install: __install_10, + listeners: { + 'interactions:down': prepareOnDown, + 'interactions:move': function interactionsMove(arg, scope) { + prepareOnMove(arg, scope); + startOnMove(arg, scope); + }, + 'interactions:stop': clearCursorOnStop + }, + maxInteractions: maxInteractions, + withinInteractionLimit: withinInteractionLimit, + validateAction: validateAction + }; + var ___default_10 = autoStart; + _$base_10["default"] = ___default_10; + var _$dragAxis_11 = {}; + "use strict"; + + Object.defineProperty(_$dragAxis_11, "__esModule", { + value: true + }); + _$dragAxis_11["default"] = void 0; + /* removed: var _$domUtils_71 = require("../utils/domUtils.js"); */ + + ; + /* removed: var _$is_76 = require("../utils/is.js"); */ + + ; + /* removed: var _$base_10 = require("./base.js"); */ + + ; + + function beforeStart(_ref, scope) { + var interaction = _ref.interaction, + eventTarget = _ref.eventTarget, + dx = _ref.dx, + dy = _ref.dy; + + if (interaction.prepared.name !== 'drag') { + return; + } // check if a drag is in the correct axis + + + var absX = Math.abs(dx); + var absY = Math.abs(dy); + var targetOptions = interaction.interactable.options.drag; + var startAxis = targetOptions.startAxis; + var currentAxis = absX > absY ? 'x' : absX < absY ? 'y' : 'xy'; + interaction.prepared.axis = targetOptions.lockAxis === 'start' ? currentAxis[0] // always lock to one axis even if currentAxis === 'xy' + : targetOptions.lockAxis; // if the movement isn't in the startAxis of the interactable + + if (currentAxis !== 'xy' && startAxis !== 'xy' && startAxis !== currentAxis) { + // cancel the prepared action + interaction.prepared.name = null; // then try to get a drag from another ineractable + + var element = eventTarget; + + var getDraggable = function getDraggable(interactable) { + if (interactable === interaction.interactable) { + return; + } + + var options = interaction.interactable.options.drag; + + if (!options.manualStart && interactable.testIgnoreAllow(options, element, eventTarget)) { + var action = interactable.getAction(interaction.downPointer, interaction.downEvent, interaction, element); + + if (action && action.name === 'drag' && checkStartAxis(currentAxis, interactable) && _$base_10["default"].validateAction(action, interactable, element, eventTarget, scope)) { + return interactable; + } + } + }; // check all interactables + + + while (_$is_76["default"].element(element)) { + var interactable = scope.interactables.forEachMatch(element, getDraggable); + + if (interactable) { + interaction.prepared.name = 'drag'; + interaction.interactable = interactable; + interaction.element = element; + break; + } + + element = (0, _$domUtils_71.parentNode)(element); + } + } + } + + function checkStartAxis(startAxis, interactable) { + if (!interactable) { + return false; + } + + var thisAxis = interactable.options.drag.startAxis; + return startAxis === 'xy' || thisAxis === 'xy' || thisAxis === startAxis; + } + + var ___default_11 = { + id: 'auto-start/dragAxis', + listeners: { + 'autoStart:before-start': beforeStart + } + }; + _$dragAxis_11["default"] = ___default_11; + var _$hold_12 = {}; + "use strict"; + + Object.defineProperty(_$hold_12, "__esModule", { + value: true + }); + _$hold_12["default"] = void 0; + /* removed: var _$base_10 = require("./base.js"); */ + + ; + + function __install_12(scope) { + var defaults = scope.defaults; + scope.usePlugin(_$base_10["default"]); + defaults.perAction.hold = 0; + defaults.perAction.delay = 0; + } + + function getHoldDuration(interaction) { + var actionName = interaction.prepared && interaction.prepared.name; + + if (!actionName) { + return null; + } + + var options = interaction.interactable.options; + return options[actionName].hold || options[actionName].delay; + } + + var ___default_12 = { + id: 'auto-start/hold', + install: __install_12, + listeners: { + 'interactions:new': function interactionsNew(_ref) { + var interaction = _ref.interaction; + interaction.autoStartHoldTimer = null; + }, + 'autoStart:prepared': function autoStartPrepared(_ref2) { + var interaction = _ref2.interaction; + var hold = getHoldDuration(interaction); + + if (hold > 0) { + interaction.autoStartHoldTimer = setTimeout(function () { + interaction.start(interaction.prepared, interaction.interactable, interaction.element); + }, hold); + } + }, + 'interactions:move': function interactionsMove(_ref3) { + var interaction = _ref3.interaction, + duplicate = _ref3.duplicate; + + if (interaction.pointerWasMoved && !duplicate) { + clearTimeout(interaction.autoStartHoldTimer); + } + }, + // prevent regular down->move autoStart + 'autoStart:before-start': function autoStartBeforeStart(_ref4) { + var interaction = _ref4.interaction; + var hold = getHoldDuration(interaction); + + if (hold > 0) { + interaction.prepared.name = null; + } + } + }, + getHoldDuration: getHoldDuration + }; + _$hold_12["default"] = ___default_12; + var _$plugin_13 = {}; + "use strict"; + + Object.defineProperty(_$plugin_13, "__esModule", { + value: true + }); + _$plugin_13["default"] = void 0; + /* removed: var _$base_10 = require("./base.js"); */ + + ; + /* removed: var _$dragAxis_11 = require("./dragAxis.js"); */ + + ; + /* removed: var _$hold_12 = require("./hold.js"); */ + + ; + var ___default_13 = { + id: 'auto-start', + install: function install(scope) { + scope.usePlugin(_$base_10["default"]); + scope.usePlugin(_$hold_12["default"]); + scope.usePlugin(_$dragAxis_11["default"]); + } + }; + _$plugin_13["default"] = ___default_13; + var _$plugin_14 = {}; + "use strict"; + + Object.defineProperty(_$plugin_14, "__esModule", { + value: true + }); + _$plugin_14["default"] = void 0; + var ___default_14 = {}; + _$plugin_14["default"] = ___default_14; + var _$interactablePreventDefault_25 = {}; + "use strict"; + + Object.defineProperty(_$interactablePreventDefault_25, "__esModule", { + value: true + }); + _$interactablePreventDefault_25.install = __install_25; + _$interactablePreventDefault_25["default"] = void 0; + /* removed: var _$domUtils_71 = require("../utils/domUtils.js"); */ + + ; + /* removed: var _$is_76 = require("../utils/is.js"); */ + + ; + /* removed: var _$window_84 = require("../utils/window.js"); */ + + ; + + function preventDefault(newValue) { + if (/^(always|never|auto)$/.test(newValue)) { + this.options.preventDefault = newValue; + return this; + } + + if (_$is_76["default"].bool(newValue)) { + this.options.preventDefault = newValue ? 'always' : 'never'; + return this; + } + + return this.options.preventDefault; + } + + function checkAndPreventDefault(interactable, scope, event) { + var setting = interactable.options.preventDefault; + + if (setting === 'never') { + return; + } + + if (setting === 'always') { + event.preventDefault(); + return; + } // setting === 'auto' + // if the browser supports passive event listeners and isn't running on iOS, + // don't preventDefault of touch{start,move} events. CSS touch-action and + // user-select should be used instead of calling event.preventDefault(). + + + if (scope.events.supportsPassive && /^touch(start|move)$/.test(event.type)) { + var doc = (0, _$window_84.getWindow)(event.target).document; + var docOptions = scope.getDocOptions(doc); + + if (!(docOptions && docOptions.events) || docOptions.events.passive !== false) { + return; + } + } // don't preventDefault of pointerdown events + + + if (/^(mouse|pointer|touch)*(down|start)/i.test(event.type)) { + return; + } // don't preventDefault on editable elements + + + if (_$is_76["default"].element(event.target) && (0, _$domUtils_71.matchesSelector)(event.target, 'input,select,textarea,[contenteditable=true],[contenteditable=true] *')) { + return; + } + + event.preventDefault(); + } + + function onInteractionEvent(_ref) { + var interaction = _ref.interaction, + event = _ref.event; + + if (interaction.interactable) { + interaction.interactable.checkAndPreventDefault(event); + } + } + + function __install_25(scope) { + /** @lends Interactable */ + var Interactable = scope.Interactable; + /** + * Returns or sets whether to prevent the browser's default behaviour in + * response to pointer events. Can be set to: + * - `'always'` to always prevent + * - `'never'` to never prevent + * - `'auto'` to let interact.js try to determine what would be best + * + * @param {string} [newValue] `'always'`, `'never'` or `'auto'` + * @return {string | Interactable} The current setting or this Interactable + */ + + Interactable.prototype.preventDefault = preventDefault; + + Interactable.prototype.checkAndPreventDefault = function (event) { + return checkAndPreventDefault(this, scope, event); + }; // prevent native HTML5 drag on interact.js target elements + + + scope.interactions.docEvents.push({ + type: 'dragstart', + listener: function listener(event) { + for (var _i = 0; _i < scope.interactions.list.length; _i++) { + var _ref2; + + _ref2 = scope.interactions.list[_i]; + var interaction = _ref2; + + if (interaction.element && (interaction.element === event.target || (0, _$domUtils_71.nodeContains)(interaction.element, event.target))) { + interaction.interactable.checkAndPreventDefault(event); + return; + } + } + } + }); + } + + var ___default_25 = { + id: 'core/interactablePreventDefault', + install: __install_25, + listeners: ['down', 'move', 'up', 'cancel'].reduce(function (acc, eventType) { + acc["interactions:".concat(eventType)] = onInteractionEvent; + return acc; + }, {}) + }; + _$interactablePreventDefault_25["default"] = ___default_25; + var _$plugin_30 = {}; + "use strict"; + + Object.defineProperty(_$plugin_30, "__esModule", { + value: true + }); + _$plugin_30["default"] = void 0; + /* removed: var _$domObjects_70 = require("../utils/domObjects.js"); */ + + ; + /* removed: var _$domUtils_71 = require("../utils/domUtils.js"); */ + + ; + /* removed: var _$extend_73 = require("../utils/extend.js"); */ + + ; + /* removed: var _$is_76 = require("../utils/is.js"); */ + + ; + /* removed: var _$window_84 = require("../utils/window.js"); */ + + ; + + function ___toConsumableArray_30(arr) { + return ___arrayWithoutHoles_30(arr) || ___iterableToArray_30(arr) || ___unsupportedIterableToArray_30(arr) || ___nonIterableSpread_30(); + } + + function ___nonIterableSpread_30() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + + function ___unsupportedIterableToArray_30(o, minLen) { + if (!o) return; + if (typeof o === "string") return ___arrayLikeToArray_30(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return ___arrayLikeToArray_30(o, minLen); + } + + function ___iterableToArray_30(iter) { + if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); + } + + function ___arrayWithoutHoles_30(arr) { + if (Array.isArray(arr)) return ___arrayLikeToArray_30(arr); + } + + function ___arrayLikeToArray_30(arr, len) { + if (len == null || len > arr.length) len = arr.length; + + for (var i = 0, arr2 = new Array(len); i < len; i++) { + arr2[i] = arr[i]; + } + + return arr2; + } + + var CheckName; + + (function (CheckName) { + CheckName["touchAction"] = "touchAction"; + CheckName["boxSizing"] = "boxSizing"; + CheckName["noListeners"] = "noListeners"; + })(CheckName || (CheckName = {})); + + var prefix = '[interact.js] '; + var links = { + touchAction: 'https://developer.mozilla.org/en-US/docs/Web/CSS/touch-action', + boxSizing: 'https://developer.mozilla.org/en-US/docs/Web/CSS/box-sizing' + }; // eslint-disable-next-line no-undef + + var isProduction = "development" === 'production'; // eslint-disable-next-line no-restricted-syntax + + function __install_30(scope) { + var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + logger = _ref.logger; + + var Interactable = scope.Interactable, + defaults = scope.defaults; + scope.logger = logger || console; + defaults.base.devTools = { + ignore: {} + }; + + Interactable.prototype.devTools = function (options) { + if (options) { + (0, _$extend_73["default"])(this.options.devTools, options); + return this; + } + + return this.options.devTools; + }; + } + + var checks = [{ + name: CheckName.touchAction, + perform: function perform(_ref2) { + var element = _ref2.element; + return !parentHasStyle(element, 'touchAction', /pan-|pinch|none/); + }, + getInfo: function getInfo(_ref3) { + var element = _ref3.element; + return [element, links.touchAction]; + }, + text: 'Consider adding CSS "touch-action: none" to this element\n' + }, { + name: CheckName.boxSizing, + perform: function perform(interaction) { + var element = interaction.element; + return interaction.prepared.name === 'resize' && element instanceof _$domObjects_70["default"].HTMLElement && !hasStyle(element, 'boxSizing', /border-box/); + }, + text: 'Consider adding CSS "box-sizing: border-box" to this resizable element', + getInfo: function getInfo(_ref4) { + var element = _ref4.element; + return [element, links.boxSizing]; + } + }, { + name: CheckName.noListeners, + perform: function perform(interaction) { + var actionName = interaction.prepared.name; + var moveListeners = interaction.interactable.events.types["".concat(actionName, "move")] || []; + return !moveListeners.length; + }, + getInfo: function getInfo(interaction) { + return [interaction.prepared.name, interaction.interactable]; + }, + text: 'There are no listeners set for this action' + }]; + + function hasStyle(element, prop, styleRe) { + var value = element.style[prop] || _$window_84["default"].window.getComputedStyle(element)[prop]; + + return styleRe.test((value || '').toString()); + } + + function parentHasStyle(element, prop, styleRe) { + var parent = element; + + while (_$is_76["default"].element(parent)) { + if (hasStyle(parent, prop, styleRe)) { + return true; + } + + parent = (0, _$domUtils_71.parentNode)(parent); + } + + return false; + } + + var id = 'dev-tools'; + var defaultExport = isProduction ? { + id: id, + install: function install() {} + } : { + id: id, + install: __install_30, + listeners: { + 'interactions:action-start': function interactionsActionStart(_ref5, scope) { + var interaction = _ref5.interaction; + + for (var _i = 0; _i < checks.length; _i++) { + var _ref6; + + _ref6 = checks[_i]; + var check = _ref6; + var options = interaction.interactable && interaction.interactable.options; + + if (!(options && options.devTools && options.devTools.ignore[check.name]) && check.perform(interaction)) { + var _scope$logger; + + (_scope$logger = scope.logger).warn.apply(_scope$logger, [prefix + check.text].concat(___toConsumableArray_30(check.getInfo(interaction)))); + } + } + } + }, + checks: checks, + CheckName: CheckName, + links: links, + prefix: prefix + }; + var ___default_30 = defaultExport; + _$plugin_30["default"] = ___default_30; + var _$plugin_31 = {}; + "use strict"; + + Object.defineProperty(_$plugin_31, "__esModule", { + value: true + }); + _$plugin_31["default"] = void 0; + var ___default_31 = {}; + _$plugin_31["default"] = ___default_31; + var _$clone_68 = {}; + "use strict"; + + Object.defineProperty(_$clone_68, "__esModule", { + value: true + }); + _$clone_68["default"] = clone; + /* removed: var _$arr_66 = require("./arr.js"); */ + + ; + /* removed: var _$is_76 = require("./is.js"); */ + + ; // tslint:disable-next-line ban-types + + function clone(source) { + var dest = {}; + + for (var prop in source) { + var value = source[prop]; + + if (_$is_76["default"].plainObject(value)) { + dest[prop] = clone(value); + } else if (_$is_76["default"].array(value)) { + dest[prop] = _$arr_66.from(value); + } else { + dest[prop] = value; + } + } + + return dest; + } + + var _$Modification_35 = {}; + "use strict"; + + Object.defineProperty(_$Modification_35, "__esModule", { + value: true + }); + _$Modification_35.getRectOffset = getRectOffset; + _$Modification_35["default"] = void 0; + /* removed: var _$clone_68 = require("../utils/clone.js"); */ + + ; + /* removed: var _$extend_73 = require("../utils/extend.js"); */ + + ; + /* removed: var _$rect_83 = require("../utils/rect.js"); */ + + ; + + function _slicedToArray(arr, i) { + return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || ___unsupportedIterableToArray_35(arr, i) || _nonIterableRest(); + } + + function _nonIterableRest() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + + function ___unsupportedIterableToArray_35(o, minLen) { + if (!o) return; + if (typeof o === "string") return ___arrayLikeToArray_35(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return ___arrayLikeToArray_35(o, minLen); + } + + function ___arrayLikeToArray_35(arr, len) { + if (len == null || len > arr.length) len = arr.length; + + for (var i = 0, arr2 = new Array(len); i < len; i++) { + arr2[i] = arr[i]; + } + + return arr2; + } + + function _iterableToArrayLimit(arr, i) { + if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; + var _arr = []; + var _n = true; + var _d = false; + var _e = undefined; + + try { + for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"] != null) _i["return"](); + } finally { + if (_d) throw _e; + } + } + + return _arr; + } + + function _arrayWithHoles(arr) { + if (Array.isArray(arr)) return arr; + } + + function ___classCallCheck_35(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function ___defineProperties_35(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function ___createClass_35(Constructor, protoProps, staticProps) { + if (protoProps) ___defineProperties_35(Constructor.prototype, protoProps); + if (staticProps) ___defineProperties_35(Constructor, staticProps); + return Constructor; + } + + var Modification = /*#__PURE__*/function () { + function Modification(interaction) { + ___classCallCheck_35(this, Modification); + + this.states = []; + this.startOffset = { + left: 0, + right: 0, + top: 0, + bottom: 0 + }; + this.startDelta = null; + this.result = null; + this.endResult = null; + this.edges = void 0; + this.interaction = void 0; + this.interaction = interaction; + this.result = createResult(); + } + + ___createClass_35(Modification, [{ + key: "start", + value: function start(_ref, pageCoords) { + var phase = _ref.phase; + var interaction = this.interaction; + var modifierList = getModifierList(interaction); + this.prepareStates(modifierList); + this.edges = (0, _$extend_73["default"])({}, interaction.edges); + this.startOffset = getRectOffset(interaction.rect, pageCoords); + this.startDelta = { + x: 0, + y: 0 + }; + var arg = { + phase: phase, + pageCoords: pageCoords, + preEnd: false + }; + this.result = createResult(); + this.startAll(arg); + var result = this.result = this.setAll(arg); + return result; + } + }, { + key: "fillArg", + value: function fillArg(arg) { + var interaction = this.interaction; + arg.interaction = interaction; + arg.interactable = interaction.interactable; + arg.element = interaction.element; + arg.rect = arg.rect || interaction.rect; + arg.edges = this.edges; + arg.startOffset = this.startOffset; + } + }, { + key: "startAll", + value: function startAll(arg) { + this.fillArg(arg); + + for (var _i = 0; _i < this.states.length; _i++) { + var _ref2; + + _ref2 = this.states[_i]; + var state = _ref2; + + if (state.methods.start) { + arg.state = state; + state.methods.start(arg); + } + } + } + }, { + key: "setAll", + value: function setAll(arg) { + this.fillArg(arg); + var phase = arg.phase, + preEnd = arg.preEnd, + skipModifiers = arg.skipModifiers, + unmodifiedRect = arg.rect; + arg.coords = (0, _$extend_73["default"])({}, arg.pageCoords); + arg.rect = (0, _$extend_73["default"])({}, unmodifiedRect); + var states = skipModifiers ? this.states.slice(skipModifiers) : this.states; + var newResult = createResult(arg.coords, arg.rect); + + for (var _i2 = 0; _i2 < states.length; _i2++) { + var _ref3; + + _ref3 = states[_i2]; + var state = _ref3; + var options = state.options; + var lastModifierCoords = (0, _$extend_73["default"])({}, arg.coords); + var returnValue = null; + + if (state.methods.set && this.shouldDo(options, preEnd, phase)) { + arg.state = state; + returnValue = state.methods.set(arg); + + _$rect_83.addEdges(this.interaction.edges, arg.rect, { + x: arg.coords.x - lastModifierCoords.x, + y: arg.coords.y - lastModifierCoords.y + }); + } + + newResult.eventProps.push(returnValue); + } + + newResult.delta.x = arg.coords.x - arg.pageCoords.x; + newResult.delta.y = arg.coords.y - arg.pageCoords.y; + newResult.rectDelta.left = arg.rect.left - unmodifiedRect.left; + newResult.rectDelta.right = arg.rect.right - unmodifiedRect.right; + newResult.rectDelta.top = arg.rect.top - unmodifiedRect.top; + newResult.rectDelta.bottom = arg.rect.bottom - unmodifiedRect.bottom; + var prevCoords = this.result.coords; + var prevRect = this.result.rect; + + if (prevCoords && prevRect) { + var rectChanged = newResult.rect.left !== prevRect.left || newResult.rect.right !== prevRect.right || newResult.rect.top !== prevRect.top || newResult.rect.bottom !== prevRect.bottom; + newResult.changed = rectChanged || prevCoords.x !== newResult.coords.x || prevCoords.y !== newResult.coords.y; + } + + return newResult; + } + }, { + key: "applyToInteraction", + value: function applyToInteraction(arg) { + var interaction = this.interaction; + var phase = arg.phase; + var curCoords = interaction.coords.cur; + var startCoords = interaction.coords.start; + var result = this.result, + startDelta = this.startDelta; + var curDelta = result.delta; + + if (phase === 'start') { + (0, _$extend_73["default"])(this.startDelta, result.delta); + } + + var _arr = [[startCoords, startDelta], [curCoords, curDelta]]; + + for (var _i3 = 0; _i3 < _arr.length; _i3++) { + var _arr$_i = _slicedToArray(_arr[_i3], 2), + coordsSet = _arr$_i[0], + delta = _arr$_i[1]; + + coordsSet.page.x += delta.x; + coordsSet.page.y += delta.y; + coordsSet.client.x += delta.x; + coordsSet.client.y += delta.y; + } + + var rectDelta = this.result.rectDelta; + var rect = arg.rect || interaction.rect; + rect.left += rectDelta.left; + rect.right += rectDelta.right; + rect.top += rectDelta.top; + rect.bottom += rectDelta.bottom; + rect.width = rect.right - rect.left; + rect.height = rect.bottom - rect.top; + } + }, { + key: "setAndApply", + value: function setAndApply(arg) { + var interaction = this.interaction; + var phase = arg.phase, + preEnd = arg.preEnd, + skipModifiers = arg.skipModifiers; + var result = this.setAll({ + preEnd: preEnd, + phase: phase, + pageCoords: arg.modifiedCoords || interaction.coords.cur.page + }); + this.result = result; // don't fire an action move if a modifier would keep the event in the same + // cordinates as before + + if (!result.changed && (!skipModifiers || skipModifiers < this.states.length) && interaction.interacting()) { + return false; + } + + if (arg.modifiedCoords) { + var page = interaction.coords.cur.page; + var adjustment = { + x: arg.modifiedCoords.x - page.x, + y: arg.modifiedCoords.y - page.y + }; + result.coords.x += adjustment.x; + result.coords.y += adjustment.y; + result.delta.x += adjustment.x; + result.delta.y += adjustment.y; + } + + this.applyToInteraction(arg); + } + }, { + key: "beforeEnd", + value: function beforeEnd(arg) { + var interaction = arg.interaction, + event = arg.event; + var states = this.states; + + if (!states || !states.length) { + return; + } + + var doPreend = false; + + for (var _i4 = 0; _i4 < states.length; _i4++) { + var _ref4; + + _ref4 = states[_i4]; + var state = _ref4; + arg.state = state; + var options = state.options, + methods = state.methods; + var endPosition = methods.beforeEnd && methods.beforeEnd(arg); + + if (endPosition) { + this.endResult = endPosition; + return false; + } + + doPreend = doPreend || !doPreend && this.shouldDo(options, true, arg.phase, true); + } + + if (doPreend) { + // trigger a final modified move before ending + interaction.move({ + event: event, + preEnd: true + }); + } + } + }, { + key: "stop", + value: function stop(arg) { + var interaction = arg.interaction; + + if (!this.states || !this.states.length) { + return; + } + + var modifierArg = (0, _$extend_73["default"])({ + states: this.states, + interactable: interaction.interactable, + element: interaction.element, + rect: null + }, arg); + this.fillArg(modifierArg); + + for (var _i5 = 0; _i5 < this.states.length; _i5++) { + var _ref5; + + _ref5 = this.states[_i5]; + var state = _ref5; + modifierArg.state = state; + + if (state.methods.stop) { + state.methods.stop(modifierArg); + } + } + + this.states = null; + this.endResult = null; + } + }, { + key: "prepareStates", + value: function prepareStates(modifierList) { + this.states = []; + + for (var index = 0; index < modifierList.length; index++) { + var _modifierList$index = modifierList[index], + options = _modifierList$index.options, + methods = _modifierList$index.methods, + name = _modifierList$index.name; + this.states.push({ + options: options, + methods: methods, + index: index, + name: name + }); + } + + return this.states; + } + }, { + key: "restoreInteractionCoords", + value: function restoreInteractionCoords(_ref6) { + var _ref6$interaction = _ref6.interaction, + coords = _ref6$interaction.coords, + rect = _ref6$interaction.rect, + modification = _ref6$interaction.modification; + + if (!modification.result) { + return; + } + + var startDelta = modification.startDelta; + var _modification$result = modification.result, + curDelta = _modification$result.delta, + rectDelta = _modification$result.rectDelta; + var coordsAndDeltas = [[coords.start, startDelta], [coords.cur, curDelta]]; + + for (var _i6 = 0; _i6 < coordsAndDeltas.length; _i6++) { + var _coordsAndDeltas$_i = _slicedToArray(coordsAndDeltas[_i6], 2), + coordsSet = _coordsAndDeltas$_i[0], + delta = _coordsAndDeltas$_i[1]; + + coordsSet.page.x -= delta.x; + coordsSet.page.y -= delta.y; + coordsSet.client.x -= delta.x; + coordsSet.client.y -= delta.y; + } + + rect.left -= rectDelta.left; + rect.right -= rectDelta.right; + rect.top -= rectDelta.top; + rect.bottom -= rectDelta.bottom; + } + }, { + key: "shouldDo", + value: function shouldDo(options, preEnd, phase, requireEndOnly) { + if ( // ignore disabled modifiers + !options || options.enabled === false || // check if we require endOnly option to fire move before end + requireEndOnly && !options.endOnly || // don't apply endOnly modifiers when not ending + options.endOnly && !preEnd || // check if modifier should run be applied on start + phase === 'start' && !options.setStart) { + return false; + } + + return true; + } + }, { + key: "copyFrom", + value: function copyFrom(other) { + this.startOffset = other.startOffset; + this.startDelta = other.startDelta; + this.edges = other.edges; + this.states = other.states.map(function (s) { + return (0, _$clone_68["default"])(s); + }); + this.result = createResult((0, _$extend_73["default"])({}, other.result.coords), (0, _$extend_73["default"])({}, other.result.rect)); + } + }, { + key: "destroy", + value: function destroy() { + for (var prop in this) { + this[prop] = null; + } + } + }]); + + return Modification; + }(); + + _$Modification_35["default"] = Modification; + + function createResult(coords, rect) { + return { + rect: rect, + coords: coords, + delta: { + x: 0, + y: 0 + }, + rectDelta: { + left: 0, + right: 0, + top: 0, + bottom: 0 + }, + eventProps: [], + changed: true + }; + } + + function getModifierList(interaction) { + var actionOptions = interaction.interactable.options[interaction.prepared.name]; + var actionModifiers = actionOptions.modifiers; + + if (actionModifiers && actionModifiers.length) { + return actionModifiers; + } + + return ['snap', 'snapSize', 'snapEdges', 'restrict', 'restrictEdges', 'restrictSize'].map(function (type) { + var options = actionOptions[type]; + return options && options.enabled && { + options: options, + methods: options._methods + }; + }).filter(function (m) { + return !!m; + }); + } + + function getRectOffset(rect, coords) { + return rect ? { + left: coords.x - rect.left, + top: coords.y - rect.top, + right: rect.right - coords.x, + bottom: rect.bottom - coords.y + } : { + left: 0, + top: 0, + right: 0, + bottom: 0 + }; + } + + var _$base_39 = {}; + "use strict"; + + Object.defineProperty(_$base_39, "__esModule", { + value: true + }); + _$base_39.makeModifier = makeModifier; + _$base_39.addEventModifiers = addEventModifiers; + _$base_39["default"] = void 0; + /* removed: var _$Modification_35 = require("./Modification.js"); */ + + ; + + function makeModifier(module, name) { + var defaults = module.defaults; + var methods = { + start: module.start, + set: module.set, + beforeEnd: module.beforeEnd, + stop: module.stop + }; + + var modifier = function modifier(_options) { + var options = _options || {}; + options.enabled = options.enabled !== false; // add missing defaults to options + + for (var prop in defaults) { + if (!(prop in options)) { + options[prop] = defaults[prop]; + } + } + + var m = { + options: options, + methods: methods, + name: name, + enable: function enable() { + options.enabled = true; + return m; + }, + disable: function disable() { + options.enabled = false; + return m; + } + }; + return m; + }; + + if (name && typeof name === 'string') { + // for backwrads compatibility + modifier._defaults = defaults; + modifier._methods = methods; + } + + return modifier; + } + + function addEventModifiers(_ref) { + var iEvent = _ref.iEvent, + result = _ref.interaction.modification.result; + + if (result) { + iEvent.modifiers = result.eventProps; + } + } + + var modifiersBase = { + id: 'modifiers/base', + install: function install(scope) { + scope.defaults.perAction.modifiers = []; + }, + listeners: { + 'interactions:new': function interactionsNew(_ref2) { + var interaction = _ref2.interaction; + interaction.modification = new _$Modification_35["default"](interaction); + }, + 'interactions:before-action-start': function interactionsBeforeActionStart(arg) { + var modification = arg.interaction.modification; + modification.start(arg, arg.interaction.coords.start.page); + arg.interaction.edges = modification.edges; + modification.applyToInteraction(arg); + }, + 'interactions:before-action-move': function interactionsBeforeActionMove(arg) { + return arg.interaction.modification.setAndApply(arg); + }, + 'interactions:before-action-end': function interactionsBeforeActionEnd(arg) { + return arg.interaction.modification.beforeEnd(arg); + }, + 'interactions:action-start': addEventModifiers, + 'interactions:action-move': addEventModifiers, + 'interactions:action-end': addEventModifiers, + 'interactions:after-action-start': function interactionsAfterActionStart(arg) { + return arg.interaction.modification.restoreInteractionCoords(arg); + }, + 'interactions:after-action-move': function interactionsAfterActionMove(arg) { + return arg.interaction.modification.restoreInteractionCoords(arg); + }, + 'interactions:stop': function interactionsStop(arg) { + return arg.interaction.modification.stop(arg); + } + }, + before: ['actions'] + }; + var ___default_39 = modifiersBase; + _$base_39["default"] = ___default_39; + var _$defaultOptions_22 = {}; + "use strict"; + + Object.defineProperty(_$defaultOptions_22, "__esModule", { + value: true + }); + _$defaultOptions_22.defaults = void 0; // eslint-disable-next-line @typescript-eslint/no-empty-interface + // export interface Options extends BaseDefaults, PerActionDefaults {} + + var defaults = { + base: { + preventDefault: 'auto', + deltaSource: 'page' + }, + perAction: { + enabled: false, + origin: { + x: 0, + y: 0 + } + }, + actions: {} + }; + _$defaultOptions_22.defaults = defaults; + var _$InteractEvent_17 = {}; + "use strict"; + + Object.defineProperty(_$InteractEvent_17, "__esModule", { + value: true + }); + _$InteractEvent_17.InteractEvent = void 0; + /* removed: var _$extend_73 = require("../utils/extend.js"); */ + + ; + /* removed: var _$getOriginXY_74 = require("../utils/getOriginXY.js"); */ + + ; + /* removed: var _$hypot_75 = require("../utils/hypot.js"); */ + + ; + /* removed: var _$BaseEvent_15 = require("./BaseEvent.js"); */ + + ; + /* removed: var _$defaultOptions_22 = require("./defaultOptions.js"); */ + + ; + + function ___typeof_17(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + ___typeof_17 = function _typeof(obj) { + return typeof obj; + }; + } else { + ___typeof_17 = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + + return ___typeof_17(obj); + } + + function ___classCallCheck_17(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function ___defineProperties_17(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function ___createClass_17(Constructor, protoProps, staticProps) { + if (protoProps) ___defineProperties_17(Constructor.prototype, protoProps); + if (staticProps) ___defineProperties_17(Constructor, staticProps); + return Constructor; + } + + function ___inherits_17(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function"); + } + + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + writable: true, + configurable: true + } + }); + if (superClass) ___setPrototypeOf_17(subClass, superClass); + } + + function ___setPrototypeOf_17(o, p) { + ___setPrototypeOf_17 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + + return ___setPrototypeOf_17(o, p); + } + + function ___createSuper_17(Derived) { + var hasNativeReflectConstruct = ___isNativeReflectConstruct_17(); + + return function () { + var Super = ___getPrototypeOf_17(Derived), + result; + + if (hasNativeReflectConstruct) { + var NewTarget = ___getPrototypeOf_17(this).constructor; + + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + + return ___possibleConstructorReturn_17(this, result); + }; + } + + function ___possibleConstructorReturn_17(self, call) { + if (call && (___typeof_17(call) === "object" || typeof call === "function")) { + return call; + } + + return ___assertThisInitialized_17(self); + } + + function ___assertThisInitialized_17(self) { + if (self === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return self; + } + + function ___isNativeReflectConstruct_17() { + if (typeof Reflect === "undefined" || !Reflect.construct) return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === "function") return true; + + try { + Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); + return true; + } catch (e) { + return false; + } + } + + function ___getPrototypeOf_17(o) { + ___getPrototypeOf_17 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return ___getPrototypeOf_17(o); + } + + var InteractEvent = /*#__PURE__*/function (_BaseEvent) { + ___inherits_17(InteractEvent, _BaseEvent); + + var _super = ___createSuper_17(InteractEvent); // drag + // resize + + /** */ + + + function InteractEvent(interaction, event, actionName, phase, element, preEnd, type) { + var _this; + + ___classCallCheck_17(this, InteractEvent); + + _this = _super.call(this, interaction); + _this.target = void 0; + _this.currentTarget = void 0; + _this.relatedTarget = null; + _this.screenX = void 0; + _this.screenY = void 0; + _this.button = void 0; + _this.buttons = void 0; + _this.ctrlKey = void 0; + _this.shiftKey = void 0; + _this.altKey = void 0; + _this.metaKey = void 0; + _this.page = void 0; + _this.client = void 0; + _this.delta = void 0; + _this.rect = void 0; + _this.x0 = void 0; + _this.y0 = void 0; + _this.t0 = void 0; + _this.dt = void 0; + _this.duration = void 0; + _this.clientX0 = void 0; + _this.clientY0 = void 0; + _this.velocity = void 0; + _this.speed = void 0; + _this.swipe = void 0; + _this.timeStamp = void 0; + _this.dragEnter = void 0; + _this.dragLeave = void 0; + _this.axes = void 0; + _this.preEnd = void 0; + element = element || interaction.element; + var target = interaction.interactable; + var deltaSource = (target && target.options || _$defaultOptions_22.defaults).deltaSource; + var origin = (0, _$getOriginXY_74["default"])(target, element, actionName); + var starting = phase === 'start'; + var ending = phase === 'end'; + var prevEvent = starting ? ___assertThisInitialized_17(_this) : interaction.prevEvent; + var coords = starting ? interaction.coords.start : ending ? { + page: prevEvent.page, + client: prevEvent.client, + timeStamp: interaction.coords.cur.timeStamp + } : interaction.coords.cur; + _this.page = (0, _$extend_73["default"])({}, coords.page); + _this.client = (0, _$extend_73["default"])({}, coords.client); + _this.rect = (0, _$extend_73["default"])({}, interaction.rect); + _this.timeStamp = coords.timeStamp; + + if (!ending) { + _this.page.x -= origin.x; + _this.page.y -= origin.y; + _this.client.x -= origin.x; + _this.client.y -= origin.y; + } + + _this.ctrlKey = event.ctrlKey; + _this.altKey = event.altKey; + _this.shiftKey = event.shiftKey; + _this.metaKey = event.metaKey; + _this.button = event.button; + _this.buttons = event.buttons; + _this.target = element; + _this.currentTarget = element; + _this.preEnd = preEnd; + _this.type = type || actionName + (phase || ''); + _this.interactable = target; + _this.t0 = starting ? interaction.pointers[interaction.pointers.length - 1].downTime : prevEvent.t0; + _this.x0 = interaction.coords.start.page.x - origin.x; + _this.y0 = interaction.coords.start.page.y - origin.y; + _this.clientX0 = interaction.coords.start.client.x - origin.x; + _this.clientY0 = interaction.coords.start.client.y - origin.y; + + if (starting || ending) { + _this.delta = { + x: 0, + y: 0 + }; + } else { + _this.delta = { + x: _this[deltaSource].x - prevEvent[deltaSource].x, + y: _this[deltaSource].y - prevEvent[deltaSource].y + }; + } + + _this.dt = interaction.coords.delta.timeStamp; + _this.duration = _this.timeStamp - _this.t0; // velocity and speed in pixels per second + + _this.velocity = (0, _$extend_73["default"])({}, interaction.coords.velocity[deltaSource]); + _this.speed = (0, _$hypot_75["default"])(_this.velocity.x, _this.velocity.y); + _this.swipe = ending || phase === 'inertiastart' ? _this.getSwipe() : null; + return _this; + } + + ___createClass_17(InteractEvent, [{ + key: "getSwipe", + value: function getSwipe() { + var interaction = this._interaction; + + if (interaction.prevEvent.speed < 600 || this.timeStamp - interaction.prevEvent.timeStamp > 150) { + return null; + } + + var angle = 180 * Math.atan2(interaction.prevEvent.velocityY, interaction.prevEvent.velocityX) / Math.PI; + var overlap = 22.5; + + if (angle < 0) { + angle += 360; + } + + var left = 135 - overlap <= angle && angle < 225 + overlap; + var up = 225 - overlap <= angle && angle < 315 + overlap; + var right = !left && (315 - overlap <= angle || angle < 45 + overlap); + var down = !up && 45 - overlap <= angle && angle < 135 + overlap; + return { + up: up, + down: down, + left: left, + right: right, + angle: angle, + speed: interaction.prevEvent.speed, + velocity: { + x: interaction.prevEvent.velocityX, + y: interaction.prevEvent.velocityY + } + }; + } + }, { + key: "preventDefault", + value: function preventDefault() {} + /** + * Don't call listeners on the remaining targets + */ + + }, { + key: "stopImmediatePropagation", + value: function stopImmediatePropagation() { + this.immediatePropagationStopped = this.propagationStopped = true; + } + /** + * Don't call any other listeners (even on the current target) + */ + + }, { + key: "stopPropagation", + value: function stopPropagation() { + this.propagationStopped = true; + } + }]); + + return InteractEvent; + }(_$BaseEvent_15.BaseEvent); // getters and setters defined here to support typescript 3.6 and below which + // don't support getter and setters in .d.ts files + + + _$InteractEvent_17.InteractEvent = InteractEvent; + Object.defineProperties(InteractEvent.prototype, { + pageX: { + get: function get() { + return this.page.x; + }, + set: function set(value) { + this.page.x = value; + } + }, + pageY: { + get: function get() { + return this.page.y; + }, + set: function set(value) { + this.page.y = value; + } + }, + clientX: { + get: function get() { + return this.client.x; + }, + set: function set(value) { + this.client.x = value; + } + }, + clientY: { + get: function get() { + return this.client.y; + }, + set: function set(value) { + this.client.y = value; + } + }, + dx: { + get: function get() { + return this.delta.x; + }, + set: function set(value) { + this.delta.x = value; + } + }, + dy: { + get: function get() { + return this.delta.y; + }, + set: function set(value) { + this.delta.y = value; + } + }, + velocityX: { + get: function get() { + return this.velocity.x; + }, + set: function set(value) { + this.velocity.x = value; + } + }, + velocityY: { + get: function get() { + return this.velocity.y; + }, + set: function set(value) { + this.velocity.y = value; + } + } + }); + var _$PointerInfo_21 = {}; + "use strict"; + + Object.defineProperty(_$PointerInfo_21, "__esModule", { + value: true + }); + _$PointerInfo_21.PointerInfo = void 0; + + function ___classCallCheck_21(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + var PointerInfo = function PointerInfo(id, pointer, event, downTime, downTarget) { + ___classCallCheck_21(this, PointerInfo); + + this.id = void 0; + this.pointer = void 0; + this.event = void 0; + this.downTime = void 0; + this.downTarget = void 0; + this.id = id; + this.pointer = pointer; + this.event = event; + this.downTime = downTime; + this.downTarget = downTarget; + }; + + _$PointerInfo_21.PointerInfo = PointerInfo; + var _$Interaction_20 = {}; + "use strict"; + + Object.defineProperty(_$Interaction_20, "__esModule", { + value: true + }); + Object.defineProperty(_$Interaction_20, "PointerInfo", { + enumerable: true, + get: function get() { + return _$PointerInfo_21.PointerInfo; + } + }); + _$Interaction_20["default"] = _$Interaction_20.Interaction = _$Interaction_20._ProxyMethods = _$Interaction_20._ProxyValues = void 0; + /* removed: var _$arr_66 = require("../utils/arr.js"); */ + + ; + /* removed: var _$extend_73 = require("../utils/extend.js"); */ + + ; + /* removed: var _$hypot_75 = require("../utils/hypot.js"); */ + + ; + /* removed: var _$misc_78 = require("../utils/misc.js"); */ + + ; + /* removed: var _$pointerUtils_81 = require("../utils/pointerUtils.js"); */ + + ; + /* removed: var _$rect_83 = require("../utils/rect.js"); */ + + ; + /* removed: var _$InteractEvent_17 = require("./InteractEvent.js"); */ + + ; + /* removed: var _$PointerInfo_21 = require("./PointerInfo.js"); */ + + ; + + function ___classCallCheck_20(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function ___defineProperties_20(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function ___createClass_20(Constructor, protoProps, staticProps) { + if (protoProps) ___defineProperties_20(Constructor.prototype, protoProps); + if (staticProps) ___defineProperties_20(Constructor, staticProps); + return Constructor; + } + + var _ProxyValues; + + _$Interaction_20._ProxyValues = _ProxyValues; + + (function (_ProxyValues) { + _ProxyValues["interactable"] = ""; + _ProxyValues["element"] = ""; + _ProxyValues["prepared"] = ""; + _ProxyValues["pointerIsDown"] = ""; + _ProxyValues["pointerWasMoved"] = ""; + _ProxyValues["_proxy"] = ""; + })(_ProxyValues || (_$Interaction_20._ProxyValues = _ProxyValues = {})); + + var _ProxyMethods; + + _$Interaction_20._ProxyMethods = _ProxyMethods; + + (function (_ProxyMethods) { + _ProxyMethods["start"] = ""; + _ProxyMethods["move"] = ""; + _ProxyMethods["end"] = ""; + _ProxyMethods["stop"] = ""; + _ProxyMethods["interacting"] = ""; + })(_ProxyMethods || (_$Interaction_20._ProxyMethods = _ProxyMethods = {})); + + var idCounter = 0; + + var Interaction = /*#__PURE__*/function () { + ___createClass_20(Interaction, [{ + key: "pointerMoveTolerance", + // current interactable being interacted with + // the target element of the interactable + // action that's ready to be fired on next move event + // keep track of added pointers + // pointerdown/mousedown/touchstart event + // previous action event + + /** @internal */ + get: function get() { + return 1; + } + /** + * @alias Interaction.prototype.move + */ + + /** */ + + }]); + + function Interaction(_ref) { + var _this = this; + + var pointerType = _ref.pointerType, + scopeFire = _ref.scopeFire; + + ___classCallCheck_20(this, Interaction); + + this.interactable = null; + this.element = null; + this.rect = void 0; + this._rects = void 0; + this.edges = void 0; + this._scopeFire = void 0; + this.prepared = { + name: null, + axis: null, + edges: null + }; + this.pointerType = void 0; + this.pointers = []; + this.downEvent = null; + this.downPointer = {}; + this._latestPointer = { + pointer: null, + event: null, + eventTarget: null + }; + this.prevEvent = null; + this.pointerIsDown = false; + this.pointerWasMoved = false; + this._interacting = false; + this._ending = false; + this._stopped = true; + this._proxy = null; + this.simulation = null; + this.doMove = (0, _$misc_78.warnOnce)(function (signalArg) { + this.move(signalArg); + }, 'The interaction.doMove() method has been renamed to interaction.move()'); + this.coords = { + // Starting InteractEvent pointer coordinates + start: _$pointerUtils_81.newCoords(), + // Previous native pointer move event coordinates + prev: _$pointerUtils_81.newCoords(), + // current native pointer move event coordinates + cur: _$pointerUtils_81.newCoords(), + // Change in coordinates and time of the pointer + delta: _$pointerUtils_81.newCoords(), + // pointer velocity + velocity: _$pointerUtils_81.newCoords() + }; + this._id = idCounter++; + this._scopeFire = scopeFire; + this.pointerType = pointerType; + var that = this; + this._proxy = {}; + + var _loop = function _loop(key) { + Object.defineProperty(_this._proxy, key, { + get: function get() { + return that[key]; + } + }); + }; + + for (var key in _ProxyValues) { + _loop(key); + } + + var _loop2 = function _loop2(_key) { + Object.defineProperty(_this._proxy, _key, { + value: function value() { + return that[_key].apply(that, arguments); + } + }); + }; + + for (var _key in _ProxyMethods) { + _loop2(_key); + } + + this._scopeFire('interactions:new', { + interaction: this + }); + } + + ___createClass_20(Interaction, [{ + key: "pointerDown", + value: function pointerDown(pointer, event, eventTarget) { + var pointerIndex = this.updatePointer(pointer, event, eventTarget, true); + var pointerInfo = this.pointers[pointerIndex]; + + this._scopeFire('interactions:down', { + pointer: pointer, + event: event, + eventTarget: eventTarget, + pointerIndex: pointerIndex, + pointerInfo: pointerInfo, + type: 'down', + interaction: this + }); + } + /** + * ```js + * interact(target) + * .draggable({ + * // disable the default drag start by down->move + * manualStart: true + * }) + * // start dragging after the user holds the pointer down + * .on('hold', function (event) { + * var interaction = event.interaction + * + * if (!interaction.interacting()) { + * interaction.start({ name: 'drag' }, + * event.interactable, + * event.currentTarget) + * } + * }) + * ``` + * + * Start an action with the given Interactable and Element as tartgets. The + * action must be enabled for the target Interactable and an appropriate + * number of pointers must be held down - 1 for drag/resize, 2 for gesture. + * + * Use it with `interactable.able({ manualStart: false })` to always + * [start actions manually](https://github.com/taye/interact.js/issues/114) + * + * @param {object} action The action to be performed - drag, resize, etc. + * @param {Interactable} target The Interactable to target + * @param {Element} element The DOM Element to target + * @return {object} interact + */ + + }, { + key: "start", + value: function start(action, interactable, element) { + if (this.interacting() || !this.pointerIsDown || this.pointers.length < (action.name === 'gesture' ? 2 : 1) || !interactable.options[action.name].enabled) { + return false; + } + + (0, _$misc_78.copyAction)(this.prepared, action); + this.interactable = interactable; + this.element = element; + this.rect = interactable.getRect(element); + this.edges = this.prepared.edges ? (0, _$extend_73["default"])({}, this.prepared.edges) : { + left: true, + right: true, + top: true, + bottom: true + }; + this._stopped = false; + this._interacting = this._doPhase({ + interaction: this, + event: this.downEvent, + phase: 'start' + }) && !this._stopped; + return this._interacting; + } + }, { + key: "pointerMove", + value: function pointerMove(pointer, event, eventTarget) { + if (!this.simulation && !(this.modification && this.modification.endResult)) { + this.updatePointer(pointer, event, eventTarget, false); + } + + var duplicateMove = this.coords.cur.page.x === this.coords.prev.page.x && this.coords.cur.page.y === this.coords.prev.page.y && this.coords.cur.client.x === this.coords.prev.client.x && this.coords.cur.client.y === this.coords.prev.client.y; + var dx; + var dy; // register movement greater than pointerMoveTolerance + + if (this.pointerIsDown && !this.pointerWasMoved) { + dx = this.coords.cur.client.x - this.coords.start.client.x; + dy = this.coords.cur.client.y - this.coords.start.client.y; + this.pointerWasMoved = (0, _$hypot_75["default"])(dx, dy) > this.pointerMoveTolerance; + } + + var pointerIndex = this.getPointerIndex(pointer); + var signalArg = { + pointer: pointer, + pointerIndex: pointerIndex, + pointerInfo: this.pointers[pointerIndex], + event: event, + type: 'move', + eventTarget: eventTarget, + dx: dx, + dy: dy, + duplicate: duplicateMove, + interaction: this + }; + + if (!duplicateMove) { + // set pointer coordinate, time changes and velocity + _$pointerUtils_81.setCoordVelocity(this.coords.velocity, this.coords.delta); + } + + this._scopeFire('interactions:move', signalArg); + + if (!duplicateMove && !this.simulation) { + // if interacting, fire an 'action-move' signal etc + if (this.interacting()) { + signalArg.type = null; + this.move(signalArg); + } + + if (this.pointerWasMoved) { + _$pointerUtils_81.copyCoords(this.coords.prev, this.coords.cur); + } + } + } + /** + * ```js + * interact(target) + * .draggable(true) + * .on('dragmove', function (event) { + * if (someCondition) { + * // change the snap settings + * event.interactable.draggable({ snap: { targets: [] }}) + * // fire another move event with re-calculated snap + * event.interaction.move() + * } + * }) + * ``` + * + * Force a move of the current action at the same coordinates. Useful if + * snap/restrict has been changed and you want a movement with the new + * settings. + */ + + }, { + key: "move", + value: function move(signalArg) { + if (!signalArg || !signalArg.event) { + _$pointerUtils_81.setZeroCoords(this.coords.delta); + } + + signalArg = (0, _$extend_73["default"])({ + pointer: this._latestPointer.pointer, + event: this._latestPointer.event, + eventTarget: this._latestPointer.eventTarget, + interaction: this + }, signalArg || {}); + signalArg.phase = 'move'; + + this._doPhase(signalArg); + } // End interact move events and stop auto-scroll unless simulation is running + + }, { + key: "pointerUp", + value: function pointerUp(pointer, event, eventTarget, curEventTarget) { + var pointerIndex = this.getPointerIndex(pointer); + + if (pointerIndex === -1) { + pointerIndex = this.updatePointer(pointer, event, eventTarget, false); + } + + var type = /cancel$/i.test(event.type) ? 'cancel' : 'up'; + + this._scopeFire("interactions:".concat(type), { + pointer: pointer, + pointerIndex: pointerIndex, + pointerInfo: this.pointers[pointerIndex], + event: event, + eventTarget: eventTarget, + type: type, + curEventTarget: curEventTarget, + interaction: this + }); + + if (!this.simulation) { + this.end(event); + } + + this.pointerIsDown = false; + this.removePointer(pointer, event); + } + }, { + key: "documentBlur", + value: function documentBlur(event) { + this.end(event); + + this._scopeFire('interactions:blur', { + event: event, + type: 'blur', + interaction: this + }); + } + /** + * ```js + * interact(target) + * .draggable(true) + * .on('move', function (event) { + * if (event.pageX > 1000) { + * // end the current action + * event.interaction.end() + * // stop all further listeners from being called + * event.stopImmediatePropagation() + * } + * }) + * ``` + * + * @param {PointerEvent} [event] + */ + + }, { + key: "end", + value: function end(event) { + this._ending = true; + event = event || this._latestPointer.event; + var endPhaseResult; + + if (this.interacting()) { + endPhaseResult = this._doPhase({ + event: event, + interaction: this, + phase: 'end' + }); + } + + this._ending = false; + + if (endPhaseResult === true) { + this.stop(); + } + } + }, { + key: "currentAction", + value: function currentAction() { + return this._interacting ? this.prepared.name : null; + } + }, { + key: "interacting", + value: function interacting() { + return this._interacting; + } + /** */ + + }, { + key: "stop", + value: function stop() { + this._scopeFire('interactions:stop', { + interaction: this + }); + + this.interactable = this.element = null; + this._interacting = false; + this._stopped = true; + this.prepared.name = this.prevEvent = null; + } + }, { + key: "getPointerIndex", + value: function getPointerIndex(pointer) { + var pointerId = _$pointerUtils_81.getPointerId(pointer); // mouse and pen interactions may have only one pointer + + + return this.pointerType === 'mouse' || this.pointerType === 'pen' ? this.pointers.length - 1 : _$arr_66.findIndex(this.pointers, function (curPointer) { + return curPointer.id === pointerId; + }); + } + }, { + key: "getPointerInfo", + value: function getPointerInfo(pointer) { + return this.pointers[this.getPointerIndex(pointer)]; + } + }, { + key: "updatePointer", + value: function updatePointer(pointer, event, eventTarget, down) { + var id = _$pointerUtils_81.getPointerId(pointer); + + var pointerIndex = this.getPointerIndex(pointer); + var pointerInfo = this.pointers[pointerIndex]; + down = down === false ? false : down || /(down|start)$/i.test(event.type); + + if (!pointerInfo) { + pointerInfo = new _$PointerInfo_21.PointerInfo(id, pointer, event, null, null); + pointerIndex = this.pointers.length; + this.pointers.push(pointerInfo); + } else { + pointerInfo.pointer = pointer; + } + + _$pointerUtils_81.setCoords(this.coords.cur, this.pointers.map(function (p) { + return p.pointer; + }), this._now()); + + _$pointerUtils_81.setCoordDeltas(this.coords.delta, this.coords.prev, this.coords.cur); + + if (down) { + this.pointerIsDown = true; + pointerInfo.downTime = this.coords.cur.timeStamp; + pointerInfo.downTarget = eventTarget; + + _$pointerUtils_81.pointerExtend(this.downPointer, pointer); + + if (!this.interacting()) { + _$pointerUtils_81.copyCoords(this.coords.start, this.coords.cur); + + _$pointerUtils_81.copyCoords(this.coords.prev, this.coords.cur); + + this.downEvent = event; + this.pointerWasMoved = false; + } + } + + this._updateLatestPointer(pointer, event, eventTarget); + + this._scopeFire('interactions:update-pointer', { + pointer: pointer, + event: event, + eventTarget: eventTarget, + down: down, + pointerInfo: pointerInfo, + pointerIndex: pointerIndex, + interaction: this + }); + + return pointerIndex; + } + }, { + key: "removePointer", + value: function removePointer(pointer, event) { + var pointerIndex = this.getPointerIndex(pointer); + + if (pointerIndex === -1) { + return; + } + + var pointerInfo = this.pointers[pointerIndex]; + + this._scopeFire('interactions:remove-pointer', { + pointer: pointer, + event: event, + eventTarget: null, + pointerIndex: pointerIndex, + pointerInfo: pointerInfo, + interaction: this + }); + + this.pointers.splice(pointerIndex, 1); + } + }, { + key: "_updateLatestPointer", + value: function _updateLatestPointer(pointer, event, eventTarget) { + this._latestPointer.pointer = pointer; + this._latestPointer.event = event; + this._latestPointer.eventTarget = eventTarget; + } + }, { + key: "destroy", + value: function destroy() { + this._latestPointer.pointer = null; + this._latestPointer.event = null; + this._latestPointer.eventTarget = null; + } + }, { + key: "_createPreparedEvent", + value: function _createPreparedEvent(event, phase, preEnd, type) { + return new _$InteractEvent_17.InteractEvent(this, event, this.prepared.name, phase, this.element, preEnd, type); + } + }, { + key: "_fireEvent", + value: function _fireEvent(iEvent) { + this.interactable.fire(iEvent); + + if (!this.prevEvent || iEvent.timeStamp >= this.prevEvent.timeStamp) { + this.prevEvent = iEvent; + } + } + }, { + key: "_doPhase", + value: function _doPhase(signalArg) { + var event = signalArg.event, + phase = signalArg.phase, + preEnd = signalArg.preEnd, + type = signalArg.type; + var rect = this.rect; + + if (rect && phase === 'move') { + // update the rect changes due to pointer move + _$rect_83.addEdges(this.edges, rect, this.coords.delta[this.interactable.options.deltaSource]); + + rect.width = rect.right - rect.left; + rect.height = rect.bottom - rect.top; + } + + var beforeResult = this._scopeFire("interactions:before-action-".concat(phase), signalArg); + + if (beforeResult === false) { + return false; + } + + var iEvent = signalArg.iEvent = this._createPreparedEvent(event, phase, preEnd, type); + + this._scopeFire("interactions:action-".concat(phase), signalArg); + + if (phase === 'start') { + this.prevEvent = iEvent; + } + + this._fireEvent(iEvent); + + this._scopeFire("interactions:after-action-".concat(phase), signalArg); + + return true; + } + }, { + key: "_now", + value: function _now() { + return Date.now(); + } + }]); + + return Interaction; + }(); + + _$Interaction_20.Interaction = Interaction; + var ___default_20 = Interaction; + _$Interaction_20["default"] = ___default_20; + var _$plugin_53 = {}; + "use strict"; + + Object.defineProperty(_$plugin_53, "__esModule", { + value: true + }); + _$plugin_53.addTotal = addTotal; + _$plugin_53.applyPending = applyPending; + _$plugin_53["default"] = void 0; + /* removed: var _$Interaction_20 = require("../core/Interaction.js"); */ + + ; + /* removed: var _$rect_83 = require("../utils/rect.js"); */ + + ; + _$Interaction_20._ProxyMethods.offsetBy = ''; + + function addTotal(interaction) { + if (!interaction.pointerIsDown) { + return; + } + + addToCoords(interaction.coords.cur, interaction.offset.total); + interaction.offset.pending.x = 0; + interaction.offset.pending.y = 0; + } + + function beforeAction(_ref) { + var interaction = _ref.interaction; + applyPending(interaction); + } + + function beforeEnd(_ref2) { + var interaction = _ref2.interaction; + var hadPending = applyPending(interaction); + + if (!hadPending) { + return; + } + + interaction.move({ + offset: true + }); + interaction.end(); + return false; + } + + function __end_53(_ref3) { + var interaction = _ref3.interaction; + interaction.offset.total.x = 0; + interaction.offset.total.y = 0; + interaction.offset.pending.x = 0; + interaction.offset.pending.y = 0; + } + + function applyPending(interaction) { + if (!hasPending(interaction)) { + return false; + } + + var pending = interaction.offset.pending; + addToCoords(interaction.coords.cur, pending); + addToCoords(interaction.coords.delta, pending); + + _$rect_83.addEdges(interaction.edges, interaction.rect, pending); + + pending.x = 0; + pending.y = 0; + return true; + } + + function offsetBy(_ref4) { + var x = _ref4.x, + y = _ref4.y; + this.offset.pending.x += x; + this.offset.pending.y += y; + this.offset.total.x += x; + this.offset.total.y += y; + } + + function addToCoords(_ref5, _ref6) { + var page = _ref5.page, + client = _ref5.client; + var x = _ref6.x, + y = _ref6.y; + page.x += x; + page.y += y; + client.x += x; + client.y += y; + } + + function hasPending(interaction) { + return !!(interaction.offset.pending.x || interaction.offset.pending.y); + } + + var offset = { + id: 'offset', + before: ['modifiers'], + install: function install(scope) { + scope.Interaction.prototype.offsetBy = offsetBy; + }, + listeners: { + 'interactions:new': function interactionsNew(_ref7) { + var interaction = _ref7.interaction; + interaction.offset = { + total: { + x: 0, + y: 0 + }, + pending: { + x: 0, + y: 0 + } + }; + }, + 'interactions:update-pointer': function interactionsUpdatePointer(_ref8) { + var interaction = _ref8.interaction; + return addTotal(interaction); + }, + 'interactions:before-action-start': beforeAction, + 'interactions:before-action-move': beforeAction, + 'interactions:before-action-end': beforeEnd, + 'interactions:stop': __end_53 + } + }; + var ___default_53 = offset; + _$plugin_53["default"] = ___default_53; + var _$plugin_32 = {}; + "use strict"; + + Object.defineProperty(_$plugin_32, "__esModule", { + value: true + }); + _$plugin_32["default"] = _$plugin_32.InertiaState = void 0; + /* removed: var _$Modification_35 = require("../modifiers/Modification.js"); */ + + ; + /* removed: var _$base_39 = require("../modifiers/base.js"); */ + + ; + /* removed: var _$plugin_53 = require("../offset/plugin.js"); */ + + ; + /* removed: var _$domUtils_71 = require("../utils/domUtils.js"); */ + + ; + /* removed: var _$hypot_75 = require("../utils/hypot.js"); */ + + ; + /* removed: var _$is_76 = require("../utils/is.js"); */ + + ; + /* removed: var _$pointerUtils_81 = require("../utils/pointerUtils.js"); */ + + ; + /* removed: var _$raf_82 = require("../utils/raf.js"); */ + + ; + + function ___classCallCheck_32(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function ___defineProperties_32(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function ___createClass_32(Constructor, protoProps, staticProps) { + if (protoProps) ___defineProperties_32(Constructor.prototype, protoProps); + if (staticProps) ___defineProperties_32(Constructor, staticProps); + return Constructor; + } + + function __install_32(scope) { + var defaults = scope.defaults; + scope.usePlugin(_$plugin_53["default"]); + scope.usePlugin(_$base_39["default"]); + scope.actions.phases.inertiastart = true; + scope.actions.phases.resume = true; + defaults.perAction.inertia = { + enabled: false, + resistance: 10, + // the lambda in exponential decay + minSpeed: 100, + // target speed must be above this for inertia to start + endSpeed: 10, + // the speed at which inertia is slow enough to stop + allowResume: true, + // allow resuming an action in inertia phase + smoothEndDuration: 300 // animate to snap/restrict endOnly if there's no inertia + + }; + } + + var InertiaState = /*#__PURE__*/function () { + // eslint-disable-line camelcase + // eslint-disable-line camelcase + function InertiaState(interaction) { + ___classCallCheck_32(this, InertiaState); + + this.active = false; + this.isModified = false; + this.smoothEnd = false; + this.allowResume = false; + this.modification = null; + this.modifierCount = 0; + this.modifierArg = null; + this.startCoords = null; + this.t0 = 0; + this.v0 = 0; + this.te = 0; + this.targetOffset = null; + this.modifiedOffset = null; + this.currentOffset = null; + this.lambda_v0 = 0; + this.one_ve_v0 = 0; + this.timeout = null; + this.interaction = void 0; + this.interaction = interaction; + } + + ___createClass_32(InertiaState, [{ + key: "start", + value: function start(event) { + var interaction = this.interaction; + var options = getOptions(interaction); + + if (!options || !options.enabled) { + return false; + } + + var velocityClient = interaction.coords.velocity.client; + var pointerSpeed = (0, _$hypot_75["default"])(velocityClient.x, velocityClient.y); + var modification = this.modification || (this.modification = new _$Modification_35["default"](interaction)); + modification.copyFrom(interaction.modification); + this.t0 = interaction._now(); + this.allowResume = options.allowResume; + this.v0 = pointerSpeed; + this.currentOffset = { + x: 0, + y: 0 + }; + this.startCoords = interaction.coords.cur.page; + this.modifierArg = { + interaction: interaction, + interactable: interaction.interactable, + element: interaction.element, + rect: interaction.rect, + edges: interaction.edges, + pageCoords: this.startCoords, + preEnd: true, + phase: 'inertiastart' + }; + var thrown = this.t0 - interaction.coords.cur.timeStamp < 50 && pointerSpeed > options.minSpeed && pointerSpeed > options.endSpeed; + + if (thrown) { + this.startInertia(); + } else { + modification.result = modification.setAll(this.modifierArg); + + if (!modification.result.changed) { + return false; + } + + this.startSmoothEnd(); + } // force modification change + + + interaction.modification.result.rect = null; // bring inertiastart event to the target coords + + interaction.offsetBy(this.targetOffset); + + interaction._doPhase({ + interaction: interaction, + event: event, + phase: 'inertiastart' + }); + + interaction.offsetBy({ + x: -this.targetOffset.x, + y: -this.targetOffset.y + }); // force modification change + + interaction.modification.result.rect = null; + this.active = true; + interaction.simulation = this; + return true; + } + }, { + key: "startInertia", + value: function startInertia() { + var _this = this; + + var startVelocity = this.interaction.coords.velocity.client; + var options = getOptions(this.interaction); + var lambda = options.resistance; + var inertiaDur = -Math.log(options.endSpeed / this.v0) / lambda; + this.targetOffset = { + x: (startVelocity.x - inertiaDur) / lambda, + y: (startVelocity.y - inertiaDur) / lambda + }; + this.te = inertiaDur; + this.lambda_v0 = lambda / this.v0; + this.one_ve_v0 = 1 - options.endSpeed / this.v0; + var modification = this.modification, + modifierArg = this.modifierArg; + modifierArg.pageCoords = { + x: this.startCoords.x + this.targetOffset.x, + y: this.startCoords.y + this.targetOffset.y + }; + modification.result = modification.setAll(modifierArg); + + if (modification.result.changed) { + this.isModified = true; + this.modifiedOffset = { + x: this.targetOffset.x + modification.result.delta.x, + y: this.targetOffset.y + modification.result.delta.y + }; + } + + this.timeout = _$raf_82["default"].request(function () { + return _this.inertiaTick(); + }); + } + }, { + key: "startSmoothEnd", + value: function startSmoothEnd() { + var _this2 = this; + + this.smoothEnd = true; + this.isModified = true; + this.targetOffset = { + x: this.modification.result.delta.x, + y: this.modification.result.delta.y + }; + this.timeout = _$raf_82["default"].request(function () { + return _this2.smoothEndTick(); + }); + } + }, { + key: "inertiaTick", + value: function inertiaTick() { + var _this3 = this; + + var interaction = this.interaction; + var options = getOptions(interaction); + var lambda = options.resistance; + var t = (interaction._now() - this.t0) / 1000; + + if (t < this.te) { + var progress = 1 - (Math.exp(-lambda * t) - this.lambda_v0) / this.one_ve_v0; + var newOffset; + + if (this.isModified) { + newOffset = getQuadraticCurvePoint(0, 0, this.targetOffset.x, this.targetOffset.y, this.modifiedOffset.x, this.modifiedOffset.y, progress); + } else { + newOffset = { + x: this.targetOffset.x * progress, + y: this.targetOffset.y * progress + }; + } + + var delta = { + x: newOffset.x - this.currentOffset.x, + y: newOffset.y - this.currentOffset.y + }; + this.currentOffset.x += delta.x; + this.currentOffset.y += delta.y; + interaction.offsetBy(delta); + interaction.move(); + this.timeout = _$raf_82["default"].request(function () { + return _this3.inertiaTick(); + }); + } else { + interaction.offsetBy({ + x: this.modifiedOffset.x - this.currentOffset.x, + y: this.modifiedOffset.y - this.currentOffset.y + }); + this.end(); + } + } + }, { + key: "smoothEndTick", + value: function smoothEndTick() { + var _this4 = this; + + var interaction = this.interaction; + var t = interaction._now() - this.t0; + + var _getOptions = getOptions(interaction), + duration = _getOptions.smoothEndDuration; + + if (t < duration) { + var newOffset = { + x: easeOutQuad(t, 0, this.targetOffset.x, duration), + y: easeOutQuad(t, 0, this.targetOffset.y, duration) + }; + var delta = { + x: newOffset.x - this.currentOffset.x, + y: newOffset.y - this.currentOffset.y + }; + this.currentOffset.x += delta.x; + this.currentOffset.y += delta.y; + interaction.offsetBy(delta); + interaction.move({ + skipModifiers: this.modifierCount + }); + this.timeout = _$raf_82["default"].request(function () { + return _this4.smoothEndTick(); + }); + } else { + interaction.offsetBy({ + x: this.targetOffset.x - this.currentOffset.x, + y: this.targetOffset.y - this.currentOffset.y + }); + this.end(); + } + } + }, { + key: "resume", + value: function resume(_ref) { + var pointer = _ref.pointer, + event = _ref.event, + eventTarget = _ref.eventTarget; + var interaction = this.interaction; // undo inertia changes to interaction coords + + interaction.offsetBy({ + x: -this.currentOffset.x, + y: -this.currentOffset.y + }); // update pointer at pointer down position + + interaction.updatePointer(pointer, event, eventTarget, true); // fire resume signals and event + + interaction._doPhase({ + interaction: interaction, + event: event, + phase: 'resume' + }); + + (0, _$pointerUtils_81.copyCoords)(interaction.coords.prev, interaction.coords.cur); + this.stop(); + } + }, { + key: "end", + value: function end() { + this.interaction.move(); + this.interaction.end(); + this.stop(); + } + }, { + key: "stop", + value: function stop() { + this.active = this.smoothEnd = false; + this.interaction.simulation = null; + + _$raf_82["default"].cancel(this.timeout); + } + }]); + + return InertiaState; + }(); + + _$plugin_32.InertiaState = InertiaState; + + function __start_32(_ref2) { + var interaction = _ref2.interaction, + event = _ref2.event; + + if (!interaction._interacting || interaction.simulation) { + return null; + } + + var started = interaction.inertia.start(event); // prevent action end if inertia or smoothEnd + + return started ? false : null; + } // Check if the down event hits the current inertia target + // control should be return to the user + + + function resume(arg) { + var interaction = arg.interaction, + eventTarget = arg.eventTarget; + var state = interaction.inertia; + + if (!state.active) { + return; + } + + var element = eventTarget; // climb up the DOM tree from the event target + + while (_$is_76["default"].element(element)) { + // if interaction element is the current inertia target element + if (element === interaction.element) { + state.resume(arg); + break; + } + + element = _$domUtils_71.parentNode(element); + } + } + + function stop(_ref3) { + var interaction = _ref3.interaction; + var state = interaction.inertia; + + if (state.active) { + state.stop(); + } + } + + function getOptions(_ref4) { + var interactable = _ref4.interactable, + prepared = _ref4.prepared; + return interactable && interactable.options && prepared.name && interactable.options[prepared.name].inertia; + } + + var inertia = { + id: 'inertia', + before: ['modifiers'], + install: __install_32, + listeners: { + 'interactions:new': function interactionsNew(_ref5) { + var interaction = _ref5.interaction; + interaction.inertia = new InertiaState(interaction); + }, + 'interactions:before-action-end': __start_32, + 'interactions:down': resume, + 'interactions:stop': stop, + 'interactions:before-action-resume': function interactionsBeforeActionResume(arg) { + var modification = arg.interaction.modification; + modification.stop(arg); + modification.start(arg, arg.interaction.coords.cur.page); + modification.applyToInteraction(arg); + }, + 'interactions:before-action-inertiastart': function interactionsBeforeActionInertiastart(arg) { + return arg.interaction.modification.setAndApply(arg); + }, + 'interactions:action-resume': _$base_39.addEventModifiers, + 'interactions:action-inertiastart': _$base_39.addEventModifiers, + 'interactions:after-action-inertiastart': function interactionsAfterActionInertiastart(arg) { + return arg.interaction.modification.restoreInteractionCoords(arg); + }, + 'interactions:after-action-resume': function interactionsAfterActionResume(arg) { + return arg.interaction.modification.restoreInteractionCoords(arg); + } + } + }; // http://stackoverflow.com/a/5634528/2280888 + + function _getQBezierValue(t, p1, p2, p3) { + var iT = 1 - t; + return iT * iT * p1 + 2 * iT * t * p2 + t * t * p3; + } + + function getQuadraticCurvePoint(startX, startY, cpX, cpY, endX, endY, position) { + return { + x: _getQBezierValue(position, startX, cpX, endX), + y: _getQBezierValue(position, startY, cpY, endY) + }; + } // http://gizma.com/easing/ + + + function easeOutQuad(t, b, c, d) { + t /= d; + return -c * t * (t - 2) + b; + } + + var ___default_32 = inertia; + _$plugin_32["default"] = ___default_32; + var _$Eventable_16 = {}; + "use strict"; + + Object.defineProperty(_$Eventable_16, "__esModule", { + value: true + }); + _$Eventable_16.Eventable = void 0; + /* removed: var _$arr_66 = require("../utils/arr.js"); */ + + ; + /* removed: var _$extend_73 = require("../utils/extend.js"); */ + + ; + /* removed: var _$normalizeListeners_79 = require("../utils/normalizeListeners.js"); */ + + ; + + function ___classCallCheck_16(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function ___defineProperties_16(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function ___createClass_16(Constructor, protoProps, staticProps) { + if (protoProps) ___defineProperties_16(Constructor.prototype, protoProps); + if (staticProps) ___defineProperties_16(Constructor, staticProps); + return Constructor; + } + + function fireUntilImmediateStopped(event, listeners) { + for (var _i = 0; _i < listeners.length; _i++) { + var _ref; + + _ref = listeners[_i]; + var listener = _ref; + + if (event.immediatePropagationStopped) { + break; + } + + listener(event); + } + } + + var Eventable = /*#__PURE__*/function () { + function Eventable(options) { + ___classCallCheck_16(this, Eventable); + + this.options = void 0; + this.types = {}; + this.propagationStopped = false; + this.immediatePropagationStopped = false; + this.global = void 0; + this.options = (0, _$extend_73["default"])({}, options || {}); + } + + ___createClass_16(Eventable, [{ + key: "fire", + value: function fire(event) { + var listeners; + var global = this.global; // Interactable#on() listeners + // tslint:disable no-conditional-assignment + + if (listeners = this.types[event.type]) { + fireUntilImmediateStopped(event, listeners); + } // interact.on() listeners + + + if (!event.propagationStopped && global && (listeners = global[event.type])) { + fireUntilImmediateStopped(event, listeners); + } + } + }, { + key: "on", + value: function on(type, listener) { + var listeners = (0, _$normalizeListeners_79["default"])(type, listener); + + for (type in listeners) { + this.types[type] = _$arr_66.merge(this.types[type] || [], listeners[type]); + } + } + }, { + key: "off", + value: function off(type, listener) { + var listeners = (0, _$normalizeListeners_79["default"])(type, listener); + + for (type in listeners) { + var eventList = this.types[type]; + + if (!eventList || !eventList.length) { + continue; + } + + for (var _i2 = 0; _i2 < listeners[type].length; _i2++) { + var _ref2; + + _ref2 = listeners[type][_i2]; + var subListener = _ref2; + var index = eventList.indexOf(subListener); + + if (index !== -1) { + eventList.splice(index, 1); + } + } + } + } + }, { + key: "getRect", + value: function getRect(_element) { + return null; + } + }]); + + return Eventable; + }(); + + _$Eventable_16.Eventable = Eventable; + var _$isNonNativeEvent_28 = {}; + "use strict"; + + Object.defineProperty(_$isNonNativeEvent_28, "__esModule", { + value: true + }); + _$isNonNativeEvent_28["default"] = isNonNativeEvent; + + function isNonNativeEvent(type, actions) { + if (actions.phaselessTypes[type]) { + return true; + } + + for (var name in actions.map) { + if (type.indexOf(name) === 0 && type.substr(name.length) in actions.phases) { + return true; + } + } + + return false; + } + + var _$Interactable_18 = {}; + "use strict"; + + Object.defineProperty(_$Interactable_18, "__esModule", { + value: true + }); + _$Interactable_18.Interactable = void 0; + /* removed: var _$arr_66 = require("../utils/arr.js"); */ + + ; + /* removed: var _$browser_67 = require("../utils/browser.js"); */ + + ; + /* removed: var _$clone_68 = require("../utils/clone.js"); */ + + ; + /* removed: var _$domUtils_71 = require("../utils/domUtils.js"); */ + + ; + /* removed: var _$extend_73 = require("../utils/extend.js"); */ + + ; + /* removed: var _$is_76 = require("../utils/is.js"); */ + + ; + /* removed: var _$normalizeListeners_79 = require("../utils/normalizeListeners.js"); */ + + ; + /* removed: var _$window_84 = require("../utils/window.js"); */ + + ; + /* removed: var _$Eventable_16 = require("./Eventable.js"); */ + + ; + /* removed: var _$isNonNativeEvent_28 = require("./isNonNativeEvent.js"); */ + + ; + + function ___classCallCheck_18(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function ___defineProperties_18(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function ___createClass_18(Constructor, protoProps, staticProps) { + if (protoProps) ___defineProperties_18(Constructor.prototype, protoProps); + if (staticProps) ___defineProperties_18(Constructor, staticProps); + return Constructor; + } + /** */ + + + var Interactable = /*#__PURE__*/function () { + ___createClass_18(Interactable, [{ + key: "_defaults", + + /** @internal */ + get: function get() { + return { + base: {}, + perAction: {}, + actions: {} + }; + } + /** */ + + }]); + + function Interactable(target, options, defaultContext, scopeEvents) { + ___classCallCheck_18(this, Interactable); + + this.options = void 0; + this._actions = void 0; + this.target = void 0; + this.events = new _$Eventable_16.Eventable(); + this._context = void 0; + this._win = void 0; + this._doc = void 0; + this._scopeEvents = void 0; + this._rectChecker = void 0; + this._actions = options.actions; + this.target = target; + this._context = options.context || defaultContext; + this._win = (0, _$window_84.getWindow)((0, _$domUtils_71.trySelector)(target) ? this._context : target); + this._doc = this._win.document; + this._scopeEvents = scopeEvents; + this.set(options); + } + + ___createClass_18(Interactable, [{ + key: "setOnEvents", + value: function setOnEvents(actionName, phases) { + if (_$is_76["default"].func(phases.onstart)) { + this.on("".concat(actionName, "start"), phases.onstart); + } + + if (_$is_76["default"].func(phases.onmove)) { + this.on("".concat(actionName, "move"), phases.onmove); + } + + if (_$is_76["default"].func(phases.onend)) { + this.on("".concat(actionName, "end"), phases.onend); + } + + if (_$is_76["default"].func(phases.oninertiastart)) { + this.on("".concat(actionName, "inertiastart"), phases.oninertiastart); + } + + return this; + } + }, { + key: "updatePerActionListeners", + value: function updatePerActionListeners(actionName, prev, cur) { + if (_$is_76["default"].array(prev) || _$is_76["default"].object(prev)) { + this.off(actionName, prev); + } + + if (_$is_76["default"].array(cur) || _$is_76["default"].object(cur)) { + this.on(actionName, cur); + } + } + }, { + key: "setPerAction", + value: function setPerAction(actionName, options) { + var defaults = this._defaults; // for all the default per-action options + + for (var optionName_ in options) { + var optionName = optionName_; + var actionOptions = this.options[actionName]; + var optionValue = options[optionName]; // remove old event listeners and add new ones + + if (optionName === 'listeners') { + this.updatePerActionListeners(actionName, actionOptions.listeners, optionValue); + } // if the option value is an array + + + if (_$is_76["default"].array(optionValue)) { + actionOptions[optionName] = _$arr_66.from(optionValue); + } // if the option value is an object + else if (_$is_76["default"].plainObject(optionValue)) { + // copy the object + actionOptions[optionName] = (0, _$extend_73["default"])(actionOptions[optionName] || {}, (0, _$clone_68["default"])(optionValue)); // set anabled field to true if it exists in the defaults + + if (_$is_76["default"].object(defaults.perAction[optionName]) && 'enabled' in defaults.perAction[optionName]) { + actionOptions[optionName].enabled = optionValue.enabled !== false; + } + } // if the option value is a boolean and the default is an object + else if (_$is_76["default"].bool(optionValue) && _$is_76["default"].object(defaults.perAction[optionName])) { + actionOptions[optionName].enabled = optionValue; + } // if it's anything else, do a plain assignment + else { + actionOptions[optionName] = optionValue; + } + } + } + /** + * The default function to get an Interactables bounding rect. Can be + * overridden using {@link Interactable.rectChecker}. + * + * @param {Element} [element] The element to measure. + * @return {Interact.Rect} The object's bounding rectangle. + */ + + }, { + key: "getRect", + value: function getRect(element) { + element = element || (_$is_76["default"].element(this.target) ? this.target : null); + + if (_$is_76["default"].string(this.target)) { + element = element || this._context.querySelector(this.target); + } + + return (0, _$domUtils_71.getElementRect)(element); + } + /** + * Returns or sets the function used to calculate the interactable's + * element's rectangle + * + * @param {function} [checker] A function which returns this Interactable's + * bounding rectangle. See {@link Interactable.getRect} + * @return {function | object} The checker function or this Interactable + */ + + }, { + key: "rectChecker", + value: function rectChecker(checker) { + var _this = this; + + if (_$is_76["default"].func(checker)) { + this._rectChecker = checker; + + this.getRect = function (element) { + var rect = (0, _$extend_73["default"])({}, _this._rectChecker(element)); + + if (!('width' in rect)) { + rect.width = rect.right - rect.left; + rect.height = rect.bottom - rect.top; + } + + return rect; + }; + + return this; + } + + if (checker === null) { + delete this.getRect; + delete this._rectChecker; + return this; + } + + return this.getRect; + } + }, { + key: "_backCompatOption", + value: function _backCompatOption(optionName, newValue) { + if ((0, _$domUtils_71.trySelector)(newValue) || _$is_76["default"].object(newValue)) { + this.options[optionName] = newValue; + + for (var action in this._actions.map) { + this.options[action][optionName] = newValue; + } + + return this; + } + + return this.options[optionName]; + } + /** + * Gets or sets the origin of the Interactable's element. The x and y + * of the origin will be subtracted from action event coordinates. + * + * @param {Element | object | string} [origin] An HTML or SVG Element whose + * rect will be used, an object eg. { x: 0, y: 0 } or string 'parent', 'self' + * or any CSS selector + * + * @return {object} The current origin or this Interactable + */ + + }, { + key: "origin", + value: function origin(newValue) { + return this._backCompatOption('origin', newValue); + } + /** + * Returns or sets the mouse coordinate types used to calculate the + * movement of the pointer. + * + * @param {string} [newValue] Use 'client' if you will be scrolling while + * interacting; Use 'page' if you want autoScroll to work + * @return {string | object} The current deltaSource or this Interactable + */ + + }, { + key: "deltaSource", + value: function deltaSource(newValue) { + if (newValue === 'page' || newValue === 'client') { + this.options.deltaSource = newValue; + return this; + } + + return this.options.deltaSource; + } + /** + * Gets the selector context Node of the Interactable. The default is + * `window.document`. + * + * @return {Node} The context Node of this Interactable + */ + + }, { + key: "context", + value: function context() { + return this._context; + } + }, { + key: "inContext", + value: function inContext(element) { + return this._context === element.ownerDocument || (0, _$domUtils_71.nodeContains)(this._context, element); + } + }, { + key: "testIgnoreAllow", + value: function testIgnoreAllow(options, targetNode, eventTarget) { + return !this.testIgnore(options.ignoreFrom, targetNode, eventTarget) && this.testAllow(options.allowFrom, targetNode, eventTarget); + } + }, { + key: "testAllow", + value: function testAllow(allowFrom, targetNode, element) { + if (!allowFrom) { + return true; + } + + if (!_$is_76["default"].element(element)) { + return false; + } + + if (_$is_76["default"].string(allowFrom)) { + return (0, _$domUtils_71.matchesUpTo)(element, allowFrom, targetNode); + } else if (_$is_76["default"].element(allowFrom)) { + return (0, _$domUtils_71.nodeContains)(allowFrom, element); + } + + return false; + } + }, { + key: "testIgnore", + value: function testIgnore(ignoreFrom, targetNode, element) { + if (!ignoreFrom || !_$is_76["default"].element(element)) { + return false; + } + + if (_$is_76["default"].string(ignoreFrom)) { + return (0, _$domUtils_71.matchesUpTo)(element, ignoreFrom, targetNode); + } else if (_$is_76["default"].element(ignoreFrom)) { + return (0, _$domUtils_71.nodeContains)(ignoreFrom, element); + } + + return false; + } + /** + * Calls listeners for the given InteractEvent type bound globally + * and directly to this Interactable + * + * @param {InteractEvent} iEvent The InteractEvent object to be fired on this + * Interactable + * @return {Interactable} this Interactable + */ + + }, { + key: "fire", + value: function fire(iEvent) { + this.events.fire(iEvent); + return this; + } + }, { + key: "_onOff", + value: function _onOff(method, typeArg, listenerArg, options) { + if (_$is_76["default"].object(typeArg) && !_$is_76["default"].array(typeArg)) { + options = listenerArg; + listenerArg = null; + } + + var addRemove = method === 'on' ? 'add' : 'remove'; + var listeners = (0, _$normalizeListeners_79["default"])(typeArg, listenerArg); + + for (var type in listeners) { + if (type === 'wheel') { + type = _$browser_67["default"].wheelEvent; + } + + for (var _i = 0; _i < listeners[type].length; _i++) { + var _ref; + + _ref = listeners[type][_i]; + var listener = _ref; // if it is an action event type + + if ((0, _$isNonNativeEvent_28["default"])(type, this._actions)) { + this.events[method](type, listener); + } // delegated event + else if (_$is_76["default"].string(this.target)) { + this._scopeEvents["".concat(addRemove, "Delegate")](this.target, this._context, type, listener, options); + } // remove listener from this Interactable's element + else { + this._scopeEvents[addRemove](this.target, type, listener, options); + } + } + } + + return this; + } + /** + * Binds a listener for an InteractEvent, pointerEvent or DOM event. + * + * @param {string | array | object} types The types of events to listen + * for + * @param {function | array | object} [listener] The event listener function(s) + * @param {object | boolean} [options] options object or useCapture flag for + * addEventListener + * @return {Interactable} This Interactable + */ + + }, { + key: "on", + value: function on(types, listener, options) { + return this._onOff('on', types, listener, options); + } + /** + * Removes an InteractEvent, pointerEvent or DOM event listener. + * + * @param {string | array | object} types The types of events that were + * listened for + * @param {function | array | object} [listener] The event listener function(s) + * @param {object | boolean} [options] options object or useCapture flag for + * removeEventListener + * @return {Interactable} This Interactable + */ + + }, { + key: "off", + value: function off(types, listener, options) { + return this._onOff('off', types, listener, options); + } + /** + * Reset the options of this Interactable + * + * @param {object} options The new settings to apply + * @return {object} This Interactable + */ + + }, { + key: "set", + value: function set(options) { + var defaults = this._defaults; + + if (!_$is_76["default"].object(options)) { + options = {}; + } + + this.options = (0, _$clone_68["default"])(defaults.base); + + for (var actionName_ in this._actions.methodDict) { + var actionName = actionName_; + var methodName = this._actions.methodDict[actionName]; + this.options[actionName] = {}; + this.setPerAction(actionName, (0, _$extend_73["default"])((0, _$extend_73["default"])({}, defaults.perAction), defaults.actions[actionName])); + this[methodName](options[actionName]); + } + + for (var setting in options) { + if (_$is_76["default"].func(this[setting])) { + this[setting](options[setting]); + } + } + + return this; + } + /** + * Remove this interactable from the list of interactables and remove it's + * action capabilities and event listeners + */ + + }, { + key: "unset", + value: function unset() { + if (_$is_76["default"].string(this.target)) { + // remove delegated events + for (var type in this._scopeEvents.delegatedEvents) { + var delegated = this._scopeEvents.delegatedEvents[type]; + + for (var i = delegated.length - 1; i >= 0; i--) { + var _delegated$i = delegated[i], + selector = _delegated$i.selector, + context = _delegated$i.context, + listeners = _delegated$i.listeners; + + if (selector === this.target && context === this._context) { + delegated.splice(i, 1); + } + + for (var l = listeners.length - 1; l >= 0; l--) { + this._scopeEvents.removeDelegate(this.target, this._context, type, listeners[l][0], listeners[l][1]); + } + } + } + } else { + this._scopeEvents.remove(this.target, 'all'); + } + } + }]); + + return Interactable; + }(); + + _$Interactable_18.Interactable = Interactable; + var _$InteractableSet_19 = {}; + "use strict"; + + Object.defineProperty(_$InteractableSet_19, "__esModule", { + value: true + }); + _$InteractableSet_19.InteractableSet = void 0; + /* removed: var _$arr_66 = require("../utils/arr.js"); */ + + ; + /* removed: var _$domUtils_71 = require("../utils/domUtils.js"); */ + + ; + /* removed: var _$extend_73 = require("../utils/extend.js"); */ + + ; + /* removed: var _$is_76 = require("../utils/is.js"); */ + + ; + + function ___classCallCheck_19(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function ___defineProperties_19(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function ___createClass_19(Constructor, protoProps, staticProps) { + if (protoProps) ___defineProperties_19(Constructor.prototype, protoProps); + if (staticProps) ___defineProperties_19(Constructor, staticProps); + return Constructor; + } + + var InteractableSet = /*#__PURE__*/function () { + // all set interactables + function InteractableSet(scope) { + var _this = this; + + ___classCallCheck_19(this, InteractableSet); + + this.list = []; + this.selectorMap = {}; + this.scope = void 0; + this.scope = scope; + scope.addListeners({ + 'interactable:unset': function interactableUnset(_ref) { + var interactable = _ref.interactable; + var target = interactable.target, + context = interactable._context; + var targetMappings = _$is_76["default"].string(target) ? _this.selectorMap[target] : target[_this.scope.id]; + var targetIndex = targetMappings.findIndex(function (m) { + return m.context === context; + }); + + if (targetMappings[targetIndex]) { + // Destroying mappingInfo's context and interactable + targetMappings[targetIndex].context = null; + targetMappings[targetIndex].interactable = null; + } + + targetMappings.splice(targetIndex, 1); + } + }); + } + + ___createClass_19(InteractableSet, [{ + key: "new", + value: function _new(target, options) { + options = (0, _$extend_73["default"])(options || {}, { + actions: this.scope.actions + }); + var interactable = new this.scope.Interactable(target, options, this.scope.document, this.scope.events); + var mappingInfo = { + context: interactable._context, + interactable: interactable + }; + this.scope.addDocument(interactable._doc); + this.list.push(interactable); + + if (_$is_76["default"].string(target)) { + if (!this.selectorMap[target]) { + this.selectorMap[target] = []; + } + + this.selectorMap[target].push(mappingInfo); + } else { + if (!interactable.target[this.scope.id]) { + Object.defineProperty(target, this.scope.id, { + value: [], + configurable: true + }); + } + + target[this.scope.id].push(mappingInfo); + } + + this.scope.fire('interactable:new', { + target: target, + options: options, + interactable: interactable, + win: this.scope._win + }); + return interactable; + } + }, { + key: "get", + value: function get(target, options) { + var context = options && options.context || this.scope.document; + + var isSelector = _$is_76["default"].string(target); + + var targetMappings = isSelector ? this.selectorMap[target] : target[this.scope.id]; + + if (!targetMappings) { + return null; + } + + var found = _$arr_66.find(targetMappings, function (m) { + return m.context === context && (isSelector || m.interactable.inContext(target)); + }); + + return found && found.interactable; + } + }, { + key: "forEachMatch", + value: function forEachMatch(node, callback) { + for (var _i = 0; _i < this.list.length; _i++) { + var _ref2; + + _ref2 = this.list[_i]; + var interactable = _ref2; + var ret = void 0; + + if ((_$is_76["default"].string(interactable.target) // target is a selector and the element matches + ? _$is_76["default"].element(node) && _$domUtils_71.matchesSelector(node, interactable.target) : // target is the element + node === interactable.target) && // the element is in context + interactable.inContext(node)) { + ret = callback(interactable); + } + + if (ret !== undefined) { + return ret; + } + } + } + }]); + + return InteractableSet; + }(); + + _$InteractableSet_19.InteractableSet = InteractableSet; + var _$events_23 = {}; + "use strict"; + + Object.defineProperty(_$events_23, "__esModule", { + value: true + }); + _$events_23["default"] = _$events_23.FakeEvent = void 0; + /* removed: var _$arr_66 = require("../utils/arr.js"); */ + + ; + /* removed: var _$domUtils_71 = require("../utils/domUtils.js"); */ + + ; + /* removed: var _$extend_73 = require("../utils/extend.js"); */ + + ; + /* removed: var _$is_76 = require("../utils/is.js"); */ + + ; + /* removed: var _$pointerExtend_80 = require("../utils/pointerExtend.js"); */ + + ; + /* removed: var _$pointerUtils_81 = require("../utils/pointerUtils.js"); */ + + ; + + function ___classCallCheck_23(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function ___defineProperties_23(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function ___createClass_23(Constructor, protoProps, staticProps) { + if (protoProps) ___defineProperties_23(Constructor.prototype, protoProps); + if (staticProps) ___defineProperties_23(Constructor, staticProps); + return Constructor; + } + + function ___slicedToArray_23(arr, i) { + return ___arrayWithHoles_23(arr) || ___iterableToArrayLimit_23(arr, i) || ___unsupportedIterableToArray_23(arr, i) || ___nonIterableRest_23(); + } + + function ___nonIterableRest_23() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + + function ___unsupportedIterableToArray_23(o, minLen) { + if (!o) return; + if (typeof o === "string") return ___arrayLikeToArray_23(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return ___arrayLikeToArray_23(o, minLen); + } + + function ___arrayLikeToArray_23(arr, len) { + if (len == null || len > arr.length) len = arr.length; + + for (var i = 0, arr2 = new Array(len); i < len; i++) { + arr2[i] = arr[i]; + } + + return arr2; + } + + function ___iterableToArrayLimit_23(arr, i) { + if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; + var _arr = []; + var _n = true; + var _d = false; + var _e = undefined; + + try { + for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"] != null) _i["return"](); + } finally { + if (_d) throw _e; + } + } + + return _arr; + } + + function ___arrayWithHoles_23(arr) { + if (Array.isArray(arr)) return arr; + } + + function __install_23(scope) { + var targets = []; + var delegatedEvents = {}; + var documents = []; + var eventsMethods = { + add: add, + remove: remove, + addDelegate: addDelegate, + removeDelegate: removeDelegate, + delegateListener: delegateListener, + delegateUseCapture: delegateUseCapture, + delegatedEvents: delegatedEvents, + documents: documents, + targets: targets, + supportsOptions: false, + supportsPassive: false + }; // check if browser supports passive events and options arg + + scope.document.createElement('div').addEventListener('test', null, { + get capture() { + return eventsMethods.supportsOptions = true; + }, + + get passive() { + return eventsMethods.supportsPassive = true; + } + + }); + scope.events = eventsMethods; + + function add(eventTarget, type, listener, optionalArg) { + var options = __getOptions_23(optionalArg); + + var target = _$arr_66.find(targets, function (t) { + return t.eventTarget === eventTarget; + }); + + if (!target) { + target = { + eventTarget: eventTarget, + events: {} + }; + targets.push(target); + } + + if (!target.events[type]) { + target.events[type] = []; + } + + if (eventTarget.addEventListener && !_$arr_66.contains(target.events[type], listener)) { + eventTarget.addEventListener(type, listener, eventsMethods.supportsOptions ? options : options.capture); + target.events[type].push(listener); + } + } + + function remove(eventTarget, type, listener, optionalArg) { + var options = __getOptions_23(optionalArg); + + var targetIndex = _$arr_66.findIndex(targets, function (t) { + return t.eventTarget === eventTarget; + }); + + var target = targets[targetIndex]; + + if (!target || !target.events) { + return; + } + + if (type === 'all') { + for (type in target.events) { + if (target.events.hasOwnProperty(type)) { + remove(eventTarget, type, 'all'); + } + } + + return; + } + + var typeIsEmpty = false; + var typeListeners = target.events[type]; + + if (typeListeners) { + if (listener === 'all') { + for (var i = typeListeners.length - 1; i >= 0; i--) { + remove(eventTarget, type, typeListeners[i], options); + } + + return; + } else { + for (var _i = 0; _i < typeListeners.length; _i++) { + if (typeListeners[_i] === listener) { + eventTarget.removeEventListener(type, listener, eventsMethods.supportsOptions ? options : options.capture); + typeListeners.splice(_i, 1); + + if (typeListeners.length === 0) { + delete target.events[type]; + typeIsEmpty = true; + } + + break; + } + } + } + } + + if (typeIsEmpty && !Object.keys(target.events).length) { + targets.splice(targetIndex, 1); + } + } + + function addDelegate(selector, context, type, listener, optionalArg) { + var options = __getOptions_23(optionalArg); + + if (!delegatedEvents[type]) { + delegatedEvents[type] = []; // add delegate listener functions + + for (var _i2 = 0; _i2 < documents.length; _i2++) { + var _ref; + + _ref = documents[_i2]; + var doc = _ref; + add(doc, type, delegateListener); + add(doc, type, delegateUseCapture, true); + } + } + + var delegates = delegatedEvents[type]; + + var delegate = _$arr_66.find(delegates, function (d) { + return d.selector === selector && d.context === context; + }); + + if (!delegate) { + delegate = { + selector: selector, + context: context, + listeners: [] + }; + delegates.push(delegate); + } + + delegate.listeners.push([listener, options]); + } + + function removeDelegate(selector, context, type, listener, optionalArg) { + var options = __getOptions_23(optionalArg); + + var delegates = delegatedEvents[type]; + var matchFound = false; + var index; + + if (!delegates) { + return; + } // count from last index of delegated to 0 + + + for (index = delegates.length - 1; index >= 0; index--) { + var cur = delegates[index]; // look for matching selector and context Node + + if (cur.selector === selector && cur.context === context) { + var listeners = cur.listeners; // each item of the listeners array is an array: [function, capture, passive] + + for (var i = listeners.length - 1; i >= 0; i--) { + var _listeners$i = ___slicedToArray_23(listeners[i], 2), + fn = _listeners$i[0], + _listeners$i$ = _listeners$i[1], + capture = _listeners$i$.capture, + passive = _listeners$i$.passive; // check if the listener functions and capture and passive flags match + + + if (fn === listener && capture === options.capture && passive === options.passive) { + // remove the listener from the array of listeners + listeners.splice(i, 1); // if all listeners for this target have been removed + // remove the target from the delegates array + + if (!listeners.length) { + delegates.splice(index, 1); // remove delegate function from context + + remove(context, type, delegateListener); + remove(context, type, delegateUseCapture, true); + } // only remove one listener + + + matchFound = true; + break; + } + } + + if (matchFound) { + break; + } + } + } + } // bound to the interactable context when a DOM event + // listener is added to a selector interactable + + + function delegateListener(event, optionalArg) { + var options = __getOptions_23(optionalArg); + + var fakeEvent = new FakeEvent(event); + var delegates = delegatedEvents[event.type]; + + var _pointerUtils$getEven = _$pointerUtils_81.getEventTargets(event), + _pointerUtils$getEven2 = ___slicedToArray_23(_pointerUtils$getEven, 1), + eventTarget = _pointerUtils$getEven2[0]; + + var element = eventTarget; // climb up document tree looking for selector matches + + while (_$is_76["default"].element(element)) { + for (var i = 0; i < delegates.length; i++) { + var cur = delegates[i]; + var selector = cur.selector, + context = cur.context; + + if (_$domUtils_71.matchesSelector(element, selector) && _$domUtils_71.nodeContains(context, eventTarget) && _$domUtils_71.nodeContains(context, element)) { + var listeners = cur.listeners; + fakeEvent.currentTarget = element; + + for (var _i3 = 0; _i3 < listeners.length; _i3++) { + var _ref2; + + _ref2 = listeners[_i3]; + + var _ref3 = _ref2, + _ref4 = ___slicedToArray_23(_ref3, 2), + fn = _ref4[0], + _ref4$ = _ref4[1], + capture = _ref4$.capture, + passive = _ref4$.passive; + + if (capture === options.capture && passive === options.passive) { + fn(fakeEvent); + } + } + } + } + + element = _$domUtils_71.parentNode(element); + } + } + + function delegateUseCapture(event) { + return delegateListener.call(this, event, true); + } // for type inferrence + + + return eventsMethods; + } + + var FakeEvent = /*#__PURE__*/function () { + function FakeEvent(originalEvent) { + ___classCallCheck_23(this, FakeEvent); + + this.currentTarget = void 0; + this.originalEvent = void 0; + this.originalEvent = originalEvent; // duplicate the event so that currentTarget can be changed + + (0, _$pointerExtend_80["default"])(this, originalEvent); + } + + ___createClass_23(FakeEvent, [{ + key: "preventOriginalDefault", + value: function preventOriginalDefault() { + this.originalEvent.preventDefault(); + } + }, { + key: "stopPropagation", + value: function stopPropagation() { + this.originalEvent.stopPropagation(); + } + }, { + key: "stopImmediatePropagation", + value: function stopImmediatePropagation() { + this.originalEvent.stopImmediatePropagation(); + } + }]); + + return FakeEvent; + }(); + + _$events_23.FakeEvent = FakeEvent; + + function __getOptions_23(param) { + if (!_$is_76["default"].object(param)) { + return { + capture: !!param, + passive: false + }; + } + + var options = (0, _$extend_73["default"])({}, param); + options.capture = !!param.capture; + options.passive = !!param.passive; + return options; + } + + var ___default_23 = { + id: 'events', + install: __install_23 + }; + _$events_23["default"] = ___default_23; + var _$interactStatic_24 = {}; + "use strict"; + + Object.defineProperty(_$interactStatic_24, "__esModule", { + value: true + }); + _$interactStatic_24.createInteractStatic = createInteractStatic; + /* removed: var _$browser_67 = require("../utils/browser.js"); */ + + ; + /* removed: var _$domUtils_71 = require("../utils/domUtils.js"); */ + + ; + /* removed: var _$is_76 = require("../utils/is.js"); */ + + ; + /* removed: var _$pointerUtils_81 = require("../utils/pointerUtils.js"); */ + + ; + /* removed: var _$isNonNativeEvent_28 = require("./isNonNativeEvent.js"); */ + + ; + /** @module interact */ + + function createInteractStatic(scope) { + /** + * ```js + * interact('#draggable').draggable(true) + * + * var rectables = interact('rect') + * rectables + * .gesturable(true) + * .on('gesturemove', function (event) { + * // ... + * }) + * ``` + * + * The methods of this variable can be used to set elements as interactables + * and also to change various default settings. + * + * Calling it as a function and passing an element or a valid CSS selector + * string returns an Interactable object which has various methods to configure + * it. + * + * @global + * + * @param {Element | string} target The HTML or SVG Element to interact with + * or CSS selector + * @return {Interactable} + */ + var interact = function interact(target, options) { + var interactable = scope.interactables.get(target, options); + + if (!interactable) { + interactable = scope.interactables["new"](target, options); + interactable.events.global = interact.globalEvents; + } + + return interactable; + }; // expose the functions used to calculate multi-touch properties + + + interact.getPointerAverage = _$pointerUtils_81.pointerAverage; + interact.getTouchBBox = _$pointerUtils_81.touchBBox; + interact.getTouchDistance = _$pointerUtils_81.touchDistance; + interact.getTouchAngle = _$pointerUtils_81.touchAngle; + interact.getElementRect = _$domUtils_71.getElementRect; + interact.getElementClientRect = _$domUtils_71.getElementClientRect; + interact.matchesSelector = _$domUtils_71.matchesSelector; + interact.closest = _$domUtils_71.closest; + interact.globalEvents = {}; // eslint-disable-next-line no-undef + + interact.version = undefined; + interact.scope = scope; + /** + * Use a plugin + * + * @alias module:interact.use + * + * @param {Object} plugin + * @param {function} plugin.install + * @return {Interact.InteractStatic} + */ + + interact.use = function (plugin, options) { + this.scope.usePlugin(plugin, options); + return this; + }; + /** + * Check if an element or selector has been set with the {@link interact} + * function + * + * @alias module:interact.isSet + * + * @param {Element} element The Element being searched for + * @return {boolean} Indicates if the element or CSS selector was previously + * passed to interact + */ + + + interact.isSet = function (target, options) { + return !!this.scope.interactables.get(target, options && options.context); + }; + /** + * Add a global listener for an InteractEvent or adds a DOM event to `document` + * + * @alias module:interact.on + * + * @param {string | array | object} type The types of events to listen for + * @param {function} listener The function event (s) + * @param {object | boolean} [options] object or useCapture flag for + * addEventListener + * @return {object} interact + */ + + + interact.on = function (type, listener, options) { + if (_$is_76["default"].string(type) && type.search(' ') !== -1) { + type = type.trim().split(/ +/); + } + + if (_$is_76["default"].array(type)) { + for (var _i = 0; _i < type.length; _i++) { + var _ref; + + _ref = type[_i]; + var eventType = _ref; + this.on(eventType, listener, options); + } + + return this; + } + + if (_$is_76["default"].object(type)) { + for (var prop in type) { + this.on(prop, type[prop], listener); + } + + return this; + } // if it is an InteractEvent type, add listener to globalEvents + + + if ((0, _$isNonNativeEvent_28["default"])(type, this.scope.actions)) { + // if this type of event was never bound + if (!this.globalEvents[type]) { + this.globalEvents[type] = [listener]; + } else { + this.globalEvents[type].push(listener); + } + } // If non InteractEvent type, addEventListener to document + else { + this.scope.events.add(this.scope.document, type, listener, { + options: options + }); + } + + return this; + }; + /** + * Removes a global InteractEvent listener or DOM event from `document` + * + * @alias module:interact.off + * + * @param {string | array | object} type The types of events that were listened + * for + * @param {function} listener The listener function to be removed + * @param {object | boolean} options [options] object or useCapture flag for + * removeEventListener + * @return {object} interact + */ + + + interact.off = function (type, listener, options) { + if (_$is_76["default"].string(type) && type.search(' ') !== -1) { + type = type.trim().split(/ +/); + } + + if (_$is_76["default"].array(type)) { + for (var _i2 = 0; _i2 < type.length; _i2++) { + var _ref2; + + _ref2 = type[_i2]; + var eventType = _ref2; + this.off(eventType, listener, options); + } + + return this; + } + + if (_$is_76["default"].object(type)) { + for (var prop in type) { + this.off(prop, type[prop], listener); + } + + return this; + } + + if ((0, _$isNonNativeEvent_28["default"])(type, this.scope.actions)) { + var index; + + if (type in this.globalEvents && (index = this.globalEvents[type].indexOf(listener)) !== -1) { + this.globalEvents[type].splice(index, 1); + } + } else { + this.scope.events.remove(this.scope.document, type, listener, options); + } + + return this; + }; + + interact.debug = function () { + return this.scope; + }; + /** + * @alias module:interact.supportsTouch + * + * @return {boolean} Whether or not the browser supports touch input + */ + + + interact.supportsTouch = function () { + return _$browser_67["default"].supportsTouch; + }; + /** + * @alias module:interact.supportsPointerEvent + * + * @return {boolean} Whether or not the browser supports PointerEvents + */ + + + interact.supportsPointerEvent = function () { + return _$browser_67["default"].supportsPointerEvent; + }; + /** + * Cancels all interactions (end events are not fired) + * + * @alias module:interact.stop + * + * @return {object} interact + */ + + + interact.stop = function () { + for (var _i3 = 0; _i3 < this.scope.interactions.list.length; _i3++) { + var _ref3; + + _ref3 = this.scope.interactions.list[_i3]; + var interaction = _ref3; + interaction.stop(); + } + + return this; + }; + /** + * Returns or sets the distance the pointer must be moved before an action + * sequence occurs. This also affects tolerance for tap events. + * + * @alias module:interact.pointerMoveTolerance + * + * @param {number} [newValue] The movement from the start position must be greater than this value + * @return {interact | number} + */ + + + interact.pointerMoveTolerance = function (newValue) { + if (_$is_76["default"].number(newValue)) { + this.scope.interactions.pointerMoveTolerance = newValue; + return this; + } + + return this.scope.interactions.pointerMoveTolerance; + }; + + interact.addDocument = function (doc, options) { + this.scope.addDocument(doc, options); + }; + + interact.removeDocument = function (doc) { + this.scope.removeDocument(doc); + }; + + return interact; + } + + var _$interactionFinder_26 = {}; + "use strict"; + + Object.defineProperty(_$interactionFinder_26, "__esModule", { + value: true + }); + _$interactionFinder_26["default"] = void 0; + /* removed: var _$domUtils_71 = require("../utils/domUtils.js"); */ + + ; + var finder = { + methodOrder: ['simulationResume', 'mouseOrPen', 'hasPointer', 'idle'], + search: function search(details) { + for (var _i = 0; _i < finder.methodOrder.length; _i++) { + var _ref; + + _ref = finder.methodOrder[_i]; + var method = _ref; + var interaction = finder[method](details); + + if (interaction) { + return interaction; + } + } + + return null; + }, + // try to resume simulation with a new pointer + simulationResume: function simulationResume(_ref2) { + var pointerType = _ref2.pointerType, + eventType = _ref2.eventType, + eventTarget = _ref2.eventTarget, + scope = _ref2.scope; + + if (!/down|start/i.test(eventType)) { + return null; + } + + for (var _i2 = 0; _i2 < scope.interactions.list.length; _i2++) { + var _ref3; + + _ref3 = scope.interactions.list[_i2]; + var interaction = _ref3; + var element = eventTarget; + + if (interaction.simulation && interaction.simulation.allowResume && interaction.pointerType === pointerType) { + while (element) { + // if the element is the interaction element + if (element === interaction.element) { + return interaction; + } + + element = _$domUtils_71.parentNode(element); + } + } + } + + return null; + }, + // if it's a mouse or pen interaction + mouseOrPen: function mouseOrPen(_ref4) { + var pointerId = _ref4.pointerId, + pointerType = _ref4.pointerType, + eventType = _ref4.eventType, + scope = _ref4.scope; + + if (pointerType !== 'mouse' && pointerType !== 'pen') { + return null; + } + + var firstNonActive; + + for (var _i3 = 0; _i3 < scope.interactions.list.length; _i3++) { + var _ref5; + + _ref5 = scope.interactions.list[_i3]; + var interaction = _ref5; + + if (interaction.pointerType === pointerType) { + // if it's a down event, skip interactions with running simulations + if (interaction.simulation && !hasPointerId(interaction, pointerId)) { + continue; + } // if the interaction is active, return it immediately + + + if (interaction.interacting()) { + return interaction; + } // otherwise save it and look for another active interaction + else if (!firstNonActive) { + firstNonActive = interaction; + } + } + } // if no active mouse interaction was found use the first inactive mouse + // interaction + + + if (firstNonActive) { + return firstNonActive; + } // find any mouse or pen interaction. + // ignore the interaction if the eventType is a *down, and a simulation + // is active + + + for (var _i4 = 0; _i4 < scope.interactions.list.length; _i4++) { + var _ref6; + + _ref6 = scope.interactions.list[_i4]; + var _interaction = _ref6; + + if (_interaction.pointerType === pointerType && !(/down/i.test(eventType) && _interaction.simulation)) { + return _interaction; + } + } + + return null; + }, + // get interaction that has this pointer + hasPointer: function hasPointer(_ref7) { + var pointerId = _ref7.pointerId, + scope = _ref7.scope; + + for (var _i5 = 0; _i5 < scope.interactions.list.length; _i5++) { + var _ref8; + + _ref8 = scope.interactions.list[_i5]; + var interaction = _ref8; + + if (hasPointerId(interaction, pointerId)) { + return interaction; + } + } + + return null; + }, + // get first idle interaction with a matching pointerType + idle: function idle(_ref9) { + var pointerType = _ref9.pointerType, + scope = _ref9.scope; + + for (var _i6 = 0; _i6 < scope.interactions.list.length; _i6++) { + var _ref10; + + _ref10 = scope.interactions.list[_i6]; + var interaction = _ref10; // if there's already a pointer held down + + if (interaction.pointers.length === 1) { + var target = interaction.interactable; // don't add this pointer if there is a target interactable and it + // isn't gesturable + + if (target && !(target.options.gesture && target.options.gesture.enabled)) { + continue; + } + } // maximum of 2 pointers per interaction + else if (interaction.pointers.length >= 2) { + continue; + } + + if (!interaction.interacting() && pointerType === interaction.pointerType) { + return interaction; + } + } + + return null; + } + }; + + function hasPointerId(interaction, pointerId) { + return interaction.pointers.some(function (_ref11) { + var id = _ref11.id; + return id === pointerId; + }); + } + + var ___default_26 = finder; + _$interactionFinder_26["default"] = ___default_26; + var _$interactions_27 = {}; + "use strict"; + + Object.defineProperty(_$interactions_27, "__esModule", { + value: true + }); + _$interactions_27["default"] = void 0; + /* removed: var _$browser_67 = require("../utils/browser.js"); */ + + ; + /* removed: var _$domObjects_70 = require("../utils/domObjects.js"); */ + + ; + /* removed: var _$domUtils_71 = require("../utils/domUtils.js"); */ + + ; + /* removed: var _$pointerUtils_81 = require("../utils/pointerUtils.js"); */ + + ; + /* removed: var _$Interaction_20 = require("./Interaction.js"); */ + + ; + /* removed: var _$interactablePreventDefault_25 = require("./interactablePreventDefault.js"); */ + + ; + /* removed: var _$interactionFinder_26 = require("./interactionFinder.js"); */ + + ; + + function ___typeof_27(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + ___typeof_27 = function _typeof(obj) { + return typeof obj; + }; + } else { + ___typeof_27 = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + + return ___typeof_27(obj); + } + + function ___slicedToArray_27(arr, i) { + return ___arrayWithHoles_27(arr) || ___iterableToArrayLimit_27(arr, i) || ___unsupportedIterableToArray_27(arr, i) || ___nonIterableRest_27(); + } + + function ___nonIterableRest_27() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + + function ___unsupportedIterableToArray_27(o, minLen) { + if (!o) return; + if (typeof o === "string") return ___arrayLikeToArray_27(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return ___arrayLikeToArray_27(o, minLen); + } + + function ___arrayLikeToArray_27(arr, len) { + if (len == null || len > arr.length) len = arr.length; + + for (var i = 0, arr2 = new Array(len); i < len; i++) { + arr2[i] = arr[i]; + } + + return arr2; + } + + function ___iterableToArrayLimit_27(arr, i) { + if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; + var _arr = []; + var _n = true; + var _d = false; + var _e = undefined; + + try { + for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"] != null) _i["return"](); + } finally { + if (_d) throw _e; + } + } + + return _arr; + } + + function ___arrayWithHoles_27(arr) { + if (Array.isArray(arr)) return arr; + } + + function ___classCallCheck_27(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function ___defineProperties_27(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function ___createClass_27(Constructor, protoProps, staticProps) { + if (protoProps) ___defineProperties_27(Constructor.prototype, protoProps); + if (staticProps) ___defineProperties_27(Constructor, staticProps); + return Constructor; + } + + function ___inherits_27(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function"); + } + + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + writable: true, + configurable: true + } + }); + if (superClass) ___setPrototypeOf_27(subClass, superClass); + } + + function ___setPrototypeOf_27(o, p) { + ___setPrototypeOf_27 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + + return ___setPrototypeOf_27(o, p); + } + + function ___createSuper_27(Derived) { + var hasNativeReflectConstruct = ___isNativeReflectConstruct_27(); + + return function () { + var Super = ___getPrototypeOf_27(Derived), + result; + + if (hasNativeReflectConstruct) { + var NewTarget = ___getPrototypeOf_27(this).constructor; + + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + + return ___possibleConstructorReturn_27(this, result); + }; + } + + function ___possibleConstructorReturn_27(self, call) { + if (call && (___typeof_27(call) === "object" || typeof call === "function")) { + return call; + } + + return ___assertThisInitialized_27(self); + } + + function ___assertThisInitialized_27(self) { + if (self === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return self; + } + + function ___isNativeReflectConstruct_27() { + if (typeof Reflect === "undefined" || !Reflect.construct) return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === "function") return true; + + try { + Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); + return true; + } catch (e) { + return false; + } + } + + function ___getPrototypeOf_27(o) { + ___getPrototypeOf_27 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return ___getPrototypeOf_27(o); + } + + var methodNames = ['pointerDown', 'pointerMove', 'pointerUp', 'updatePointer', 'removePointer', 'windowBlur']; + + function __install_27(scope) { + var listeners = {}; + + for (var _i = 0; _i < methodNames.length; _i++) { + var _ref; + + _ref = methodNames[_i]; + var method = _ref; + listeners[method] = doOnInteractions(method, scope); + } + + var pEventTypes = _$browser_67["default"].pEventTypes; + var docEvents; + + if (_$domObjects_70["default"].PointerEvent) { + docEvents = [{ + type: pEventTypes.down, + listener: releasePointersOnRemovedEls + }, { + type: pEventTypes.down, + listener: listeners.pointerDown + }, { + type: pEventTypes.move, + listener: listeners.pointerMove + }, { + type: pEventTypes.up, + listener: listeners.pointerUp + }, { + type: pEventTypes.cancel, + listener: listeners.pointerUp + }]; + } else { + docEvents = [{ + type: 'mousedown', + listener: listeners.pointerDown + }, { + type: 'mousemove', + listener: listeners.pointerMove + }, { + type: 'mouseup', + listener: listeners.pointerUp + }, { + type: 'touchstart', + listener: releasePointersOnRemovedEls + }, { + type: 'touchstart', + listener: listeners.pointerDown + }, { + type: 'touchmove', + listener: listeners.pointerMove + }, { + type: 'touchend', + listener: listeners.pointerUp + }, { + type: 'touchcancel', + listener: listeners.pointerUp + }]; + } + + docEvents.push({ + type: 'blur', + listener: function listener(event) { + for (var _i2 = 0; _i2 < scope.interactions.list.length; _i2++) { + var _ref2; + + _ref2 = scope.interactions.list[_i2]; + var interaction = _ref2; + interaction.documentBlur(event); + } + } + }); // for ignoring browser's simulated mouse events + + scope.prevTouchTime = 0; + + scope.Interaction = /*#__PURE__*/function (_InteractionBase) { + ___inherits_27(_class, _InteractionBase); + + var _super = ___createSuper_27(_class); + + function _class() { + ___classCallCheck_27(this, _class); + + return _super.apply(this, arguments); + } + + ___createClass_27(_class, [{ + key: "_now", + value: function _now() { + return scope.now(); + } + }, { + key: "pointerMoveTolerance", + get: function get() { + return scope.interactions.pointerMoveTolerance; + }, + set: function set(value) { + scope.interactions.pointerMoveTolerance = value; + } + }]); + + return _class; + }(_$Interaction_20["default"]); + + scope.interactions = { + // all active and idle interactions + list: [], + "new": function _new(options) { + options.scopeFire = function (name, arg) { + return scope.fire(name, arg); + }; + + var interaction = new scope.Interaction(options); + scope.interactions.list.push(interaction); + return interaction; + }, + listeners: listeners, + docEvents: docEvents, + pointerMoveTolerance: 1 + }; + + function releasePointersOnRemovedEls() { + // for all inactive touch interactions with pointers down + for (var _i3 = 0; _i3 < scope.interactions.list.length; _i3++) { + var _ref3; + + _ref3 = scope.interactions.list[_i3]; + var interaction = _ref3; + + if (!interaction.pointerIsDown || interaction.pointerType !== 'touch' || interaction._interacting) { + continue; + } // if a pointer is down on an element that is no longer in the DOM tree + + + var _loop = function _loop() { + _ref4 = interaction.pointers[_i4]; + var pointer = _ref4; + + if (!scope.documents.some(function (_ref5) { + var doc = _ref5.doc; + return (0, _$domUtils_71.nodeContains)(doc, pointer.downTarget); + })) { + // remove the pointer from the interaction + interaction.removePointer(pointer.pointer, pointer.event); + } + }; + + for (var _i4 = 0; _i4 < interaction.pointers.length; _i4++) { + var _ref4; + + _loop(); + } + } + } + + scope.usePlugin(_$interactablePreventDefault_25["default"]); + } + + function doOnInteractions(method, scope) { + return function (event) { + var interactions = scope.interactions.list; + + var pointerType = _$pointerUtils_81.getPointerType(event); + + var _pointerUtils$getEven = _$pointerUtils_81.getEventTargets(event), + _pointerUtils$getEven2 = ___slicedToArray_27(_pointerUtils$getEven, 2), + eventTarget = _pointerUtils$getEven2[0], + curEventTarget = _pointerUtils$getEven2[1]; + + var matches = []; // [ [pointer, interaction], ...] + + if (/^touch/.test(event.type)) { + scope.prevTouchTime = scope.now(); + + for (var _i5 = 0; _i5 < event.changedTouches.length; _i5++) { + var _ref6; + + _ref6 = event.changedTouches[_i5]; + var changedTouch = _ref6; + var pointer = changedTouch; + + var pointerId = _$pointerUtils_81.getPointerId(pointer); + + var searchDetails = { + pointer: pointer, + pointerId: pointerId, + pointerType: pointerType, + eventType: event.type, + eventTarget: eventTarget, + curEventTarget: curEventTarget, + scope: scope + }; + var interaction = getInteraction(searchDetails); + matches.push([searchDetails.pointer, searchDetails.eventTarget, searchDetails.curEventTarget, interaction]); + } + } else { + var invalidPointer = false; + + if (!_$browser_67["default"].supportsPointerEvent && /mouse/.test(event.type)) { + // ignore mouse events while touch interactions are active + for (var i = 0; i < interactions.length && !invalidPointer; i++) { + invalidPointer = interactions[i].pointerType !== 'mouse' && interactions[i].pointerIsDown; + } // try to ignore mouse events that are simulated by the browser + // after a touch event + + + invalidPointer = invalidPointer || scope.now() - scope.prevTouchTime < 500 || // on iOS and Firefox Mobile, MouseEvent.timeStamp is zero if simulated + event.timeStamp === 0; + } + + if (!invalidPointer) { + var _searchDetails = { + pointer: event, + pointerId: _$pointerUtils_81.getPointerId(event), + pointerType: pointerType, + eventType: event.type, + curEventTarget: curEventTarget, + eventTarget: eventTarget, + scope: scope + }; + + var _interaction = getInteraction(_searchDetails); + + matches.push([_searchDetails.pointer, _searchDetails.eventTarget, _searchDetails.curEventTarget, _interaction]); + } + } // eslint-disable-next-line no-shadow + + + for (var _i6 = 0; _i6 < matches.length; _i6++) { + var _matches$_i = ___slicedToArray_27(matches[_i6], 4), + _pointer = _matches$_i[0], + _eventTarget = _matches$_i[1], + _curEventTarget = _matches$_i[2], + _interaction2 = _matches$_i[3]; + + _interaction2[method](_pointer, event, _eventTarget, _curEventTarget); + } + }; + } + + function getInteraction(searchDetails) { + var pointerType = searchDetails.pointerType, + scope = searchDetails.scope; + + var foundInteraction = _$interactionFinder_26["default"].search(searchDetails); + + var signalArg = { + interaction: foundInteraction, + searchDetails: searchDetails + }; + scope.fire('interactions:find', signalArg); + return signalArg.interaction || scope.interactions["new"]({ + pointerType: pointerType + }); + } + + function onDocSignal(_ref7, eventMethodName) { + var doc = _ref7.doc, + scope = _ref7.scope, + options = _ref7.options; + var docEvents = scope.interactions.docEvents, + events = scope.events; + var eventMethod = events[eventMethodName]; + + if (scope.browser.isIOS && !options.events) { + options.events = { + passive: false + }; + } // delegate event listener + + + for (var eventType in events.delegatedEvents) { + eventMethod(doc, eventType, events.delegateListener); + eventMethod(doc, eventType, events.delegateUseCapture, true); + } + + var eventOptions = options && options.events; + + for (var _i7 = 0; _i7 < docEvents.length; _i7++) { + var _ref8; + + _ref8 = docEvents[_i7]; + var _ref9 = _ref8, + type = _ref9.type, + listener = _ref9.listener; + eventMethod(doc, type, listener, eventOptions); + } + } + + var interactions = { + id: 'core/interactions', + install: __install_27, + listeners: { + 'scope:add-document': function scopeAddDocument(arg) { + return onDocSignal(arg, 'add'); + }, + 'scope:remove-document': function scopeRemoveDocument(arg) { + return onDocSignal(arg, 'remove'); + }, + 'interactable:unset': function interactableUnset(_ref10, scope) { + var interactable = _ref10.interactable; // Stop and destroy related interactions when an Interactable is unset + + for (var i = scope.interactions.list.length - 1; i >= 0; i--) { + var interaction = scope.interactions.list[i]; + + if (interaction.interactable !== interactable) { + continue; + } + + interaction.stop(); + scope.fire('interactions:destroy', { + interaction: interaction + }); + interaction.destroy(); + + if (scope.interactions.list.length > 2) { + scope.interactions.list.splice(i, 1); + } + } + } + }, + onDocSignal: onDocSignal, + doOnInteractions: doOnInteractions, + methodNames: methodNames + }; + var ___default_27 = interactions; + _$interactions_27["default"] = ___default_27; + var _$scope_29 = {}; + "use strict"; + + Object.defineProperty(_$scope_29, "__esModule", { + value: true + }); + _$scope_29.initScope = initScope; + _$scope_29.Scope = void 0; + /* removed: var _$browser_67 = require("../utils/browser.js"); */ + + ; + /* removed: var _$clone_68 = require("../utils/clone.js"); */ + + ; + /* removed: var _$domObjects_70 = require("../utils/domObjects.js"); */ + + ; + /* removed: var _$extend_73 = require("../utils/extend.js"); */ + + ; + /* removed: var _$raf_82 = require("../utils/raf.js"); */ + + ; + /* removed: var _$window_84 = require("../utils/window.js"); */ + + ; + /* removed: var _$Eventable_16 = require("./Eventable.js"); */ + + ; + /* removed: var _$InteractEvent_17 = require("./InteractEvent.js"); */ + + ; + /* removed: var _$Interactable_18 = require("./Interactable.js"); */ + + ; + /* removed: var _$InteractableSet_19 = require("./InteractableSet.js"); */ + + ; + /* removed: var _$defaultOptions_22 = require("./defaultOptions.js"); */ + + ; + /* removed: var _$events_23 = require("./events.js"); */ + + ; + /* removed: var _$interactStatic_24 = require("./interactStatic.js"); */ + + ; + /* removed: var _$interactions_27 = require("./interactions.js"); */ + + ; + + function ___typeof_29(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + ___typeof_29 = function _typeof(obj) { + return typeof obj; + }; + } else { + ___typeof_29 = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + + return ___typeof_29(obj); + } + + function _get(target, property, receiver) { + if (typeof Reflect !== "undefined" && Reflect.get) { + _get = Reflect.get; + } else { + _get = function _get(target, property, receiver) { + var base = _superPropBase(target, property); + + if (!base) return; + var desc = Object.getOwnPropertyDescriptor(base, property); + + if (desc.get) { + return desc.get.call(receiver); + } + + return desc.value; + }; + } + + return _get(target, property, receiver || target); + } + + function _superPropBase(object, property) { + while (!Object.prototype.hasOwnProperty.call(object, property)) { + object = ___getPrototypeOf_29(object); + if (object === null) break; + } + + return object; + } + + function ___inherits_29(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function"); + } + + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + writable: true, + configurable: true + } + }); + if (superClass) ___setPrototypeOf_29(subClass, superClass); + } + + function ___setPrototypeOf_29(o, p) { + ___setPrototypeOf_29 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + + return ___setPrototypeOf_29(o, p); + } + + function ___createSuper_29(Derived) { + var hasNativeReflectConstruct = ___isNativeReflectConstruct_29(); + + return function () { + var Super = ___getPrototypeOf_29(Derived), + result; + + if (hasNativeReflectConstruct) { + var NewTarget = ___getPrototypeOf_29(this).constructor; + + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + + return ___possibleConstructorReturn_29(this, result); + }; + } + + function ___possibleConstructorReturn_29(self, call) { + if (call && (___typeof_29(call) === "object" || typeof call === "function")) { + return call; + } + + return ___assertThisInitialized_29(self); + } + + function ___assertThisInitialized_29(self) { + if (self === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return self; + } + + function ___isNativeReflectConstruct_29() { + if (typeof Reflect === "undefined" || !Reflect.construct) return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === "function") return true; + + try { + Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); + return true; + } catch (e) { + return false; + } + } + + function ___getPrototypeOf_29(o) { + ___getPrototypeOf_29 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return ___getPrototypeOf_29(o); + } + + function ___classCallCheck_29(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function ___defineProperties_29(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function ___createClass_29(Constructor, protoProps, staticProps) { + if (protoProps) ___defineProperties_29(Constructor.prototype, protoProps); + if (staticProps) ___defineProperties_29(Constructor, staticProps); + return Constructor; + } + + var Scope = /*#__PURE__*/function () { + // main window + // main document + // main window + // all documents being listened to + function Scope() { + var _this = this; + + ___classCallCheck_29(this, Scope); + + this.id = "__interact_scope_".concat(Math.floor(Math.random() * 100)); + this.isInitialized = false; + this.listenerMaps = []; + this.browser = _$browser_67["default"]; + this.defaults = (0, _$clone_68["default"])(_$defaultOptions_22.defaults); + this.Eventable = _$Eventable_16.Eventable; + this.actions = { + map: {}, + phases: { + start: true, + move: true, + end: true + }, + methodDict: {}, + phaselessTypes: {} + }; + this.interactStatic = (0, _$interactStatic_24.createInteractStatic)(this); + this.InteractEvent = _$InteractEvent_17.InteractEvent; + this.Interactable = void 0; + this.interactables = new _$InteractableSet_19.InteractableSet(this); + this._win = void 0; + this.document = void 0; + this.window = void 0; + this.documents = []; + this._plugins = { + list: [], + map: {} + }; + + this.onWindowUnload = function (event) { + return _this.removeDocument(event.target); + }; + + var scope = this; + + this.Interactable = /*#__PURE__*/function (_InteractableBase) { + ___inherits_29(_class, _InteractableBase); + + var _super = ___createSuper_29(_class); + + function _class() { + ___classCallCheck_29(this, _class); + + return _super.apply(this, arguments); + } + + ___createClass_29(_class, [{ + key: "set", + value: function set(options) { + _get(___getPrototypeOf_29(_class.prototype), "set", this).call(this, options); + + scope.fire('interactable:set', { + options: options, + interactable: this + }); + return this; + } + }, { + key: "unset", + value: function unset() { + _get(___getPrototypeOf_29(_class.prototype), "unset", this).call(this); + + scope.interactables.list.splice(scope.interactables.list.indexOf(this), 1); + scope.fire('interactable:unset', { + interactable: this + }); + } + }, { + key: "_defaults", + get: function get() { + return scope.defaults; + } + }]); + + return _class; + }(_$Interactable_18.Interactable); + } + + ___createClass_29(Scope, [{ + key: "addListeners", + value: function addListeners(map, id) { + this.listenerMaps.push({ + id: id, + map: map + }); + } + }, { + key: "fire", + value: function fire(name, arg) { + for (var _i = 0; _i < this.listenerMaps.length; _i++) { + var _ref; + + _ref = this.listenerMaps[_i]; + var _ref2 = _ref, + listener = _ref2.map[name]; + + if (!!listener && listener(arg, this, name) === false) { + return false; + } + } + } + }, { + key: "init", + value: function init(window) { + return this.isInitialized ? this : initScope(this, window); + } + }, { + key: "pluginIsInstalled", + value: function pluginIsInstalled(plugin) { + return this._plugins.map[plugin.id] || this._plugins.list.indexOf(plugin) !== -1; + } + }, { + key: "usePlugin", + value: function usePlugin(plugin, options) { + if (!this.isInitialized) { + return this; + } + + if (this.pluginIsInstalled(plugin)) { + return this; + } + + if (plugin.id) { + this._plugins.map[plugin.id] = plugin; + } + + this._plugins.list.push(plugin); + + if (plugin.install) { + plugin.install(this, options); + } + + if (plugin.listeners && plugin.before) { + var index = 0; + var len = this.listenerMaps.length; + var before = plugin.before.reduce(function (acc, id) { + acc[id] = true; + acc[pluginIdRoot(id)] = true; + return acc; + }, {}); + + for (; index < len; index++) { + var otherId = this.listenerMaps[index].id; + + if (before[otherId] || before[pluginIdRoot(otherId)]) { + break; + } + } + + this.listenerMaps.splice(index, 0, { + id: plugin.id, + map: plugin.listeners + }); + } else if (plugin.listeners) { + this.listenerMaps.push({ + id: plugin.id, + map: plugin.listeners + }); + } + + return this; + } + }, { + key: "addDocument", + value: function addDocument(doc, options) { + // do nothing if document is already known + if (this.getDocIndex(doc) !== -1) { + return false; + } + + var window = _$window_84["default"].getWindow(doc); + + options = options ? (0, _$extend_73["default"])({}, options) : {}; + this.documents.push({ + doc: doc, + options: options + }); + this.events.documents.push(doc); // don't add an unload event for the main document + // so that the page may be cached in browser history + + if (doc !== this.document) { + this.events.add(window, 'unload', this.onWindowUnload); + } + + this.fire('scope:add-document', { + doc: doc, + window: window, + scope: this, + options: options + }); + } + }, { + key: "removeDocument", + value: function removeDocument(doc) { + var index = this.getDocIndex(doc); + + var window = _$window_84["default"].getWindow(doc); + + var options = this.documents[index].options; + this.events.remove(window, 'unload', this.onWindowUnload); + this.documents.splice(index, 1); + this.events.documents.splice(index, 1); + this.fire('scope:remove-document', { + doc: doc, + window: window, + scope: this, + options: options + }); + } + }, { + key: "getDocIndex", + value: function getDocIndex(doc) { + for (var i = 0; i < this.documents.length; i++) { + if (this.documents[i].doc === doc) { + return i; + } + } + + return -1; + } + }, { + key: "getDocOptions", + value: function getDocOptions(doc) { + var docIndex = this.getDocIndex(doc); + return docIndex === -1 ? null : this.documents[docIndex].options; + } + }, { + key: "now", + value: function now() { + return (this.window.Date || Date).now(); + } + }]); + + return Scope; + }(); + + _$scope_29.Scope = Scope; + + function initScope(scope, window) { + scope.isInitialized = true; + + _$window_84["default"].init(window); + + _$domObjects_70["default"].init(window); + + _$browser_67["default"].init(window); + + _$raf_82["default"].init(window); + + scope.window = window; + scope.document = window.document; + scope.usePlugin(_$interactions_27["default"]); + scope.usePlugin(_$events_23["default"]); + return scope; + } + + function pluginIdRoot(id) { + return id && id.replace(/\/.*$/, ''); + } + + var _$interact_33 = {}; + "use strict"; + + Object.defineProperty(_$interact_33, "__esModule", { + value: true + }); + _$interact_33.init = _$interact_33["default"] = void 0; + /* removed: var _$scope_29 = require("../core/scope.js"); */ + + ; + + function ___typeof_33(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + ___typeof_33 = function _typeof(obj) { + return typeof obj; + }; + } else { + ___typeof_33 = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + + return ___typeof_33(obj); + } + + var scope = new _$scope_29.Scope(); + var interact = scope.interactStatic; + var ___default_33 = interact; + _$interact_33["default"] = ___default_33; + + var __init_33 = function init(win) { + return scope.init(win); + }; + + _$interact_33.init = __init_33; + + if ((typeof window === "undefined" ? "undefined" : ___typeof_33(window)) === 'object' && !!window) { + __init_33(window); + } + + var _$edgeTarget_62 = {}; + "use strict"; + + Object.defineProperty(_$edgeTarget_62, "__esModule", { + value: true + }); + _$edgeTarget_62["default"] = void 0; + + var ___default_62 = function _default() {}; + + _$edgeTarget_62["default"] = ___default_62; + var _$elements_63 = {}; + "use strict"; + + Object.defineProperty(_$elements_63, "__esModule", { + value: true + }); + _$elements_63["default"] = void 0; + + var ___default_63 = function _default() {}; + + _$elements_63["default"] = ___default_63; + var _$grid_64 = {}; + "use strict"; + + Object.defineProperty(_$grid_64, "__esModule", { + value: true + }); + _$grid_64["default"] = void 0; + + function ___slicedToArray_64(arr, i) { + return ___arrayWithHoles_64(arr) || ___iterableToArrayLimit_64(arr, i) || ___unsupportedIterableToArray_64(arr, i) || ___nonIterableRest_64(); + } + + function ___nonIterableRest_64() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + + function ___unsupportedIterableToArray_64(o, minLen) { + if (!o) return; + if (typeof o === "string") return ___arrayLikeToArray_64(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return ___arrayLikeToArray_64(o, minLen); + } + + function ___arrayLikeToArray_64(arr, len) { + if (len == null || len > arr.length) len = arr.length; + + for (var i = 0, arr2 = new Array(len); i < len; i++) { + arr2[i] = arr[i]; + } + + return arr2; + } + + function ___iterableToArrayLimit_64(arr, i) { + if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; + var _arr = []; + var _n = true; + var _d = false; + var _e = undefined; + + try { + for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"] != null) _i["return"](); + } finally { + if (_d) throw _e; + } + } + + return _arr; + } + + function ___arrayWithHoles_64(arr) { + if (Array.isArray(arr)) return arr; + } + + var ___default_64 = function _default(grid) { + var coordFields = [['x', 'y'], ['left', 'top'], ['right', 'bottom'], ['width', 'height']].filter(function (_ref) { + var _ref2 = ___slicedToArray_64(_ref, 2), + xField = _ref2[0], + yField = _ref2[1]; + + return xField in grid || yField in grid; + }); + + var gridFunc = function gridFunc(x, y) { + var range = grid.range, + _grid$limits = grid.limits, + limits = _grid$limits === void 0 ? { + left: -Infinity, + right: Infinity, + top: -Infinity, + bottom: Infinity + } : _grid$limits, + _grid$offset = grid.offset, + offset = _grid$offset === void 0 ? { + x: 0, + y: 0 + } : _grid$offset; + var result = { + range: range, + grid: grid, + x: null, + y: null + }; + + for (var _i2 = 0; _i2 < coordFields.length; _i2++) { + var _ref3; + + _ref3 = coordFields[_i2]; + + var _ref4 = _ref3, + _ref5 = ___slicedToArray_64(_ref4, 2), + xField = _ref5[0], + yField = _ref5[1]; + + var gridx = Math.round((x - offset.x) / grid[xField]); + var gridy = Math.round((y - offset.y) / grid[yField]); + result[xField] = Math.max(limits.left, Math.min(limits.right, gridx * grid[xField] + offset.x)); + result[yField] = Math.max(limits.top, Math.min(limits.bottom, gridy * grid[yField] + offset.y)); + } + + return result; + }; + + gridFunc.grid = grid; + gridFunc.coordFields = coordFields; + return gridFunc; + }; + + _$grid_64["default"] = ___default_64; + var _$all_61 = {}; + "use strict"; + + Object.defineProperty(_$all_61, "__esModule", { + value: true + }); + Object.defineProperty(_$all_61, "edgeTarget", { + enumerable: true, + get: function get() { + return _$edgeTarget_62["default"]; + } + }); + Object.defineProperty(_$all_61, "elements", { + enumerable: true, + get: function get() { + return _$elements_63["default"]; + } + }); + Object.defineProperty(_$all_61, "grid", { + enumerable: true, + get: function get() { + return _$grid_64["default"]; + } + }); + /* removed: var _$edgeTarget_62 = require("./edgeTarget.js"); */ + + ; + /* removed: var _$elements_63 = require("./elements.js"); */ + + ; + /* removed: var _$grid_64 = require("./grid.js"); */ + + ; + var _$plugin_65 = {}; + "use strict"; + + Object.defineProperty(_$plugin_65, "__esModule", { + value: true + }); + _$plugin_65["default"] = void 0; + /* removed: var _$extend_73 = require("../utils/extend.js"); */ + + ; + /* removed: var _$all_61 = require("./all.js"); */ + + ; + var snappersPlugin = { + id: 'snappers', + install: function install(scope) { + var interact = scope.interactStatic; + interact.snappers = (0, _$extend_73["default"])(interact.snappers || {}, _$all_61); + interact.createSnapGrid = interact.snappers.grid; + } + }; + var ___default_65 = snappersPlugin; + _$plugin_65["default"] = ___default_65; + var _$aspectRatio_37 = {}; + "use strict"; + + Object.defineProperty(_$aspectRatio_37, "__esModule", { + value: true + }); + _$aspectRatio_37.aspectRatio = _$aspectRatio_37["default"] = void 0; + /* removed: var _$extend_73 = require("../utils/extend.js"); */ + + ; + /* removed: var _$rect_83 = require("../utils/rect.js"); */ + + ; + /* removed: var _$Modification_35 = require("./Modification.js"); */ + + ; + /* removed: var _$base_39 = require("./base.js"); */ + + ; + + function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + if (enumerableOnly) symbols = symbols.filter(function (sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + }); + keys.push.apply(keys, symbols); + } + + return keys; + } + + function _objectSpread(target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i] != null ? arguments[i] : {}; + + if (i % 2) { + ownKeys(Object(source), true).forEach(function (key) { + _defineProperty(target, key, source[key]); + }); + } else if (Object.getOwnPropertyDescriptors) { + Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); + } else { + ownKeys(Object(source)).forEach(function (key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); + }); + } + } + + return target; + } + + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + + return obj; + } + + var aspectRatio = { + start: function start(arg) { + var state = arg.state, + rect = arg.rect, + originalEdges = arg.edges, + coords = arg.pageCoords; + var ratio = state.options.ratio; + var _state$options = state.options, + equalDelta = _state$options.equalDelta, + modifiers = _state$options.modifiers; + + if (ratio === 'preserve') { + ratio = rect.width / rect.height; + } + + state.startCoords = (0, _$extend_73["default"])({}, coords); + state.startRect = (0, _$extend_73["default"])({}, rect); + state.ratio = ratio; + state.equalDelta = equalDelta; + var linkedEdges = state.linkedEdges = { + top: originalEdges.top || originalEdges.left && !originalEdges.bottom, + left: originalEdges.left || originalEdges.top && !originalEdges.right, + bottom: originalEdges.bottom || originalEdges.right && !originalEdges.top, + right: originalEdges.right || originalEdges.bottom && !originalEdges.left + }; + state.xIsPrimaryAxis = !!(originalEdges.left || originalEdges.right); + + if (state.equalDelta) { + state.edgeSign = (linkedEdges.left ? 1 : -1) * (linkedEdges.top ? 1 : -1); + } else { + var negativeSecondaryEdge = state.xIsPrimaryAxis ? linkedEdges.top : linkedEdges.left; + state.edgeSign = negativeSecondaryEdge ? -1 : 1; + } + + (0, _$extend_73["default"])(arg.edges, linkedEdges); + + if (!modifiers || !modifiers.length) { + return; + } + + var subModification = new _$Modification_35["default"](arg.interaction); + subModification.copyFrom(arg.interaction.modification); + subModification.prepareStates(modifiers); + state.subModification = subModification; + subModification.startAll(_objectSpread({}, arg)); + }, + set: function set(arg) { + var state = arg.state, + rect = arg.rect, + coords = arg.coords; + var initialCoords = (0, _$extend_73["default"])({}, coords); + var aspectMethod = state.equalDelta ? setEqualDelta : setRatio; + aspectMethod(state, state.xIsPrimaryAxis, coords, rect); + + if (!state.subModification) { + return null; + } + + var correctedRect = (0, _$extend_73["default"])({}, rect); + (0, _$rect_83.addEdges)(state.linkedEdges, correctedRect, { + x: coords.x - initialCoords.x, + y: coords.y - initialCoords.y + }); + var result = state.subModification.setAll(_objectSpread(_objectSpread({}, arg), {}, { + rect: correctedRect, + edges: state.linkedEdges, + pageCoords: coords, + prevCoords: coords, + prevRect: correctedRect + })); + var delta = result.delta; + + if (result.changed) { + var xIsCriticalAxis = Math.abs(delta.x) > Math.abs(delta.y); // do aspect modification again with critical edge axis as primary + + aspectMethod(state, xIsCriticalAxis, result.coords, result.rect); + (0, _$extend_73["default"])(coords, result.coords); + } + + return result.eventProps; + }, + defaults: { + ratio: 'preserve', + equalDelta: false, + modifiers: [], + enabled: false + } + }; + _$aspectRatio_37.aspectRatio = aspectRatio; + + function setEqualDelta(_ref, xIsPrimaryAxis, coords) { + var startCoords = _ref.startCoords, + edgeSign = _ref.edgeSign; + + if (xIsPrimaryAxis) { + coords.y = startCoords.y + (coords.x - startCoords.x) * edgeSign; + } else { + coords.x = startCoords.x + (coords.y - startCoords.y) * edgeSign; + } + } + + function setRatio(_ref2, xIsPrimaryAxis, coords, rect) { + var startRect = _ref2.startRect, + startCoords = _ref2.startCoords, + ratio = _ref2.ratio, + edgeSign = _ref2.edgeSign; + + if (xIsPrimaryAxis) { + var newHeight = rect.width / ratio; + coords.y = startCoords.y + (newHeight - startRect.height) * edgeSign; + } else { + var newWidth = rect.height * ratio; + coords.x = startCoords.x + (newWidth - startRect.width) * edgeSign; + } + } + + var ___default_37 = (0, _$base_39.makeModifier)(aspectRatio, 'aspectRatio'); + + _$aspectRatio_37["default"] = ___default_37; + var _$noop_40 = {}; + "use strict"; + + Object.defineProperty(_$noop_40, "__esModule", { + value: true + }); + _$noop_40["default"] = void 0; + + var noop = function noop() {}; + + noop._defaults = {}; + var ___default_40 = noop; + _$noop_40["default"] = ___default_40; + var _$avoid_38 = {}; + "use strict"; + + Object.defineProperty(_$avoid_38, "__esModule", { + value: true + }); + Object.defineProperty(_$avoid_38, "default", { + enumerable: true, + get: function get() { + return _$noop_40["default"]; + } + }); + /* removed: var _$noop_40 = require("./noop.js"); */ + + ; + var _$pointer_43 = {}; + "use strict"; + + Object.defineProperty(_$pointer_43, "__esModule", { + value: true + }); + _$pointer_43.getRestrictionRect = getRestrictionRect; + _$pointer_43.restrict = _$pointer_43["default"] = void 0; + /* removed: var _$extend_73 = require("../../utils/extend.js"); */ + + ; + /* removed: var _$is_76 = require("../../utils/is.js"); */ + + ; + /* removed: var _$rect_83 = require("../../utils/rect.js"); */ + + ; + /* removed: var _$base_39 = require("../base.js"); */ + + ; + + function __start_43(_ref) { + var rect = _ref.rect, + startOffset = _ref.startOffset, + state = _ref.state, + interaction = _ref.interaction, + pageCoords = _ref.pageCoords; + var options = state.options; + var elementRect = options.elementRect; + var offset = (0, _$extend_73["default"])({ + left: 0, + top: 0, + right: 0, + bottom: 0 + }, options.offset || {}); + + if (rect && elementRect) { + var restriction = getRestrictionRect(options.restriction, interaction, pageCoords); + + if (restriction) { + var widthDiff = restriction.right - restriction.left - rect.width; + var heightDiff = restriction.bottom - restriction.top - rect.height; + + if (widthDiff < 0) { + offset.left += widthDiff; + offset.right += widthDiff; + } + + if (heightDiff < 0) { + offset.top += heightDiff; + offset.bottom += heightDiff; + } + } + + offset.left += startOffset.left - rect.width * elementRect.left; + offset.top += startOffset.top - rect.height * elementRect.top; + offset.right += startOffset.right - rect.width * (1 - elementRect.right); + offset.bottom += startOffset.bottom - rect.height * (1 - elementRect.bottom); + } + + state.offset = offset; + } + + function set(_ref2) { + var coords = _ref2.coords, + interaction = _ref2.interaction, + state = _ref2.state; + var options = state.options, + offset = state.offset; + var restriction = getRestrictionRect(options.restriction, interaction, coords); + + if (!restriction) { + return; + } + + var rect = _$rect_83.xywhToTlbr(restriction); + + coords.x = Math.max(Math.min(rect.right - offset.right, coords.x), rect.left + offset.left); + coords.y = Math.max(Math.min(rect.bottom - offset.bottom, coords.y), rect.top + offset.top); + } + + function getRestrictionRect(value, interaction, coords) { + if (_$is_76["default"].func(value)) { + return _$rect_83.resolveRectLike(value, interaction.interactable, interaction.element, [coords.x, coords.y, interaction]); + } else { + return _$rect_83.resolveRectLike(value, interaction.interactable, interaction.element); + } + } + + var __defaults_43 = { + restriction: null, + elementRect: null, + offset: null, + endOnly: false, + enabled: false + }; + var restrict = { + start: __start_43, + set: set, + defaults: __defaults_43 + }; + _$pointer_43.restrict = restrict; + + var ___default_43 = (0, _$base_39.makeModifier)(restrict, 'restrict'); + + _$pointer_43["default"] = ___default_43; + var _$edges_42 = {}; + "use strict"; + + Object.defineProperty(_$edges_42, "__esModule", { + value: true + }); + _$edges_42.restrictEdges = _$edges_42["default"] = void 0; + /* removed: var _$extend_73 = require("../../utils/extend.js"); */ + + ; + /* removed: var _$rect_83 = require("../../utils/rect.js"); */ + + ; + /* removed: var _$base_39 = require("../base.js"); */ + + ; + /* removed: var _$pointer_43 = require("./pointer.js"); */ + + ; // This module adds the options.resize.restrictEdges setting which sets min and + // max for the top, left, bottom and right edges of the target being resized. + // + // interact(target).resize({ + // edges: { top: true, left: true }, + // restrictEdges: { + // inner: { top: 200, left: 200, right: 400, bottom: 400 }, + // outer: { top: 0, left: 0, right: 600, bottom: 600 }, + // }, + // }) + + var noInner = { + top: +Infinity, + left: +Infinity, + bottom: -Infinity, + right: -Infinity + }; + var noOuter = { + top: -Infinity, + left: -Infinity, + bottom: +Infinity, + right: +Infinity + }; + + function __start_42(_ref) { + var interaction = _ref.interaction, + startOffset = _ref.startOffset, + state = _ref.state; + var options = state.options; + var offset; + + if (options) { + var offsetRect = (0, _$pointer_43.getRestrictionRect)(options.offset, interaction, interaction.coords.start.page); + offset = _$rect_83.rectToXY(offsetRect); + } + + offset = offset || { + x: 0, + y: 0 + }; + state.offset = { + top: offset.y + startOffset.top, + left: offset.x + startOffset.left, + bottom: offset.y - startOffset.bottom, + right: offset.x - startOffset.right + }; + } + + function __set_42(_ref2) { + var coords = _ref2.coords, + edges = _ref2.edges, + interaction = _ref2.interaction, + state = _ref2.state; + var offset = state.offset, + options = state.options; + + if (!edges) { + return; + } + + var page = (0, _$extend_73["default"])({}, coords); + var inner = (0, _$pointer_43.getRestrictionRect)(options.inner, interaction, page) || {}; + var outer = (0, _$pointer_43.getRestrictionRect)(options.outer, interaction, page) || {}; + fixRect(inner, noInner); + fixRect(outer, noOuter); + + if (edges.top) { + coords.y = Math.min(Math.max(outer.top + offset.top, page.y), inner.top + offset.top); + } else if (edges.bottom) { + coords.y = Math.max(Math.min(outer.bottom + offset.bottom, page.y), inner.bottom + offset.bottom); + } + + if (edges.left) { + coords.x = Math.min(Math.max(outer.left + offset.left, page.x), inner.left + offset.left); + } else if (edges.right) { + coords.x = Math.max(Math.min(outer.right + offset.right, page.x), inner.right + offset.right); + } + } + + function fixRect(rect, defaults) { + var _arr = ['top', 'left', 'bottom', 'right']; + + for (var _i = 0; _i < _arr.length; _i++) { + var edge = _arr[_i]; + + if (!(edge in rect)) { + rect[edge] = defaults[edge]; + } + } + + return rect; + } + + var __defaults_42 = { + inner: null, + outer: null, + offset: null, + endOnly: false, + enabled: false + }; + var restrictEdges = { + noInner: noInner, + noOuter: noOuter, + start: __start_42, + set: __set_42, + defaults: __defaults_42 + }; + _$edges_42.restrictEdges = restrictEdges; + + var ___default_42 = (0, _$base_39.makeModifier)(restrictEdges, 'restrictEdges'); + + _$edges_42["default"] = ___default_42; + var _$rect_44 = {}; + "use strict"; + + Object.defineProperty(_$rect_44, "__esModule", { + value: true + }); + _$rect_44.restrictRect = _$rect_44["default"] = void 0; + /* removed: var _$extend_73 = require("../../utils/extend.js"); */ + + ; + /* removed: var _$base_39 = require("../base.js"); */ + + ; + /* removed: var _$pointer_43 = require("./pointer.js"); */ + + ; + + var __defaults_44 = (0, _$extend_73["default"])({ + get elementRect() { + return { + top: 0, + left: 0, + bottom: 1, + right: 1 + }; + }, + + set elementRect(_) {} + + }, _$pointer_43.restrict.defaults); + + var restrictRect = { + start: _$pointer_43.restrict.start, + set: _$pointer_43.restrict.set, + defaults: __defaults_44 + }; + _$rect_44.restrictRect = restrictRect; + + var ___default_44 = (0, _$base_39.makeModifier)(restrictRect, 'restrictRect'); + + _$rect_44["default"] = ___default_44; + var _$size_45 = {}; + "use strict"; + + Object.defineProperty(_$size_45, "__esModule", { + value: true + }); + _$size_45.restrictSize = _$size_45["default"] = void 0; + /* removed: var _$extend_73 = require("../../utils/extend.js"); */ + + ; + /* removed: var _$rect_83 = require("../../utils/rect.js"); */ + + ; + /* removed: var _$base_39 = require("../base.js"); */ + + ; + /* removed: var _$edges_42 = require("./edges.js"); */ + + ; + /* removed: var _$pointer_43 = require("./pointer.js"); */ + + ; + var noMin = { + width: -Infinity, + height: -Infinity + }; + var noMax = { + width: +Infinity, + height: +Infinity + }; + + function __start_45(arg) { + return _$edges_42.restrictEdges.start(arg); + } + + function __set_45(arg) { + var interaction = arg.interaction, + state = arg.state, + rect = arg.rect, + edges = arg.edges; + var options = state.options; + + if (!edges) { + return; + } + + var minSize = _$rect_83.tlbrToXywh((0, _$pointer_43.getRestrictionRect)(options.min, interaction, arg.coords)) || noMin; + var maxSize = _$rect_83.tlbrToXywh((0, _$pointer_43.getRestrictionRect)(options.max, interaction, arg.coords)) || noMax; + state.options = { + endOnly: options.endOnly, + inner: (0, _$extend_73["default"])({}, _$edges_42.restrictEdges.noInner), + outer: (0, _$extend_73["default"])({}, _$edges_42.restrictEdges.noOuter) + }; + + if (edges.top) { + state.options.inner.top = rect.bottom - minSize.height; + state.options.outer.top = rect.bottom - maxSize.height; + } else if (edges.bottom) { + state.options.inner.bottom = rect.top + minSize.height; + state.options.outer.bottom = rect.top + maxSize.height; + } + + if (edges.left) { + state.options.inner.left = rect.right - minSize.width; + state.options.outer.left = rect.right - maxSize.width; + } else if (edges.right) { + state.options.inner.right = rect.left + minSize.width; + state.options.outer.right = rect.left + maxSize.width; + } + + _$edges_42.restrictEdges.set(arg); + + state.options = options; + } + + var __defaults_45 = { + min: null, + max: null, + endOnly: false, + enabled: false + }; + var restrictSize = { + start: __start_45, + set: __set_45, + defaults: __defaults_45 + }; + _$size_45.restrictSize = restrictSize; + + var ___default_45 = (0, _$base_39.makeModifier)(restrictSize, 'restrictSize'); + + _$size_45["default"] = ___default_45; + var _$rubberband_46 = {}; + "use strict"; + + Object.defineProperty(_$rubberband_46, "__esModule", { + value: true + }); + Object.defineProperty(_$rubberband_46, "default", { + enumerable: true, + get: function get() { + return _$noop_40["default"]; + } + }); + /* removed: var _$noop_40 = require("./noop.js"); */ + + ; + var _$pointer_48 = {}; + "use strict"; + + Object.defineProperty(_$pointer_48, "__esModule", { + value: true + }); + _$pointer_48.snap = _$pointer_48["default"] = void 0; + /* removed: var _$extend_73 = require("../../utils/extend.js"); */ + + ; + /* removed: var _$getOriginXY_74 = require("../../utils/getOriginXY.js"); */ + + ; + /* removed: var _$hypot_75 = require("../../utils/hypot.js"); */ + + ; + /* removed: var _$is_76 = require("../../utils/is.js"); */ + + ; + /* removed: var _$rect_83 = require("../../utils/rect.js"); */ + + ; + /* removed: var _$base_39 = require("../base.js"); */ + + ; + + function __start_48(arg) { + var interaction = arg.interaction, + interactable = arg.interactable, + element = arg.element, + rect = arg.rect, + state = arg.state, + startOffset = arg.startOffset; + var options = state.options; + var origin = options.offsetWithOrigin ? getOrigin(arg) : { + x: 0, + y: 0 + }; + var snapOffset; + + if (options.offset === 'startCoords') { + snapOffset = { + x: interaction.coords.start.page.x, + y: interaction.coords.start.page.y + }; + } else { + var offsetRect = (0, _$rect_83.resolveRectLike)(options.offset, interactable, element, [interaction]); + snapOffset = (0, _$rect_83.rectToXY)(offsetRect) || { + x: 0, + y: 0 + }; + snapOffset.x += origin.x; + snapOffset.y += origin.y; + } + + var relativePoints = options.relativePoints; + state.offsets = rect && relativePoints && relativePoints.length ? relativePoints.map(function (relativePoint, index) { + return { + index: index, + relativePoint: relativePoint, + x: startOffset.left - rect.width * relativePoint.x + snapOffset.x, + y: startOffset.top - rect.height * relativePoint.y + snapOffset.y + }; + }) : [(0, _$extend_73["default"])({ + index: 0, + relativePoint: null + }, snapOffset)]; + } + + function __set_48(arg) { + var interaction = arg.interaction, + coords = arg.coords, + state = arg.state; + var options = state.options, + offsets = state.offsets; + var origin = (0, _$getOriginXY_74["default"])(interaction.interactable, interaction.element, interaction.prepared.name); + var page = (0, _$extend_73["default"])({}, coords); + var targets = []; + + if (!options.offsetWithOrigin) { + page.x -= origin.x; + page.y -= origin.y; + } + + for (var _i = 0; _i < offsets.length; _i++) { + var _ref; + + _ref = offsets[_i]; + var offset = _ref; + var relativeX = page.x - offset.x; + var relativeY = page.y - offset.y; + + for (var index = 0, len = options.targets.length; index < len; index++) { + var snapTarget = options.targets[index]; + var target = void 0; + + if (_$is_76["default"].func(snapTarget)) { + target = snapTarget(relativeX, relativeY, interaction._proxy, offset, index); + } else { + target = snapTarget; + } + + if (!target) { + continue; + } + + targets.push({ + x: (_$is_76["default"].number(target.x) ? target.x : relativeX) + offset.x, + y: (_$is_76["default"].number(target.y) ? target.y : relativeY) + offset.y, + range: _$is_76["default"].number(target.range) ? target.range : options.range, + source: snapTarget, + index: index, + offset: offset + }); + } + } + + var closest = { + target: null, + inRange: false, + distance: 0, + range: 0, + delta: { + x: 0, + y: 0 + } + }; + + for (var _i2 = 0; _i2 < targets.length; _i2++) { + var _target = targets[_i2]; + var range = _target.range; + var dx = _target.x - page.x; + var dy = _target.y - page.y; + var distance = (0, _$hypot_75["default"])(dx, dy); + var inRange = distance <= range; // Infinite targets count as being out of range + // compared to non infinite ones that are in range + + if (range === Infinity && closest.inRange && closest.range !== Infinity) { + inRange = false; + } + + if (!closest.target || (inRange // is the closest target in range? + ? closest.inRange && range !== Infinity // the pointer is relatively deeper in this target + ? distance / range < closest.distance / closest.range // this target has Infinite range and the closest doesn't + : range === Infinity && closest.range !== Infinity || // OR this target is closer that the previous closest + distance < closest.distance : // The other is not in range and the pointer is closer to this target + !closest.inRange && distance < closest.distance)) { + closest.target = _target; + closest.distance = distance; + closest.range = range; + closest.inRange = inRange; + closest.delta.x = dx; + closest.delta.y = dy; + } + } + + if (closest.inRange) { + coords.x = closest.target.x; + coords.y = closest.target.y; + } + + state.closest = closest; + return closest; + } + + function getOrigin(arg) { + var element = arg.interaction.element; + var optionsOrigin = (0, _$rect_83.rectToXY)((0, _$rect_83.resolveRectLike)(arg.state.options.origin, null, null, [element])); + var origin = optionsOrigin || (0, _$getOriginXY_74["default"])(arg.interactable, element, arg.interaction.prepared.name); + return origin; + } + + var __defaults_48 = { + range: Infinity, + targets: null, + offset: null, + offsetWithOrigin: true, + origin: null, + relativePoints: null, + endOnly: false, + enabled: false + }; + var snap = { + start: __start_48, + set: __set_48, + defaults: __defaults_48 + }; + _$pointer_48.snap = snap; + + var ___default_48 = (0, _$base_39.makeModifier)(snap, 'snap'); + + _$pointer_48["default"] = ___default_48; + var _$size_49 = {}; + "use strict"; + + Object.defineProperty(_$size_49, "__esModule", { + value: true + }); + _$size_49.snapSize = _$size_49["default"] = void 0; + /* removed: var _$extend_73 = require("../../utils/extend.js"); */ + + ; + /* removed: var _$is_76 = require("../../utils/is.js"); */ + + ; + /* removed: var _$base_39 = require("../base.js"); */ + + ; + /* removed: var _$pointer_48 = require("./pointer.js"); */ + + ; + + function ___slicedToArray_49(arr, i) { + return ___arrayWithHoles_49(arr) || ___iterableToArrayLimit_49(arr, i) || ___unsupportedIterableToArray_49(arr, i) || ___nonIterableRest_49(); + } + + function ___nonIterableRest_49() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + + function ___unsupportedIterableToArray_49(o, minLen) { + if (!o) return; + if (typeof o === "string") return ___arrayLikeToArray_49(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return ___arrayLikeToArray_49(o, minLen); + } + + function ___arrayLikeToArray_49(arr, len) { + if (len == null || len > arr.length) len = arr.length; + + for (var i = 0, arr2 = new Array(len); i < len; i++) { + arr2[i] = arr[i]; + } + + return arr2; + } + + function ___iterableToArrayLimit_49(arr, i) { + if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; + var _arr = []; + var _n = true; + var _d = false; + var _e = undefined; + + try { + for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"] != null) _i["return"](); + } finally { + if (_d) throw _e; + } + } + + return _arr; + } + + function ___arrayWithHoles_49(arr) { + if (Array.isArray(arr)) return arr; + } + + function __start_49(arg) { + var state = arg.state, + edges = arg.edges; + var options = state.options; + + if (!edges) { + return null; + } + + arg.state = { + options: { + targets: null, + relativePoints: [{ + x: edges.left ? 0 : 1, + y: edges.top ? 0 : 1 + }], + offset: options.offset || 'self', + origin: { + x: 0, + y: 0 + }, + range: options.range + } + }; + state.targetFields = state.targetFields || [['width', 'height'], ['x', 'y']]; + + _$pointer_48.snap.start(arg); + + state.offsets = arg.state.offsets; + arg.state = state; + } + + function __set_49(arg) { + var interaction = arg.interaction, + state = arg.state, + coords = arg.coords; + var options = state.options, + offsets = state.offsets; + var relative = { + x: coords.x - offsets[0].x, + y: coords.y - offsets[0].y + }; + state.options = (0, _$extend_73["default"])({}, options); + state.options.targets = []; + + for (var _i = 0; _i < (options.targets || []).length; _i++) { + var _ref; + + _ref = (options.targets || [])[_i]; + var snapTarget = _ref; + var target = void 0; + + if (_$is_76["default"].func(snapTarget)) { + target = snapTarget(relative.x, relative.y, interaction); + } else { + target = snapTarget; + } + + if (!target) { + continue; + } + + for (var _i2 = 0; _i2 < state.targetFields.length; _i2++) { + var _ref2; + + _ref2 = state.targetFields[_i2]; + + var _ref3 = _ref2, + _ref4 = ___slicedToArray_49(_ref3, 2), + xField = _ref4[0], + yField = _ref4[1]; + + if (xField in target || yField in target) { + target.x = target[xField]; + target.y = target[yField]; + break; + } + } + + state.options.targets.push(target); + } + + var returnValue = _$pointer_48.snap.set(arg); + + state.options = options; + return returnValue; + } + + var __defaults_49 = { + range: Infinity, + targets: null, + offset: null, + endOnly: false, + enabled: false + }; + var snapSize = { + start: __start_49, + set: __set_49, + defaults: __defaults_49 + }; + _$size_49.snapSize = snapSize; + + var ___default_49 = (0, _$base_39.makeModifier)(snapSize, 'snapSize'); + + _$size_49["default"] = ___default_49; + var _$edges_47 = {}; + "use strict"; + + Object.defineProperty(_$edges_47, "__esModule", { + value: true + }); + _$edges_47.snapEdges = _$edges_47["default"] = void 0; + /* removed: var _$clone_68 = require("../../utils/clone.js"); */ + + ; + /* removed: var _$extend_73 = require("../../utils/extend.js"); */ + + ; + /* removed: var _$base_39 = require("../base.js"); */ + + ; + /* removed: var _$size_49 = require("./size.js"); */ + + ; + /** + * @module modifiers/snapEdges + * + * @description + * This module allows snapping of the edges of targets during resize + * interactions. + * + * @example + * interact(target).resizable({ + * snapEdges: { + * targets: [interact.snappers.grid({ x: 100, y: 50 })], + * }, + * }) + * + * interact(target).resizable({ + * snapEdges: { + * targets: [ + * interact.snappers.grid({ + * top: 50, + * left: 50, + * bottom: 100, + * right: 100, + * }), + * ], + * }, + * }) + */ + + function __start_47(arg) { + var edges = arg.edges; + + if (!edges) { + return null; + } + + arg.state.targetFields = arg.state.targetFields || [[edges.left ? 'left' : 'right', edges.top ? 'top' : 'bottom']]; + return _$size_49.snapSize.start(arg); + } + + var snapEdges = { + start: __start_47, + set: _$size_49.snapSize.set, + defaults: (0, _$extend_73["default"])((0, _$clone_68["default"])(_$size_49.snapSize.defaults), { + targets: null, + range: null, + offset: { + x: 0, + y: 0 + } + }) + }; + _$edges_47.snapEdges = snapEdges; + + var ___default_47 = (0, _$base_39.makeModifier)(snapEdges, 'snapEdges'); + + _$edges_47["default"] = ___default_47; + var _$spring_50 = {}; + "use strict"; + + Object.defineProperty(_$spring_50, "__esModule", { + value: true + }); + Object.defineProperty(_$spring_50, "default", { + enumerable: true, + get: function get() { + return _$noop_40["default"]; + } + }); + /* removed: var _$noop_40 = require("./noop.js"); */ + + ; + var _$transform_51 = {}; + "use strict"; + + Object.defineProperty(_$transform_51, "__esModule", { + value: true + }); + Object.defineProperty(_$transform_51, "default", { + enumerable: true, + get: function get() { + return _$noop_40["default"]; + } + }); + /* removed: var _$noop_40 = require("./noop.js"); */ + + ; + var _$all_36 = {}; + "use strict"; + + Object.defineProperty(_$all_36, "__esModule", { + value: true + }); + _$all_36["default"] = void 0; + /* removed: var _$aspectRatio_37 = require("./aspectRatio.js"); */ + + ; + /* removed: var _$avoid_38 = require("./avoid.js"); */ + + ; + /* removed: var _$edges_42 = require("./restrict/edges.js"); */ + + ; + /* removed: var _$pointer_43 = require("./restrict/pointer.js"); */ + + ; + /* removed: var _$rect_44 = require("./restrict/rect.js"); */ + + ; + /* removed: var _$size_45 = require("./restrict/size.js"); */ + + ; + /* removed: var _$rubberband_46 = require("./rubberband.js"); */ + + ; + /* removed: var _$edges_47 = require("./snap/edges.js"); */ + + ; + /* removed: var _$pointer_48 = require("./snap/pointer.js"); */ + + ; + /* removed: var _$size_49 = require("./snap/size.js"); */ + + ; + /* removed: var _$spring_50 = require("./spring.js"); */ + + ; + /* removed: var _$transform_51 = require("./transform.js"); */ + + ; + /* eslint-disable node/no-extraneous-import */ + + var ___default_36 = { + aspectRatio: _$aspectRatio_37["default"], + restrictEdges: _$edges_42["default"], + restrict: _$pointer_43["default"], + restrictRect: _$rect_44["default"], + restrictSize: _$size_45["default"], + snapEdges: _$edges_47["default"], + snap: _$pointer_48["default"], + snapSize: _$size_49["default"], + spring: _$spring_50["default"], + avoid: _$avoid_38["default"], + transform: _$transform_51["default"], + rubberband: _$rubberband_46["default"] + }; + _$all_36["default"] = ___default_36; + var _$plugin_41 = {}; + "use strict"; + + Object.defineProperty(_$plugin_41, "__esModule", { + value: true + }); + _$plugin_41["default"] = void 0; + /* removed: var _$plugin_65 = require("../snappers/plugin.js"); */ + + ; + /* removed: var _$all_36 = require("./all.js"); */ + + ; + /* removed: var _$base_39 = require("./base.js"); */ + + ; + var __modifiers_41 = { + id: 'modifiers', + install: function install(scope) { + var interact = scope.interactStatic; + scope.usePlugin(_$base_39["default"]); + scope.usePlugin(_$plugin_65["default"]); + interact.modifiers = _$all_36["default"]; // for backwrads compatibility + + for (var type in _$all_36["default"]) { + var _all$type = _$all_36["default"][type], + _defaults = _all$type._defaults, + _methods = _all$type._methods; + _defaults._methods = _methods; + scope.defaults.perAction[type] = _defaults; + } + } + }; + var ___default_41 = __modifiers_41; + _$plugin_41["default"] = ___default_41; + var _$plugin_52 = {}; + "use strict"; + + Object.defineProperty(_$plugin_52, "__esModule", { + value: true + }); + _$plugin_52["default"] = void 0; + var ___default_52 = {}; + _$plugin_52["default"] = ___default_52; + var _$PointerEvent_54 = {}; + "use strict"; + + Object.defineProperty(_$PointerEvent_54, "__esModule", { + value: true + }); + _$PointerEvent_54.PointerEvent = _$PointerEvent_54["default"] = void 0; + /* removed: var _$pointerUtils_81 = require("../utils/pointerUtils.js"); */ + + ; + /* removed: var _$BaseEvent_15 = require("../core/BaseEvent.js"); */ + + ; + + function ___typeof_54(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + ___typeof_54 = function _typeof(obj) { + return typeof obj; + }; + } else { + ___typeof_54 = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + + return ___typeof_54(obj); + } + + function ___classCallCheck_54(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + function ___defineProperties_54(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function ___createClass_54(Constructor, protoProps, staticProps) { + if (protoProps) ___defineProperties_54(Constructor.prototype, protoProps); + if (staticProps) ___defineProperties_54(Constructor, staticProps); + return Constructor; + } + + function ___inherits_54(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function"); + } + + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + writable: true, + configurable: true + } + }); + if (superClass) ___setPrototypeOf_54(subClass, superClass); + } + + function ___setPrototypeOf_54(o, p) { + ___setPrototypeOf_54 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }; + + return ___setPrototypeOf_54(o, p); + } + + function ___createSuper_54(Derived) { + var hasNativeReflectConstruct = ___isNativeReflectConstruct_54(); + + return function () { + var Super = ___getPrototypeOf_54(Derived), + result; + + if (hasNativeReflectConstruct) { + var NewTarget = ___getPrototypeOf_54(this).constructor; + + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + + return ___possibleConstructorReturn_54(this, result); + }; + } + + function ___possibleConstructorReturn_54(self, call) { + if (call && (___typeof_54(call) === "object" || typeof call === "function")) { + return call; + } + + return ___assertThisInitialized_54(self); + } + + function ___assertThisInitialized_54(self) { + if (self === void 0) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return self; + } + + function ___isNativeReflectConstruct_54() { + if (typeof Reflect === "undefined" || !Reflect.construct) return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === "function") return true; + + try { + Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); + return true; + } catch (e) { + return false; + } + } + + function ___getPrototypeOf_54(o) { + ___getPrototypeOf_54 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }; + return ___getPrototypeOf_54(o); + } + + var PointerEvent = /*#__PURE__*/function (_BaseEvent) { + ___inherits_54(PointerEvent, _BaseEvent); + + var _super = ___createSuper_54(PointerEvent); + /** */ + + + function PointerEvent(type, pointer, event, eventTarget, interaction, timeStamp) { + var _this; + + ___classCallCheck_54(this, PointerEvent); + + _this = _super.call(this, interaction); + _this.type = void 0; + _this.originalEvent = void 0; + _this.pointerId = void 0; + _this.pointerType = void 0; + _this["double"] = void 0; + _this.pageX = void 0; + _this.pageY = void 0; + _this.clientX = void 0; + _this.clientY = void 0; + _this.dt = void 0; + _this.eventable = void 0; + + _$pointerUtils_81.pointerExtend(___assertThisInitialized_54(_this), event); + + if (event !== pointer) { + _$pointerUtils_81.pointerExtend(___assertThisInitialized_54(_this), pointer); + } + + _this.timeStamp = timeStamp; + _this.originalEvent = event; + _this.type = type; + _this.pointerId = _$pointerUtils_81.getPointerId(pointer); + _this.pointerType = _$pointerUtils_81.getPointerType(pointer); + _this.target = eventTarget; + _this.currentTarget = null; + + if (type === 'tap') { + var pointerIndex = interaction.getPointerIndex(pointer); + _this.dt = _this.timeStamp - interaction.pointers[pointerIndex].downTime; + var interval = _this.timeStamp - interaction.tapTime; + _this["double"] = !!(interaction.prevTap && interaction.prevTap.type !== 'doubletap' && interaction.prevTap.target === _this.target && interval < 500); + } else if (type === 'doubletap') { + _this.dt = pointer.timeStamp - interaction.tapTime; + } + + return _this; + } + + ___createClass_54(PointerEvent, [{ + key: "_subtractOrigin", + value: function _subtractOrigin(_ref) { + var originX = _ref.x, + originY = _ref.y; + this.pageX -= originX; + this.pageY -= originY; + this.clientX -= originX; + this.clientY -= originY; + return this; + } + }, { + key: "_addOrigin", + value: function _addOrigin(_ref2) { + var originX = _ref2.x, + originY = _ref2.y; + this.pageX += originX; + this.pageY += originY; + this.clientX += originX; + this.clientY += originY; + return this; + } + /** + * Prevent the default behaviour of the original Event + */ + + }, { + key: "preventDefault", + value: function preventDefault() { + this.originalEvent.preventDefault(); + } + }]); + + return PointerEvent; + }(_$BaseEvent_15["default"]); + + _$PointerEvent_54.PointerEvent = _$PointerEvent_54["default"] = PointerEvent; + var _$base_55 = {}; + "use strict"; + + Object.defineProperty(_$base_55, "__esModule", { + value: true + }); + _$base_55["default"] = void 0; + /* removed: var _$domUtils_71 = require("../utils/domUtils.js"); */ + + ; + /* removed: var _$extend_73 = require("../utils/extend.js"); */ + + ; + /* removed: var _$getOriginXY_74 = require("../utils/getOriginXY.js"); */ + + ; + /* removed: var _$PointerEvent_54 = require("./PointerEvent.js"); */ + + ; + var __defaults_55 = { + holdDuration: 600, + ignoreFrom: null, + allowFrom: null, + origin: { + x: 0, + y: 0 + } + }; + var pointerEvents = { + id: 'pointer-events/base', + before: ['inertia', 'modifiers', 'auto-start', 'actions'], + install: __install_55, + listeners: { + 'interactions:new': addInteractionProps, + 'interactions:update-pointer': addHoldInfo, + 'interactions:move': moveAndClearHold, + 'interactions:down': function interactionsDown(arg, scope) { + downAndStartHold(arg, scope); + fire(arg, scope); + }, + 'interactions:up': function interactionsUp(arg, scope) { + clearHold(arg); + fire(arg, scope); + tapAfterUp(arg, scope); + }, + 'interactions:cancel': function interactionsCancel(arg, scope) { + clearHold(arg); + fire(arg, scope); + } + }, + PointerEvent: _$PointerEvent_54.PointerEvent, + fire: fire, + collectEventTargets: collectEventTargets, + defaults: __defaults_55, + types: { + down: true, + move: true, + up: true, + cancel: true, + tap: true, + doubletap: true, + hold: true + } + }; + + function fire(arg, scope) { + var interaction = arg.interaction, + pointer = arg.pointer, + event = arg.event, + eventTarget = arg.eventTarget, + type = arg.type, + _arg$targets = arg.targets, + targets = _arg$targets === void 0 ? collectEventTargets(arg, scope) : _arg$targets; + var pointerEvent = new _$PointerEvent_54.PointerEvent(type, pointer, event, eventTarget, interaction, scope.now()); + scope.fire('pointerEvents:new', { + pointerEvent: pointerEvent + }); + var signalArg = { + interaction: interaction, + pointer: pointer, + event: event, + eventTarget: eventTarget, + targets: targets, + type: type, + pointerEvent: pointerEvent + }; + + for (var i = 0; i < targets.length; i++) { + var target = targets[i]; + + for (var prop in target.props || {}) { + pointerEvent[prop] = target.props[prop]; + } + + var origin = (0, _$getOriginXY_74["default"])(target.eventable, target.node); + + pointerEvent._subtractOrigin(origin); + + pointerEvent.eventable = target.eventable; + pointerEvent.currentTarget = target.node; + target.eventable.fire(pointerEvent); + + pointerEvent._addOrigin(origin); + + if (pointerEvent.immediatePropagationStopped || pointerEvent.propagationStopped && i + 1 < targets.length && targets[i + 1].node !== pointerEvent.currentTarget) { + break; + } + } + + scope.fire('pointerEvents:fired', signalArg); + + if (type === 'tap') { + // if pointerEvent should make a double tap, create and fire a doubletap + // PointerEvent and use that as the prevTap + var prevTap = pointerEvent["double"] ? fire({ + interaction: interaction, + pointer: pointer, + event: event, + eventTarget: eventTarget, + type: 'doubletap' + }, scope) : pointerEvent; + interaction.prevTap = prevTap; + interaction.tapTime = prevTap.timeStamp; + } + + return pointerEvent; + } + + function collectEventTargets(_ref, scope) { + var interaction = _ref.interaction, + pointer = _ref.pointer, + event = _ref.event, + eventTarget = _ref.eventTarget, + type = _ref.type; + var pointerIndex = interaction.getPointerIndex(pointer); + var pointerInfo = interaction.pointers[pointerIndex]; // do not fire a tap event if the pointer was moved before being lifted + + if (type === 'tap' && (interaction.pointerWasMoved || // or if the pointerup target is different to the pointerdown target + !(pointerInfo && pointerInfo.downTarget === eventTarget))) { + return []; + } + + var path = _$domUtils_71.getPath(eventTarget); + + var signalArg = { + interaction: interaction, + pointer: pointer, + event: event, + eventTarget: eventTarget, + type: type, + path: path, + targets: [], + node: null + }; + + for (var _i = 0; _i < path.length; _i++) { + var _ref2; + + _ref2 = path[_i]; + var node = _ref2; + signalArg.node = node; + scope.fire('pointerEvents:collect-targets', signalArg); + } + + if (type === 'hold') { + signalArg.targets = signalArg.targets.filter(function (target) { + return target.eventable.options.holdDuration === interaction.pointers[pointerIndex].hold.duration; + }); + } + + return signalArg.targets; + } + + function addInteractionProps(_ref3) { + var interaction = _ref3.interaction; + interaction.prevTap = null; // the most recent tap event on this interaction + + interaction.tapTime = 0; // time of the most recent tap event + } + + function addHoldInfo(_ref4) { + var down = _ref4.down, + pointerInfo = _ref4.pointerInfo; + + if (!down && pointerInfo.hold) { + return; + } + + pointerInfo.hold = { + duration: Infinity, + timeout: null + }; + } + + function clearHold(_ref5) { + var interaction = _ref5.interaction, + pointerIndex = _ref5.pointerIndex; + + if (interaction.pointers[pointerIndex].hold) { + clearTimeout(interaction.pointers[pointerIndex].hold.timeout); + } + } + + function moveAndClearHold(_ref6, scope) { + var interaction = _ref6.interaction, + pointer = _ref6.pointer, + event = _ref6.event, + eventTarget = _ref6.eventTarget, + duplicate = _ref6.duplicate; + var pointerIndex = interaction.getPointerIndex(pointer); + + if (!duplicate && (!interaction.pointerIsDown || interaction.pointerWasMoved)) { + if (interaction.pointerIsDown) { + clearTimeout(interaction.pointers[pointerIndex].hold.timeout); + } + + fire({ + interaction: interaction, + pointer: pointer, + event: event, + eventTarget: eventTarget, + type: 'move' + }, scope); + } + } + + function downAndStartHold(_ref7, scope) { + var interaction = _ref7.interaction, + pointer = _ref7.pointer, + event = _ref7.event, + eventTarget = _ref7.eventTarget, + pointerIndex = _ref7.pointerIndex; + var timer = interaction.pointers[pointerIndex].hold; + + var path = _$domUtils_71.getPath(eventTarget); + + var signalArg = { + interaction: interaction, + pointer: pointer, + event: event, + eventTarget: eventTarget, + type: 'hold', + targets: [], + path: path, + node: null + }; + + for (var _i2 = 0; _i2 < path.length; _i2++) { + var _ref8; + + _ref8 = path[_i2]; + var node = _ref8; + signalArg.node = node; + scope.fire('pointerEvents:collect-targets', signalArg); + } + + if (!signalArg.targets.length) { + return; + } + + var minDuration = Infinity; + + for (var _i3 = 0; _i3 < signalArg.targets.length; _i3++) { + var _ref9; + + _ref9 = signalArg.targets[_i3]; + var target = _ref9; + var holdDuration = target.eventable.options.holdDuration; + + if (holdDuration < minDuration) { + minDuration = holdDuration; + } + } + + timer.duration = minDuration; + timer.timeout = setTimeout(function () { + fire({ + interaction: interaction, + eventTarget: eventTarget, + pointer: pointer, + event: event, + type: 'hold' + }, scope); + }, minDuration); + } + + function tapAfterUp(_ref10, scope) { + var interaction = _ref10.interaction, + pointer = _ref10.pointer, + event = _ref10.event, + eventTarget = _ref10.eventTarget; + + if (!interaction.pointerWasMoved) { + fire({ + interaction: interaction, + eventTarget: eventTarget, + pointer: pointer, + event: event, + type: 'tap' + }, scope); + } + } + + function __install_55(scope) { + scope.pointerEvents = pointerEvents; + scope.defaults.actions.pointerEvents = pointerEvents.defaults; + (0, _$extend_73["default"])(scope.actions.phaselessTypes, pointerEvents.types); + } + + var ___default_55 = pointerEvents; + _$base_55["default"] = ___default_55; + var _$holdRepeat_56 = {}; + "use strict"; + + Object.defineProperty(_$holdRepeat_56, "__esModule", { + value: true + }); + _$holdRepeat_56["default"] = void 0; + /* removed: var _$base_55 = require("./base.js"); */ + + ; + + function __install_56(scope) { + scope.usePlugin(_$base_55["default"]); + var pointerEvents = scope.pointerEvents; // don't repeat by default + + pointerEvents.defaults.holdRepeatInterval = 0; + pointerEvents.types.holdrepeat = scope.actions.phaselessTypes.holdrepeat = true; + } + + function onNew(_ref) { + var pointerEvent = _ref.pointerEvent; + + if (pointerEvent.type !== 'hold') { + return; + } + + pointerEvent.count = (pointerEvent.count || 0) + 1; + } + + function onFired(_ref2, scope) { + var interaction = _ref2.interaction, + pointerEvent = _ref2.pointerEvent, + eventTarget = _ref2.eventTarget, + targets = _ref2.targets; + + if (pointerEvent.type !== 'hold' || !targets.length) { + return; + } // get the repeat interval from the first eventable + + + var interval = targets[0].eventable.options.holdRepeatInterval; // don't repeat if the interval is 0 or less + + if (interval <= 0) { + return; + } // set a timeout to fire the holdrepeat event + + + interaction.holdIntervalHandle = setTimeout(function () { + scope.pointerEvents.fire({ + interaction: interaction, + eventTarget: eventTarget, + type: 'hold', + pointer: pointerEvent, + event: pointerEvent + }, scope); + }, interval); + } + + function endHoldRepeat(_ref3) { + var interaction = _ref3.interaction; // set the interaction's holdStopTime property + // to stop further holdRepeat events + + if (interaction.holdIntervalHandle) { + clearInterval(interaction.holdIntervalHandle); + interaction.holdIntervalHandle = null; + } + } + + var holdRepeat = { + id: 'pointer-events/holdRepeat', + install: __install_56, + listeners: ['move', 'up', 'cancel', 'endall'].reduce(function (acc, enderTypes) { + acc["pointerEvents:".concat(enderTypes)] = endHoldRepeat; + return acc; + }, { + 'pointerEvents:new': onNew, + 'pointerEvents:fired': onFired + }) + }; + var ___default_56 = holdRepeat; + _$holdRepeat_56["default"] = ___default_56; + var _$interactableTargets_57 = {}; + "use strict"; + + Object.defineProperty(_$interactableTargets_57, "__esModule", { + value: true + }); + _$interactableTargets_57["default"] = void 0; + /* removed: var _$extend_73 = require("../utils/extend.js"); */ + + ; + + function __install_57(scope) { + var Interactable = scope.Interactable; + Interactable.prototype.pointerEvents = pointerEventsMethod; + var __backCompatOption = Interactable.prototype._backCompatOption; + + Interactable.prototype._backCompatOption = function (optionName, newValue) { + var ret = __backCompatOption.call(this, optionName, newValue); + + if (ret === this) { + this.events.options[optionName] = newValue; + } + + return ret; + }; + } + + function pointerEventsMethod(options) { + (0, _$extend_73["default"])(this.events.options, options); + return this; + } + + var plugin = { + id: 'pointer-events/interactableTargets', + install: __install_57, + listeners: { + 'pointerEvents:collect-targets': function pointerEventsCollectTargets(_ref, scope) { + var targets = _ref.targets, + node = _ref.node, + type = _ref.type, + eventTarget = _ref.eventTarget; + scope.interactables.forEachMatch(node, function (interactable) { + var eventable = interactable.events; + var options = eventable.options; + + if (eventable.types[type] && eventable.types[type].length && interactable.testIgnoreAllow(options, node, eventTarget)) { + targets.push({ + node: node, + eventable: eventable, + props: { + interactable: interactable + } + }); + } + }); + }, + 'interactable:new': function interactableNew(_ref2) { + var interactable = _ref2.interactable; + + interactable.events.getRect = function (element) { + return interactable.getRect(element); + }; + }, + 'interactable:set': function interactableSet(_ref3, scope) { + var interactable = _ref3.interactable, + options = _ref3.options; + (0, _$extend_73["default"])(interactable.events.options, scope.pointerEvents.defaults); + (0, _$extend_73["default"])(interactable.events.options, options.pointerEvents || {}); + } + } + }; + var ___default_57 = plugin; + _$interactableTargets_57["default"] = ___default_57; + var _$plugin_58 = {}; + "use strict"; + + Object.defineProperty(_$plugin_58, "__esModule", { + value: true + }); + Object.defineProperty(_$plugin_58, "holdRepeat", { + enumerable: true, + get: function get() { + return _$holdRepeat_56["default"]; + } + }); + Object.defineProperty(_$plugin_58, "interactableTargets", { + enumerable: true, + get: function get() { + return _$interactableTargets_57["default"]; + } + }); + _$plugin_58.pointerEvents = _$plugin_58["default"] = void 0; + /* removed: var _$base_55 = require("./base.js"); */ + + ; + _$plugin_58.pointerEvents = _$base_55; + /* removed: var _$holdRepeat_56 = require("./holdRepeat.js"); */ + + ; + /* removed: var _$interactableTargets_57 = require("./interactableTargets.js"); */ + + ; + var __plugin_58 = { + id: 'pointer-events', + install: function install(scope) { + scope.usePlugin(_$base_55); + scope.usePlugin(_$holdRepeat_56["default"]); + scope.usePlugin(_$interactableTargets_57["default"]); + } + }; + var ___default_58 = __plugin_58; + _$plugin_58["default"] = ___default_58; + var _$plugin_59 = {}; + "use strict"; + + Object.defineProperty(_$plugin_59, "__esModule", { + value: true + }); + _$plugin_59["default"] = void 0; + var ___default_59 = {}; + _$plugin_59["default"] = ___default_59; + var _$plugin_60 = {}; + "use strict"; + + Object.defineProperty(_$plugin_60, "__esModule", { + value: true + }); + _$plugin_60.install = __install_60; + _$plugin_60["default"] = void 0; + /* removed: var _$arr_66 = require("../utils/arr.js"); */ + + ; + /* removed: var _$extend_73 = require("../utils/extend.js"); */ + + ; + /* removed: var _$is_76 = require("../utils/is.js"); */ + + ; + /* removed: var _$pointerUtils_81 = require("../utils/pointerUtils.js"); */ + + ; + /* removed: var _$rect_83 = require("../utils/rect.js"); */ + + ; + + function __install_60(scope) { + var Interactable = scope.Interactable; + scope.actions.phases.reflow = true; + /** + * ```js + * const interactable = interact(target) + * const drag = { name: drag, axis: 'x' } + * const resize = { name: resize, edges: { left: true, bottom: true } + * + * interactable.reflow(drag) + * interactable.reflow(resize) + * ``` + * + * Start an action sequence to re-apply modifiers, check drops, etc. + * + * @param { Object } action The action to begin + * @param { string } action.name The name of the action + * @returns { Promise } A promise that resolves to the `Interactable` when actions on all targets have ended + */ + + Interactable.prototype.reflow = function (action) { + return reflow(this, action, scope); + }; + } + + function reflow(interactable, action, scope) { + var elements = _$is_76["default"].string(interactable.target) ? _$arr_66.from(interactable._context.querySelectorAll(interactable.target)) : [interactable.target]; // tslint:disable-next-line variable-name + + var Promise = scope.window.Promise; + var promises = Promise ? [] : null; + + var _loop = function _loop() { + _ref = elements[_i]; + var element = _ref; + var rect = interactable.getRect(element); + + if (!rect) { + return "break"; + } + + var runningInteraction = _$arr_66.find(scope.interactions.list, function (interaction) { + return interaction.interacting() && interaction.interactable === interactable && interaction.element === element && interaction.prepared.name === action.name; + }); + + var reflowPromise = void 0; + + if (runningInteraction) { + runningInteraction.move(); + + if (promises) { + reflowPromise = runningInteraction._reflowPromise || new Promise(function (resolve) { + runningInteraction._reflowResolve = resolve; + }); + } + } else { + var xywh = (0, _$rect_83.tlbrToXywh)(rect); + var coords = { + page: { + x: xywh.x, + y: xywh.y + }, + client: { + x: xywh.x, + y: xywh.y + }, + timeStamp: scope.now() + }; + + var event = _$pointerUtils_81.coordsToEvent(coords); + + reflowPromise = startReflow(scope, interactable, element, action, event); + } + + if (promises) { + promises.push(reflowPromise); + } + }; + + for (var _i = 0; _i < elements.length; _i++) { + var _ref; + + var _ret = _loop(); + + if (_ret === "break") break; + } + + return promises && Promise.all(promises).then(function () { + return interactable; + }); + } + + function startReflow(scope, interactable, element, action, event) { + var interaction = scope.interactions["new"]({ + pointerType: 'reflow' + }); + var signalArg = { + interaction: interaction, + event: event, + pointer: event, + eventTarget: element, + phase: 'reflow' + }; + interaction.interactable = interactable; + interaction.element = element; + interaction.prepared = (0, _$extend_73["default"])({}, action); + interaction.prevEvent = event; + interaction.updatePointer(event, event, element, true); + + interaction._doPhase(signalArg); + + var Promise = scope.window.Promise; + var reflowPromise = Promise ? new Promise(function (resolve) { + interaction._reflowResolve = resolve; + }) : null; + interaction._reflowPromise = reflowPromise; + interaction.start(action, interactable, element); + + if (interaction._interacting) { + interaction.move(signalArg); + interaction.end(event); + } else { + interaction.stop(); + } + + interaction.removePointer(event, event); + interaction.pointerIsDown = false; + return reflowPromise; + } + + var ___default_60 = { + id: 'reflow', + install: __install_60, + listeners: { + // remove completed reflow interactions + 'interactions:stop': function interactionsStop(_ref2, scope) { + var interaction = _ref2.interaction; + + if (interaction.pointerType === 'reflow') { + if (interaction._reflowResolve) { + interaction._reflowResolve(); + } + + _$arr_66.remove(scope.interactions.list, interaction); + } + } + } + }; + _$plugin_60["default"] = ___default_60; + var _$displace_69 = {}; + "use strict"; + + Object.defineProperty(_$displace_69, "__esModule", { + value: true + }); + _$displace_69["default"] = void 0; + var ___default_69 = {}; + _$displace_69["default"] = ___default_69; + var _$exchange_72 = {}; + "use strict"; + + Object.defineProperty(_$exchange_72, "__esModule", { + value: true + }); + _$exchange_72.exchange = void 0; + var exchange = {}; + _$exchange_72.exchange = exchange; + var _$plugin_85 = {}; + "use strict"; + + Object.defineProperty(_$plugin_85, "__esModule", { + value: true + }); + _$plugin_85["default"] = void 0; + var ___default_85 = {}; + _$plugin_85["default"] = ___default_85; + var _$interactjs_34 = { + exports: {} + }; + "use strict"; + + Object.defineProperty(_$interactjs_34.exports, "__esModule", { + value: true + }); + _$interactjs_34.exports["default"] = void 0; + /* removed: var _$plugin_5 = require("../actions/plugin.js"); */ + + ; + /* removed: var _$plugin_7 = require("../arrange/plugin.js"); */ + + ; + /* removed: var _$plugin_8 = require("../auto-scroll/plugin.js"); */ + + ; + /* removed: var _$plugin_13 = require("../auto-start/plugin.js"); */ + + ; + /* removed: var _$plugin_14 = require("../clone/plugin.js"); */ + + ; + /* removed: var _$interactablePreventDefault_25 = require("../core/interactablePreventDefault.js"); */ + + ; + /* removed: var _$plugin_30 = require("../dev-tools/plugin.js"); */ + + ; + /* removed: var _$plugin_31 = require("../feedback/plugin.js"); */ + + ; + /* removed: var _$plugin_32 = require("../inertia/plugin.js"); */ + + ; + /* removed: var _$interact_33 = require("../interact/index.js"); */ + + ; + /* removed: var _$plugin_41 = require("../modifiers/plugin.js"); */ + + ; + /* removed: var _$plugin_52 = require("../multi-target/plugin.js"); */ + + ; + /* removed: var _$plugin_53 = require("../offset/plugin.js"); */ + + ; + /* removed: var _$plugin_58 = require("../pointer-events/plugin.js"); */ + + ; + /* removed: var _$plugin_59 = require("../react/plugin.js"); */ + + ; + /* removed: var _$plugin_60 = require("../reflow/plugin.js"); */ + + ; + /* removed: var _$displace_69 = require("../utils/displace.js"); */ + + ; + /* removed: var _$exchange_72 = require("../utils/exchange.js"); */ + + ; + /* removed: var _$pointerUtils_81 = require("../utils/pointerUtils.js"); */ + + ; + /* removed: var _$plugin_85 = require("../vue/plugin.js"); */ + + ; + + function ___typeof_34(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + ___typeof_34 = function _typeof(obj) { + return typeof obj; + }; + } else { + ___typeof_34 = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + + return ___typeof_34(obj); + } + + _$interact_33["default"].use(_$plugin_52["default"]); + + _$interact_33["default"].use(_$interactablePreventDefault_25["default"]); + + _$interact_33["default"].use(_$plugin_53["default"]); // interaction element cloning + + + _$interact_33["default"].use(_$plugin_14["default"]); // sortable and swappable + + + _$interact_33["default"].use(_$plugin_7["default"]); // pointerEvents + + + _$interact_33["default"].use(_$plugin_58["default"]); // inertia + + + _$interact_33["default"].use(_$plugin_32["default"]); // snap, resize, etc. + + + _$interact_33["default"].use(_$plugin_41["default"]); // autoStart, hold + + + _$interact_33["default"].use(_$plugin_13["default"]); // drag and drop, resize, gesture + + + _$interact_33["default"].use(_$plugin_5["default"]); // autoScroll + + + _$interact_33["default"].use(_$plugin_8["default"]); // reflow + + + _$interact_33["default"].use(_$plugin_60["default"]); + + _$interact_33["default"].use(_$plugin_31["default"]); + + _$interact_33["default"].use(_$plugin_85["default"]); + + _$interact_33["default"].use(_$plugin_59["default"]); + + _$interact_33["default"].__utils = { + exchange: _$exchange_72.exchange, + displace: _$displace_69, + pointer: _$pointerUtils_81 + }; // eslint-disable-next-line no-undef + + if ("development" !== 'production') { + _$interact_33["default"].use(_$plugin_30["default"]); + } + + var ___default_34 = _$interact_33["default"]; + _$interactjs_34.exports["default"] = ___default_34; + + if (("object" === "undefined" ? "undefined" : ___typeof_34(_$interactjs_34)) === 'object' && !!_$interactjs_34) { + try { + _$interactjs_34.exports = _$interact_33["default"]; + } catch (_unused) {} + } + + _$interact_33["default"]["default"] = _$interact_33["default"]; + _$interactjs_34 = _$interactjs_34.exports; + var _$index_86 = { + exports: {} + }; + "use strict"; + + Object.defineProperty(_$index_86.exports, "__esModule", { + value: true + }); + _$index_86.exports["default"] = void 0; + /* removed: var _$interactjs_34 = require("@interactjs/interactjs/index"); */ + + ; + + function ___typeof_86(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + ___typeof_86 = function _typeof(obj) { + return typeof obj; + }; + } else { + ___typeof_86 = function _typeof(obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + + return ___typeof_86(obj); + } + + var ___default_86 = _$interactjs_34["default"]; + _$index_86.exports["default"] = ___default_86; + + if (("object" === "undefined" ? "undefined" : ___typeof_86(_$index_86)) === 'object' && !!_$index_86) { + try { + _$index_86.exports = _$interactjs_34["default"]; + } catch (_unused) {} + } + + _$interactjs_34["default"]["default"] = _$interactjs_34["default"]; + _$index_86 = _$index_86.exports; + return _$index_86; +}); //# sourceMappingURL=interact.js.map \ No newline at end of file diff --git a/public/lib/interact.js.map b/public/lib/interact.js.map new file mode 100644 index 0000000..af32add --- /dev/null +++ b/public/lib/interact.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["node_modules/browser-pack-flat/_prelude","packages/@interactjs/utils/isWindow.ts","packages/@interactjs/utils/window.ts","packages/@interactjs/utils/is.ts","packages/@interactjs/actions/drag/plugin.ts","packages/@interactjs/utils/domObjects.ts","packages/@interactjs/utils/browser.ts","packages/@interactjs/utils/domUtils.ts","packages/@interactjs/utils/extend.ts","packages/@interactjs/utils/rect.ts","packages/@interactjs/utils/getOriginXY.ts","packages/@interactjs/utils/normalizeListeners.ts","packages/@interactjs/utils/hypot.ts","packages/@interactjs/utils/pointerExtend.ts","packages/@interactjs/utils/pointerUtils.ts","packages/@interactjs/core/BaseEvent.ts","packages/@interactjs/utils/arr.ts","packages/@interactjs/actions/drop/DropEvent.ts","packages/@interactjs/actions/drop/plugin.ts","packages/@interactjs/actions/gesture/plugin.ts","packages/@interactjs/actions/resize/plugin.ts","packages/@interactjs/actions/plugin.ts","packages/@interactjs/arrange/plugin.ts","packages/@interactjs/utils/raf.ts","packages/@interactjs/auto-scroll/plugin.ts","packages/@interactjs/utils/misc.ts","packages/@interactjs/auto-start/InteractableMethods.ts","packages/@interactjs/auto-start/base.ts","packages/@interactjs/auto-start/dragAxis.ts","packages/@interactjs/auto-start/hold.ts","packages/@interactjs/auto-start/plugin.ts","packages/@interactjs/clone/plugin.ts","packages/@interactjs/core/interactablePreventDefault.ts","packages/@interactjs/dev-tools/plugin.ts","packages/@interactjs/utils/clone.ts","packages/@interactjs/modifiers/Modification.ts","packages/@interactjs/modifiers/base.ts","packages/@interactjs/core/defaultOptions.ts","packages/@interactjs/core/InteractEvent.ts","packages/@interactjs/core/PointerInfo.ts","packages/@interactjs/core/Interaction.ts","packages/@interactjs/offset/plugin.ts","packages/@interactjs/inertia/plugin.ts","packages/@interactjs/core/Eventable.ts","packages/@interactjs/core/isNonNativeEvent.ts","packages/@interactjs/core/Interactable.ts","packages/@interactjs/core/InteractableSet.ts","packages/@interactjs/core/events.ts","packages/@interactjs/core/interactStatic.ts","packages/@interactjs/core/interactionFinder.ts","packages/@interactjs/core/interactions.ts","packages/@interactjs/core/scope.ts","packages/@interactjs/interact/index.ts","packages/@interactjs/snappers/edgeTarget.ts","packages/@interactjs/snappers/elements.ts","packages/@interactjs/snappers/grid.ts","packages/@interactjs/snappers/all.ts","packages/@interactjs/snappers/plugin.ts","packages/@interactjs/modifiers/aspectRatio.ts","packages/@interactjs/modifiers/noop.ts","packages/@interactjs/modifiers/avoid.ts","packages/@interactjs/modifiers/restrict/pointer.ts","packages/@interactjs/modifiers/restrict/edges.ts","packages/@interactjs/modifiers/restrict/rect.ts","packages/@interactjs/modifiers/restrict/size.ts","packages/@interactjs/modifiers/rubberband.ts","packages/@interactjs/modifiers/snap/pointer.ts","packages/@interactjs/modifiers/snap/size.ts","packages/@interactjs/modifiers/snap/edges.ts","packages/@interactjs/modifiers/spring.ts","packages/@interactjs/modifiers/all.ts","packages/@interactjs/modifiers/plugin.ts","packages/@interactjs/pointer-events/PointerEvent.ts","packages/@interactjs/pointer-events/base.ts","packages/@interactjs/pointer-events/holdRepeat.ts","packages/@interactjs/pointer-events/interactableTargets.ts","packages/@interactjs/pointer-events/plugin.ts","packages/@interactjs/reflow/plugin.ts","packages/@interactjs/utils/displace.ts","packages/@interactjs/utils/exchange.ts","packages/@interactjs/interactjs/index.ts","packages/interactjs/index.ts","node_modules/browser-pack-flat/_postlude"],"names":[],"mappings":";;;;;;;;;;;AAAA,CAAA,UAAA,CAAA,EAAA;AAAA,MAAA,QAAA,OAAA,0CAAA,OAAA,OAAA,QAAA,IAAA,OAAA,MAAA,KAAA,WAAA,EAAA;AAAA,IAAA,MAAA,CAAA,OAAA,GAAA,CAAA,EAAA;AAAA,GAAA,MAAA,IAAA,OAAA,MAAA,KAAA,UAAA,IAAA,MAAA,C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;;;;;;;;;;;;;;sBAEe,eAAA,CAAA,SAAA,C;;;AAEf,MAAI,CAAA,aAAA,WAAA,GAAA,WAAA,GAAA,YAAA,CAAA,UAAA,CAAA,MAAA,QAAA,IAA8B,CAAC,CAAnC,UAAA,EAA4C;AAC1C,QAAI;AAAE,MAAA,UAAA,CAAA,OAAA,GAAiB,eAAA,CAAjB,SAAiB,CAAjB;AAAN,KAAA,CACA,OAAA,OAAA,EAAM,CAAE;AACT;;AAEA,EAAA,eAAA,CAAD,SAAC,CAAA,CAAD,SAAC,IAA2B,eAAA,CAA5B,SAA4B,CAA3B;ACVD,EAAA,UAAA,GAAA,UAAA,CAAA,OAAA;AACA,SAAA,UAAA;AAEA,ClFHA,E","sourcesContent":["(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.interact = f()}})(function(){var define,module,exports;\n","export default (thing: any) => !!(thing && thing.Window) && (thing instanceof thing.Window)\n","import isWindow from './isWindow'\n\nconst win = {\n realWindow: undefined as Window,\n window: undefined as Window,\n getWindow,\n init,\n}\n\nexport function init (window: Window & { wrap?: (...args: any[]) => any }) {\n // get wrapped window if using Shadow DOM polyfill\n\n win.realWindow = window\n\n // create a TextNode\n const el = window.document.createTextNode('')\n\n // check if it's wrapped by a polyfill\n if (el.ownerDocument !== window.document &&\n typeof window.wrap === 'function' &&\n window.wrap(el) === el) {\n // use wrapped window\n window = window.wrap(window)\n }\n\n win.window = window\n}\n\nif (typeof window === 'undefined') {\n win.window = undefined\n win.realWindow = undefined\n}\nelse {\n init(window)\n}\n\nexport function getWindow (node: any) {\n if (isWindow(node)) {\n return node\n }\n\n const rootNode = (node.ownerDocument || node)\n\n return rootNode.defaultView || win.window\n}\n\nwin.init = init\n\nexport default win\n","import * as Interact from '@interactjs/types/index'\n\nimport isWindow from './isWindow'\nimport win from './window'\n\nconst window = (thing: any): thing is Window =>\n thing === win.window || isWindow(thing)\n\nconst docFrag = (thing: any): thing is DocumentFragment =>\n object(thing) && thing.nodeType === 11\n\nconst object = (thing: any): thing is { [index: string]: any } =>\n !!thing && (typeof thing === 'object')\n\nconst func = (thing: any): thing is (...args: any[]) => any =>\n typeof thing === 'function'\n\nconst number = (thing: any): thing is number =>\n typeof thing === 'number'\n\nconst bool = (thing: any): thing is boolean =>\n typeof thing === 'boolean'\n\nconst string = (thing: any): thing is string =>\n typeof thing === 'string'\n\nconst element = (thing: any): thing is Interact.Element => {\n if (!thing || (typeof thing !== 'object')) { return false }\n\n // eslint-disable-next-line import/no-named-as-default-member\n const _window = win.getWindow(thing) || win.window\n\n return (/object|function/.test(typeof _window.Element)\n ? thing instanceof _window.Element // DOM2\n : thing.nodeType === 1 && typeof thing.nodeName === 'string')\n}\n\nconst plainObject: typeof object = (thing: any): thing is { [index: string]: any } =>\n object(thing) &&\n !!thing.constructor &&\n /function Object\\b/.test(thing.constructor.toString())\n\nconst array = (thing: any): thing is T[] =>\n (object(thing) &&\n (typeof thing.length !== 'undefined') &&\n func(thing.splice))\n\nexport default {\n window,\n docFrag,\n object,\n func,\n number,\n bool,\n string,\n element,\n plainObject,\n array,\n}\n","import { Scope } from '@interactjs/core/scope'\nimport * as Interact from '@interactjs/types/index'\nimport is from '@interactjs/utils/is'\n\ndeclare module '@interactjs/core/Interactable' {\n interface Interactable {\n draggable: DraggableMethod\n }\n}\n\ndeclare module '@interactjs/core/defaultOptions' {\n interface ActionDefaults {\n drag: Interact.DraggableOptions\n }\n}\n\ndeclare module '@interactjs/core/scope' {\n interface ActionMap {\n drag?: typeof drag\n }\n}\n\nexport type DragEvent = Interact.InteractEvent<'drag'>\n\nexport type DraggableMethod = Interact.ActionMethod\n\nfunction install (scope: Scope) {\n const {\n actions,\n Interactable,\n defaults,\n } = scope\n\n Interactable.prototype.draggable = drag.draggable\n\n actions.map.drag = drag\n actions.methodDict.drag = 'draggable'\n\n defaults.actions.drag = drag.defaults\n}\n\nfunction beforeMove ({ interaction }) {\n if (interaction.prepared.name !== 'drag') { return }\n\n const axis = interaction.prepared.axis\n\n if (axis === 'x') {\n interaction.coords.cur.page.y = interaction.coords.start.page.y\n interaction.coords.cur.client.y = interaction.coords.start.client.y\n\n interaction.coords.velocity.client.y = 0\n interaction.coords.velocity.page.y = 0\n }\n else if (axis === 'y') {\n interaction.coords.cur.page.x = interaction.coords.start.page.x\n interaction.coords.cur.client.x = interaction.coords.start.client.x\n\n interaction.coords.velocity.client.x = 0\n interaction.coords.velocity.page.x = 0\n }\n}\n\nfunction move ({ iEvent, interaction }) {\n if (interaction.prepared.name !== 'drag') { return }\n\n const axis = interaction.prepared.axis\n\n if (axis === 'x' || axis === 'y') {\n const opposite = axis === 'x' ? 'y' : 'x'\n\n iEvent.page[opposite] = interaction.coords.start.page[opposite]\n iEvent.client[opposite] = interaction.coords.start.client[opposite]\n iEvent.delta[opposite] = 0\n }\n}\n\n/**\n * ```js\n * interact(element).draggable({\n * onstart: function (event) {},\n * onmove : function (event) {},\n * onend : function (event) {},\n *\n * // the axis in which the first movement must be\n * // for the drag sequence to start\n * // 'xy' by default - any direction\n * startAxis: 'x' || 'y' || 'xy',\n *\n * // 'xy' by default - don't restrict to one axis (move in any direction)\n * // 'x' or 'y' to restrict movement to either axis\n * // 'start' to restrict movement to the axis the drag started in\n * lockAxis: 'x' || 'y' || 'xy' || 'start',\n *\n * // max number of drags that can happen concurrently\n * // with elements of this Interactable. Infinity by default\n * max: Infinity,\n *\n * // max number of drags that can target the same element+Interactable\n * // 1 by default\n * maxPerElement: 2\n * })\n *\n * var isDraggable = interact('element').draggable(); // true\n * ```\n *\n * Get or set whether drag actions can be performed on the target\n *\n * @alias Interactable.prototype.draggable\n *\n * @param {boolean | object} [options] true/false or An object with event\n * listeners to be fired on drag events (object makes the Interactable\n * draggable)\n * @return {boolean | Interactable} boolean indicating if this can be the\n * target of drag events, or this Interctable\n */\nconst draggable: DraggableMethod = function draggable (this: Interact.Interactable, options?: Interact.DraggableOptions | boolean): any {\n if (is.object(options)) {\n this.options.drag.enabled = options.enabled !== false\n this.setPerAction('drag', options)\n this.setOnEvents('drag', options)\n\n if (/^(xy|x|y|start)$/.test(options.lockAxis)) {\n this.options.drag.lockAxis = options.lockAxis\n }\n if (/^(xy|x|y)$/.test(options.startAxis)) {\n this.options.drag.startAxis = options.startAxis\n }\n\n return this\n }\n\n if (is.bool(options)) {\n this.options.drag.enabled = options\n\n return this\n }\n\n return this.options.drag\n}\n\nconst drag: Interact.Plugin = {\n id: 'actions/drag',\n install,\n listeners: {\n 'interactions:before-action-move': beforeMove,\n 'interactions:action-resume': beforeMove,\n\n // dragmove\n 'interactions:action-move': move,\n 'auto-start:check': arg => {\n const { interaction, interactable, buttons } = arg\n const dragOptions = interactable.options.drag\n\n if (\n !(dragOptions && dragOptions.enabled) ||\n // check mouseButton setting if the pointer is down\n (interaction.pointerIsDown &&\n /mouse|pointer/.test(interaction.pointerType) &&\n (buttons & interactable.options.drag.mouseButtons) === 0)\n ) {\n return undefined\n }\n\n arg.action = {\n name: 'drag',\n axis: (dragOptions.lockAxis === 'start'\n ? dragOptions.startAxis\n : dragOptions.lockAxis),\n }\n\n return false\n },\n },\n draggable,\n beforeMove,\n move,\n defaults: {\n startAxis : 'xy',\n lockAxis : 'xy',\n } as Interact.DropzoneOptions,\n\n getCursor () {\n return 'move'\n },\n}\n\nexport default drag\n","const domObjects: {\n init: any\n document: Document\n DocumentFragment: typeof DocumentFragment\n SVGElement: typeof SVGElement\n SVGSVGElement: typeof SVGSVGElement\n SVGElementInstance: any\n Element: typeof Element\n HTMLElement: typeof HTMLElement\n Event: typeof Event\n Touch: typeof Touch\n PointerEvent: typeof PointerEvent\n} =\n{\n init,\n document: null,\n DocumentFragment: null,\n SVGElement: null,\n SVGSVGElement: null,\n SVGElementInstance: null,\n Element: null,\n HTMLElement: null,\n Event: null,\n Touch: null,\n PointerEvent: null,\n}\n\nfunction blank () {}\n\nexport default domObjects\n\nfunction init (window: Window) {\n const win = window as any\n\n domObjects.document = win.document\n domObjects.DocumentFragment = win.DocumentFragment || blank\n domObjects.SVGElement = win.SVGElement || blank\n domObjects.SVGSVGElement = win.SVGSVGElement || blank\n domObjects.SVGElementInstance = win.SVGElementInstance || blank\n domObjects.Element = win.Element || blank\n domObjects.HTMLElement = win.HTMLElement || domObjects.Element\n\n domObjects.Event = win.Event\n domObjects.Touch = win.Touch || blank\n domObjects.PointerEvent = (win.PointerEvent || win.MSPointerEvent)\n}\n","import domObjects from './domObjects'\nimport is from './is'\nimport win from './window'\n\nconst browser = {\n init,\n supportsTouch: null as boolean,\n supportsPointerEvent: null as boolean,\n isIOS7: null as boolean,\n isIOS: null as boolean,\n isIe9: null as boolean,\n isOperaMobile: null as boolean,\n prefixedMatchesSelector: null as string,\n pEventTypes: null as {\n up: string\n down: string\n over: string\n out: string\n move: string\n cancel: string\n },\n wheelEvent: null as string,\n}\n\nfunction init (window: any) {\n const Element = domObjects.Element\n const navigator = win.window.navigator\n\n // Does the browser support touch input?\n browser.supportsTouch = ('ontouchstart' in window) ||\n (is.func(window.DocumentTouch) && domObjects.document instanceof window.DocumentTouch)\n\n // Does the browser support PointerEvents\n browser.supportsPointerEvent = navigator.pointerEnabled !== false && !!domObjects.PointerEvent\n\n browser.isIOS = (/iP(hone|od|ad)/.test(navigator.platform))\n\n // scrolling doesn't change the result of getClientRects on iOS 7\n browser.isIOS7 = (/iP(hone|od|ad)/.test(navigator.platform) &&\n /OS 7[^\\d]/.test(navigator.appVersion))\n\n browser.isIe9 = /MSIE 9/.test(navigator.userAgent)\n\n // Opera Mobile must be handled differently\n browser.isOperaMobile = (navigator.appName === 'Opera' &&\n browser.supportsTouch &&\n /Presto/.test(navigator.userAgent))\n\n // prefix matchesSelector\n browser.prefixedMatchesSelector = 'matches' in Element.prototype\n ? 'matches'\n : 'webkitMatchesSelector' in Element.prototype\n ? 'webkitMatchesSelector'\n : 'mozMatchesSelector' in Element.prototype\n ? 'mozMatchesSelector'\n : 'oMatchesSelector' in Element.prototype\n ? 'oMatchesSelector'\n : 'msMatchesSelector'\n\n browser.pEventTypes = (browser.supportsPointerEvent\n ? (domObjects.PointerEvent === window.MSPointerEvent\n ? {\n up: 'MSPointerUp',\n down: 'MSPointerDown',\n over: 'mouseover',\n out: 'mouseout',\n move: 'MSPointerMove',\n cancel: 'MSPointerCancel',\n }\n : {\n up: 'pointerup',\n down: 'pointerdown',\n over: 'pointerover',\n out: 'pointerout',\n move: 'pointermove',\n cancel: 'pointercancel',\n })\n : null)\n\n // because Webkit and Opera still use 'mousewheel' event type\n browser.wheelEvent = 'onmousewheel' in domObjects.document ? 'mousewheel' : 'wheel'\n}\n\nexport default browser\n","import * as Interact from '@interactjs/types/index'\n\nimport browser from './browser'\nimport domObjects from './domObjects'\nimport is from './is'\nimport win, { getWindow } from './window'\n\nexport function nodeContains (parent: Node | Interact.EventTarget, child: Node | Interact.EventTarget) {\n while (child) {\n if (child === parent) {\n return true\n }\n\n child = (child as Node).parentNode\n }\n\n return false\n}\n\nexport function closest (element: Node, selector: string) {\n while (is.element(element)) {\n if (matchesSelector(element, selector)) { return element }\n\n element = parentNode(element)\n }\n\n return null\n}\n\nexport function parentNode (node: Node | Document) {\n let parent = node.parentNode\n\n if (is.docFrag(parent)) {\n // skip past #shado-root fragments\n // tslint:disable-next-line\n while ((parent = (parent as any).host) && is.docFrag(parent)) {\n continue\n }\n\n return parent\n }\n\n return parent\n}\n\nexport function matchesSelector (element: Interact.Element, selector: string) {\n // remove /deep/ from selectors if shadowDOM polyfill is used\n if (win.window !== win.realWindow) {\n selector = selector.replace(/\\/deep\\//g, ' ')\n }\n\n return element[browser.prefixedMatchesSelector](selector)\n}\n\nconst getParent = (el: Node | Document | ShadowRoot) => el.parentNode || (el as ShadowRoot).host\n\n// Test for the element that's \"above\" all other qualifiers\nexport function indexOfDeepestElement (elements: Interact.Element[] | NodeListOf) {\n let deepestNodeParents: Node[] = []\n let deepestNodeIndex: number\n\n for (let i = 0; i < elements.length; i++) {\n const currentNode = elements[i]\n const deepestNode: Node = elements[deepestNodeIndex]\n\n // node may appear in elements array multiple times\n if (!currentNode || i === deepestNodeIndex) {\n continue\n }\n\n if (!deepestNode) {\n deepestNodeIndex = i\n continue\n }\n\n const currentNodeParent = getParent(currentNode)\n const deepestNodeParent = getParent(deepestNode)\n\n // check if the deepest or current are document.documentElement/rootElement\n // - if the current node is, do nothing and continue\n if (currentNodeParent === currentNode.ownerDocument) {\n continue\n }\n // - if deepest is, update with the current node and continue to next\n else if (deepestNodeParent === currentNode.ownerDocument) {\n deepestNodeIndex = i\n continue\n }\n\n // compare zIndex of siblings\n if (currentNodeParent === deepestNodeParent) {\n if (zIndexIsHigherThan(currentNode, deepestNode)) {\n deepestNodeIndex = i\n }\n\n continue\n }\n\n // populate the ancestry array for the latest deepest node\n deepestNodeParents = deepestNodeParents.length ? deepestNodeParents : getNodeParents(deepestNode)\n\n let ancestryStart: Node\n\n // if the deepest node is an HTMLElement and the current node is a non root svg element\n if (deepestNode instanceof domObjects.HTMLElement &&\n currentNode instanceof domObjects.SVGElement &&\n !(currentNode instanceof domObjects.SVGSVGElement)\n ) {\n // TODO: is this check necessary? Was this for HTML elements embedded in SVG?\n if (currentNode === deepestNodeParent) {\n continue\n }\n\n ancestryStart = currentNode.ownerSVGElement\n }\n else {\n ancestryStart = currentNode\n }\n\n const currentNodeParents = getNodeParents(ancestryStart, deepestNode.ownerDocument)\n let commonIndex = 0\n\n // get (position of closest common ancestor) + 1\n while (currentNodeParents[commonIndex] && currentNodeParents[commonIndex] === deepestNodeParents[commonIndex]) {\n commonIndex++\n }\n\n const parents = [\n currentNodeParents[commonIndex - 1],\n currentNodeParents[commonIndex],\n deepestNodeParents[commonIndex],\n ]\n\n let child = parents[0].lastChild\n\n while (child) {\n if (child === parents[1]) {\n deepestNodeIndex = i\n deepestNodeParents = currentNodeParents\n\n break\n }\n else if (child === parents[2]) {\n break\n }\n\n child = child.previousSibling\n }\n }\n\n return deepestNodeIndex\n}\n\nfunction getNodeParents (node: Node, limit?: Node) {\n const parents: Node[] = []\n let parent: Node = node\n let parentParent: Node\n\n while ((parentParent = getParent(parent)) && parent !== limit && parentParent !== parent.ownerDocument) {\n parents.unshift(parent)\n parent = parentParent\n }\n\n return parents\n}\n\nfunction zIndexIsHigherThan (higherNode: Node, lowerNode: Node) {\n const higherIndex = parseInt(getWindow(higherNode).getComputedStyle(higherNode).zIndex, 10) || 0\n const lowerIndex = parseInt(getWindow(lowerNode).getComputedStyle(lowerNode).zIndex, 10) || 0\n\n return higherIndex >= lowerIndex\n}\n\nexport function matchesUpTo (element: Interact.Element, selector: string, limit: Node) {\n while (is.element(element)) {\n if (matchesSelector(element, selector)) {\n return true\n }\n\n element = parentNode(element) as Interact.Element\n\n if (element === limit) {\n return matchesSelector(element, selector)\n }\n }\n\n return false\n}\n\nexport function getActualElement (element: Interact.Element) {\n return (element instanceof domObjects.SVGElementInstance\n ? (element as SVGElement).correspondingUseElement\n : element)\n}\n\nexport function getScrollXY (relevantWindow) {\n relevantWindow = relevantWindow || win.window\n return {\n x: relevantWindow.scrollX || relevantWindow.document.documentElement.scrollLeft,\n y: relevantWindow.scrollY || relevantWindow.document.documentElement.scrollTop,\n }\n}\n\nexport function getElementClientRect (element: Interact.Element) {\n const clientRect = (element instanceof domObjects.SVGElement\n ? element.getBoundingClientRect()\n : element.getClientRects()[0])\n\n return clientRect && {\n left : clientRect.left,\n right : clientRect.right,\n top : clientRect.top,\n bottom: clientRect.bottom,\n width : clientRect.width || clientRect.right - clientRect.left,\n height: clientRect.height || clientRect.bottom - clientRect.top,\n }\n}\n\nexport function getElementRect (element: Interact.Element) {\n const clientRect = getElementClientRect(element)\n\n if (!browser.isIOS7 && clientRect) {\n const scroll = getScrollXY(win.getWindow(element))\n\n clientRect.left += scroll.x\n clientRect.right += scroll.x\n clientRect.top += scroll.y\n clientRect.bottom += scroll.y\n }\n\n return clientRect\n}\n\nexport function getPath (node: Node | Document) {\n const path = []\n\n while (node) {\n path.push(node)\n node = parentNode(node)\n }\n\n return path\n}\n\nexport function trySelector (value: Interact.Target) {\n if (!is.string(value)) { return false }\n\n // an exception will be raised if it is invalid\n domObjects.document.querySelector(value)\n return true\n}\n","export default function extend (dest: U & Partial, source: T): T & U {\n for (const prop in source) {\n (dest as unknown as T)[prop] = source[prop]\n }\n\n const ret = dest as T & U\n\n return ret\n}\n","import * as Interact from '@interactjs/types/index'\n\nimport { closest, getElementRect, parentNode } from './domUtils'\nimport extend from './extend'\nimport is from './is'\n\nexport function getStringOptionResult (value: any, target: Interact.HasGetRect, element) {\n if (value === 'parent') { return parentNode(element) }\n\n if (value === 'self') { return target.getRect(element) }\n\n return closest(element, value)\n}\n\nexport function resolveRectLike (\n value: Interact.RectResolvable,\n target?: Interact.HasGetRect,\n element?: Node,\n functionArgs?: T,\n) {\n let returnValue: any = value\n if (is.string(returnValue)) {\n returnValue = getStringOptionResult(returnValue, target, element)\n }\n else if (is.func(returnValue)) {\n returnValue = returnValue(...functionArgs)\n }\n\n if (is.element(returnValue)) {\n returnValue = getElementRect(returnValue)\n }\n\n return returnValue as Interact.Rect\n}\n\nexport function rectToXY (rect) {\n return rect && {\n x: 'x' in rect ? rect.x : rect.left,\n y: 'y' in rect ? rect.y : rect.top,\n }\n}\n\nexport function xywhToTlbr (rect) {\n if (rect && !('left' in rect && 'top' in rect)) {\n rect = extend({}, rect)\n\n rect.left = rect.x || 0\n rect.top = rect.y || 0\n rect.right = rect.right || (rect.left + rect.width)\n rect.bottom = rect.bottom || (rect.top + rect.height)\n }\n\n return rect\n}\n\nexport function tlbrToXywh (rect) {\n if (rect && !('x' in rect && 'y' in rect)) {\n rect = extend({}, rect)\n\n rect.x = rect.left || 0\n rect.y = rect.top || 0\n rect.width = rect.width || ((rect.right || 0) - rect.x)\n rect.height = rect.height || ((rect.bottom || 0) - rect.y)\n }\n\n return rect\n}\n\nexport function addEdges (edges: Interact.EdgeOptions, rect: Interact.Rect, delta: Interact.Point) {\n if (edges.left) { rect.left += delta.x }\n if (edges.right) { rect.right += delta.x }\n if (edges.top) { rect.top += delta.y }\n if (edges.bottom) { rect.bottom += delta.y }\n\n rect.width = rect.right - rect.left\n rect.height = rect.bottom - rect.top\n}\n","import * as Interact from '@interactjs/types/index'\n\nimport { rectToXY, resolveRectLike } from './rect'\n\nexport default function (\n target: Interact.HasGetRect & { options: Interact.PerActionDefaults },\n element: Node,\n actionName?: Interact.ActionName,\n) {\n const actionOptions = (target.options as any)[actionName]\n const actionOrigin = actionOptions && actionOptions.origin\n const origin = actionOrigin || target.options.origin\n\n const originRect = resolveRectLike(origin, target, element, [target && element])\n\n return rectToXY(originRect) || { x: 0, y: 0 }\n}\n","import * as Interact from '@interactjs/types/index'\n\nimport extend from './extend'\nimport is from './is'\n\nexport interface NormalizedListeners {\n [type: string]: Interact.Listener[]\n}\n\nexport default function normalize (\n type: Interact.EventTypes,\n listeners?: Interact.ListenersArg | Interact.ListenersArg[],\n result?: NormalizedListeners,\n): NormalizedListeners {\n result = result || {}\n\n if (is.string(type) && type.search(' ') !== -1) {\n type = split(type)\n }\n\n if (is.array(type)) {\n return type.reduce(\n (acc, t) => extend(acc, normalize(t, listeners, result)),\n result,\n )\n }\n\n // ({ type: fn }) -> ('', { type: fn })\n if (is.object(type)) {\n listeners = type\n type = ''\n }\n\n if (is.func(listeners)) {\n result[type] = result[type] || []\n result[type].push(listeners)\n }\n else if (is.array(listeners)) {\n for (const l of listeners) {\n normalize(type, l, result)\n }\n }\n else if (is.object(listeners)) {\n for (const prefix in listeners) {\n const combinedTypes = split(prefix).map(p => `${type}${p}`)\n\n normalize(combinedTypes, listeners[prefix], result)\n }\n }\n\n return result as NormalizedListeners\n}\n\nfunction split (type: string) {\n return type.trim().split(/ +/)\n}\n","export default (x: number, y: number) => Math.sqrt(x * x + y * y)\n","export interface PointerExtend {\n webkit: RegExp\n [prefix: string]: RegExp\n}\n\nfunction pointerExtend (dest, source) {\n for (const prop in source) {\n const prefixedPropREs = pointerExtend.prefixedPropREs\n let deprecated = false\n\n // skip deprecated prefixed properties\n for (const vendor in prefixedPropREs) {\n if (prop.indexOf(vendor) === 0 && prefixedPropREs[vendor].test(prop)) {\n deprecated = true\n break\n }\n }\n\n if (!deprecated && typeof source[prop] !== 'function') {\n dest[prop] = source[prop]\n }\n }\n return dest\n}\n\npointerExtend.prefixedPropREs = {\n webkit: /(Movement[XY]|Radius[XY]|RotationAngle|Force)$/,\n moz: /(Pressure)$/,\n}\n\nexport default pointerExtend\n","import * as Interact from '@interactjs/types/index'\n\nimport browser from './browser'\nimport dom from './domObjects'\nimport * as domUtils from './domUtils'\nimport hypot from './hypot'\nimport is from './is'\nimport pointerExtend from './pointerExtend'\n\nexport function copyCoords (dest: Interact.CoordsSetMember, src: Interact.CoordsSetMember) {\n dest.page = dest.page || {} as any\n dest.page.x = src.page.x\n dest.page.y = src.page.y\n\n dest.client = dest.client || {} as any\n dest.client.x = src.client.x\n dest.client.y = src.client.y\n\n dest.timeStamp = src.timeStamp\n}\n\nexport function setCoordDeltas (targetObj: Interact.CoordsSetMember, prev: Interact.CoordsSetMember, cur: Interact.CoordsSetMember) {\n targetObj.page.x = cur.page.x - prev.page.x\n targetObj.page.y = cur.page.y - prev.page.y\n targetObj.client.x = cur.client.x - prev.client.x\n targetObj.client.y = cur.client.y - prev.client.y\n targetObj.timeStamp = cur.timeStamp - prev.timeStamp\n}\n\nexport function setCoordVelocity (targetObj: Interact.CoordsSetMember, delta: Interact.CoordsSetMember) {\n const dt = Math.max(delta.timeStamp / 1000, 0.001)\n\n targetObj.page.x = delta.page.x / dt\n targetObj.page.y = delta.page.y / dt\n targetObj.client.x = delta.client.x / dt\n targetObj.client.y = delta.client.y / dt\n targetObj.timeStamp = dt\n}\n\nexport function setZeroCoords (targetObj: Interact.CoordsSetMember) {\n targetObj.page.x = 0\n targetObj.page.y = 0\n targetObj.client.x = 0\n targetObj.client.y = 0\n}\n\nexport function isNativePointer (pointer: any) {\n return (pointer instanceof dom.Event || pointer instanceof dom.Touch)\n}\n\n// Get specified X/Y coords for mouse or event.touches[0]\nexport function getXY (type, pointer, xy) {\n xy = xy || {}\n type = type || 'page'\n\n xy.x = pointer[type + 'X']\n xy.y = pointer[type + 'Y']\n\n return xy\n}\n\nexport function getPageXY (pointer: Interact.PointerType | Interact.InteractEvent, page?: Interact.Point) {\n page = page || { x: 0, y: 0 }\n\n // Opera Mobile handles the viewport and scrolling oddly\n if (browser.isOperaMobile && isNativePointer(pointer)) {\n getXY('screen', pointer, page)\n\n page.x += window.scrollX\n page.y += window.scrollY\n }\n else {\n getXY('page', pointer, page)\n }\n\n return page\n}\n\nexport function getClientXY (pointer, client) {\n client = client || {}\n\n if (browser.isOperaMobile && isNativePointer(pointer)) {\n // Opera Mobile handles the viewport and scrolling oddly\n getXY('screen', pointer, client)\n }\n else {\n getXY('client', pointer, client)\n }\n\n return client\n}\n\nexport function getPointerId (pointer) {\n return is.number(pointer.pointerId) ? pointer.pointerId : pointer.identifier\n}\n\nexport function setCoords (targetObj, pointers: any[], timeStamp: number) {\n const pointer = (pointers.length > 1\n ? pointerAverage(pointers)\n : pointers[0])\n\n const tmpXY = {} as { x: number, y: number }\n\n getPageXY(pointer, tmpXY)\n targetObj.page.x = tmpXY.x\n targetObj.page.y = tmpXY.y\n\n getClientXY(pointer, tmpXY)\n targetObj.client.x = tmpXY.x\n targetObj.client.y = tmpXY.y\n\n targetObj.timeStamp = timeStamp\n}\n\nexport function getTouchPair (event) {\n const touches = []\n\n // array of touches is supplied\n if (is.array(event)) {\n touches[0] = event[0]\n touches[1] = event[1]\n }\n // an event\n else {\n if (event.type === 'touchend') {\n if (event.touches.length === 1) {\n touches[0] = event.touches[0]\n touches[1] = event.changedTouches[0]\n }\n else if (event.touches.length === 0) {\n touches[0] = event.changedTouches[0]\n touches[1] = event.changedTouches[1]\n }\n }\n else {\n touches[0] = event.touches[0]\n touches[1] = event.touches[1]\n }\n }\n\n return touches\n}\n\nexport function pointerAverage (pointers: PointerEvent[] | Event[]) {\n const average = {\n pageX : 0,\n pageY : 0,\n clientX: 0,\n clientY: 0,\n screenX: 0,\n screenY: 0,\n }\n\n for (const pointer of pointers) {\n for (const prop in average) {\n average[prop] += pointer[prop]\n }\n }\n for (const prop in average) {\n average[prop] /= pointers.length\n }\n\n return average\n}\n\nexport function touchBBox (event: Event | Array<(Interact.PointerType) | TouchEvent>) {\n if (!(event as any).length &&\n !((event as TouchEvent).touches &&\n (event as TouchEvent).touches.length > 1)) {\n return null\n }\n\n const touches = getTouchPair(event)\n const minX = Math.min(touches[0].pageX, touches[1].pageX)\n const minY = Math.min(touches[0].pageY, touches[1].pageY)\n const maxX = Math.max(touches[0].pageX, touches[1].pageX)\n const maxY = Math.max(touches[0].pageY, touches[1].pageY)\n\n return {\n x: minX,\n y: minY,\n left: minX,\n top: minY,\n right: maxX,\n bottom: maxY,\n width: maxX - minX,\n height: maxY - minY,\n }\n}\n\nexport function touchDistance (event, deltaSource) {\n const sourceX = deltaSource + 'X'\n const sourceY = deltaSource + 'Y'\n const touches = getTouchPair(event)\n\n const dx = touches[0][sourceX] - touches[1][sourceX]\n const dy = touches[0][sourceY] - touches[1][sourceY]\n\n return hypot(dx, dy)\n}\n\nexport function touchAngle (event, deltaSource) {\n const sourceX = deltaSource + 'X'\n const sourceY = deltaSource + 'Y'\n const touches = getTouchPair(event)\n const dx = touches[1][sourceX] - touches[0][sourceX]\n const dy = touches[1][sourceY] - touches[0][sourceY]\n const angle = 180 * Math.atan2(dy, dx) / Math.PI\n\n return angle\n}\n\nexport function getPointerType (pointer) {\n return is.string(pointer.pointerType)\n ? pointer.pointerType\n : is.number(pointer.pointerType)\n ? [undefined, undefined, 'touch', 'pen', 'mouse'][pointer.pointerType]\n // if the PointerEvent API isn't available, then the \"pointer\" must\n // be either a MouseEvent, TouchEvent, or Touch object\n : /touch/.test(pointer.type) || pointer instanceof dom.Touch\n ? 'touch'\n : 'mouse'\n}\n\n// [ event.target, event.currentTarget ]\nexport function getEventTargets (event) {\n const path = is.func(event.composedPath) ? event.composedPath() : event.path\n\n return [\n domUtils.getActualElement(path ? path[0] : event.target),\n domUtils.getActualElement(event.currentTarget),\n ]\n}\n\nexport function newCoords (): Interact.CoordsSetMember {\n return {\n page : { x: 0, y: 0 },\n client : { x: 0, y: 0 },\n timeStamp: 0,\n }\n}\n\nexport function coordsToEvent (coords: MockCoords) {\n const event = {\n coords,\n get page () { return this.coords.page },\n get client () { return this.coords.client },\n get timeStamp () { return this.coords.timeStamp },\n get pageX () { return this.coords.page.x },\n get pageY () { return this.coords.page.y },\n get clientX () { return this.coords.client.x },\n get clientY () { return this.coords.client.y },\n get pointerId () { return this.coords.pointerId },\n get target () { return this.coords.target },\n get type () { return this.coords.type },\n get pointerType () { return this.coords.pointerType },\n get buttons () { return this.coords.buttons },\n preventDefault () {},\n }\n\n return event as typeof event & Interact.PointerType & Interact.PointerEventType\n}\n\nexport interface MockCoords {\n page: Interact.Point\n client: Interact.Point\n timeStamp?: number\n pointerId?: any\n target?: any\n type?: string\n pointerType?: string\n buttons?: number\n}\n\nexport { pointerExtend }\n","import * as Interact from '@interactjs/types/index'\n\nexport class BaseEvent {\n type: string\n target: EventTarget\n currentTarget: EventTarget\n interactable: Interact.Interactable\n _interaction: Interact.Interaction\n timeStamp: any\n immediatePropagationStopped = false\n propagationStopped = false\n\n constructor (interaction: Interact.Interaction) {\n this._interaction = interaction\n }\n\n preventDefault () {}\n\n /**\n * Don't call any other listeners (even on the current target)\n */\n stopPropagation () {\n this.propagationStopped = true\n }\n\n /**\n * Don't call listeners on the remaining targets\n */\n stopImmediatePropagation () {\n this.immediatePropagationStopped = this.propagationStopped = true\n }\n}\n\n// defined outside of class definition to avoid assignment of undefined during\n// construction\nexport interface BaseEvent {\n interaction: Interact.InteractionProxy\n}\n\n// getters and setters defined here to support typescript 3.6 and below which\n// don't support getter and setters in .d.ts files\nObject.defineProperty(BaseEvent.prototype, 'interaction', {\n get (this: BaseEvent) { return this._interaction._proxy },\n set (this: BaseEvent) {},\n})\n\nexport default BaseEvent\n","type Filter = (element: T, index: number, array: T[]) => boolean\n\nexport const contains = (array: T[], target: T) => array.indexOf(target) !== -1\n\nexport const remove = (array: T[], target: T) => array.splice(array.indexOf(target), 1)\n\nexport const merge = (target: Array, source: U[]) => {\n for (const item of source) {\n target.push(item)\n }\n\n return target\n}\n\nexport const from = (source: ArrayLike) => merge([] as T[], source as T[])\n\nexport const findIndex = (array: T[], func: Filter) => {\n for (let i = 0; i < array.length; i++) {\n if (func(array[i], i, array)) {\n return i\n }\n }\n\n return -1\n}\n\nexport const find = (array: T[], func: Filter) => array[findIndex(array, func)]\n","import { BaseEvent } from '@interactjs/core/BaseEvent'\nimport { InteractEvent } from '@interactjs/core/InteractEvent'\nimport { Interactable } from '@interactjs/core/Interactable'\nimport * as Interact from '@interactjs/types/index'\nimport * as arr from '@interactjs/utils/arr'\n\nexport class DropEvent extends BaseEvent {\n target: Interact.Element\n dropzone: Interactable\n dragEvent: InteractEvent<'drag'>\n relatedTarget: Interact.Element\n draggable: Interactable\n timeStamp: number\n propagationStopped = false\n immediatePropagationStopped = false\n\n /**\n * Class of events fired on dropzones during drags with acceptable targets.\n */\n constructor (dropState: import('./plugin').DropState, dragEvent: InteractEvent<'drag'>, type: string) {\n super(dragEvent._interaction)\n\n const { element, dropzone } = type === 'dragleave'\n ? dropState.prev\n : dropState.cur\n\n this.type = type\n this.target = element\n this.currentTarget = element\n this.dropzone = dropzone\n this.dragEvent = dragEvent\n this.relatedTarget = dragEvent.target\n this.draggable = dragEvent.interactable\n this.timeStamp = dragEvent.timeStamp\n }\n\n /**\n * If this is a `dropactivate` event, the dropzone element will be\n * deactivated.\n *\n * If this is a `dragmove` or `dragenter`, a `dragleave` will be fired on the\n * dropzone element and more.\n */\n reject () {\n const { dropState } = this._interaction\n\n if (\n (this.type !== 'dropactivate') && (\n !this.dropzone ||\n dropState.cur.dropzone !== this.dropzone ||\n dropState.cur.element !== this.target)) {\n return\n }\n\n dropState.prev.dropzone = this.dropzone\n dropState.prev.element = this.target\n\n dropState.rejected = true\n dropState.events.enter = null\n\n this.stopImmediatePropagation()\n\n if (this.type === 'dropactivate') {\n const activeDrops = dropState.activeDrops\n const index = arr.findIndex(activeDrops, ({ dropzone, element }) =>\n dropzone === this.dropzone && element === this.target)\n\n dropState.activeDrops.splice(index, 1)\n\n const deactivateEvent = new DropEvent(dropState, this.dragEvent, 'dropdeactivate')\n\n deactivateEvent.dropzone = this.dropzone\n deactivateEvent.target = this.target\n\n this.dropzone.fire(deactivateEvent)\n }\n else {\n this.dropzone.fire(new DropEvent(dropState, this.dragEvent, 'dragleave'))\n }\n }\n\n preventDefault () {}\n\n stopPropagation () {\n this.propagationStopped = true\n }\n\n stopImmediatePropagation () {\n this.immediatePropagationStopped = this.propagationStopped = true\n }\n}\n","import { InteractEvent } from '@interactjs/core/InteractEvent'\nimport { Interactable } from '@interactjs/core/Interactable'\nimport { Scope } from '@interactjs/core/scope'\nimport * as Interact from '@interactjs/types/index'\nimport * as domUtils from '@interactjs/utils/domUtils'\nimport extend from '@interactjs/utils/extend'\nimport getOriginXY from '@interactjs/utils/getOriginXY'\nimport is from '@interactjs/utils/is'\nimport normalizeListeners from '@interactjs/utils/normalizeListeners'\nimport * as pointerUtils from '@interactjs/utils/pointerUtils'\n\nimport drag from '../drag/plugin'\n\nimport { DropEvent } from './DropEvent'\n\nexport interface DropzoneMethod {\n (options: Interact.DropzoneOptions | boolean): Interact.Interactable\n (): Interact.DropzoneOptions\n}\n\ndeclare module '@interactjs/core/Interactable' {\n interface Interactable {\n dropzone: DropzoneMethod\n dropCheck: (\n dragEvent: InteractEvent,\n event: Interact.PointerEventType,\n draggable: Interactable,\n draggableElement: Interact.Element,\n dropElemen: Interact.Element,\n rect: any\n ) => boolean\n }\n}\n\ndeclare module '@interactjs/core/Interaction' {\n interface Interaction {\n dropState?: DropState\n }\n}\n\ndeclare module '@interactjs/core/defaultOptions' {\n interface ActionDefaults {\n drop: Interact.DropzoneOptions\n }\n}\n\ndeclare module '@interactjs/core/scope' {\n interface ActionMap {\n drop?: typeof drop\n }\n\n interface Scope {\n dynamicDrop?: boolean\n }\n\n interface SignalArgs {\n 'actions/drop:start': DropSignalArg\n 'actions/drop:move': DropSignalArg\n 'actions/drop:end': DropSignalArg\n }\n}\n\ndeclare module '@interactjs/core/interactStatic' {\n export interface InteractStatic {\n dynamicDrop: (this: Interact.InteractStatic, newValue?: boolean) => boolean | this\n }\n}\n\ninterface DropSignalArg {\n interaction: Interact.Interaction\n dragEvent: Interact.DragEvent\n}\n\nexport interface ActiveDrop {\n dropzone: Interactable\n element: Interact.Element\n rect: Interact.Rect\n}\n\nexport interface DropState {\n cur: {\n dropzone: Interactable // the dropzone a drag target might be dropped into\n element: Interact.Element // the element at the time of checking\n }\n prev: {\n dropzone: Interactable // the dropzone that was recently dragged away from\n element: Interact.Element // the element at the time of checking\n }\n rejected: boolean // wheather the potential drop was rejected from a listener\n events: any // the drop events related to the current drag event\n activeDrops: ActiveDrop[]\n}\n\nfunction install (scope: Scope) {\n const {\n actions,\n /** @lends module:interact */\n interactStatic: interact,\n /** @lends Interactable */\n Interactable, // eslint-disable-line no-shadow\n defaults,\n } = scope\n\n scope.usePlugin(drag)\n\n /**\n *\n * ```js\n * interact('.drop').dropzone({\n * accept: '.can-drop' || document.getElementById('single-drop'),\n * overlap: 'pointer' || 'center' || zeroToOne\n * }\n * ```\n *\n * Returns or sets whether draggables can be dropped onto this target to\n * trigger drop events\n *\n * Dropzones can receive the following events:\n * - `dropactivate` and `dropdeactivate` when an acceptable drag starts and ends\n * - `dragenter` and `dragleave` when a draggable enters and leaves the dropzone\n * - `dragmove` when a draggable that has entered the dropzone is moved\n * - `drop` when a draggable is dropped into this dropzone\n *\n * Use the `accept` option to allow only elements that match the given CSS\n * selector or element. The value can be:\n *\n * - **an Element** - only that element can be dropped into this dropzone.\n * - **a string**, - the element being dragged must match it as a CSS selector.\n * - **`null`** - accept options is cleared - it accepts any element.\n *\n * Use the `overlap` option to set how drops are checked for. The allowed\n * values are:\n *\n * - `'pointer'`, the pointer must be over the dropzone (default)\n * - `'center'`, the draggable element's center must be over the dropzone\n * - a number from 0-1 which is the `(intersection area) / (draggable area)`.\n * e.g. `0.5` for drop to happen when half of the area of the draggable is\n * over the dropzone\n *\n * Use the `checker` option to specify a function to check if a dragged element\n * is over this Interactable.\n *\n * @param {boolean | object | null} [options] The new options to be set.\n * @return {boolean | Interactable} The current setting or this Interactable\n */\n Interactable.prototype.dropzone = function (this: Interact.Interactable, options?: Interact.DropzoneOptions | boolean) {\n return dropzoneMethod(this, options)\n }\n\n /**\n * ```js\n * interact(target)\n * .dropChecker(function(dragEvent, // related dragmove or dragend event\n * event, // TouchEvent/PointerEvent/MouseEvent\n * dropped, // bool result of the default checker\n * dropzone, // dropzone Interactable\n * dropElement, // dropzone elemnt\n * draggable, // draggable Interactable\n * draggableElement) {// draggable element\n *\n * return dropped && event.target.hasAttribute('allow-drop')\n * }\n * ```\n */\n Interactable.prototype.dropCheck = function (this: Interact.Interactable, dragEvent, event, draggable, draggableElement, dropElement, rect) {\n return dropCheckMethod(this, dragEvent, event, draggable, draggableElement, dropElement, rect)\n }\n\n /**\n * Returns or sets whether the dimensions of dropzone elements are calculated\n * on every dragmove or only on dragstart for the default dropChecker\n *\n * @param {boolean} [newValue] True to check on each move. False to check only\n * before start\n * @return {boolean | interact} The current setting or interact\n */\n interact.dynamicDrop = function (newValue?: boolean) {\n if (is.bool(newValue)) {\n // if (dragging && scope.dynamicDrop !== newValue && !newValue) {\n // calcRects(dropzones)\n // }\n\n scope.dynamicDrop = newValue\n\n return interact\n }\n return scope.dynamicDrop\n }\n\n extend(actions.phaselessTypes, {\n dragenter: true,\n dragleave: true,\n dropactivate: true,\n dropdeactivate: true,\n dropmove: true,\n drop: true,\n })\n actions.methodDict.drop = 'dropzone'\n\n scope.dynamicDrop = false\n\n defaults.actions.drop = drop.defaults\n}\n\nfunction collectDrops ({ interactables }, draggableElement) {\n const drops = []\n\n // collect all dropzones and their elements which qualify for a drop\n for (const dropzone of interactables.list) {\n if (!dropzone.options.drop.enabled) { continue }\n\n const accept = dropzone.options.drop.accept\n\n // test the draggable draggableElement against the dropzone's accept setting\n if ((is.element(accept) && accept !== draggableElement) ||\n (is.string(accept) &&\n !domUtils.matchesSelector(draggableElement, accept)) ||\n (is.func(accept) && !accept({ dropzone, draggableElement }))) {\n continue\n }\n\n // query for new elements if necessary\n const dropElements = is.string(dropzone.target)\n ? dropzone._context.querySelectorAll(dropzone.target)\n : is.array(dropzone.target) ? dropzone.target : [dropzone.target]\n\n for (const dropzoneElement of dropElements) {\n if (dropzoneElement !== draggableElement) {\n drops.push({\n dropzone,\n element: dropzoneElement,\n })\n }\n }\n }\n\n return drops\n}\n\nfunction fireActivationEvents (activeDrops, event) {\n // loop through all active dropzones and trigger event\n for (const { dropzone, element } of activeDrops.slice()) {\n event.dropzone = dropzone\n\n // set current element as event target\n event.target = element\n dropzone.fire(event)\n event.propagationStopped = event.immediatePropagationStopped = false\n }\n}\n\n// return a new array of possible drops. getActiveDrops should always be\n// called when a drag has just started or a drag event happens while\n// dynamicDrop is true\nfunction getActiveDrops (scope: Scope, dragElement: Interact.Element) {\n // get dropzones and their elements that could receive the draggable\n const activeDrops = collectDrops(scope, dragElement)\n\n for (const activeDrop of activeDrops) {\n activeDrop.rect = activeDrop.dropzone.getRect(activeDrop.element)\n }\n\n return activeDrops\n}\n\nfunction getDrop ({ dropState, interactable: draggable, element: dragElement }: Partial, dragEvent, pointerEvent) {\n const validDrops = []\n\n // collect all dropzones and their elements which qualify for a drop\n for (const { dropzone, element: dropzoneElement, rect } of dropState.activeDrops) {\n validDrops.push(dropzone.dropCheck(dragEvent, pointerEvent, draggable, dragElement, dropzoneElement, rect)\n ? dropzoneElement\n : null)\n }\n\n // get the most appropriate dropzone based on DOM depth and order\n const dropIndex = domUtils.indexOfDeepestElement(validDrops)\n\n return dropState.activeDrops[dropIndex] || null\n}\n\nfunction getDropEvents (interaction: Interact.Interaction, _pointerEvent, dragEvent) {\n const { dropState } = interaction\n const dropEvents = {\n enter : null,\n leave : null,\n activate : null,\n deactivate: null,\n move : null,\n drop : null,\n }\n\n if (dragEvent.type === 'dragstart') {\n dropEvents.activate = new DropEvent(dropState, dragEvent, 'dropactivate')\n\n dropEvents.activate.target = null\n dropEvents.activate.dropzone = null\n }\n if (dragEvent.type === 'dragend') {\n dropEvents.deactivate = new DropEvent(dropState, dragEvent, 'dropdeactivate')\n\n dropEvents.deactivate.target = null\n dropEvents.deactivate.dropzone = null\n }\n\n if (dropState.rejected) {\n return dropEvents\n }\n\n if (dropState.cur.element !== dropState.prev.element) {\n // if there was a previous dropzone, create a dragleave event\n if (dropState.prev.dropzone) {\n dropEvents.leave = new DropEvent(dropState, dragEvent, 'dragleave')\n\n dragEvent.dragLeave = dropEvents.leave.target = dropState.prev.element\n dragEvent.prevDropzone = dropEvents.leave.dropzone = dropState.prev.dropzone\n }\n // if dropzone is not null, create a dragenter event\n if (dropState.cur.dropzone) {\n dropEvents.enter = new DropEvent(dropState, dragEvent, 'dragenter')\n\n dragEvent.dragEnter = dropState.cur.element\n dragEvent.dropzone = dropState.cur.dropzone\n }\n }\n\n if (dragEvent.type === 'dragend' && dropState.cur.dropzone) {\n dropEvents.drop = new DropEvent(dropState, dragEvent, 'drop')\n\n dragEvent.dropzone = dropState.cur.dropzone\n dragEvent.relatedTarget = dropState.cur.element\n }\n if (dragEvent.type === 'dragmove' && dropState.cur.dropzone) {\n dropEvents.move = new DropEvent(dropState, dragEvent, 'dropmove')\n\n dropEvents.move.dragmove = dragEvent\n dragEvent.dropzone = dropState.cur.dropzone\n }\n\n return dropEvents\n}\n\nfunction fireDropEvents (interaction: Interact.Interaction, events) {\n const { dropState } = interaction\n const {\n activeDrops,\n cur,\n prev,\n } = dropState\n\n if (events.leave) { prev.dropzone.fire(events.leave) }\n if (events.move) { cur.dropzone.fire(events.move) }\n if (events.enter) { cur.dropzone.fire(events.enter) }\n if (events.drop) { cur.dropzone.fire(events.drop) }\n\n if (events.deactivate) {\n fireActivationEvents(activeDrops, events.deactivate)\n }\n\n dropState.prev.dropzone = cur.dropzone\n dropState.prev.element = cur.element\n}\n\nfunction onEventCreated ({ interaction, iEvent, event }: Interact.DoPhaseArg<'drag', Interact.EventPhase>, scope) {\n if (iEvent.type !== 'dragmove' && iEvent.type !== 'dragend') { return }\n\n const { dropState } = interaction\n\n if (scope.dynamicDrop) {\n dropState.activeDrops = getActiveDrops(scope, interaction.element)\n }\n\n const dragEvent = iEvent\n const dropResult = getDrop(interaction, dragEvent, event)\n\n // update rejected status\n dropState.rejected = dropState.rejected &&\n !!dropResult &&\n dropResult.dropzone === dropState.cur.dropzone &&\n dropResult.element === dropState.cur.element\n\n dropState.cur.dropzone = dropResult && dropResult.dropzone\n dropState.cur.element = dropResult && dropResult.element\n\n dropState.events = getDropEvents(interaction, event, dragEvent)\n}\n\nfunction dropzoneMethod (interactable: Interact.Interactable): Interact.DropzoneOptions\nfunction dropzoneMethod (interactable: Interact.Interactable, options: Interact.DropzoneOptions | boolean)\nfunction dropzoneMethod (interactable: Interact.Interactable, options?: Interact.DropzoneOptions | boolean) {\n if (is.object(options)) {\n interactable.options.drop.enabled = options.enabled !== false\n\n if (options.listeners) {\n const normalized = normalizeListeners(options.listeners)\n // rename 'drop' to '' as it will be prefixed with 'drop'\n const corrected = Object.keys(normalized).reduce((acc, type) => {\n const correctedType = /^(enter|leave)/.test(type)\n ? `drag${type}`\n : /^(activate|deactivate|move)/.test(type)\n ? `drop${type}`\n : type\n\n acc[correctedType] = normalized[type]\n\n return acc\n }, {})\n\n interactable.off(interactable.options.drop.listeners)\n interactable.on(corrected)\n interactable.options.drop.listeners = corrected\n }\n\n if (is.func(options.ondrop)) { interactable.on('drop', options.ondrop) }\n if (is.func(options.ondropactivate)) { interactable.on('dropactivate', options.ondropactivate) }\n if (is.func(options.ondropdeactivate)) { interactable.on('dropdeactivate', options.ondropdeactivate) }\n if (is.func(options.ondragenter)) { interactable.on('dragenter', options.ondragenter) }\n if (is.func(options.ondragleave)) { interactable.on('dragleave', options.ondragleave) }\n if (is.func(options.ondropmove)) { interactable.on('dropmove', options.ondropmove) }\n\n if (/^(pointer|center)$/.test(options.overlap as string)) {\n interactable.options.drop.overlap = options.overlap\n }\n else if (is.number(options.overlap)) {\n interactable.options.drop.overlap = Math.max(Math.min(1, options.overlap), 0)\n }\n if ('accept' in options) {\n interactable.options.drop.accept = options.accept\n }\n if ('checker' in options) {\n interactable.options.drop.checker = options.checker\n }\n\n return interactable\n }\n\n if (is.bool(options)) {\n interactable.options.drop.enabled = options\n\n return interactable\n }\n\n return interactable.options.drop\n}\n\nfunction dropCheckMethod (\n interactable: Interact.Interactable,\n dragEvent: InteractEvent,\n event: Interact.PointerEventType,\n draggable: Interact.Interactable,\n draggableElement: Interact.Element,\n dropElement: Interact.Element,\n rect: any,\n) {\n let dropped = false\n\n // if the dropzone has no rect (eg. display: none)\n // call the custom dropChecker or just return false\n if (!(rect = rect || interactable.getRect(dropElement))) {\n return (interactable.options.drop.checker\n ? interactable.options.drop.checker(dragEvent, event, dropped, interactable, dropElement, draggable, draggableElement)\n : false)\n }\n\n const dropOverlap = interactable.options.drop.overlap\n\n if (dropOverlap === 'pointer') {\n const origin = getOriginXY(draggable, draggableElement, 'drag')\n const page = pointerUtils.getPageXY(dragEvent)\n\n page.x += origin.x\n page.y += origin.y\n\n const horizontal = (page.x > rect.left) && (page.x < rect.right)\n const vertical = (page.y > rect.top) && (page.y < rect.bottom)\n\n dropped = horizontal && vertical\n }\n\n const dragRect = draggable.getRect(draggableElement)\n\n if (dragRect && dropOverlap === 'center') {\n const cx = dragRect.left + dragRect.width / 2\n const cy = dragRect.top + dragRect.height / 2\n\n dropped = cx >= rect.left && cx <= rect.right && cy >= rect.top && cy <= rect.bottom\n }\n\n if (dragRect && is.number(dropOverlap)) {\n const overlapArea = (Math.max(0, Math.min(rect.right, dragRect.right) - Math.max(rect.left, dragRect.left)) *\n Math.max(0, Math.min(rect.bottom, dragRect.bottom) - Math.max(rect.top, dragRect.top)))\n\n const overlapRatio = overlapArea / (dragRect.width * dragRect.height)\n\n dropped = overlapRatio >= dropOverlap\n }\n\n if (interactable.options.drop.checker) {\n dropped = interactable.options.drop.checker(dragEvent, event, dropped, interactable, dropElement, draggable, draggableElement)\n }\n\n return dropped\n}\n\nconst drop: Interact.Plugin = {\n id: 'actions/drop',\n install,\n listeners: {\n 'interactions:before-action-start': ({ interaction }) => {\n if (interaction.prepared.name !== 'drag') { return }\n\n interaction.dropState = {\n cur: {\n dropzone: null,\n element: null,\n },\n prev: {\n dropzone: null,\n element: null,\n },\n rejected: null,\n events: null,\n activeDrops: [],\n }\n },\n\n 'interactions:after-action-start': ({ interaction, event, iEvent: dragEvent }: Interact.DoPhaseArg<'drag', Interact.EventPhase>, scope) => {\n if (interaction.prepared.name !== 'drag') { return }\n\n const { dropState } = interaction\n\n // reset active dropzones\n dropState.activeDrops = null\n dropState.events = null\n dropState.activeDrops = getActiveDrops(scope, interaction.element)\n dropState.events = getDropEvents(interaction, event, dragEvent)\n\n if (dropState.events.activate) {\n fireActivationEvents(dropState.activeDrops, dropState.events.activate)\n scope.fire('actions/drop:start', { interaction, dragEvent })\n }\n },\n\n // FIXME proper signal types\n 'interactions:action-move': onEventCreated,\n 'interactions:action-end': onEventCreated,\n\n 'interactions:after-action-move': function fireDropAfterMove ({ interaction, iEvent: dragEvent }: Interact.DoPhaseArg<'drag', Interact.EventPhase>, scope) {\n if (interaction.prepared.name !== 'drag') { return }\n\n fireDropEvents(interaction, interaction.dropState.events)\n\n scope.fire('actions/drop:move', { interaction, dragEvent })\n interaction.dropState.events = {}\n },\n\n 'interactions:after-action-end': ({ interaction, iEvent: dragEvent }: Interact.DoPhaseArg<'drag', Interact.EventPhase>, scope) => {\n if (interaction.prepared.name !== 'drag') { return }\n\n fireDropEvents(interaction, interaction.dropState.events)\n scope.fire('actions/drop:end', { interaction, dragEvent })\n },\n\n 'interactions:stop': ({ interaction }) => {\n if (interaction.prepared.name !== 'drag') { return }\n\n const { dropState } = interaction\n\n if (dropState) {\n dropState.activeDrops = null\n dropState.events = null\n dropState.cur.dropzone = null\n dropState.cur.element = null\n dropState.prev.dropzone = null\n dropState.prev.element = null\n dropState.rejected = false\n }\n },\n },\n getActiveDrops,\n getDrop,\n getDropEvents,\n fireDropEvents,\n defaults: {\n enabled: false,\n accept : null,\n overlap: 'pointer',\n } as Interact.DropzoneOptions,\n}\n\nexport default drop\n","import * as Interact from '@interactjs/types/index'\nimport is from '@interactjs/utils/is'\nimport * as pointerUtils from '@interactjs/utils/pointerUtils'\nexport type GesturableMethod = Interact.ActionMethod\n\ndeclare module '@interactjs/core/Interaction' {\n interface Interaction {\n gesture?: {\n angle: number // angle from first to second touch\n distance: number\n scale: number // gesture.distance / gesture.startDistance\n startAngle: number // angle of line joining two touches\n startDistance: number // distance between two touches of touchStart\n }\n }\n}\n\ndeclare module '@interactjs/core/Interactable' {\n interface Interactable {\n gesturable: GesturableMethod\n }\n}\n\ndeclare module '@interactjs/core/defaultOptions' {\n interface ActionDefaults {\n gesture: Interact.GesturableOptions\n }\n}\n\ndeclare module '@interactjs/core/scope' {\n interface ActionMap {\n gesture?: typeof gesture\n }\n}\n\nexport interface GestureEvent extends Interact.InteractEvent<'gesture'> {\n distance: number\n angle: number\n da: number // angle change\n scale: number // ratio of distance start to current event\n ds: number // scale change\n box: Interact.Rect // enclosing box of all points\n touches: Interact.PointerType[]\n}\n\nexport interface GestureSignalArg extends Interact.DoPhaseArg<'gesture', Interact.EventPhase> {\n iEvent: GestureEvent\n interaction: Interact.Interaction<'gesture'>\n}\n\nfunction install (scope: Interact.Scope) {\n const {\n actions,\n Interactable,\n defaults,\n } = scope\n\n /**\n * ```js\n * interact(element).gesturable({\n * onstart: function (event) {},\n * onmove : function (event) {},\n * onend : function (event) {},\n *\n * // limit multiple gestures.\n * // See the explanation in {@link Interactable.draggable} example\n * max: Infinity,\n * maxPerElement: 1,\n * })\n *\n * var isGestureable = interact(element).gesturable()\n * ```\n *\n * Gets or sets whether multitouch gestures can be performed on the target\n *\n * @param {boolean | object} [options] true/false or An object with event\n * listeners to be fired on gesture events (makes the Interactable gesturable)\n * @return {boolean | Interactable} A boolean indicating if this can be the\n * target of gesture events, or this Interactable\n */\n Interactable.prototype.gesturable = function (this: Interact.Interactable, options: Interact.GesturableOptions | boolean) {\n if (is.object(options)) {\n this.options.gesture.enabled = options.enabled !== false\n this.setPerAction('gesture', options)\n this.setOnEvents('gesture', options)\n\n return this\n }\n\n if (is.bool(options)) {\n this.options.gesture.enabled = options\n\n return this\n }\n\n return this.options.gesture as Interact.Options\n } as GesturableMethod\n\n actions.map.gesture = gesture\n actions.methodDict.gesture = 'gesturable'\n\n defaults.actions.gesture = gesture.defaults\n}\n\nfunction updateGestureProps ({ interaction, iEvent, phase }: GestureSignalArg) {\n if (interaction.prepared.name !== 'gesture') { return }\n\n const pointers = interaction.pointers.map(p => p.pointer)\n const starting = phase === 'start'\n const ending = phase === 'end'\n const deltaSource = interaction.interactable.options.deltaSource\n\n iEvent.touches = [pointers[0], pointers[1]]\n\n if (starting) {\n iEvent.distance = pointerUtils.touchDistance(pointers, deltaSource)\n iEvent.box = pointerUtils.touchBBox(pointers)\n iEvent.scale = 1\n iEvent.ds = 0\n iEvent.angle = pointerUtils.touchAngle(pointers, deltaSource)\n iEvent.da = 0\n\n interaction.gesture.startDistance = iEvent.distance\n interaction.gesture.startAngle = iEvent.angle\n }\n else if (ending) {\n const prevEvent = interaction.prevEvent as GestureEvent\n\n iEvent.distance = prevEvent.distance\n iEvent.box = prevEvent.box\n iEvent.scale = prevEvent.scale\n iEvent.ds = 0\n iEvent.angle = prevEvent.angle\n iEvent.da = 0\n }\n else {\n iEvent.distance = pointerUtils.touchDistance(pointers, deltaSource)\n iEvent.box = pointerUtils.touchBBox(pointers)\n iEvent.scale = iEvent.distance / interaction.gesture.startDistance\n iEvent.angle = pointerUtils.touchAngle(pointers, deltaSource)\n\n iEvent.ds = iEvent.scale - interaction.gesture.scale\n iEvent.da = iEvent.angle - interaction.gesture.angle\n }\n\n interaction.gesture.distance = iEvent.distance\n interaction.gesture.angle = iEvent.angle\n\n if (is.number(iEvent.scale) &&\n iEvent.scale !== Infinity &&\n !isNaN(iEvent.scale)) {\n interaction.gesture.scale = iEvent.scale\n }\n}\n\nconst gesture: Interact.Plugin = {\n id: 'actions/gesture',\n before: ['actions/drag', 'actions/resize'],\n install,\n listeners: {\n 'interactions:action-start': updateGestureProps,\n 'interactions:action-move': updateGestureProps,\n 'interactions:action-end': updateGestureProps,\n\n 'interactions:new': ({ interaction }) => {\n interaction.gesture = {\n angle: 0,\n distance: 0,\n scale: 1,\n startAngle: 0,\n startDistance: 0,\n }\n },\n\n 'auto-start:check': arg => {\n if (arg.interaction.pointers.length < 2) {\n return undefined\n }\n\n const gestureOptions = arg.interactable.options.gesture\n\n if (!(gestureOptions && gestureOptions.enabled)) {\n return undefined\n }\n\n arg.action = { name: 'gesture' }\n\n return false\n },\n },\n\n defaults: {\n },\n\n getCursor () {\n return ''\n },\n}\n\nexport default gesture\n","import { Interaction } from '@interactjs/core/Interaction'\nimport { Scope } from '@interactjs/core/scope'\nimport * as Interact from '@interactjs/types/index'\nimport * as dom from '@interactjs/utils/domUtils'\nimport extend from '@interactjs/utils/extend'\nimport is from '@interactjs/utils/is'\n\nexport type EdgeName = 'top' | 'left' | 'bottom' | 'right'\n\nexport type ResizableMethod = Interact.ActionMethod\n\ndeclare module '@interactjs/core/Interactable' {\n interface Interactable {\n resizable: ResizableMethod\n }\n}\n\ndeclare module '@interactjs/core/Interaction' {\n interface Interaction {\n resizeAxes: 'x' | 'y' | 'xy'\n resizeStartAspectRatio: number\n }\n}\n\ndeclare module '@interactjs/core/defaultOptions' {\n interface ActionDefaults {\n resize: Interact.ResizableOptions\n }\n}\n\ndeclare module '@interactjs/core/scope' {\n interface ActionMap {\n resize?: typeof resize\n }\n}\n\nexport interface ResizeEvent

extends Interact.InteractEvent<'resize', P> {\n deltaRect?: Interact.FullRect\n edges?: Interact.ActionProps['edges']\n}\n\nfunction install (scope: Scope) {\n const {\n actions,\n browser,\n /** @lends Interactable */\n Interactable, // tslint:disable-line no-shadowed-variable\n defaults,\n } = scope\n\n // Less Precision with touch input\n\n resize.cursors = initCursors(browser)\n resize.defaultMargin = browser.supportsTouch || browser.supportsPointerEvent ? 20 : 10\n\n /**\n * ```js\n * interact(element).resizable({\n * onstart: function (event) {},\n * onmove : function (event) {},\n * onend : function (event) {},\n *\n * edges: {\n * top : true, // Use pointer coords to check for resize.\n * left : false, // Disable resizing from left edge.\n * bottom: '.resize-s',// Resize if pointer target matches selector\n * right : handleEl // Resize if pointer target is the given Element\n * },\n *\n * // Width and height can be adjusted independently. When `true`, width and\n * // height are adjusted at a 1:1 ratio.\n * square: false,\n *\n * // Width and height can be adjusted independently. When `true`, width and\n * // height maintain the aspect ratio they had when resizing started.\n * preserveAspectRatio: false,\n *\n * // a value of 'none' will limit the resize rect to a minimum of 0x0\n * // 'negate' will allow the rect to have negative width/height\n * // 'reposition' will keep the width/height positive by swapping\n * // the top and bottom edges and/or swapping the left and right edges\n * invert: 'none' || 'negate' || 'reposition'\n *\n * // limit multiple resizes.\n * // See the explanation in the {@link Interactable.draggable} example\n * max: Infinity,\n * maxPerElement: 1,\n * })\n *\n * var isResizeable = interact(element).resizable()\n * ```\n *\n * Gets or sets whether resize actions can be performed on the target\n *\n * @param {boolean | object} [options] true/false or An object with event\n * listeners to be fired on resize events (object makes the Interactable\n * resizable)\n * @return {boolean | Interactable} A boolean indicating if this can be the\n * target of resize elements, or this Interactable\n */\n Interactable.prototype.resizable = function (this: Interact.Interactable, options: Interact.ResizableOptions | boolean) {\n return resizable(this, options, scope)\n } as ResizableMethod\n\n actions.map.resize = resize\n actions.methodDict.resize = 'resizable'\n\n defaults.actions.resize = resize.defaults\n}\n\nfunction resizeChecker (arg) {\n const { interaction, interactable, element, rect, buttons } = arg\n\n if (!rect) { return undefined }\n\n const page = extend({}, interaction.coords.cur.page)\n const resizeOptions = interactable.options.resize\n\n if (\n !(resizeOptions && resizeOptions.enabled) ||\n // check mouseButton setting if the pointer is down\n (interaction.pointerIsDown &&\n /mouse|pointer/.test(interaction.pointerType) &&\n (buttons & resizeOptions.mouseButtons) === 0)\n ) {\n return undefined\n }\n\n // if using resize.edges\n if (is.object(resizeOptions.edges)) {\n const resizeEdges = {\n left: false,\n right: false,\n top: false,\n bottom: false,\n }\n\n for (const edge in resizeEdges) {\n resizeEdges[edge] = checkResizeEdge(edge,\n resizeOptions.edges[edge],\n page,\n interaction._latestPointer.eventTarget,\n element,\n rect,\n resizeOptions.margin || resize.defaultMargin)\n }\n\n resizeEdges.left = resizeEdges.left && !resizeEdges.right\n resizeEdges.top = resizeEdges.top && !resizeEdges.bottom\n\n if (resizeEdges.left || resizeEdges.right || resizeEdges.top || resizeEdges.bottom) {\n arg.action = {\n name: 'resize',\n edges: resizeEdges,\n }\n }\n }\n else {\n const right = resizeOptions.axis !== 'y' && page.x > (rect.right - resize.defaultMargin)\n const bottom = resizeOptions.axis !== 'x' && page.y > (rect.bottom - resize.defaultMargin)\n\n if (right || bottom) {\n arg.action = {\n name: 'resize',\n axes: (right ? 'x' : '') + (bottom ? 'y' : ''),\n }\n }\n }\n\n return arg.action ? false : undefined\n}\n\nfunction resizable (interactable: Interact.Interactable, options: Interact.OrBoolean | boolean, scope: Scope) {\n if (is.object(options)) {\n interactable.options.resize.enabled = options.enabled !== false\n interactable.setPerAction('resize', options)\n interactable.setOnEvents('resize', options)\n\n if (is.string(options.axis) && /^x$|^y$|^xy$/.test(options.axis)) {\n interactable.options.resize.axis = options.axis\n }\n else if (options.axis === null) {\n interactable.options.resize.axis = scope.defaults.actions.resize.axis\n }\n\n if (is.bool(options.preserveAspectRatio)) {\n interactable.options.resize.preserveAspectRatio = options.preserveAspectRatio\n }\n else if (is.bool(options.square)) {\n interactable.options.resize.square = options.square\n }\n\n return interactable\n }\n if (is.bool(options)) {\n interactable.options.resize.enabled = options\n\n return interactable\n }\n return interactable.options.resize\n}\n\nfunction checkResizeEdge (\n name: string,\n value: any,\n page: Interact.Point,\n element: Node,\n interactableElement: Interact.Element,\n rect: Interact.Rect,\n margin: number,\n) {\n // false, '', undefined, null\n if (!value) { return false }\n\n // true value, use pointer coords and element rect\n if (value === true) {\n // if dimensions are negative, \"switch\" edges\n const width = is.number(rect.width) ? rect.width : rect.right - rect.left\n const height = is.number(rect.height) ? rect.height : rect.bottom - rect.top\n\n // don't use margin greater than half the relevent dimension\n margin = Math.min(margin, Math.abs((name === 'left' || name === 'right' ? width : height) / 2))\n\n if (width < 0) {\n if (name === 'left') { name = 'right' }\n else if (name === 'right') { name = 'left' }\n }\n if (height < 0) {\n if (name === 'top') { name = 'bottom' }\n else if (name === 'bottom') { name = 'top' }\n }\n\n if (name === 'left') { return page.x < ((width >= 0 ? rect.left : rect.right) + margin) }\n if (name === 'top') { return page.y < ((height >= 0 ? rect.top : rect.bottom) + margin) }\n\n if (name === 'right') { return page.x > ((width >= 0 ? rect.right : rect.left) - margin) }\n if (name === 'bottom') { return page.y > ((height >= 0 ? rect.bottom : rect.top) - margin) }\n }\n\n // the remaining checks require an element\n if (!is.element(element)) { return false }\n\n return is.element(value)\n // the value is an element to use as a resize handle\n ? value === element\n // otherwise check if element matches value as selector\n : dom.matchesUpTo(element, value, interactableElement)\n}\n\nfunction initCursors (browser: typeof import ('@interactjs/utils/browser').default) {\n return (browser.isIe9 ? {\n x : 'e-resize',\n y : 's-resize',\n xy: 'se-resize',\n\n top : 'n-resize',\n left : 'w-resize',\n bottom : 's-resize',\n right : 'e-resize',\n topleft : 'se-resize',\n bottomright: 'se-resize',\n topright : 'ne-resize',\n bottomleft : 'ne-resize',\n } : {\n x : 'ew-resize',\n y : 'ns-resize',\n xy: 'nwse-resize',\n\n top : 'ns-resize',\n left : 'ew-resize',\n bottom : 'ns-resize',\n right : 'ew-resize',\n topleft : 'nwse-resize',\n bottomright: 'nwse-resize',\n topright : 'nesw-resize',\n bottomleft : 'nesw-resize',\n })\n}\n\nfunction start ({ iEvent, interaction }: { iEvent: Interact.InteractEvent, interaction: Interaction }) {\n if (interaction.prepared.name !== 'resize' || !interaction.prepared.edges) {\n return\n }\n\n const resizeEvent = iEvent as ResizeEvent\n const rect = interaction.rect\n\n interaction._rects = {\n start: extend({}, rect),\n corrected: extend({}, rect),\n previous: extend({}, rect),\n delta: {\n left: 0,\n right : 0,\n width : 0,\n top : 0,\n bottom: 0,\n height: 0,\n },\n }\n\n resizeEvent.edges = interaction.prepared.edges\n resizeEvent.rect = interaction._rects.corrected\n resizeEvent.deltaRect = interaction._rects.delta\n}\n\nfunction move ({ iEvent, interaction }: { iEvent: Interact.InteractEvent, interaction: Interaction }) {\n if (interaction.prepared.name !== 'resize' || !interaction.prepared.edges) { return }\n\n const resizeEvent = iEvent as ResizeEvent\n const resizeOptions = interaction.interactable.options.resize\n const invert = resizeOptions.invert\n const invertible = invert === 'reposition' || invert === 'negate'\n\n // eslint-disable-next-line no-shadow\n const current = interaction.rect\n const { start: startRect, corrected, delta: deltaRect, previous } = interaction._rects\n\n extend(previous, corrected)\n\n if (invertible) {\n // if invertible, copy the current rect\n extend(corrected, current)\n\n if (invert === 'reposition') {\n // swap edge values if necessary to keep width/height positive\n if (corrected.top > corrected.bottom) {\n const swap = corrected.top\n\n corrected.top = corrected.bottom\n corrected.bottom = swap\n }\n if (corrected.left > corrected.right) {\n const swap = corrected.left\n\n corrected.left = corrected.right\n corrected.right = swap\n }\n }\n }\n else {\n // if not invertible, restrict to minimum of 0x0 rect\n corrected.top = Math.min(current.top, startRect.bottom)\n corrected.bottom = Math.max(current.bottom, startRect.top)\n corrected.left = Math.min(current.left, startRect.right)\n corrected.right = Math.max(current.right, startRect.left)\n }\n\n corrected.width = corrected.right - corrected.left\n corrected.height = corrected.bottom - corrected.top\n\n for (const edge in corrected) {\n deltaRect[edge] = corrected[edge] - previous[edge]\n }\n\n resizeEvent.edges = interaction.prepared.edges\n resizeEvent.rect = corrected\n resizeEvent.deltaRect = deltaRect\n}\n\nfunction end ({ iEvent, interaction }: { iEvent: Interact.InteractEvent, interaction: Interaction }) {\n if (interaction.prepared.name !== 'resize' || !interaction.prepared.edges) { return }\n\n const resizeEvent = iEvent as ResizeEvent\n\n resizeEvent.edges = interaction.prepared.edges\n resizeEvent.rect = interaction._rects.corrected\n resizeEvent.deltaRect = interaction._rects.delta\n}\n\nfunction updateEventAxes ({ iEvent, interaction }: { iEvent: Interact.InteractEvent, interaction: Interaction }) {\n if (interaction.prepared.name !== 'resize' || !interaction.resizeAxes) { return }\n\n const options = interaction.interactable.options\n const resizeEvent = iEvent as ResizeEvent\n\n if (options.resize.square) {\n if (interaction.resizeAxes === 'y') {\n resizeEvent.delta.x = resizeEvent.delta.y\n }\n else {\n resizeEvent.delta.y = resizeEvent.delta.x\n }\n resizeEvent.axes = 'xy'\n }\n else {\n resizeEvent.axes = interaction.resizeAxes\n\n if (interaction.resizeAxes === 'x') {\n resizeEvent.delta.y = 0\n }\n else if (interaction.resizeAxes === 'y') {\n resizeEvent.delta.x = 0\n }\n }\n}\n\nconst resize: Interact.Plugin = {\n id: 'actions/resize',\n before: ['actions/drag'],\n install,\n listeners: {\n 'interactions:new': ({ interaction }) => {\n interaction.resizeAxes = 'xy'\n },\n\n 'interactions:action-start': arg => {\n start(arg)\n updateEventAxes(arg)\n },\n 'interactions:action-move': arg => {\n move(arg)\n updateEventAxes(arg)\n },\n 'interactions:action-end': end,\n 'auto-start:check': resizeChecker,\n },\n\n defaults: {\n square: false,\n preserveAspectRatio: false,\n axis: 'xy',\n\n // use default margin\n margin: NaN,\n\n // object with props left, right, top, bottom which are\n // true/false values to resize when the pointer is over that edge,\n // CSS selectors to match the handles for each direction\n // or the Elements for each handle\n edges: null,\n\n // a value of 'none' will limit the resize rect to a minimum of 0x0\n // 'negate' will alow the rect to have negative width/height\n // 'reposition' will keep the width/height positive by swapping\n // the top and bottom edges and/or swapping the left and right edges\n invert: 'none',\n } as Interact.ResizableOptions,\n\n cursors: null as ReturnType,\n\n getCursor ({ edges, axis, name }: Interact.ActionProps) {\n const cursors = resize.cursors\n let result: string = null\n\n if (axis) {\n result = cursors[name + axis]\n }\n else if (edges) {\n let cursorKey = ''\n\n for (const edge of ['top', 'bottom', 'left', 'right']) {\n if (edges[edge]) {\n cursorKey += edge\n }\n }\n\n result = cursors[cursorKey]\n }\n\n return result\n },\n\n defaultMargin: null as number,\n}\n\nexport default resize\n","import * as Interact from '@interactjs/types/index'\n\nimport drag from './drag/plugin'\nimport drop from './drop/plugin'\nimport gesture from './gesture/plugin'\nimport resize from './resize/plugin'\n\nexport default {\n id: 'actions',\n install (scope: Interact.Scope) {\n scope.usePlugin(gesture)\n scope.usePlugin(resize)\n scope.usePlugin(drag)\n scope.usePlugin(drop)\n },\n}\n","export type ArrangeEvent = {}\nexport type ArrangeMode = {}\n\nexport default {}\n","let lastTime = 0\nlet request\nlet cancel\n\nfunction init (window) {\n request = window.requestAnimationFrame\n cancel = window.cancelAnimationFrame\n\n if (!request) {\n const vendors = ['ms', 'moz', 'webkit', 'o']\n\n for (const vendor of vendors) {\n request = window[`${vendor}RequestAnimationFrame`]\n cancel = window[`${vendor}CancelAnimationFrame`] || window[`${vendor}CancelRequestAnimationFrame`]\n }\n }\n\n if (!request) {\n request = callback => {\n const currTime = Date.now()\n const timeToCall = Math.max(0, 16 - (currTime - lastTime))\n // eslint-disable-next-line standard/no-callback-literal\n const token = setTimeout(() => { callback(currTime + timeToCall) },\n timeToCall)\n\n lastTime = currTime + timeToCall\n return token\n }\n\n cancel = token => clearTimeout(token)\n }\n}\n\nexport default {\n request: callback => request(callback),\n cancel: token => cancel(token),\n init,\n}\n","import * as Interact from '@interactjs/types/index'\nimport * as domUtils from '@interactjs/utils/domUtils'\nimport is from '@interactjs/utils/is'\nimport raf from '@interactjs/utils/raf'\nimport { getStringOptionResult } from '@interactjs/utils/rect'\nimport { getWindow } from '@interactjs/utils/window'\n\ntype Scope = import ('@interactjs/core/scope').Scope\n\ndeclare module '@interactjs/core/scope' {\n interface Scope {\n autoScroll: typeof autoScroll\n }\n}\n\ndeclare module '@interactjs/core/Interaction' {\n interface Interaction {\n autoScroll?: typeof autoScroll\n }\n}\n\ndeclare module '@interactjs/core/defaultOptions' {\n interface PerActionDefaults {\n autoScroll?: AutoScrollOptions\n }\n}\n\nexport interface AutoScrollOptions {\n container?: Window | HTMLElement\n margin?: number\n distance?: number\n interval?: number\n speed?: number\n enabled?: boolean\n}\n\nfunction install (scope: Scope) {\n const {\n defaults,\n actions,\n } = scope\n\n scope.autoScroll = autoScroll\n autoScroll.now = () => scope.now()\n\n actions.phaselessTypes.autoscroll = true\n defaults.perAction.autoScroll = autoScroll.defaults\n}\n\nconst autoScroll = {\n defaults: {\n enabled : false,\n margin : 60,\n\n // the item that is scrolled (Window or HTMLElement)\n container: null as AutoScrollOptions['container'],\n\n // the scroll speed in pixels per second\n speed : 300,\n } as AutoScrollOptions,\n\n now: Date.now,\n\n interaction: null as Interact.Interaction,\n i: 0, // the handle returned by window.setInterval\n\n // Direction each pulse is to scroll in\n x: 0,\n y: 0,\n\n isScrolling: false,\n prevTime: 0,\n margin: 0,\n speed: 0,\n\n start (interaction: Interact.Interaction) {\n autoScroll.isScrolling = true\n raf.cancel(autoScroll.i)\n\n interaction.autoScroll = autoScroll\n autoScroll.interaction = interaction\n autoScroll.prevTime = autoScroll.now()\n autoScroll.i = raf.request(autoScroll.scroll)\n },\n\n stop () {\n autoScroll.isScrolling = false\n if (autoScroll.interaction) {\n autoScroll.interaction.autoScroll = null\n }\n raf.cancel(autoScroll.i)\n },\n\n // scroll the window by the values in scroll.x/y\n scroll () {\n const { interaction } = autoScroll\n const { interactable, element } = interaction\n const actionName = interaction.prepared.name\n const options = interactable.options[actionName].autoScroll\n const container = getContainer(options.container, interactable, element)\n const now = autoScroll.now()\n // change in time in seconds\n const dt = (now - autoScroll.prevTime) / 1000\n // displacement\n const s = options.speed * dt\n\n if (s >= 1) {\n const scrollBy = {\n x: autoScroll.x * s,\n y: autoScroll.y * s,\n }\n\n if (scrollBy.x || scrollBy.y) {\n const prevScroll = getScroll(container)\n\n if (is.window(container)) {\n container.scrollBy(scrollBy.x, scrollBy.y)\n }\n else if (container) {\n container.scrollLeft += scrollBy.x\n container.scrollTop += scrollBy.y\n }\n\n const curScroll = getScroll(container)\n const delta = {\n x: curScroll.x - prevScroll.x,\n y: curScroll.y - prevScroll.y,\n }\n\n if (delta.x || delta.y) {\n interactable.fire({\n type: 'autoscroll',\n target: element,\n interactable,\n delta,\n interaction,\n container,\n })\n }\n }\n\n autoScroll.prevTime = now\n }\n\n if (autoScroll.isScrolling) {\n raf.cancel(autoScroll.i)\n autoScroll.i = raf.request(autoScroll.scroll)\n }\n },\n check (interactable: Interact.Interactable, actionName: Interact.ActionName) {\n const options = interactable.options\n\n return options[actionName].autoScroll && options[actionName].autoScroll.enabled\n },\n onInteractionMove ({ interaction, pointer }: { interaction: Interact.Interaction, pointer: Interact.PointerType }) {\n if (!(interaction.interacting() &&\n autoScroll.check(interaction.interactable, interaction.prepared.name))) {\n return\n }\n\n if (interaction.simulation) {\n autoScroll.x = autoScroll.y = 0\n return\n }\n\n let top\n let right\n let bottom\n let left\n\n const { interactable, element } = interaction\n const actionName = interaction.prepared.name\n const options = interactable.options[actionName].autoScroll\n const container = getContainer(options.container, interactable, element)\n\n if (is.window(container)) {\n left = pointer.clientX < autoScroll.margin\n top = pointer.clientY < autoScroll.margin\n right = pointer.clientX > container.innerWidth - autoScroll.margin\n bottom = pointer.clientY > container.innerHeight - autoScroll.margin\n }\n else {\n const rect = domUtils.getElementClientRect(container)\n\n left = pointer.clientX < rect.left + autoScroll.margin\n top = pointer.clientY < rect.top + autoScroll.margin\n right = pointer.clientX > rect.right - autoScroll.margin\n bottom = pointer.clientY > rect.bottom - autoScroll.margin\n }\n\n autoScroll.x = (right ? 1 : left ? -1 : 0)\n autoScroll.y = (bottom ? 1 : top ? -1 : 0)\n\n if (!autoScroll.isScrolling) {\n // set the autoScroll properties to those of the target\n autoScroll.margin = options.margin\n autoScroll.speed = options.speed\n\n autoScroll.start(interaction)\n }\n },\n}\n\nexport function getContainer (value: any, interactable: Interact.Interactable, element: Interact.Element) {\n return (is.string(value) ? getStringOptionResult(value, interactable, element) : value) || getWindow(element)\n}\n\nexport function getScroll (container: any) {\n if (is.window(container)) { container = window.document.body }\n\n return { x: container.scrollLeft, y: container.scrollTop }\n}\n\nexport function getScrollSize (container: any) {\n if (is.window(container)) { container = window.document.body }\n\n return { x: container.scrollWidth, y: container.scrollHeight }\n}\n\nexport function getScrollSizeDelta ({ interaction, element }: {\n interaction: Partial>\n element: Interact.Element\n}, func: any) {\n const scrollOptions = interaction && interaction.interactable.options[interaction.prepared.name].autoScroll\n\n if (!scrollOptions || !scrollOptions.enabled) {\n func()\n return { x: 0, y: 0 }\n }\n\n const scrollContainer = getContainer(\n scrollOptions.container,\n interaction.interactable,\n element,\n )\n\n const prevSize = getScroll(scrollContainer)\n func()\n const curSize = getScroll(scrollContainer)\n\n return {\n x: curSize.x - prevSize.x,\n y: curSize.y - prevSize.y,\n }\n}\n\nconst autoScrollPlugin: Interact.Plugin = {\n id: 'auto-scroll',\n install,\n listeners: {\n 'interactions:new': ({ interaction }) => {\n interaction.autoScroll = null\n },\n\n 'interactions:destroy': ({ interaction }) => {\n interaction.autoScroll = null\n autoScroll.stop()\n if (autoScroll.interaction) {\n autoScroll.interaction = null\n }\n },\n\n 'interactions:stop': autoScroll.stop,\n\n 'interactions:action-move': (arg: any) => autoScroll.onInteractionMove(arg),\n },\n}\n\nexport default autoScrollPlugin\n","import * as Interact from '@interactjs/types/index'\n\nimport win from './window'\n\nexport function warnOnce (this: T, method: (...args: any[]) => any, message: string) {\n let warned = false\n\n return function (this: T) {\n if (!warned) {\n (win.window as any).console.warn(message)\n warned = true\n }\n\n return method.apply(this, arguments)\n }\n}\n\nexport function copyAction (dest: Interact.ActionProps, src: Interact.ActionProps) {\n dest.name = src.name\n dest.axis = src.axis\n dest.edges = src.edges\n\n return dest\n}\n","import * as Interact from '@interactjs/types/index'\nimport is from '@interactjs/utils/is'\nimport { warnOnce } from '@interactjs/utils/misc'\n\ndeclare module '@interactjs/core/Interactable' {\n interface Interactable {\n getAction: (\n this: Interact.Interactable,\n pointer: Interact.PointerType,\n event: Interact.PointerEventType,\n interaction: Interact.Interaction,\n element: Interact.Element,\n ) => Interact.ActionProps | null\n styleCursor: typeof styleCursor\n actionChecker: typeof actionChecker\n ignoreFrom: {\n (...args: any[]): Interactable\n (): boolean\n }\n allowFrom: {\n (...args: any[]): Interactable\n (): boolean\n }\n }\n}\n\nfunction install (scope: Interact.Scope) {\n const {\n /** @lends Interactable */\n Interactable, // tslint:disable-line no-shadowed-variable\n } = scope\n\n Interactable.prototype.getAction = function getAction (\n this: Interact.Interactable,\n pointer: Interact.PointerType,\n event: Interact.PointerEventType,\n interaction: Interact.Interaction,\n element: Interact.Element,\n ): Interact.ActionProps {\n const action = defaultActionChecker(this, event, interaction, element, scope)\n\n if (this.options.actionChecker) {\n return this.options.actionChecker(pointer, event, action, this, element, interaction)\n }\n\n return action\n }\n\n /**\n * ```js\n * interact(element, { ignoreFrom: document.getElementById('no-action') })\n * // or\n * interact(element).ignoreFrom('input, textarea, a')\n * ```\n * @deprecated\n * If the target of the `mousedown`, `pointerdown` or `touchstart` event or any\n * of it's parents match the given CSS selector or Element, no\n * drag/resize/gesture is started.\n *\n * Don't use this method. Instead set the `ignoreFrom` option for each action\n * or for `pointerEvents`\n *\n * @example\n * interact(targett)\n * .draggable({\n * ignoreFrom: 'input, textarea, a[href]'',\n * })\n * .pointerEvents({\n * ignoreFrom: '[no-pointer]',\n * })\n *\n * @param {string | Element | null} [newValue] a CSS selector string, an\n * Element or `null` to not ignore any elements\n * @return {string | Element | object} The current ignoreFrom value or this\n * Interactable\n */\n Interactable.prototype.ignoreFrom = warnOnce(function (this: Interact.Interactable, newValue) {\n return this._backCompatOption('ignoreFrom', newValue)\n }, 'Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue}).')\n\n /**\n * @deprecated\n *\n * A drag/resize/gesture is started only If the target of the `mousedown`,\n * `pointerdown` or `touchstart` event or any of it's parents match the given\n * CSS selector or Element.\n *\n * Don't use this method. Instead set the `allowFrom` option for each action\n * or for `pointerEvents`\n *\n * @example\n * interact(targett)\n * .resizable({\n * allowFrom: '.resize-handle',\n * .pointerEvents({\n * allowFrom: '.handle',,\n * })\n *\n * @param {string | Element | null} [newValue] a CSS selector string, an\n * Element or `null` to allow from any element\n * @return {string | Element | object} The current allowFrom value or this\n * Interactable\n */\n Interactable.prototype.allowFrom = warnOnce(function (this: Interact.Interactable, newValue) {\n return this._backCompatOption('allowFrom', newValue)\n }, 'Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue}).')\n\n /**\n * ```js\n * interact('.resize-drag')\n * .resizable(true)\n * .draggable(true)\n * .actionChecker(function (pointer, event, action, interactable, element, interaction) {\n *\n * if (interact.matchesSelector(event.target, '.drag-handle')) {\n * // force drag with handle target\n * action.name = drag\n * }\n * else {\n * // resize from the top and right edges\n * action.name = 'resize'\n * action.edges = { top: true, right: true }\n * }\n *\n * return action\n * })\n * ```\n *\n * Returns or sets the function used to check action to be performed on\n * pointerDown\n *\n * @param {function | null} [checker] A function which takes a pointer event,\n * defaultAction string, interactable, element and interaction as parameters\n * and returns an object with name property 'drag' 'resize' or 'gesture' and\n * optionally an `edges` object with boolean 'top', 'left', 'bottom' and right\n * props.\n * @return {Function | Interactable} The checker function or this Interactable\n */\n Interactable.prototype.actionChecker = actionChecker\n\n /**\n * Returns or sets whether the the cursor should be changed depending on the\n * action that would be performed if the mouse were pressed and dragged.\n *\n * @param {boolean} [newValue]\n * @return {boolean | Interactable} The current setting or this Interactable\n */\n Interactable.prototype.styleCursor = styleCursor\n}\n\nfunction defaultActionChecker (\n interactable: Interact.Interactable,\n event: Interact.PointerEventType,\n interaction: Interact.Interaction,\n element: Interact.Element,\n scope: Interact.Scope,\n) {\n const rect = interactable.getRect(element)\n const buttons = (event as MouseEvent).buttons || ({\n 0: 1,\n 1: 4,\n 3: 8,\n 4: 16,\n })[(event as MouseEvent).button as 0 | 1 | 3 | 4]\n const arg = {\n action: null,\n interactable,\n interaction,\n element,\n rect,\n buttons,\n }\n\n scope.fire('auto-start:check', arg)\n\n return arg.action\n}\n\nfunction styleCursor (this: Interact.Interactable): boolean\nfunction styleCursor (this: Interact.Interactable, newValue: boolean): typeof this\nfunction styleCursor (this: Interact.Interactable, newValue?: boolean) {\n if (is.bool(newValue)) {\n this.options.styleCursor = newValue\n\n return this\n }\n\n if (newValue === null) {\n delete this.options.styleCursor\n\n return this\n }\n\n return this.options.styleCursor\n}\n\nfunction actionChecker (this: Interact.Interactable, checker: any) {\n if (is.func(checker)) {\n this.options.actionChecker = checker\n\n return this\n }\n\n if (checker === null) {\n delete this.options.actionChecker\n\n return this\n }\n\n return this.options.actionChecker\n}\n\nexport default {\n id: 'auto-start/interactableMethods',\n install,\n}\n","import * as Interact from '@interactjs/types/index'\nimport * as domUtils from '@interactjs/utils/domUtils'\nimport extend from '@interactjs/utils/extend'\nimport is from '@interactjs/utils/is'\nimport { copyAction } from '@interactjs/utils/misc'\n\nimport InteractableMethods from './InteractableMethods'\n\ndeclare module '@interactjs/core/interactStatic' {\n export interface InteractStatic {\n maxInteractions: (newValue: any) => any\n }\n}\n\ndeclare module '@interactjs/core/scope' {\n interface Scope {\n autoStart: AutoStart\n }\n\n interface SignalArgs {\n 'autoStart:before-start': Interact.SignalArgs['interactions:move']\n 'autoStart:prepared': { interaction: Interact.Interaction }\n 'auto-start:check': CheckSignalArg\n }\n}\n\ndeclare module '@interactjs/core/defaultOptions' {\n interface BaseDefaults {\n actionChecker?: any\n cursorChecker?: any\n styleCursor?: any\n }\n\n interface PerActionDefaults {\n manualStart?: boolean\n max?: number\n maxPerElement?: number\n allowFrom?: string | Interact.Element\n ignoreFrom?: string | Interact.Element\n cursorChecker?: Interact.CursorChecker\n\n // only allow left button by default\n // see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons#Return_value\n mouseButtons?: 0 | 1 | 2 | 4 | 16\n }\n}\n\ninterface CheckSignalArg {\n interactable: Interact.Interactable\n interaction: Interact.Interaction\n element: Interact.Element\n action: Interact.ActionProps\n buttons: number\n}\n\nexport interface AutoStart {\n // Allow this many interactions to happen simultaneously\n maxInteractions: number\n withinInteractionLimit: typeof withinInteractionLimit\n cursorElement: Interact.Element\n}\n\nfunction install (scope: Interact.Scope) {\n const {\n interactStatic: interact,\n defaults,\n } = scope\n\n scope.usePlugin(InteractableMethods)\n\n defaults.base.actionChecker = null\n defaults.base.styleCursor = true\n\n extend(defaults.perAction, {\n manualStart: false,\n max: Infinity,\n maxPerElement: 1,\n allowFrom: null,\n ignoreFrom: null,\n\n // only allow left button by default\n // see https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons#Return_value\n mouseButtons: 1,\n })\n\n /**\n * Returns or sets the maximum number of concurrent interactions allowed. By\n * default only 1 interaction is allowed at a time (for backwards\n * compatibility). To allow multiple interactions on the same Interactables and\n * elements, you need to enable it in the draggable, resizable and gesturable\n * `'max'` and `'maxPerElement'` options.\n *\n * @alias module:interact.maxInteractions\n *\n * @param {number} [newValue] Any number. newValue <= 0 means no interactions.\n */\n interact.maxInteractions = (newValue: number) => maxInteractions(newValue, scope)\n\n scope.autoStart = {\n // Allow this many interactions to happen simultaneously\n maxInteractions: Infinity,\n withinInteractionLimit,\n cursorElement: null,\n }\n}\n\nfunction prepareOnDown ({ interaction, pointer, event, eventTarget }: Interact.SignalArgs['interactions:down'], scope: Interact.Scope) {\n if (interaction.interacting()) { return }\n\n const actionInfo = getActionInfo(interaction, pointer, event, eventTarget, scope)\n prepare(interaction, actionInfo, scope)\n}\n\nfunction prepareOnMove ({ interaction, pointer, event, eventTarget }: Interact.SignalArgs['interactions:move'], scope: Interact.Scope) {\n if (interaction.pointerType !== 'mouse' ||\n interaction.pointerIsDown ||\n interaction.interacting()) { return }\n\n const actionInfo = getActionInfo(interaction, pointer, event, eventTarget as Interact.Element, scope)\n prepare(interaction, actionInfo, scope)\n}\n\nfunction startOnMove (arg: Interact.SignalArgs['interactions:move'], scope: Interact.Scope) {\n const { interaction } = arg\n\n if (!interaction.pointerIsDown ||\n interaction.interacting() ||\n !interaction.pointerWasMoved ||\n !interaction.prepared.name) {\n return\n }\n\n scope.fire('autoStart:before-start', arg)\n\n const { interactable } = interaction\n const actionName = interaction.prepared.name\n\n if (actionName && interactable) {\n // check manualStart and interaction limit\n if (interactable.options[actionName].manualStart ||\n !withinInteractionLimit(interactable, interaction.element, interaction.prepared, scope)) {\n interaction.stop()\n }\n else {\n interaction.start(interaction.prepared, interactable, interaction.element)\n setInteractionCursor(interaction, scope)\n }\n }\n}\n\nfunction clearCursorOnStop ({ interaction }: { interaction: Interact.Interaction }, scope: Interact.Scope) {\n const { interactable } = interaction\n\n if (interactable && interactable.options.styleCursor) {\n setCursor(interaction.element, '', scope)\n }\n}\n\n// Check if the current interactable supports the action.\n// If so, return the validated action. Otherwise, return null\nfunction validateAction (\n action: Interact.ActionProps,\n interactable: Interact.Interactable,\n element: Interact.Element,\n eventTarget: Interact.EventTarget,\n scope: Interact.Scope,\n) {\n if (interactable.testIgnoreAllow(interactable.options[action.name], element, eventTarget) &&\n interactable.options[action.name].enabled &&\n withinInteractionLimit(interactable, element, action, scope)) {\n return action\n }\n\n return null\n}\n\nfunction validateMatches (\n interaction: Interact.Interaction,\n pointer: Interact.PointerType,\n event: Interact.PointerEventType,\n matches: Interact.Interactable[],\n matchElements: Interact.Element[],\n eventTarget: Interact.EventTarget,\n scope: Interact.Scope,\n) {\n for (let i = 0, len = matches.length; i < len; i++) {\n const match = matches[i]\n const matchElement = matchElements[i]\n const matchAction = match.getAction(pointer, event, interaction, matchElement)\n\n if (!matchAction) { continue }\n\n const action = validateAction(\n matchAction,\n match,\n matchElement,\n eventTarget,\n scope)\n\n if (action) {\n return {\n action,\n interactable: match,\n element: matchElement,\n }\n }\n }\n\n return { action: null, interactable: null, element: null }\n}\n\nfunction getActionInfo (\n interaction: Interact.Interaction,\n pointer: Interact.PointerType,\n event: Interact.PointerEventType,\n eventTarget: Interact.EventTarget,\n scope: Interact.Scope,\n) {\n let matches: Interact.Interactable[] = []\n let matchElements: Interact.Element[] = []\n\n let element = eventTarget as Interact.Element\n\n function pushMatches (interactable: Interact.Interactable) {\n matches.push(interactable)\n matchElements.push(element)\n }\n\n while (is.element(element)) {\n matches = []\n matchElements = []\n\n scope.interactables.forEachMatch(element, pushMatches)\n\n const actionInfo = validateMatches(interaction, pointer, event, matches, matchElements, eventTarget, scope)\n\n if (actionInfo.action &&\n !actionInfo.interactable.options[actionInfo.action.name].manualStart) {\n return actionInfo\n }\n\n element = domUtils.parentNode(element) as Interact.Element\n }\n\n return { action: null, interactable: null, element: null }\n}\n\nfunction prepare (\n interaction: Interact.Interaction,\n { action, interactable, element }: {\n action: Interact.ActionProps\n interactable: Interact.Interactable\n element: Interact.Element\n },\n scope: Interact.Scope,\n) {\n action = action || { name: null }\n\n interaction.interactable = interactable\n interaction.element = element\n copyAction(interaction.prepared, action)\n\n interaction.rect = interactable && action.name\n ? interactable.getRect(element)\n : null\n\n setInteractionCursor(interaction, scope)\n\n scope.fire('autoStart:prepared', { interaction })\n}\n\nfunction withinInteractionLimit (\n interactable: Interact.Interactable,\n element: Interact.Element,\n action: Interact.ActionProps,\n scope: Interact.Scope,\n) {\n const options = interactable.options\n const maxActions = options[action.name].max\n const maxPerElement = options[action.name].maxPerElement\n const autoStartMax = scope.autoStart.maxInteractions\n let activeInteractions = 0\n let interactableCount = 0\n let elementCount = 0\n\n // no actions if any of these values == 0\n if (!(maxActions && maxPerElement && autoStartMax)) { return false }\n\n for (const interaction of scope.interactions.list) {\n const otherAction = interaction.prepared.name\n\n if (!interaction.interacting()) { continue }\n\n activeInteractions++\n\n if (activeInteractions >= autoStartMax) {\n return false\n }\n\n if (interaction.interactable !== interactable) { continue }\n\n interactableCount += otherAction === action.name ? 1 : 0\n\n if (interactableCount >= maxActions) {\n return false\n }\n\n if (interaction.element === element) {\n elementCount++\n\n if (otherAction === action.name && elementCount >= maxPerElement) {\n return false\n }\n }\n }\n\n return autoStartMax > 0\n}\n\nfunction maxInteractions (newValue: any, scope: Interact.Scope) {\n if (is.number(newValue)) {\n scope.autoStart.maxInteractions = newValue\n\n return this\n }\n\n return scope.autoStart.maxInteractions\n}\n\nfunction setCursor (element: Interact.Element, cursor: string, scope: Interact.Scope) {\n const { cursorElement: prevCursorElement } = scope.autoStart\n\n if (prevCursorElement && prevCursorElement !== element) {\n prevCursorElement.style.cursor = ''\n }\n\n element.ownerDocument.documentElement.style.cursor = cursor\n element.style.cursor = cursor\n scope.autoStart.cursorElement = cursor ? element : null\n}\n\nfunction setInteractionCursor (interaction: Interact.Interaction, scope: Interact.Scope) {\n const { interactable, element, prepared } = interaction\n\n if (!(interaction.pointerType === 'mouse' && interactable && interactable.options.styleCursor)) {\n // clear previous target element cursor\n if (scope.autoStart.cursorElement) {\n setCursor(scope.autoStart.cursorElement, '', scope)\n }\n\n return\n }\n\n let cursor = ''\n\n if (prepared.name) {\n const cursorChecker: Interact.CursorChecker = interactable.options[prepared.name].cursorChecker\n\n if (is.func(cursorChecker)) {\n cursor = cursorChecker(prepared, interactable, element, interaction._interacting)\n }\n else {\n cursor = scope.actions.map[prepared.name].getCursor(prepared)\n }\n }\n\n setCursor(interaction.element, cursor || '', scope)\n}\n\nconst autoStart: Interact.Plugin = {\n id: 'auto-start/base',\n before: ['actions'],\n install,\n listeners: {\n 'interactions:down': prepareOnDown,\n 'interactions:move': (arg, scope) => {\n prepareOnMove(arg, scope)\n startOnMove(arg, scope)\n },\n 'interactions:stop': clearCursorOnStop,\n },\n maxInteractions,\n withinInteractionLimit,\n validateAction,\n} as Interact.Plugin\n\nexport default autoStart\n","import * as Interact from '@interactjs/types/index'\nimport { parentNode } from '@interactjs/utils/domUtils'\nimport is from '@interactjs/utils/is'\n\nimport autoStart from './base'\n\nfunction beforeStart ({ interaction, eventTarget, dx, dy }: Interact.SignalArgs['interactions:move'], scope: Interact.Scope) {\n if (interaction.prepared.name !== 'drag') { return }\n\n // check if a drag is in the correct axis\n const absX = Math.abs(dx)\n const absY = Math.abs(dy)\n const targetOptions = interaction.interactable.options.drag\n const startAxis = targetOptions.startAxis\n const currentAxis = (absX > absY ? 'x' : absX < absY ? 'y' : 'xy')\n\n interaction.prepared.axis = targetOptions.lockAxis === 'start'\n ? currentAxis[0] as 'x' | 'y' // always lock to one axis even if currentAxis === 'xy'\n : targetOptions.lockAxis\n\n // if the movement isn't in the startAxis of the interactable\n if (currentAxis !== 'xy' && startAxis !== 'xy' && startAxis !== currentAxis) {\n // cancel the prepared action\n interaction.prepared.name = null\n\n // then try to get a drag from another ineractable\n let element = eventTarget as Interact.Element\n\n const getDraggable = function (interactable: Interact.Interactable): Interact.Interactable | void {\n if (interactable === interaction.interactable) { return }\n\n const options = interaction.interactable.options.drag\n\n if (!options.manualStart &&\n interactable.testIgnoreAllow(options, element, eventTarget)) {\n const action = interactable.getAction(\n interaction.downPointer, interaction.downEvent, interaction, element)\n\n if (action &&\n action.name === 'drag' &&\n checkStartAxis(currentAxis, interactable) &&\n autoStart.validateAction(action, interactable, element, eventTarget, scope)) {\n return interactable\n }\n }\n }\n\n // check all interactables\n while (is.element(element)) {\n const interactable = scope.interactables.forEachMatch(element, getDraggable)\n\n if (interactable) {\n interaction.prepared.name = 'drag'\n interaction.interactable = interactable\n interaction.element = element\n break\n }\n\n element = parentNode(element) as Interact.Element\n }\n }\n}\n\nfunction checkStartAxis (startAxis: string, interactable: Interact.Interactable) {\n if (!interactable) { return false }\n\n const thisAxis = interactable.options.drag.startAxis\n\n return (startAxis === 'xy' || thisAxis === 'xy' || thisAxis === startAxis)\n}\n\nexport default {\n id: 'auto-start/dragAxis',\n listeners: { 'autoStart:before-start': beforeStart },\n}\n","import * as Interact from '@interactjs/types/index'\n\nimport basePlugin from './base'\n\ndeclare module '@interactjs/core/defaultOptions' {\n interface PerActionDefaults {\n hold?: number\n delay?: number\n }\n}\n\ndeclare module '@interactjs/core/Interaction' {\n interface Interaction {\n autoStartHoldTimer?: any\n }\n}\n\nfunction install (scope: Interact.Scope) {\n const {\n defaults,\n } = scope\n\n scope.usePlugin(basePlugin)\n\n defaults.perAction.hold = 0\n defaults.perAction.delay = 0\n}\n\nfunction getHoldDuration (interaction) {\n const actionName = interaction.prepared && interaction.prepared.name\n\n if (!actionName) { return null }\n\n const options = interaction.interactable.options\n\n return options[actionName].hold || options[actionName].delay\n}\n\nexport default {\n id: 'auto-start/hold',\n install,\n listeners: {\n 'interactions:new': ({ interaction }) => {\n interaction.autoStartHoldTimer = null\n },\n\n 'autoStart:prepared': ({ interaction }) => {\n const hold = getHoldDuration(interaction)\n\n if (hold > 0) {\n interaction.autoStartHoldTimer = setTimeout(() => {\n interaction.start(interaction.prepared, interaction.interactable, interaction.element)\n }, hold)\n }\n },\n\n 'interactions:move': ({ interaction, duplicate }) => {\n if (interaction.pointerWasMoved && !duplicate) {\n clearTimeout(interaction.autoStartHoldTimer)\n }\n },\n\n // prevent regular down->move autoStart\n 'autoStart:before-start': ({ interaction }) => {\n const hold = getHoldDuration(interaction)\n\n if (hold > 0) {\n interaction.prepared.name = null\n }\n },\n },\n getHoldDuration,\n}\n","import * as Interact from '@interactjs/types/index'\n\nimport autoStart from './base'\nimport dragAxis from './dragAxis'\nimport hold from './hold'\n\nexport default {\n id: 'auto-start',\n install (scope: Interact.Scope) {\n scope.usePlugin(autoStart)\n scope.usePlugin(hold)\n scope.usePlugin(dragAxis)\n },\n}\n","export default {}\n","import * as Interact from '@interactjs/types/index'\nimport { matchesSelector, nodeContains } from '@interactjs/utils/domUtils'\nimport is from '@interactjs/utils/is'\nimport { getWindow } from '@interactjs/utils/window'\n\ndeclare module '@interactjs/core/Interactable' {\n interface Interactable {\n preventDefault: typeof preventDefault\n checkAndPreventDefault: (event: Event) => void\n }\n}\n\ntype PreventDefaultValue = 'always' | 'never' | 'auto'\nfunction preventDefault (this: Interact.Interactable): PreventDefaultValue\nfunction preventDefault (this: Interact.Interactable, newValue: PreventDefaultValue): typeof this\nfunction preventDefault (this: Interact.Interactable, newValue?: PreventDefaultValue) {\n if (/^(always|never|auto)$/.test(newValue)) {\n this.options.preventDefault = newValue\n return this\n }\n\n if (is.bool(newValue)) {\n this.options.preventDefault = newValue ? 'always' : 'never'\n return this\n }\n\n return this.options.preventDefault\n}\n\nfunction checkAndPreventDefault (interactable: Interact.Interactable, scope: Interact.Scope, event: Event) {\n const setting = interactable.options.preventDefault\n\n if (setting === 'never') { return }\n\n if (setting === 'always') {\n event.preventDefault()\n return\n }\n\n // setting === 'auto'\n\n // if the browser supports passive event listeners and isn't running on iOS,\n // don't preventDefault of touch{start,move} events. CSS touch-action and\n // user-select should be used instead of calling event.preventDefault().\n if (scope.events.supportsPassive && /^touch(start|move)$/.test(event.type)) {\n const doc = getWindow(event.target).document\n const docOptions = scope.getDocOptions(doc)\n\n if (!(docOptions && docOptions.events) || docOptions.events.passive !== false) {\n return\n }\n }\n\n // don't preventDefault of pointerdown events\n if (/^(mouse|pointer|touch)*(down|start)/i.test(event.type)) {\n return\n }\n\n // don't preventDefault on editable elements\n if (is.element(event.target) &&\n matchesSelector(event.target, 'input,select,textarea,[contenteditable=true],[contenteditable=true] *')) {\n return\n }\n\n event.preventDefault()\n}\n\nfunction onInteractionEvent ({ interaction, event }: { interaction: Interact.Interaction, event: Interact.PointerEventType }) {\n if (interaction.interactable) {\n interaction.interactable.checkAndPreventDefault(event as Event)\n }\n}\n\nexport function install (scope: Interact.Scope) {\n /** @lends Interactable */\n const { Interactable } = scope\n\n /**\n * Returns or sets whether to prevent the browser's default behaviour in\n * response to pointer events. Can be set to:\n * - `'always'` to always prevent\n * - `'never'` to never prevent\n * - `'auto'` to let interact.js try to determine what would be best\n *\n * @param {string} [newValue] `'always'`, `'never'` or `'auto'`\n * @return {string | Interactable} The current setting or this Interactable\n */\n Interactable.prototype.preventDefault = preventDefault\n\n Interactable.prototype.checkAndPreventDefault = function (event) {\n return checkAndPreventDefault(this, scope, event)\n }\n\n // prevent native HTML5 drag on interact.js target elements\n scope.interactions.docEvents.push({\n type: 'dragstart',\n listener (event) {\n for (const interaction of scope.interactions.list) {\n if (interaction.element &&\n (interaction.element === event.target ||\n nodeContains(interaction.element, event.target))) {\n interaction.interactable.checkAndPreventDefault(event)\n return\n }\n }\n },\n })\n}\n\nexport default {\n id: 'core/interactablePreventDefault',\n install,\n listeners: ['down', 'move', 'up', 'cancel'].reduce((acc, eventType) => {\n acc[`interactions:${eventType}`] = onInteractionEvent\n return acc\n }, {} as any),\n}\n","/* eslint-disable no-console */\nimport * as Interact from '@interactjs/types/index'\nimport domObjects from '@interactjs/utils/domObjects'\nimport { parentNode } from '@interactjs/utils/domUtils'\nimport extend from '@interactjs/utils/extend'\nimport is from '@interactjs/utils/is'\nimport win from '@interactjs/utils/window'\n\nimport visualizer from './visualizer/plugin'\n\ndeclare module '@interactjs/core/scope' {\n interface Scope {\n logger: Logger\n }\n}\n\ndeclare module '@interactjs/core/interactStatic' {\n export interface InteractStatic {\n visializer: typeof visualizer\n }\n}\n\ndeclare module '@interactjs/core/defaultOptions' {\n interface BaseDefaults {\n devTools?: DevToolsOptions\n }\n}\n\ndeclare module '@interactjs/core/Interactable' {\n interface Interactable {\n devTools: Interact.OptionMethod\n }\n}\n\nexport interface DevToolsOptions {\n ignore: { [P in keyof typeof CheckName]?: boolean }\n}\n\nexport interface Logger {\n warn: (...args: any[]) => void\n error: (...args: any[]) => void\n log: (...args: any[]) => void\n}\n\nexport interface Check {\n name: CheckName\n text: string\n perform: (interaction: Interact.Interaction) => boolean\n getInfo: (interaction: Interact.Interaction) => any[]\n}\n\nenum CheckName {\n touchAction = 'touchAction',\n boxSizing = 'boxSizing',\n noListeners = 'noListeners',\n}\n\nconst prefix = '[interact.js] '\nconst links = {\n touchAction: 'https://developer.mozilla.org/en-US/docs/Web/CSS/touch-action',\n boxSizing: 'https://developer.mozilla.org/en-US/docs/Web/CSS/box-sizing',\n}\n\n// eslint-disable-next-line no-undef\nconst isProduction = process.env.NODE_ENV === 'production'\n\n// eslint-disable-next-line no-restricted-syntax\nfunction install (scope: Interact.Scope, { logger }: { logger?: Logger } = {}) {\n const {\n Interactable,\n defaults,\n } = scope\n\n scope.logger = logger || console\n\n defaults.base.devTools = {\n ignore: {},\n }\n\n Interactable.prototype.devTools = function (options?: object) {\n if (options) {\n extend(this.options.devTools, options)\n return this\n }\n\n return this.options.devTools\n }\n}\n\nconst checks: Check[] = [\n {\n name: CheckName.touchAction,\n perform ({ element }) {\n return !parentHasStyle(element, 'touchAction', /pan-|pinch|none/)\n },\n getInfo ({ element }) {\n return [\n element,\n links.touchAction,\n ]\n },\n text: 'Consider adding CSS \"touch-action: none\" to this element\\n',\n },\n\n {\n name: CheckName.boxSizing,\n perform (interaction) {\n const { element } = interaction\n\n return interaction.prepared.name === 'resize' &&\n element instanceof domObjects.HTMLElement &&\n !hasStyle(element, 'boxSizing', /border-box/)\n },\n text: 'Consider adding CSS \"box-sizing: border-box\" to this resizable element',\n getInfo ({ element }) {\n return [\n element,\n links.boxSizing,\n ]\n },\n },\n\n {\n name: CheckName.noListeners,\n perform (interaction) {\n const actionName = interaction.prepared.name\n const moveListeners = interaction.interactable.events.types[`${actionName}move`] || []\n\n return !moveListeners.length\n },\n getInfo (interaction) {\n return [\n interaction.prepared.name,\n interaction.interactable,\n ]\n },\n text: 'There are no listeners set for this action',\n },\n]\n\nfunction hasStyle (element: HTMLElement, prop: keyof CSSStyleDeclaration, styleRe: RegExp) {\n const value = element.style[prop] || win.window.getComputedStyle(element)[prop]\n return styleRe.test((value || '').toString())\n}\n\nfunction parentHasStyle (element: Interact.Element, prop: keyof CSSStyleDeclaration, styleRe: RegExp) {\n let parent = element as HTMLElement\n\n while (is.element(parent)) {\n if (hasStyle(parent, prop, styleRe)) {\n return true\n }\n\n parent = parentNode(parent) as HTMLElement\n }\n\n return false\n}\n\nconst id = 'dev-tools'\nconst defaultExport: Interact.Plugin = isProduction\n ? { id, install: () => {} }\n : {\n id,\n install,\n listeners: {\n 'interactions:action-start': ({ interaction }, scope) => {\n for (const check of checks) {\n const options = interaction.interactable && interaction.interactable.options\n\n if (\n !(options && options.devTools && options.devTools.ignore[check.name]) &&\n check.perform(interaction)\n ) {\n scope.logger.warn(prefix + check.text, ...check.getInfo(interaction))\n }\n }\n },\n },\n checks,\n CheckName,\n links,\n prefix,\n }\n\nexport default defaultExport\n","import * as arr from './arr'\nimport is from './is'\n\n// tslint:disable-next-line ban-types\nexport default function clone (source: T): Partial {\n const dest = {} as Partial\n\n for (const prop in source) {\n const value = source[prop]\n\n if (is.plainObject(value)) {\n dest[prop] = clone(value) as any\n }\n else if (is.array(value)) {\n dest[prop] = arr.from(value) as typeof value\n }\n else {\n dest[prop] = value\n }\n }\n\n return dest\n}\n","import * as Interact from '@interactjs/types/index'\nimport clone from '@interactjs/utils/clone'\nimport extend from '@interactjs/utils/extend'\nimport * as rectUtils from '@interactjs/utils/rect'\n\nimport { Modifier, ModifierArg, ModifierState } from './base'\n\nexport interface ModificationResult {\n delta: Interact.Point\n rectDelta: Interact.Rect\n coords: Interact.Point\n rect: Interact.FullRect\n eventProps: any[]\n changed: boolean\n}\n\ninterface MethodArg {\n phase: Interact.EventPhase\n pageCoords?: Interact.Point\n rect?: Interact.FullRect\n coords?: Interact.Point\n preEnd?: boolean\n skipModifiers?: number\n}\n\nexport default class Modification {\n states: ModifierState[] = []\n startOffset: Interact.Rect = { left: 0, right: 0, top: 0, bottom: 0 }\n startDelta: Interact.Point = null\n result?: ModificationResult = null\n endResult?: Interact.Point = null\n edges: Interact.EdgeOptions\n readonly interaction: Readonly\n\n constructor (interaction: Interact.Interaction) {\n this.interaction = interaction\n this.result = createResult()\n }\n\n start (\n { phase }: MethodArg,\n pageCoords: Interact.Point,\n ) {\n const { interaction } = this\n const modifierList = getModifierList(interaction)\n this.prepareStates(modifierList)\n\n this.edges = extend({}, interaction.edges)\n this.startOffset = getRectOffset(interaction.rect, pageCoords)\n this.startDelta = { x: 0, y: 0 }\n\n const arg: MethodArg = {\n phase,\n pageCoords,\n preEnd: false,\n }\n\n this.result = createResult()\n this.startAll(arg)\n\n const result = this.result = this.setAll(arg)\n\n return result\n }\n\n fillArg (arg: Partial) {\n const { interaction } = this\n\n arg.interaction = interaction\n arg.interactable = interaction.interactable\n arg.element = interaction.element\n arg.rect = arg.rect || interaction.rect\n arg.edges = this.edges\n arg.startOffset = this.startOffset\n }\n\n startAll (arg: MethodArg & Partial) {\n this.fillArg(arg)\n\n for (const state of this.states) {\n if (state.methods.start) {\n arg.state = state\n state.methods.start(arg as ModifierArg)\n }\n }\n }\n\n setAll (arg: MethodArg & Partial): ModificationResult {\n this.fillArg(arg)\n\n const {\n phase,\n preEnd,\n skipModifiers,\n rect: unmodifiedRect,\n } = arg\n\n arg.coords = extend({}, arg.pageCoords)\n arg.rect = extend({}, unmodifiedRect)\n\n const states = skipModifiers\n ? this.states.slice(skipModifiers)\n : this.states\n\n const newResult = createResult(arg.coords, arg.rect)\n\n for (const state of states) {\n const { options } = state\n const lastModifierCoords = extend({}, arg.coords)\n let returnValue = null\n\n if (state.methods.set && this.shouldDo(options, preEnd, phase)) {\n arg.state = state\n returnValue = state.methods.set(arg as ModifierArg)\n\n rectUtils.addEdges(this.interaction.edges, arg.rect, { x: arg.coords.x - lastModifierCoords.x, y: arg.coords.y - lastModifierCoords.y })\n }\n\n newResult.eventProps.push(returnValue)\n }\n\n newResult.delta.x = arg.coords.x - arg.pageCoords.x\n newResult.delta.y = arg.coords.y - arg.pageCoords.y\n\n newResult.rectDelta.left = arg.rect.left - unmodifiedRect.left\n newResult.rectDelta.right = arg.rect.right - unmodifiedRect.right\n newResult.rectDelta.top = arg.rect.top - unmodifiedRect.top\n newResult.rectDelta.bottom = arg.rect.bottom - unmodifiedRect.bottom\n\n const prevCoords = this.result.coords\n const prevRect = this.result.rect\n\n if (prevCoords && prevRect) {\n const rectChanged = newResult.rect.left !== prevRect.left ||\n newResult.rect.right !== prevRect.right ||\n newResult.rect.top !== prevRect.top ||\n newResult.rect.bottom !== prevRect.bottom\n\n newResult.changed = rectChanged ||\n prevCoords.x !== newResult.coords.x ||\n prevCoords.y !== newResult.coords.y\n }\n\n return newResult\n }\n\n applyToInteraction (arg: { phase: Interact.EventPhase, rect?: Interact.Rect }) {\n const { interaction } = this\n const { phase } = arg\n const curCoords = interaction.coords.cur\n const startCoords = interaction.coords.start\n const { result, startDelta } = this\n const curDelta = result.delta\n\n if (phase === 'start') {\n extend(this.startDelta, result.delta)\n }\n\n for (const [coordsSet, delta] of [[startCoords, startDelta], [curCoords, curDelta]] as const) {\n coordsSet.page.x += delta.x\n coordsSet.page.y += delta.y\n coordsSet.client.x += delta.x\n coordsSet.client.y += delta.y\n }\n\n const { rectDelta } = this.result\n const rect = arg.rect || interaction.rect\n\n rect.left += rectDelta.left\n rect.right += rectDelta.right\n rect.top += rectDelta.top\n rect.bottom += rectDelta.bottom\n\n rect.width = rect.right - rect.left\n rect.height = rect.bottom - rect.top\n }\n\n setAndApply (arg: Partial & {\n phase: Interact.EventPhase\n preEnd?: boolean\n skipModifiers?: number\n modifiedCoords?: Interact.Point\n }): void | false {\n const { interaction } = this\n const { phase, preEnd, skipModifiers } = arg\n\n const result = this.setAll({\n preEnd,\n phase,\n pageCoords: arg.modifiedCoords || interaction.coords.cur.page,\n })\n\n this.result = result\n\n // don't fire an action move if a modifier would keep the event in the same\n // cordinates as before\n if (!result.changed && (!skipModifiers || skipModifiers < this.states.length) && interaction.interacting()) {\n return false\n }\n\n if (arg.modifiedCoords) {\n const { page } = interaction.coords.cur\n const adjustment = {\n x: arg.modifiedCoords.x - page.x,\n y: arg.modifiedCoords.y - page.y,\n }\n\n result.coords.x += adjustment.x\n result.coords.y += adjustment.y\n result.delta.x += adjustment.x\n result.delta.y += adjustment.y\n }\n\n this.applyToInteraction(arg)\n }\n\n beforeEnd (arg: Omit & { state?: ModifierState }): void | false {\n const { interaction, event } = arg\n const states = this.states\n\n if (!states || !states.length) {\n return\n }\n\n let doPreend = false\n\n for (const state of states) {\n arg.state = state\n const { options, methods } = state\n\n const endPosition = methods.beforeEnd && methods.beforeEnd(arg as unknown as ModifierArg)\n\n if (endPosition) {\n this.endResult = endPosition\n return false\n }\n\n doPreend = doPreend || (!doPreend && this.shouldDo(options, true, arg.phase, true))\n }\n\n if (doPreend) {\n // trigger a final modified move before ending\n interaction.move({ event, preEnd: true })\n }\n }\n\n stop (arg: { interaction: Interact.Interaction }) {\n const { interaction } = arg\n\n if (!this.states || !this.states.length) {\n return\n }\n\n const modifierArg: Partial = extend({\n states: this.states,\n interactable: interaction.interactable,\n element: interaction.element,\n rect: null,\n }, arg)\n\n this.fillArg(modifierArg)\n\n for (const state of this.states) {\n modifierArg.state = state\n\n if (state.methods.stop) { state.methods.stop(modifierArg as ModifierArg) }\n }\n\n this.states = null\n this.endResult = null\n }\n\n prepareStates (modifierList: Modifier[]) {\n this.states = []\n\n for (let index = 0; index < modifierList.length; index++) {\n const { options, methods, name } = modifierList[index]\n\n this.states.push({\n options,\n methods,\n index,\n name,\n })\n }\n\n return this.states\n }\n\n restoreInteractionCoords ({ interaction: { coords, rect, modification } }: { interaction: Interact.Interaction }) {\n if (!modification.result) { return }\n\n const { startDelta } = modification\n const { delta: curDelta, rectDelta } = modification.result\n\n const coordsAndDeltas = [\n [coords.start, startDelta],\n [coords.cur, curDelta],\n ]\n\n for (const [coordsSet, delta] of coordsAndDeltas as any) {\n coordsSet.page.x -= delta.x\n coordsSet.page.y -= delta.y\n coordsSet.client.x -= delta.x\n coordsSet.client.y -= delta.y\n }\n\n rect.left -= rectDelta.left\n rect.right -= rectDelta.right\n rect.top -= rectDelta.top\n rect.bottom -= rectDelta.bottom\n }\n\n shouldDo (options, preEnd?: boolean, phase?: string, requireEndOnly?: boolean) {\n if (\n // ignore disabled modifiers\n (!options || options.enabled === false) ||\n // check if we require endOnly option to fire move before end\n (requireEndOnly && !options.endOnly) ||\n // don't apply endOnly modifiers when not ending\n (options.endOnly && !preEnd) ||\n // check if modifier should run be applied on start\n (phase === 'start' && !options.setStart)\n ) {\n return false\n }\n\n return true\n }\n\n copyFrom (other: Modification) {\n this.startOffset = other.startOffset\n this.startDelta = other.startDelta\n this.edges = other.edges\n this.states = other.states.map(s => clone(s) as ModifierState)\n this.result = createResult(extend({}, other.result.coords), extend({}, other.result.rect))\n }\n\n destroy () {\n for (const prop in this) {\n this[prop] = null\n }\n }\n}\n\nfunction createResult (coords?: Interact.Point, rect?: Interact.FullRect): ModificationResult {\n return {\n rect,\n coords,\n delta: { x: 0, y: 0 },\n rectDelta: {\n left : 0,\n right : 0,\n top : 0,\n bottom: 0,\n },\n eventProps: [],\n changed: true,\n }\n}\n\nfunction getModifierList (interaction) {\n const actionOptions = interaction.interactable.options[interaction.prepared.name]\n const actionModifiers = actionOptions.modifiers\n\n if (actionModifiers && actionModifiers.length) {\n return actionModifiers\n }\n\n return ['snap', 'snapSize', 'snapEdges', 'restrict', 'restrictEdges', 'restrictSize']\n .map(type => {\n const options = actionOptions[type]\n\n return options && options.enabled && {\n options,\n methods: options._methods,\n }\n })\n .filter(m => !!m)\n}\n\nexport function getRectOffset (rect, coords) {\n return rect\n ? {\n left : coords.x - rect.left,\n top : coords.y - rect.top,\n right : rect.right - coords.x,\n bottom: rect.bottom - coords.y,\n }\n : {\n left : 0,\n top : 0,\n right : 0,\n bottom: 0,\n }\n}\n","import * as Interact from '@interactjs/types/index'\n\nimport Modification from './Modification'\n\ndeclare module '@interactjs/core/Interaction' {\n interface Interaction {\n modification?: Modification\n }\n}\n\ndeclare module '@interactjs/core/InteractEvent' {\n interface InteractEvent {\n modifiers?: Array<{\n name: string\n [key: string]: any\n }>\n }\n}\n\ndeclare module '@interactjs/core/defaultOptions' {\n interface PerActionDefaults {\n modifiers?: Modifier[]\n }\n}\n\nexport interface Modifier<\n Defaults = any,\n State extends ModifierState = any,\n Name extends string = any\n> {\n options?: Defaults\n methods: {\n start?: (arg: ModifierArg) => void\n set: (arg: ModifierArg) => void\n beforeEnd?: (arg: ModifierArg) => Interact.Point | void\n stop?: (arg: ModifierArg) => void\n }\n name?: Name\n enable: () => Modifier\n disable: () => Modifier\n}\n\nexport type ModifierState<\n Defaults = {},\n StateProps extends { [prop: string]: any } = {},\n Name extends string = any\n> = {\n options: Defaults\n methods?: Modifier['methods']\n index?: number\n name?: Name\n} & StateProps\n\nexport interface ModifierArg {\n interaction: Interact.Interaction\n interactable: Interact.Interactable\n phase: Interact.EventPhase\n rect: Interact.FullRect\n edges: Interact.EdgeOptions\n state?: State\n element: Interact.Element\n pageCoords?: Interact.Point\n prevCoords?: Interact.Point\n prevRect?: Interact.FullRect\n coords?: Interact.Point\n startOffset?: Interact.Rect\n preEnd?: boolean\n}\n\nexport interface ModifierModule<\n Defaults extends { enabled?: boolean },\n State extends ModifierState,\n> {\n defaults?: Defaults\n start? (arg: ModifierArg): void\n set? (arg: ModifierArg): any\n beforeEnd? (arg: ModifierArg): Interact.Point | void\n stop? (arg: ModifierArg): void\n}\n\nexport interface ModifierFunction <\n Defaults extends { enabled?: boolean },\n State extends ModifierState,\n Name extends string,\n> {\n (_options?: Partial): Modifier\n _defaults: Defaults\n _methods: ModifierModule\n}\n\nexport function makeModifier<\n Defaults extends { enabled?: boolean },\n State extends ModifierState,\n Name extends string\n> (\n module: ModifierModule,\n name?: Name,\n) {\n const { defaults } = module\n const methods = {\n start: module.start,\n set: module.set,\n beforeEnd: module.beforeEnd,\n stop: module.stop,\n }\n\n const modifier = (_options?: Partial) => {\n const options: Defaults = (_options || {}) as Defaults\n\n options.enabled = options.enabled !== false\n\n // add missing defaults to options\n for (const prop in defaults) {\n if (!(prop in options)) {\n options[prop] = defaults[prop]\n }\n }\n\n const m: Modifier = {\n options,\n methods,\n name,\n enable: () => {\n options.enabled = true\n return m\n },\n disable: () => {\n options.enabled = false\n return m\n },\n }\n\n return m\n }\n\n if (name && typeof name === 'string') {\n // for backwrads compatibility\n modifier._defaults = defaults\n modifier._methods = methods\n }\n\n return modifier\n}\n\nexport function addEventModifiers ({ iEvent, interaction: { modification: { result } } }: {\n iEvent: Interact.InteractEvent\n interaction: Interact.Interaction\n}) {\n if (result) {\n iEvent.modifiers = result.eventProps\n }\n}\n\nconst modifiersBase: Interact.Plugin = {\n id: 'modifiers/base',\n install: scope => {\n scope.defaults.perAction.modifiers = []\n },\n listeners: {\n 'interactions:new': ({ interaction }) => {\n interaction.modification = new Modification(interaction)\n },\n\n 'interactions:before-action-start': arg => {\n const { modification } = arg.interaction\n\n modification.start(arg, arg.interaction.coords.start.page)\n arg.interaction.edges = modification.edges\n modification.applyToInteraction(arg)\n },\n\n 'interactions:before-action-move': arg => arg.interaction.modification.setAndApply(arg),\n\n 'interactions:before-action-end': arg => arg.interaction.modification.beforeEnd(arg),\n\n 'interactions:action-start': addEventModifiers,\n 'interactions:action-move': addEventModifiers,\n 'interactions:action-end': addEventModifiers,\n\n 'interactions:after-action-start': arg => arg.interaction.modification.restoreInteractionCoords(arg),\n 'interactions:after-action-move': arg => arg.interaction.modification.restoreInteractionCoords(arg),\n\n 'interactions:stop': arg => arg.interaction.modification.stop(arg),\n },\n before: ['actions'],\n}\n\nexport default modifiersBase\n","import * as Interact from '@interactjs/types/index'\n\nexport interface Defaults {\n base: BaseDefaults\n perAction: PerActionDefaults\n actions: ActionDefaults\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface ActionDefaults {\n}\n\nexport interface BaseDefaults {\n preventDefault?: 'auto' | 'never' | string\n deltaSource?: 'page' | 'client'\n context?: Node\n}\n\nexport interface PerActionDefaults {\n enabled?: boolean\n origin?: Interact.Point | string | Interact.Element\n listeners?: Interact.Listeners\n allowFrom?: string | Interact.Element\n ignoreFrom?: string | Interact.Element\n}\n\nexport type Options = Partial & Partial & {\n [P in keyof ActionDefaults]?: Partial\n}\n\n// export interface Options extends BaseDefaults, PerActionDefaults {}\n\nexport interface OptionsArg extends BaseDefaults, Interact.OrBoolean> {}\n\nexport const defaults: Defaults = {\n base: {\n preventDefault: 'auto',\n deltaSource: 'page',\n },\n\n perAction: {\n enabled: false,\n origin: { x: 0, y: 0 },\n },\n\n actions: {} as ActionDefaults,\n}\n","import * as Interact from '@interactjs/types/index'\nimport extend from '@interactjs/utils/extend'\nimport getOriginXY from '@interactjs/utils/getOriginXY'\nimport hypot from '@interactjs/utils/hypot'\n\nimport { BaseEvent } from './BaseEvent'\nimport { Interaction } from './Interaction'\nimport { defaults } from './defaultOptions'\n\nexport type EventPhase = keyof PhaseMap\n\nexport interface PhaseMap {\n start: true\n move: true\n end: true\n}\n\n// defined outside of class definition to avoid assignment of undefined during\n// construction\nexport interface InteractEvent {\n pageX: number\n pageY: number\n\n clientX: number\n clientY: number\n\n dx: number\n dy: number\n\n velocityX: number\n velocityY: number\n}\n\nexport class InteractEvent<\n T extends Interact.ActionName = never,\n P extends EventPhase = EventPhase,\n> extends BaseEvent {\n target: Interact.Element\n currentTarget: Interact.Element\n relatedTarget: null = null\n screenX?: number\n screenY?: number\n button: number\n buttons: number\n ctrlKey: boolean\n shiftKey: boolean\n altKey: boolean\n metaKey: boolean\n page: Interact.Point\n client: Interact.Point\n delta: Interact.Point\n rect: Interact.FullRect\n x0: number\n y0: number\n t0: number\n dt: number\n duration: number\n clientX0: number\n clientY0: number\n velocity: Interact.Point\n speed: number\n swipe: ReturnType['getSwipe']>\n timeStamp: any\n // drag\n dragEnter?: Interact.Element\n dragLeave?: Interact.Element\n // resize\n axes?: 'x' | 'y' | 'xy'\n preEnd?: boolean\n\n /** */\n constructor (\n interaction: Interaction,\n event: Interact.PointerEventType,\n actionName: T,\n phase: P,\n element: Interact.Element,\n preEnd?: boolean,\n type?: string,\n ) {\n super(interaction)\n\n element = element || interaction.element\n\n const target = interaction.interactable\n const deltaSource = (((target && target.options) || defaults) as any).deltaSource as 'page' | 'client'\n const origin = getOriginXY(target, element, actionName)\n const starting = phase === 'start'\n const ending = phase === 'end'\n const prevEvent = starting ? this : interaction.prevEvent\n const coords = starting\n ? interaction.coords.start\n : ending\n ? { page: prevEvent.page, client: prevEvent.client, timeStamp: interaction.coords.cur.timeStamp }\n : interaction.coords.cur\n\n this.page = extend({}, coords.page)\n this.client = extend({}, coords.client)\n this.rect = extend({}, interaction.rect)\n this.timeStamp = coords.timeStamp\n\n if (!ending) {\n this.page.x -= origin.x\n this.page.y -= origin.y\n\n this.client.x -= origin.x\n this.client.y -= origin.y\n }\n\n this.ctrlKey = event.ctrlKey\n this.altKey = event.altKey\n this.shiftKey = event.shiftKey\n this.metaKey = event.metaKey\n this.button = (event as MouseEvent).button\n this.buttons = (event as MouseEvent).buttons\n this.target = element\n this.currentTarget = element\n this.preEnd = preEnd\n this.type = type || (actionName + (phase || ''))\n this.interactable = target\n\n this.t0 = starting\n ? interaction.pointers[interaction.pointers.length - 1].downTime\n : prevEvent.t0\n\n this.x0 = interaction.coords.start.page.x - origin.x\n this.y0 = interaction.coords.start.page.y - origin.y\n this.clientX0 = interaction.coords.start.client.x - origin.x\n this.clientY0 = interaction.coords.start.client.y - origin.y\n\n if (starting || ending) {\n this.delta = { x: 0, y: 0 }\n }\n else {\n this.delta = {\n x: this[deltaSource].x - prevEvent[deltaSource].x,\n y: this[deltaSource].y - prevEvent[deltaSource].y,\n }\n }\n\n this.dt = interaction.coords.delta.timeStamp\n this.duration = this.timeStamp - this.t0\n\n // velocity and speed in pixels per second\n this.velocity = extend({}, interaction.coords.velocity[deltaSource])\n this.speed = hypot(this.velocity.x, this.velocity.y)\n\n this.swipe = (ending || phase === 'inertiastart') ? this.getSwipe() : null\n }\n\n getSwipe () {\n const interaction = this._interaction\n\n if (interaction.prevEvent.speed < 600 ||\n this.timeStamp - interaction.prevEvent.timeStamp > 150) {\n return null\n }\n\n let angle = 180 * Math.atan2(interaction.prevEvent.velocityY, interaction.prevEvent.velocityX) / Math.PI\n const overlap = 22.5\n\n if (angle < 0) {\n angle += 360\n }\n\n const left = 135 - overlap <= angle && angle < 225 + overlap\n const up = 225 - overlap <= angle && angle < 315 + overlap\n\n const right = !left && (315 - overlap <= angle || angle < 45 + overlap)\n const down = !up && 45 - overlap <= angle && angle < 135 + overlap\n\n return {\n up,\n down,\n left,\n right,\n angle,\n speed: interaction.prevEvent.speed,\n velocity: {\n x: interaction.prevEvent.velocityX,\n y: interaction.prevEvent.velocityY,\n },\n }\n }\n\n preventDefault () {}\n\n /**\n * Don't call listeners on the remaining targets\n */\n stopImmediatePropagation () {\n this.immediatePropagationStopped = this.propagationStopped = true\n }\n\n /**\n * Don't call any other listeners (even on the current target)\n */\n stopPropagation () {\n this.propagationStopped = true\n }\n}\n\n// getters and setters defined here to support typescript 3.6 and below which\n// don't support getter and setters in .d.ts files\nObject.defineProperties(InteractEvent.prototype, {\n pageX: { get () { return this.page.x }, set (value) { this.page.x = value } },\n pageY: { get () { return this.page.y }, set (value) { this.page.y = value } },\n\n clientX: { get () { return this.client.x }, set (value) { this.client.x = value } },\n clientY: { get () { return this.client.y }, set (value) { this.client.y = value } },\n\n dx: { get () { return this.delta.x }, set (value) { this.delta.x = value } },\n dy: { get () { return this.delta.y }, set (value) { this.delta.y = value } },\n\n velocityX: { get () { return this.velocity.x }, set (value) { this.velocity.x = value } },\n velocityY: { get () { return this.velocity.y }, set (value) { this.velocity.y = value } },\n\n})\n","import * as Interact from '@interactjs/types/index'\n\nexport class PointerInfo {\n id: number\n pointer: Interact.PointerType\n event: Interact.PointerEventType\n downTime: number\n downTarget: Interact.EventTarget\n\n constructor (\n id: number,\n pointer: Interact.PointerType,\n event: Interact.PointerEventType,\n downTime: number,\n downTarget: Interact.EventTarget,\n ) {\n this.id = id\n this.pointer = pointer\n this.event = event\n this.downTime = downTime\n this.downTarget = downTarget\n }\n}\n","import * as Interact from '@interactjs/types/index'\nimport * as arr from '@interactjs/utils/arr'\nimport extend from '@interactjs/utils/extend'\nimport hypot from '@interactjs/utils/hypot'\nimport { warnOnce, copyAction } from '@interactjs/utils/misc'\nimport * as pointerUtils from '@interactjs/utils/pointerUtils'\nimport * as rectUtils from '@interactjs/utils/rect'\n\nimport { InteractEvent, EventPhase } from './InteractEvent'\nimport { Interactable } from './Interactable'\nimport { PointerInfo } from './PointerInfo'\nimport { ActionName } from './scope'\n\nexport interface ActionProps {\n name: T\n axis?: 'x' | 'y' | 'xy'\n edges?: Interact.EdgeOptions\n}\n\nexport interface StartAction extends ActionProps {\n name: ActionName\n}\n\nexport enum _ProxyValues {\n interactable = '',\n element = '',\n prepared = '',\n pointerIsDown = '',\n pointerWasMoved = '',\n _proxy = ''\n}\n\nexport enum _ProxyMethods {\n start = '',\n move = '',\n end = '',\n stop = '',\n interacting = ''\n}\n\nexport type PointerArgProps = {\n pointer: Interact.PointerType\n event: Interact.PointerEventType\n eventTarget: Interact.EventTarget\n pointerIndex: number\n pointerInfo: PointerInfo\n interaction: Interaction\n} & T\n\nexport interface DoPhaseArg {\n event: Interact.PointerEventType\n phase: EventPhase\n interaction: Interaction\n iEvent: InteractEvent\n preEnd?: boolean\n type?: string\n}\n\nexport type DoAnyPhaseArg = DoPhaseArg\n\ndeclare module '@interactjs/core/scope' {\n interface SignalArgs {\n 'interactions:new': { interaction: Interaction }\n 'interactions:down': PointerArgProps<{\n type: 'down'\n }>\n 'interactions:move': PointerArgProps<{\n type: 'move'\n dx: number\n dy: number\n duplicate: boolean\n }>\n 'interactions:up': PointerArgProps<{\n type: 'up'\n curEventTarget: EventTarget\n }>\n 'interactions:cancel': SignalArgs['interactions:up'] & {\n type: 'cancel'\n curEventTarget: EventTarget\n }\n 'interactions:update-pointer': PointerArgProps<{\n down: boolean\n }>\n 'interactions:remove-pointer': PointerArgProps\n 'interactions:blur': { interaction: Interaction, event: Event, type: 'blur' }\n 'interactions:before-action-start': Omit\n 'interactions:action-start': DoAnyPhaseArg\n 'interactions:after-action-start': DoAnyPhaseArg\n 'interactions:before-action-move': Omit\n 'interactions:action-move': DoAnyPhaseArg\n 'interactions:after-action-move': DoAnyPhaseArg\n 'interactions:before-action-end': Omit\n 'interactions:action-end': DoAnyPhaseArg\n 'interactions:after-action-end': DoAnyPhaseArg\n 'interactions:stop': { interaction: Interaction }\n }\n}\n\nexport type InteractionProxy = Pick<\nInteraction,\nkeyof typeof _ProxyValues | keyof typeof _ProxyMethods\n>\n\nlet idCounter = 0\n\nexport class Interaction {\n // current interactable being interacted with\n interactable: Interactable = null\n\n // the target element of the interactable\n element: Interact.Element = null\n rect: Interact.FullRect\n _rects?: {\n start: Interact.FullRect\n corrected: Interact.FullRect\n previous: Interact.FullRect\n delta: Interact.FullRect\n }\n edges: Interact.EdgeOptions\n\n _scopeFire: Interact.Scope['fire']\n\n // action that's ready to be fired on next move event\n prepared: ActionProps = {\n name : null,\n axis : null,\n edges: null,\n }\n\n pointerType: string\n\n // keep track of added pointers\n pointers: PointerInfo[] = []\n\n // pointerdown/mousedown/touchstart event\n downEvent: Interact.PointerEventType = null\n\n downPointer: Interact.PointerType = {} as Interact.PointerType\n\n _latestPointer: {\n pointer: Interact.PointerType\n event: Interact.PointerEventType\n eventTarget: Node\n } = {\n pointer: null,\n event: null,\n eventTarget: null,\n }\n\n // previous action event\n prevEvent: InteractEvent = null\n\n pointerIsDown = false\n pointerWasMoved = false\n _interacting = false\n _ending = false\n _stopped = true\n _proxy: InteractionProxy = null\n\n simulation = null\n\n /** @internal */ get pointerMoveTolerance () {\n return 1\n }\n\n /**\n * @alias Interaction.prototype.move\n */\n doMove = warnOnce(\n function (this: Interaction, signalArg: any) {\n this.move(signalArg)\n },\n 'The interaction.doMove() method has been renamed to interaction.move()')\n\n coords: Interact.CoordsSet = {\n // Starting InteractEvent pointer coordinates\n start: pointerUtils.newCoords(),\n // Previous native pointer move event coordinates\n prev: pointerUtils.newCoords(),\n // current native pointer move event coordinates\n cur: pointerUtils.newCoords(),\n // Change in coordinates and time of the pointer\n delta: pointerUtils.newCoords(),\n // pointer velocity\n velocity: pointerUtils.newCoords(),\n }\n\n readonly _id: number = idCounter++\n\n /** */\n constructor ({ pointerType, scopeFire }: {\n pointerType?: string\n scopeFire: Interact.Scope['fire']\n }) {\n this._scopeFire = scopeFire\n this.pointerType = pointerType\n\n const that = this\n\n this._proxy = {} as InteractionProxy\n\n for (const key in _ProxyValues) {\n Object.defineProperty(this._proxy, key, {\n get () { return that[key] },\n })\n }\n\n for (const key in _ProxyMethods) {\n Object.defineProperty(this._proxy, key, {\n value: (...args: any[]) => that[key](...args),\n })\n }\n\n this._scopeFire('interactions:new', { interaction: this })\n }\n\n pointerDown (pointer: Interact.PointerType, event: Interact.PointerEventType, eventTarget: Interact.EventTarget) {\n const pointerIndex = this.updatePointer(pointer, event, eventTarget, true)\n const pointerInfo = this.pointers[pointerIndex]\n\n this._scopeFire('interactions:down', {\n pointer,\n event,\n eventTarget,\n pointerIndex,\n pointerInfo,\n type: 'down',\n interaction: this,\n })\n }\n\n /**\n * ```js\n * interact(target)\n * .draggable({\n * // disable the default drag start by down->move\n * manualStart: true\n * })\n * // start dragging after the user holds the pointer down\n * .on('hold', function (event) {\n * var interaction = event.interaction\n *\n * if (!interaction.interacting()) {\n * interaction.start({ name: 'drag' },\n * event.interactable,\n * event.currentTarget)\n * }\n * })\n * ```\n *\n * Start an action with the given Interactable and Element as tartgets. The\n * action must be enabled for the target Interactable and an appropriate\n * number of pointers must be held down - 1 for drag/resize, 2 for gesture.\n *\n * Use it with `interactable.able({ manualStart: false })` to always\n * [start actions manually](https://github.com/taye/interact.js/issues/114)\n *\n * @param {object} action The action to be performed - drag, resize, etc.\n * @param {Interactable} target The Interactable to target\n * @param {Element} element The DOM Element to target\n * @return {object} interact\n */\n start (action: StartAction, interactable: Interactable, element: Interact.Element) {\n if (this.interacting() ||\n !this.pointerIsDown ||\n this.pointers.length < (action.name === 'gesture' ? 2 : 1) ||\n !interactable.options[action.name].enabled) {\n return false\n }\n\n copyAction(this.prepared, action)\n\n this.interactable = interactable\n this.element = element\n this.rect = interactable.getRect(element)\n this.edges = this.prepared.edges\n ? extend({}, this.prepared.edges)\n : { left: true, right: true, top: true, bottom: true }\n this._stopped = false\n this._interacting = this._doPhase({\n interaction: this,\n event: this.downEvent,\n phase: 'start',\n }) && !this._stopped\n\n return this._interacting\n }\n\n pointerMove (pointer: Interact.PointerType, event: Interact.PointerEventType, eventTarget: Interact.EventTarget) {\n if (!this.simulation && !(this.modification && this.modification.endResult)) {\n this.updatePointer(pointer, event, eventTarget, false)\n }\n\n const duplicateMove = (this.coords.cur.page.x === this.coords.prev.page.x &&\n this.coords.cur.page.y === this.coords.prev.page.y &&\n this.coords.cur.client.x === this.coords.prev.client.x &&\n this.coords.cur.client.y === this.coords.prev.client.y)\n\n let dx: number\n let dy: number\n\n // register movement greater than pointerMoveTolerance\n if (this.pointerIsDown && !this.pointerWasMoved) {\n dx = this.coords.cur.client.x - this.coords.start.client.x\n dy = this.coords.cur.client.y - this.coords.start.client.y\n\n this.pointerWasMoved = hypot(dx, dy) > this.pointerMoveTolerance\n }\n\n const pointerIndex = this.getPointerIndex(pointer)\n const signalArg = {\n pointer,\n pointerIndex,\n pointerInfo: this.pointers[pointerIndex],\n event,\n type: 'move' as const,\n eventTarget,\n dx,\n dy,\n duplicate: duplicateMove,\n interaction: this,\n }\n\n if (!duplicateMove) {\n // set pointer coordinate, time changes and velocity\n pointerUtils.setCoordVelocity(this.coords.velocity, this.coords.delta)\n }\n\n this._scopeFire('interactions:move', signalArg)\n\n if (!duplicateMove && !this.simulation) {\n // if interacting, fire an 'action-move' signal etc\n if (this.interacting()) {\n signalArg.type = null\n this.move(signalArg)\n }\n\n if (this.pointerWasMoved) {\n pointerUtils.copyCoords(this.coords.prev, this.coords.cur)\n }\n }\n }\n\n /**\n * ```js\n * interact(target)\n * .draggable(true)\n * .on('dragmove', function (event) {\n * if (someCondition) {\n * // change the snap settings\n * event.interactable.draggable({ snap: { targets: [] }})\n * // fire another move event with re-calculated snap\n * event.interaction.move()\n * }\n * })\n * ```\n *\n * Force a move of the current action at the same coordinates. Useful if\n * snap/restrict has been changed and you want a movement with the new\n * settings.\n */\n move (signalArg?: any) {\n if (!signalArg || !signalArg.event) {\n pointerUtils.setZeroCoords(this.coords.delta)\n }\n\n signalArg = extend({\n pointer: this._latestPointer.pointer,\n event: this._latestPointer.event,\n eventTarget: this._latestPointer.eventTarget,\n interaction: this,\n }, signalArg || {})\n\n signalArg.phase = 'move'\n\n this._doPhase(signalArg)\n }\n\n // End interact move events and stop auto-scroll unless simulation is running\n pointerUp (pointer: Interact.PointerType, event: Interact.PointerEventType, eventTarget: Interact.EventTarget, curEventTarget: Interact.EventTarget) {\n let pointerIndex = this.getPointerIndex(pointer)\n\n if (pointerIndex === -1) {\n pointerIndex = this.updatePointer(pointer, event, eventTarget, false)\n }\n\n const type = /cancel$/i.test(event.type) ? 'cancel' : 'up'\n\n this._scopeFire(`interactions:${type}` as 'interactions:up' | 'interactions:cancel', {\n pointer,\n pointerIndex,\n pointerInfo: this.pointers[pointerIndex],\n event,\n eventTarget,\n type: type as any,\n curEventTarget,\n interaction: this,\n })\n\n if (!this.simulation) {\n this.end(event)\n }\n\n this.pointerIsDown = false\n this.removePointer(pointer, event)\n }\n\n documentBlur (event: Event) {\n this.end(event as any)\n this._scopeFire('interactions:blur', { event, type: 'blur', interaction: this })\n }\n\n /**\n * ```js\n * interact(target)\n * .draggable(true)\n * .on('move', function (event) {\n * if (event.pageX > 1000) {\n * // end the current action\n * event.interaction.end()\n * // stop all further listeners from being called\n * event.stopImmediatePropagation()\n * }\n * })\n * ```\n *\n * @param {PointerEvent} [event]\n */\n end (event?: Interact.PointerEventType) {\n this._ending = true\n event = event || this._latestPointer.event\n let endPhaseResult: boolean\n\n if (this.interacting()) {\n endPhaseResult = this._doPhase({\n event,\n interaction: this,\n phase: 'end',\n })\n }\n\n this._ending = false\n\n if (endPhaseResult === true) {\n this.stop()\n }\n }\n\n currentAction () {\n return this._interacting ? this.prepared.name : null\n }\n\n interacting () {\n return this._interacting\n }\n\n /** */\n stop () {\n this._scopeFire('interactions:stop', { interaction: this })\n\n this.interactable = this.element = null\n\n this._interacting = false\n this._stopped = true\n this.prepared.name = this.prevEvent = null\n }\n\n getPointerIndex (pointer: Interact.PointerType) {\n const pointerId = pointerUtils.getPointerId(pointer)\n\n // mouse and pen interactions may have only one pointer\n return (this.pointerType === 'mouse' || this.pointerType === 'pen')\n ? this.pointers.length - 1\n : arr.findIndex(this.pointers, curPointer => curPointer.id === pointerId)\n }\n\n getPointerInfo (pointer: any) {\n return this.pointers[this.getPointerIndex(pointer)]\n }\n\n updatePointer (pointer: Interact.PointerType, event: Interact.PointerEventType, eventTarget: Interact.EventTarget, down?: boolean) {\n const id = pointerUtils.getPointerId(pointer)\n let pointerIndex = this.getPointerIndex(pointer)\n let pointerInfo = this.pointers[pointerIndex]\n\n down = down === false\n ? false\n : down || /(down|start)$/i.test(event.type)\n\n if (!pointerInfo) {\n pointerInfo = new PointerInfo(\n id,\n pointer,\n event,\n null,\n null,\n )\n\n pointerIndex = this.pointers.length\n this.pointers.push(pointerInfo)\n }\n else {\n pointerInfo.pointer = pointer\n }\n\n pointerUtils.setCoords(this.coords.cur, this.pointers.map(p => p.pointer), this._now())\n pointerUtils.setCoordDeltas(this.coords.delta, this.coords.prev, this.coords.cur)\n\n if (down) {\n this.pointerIsDown = true\n\n pointerInfo.downTime = this.coords.cur.timeStamp\n pointerInfo.downTarget = eventTarget\n pointerUtils.pointerExtend(this.downPointer, pointer)\n\n if (!this.interacting()) {\n pointerUtils.copyCoords(this.coords.start, this.coords.cur)\n pointerUtils.copyCoords(this.coords.prev, this.coords.cur)\n\n this.downEvent = event\n this.pointerWasMoved = false\n }\n }\n\n this._updateLatestPointer(pointer, event, eventTarget)\n\n this._scopeFire('interactions:update-pointer', {\n pointer,\n event,\n eventTarget,\n down,\n pointerInfo,\n pointerIndex,\n interaction: this,\n })\n\n return pointerIndex\n }\n\n removePointer (pointer: Interact.PointerType, event: Interact.PointerEventType) {\n const pointerIndex = this.getPointerIndex(pointer)\n\n if (pointerIndex === -1) { return }\n\n const pointerInfo = this.pointers[pointerIndex]\n\n this._scopeFire('interactions:remove-pointer', {\n pointer,\n event,\n eventTarget: null,\n pointerIndex,\n pointerInfo,\n interaction: this,\n })\n\n this.pointers.splice(pointerIndex, 1)\n }\n\n _updateLatestPointer (pointer, event, eventTarget) {\n this._latestPointer.pointer = pointer\n this._latestPointer.event = event\n this._latestPointer.eventTarget = eventTarget\n }\n\n destroy () {\n this._latestPointer.pointer = null\n this._latestPointer.event = null\n this._latestPointer.eventTarget = null\n }\n\n _createPreparedEvent

(event: Interact.PointerEventType, phase: P, preEnd?: boolean, type?: string) {\n return new InteractEvent(this, event, this.prepared.name, phase, this.element, preEnd, type)\n }\n\n _fireEvent

(iEvent: InteractEvent) {\n this.interactable.fire(iEvent)\n\n if (!this.prevEvent || iEvent.timeStamp >= this.prevEvent.timeStamp) {\n this.prevEvent = iEvent\n }\n }\n\n _doPhase

(signalArg: Omit, 'iEvent'> & { iEvent?: InteractEvent }) {\n const { event, phase, preEnd, type } = signalArg\n const { rect } = this\n\n if (rect && phase === 'move') {\n // update the rect changes due to pointer move\n rectUtils.addEdges(this.edges, rect, this.coords.delta[this.interactable.options.deltaSource])\n\n rect.width = rect.right - rect.left\n rect.height = rect.bottom - rect.top\n }\n\n const beforeResult = this._scopeFire(`interactions:before-action-${phase}` as any, signalArg)\n\n if (beforeResult === false) {\n return false\n }\n\n const iEvent = signalArg.iEvent = this._createPreparedEvent(event, phase, preEnd, type)\n\n this._scopeFire(`interactions:action-${phase}` as any, signalArg)\n\n if (phase === 'start') { this.prevEvent = iEvent }\n\n this._fireEvent(iEvent)\n\n this._scopeFire(`interactions:after-action-${phase}` as any, signalArg)\n\n return true\n }\n\n _now () { return Date.now() }\n}\n\nexport default Interaction\nexport { PointerInfo }\n","import { _ProxyMethods } from '@interactjs/core/Interaction'\nimport * as Interact from '@interactjs/types/index'\nimport * as rectUtils from '@interactjs/utils/rect'\n\ndeclare module '@interactjs/core/Interaction' {\n interface Interaction {\n offsetBy?: typeof offsetBy\n offset: {\n total: Interact.Point\n pending: Interact.Point\n }\n }\n\n // eslint-disable-next-line no-shadow\n enum _ProxyMethods {\n // eslint-disable-next-line no-shadow\n offsetBy = ''\n }\n}\n\n(_ProxyMethods as any).offsetBy = ''\n\nexport function addTotal (interaction: Interact.Interaction) {\n if (!interaction.pointerIsDown) { return }\n\n addToCoords(interaction.coords.cur, interaction.offset.total)\n\n interaction.offset.pending.x = 0\n interaction.offset.pending.y = 0\n}\n\nfunction beforeAction ({ interaction }: { interaction: Interact.Interaction }) {\n applyPending(interaction)\n}\n\nfunction beforeEnd ({ interaction }: { interaction: Interact.Interaction }): boolean | void {\n const hadPending = applyPending(interaction)\n\n if (!hadPending) { return }\n\n interaction.move({ offset: true })\n interaction.end()\n\n return false\n}\n\nfunction end ({ interaction }: { interaction: Interact.Interaction }) {\n interaction.offset.total.x = 0\n interaction.offset.total.y = 0\n interaction.offset.pending.x = 0\n interaction.offset.pending.y = 0\n}\n\nexport function applyPending (interaction: Interact.Interaction) {\n if (!hasPending(interaction)) {\n return false\n }\n\n const { pending } = interaction.offset\n\n addToCoords(interaction.coords.cur, pending)\n addToCoords(interaction.coords.delta, pending)\n rectUtils.addEdges(interaction.edges, interaction.rect, pending)\n\n pending.x = 0\n pending.y = 0\n\n return true\n}\n\nfunction offsetBy (this: Interact.Interaction, { x, y }: Interact.Point) {\n this.offset.pending.x += x\n this.offset.pending.y += y\n\n this.offset.total.x += x\n this.offset.total.y += y\n}\n\nfunction addToCoords ({ page, client }, { x, y }: Interact.Point) {\n page.x += x\n page.y += y\n client.x += x\n client.y += y\n}\n\nfunction hasPending (interaction) {\n return !!(interaction.offset.pending.x || interaction.offset.pending.y)\n}\n\nconst offset: Interact.Plugin = {\n id: 'offset',\n before: ['modifiers'],\n install (scope) {\n scope.Interaction.prototype.offsetBy = offsetBy\n },\n listeners: {\n 'interactions:new': ({ interaction }) => {\n interaction.offset = {\n total: { x: 0, y: 0 },\n pending: { x: 0, y: 0 },\n }\n },\n 'interactions:update-pointer': ({ interaction }) => addTotal(interaction),\n 'interactions:before-action-start': beforeAction,\n 'interactions:before-action-move': beforeAction,\n 'interactions:before-action-end': beforeEnd,\n 'interactions:stop': end,\n },\n}\n\nexport default offset\n","import Modification from '@interactjs/modifiers/Modification'\nimport * as modifiers from '@interactjs/modifiers/base'\nimport offset from '@interactjs/offset/plugin'\nimport * as Interact from '@interactjs/types/index'\nimport * as dom from '@interactjs/utils/domUtils'\nimport hypot from '@interactjs/utils/hypot'\nimport is from '@interactjs/utils/is'\nimport { copyCoords } from '@interactjs/utils/pointerUtils'\nimport raf from '@interactjs/utils/raf'\n\ndeclare module '@interactjs/core/InteractEvent' {\n // eslint-disable-next-line no-shadow\n interface PhaseMap {\n resume?: true\n inertiastart?: true\n }\n}\n\ndeclare module '@interactjs/core/Interaction' {\n interface Interaction {\n inertia?: InertiaState\n }\n}\n\ndeclare module '@interactjs/core/defaultOptions' {\n interface PerActionDefaults {\n inertia?: {\n enabled?: boolean\n resistance?: number // the lambda in exponential decay\n minSpeed?: number // target speed must be above this for inertia to start\n endSpeed?: number // the speed at which inertia is slow enough to stop\n allowResume?: true // allow resuming an action in inertia phase\n smoothEndDuration?: number // animate to snap/restrict endOnly if there's no inertia\n }\n }\n}\n\ndeclare module '@interactjs/core/scope' {\n interface SignalArgs {\n 'interactions:before-action-inertiastart': Omit, 'iEvent'>\n 'interactions:action-inertiastart': Interact.DoPhaseArg\n 'interactions:after-action-inertiastart': Interact.DoPhaseArg\n 'interactions:before-action-resume': Omit, 'iEvent'>\n 'interactions:action-resume': Interact.DoPhaseArg\n 'interactions:after-action-resume': Interact.DoPhaseArg\n }\n}\n\nfunction install (scope: Interact.Scope) {\n const {\n defaults,\n } = scope\n\n scope.usePlugin(offset)\n scope.usePlugin(modifiers.default)\n scope.actions.phases.inertiastart = true\n scope.actions.phases.resume = true\n\n defaults.perAction.inertia = {\n enabled : false,\n resistance : 10, // the lambda in exponential decay\n minSpeed : 100, // target speed must be above this for inertia to start\n endSpeed : 10, // the speed at which inertia is slow enough to stop\n allowResume : true, // allow resuming an action in inertia phase\n smoothEndDuration: 300, // animate to snap/restrict endOnly if there's no inertia\n }\n}\n\nexport class InertiaState {\n active = false\n isModified = false\n smoothEnd = false\n allowResume = false\n\n modification: Modification = null\n modifierCount = 0\n modifierArg: modifiers.ModifierArg = null\n\n startCoords: Interact.Point = null\n t0 = 0\n v0 = 0\n\n te = 0\n targetOffset: Interact.Point = null\n modifiedOffset: Interact.Point = null\n currentOffset: Interact.Point = null\n\n lambda_v0? = 0 // eslint-disable-line camelcase\n one_ve_v0? = 0 // eslint-disable-line camelcase\n timeout: number = null\n readonly interaction: Interact.Interaction\n\n constructor (interaction: Interact.Interaction) {\n this.interaction = interaction\n }\n\n start (event: Interact.PointerEventType) {\n const { interaction } = this\n const options = getOptions(interaction)\n\n if (!options || !options.enabled) {\n return false\n }\n\n const { client: velocityClient } = interaction.coords.velocity\n const pointerSpeed = hypot(velocityClient.x, velocityClient.y)\n const modification = this.modification || (this.modification = new Modification(interaction))\n\n modification.copyFrom(interaction.modification)\n\n this.t0 = interaction._now()\n this.allowResume = options.allowResume\n this.v0 = pointerSpeed\n this.currentOffset = { x: 0, y: 0 }\n this.startCoords = interaction.coords.cur.page\n\n this.modifierArg = {\n interaction,\n interactable: interaction.interactable,\n element: interaction.element,\n rect: interaction.rect,\n edges: interaction.edges,\n pageCoords: this.startCoords,\n preEnd: true,\n phase: 'inertiastart',\n }\n\n const thrown = (\n (this.t0 - interaction.coords.cur.timeStamp) < 50 &&\n pointerSpeed > options.minSpeed &&\n pointerSpeed > options.endSpeed\n )\n\n if (thrown) {\n this.startInertia()\n } else {\n modification.result = modification.setAll(this.modifierArg)\n\n if (!modification.result.changed) {\n return false\n }\n\n this.startSmoothEnd()\n }\n\n // force modification change\n interaction.modification.result.rect = null\n\n // bring inertiastart event to the target coords\n interaction.offsetBy(this.targetOffset)\n interaction._doPhase({\n interaction,\n event,\n phase: 'inertiastart',\n })\n interaction.offsetBy({ x: -this.targetOffset.x, y: -this.targetOffset.y })\n // force modification change\n interaction.modification.result.rect = null\n\n this.active = true\n interaction.simulation = this\n\n return true\n }\n\n startInertia () {\n const startVelocity = this.interaction.coords.velocity.client\n const options = getOptions(this.interaction)\n const lambda = options.resistance\n const inertiaDur = -Math.log(options.endSpeed / this.v0) / lambda\n\n this.targetOffset = {\n x: (startVelocity.x - inertiaDur) / lambda,\n y: (startVelocity.y - inertiaDur) / lambda,\n }\n\n this.te = inertiaDur\n this.lambda_v0 = lambda / this.v0\n this.one_ve_v0 = 1 - options.endSpeed / this.v0\n\n const { modification, modifierArg } = this\n\n modifierArg.pageCoords = {\n x: this.startCoords.x + this.targetOffset.x,\n y: this.startCoords.y + this.targetOffset.y,\n }\n\n modification.result = modification.setAll(modifierArg)\n\n if (modification.result.changed) {\n this.isModified = true\n this.modifiedOffset = {\n x: this.targetOffset.x + modification.result.delta.x,\n y: this.targetOffset.y + modification.result.delta.y,\n }\n }\n\n this.timeout = raf.request(() => this.inertiaTick())\n }\n\n startSmoothEnd () {\n this.smoothEnd = true\n this.isModified = true\n this.targetOffset = {\n x: this.modification.result.delta.x,\n y: this.modification.result.delta.y,\n }\n\n this.timeout = raf.request(() => this.smoothEndTick())\n }\n\n inertiaTick () {\n const { interaction } = this\n const options = getOptions(interaction)\n const lambda = options.resistance\n const t = (interaction._now() - this.t0) / 1000\n\n if (t < this.te) {\n const progress = 1 - (Math.exp(-lambda * t) - this.lambda_v0) / this.one_ve_v0\n let newOffset: Interact.Point\n\n if (this.isModified) {\n newOffset = getQuadraticCurvePoint(\n 0, 0,\n this.targetOffset.x, this.targetOffset.y,\n this.modifiedOffset.x, this.modifiedOffset.y,\n progress,\n )\n }\n else {\n newOffset = {\n x: this.targetOffset.x * progress,\n y: this.targetOffset.y * progress,\n }\n }\n\n const delta = { x: newOffset.x - this.currentOffset.x, y: newOffset.y - this.currentOffset.y }\n\n this.currentOffset.x += delta.x\n this.currentOffset.y += delta.y\n\n interaction.offsetBy(delta)\n interaction.move()\n\n this.timeout = raf.request(() => this.inertiaTick())\n }\n else {\n interaction.offsetBy({\n x: this.modifiedOffset.x - this.currentOffset.x,\n y: this.modifiedOffset.y - this.currentOffset.y,\n })\n\n this.end()\n }\n }\n\n smoothEndTick () {\n const { interaction } = this\n const t = interaction._now() - this.t0\n const { smoothEndDuration: duration } = getOptions(interaction)\n\n if (t < duration) {\n const newOffset = {\n x: easeOutQuad(t, 0, this.targetOffset.x, duration),\n y: easeOutQuad(t, 0, this.targetOffset.y, duration),\n }\n const delta = {\n x: newOffset.x - this.currentOffset.x,\n y: newOffset.y - this.currentOffset.y,\n }\n\n this.currentOffset.x += delta.x\n this.currentOffset.y += delta.y\n\n interaction.offsetBy(delta)\n interaction.move({ skipModifiers: this.modifierCount })\n\n this.timeout = raf.request(() => this.smoothEndTick())\n }\n else {\n interaction.offsetBy({\n x: this.targetOffset.x - this.currentOffset.x,\n y: this.targetOffset.y - this.currentOffset.y,\n })\n\n this.end()\n }\n }\n\n resume ({ pointer, event, eventTarget }: Interact.SignalArgs['interactions:down']) {\n const { interaction } = this\n\n // undo inertia changes to interaction coords\n interaction.offsetBy({\n x: -this.currentOffset.x,\n y: -this.currentOffset.y,\n })\n\n // update pointer at pointer down position\n interaction.updatePointer(pointer, event, eventTarget, true)\n\n // fire resume signals and event\n interaction._doPhase({\n interaction,\n event,\n phase: 'resume',\n })\n copyCoords(interaction.coords.prev, interaction.coords.cur)\n\n this.stop()\n }\n\n end () {\n this.interaction.move()\n this.interaction.end()\n this.stop()\n }\n\n stop () {\n this.active = this.smoothEnd = false\n this.interaction.simulation = null\n raf.cancel(this.timeout)\n }\n}\n\nfunction start ({ interaction, event }: Interact.DoPhaseArg) {\n if (!interaction._interacting || interaction.simulation) {\n return null\n }\n\n const started = interaction.inertia.start(event)\n\n // prevent action end if inertia or smoothEnd\n return started ? false : null\n}\n\n// Check if the down event hits the current inertia target\n// control should be return to the user\nfunction resume (arg: Interact.SignalArgs['interactions:down']) {\n const { interaction, eventTarget } = arg\n const state = interaction.inertia\n\n if (!state.active) { return }\n\n let element = eventTarget as Node\n\n // climb up the DOM tree from the event target\n while (is.element(element)) {\n // if interaction element is the current inertia target element\n if (element === interaction.element) {\n state.resume(arg)\n break\n }\n\n element = dom.parentNode(element)\n }\n}\n\nfunction stop ({ interaction }: { interaction: Interact.Interaction }) {\n const state = interaction.inertia\n\n if (state.active) {\n state.stop()\n }\n}\n\nfunction getOptions ({ interactable, prepared }: Interact.Interaction) {\n return interactable &&\n interactable.options &&\n prepared.name &&\n interactable.options[prepared.name].inertia\n}\n\nconst inertia: Interact.Plugin = {\n id: 'inertia',\n before: ['modifiers'],\n install,\n listeners: {\n 'interactions:new': ({ interaction }) => {\n interaction.inertia = new InertiaState(interaction)\n },\n\n 'interactions:before-action-end': start,\n 'interactions:down': resume,\n 'interactions:stop': stop,\n\n 'interactions:before-action-resume': arg => {\n const { modification } = arg.interaction\n\n modification.stop(arg)\n modification.start(arg, arg.interaction.coords.cur.page)\n modification.applyToInteraction(arg)\n },\n\n 'interactions:before-action-inertiastart': arg => arg.interaction.modification.setAndApply(arg),\n 'interactions:action-resume': modifiers.addEventModifiers,\n 'interactions:action-inertiastart': modifiers.addEventModifiers,\n 'interactions:after-action-inertiastart': arg => arg.interaction.modification.restoreInteractionCoords(arg),\n 'interactions:after-action-resume': arg => arg.interaction.modification.restoreInteractionCoords(arg),\n },\n}\n\n// http://stackoverflow.com/a/5634528/2280888\nfunction _getQBezierValue (t: number, p1: number, p2: number, p3: number) {\n const iT = 1 - t\n return iT * iT * p1 + 2 * iT * t * p2 + t * t * p3\n}\n\nfunction getQuadraticCurvePoint (\n startX: number, startY: number, cpX: number, cpY: number, endX: number, endY: number, position: number) {\n return {\n x: _getQBezierValue(position, startX, cpX, endX),\n y: _getQBezierValue(position, startY, cpY, endY),\n }\n}\n\n// http://gizma.com/easing/\nfunction easeOutQuad (t: number, b: number, c: number, d: number) {\n t /= d\n return -c * t * (t - 2) + b\n}\n\nexport default inertia\n","import * as Interact from '@interactjs/types/index'\nimport * as arr from '@interactjs/utils/arr'\nimport extend from '@interactjs/utils/extend'\nimport normalize, { NormalizedListeners } from '@interactjs/utils/normalizeListeners'\n\nfunction fireUntilImmediateStopped<\n T extends Interact.ActionName,\n P extends Interact.EventPhase,\n> (event: Interact.InteractEvent, listeners: Interact.Listener[]) {\n for (const listener of listeners) {\n if (event.immediatePropagationStopped) { break }\n\n listener(event)\n }\n}\n\nexport class Eventable {\n options: any\n types: NormalizedListeners = {}\n propagationStopped = false\n immediatePropagationStopped = false\n global: any\n\n constructor (options?: { [index: string]: any }) {\n this.options = extend({}, options || {})\n }\n\n fire (event: any) {\n let listeners: Interact.Listener[]\n const global = this.global\n\n // Interactable#on() listeners\n // tslint:disable no-conditional-assignment\n if ((listeners = this.types[event.type])) {\n fireUntilImmediateStopped(event, listeners)\n }\n\n // interact.on() listeners\n if (!event.propagationStopped && global && (listeners = global[event.type])) {\n fireUntilImmediateStopped(event, listeners)\n }\n }\n\n on (type: string, listener: Interact.ListenersArg) {\n const listeners = normalize(type, listener)\n\n for (type in listeners) {\n this.types[type] = arr.merge(this.types[type] || [], listeners[type])\n }\n }\n\n off (type: string, listener: Interact.ListenersArg) {\n const listeners = normalize(type, listener)\n\n for (type in listeners) {\n const eventList = this.types[type]\n\n if (!eventList || !eventList.length) { continue }\n\n for (const subListener of listeners[type]) {\n const index = eventList.indexOf(subListener)\n\n if (index !== -1) {\n eventList.splice(index, 1)\n }\n }\n }\n }\n\n getRect (_element: Interact.Element): Interact.Rect {\n return null\n }\n}\n","import * as Interact from '@interactjs/types/index'\n\nexport default function isNonNativeEvent (type: string, actions: Interact.Actions) {\n if (actions.phaselessTypes[type]) { return true }\n\n for (const name in actions.map) {\n if (type.indexOf(name) === 0 && type.substr(name.length) in actions.phases) {\n return true\n }\n }\n\n return false\n}\n","/* eslint-disable no-dupe-class-members */\nimport * as Interact from '@interactjs/types/index'\nimport * as arr from '@interactjs/utils/arr'\nimport browser from '@interactjs/utils/browser'\nimport clone from '@interactjs/utils/clone'\nimport { getElementRect, matchesUpTo, nodeContains, trySelector } from '@interactjs/utils/domUtils'\nimport extend from '@interactjs/utils/extend'\nimport is from '@interactjs/utils/is'\nimport normalizeListeners from '@interactjs/utils/normalizeListeners'\nimport { getWindow } from '@interactjs/utils/window'\n\nimport { Eventable } from './Eventable'\nimport { ActionDefaults, Defaults, Options } from './defaultOptions'\nimport isNonNativeEvent from './isNonNativeEvent'\n\ntype IgnoreValue = string | Interact.Element | boolean\ntype DeltaSource = 'page' | 'client'\n\n/** */\nexport class Interactable implements Partial {\n /** @internal */ get _defaults (): Defaults {\n return {\n base: {},\n perAction: {},\n actions: {} as ActionDefaults,\n }\n }\n\n readonly options!: Required\n readonly _actions: Interact.Actions\n readonly target: Interact.Target\n readonly events = new Eventable()\n readonly _context: Interact.Context\n readonly _win: Window\n readonly _doc: Document\n readonly _scopeEvents: Interact.Scope['events']\n\n /** @internal */ _rectChecker?: typeof Interactable.prototype.getRect\n\n /** */\n constructor (target: Interact.Target, options: any, defaultContext: Document | Interact.Element, scopeEvents: Interact.Scope['events']) {\n this._actions = options.actions\n this.target = target\n this._context = options.context || defaultContext\n this._win = getWindow(trySelector(target) ? this._context : target)\n this._doc = this._win.document\n this._scopeEvents = scopeEvents\n\n this.set(options)\n }\n\n setOnEvents (actionName: Interact.ActionName, phases: NonNullable) {\n if (is.func(phases.onstart)) { this.on(`${actionName}start`, phases.onstart) }\n if (is.func(phases.onmove)) { this.on(`${actionName}move`, phases.onmove) }\n if (is.func(phases.onend)) { this.on(`${actionName}end`, phases.onend) }\n if (is.func(phases.oninertiastart)) { this.on(`${actionName}inertiastart`, phases.oninertiastart) }\n\n return this\n }\n\n updatePerActionListeners (actionName: Interact.ActionName, prev: Interact.Listeners, cur: Interact.Listeners) {\n if (is.array(prev) || is.object(prev)) {\n this.off(actionName, prev)\n }\n\n if (is.array(cur) || is.object(cur)) {\n this.on(actionName, cur)\n }\n }\n\n setPerAction (actionName: Interact.ActionName, options: Interact.OrBoolean) {\n const defaults = this._defaults\n\n // for all the default per-action options\n for (const optionName_ in options) {\n const optionName = optionName_ as keyof Interact.PerActionDefaults\n const actionOptions = this.options[actionName]\n const optionValue: any = options[optionName]\n\n // remove old event listeners and add new ones\n if (optionName === 'listeners') {\n this.updatePerActionListeners(actionName, actionOptions.listeners, optionValue as Interact.Listeners)\n }\n\n // if the option value is an array\n if (is.array(optionValue)) {\n (actionOptions[optionName] as any) = arr.from(optionValue)\n }\n // if the option value is an object\n else if (is.plainObject(optionValue)) {\n // copy the object\n (actionOptions[optionName] as any) = extend(\n actionOptions[optionName] || {} as any,\n clone(optionValue))\n\n // set anabled field to true if it exists in the defaults\n if (is.object(defaults.perAction[optionName]) && 'enabled' in (defaults.perAction[optionName] as any)) {\n (actionOptions[optionName] as any).enabled = optionValue.enabled !== false\n }\n }\n // if the option value is a boolean and the default is an object\n else if (is.bool(optionValue) && is.object(defaults.perAction[optionName])) {\n (actionOptions[optionName] as any).enabled = optionValue\n }\n // if it's anything else, do a plain assignment\n else {\n (actionOptions[optionName] as any) = optionValue\n }\n }\n }\n\n /**\n * The default function to get an Interactables bounding rect. Can be\n * overridden using {@link Interactable.rectChecker}.\n *\n * @param {Element} [element] The element to measure.\n * @return {Interact.Rect} The object's bounding rectangle.\n */\n getRect (element: Interact.Element) {\n element = element || (is.element(this.target)\n ? this.target\n : null)\n\n if (is.string(this.target)) {\n element = element || this._context.querySelector(this.target)\n }\n\n return getElementRect(element)\n }\n\n /**\n * Returns or sets the function used to calculate the interactable's\n * element's rectangle\n *\n * @param {function} [checker] A function which returns this Interactable's\n * bounding rectangle. See {@link Interactable.getRect}\n * @return {function | object} The checker function or this Interactable\n */\n rectChecker (): (element: Interact.Element) => any | null\n rectChecker (checker: (element: Interact.Element) => any): this\n rectChecker (checker?: (element: Interact.Element) => any) {\n if (is.func(checker)) {\n this._rectChecker = checker\n\n this.getRect = element => {\n const rect = extend({}, this._rectChecker(element))\n\n if (!('width' in rect)) {\n rect.width = rect.right - rect.left\n rect.height = rect.bottom - rect.top\n }\n\n return rect\n }\n\n return this\n }\n\n if (checker === null) {\n delete this.getRect\n delete this._rectChecker\n\n return this\n }\n\n return this.getRect\n }\n\n _backCompatOption (optionName: keyof Interact.Options, newValue: any) {\n if (trySelector(newValue) || is.object(newValue)) {\n (this.options[optionName] as any) = newValue\n\n for (const action in this._actions.map) {\n (this.options[action][optionName] as any) = newValue\n }\n\n return this\n }\n\n return this.options[optionName]\n }\n\n /**\n * Gets or sets the origin of the Interactable's element. The x and y\n * of the origin will be subtracted from action event coordinates.\n *\n * @param {Element | object | string} [origin] An HTML or SVG Element whose\n * rect will be used, an object eg. { x: 0, y: 0 } or string 'parent', 'self'\n * or any CSS selector\n *\n * @return {object} The current origin or this Interactable\n */\n origin (newValue: any) {\n return this._backCompatOption('origin', newValue)\n }\n\n /**\n * Returns or sets the mouse coordinate types used to calculate the\n * movement of the pointer.\n *\n * @param {string} [newValue] Use 'client' if you will be scrolling while\n * interacting; Use 'page' if you want autoScroll to work\n * @return {string | object} The current deltaSource or this Interactable\n */\n deltaSource (): DeltaSource\n deltaSource (newValue: DeltaSource): this\n deltaSource (newValue?: DeltaSource) {\n if (newValue === 'page' || newValue === 'client') {\n this.options.deltaSource = newValue\n\n return this\n }\n\n return this.options.deltaSource\n }\n\n /**\n * Gets the selector context Node of the Interactable. The default is\n * `window.document`.\n *\n * @return {Node} The context Node of this Interactable\n */\n context () {\n return this._context\n }\n\n inContext (element: Document | Node) {\n return (this._context === element.ownerDocument ||\n nodeContains(this._context, element))\n }\n\n testIgnoreAllow (\n this: Interactable,\n options: { ignoreFrom?: IgnoreValue, allowFrom?: IgnoreValue },\n targetNode: Node,\n eventTarget: Interact.EventTarget,\n ) {\n return (!this.testIgnore(options.ignoreFrom, targetNode, eventTarget) &&\n this.testAllow(options.allowFrom, targetNode, eventTarget))\n }\n\n testAllow (\n this: Interactable,\n allowFrom: IgnoreValue,\n targetNode: Node,\n element: Interact.EventTarget,\n ) {\n if (!allowFrom) { return true }\n\n if (!is.element(element)) { return false }\n\n if (is.string(allowFrom)) {\n return matchesUpTo(element, allowFrom, targetNode)\n }\n else if (is.element(allowFrom)) {\n return nodeContains(allowFrom, element)\n }\n\n return false\n }\n\n testIgnore (\n this: Interactable,\n ignoreFrom: IgnoreValue,\n targetNode: Node,\n element: Interact.EventTarget,\n ) {\n if (!ignoreFrom || !is.element(element)) { return false }\n\n if (is.string(ignoreFrom)) {\n return matchesUpTo(element, ignoreFrom, targetNode)\n }\n else if (is.element(ignoreFrom)) {\n return nodeContains(ignoreFrom, element)\n }\n\n return false\n }\n\n /**\n * Calls listeners for the given InteractEvent type bound globally\n * and directly to this Interactable\n *\n * @param {InteractEvent} iEvent The InteractEvent object to be fired on this\n * Interactable\n * @return {Interactable} this Interactable\n */\n fire (iEvent: object) {\n this.events.fire(iEvent)\n\n return this\n }\n\n _onOff (method: 'on' | 'off', typeArg: Interact.EventTypes, listenerArg?: Interact.ListenersArg | null, options?: any) {\n if (is.object(typeArg) && !is.array(typeArg)) {\n options = listenerArg\n listenerArg = null\n }\n\n const addRemove = method === 'on' ? 'add' : 'remove'\n const listeners = normalizeListeners(typeArg, listenerArg)\n\n for (let type in listeners) {\n if (type === 'wheel') { type = browser.wheelEvent }\n\n for (const listener of listeners[type]) {\n // if it is an action event type\n if (isNonNativeEvent(type, this._actions)) {\n this.events[method](type, listener)\n }\n // delegated event\n else if (is.string(this.target)) {\n this._scopeEvents[`${addRemove}Delegate` as 'addDelegate' | 'removeDelegate'](this.target, this._context, type, listener, options)\n }\n // remove listener from this Interactable's element\n else {\n this._scopeEvents[addRemove](this.target, type, listener, options)\n }\n }\n }\n\n return this\n }\n\n /**\n * Binds a listener for an InteractEvent, pointerEvent or DOM event.\n *\n * @param {string | array | object} types The types of events to listen\n * for\n * @param {function | array | object} [listener] The event listener function(s)\n * @param {object | boolean} [options] options object or useCapture flag for\n * addEventListener\n * @return {Interactable} This Interactable\n */\n on (types: Interact.EventTypes, listener?: Interact.ListenersArg, options?: any) {\n return this._onOff('on', types, listener, options)\n }\n\n /**\n * Removes an InteractEvent, pointerEvent or DOM event listener.\n *\n * @param {string | array | object} types The types of events that were\n * listened for\n * @param {function | array | object} [listener] The event listener function(s)\n * @param {object | boolean} [options] options object or useCapture flag for\n * removeEventListener\n * @return {Interactable} This Interactable\n */\n off (types: string | string[] | Interact.EventTypes, listener?: Interact.ListenersArg, options?: any) {\n return this._onOff('off', types, listener, options)\n }\n\n /**\n * Reset the options of this Interactable\n *\n * @param {object} options The new settings to apply\n * @return {object} This Interactable\n */\n set (options: Interact.OptionsArg) {\n const defaults = this._defaults\n\n if (!is.object(options)) {\n options = {}\n }\n\n (this.options as Required) = clone(defaults.base) as Required\n\n for (const actionName_ in this._actions.methodDict) {\n const actionName = actionName_ as Interact.ActionName\n const methodName = this._actions.methodDict[actionName]\n\n this.options[actionName] = {}\n this.setPerAction(actionName, extend(extend({}, defaults.perAction), defaults.actions[actionName]))\n\n this[methodName](options[actionName])\n }\n\n for (const setting in options) {\n if (is.func(this[setting])) {\n this[setting](options[setting])\n }\n }\n\n return this\n }\n\n /**\n * Remove this interactable from the list of interactables and remove it's\n * action capabilities and event listeners\n */\n unset () {\n if (is.string(this.target)) {\n // remove delegated events\n for (const type in this._scopeEvents.delegatedEvents) {\n const delegated = this._scopeEvents.delegatedEvents[type]\n\n for (let i = delegated.length - 1; i >= 0; i--) {\n const { selector, context, listeners } = delegated[i]\n\n if (selector === this.target && context === this._context) {\n delegated.splice(i, 1)\n }\n\n for (let l = listeners.length - 1; l >= 0; l--) {\n this._scopeEvents.removeDelegate(this.target, this._context, type, listeners[l][0], listeners[l][1])\n }\n }\n }\n }\n else {\n this._scopeEvents.remove(this.target as Node, 'all')\n }\n }\n}\n","import { Interactable } from '@interactjs/core/Interactable'\nimport * as Interact from '@interactjs/types/index'\nimport * as arr from '@interactjs/utils/arr'\nimport * as domUtils from '@interactjs/utils/domUtils'\nimport extend from '@interactjs/utils/extend'\nimport is from '@interactjs/utils/is'\n\ndeclare module '@interactjs/core/scope' {\n interface SignalArgs {\n 'interactable:new': {\n interactable: Interact.Interactable\n target: Interact.Target\n options: Interact.OptionsArg\n win: Window\n }\n }\n}\n\ninterface InteractableScopeProp {\n context: Document | Interact.Element\n interactable: Interact.Interactable\n}\n\nexport class InteractableSet {\n // all set interactables\n list: Interact.Interactable[] = []\n\n selectorMap: {\n [selector: string]: InteractableScopeProp[]\n } = {}\n\n scope: Interact.Scope\n\n constructor (scope: Interact.Scope) {\n this.scope = scope\n scope.addListeners({\n 'interactable:unset': ({ interactable }) => {\n const { target, _context: context } = interactable\n const targetMappings: InteractableScopeProp[] = is.string(target)\n ? this.selectorMap[target]\n : (target as any)[this.scope.id]\n\n const targetIndex = targetMappings.findIndex(m => m.context === context)\n if (targetMappings[targetIndex]) {\n // Destroying mappingInfo's context and interactable\n targetMappings[targetIndex].context = null\n targetMappings[targetIndex].interactable = null\n }\n targetMappings.splice(targetIndex, 1)\n },\n })\n }\n\n new (target: Interact.Target, options?: any): Interactable {\n options = extend(options || {}, {\n actions: this.scope.actions,\n })\n const interactable = new this.scope.Interactable(target, options, this.scope.document, this.scope.events)\n const mappingInfo = { context: interactable._context, interactable }\n\n this.scope.addDocument(interactable._doc)\n this.list.push(interactable)\n\n if (is.string(target)) {\n if (!this.selectorMap[target]) { this.selectorMap[target] = [] }\n this.selectorMap[target].push(mappingInfo)\n } else {\n if (!((interactable.target as any)[this.scope.id])) {\n Object.defineProperty(target, this.scope.id, {\n value: [],\n configurable: true,\n })\n }\n\n (target as any)[this.scope.id].push(mappingInfo)\n }\n\n this.scope.fire('interactable:new', {\n target,\n options,\n interactable,\n win: this.scope._win,\n })\n\n return interactable\n }\n\n get (target: Interact.Target, options?: Interact.Options) {\n const context = (options && options.context) || this.scope.document\n const isSelector = is.string(target)\n const targetMappings: InteractableScopeProp[] = isSelector\n ? this.selectorMap[target as string]\n : (target as any)[this.scope.id]\n\n if (!targetMappings) { return null }\n\n const found = arr.find(\n targetMappings,\n m => m.context === context &&\n (isSelector || m.interactable.inContext(target as any)))\n\n return found && found.interactable\n }\n\n forEachMatch (node: Node, callback: (interactable: Interact.Interactable) => T) {\n for (const interactable of this.list) {\n let ret: void | T\n\n if ((is.string(interactable.target)\n // target is a selector and the element matches\n ? (is.element(node) && domUtils.matchesSelector(node, interactable.target))\n // target is the element\n : node === interactable.target) &&\n // the element is in context\n (interactable.inContext(node))) {\n ret = callback(interactable)\n }\n\n if (ret !== undefined) {\n return ret\n }\n }\n }\n}\n","import * as Interact from '@interactjs/types/index'\nimport * as arr from '@interactjs/utils/arr'\nimport * as domUtils from '@interactjs/utils/domUtils'\nimport extend from '@interactjs/utils/extend'\nimport is from '@interactjs/utils/is'\nimport pExtend from '@interactjs/utils/pointerExtend'\nimport * as pointerUtils from '@interactjs/utils/pointerUtils'\n\ndeclare module '@interactjs/core/scope' {\n interface Scope {\n events: ReturnType\n }\n}\n\ntype Listener = (event: Event | FakeEvent) => any\n\nfunction install (scope: Interact.Scope) {\n const targets: Array<{\n eventTarget: EventTarget\n events: { [type: string]: Listener[] }\n }> = []\n\n const delegatedEvents: {\n [type: string]: Array<{\n selector: string\n context: Node\n listeners: Array<[Listener, { capture: boolean, passive: boolean }]>\n }>\n } = {}\n const documents: Document[] = []\n\n const eventsMethods = {\n add,\n remove,\n\n addDelegate,\n removeDelegate,\n\n delegateListener,\n delegateUseCapture,\n delegatedEvents,\n documents,\n\n targets,\n\n supportsOptions: false,\n supportsPassive: false,\n }\n\n // check if browser supports passive events and options arg\n scope.document.createElement('div').addEventListener('test', null, {\n get capture () { return (eventsMethods.supportsOptions = true) },\n get passive () { return (eventsMethods.supportsPassive = true) },\n })\n\n scope.events = eventsMethods\n\n function add (eventTarget: EventTarget, type: string, listener: Listener, optionalArg?: boolean | any) {\n const options = getOptions(optionalArg)\n let target = arr.find(targets, t => t.eventTarget === eventTarget)\n\n if (!target) {\n target = {\n eventTarget,\n events: {},\n }\n\n targets.push(target)\n }\n\n if (!target.events[type]) {\n target.events[type] = []\n }\n\n if (eventTarget.addEventListener && !arr.contains(target.events[type], listener)) {\n eventTarget.addEventListener(type, listener as any, eventsMethods.supportsOptions ? options : options.capture)\n target.events[type].push(listener)\n }\n }\n\n function remove (eventTarget: EventTarget, type: string, listener?: 'all' | Listener, optionalArg?: boolean | any) {\n const options = getOptions(optionalArg)\n const targetIndex = arr.findIndex(targets, t => t.eventTarget === eventTarget)\n const target = targets[targetIndex]\n\n if (!target || !target.events) {\n return\n }\n\n if (type === 'all') {\n for (type in target.events) {\n if (target.events.hasOwnProperty(type)) {\n remove(eventTarget, type, 'all')\n }\n }\n return\n }\n\n let typeIsEmpty = false\n const typeListeners = target.events[type]\n\n if (typeListeners) {\n if (listener === 'all') {\n for (let i = typeListeners.length - 1; i >= 0; i--) {\n remove(eventTarget, type, typeListeners[i], options)\n }\n return\n }\n else {\n for (let i = 0; i < typeListeners.length; i++) {\n if (typeListeners[i] === listener) {\n eventTarget.removeEventListener(type, listener as any, eventsMethods.supportsOptions ? options : options.capture)\n typeListeners.splice(i, 1)\n\n if (typeListeners.length === 0) {\n delete target.events[type]\n typeIsEmpty = true\n }\n\n break\n }\n }\n }\n }\n\n if (typeIsEmpty && !Object.keys(target.events).length) {\n targets.splice(targetIndex, 1)\n }\n }\n\n function addDelegate (selector: string, context: Node, type: string, listener: Listener, optionalArg?: any) {\n const options = getOptions(optionalArg)\n if (!delegatedEvents[type]) {\n delegatedEvents[type] = []\n\n // add delegate listener functions\n for (const doc of documents) {\n add(doc, type, delegateListener)\n add(doc, type, delegateUseCapture, true)\n }\n }\n\n const delegates = delegatedEvents[type]\n let delegate = arr.find(delegates, d => d.selector === selector && d.context === context)\n\n if (!delegate) {\n delegate = { selector, context, listeners: [] }\n delegates.push(delegate)\n }\n\n delegate.listeners.push([listener, options])\n }\n\n function removeDelegate (\n selector: string,\n context: Document | Interact.Element,\n type: string,\n listener?: Listener,\n optionalArg?: any,\n ) {\n const options = getOptions(optionalArg)\n const delegates = delegatedEvents[type]\n let matchFound = false\n let index: number\n\n if (!delegates) { return }\n\n // count from last index of delegated to 0\n for (index = delegates.length - 1; index >= 0; index--) {\n const cur = delegates[index]\n // look for matching selector and context Node\n if (cur.selector === selector && cur.context === context) {\n const { listeners } = cur\n\n // each item of the listeners array is an array: [function, capture, passive]\n for (let i = listeners.length - 1; i >= 0; i--) {\n const [fn, { capture, passive }] = listeners[i]\n\n // check if the listener functions and capture and passive flags match\n if (fn === listener && capture === options.capture && passive === options.passive) {\n // remove the listener from the array of listeners\n listeners.splice(i, 1)\n\n // if all listeners for this target have been removed\n // remove the target from the delegates array\n if (!listeners.length) {\n delegates.splice(index, 1)\n\n // remove delegate function from context\n remove(context, type, delegateListener)\n remove(context, type, delegateUseCapture, true)\n }\n\n // only remove one listener\n matchFound = true\n break\n }\n }\n\n if (matchFound) { break }\n }\n }\n }\n\n // bound to the interactable context when a DOM event\n // listener is added to a selector interactable\n function delegateListener (event: Event, optionalArg?: any) {\n const options = getOptions(optionalArg)\n const fakeEvent = new FakeEvent(event)\n const delegates = delegatedEvents[event.type]\n const [eventTarget] = (pointerUtils.getEventTargets(event))\n let element: Node = eventTarget\n\n // climb up document tree looking for selector matches\n while (is.element(element)) {\n for (let i = 0; i < delegates.length; i++) {\n const cur = delegates[i]\n const { selector, context } = cur\n\n if (domUtils.matchesSelector(element, selector) &&\n domUtils.nodeContains(context, eventTarget) &&\n domUtils.nodeContains(context, element)) {\n const { listeners } = cur\n\n fakeEvent.currentTarget = element\n\n for (const [fn, { capture, passive }] of listeners) {\n if (capture === options.capture && passive === options.passive) {\n fn(fakeEvent)\n }\n }\n }\n }\n\n element = domUtils.parentNode(element)\n }\n }\n\n function delegateUseCapture (event: Event) {\n return delegateListener.call(this, event, true)\n }\n\n // for type inferrence\n return eventsMethods\n}\n\nexport class FakeEvent implements Partial {\n currentTarget: EventTarget\n originalEvent: Event\n\n constructor (originalEvent: Event) {\n this.originalEvent = originalEvent\n // duplicate the event so that currentTarget can be changed\n pExtend(this, originalEvent)\n }\n\n preventOriginalDefault () {\n this.originalEvent.preventDefault()\n }\n\n stopPropagation () {\n this.originalEvent.stopPropagation()\n }\n\n stopImmediatePropagation () {\n this.originalEvent.stopImmediatePropagation()\n }\n}\n\nfunction getOptions (param: { [index: string]: any } | boolean): { capture: boolean, passive: boolean } {\n if (!is.object(param)) { return { capture: !!param, passive: false } }\n\n const options = extend({}, param) as any\n\n options.capture = !!param.capture\n options.passive = !!param.passive\n\n return options\n}\n\nexport default {\n id: 'events',\n install,\n}\n","/** @module interact */\nimport * as Interact from '@interactjs/types/index'\nimport browser from '@interactjs/utils/browser'\nimport * as domUtils from '@interactjs/utils/domUtils'\nimport is from '@interactjs/utils/is'\nimport * as pointerUtils from '@interactjs/utils/pointerUtils'\n\nimport { Interactable } from './Interactable'\nimport { Options } from './defaultOptions'\nimport isNonNativeEvent from './isNonNativeEvent'\n\nexport interface InteractStatic {\n (target: Interact.Target, options?: Options): Interactable\n getPointerAverage: typeof pointerUtils.pointerAverage\n getTouchBBox: typeof pointerUtils.touchBBox\n getTouchDistance: typeof pointerUtils.touchDistance\n getTouchAngle: typeof pointerUtils.touchAngle\n getElementRect: typeof domUtils.getElementRect\n getElementClientRect: typeof domUtils.getElementClientRect\n matchesSelector: typeof domUtils.matchesSelector\n closest: typeof domUtils.closest\n /** @internal */ globalEvents: any\n version: string\n /** @internal */ scope: Interact.Scope\n use(plugin: Interact.Plugin, options?: {\n [key: string]: any\n }): any\n isSet(target: Interact.Element, options?: any): boolean\n on(type: string | Interact.EventTypes, listener: Interact.ListenersArg, options?: object): any\n off(type: Interact.EventTypes, listener: any, options?: object): any\n debug(): any\n supportsTouch(): boolean\n supportsPointerEvent(): boolean\n stop(): any\n pointerMoveTolerance(newValue?: number): any\n addDocument(doc: Document, options?: object): void\n removeDocument(doc: Document): void\n}\n\nexport function createInteractStatic (scope: Interact.Scope): Interact.InteractStatic {\n /**\n * ```js\n * interact('#draggable').draggable(true)\n *\n * var rectables = interact('rect')\n * rectables\n * .gesturable(true)\n * .on('gesturemove', function (event) {\n * // ...\n * })\n * ```\n *\n * The methods of this variable can be used to set elements as interactables\n * and also to change various default settings.\n *\n * Calling it as a function and passing an element or a valid CSS selector\n * string returns an Interactable object which has various methods to configure\n * it.\n *\n * @global\n *\n * @param {Element | string} target The HTML or SVG Element to interact with\n * or CSS selector\n * @return {Interactable}\n */\n const interact = ((target, options) => {\n let interactable = scope.interactables.get(target, options)\n\n if (!interactable) {\n interactable = scope.interactables.new(target, options)\n interactable.events.global = interact.globalEvents\n }\n\n return interactable\n }) as InteractStatic\n\n // expose the functions used to calculate multi-touch properties\n interact.getPointerAverage = pointerUtils.pointerAverage\n interact.getTouchBBox = pointerUtils.touchBBox\n interact.getTouchDistance = pointerUtils.touchDistance\n interact.getTouchAngle = pointerUtils.touchAngle\n\n interact.getElementRect = domUtils.getElementRect\n interact.getElementClientRect = domUtils.getElementClientRect\n interact.matchesSelector = domUtils.matchesSelector\n interact.closest = domUtils.closest\n\n interact.globalEvents = {} as any\n\n // eslint-disable-next-line no-undef\n interact.version = process.env.npm_package_version\n interact.scope = scope\n /**\n * Use a plugin\n *\n * @alias module:interact.use\n *\n * @param {Object} plugin\n * @param {function} plugin.install\n * @return {Interact.InteractStatic}\n */\n interact.use = function (plugin, options) {\n this.scope.usePlugin(plugin, options)\n\n return this\n }\n\n /**\n * Check if an element or selector has been set with the {@link interact}\n * function\n *\n * @alias module:interact.isSet\n *\n * @param {Element} element The Element being searched for\n * @return {boolean} Indicates if the element or CSS selector was previously\n * passed to interact\n */\n interact.isSet = function (target, options) {\n return !!this.scope.interactables.get(target, options && options.context)\n }\n\n /**\n * Add a global listener for an InteractEvent or adds a DOM event to `document`\n *\n * @alias module:interact.on\n *\n * @param {string | array | object} type The types of events to listen for\n * @param {function} listener The function event (s)\n * @param {object | boolean} [options] object or useCapture flag for\n * addEventListener\n * @return {object} interact\n */\n interact.on = function (type: string | Interact.EventTypes, listener: Interact.ListenersArg, options?: object) {\n if (is.string(type) && type.search(' ') !== -1) {\n type = type.trim().split(/ +/)\n }\n\n if (is.array(type)) {\n for (const eventType of (type as any[])) {\n this.on(eventType, listener, options)\n }\n\n return this\n }\n\n if (is.object(type)) {\n for (const prop in type) {\n this.on(prop, (type as any)[prop], listener)\n }\n\n return this\n }\n\n // if it is an InteractEvent type, add listener to globalEvents\n if (isNonNativeEvent(type, this.scope.actions)) {\n // if this type of event was never bound\n if (!this.globalEvents[type]) {\n this.globalEvents[type] = [listener]\n }\n else {\n this.globalEvents[type].push(listener)\n }\n }\n // If non InteractEvent type, addEventListener to document\n else {\n this.scope.events.add(this.scope.document, type, listener as Interact.Listener, { options })\n }\n\n return this\n }\n\n /**\n * Removes a global InteractEvent listener or DOM event from `document`\n *\n * @alias module:interact.off\n *\n * @param {string | array | object} type The types of events that were listened\n * for\n * @param {function} listener The listener function to be removed\n * @param {object | boolean} options [options] object or useCapture flag for\n * removeEventListener\n * @return {object} interact\n */\n interact.off = function (type: Interact.EventTypes, listener: any, options?: object) {\n if (is.string(type) && type.search(' ') !== -1) {\n type = type.trim().split(/ +/)\n }\n\n if (is.array(type)) {\n for (const eventType of type) {\n this.off(eventType, listener, options)\n }\n\n return this\n }\n\n if (is.object(type)) {\n for (const prop in type) {\n this.off(prop, type[prop], listener)\n }\n\n return this\n }\n\n if (isNonNativeEvent(type, this.scope.actions)) {\n let index: number\n\n if (type in this.globalEvents &&\n (index = this.globalEvents[type].indexOf(listener)) !== -1) {\n this.globalEvents[type].splice(index, 1)\n }\n }\n else {\n this.scope.events.remove(this.scope.document, type, listener, options)\n }\n\n return this\n }\n\n interact.debug = function () {\n return this.scope\n }\n\n /**\n * @alias module:interact.supportsTouch\n *\n * @return {boolean} Whether or not the browser supports touch input\n */\n interact.supportsTouch = function () {\n return browser.supportsTouch\n }\n\n /**\n * @alias module:interact.supportsPointerEvent\n *\n * @return {boolean} Whether or not the browser supports PointerEvents\n */\n interact.supportsPointerEvent = function () {\n return browser.supportsPointerEvent\n }\n\n /**\n * Cancels all interactions (end events are not fired)\n *\n * @alias module:interact.stop\n *\n * @return {object} interact\n */\n interact.stop = function () {\n for (const interaction of this.scope.interactions.list) {\n interaction.stop()\n }\n\n return this\n }\n\n /**\n * Returns or sets the distance the pointer must be moved before an action\n * sequence occurs. This also affects tolerance for tap events.\n *\n * @alias module:interact.pointerMoveTolerance\n *\n * @param {number} [newValue] The movement from the start position must be greater than this value\n * @return {interact | number}\n */\n interact.pointerMoveTolerance = function (newValue?: number) {\n if (is.number(newValue)) {\n this.scope.interactions.pointerMoveTolerance = newValue\n\n return this\n }\n\n return this.scope.interactions.pointerMoveTolerance\n }\n\n interact.addDocument = function (doc: Document, options?: object) {\n this.scope.addDocument(doc, options)\n }\n\n interact.removeDocument = function (doc: Document) {\n this.scope.removeDocument(doc)\n }\n\n return interact as any\n}\n","import * as Interact from '@interactjs/types/index'\nimport * as dom from '@interactjs/utils/domUtils'\n\nexport interface SearchDetails {\n pointer: Interact.PointerType\n pointerId: number\n pointerType: string\n eventType: string\n eventTarget: Interact.EventTarget\n curEventTarget: Interact.EventTarget\n scope: Interact.Scope\n}\n\nconst finder = {\n methodOrder: ['simulationResume', 'mouseOrPen', 'hasPointer', 'idle'] as const,\n\n search (details: SearchDetails) {\n for (const method of finder.methodOrder) {\n const interaction = finder[method](details)\n\n if (interaction) {\n return interaction\n }\n }\n\n return null\n },\n\n // try to resume simulation with a new pointer\n simulationResume ({ pointerType, eventType, eventTarget, scope }: SearchDetails) {\n if (!/down|start/i.test(eventType)) {\n return null\n }\n\n for (const interaction of scope.interactions.list) {\n let element = eventTarget as Node\n\n if (interaction.simulation && interaction.simulation.allowResume &&\n (interaction.pointerType === pointerType)) {\n while (element) {\n // if the element is the interaction element\n if (element === interaction.element) {\n return interaction\n }\n element = dom.parentNode(element)\n }\n }\n }\n\n return null\n },\n\n // if it's a mouse or pen interaction\n mouseOrPen ({ pointerId, pointerType, eventType, scope }: SearchDetails) {\n if (pointerType !== 'mouse' && pointerType !== 'pen') {\n return null\n }\n\n let firstNonActive\n\n for (const interaction of scope.interactions.list) {\n if (interaction.pointerType === pointerType) {\n // if it's a down event, skip interactions with running simulations\n if (interaction.simulation && !hasPointerId(interaction, pointerId)) { continue }\n\n // if the interaction is active, return it immediately\n if (interaction.interacting()) {\n return interaction\n }\n // otherwise save it and look for another active interaction\n else if (!firstNonActive) {\n firstNonActive = interaction\n }\n }\n }\n\n // if no active mouse interaction was found use the first inactive mouse\n // interaction\n if (firstNonActive) {\n return firstNonActive\n }\n\n // find any mouse or pen interaction.\n // ignore the interaction if the eventType is a *down, and a simulation\n // is active\n for (const interaction of scope.interactions.list) {\n if (interaction.pointerType === pointerType && !(/down/i.test(eventType) && interaction.simulation)) {\n return interaction\n }\n }\n\n return null\n },\n\n // get interaction that has this pointer\n hasPointer ({ pointerId, scope }: SearchDetails) {\n for (const interaction of scope.interactions.list) {\n if (hasPointerId(interaction, pointerId)) {\n return interaction\n }\n }\n\n return null\n },\n\n // get first idle interaction with a matching pointerType\n idle ({ pointerType, scope }: SearchDetails) {\n for (const interaction of scope.interactions.list) {\n // if there's already a pointer held down\n if (interaction.pointers.length === 1) {\n const target = interaction.interactable\n // don't add this pointer if there is a target interactable and it\n // isn't gesturable\n if (target && !(target.options.gesture && target.options.gesture.enabled)) {\n continue\n }\n }\n // maximum of 2 pointers per interaction\n else if (interaction.pointers.length >= 2) {\n continue\n }\n\n if (!interaction.interacting() && (pointerType === interaction.pointerType)) {\n return interaction\n }\n }\n\n return null\n },\n}\n\nfunction hasPointerId (interaction: Interact.Interaction, pointerId: number) {\n return interaction.pointers.some(({ id }) => id === pointerId)\n}\n\nexport default finder\n","import * as Interact from '@interactjs/types/index'\nimport browser from '@interactjs/utils/browser'\nimport domObjects from '@interactjs/utils/domObjects'\nimport { nodeContains } from '@interactjs/utils/domUtils'\nimport * as pointerUtils from '@interactjs/utils/pointerUtils'\n\nimport InteractionBase from './Interaction'\nimport interactablePreventDefault from './interactablePreventDefault'\nimport finder, { SearchDetails } from './interactionFinder'\n\ndeclare module '@interactjs/core/scope' {\n interface Scope {\n Interaction: typeof InteractionBase\n interactions: {\n new: (options: any) => InteractionBase\n list: InteractionBase[]\n listeners: { [type: string]: Interact.Listener }\n docEvents: Array<{ type: string, listener: Interact.Listener }>\n pointerMoveTolerance: number\n }\n prevTouchTime: number\n }\n}\n\ndeclare module '@interactjs/core/scope' {\n interface SignalArgs {\n 'interactions:find': {\n interaction: InteractionBase\n searchDetails: SearchDetails\n }\n }\n}\n\nconst methodNames = [\n 'pointerDown', 'pointerMove', 'pointerUp',\n 'updatePointer', 'removePointer', 'windowBlur',\n]\n\nfunction install (scope: Interact.Scope) {\n const listeners = {} as any\n\n for (const method of methodNames) {\n listeners[method] = doOnInteractions(method, scope)\n }\n\n const pEventTypes = browser.pEventTypes\n let docEvents: typeof scope.interactions.docEvents\n\n if (domObjects.PointerEvent) {\n docEvents = [\n { type: pEventTypes.down, listener: releasePointersOnRemovedEls },\n { type: pEventTypes.down, listener: listeners.pointerDown },\n { type: pEventTypes.move, listener: listeners.pointerMove },\n { type: pEventTypes.up, listener: listeners.pointerUp },\n { type: pEventTypes.cancel, listener: listeners.pointerUp },\n ]\n }\n else {\n docEvents = [\n { type: 'mousedown', listener: listeners.pointerDown },\n { type: 'mousemove', listener: listeners.pointerMove },\n { type: 'mouseup', listener: listeners.pointerUp },\n\n { type: 'touchstart', listener: releasePointersOnRemovedEls },\n { type: 'touchstart', listener: listeners.pointerDown },\n { type: 'touchmove', listener: listeners.pointerMove },\n { type: 'touchend', listener: listeners.pointerUp },\n { type: 'touchcancel', listener: listeners.pointerUp },\n ]\n }\n\n docEvents.push({\n type: 'blur',\n listener (event) {\n for (const interaction of scope.interactions.list) {\n interaction.documentBlur(event)\n }\n },\n })\n\n // for ignoring browser's simulated mouse events\n scope.prevTouchTime = 0\n\n scope.Interaction = class extends InteractionBase {\n get pointerMoveTolerance () {\n return scope.interactions.pointerMoveTolerance\n }\n\n set pointerMoveTolerance (value) {\n scope.interactions.pointerMoveTolerance = value\n }\n\n _now () { return scope.now() }\n }\n\n scope.interactions = {\n // all active and idle interactions\n list: [],\n new (options: { pointerType?: string, scopeFire?: Interact.Scope['fire'] }) {\n options.scopeFire = (name, arg) => scope.fire(name, arg)\n\n const interaction = new scope.Interaction(options as Required)\n\n scope.interactions.list.push(interaction)\n return interaction\n },\n listeners,\n docEvents,\n pointerMoveTolerance: 1,\n }\n\n function releasePointersOnRemovedEls () {\n // for all inactive touch interactions with pointers down\n for (const interaction of scope.interactions.list) {\n if (!interaction.pointerIsDown ||\n interaction.pointerType !== 'touch' ||\n interaction._interacting) {\n continue\n }\n\n // if a pointer is down on an element that is no longer in the DOM tree\n for (const pointer of interaction.pointers) {\n if (!scope.documents.some(({ doc }) => nodeContains(doc, pointer.downTarget))) {\n // remove the pointer from the interaction\n interaction.removePointer(pointer.pointer, pointer.event)\n }\n }\n }\n }\n\n scope.usePlugin(interactablePreventDefault)\n}\n\nfunction doOnInteractions (method, scope) {\n return function (event) {\n const interactions = scope.interactions.list\n\n const pointerType = pointerUtils.getPointerType(event)\n const [eventTarget, curEventTarget] = pointerUtils.getEventTargets(event)\n const matches = [] // [ [pointer, interaction], ...]\n\n if (/^touch/.test(event.type)) {\n scope.prevTouchTime = scope.now()\n\n for (const changedTouch of event.changedTouches) {\n const pointer = changedTouch\n const pointerId = pointerUtils.getPointerId(pointer)\n const searchDetails: SearchDetails = {\n pointer,\n pointerId,\n pointerType,\n eventType: event.type,\n eventTarget,\n curEventTarget,\n scope,\n }\n const interaction = getInteraction(searchDetails)\n\n matches.push([\n searchDetails.pointer,\n searchDetails.eventTarget,\n searchDetails.curEventTarget,\n interaction,\n ])\n }\n }\n else {\n let invalidPointer = false\n\n if (!browser.supportsPointerEvent && /mouse/.test(event.type)) {\n // ignore mouse events while touch interactions are active\n for (let i = 0; i < interactions.length && !invalidPointer; i++) {\n invalidPointer = interactions[i].pointerType !== 'mouse' && interactions[i].pointerIsDown\n }\n\n // try to ignore mouse events that are simulated by the browser\n // after a touch event\n invalidPointer = invalidPointer ||\n (scope.now() - scope.prevTouchTime < 500) ||\n // on iOS and Firefox Mobile, MouseEvent.timeStamp is zero if simulated\n event.timeStamp === 0\n }\n\n if (!invalidPointer) {\n const searchDetails = {\n pointer: event,\n pointerId: pointerUtils.getPointerId(event),\n pointerType,\n eventType: event.type,\n curEventTarget,\n eventTarget,\n scope,\n }\n\n const interaction = getInteraction(searchDetails)\n\n matches.push([\n searchDetails.pointer,\n searchDetails.eventTarget,\n searchDetails.curEventTarget,\n interaction,\n ])\n }\n }\n\n // eslint-disable-next-line no-shadow\n for (const [pointer, eventTarget, curEventTarget, interaction] of matches) {\n interaction[method](pointer, event, eventTarget, curEventTarget)\n }\n }\n}\n\nfunction getInteraction (searchDetails: SearchDetails) {\n const { pointerType, scope } = searchDetails\n\n const foundInteraction = finder.search(searchDetails)\n const signalArg = { interaction: foundInteraction, searchDetails }\n\n scope.fire('interactions:find', signalArg)\n\n return signalArg.interaction || scope.interactions.new({ pointerType })\n}\n\nfunction onDocSignal ({ doc, scope, options }: Interact.SignalArgs[T], eventMethodName: 'add' | 'remove') {\n const { interactions: { docEvents }, events } = scope\n const eventMethod = events[eventMethodName]\n\n if (scope.browser.isIOS && !options.events) {\n options.events = { passive: false }\n }\n\n // delegate event listener\n for (const eventType in events.delegatedEvents) {\n eventMethod(doc, eventType, events.delegateListener)\n eventMethod(doc, eventType, events.delegateUseCapture, true)\n }\n\n const eventOptions = options && options.events\n\n for (const { type, listener } of docEvents) {\n eventMethod(doc, type, listener, eventOptions)\n }\n}\n\nconst interactions: Interact.Plugin = {\n id: 'core/interactions',\n install,\n listeners: {\n 'scope:add-document': arg => onDocSignal(arg, 'add'),\n 'scope:remove-document': arg => onDocSignal(arg, 'remove'),\n 'interactable:unset': ({ interactable }, scope) => {\n // Stop and destroy related interactions when an Interactable is unset\n for (let i = scope.interactions.list.length - 1; i >= 0; i--) {\n const interaction = scope.interactions.list[i]\n\n if (interaction.interactable !== interactable) { continue }\n\n interaction.stop()\n scope.fire('interactions:destroy', { interaction })\n interaction.destroy()\n\n if (scope.interactions.list.length > 2) {\n scope.interactions.list.splice(i, 1)\n }\n }\n },\n },\n onDocSignal,\n doOnInteractions,\n methodNames,\n}\n\nexport default interactions\n","import * as Interact from '@interactjs/types/index'\nimport browser from '@interactjs/utils/browser'\nimport clone from '@interactjs/utils/clone'\nimport domObjects from '@interactjs/utils/domObjects'\nimport extend from '@interactjs/utils/extend'\nimport raf from '@interactjs/utils/raf'\nimport win from '@interactjs/utils/window'\n\nimport { Eventable } from './Eventable'\nimport { InteractEvent, PhaseMap } from './InteractEvent'\nimport { Interactable as InteractableBase } from './Interactable'\nimport { InteractableSet } from './InteractableSet'\nimport { defaults } from './defaultOptions'\nimport events from './events'\nimport { createInteractStatic } from './interactStatic'\nimport interactions from './interactions'\n\nexport interface SignalArgs {\n 'scope:add-document': DocSignalArg\n 'scope:remove-document': DocSignalArg\n 'interactable:unset': { interactable: InteractableBase }\n 'interactable:set': { interactable: InteractableBase, options: Interact.OptionsArg }\n 'interactions:destroy': { interaction: Interact.Interaction }\n}\n\nexport type ListenerName = keyof SignalArgs\n\nexport type ListenerMap = {\n [P in ListenerName]?: (arg: SignalArgs[P], scope: Scope, signalName: P) => void | boolean\n}\n\ninterface DocSignalArg {\n doc: Document\n window: Window\n scope: Scope\n options?: { [index: string]: any }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface ActionMap { // tslint:disable-line no-empty-interface\n}\n\nexport type ActionName = keyof ActionMap\n\nexport interface Actions {\n map: ActionMap\n phases: PhaseMap\n methodDict: { [P in ActionName]?: string }\n phaselessTypes: { [type: string]: true }\n}\n\n/**\n * plugin typedef\n * @typedef Plugin\n */\nexport interface Plugin {\n [key: string]: any\n id?: string\n listeners?: ListenerMap\n before?: string[]\n install? (scope: Scope, options?: any): void\n}\n\nexport class Scope {\n id = `__interact_scope_${Math.floor(Math.random() * 100)}`\n isInitialized = false\n listenerMaps: Array<{\n map: ListenerMap\n id: string\n }> = []\n\n browser = browser\n defaults = clone(defaults) as typeof defaults\n Eventable = Eventable\n actions: Actions = {\n map: {},\n phases: {\n start: true,\n move: true,\n end: true,\n },\n methodDict: {},\n phaselessTypes: {},\n }\n\n interactStatic = createInteractStatic(this)\n InteractEvent = InteractEvent\n Interactable: typeof InteractableBase\n interactables = new InteractableSet(this)\n\n // main window\n _win!: Window\n\n // main document\n document!: Document\n\n // main window\n window!: Window\n\n // all documents being listened to\n documents: Array<{ doc: Document, options: any }> = []\n\n _plugins: {\n list: Plugin[]\n map: { [id: string]: Plugin }\n } = {\n list: [],\n map: {},\n }\n\n constructor () {\n const scope = this\n\n this.Interactable = class extends InteractableBase {\n get _defaults () { return scope.defaults }\n\n set (this: T, options: Interact.OptionsArg) {\n super.set(options)\n\n scope.fire('interactable:set', {\n options,\n interactable: this,\n })\n\n return this\n }\n\n unset (this: InteractableBase) {\n super.unset()\n scope.interactables.list.splice(scope.interactables.list.indexOf(this), 1)\n\n scope.fire('interactable:unset', { interactable: this })\n }\n }\n }\n\n addListeners (map: ListenerMap, id?: string) {\n this.listenerMaps.push({ id, map })\n }\n\n fire (name: T, arg: SignalArgs[T]): void | false {\n for (const { map: { [name]: listener } } of this.listenerMaps) {\n if (!!listener && listener(arg as any, this, name as never) === false) {\n return false\n }\n }\n }\n\n onWindowUnload = (event: BeforeUnloadEvent) => this.removeDocument(event.target as Document)\n\n init (window: Window) {\n return this.isInitialized\n ? this\n : initScope(this, window)\n }\n\n pluginIsInstalled (plugin: Plugin) {\n return this._plugins.map[plugin.id] || this._plugins.list.indexOf(plugin) !== -1\n }\n\n usePlugin (plugin: Plugin, options?: { [key: string]: any }) {\n if (!this.isInitialized) {\n return this\n }\n\n if (this.pluginIsInstalled(plugin)) {\n return this\n }\n\n if (plugin.id) { this._plugins.map[plugin.id] = plugin }\n this._plugins.list.push(plugin)\n\n if (plugin.install) {\n plugin.install(this, options)\n }\n\n if (plugin.listeners && plugin.before) {\n let index = 0\n const len = this.listenerMaps.length\n const before = plugin.before.reduce((acc, id) => {\n acc[id] = true\n acc[pluginIdRoot(id)] = true\n return acc\n }, {})\n\n for (; index < len; index++) {\n const otherId = this.listenerMaps[index].id\n\n if (before[otherId] || before[pluginIdRoot(otherId)]) { break }\n }\n\n this.listenerMaps.splice(index, 0, { id: plugin.id, map: plugin.listeners })\n }\n else if (plugin.listeners) {\n this.listenerMaps.push({ id: plugin.id, map: plugin.listeners })\n }\n\n return this\n }\n\n addDocument (doc: Document, options?: any): void | false {\n // do nothing if document is already known\n if (this.getDocIndex(doc) !== -1) { return false }\n\n const window = win.getWindow(doc)\n\n options = options ? extend({}, options) : {}\n\n this.documents.push({ doc, options })\n this.events.documents.push(doc)\n\n // don't add an unload event for the main document\n // so that the page may be cached in browser history\n if (doc !== this.document) {\n this.events.add(window, 'unload', this.onWindowUnload)\n }\n\n this.fire('scope:add-document', { doc, window, scope: this, options })\n }\n\n removeDocument (doc: Document) {\n const index = this.getDocIndex(doc)\n\n const window = win.getWindow(doc)\n const options = this.documents[index].options\n\n this.events.remove(window, 'unload', this.onWindowUnload)\n\n this.documents.splice(index, 1)\n this.events.documents.splice(index, 1)\n\n this.fire('scope:remove-document', { doc, window, scope: this, options })\n }\n\n getDocIndex (doc: Document) {\n for (let i = 0; i < this.documents.length; i++) {\n if (this.documents[i].doc === doc) {\n return i\n }\n }\n\n return -1\n }\n\n getDocOptions (doc: Document) {\n const docIndex = this.getDocIndex(doc)\n\n return docIndex === -1 ? null : this.documents[docIndex].options\n }\n\n now () {\n return ((this.window as any).Date as typeof Date || Date).now()\n }\n}\n\nexport function initScope (scope: Scope, window: Window) {\n scope.isInitialized = true\n win.init(window)\n domObjects.init(window)\n browser.init(window)\n raf.init(window)\n\n scope.window = window\n scope.document = window.document\n\n scope.usePlugin(interactions)\n scope.usePlugin(events)\n\n return scope\n}\n\nfunction pluginIdRoot (id: string) {\n return id && id.replace(/\\/.*$/, '')\n}\n","import { Scope } from '@interactjs/core/scope'\n\nconst scope = new Scope()\n\nconst interact: import('@interactjs/core/interactStatic').InteractStatic = scope.interactStatic\n\nexport default interact\n\nexport const init = (win: Window) => scope.init(win)\n\nif (typeof window === 'object' && !!window) {\n init(window)\n}\n","export default () => {}\n","export default () => {}\n","import * as Interact from '@interactjs/types/index'\n\nexport type GridOptions = (Partial | Interact.Point) & {\n range?: number\n limits?: Interact.Rect\n offset?: Interact.Point\n}\n\nexport default (grid: GridOptions) => {\n const coordFields = ([\n ['x', 'y'],\n ['left', 'top'],\n ['right', 'bottom'],\n ['width', 'height'],\n ] as const).filter(([xField, yField]) => xField in grid || yField in grid)\n\n const gridFunc: Interact.SnapFunction & {\n grid: typeof grid\n coordFields: typeof coordFields\n } = (x, y) => {\n const {\n range,\n limits = {\n left : -Infinity,\n right : Infinity,\n top : -Infinity,\n bottom: Infinity,\n },\n offset = { x: 0, y: 0 },\n } = grid\n\n const result: Interact.SnapTarget & {\n grid: typeof grid\n } = { range, grid, x: null as number, y: null as number }\n\n for (const [xField, yField] of coordFields) {\n const gridx = Math.round((x - offset.x) / (grid as any)[xField])\n const gridy = Math.round((y - offset.y) / (grid as any)[yField])\n\n result[xField] = Math.max(limits.left, Math.min(limits.right, gridx * (grid as any)[xField] + offset.x))\n result[yField] = Math.max(limits.top, Math.min(limits.bottom, gridy * (grid as any)[yField] + offset.y))\n }\n\n return result\n }\n\n gridFunc.grid = grid\n gridFunc.coordFields = coordFields\n\n return gridFunc\n}\n","export { default as edgeTarget } from './edgeTarget'\nexport { default as elements } from './elements'\nexport { default as grid } from './grid'\n","import * as Interact from '@interactjs/types/index'\nimport extend from '@interactjs/utils/extend'\n\nimport * as allSnappers from './all'\n\ndeclare module '@interactjs/core/interactStatic' {\n export interface InteractStatic {\n snappers: typeof allSnappers\n createSnapGrid: typeof allSnappers.grid\n }\n}\n\nconst snappersPlugin: Interact.Plugin = {\n id: 'snappers',\n install (scope) {\n const { interactStatic: interact } = scope\n\n interact.snappers = extend(interact.snappers || {}, allSnappers)\n interact.createSnapGrid = interact.snappers.grid\n },\n}\n\nexport default snappersPlugin\n","/**\n * @module modifiers/aspectRatio\n *\n * @description\n * This module forces elements to be resized with a specified dx/dy ratio.\n *\n * @example\n * interact(target).resizable({\n * modifiers: [\n * interact.modifiers.snapSize({\n * targets: [ interact.createSnapGrid({ x: 20, y: 20 }) ],\n * }),\n * interact.aspectRatio({ ratio: 'preserve' }),\n * ],\n * });\n */\n\nimport * as Interact from '@interactjs/types/index'\nimport extend from '@interactjs/utils/extend'\nimport { addEdges } from '@interactjs/utils/rect'\n\nimport Modification from './Modification'\nimport { Modifier, ModifierModule, ModifierState, makeModifier } from './base'\n\nexport interface AspectRatioOptions {\n ratio?: number | 'preserve'\n equalDelta?: boolean\n modifiers?: Modifier[]\n enabled?: boolean\n}\n\nexport type AspectRatioState = ModifierState\n\nconst aspectRatio: ModifierModule = {\n start (arg) {\n const { state, rect, edges: originalEdges, pageCoords: coords } = arg\n let { ratio } = state.options\n const { equalDelta, modifiers } = state.options\n\n if (ratio === 'preserve') {\n ratio = rect.width / rect.height\n }\n\n state.startCoords = extend({}, coords)\n state.startRect = extend({}, rect)\n state.ratio = ratio\n state.equalDelta = equalDelta\n\n const linkedEdges = state.linkedEdges = {\n top : originalEdges.top || (originalEdges.left && !originalEdges.bottom),\n left : originalEdges.left || (originalEdges.top && !originalEdges.right),\n bottom: originalEdges.bottom || (originalEdges.right && !originalEdges.top),\n right : originalEdges.right || (originalEdges.bottom && !originalEdges.left),\n }\n\n state.xIsPrimaryAxis = !!(originalEdges.left || originalEdges.right)\n\n if (state.equalDelta) {\n state.edgeSign = (linkedEdges.left ? 1 : -1) * (linkedEdges.top ? 1 : -1) as 1 | -1\n }\n else {\n const negativeSecondaryEdge = state.xIsPrimaryAxis ? linkedEdges.top : linkedEdges.left\n state.edgeSign = negativeSecondaryEdge ? -1 : 1\n }\n\n extend(arg.edges, linkedEdges)\n\n if (!modifiers || !modifiers.length) { return }\n\n const subModification = new Modification(arg.interaction)\n\n subModification.copyFrom(arg.interaction.modification)\n subModification.prepareStates(modifiers)\n\n state.subModification = subModification\n subModification.startAll({ ...arg })\n },\n\n set (arg) {\n const { state, rect, coords } = arg\n const initialCoords = extend({}, coords)\n const aspectMethod = state.equalDelta ? setEqualDelta : setRatio\n\n aspectMethod(state, state.xIsPrimaryAxis, coords, rect)\n\n if (!state.subModification) { return null }\n\n const correctedRect = extend({}, rect)\n\n addEdges(state.linkedEdges, correctedRect, { x: coords.x - initialCoords.x, y: coords.y - initialCoords.y })\n\n const result = state.subModification.setAll({\n ...arg,\n rect: correctedRect,\n edges: state.linkedEdges,\n pageCoords: coords,\n prevCoords: coords,\n prevRect: correctedRect,\n })\n\n const { delta } = result\n\n if (result.changed) {\n const xIsCriticalAxis = Math.abs(delta.x) > Math.abs(delta.y)\n\n // do aspect modification again with critical edge axis as primary\n aspectMethod(state, xIsCriticalAxis, result.coords, result.rect)\n extend(coords, result.coords)\n }\n\n return result.eventProps\n },\n\n defaults: {\n ratio: 'preserve',\n equalDelta: false,\n modifiers: [],\n enabled: false,\n },\n}\n\nfunction setEqualDelta ({ startCoords, edgeSign }: AspectRatioState, xIsPrimaryAxis: boolean, coords: Interact.Point) {\n if (xIsPrimaryAxis) {\n coords.y = startCoords.y + (coords.x - startCoords.x) * edgeSign\n }\n else {\n coords.x = startCoords.x + (coords.y - startCoords.y) * edgeSign\n }\n}\n\nfunction setRatio ({ startRect, startCoords, ratio, edgeSign }: AspectRatioState, xIsPrimaryAxis: boolean, coords: Interact.Point, rect: Interact.Rect) {\n if (xIsPrimaryAxis) {\n const newHeight = rect.width / ratio\n\n coords.y = startCoords.y + (newHeight - startRect.height) * edgeSign\n }\n else {\n const newWidth = rect.height * ratio\n\n coords.x = startCoords.x + (newWidth - startRect.width) * edgeSign\n }\n}\n\nexport default makeModifier(aspectRatio, 'aspectRatio')\nexport { aspectRatio }\n","import { ModifierFunction } from './base'\n\nconst noop = (() => {\n}) as unknown as ModifierFunction\n\nnoop._defaults = {}\n\nexport default noop\n","export { default } from './noop'\n","import * as Interact from '@interactjs/types/index'\nimport extend from '@interactjs/utils/extend'\nimport is from '@interactjs/utils/is'\nimport * as rectUtils from '@interactjs/utils/rect'\n\nimport { makeModifier, ModifierArg, ModifierModule, ModifierState } from '../base'\n\nexport interface RestrictOptions {\n // where to drag over\n restriction: Interact.RectResolvable<[number, number, Interact.Interaction]>\n // what part of self is allowed to drag over\n elementRect: Interact.Rect\n offset: Interact.Rect\n // restrict just before the end drag\n endOnly: boolean\n enabled?: boolean\n}\n\nexport type RestrictState = ModifierState\n\nfunction start ({ rect, startOffset, state, interaction, pageCoords }: ModifierArg) {\n const { options } = state\n const { elementRect } = options\n const offset: Interact.Rect = extend({\n left: 0,\n top: 0,\n right: 0,\n bottom: 0,\n }, options.offset || {})\n\n if (rect && elementRect) {\n const restriction = getRestrictionRect(options.restriction, interaction, pageCoords)\n\n if (restriction) {\n const widthDiff = (restriction.right - restriction.left) - rect.width\n const heightDiff = (restriction.bottom - restriction.top) - rect.height\n\n if (widthDiff < 0) {\n offset.left += widthDiff\n offset.right += widthDiff\n }\n if (heightDiff < 0) {\n offset.top += heightDiff\n offset.bottom += heightDiff\n }\n }\n\n offset.left += startOffset.left - (rect.width * elementRect.left)\n offset.top += startOffset.top - (rect.height * elementRect.top)\n\n offset.right += startOffset.right - (rect.width * (1 - elementRect.right))\n offset.bottom += startOffset.bottom - (rect.height * (1 - elementRect.bottom))\n }\n\n state.offset = offset\n}\n\nfunction set ({ coords, interaction, state }: ModifierArg) {\n const { options, offset } = state\n\n const restriction = getRestrictionRect(options.restriction, interaction, coords)\n\n if (!restriction) { return }\n\n const rect = rectUtils.xywhToTlbr(restriction)\n\n coords.x = Math.max(Math.min(rect.right - offset.right, coords.x), rect.left + offset.left)\n coords.y = Math.max(Math.min(rect.bottom - offset.bottom, coords.y), rect.top + offset.top)\n}\n\nexport function getRestrictionRect (\n value: Interact.RectResolvable<[number, number, Interact.Interaction]>,\n interaction: Interact.Interaction,\n coords?: Interact.Point,\n) {\n if (is.func(value)) {\n return rectUtils.resolveRectLike(value, interaction.interactable, interaction.element, [coords.x, coords.y, interaction])\n } else {\n return rectUtils.resolveRectLike(value, interaction.interactable, interaction.element)\n }\n}\n\nconst defaults: RestrictOptions = {\n restriction: null,\n elementRect: null,\n offset: null,\n endOnly: false,\n enabled: false,\n}\n\nconst restrict: ModifierModule = {\n start,\n set,\n defaults,\n}\n\nexport default makeModifier(restrict, 'restrict')\nexport { restrict }\n","// This module adds the options.resize.restrictEdges setting which sets min and\n// max for the top, left, bottom and right edges of the target being resized.\n//\n// interact(target).resize({\n// edges: { top: true, left: true },\n// restrictEdges: {\n// inner: { top: 200, left: 200, right: 400, bottom: 400 },\n// outer: { top: 0, left: 0, right: 600, bottom: 600 },\n// },\n// })\n\nimport * as Interact from '@interactjs/types/index'\nimport extend from '@interactjs/utils/extend'\nimport * as rectUtils from '@interactjs/utils/rect'\n\nimport { makeModifier, ModifierArg, ModifierState } from '../base'\n\nimport { getRestrictionRect, RestrictOptions } from './pointer'\n\nexport interface RestrictEdgesOptions {\n inner: RestrictOptions['restriction']\n outer: RestrictOptions['restriction']\n offset?: RestrictOptions['offset']\n endOnly: boolean\n enabled?: boolean\n}\n\nexport type RestrictEdgesState = ModifierState\n\nconst noInner = { top: +Infinity, left: +Infinity, bottom: -Infinity, right: -Infinity }\nconst noOuter = { top: -Infinity, left: -Infinity, bottom: +Infinity, right: +Infinity }\n\nfunction start ({ interaction, startOffset, state }: ModifierArg) {\n const { options } = state\n let offset\n\n if (options) {\n const offsetRect = getRestrictionRect(options.offset, interaction, interaction.coords.start.page)\n\n offset = rectUtils.rectToXY(offsetRect)\n }\n\n offset = offset || { x: 0, y: 0 }\n\n state.offset = {\n top: offset.y + startOffset.top,\n left: offset.x + startOffset.left,\n bottom: offset.y - startOffset.bottom,\n right: offset.x - startOffset.right,\n }\n}\n\nfunction set ({ coords, edges, interaction, state }: ModifierArg) {\n const { offset, options } = state\n\n if (!edges) {\n return\n }\n\n const page = extend({}, coords)\n const inner = getRestrictionRect(options.inner, interaction, page) || {} as Interact.Rect\n const outer = getRestrictionRect(options.outer, interaction, page) || {} as Interact.Rect\n\n fixRect(inner, noInner)\n fixRect(outer, noOuter)\n\n if (edges.top) {\n coords.y = Math.min(Math.max(outer.top + offset.top, page.y), inner.top + offset.top)\n }\n else if (edges.bottom) {\n coords.y = Math.max(Math.min(outer.bottom + offset.bottom, page.y), inner.bottom + offset.bottom)\n }\n if (edges.left) {\n coords.x = Math.min(Math.max(outer.left + offset.left, page.x), inner.left + offset.left)\n }\n else if (edges.right) {\n coords.x = Math.max(Math.min(outer.right + offset.right, page.x), inner.right + offset.right)\n }\n}\n\nfunction fixRect (rect, defaults) {\n for (const edge of ['top', 'left', 'bottom', 'right']) {\n if (!(edge in rect)) {\n rect[edge] = defaults[edge]\n }\n }\n\n return rect\n}\n\nconst defaults: RestrictEdgesOptions = {\n inner: null,\n outer: null,\n offset: null,\n endOnly: false,\n enabled: false,\n}\n\nconst restrictEdges = {\n noInner,\n noOuter,\n start,\n set,\n defaults,\n}\n\nexport default makeModifier(restrictEdges, 'restrictEdges')\nexport { restrictEdges }\n","import extend from '@interactjs/utils/extend'\n\nimport { makeModifier } from '../base'\n\nimport { restrict } from './pointer'\n\nconst defaults = extend({\n get elementRect () {\n return { top: 0, left: 0, bottom: 1, right: 1 }\n },\n set elementRect (_) {},\n}, restrict.defaults)\n\nconst restrictRect = {\n start: restrict.start,\n set: restrict.set,\n defaults,\n}\n\nexport default makeModifier(restrictRect, 'restrictRect')\nexport { restrictRect }\n","import * as Interact from '@interactjs/types/index'\nimport extend from '@interactjs/utils/extend'\nimport * as rectUtils from '@interactjs/utils/rect'\n\nimport { makeModifier, ModifierArg, ModifierState } from '../base'\n\nimport { restrictEdges, RestrictEdgesState } from './edges'\nimport { getRestrictionRect, RestrictOptions } from './pointer'\n\nconst noMin = { width: -Infinity, height: -Infinity }\nconst noMax = { width: +Infinity, height: +Infinity }\n\nexport interface RestrictSizeOptions {\n min?: Interact.Size | Interact.Point | RestrictOptions['restriction']\n max?: Interact.Size | Interact.Point | RestrictOptions['restriction']\n endOnly: boolean\n enabled?: boolean\n}\n\nfunction start (arg: ModifierArg) {\n return restrictEdges.start(arg)\n}\n\nexport type RestrictSizeState =\n RestrictEdgesState & ModifierState\n\nfunction set (arg: ModifierArg) {\n const { interaction, state, rect, edges } = arg\n const { options } = state\n\n if (!edges) {\n return\n }\n\n const minSize = rectUtils.tlbrToXywh(getRestrictionRect(options.min as any, interaction, arg.coords)) || noMin\n const maxSize = rectUtils.tlbrToXywh(getRestrictionRect(options.max as any, interaction, arg.coords)) || noMax\n\n state.options = {\n endOnly: options.endOnly,\n inner: extend({}, restrictEdges.noInner),\n outer: extend({}, restrictEdges.noOuter),\n }\n\n if (edges.top) {\n state.options.inner.top = rect.bottom - minSize.height\n state.options.outer.top = rect.bottom - maxSize.height\n }\n else if (edges.bottom) {\n state.options.inner.bottom = rect.top + minSize.height\n state.options.outer.bottom = rect.top + maxSize.height\n }\n if (edges.left) {\n state.options.inner.left = rect.right - minSize.width\n state.options.outer.left = rect.right - maxSize.width\n }\n else if (edges.right) {\n state.options.inner.right = rect.left + minSize.width\n state.options.outer.right = rect.left + maxSize.width\n }\n\n restrictEdges.set(arg)\n\n state.options = options\n}\n\nconst defaults: RestrictSizeOptions = {\n min: null,\n max: null,\n endOnly: false,\n enabled: false,\n}\n\nconst restrictSize = {\n start,\n set,\n defaults,\n}\n\nexport default makeModifier(restrictSize, 'restrictSize')\nexport { restrictSize }\n","export { default } from './noop'\n","import * as Interact from '@interactjs/types/index'\nimport extend from '@interactjs/utils/extend'\nimport getOriginXY from '@interactjs/utils/getOriginXY'\nimport hypot from '@interactjs/utils/hypot'\nimport is from '@interactjs/utils/is'\nimport { resolveRectLike, rectToXY } from '@interactjs/utils/rect'\n\nimport { makeModifier, ModifierArg, ModifierState } from '../base'\n\nexport interface Offset {\n x: number\n y: number\n index: number\n relativePoint?: Interact.Point\n}\n\nexport interface SnapPosition {\n x?: number\n y?: number\n range?: number\n offset?: Offset\n [index: string]: any\n}\n\nexport type SnapFunction = (\n x: number,\n y: number,\n interaction: Interact.InteractionProxy,\n offset: Offset,\n index: number\n) => SnapPosition\nexport type SnapTarget = SnapPosition | SnapFunction\nexport interface SnapOptions {\n targets: SnapTarget[]\n // target range\n range: number\n // self points for snapping. [0,0] = top left, [1,1] = bottom right\n relativePoints: Interact.Point[]\n // startCoords = offset snapping from drag start page position\n offset: Interact.Point | Interact.RectResolvable<[Interact.Interaction]> | 'startCoords'\n offsetWithOrigin?: boolean\n origin: Interact.RectResolvable<[Interact.Element]> | Interact.Point\n endOnly?: boolean\n enabled?: boolean\n}\n\nexport type SnapState = ModifierState\n\nfunction start (arg: ModifierArg) {\n const { interaction, interactable, element, rect, state, startOffset } = arg\n const { options } = state\n const origin = options.offsetWithOrigin\n ? getOrigin(arg)\n : { x: 0, y: 0 }\n\n let snapOffset: Interact.Point\n\n if (options.offset === 'startCoords') {\n snapOffset = {\n x: interaction.coords.start.page.x,\n y: interaction.coords.start.page.y,\n }\n }\n else {\n const offsetRect = resolveRectLike(options.offset as any, interactable, element, [interaction])\n\n snapOffset = rectToXY(offsetRect) || { x: 0, y: 0 }\n snapOffset.x += origin.x\n snapOffset.y += origin.y\n }\n\n const { relativePoints } = options\n\n state.offsets = rect && relativePoints && relativePoints.length\n ? relativePoints.map((relativePoint, index) => ({\n index,\n relativePoint,\n x: startOffset.left - (rect.width * relativePoint.x) + snapOffset.x,\n y: startOffset.top - (rect.height * relativePoint.y) + snapOffset.y,\n }))\n : [extend({\n index: 0,\n relativePoint: null,\n }, snapOffset)]\n}\n\nfunction set (arg: ModifierArg) {\n const { interaction, coords, state } = arg\n const { options, offsets } = state\n\n const origin = getOriginXY(interaction.interactable, interaction.element, interaction.prepared.name)\n const page = extend({}, coords)\n const targets = []\n\n if (!options.offsetWithOrigin) {\n page.x -= origin.x\n page.y -= origin.y\n }\n\n for (const offset of offsets) {\n const relativeX = page.x - offset.x\n const relativeY = page.y - offset.y\n\n for (let index = 0, len = options.targets.length; index < len; index++) {\n const snapTarget = options.targets[index]\n let target: SnapPosition\n\n if (is.func(snapTarget)) {\n target = snapTarget(relativeX, relativeY, interaction._proxy, offset, index)\n }\n else {\n target = snapTarget\n }\n\n if (!target) { continue }\n\n targets.push({\n x: (is.number(target.x) ? target.x : relativeX) + offset.x,\n y: (is.number(target.y) ? target.y : relativeY) + offset.y,\n\n range: is.number(target.range) ? target.range : options.range,\n source: snapTarget,\n index,\n offset,\n })\n }\n }\n\n const closest = {\n target: null,\n inRange: false,\n distance: 0,\n range: 0,\n delta: { x: 0, y: 0 },\n }\n\n for (const target of targets) {\n const range = target.range\n const dx = target.x - page.x\n const dy = target.y - page.y\n const distance = hypot(dx, dy)\n let inRange = distance <= range\n\n // Infinite targets count as being out of range\n // compared to non infinite ones that are in range\n if (range === Infinity && closest.inRange && closest.range !== Infinity) {\n inRange = false\n }\n\n if (!closest.target || (inRange\n // is the closest target in range?\n ? (closest.inRange && range !== Infinity\n // the pointer is relatively deeper in this target\n ? distance / range < closest.distance / closest.range\n // this target has Infinite range and the closest doesn't\n : (range === Infinity && closest.range !== Infinity) ||\n // OR this target is closer that the previous closest\n distance < closest.distance)\n // The other is not in range and the pointer is closer to this target\n : (!closest.inRange && distance < closest.distance))) {\n closest.target = target\n closest.distance = distance\n closest.range = range\n closest.inRange = inRange\n closest.delta.x = dx\n closest.delta.y = dy\n }\n }\n\n if (closest.inRange) {\n coords.x = closest.target.x\n coords.y = closest.target.y\n }\n\n state.closest = closest\n return closest\n}\n\nfunction getOrigin (arg: Partial>) {\n const { element } = arg.interaction\n const optionsOrigin = rectToXY(\n resolveRectLike(arg.state.options.origin as any, null, null, [element]),\n )\n const origin = optionsOrigin || getOriginXY(\n arg.interactable,\n element,\n arg.interaction.prepared.name,\n )\n\n return origin\n}\n\nconst defaults: SnapOptions = {\n range : Infinity,\n targets: null,\n offset: null,\n offsetWithOrigin: true,\n origin: null,\n relativePoints: null,\n endOnly: false,\n enabled: false,\n}\nconst snap = {\n start,\n set,\n defaults,\n}\n\nexport default makeModifier(snap, 'snap')\nexport { snap }\n","// This module allows snapping of the size of targets during resize\n// interactions.\n\nimport extend from '@interactjs/utils/extend'\nimport is from '@interactjs/utils/is'\n\nimport { makeModifier, ModifierArg } from '../base'\n\nimport { snap, SnapOptions, SnapState } from './pointer'\n\nexport type SnapSizeOptions = Pick<\nSnapOptions,\n'targets' | 'offset' | 'endOnly' | 'range' | 'enabled'\n>\n\nfunction start (arg: ModifierArg) {\n const { state, edges } = arg\n const { options } = state\n\n if (!edges) { return null }\n\n arg.state = {\n options: {\n targets: null,\n relativePoints: [{\n x: edges.left ? 0 : 1,\n y: edges.top ? 0 : 1,\n }],\n offset: options.offset || 'self',\n origin: { x: 0, y: 0 },\n range: options.range,\n },\n }\n\n state.targetFields = state.targetFields || [\n ['width', 'height'],\n ['x', 'y'],\n ]\n\n snap.start(arg)\n state.offsets = arg.state.offsets\n\n arg.state = state\n}\n\nfunction set (arg) {\n const { interaction, state, coords } = arg\n const { options, offsets } = state\n const relative = {\n x: coords.x - offsets[0].x,\n y: coords.y - offsets[0].y,\n }\n\n state.options = extend({}, options)\n state.options.targets = []\n\n for (const snapTarget of (options.targets || [])) {\n let target\n\n if (is.func(snapTarget)) {\n target = snapTarget(relative.x, relative.y, interaction)\n }\n else {\n target = snapTarget\n }\n\n if (!target) { continue }\n\n for (const [xField, yField] of state.targetFields) {\n if (xField in target || yField in target) {\n target.x = target[xField]\n target.y = target[yField]\n\n break\n }\n }\n\n state.options.targets.push(target)\n }\n\n const returnValue = snap.set(arg)\n\n state.options = options\n\n return returnValue\n}\n\nconst defaults: SnapSizeOptions = {\n range: Infinity,\n targets: null,\n offset: null,\n endOnly: false,\n enabled: false,\n}\n\nconst snapSize = {\n start,\n set,\n defaults,\n}\n\nexport default makeModifier(snapSize, 'snapSize')\nexport { snapSize }\n","/**\n * @module modifiers/snapEdges\n *\n * @description\n * This module allows snapping of the edges of targets during resize\n * interactions.\n *\n * @example\n * interact(target).resizable({\n * snapEdges: {\n * targets: [interact.snappers.grid({ x: 100, y: 50 })],\n * },\n * })\n *\n * interact(target).resizable({\n * snapEdges: {\n * targets: [\n * interact.snappers.grid({\n * top: 50,\n * left: 50,\n * bottom: 100,\n * right: 100,\n * }),\n * ],\n * },\n * })\n */\n\nimport clone from '@interactjs/utils/clone'\nimport extend from '@interactjs/utils/extend'\n\nimport { makeModifier, ModifierArg, ModifierModule } from '../base'\n\nimport { SnapOptions, SnapState } from './pointer'\nimport { snapSize } from './size'\n\nexport type SnapEdgesOptions = Pick\n\nfunction start (arg: ModifierArg) {\n const { edges } = arg\n\n if (!edges) { return null }\n\n arg.state.targetFields = arg.state.targetFields || [\n [edges.left ? 'left' : 'right', edges.top ? 'top' : 'bottom'],\n ]\n\n return snapSize.start(arg)\n}\n\nconst snapEdges: ModifierModule = {\n start,\n set: snapSize.set,\n defaults: extend(\n clone(snapSize.defaults),\n {\n targets: null,\n range: null,\n offset: { x: 0, y: 0 },\n } as const,\n ),\n}\n\nexport default makeModifier(snapEdges, 'snapEdges')\nexport { snapEdges }\n","export { default } from './noop'\n","/* eslint-disable node/no-extraneous-import */\nimport aspectRatio from './aspectRatio'\nimport avoid from './avoid'\nimport restrictEdges from './restrict/edges'\nimport restrict from './restrict/pointer'\nimport restrictRect from './restrict/rect'\nimport restrictSize from './restrict/size'\nimport rubberband from './rubberband'\nimport snapEdges from './snap/edges'\nimport snap from './snap/pointer'\nimport snapSize from './snap/size'\nimport spring from './spring'\nimport transform from './transform'\n\nexport default {\n aspectRatio,\n restrictEdges,\n restrict,\n restrictRect,\n restrictSize,\n snapEdges,\n snap,\n snapSize,\n\n spring,\n avoid,\n transform,\n rubberband,\n}\n","import snappers from '@interactjs/snappers/plugin'\nimport * as Interact from '@interactjs/types/index'\n\nimport all from './all'\nimport base from './base'\n\ndeclare module '@interactjs/core/interactStatic' {\n export interface InteractStatic {\n modifiers: typeof all\n }\n}\n\nconst modifiers: Interact.Plugin = {\n id: 'modifiers',\n install (scope) {\n const { interactStatic: interact } = scope\n\n scope.usePlugin(base)\n scope.usePlugin(snappers)\n\n interact.modifiers = all\n\n // for backwrads compatibility\n for (const type in all) {\n const { _defaults, _methods } = all[type as keyof typeof all]\n\n ;(_defaults as any)._methods = _methods\n ;(scope.defaults.perAction as any)[type] = _defaults\n }\n },\n}\n\nexport default modifiers\n","import * as Interact from '@interactjs/types/index'\nimport * as pointerUtils from '@interactjs/utils/pointerUtils'\n\nimport BaseEvent from '../core/BaseEvent'\n\nexport default class PointerEvent extends BaseEvent {\n type: T\n originalEvent: Interact.PointerEventType\n pointerId: number\n pointerType: string\n double: boolean\n pageX: number\n pageY: number\n clientX: number\n clientY: number\n dt: number\n eventable: any\n [key: string]: any\n\n /** */\n constructor (\n type: T,\n pointer: Interact.PointerType | PointerEvent,\n event: Interact.PointerEventType,\n eventTarget: Interact.EventTarget,\n interaction: Interact.Interaction,\n timeStamp: number,\n ) {\n super(interaction)\n pointerUtils.pointerExtend(this, event)\n\n if (event !== pointer) {\n pointerUtils.pointerExtend(this, pointer)\n }\n\n this.timeStamp = timeStamp\n this.originalEvent = event\n this.type = type\n this.pointerId = pointerUtils.getPointerId(pointer)\n this.pointerType = pointerUtils.getPointerType(pointer)\n this.target = eventTarget\n this.currentTarget = null\n\n if (type === 'tap') {\n const pointerIndex = interaction.getPointerIndex(pointer)\n this.dt = this.timeStamp - interaction.pointers[pointerIndex].downTime\n\n const interval = this.timeStamp - interaction.tapTime\n\n this.double = !!(interaction.prevTap &&\n interaction.prevTap.type !== 'doubletap' &&\n interaction.prevTap.target === this.target &&\n interval < 500)\n }\n else if (type === 'doubletap') {\n this.dt = (pointer as PointerEvent<'tap'>).timeStamp - interaction.tapTime\n }\n }\n\n _subtractOrigin ({ x: originX, y: originY }: Interact.Point) {\n this.pageX -= originX\n this.pageY -= originY\n this.clientX -= originX\n this.clientY -= originY\n\n return this\n }\n\n _addOrigin ({ x: originX, y: originY }: Interact.Point) {\n this.pageX += originX\n this.pageY += originY\n this.clientX += originX\n this.clientY += originY\n\n return this\n }\n\n /**\n * Prevent the default behaviour of the original Event\n */\n preventDefault () {\n this.originalEvent.preventDefault()\n }\n}\n\nexport { PointerEvent }\n","import { Eventable } from '@interactjs/core/Eventable'\nimport { Interaction } from '@interactjs/core/Interaction'\nimport { PerActionDefaults } from '@interactjs/core/defaultOptions'\nimport { Scope } from '@interactjs/core/scope'\nimport * as Interact from '@interactjs/types/index'\nimport * as domUtils from '@interactjs/utils/domUtils'\nimport extend from '@interactjs/utils/extend'\nimport getOriginXY from '@interactjs/utils/getOriginXY'\n\nimport { PointerEvent } from './PointerEvent'\n\nexport type EventTargetList = Array<{\n node: Node\n eventable: Eventable\n props: { [key: string]: any }\n}>\n\nexport interface PointerEventOptions extends PerActionDefaults {\n enabled?: undefined // not used\n holdDuration?: number\n ignoreFrom?: any\n allowFrom?: any\n origin?: Interact.Point | string | Interact.Element\n}\n\ndeclare module '@interactjs/core/scope' {\n interface Scope {\n pointerEvents: typeof pointerEvents\n }\n}\n\ndeclare module '@interactjs/core/Interaction' {\n interface Interaction {\n prevTap?: PointerEvent\n tapTime?: number\n }\n}\n\ndeclare module '@interactjs/core/PointerInfo' {\n interface PointerInfo {\n hold?: {\n duration: number\n timeout: any\n }\n }\n}\n\ndeclare module '@interactjs/core/defaultOptions' {\n interface ActionDefaults {\n pointerEvents: Interact.Options\n }\n}\n\ndeclare module '@interactjs/core/scope' {\n interface SignalArgs {\n 'pointerEvents:new': { pointerEvent: PointerEvent }\n 'pointerEvents:fired': {\n interaction: Interaction\n pointer: Interact.PointerType | PointerEvent\n event: Interact.PointerEventType | PointerEvent\n eventTarget: Interact.EventTarget\n pointerEvent: PointerEvent\n targets?: EventTargetList\n type: string\n }\n 'pointerEvents:collect-targets': {\n interaction: Interaction\n pointer: Interact.PointerType | PointerEvent\n event: Interact.PointerEventType | PointerEvent\n eventTarget: Interact.EventTarget\n targets?: EventTargetList\n type: string\n path: Node[]\n node: null\n }\n }\n}\n\nconst defaults: PointerEventOptions = {\n holdDuration: 600,\n ignoreFrom : null,\n allowFrom : null,\n origin : { x: 0, y: 0 },\n}\n\nconst pointerEvents: Interact.Plugin = {\n id: 'pointer-events/base',\n before: ['inertia', 'modifiers', 'auto-start', 'actions'],\n install,\n listeners: {\n 'interactions:new': addInteractionProps,\n 'interactions:update-pointer': addHoldInfo,\n 'interactions:move': moveAndClearHold,\n 'interactions:down': (arg, scope) => {\n downAndStartHold(arg, scope)\n fire(arg, scope)\n },\n 'interactions:up': (arg, scope) => {\n clearHold(arg)\n fire(arg, scope)\n tapAfterUp(arg, scope)\n },\n 'interactions:cancel': (arg, scope) => {\n clearHold(arg)\n fire(arg, scope)\n },\n },\n PointerEvent,\n fire,\n collectEventTargets,\n defaults,\n types: {\n down: true,\n move: true,\n up: true,\n cancel: true,\n tap: true,\n doubletap: true,\n hold: true,\n } as { [type: string]: true },\n}\n\nfunction fire (\n arg: {\n pointer: Interact.PointerType | PointerEvent\n event: Interact.PointerEventType | PointerEvent\n eventTarget: Interact.EventTarget\n interaction: Interaction\n type: T\n targets?: EventTargetList\n },\n scope: Interact.Scope,\n) {\n const {\n interaction,\n pointer,\n event,\n eventTarget,\n type,\n targets = collectEventTargets(arg, scope),\n } = arg\n\n const pointerEvent = new PointerEvent(type, pointer, event, eventTarget, interaction, scope.now())\n\n scope.fire('pointerEvents:new', { pointerEvent })\n\n const signalArg = {\n interaction,\n pointer,\n event,\n eventTarget,\n targets,\n type,\n pointerEvent,\n }\n\n for (let i = 0; i < targets.length; i++) {\n const target = targets[i]\n\n for (const prop in target.props || {}) {\n (pointerEvent as any)[prop] = target.props[prop]\n }\n\n const origin = getOriginXY(target.eventable, target.node)\n\n pointerEvent._subtractOrigin(origin)\n pointerEvent.eventable = target.eventable\n pointerEvent.currentTarget = target.node\n\n target.eventable.fire(pointerEvent)\n\n pointerEvent._addOrigin(origin)\n\n if (pointerEvent.immediatePropagationStopped ||\n (pointerEvent.propagationStopped &&\n (i + 1) < targets.length && targets[i + 1].node !== pointerEvent.currentTarget)) {\n break\n }\n }\n\n scope.fire('pointerEvents:fired', signalArg)\n\n if (type === 'tap') {\n // if pointerEvent should make a double tap, create and fire a doubletap\n // PointerEvent and use that as the prevTap\n const prevTap = pointerEvent.double\n ? fire({\n interaction,\n pointer,\n event,\n eventTarget,\n type: 'doubletap',\n }, scope)\n : pointerEvent\n\n interaction.prevTap = prevTap\n interaction.tapTime = prevTap.timeStamp\n }\n\n return pointerEvent\n}\n\nfunction collectEventTargets ({ interaction, pointer, event, eventTarget, type }: {\n interaction: Interaction\n pointer: Interact.PointerType | PointerEvent\n event: Interact.PointerEventType | PointerEvent\n eventTarget: Interact.EventTarget\n type: T\n}, scope: Interact.Scope) {\n const pointerIndex = interaction.getPointerIndex(pointer)\n const pointerInfo = interaction.pointers[pointerIndex]\n\n // do not fire a tap event if the pointer was moved before being lifted\n if (type === 'tap' && (interaction.pointerWasMoved ||\n // or if the pointerup target is different to the pointerdown target\n !(pointerInfo && pointerInfo.downTarget === eventTarget))) {\n return []\n }\n\n const path = domUtils.getPath(eventTarget as Interact.Element | Document)\n const signalArg = {\n interaction,\n pointer,\n event,\n eventTarget,\n type,\n path,\n targets: [] as EventTargetList,\n node: null,\n }\n\n for (const node of path) {\n signalArg.node = node\n\n scope.fire('pointerEvents:collect-targets', signalArg)\n }\n\n if (type === 'hold') {\n signalArg.targets = signalArg.targets.filter(target =>\n target.eventable.options.holdDuration === interaction.pointers[pointerIndex].hold.duration)\n }\n\n return signalArg.targets\n}\n\nfunction addInteractionProps ({ interaction }) {\n interaction.prevTap = null // the most recent tap event on this interaction\n interaction.tapTime = 0 // time of the most recent tap event\n}\n\nfunction addHoldInfo ({ down, pointerInfo }: Interact.SignalArgs['interactions:update-pointer']) {\n if (!down && pointerInfo.hold) {\n return\n }\n\n pointerInfo.hold = { duration: Infinity, timeout: null }\n}\n\nfunction clearHold ({ interaction, pointerIndex }) {\n if (interaction.pointers[pointerIndex].hold) {\n clearTimeout(interaction.pointers[pointerIndex].hold.timeout)\n }\n}\n\nfunction moveAndClearHold (\n { interaction, pointer, event, eventTarget, duplicate }: Interact.SignalArgs['interactions:move'],\n scope: Interact.Scope,\n) {\n const pointerIndex = interaction.getPointerIndex(pointer)\n\n if (!duplicate && (!interaction.pointerIsDown || interaction.pointerWasMoved)) {\n if (interaction.pointerIsDown) {\n clearTimeout(interaction.pointers[pointerIndex].hold.timeout)\n }\n\n fire({\n interaction,\n pointer,\n event,\n eventTarget: eventTarget as Interact.Element,\n type: 'move',\n }, scope)\n }\n}\n\nfunction downAndStartHold ({ interaction, pointer, event, eventTarget, pointerIndex }: Interact.SignalArgs['interactions:down'], scope: Interact.Scope) {\n const timer = interaction.pointers[pointerIndex].hold\n const path = domUtils.getPath(eventTarget as Interact.Element | Document)\n const signalArg = {\n interaction,\n pointer,\n event,\n eventTarget,\n type: 'hold',\n targets: [] as EventTargetList,\n path,\n node: null,\n }\n\n for (const node of path) {\n signalArg.node = node\n\n scope.fire('pointerEvents:collect-targets', signalArg)\n }\n\n if (!signalArg.targets.length) { return }\n\n let minDuration = Infinity\n\n for (const target of signalArg.targets) {\n const holdDuration = target.eventable.options.holdDuration\n\n if (holdDuration < minDuration) {\n minDuration = holdDuration\n }\n }\n\n timer.duration = minDuration\n timer.timeout = setTimeout(() => {\n fire({\n interaction,\n eventTarget,\n pointer,\n event,\n type: 'hold',\n }, scope)\n }, minDuration)\n}\n\nfunction tapAfterUp ({ interaction, pointer, event, eventTarget }: Interact.SignalArgs['interactions:up'], scope: Interact.Scope) {\n if (!interaction.pointerWasMoved) {\n fire({ interaction, eventTarget, pointer, event, type: 'tap' }, scope)\n }\n}\n\nfunction install (scope: Scope) {\n scope.pointerEvents = pointerEvents\n scope.defaults.actions.pointerEvents = pointerEvents.defaults\n extend(scope.actions.phaselessTypes, pointerEvents.types)\n}\n\nexport default pointerEvents\n","import { ListenerMap } from '@interactjs/core/scope'\nimport * as Interact from '@interactjs/types/index'\n\nimport PointerEvent from './PointerEvent'\nimport basePlugin from './base'\n\ndeclare module '@interactjs/core/Interaction' {\n interface Interaction {\n holdIntervalHandle?: any\n }\n}\n\ndeclare module '@interactjs/pointer-events/PointerEvent' {\n interface PointerEvent {\n count?: number\n }\n}\n\ndeclare module '@interactjs/pointer-events/base' {\n interface PointerEventOptions {\n holdRepeatInterval?: number\n }\n}\n\nfunction install (scope: Interact.Scope) {\n scope.usePlugin(basePlugin)\n\n const {\n pointerEvents,\n } = scope\n\n // don't repeat by default\n pointerEvents.defaults.holdRepeatInterval = 0\n pointerEvents.types.holdrepeat = scope.actions.phaselessTypes.holdrepeat = true\n}\n\nfunction onNew ({ pointerEvent }: { pointerEvent: PointerEvent }) {\n if (pointerEvent.type !== 'hold') { return }\n\n pointerEvent.count = (pointerEvent.count || 0) + 1\n}\n\nfunction onFired (\n { interaction, pointerEvent, eventTarget, targets }: Interact.SignalArgs['pointerEvents:fired'],\n scope: Interact.Scope,\n) {\n if (pointerEvent.type !== 'hold' || !targets.length) { return }\n\n // get the repeat interval from the first eventable\n const interval = targets[0].eventable.options.holdRepeatInterval\n\n // don't repeat if the interval is 0 or less\n if (interval <= 0) { return }\n\n // set a timeout to fire the holdrepeat event\n interaction.holdIntervalHandle = setTimeout(() => {\n scope.pointerEvents.fire({\n interaction,\n eventTarget,\n type: 'hold',\n pointer: pointerEvent,\n event: pointerEvent,\n }, scope)\n }, interval)\n}\n\nfunction endHoldRepeat ({ interaction }: { interaction: Interact.Interaction }) {\n // set the interaction's holdStopTime property\n // to stop further holdRepeat events\n if (interaction.holdIntervalHandle) {\n clearInterval(interaction.holdIntervalHandle)\n interaction.holdIntervalHandle = null\n }\n}\n\nconst holdRepeat: Interact.Plugin = {\n id: 'pointer-events/holdRepeat',\n install,\n listeners: ['move', 'up', 'cancel', 'endall'].reduce(\n (acc, enderTypes) => {\n (acc as any)[`pointerEvents:${enderTypes}`] = endHoldRepeat\n return acc\n },\n {\n 'pointerEvents:new': onNew,\n 'pointerEvents:fired': onFired,\n } as ListenerMap,\n ),\n}\n\nexport default holdRepeat\n","import * as Interact from '@interactjs/types/index'\nimport extend from '@interactjs/utils/extend'\n\ndeclare module '@interactjs/core/Interactable' {\n interface Interactable {\n pointerEvents: typeof pointerEventsMethod\n __backCompatOption: (optionName: string, newValue: any) => any\n }\n}\n\nfunction install (scope: Interact.Scope) {\n const { Interactable } = scope\n\n Interactable.prototype.pointerEvents = pointerEventsMethod\n\n const __backCompatOption = Interactable.prototype._backCompatOption\n\n Interactable.prototype._backCompatOption = function (optionName, newValue) {\n const ret = __backCompatOption.call(this, optionName, newValue)\n\n if (ret === this) {\n this.events.options[optionName] = newValue\n }\n\n return ret\n }\n}\n\nfunction pointerEventsMethod (this: Interact.Interactable, options: any) {\n extend(this.events.options, options)\n\n return this\n}\n\nconst plugin: Interact.Plugin = {\n id: 'pointer-events/interactableTargets',\n install,\n listeners: {\n 'pointerEvents:collect-targets': ({\n targets,\n node,\n type,\n eventTarget,\n }, scope) => {\n scope.interactables.forEachMatch(node, (interactable: Interact.Interactable) => {\n const eventable = interactable.events\n const options = eventable.options\n\n if (\n eventable.types[type] &&\n eventable.types[type].length &&\n interactable.testIgnoreAllow(options, node, eventTarget)) {\n targets.push({\n node,\n eventable,\n props: { interactable },\n })\n }\n })\n },\n\n 'interactable:new': ({ interactable }) => {\n interactable.events.getRect = function (element: Interact.Element) {\n return interactable.getRect(element)\n }\n },\n\n 'interactable:set': ({ interactable, options }, scope) => {\n extend(interactable.events.options, scope.pointerEvents.defaults)\n extend(interactable.events.options, options.pointerEvents || {})\n },\n },\n}\n\nexport default plugin\n","import * as Interact from '@interactjs/types/index'\n\nimport * as pointerEvents from './base'\nimport holdRepeat from './holdRepeat'\nimport interactableTargets from './interactableTargets'\n\nconst plugin: Interact.Plugin = {\n id: 'pointer-events',\n install (scope) {\n scope.usePlugin(pointerEvents)\n scope.usePlugin(holdRepeat)\n scope.usePlugin(interactableTargets)\n },\n}\n\nexport default plugin\n\nexport {\n pointerEvents,\n holdRepeat,\n interactableTargets,\n}\n","import { Interactable } from '@interactjs/core/Interactable'\nimport { ActionProps, Interaction } from '@interactjs/core/Interaction'\nimport { Scope } from '@interactjs/core/scope'\nimport * as Interact from '@interactjs/types/index'\nimport * as arr from '@interactjs/utils/arr'\nimport extend from '@interactjs/utils/extend'\nimport is from '@interactjs/utils/is'\nimport * as pointerUtils from '@interactjs/utils/pointerUtils'\nimport { tlbrToXywh } from '@interactjs/utils/rect'\n\ndeclare module '@interactjs/core/Interactable' {\n interface Interactable {\n reflow: (action: ActionProps) => ReturnType\n }\n}\n\ndeclare module '@interactjs/core/Interaction' {\n interface Interaction {\n _reflowPromise: Promise\n _reflowResolve: () => void\n }\n}\n\ndeclare module '@interactjs/core/InteractEvent' {\n // eslint-disable-next-line no-shadow\n interface PhaseMap {\n reflow?: true\n }\n}\n\nexport function install (scope: Scope) {\n const {\n /** @lends Interactable */\n // eslint-disable-next-line no-shadow\n Interactable,\n } = scope\n\n scope.actions.phases.reflow = true\n\n /**\n * ```js\n * const interactable = interact(target)\n * const drag = { name: drag, axis: 'x' }\n * const resize = { name: resize, edges: { left: true, bottom: true }\n *\n * interactable.reflow(drag)\n * interactable.reflow(resize)\n * ```\n *\n * Start an action sequence to re-apply modifiers, check drops, etc.\n *\n * @param { Object } action The action to begin\n * @param { string } action.name The name of the action\n * @returns { Promise } A promise that resolves to the `Interactable` when actions on all targets have ended\n */\n Interactable.prototype.reflow = function (action) {\n return reflow(this, action, scope)\n }\n}\n\nfunction reflow (interactable: Interactable, action: ActionProps, scope: Scope): Promise {\n const elements = (is.string(interactable.target)\n ? arr.from(interactable._context.querySelectorAll(interactable.target))\n : [interactable.target]) as Interact.Element[]\n\n // tslint:disable-next-line variable-name\n const Promise = (scope.window as any).Promise\n const promises: Array> | null = Promise ? [] : null\n\n for (const element of elements) {\n const rect = interactable.getRect(element as HTMLElement | SVGElement)\n\n if (!rect) { break }\n\n const runningInteraction = arr.find(\n scope.interactions.list,\n (interaction: Interaction) => {\n return interaction.interacting() &&\n interaction.interactable === interactable &&\n interaction.element === element &&\n interaction.prepared.name === action.name\n })\n let reflowPromise: Promise\n\n if (runningInteraction) {\n runningInteraction.move()\n\n if (promises) {\n reflowPromise = runningInteraction._reflowPromise || new Promise((resolve: any) => {\n runningInteraction._reflowResolve = resolve\n })\n }\n }\n else {\n const xywh = tlbrToXywh(rect)\n const coords = {\n page : { x: xywh.x, y: xywh.y },\n client : { x: xywh.x, y: xywh.y },\n timeStamp: scope.now(),\n }\n\n const event = pointerUtils.coordsToEvent(coords)\n reflowPromise = startReflow(scope, interactable, element, action, event)\n }\n\n if (promises) {\n promises.push(reflowPromise)\n }\n }\n\n return promises && Promise.all(promises).then(() => interactable)\n}\n\nfunction startReflow (scope: Scope, interactable: Interactable, element: Interact.Element, action: ActionProps, event: any) {\n const interaction = scope.interactions.new({ pointerType: 'reflow' })\n const signalArg = {\n interaction,\n event,\n pointer: event,\n eventTarget: element,\n phase: 'reflow',\n } as const\n\n interaction.interactable = interactable\n interaction.element = element\n interaction.prepared = extend({}, action)\n interaction.prevEvent = event\n interaction.updatePointer(event, event, element, true)\n\n interaction._doPhase(signalArg)\n\n const Promise: PromiseConstructor = (scope.window as unknown as any).Promise\n const reflowPromise = Promise\n ? new Promise(resolve => {\n interaction._reflowResolve = resolve\n })\n : null\n\n interaction._reflowPromise = reflowPromise\n interaction.start(action, interactable, element)\n\n if (interaction._interacting) {\n interaction.move(signalArg)\n interaction.end(event)\n }\n else {\n interaction.stop()\n }\n\n interaction.removePointer(event, event)\n interaction.pointerIsDown = false\n\n return reflowPromise\n}\n\nexport default {\n id: 'reflow',\n install,\n listeners: {\n // remove completed reflow interactions\n 'interactions:stop': ({ interaction }, scope) => {\n if (interaction.pointerType === 'reflow') {\n if (interaction._reflowResolve) {\n interaction._reflowResolve()\n }\n\n arr.remove(scope.interactions.list, interaction)\n }\n },\n },\n} as Interact.Plugin\n","export default {}\n","export const exchange = {}\n","import actions from '@interactjs/actions/plugin'\nimport arrange from '@interactjs/arrange/plugin'\nimport autoScroll from '@interactjs/auto-scroll/plugin'\nimport autoStart from '@interactjs/auto-start/plugin'\nimport clone from '@interactjs/clone/plugin'\nimport interactablePreventDefault from '@interactjs/core/interactablePreventDefault'\nimport devTools from '@interactjs/dev-tools/plugin'\nimport feedback from '@interactjs/feedback/plugin'\nimport inertia from '@interactjs/inertia/plugin'\nimport interact from '@interactjs/interact'\nimport modifiers from '@interactjs/modifiers/plugin'\nimport multiTarget from '@interactjs/multi-target/plugin'\nimport offset from '@interactjs/offset/plugin'\nimport pointerEvents from '@interactjs/pointer-events/plugin'\nimport reactComponents from '@interactjs/react/plugin'\nimport reflow from '@interactjs/reflow/plugin'\nimport * as displace from '@interactjs/utils/displace'\nimport { exchange } from '@interactjs/utils/exchange'\nimport * as pointerUtils from '@interactjs/utils/pointerUtils'\nimport vueComponents from '@interactjs/vue/plugin'\n\ndeclare module '@interactjs/core/interactStatic' {\n export interface InteractStatic {\n __utils: {\n exchange: typeof exchange\n displace: typeof displace\n pointer: typeof pointerUtils\n }\n }\n}\n\ninteract.use(multiTarget)\n\ninteract.use(interactablePreventDefault)\n\ninteract.use(offset)\n\n// interaction element cloning\ninteract.use(clone)\n\n// sortable and swappable\ninteract.use(arrange)\n\n// pointerEvents\ninteract.use(pointerEvents)\n\n// inertia\ninteract.use(inertia)\n\n// snap, resize, etc.\ninteract.use(modifiers)\n\n// autoStart, hold\ninteract.use(autoStart)\n\n// drag and drop, resize, gesture\ninteract.use(actions)\n\n// autoScroll\ninteract.use(autoScroll)\n\n// reflow\ninteract.use(reflow)\n\ninteract.use(feedback)\n\ninteract.use(vueComponents)\n\ninteract.use(reactComponents)\n\ninteract.__utils = {\n exchange,\n displace,\n pointer: pointerUtils,\n}\n\n// eslint-disable-next-line no-undef\nif (process.env.NODE_ENV !== 'production') {\n interact.use(devTools)\n}\n\nexport default interact\n\nif (typeof module === 'object' && !!module) {\n try { module.exports = interact }\n catch {}\n}\n\n(interact as any).default = interact\n","// eslint-disable-next-line import/no-extraneous-dependencies\nimport interact from '@interactjs/interactjs/index'\n\nexport default interact\n\nif (typeof module === 'object' && !!module) {\n try { module.exports = interact }\n catch {}\n}\n\n(interact as any).default = interact\n","\nreturn _$index_86;\n\n});\n"],"sourceRoot":"","file":"interact.js"} \ No newline at end of file diff --git a/public/lib/interact.min.js b/public/lib/interact.min.js deleted file mode 100644 index d2138e2..0000000 --- a/public/lib/interact.min.js +++ /dev/null @@ -1,3 +0,0 @@ -/* interact.js 1.10.17 | https://interactjs.io/license */ -!function(t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).interact=t()}((function(){var t={};Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.default=function(t){return!(!t||!t.Window)&&t instanceof t.Window};var e={};Object.defineProperty(e,"__esModule",{value:!0}),e.getWindow=function(e){return(0,t.default)(e)?e:(e.ownerDocument||e).defaultView||r.window},e.init=o,e.window=e.realWindow=void 0;var n=void 0;e.realWindow=n;var r=void 0;function o(t){e.realWindow=n=t;var o=t.document.createTextNode("");o.ownerDocument!==t.document&&"function"==typeof t.wrap&&t.wrap(o)===o&&(t=t.wrap(t)),e.window=r=t}e.window=r,"undefined"!=typeof window&&window&&o(window);var i={};function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var s=function(t){return!!t&&"object"===a(t)},l=function(t){return"function"==typeof t},u={window:function(n){return n===e.window||(0,t.default)(n)},docFrag:function(t){return s(t)&&11===t.nodeType},object:s,func:l,number:function(t){return"number"==typeof t},bool:function(t){return"boolean"==typeof t},string:function(t){return"string"==typeof t},element:function(t){if(!t||"object"!==a(t))return!1;var n=e.getWindow(t)||e.window;return/object|function/.test("undefined"==typeof Element?"undefined":a(Element))?t instanceof Element||t instanceof n.Element:1===t.nodeType&&"string"==typeof t.nodeName},plainObject:function(t){return s(t)&&!!t.constructor&&/function Object\b/.test(t.constructor.toString())},array:function(t){return s(t)&&void 0!==t.length&&l(t.splice)}};i.default=u;var c={};function f(t){var e=t.interaction;if("drag"===e.prepared.name){var n=e.prepared.axis;"x"===n?(e.coords.cur.page.y=e.coords.start.page.y,e.coords.cur.client.y=e.coords.start.client.y,e.coords.velocity.client.y=0,e.coords.velocity.page.y=0):"y"===n&&(e.coords.cur.page.x=e.coords.start.page.x,e.coords.cur.client.x=e.coords.start.client.x,e.coords.velocity.client.x=0,e.coords.velocity.page.x=0)}}function d(t){var e=t.iEvent,n=t.interaction;if("drag"===n.prepared.name){var r=n.prepared.axis;if("x"===r||"y"===r){var o="x"===r?"y":"x";e.page[o]=n.coords.start.page[o],e.client[o]=n.coords.start.client[o],e.delta[o]=0}}}Object.defineProperty(c,"__esModule",{value:!0}),c.default=void 0;var p={id:"actions/drag",install:function(t){var e=t.actions,n=t.Interactable,r=t.defaults;n.prototype.draggable=p.draggable,e.map.drag=p,e.methodDict.drag="draggable",r.actions.drag=p.defaults},listeners:{"interactions:before-action-move":f,"interactions:action-resume":f,"interactions:action-move":d,"auto-start:check":function(t){var e=t.interaction,n=t.interactable,r=t.buttons,o=n.options.drag;if(o&&o.enabled&&(!e.pointerIsDown||!/mouse|pointer/.test(e.pointerType)||0!=(r&n.options.drag.mouseButtons)))return t.action={name:"drag",axis:"start"===o.lockAxis?o.startAxis:o.lockAxis},!1}},draggable:function(t){return i.default.object(t)?(this.options.drag.enabled=!1!==t.enabled,this.setPerAction("drag",t),this.setOnEvents("drag",t),/^(xy|x|y|start)$/.test(t.lockAxis)&&(this.options.drag.lockAxis=t.lockAxis),/^(xy|x|y)$/.test(t.startAxis)&&(this.options.drag.startAxis=t.startAxis),this):i.default.bool(t)?(this.options.drag.enabled=t,this):this.options.drag},beforeMove:f,move:d,defaults:{startAxis:"xy",lockAxis:"xy"},getCursor:function(){return"move"}},v=p;c.default=v;var h={};Object.defineProperty(h,"__esModule",{value:!0}),h.default=void 0;var g={init:function(t){var e=t;g.document=e.document,g.DocumentFragment=e.DocumentFragment||y,g.SVGElement=e.SVGElement||y,g.SVGSVGElement=e.SVGSVGElement||y,g.SVGElementInstance=e.SVGElementInstance||y,g.Element=e.Element||y,g.HTMLElement=e.HTMLElement||g.Element,g.Event=e.Event,g.Touch=e.Touch||y,g.PointerEvent=e.PointerEvent||e.MSPointerEvent},document:null,DocumentFragment:null,SVGElement:null,SVGSVGElement:null,SVGElementInstance:null,Element:null,HTMLElement:null,Event:null,Touch:null,PointerEvent:null};function y(){}var m=g;h.default=m;var b={};Object.defineProperty(b,"__esModule",{value:!0}),b.default=void 0;var x={init:function(t){var e=h.default.Element,n=t.navigator||{};x.supportsTouch="ontouchstart"in t||i.default.func(t.DocumentTouch)&&h.default.document instanceof t.DocumentTouch,x.supportsPointerEvent=!1!==n.pointerEnabled&&!!h.default.PointerEvent,x.isIOS=/iP(hone|od|ad)/.test(n.platform),x.isIOS7=/iP(hone|od|ad)/.test(n.platform)&&/OS 7[^\d]/.test(n.appVersion),x.isIe9=/MSIE 9/.test(n.userAgent),x.isOperaMobile="Opera"===n.appName&&x.supportsTouch&&/Presto/.test(n.userAgent),x.prefixedMatchesSelector="matches"in e.prototype?"matches":"webkitMatchesSelector"in e.prototype?"webkitMatchesSelector":"mozMatchesSelector"in e.prototype?"mozMatchesSelector":"oMatchesSelector"in e.prototype?"oMatchesSelector":"msMatchesSelector",x.pEventTypes=x.supportsPointerEvent?h.default.PointerEvent===t.MSPointerEvent?{up:"MSPointerUp",down:"MSPointerDown",over:"mouseover",out:"mouseout",move:"MSPointerMove",cancel:"MSPointerCancel"}:{up:"pointerup",down:"pointerdown",over:"pointerover",out:"pointerout",move:"pointermove",cancel:"pointercancel"}:null,x.wheelEvent=h.default.document&&"onmousewheel"in h.default.document?"mousewheel":"wheel"},supportsTouch:null,supportsPointerEvent:null,isIOS7:null,isIOS:null,isIe9:null,isOperaMobile:null,prefixedMatchesSelector:null,pEventTypes:null,wheelEvent:null},w=x;b.default=w;var _={};function P(t){var e=t.parentNode;if(i.default.docFrag(e)){for(;(e=e.host)&&i.default.docFrag(e););return e}return e}function O(t,n){return e.window!==e.realWindow&&(n=n.replace(/\/deep\//g," ")),t[b.default.prefixedMatchesSelector](n)}Object.defineProperty(_,"__esModule",{value:!0}),_.closest=function(t,e){for(;i.default.element(t);){if(O(t,e))return t;t=P(t)}return null},_.getActualElement=function(t){return t.correspondingUseElement||t},_.getElementClientRect=j,_.getElementRect=function(t){var n=j(t);if(!b.default.isIOS7&&n){var r=T(e.getWindow(t));n.left+=r.x,n.right+=r.x,n.top+=r.y,n.bottom+=r.y}return n},_.getPath=function(t){for(var e=[];t;)e.push(t),t=P(t);return e},_.getScrollXY=T,_.indexOfDeepestElement=function(t){for(var n,r=[],o=0;o=(parseInt(e.getWindow(g).getComputedStyle(g).zIndex,10)||0)&&(n=o);else n=o}else n=o}var v,g;return n},_.matchesSelector=O,_.matchesUpTo=function(t,e,n){for(;i.default.element(t);){if(O(t,e))return!0;if((t=P(t))===n)return O(t,e)}return!1},_.nodeContains=function(t,e){if(t.contains)return t.contains(e);for(;e;){if(e===t)return!0;e=e.parentNode}return!1},_.parentNode=P,_.trySelector=function(t){return!!i.default.string(t)&&(h.default.document.querySelector(t),!0)};var E=function(t){return t.parentNode||t.host};function S(t,e){for(var n,r=[],o=t;(n=E(o))&&o!==e&&n!==o.ownerDocument;)r.unshift(o),o=n;return r}function T(t){return{x:(t=t||e.window).scrollX||t.document.documentElement.scrollLeft,y:t.scrollY||t.document.documentElement.scrollTop}}function j(t){var e=t instanceof h.default.SVGElement?t.getBoundingClientRect():t.getClientRects()[0];return e&&{left:e.left,right:e.right,top:e.top,bottom:e.bottom,width:e.width||e.right-e.left,height:e.height||e.bottom-e.top}}var M={};Object.defineProperty(M,"__esModule",{value:!0}),M.default=function(t,e){for(var n in e)t[n]=e[n];return t};var k={};function I(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n1?V(e):e[0];W(r,t.page),L(r,t.client),t.timeStamp=n},X.setZeroCoords=function(t){t.page.x=0,t.page.y=0,t.client.x=0,t.client.y=0},X.touchAngle=function(t,e){var n=e+"X",r=e+"Y",o=U(t),i=o[1][n]-o[0][n],a=o[1][r]-o[0][r];return 180*Math.atan2(a,i)/Math.PI},X.touchBBox=function(t){if(!t.length)return null;var e=U(t),n=Math.min(e[0].pageX,e[1].pageX),r=Math.min(e[0].pageY,e[1].pageY),o=Math.max(e[0].pageX,e[1].pageX),i=Math.max(e[0].pageY,e[1].pageY);return{x:n,y:r,left:n,top:r,right:o,bottom:i,width:o-n,height:i-r}},X.touchDistance=function(t,e){var n=e+"X",r=e+"Y",o=U(t),i=o[0][n]-o[1][n],a=o[0][r]-o[1][r];return(0,R.default)(i,a)};var N={};function q(t,e){for(var n=0;ns.left&&f.xs.top&&f.y=s.left&&h<=s.right&&g>=s.top&&g<=s.bottom}return v&&i.default.number(u)&&(l=Math.max(0,Math.min(s.right,v.right)-Math.max(s.left,v.left))*Math.max(0,Math.min(s.bottom,v.bottom)-Math.max(s.top,v.top))/(v.width*v.height)>=u),t.options.drop.checker&&(l=t.options.drop.checker(e,n,l,t,a,r,o)),l}(this,t,e,n,r,o,a)},n.dynamicDrop=function(e){return i.default.bool(e)?(t.dynamicDrop=e,n):t.dynamicDrop},(0,M.default)(e.phaselessTypes,{dragenter:!0,dragleave:!0,dropactivate:!0,dropdeactivate:!0,dropmove:!0,drop:!0}),e.methodDict.drop="dropzone",t.dynamicDrop=!1,o.actions.drop=vt.defaults},listeners:{"interactions:before-action-start":function(t){var e=t.interaction;"drag"===e.prepared.name&&(e.dropState={cur:{dropzone:null,element:null},prev:{dropzone:null,element:null},rejected:null,events:null,activeDrops:[]})},"interactions:after-action-start":function(t,e){var n=t.interaction,r=(t.event,t.iEvent);if("drag"===n.prepared.name){var o=n.dropState;o.activeDrops=null,o.events=null,o.activeDrops=ut(e,n.element),o.events=ft(n,0,r),o.events.activate&&(lt(o.activeDrops,o.events.activate),e.fire("actions/drop:start",{interaction:n,dragEvent:r}))}},"interactions:action-move":pt,"interactions:after-action-move":function(t,e){var n=t.interaction,r=t.iEvent;"drag"===n.prepared.name&&(dt(n,n.dropState.events),e.fire("actions/drop:move",{interaction:n,dragEvent:r}),n.dropState.events={})},"interactions:action-end":function(t,e){if("drag"===t.interaction.prepared.name){var n=t.interaction,r=t.iEvent;pt(t,e),dt(n,n.dropState.events),e.fire("actions/drop:end",{interaction:n,dragEvent:r})}},"interactions:stop":function(t){var e=t.interaction;if("drag"===e.prepared.name){var n=e.dropState;n&&(n.activeDrops=null,n.events=null,n.cur.dropzone=null,n.cur.element=null,n.prev.dropzone=null,n.prev.element=null,n.rejected=!1)}}},getActiveDrops:ut,getDrop:ct,getDropEvents:ft,fireDropEvents:dt,defaults:{enabled:!1,accept:null,overlap:"pointer"}},ht=vt;st.default=ht;var gt={};function yt(t){var e=t.interaction,n=t.iEvent,r=t.phase;if("gesture"===e.prepared.name){var o=e.pointers.map((function(t){return t.pointer})),a="start"===r,s="end"===r,l=e.interactable.options.deltaSource;if(n.touches=[o[0],o[1]],a)n.distance=X.touchDistance(o,l),n.box=X.touchBBox(o),n.scale=1,n.ds=0,n.angle=X.touchAngle(o,l),n.da=0,e.gesture.startDistance=n.distance,e.gesture.startAngle=n.angle;else if(s){var u=e.prevEvent;n.distance=u.distance,n.box=u.box,n.scale=u.scale,n.ds=0,n.angle=u.angle,n.da=0}else n.distance=X.touchDistance(o,l),n.box=X.touchBBox(o),n.scale=n.distance/e.gesture.startDistance,n.angle=X.touchAngle(o,l),n.ds=n.scale-e.gesture.scale,n.da=n.angle-e.gesture.angle;e.gesture.distance=n.distance,e.gesture.angle=n.angle,i.default.number(n.scale)&&n.scale!==1/0&&!isNaN(n.scale)&&(e.gesture.scale=n.scale)}}Object.defineProperty(gt,"__esModule",{value:!0}),gt.default=void 0;var mt={id:"actions/gesture",before:["actions/drag","actions/resize"],install:function(t){var e=t.actions,n=t.Interactable,r=t.defaults;n.prototype.gesturable=function(t){return i.default.object(t)?(this.options.gesture.enabled=!1!==t.enabled,this.setPerAction("gesture",t),this.setOnEvents("gesture",t),this):i.default.bool(t)?(this.options.gesture.enabled=t,this):this.options.gesture},e.map.gesture=mt,e.methodDict.gesture="gesturable",r.actions.gesture=mt.defaults},listeners:{"interactions:action-start":yt,"interactions:action-move":yt,"interactions:action-end":yt,"interactions:new":function(t){t.interaction.gesture={angle:0,distance:0,scale:1,startAngle:0,startDistance:0}},"auto-start:check":function(t){if(!(t.interaction.pointers.length<2)){var e=t.interactable.options.gesture;if(e&&e.enabled)return t.action={name:"gesture"},!1}}},defaults:{},getCursor:function(){return""}},bt=mt;gt.default=bt;var xt={};function wt(t,e,n,r,o,a,s){if(!e)return!1;if(!0===e){var l=i.default.number(a.width)?a.width:a.right-a.left,u=i.default.number(a.height)?a.height:a.bottom-a.top;if(s=Math.min(s,Math.abs(("left"===t||"right"===t?l:u)/2)),l<0&&("left"===t?t="right":"right"===t&&(t="left")),u<0&&("top"===t?t="bottom":"bottom"===t&&(t="top")),"left"===t){var c=l>=0?a.left:a.right;return n.x=0?a.top:a.bottom;return n.y(l>=0?a.right:a.left)-s;if("bottom"===t)return n.y>(u>=0?a.bottom:a.top)-s}return!!i.default.element(r)&&(i.default.element(e)?e===r:_.matchesUpTo(r,e,o))}function _t(t){var e=t.iEvent,n=t.interaction;if("resize"===n.prepared.name&&n.resizeAxes){var r=e;n.interactable.options.resize.square?("y"===n.resizeAxes?r.delta.x=r.delta.y:r.delta.y=r.delta.x,r.axes="xy"):(r.axes=n.resizeAxes,"x"===n.resizeAxes?r.delta.y=0:"y"===n.resizeAxes&&(r.delta.x=0))}}Object.defineProperty(xt,"__esModule",{value:!0}),xt.default=void 0;var Pt={id:"actions/resize",before:["actions/drag"],install:function(t){var e=t.actions,n=t.browser,r=t.Interactable,o=t.defaults;Pt.cursors=function(t){return t.isIe9?{x:"e-resize",y:"s-resize",xy:"se-resize",top:"n-resize",left:"w-resize",bottom:"s-resize",right:"e-resize",topleft:"se-resize",bottomright:"se-resize",topright:"ne-resize",bottomleft:"ne-resize"}:{x:"ew-resize",y:"ns-resize",xy:"nwse-resize",top:"ns-resize",left:"ew-resize",bottom:"ns-resize",right:"ew-resize",topleft:"nwse-resize",bottomright:"nwse-resize",topright:"nesw-resize",bottomleft:"nesw-resize"}}(n),Pt.defaultMargin=n.supportsTouch||n.supportsPointerEvent?20:10,r.prototype.resizable=function(e){return function(t,e,n){return i.default.object(e)?(t.options.resize.enabled=!1!==e.enabled,t.setPerAction("resize",e),t.setOnEvents("resize",e),i.default.string(e.axis)&&/^x$|^y$|^xy$/.test(e.axis)?t.options.resize.axis=e.axis:null===e.axis&&(t.options.resize.axis=n.defaults.actions.resize.axis),i.default.bool(e.preserveAspectRatio)?t.options.resize.preserveAspectRatio=e.preserveAspectRatio:i.default.bool(e.square)&&(t.options.resize.square=e.square),t):i.default.bool(e)?(t.options.resize.enabled=e,t):t.options.resize}(this,e,t)},e.map.resize=Pt,e.methodDict.resize="resizable",o.actions.resize=Pt.defaults},listeners:{"interactions:new":function(t){t.interaction.resizeAxes="xy"},"interactions:action-start":function(t){!function(t){var e=t.iEvent,n=t.interaction;if("resize"===n.prepared.name&&n.prepared.edges){var r=e,o=n.rect;n._rects={start:(0,M.default)({},o),corrected:(0,M.default)({},o),previous:(0,M.default)({},o),delta:{left:0,right:0,width:0,top:0,bottom:0,height:0}},r.edges=n.prepared.edges,r.rect=n._rects.corrected,r.deltaRect=n._rects.delta}}(t),_t(t)},"interactions:action-move":function(t){!function(t){var e=t.iEvent,n=t.interaction;if("resize"===n.prepared.name&&n.prepared.edges){var r=e,o=n.interactable.options.resize.invert,i="reposition"===o||"negate"===o,a=n.rect,s=n._rects,l=s.start,u=s.corrected,c=s.delta,f=s.previous;if((0,M.default)(f,u),i){if((0,M.default)(u,a),"reposition"===o){if(u.top>u.bottom){var d=u.top;u.top=u.bottom,u.bottom=d}if(u.left>u.right){var p=u.left;u.left=u.right,u.right=p}}}else u.top=Math.min(a.top,l.bottom),u.bottom=Math.max(a.bottom,l.top),u.left=Math.min(a.left,l.right),u.right=Math.max(a.right,l.left);for(var v in u.width=u.right-u.left,u.height=u.bottom-u.top,u)c[v]=u[v]-f[v];r.edges=n.prepared.edges,r.rect=u,r.deltaRect=c}}(t),_t(t)},"interactions:action-end":function(t){var e=t.iEvent,n=t.interaction;if("resize"===n.prepared.name&&n.prepared.edges){var r=e;r.edges=n.prepared.edges,r.rect=n._rects.corrected,r.deltaRect=n._rects.delta}},"auto-start:check":function(t){var e=t.interaction,n=t.interactable,r=t.element,o=t.rect,a=t.buttons;if(o){var s=(0,M.default)({},e.coords.cur.page),l=n.options.resize;if(l&&l.enabled&&(!e.pointerIsDown||!/mouse|pointer/.test(e.pointerType)||0!=(a&l.mouseButtons))){if(i.default.object(l.edges)){var u={left:!1,right:!1,top:!1,bottom:!1};for(var c in u)u[c]=wt(c,l.edges[c],s,e._latestPointer.eventTarget,r,o,l.margin||Pt.defaultMargin);u.left=u.left&&!u.right,u.top=u.top&&!u.bottom,(u.left||u.right||u.top||u.bottom)&&(t.action={name:"resize",edges:u})}else{var f="y"!==l.axis&&s.x>o.right-Pt.defaultMargin,d="x"!==l.axis&&s.y>o.bottom-Pt.defaultMargin;(f||d)&&(t.action={name:"resize",axes:(f?"x":"")+(d?"y":"")})}return!t.action&&void 0}}}},defaults:{square:!1,preserveAspectRatio:!1,axis:"xy",margin:NaN,edges:null,invert:"none"},cursors:null,getCursor:function(t){var e=t.edges,n=t.axis,r=t.name,o=Pt.cursors,i=null;if(n)i=o[r+n];else if(e){for(var a="",s=["top","bottom","left","right"],l=0;l=1){var c={x:At.x*u,y:At.y*u};if(c.x||c.y){var f=Ct(a);i.default.window(a)?a.scrollBy(c.x,c.y):a&&(a.scrollLeft+=c.x,a.scrollTop+=c.y);var d=Ct(a),p={x:d.x-f.x,y:d.y-f.y};(p.x||p.y)&&e.fire({type:"autoscroll",target:n,interactable:e,delta:p,interaction:t,container:a})}At.prevTime=s}At.isScrolling&&(Tt.default.cancel(At.i),At.i=Tt.default.request(At.scroll))},check:function(t,e){var n;return null==(n=t.options[e].autoScroll)?void 0:n.enabled},onInteractionMove:function(t){var e=t.interaction,n=t.pointer;if(e.interacting()&&At.check(e.interactable,e.prepared.name))if(e.simulation)At.x=At.y=0;else{var r,o,a,s,l=e.interactable,u=e.element,c=e.prepared.name,f=l.options[c].autoScroll,d=zt(f.container,l,u);if(i.default.window(d))s=n.clientXd.innerWidth-At.margin,a=n.clientY>d.innerHeight-At.margin;else{var p=_.getElementClientRect(d);s=n.clientXp.right-At.margin,a=n.clientY>p.bottom-At.margin}At.x=o?1:s?-1:0,At.y=a?1:r?-1:0,At.isScrolling||(At.margin=f.margin,At.speed=f.speed,At.start(e))}}};function zt(t,n,r){return(i.default.string(t)?(0,k.getStringOptionResult)(t,n,r):t)||(0,e.getWindow)(r)}function Ct(t){return i.default.window(t)&&(t=window.document.body),{x:t.scrollLeft,y:t.scrollTop}}var Rt={id:"auto-scroll",install:function(t){var e=t.defaults,n=t.actions;t.autoScroll=At,At.now=function(){return t.now()},n.phaselessTypes.autoscroll=!0,e.perAction.autoScroll=At.defaults},listeners:{"interactions:new":function(t){t.interaction.autoScroll=null},"interactions:destroy":function(t){t.interaction.autoScroll=null,At.stop(),At.interaction&&(At.interaction=null)},"interactions:stop":At.stop,"interactions:action-move":function(t){return At.onInteractionMove(t)}}},Ft=Rt;Dt.default=Ft;var Xt={};Object.defineProperty(Xt,"__esModule",{value:!0}),Xt.copyAction=function(t,e){return t.name=e.name,t.axis=e.axis,t.edges=e.edges,t},Xt.sign=void 0,Xt.warnOnce=function(t,n){var r=!1;return function(){return r||(e.window.console.warn(n),r=!0),t.apply(this,arguments)}},Xt.sign=function(t){return t>=0?1:-1};var Bt={};function Yt(t){return i.default.bool(t)?(this.options.styleCursor=t,this):null===t?(delete this.options.styleCursor,this):this.options.styleCursor}function Wt(t){return i.default.func(t)?(this.options.actionChecker=t,this):null===t?(delete this.options.actionChecker,this):this.options.actionChecker}Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.default=void 0;var Lt={id:"auto-start/interactableMethods",install:function(t){var e=t.Interactable;e.prototype.getAction=function(e,n,r,o){var i=function(t,e,n,r,o){var i=t.getRect(r),a={action:null,interactable:t,interaction:n,element:r,rect:i,buttons:e.buttons||{0:1,1:4,3:8,4:16}[e.button]};return o.fire("auto-start:check",a),a.action}(this,n,r,o,t);return this.options.actionChecker?this.options.actionChecker(e,n,i,this,o,r):i},e.prototype.ignoreFrom=(0,Xt.warnOnce)((function(t){return this._backCompatOption("ignoreFrom",t)}),"Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue})."),e.prototype.allowFrom=(0,Xt.warnOnce)((function(t){return this._backCompatOption("allowFrom",t)}),"Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."),e.prototype.actionChecker=Wt,e.prototype.styleCursor=Yt}};Bt.default=Lt;var Ut={};function Vt(t,e,n,r,o){return e.testIgnoreAllow(e.options[t.name],n,r)&&e.options[t.name].enabled&&$t(e,n,t,o)?t:null}function Nt(t,e,n,r,o,i,a){for(var s=0,l=r.length;s=s)return!1;if(d.interactable===t){if((u+=p===n.name?1:0)>=i)return!1;if(d.element===e&&(c++,p===n.name&&c>=a))return!1}}}return s>0}function Ht(t,e){return i.default.number(t)?(e.autoStart.maxInteractions=t,this):e.autoStart.maxInteractions}function Kt(t,e,n){var r=n.autoStart.cursorElement;r&&r!==t&&(r.style.cursor=""),t.ownerDocument.documentElement.style.cursor=e,t.style.cursor=e,n.autoStart.cursorElement=e?t:null}function Zt(t,e){var n=t.interactable,r=t.element,o=t.prepared;if("mouse"===t.pointerType&&n&&n.options.styleCursor){var a="";if(o.name){var s=n.options[o.name].cursorChecker;a=i.default.func(s)?s(o,n,r,t._interacting):e.actions.map[o.name].getCursor(o)}Kt(t.element,a||"",e)}else e.autoStart.cursorElement&&Kt(e.autoStart.cursorElement,"",e)}Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.default=void 0;var Jt={id:"auto-start/base",before:["actions"],install:function(t){var e=t.interactStatic,n=t.defaults;t.usePlugin(Bt.default),n.base.actionChecker=null,n.base.styleCursor=!0,(0,M.default)(n.perAction,{manualStart:!1,max:1/0,maxPerElement:1,allowFrom:null,ignoreFrom:null,mouseButtons:1}),e.maxInteractions=function(e){return Ht(e,t)},t.autoStart={maxInteractions:1/0,withinInteractionLimit:$t,cursorElement:null}},listeners:{"interactions:down":function(t,e){var n=t.interaction,r=t.pointer,o=t.event,i=t.eventTarget;n.interacting()||Gt(n,qt(n,r,o,i,e),e)},"interactions:move":function(t,e){!function(t,e){var n=t.interaction,r=t.pointer,o=t.event,i=t.eventTarget;"mouse"!==n.pointerType||n.pointerIsDown||n.interacting()||Gt(n,qt(n,r,o,i,e),e)}(t,e),function(t,e){var n=t.interaction;if(n.pointerIsDown&&!n.interacting()&&n.pointerWasMoved&&n.prepared.name){e.fire("autoStart:before-start",t);var r=n.interactable,o=n.prepared.name;o&&r&&(r.options[o].manualStart||!$t(r,n.element,n.prepared,e)?n.stop():(n.start(n.prepared,r,n.element),Zt(n,e)))}}(t,e)},"interactions:stop":function(t,e){var n=t.interaction,r=n.interactable;r&&r.options.styleCursor&&Kt(n.element,"",e)}},maxInteractions:Ht,withinInteractionLimit:$t,validateAction:Vt},Qt=Jt;Ut.default=Qt;var te={};Object.defineProperty(te,"__esModule",{value:!0}),te.default=void 0;var ee={id:"auto-start/dragAxis",listeners:{"autoStart:before-start":function(t,e){var n=t.interaction,r=t.eventTarget,o=t.dx,a=t.dy;if("drag"===n.prepared.name){var s=Math.abs(o),l=Math.abs(a),u=n.interactable.options.drag,c=u.startAxis,f=s>l?"x":s0&&(e.autoStartHoldTimer=setTimeout((function(){e.start(e.prepared,e.interactable,e.element)}),n))},"interactions:move":function(t){var e=t.interaction,n=t.duplicate;e.autoStartHoldTimer&&e.pointerWasMoved&&!n&&(clearTimeout(e.autoStartHoldTimer),e.autoStartHoldTimer=null)},"autoStart:before-start":function(t){var e=t.interaction;re(e)>0&&(e.prepared.name=null)}},getHoldDuration:re},ie=oe;ne.default=ie;var ae={};Object.defineProperty(ae,"__esModule",{value:!0}),ae.default=void 0;var se={id:"auto-start",install:function(t){t.usePlugin(Ut.default),t.usePlugin(ne.default),t.usePlugin(te.default)}};ae.default=se;var le={};function ue(t){return/^(always|never|auto)$/.test(t)?(this.options.preventDefault=t,this):i.default.bool(t)?(this.options.preventDefault=t?"always":"never",this):this.options.preventDefault}function ce(t){var e=t.interaction,n=t.event;e.interactable&&e.interactable.checkAndPreventDefault(n)}function fe(t){var n=t.Interactable;n.prototype.preventDefault=ue,n.prototype.checkAndPreventDefault=function(n){return function(t,n,r){var o=t.options.preventDefault;if("never"!==o)if("always"!==o){if(n.events.supportsPassive&&/^touch(start|move)$/.test(r.type)){var a=(0,e.getWindow)(r.target).document,s=n.getDocOptions(a);if(!s||!s.events||!1!==s.events.passive)return}/^(mouse|pointer|touch)*(down|start)/i.test(r.type)||i.default.element(r.target)&&(0,_.matchesSelector)(r.target,"input,select,textarea,[contenteditable=true],[contenteditable=true] *")||r.preventDefault()}else r.preventDefault()}(this,t,n)},t.interactions.docEvents.push({type:"dragstart",listener:function(e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=Array(e);n150)return null;var e=180*Math.atan2(t.prevEvent.velocityY,t.prevEvent.velocityX)/Math.PI;e<0&&(e+=360);var n=112.5<=e&&e<247.5,r=202.5<=e&&e<337.5;return{up:r,down:!r&&22.5<=e&&e<157.5,left:n,right:!n&&(292.5<=e||e<67.5),angle:e,speed:t.prevEvent.speed,velocity:{x:t.prevEvent.velocityX,y:t.prevEvent.velocityY}}}},{key:"preventDefault",value:function(){}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}}])&&Ae(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(N.BaseEvent);Ie.InteractEvent=Be,Object.defineProperties(Be.prototype,{pageX:{get:function(){return this.page.x},set:function(t){this.page.x=t}},pageY:{get:function(){return this.page.y},set:function(t){this.page.y=t}},clientX:{get:function(){return this.client.x},set:function(t){this.client.x=t}},clientY:{get:function(){return this.client.y},set:function(t){this.client.y=t}},dx:{get:function(){return this.delta.x},set:function(t){this.delta.x=t}},dy:{get:function(){return this.delta.y},set:function(t){this.delta.y=t}},velocityX:{get:function(){return this.velocity.x},set:function(t){this.velocity.x=t}},velocityY:{get:function(){return this.velocity.y},set:function(t){this.velocity.y=t}}});var Ye={};function We(t,e){for(var n=0;nthis.pointerMoveTolerance);var a=this.getPointerIndex(t),s={pointer:t,pointerIndex:a,pointerInfo:this.pointers[a],event:e,type:"move",eventTarget:n,dx:r,dy:o,duplicate:i,interaction:this};i||X.setCoordVelocity(this.coords.velocity,this.coords.delta),this._scopeFire("interactions:move",s),i||this.simulation||(this.interacting()&&(s.type=null,this.move(s)),this.pointerWasMoved&&X.copyCoords(this.coords.prev,this.coords.cur))}},{key:"move",value:function(t){t&&t.event||X.setZeroCoords(this.coords.delta),(t=(0,M.default)({pointer:this._latestPointer.pointer,event:this._latestPointer.event,eventTarget:this._latestPointer.eventTarget,interaction:this},t||{})).phase="move",this._doPhase(t)}},{key:"pointerUp",value:function(t,e,n,r){var o=this.getPointerIndex(t);-1===o&&(o=this.updatePointer(t,e,n,!1));var i=/cancel$/i.test(e.type)?"cancel":"up";this._scopeFire("interactions:".concat(i),{pointer:t,pointerIndex:o,pointerInfo:this.pointers[o],event:e,eventTarget:n,type:i,curEventTarget:r,interaction:this}),this.simulation||this.end(e),this.removePointer(t,e)}},{key:"documentBlur",value:function(t){this.end(t),this._scopeFire("interactions:blur",{event:t,type:"blur",interaction:this})}},{key:"end",value:function(t){var e;this._ending=!0,t=t||this._latestPointer.event,this.interacting()&&(e=this._doPhase({event:t,interaction:this,phase:"end"})),this._ending=!1,!0===e&&this.stop()}},{key:"currentAction",value:function(){return this._interacting?this.prepared.name:null}},{key:"interacting",value:function(){return this._interacting}},{key:"stop",value:function(){this._scopeFire("interactions:stop",{interaction:this}),this.interactable=this.element=null,this._interacting=!1,this._stopped=!0,this.prepared.name=this.prevEvent=null}},{key:"getPointerIndex",value:function(t){var e=X.getPointerId(t);return"mouse"===this.pointerType||"pen"===this.pointerType?this.pointers.length-1:H.findIndex(this.pointers,(function(t){return t.id===e}))}},{key:"getPointerInfo",value:function(t){return this.pointers[this.getPointerIndex(t)]}},{key:"updatePointer",value:function(t,e,n,r){var o=X.getPointerId(t),i=this.getPointerIndex(t),a=this.pointers[i];return r=!1!==r&&(r||/(down|start)$/i.test(e.type)),a?a.pointer=t:(a=new Ye.PointerInfo(o,t,e,null,null),i=this.pointers.length,this.pointers.push(a)),X.setCoords(this.coords.cur,this.pointers.map((function(t){return t.pointer})),this._now()),X.setCoordDeltas(this.coords.delta,this.coords.prev,this.coords.cur),r&&(this.pointerIsDown=!0,a.downTime=this.coords.cur.timeStamp,a.downTarget=n,X.pointerExtend(this.downPointer,t),this.interacting()||(X.copyCoords(this.coords.start,this.coords.cur),X.copyCoords(this.coords.prev,this.coords.cur),this.downEvent=e,this.pointerWasMoved=!1)),this._updateLatestPointer(t,e,n),this._scopeFire("interactions:update-pointer",{pointer:t,event:e,eventTarget:n,down:r,pointerInfo:a,pointerIndex:i,interaction:this}),i}},{key:"removePointer",value:function(t,e){var n=this.getPointerIndex(t);if(-1!==n){var r=this.pointers[n];this._scopeFire("interactions:remove-pointer",{pointer:t,event:e,eventTarget:null,pointerIndex:n,pointerInfo:r,interaction:this}),this.pointers.splice(n,1),this.pointerIsDown=!1}}},{key:"_updateLatestPointer",value:function(t,e,n){this._latestPointer.pointer=t,this._latestPointer.event=e,this._latestPointer.eventTarget=n}},{key:"destroy",value:function(){this._latestPointer.pointer=null,this._latestPointer.event=null,this._latestPointer.eventTarget=null}},{key:"_createPreparedEvent",value:function(t,e,n,r){return new Ie.InteractEvent(this,t,this.prepared.name,e,this.element,n,r)}},{key:"_fireEvent",value:function(t){var e;null==(e=this.interactable)||e.fire(t),(!this.prevEvent||t.timeStamp>=this.prevEvent.timeStamp)&&(this.prevEvent=t)}},{key:"_doPhase",value:function(t){var e=t.event,n=t.phase,r=t.preEnd,o=t.type,i=this.rect;if(i&&"move"===n&&(k.addEdges(this.edges,i,this.coords.delta[this.interactable.options.deltaSource]),i.width=i.right-i.left,i.height=i.bottom-i.top),!1===this._scopeFire("interactions:before-action-".concat(n),t))return!1;var a=t.iEvent=this._createPreparedEvent(e,n,r,o);return this._scopeFire("interactions:action-".concat(n),t),"start"===n&&(this.prevEvent=a),this._fireEvent(a),this._scopeFire("interactions:after-action-".concat(n),t),!0}},{key:"_now",value:function(){return Date.now()}}],n&&$e(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();Ge.Interaction=Ze;var Je=Ze;Ge.default=Je;var Qe={};function tn(t){t.pointerIsDown&&(on(t.coords.cur,t.offset.total),t.offset.pending.x=0,t.offset.pending.y=0)}function en(t){nn(t.interaction)}function nn(t){if(!function(t){return!(!t.offset.pending.x&&!t.offset.pending.y)}(t))return!1;var e=t.offset.pending;return on(t.coords.cur,e),on(t.coords.delta,e),k.addEdges(t.edges,t.rect,e),e.x=0,e.y=0,!0}function rn(t){var e=t.x,n=t.y;this.offset.pending.x+=e,this.offset.pending.y+=n,this.offset.total.x+=e,this.offset.total.y+=n}function on(t,e){var n=t.page,r=t.client,o=e.x,i=e.y;n.x+=o,n.y+=i,r.x+=o,r.y+=i}Object.defineProperty(Qe,"__esModule",{value:!0}),Qe.addTotal=tn,Qe.applyPending=nn,Qe.default=void 0,Ge._ProxyMethods.offsetBy="";var an={id:"offset",before:["modifiers","pointer-events","actions","inertia"],install:function(t){t.Interaction.prototype.offsetBy=rn},listeners:{"interactions:new":function(t){t.interaction.offset={total:{x:0,y:0},pending:{x:0,y:0}}},"interactions:update-pointer":function(t){return tn(t.interaction)},"interactions:before-action-start":en,"interactions:before-action-move":en,"interactions:before-action-end":function(t){var e=t.interaction;if(nn(e))return e.move({offset:!0}),e.end(),!1},"interactions:stop":function(t){var e=t.interaction;e.offset.total.x=0,e.offset.total.y=0,e.offset.pending.x=0,e.offset.pending.y=0}}},sn=an;Qe.default=sn;var ln={};function un(t,e){for(var n=0;nn.minSpeed&&o>n.endSpeed)this.startInertia();else{if(i.result=i.setAll(this.modifierArg),!i.result.changed)return!1;this.startSmoothEnd()}return e.modification.result.rect=null,e.offsetBy(this.targetOffset),e._doPhase({interaction:e,event:t,phase:"inertiastart"}),e.offsetBy({x:-this.targetOffset.x,y:-this.targetOffset.y}),e.modification.result.rect=null,this.active=!0,e.simulation=this,!0}},{key:"startInertia",value:function(){var t=this,e=this.interaction.coords.velocity.client,n=dn(this.interaction),r=n.resistance,o=-Math.log(n.endSpeed/this.v0)/r;this.targetOffset={x:(e.x-o)/r,y:(e.y-o)/r},this.te=o,this.lambda_v0=r/this.v0,this.one_ve_v0=1-n.endSpeed/this.v0;var i=this.modification,a=this.modifierArg;a.pageCoords={x:this.startCoords.x+this.targetOffset.x,y:this.startCoords.y+this.targetOffset.y},i.result=i.setAll(a),i.result.changed&&(this.isModified=!0,this.modifiedOffset={x:this.targetOffset.x+i.result.delta.x,y:this.targetOffset.y+i.result.delta.y}),this.onNextFrame((function(){return t.inertiaTick()}))}},{key:"startSmoothEnd",value:function(){var t=this;this.smoothEnd=!0,this.isModified=!0,this.targetOffset={x:this.modification.result.delta.x,y:this.modification.result.delta.y},this.onNextFrame((function(){return t.smoothEndTick()}))}},{key:"onNextFrame",value:function(t){var e=this;this.timeout=Tt.default.request((function(){e.active&&t()}))}},{key:"inertiaTick",value:function(){var t,e,n,r,o,i=this,a=this.interaction,s=dn(a).resistance,l=(a._now()-this.t0)/1e3;if(l=0;n--){var r=e[n],o=r.selector,a=r.context,s=r.listeners;o===this.target&&a===this._context&&e.splice(n,1);for(var l=s.length-1;l>=0;l--)this._scopeEvents.removeDelegate(this.target,this._context,t,s[l][0],s[l][1])}else this._scopeEvents.remove(this.target,"all")}}])&&En(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),t}();On.Interactable=Tn;var jn={};function Mn(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=Array(e);n=0;a--){var p=f[a];if(p.selector===t&&p.context===e){for(var v=p.listeners,h=v.length-1;h>=0;h--){var g=Cn(v[h],2),y=g[0],m=g[1],b=m.capture,x=m.passive;if(y===o&&b===s.capture&&x===s.passive){v.splice(h,1),v.length||(f.splice(a,1),l(e,n,u),l(e,n,c,!0)),d=!0;break}}if(d)break}}},delegateListener:u,delegateUseCapture:c,delegatedEvents:r,documents:o,targets:n,supportsOptions:!1,supportsPassive:!1};function s(t,e,r,o){var i=Xn(o),s=H.find(n,(function(e){return e.eventTarget===t}));s||(s={eventTarget:t,events:{}},n.push(s)),s.events[e]||(s.events[e]=[]),t.addEventListener&&!H.contains(s.events[e],r)&&(t.addEventListener(e,r,a.supportsOptions?i:i.capture),s.events[e].push(r))}function l(t,e,r,o){var i=Xn(o),s=H.findIndex(n,(function(e){return e.eventTarget===t})),u=n[s];if(u&&u.events)if("all"!==e){var c=!1,f=u.events[e];if(f){if("all"===r){for(var d=f.length-1;d>=0;d--)l(t,e,f[d],i);return}for(var p=0;p=2)continue;if(!o.interacting()&&e===o.pointerType)return o}return null}};function Ln(t,e){return t.pointers.some((function(t){return t.id===e}))}var Un=Wn;Yn.default=Un;var Vn={};function Nn(t){return Nn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nn(t)}function qn(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){s=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Gn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Gn(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Gn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n=0;r--){var o=e.interactions.list[r];o.interactable===n&&(o.stop(),e.fire("interactions:destroy",{interaction:o}),o.destroy(),e.interactions.list.length>2&&e.interactions.list.splice(r,1))}}},onDocSignal:nr,doOnInteractions:tr,methodNames:Qn},or=rr;Vn.default=or;var ir={};function ar(t){return ar="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ar(t)}function sr(){return sr="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=lr(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},sr.apply(this,arguments)}function lr(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=fr(t)););return t}function ur(t,e){return ur=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ur(t,e)}function cr(t,e){if(e&&("object"===ar(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function fr(t){return fr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},fr(t)}function dr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function pr(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=Array(e);nMath.abs(l.y),s.coords,s.rect),(0,M.default)(r,s.coords)),s.eventProps},defaults:{ratio:"preserve",equalDelta:!1,modifiers:[],enabled:!1}};function Fr(t,e,n){var r=t.startCoords,o=t.edgeSign;e?n.y=r.y+(n.x-r.x)*o.y:n.x=r.x+(n.y-r.y)*o.x}function Xr(t,e,n,r){var o=t.startRect,i=t.startCoords,a=t.ratio,s=t.edgeSign;if(e){var l=r.width/a;n.y=i.y+(l-o.height)*s.y}else{var u=r.height*a;n.x=i.x+(u-o.width)*s.x}}Dr.aspectRatio=Rr;var Br=(0,Se.makeModifier)(Rr,"aspectRatio");Dr.default=Br;var Yr={};Object.defineProperty(Yr,"__esModule",{value:!0}),Yr.default=void 0;var Wr=function(){};Wr._defaults={};var Lr=Wr;Yr.default=Lr;var Ur={};Object.defineProperty(Ur,"__esModule",{value:!0}),Object.defineProperty(Ur,"default",{enumerable:!0,get:function(){return Yr.default}});var Vr={};function Nr(t,e,n){return i.default.func(t)?k.resolveRectLike(t,e.interactable,e.element,[n.x,n.y,e]):k.resolveRectLike(t,e.interactable,e.element)}Object.defineProperty(Vr,"__esModule",{value:!0}),Vr.default=void 0,Vr.getRestrictionRect=Nr,Vr.restrict=void 0;var qr={start:function(t){var e=t.rect,n=t.startOffset,r=t.state,o=t.interaction,i=t.pageCoords,a=r.options,s=a.elementRect,l=(0,M.default)({left:0,top:0,right:0,bottom:0},a.offset||{});if(e&&s){var u=Nr(a.restriction,o,i);if(u){var c=u.right-u.left-e.width,f=u.bottom-u.top-e.height;c<0&&(l.left+=c,l.right+=c),f<0&&(l.top+=f,l.bottom+=f)}l.left+=n.left-e.width*s.left,l.top+=n.top-e.height*s.top,l.right+=n.right-e.width*(1-s.right),l.bottom+=n.bottom-e.height*(1-s.bottom)}r.offset=l},set:function(t){var e=t.coords,n=t.interaction,r=t.state,o=r.options,i=r.offset,a=Nr(o.restriction,n,e);if(a){var s=k.xywhToTlbr(a);e.x=Math.max(Math.min(s.right-i.right,e.x),s.left+i.left),e.y=Math.max(Math.min(s.bottom-i.bottom,e.y),s.top+i.top)}},defaults:{restriction:null,elementRect:null,offset:null,endOnly:!1,enabled:!1}};Vr.restrict=qr;var Gr=(0,Se.makeModifier)(qr,"restrict");Vr.default=Gr;var $r={};Object.defineProperty($r,"__esModule",{value:!0}),$r.restrictEdges=$r.default=void 0;var Hr={top:1/0,left:1/0,bottom:-1/0,right:-1/0},Kr={top:-1/0,left:-1/0,bottom:1/0,right:1/0};function Zr(t,e){for(var n=["top","left","bottom","right"],r=0;rt.length)&&(e=t.length);for(var n=0,r=Array(e);nhello admin

-
+
+
Image preview...
diff --git a/views/project.ejs b/views/project.ejs index 575a72e..84677a9 100644 --- a/views/project.ejs +++ b/views/project.ejs @@ -100,7 +100,7 @@ <%- include('./static/start.ejs',{name:proj_name,async: true}) %> <%- include('./header.ejs') %> - + @@ -124,14 +124,14 @@
0
- +
0
- +
@@ -177,7 +177,7 @@ data.forEach(value => { // console.log(value); let czones = document.getElementsByClassName("czones")[0]; - let czone = document.createElement('img'); + let czone = document.createElement('div'); czone.classList.add(value["name"]); czone.classList.add("createzone"); czones.append(czone)