1 | "use strict";
|
2 |
|
3 | 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); }
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | (function (f) {
|
12 | if ((typeof exports === "undefined" ? "undefined" : _typeof2(exports)) === "object" && typeof module !== "undefined") {
|
13 | module.exports = f();
|
14 | } else if (typeof define === "function" && define.amd) {
|
15 | define([], f);
|
16 | } else {
|
17 | var g;
|
18 |
|
19 | if (typeof window !== "undefined") {
|
20 | g = window;
|
21 | } else if (typeof global !== "undefined") {
|
22 | g = global;
|
23 | } else if (typeof self !== "undefined") {
|
24 | g = self;
|
25 | } else {
|
26 | g = this;
|
27 | }
|
28 |
|
29 | g.interact = f();
|
30 | }
|
31 | })(function () {
|
32 | var define, module, exports;
|
33 | var _$isWindow_71 = {};
|
34 | "use strict";
|
35 |
|
36 | Object.defineProperty(_$isWindow_71, "__esModule", {
|
37 | value: true
|
38 | });
|
39 | _$isWindow_71.default = void 0;
|
40 |
|
41 | var _default = function _default(thing) {
|
42 | return !!(thing && thing.Window) && thing instanceof thing.Window;
|
43 | };
|
44 |
|
45 | _$isWindow_71.default = _default;
|
46 | var _$window_78 = {};
|
47 | "use strict";
|
48 |
|
49 | Object.defineProperty(_$window_78, "__esModule", {
|
50 | value: true
|
51 | });
|
52 | _$window_78.init = init;
|
53 | _$window_78.getWindow = getWindow;
|
54 | _$window_78.window = _$window_78.realWindow = void 0;
|
55 |
|
56 |
|
57 | ;
|
58 | var realWindow = undefined;
|
59 | _$window_78.realWindow = realWindow;
|
60 | var win = undefined;
|
61 | _$window_78.window = win;
|
62 |
|
63 | function init(window) {
|
64 |
|
65 | _$window_78.realWindow = realWindow = window;
|
66 |
|
67 | var el = window.document.createTextNode('');
|
68 |
|
69 | if (el.ownerDocument !== window.document && typeof window.wrap === 'function' && window.wrap(el) === el) {
|
70 |
|
71 | window = window.wrap(window);
|
72 | }
|
73 |
|
74 | _$window_78.window = win = window;
|
75 | }
|
76 |
|
77 | if (typeof window !== 'undefined' && !!window) {
|
78 | init(window);
|
79 | }
|
80 |
|
81 | function getWindow(node) {
|
82 | if ((0, _$isWindow_71.default)(node)) {
|
83 | return node;
|
84 | }
|
85 |
|
86 | var rootNode = node.ownerDocument || node;
|
87 | return rootNode.defaultView || win.window;
|
88 | }
|
89 |
|
90 | var _$is_70 = {};
|
91 | "use strict";
|
92 |
|
93 | Object.defineProperty(_$is_70, "__esModule", {
|
94 | value: true
|
95 | });
|
96 | _$is_70.default = void 0;
|
97 |
|
98 |
|
99 | ;
|
100 |
|
101 |
|
102 | ;
|
103 |
|
104 | function _typeof(obj) {
|
105 | "@babel/helpers - typeof";
|
106 |
|
107 | if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
108 | _typeof = function _typeof(obj) {
|
109 | return typeof obj;
|
110 | };
|
111 | } else {
|
112 | _typeof = function _typeof(obj) {
|
113 | return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
114 | };
|
115 | }
|
116 |
|
117 | return _typeof(obj);
|
118 | }
|
119 |
|
120 | var __window_70 = function window(thing) {
|
121 | return thing === _$window_78.window || (0, _$isWindow_71.default)(thing);
|
122 | };
|
123 |
|
124 | var docFrag = function docFrag(thing) {
|
125 | return object(thing) && thing.nodeType === 11;
|
126 | };
|
127 |
|
128 | var object = function object(thing) {
|
129 | return !!thing && _typeof(thing) === 'object';
|
130 | };
|
131 |
|
132 | var func = function func(thing) {
|
133 | return typeof thing === 'function';
|
134 | };
|
135 |
|
136 | var number = function number(thing) {
|
137 | return typeof thing === 'number';
|
138 | };
|
139 |
|
140 | var bool = function bool(thing) {
|
141 | return typeof thing === 'boolean';
|
142 | };
|
143 |
|
144 | var string = function string(thing) {
|
145 | return typeof thing === 'string';
|
146 | };
|
147 |
|
148 | var element = function element(thing) {
|
149 | if (!thing || _typeof(thing) !== 'object') {
|
150 | return false;
|
151 | }
|
152 |
|
153 |
|
154 | var _window = _$window_78.getWindow(thing) || _$window_78.window;
|
155 |
|
156 | return /object|function/.test(_typeof(_window.Element)) ? thing instanceof _window.Element
|
157 | : thing.nodeType === 1 && typeof thing.nodeName === 'string';
|
158 | };
|
159 |
|
160 | var plainObject = function plainObject(thing) {
|
161 | return object(thing) && !!thing.constructor && /function Object\b/.test(thing.constructor.toString());
|
162 | };
|
163 |
|
164 | var array = function array(thing) {
|
165 | return object(thing) && typeof thing.length !== 'undefined' && func(thing.splice);
|
166 | };
|
167 |
|
168 | var ___default_70 = {
|
169 | window: __window_70,
|
170 | docFrag: docFrag,
|
171 | object: object,
|
172 | func: func,
|
173 | number: number,
|
174 | bool: bool,
|
175 | string: string,
|
176 | element: element,
|
177 | plainObject: plainObject,
|
178 | array: array
|
179 | };
|
180 | _$is_70.default = ___default_70;
|
181 | var _$plugin_1 = {};
|
182 | "use strict";
|
183 |
|
184 | Object.defineProperty(_$plugin_1, "__esModule", {
|
185 | value: true
|
186 | });
|
187 | _$plugin_1.default = void 0;
|
188 |
|
189 |
|
190 | ;
|
191 |
|
192 | function install(scope) {
|
193 | var actions = scope.actions,
|
194 | Interactable = scope.Interactable,
|
195 | defaults = scope.defaults;
|
196 | Interactable.prototype.draggable = drag.draggable;
|
197 | actions.map.drag = drag;
|
198 | actions.methodDict.drag = 'draggable';
|
199 | defaults.actions.drag = drag.defaults;
|
200 | }
|
201 |
|
202 | function beforeMove(_ref) {
|
203 | var interaction = _ref.interaction;
|
204 | if (interaction.prepared.name !== 'drag') return;
|
205 | var axis = interaction.prepared.axis;
|
206 |
|
207 | if (axis === 'x') {
|
208 | interaction.coords.cur.page.y = interaction.coords.start.page.y;
|
209 | interaction.coords.cur.client.y = interaction.coords.start.client.y;
|
210 | interaction.coords.velocity.client.y = 0;
|
211 | interaction.coords.velocity.page.y = 0;
|
212 | } else if (axis === 'y') {
|
213 | interaction.coords.cur.page.x = interaction.coords.start.page.x;
|
214 | interaction.coords.cur.client.x = interaction.coords.start.client.x;
|
215 | interaction.coords.velocity.client.x = 0;
|
216 | interaction.coords.velocity.page.x = 0;
|
217 | }
|
218 | }
|
219 |
|
220 | function move(_ref2) {
|
221 | var iEvent = _ref2.iEvent,
|
222 | interaction = _ref2.interaction;
|
223 | if (interaction.prepared.name !== 'drag') return;
|
224 | var axis = interaction.prepared.axis;
|
225 |
|
226 | if (axis === 'x' || axis === 'y') {
|
227 | var opposite = axis === 'x' ? 'y' : 'x';
|
228 | iEvent.page[opposite] = interaction.coords.start.page[opposite];
|
229 | iEvent.client[opposite] = interaction.coords.start.client[opposite];
|
230 | iEvent.delta[opposite] = 0;
|
231 | }
|
232 | }
|
233 | |
234 |
|
235 |
|
236 |
|
237 |
|
238 |
|
239 |
|
240 |
|
241 |
|
242 |
|
243 |
|
244 |
|
245 |
|
246 |
|
247 |
|
248 |
|
249 |
|
250 |
|
251 |
|
252 |
|
253 |
|
254 |
|
255 |
|
256 |
|
257 |
|
258 |
|
259 |
|
260 |
|
261 |
|
262 |
|
263 |
|
264 |
|
265 |
|
266 |
|
267 |
|
268 |
|
269 |
|
270 |
|
271 |
|
272 |
|
273 |
|
274 | var draggable = function draggable(options) {
|
275 | if (_$is_70.default.object(options)) {
|
276 | this.options.drag.enabled = options.enabled !== false;
|
277 | this.setPerAction('drag', options);
|
278 | this.setOnEvents('drag', options);
|
279 |
|
280 | if (/^(xy|x|y|start)$/.test(options.lockAxis)) {
|
281 | this.options.drag.lockAxis = options.lockAxis;
|
282 | }
|
283 |
|
284 | if (/^(xy|x|y)$/.test(options.startAxis)) {
|
285 | this.options.drag.startAxis = options.startAxis;
|
286 | }
|
287 |
|
288 | return this;
|
289 | }
|
290 |
|
291 | if (_$is_70.default.bool(options)) {
|
292 | this.options.drag.enabled = options;
|
293 | return this;
|
294 | }
|
295 |
|
296 | return this.options.drag;
|
297 | };
|
298 |
|
299 | var drag = {
|
300 | id: 'actions/drag',
|
301 | install: install,
|
302 | listeners: {
|
303 | 'interactions:before-action-move': beforeMove,
|
304 | 'interactions:action-resume': beforeMove,
|
305 |
|
306 | 'interactions:action-move': move,
|
307 | 'auto-start:check': function autoStartCheck(arg) {
|
308 | var interaction = arg.interaction,
|
309 | interactable = arg.interactable,
|
310 | buttons = arg.buttons;
|
311 | var dragOptions = interactable.options.drag;
|
312 |
|
313 | if (!(dragOptions && dragOptions.enabled) ||
|
314 | interaction.pointerIsDown && /mouse|pointer/.test(interaction.pointerType) && (buttons & interactable.options.drag.mouseButtons) === 0) {
|
315 | return undefined;
|
316 | }
|
317 |
|
318 | arg.action = {
|
319 | name: 'drag',
|
320 | axis: dragOptions.lockAxis === 'start' ? dragOptions.startAxis : dragOptions.lockAxis
|
321 | };
|
322 | return false;
|
323 | }
|
324 | },
|
325 | draggable: draggable,
|
326 | beforeMove: beforeMove,
|
327 | move: move,
|
328 | defaults: {
|
329 | startAxis: 'xy',
|
330 | lockAxis: 'xy'
|
331 | },
|
332 | getCursor: function getCursor() {
|
333 | return 'move';
|
334 | }
|
335 | };
|
336 | var ___default_1 = drag;
|
337 | _$plugin_1.default = ___default_1;
|
338 | var _$domObjects_65 = {};
|
339 | "use strict";
|
340 |
|
341 | Object.defineProperty(_$domObjects_65, "__esModule", {
|
342 | value: true
|
343 | });
|
344 | _$domObjects_65.default = void 0;
|
345 | var domObjects = {
|
346 | init: __init_65,
|
347 | document: null,
|
348 | DocumentFragment: null,
|
349 | SVGElement: null,
|
350 | SVGSVGElement: null,
|
351 | SVGElementInstance: null,
|
352 | Element: null,
|
353 | HTMLElement: null,
|
354 | Event: null,
|
355 | Touch: null,
|
356 | PointerEvent: null
|
357 | };
|
358 |
|
359 | function blank() {}
|
360 |
|
361 | var ___default_65 = domObjects;
|
362 | _$domObjects_65.default = ___default_65;
|
363 |
|
364 | function __init_65(window) {
|
365 | var win = window;
|
366 | domObjects.document = win.document;
|
367 | domObjects.DocumentFragment = win.DocumentFragment || blank;
|
368 | domObjects.SVGElement = win.SVGElement || blank;
|
369 | domObjects.SVGSVGElement = win.SVGSVGElement || blank;
|
370 | domObjects.SVGElementInstance = win.SVGElementInstance || blank;
|
371 | domObjects.Element = win.Element || blank;
|
372 | domObjects.HTMLElement = win.HTMLElement || domObjects.Element;
|
373 | domObjects.Event = win.Event;
|
374 | domObjects.Touch = win.Touch || blank;
|
375 | domObjects.PointerEvent = win.PointerEvent || win.MSPointerEvent;
|
376 | }
|
377 |
|
378 | var _$browser_63 = {};
|
379 | "use strict";
|
380 |
|
381 | Object.defineProperty(_$browser_63, "__esModule", {
|
382 | value: true
|
383 | });
|
384 | _$browser_63.default = void 0;
|
385 |
|
386 |
|
387 | ;
|
388 |
|
389 |
|
390 | ;
|
391 | var browser = {
|
392 | init: __init_63,
|
393 | supportsTouch: null,
|
394 | supportsPointerEvent: null,
|
395 | isIOS7: null,
|
396 | isIOS: null,
|
397 | isIe9: null,
|
398 | isOperaMobile: null,
|
399 | prefixedMatchesSelector: null,
|
400 | pEventTypes: null,
|
401 | wheelEvent: null
|
402 | };
|
403 |
|
404 | function __init_63(window) {
|
405 | var Element = _$domObjects_65.default.Element;
|
406 | var navigator = window.navigator || {};
|
407 |
|
408 | browser.supportsTouch = 'ontouchstart' in window || _$is_70.default.func(window.DocumentTouch) && _$domObjects_65.default.document instanceof window.DocumentTouch;
|
409 |
|
410 | browser.supportsPointerEvent = navigator.pointerEnabled !== false && !!_$domObjects_65.default.PointerEvent;
|
411 | browser.isIOS = /iP(hone|od|ad)/.test(navigator.platform);
|
412 |
|
413 | browser.isIOS7 = /iP(hone|od|ad)/.test(navigator.platform) && /OS 7[^\d]/.test(navigator.appVersion);
|
414 | browser.isIe9 = /MSIE 9/.test(navigator.userAgent);
|
415 |
|
416 | browser.isOperaMobile = navigator.appName === 'Opera' && browser.supportsTouch && /Presto/.test(navigator.userAgent);
|
417 |
|
418 | browser.prefixedMatchesSelector = 'matches' in Element.prototype ? 'matches' : 'webkitMatchesSelector' in Element.prototype ? 'webkitMatchesSelector' : 'mozMatchesSelector' in Element.prototype ? 'mozMatchesSelector' : 'oMatchesSelector' in Element.prototype ? 'oMatchesSelector' : 'msMatchesSelector';
|
419 | browser.pEventTypes = browser.supportsPointerEvent ? _$domObjects_65.default.PointerEvent === window.MSPointerEvent ? {
|
420 | up: 'MSPointerUp',
|
421 | down: 'MSPointerDown',
|
422 | over: 'mouseover',
|
423 | out: 'mouseout',
|
424 | move: 'MSPointerMove',
|
425 | cancel: 'MSPointerCancel'
|
426 | } : {
|
427 | up: 'pointerup',
|
428 | down: 'pointerdown',
|
429 | over: 'pointerover',
|
430 | out: 'pointerout',
|
431 | move: 'pointermove',
|
432 | cancel: 'pointercancel'
|
433 | } : null;
|
434 |
|
435 | browser.wheelEvent = _$domObjects_65.default.document && 'onmousewheel' in _$domObjects_65.default.document ? 'mousewheel' : 'wheel';
|
436 | }
|
437 |
|
438 | var ___default_63 = browser;
|
439 | _$browser_63.default = ___default_63;
|
440 | var _$domUtils_66 = {};
|
441 | "use strict";
|
442 |
|
443 | Object.defineProperty(_$domUtils_66, "__esModule", {
|
444 | value: true
|
445 | });
|
446 | _$domUtils_66.nodeContains = nodeContains;
|
447 | _$domUtils_66.closest = closest;
|
448 | _$domUtils_66.parentNode = parentNode;
|
449 | _$domUtils_66.matchesSelector = matchesSelector;
|
450 | _$domUtils_66.indexOfDeepestElement = indexOfDeepestElement;
|
451 | _$domUtils_66.matchesUpTo = matchesUpTo;
|
452 | _$domUtils_66.getActualElement = getActualElement;
|
453 | _$domUtils_66.getScrollXY = getScrollXY;
|
454 | _$domUtils_66.getElementClientRect = getElementClientRect;
|
455 | _$domUtils_66.getElementRect = getElementRect;
|
456 | _$domUtils_66.getPath = getPath;
|
457 | _$domUtils_66.trySelector = trySelector;
|
458 |
|
459 |
|
460 | ;
|
461 |
|
462 |
|
463 | ;
|
464 |
|
465 |
|
466 | ;
|
467 |
|
468 |
|
469 | ;
|
470 |
|
471 | function nodeContains(parent, child) {
|
472 | if (parent.contains) {
|
473 | return parent.contains(child);
|
474 | }
|
475 |
|
476 | while (child) {
|
477 | if (child === parent) {
|
478 | return true;
|
479 | }
|
480 |
|
481 | child = child.parentNode;
|
482 | }
|
483 |
|
484 | return false;
|
485 | }
|
486 |
|
487 | function closest(element, selector) {
|
488 | while (_$is_70.default.element(element)) {
|
489 | if (matchesSelector(element, selector)) {
|
490 | return element;
|
491 | }
|
492 |
|
493 | element = parentNode(element);
|
494 | }
|
495 |
|
496 | return null;
|
497 | }
|
498 |
|
499 | function parentNode(node) {
|
500 | var parent = node.parentNode;
|
501 |
|
502 | if (_$is_70.default.docFrag(parent)) {
|
503 |
|
504 |
|
505 | while ((parent = parent.host) && _$is_70.default.docFrag(parent)) {
|
506 | continue;
|
507 | }
|
508 |
|
509 | return parent;
|
510 | }
|
511 |
|
512 | return parent;
|
513 | }
|
514 |
|
515 | function matchesSelector(element, selector) {
|
516 |
|
517 | if (_$window_78.window !== _$window_78.realWindow) {
|
518 | selector = selector.replace(/\/deep\//g, ' ');
|
519 | }
|
520 |
|
521 | return element[_$browser_63.default.prefixedMatchesSelector](selector);
|
522 | }
|
523 |
|
524 | var getParent = function getParent(el) {
|
525 | return el.parentNode || el.host;
|
526 | };
|
527 |
|
528 |
|
529 | function indexOfDeepestElement(elements) {
|
530 | var deepestNodeParents = [];
|
531 | var deepestNodeIndex;
|
532 |
|
533 | for (var i = 0; i < elements.length; i++) {
|
534 | var currentNode = elements[i];
|
535 | var deepestNode = elements[deepestNodeIndex];
|
536 |
|
537 | if (!currentNode || i === deepestNodeIndex) {
|
538 | continue;
|
539 | }
|
540 |
|
541 | if (!deepestNode) {
|
542 | deepestNodeIndex = i;
|
543 | continue;
|
544 | }
|
545 |
|
546 | var currentNodeParent = getParent(currentNode);
|
547 | var deepestNodeParent = getParent(deepestNode);
|
548 |
|
549 |
|
550 | if (currentNodeParent === currentNode.ownerDocument) {
|
551 | continue;
|
552 | }
|
553 | else if (deepestNodeParent === currentNode.ownerDocument) {
|
554 | deepestNodeIndex = i;
|
555 | continue;
|
556 | }
|
557 |
|
558 |
|
559 | if (currentNodeParent === deepestNodeParent) {
|
560 | if (zIndexIsHigherThan(currentNode, deepestNode)) {
|
561 | deepestNodeIndex = i;
|
562 | }
|
563 |
|
564 | continue;
|
565 | }
|
566 |
|
567 |
|
568 | deepestNodeParents = deepestNodeParents.length ? deepestNodeParents : getNodeParents(deepestNode);
|
569 | var ancestryStart = void 0;
|
570 |
|
571 | if (deepestNode instanceof _$domObjects_65.default.HTMLElement && currentNode instanceof _$domObjects_65.default.SVGElement && !(currentNode instanceof _$domObjects_65.default.SVGSVGElement)) {
|
572 |
|
573 | if (currentNode === deepestNodeParent) {
|
574 | continue;
|
575 | }
|
576 |
|
577 | ancestryStart = currentNode.ownerSVGElement;
|
578 | } else {
|
579 | ancestryStart = currentNode;
|
580 | }
|
581 |
|
582 | var currentNodeParents = getNodeParents(ancestryStart, deepestNode.ownerDocument);
|
583 | var commonIndex = 0;
|
584 |
|
585 | while (currentNodeParents[commonIndex] && currentNodeParents[commonIndex] === deepestNodeParents[commonIndex]) {
|
586 | commonIndex++;
|
587 | }
|
588 |
|
589 | var parents = [currentNodeParents[commonIndex - 1], currentNodeParents[commonIndex], deepestNodeParents[commonIndex]];
|
590 |
|
591 | if (parents[0]) {
|
592 | var child = parents[0].lastChild;
|
593 |
|
594 | while (child) {
|
595 | if (child === parents[1]) {
|
596 | deepestNodeIndex = i;
|
597 | deepestNodeParents = currentNodeParents;
|
598 | break;
|
599 | } else if (child === parents[2]) {
|
600 | break;
|
601 | }
|
602 |
|
603 | child = child.previousSibling;
|
604 | }
|
605 | }
|
606 | }
|
607 |
|
608 | return deepestNodeIndex;
|
609 | }
|
610 |
|
611 | function getNodeParents(node, limit) {
|
612 | var parents = [];
|
613 | var parent = node;
|
614 | var parentParent;
|
615 |
|
616 | while ((parentParent = getParent(parent)) && parent !== limit && parentParent !== parent.ownerDocument) {
|
617 | parents.unshift(parent);
|
618 | parent = parentParent;
|
619 | }
|
620 |
|
621 | return parents;
|
622 | }
|
623 |
|
624 | function zIndexIsHigherThan(higherNode, lowerNode) {
|
625 | var higherIndex = parseInt(_$window_78.getWindow(higherNode).getComputedStyle(higherNode).zIndex, 10) || 0;
|
626 | var lowerIndex = parseInt(_$window_78.getWindow(lowerNode).getComputedStyle(lowerNode).zIndex, 10) || 0;
|
627 | return higherIndex >= lowerIndex;
|
628 | }
|
629 |
|
630 | function matchesUpTo(element, selector, limit) {
|
631 | while (_$is_70.default.element(element)) {
|
632 | if (matchesSelector(element, selector)) {
|
633 | return true;
|
634 | }
|
635 |
|
636 | element = parentNode(element);
|
637 |
|
638 | if (element === limit) {
|
639 | return matchesSelector(element, selector);
|
640 | }
|
641 | }
|
642 |
|
643 | return false;
|
644 | }
|
645 |
|
646 | function getActualElement(element) {
|
647 | return element.correspondingUseElement || element;
|
648 | }
|
649 |
|
650 | function getScrollXY(relevantWindow) {
|
651 | relevantWindow = relevantWindow || _$window_78.window;
|
652 | return {
|
653 | x: relevantWindow.scrollX || relevantWindow.document.documentElement.scrollLeft,
|
654 | y: relevantWindow.scrollY || relevantWindow.document.documentElement.scrollTop
|
655 | };
|
656 | }
|
657 |
|
658 | function getElementClientRect(element) {
|
659 | var clientRect = element instanceof _$domObjects_65.default.SVGElement ? element.getBoundingClientRect() : element.getClientRects()[0];
|
660 | return clientRect && {
|
661 | left: clientRect.left,
|
662 | right: clientRect.right,
|
663 | top: clientRect.top,
|
664 | bottom: clientRect.bottom,
|
665 | width: clientRect.width || clientRect.right - clientRect.left,
|
666 | height: clientRect.height || clientRect.bottom - clientRect.top
|
667 | };
|
668 | }
|
669 |
|
670 | function getElementRect(element) {
|
671 | var clientRect = getElementClientRect(element);
|
672 |
|
673 | if (!_$browser_63.default.isIOS7 && clientRect) {
|
674 | var scroll = getScrollXY(_$window_78.getWindow(element));
|
675 | clientRect.left += scroll.x;
|
676 | clientRect.right += scroll.x;
|
677 | clientRect.top += scroll.y;
|
678 | clientRect.bottom += scroll.y;
|
679 | }
|
680 |
|
681 | return clientRect;
|
682 | }
|
683 |
|
684 | function getPath(node) {
|
685 | var path = [];
|
686 |
|
687 | while (node) {
|
688 | path.push(node);
|
689 | node = parentNode(node);
|
690 | }
|
691 |
|
692 | return path;
|
693 | }
|
694 |
|
695 | function trySelector(value) {
|
696 | if (!_$is_70.default.string(value)) {
|
697 | return false;
|
698 | }
|
699 |
|
700 |
|
701 | _$domObjects_65.default.document.querySelector(value);
|
702 |
|
703 | return true;
|
704 | }
|
705 |
|
706 | var _$extend_67 = {};
|
707 | "use strict";
|
708 |
|
709 | Object.defineProperty(_$extend_67, "__esModule", {
|
710 | value: true
|
711 | });
|
712 | _$extend_67.default = extend;
|
713 |
|
714 | function extend(dest, source) {
|
715 | for (var prop in source) {
|
716 | ;
|
717 | dest[prop] = source[prop];
|
718 | }
|
719 |
|
720 | var ret = dest;
|
721 | return ret;
|
722 | }
|
723 |
|
724 | var _$rect_77 = {};
|
725 | "use strict";
|
726 |
|
727 | Object.defineProperty(_$rect_77, "__esModule", {
|
728 | value: true
|
729 | });
|
730 | _$rect_77.getStringOptionResult = getStringOptionResult;
|
731 | _$rect_77.resolveRectLike = resolveRectLike;
|
732 | _$rect_77.rectToXY = rectToXY;
|
733 | _$rect_77.xywhToTlbr = xywhToTlbr;
|
734 | _$rect_77.tlbrToXywh = tlbrToXywh;
|
735 | _$rect_77.addEdges = addEdges;
|
736 |
|
737 |
|
738 | ;
|
739 |
|
740 |
|
741 | ;
|
742 |
|
743 |
|
744 | ;
|
745 |
|
746 | function _toConsumableArray(arr) {
|
747 | return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
748 | }
|
749 |
|
750 | function _nonIterableSpread() {
|
751 | throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
752 | }
|
753 |
|
754 | function _unsupportedIterableToArray(o, minLen) {
|
755 | if (!o) return;
|
756 | if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
757 | var n = Object.prototype.toString.call(o).slice(8, -1);
|
758 | if (n === "Object" && o.constructor) n = o.constructor.name;
|
759 | if (n === "Map" || n === "Set") return Array.from(o);
|
760 | if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
761 | }
|
762 |
|
763 | function _iterableToArray(iter) {
|
764 | if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
|
765 | }
|
766 |
|
767 | function _arrayWithoutHoles(arr) {
|
768 | if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
769 | }
|
770 |
|
771 | function _arrayLikeToArray(arr, len) {
|
772 | if (len == null || len > arr.length) len = arr.length;
|
773 |
|
774 | for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
775 | arr2[i] = arr[i];
|
776 | }
|
777 |
|
778 | return arr2;
|
779 | }
|
780 |
|
781 | function getStringOptionResult(value, target, element) {
|
782 | if (value === 'parent') {
|
783 | return (0, _$domUtils_66.parentNode)(element);
|
784 | }
|
785 |
|
786 | if (value === 'self') {
|
787 | return target.getRect(element);
|
788 | }
|
789 |
|
790 | return (0, _$domUtils_66.closest)(element, value);
|
791 | }
|
792 |
|
793 | function resolveRectLike(value, target, element, functionArgs) {
|
794 | var returnValue = value;
|
795 |
|
796 | if (_$is_70.default.string(returnValue)) {
|
797 | returnValue = getStringOptionResult(returnValue, target, element);
|
798 | } else if (_$is_70.default.func(returnValue)) {
|
799 | returnValue = returnValue.apply(void 0, _toConsumableArray(functionArgs));
|
800 | }
|
801 |
|
802 | if (_$is_70.default.element(returnValue)) {
|
803 | returnValue = (0, _$domUtils_66.getElementRect)(returnValue);
|
804 | }
|
805 |
|
806 | return returnValue;
|
807 | }
|
808 |
|
809 | function rectToXY(rect) {
|
810 | return rect && {
|
811 | x: 'x' in rect ? rect.x : rect.left,
|
812 | y: 'y' in rect ? rect.y : rect.top
|
813 | };
|
814 | }
|
815 |
|
816 | function xywhToTlbr(rect) {
|
817 | if (rect && !('left' in rect && 'top' in rect)) {
|
818 | rect = (0, _$extend_67.default)({}, rect);
|
819 | rect.left = rect.x || 0;
|
820 | rect.top = rect.y || 0;
|
821 | rect.right = rect.right || rect.left + rect.width;
|
822 | rect.bottom = rect.bottom || rect.top + rect.height;
|
823 | }
|
824 |
|
825 | return rect;
|
826 | }
|
827 |
|
828 | function tlbrToXywh(rect) {
|
829 | if (rect && !('x' in rect && 'y' in rect)) {
|
830 | rect = (0, _$extend_67.default)({}, rect);
|
831 | rect.x = rect.left || 0;
|
832 | rect.y = rect.top || 0;
|
833 | rect.width = rect.width || (rect.right || 0) - rect.x;
|
834 | rect.height = rect.height || (rect.bottom || 0) - rect.y;
|
835 | }
|
836 |
|
837 | return rect;
|
838 | }
|
839 |
|
840 | function addEdges(edges, rect, delta) {
|
841 | if (edges.left) {
|
842 | rect.left += delta.x;
|
843 | }
|
844 |
|
845 | if (edges.right) {
|
846 | rect.right += delta.x;
|
847 | }
|
848 |
|
849 | if (edges.top) {
|
850 | rect.top += delta.y;
|
851 | }
|
852 |
|
853 | if (edges.bottom) {
|
854 | rect.bottom += delta.y;
|
855 | }
|
856 |
|
857 | rect.width = rect.right - rect.left;
|
858 | rect.height = rect.bottom - rect.top;
|
859 | }
|
860 |
|
861 | var _$getOriginXY_68 = {};
|
862 | "use strict";
|
863 |
|
864 | Object.defineProperty(_$getOriginXY_68, "__esModule", {
|
865 | value: true
|
866 | });
|
867 | _$getOriginXY_68.default = ___default_68;
|
868 |
|
869 |
|
870 | ;
|
871 |
|
872 | function ___default_68(target, element, actionName) {
|
873 | var actionOptions = target.options[actionName];
|
874 | var actionOrigin = actionOptions && actionOptions.origin;
|
875 | var origin = actionOrigin || target.options.origin;
|
876 | var originRect = (0, _$rect_77.resolveRectLike)(origin, target, element, [target && element]);
|
877 | return (0, _$rect_77.rectToXY)(originRect) || {
|
878 | x: 0,
|
879 | y: 0
|
880 | };
|
881 | }
|
882 |
|
883 | var _$normalizeListeners_73 = {};
|
884 | "use strict";
|
885 |
|
886 | Object.defineProperty(_$normalizeListeners_73, "__esModule", {
|
887 | value: true
|
888 | });
|
889 | _$normalizeListeners_73.default = normalize;
|
890 |
|
891 |
|
892 | ;
|
893 |
|
894 |
|
895 | ;
|
896 |
|
897 | function normalize(type, listeners, result) {
|
898 | result = result || {};
|
899 |
|
900 | if (_$is_70.default.string(type) && type.search(' ') !== -1) {
|
901 | type = split(type);
|
902 | }
|
903 |
|
904 | if (_$is_70.default.array(type)) {
|
905 | return type.reduce(function (acc, t) {
|
906 | return (0, _$extend_67.default)(acc, normalize(t, listeners, result));
|
907 | }, result);
|
908 | }
|
909 |
|
910 |
|
911 | if (_$is_70.default.object(type)) {
|
912 | listeners = type;
|
913 | type = '';
|
914 | }
|
915 |
|
916 | if (_$is_70.default.func(listeners)) {
|
917 | result[type] = result[type] || [];
|
918 | result[type].push(listeners);
|
919 | } else if (_$is_70.default.array(listeners)) {
|
920 | for (var _i = 0; _i < listeners.length; _i++) {
|
921 | var _ref;
|
922 |
|
923 | _ref = listeners[_i];
|
924 | var l = _ref;
|
925 | normalize(type, l, result);
|
926 | }
|
927 | } else if (_$is_70.default.object(listeners)) {
|
928 | for (var prefix in listeners) {
|
929 | var combinedTypes = split(prefix).map(function (p) {
|
930 | return "".concat(type).concat(p);
|
931 | });
|
932 | normalize(combinedTypes, listeners[prefix], result);
|
933 | }
|
934 | }
|
935 |
|
936 | return result;
|
937 | }
|
938 |
|
939 | function split(type) {
|
940 | return type.trim().split(/ +/);
|
941 | }
|
942 |
|
943 | var _$hypot_69 = {};
|
944 | "use strict";
|
945 |
|
946 | Object.defineProperty(_$hypot_69, "__esModule", {
|
947 | value: true
|
948 | });
|
949 | _$hypot_69.default = void 0;
|
950 |
|
951 | var ___default_69 = function _default(x, y) {
|
952 | return Math.sqrt(x * x + y * y);
|
953 | };
|
954 |
|
955 | _$hypot_69.default = ___default_69;
|
956 | var _$pointerExtend_74 = {};
|
957 | "use strict";
|
958 |
|
959 | Object.defineProperty(_$pointerExtend_74, "__esModule", {
|
960 | value: true
|
961 | });
|
962 | _$pointerExtend_74.default = void 0;
|
963 |
|
964 | function pointerExtend(dest, source) {
|
965 | for (var prop in source) {
|
966 | var prefixedPropREs = pointerExtend.prefixedPropREs;
|
967 | var deprecated = false;
|
968 |
|
969 | for (var vendor in prefixedPropREs) {
|
970 | if (prop.indexOf(vendor) === 0 && prefixedPropREs[vendor].test(prop)) {
|
971 | deprecated = true;
|
972 | break;
|
973 | }
|
974 | }
|
975 |
|
976 | if (!deprecated && typeof source[prop] !== 'function') {
|
977 | dest[prop] = source[prop];
|
978 | }
|
979 | }
|
980 |
|
981 | return dest;
|
982 | }
|
983 |
|
984 | pointerExtend.prefixedPropREs = {
|
985 | webkit: /(Movement[XY]|Radius[XY]|RotationAngle|Force)$/,
|
986 | moz: /(Pressure)$/
|
987 | };
|
988 | var ___default_74 = pointerExtend;
|
989 | _$pointerExtend_74.default = ___default_74;
|
990 | var _$pointerUtils_75 = {};
|
991 | "use strict";
|
992 |
|
993 | Object.defineProperty(_$pointerUtils_75, "__esModule", {
|
994 | value: true
|
995 | });
|
996 | _$pointerUtils_75.copyCoords = copyCoords;
|
997 | _$pointerUtils_75.setCoordDeltas = setCoordDeltas;
|
998 | _$pointerUtils_75.setCoordVelocity = setCoordVelocity;
|
999 | _$pointerUtils_75.setZeroCoords = setZeroCoords;
|
1000 | _$pointerUtils_75.isNativePointer = isNativePointer;
|
1001 | _$pointerUtils_75.getXY = getXY;
|
1002 | _$pointerUtils_75.getPageXY = getPageXY;
|
1003 | _$pointerUtils_75.getClientXY = getClientXY;
|
1004 | _$pointerUtils_75.getPointerId = getPointerId;
|
1005 | _$pointerUtils_75.setCoords = setCoords;
|
1006 | _$pointerUtils_75.getTouchPair = getTouchPair;
|
1007 | _$pointerUtils_75.pointerAverage = pointerAverage;
|
1008 | _$pointerUtils_75.touchBBox = touchBBox;
|
1009 | _$pointerUtils_75.touchDistance = touchDistance;
|
1010 | _$pointerUtils_75.touchAngle = touchAngle;
|
1011 | _$pointerUtils_75.getPointerType = getPointerType;
|
1012 | _$pointerUtils_75.getEventTargets = getEventTargets;
|
1013 | _$pointerUtils_75.newCoords = newCoords;
|
1014 | _$pointerUtils_75.coordsToEvent = coordsToEvent;
|
1015 | Object.defineProperty(_$pointerUtils_75, "pointerExtend", {
|
1016 | enumerable: true,
|
1017 | get: function get() {
|
1018 | return _$pointerExtend_74.default;
|
1019 | }
|
1020 | });
|
1021 |
|
1022 |
|
1023 | ;
|
1024 |
|
1025 |
|
1026 | ;
|
1027 |
|
1028 |
|
1029 | ;
|
1030 |
|
1031 |
|
1032 | ;
|
1033 |
|
1034 |
|
1035 | ;
|
1036 |
|
1037 |
|
1038 | ;
|
1039 |
|
1040 | function copyCoords(dest, src) {
|
1041 | dest.page = dest.page || {};
|
1042 | dest.page.x = src.page.x;
|
1043 | dest.page.y = src.page.y;
|
1044 | dest.client = dest.client || {};
|
1045 | dest.client.x = src.client.x;
|
1046 | dest.client.y = src.client.y;
|
1047 | dest.timeStamp = src.timeStamp;
|
1048 | }
|
1049 |
|
1050 | function setCoordDeltas(targetObj, prev, cur) {
|
1051 | targetObj.page.x = cur.page.x - prev.page.x;
|
1052 | targetObj.page.y = cur.page.y - prev.page.y;
|
1053 | targetObj.client.x = cur.client.x - prev.client.x;
|
1054 | targetObj.client.y = cur.client.y - prev.client.y;
|
1055 | targetObj.timeStamp = cur.timeStamp - prev.timeStamp;
|
1056 | }
|
1057 |
|
1058 | function setCoordVelocity(targetObj, delta) {
|
1059 | var dt = Math.max(delta.timeStamp / 1000, 0.001);
|
1060 | targetObj.page.x = delta.page.x / dt;
|
1061 | targetObj.page.y = delta.page.y / dt;
|
1062 | targetObj.client.x = delta.client.x / dt;
|
1063 | targetObj.client.y = delta.client.y / dt;
|
1064 | targetObj.timeStamp = dt;
|
1065 | }
|
1066 |
|
1067 | function setZeroCoords(targetObj) {
|
1068 | targetObj.page.x = 0;
|
1069 | targetObj.page.y = 0;
|
1070 | targetObj.client.x = 0;
|
1071 | targetObj.client.y = 0;
|
1072 | }
|
1073 |
|
1074 | function isNativePointer(pointer) {
|
1075 | return pointer instanceof _$domObjects_65.default.Event || pointer instanceof _$domObjects_65.default.Touch;
|
1076 | }
|
1077 |
|
1078 |
|
1079 | function getXY(type, pointer, xy) {
|
1080 | xy = xy || {};
|
1081 | type = type || 'page';
|
1082 | xy.x = pointer[type + 'X'];
|
1083 | xy.y = pointer[type + 'Y'];
|
1084 | return xy;
|
1085 | }
|
1086 |
|
1087 | function getPageXY(pointer, page) {
|
1088 | page = page || {
|
1089 | x: 0,
|
1090 | y: 0
|
1091 | };
|
1092 |
|
1093 | if (_$browser_63.default.isOperaMobile && isNativePointer(pointer)) {
|
1094 | getXY('screen', pointer, page);
|
1095 | page.x += window.scrollX;
|
1096 | page.y += window.scrollY;
|
1097 | } else {
|
1098 | getXY('page', pointer, page);
|
1099 | }
|
1100 |
|
1101 | return page;
|
1102 | }
|
1103 |
|
1104 | function getClientXY(pointer, client) {
|
1105 | client = client || {};
|
1106 |
|
1107 | if (_$browser_63.default.isOperaMobile && isNativePointer(pointer)) {
|
1108 |
|
1109 | getXY('screen', pointer, client);
|
1110 | } else {
|
1111 | getXY('client', pointer, client);
|
1112 | }
|
1113 |
|
1114 | return client;
|
1115 | }
|
1116 |
|
1117 | function getPointerId(pointer) {
|
1118 | return _$is_70.default.number(pointer.pointerId) ? pointer.pointerId : pointer.identifier;
|
1119 | }
|
1120 |
|
1121 | function setCoords(dest, pointers, timeStamp) {
|
1122 | var pointer = pointers.length > 1 ? pointerAverage(pointers) : pointers[0];
|
1123 | getPageXY(pointer, dest.page);
|
1124 | getClientXY(pointer, dest.client);
|
1125 | dest.timeStamp = timeStamp;
|
1126 | }
|
1127 |
|
1128 | function getTouchPair(event) {
|
1129 | var touches = [];
|
1130 |
|
1131 | if (_$is_70.default.array(event)) {
|
1132 | touches[0] = event[0];
|
1133 | touches[1] = event[1];
|
1134 | }
|
1135 | else {
|
1136 | if (event.type === 'touchend') {
|
1137 | if (event.touches.length === 1) {
|
1138 | touches[0] = event.touches[0];
|
1139 | touches[1] = event.changedTouches[0];
|
1140 | } else if (event.touches.length === 0) {
|
1141 | touches[0] = event.changedTouches[0];
|
1142 | touches[1] = event.changedTouches[1];
|
1143 | }
|
1144 | } else {
|
1145 | touches[0] = event.touches[0];
|
1146 | touches[1] = event.touches[1];
|
1147 | }
|
1148 | }
|
1149 |
|
1150 | return touches;
|
1151 | }
|
1152 |
|
1153 | function pointerAverage(pointers) {
|
1154 | var average = {
|
1155 | pageX: 0,
|
1156 | pageY: 0,
|
1157 | clientX: 0,
|
1158 | clientY: 0,
|
1159 | screenX: 0,
|
1160 | screenY: 0
|
1161 | };
|
1162 |
|
1163 | for (var _i = 0; _i < pointers.length; _i++) {
|
1164 | var _ref;
|
1165 |
|
1166 | _ref = pointers[_i];
|
1167 | var pointer = _ref;
|
1168 |
|
1169 | for (var _prop in average) {
|
1170 | average[_prop] += pointer[_prop];
|
1171 | }
|
1172 | }
|
1173 |
|
1174 | for (var prop in average) {
|
1175 | average[prop] /= pointers.length;
|
1176 | }
|
1177 |
|
1178 | return average;
|
1179 | }
|
1180 |
|
1181 | function touchBBox(event) {
|
1182 | if (!event.length) {
|
1183 | return null;
|
1184 | }
|
1185 |
|
1186 | var touches = getTouchPair(event);
|
1187 | var minX = Math.min(touches[0].pageX, touches[1].pageX);
|
1188 | var minY = Math.min(touches[0].pageY, touches[1].pageY);
|
1189 | var maxX = Math.max(touches[0].pageX, touches[1].pageX);
|
1190 | var maxY = Math.max(touches[0].pageY, touches[1].pageY);
|
1191 | return {
|
1192 | x: minX,
|
1193 | y: minY,
|
1194 | left: minX,
|
1195 | top: minY,
|
1196 | right: maxX,
|
1197 | bottom: maxY,
|
1198 | width: maxX - minX,
|
1199 | height: maxY - minY
|
1200 | };
|
1201 | }
|
1202 |
|
1203 | function touchDistance(event, deltaSource) {
|
1204 | var sourceX = deltaSource + 'X';
|
1205 | var sourceY = deltaSource + 'Y';
|
1206 | var touches = getTouchPair(event);
|
1207 | var dx = touches[0][sourceX] - touches[1][sourceX];
|
1208 | var dy = touches[0][sourceY] - touches[1][sourceY];
|
1209 | return (0, _$hypot_69.default)(dx, dy);
|
1210 | }
|
1211 |
|
1212 | function touchAngle(event, deltaSource) {
|
1213 | var sourceX = deltaSource + 'X';
|
1214 | var sourceY = deltaSource + 'Y';
|
1215 | var touches = getTouchPair(event);
|
1216 | var dx = touches[1][sourceX] - touches[0][sourceX];
|
1217 | var dy = touches[1][sourceY] - touches[0][sourceY];
|
1218 | var angle = 180 * Math.atan2(dy, dx) / Math.PI;
|
1219 | return angle;
|
1220 | }
|
1221 |
|
1222 | function getPointerType(pointer) {
|
1223 | return _$is_70.default.string(pointer.pointerType) ? pointer.pointerType : _$is_70.default.number(pointer.pointerType) ? [undefined, undefined, 'touch', 'pen', 'mouse'][pointer.pointerType] :
|
1224 |
|
1225 | /touch/.test(pointer.type || '') || pointer instanceof _$domObjects_65.default.Touch ? 'touch' : 'mouse';
|
1226 | }
|
1227 |
|
1228 |
|
1229 | function getEventTargets(event) {
|
1230 | var path = _$is_70.default.func(event.composedPath) ? event.composedPath() : event.path;
|
1231 | return [_$domUtils_66.getActualElement(path ? path[0] : event.target), _$domUtils_66.getActualElement(event.currentTarget)];
|
1232 | }
|
1233 |
|
1234 | function newCoords() {
|
1235 | return {
|
1236 | page: {
|
1237 | x: 0,
|
1238 | y: 0
|
1239 | },
|
1240 | client: {
|
1241 | x: 0,
|
1242 | y: 0
|
1243 | },
|
1244 | timeStamp: 0
|
1245 | };
|
1246 | }
|
1247 |
|
1248 | function coordsToEvent(coords) {
|
1249 | var event = {
|
1250 | coords: coords,
|
1251 |
|
1252 | get page() {
|
1253 | return this.coords.page;
|
1254 | },
|
1255 |
|
1256 | get client() {
|
1257 | return this.coords.client;
|
1258 | },
|
1259 |
|
1260 | get timeStamp() {
|
1261 | return this.coords.timeStamp;
|
1262 | },
|
1263 |
|
1264 | get pageX() {
|
1265 | return this.coords.page.x;
|
1266 | },
|
1267 |
|
1268 | get pageY() {
|
1269 | return this.coords.page.y;
|
1270 | },
|
1271 |
|
1272 | get clientX() {
|
1273 | return this.coords.client.x;
|
1274 | },
|
1275 |
|
1276 | get clientY() {
|
1277 | return this.coords.client.y;
|
1278 | },
|
1279 |
|
1280 | get pointerId() {
|
1281 | return this.coords.pointerId;
|
1282 | },
|
1283 |
|
1284 | get target() {
|
1285 | return this.coords.target;
|
1286 | },
|
1287 |
|
1288 | get type() {
|
1289 | return this.coords.type;
|
1290 | },
|
1291 |
|
1292 | get pointerType() {
|
1293 | return this.coords.pointerType;
|
1294 | },
|
1295 |
|
1296 | get buttons() {
|
1297 | return this.coords.buttons;
|
1298 | },
|
1299 |
|
1300 | preventDefault: function preventDefault() {}
|
1301 | };
|
1302 | return event;
|
1303 | }
|
1304 |
|
1305 | var _$BaseEvent_13 = {};
|
1306 | "use strict";
|
1307 |
|
1308 | Object.defineProperty(_$BaseEvent_13, "__esModule", {
|
1309 | value: true
|
1310 | });
|
1311 | _$BaseEvent_13.BaseEvent = void 0;
|
1312 |
|
1313 | function _classCallCheck(instance, Constructor) {
|
1314 | if (!(instance instanceof Constructor)) {
|
1315 | throw new TypeError("Cannot call a class as a function");
|
1316 | }
|
1317 | }
|
1318 |
|
1319 | function _defineProperties(target, props) {
|
1320 | for (var i = 0; i < props.length; i++) {
|
1321 | var descriptor = props[i];
|
1322 | descriptor.enumerable = descriptor.enumerable || false;
|
1323 | descriptor.configurable = true;
|
1324 | if ("value" in descriptor) descriptor.writable = true;
|
1325 | Object.defineProperty(target, descriptor.key, descriptor);
|
1326 | }
|
1327 | }
|
1328 |
|
1329 | function _createClass(Constructor, protoProps, staticProps) {
|
1330 | if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
1331 | if (staticProps) _defineProperties(Constructor, staticProps);
|
1332 | return Constructor;
|
1333 | }
|
1334 |
|
1335 | function _defineProperty(obj, key, value) {
|
1336 | if (key in obj) {
|
1337 | Object.defineProperty(obj, key, {
|
1338 | value: value,
|
1339 | enumerable: true,
|
1340 | configurable: true,
|
1341 | writable: true
|
1342 | });
|
1343 | } else {
|
1344 | obj[key] = value;
|
1345 | }
|
1346 |
|
1347 | return obj;
|
1348 | }
|
1349 |
|
1350 | var BaseEvent = function () {
|
1351 | function BaseEvent(interaction) {
|
1352 | _classCallCheck(this, BaseEvent);
|
1353 |
|
1354 | _defineProperty(this, "type", void 0);
|
1355 |
|
1356 | _defineProperty(this, "target", void 0);
|
1357 |
|
1358 | _defineProperty(this, "currentTarget", void 0);
|
1359 |
|
1360 | _defineProperty(this, "interactable", void 0);
|
1361 |
|
1362 | _defineProperty(this, "_interaction", void 0);
|
1363 |
|
1364 | _defineProperty(this, "timeStamp", void 0);
|
1365 |
|
1366 | _defineProperty(this, "immediatePropagationStopped", false);
|
1367 |
|
1368 | _defineProperty(this, "propagationStopped", false);
|
1369 |
|
1370 | this._interaction = interaction;
|
1371 | }
|
1372 |
|
1373 | _createClass(BaseEvent, [{
|
1374 | key: "preventDefault",
|
1375 | value: function preventDefault() {}
|
1376 | |
1377 |
|
1378 |
|
1379 |
|
1380 | }, {
|
1381 | key: "stopPropagation",
|
1382 | value: function stopPropagation() {
|
1383 | this.propagationStopped = true;
|
1384 | }
|
1385 | |
1386 |
|
1387 |
|
1388 |
|
1389 | }, {
|
1390 | key: "stopImmediatePropagation",
|
1391 | value: function stopImmediatePropagation() {
|
1392 | this.immediatePropagationStopped = this.propagationStopped = true;
|
1393 | }
|
1394 | }]);
|
1395 |
|
1396 | return BaseEvent;
|
1397 | }();
|
1398 |
|
1399 |
|
1400 |
|
1401 | _$BaseEvent_13.BaseEvent = BaseEvent;
|
1402 |
|
1403 |
|
1404 | Object.defineProperty(BaseEvent.prototype, 'interaction', {
|
1405 | get: function get() {
|
1406 | return this._interaction._proxy;
|
1407 | },
|
1408 | set: function set() {}
|
1409 | });
|
1410 | var _$arr_62 = {};
|
1411 | "use strict";
|
1412 |
|
1413 | Object.defineProperty(_$arr_62, "__esModule", {
|
1414 | value: true
|
1415 | });
|
1416 | _$arr_62.find = _$arr_62.findIndex = _$arr_62.from = _$arr_62.merge = _$arr_62.remove = _$arr_62.contains = void 0;
|
1417 |
|
1418 | var contains = function contains(array, target) {
|
1419 | return array.indexOf(target) !== -1;
|
1420 | };
|
1421 |
|
1422 | _$arr_62.contains = contains;
|
1423 |
|
1424 | var remove = function remove(array, target) {
|
1425 | return array.splice(array.indexOf(target), 1);
|
1426 | };
|
1427 |
|
1428 | _$arr_62.remove = remove;
|
1429 |
|
1430 | var merge = function merge(target, source) {
|
1431 | for (var _i = 0; _i < source.length; _i++) {
|
1432 | var _ref;
|
1433 |
|
1434 | _ref = source[_i];
|
1435 | var item = _ref;
|
1436 | target.push(item);
|
1437 | }
|
1438 |
|
1439 | return target;
|
1440 | };
|
1441 |
|
1442 | _$arr_62.merge = merge;
|
1443 |
|
1444 | var from = function from(source) {
|
1445 | return merge([], source);
|
1446 | };
|
1447 |
|
1448 | _$arr_62.from = from;
|
1449 |
|
1450 | var findIndex = function findIndex(array, func) {
|
1451 | for (var i = 0; i < array.length; i++) {
|
1452 | if (func(array[i], i, array)) {
|
1453 | return i;
|
1454 | }
|
1455 | }
|
1456 |
|
1457 | return -1;
|
1458 | };
|
1459 |
|
1460 | _$arr_62.findIndex = findIndex;
|
1461 |
|
1462 | var find = function find(array, func) {
|
1463 | return array[findIndex(array, func)];
|
1464 | };
|
1465 |
|
1466 | _$arr_62.find = find;
|
1467 | var _$DropEvent_2 = {};
|
1468 | "use strict";
|
1469 |
|
1470 | function ___typeof_2(obj) {
|
1471 | "@babel/helpers - typeof";
|
1472 |
|
1473 | if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
1474 | ___typeof_2 = function _typeof(obj) {
|
1475 | return typeof obj;
|
1476 | };
|
1477 | } else {
|
1478 | ___typeof_2 = function _typeof(obj) {
|
1479 | return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
1480 | };
|
1481 | }
|
1482 |
|
1483 | return ___typeof_2(obj);
|
1484 | }
|
1485 |
|
1486 | Object.defineProperty(_$DropEvent_2, "__esModule", {
|
1487 | value: true
|
1488 | });
|
1489 | _$DropEvent_2.DropEvent = void 0;
|
1490 |
|
1491 |
|
1492 | ;
|
1493 |
|
1494 |
|
1495 | ;
|
1496 |
|
1497 | function ___classCallCheck_2(instance, Constructor) {
|
1498 | if (!(instance instanceof Constructor)) {
|
1499 | throw new TypeError("Cannot call a class as a function");
|
1500 | }
|
1501 | }
|
1502 |
|
1503 | function ___defineProperties_2(target, props) {
|
1504 | for (var i = 0; i < props.length; i++) {
|
1505 | var descriptor = props[i];
|
1506 | descriptor.enumerable = descriptor.enumerable || false;
|
1507 | descriptor.configurable = true;
|
1508 | if ("value" in descriptor) descriptor.writable = true;
|
1509 | Object.defineProperty(target, descriptor.key, descriptor);
|
1510 | }
|
1511 | }
|
1512 |
|
1513 | function ___createClass_2(Constructor, protoProps, staticProps) {
|
1514 | if (protoProps) ___defineProperties_2(Constructor.prototype, protoProps);
|
1515 | if (staticProps) ___defineProperties_2(Constructor, staticProps);
|
1516 | return Constructor;
|
1517 | }
|
1518 |
|
1519 | function _inherits(subClass, superClass) {
|
1520 | if (typeof superClass !== "function" && superClass !== null) {
|
1521 | throw new TypeError("Super expression must either be null or a function");
|
1522 | }
|
1523 |
|
1524 | subClass.prototype = Object.create(superClass && superClass.prototype, {
|
1525 | constructor: {
|
1526 | value: subClass,
|
1527 | writable: true,
|
1528 | configurable: true
|
1529 | }
|
1530 | });
|
1531 | if (superClass) _setPrototypeOf(subClass, superClass);
|
1532 | }
|
1533 |
|
1534 | function _setPrototypeOf(o, p) {
|
1535 | _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
1536 | o.__proto__ = p;
|
1537 | return o;
|
1538 | };
|
1539 |
|
1540 | return _setPrototypeOf(o, p);
|
1541 | }
|
1542 |
|
1543 | function _createSuper(Derived) {
|
1544 | var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
1545 |
|
1546 | return function _createSuperInternal() {
|
1547 | var Super = _getPrototypeOf(Derived),
|
1548 | result;
|
1549 |
|
1550 | if (hasNativeReflectConstruct) {
|
1551 | var NewTarget = _getPrototypeOf(this).constructor;
|
1552 |
|
1553 | result = Reflect.construct(Super, arguments, NewTarget);
|
1554 | } else {
|
1555 | result = Super.apply(this, arguments);
|
1556 | }
|
1557 |
|
1558 | return _possibleConstructorReturn(this, result);
|
1559 | };
|
1560 | }
|
1561 |
|
1562 | function _possibleConstructorReturn(self, call) {
|
1563 | if (call && (___typeof_2(call) === "object" || typeof call === "function")) {
|
1564 | return call;
|
1565 | }
|
1566 |
|
1567 | return _assertThisInitialized(self);
|
1568 | }
|
1569 |
|
1570 | function _assertThisInitialized(self) {
|
1571 | if (self === void 0) {
|
1572 | throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
1573 | }
|
1574 |
|
1575 | return self;
|
1576 | }
|
1577 |
|
1578 | function _isNativeReflectConstruct() {
|
1579 | if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
1580 | if (Reflect.construct.sham) return false;
|
1581 | if (typeof Proxy === "function") return true;
|
1582 |
|
1583 | try {
|
1584 | Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
1585 | return true;
|
1586 | } catch (e) {
|
1587 | return false;
|
1588 | }
|
1589 | }
|
1590 |
|
1591 | function _getPrototypeOf(o) {
|
1592 | _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
1593 | return o.__proto__ || Object.getPrototypeOf(o);
|
1594 | };
|
1595 | return _getPrototypeOf(o);
|
1596 | }
|
1597 |
|
1598 | function ___defineProperty_2(obj, key, value) {
|
1599 | if (key in obj) {
|
1600 | Object.defineProperty(obj, key, {
|
1601 | value: value,
|
1602 | enumerable: true,
|
1603 | configurable: true,
|
1604 | writable: true
|
1605 | });
|
1606 | } else {
|
1607 | obj[key] = value;
|
1608 | }
|
1609 |
|
1610 | return obj;
|
1611 | }
|
1612 |
|
1613 | var DropEvent = function (_BaseEvent) {
|
1614 | _inherits(DropEvent, _BaseEvent);
|
1615 |
|
1616 | var _super = _createSuper(DropEvent);
|
1617 | |
1618 |
|
1619 |
|
1620 |
|
1621 |
|
1622 | function DropEvent(dropState, dragEvent, type) {
|
1623 | var _this;
|
1624 |
|
1625 | ___classCallCheck_2(this, DropEvent);
|
1626 |
|
1627 | _this = _super.call(this, dragEvent._interaction);
|
1628 |
|
1629 | ___defineProperty_2(_assertThisInitialized(_this), "target", void 0);
|
1630 |
|
1631 | ___defineProperty_2(_assertThisInitialized(_this), "dropzone", void 0);
|
1632 |
|
1633 | ___defineProperty_2(_assertThisInitialized(_this), "dragEvent", void 0);
|
1634 |
|
1635 | ___defineProperty_2(_assertThisInitialized(_this), "relatedTarget", void 0);
|
1636 |
|
1637 | ___defineProperty_2(_assertThisInitialized(_this), "draggable", void 0);
|
1638 |
|
1639 | ___defineProperty_2(_assertThisInitialized(_this), "timeStamp", void 0);
|
1640 |
|
1641 | ___defineProperty_2(_assertThisInitialized(_this), "propagationStopped", false);
|
1642 |
|
1643 | ___defineProperty_2(_assertThisInitialized(_this), "immediatePropagationStopped", false);
|
1644 |
|
1645 | var _ref = type === 'dragleave' ? dropState.prev : dropState.cur,
|
1646 | element = _ref.element,
|
1647 | dropzone = _ref.dropzone;
|
1648 |
|
1649 | _this.type = type;
|
1650 | _this.target = element;
|
1651 | _this.currentTarget = element;
|
1652 | _this.dropzone = dropzone;
|
1653 | _this.dragEvent = dragEvent;
|
1654 | _this.relatedTarget = dragEvent.target;
|
1655 | _this.draggable = dragEvent.interactable;
|
1656 | _this.timeStamp = dragEvent.timeStamp;
|
1657 | return _this;
|
1658 | }
|
1659 | |
1660 |
|
1661 |
|
1662 |
|
1663 |
|
1664 |
|
1665 |
|
1666 |
|
1667 |
|
1668 | ___createClass_2(DropEvent, [{
|
1669 | key: "reject",
|
1670 | value: function reject() {
|
1671 | var _this2 = this;
|
1672 |
|
1673 | var dropState = this._interaction.dropState;
|
1674 |
|
1675 | if (this.type !== 'dropactivate' && (!this.dropzone || dropState.cur.dropzone !== this.dropzone || dropState.cur.element !== this.target)) {
|
1676 | return;
|
1677 | }
|
1678 |
|
1679 | dropState.prev.dropzone = this.dropzone;
|
1680 | dropState.prev.element = this.target;
|
1681 | dropState.rejected = true;
|
1682 | dropState.events.enter = null;
|
1683 | this.stopImmediatePropagation();
|
1684 |
|
1685 | if (this.type === 'dropactivate') {
|
1686 | var activeDrops = dropState.activeDrops;
|
1687 |
|
1688 | var index = _$arr_62.findIndex(activeDrops, function (_ref2) {
|
1689 | var dropzone = _ref2.dropzone,
|
1690 | element = _ref2.element;
|
1691 | return dropzone === _this2.dropzone && element === _this2.target;
|
1692 | });
|
1693 |
|
1694 | dropState.activeDrops.splice(index, 1);
|
1695 | var deactivateEvent = new DropEvent(dropState, this.dragEvent, 'dropdeactivate');
|
1696 | deactivateEvent.dropzone = this.dropzone;
|
1697 | deactivateEvent.target = this.target;
|
1698 | this.dropzone.fire(deactivateEvent);
|
1699 | } else {
|
1700 | this.dropzone.fire(new DropEvent(dropState, this.dragEvent, 'dragleave'));
|
1701 | }
|
1702 | }
|
1703 | }, {
|
1704 | key: "preventDefault",
|
1705 | value: function preventDefault() {}
|
1706 | }, {
|
1707 | key: "stopPropagation",
|
1708 | value: function stopPropagation() {
|
1709 | this.propagationStopped = true;
|
1710 | }
|
1711 | }, {
|
1712 | key: "stopImmediatePropagation",
|
1713 | value: function stopImmediatePropagation() {
|
1714 | this.immediatePropagationStopped = this.propagationStopped = true;
|
1715 | }
|
1716 | }]);
|
1717 |
|
1718 | return DropEvent;
|
1719 | }(_$BaseEvent_13.BaseEvent);
|
1720 |
|
1721 | _$DropEvent_2.DropEvent = DropEvent;
|
1722 | var _$plugin_3 = {};
|
1723 | "use strict";
|
1724 |
|
1725 | Object.defineProperty(_$plugin_3, "__esModule", {
|
1726 | value: true
|
1727 | });
|
1728 | _$plugin_3.default = void 0;
|
1729 |
|
1730 |
|
1731 | ;
|
1732 |
|
1733 |
|
1734 | ;
|
1735 |
|
1736 |
|
1737 | ;
|
1738 |
|
1739 |
|
1740 | ;
|
1741 |
|
1742 |
|
1743 | ;
|
1744 |
|
1745 |
|
1746 | ;
|
1747 |
|
1748 |
|
1749 | ;
|
1750 |
|
1751 |
|
1752 | ;
|
1753 |
|
1754 | function __install_3(scope) {
|
1755 | var actions = scope.actions,
|
1756 | interact = scope.interactStatic,
|
1757 | Interactable = scope.Interactable,
|
1758 | defaults = scope.defaults;
|
1759 | scope.usePlugin(_$plugin_1.default);
|
1760 | |
1761 |
|
1762 |
|
1763 |
|
1764 |
|
1765 |
|
1766 |
|
1767 |
|
1768 |
|
1769 |
|
1770 |
|
1771 |
|
1772 |
|
1773 |
|
1774 |
|
1775 |
|
1776 |
|
1777 |
|
1778 |
|
1779 |
|
1780 |
|
1781 |
|
1782 |
|
1783 |
|
1784 |
|
1785 |
|
1786 |
|
1787 |
|
1788 |
|
1789 |
|
1790 |
|
1791 |
|
1792 |
|
1793 |
|
1794 |
|
1795 |
|
1796 |
|
1797 |
|
1798 |
|
1799 |
|
1800 |
|
1801 | Interactable.prototype.dropzone = function (options) {
|
1802 | return dropzoneMethod(this, options);
|
1803 | };
|
1804 | |
1805 |
|
1806 |
|
1807 |
|
1808 |
|
1809 |
|
1810 |
|
1811 |
|
1812 |
|
1813 |
|
1814 |
|
1815 |
|
1816 |
|
1817 |
|
1818 |
|
1819 |
|
1820 |
|
1821 | Interactable.prototype.dropCheck = function (dragEvent, event, draggable, draggableElement, dropElement, rect) {
|
1822 | return dropCheckMethod(this, dragEvent, event, draggable, draggableElement, dropElement, rect);
|
1823 | };
|
1824 | |
1825 |
|
1826 |
|
1827 |
|
1828 |
|
1829 |
|
1830 |
|
1831 |
|
1832 |
|
1833 |
|
1834 | interact.dynamicDrop = function (newValue) {
|
1835 | if (_$is_70.default.bool(newValue)) {
|
1836 |
|
1837 |
|
1838 |
|
1839 | scope.dynamicDrop = newValue;
|
1840 | return interact;
|
1841 | }
|
1842 |
|
1843 | return scope.dynamicDrop;
|
1844 | };
|
1845 |
|
1846 | (0, _$extend_67.default)(actions.phaselessTypes, {
|
1847 | dragenter: true,
|
1848 | dragleave: true,
|
1849 | dropactivate: true,
|
1850 | dropdeactivate: true,
|
1851 | dropmove: true,
|
1852 | drop: true
|
1853 | });
|
1854 | actions.methodDict.drop = 'dropzone';
|
1855 | scope.dynamicDrop = false;
|
1856 | defaults.actions.drop = drop.defaults;
|
1857 | }
|
1858 |
|
1859 | function collectDrops(_ref, draggableElement) {
|
1860 | var interactables = _ref.interactables;
|
1861 | var drops = [];
|
1862 |
|
1863 | for (var _i = 0; _i < interactables.list.length; _i++) {
|
1864 | var _ref2;
|
1865 |
|
1866 | _ref2 = interactables.list[_i];
|
1867 | var dropzone = _ref2;
|
1868 |
|
1869 | if (!dropzone.options.drop.enabled) {
|
1870 | continue;
|
1871 | }
|
1872 |
|
1873 | var accept = dropzone.options.drop.accept;
|
1874 |
|
1875 | if (_$is_70.default.element(accept) && accept !== draggableElement || _$is_70.default.string(accept) && !_$domUtils_66.matchesSelector(draggableElement, accept) || _$is_70.default.func(accept) && !accept({
|
1876 | dropzone: dropzone,
|
1877 | draggableElement: draggableElement
|
1878 | })) {
|
1879 | continue;
|
1880 | }
|
1881 |
|
1882 |
|
1883 | var dropElements = _$is_70.default.string(dropzone.target) ? dropzone._context.querySelectorAll(dropzone.target) : _$is_70.default.array(dropzone.target) ? dropzone.target : [dropzone.target];
|
1884 |
|
1885 | for (var _i2 = 0; _i2 < dropElements.length; _i2++) {
|
1886 | var _ref3;
|
1887 |
|
1888 | _ref3 = dropElements[_i2];
|
1889 | var dropzoneElement = _ref3;
|
1890 |
|
1891 | if (dropzoneElement !== draggableElement) {
|
1892 | drops.push({
|
1893 | dropzone: dropzone,
|
1894 | element: dropzoneElement,
|
1895 | rect: dropzone.getRect(dropzoneElement)
|
1896 | });
|
1897 | }
|
1898 | }
|
1899 | }
|
1900 |
|
1901 | return drops;
|
1902 | }
|
1903 |
|
1904 | function fireActivationEvents(activeDrops, event) {
|
1905 |
|
1906 | for (var _i3 = 0; _i3 < activeDrops.slice().length; _i3++) {
|
1907 | var _ref4;
|
1908 |
|
1909 | _ref4 = activeDrops.slice()[_i3];
|
1910 | var _ref5 = _ref4,
|
1911 | dropzone = _ref5.dropzone,
|
1912 | element = _ref5.element;
|
1913 | event.dropzone = dropzone;
|
1914 |
|
1915 | event.target = element;
|
1916 | dropzone.fire(event);
|
1917 | event.propagationStopped = event.immediatePropagationStopped = false;
|
1918 | }
|
1919 | }
|
1920 |
|
1921 |
|
1922 |
|
1923 |
|
1924 | function getActiveDrops(scope, dragElement) {
|
1925 |
|
1926 | var activeDrops = collectDrops(scope, dragElement);
|
1927 |
|
1928 | for (var _i4 = 0; _i4 < activeDrops.length; _i4++) {
|
1929 | var _ref6;
|
1930 |
|
1931 | _ref6 = activeDrops[_i4];
|
1932 | var activeDrop = _ref6;
|
1933 | activeDrop.rect = activeDrop.dropzone.getRect(activeDrop.element);
|
1934 | }
|
1935 |
|
1936 | return activeDrops;
|
1937 | }
|
1938 |
|
1939 | function getDrop(_ref7, dragEvent, pointerEvent) {
|
1940 | var dropState = _ref7.dropState,
|
1941 | draggable = _ref7.interactable,
|
1942 | dragElement = _ref7.element;
|
1943 | var validDrops = [];
|
1944 |
|
1945 | for (var _i5 = 0; _i5 < dropState.activeDrops.length; _i5++) {
|
1946 | var _ref8;
|
1947 |
|
1948 | _ref8 = dropState.activeDrops[_i5];
|
1949 | var _ref9 = _ref8,
|
1950 | dropzone = _ref9.dropzone,
|
1951 | dropzoneElement = _ref9.element,
|
1952 | _rect = _ref9.rect;
|
1953 | validDrops.push(dropzone.dropCheck(dragEvent, pointerEvent, draggable, dragElement, dropzoneElement, _rect) ? dropzoneElement : null);
|
1954 | }
|
1955 |
|
1956 |
|
1957 | var dropIndex = _$domUtils_66.indexOfDeepestElement(validDrops);
|
1958 |
|
1959 | return dropState.activeDrops[dropIndex] || null;
|
1960 | }
|
1961 |
|
1962 | function getDropEvents(interaction, _pointerEvent, dragEvent) {
|
1963 | var dropState = interaction.dropState;
|
1964 | var dropEvents = {
|
1965 | enter: null,
|
1966 | leave: null,
|
1967 | activate: null,
|
1968 | deactivate: null,
|
1969 | move: null,
|
1970 | drop: null
|
1971 | };
|
1972 |
|
1973 | if (dragEvent.type === 'dragstart') {
|
1974 | dropEvents.activate = new _$DropEvent_2.DropEvent(dropState, dragEvent, 'dropactivate');
|
1975 | dropEvents.activate.target = null;
|
1976 | dropEvents.activate.dropzone = null;
|
1977 | }
|
1978 |
|
1979 | if (dragEvent.type === 'dragend') {
|
1980 | dropEvents.deactivate = new _$DropEvent_2.DropEvent(dropState, dragEvent, 'dropdeactivate');
|
1981 | dropEvents.deactivate.target = null;
|
1982 | dropEvents.deactivate.dropzone = null;
|
1983 | }
|
1984 |
|
1985 | if (dropState.rejected) {
|
1986 | return dropEvents;
|
1987 | }
|
1988 |
|
1989 | if (dropState.cur.element !== dropState.prev.element) {
|
1990 |
|
1991 | if (dropState.prev.dropzone) {
|
1992 | dropEvents.leave = new _$DropEvent_2.DropEvent(dropState, dragEvent, 'dragleave');
|
1993 | dragEvent.dragLeave = dropEvents.leave.target = dropState.prev.element;
|
1994 | dragEvent.prevDropzone = dropEvents.leave.dropzone = dropState.prev.dropzone;
|
1995 | }
|
1996 |
|
1997 |
|
1998 | if (dropState.cur.dropzone) {
|
1999 | dropEvents.enter = new _$DropEvent_2.DropEvent(dropState, dragEvent, 'dragenter');
|
2000 | dragEvent.dragEnter = dropState.cur.element;
|
2001 | dragEvent.dropzone = dropState.cur.dropzone;
|
2002 | }
|
2003 | }
|
2004 |
|
2005 | if (dragEvent.type === 'dragend' && dropState.cur.dropzone) {
|
2006 | dropEvents.drop = new _$DropEvent_2.DropEvent(dropState, dragEvent, 'drop');
|
2007 | dragEvent.dropzone = dropState.cur.dropzone;
|
2008 | dragEvent.relatedTarget = dropState.cur.element;
|
2009 | }
|
2010 |
|
2011 | if (dragEvent.type === 'dragmove' && dropState.cur.dropzone) {
|
2012 | dropEvents.move = new _$DropEvent_2.DropEvent(dropState, dragEvent, 'dropmove');
|
2013 | dropEvents.move.dragmove = dragEvent;
|
2014 | dragEvent.dropzone = dropState.cur.dropzone;
|
2015 | }
|
2016 |
|
2017 | return dropEvents;
|
2018 | }
|
2019 |
|
2020 | function fireDropEvents(interaction, events) {
|
2021 | var dropState = interaction.dropState;
|
2022 | var activeDrops = dropState.activeDrops,
|
2023 | cur = dropState.cur,
|
2024 | prev = dropState.prev;
|
2025 |
|
2026 | if (events.leave) {
|
2027 | prev.dropzone.fire(events.leave);
|
2028 | }
|
2029 |
|
2030 | if (events.enter) {
|
2031 | cur.dropzone.fire(events.enter);
|
2032 | }
|
2033 |
|
2034 | if (events.move) {
|
2035 | cur.dropzone.fire(events.move);
|
2036 | }
|
2037 |
|
2038 | if (events.drop) {
|
2039 | cur.dropzone.fire(events.drop);
|
2040 | }
|
2041 |
|
2042 | if (events.deactivate) {
|
2043 | fireActivationEvents(activeDrops, events.deactivate);
|
2044 | }
|
2045 |
|
2046 | dropState.prev.dropzone = cur.dropzone;
|
2047 | dropState.prev.element = cur.element;
|
2048 | }
|
2049 |
|
2050 | function onEventCreated(_ref10, scope) {
|
2051 | var interaction = _ref10.interaction,
|
2052 | iEvent = _ref10.iEvent,
|
2053 | event = _ref10.event;
|
2054 |
|
2055 | if (iEvent.type !== 'dragmove' && iEvent.type !== 'dragend') {
|
2056 | return;
|
2057 | }
|
2058 |
|
2059 | var dropState = interaction.dropState;
|
2060 |
|
2061 | if (scope.dynamicDrop) {
|
2062 | dropState.activeDrops = getActiveDrops(scope, interaction.element);
|
2063 | }
|
2064 |
|
2065 | var dragEvent = iEvent;
|
2066 | var dropResult = getDrop(interaction, dragEvent, event);
|
2067 |
|
2068 | dropState.rejected = dropState.rejected && !!dropResult && dropResult.dropzone === dropState.cur.dropzone && dropResult.element === dropState.cur.element;
|
2069 | dropState.cur.dropzone = dropResult && dropResult.dropzone;
|
2070 | dropState.cur.element = dropResult && dropResult.element;
|
2071 | dropState.events = getDropEvents(interaction, event, dragEvent);
|
2072 | }
|
2073 |
|
2074 | function dropzoneMethod(interactable, options) {
|
2075 | if (_$is_70.default.object(options)) {
|
2076 | interactable.options.drop.enabled = options.enabled !== false;
|
2077 |
|
2078 | if (options.listeners) {
|
2079 | var normalized = (0, _$normalizeListeners_73.default)(options.listeners);
|
2080 |
|
2081 | var corrected = Object.keys(normalized).reduce(function (acc, type) {
|
2082 | var correctedType = /^(enter|leave)/.test(type) ? "drag".concat(type) : /^(activate|deactivate|move)/.test(type) ? "drop".concat(type) : type;
|
2083 | acc[correctedType] = normalized[type];
|
2084 | return acc;
|
2085 | }, {});
|
2086 | interactable.off(interactable.options.drop.listeners);
|
2087 | interactable.on(corrected);
|
2088 | interactable.options.drop.listeners = corrected;
|
2089 | }
|
2090 |
|
2091 | if (_$is_70.default.func(options.ondrop)) {
|
2092 | interactable.on('drop', options.ondrop);
|
2093 | }
|
2094 |
|
2095 | if (_$is_70.default.func(options.ondropactivate)) {
|
2096 | interactable.on('dropactivate', options.ondropactivate);
|
2097 | }
|
2098 |
|
2099 | if (_$is_70.default.func(options.ondropdeactivate)) {
|
2100 | interactable.on('dropdeactivate', options.ondropdeactivate);
|
2101 | }
|
2102 |
|
2103 | if (_$is_70.default.func(options.ondragenter)) {
|
2104 | interactable.on('dragenter', options.ondragenter);
|
2105 | }
|
2106 |
|
2107 | if (_$is_70.default.func(options.ondragleave)) {
|
2108 | interactable.on('dragleave', options.ondragleave);
|
2109 | }
|
2110 |
|
2111 | if (_$is_70.default.func(options.ondropmove)) {
|
2112 | interactable.on('dropmove', options.ondropmove);
|
2113 | }
|
2114 |
|
2115 | if (/^(pointer|center)$/.test(options.overlap)) {
|
2116 | interactable.options.drop.overlap = options.overlap;
|
2117 | } else if (_$is_70.default.number(options.overlap)) {
|
2118 | interactable.options.drop.overlap = Math.max(Math.min(1, options.overlap), 0);
|
2119 | }
|
2120 |
|
2121 | if ('accept' in options) {
|
2122 | interactable.options.drop.accept = options.accept;
|
2123 | }
|
2124 |
|
2125 | if ('checker' in options) {
|
2126 | interactable.options.drop.checker = options.checker;
|
2127 | }
|
2128 |
|
2129 | return interactable;
|
2130 | }
|
2131 |
|
2132 | if (_$is_70.default.bool(options)) {
|
2133 | interactable.options.drop.enabled = options;
|
2134 | return interactable;
|
2135 | }
|
2136 |
|
2137 | return interactable.options.drop;
|
2138 | }
|
2139 |
|
2140 | function dropCheckMethod(interactable, dragEvent, event, draggable, draggableElement, dropElement, rect) {
|
2141 | var dropped = false;
|
2142 |
|
2143 |
|
2144 | if (!(rect = rect || interactable.getRect(dropElement))) {
|
2145 | return interactable.options.drop.checker ? interactable.options.drop.checker(dragEvent, event, dropped, interactable, dropElement, draggable, draggableElement) : false;
|
2146 | }
|
2147 |
|
2148 | var dropOverlap = interactable.options.drop.overlap;
|
2149 |
|
2150 | if (dropOverlap === 'pointer') {
|
2151 | var origin = (0, _$getOriginXY_68.default)(draggable, draggableElement, 'drag');
|
2152 |
|
2153 | var page = _$pointerUtils_75.getPageXY(dragEvent);
|
2154 |
|
2155 | page.x += origin.x;
|
2156 | page.y += origin.y;
|
2157 | var horizontal = page.x > rect.left && page.x < rect.right;
|
2158 | var vertical = page.y > rect.top && page.y < rect.bottom;
|
2159 | dropped = horizontal && vertical;
|
2160 | }
|
2161 |
|
2162 | var dragRect = draggable.getRect(draggableElement);
|
2163 |
|
2164 | if (dragRect && dropOverlap === 'center') {
|
2165 | var cx = dragRect.left + dragRect.width / 2;
|
2166 | var cy = dragRect.top + dragRect.height / 2;
|
2167 | dropped = cx >= rect.left && cx <= rect.right && cy >= rect.top && cy <= rect.bottom;
|
2168 | }
|
2169 |
|
2170 | if (dragRect && _$is_70.default.number(dropOverlap)) {
|
2171 | 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));
|
2172 | var overlapRatio = overlapArea / (dragRect.width * dragRect.height);
|
2173 | dropped = overlapRatio >= dropOverlap;
|
2174 | }
|
2175 |
|
2176 | if (interactable.options.drop.checker) {
|
2177 | dropped = interactable.options.drop.checker(dragEvent, event, dropped, interactable, dropElement, draggable, draggableElement);
|
2178 | }
|
2179 |
|
2180 | return dropped;
|
2181 | }
|
2182 |
|
2183 | var drop = {
|
2184 | id: 'actions/drop',
|
2185 | install: __install_3,
|
2186 | listeners: {
|
2187 | 'interactions:before-action-start': function interactionsBeforeActionStart(_ref11) {
|
2188 | var interaction = _ref11.interaction;
|
2189 |
|
2190 | if (interaction.prepared.name !== 'drag') {
|
2191 | return;
|
2192 | }
|
2193 |
|
2194 | interaction.dropState = {
|
2195 | cur: {
|
2196 | dropzone: null,
|
2197 | element: null
|
2198 | },
|
2199 | prev: {
|
2200 | dropzone: null,
|
2201 | element: null
|
2202 | },
|
2203 | rejected: null,
|
2204 | events: null,
|
2205 | activeDrops: []
|
2206 | };
|
2207 | },
|
2208 | 'interactions:after-action-start': function interactionsAfterActionStart(_ref12, scope) {
|
2209 | var interaction = _ref12.interaction,
|
2210 | event = _ref12.event,
|
2211 | dragEvent = _ref12.iEvent;
|
2212 |
|
2213 | if (interaction.prepared.name !== 'drag') {
|
2214 | return;
|
2215 | }
|
2216 |
|
2217 | var dropState = interaction.dropState;
|
2218 |
|
2219 | dropState.activeDrops = null;
|
2220 | dropState.events = null;
|
2221 | dropState.activeDrops = getActiveDrops(scope, interaction.element);
|
2222 | dropState.events = getDropEvents(interaction, event, dragEvent);
|
2223 |
|
2224 | if (dropState.events.activate) {
|
2225 | fireActivationEvents(dropState.activeDrops, dropState.events.activate);
|
2226 | scope.fire('actions/drop:start', {
|
2227 | interaction: interaction,
|
2228 | dragEvent: dragEvent
|
2229 | });
|
2230 | }
|
2231 | },
|
2232 | 'interactions:action-move': onEventCreated,
|
2233 | 'interactions:after-action-move': function interactionsAfterActionMove(_ref13, scope) {
|
2234 | var interaction = _ref13.interaction,
|
2235 | dragEvent = _ref13.iEvent;
|
2236 |
|
2237 | if (interaction.prepared.name !== 'drag') {
|
2238 | return;
|
2239 | }
|
2240 |
|
2241 | fireDropEvents(interaction, interaction.dropState.events);
|
2242 | scope.fire('actions/drop:move', {
|
2243 | interaction: interaction,
|
2244 | dragEvent: dragEvent
|
2245 | });
|
2246 | interaction.dropState.events = {};
|
2247 | },
|
2248 | 'interactions:action-end': function interactionsActionEnd(arg, scope) {
|
2249 | if (arg.interaction.prepared.name !== 'drag') {
|
2250 | return;
|
2251 | }
|
2252 |
|
2253 | var interaction = arg.interaction,
|
2254 | dragEvent = arg.iEvent;
|
2255 | onEventCreated(arg, scope);
|
2256 | fireDropEvents(interaction, interaction.dropState.events);
|
2257 | scope.fire('actions/drop:end', {
|
2258 | interaction: interaction,
|
2259 | dragEvent: dragEvent
|
2260 | });
|
2261 | },
|
2262 | 'interactions:stop': function interactionsStop(_ref14) {
|
2263 | var interaction = _ref14.interaction;
|
2264 |
|
2265 | if (interaction.prepared.name !== 'drag') {
|
2266 | return;
|
2267 | }
|
2268 |
|
2269 | var dropState = interaction.dropState;
|
2270 |
|
2271 | if (dropState) {
|
2272 | dropState.activeDrops = null;
|
2273 | dropState.events = null;
|
2274 | dropState.cur.dropzone = null;
|
2275 | dropState.cur.element = null;
|
2276 | dropState.prev.dropzone = null;
|
2277 | dropState.prev.element = null;
|
2278 | dropState.rejected = false;
|
2279 | }
|
2280 | }
|
2281 | },
|
2282 | getActiveDrops: getActiveDrops,
|
2283 | getDrop: getDrop,
|
2284 | getDropEvents: getDropEvents,
|
2285 | fireDropEvents: fireDropEvents,
|
2286 | defaults: {
|
2287 | enabled: false,
|
2288 | accept: null,
|
2289 | overlap: 'pointer'
|
2290 | }
|
2291 | };
|
2292 | var ___default_3 = drop;
|
2293 | _$plugin_3.default = ___default_3;
|
2294 | var _$plugin_4 = {};
|
2295 | "use strict";
|
2296 |
|
2297 | Object.defineProperty(_$plugin_4, "__esModule", {
|
2298 | value: true
|
2299 | });
|
2300 | _$plugin_4.default = void 0;
|
2301 |
|
2302 |
|
2303 | ;
|
2304 |
|
2305 |
|
2306 | ;
|
2307 |
|
2308 | function __install_4(scope) {
|
2309 | var actions = scope.actions,
|
2310 | Interactable = scope.Interactable,
|
2311 | defaults = scope.defaults;
|
2312 | |
2313 |
|
2314 |
|
2315 |
|
2316 |
|
2317 |
|
2318 |
|
2319 |
|
2320 |
|
2321 |
|
2322 |
|
2323 |
|
2324 |
|
2325 |
|
2326 |
|
2327 |
|
2328 |
|
2329 |
|
2330 |
|
2331 |
|
2332 |
|
2333 |
|
2334 |
|
2335 |
|
2336 | Interactable.prototype.gesturable = function (options) {
|
2337 | if (_$is_70.default.object(options)) {
|
2338 | this.options.gesture.enabled = options.enabled !== false;
|
2339 | this.setPerAction('gesture', options);
|
2340 | this.setOnEvents('gesture', options);
|
2341 | return this;
|
2342 | }
|
2343 |
|
2344 | if (_$is_70.default.bool(options)) {
|
2345 | this.options.gesture.enabled = options;
|
2346 | return this;
|
2347 | }
|
2348 |
|
2349 | return this.options.gesture;
|
2350 | };
|
2351 |
|
2352 | actions.map.gesture = gesture;
|
2353 | actions.methodDict.gesture = 'gesturable';
|
2354 | defaults.actions.gesture = gesture.defaults;
|
2355 | }
|
2356 |
|
2357 | function updateGestureProps(_ref) {
|
2358 | var interaction = _ref.interaction,
|
2359 | iEvent = _ref.iEvent,
|
2360 | phase = _ref.phase;
|
2361 | if (interaction.prepared.name !== 'gesture') return;
|
2362 | var pointers = interaction.pointers.map(function (p) {
|
2363 | return p.pointer;
|
2364 | });
|
2365 | var starting = phase === 'start';
|
2366 | var ending = phase === 'end';
|
2367 | var deltaSource = interaction.interactable.options.deltaSource;
|
2368 | iEvent.touches = [pointers[0], pointers[1]];
|
2369 |
|
2370 | if (starting) {
|
2371 | iEvent.distance = _$pointerUtils_75.touchDistance(pointers, deltaSource);
|
2372 | iEvent.box = _$pointerUtils_75.touchBBox(pointers);
|
2373 | iEvent.scale = 1;
|
2374 | iEvent.ds = 0;
|
2375 | iEvent.angle = _$pointerUtils_75.touchAngle(pointers, deltaSource);
|
2376 | iEvent.da = 0;
|
2377 | interaction.gesture.startDistance = iEvent.distance;
|
2378 | interaction.gesture.startAngle = iEvent.angle;
|
2379 | } else if (ending) {
|
2380 | var prevEvent = interaction.prevEvent;
|
2381 | iEvent.distance = prevEvent.distance;
|
2382 | iEvent.box = prevEvent.box;
|
2383 | iEvent.scale = prevEvent.scale;
|
2384 | iEvent.ds = 0;
|
2385 | iEvent.angle = prevEvent.angle;
|
2386 | iEvent.da = 0;
|
2387 | } else {
|
2388 | iEvent.distance = _$pointerUtils_75.touchDistance(pointers, deltaSource);
|
2389 | iEvent.box = _$pointerUtils_75.touchBBox(pointers);
|
2390 | iEvent.scale = iEvent.distance / interaction.gesture.startDistance;
|
2391 | iEvent.angle = _$pointerUtils_75.touchAngle(pointers, deltaSource);
|
2392 | iEvent.ds = iEvent.scale - interaction.gesture.scale;
|
2393 | iEvent.da = iEvent.angle - interaction.gesture.angle;
|
2394 | }
|
2395 |
|
2396 | interaction.gesture.distance = iEvent.distance;
|
2397 | interaction.gesture.angle = iEvent.angle;
|
2398 |
|
2399 | if (_$is_70.default.number(iEvent.scale) && iEvent.scale !== Infinity && !isNaN(iEvent.scale)) {
|
2400 | interaction.gesture.scale = iEvent.scale;
|
2401 | }
|
2402 | }
|
2403 |
|
2404 | var gesture = {
|
2405 | id: 'actions/gesture',
|
2406 | before: ['actions/drag', 'actions/resize'],
|
2407 | install: __install_4,
|
2408 | listeners: {
|
2409 | 'interactions:action-start': updateGestureProps,
|
2410 | 'interactions:action-move': updateGestureProps,
|
2411 | 'interactions:action-end': updateGestureProps,
|
2412 | 'interactions:new': function interactionsNew(_ref2) {
|
2413 | var interaction = _ref2.interaction;
|
2414 | interaction.gesture = {
|
2415 | angle: 0,
|
2416 | distance: 0,
|
2417 | scale: 1,
|
2418 | startAngle: 0,
|
2419 | startDistance: 0
|
2420 | };
|
2421 | },
|
2422 | 'auto-start:check': function autoStartCheck(arg) {
|
2423 | if (arg.interaction.pointers.length < 2) {
|
2424 | return undefined;
|
2425 | }
|
2426 |
|
2427 | var gestureOptions = arg.interactable.options.gesture;
|
2428 |
|
2429 | if (!(gestureOptions && gestureOptions.enabled)) {
|
2430 | return undefined;
|
2431 | }
|
2432 |
|
2433 | arg.action = {
|
2434 | name: 'gesture'
|
2435 | };
|
2436 | return false;
|
2437 | }
|
2438 | },
|
2439 | defaults: {},
|
2440 | getCursor: function getCursor() {
|
2441 | return '';
|
2442 | }
|
2443 | };
|
2444 | var ___default_4 = gesture;
|
2445 | _$plugin_4.default = ___default_4;
|
2446 | var _$plugin_6 = {};
|
2447 | "use strict";
|
2448 |
|
2449 | Object.defineProperty(_$plugin_6, "__esModule", {
|
2450 | value: true
|
2451 | });
|
2452 | _$plugin_6.default = void 0;
|
2453 |
|
2454 |
|
2455 | ;
|
2456 |
|
2457 |
|
2458 | ;
|
2459 |
|
2460 |
|
2461 | ;
|
2462 |
|
2463 | function __install_6(scope) {
|
2464 | var actions = scope.actions,
|
2465 | browser = scope.browser,
|
2466 | Interactable = scope.Interactable,
|
2467 | defaults = scope.defaults;
|
2468 |
|
2469 | resize.cursors = initCursors(browser);
|
2470 | resize.defaultMargin = browser.supportsTouch || browser.supportsPointerEvent ? 20 : 10;
|
2471 | |
2472 |
|
2473 |
|
2474 |
|
2475 |
|
2476 |
|
2477 |
|
2478 |
|
2479 |
|
2480 |
|
2481 |
|
2482 |
|
2483 |
|
2484 |
|
2485 |
|
2486 |
|
2487 |
|
2488 |
|
2489 |
|
2490 |
|
2491 |
|
2492 |
|
2493 |
|
2494 |
|
2495 |
|
2496 |
|
2497 |
|
2498 |
|
2499 |
|
2500 |
|
2501 |
|
2502 |
|
2503 |
|
2504 |
|
2505 |
|
2506 |
|
2507 |
|
2508 |
|
2509 |
|
2510 |
|
2511 |
|
2512 |
|
2513 |
|
2514 |
|
2515 |
|
2516 |
|
2517 | Interactable.prototype.resizable = function (options) {
|
2518 | return resizable(this, options, scope);
|
2519 | };
|
2520 |
|
2521 | actions.map.resize = resize;
|
2522 | actions.methodDict.resize = 'resizable';
|
2523 | defaults.actions.resize = resize.defaults;
|
2524 | }
|
2525 |
|
2526 | function resizeChecker(arg) {
|
2527 | var interaction = arg.interaction,
|
2528 | interactable = arg.interactable,
|
2529 | element = arg.element,
|
2530 | rect = arg.rect,
|
2531 | buttons = arg.buttons;
|
2532 |
|
2533 | if (!rect) {
|
2534 | return undefined;
|
2535 | }
|
2536 |
|
2537 | var page = (0, _$extend_67.default)({}, interaction.coords.cur.page);
|
2538 | var resizeOptions = interactable.options.resize;
|
2539 |
|
2540 | if (!(resizeOptions && resizeOptions.enabled) ||
|
2541 | interaction.pointerIsDown && /mouse|pointer/.test(interaction.pointerType) && (buttons & resizeOptions.mouseButtons) === 0) {
|
2542 | return undefined;
|
2543 | }
|
2544 |
|
2545 |
|
2546 | if (_$is_70.default.object(resizeOptions.edges)) {
|
2547 | var resizeEdges = {
|
2548 | left: false,
|
2549 | right: false,
|
2550 | top: false,
|
2551 | bottom: false
|
2552 | };
|
2553 |
|
2554 | for (var edge in resizeEdges) {
|
2555 | resizeEdges[edge] = checkResizeEdge(edge, resizeOptions.edges[edge], page, interaction._latestPointer.eventTarget, element, rect, resizeOptions.margin || resize.defaultMargin);
|
2556 | }
|
2557 |
|
2558 | resizeEdges.left = resizeEdges.left && !resizeEdges.right;
|
2559 | resizeEdges.top = resizeEdges.top && !resizeEdges.bottom;
|
2560 |
|
2561 | if (resizeEdges.left || resizeEdges.right || resizeEdges.top || resizeEdges.bottom) {
|
2562 | arg.action = {
|
2563 | name: 'resize',
|
2564 | edges: resizeEdges
|
2565 | };
|
2566 | }
|
2567 | } else {
|
2568 | var right = resizeOptions.axis !== 'y' && page.x > rect.right - resize.defaultMargin;
|
2569 | var bottom = resizeOptions.axis !== 'x' && page.y > rect.bottom - resize.defaultMargin;
|
2570 |
|
2571 | if (right || bottom) {
|
2572 | arg.action = {
|
2573 | name: 'resize',
|
2574 | axes: (right ? 'x' : '') + (bottom ? 'y' : '')
|
2575 | };
|
2576 | }
|
2577 | }
|
2578 |
|
2579 | return arg.action ? false : undefined;
|
2580 | }
|
2581 |
|
2582 | function resizable(interactable, options, scope) {
|
2583 | if (_$is_70.default.object(options)) {
|
2584 | interactable.options.resize.enabled = options.enabled !== false;
|
2585 | interactable.setPerAction('resize', options);
|
2586 | interactable.setOnEvents('resize', options);
|
2587 |
|
2588 | if (_$is_70.default.string(options.axis) && /^x$|^y$|^xy$/.test(options.axis)) {
|
2589 | interactable.options.resize.axis = options.axis;
|
2590 | } else if (options.axis === null) {
|
2591 | interactable.options.resize.axis = scope.defaults.actions.resize.axis;
|
2592 | }
|
2593 |
|
2594 | if (_$is_70.default.bool(options.preserveAspectRatio)) {
|
2595 | interactable.options.resize.preserveAspectRatio = options.preserveAspectRatio;
|
2596 | } else if (_$is_70.default.bool(options.square)) {
|
2597 | interactable.options.resize.square = options.square;
|
2598 | }
|
2599 |
|
2600 | return interactable;
|
2601 | }
|
2602 |
|
2603 | if (_$is_70.default.bool(options)) {
|
2604 | interactable.options.resize.enabled = options;
|
2605 | return interactable;
|
2606 | }
|
2607 |
|
2608 | return interactable.options.resize;
|
2609 | }
|
2610 |
|
2611 | function checkResizeEdge(name, value, page, element, interactableElement, rect, margin) {
|
2612 |
|
2613 | if (!value) {
|
2614 | return false;
|
2615 | }
|
2616 |
|
2617 |
|
2618 | if (value === true) {
|
2619 |
|
2620 | var width = _$is_70.default.number(rect.width) ? rect.width : rect.right - rect.left;
|
2621 | var height = _$is_70.default.number(rect.height) ? rect.height : rect.bottom - rect.top;
|
2622 |
|
2623 | margin = Math.min(margin, Math.abs((name === 'left' || name === 'right' ? width : height) / 2));
|
2624 |
|
2625 | if (width < 0) {
|
2626 | if (name === 'left') {
|
2627 | name = 'right';
|
2628 | } else if (name === 'right') {
|
2629 | name = 'left';
|
2630 | }
|
2631 | }
|
2632 |
|
2633 | if (height < 0) {
|
2634 | if (name === 'top') {
|
2635 | name = 'bottom';
|
2636 | } else if (name === 'bottom') {
|
2637 | name = 'top';
|
2638 | }
|
2639 | }
|
2640 |
|
2641 | if (name === 'left') {
|
2642 | return page.x < (width >= 0 ? rect.left : rect.right) + margin;
|
2643 | }
|
2644 |
|
2645 | if (name === 'top') {
|
2646 | return page.y < (height >= 0 ? rect.top : rect.bottom) + margin;
|
2647 | }
|
2648 |
|
2649 | if (name === 'right') {
|
2650 | return page.x > (width >= 0 ? rect.right : rect.left) - margin;
|
2651 | }
|
2652 |
|
2653 | if (name === 'bottom') {
|
2654 | return page.y > (height >= 0 ? rect.bottom : rect.top) - margin;
|
2655 | }
|
2656 | }
|
2657 |
|
2658 |
|
2659 | if (!_$is_70.default.element(element)) {
|
2660 | return false;
|
2661 | }
|
2662 |
|
2663 | return _$is_70.default.element(value) ?
|
2664 | value === element :
|
2665 | _$domUtils_66.matchesUpTo(element, value, interactableElement);
|
2666 | }
|
2667 |
|
2668 |
|
2669 |
|
2670 |
|
2671 | function initCursors(browser) {
|
2672 | return browser.isIe9 ? {
|
2673 | x: 'e-resize',
|
2674 | y: 's-resize',
|
2675 | xy: 'se-resize',
|
2676 | top: 'n-resize',
|
2677 | left: 'w-resize',
|
2678 | bottom: 's-resize',
|
2679 | right: 'e-resize',
|
2680 | topleft: 'se-resize',
|
2681 | bottomright: 'se-resize',
|
2682 | topright: 'ne-resize',
|
2683 | bottomleft: 'ne-resize'
|
2684 | } : {
|
2685 | x: 'ew-resize',
|
2686 | y: 'ns-resize',
|
2687 | xy: 'nwse-resize',
|
2688 | top: 'ns-resize',
|
2689 | left: 'ew-resize',
|
2690 | bottom: 'ns-resize',
|
2691 | right: 'ew-resize',
|
2692 | topleft: 'nwse-resize',
|
2693 | bottomright: 'nwse-resize',
|
2694 | topright: 'nesw-resize',
|
2695 | bottomleft: 'nesw-resize'
|
2696 | };
|
2697 | }
|
2698 |
|
2699 |
|
2700 |
|
2701 | function start(_ref) {
|
2702 | var iEvent = _ref.iEvent,
|
2703 | interaction = _ref.interaction;
|
2704 |
|
2705 | if (interaction.prepared.name !== 'resize' || !interaction.prepared.edges) {
|
2706 | return;
|
2707 | }
|
2708 |
|
2709 | var resizeEvent = iEvent;
|
2710 | var rect = interaction.rect;
|
2711 | interaction._rects = {
|
2712 | start: (0, _$extend_67.default)({}, rect),
|
2713 | corrected: (0, _$extend_67.default)({}, rect),
|
2714 | previous: (0, _$extend_67.default)({}, rect),
|
2715 | delta: {
|
2716 | left: 0,
|
2717 | right: 0,
|
2718 | width: 0,
|
2719 | top: 0,
|
2720 | bottom: 0,
|
2721 | height: 0
|
2722 | }
|
2723 | };
|
2724 | resizeEvent.edges = interaction.prepared.edges;
|
2725 | resizeEvent.rect = interaction._rects.corrected;
|
2726 | resizeEvent.deltaRect = interaction._rects.delta;
|
2727 | }
|
2728 |
|
2729 | function __move_6(_ref2) {
|
2730 | var iEvent = _ref2.iEvent,
|
2731 | interaction = _ref2.interaction;
|
2732 | if (interaction.prepared.name !== 'resize' || !interaction.prepared.edges) return;
|
2733 | var resizeEvent = iEvent;
|
2734 | var resizeOptions = interaction.interactable.options.resize;
|
2735 | var invert = resizeOptions.invert;
|
2736 | var invertible = invert === 'reposition' || invert === 'negate';
|
2737 | var current = interaction.rect;
|
2738 | var _interaction$_rects = interaction._rects,
|
2739 | startRect = _interaction$_rects.start,
|
2740 | corrected = _interaction$_rects.corrected,
|
2741 | deltaRect = _interaction$_rects.delta,
|
2742 | previous = _interaction$_rects.previous;
|
2743 | (0, _$extend_67.default)(previous, corrected);
|
2744 |
|
2745 | if (invertible) {
|
2746 |
|
2747 | (0, _$extend_67.default)(corrected, current);
|
2748 |
|
2749 | if (invert === 'reposition') {
|
2750 |
|
2751 | if (corrected.top > corrected.bottom) {
|
2752 | var swap = corrected.top;
|
2753 | corrected.top = corrected.bottom;
|
2754 | corrected.bottom = swap;
|
2755 | }
|
2756 |
|
2757 | if (corrected.left > corrected.right) {
|
2758 | var _swap = corrected.left;
|
2759 | corrected.left = corrected.right;
|
2760 | corrected.right = _swap;
|
2761 | }
|
2762 | }
|
2763 | } else {
|
2764 |
|
2765 | corrected.top = Math.min(current.top, startRect.bottom);
|
2766 | corrected.bottom = Math.max(current.bottom, startRect.top);
|
2767 | corrected.left = Math.min(current.left, startRect.right);
|
2768 | corrected.right = Math.max(current.right, startRect.left);
|
2769 | }
|
2770 |
|
2771 | corrected.width = corrected.right - corrected.left;
|
2772 | corrected.height = corrected.bottom - corrected.top;
|
2773 |
|
2774 | for (var edge in corrected) {
|
2775 | deltaRect[edge] = corrected[edge] - previous[edge];
|
2776 | }
|
2777 |
|
2778 | resizeEvent.edges = interaction.prepared.edges;
|
2779 | resizeEvent.rect = corrected;
|
2780 | resizeEvent.deltaRect = deltaRect;
|
2781 | }
|
2782 |
|
2783 | function end(_ref3) {
|
2784 | var iEvent = _ref3.iEvent,
|
2785 | interaction = _ref3.interaction;
|
2786 | if (interaction.prepared.name !== 'resize' || !interaction.prepared.edges) return;
|
2787 | var resizeEvent = iEvent;
|
2788 | resizeEvent.edges = interaction.prepared.edges;
|
2789 | resizeEvent.rect = interaction._rects.corrected;
|
2790 | resizeEvent.deltaRect = interaction._rects.delta;
|
2791 | }
|
2792 |
|
2793 | function updateEventAxes(_ref4) {
|
2794 | var iEvent = _ref4.iEvent,
|
2795 | interaction = _ref4.interaction;
|
2796 | if (interaction.prepared.name !== 'resize' || !interaction.resizeAxes) return;
|
2797 | var options = interaction.interactable.options;
|
2798 | var resizeEvent = iEvent;
|
2799 |
|
2800 | if (options.resize.square) {
|
2801 | if (interaction.resizeAxes === 'y') {
|
2802 | resizeEvent.delta.x = resizeEvent.delta.y;
|
2803 | } else {
|
2804 | resizeEvent.delta.y = resizeEvent.delta.x;
|
2805 | }
|
2806 |
|
2807 | resizeEvent.axes = 'xy';
|
2808 | } else {
|
2809 | resizeEvent.axes = interaction.resizeAxes;
|
2810 |
|
2811 | if (interaction.resizeAxes === 'x') {
|
2812 | resizeEvent.delta.y = 0;
|
2813 | } else if (interaction.resizeAxes === 'y') {
|
2814 | resizeEvent.delta.x = 0;
|
2815 | }
|
2816 | }
|
2817 | }
|
2818 |
|
2819 | var resize = {
|
2820 | id: 'actions/resize',
|
2821 | before: ['actions/drag'],
|
2822 | install: __install_6,
|
2823 | listeners: {
|
2824 | 'interactions:new': function interactionsNew(_ref5) {
|
2825 | var interaction = _ref5.interaction;
|
2826 | interaction.resizeAxes = 'xy';
|
2827 | },
|
2828 | 'interactions:action-start': function interactionsActionStart(arg) {
|
2829 | start(arg);
|
2830 | updateEventAxes(arg);
|
2831 | },
|
2832 | 'interactions:action-move': function interactionsActionMove(arg) {
|
2833 | __move_6(arg);
|
2834 |
|
2835 | updateEventAxes(arg);
|
2836 | },
|
2837 | 'interactions:action-end': end,
|
2838 | 'auto-start:check': resizeChecker
|
2839 | },
|
2840 | defaults: {
|
2841 | square: false,
|
2842 | preserveAspectRatio: false,
|
2843 | axis: 'xy',
|
2844 |
|
2845 | margin: NaN,
|
2846 |
|
2847 |
|
2848 |
|
2849 |
|
2850 | edges: null,
|
2851 |
|
2852 |
|
2853 |
|
2854 |
|
2855 | invert: 'none'
|
2856 | },
|
2857 | cursors: null,
|
2858 | getCursor: function getCursor(_ref6) {
|
2859 | var edges = _ref6.edges,
|
2860 | axis = _ref6.axis,
|
2861 | name = _ref6.name;
|
2862 | var cursors = resize.cursors;
|
2863 | var result = null;
|
2864 |
|
2865 | if (axis) {
|
2866 | result = cursors[name + axis];
|
2867 | } else if (edges) {
|
2868 | var cursorKey = '';
|
2869 | var _arr = ['top', 'bottom', 'left', 'right'];
|
2870 |
|
2871 | for (var _i = 0; _i < _arr.length; _i++) {
|
2872 | var edge = _arr[_i];
|
2873 |
|
2874 | if (edges[edge]) {
|
2875 | cursorKey += edge;
|
2876 | }
|
2877 | }
|
2878 |
|
2879 | result = cursors[cursorKey];
|
2880 | }
|
2881 |
|
2882 | return result;
|
2883 | },
|
2884 | defaultMargin: null
|
2885 | };
|
2886 | var ___default_6 = resize;
|
2887 | _$plugin_6.default = ___default_6;
|
2888 | var _$plugin_5 = {};
|
2889 | "use strict";
|
2890 |
|
2891 | Object.defineProperty(_$plugin_5, "__esModule", {
|
2892 | value: true
|
2893 | });
|
2894 | _$plugin_5.default = void 0;
|
2895 |
|
2896 |
|
2897 | ;
|
2898 |
|
2899 |
|
2900 | ;
|
2901 |
|
2902 |
|
2903 | ;
|
2904 |
|
2905 |
|
2906 | ;
|
2907 | var ___default_5 = {
|
2908 | id: 'actions',
|
2909 | install: function install(scope) {
|
2910 | scope.usePlugin(_$plugin_4.default);
|
2911 | scope.usePlugin(_$plugin_6.default);
|
2912 | scope.usePlugin(_$plugin_1.default);
|
2913 | scope.usePlugin(_$plugin_3.default);
|
2914 | }
|
2915 | };
|
2916 | _$plugin_5.default = ___default_5;
|
2917 | var _$raf_76 = {};
|
2918 | "use strict";
|
2919 |
|
2920 | Object.defineProperty(_$raf_76, "__esModule", {
|
2921 | value: true
|
2922 | });
|
2923 | _$raf_76.default = void 0;
|
2924 | var lastTime = 0;
|
2925 |
|
2926 | var _request;
|
2927 |
|
2928 | var _cancel;
|
2929 |
|
2930 | function __init_76(global) {
|
2931 | _request = global.requestAnimationFrame;
|
2932 | _cancel = global.cancelAnimationFrame;
|
2933 |
|
2934 | if (!_request) {
|
2935 | var vendors = ['ms', 'moz', 'webkit', 'o'];
|
2936 |
|
2937 | for (var _i = 0; _i < vendors.length; _i++) {
|
2938 | var vendor = vendors[_i];
|
2939 | _request = global["".concat(vendor, "RequestAnimationFrame")];
|
2940 | _cancel = global["".concat(vendor, "CancelAnimationFrame")] || global["".concat(vendor, "CancelRequestAnimationFrame")];
|
2941 | }
|
2942 | }
|
2943 |
|
2944 | _request = _request && _request.bind(global);
|
2945 | _cancel = _cancel && _cancel.bind(global);
|
2946 |
|
2947 | if (!_request) {
|
2948 | _request = function request(callback) {
|
2949 | var currTime = Date.now();
|
2950 | var timeToCall = Math.max(0, 16 - (currTime - lastTime));
|
2951 | var token = global.setTimeout(function () {
|
2952 |
|
2953 | callback(currTime + timeToCall);
|
2954 | }, timeToCall);
|
2955 | lastTime = currTime + timeToCall;
|
2956 | return token;
|
2957 | };
|
2958 |
|
2959 | _cancel = function cancel(token) {
|
2960 | return clearTimeout(token);
|
2961 | };
|
2962 | }
|
2963 | }
|
2964 |
|
2965 | var ___default_76 = {
|
2966 | request: function request(callback) {
|
2967 | return _request(callback);
|
2968 | },
|
2969 | cancel: function cancel(token) {
|
2970 | return _cancel(token);
|
2971 | },
|
2972 | init: __init_76
|
2973 | };
|
2974 | _$raf_76.default = ___default_76;
|
2975 | var _$plugin_7 = {};
|
2976 | "use strict";
|
2977 |
|
2978 | Object.defineProperty(_$plugin_7, "__esModule", {
|
2979 | value: true
|
2980 | });
|
2981 | _$plugin_7.getContainer = getContainer;
|
2982 | _$plugin_7.getScroll = getScroll;
|
2983 | _$plugin_7.getScrollSize = getScrollSize;
|
2984 | _$plugin_7.getScrollSizeDelta = getScrollSizeDelta;
|
2985 | _$plugin_7.default = void 0;
|
2986 |
|
2987 |
|
2988 | ;
|
2989 |
|
2990 |
|
2991 | ;
|
2992 |
|
2993 |
|
2994 | ;
|
2995 |
|
2996 |
|
2997 | ;
|
2998 |
|
2999 |
|
3000 | ;
|
3001 |
|
3002 | function __install_7(scope) {
|
3003 | var defaults = scope.defaults,
|
3004 | actions = scope.actions;
|
3005 | scope.autoScroll = autoScroll;
|
3006 |
|
3007 | autoScroll.now = function () {
|
3008 | return scope.now();
|
3009 | };
|
3010 |
|
3011 | actions.phaselessTypes.autoscroll = true;
|
3012 | defaults.perAction.autoScroll = autoScroll.defaults;
|
3013 | }
|
3014 |
|
3015 | var autoScroll = {
|
3016 | defaults: {
|
3017 | enabled: false,
|
3018 | margin: 60,
|
3019 |
|
3020 | container: null,
|
3021 |
|
3022 | speed: 300
|
3023 | },
|
3024 | now: Date.now,
|
3025 | interaction: null,
|
3026 | i: 0,
|
3027 |
|
3028 |
|
3029 | x: 0,
|
3030 | y: 0,
|
3031 | isScrolling: false,
|
3032 | prevTime: 0,
|
3033 | margin: 0,
|
3034 | speed: 0,
|
3035 | start: function start(interaction) {
|
3036 | autoScroll.isScrolling = true;
|
3037 |
|
3038 | _$raf_76.default.cancel(autoScroll.i);
|
3039 |
|
3040 | interaction.autoScroll = autoScroll;
|
3041 | autoScroll.interaction = interaction;
|
3042 | autoScroll.prevTime = autoScroll.now();
|
3043 | autoScroll.i = _$raf_76.default.request(autoScroll.scroll);
|
3044 | },
|
3045 | stop: function stop() {
|
3046 | autoScroll.isScrolling = false;
|
3047 |
|
3048 | if (autoScroll.interaction) {
|
3049 | autoScroll.interaction.autoScroll = null;
|
3050 | }
|
3051 |
|
3052 | _$raf_76.default.cancel(autoScroll.i);
|
3053 | },
|
3054 |
|
3055 | scroll: function scroll() {
|
3056 | var interaction = autoScroll.interaction;
|
3057 | var interactable = interaction.interactable,
|
3058 | element = interaction.element;
|
3059 | var actionName = interaction.prepared.name;
|
3060 | var options = interactable.options[actionName].autoScroll;
|
3061 | var container = getContainer(options.container, interactable, element);
|
3062 | var now = autoScroll.now();
|
3063 |
|
3064 | var dt = (now - autoScroll.prevTime) / 1000;
|
3065 |
|
3066 | var s = options.speed * dt;
|
3067 |
|
3068 | if (s >= 1) {
|
3069 | var scrollBy = {
|
3070 | x: autoScroll.x * s,
|
3071 | y: autoScroll.y * s
|
3072 | };
|
3073 |
|
3074 | if (scrollBy.x || scrollBy.y) {
|
3075 | var prevScroll = getScroll(container);
|
3076 |
|
3077 | if (_$is_70.default.window(container)) {
|
3078 | container.scrollBy(scrollBy.x, scrollBy.y);
|
3079 | } else if (container) {
|
3080 | container.scrollLeft += scrollBy.x;
|
3081 | container.scrollTop += scrollBy.y;
|
3082 | }
|
3083 |
|
3084 | var curScroll = getScroll(container);
|
3085 | var delta = {
|
3086 | x: curScroll.x - prevScroll.x,
|
3087 | y: curScroll.y - prevScroll.y
|
3088 | };
|
3089 |
|
3090 | if (delta.x || delta.y) {
|
3091 | interactable.fire({
|
3092 | type: 'autoscroll',
|
3093 | target: element,
|
3094 | interactable: interactable,
|
3095 | delta: delta,
|
3096 | interaction: interaction,
|
3097 | container: container
|
3098 | });
|
3099 | }
|
3100 | }
|
3101 |
|
3102 | autoScroll.prevTime = now;
|
3103 | }
|
3104 |
|
3105 | if (autoScroll.isScrolling) {
|
3106 | _$raf_76.default.cancel(autoScroll.i);
|
3107 |
|
3108 | autoScroll.i = _$raf_76.default.request(autoScroll.scroll);
|
3109 | }
|
3110 | },
|
3111 | check: function check(interactable, actionName) {
|
3112 | var _options$actionName$a;
|
3113 |
|
3114 | var options = interactable.options;
|
3115 | return (_options$actionName$a = options[actionName].autoScroll) == null ? void 0 : _options$actionName$a.enabled;
|
3116 | },
|
3117 | onInteractionMove: function onInteractionMove(_ref) {
|
3118 | var interaction = _ref.interaction,
|
3119 | pointer = _ref.pointer;
|
3120 |
|
3121 | if (!(interaction.interacting() && autoScroll.check(interaction.interactable, interaction.prepared.name))) {
|
3122 | return;
|
3123 | }
|
3124 |
|
3125 | if (interaction.simulation) {
|
3126 | autoScroll.x = autoScroll.y = 0;
|
3127 | return;
|
3128 | }
|
3129 |
|
3130 | var top;
|
3131 | var right;
|
3132 | var bottom;
|
3133 | var left;
|
3134 | var interactable = interaction.interactable,
|
3135 | element = interaction.element;
|
3136 | var actionName = interaction.prepared.name;
|
3137 | var options = interactable.options[actionName].autoScroll;
|
3138 | var container = getContainer(options.container, interactable, element);
|
3139 |
|
3140 | if (_$is_70.default.window(container)) {
|
3141 | left = pointer.clientX < autoScroll.margin;
|
3142 | top = pointer.clientY < autoScroll.margin;
|
3143 | right = pointer.clientX > container.innerWidth - autoScroll.margin;
|
3144 | bottom = pointer.clientY > container.innerHeight - autoScroll.margin;
|
3145 | } else {
|
3146 | var rect = _$domUtils_66.getElementClientRect(container);
|
3147 |
|
3148 | left = pointer.clientX < rect.left + autoScroll.margin;
|
3149 | top = pointer.clientY < rect.top + autoScroll.margin;
|
3150 | right = pointer.clientX > rect.right - autoScroll.margin;
|
3151 | bottom = pointer.clientY > rect.bottom - autoScroll.margin;
|
3152 | }
|
3153 |
|
3154 | autoScroll.x = right ? 1 : left ? -1 : 0;
|
3155 | autoScroll.y = bottom ? 1 : top ? -1 : 0;
|
3156 |
|
3157 | if (!autoScroll.isScrolling) {
|
3158 |
|
3159 | autoScroll.margin = options.margin;
|
3160 | autoScroll.speed = options.speed;
|
3161 | autoScroll.start(interaction);
|
3162 | }
|
3163 | }
|
3164 | };
|
3165 |
|
3166 | function getContainer(value, interactable, element) {
|
3167 | return (_$is_70.default.string(value) ? (0, _$rect_77.getStringOptionResult)(value, interactable, element) : value) || (0, _$window_78.getWindow)(element);
|
3168 | }
|
3169 |
|
3170 | function getScroll(container) {
|
3171 | if (_$is_70.default.window(container)) {
|
3172 | container = window.document.body;
|
3173 | }
|
3174 |
|
3175 | return {
|
3176 | x: container.scrollLeft,
|
3177 | y: container.scrollTop
|
3178 | };
|
3179 | }
|
3180 |
|
3181 | function getScrollSize(container) {
|
3182 | if (_$is_70.default.window(container)) {
|
3183 | container = window.document.body;
|
3184 | }
|
3185 |
|
3186 | return {
|
3187 | x: container.scrollWidth,
|
3188 | y: container.scrollHeight
|
3189 | };
|
3190 | }
|
3191 |
|
3192 | function getScrollSizeDelta(_ref2, func) {
|
3193 | var interaction = _ref2.interaction,
|
3194 | element = _ref2.element;
|
3195 | var scrollOptions = interaction && interaction.interactable.options[interaction.prepared.name].autoScroll;
|
3196 |
|
3197 | if (!scrollOptions || !scrollOptions.enabled) {
|
3198 | func();
|
3199 | return {
|
3200 | x: 0,
|
3201 | y: 0
|
3202 | };
|
3203 | }
|
3204 |
|
3205 | var scrollContainer = getContainer(scrollOptions.container, interaction.interactable, element);
|
3206 | var prevSize = getScroll(scrollContainer);
|
3207 | func();
|
3208 | var curSize = getScroll(scrollContainer);
|
3209 | return {
|
3210 | x: curSize.x - prevSize.x,
|
3211 | y: curSize.y - prevSize.y
|
3212 | };
|
3213 | }
|
3214 |
|
3215 | var autoScrollPlugin = {
|
3216 | id: 'auto-scroll',
|
3217 | install: __install_7,
|
3218 | listeners: {
|
3219 | 'interactions:new': function interactionsNew(_ref3) {
|
3220 | var interaction = _ref3.interaction;
|
3221 | interaction.autoScroll = null;
|
3222 | },
|
3223 | 'interactions:destroy': function interactionsDestroy(_ref4) {
|
3224 | var interaction = _ref4.interaction;
|
3225 | interaction.autoScroll = null;
|
3226 | autoScroll.stop();
|
3227 |
|
3228 | if (autoScroll.interaction) {
|
3229 | autoScroll.interaction = null;
|
3230 | }
|
3231 | },
|
3232 | 'interactions:stop': autoScroll.stop,
|
3233 | 'interactions:action-move': function interactionsActionMove(arg) {
|
3234 | return autoScroll.onInteractionMove(arg);
|
3235 | }
|
3236 | }
|
3237 | };
|
3238 | var ___default_7 = autoScrollPlugin;
|
3239 | _$plugin_7.default = ___default_7;
|
3240 | var _$misc_72 = {};
|
3241 | "use strict";
|
3242 |
|
3243 | Object.defineProperty(_$misc_72, "__esModule", {
|
3244 | value: true
|
3245 | });
|
3246 | _$misc_72.warnOnce = warnOnce;
|
3247 | _$misc_72.copyAction = copyAction;
|
3248 | _$misc_72.sign = void 0;
|
3249 |
|
3250 |
|
3251 | ;
|
3252 |
|
3253 | function warnOnce(method, message) {
|
3254 | var warned = false;
|
3255 | return function () {
|
3256 | if (!warned) {
|
3257 | ;
|
3258 |
|
3259 | _$window_78.window.console.warn(message);
|
3260 |
|
3261 | warned = true;
|
3262 | }
|
3263 |
|
3264 | return method.apply(this, arguments);
|
3265 | };
|
3266 | }
|
3267 |
|
3268 | function copyAction(dest, src) {
|
3269 | dest.name = src.name;
|
3270 | dest.axis = src.axis;
|
3271 | dest.edges = src.edges;
|
3272 | return dest;
|
3273 | }
|
3274 |
|
3275 | var sign = function sign(n) {
|
3276 | return n >= 0 ? 1 : -1;
|
3277 | };
|
3278 |
|
3279 | _$misc_72.sign = sign;
|
3280 | var _$InteractableMethods_8 = {};
|
3281 | "use strict";
|
3282 |
|
3283 | Object.defineProperty(_$InteractableMethods_8, "__esModule", {
|
3284 | value: true
|
3285 | });
|
3286 | _$InteractableMethods_8.default = void 0;
|
3287 |
|
3288 |
|
3289 | ;
|
3290 |
|
3291 |
|
3292 | ;
|
3293 |
|
3294 | function __install_8(scope) {
|
3295 | var Interactable = scope.Interactable;
|
3296 |
|
3297 | Interactable.prototype.getAction = function getAction(pointer, event, interaction, element) {
|
3298 | var action = defaultActionChecker(this, event, interaction, element, scope);
|
3299 |
|
3300 | if (this.options.actionChecker) {
|
3301 | return this.options.actionChecker(pointer, event, action, this, element, interaction);
|
3302 | }
|
3303 |
|
3304 | return action;
|
3305 | };
|
3306 | |
3307 |
|
3308 |
|
3309 |
|
3310 |
|
3311 |
|
3312 |
|
3313 |
|
3314 |
|
3315 |
|
3316 |
|
3317 |
|
3318 |
|
3319 |
|
3320 |
|
3321 |
|
3322 |
|
3323 |
|
3324 |
|
3325 |
|
3326 |
|
3327 |
|
3328 |
|
3329 |
|
3330 |
|
3331 |
|
3332 | Interactable.prototype.ignoreFrom = (0, _$misc_72.warnOnce)(function (newValue) {
|
3333 | return this._backCompatOption('ignoreFrom', newValue);
|
3334 | }, 'Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue}).');
|
3335 | |
3336 |
|
3337 |
|
3338 |
|
3339 |
|
3340 |
|
3341 |
|
3342 |
|
3343 |
|
3344 |
|
3345 |
|
3346 |
|
3347 |
|
3348 |
|
3349 |
|
3350 |
|
3351 |
|
3352 |
|
3353 |
|
3354 |
|
3355 |
|
3356 |
|
3357 |
|
3358 |
|
3359 |
|
3360 | Interactable.prototype.allowFrom = (0, _$misc_72.warnOnce)(function (newValue) {
|
3361 | return this._backCompatOption('allowFrom', newValue);
|
3362 | }, 'Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue}).');
|
3363 | |
3364 |
|
3365 |
|
3366 |
|
3367 |
|
3368 |
|
3369 |
|
3370 |
|
3371 |
|
3372 |
|
3373 |
|
3374 |
|
3375 |
|
3376 |
|
3377 |
|
3378 |
|
3379 |
|
3380 |
|
3381 |
|
3382 |
|
3383 |
|
3384 |
|
3385 |
|
3386 |
|
3387 |
|
3388 |
|
3389 |
|
3390 |
|
3391 |
|
3392 |
|
3393 |
|
3394 |
|
3395 | Interactable.prototype.actionChecker = actionChecker;
|
3396 | |
3397 |
|
3398 |
|
3399 |
|
3400 |
|
3401 |
|
3402 |
|
3403 |
|
3404 | Interactable.prototype.styleCursor = styleCursor;
|
3405 | }
|
3406 |
|
3407 | function defaultActionChecker(interactable, event, interaction, element, scope) {
|
3408 | var rect = interactable.getRect(element);
|
3409 | var buttons = event.buttons || {
|
3410 | 0: 1,
|
3411 | 1: 4,
|
3412 | 3: 8,
|
3413 | 4: 16
|
3414 | }[event.button];
|
3415 | var arg = {
|
3416 | action: null,
|
3417 | interactable: interactable,
|
3418 | interaction: interaction,
|
3419 | element: element,
|
3420 | rect: rect,
|
3421 | buttons: buttons
|
3422 | };
|
3423 | scope.fire('auto-start:check', arg);
|
3424 | return arg.action;
|
3425 | }
|
3426 |
|
3427 | function styleCursor(newValue) {
|
3428 | if (_$is_70.default.bool(newValue)) {
|
3429 | this.options.styleCursor = newValue;
|
3430 | return this;
|
3431 | }
|
3432 |
|
3433 | if (newValue === null) {
|
3434 | delete this.options.styleCursor;
|
3435 | return this;
|
3436 | }
|
3437 |
|
3438 | return this.options.styleCursor;
|
3439 | }
|
3440 |
|
3441 | function actionChecker(checker) {
|
3442 | if (_$is_70.default.func(checker)) {
|
3443 | this.options.actionChecker = checker;
|
3444 | return this;
|
3445 | }
|
3446 |
|
3447 | if (checker === null) {
|
3448 | delete this.options.actionChecker;
|
3449 | return this;
|
3450 | }
|
3451 |
|
3452 | return this.options.actionChecker;
|
3453 | }
|
3454 |
|
3455 | var ___default_8 = {
|
3456 | id: 'auto-start/interactableMethods',
|
3457 | install: __install_8
|
3458 | };
|
3459 | _$InteractableMethods_8.default = ___default_8;
|
3460 | var _$base_9 = {};
|
3461 | "use strict";
|
3462 |
|
3463 | Object.defineProperty(_$base_9, "__esModule", {
|
3464 | value: true
|
3465 | });
|
3466 | _$base_9.default = void 0;
|
3467 |
|
3468 |
|
3469 | ;
|
3470 |
|
3471 |
|
3472 | ;
|
3473 |
|
3474 |
|
3475 | ;
|
3476 |
|
3477 |
|
3478 | ;
|
3479 |
|
3480 |
|
3481 | ;
|
3482 |
|
3483 | function __install_9(scope) {
|
3484 | var interact = scope.interactStatic,
|
3485 | defaults = scope.defaults;
|
3486 | scope.usePlugin(_$InteractableMethods_8.default);
|
3487 | defaults.base.actionChecker = null;
|
3488 | defaults.base.styleCursor = true;
|
3489 | (0, _$extend_67.default)(defaults.perAction, {
|
3490 | manualStart: false,
|
3491 | max: Infinity,
|
3492 | maxPerElement: 1,
|
3493 | allowFrom: null,
|
3494 | ignoreFrom: null,
|
3495 |
|
3496 |
|
3497 | mouseButtons: 1
|
3498 | });
|
3499 | |
3500 |
|
3501 |
|
3502 |
|
3503 |
|
3504 |
|
3505 |
|
3506 |
|
3507 |
|
3508 |
|
3509 |
|
3510 |
|
3511 | interact.maxInteractions = function (newValue) {
|
3512 | return maxInteractions(newValue, scope);
|
3513 | };
|
3514 |
|
3515 | scope.autoStart = {
|
3516 |
|
3517 | maxInteractions: Infinity,
|
3518 | withinInteractionLimit: withinInteractionLimit,
|
3519 | cursorElement: null
|
3520 | };
|
3521 | }
|
3522 |
|
3523 | function prepareOnDown(_ref, scope) {
|
3524 | var interaction = _ref.interaction,
|
3525 | pointer = _ref.pointer,
|
3526 | event = _ref.event,
|
3527 | eventTarget = _ref.eventTarget;
|
3528 | if (interaction.interacting()) return;
|
3529 | var actionInfo = getActionInfo(interaction, pointer, event, eventTarget, scope);
|
3530 | prepare(interaction, actionInfo, scope);
|
3531 | }
|
3532 |
|
3533 | function prepareOnMove(_ref2, scope) {
|
3534 | var interaction = _ref2.interaction,
|
3535 | pointer = _ref2.pointer,
|
3536 | event = _ref2.event,
|
3537 | eventTarget = _ref2.eventTarget;
|
3538 | if (interaction.pointerType !== 'mouse' || interaction.pointerIsDown || interaction.interacting()) return;
|
3539 | var actionInfo = getActionInfo(interaction, pointer, event, eventTarget, scope);
|
3540 | prepare(interaction, actionInfo, scope);
|
3541 | }
|
3542 |
|
3543 | function startOnMove(arg, scope) {
|
3544 | var interaction = arg.interaction;
|
3545 |
|
3546 | if (!interaction.pointerIsDown || interaction.interacting() || !interaction.pointerWasMoved || !interaction.prepared.name) {
|
3547 | return;
|
3548 | }
|
3549 |
|
3550 | scope.fire('autoStart:before-start', arg);
|
3551 | var interactable = interaction.interactable;
|
3552 | var actionName = interaction.prepared.name;
|
3553 |
|
3554 | if (actionName && interactable) {
|
3555 |
|
3556 | if (interactable.options[actionName].manualStart || !withinInteractionLimit(interactable, interaction.element, interaction.prepared, scope)) {
|
3557 | interaction.stop();
|
3558 | } else {
|
3559 | interaction.start(interaction.prepared, interactable, interaction.element);
|
3560 | setInteractionCursor(interaction, scope);
|
3561 | }
|
3562 | }
|
3563 | }
|
3564 |
|
3565 | function clearCursorOnStop(_ref3, scope) {
|
3566 | var interaction = _ref3.interaction;
|
3567 | var interactable = interaction.interactable;
|
3568 |
|
3569 | if (interactable && interactable.options.styleCursor) {
|
3570 | setCursor(interaction.element, '', scope);
|
3571 | }
|
3572 | }
|
3573 |
|
3574 |
|
3575 |
|
3576 | function validateAction(action, interactable, element, eventTarget, scope) {
|
3577 | if (interactable.testIgnoreAllow(interactable.options[action.name], element, eventTarget) && interactable.options[action.name].enabled && withinInteractionLimit(interactable, element, action, scope)) {
|
3578 | return action;
|
3579 | }
|
3580 |
|
3581 | return null;
|
3582 | }
|
3583 |
|
3584 | function validateMatches(interaction, pointer, event, matches, matchElements, eventTarget, scope) {
|
3585 | for (var i = 0, len = matches.length; i < len; i++) {
|
3586 | var match = matches[i];
|
3587 | var matchElement = matchElements[i];
|
3588 | var matchAction = match.getAction(pointer, event, interaction, matchElement);
|
3589 |
|
3590 | if (!matchAction) {
|
3591 | continue;
|
3592 | }
|
3593 |
|
3594 | var action = validateAction(matchAction, match, matchElement, eventTarget, scope);
|
3595 |
|
3596 | if (action) {
|
3597 | return {
|
3598 | action: action,
|
3599 | interactable: match,
|
3600 | element: matchElement
|
3601 | };
|
3602 | }
|
3603 | }
|
3604 |
|
3605 | return {
|
3606 | action: null,
|
3607 | interactable: null,
|
3608 | element: null
|
3609 | };
|
3610 | }
|
3611 |
|
3612 | function getActionInfo(interaction, pointer, event, eventTarget, scope) {
|
3613 | var matches = [];
|
3614 | var matchElements = [];
|
3615 | var element = eventTarget;
|
3616 |
|
3617 | function pushMatches(interactable) {
|
3618 | matches.push(interactable);
|
3619 | matchElements.push(element);
|
3620 | }
|
3621 |
|
3622 | while (_$is_70.default.element(element)) {
|
3623 | matches = [];
|
3624 | matchElements = [];
|
3625 | scope.interactables.forEachMatch(element, pushMatches);
|
3626 | var actionInfo = validateMatches(interaction, pointer, event, matches, matchElements, eventTarget, scope);
|
3627 |
|
3628 | if (actionInfo.action && !actionInfo.interactable.options[actionInfo.action.name].manualStart) {
|
3629 | return actionInfo;
|
3630 | }
|
3631 |
|
3632 | element = _$domUtils_66.parentNode(element);
|
3633 | }
|
3634 |
|
3635 | return {
|
3636 | action: null,
|
3637 | interactable: null,
|
3638 | element: null
|
3639 | };
|
3640 | }
|
3641 |
|
3642 | function prepare(interaction, _ref4, scope) {
|
3643 | var action = _ref4.action,
|
3644 | interactable = _ref4.interactable,
|
3645 | element = _ref4.element;
|
3646 | action = action || {
|
3647 | name: null
|
3648 | };
|
3649 | interaction.interactable = interactable;
|
3650 | interaction.element = element;
|
3651 | (0, _$misc_72.copyAction)(interaction.prepared, action);
|
3652 | interaction.rect = interactable && action.name ? interactable.getRect(element) : null;
|
3653 | setInteractionCursor(interaction, scope);
|
3654 | scope.fire('autoStart:prepared', {
|
3655 | interaction: interaction
|
3656 | });
|
3657 | }
|
3658 |
|
3659 | function withinInteractionLimit(interactable, element, action, scope) {
|
3660 | var options = interactable.options;
|
3661 | var maxActions = options[action.name].max;
|
3662 | var maxPerElement = options[action.name].maxPerElement;
|
3663 | var autoStartMax = scope.autoStart.maxInteractions;
|
3664 | var activeInteractions = 0;
|
3665 | var interactableCount = 0;
|
3666 | var elementCount = 0;
|
3667 |
|
3668 | if (!(maxActions && maxPerElement && autoStartMax)) {
|
3669 | return false;
|
3670 | }
|
3671 |
|
3672 | for (var _i = 0; _i < scope.interactions.list.length; _i++) {
|
3673 | var _ref5;
|
3674 |
|
3675 | _ref5 = scope.interactions.list[_i];
|
3676 | var interaction = _ref5;
|
3677 | var otherAction = interaction.prepared.name;
|
3678 |
|
3679 | if (!interaction.interacting()) {
|
3680 | continue;
|
3681 | }
|
3682 |
|
3683 | activeInteractions++;
|
3684 |
|
3685 | if (activeInteractions >= autoStartMax) {
|
3686 | return false;
|
3687 | }
|
3688 |
|
3689 | if (interaction.interactable !== interactable) {
|
3690 | continue;
|
3691 | }
|
3692 |
|
3693 | interactableCount += otherAction === action.name ? 1 : 0;
|
3694 |
|
3695 | if (interactableCount >= maxActions) {
|
3696 | return false;
|
3697 | }
|
3698 |
|
3699 | if (interaction.element === element) {
|
3700 | elementCount++;
|
3701 |
|
3702 | if (otherAction === action.name && elementCount >= maxPerElement) {
|
3703 | return false;
|
3704 | }
|
3705 | }
|
3706 | }
|
3707 |
|
3708 | return autoStartMax > 0;
|
3709 | }
|
3710 |
|
3711 | function maxInteractions(newValue, scope) {
|
3712 | if (_$is_70.default.number(newValue)) {
|
3713 | scope.autoStart.maxInteractions = newValue;
|
3714 | return this;
|
3715 | }
|
3716 |
|
3717 | return scope.autoStart.maxInteractions;
|
3718 | }
|
3719 |
|
3720 | function setCursor(element, cursor, scope) {
|
3721 | var prevCursorElement = scope.autoStart.cursorElement;
|
3722 |
|
3723 | if (prevCursorElement && prevCursorElement !== element) {
|
3724 | prevCursorElement.style.cursor = '';
|
3725 | }
|
3726 |
|
3727 | element.ownerDocument.documentElement.style.cursor = cursor;
|
3728 | element.style.cursor = cursor;
|
3729 | scope.autoStart.cursorElement = cursor ? element : null;
|
3730 | }
|
3731 |
|
3732 | function setInteractionCursor(interaction, scope) {
|
3733 | var interactable = interaction.interactable,
|
3734 | element = interaction.element,
|
3735 | prepared = interaction.prepared;
|
3736 |
|
3737 | if (!(interaction.pointerType === 'mouse' && interactable && interactable.options.styleCursor)) {
|
3738 |
|
3739 | if (scope.autoStart.cursorElement) {
|
3740 | setCursor(scope.autoStart.cursorElement, '', scope);
|
3741 | }
|
3742 |
|
3743 | return;
|
3744 | }
|
3745 |
|
3746 | var cursor = '';
|
3747 |
|
3748 | if (prepared.name) {
|
3749 | var cursorChecker = interactable.options[prepared.name].cursorChecker;
|
3750 |
|
3751 | if (_$is_70.default.func(cursorChecker)) {
|
3752 | cursor = cursorChecker(prepared, interactable, element, interaction._interacting);
|
3753 | } else {
|
3754 | cursor = scope.actions.map[prepared.name].getCursor(prepared);
|
3755 | }
|
3756 | }
|
3757 |
|
3758 | setCursor(interaction.element, cursor || '', scope);
|
3759 | }
|
3760 |
|
3761 | var autoStart = {
|
3762 | id: 'auto-start/base',
|
3763 | before: ['actions'],
|
3764 | install: __install_9,
|
3765 | listeners: {
|
3766 | 'interactions:down': prepareOnDown,
|
3767 | 'interactions:move': function interactionsMove(arg, scope) {
|
3768 | prepareOnMove(arg, scope);
|
3769 | startOnMove(arg, scope);
|
3770 | },
|
3771 | 'interactions:stop': clearCursorOnStop
|
3772 | },
|
3773 | maxInteractions: maxInteractions,
|
3774 | withinInteractionLimit: withinInteractionLimit,
|
3775 | validateAction: validateAction
|
3776 | };
|
3777 | var ___default_9 = autoStart;
|
3778 | _$base_9.default = ___default_9;
|
3779 | var _$dragAxis_10 = {};
|
3780 | "use strict";
|
3781 |
|
3782 | Object.defineProperty(_$dragAxis_10, "__esModule", {
|
3783 | value: true
|
3784 | });
|
3785 | _$dragAxis_10.default = void 0;
|
3786 |
|
3787 |
|
3788 | ;
|
3789 |
|
3790 |
|
3791 | ;
|
3792 |
|
3793 |
|
3794 | ;
|
3795 |
|
3796 | function beforeStart(_ref, scope) {
|
3797 | var interaction = _ref.interaction,
|
3798 | eventTarget = _ref.eventTarget,
|
3799 | dx = _ref.dx,
|
3800 | dy = _ref.dy;
|
3801 | if (interaction.prepared.name !== 'drag') return;
|
3802 |
|
3803 | var absX = Math.abs(dx);
|
3804 | var absY = Math.abs(dy);
|
3805 | var targetOptions = interaction.interactable.options.drag;
|
3806 | var startAxis = targetOptions.startAxis;
|
3807 | var currentAxis = absX > absY ? 'x' : absX < absY ? 'y' : 'xy';
|
3808 | interaction.prepared.axis = targetOptions.lockAxis === 'start' ? currentAxis[0] :
|
3809 | targetOptions.lockAxis;
|
3810 |
|
3811 | if (currentAxis !== 'xy' && startAxis !== 'xy' && startAxis !== currentAxis) {
|
3812 |
|
3813 | ;
|
3814 | interaction.prepared.name = null;
|
3815 |
|
3816 | var element = eventTarget;
|
3817 |
|
3818 | var getDraggable = function getDraggable(interactable) {
|
3819 | if (interactable === interaction.interactable) return;
|
3820 | var options = interaction.interactable.options.drag;
|
3821 |
|
3822 | if (!options.manualStart && interactable.testIgnoreAllow(options, element, eventTarget)) {
|
3823 | var action = interactable.getAction(interaction.downPointer, interaction.downEvent, interaction, element);
|
3824 |
|
3825 | if (action && action.name === 'drag' && checkStartAxis(currentAxis, interactable) && _$base_9.default.validateAction(action, interactable, element, eventTarget, scope)) {
|
3826 | return interactable;
|
3827 | }
|
3828 | }
|
3829 | };
|
3830 |
|
3831 |
|
3832 | while (_$is_70.default.element(element)) {
|
3833 | var interactable = scope.interactables.forEachMatch(element, getDraggable);
|
3834 |
|
3835 | if (interactable) {
|
3836 | ;
|
3837 | interaction.prepared.name = 'drag';
|
3838 | interaction.interactable = interactable;
|
3839 | interaction.element = element;
|
3840 | break;
|
3841 | }
|
3842 |
|
3843 | element = (0, _$domUtils_66.parentNode)(element);
|
3844 | }
|
3845 | }
|
3846 | }
|
3847 |
|
3848 | function checkStartAxis(startAxis, interactable) {
|
3849 | if (!interactable) {
|
3850 | return false;
|
3851 | }
|
3852 |
|
3853 | var thisAxis = interactable.options.drag.startAxis;
|
3854 | return startAxis === 'xy' || thisAxis === 'xy' || thisAxis === startAxis;
|
3855 | }
|
3856 |
|
3857 | var ___default_10 = {
|
3858 | id: 'auto-start/dragAxis',
|
3859 | listeners: {
|
3860 | 'autoStart:before-start': beforeStart
|
3861 | }
|
3862 | };
|
3863 | _$dragAxis_10.default = ___default_10;
|
3864 | var _$hold_11 = {};
|
3865 | "use strict";
|
3866 |
|
3867 | Object.defineProperty(_$hold_11, "__esModule", {
|
3868 | value: true
|
3869 | });
|
3870 | _$hold_11.default = void 0;
|
3871 |
|
3872 |
|
3873 | ;
|
3874 |
|
3875 | function __install_11(scope) {
|
3876 | var defaults = scope.defaults;
|
3877 | scope.usePlugin(_$base_9.default);
|
3878 | defaults.perAction.hold = 0;
|
3879 | defaults.perAction.delay = 0;
|
3880 | }
|
3881 |
|
3882 | function getHoldDuration(interaction) {
|
3883 | var actionName = interaction.prepared && interaction.prepared.name;
|
3884 |
|
3885 | if (!actionName) {
|
3886 | return null;
|
3887 | }
|
3888 |
|
3889 | var options = interaction.interactable.options;
|
3890 | return options[actionName].hold || options[actionName].delay;
|
3891 | }
|
3892 |
|
3893 | var hold = {
|
3894 | id: 'auto-start/hold',
|
3895 | install: __install_11,
|
3896 | listeners: {
|
3897 | 'interactions:new': function interactionsNew(_ref) {
|
3898 | var interaction = _ref.interaction;
|
3899 | interaction.autoStartHoldTimer = null;
|
3900 | },
|
3901 | 'autoStart:prepared': function autoStartPrepared(_ref2) {
|
3902 | var interaction = _ref2.interaction;
|
3903 | var hold = getHoldDuration(interaction);
|
3904 |
|
3905 | if (hold > 0) {
|
3906 | interaction.autoStartHoldTimer = setTimeout(function () {
|
3907 | interaction.start(interaction.prepared, interaction.interactable, interaction.element);
|
3908 | }, hold);
|
3909 | }
|
3910 | },
|
3911 | 'interactions:move': function interactionsMove(_ref3) {
|
3912 | var interaction = _ref3.interaction,
|
3913 | duplicate = _ref3.duplicate;
|
3914 |
|
3915 | if (interaction.autoStartHoldTimer && interaction.pointerWasMoved && !duplicate) {
|
3916 | clearTimeout(interaction.autoStartHoldTimer);
|
3917 | interaction.autoStartHoldTimer = null;
|
3918 | }
|
3919 | },
|
3920 |
|
3921 | 'autoStart:before-start': function autoStartBeforeStart(_ref4) {
|
3922 | var interaction = _ref4.interaction;
|
3923 | var holdDuration = getHoldDuration(interaction);
|
3924 |
|
3925 | if (holdDuration > 0) {
|
3926 | interaction.prepared.name = null;
|
3927 | }
|
3928 | }
|
3929 | },
|
3930 | getHoldDuration: getHoldDuration
|
3931 | };
|
3932 | var ___default_11 = hold;
|
3933 | _$hold_11.default = ___default_11;
|
3934 | var _$plugin_12 = {};
|
3935 | "use strict";
|
3936 |
|
3937 | Object.defineProperty(_$plugin_12, "__esModule", {
|
3938 | value: true
|
3939 | });
|
3940 | _$plugin_12.default = void 0;
|
3941 |
|
3942 |
|
3943 | ;
|
3944 |
|
3945 |
|
3946 | ;
|
3947 |
|
3948 |
|
3949 | ;
|
3950 | var ___default_12 = {
|
3951 | id: 'auto-start',
|
3952 | install: function install(scope) {
|
3953 | scope.usePlugin(_$base_9.default);
|
3954 | scope.usePlugin(_$hold_11.default);
|
3955 | scope.usePlugin(_$dragAxis_10.default);
|
3956 | }
|
3957 | };
|
3958 | _$plugin_12.default = ___default_12;
|
3959 | var _$interactablePreventDefault_22 = {};
|
3960 | "use strict";
|
3961 |
|
3962 | Object.defineProperty(_$interactablePreventDefault_22, "__esModule", {
|
3963 | value: true
|
3964 | });
|
3965 | _$interactablePreventDefault_22.install = __install_22;
|
3966 | _$interactablePreventDefault_22.default = void 0;
|
3967 |
|
3968 |
|
3969 | ;
|
3970 |
|
3971 |
|
3972 | ;
|
3973 |
|
3974 |
|
3975 | ;
|
3976 |
|
3977 | function preventDefault(newValue) {
|
3978 | if (/^(always|never|auto)$/.test(newValue)) {
|
3979 | this.options.preventDefault = newValue;
|
3980 | return this;
|
3981 | }
|
3982 |
|
3983 | if (_$is_70.default.bool(newValue)) {
|
3984 | this.options.preventDefault = newValue ? 'always' : 'never';
|
3985 | return this;
|
3986 | }
|
3987 |
|
3988 | return this.options.preventDefault;
|
3989 | }
|
3990 |
|
3991 | function checkAndPreventDefault(interactable, scope, event) {
|
3992 | var setting = interactable.options.preventDefault;
|
3993 | if (setting === 'never') return;
|
3994 |
|
3995 | if (setting === 'always') {
|
3996 | event.preventDefault();
|
3997 | return;
|
3998 | }
|
3999 |
|
4000 |
|
4001 |
|
4002 |
|
4003 |
|
4004 | if (scope.events.supportsPassive && /^touch(start|move)$/.test(event.type)) {
|
4005 | var doc = (0, _$window_78.getWindow)(event.target).document;
|
4006 | var docOptions = scope.getDocOptions(doc);
|
4007 |
|
4008 | if (!(docOptions && docOptions.events) || docOptions.events.passive !== false) {
|
4009 | return;
|
4010 | }
|
4011 | }
|
4012 |
|
4013 |
|
4014 | if (/^(mouse|pointer|touch)*(down|start)/i.test(event.type)) {
|
4015 | return;
|
4016 | }
|
4017 |
|
4018 |
|
4019 | if (_$is_70.default.element(event.target) && (0, _$domUtils_66.matchesSelector)(event.target, 'input,select,textarea,[contenteditable=true],[contenteditable=true] *')) {
|
4020 | return;
|
4021 | }
|
4022 |
|
4023 | event.preventDefault();
|
4024 | }
|
4025 |
|
4026 | function onInteractionEvent(_ref) {
|
4027 | var interaction = _ref.interaction,
|
4028 | event = _ref.event;
|
4029 |
|
4030 | if (interaction.interactable) {
|
4031 | interaction.interactable.checkAndPreventDefault(event);
|
4032 | }
|
4033 | }
|
4034 |
|
4035 | function __install_22(scope) {
|
4036 |
|
4037 | var Interactable = scope.Interactable;
|
4038 | |
4039 |
|
4040 |
|
4041 |
|
4042 |
|
4043 |
|
4044 |
|
4045 |
|
4046 |
|
4047 |
|
4048 |
|
4049 | Interactable.prototype.preventDefault = preventDefault;
|
4050 |
|
4051 | Interactable.prototype.checkAndPreventDefault = function (event) {
|
4052 | return checkAndPreventDefault(this, scope, event);
|
4053 | };
|
4054 |
|
4055 |
|
4056 | scope.interactions.docEvents.push({
|
4057 | type: 'dragstart',
|
4058 | listener: function listener(event) {
|
4059 | for (var _i = 0; _i < scope.interactions.list.length; _i++) {
|
4060 | var _ref2;
|
4061 |
|
4062 | _ref2 = scope.interactions.list[_i];
|
4063 | var interaction = _ref2;
|
4064 |
|
4065 | if (interaction.element && (interaction.element === event.target || (0, _$domUtils_66.nodeContains)(interaction.element, event.target))) {
|
4066 | interaction.interactable.checkAndPreventDefault(event);
|
4067 | return;
|
4068 | }
|
4069 | }
|
4070 | }
|
4071 | });
|
4072 | }
|
4073 |
|
4074 | var ___default_22 = {
|
4075 | id: 'core/interactablePreventDefault',
|
4076 | install: __install_22,
|
4077 | listeners: ['down', 'move', 'up', 'cancel'].reduce(function (acc, eventType) {
|
4078 | acc["interactions:".concat(eventType)] = onInteractionEvent;
|
4079 | return acc;
|
4080 | }, {})
|
4081 | };
|
4082 | _$interactablePreventDefault_22.default = ___default_22;
|
4083 | var _$plugin_29 = {};
|
4084 | "use strict";
|
4085 |
|
4086 | Object.defineProperty(_$plugin_29, "__esModule", {
|
4087 | value: true
|
4088 | });
|
4089 | _$plugin_29.default = void 0;
|
4090 | var ___default_29 = {};
|
4091 | _$plugin_29.default = ___default_29;
|
4092 | var _$plugin_28 = {};
|
4093 | "use strict";
|
4094 |
|
4095 | Object.defineProperty(_$plugin_28, "__esModule", {
|
4096 | value: true
|
4097 | });
|
4098 | _$plugin_28.default = void 0;
|
4099 |
|
4100 |
|
4101 | ;
|
4102 |
|
4103 |
|
4104 | ;
|
4105 |
|
4106 |
|
4107 | ;
|
4108 |
|
4109 |
|
4110 | ;
|
4111 |
|
4112 |
|
4113 | ;
|
4114 |
|
4115 |
|
4116 | ;
|
4117 |
|
4118 | function ___toConsumableArray_28(arr) {
|
4119 | return ___arrayWithoutHoles_28(arr) || ___iterableToArray_28(arr) || ___unsupportedIterableToArray_28(arr) || ___nonIterableSpread_28();
|
4120 | }
|
4121 |
|
4122 | function ___nonIterableSpread_28() {
|
4123 | throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
4124 | }
|
4125 |
|
4126 | function ___unsupportedIterableToArray_28(o, minLen) {
|
4127 | if (!o) return;
|
4128 | if (typeof o === "string") return ___arrayLikeToArray_28(o, minLen);
|
4129 | var n = Object.prototype.toString.call(o).slice(8, -1);
|
4130 | if (n === "Object" && o.constructor) n = o.constructor.name;
|
4131 | if (n === "Map" || n === "Set") return Array.from(o);
|
4132 | if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return ___arrayLikeToArray_28(o, minLen);
|
4133 | }
|
4134 |
|
4135 | function ___iterableToArray_28(iter) {
|
4136 | if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
|
4137 | }
|
4138 |
|
4139 | function ___arrayWithoutHoles_28(arr) {
|
4140 | if (Array.isArray(arr)) return ___arrayLikeToArray_28(arr);
|
4141 | }
|
4142 |
|
4143 | function ___arrayLikeToArray_28(arr, len) {
|
4144 | if (len == null || len > arr.length) len = arr.length;
|
4145 |
|
4146 | for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
4147 | arr2[i] = arr[i];
|
4148 | }
|
4149 |
|
4150 | return arr2;
|
4151 | }
|
4152 |
|
4153 | var CheckName;
|
4154 |
|
4155 | (function (CheckName) {
|
4156 | CheckName["touchAction"] = "touchAction";
|
4157 | CheckName["boxSizing"] = "boxSizing";
|
4158 | CheckName["noListeners"] = "noListeners";
|
4159 | })(CheckName || (CheckName = {}));
|
4160 |
|
4161 | var prefix = '[interact.js] ';
|
4162 | var links = {
|
4163 | touchAction: 'https://developer.mozilla.org/en-US/docs/Web/CSS/touch-action',
|
4164 | boxSizing: 'https://developer.mozilla.org/en-US/docs/Web/CSS/box-sizing'
|
4165 | };
|
4166 |
|
4167 | var isProduction = "development" === 'production';
|
4168 |
|
4169 | function __install_28(scope) {
|
4170 | var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
4171 | logger = _ref.logger;
|
4172 |
|
4173 | var Interactable = scope.Interactable,
|
4174 | defaults = scope.defaults;
|
4175 | scope.logger = logger || console;
|
4176 | defaults.base.devTools = {
|
4177 | ignore: {}
|
4178 | };
|
4179 |
|
4180 | Interactable.prototype.devTools = function (options) {
|
4181 | if (options) {
|
4182 | (0, _$extend_67.default)(this.options.devTools, options);
|
4183 | return this;
|
4184 | }
|
4185 |
|
4186 | return this.options.devTools;
|
4187 | };
|
4188 |
|
4189 | scope.usePlugin(_$plugin_29.default);
|
4190 | }
|
4191 |
|
4192 | var checks = [{
|
4193 | name: CheckName.touchAction,
|
4194 | perform: function perform(_ref2) {
|
4195 | var element = _ref2.element;
|
4196 | return !parentHasStyle(element, 'touchAction', /pan-|pinch|none/);
|
4197 | },
|
4198 | getInfo: function getInfo(_ref3) {
|
4199 | var element = _ref3.element;
|
4200 | return [element, links.touchAction];
|
4201 | },
|
4202 | text: 'Consider adding CSS "touch-action: none" to this element\n'
|
4203 | }, {
|
4204 | name: CheckName.boxSizing,
|
4205 | perform: function perform(interaction) {
|
4206 | var element = interaction.element;
|
4207 | return interaction.prepared.name === 'resize' && element instanceof _$domObjects_65.default.HTMLElement && !hasStyle(element, 'boxSizing', /border-box/);
|
4208 | },
|
4209 | text: 'Consider adding CSS "box-sizing: border-box" to this resizable element',
|
4210 | getInfo: function getInfo(_ref4) {
|
4211 | var element = _ref4.element;
|
4212 | return [element, links.boxSizing];
|
4213 | }
|
4214 | }, {
|
4215 | name: CheckName.noListeners,
|
4216 | perform: function perform(interaction) {
|
4217 | var actionName = interaction.prepared.name;
|
4218 | var moveListeners = interaction.interactable.events.types["".concat(actionName, "move")] || [];
|
4219 | return !moveListeners.length;
|
4220 | },
|
4221 | getInfo: function getInfo(interaction) {
|
4222 | return [interaction.prepared.name, interaction.interactable];
|
4223 | },
|
4224 | text: 'There are no listeners set for this action'
|
4225 | }];
|
4226 |
|
4227 | function hasStyle(element, prop, styleRe) {
|
4228 | var value = element.style[prop] || _$window_78.window.getComputedStyle(element)[prop];
|
4229 |
|
4230 | return styleRe.test((value || '').toString());
|
4231 | }
|
4232 |
|
4233 | function parentHasStyle(element, prop, styleRe) {
|
4234 | var parent = element;
|
4235 |
|
4236 | while (_$is_70.default.element(parent)) {
|
4237 | if (hasStyle(parent, prop, styleRe)) {
|
4238 | return true;
|
4239 | }
|
4240 |
|
4241 | parent = (0, _$domUtils_66.parentNode)(parent);
|
4242 | }
|
4243 |
|
4244 | return false;
|
4245 | }
|
4246 |
|
4247 | var id = 'dev-tools';
|
4248 | var defaultExport = isProduction ? {
|
4249 | id: id,
|
4250 | install: function install() {}
|
4251 | } : {
|
4252 | id: id,
|
4253 | install: __install_28,
|
4254 | listeners: {
|
4255 | 'interactions:action-start': function interactionsActionStart(_ref5, scope) {
|
4256 | var interaction = _ref5.interaction;
|
4257 |
|
4258 | for (var _i = 0; _i < checks.length; _i++) {
|
4259 | var _ref6;
|
4260 |
|
4261 | _ref6 = checks[_i];
|
4262 | var check = _ref6;
|
4263 | var options = interaction.interactable && interaction.interactable.options;
|
4264 |
|
4265 | if (!(options && options.devTools && options.devTools.ignore[check.name]) && check.perform(interaction)) {
|
4266 | var _scope$logger;
|
4267 |
|
4268 | (_scope$logger = scope.logger).warn.apply(_scope$logger, [prefix + check.text].concat(___toConsumableArray_28(check.getInfo(interaction))));
|
4269 | }
|
4270 | }
|
4271 | }
|
4272 | },
|
4273 | checks: checks,
|
4274 | CheckName: CheckName,
|
4275 | links: links,
|
4276 | prefix: prefix
|
4277 | };
|
4278 | var ___default_28 = defaultExport;
|
4279 | _$plugin_28.default = ___default_28;
|
4280 | var _$clone_64 = {};
|
4281 | "use strict";
|
4282 |
|
4283 | Object.defineProperty(_$clone_64, "__esModule", {
|
4284 | value: true
|
4285 | });
|
4286 | _$clone_64.default = clone;
|
4287 |
|
4288 |
|
4289 | ;
|
4290 |
|
4291 |
|
4292 | ;
|
4293 |
|
4294 | function clone(source) {
|
4295 | var dest = {};
|
4296 |
|
4297 | for (var prop in source) {
|
4298 | var value = source[prop];
|
4299 |
|
4300 | if (_$is_70.default.plainObject(value)) {
|
4301 | dest[prop] = clone(value);
|
4302 | } else if (_$is_70.default.array(value)) {
|
4303 | dest[prop] = _$arr_62.from(value);
|
4304 | } else {
|
4305 | dest[prop] = value;
|
4306 | }
|
4307 | }
|
4308 |
|
4309 | return dest;
|
4310 | }
|
4311 |
|
4312 | var _$Modification_33 = {};
|
4313 | "use strict";
|
4314 |
|
4315 | Object.defineProperty(_$Modification_33, "__esModule", {
|
4316 | value: true
|
4317 | });
|
4318 | _$Modification_33.getRectOffset = getRectOffset;
|
4319 | _$Modification_33.default = void 0;
|
4320 |
|
4321 |
|
4322 | ;
|
4323 |
|
4324 |
|
4325 | ;
|
4326 |
|
4327 |
|
4328 | ;
|
4329 |
|
4330 | function _slicedToArray(arr, i) {
|
4331 | return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || ___unsupportedIterableToArray_33(arr, i) || _nonIterableRest();
|
4332 | }
|
4333 |
|
4334 | function _nonIterableRest() {
|
4335 | throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
4336 | }
|
4337 |
|
4338 | function ___unsupportedIterableToArray_33(o, minLen) {
|
4339 | if (!o) return;
|
4340 | if (typeof o === "string") return ___arrayLikeToArray_33(o, minLen);
|
4341 | var n = Object.prototype.toString.call(o).slice(8, -1);
|
4342 | if (n === "Object" && o.constructor) n = o.constructor.name;
|
4343 | if (n === "Map" || n === "Set") return Array.from(o);
|
4344 | if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return ___arrayLikeToArray_33(o, minLen);
|
4345 | }
|
4346 |
|
4347 | function ___arrayLikeToArray_33(arr, len) {
|
4348 | if (len == null || len > arr.length) len = arr.length;
|
4349 |
|
4350 | for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
4351 | arr2[i] = arr[i];
|
4352 | }
|
4353 |
|
4354 | return arr2;
|
4355 | }
|
4356 |
|
4357 | function _iterableToArrayLimit(arr, i) {
|
4358 | if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
|
4359 | var _arr = [];
|
4360 | var _n = true;
|
4361 | var _d = false;
|
4362 | var _e = undefined;
|
4363 |
|
4364 | try {
|
4365 | for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
|
4366 | _arr.push(_s.value);
|
4367 |
|
4368 | if (i && _arr.length === i) break;
|
4369 | }
|
4370 | } catch (err) {
|
4371 | _d = true;
|
4372 | _e = err;
|
4373 | } finally {
|
4374 | try {
|
4375 | if (!_n && _i["return"] != null) _i["return"]();
|
4376 | } finally {
|
4377 | if (_d) throw _e;
|
4378 | }
|
4379 | }
|
4380 |
|
4381 | return _arr;
|
4382 | }
|
4383 |
|
4384 | function _arrayWithHoles(arr) {
|
4385 | if (Array.isArray(arr)) return arr;
|
4386 | }
|
4387 |
|
4388 | function ___classCallCheck_33(instance, Constructor) {
|
4389 | if (!(instance instanceof Constructor)) {
|
4390 | throw new TypeError("Cannot call a class as a function");
|
4391 | }
|
4392 | }
|
4393 |
|
4394 | function ___defineProperties_33(target, props) {
|
4395 | for (var i = 0; i < props.length; i++) {
|
4396 | var descriptor = props[i];
|
4397 | descriptor.enumerable = descriptor.enumerable || false;
|
4398 | descriptor.configurable = true;
|
4399 | if ("value" in descriptor) descriptor.writable = true;
|
4400 | Object.defineProperty(target, descriptor.key, descriptor);
|
4401 | }
|
4402 | }
|
4403 |
|
4404 | function ___createClass_33(Constructor, protoProps, staticProps) {
|
4405 | if (protoProps) ___defineProperties_33(Constructor.prototype, protoProps);
|
4406 | if (staticProps) ___defineProperties_33(Constructor, staticProps);
|
4407 | return Constructor;
|
4408 | }
|
4409 |
|
4410 | function ___defineProperty_33(obj, key, value) {
|
4411 | if (key in obj) {
|
4412 | Object.defineProperty(obj, key, {
|
4413 | value: value,
|
4414 | enumerable: true,
|
4415 | configurable: true,
|
4416 | writable: true
|
4417 | });
|
4418 | } else {
|
4419 | obj[key] = value;
|
4420 | }
|
4421 |
|
4422 | return obj;
|
4423 | }
|
4424 |
|
4425 | var Modification = function () {
|
4426 | function Modification(interaction) {
|
4427 | ___classCallCheck_33(this, Modification);
|
4428 |
|
4429 | ___defineProperty_33(this, "states", []);
|
4430 |
|
4431 | ___defineProperty_33(this, "startOffset", {
|
4432 | left: 0,
|
4433 | right: 0,
|
4434 | top: 0,
|
4435 | bottom: 0
|
4436 | });
|
4437 |
|
4438 | ___defineProperty_33(this, "startDelta", void 0);
|
4439 |
|
4440 | ___defineProperty_33(this, "result", void 0);
|
4441 |
|
4442 | ___defineProperty_33(this, "endResult", void 0);
|
4443 |
|
4444 | ___defineProperty_33(this, "edges", void 0);
|
4445 |
|
4446 | ___defineProperty_33(this, "interaction", void 0);
|
4447 |
|
4448 | this.interaction = interaction;
|
4449 | this.result = createResult();
|
4450 | }
|
4451 |
|
4452 | ___createClass_33(Modification, [{
|
4453 | key: "start",
|
4454 | value: function start(_ref, pageCoords) {
|
4455 | var phase = _ref.phase;
|
4456 | var interaction = this.interaction;
|
4457 | var modifierList = getModifierList(interaction);
|
4458 | this.prepareStates(modifierList);
|
4459 | this.edges = (0, _$extend_67.default)({}, interaction.edges);
|
4460 | this.startOffset = getRectOffset(interaction.rect, pageCoords);
|
4461 | this.startDelta = {
|
4462 | x: 0,
|
4463 | y: 0
|
4464 | };
|
4465 | var arg = this.fillArg({
|
4466 | phase: phase,
|
4467 | pageCoords: pageCoords,
|
4468 | preEnd: false
|
4469 | });
|
4470 | this.result = createResult();
|
4471 | this.startAll(arg);
|
4472 | var result = this.result = this.setAll(arg);
|
4473 | return result;
|
4474 | }
|
4475 | }, {
|
4476 | key: "fillArg",
|
4477 | value: function fillArg(arg) {
|
4478 | var interaction = this.interaction;
|
4479 | arg.interaction = interaction;
|
4480 | arg.interactable = interaction.interactable;
|
4481 | arg.element = interaction.element;
|
4482 | arg.rect = arg.rect || interaction.rect;
|
4483 | arg.edges = this.edges;
|
4484 | arg.startOffset = this.startOffset;
|
4485 | return arg;
|
4486 | }
|
4487 | }, {
|
4488 | key: "startAll",
|
4489 | value: function startAll(arg) {
|
4490 | for (var _i = 0; _i < this.states.length; _i++) {
|
4491 | var _ref2;
|
4492 |
|
4493 | _ref2 = this.states[_i];
|
4494 | var state = _ref2;
|
4495 |
|
4496 | if (state.methods.start) {
|
4497 | arg.state = state;
|
4498 | state.methods.start(arg);
|
4499 | }
|
4500 | }
|
4501 | }
|
4502 | }, {
|
4503 | key: "setAll",
|
4504 | value: function setAll(arg) {
|
4505 | var phase = arg.phase,
|
4506 | preEnd = arg.preEnd,
|
4507 | skipModifiers = arg.skipModifiers,
|
4508 | unmodifiedRect = arg.rect;
|
4509 | arg.coords = (0, _$extend_67.default)({}, arg.pageCoords);
|
4510 | arg.rect = (0, _$extend_67.default)({}, unmodifiedRect);
|
4511 | var states = skipModifiers ? this.states.slice(skipModifiers) : this.states;
|
4512 | var newResult = createResult(arg.coords, arg.rect);
|
4513 |
|
4514 | for (var _i2 = 0; _i2 < states.length; _i2++) {
|
4515 | var _state$methods;
|
4516 |
|
4517 | var _ref3;
|
4518 |
|
4519 | _ref3 = states[_i2];
|
4520 | var state = _ref3;
|
4521 | var options = state.options;
|
4522 | var lastModifierCoords = (0, _$extend_67.default)({}, arg.coords);
|
4523 | var returnValue = null;
|
4524 |
|
4525 | if ((_state$methods = state.methods) != null && _state$methods.set && this.shouldDo(options, preEnd, phase)) {
|
4526 | arg.state = state;
|
4527 | returnValue = state.methods.set(arg);
|
4528 |
|
4529 | _$rect_77.addEdges(this.interaction.edges, arg.rect, {
|
4530 | x: arg.coords.x - lastModifierCoords.x,
|
4531 | y: arg.coords.y - lastModifierCoords.y
|
4532 | });
|
4533 | }
|
4534 |
|
4535 | newResult.eventProps.push(returnValue);
|
4536 | }
|
4537 |
|
4538 | newResult.delta.x = arg.coords.x - arg.pageCoords.x;
|
4539 | newResult.delta.y = arg.coords.y - arg.pageCoords.y;
|
4540 | newResult.rectDelta.left = arg.rect.left - unmodifiedRect.left;
|
4541 | newResult.rectDelta.right = arg.rect.right - unmodifiedRect.right;
|
4542 | newResult.rectDelta.top = arg.rect.top - unmodifiedRect.top;
|
4543 | newResult.rectDelta.bottom = arg.rect.bottom - unmodifiedRect.bottom;
|
4544 | var prevCoords = this.result.coords;
|
4545 | var prevRect = this.result.rect;
|
4546 |
|
4547 | if (prevCoords && prevRect) {
|
4548 | var rectChanged = newResult.rect.left !== prevRect.left || newResult.rect.right !== prevRect.right || newResult.rect.top !== prevRect.top || newResult.rect.bottom !== prevRect.bottom;
|
4549 | newResult.changed = rectChanged || prevCoords.x !== newResult.coords.x || prevCoords.y !== newResult.coords.y;
|
4550 | }
|
4551 |
|
4552 | return newResult;
|
4553 | }
|
4554 | }, {
|
4555 | key: "applyToInteraction",
|
4556 | value: function applyToInteraction(arg) {
|
4557 | var interaction = this.interaction;
|
4558 | var phase = arg.phase;
|
4559 | var curCoords = interaction.coords.cur;
|
4560 | var startCoords = interaction.coords.start;
|
4561 | var result = this.result,
|
4562 | startDelta = this.startDelta;
|
4563 | var curDelta = result.delta;
|
4564 |
|
4565 | if (phase === 'start') {
|
4566 | (0, _$extend_67.default)(this.startDelta, result.delta);
|
4567 | }
|
4568 |
|
4569 | for (var _i3 = 0; _i3 < [[startCoords, startDelta], [curCoords, curDelta]].length; _i3++) {
|
4570 | var _ref4;
|
4571 |
|
4572 | _ref4 = [[startCoords, startDelta], [curCoords, curDelta]][_i3];
|
4573 |
|
4574 | var _ref5 = _ref4,
|
4575 | _ref6 = _slicedToArray(_ref5, 2),
|
4576 | coordsSet = _ref6[0],
|
4577 | delta = _ref6[1];
|
4578 |
|
4579 | coordsSet.page.x += delta.x;
|
4580 | coordsSet.page.y += delta.y;
|
4581 | coordsSet.client.x += delta.x;
|
4582 | coordsSet.client.y += delta.y;
|
4583 | }
|
4584 |
|
4585 | var rectDelta = this.result.rectDelta;
|
4586 | var rect = arg.rect || interaction.rect;
|
4587 | rect.left += rectDelta.left;
|
4588 | rect.right += rectDelta.right;
|
4589 | rect.top += rectDelta.top;
|
4590 | rect.bottom += rectDelta.bottom;
|
4591 | rect.width = rect.right - rect.left;
|
4592 | rect.height = rect.bottom - rect.top;
|
4593 | }
|
4594 | }, {
|
4595 | key: "setAndApply",
|
4596 | value: function setAndApply(arg) {
|
4597 | var interaction = this.interaction;
|
4598 | var phase = arg.phase,
|
4599 | preEnd = arg.preEnd,
|
4600 | skipModifiers = arg.skipModifiers;
|
4601 | var result = this.setAll(this.fillArg({
|
4602 | preEnd: preEnd,
|
4603 | phase: phase,
|
4604 | pageCoords: arg.modifiedCoords || interaction.coords.cur.page
|
4605 | }));
|
4606 | this.result = result;
|
4607 |
|
4608 |
|
4609 | if (!result.changed && (!skipModifiers || skipModifiers < this.states.length) && interaction.interacting()) {
|
4610 | return false;
|
4611 | }
|
4612 |
|
4613 | if (arg.modifiedCoords) {
|
4614 | var page = interaction.coords.cur.page;
|
4615 | var adjustment = {
|
4616 | x: arg.modifiedCoords.x - page.x,
|
4617 | y: arg.modifiedCoords.y - page.y
|
4618 | };
|
4619 | result.coords.x += adjustment.x;
|
4620 | result.coords.y += adjustment.y;
|
4621 | result.delta.x += adjustment.x;
|
4622 | result.delta.y += adjustment.y;
|
4623 | }
|
4624 |
|
4625 | this.applyToInteraction(arg);
|
4626 | }
|
4627 | }, {
|
4628 | key: "beforeEnd",
|
4629 | value: function beforeEnd(arg) {
|
4630 | var interaction = arg.interaction,
|
4631 | event = arg.event;
|
4632 | var states = this.states;
|
4633 |
|
4634 | if (!states || !states.length) {
|
4635 | return;
|
4636 | }
|
4637 |
|
4638 | var doPreend = false;
|
4639 |
|
4640 | for (var _i4 = 0; _i4 < states.length; _i4++) {
|
4641 | var _ref7;
|
4642 |
|
4643 | _ref7 = states[_i4];
|
4644 | var state = _ref7;
|
4645 | arg.state = state;
|
4646 | var options = state.options,
|
4647 | methods = state.methods;
|
4648 | var endPosition = methods.beforeEnd && methods.beforeEnd(arg);
|
4649 |
|
4650 | if (endPosition) {
|
4651 | this.endResult = endPosition;
|
4652 | return false;
|
4653 | }
|
4654 |
|
4655 | doPreend = doPreend || !doPreend && this.shouldDo(options, true, arg.phase, true);
|
4656 | }
|
4657 |
|
4658 | if (doPreend) {
|
4659 |
|
4660 | interaction.move({
|
4661 | event: event,
|
4662 | preEnd: true
|
4663 | });
|
4664 | }
|
4665 | }
|
4666 | }, {
|
4667 | key: "stop",
|
4668 | value: function stop(arg) {
|
4669 | var interaction = arg.interaction;
|
4670 |
|
4671 | if (!this.states || !this.states.length) {
|
4672 | return;
|
4673 | }
|
4674 |
|
4675 | var modifierArg = (0, _$extend_67.default)({
|
4676 | states: this.states,
|
4677 | interactable: interaction.interactable,
|
4678 | element: interaction.element,
|
4679 | rect: null
|
4680 | }, arg);
|
4681 | this.fillArg(modifierArg);
|
4682 |
|
4683 | for (var _i5 = 0; _i5 < this.states.length; _i5++) {
|
4684 | var _ref8;
|
4685 |
|
4686 | _ref8 = this.states[_i5];
|
4687 | var state = _ref8;
|
4688 | modifierArg.state = state;
|
4689 |
|
4690 | if (state.methods.stop) {
|
4691 | state.methods.stop(modifierArg);
|
4692 | }
|
4693 | }
|
4694 |
|
4695 | this.states = null;
|
4696 | this.endResult = null;
|
4697 | }
|
4698 | }, {
|
4699 | key: "prepareStates",
|
4700 | value: function prepareStates(modifierList) {
|
4701 | this.states = [];
|
4702 |
|
4703 | for (var index = 0; index < modifierList.length; index++) {
|
4704 | var _modifierList$index = modifierList[index],
|
4705 | options = _modifierList$index.options,
|
4706 | methods = _modifierList$index.methods,
|
4707 | name = _modifierList$index.name;
|
4708 | this.states.push({
|
4709 | options: options,
|
4710 | methods: methods,
|
4711 | index: index,
|
4712 | name: name
|
4713 | });
|
4714 | }
|
4715 |
|
4716 | return this.states;
|
4717 | }
|
4718 | }, {
|
4719 | key: "restoreInteractionCoords",
|
4720 | value: function restoreInteractionCoords(_ref9) {
|
4721 | var _ref9$interaction = _ref9.interaction,
|
4722 | coords = _ref9$interaction.coords,
|
4723 | rect = _ref9$interaction.rect,
|
4724 | modification = _ref9$interaction.modification;
|
4725 | if (!modification.result) return;
|
4726 | var startDelta = modification.startDelta;
|
4727 | var _modification$result = modification.result,
|
4728 | curDelta = _modification$result.delta,
|
4729 | rectDelta = _modification$result.rectDelta;
|
4730 | var coordsAndDeltas = [[coords.start, startDelta], [coords.cur, curDelta]];
|
4731 |
|
4732 | for (var _i6 = 0; _i6 < coordsAndDeltas.length; _i6++) {
|
4733 | var _ref10;
|
4734 |
|
4735 | _ref10 = coordsAndDeltas[_i6];
|
4736 |
|
4737 | var _ref11 = _ref10,
|
4738 | _ref12 = _slicedToArray(_ref11, 2),
|
4739 | coordsSet = _ref12[0],
|
4740 | delta = _ref12[1];
|
4741 |
|
4742 | coordsSet.page.x -= delta.x;
|
4743 | coordsSet.page.y -= delta.y;
|
4744 | coordsSet.client.x -= delta.x;
|
4745 | coordsSet.client.y -= delta.y;
|
4746 | }
|
4747 |
|
4748 | rect.left -= rectDelta.left;
|
4749 | rect.right -= rectDelta.right;
|
4750 | rect.top -= rectDelta.top;
|
4751 | rect.bottom -= rectDelta.bottom;
|
4752 | }
|
4753 | }, {
|
4754 | key: "shouldDo",
|
4755 | value: function shouldDo(options, preEnd, phase, requireEndOnly) {
|
4756 | if (
|
4757 | !options || options.enabled === false ||
|
4758 | requireEndOnly && !options.endOnly ||
|
4759 | options.endOnly && !preEnd ||
|
4760 | phase === 'start' && !options.setStart) {
|
4761 | return false;
|
4762 | }
|
4763 |
|
4764 | return true;
|
4765 | }
|
4766 | }, {
|
4767 | key: "copyFrom",
|
4768 | value: function copyFrom(other) {
|
4769 | this.startOffset = other.startOffset;
|
4770 | this.startDelta = other.startDelta;
|
4771 | this.edges = other.edges;
|
4772 | this.states = other.states.map(function (s) {
|
4773 | return (0, _$clone_64.default)(s);
|
4774 | });
|
4775 | this.result = createResult((0, _$extend_67.default)({}, other.result.coords), (0, _$extend_67.default)({}, other.result.rect));
|
4776 | }
|
4777 | }, {
|
4778 | key: "destroy",
|
4779 | value: function destroy() {
|
4780 | for (var prop in this) {
|
4781 | this[prop] = null;
|
4782 | }
|
4783 | }
|
4784 | }]);
|
4785 |
|
4786 | return Modification;
|
4787 | }();
|
4788 |
|
4789 | _$Modification_33.default = Modification;
|
4790 |
|
4791 | function createResult(coords, rect) {
|
4792 | return {
|
4793 | rect: rect,
|
4794 | coords: coords,
|
4795 | delta: {
|
4796 | x: 0,
|
4797 | y: 0
|
4798 | },
|
4799 | rectDelta: {
|
4800 | left: 0,
|
4801 | right: 0,
|
4802 | top: 0,
|
4803 | bottom: 0
|
4804 | },
|
4805 | eventProps: [],
|
4806 | changed: true
|
4807 | };
|
4808 | }
|
4809 |
|
4810 | function getModifierList(interaction) {
|
4811 | var actionOptions = interaction.interactable.options[interaction.prepared.name];
|
4812 | var actionModifiers = actionOptions.modifiers;
|
4813 |
|
4814 | if (actionModifiers && actionModifiers.length) {
|
4815 | return actionModifiers;
|
4816 | }
|
4817 |
|
4818 | return ['snap', 'snapSize', 'snapEdges', 'restrict', 'restrictEdges', 'restrictSize'].map(function (type) {
|
4819 | var options = actionOptions[type];
|
4820 | return options && options.enabled && {
|
4821 | options: options,
|
4822 | methods: options._methods
|
4823 | };
|
4824 | }).filter(function (m) {
|
4825 | return !!m;
|
4826 | });
|
4827 | }
|
4828 |
|
4829 | function getRectOffset(rect, coords) {
|
4830 | return rect ? {
|
4831 | left: coords.x - rect.left,
|
4832 | top: coords.y - rect.top,
|
4833 | right: rect.right - coords.x,
|
4834 | bottom: rect.bottom - coords.y
|
4835 | } : {
|
4836 | left: 0,
|
4837 | top: 0,
|
4838 | right: 0,
|
4839 | bottom: 0
|
4840 | };
|
4841 | }
|
4842 |
|
4843 | var _$base_37 = {};
|
4844 | "use strict";
|
4845 |
|
4846 | Object.defineProperty(_$base_37, "__esModule", {
|
4847 | value: true
|
4848 | });
|
4849 | _$base_37.makeModifier = makeModifier;
|
4850 | _$base_37.addEventModifiers = addEventModifiers;
|
4851 | _$base_37.default = void 0;
|
4852 |
|
4853 |
|
4854 | ;
|
4855 |
|
4856 | function makeModifier(module, name) {
|
4857 | var defaults = module.defaults;
|
4858 | var methods = {
|
4859 | start: module.start,
|
4860 | set: module.set,
|
4861 | beforeEnd: module.beforeEnd,
|
4862 | stop: module.stop
|
4863 | };
|
4864 |
|
4865 | var modifier = function modifier(_options) {
|
4866 | var options = _options || {};
|
4867 | options.enabled = options.enabled !== false;
|
4868 |
|
4869 | for (var prop in defaults) {
|
4870 | if (!(prop in options)) {
|
4871 | ;
|
4872 | options[prop] = defaults[prop];
|
4873 | }
|
4874 | }
|
4875 |
|
4876 | var m = {
|
4877 | options: options,
|
4878 | methods: methods,
|
4879 | name: name,
|
4880 | enable: function enable() {
|
4881 | options.enabled = true;
|
4882 | return m;
|
4883 | },
|
4884 | disable: function disable() {
|
4885 | options.enabled = false;
|
4886 | return m;
|
4887 | }
|
4888 | };
|
4889 | return m;
|
4890 | };
|
4891 |
|
4892 | if (name && typeof name === 'string') {
|
4893 |
|
4894 | modifier._defaults = defaults;
|
4895 | modifier._methods = methods;
|
4896 | }
|
4897 |
|
4898 | return modifier;
|
4899 | }
|
4900 |
|
4901 | function addEventModifiers(_ref) {
|
4902 | var iEvent = _ref.iEvent,
|
4903 | interaction = _ref.interaction;
|
4904 | var result = interaction.modification.result;
|
4905 |
|
4906 | if (result) {
|
4907 | iEvent.modifiers = result.eventProps;
|
4908 | }
|
4909 | }
|
4910 |
|
4911 | var modifiersBase = {
|
4912 | id: 'modifiers/base',
|
4913 | before: ['actions'],
|
4914 | install: function install(scope) {
|
4915 | scope.defaults.perAction.modifiers = [];
|
4916 | },
|
4917 | listeners: {
|
4918 | 'interactions:new': function interactionsNew(_ref2) {
|
4919 | var interaction = _ref2.interaction;
|
4920 | interaction.modification = new _$Modification_33.default(interaction);
|
4921 | },
|
4922 | 'interactions:before-action-start': function interactionsBeforeActionStart(arg) {
|
4923 | var modification = arg.interaction.modification;
|
4924 | modification.start(arg, arg.interaction.coords.start.page);
|
4925 | arg.interaction.edges = modification.edges;
|
4926 | modification.applyToInteraction(arg);
|
4927 | },
|
4928 | 'interactions:before-action-move': function interactionsBeforeActionMove(arg) {
|
4929 | return arg.interaction.modification.setAndApply(arg);
|
4930 | },
|
4931 | 'interactions:before-action-end': function interactionsBeforeActionEnd(arg) {
|
4932 | return arg.interaction.modification.beforeEnd(arg);
|
4933 | },
|
4934 | 'interactions:action-start': addEventModifiers,
|
4935 | 'interactions:action-move': addEventModifiers,
|
4936 | 'interactions:action-end': addEventModifiers,
|
4937 | 'interactions:after-action-start': function interactionsAfterActionStart(arg) {
|
4938 | return arg.interaction.modification.restoreInteractionCoords(arg);
|
4939 | },
|
4940 | 'interactions:after-action-move': function interactionsAfterActionMove(arg) {
|
4941 | return arg.interaction.modification.restoreInteractionCoords(arg);
|
4942 | },
|
4943 | 'interactions:stop': function interactionsStop(arg) {
|
4944 | return arg.interaction.modification.stop(arg);
|
4945 | }
|
4946 | }
|
4947 | };
|
4948 | var ___default_37 = modifiersBase;
|
4949 | _$base_37.default = ___default_37;
|
4950 | var _$options_26 = {};
|
4951 | "use strict";
|
4952 |
|
4953 | Object.defineProperty(_$options_26, "__esModule", {
|
4954 | value: true
|
4955 | });
|
4956 | _$options_26.defaults = void 0;
|
4957 |
|
4958 |
|
4959 | var defaults = {
|
4960 | base: {
|
4961 | preventDefault: 'auto',
|
4962 | deltaSource: 'page'
|
4963 | },
|
4964 | perAction: {
|
4965 | enabled: false,
|
4966 | origin: {
|
4967 | x: 0,
|
4968 | y: 0
|
4969 | }
|
4970 | },
|
4971 | actions: {}
|
4972 | };
|
4973 | _$options_26.defaults = defaults;
|
4974 | var _$InteractEvent_15 = {};
|
4975 | "use strict";
|
4976 |
|
4977 | function ___typeof_15(obj) {
|
4978 | "@babel/helpers - typeof";
|
4979 |
|
4980 | if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
4981 | ___typeof_15 = function _typeof(obj) {
|
4982 | return typeof obj;
|
4983 | };
|
4984 | } else {
|
4985 | ___typeof_15 = function _typeof(obj) {
|
4986 | return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
4987 | };
|
4988 | }
|
4989 |
|
4990 | return ___typeof_15(obj);
|
4991 | }
|
4992 |
|
4993 | Object.defineProperty(_$InteractEvent_15, "__esModule", {
|
4994 | value: true
|
4995 | });
|
4996 | _$InteractEvent_15.InteractEvent = void 0;
|
4997 |
|
4998 |
|
4999 | ;
|
5000 |
|
5001 |
|
5002 | ;
|
5003 |
|
5004 |
|
5005 | ;
|
5006 |
|
5007 |
|
5008 | ;
|
5009 |
|
5010 |
|
5011 | ;
|
5012 |
|
5013 | function ___classCallCheck_15(instance, Constructor) {
|
5014 | if (!(instance instanceof Constructor)) {
|
5015 | throw new TypeError("Cannot call a class as a function");
|
5016 | }
|
5017 | }
|
5018 |
|
5019 | function ___defineProperties_15(target, props) {
|
5020 | for (var i = 0; i < props.length; i++) {
|
5021 | var descriptor = props[i];
|
5022 | descriptor.enumerable = descriptor.enumerable || false;
|
5023 | descriptor.configurable = true;
|
5024 | if ("value" in descriptor) descriptor.writable = true;
|
5025 | Object.defineProperty(target, descriptor.key, descriptor);
|
5026 | }
|
5027 | }
|
5028 |
|
5029 | function ___createClass_15(Constructor, protoProps, staticProps) {
|
5030 | if (protoProps) ___defineProperties_15(Constructor.prototype, protoProps);
|
5031 | if (staticProps) ___defineProperties_15(Constructor, staticProps);
|
5032 | return Constructor;
|
5033 | }
|
5034 |
|
5035 | function ___inherits_15(subClass, superClass) {
|
5036 | if (typeof superClass !== "function" && superClass !== null) {
|
5037 | throw new TypeError("Super expression must either be null or a function");
|
5038 | }
|
5039 |
|
5040 | subClass.prototype = Object.create(superClass && superClass.prototype, {
|
5041 | constructor: {
|
5042 | value: subClass,
|
5043 | writable: true,
|
5044 | configurable: true
|
5045 | }
|
5046 | });
|
5047 | if (superClass) ___setPrototypeOf_15(subClass, superClass);
|
5048 | }
|
5049 |
|
5050 | function ___setPrototypeOf_15(o, p) {
|
5051 | ___setPrototypeOf_15 = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
5052 | o.__proto__ = p;
|
5053 | return o;
|
5054 | };
|
5055 |
|
5056 | return ___setPrototypeOf_15(o, p);
|
5057 | }
|
5058 |
|
5059 | function ___createSuper_15(Derived) {
|
5060 | var hasNativeReflectConstruct = ___isNativeReflectConstruct_15();
|
5061 |
|
5062 | return function _createSuperInternal() {
|
5063 | var Super = ___getPrototypeOf_15(Derived),
|
5064 | result;
|
5065 |
|
5066 | if (hasNativeReflectConstruct) {
|
5067 | var NewTarget = ___getPrototypeOf_15(this).constructor;
|
5068 |
|
5069 | result = Reflect.construct(Super, arguments, NewTarget);
|
5070 | } else {
|
5071 | result = Super.apply(this, arguments);
|
5072 | }
|
5073 |
|
5074 | return ___possibleConstructorReturn_15(this, result);
|
5075 | };
|
5076 | }
|
5077 |
|
5078 | function ___possibleConstructorReturn_15(self, call) {
|
5079 | if (call && (___typeof_15(call) === "object" || typeof call === "function")) {
|
5080 | return call;
|
5081 | }
|
5082 |
|
5083 | return ___assertThisInitialized_15(self);
|
5084 | }
|
5085 |
|
5086 | function ___assertThisInitialized_15(self) {
|
5087 | if (self === void 0) {
|
5088 | throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
5089 | }
|
5090 |
|
5091 | return self;
|
5092 | }
|
5093 |
|
5094 | function ___isNativeReflectConstruct_15() {
|
5095 | if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
5096 | if (Reflect.construct.sham) return false;
|
5097 | if (typeof Proxy === "function") return true;
|
5098 |
|
5099 | try {
|
5100 | Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
5101 | return true;
|
5102 | } catch (e) {
|
5103 | return false;
|
5104 | }
|
5105 | }
|
5106 |
|
5107 | function ___getPrototypeOf_15(o) {
|
5108 | ___getPrototypeOf_15 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
5109 | return o.__proto__ || Object.getPrototypeOf(o);
|
5110 | };
|
5111 | return ___getPrototypeOf_15(o);
|
5112 | }
|
5113 |
|
5114 | function ___defineProperty_15(obj, key, value) {
|
5115 | if (key in obj) {
|
5116 | Object.defineProperty(obj, key, {
|
5117 | value: value,
|
5118 | enumerable: true,
|
5119 | configurable: true,
|
5120 | writable: true
|
5121 | });
|
5122 | } else {
|
5123 | obj[key] = value;
|
5124 | }
|
5125 |
|
5126 | return obj;
|
5127 | }
|
5128 |
|
5129 | var InteractEvent = function (_BaseEvent) {
|
5130 | ___inherits_15(InteractEvent, _BaseEvent);
|
5131 |
|
5132 | var _super = ___createSuper_15(InteractEvent);
|
5133 |
|
5134 |
|
5135 |
|
5136 |
|
5137 | function InteractEvent(interaction, event, actionName, phase, element, preEnd, type) {
|
5138 | var _this;
|
5139 |
|
5140 | ___classCallCheck_15(this, InteractEvent);
|
5141 |
|
5142 | _this = _super.call(this, interaction);
|
5143 |
|
5144 | ___defineProperty_15(___assertThisInitialized_15(_this), "target", void 0);
|
5145 |
|
5146 | ___defineProperty_15(___assertThisInitialized_15(_this), "currentTarget", void 0);
|
5147 |
|
5148 | ___defineProperty_15(___assertThisInitialized_15(_this), "relatedTarget", null);
|
5149 |
|
5150 | ___defineProperty_15(___assertThisInitialized_15(_this), "screenX", void 0);
|
5151 |
|
5152 | ___defineProperty_15(___assertThisInitialized_15(_this), "screenY", void 0);
|
5153 |
|
5154 | ___defineProperty_15(___assertThisInitialized_15(_this), "button", void 0);
|
5155 |
|
5156 | ___defineProperty_15(___assertThisInitialized_15(_this), "buttons", void 0);
|
5157 |
|
5158 | ___defineProperty_15(___assertThisInitialized_15(_this), "ctrlKey", void 0);
|
5159 |
|
5160 | ___defineProperty_15(___assertThisInitialized_15(_this), "shiftKey", void 0);
|
5161 |
|
5162 | ___defineProperty_15(___assertThisInitialized_15(_this), "altKey", void 0);
|
5163 |
|
5164 | ___defineProperty_15(___assertThisInitialized_15(_this), "metaKey", void 0);
|
5165 |
|
5166 | ___defineProperty_15(___assertThisInitialized_15(_this), "page", void 0);
|
5167 |
|
5168 | ___defineProperty_15(___assertThisInitialized_15(_this), "client", void 0);
|
5169 |
|
5170 | ___defineProperty_15(___assertThisInitialized_15(_this), "delta", void 0);
|
5171 |
|
5172 | ___defineProperty_15(___assertThisInitialized_15(_this), "rect", void 0);
|
5173 |
|
5174 | ___defineProperty_15(___assertThisInitialized_15(_this), "x0", void 0);
|
5175 |
|
5176 | ___defineProperty_15(___assertThisInitialized_15(_this), "y0", void 0);
|
5177 |
|
5178 | ___defineProperty_15(___assertThisInitialized_15(_this), "t0", void 0);
|
5179 |
|
5180 | ___defineProperty_15(___assertThisInitialized_15(_this), "dt", void 0);
|
5181 |
|
5182 | ___defineProperty_15(___assertThisInitialized_15(_this), "duration", void 0);
|
5183 |
|
5184 | ___defineProperty_15(___assertThisInitialized_15(_this), "clientX0", void 0);
|
5185 |
|
5186 | ___defineProperty_15(___assertThisInitialized_15(_this), "clientY0", void 0);
|
5187 |
|
5188 | ___defineProperty_15(___assertThisInitialized_15(_this), "velocity", void 0);
|
5189 |
|
5190 | ___defineProperty_15(___assertThisInitialized_15(_this), "speed", void 0);
|
5191 |
|
5192 | ___defineProperty_15(___assertThisInitialized_15(_this), "swipe", void 0);
|
5193 |
|
5194 | ___defineProperty_15(___assertThisInitialized_15(_this), "timeStamp", void 0);
|
5195 |
|
5196 | ___defineProperty_15(___assertThisInitialized_15(_this), "axes", void 0);
|
5197 |
|
5198 | ___defineProperty_15(___assertThisInitialized_15(_this), "preEnd", void 0);
|
5199 |
|
5200 | element = element || interaction.element;
|
5201 | var target = interaction.interactable;
|
5202 | var deltaSource = (target && target.options || _$options_26.defaults).deltaSource;
|
5203 | var origin = (0, _$getOriginXY_68.default)(target, element, actionName);
|
5204 | var starting = phase === 'start';
|
5205 | var ending = phase === 'end';
|
5206 | var prevEvent = starting ? ___assertThisInitialized_15(_this) : interaction.prevEvent;
|
5207 | var coords = starting ? interaction.coords.start : ending ? {
|
5208 | page: prevEvent.page,
|
5209 | client: prevEvent.client,
|
5210 | timeStamp: interaction.coords.cur.timeStamp
|
5211 | } : interaction.coords.cur;
|
5212 | _this.page = (0, _$extend_67.default)({}, coords.page);
|
5213 | _this.client = (0, _$extend_67.default)({}, coords.client);
|
5214 | _this.rect = (0, _$extend_67.default)({}, interaction.rect);
|
5215 | _this.timeStamp = coords.timeStamp;
|
5216 |
|
5217 | if (!ending) {
|
5218 | _this.page.x -= origin.x;
|
5219 | _this.page.y -= origin.y;
|
5220 | _this.client.x -= origin.x;
|
5221 | _this.client.y -= origin.y;
|
5222 | }
|
5223 |
|
5224 | _this.ctrlKey = event.ctrlKey;
|
5225 | _this.altKey = event.altKey;
|
5226 | _this.shiftKey = event.shiftKey;
|
5227 | _this.metaKey = event.metaKey;
|
5228 | _this.button = event.button;
|
5229 | _this.buttons = event.buttons;
|
5230 | _this.target = element;
|
5231 | _this.currentTarget = element;
|
5232 | _this.preEnd = preEnd;
|
5233 | _this.type = type || actionName + (phase || '');
|
5234 | _this.interactable = target;
|
5235 | _this.t0 = starting ? interaction.pointers[interaction.pointers.length - 1].downTime : prevEvent.t0;
|
5236 | _this.x0 = interaction.coords.start.page.x - origin.x;
|
5237 | _this.y0 = interaction.coords.start.page.y - origin.y;
|
5238 | _this.clientX0 = interaction.coords.start.client.x - origin.x;
|
5239 | _this.clientY0 = interaction.coords.start.client.y - origin.y;
|
5240 |
|
5241 | if (starting || ending) {
|
5242 | _this.delta = {
|
5243 | x: 0,
|
5244 | y: 0
|
5245 | };
|
5246 | } else {
|
5247 | _this.delta = {
|
5248 | x: _this[deltaSource].x - prevEvent[deltaSource].x,
|
5249 | y: _this[deltaSource].y - prevEvent[deltaSource].y
|
5250 | };
|
5251 | }
|
5252 |
|
5253 | _this.dt = interaction.coords.delta.timeStamp;
|
5254 | _this.duration = _this.timeStamp - _this.t0;
|
5255 |
|
5256 | _this.velocity = (0, _$extend_67.default)({}, interaction.coords.velocity[deltaSource]);
|
5257 | _this.speed = (0, _$hypot_69.default)(_this.velocity.x, _this.velocity.y);
|
5258 | _this.swipe = ending || phase === 'inertiastart' ? _this.getSwipe() : null;
|
5259 | return _this;
|
5260 | }
|
5261 |
|
5262 | ___createClass_15(InteractEvent, [{
|
5263 | key: "getSwipe",
|
5264 | value: function getSwipe() {
|
5265 | var interaction = this._interaction;
|
5266 |
|
5267 | if (interaction.prevEvent.speed < 600 || this.timeStamp - interaction.prevEvent.timeStamp > 150) {
|
5268 | return null;
|
5269 | }
|
5270 |
|
5271 | var angle = 180 * Math.atan2(interaction.prevEvent.velocityY, interaction.prevEvent.velocityX) / Math.PI;
|
5272 | var overlap = 22.5;
|
5273 |
|
5274 | if (angle < 0) {
|
5275 | angle += 360;
|
5276 | }
|
5277 |
|
5278 | var left = 135 - overlap <= angle && angle < 225 + overlap;
|
5279 | var up = 225 - overlap <= angle && angle < 315 + overlap;
|
5280 | var right = !left && (315 - overlap <= angle || angle < 45 + overlap);
|
5281 | var down = !up && 45 - overlap <= angle && angle < 135 + overlap;
|
5282 | return {
|
5283 | up: up,
|
5284 | down: down,
|
5285 | left: left,
|
5286 | right: right,
|
5287 | angle: angle,
|
5288 | speed: interaction.prevEvent.speed,
|
5289 | velocity: {
|
5290 | x: interaction.prevEvent.velocityX,
|
5291 | y: interaction.prevEvent.velocityY
|
5292 | }
|
5293 | };
|
5294 | }
|
5295 | }, {
|
5296 | key: "preventDefault",
|
5297 | value: function preventDefault() {}
|
5298 | |
5299 |
|
5300 |
|
5301 |
|
5302 | }, {
|
5303 | key: "stopImmediatePropagation",
|
5304 | value: function stopImmediatePropagation() {
|
5305 | this.immediatePropagationStopped = this.propagationStopped = true;
|
5306 | }
|
5307 | |
5308 |
|
5309 |
|
5310 |
|
5311 | }, {
|
5312 | key: "stopPropagation",
|
5313 | value: function stopPropagation() {
|
5314 | this.propagationStopped = true;
|
5315 | }
|
5316 | }]);
|
5317 |
|
5318 | return InteractEvent;
|
5319 | }(_$BaseEvent_13.BaseEvent);
|
5320 |
|
5321 |
|
5322 |
|
5323 | _$InteractEvent_15.InteractEvent = InteractEvent;
|
5324 | Object.defineProperties(InteractEvent.prototype, {
|
5325 | pageX: {
|
5326 | get: function get() {
|
5327 | return this.page.x;
|
5328 | },
|
5329 | set: function set(value) {
|
5330 | this.page.x = value;
|
5331 | }
|
5332 | },
|
5333 | pageY: {
|
5334 | get: function get() {
|
5335 | return this.page.y;
|
5336 | },
|
5337 | set: function set(value) {
|
5338 | this.page.y = value;
|
5339 | }
|
5340 | },
|
5341 | clientX: {
|
5342 | get: function get() {
|
5343 | return this.client.x;
|
5344 | },
|
5345 | set: function set(value) {
|
5346 | this.client.x = value;
|
5347 | }
|
5348 | },
|
5349 | clientY: {
|
5350 | get: function get() {
|
5351 | return this.client.y;
|
5352 | },
|
5353 | set: function set(value) {
|
5354 | this.client.y = value;
|
5355 | }
|
5356 | },
|
5357 | dx: {
|
5358 | get: function get() {
|
5359 | return this.delta.x;
|
5360 | },
|
5361 | set: function set(value) {
|
5362 | this.delta.x = value;
|
5363 | }
|
5364 | },
|
5365 | dy: {
|
5366 | get: function get() {
|
5367 | return this.delta.y;
|
5368 | },
|
5369 | set: function set(value) {
|
5370 | this.delta.y = value;
|
5371 | }
|
5372 | },
|
5373 | velocityX: {
|
5374 | get: function get() {
|
5375 | return this.velocity.x;
|
5376 | },
|
5377 | set: function set(value) {
|
5378 | this.velocity.x = value;
|
5379 | }
|
5380 | },
|
5381 | velocityY: {
|
5382 | get: function get() {
|
5383 | return this.velocity.y;
|
5384 | },
|
5385 | set: function set(value) {
|
5386 | this.velocity.y = value;
|
5387 | }
|
5388 | }
|
5389 | });
|
5390 | var _$PointerInfo_20 = {};
|
5391 | "use strict";
|
5392 |
|
5393 | Object.defineProperty(_$PointerInfo_20, "__esModule", {
|
5394 | value: true
|
5395 | });
|
5396 | _$PointerInfo_20.PointerInfo = void 0;
|
5397 |
|
5398 | function ___classCallCheck_20(instance, Constructor) {
|
5399 | if (!(instance instanceof Constructor)) {
|
5400 | throw new TypeError("Cannot call a class as a function");
|
5401 | }
|
5402 | }
|
5403 |
|
5404 | function ___defineProperty_20(obj, key, value) {
|
5405 | if (key in obj) {
|
5406 | Object.defineProperty(obj, key, {
|
5407 | value: value,
|
5408 | enumerable: true,
|
5409 | configurable: true,
|
5410 | writable: true
|
5411 | });
|
5412 | } else {
|
5413 | obj[key] = value;
|
5414 | }
|
5415 |
|
5416 | return obj;
|
5417 | }
|
5418 |
|
5419 | var PointerInfo = function PointerInfo(id, pointer, event, downTime, downTarget) {
|
5420 | ___classCallCheck_20(this, PointerInfo);
|
5421 |
|
5422 | ___defineProperty_20(this, "id", void 0);
|
5423 |
|
5424 | ___defineProperty_20(this, "pointer", void 0);
|
5425 |
|
5426 | ___defineProperty_20(this, "event", void 0);
|
5427 |
|
5428 | ___defineProperty_20(this, "downTime", void 0);
|
5429 |
|
5430 | ___defineProperty_20(this, "downTarget", void 0);
|
5431 |
|
5432 | this.id = id;
|
5433 | this.pointer = pointer;
|
5434 | this.event = event;
|
5435 | this.downTime = downTime;
|
5436 | this.downTarget = downTarget;
|
5437 | };
|
5438 |
|
5439 | _$PointerInfo_20.PointerInfo = PointerInfo;
|
5440 | var _$Interaction_19 = {};
|
5441 | "use strict";
|
5442 |
|
5443 | Object.defineProperty(_$Interaction_19, "__esModule", {
|
5444 | value: true
|
5445 | });
|
5446 | Object.defineProperty(_$Interaction_19, "PointerInfo", {
|
5447 | enumerable: true,
|
5448 | get: function get() {
|
5449 | return _$PointerInfo_20.PointerInfo;
|
5450 | }
|
5451 | });
|
5452 | _$Interaction_19.default = _$Interaction_19.Interaction = _$Interaction_19._ProxyMethods = _$Interaction_19._ProxyValues = void 0;
|
5453 |
|
5454 |
|
5455 | ;
|
5456 |
|
5457 |
|
5458 | ;
|
5459 |
|
5460 |
|
5461 | ;
|
5462 |
|
5463 |
|
5464 | ;
|
5465 |
|
5466 |
|
5467 | ;
|
5468 |
|
5469 |
|
5470 | ;
|
5471 |
|
5472 |
|
5473 | ;
|
5474 |
|
5475 |
|
5476 | ;
|
5477 |
|
5478 | function ___classCallCheck_19(instance, Constructor) {
|
5479 | if (!(instance instanceof Constructor)) {
|
5480 | throw new TypeError("Cannot call a class as a function");
|
5481 | }
|
5482 | }
|
5483 |
|
5484 | function ___defineProperties_19(target, props) {
|
5485 | for (var i = 0; i < props.length; i++) {
|
5486 | var descriptor = props[i];
|
5487 | descriptor.enumerable = descriptor.enumerable || false;
|
5488 | descriptor.configurable = true;
|
5489 | if ("value" in descriptor) descriptor.writable = true;
|
5490 | Object.defineProperty(target, descriptor.key, descriptor);
|
5491 | }
|
5492 | }
|
5493 |
|
5494 | function ___createClass_19(Constructor, protoProps, staticProps) {
|
5495 | if (protoProps) ___defineProperties_19(Constructor.prototype, protoProps);
|
5496 | if (staticProps) ___defineProperties_19(Constructor, staticProps);
|
5497 | return Constructor;
|
5498 | }
|
5499 |
|
5500 | function ___defineProperty_19(obj, key, value) {
|
5501 | if (key in obj) {
|
5502 | Object.defineProperty(obj, key, {
|
5503 | value: value,
|
5504 | enumerable: true,
|
5505 | configurable: true,
|
5506 | writable: true
|
5507 | });
|
5508 | } else {
|
5509 | obj[key] = value;
|
5510 | }
|
5511 |
|
5512 | return obj;
|
5513 | }
|
5514 |
|
5515 | var _ProxyValues;
|
5516 |
|
5517 | _$Interaction_19._ProxyValues = _ProxyValues;
|
5518 |
|
5519 | (function (_ProxyValues) {
|
5520 | _ProxyValues["interactable"] = "";
|
5521 | _ProxyValues["element"] = "";
|
5522 | _ProxyValues["prepared"] = "";
|
5523 | _ProxyValues["pointerIsDown"] = "";
|
5524 | _ProxyValues["pointerWasMoved"] = "";
|
5525 | _ProxyValues["_proxy"] = "";
|
5526 | })(_ProxyValues || (_$Interaction_19._ProxyValues = _ProxyValues = {}));
|
5527 |
|
5528 | var _ProxyMethods;
|
5529 |
|
5530 | _$Interaction_19._ProxyMethods = _ProxyMethods;
|
5531 |
|
5532 | (function (_ProxyMethods) {
|
5533 | _ProxyMethods["start"] = "";
|
5534 | _ProxyMethods["move"] = "";
|
5535 | _ProxyMethods["end"] = "";
|
5536 | _ProxyMethods["stop"] = "";
|
5537 | _ProxyMethods["interacting"] = "";
|
5538 | })(_ProxyMethods || (_$Interaction_19._ProxyMethods = _ProxyMethods = {}));
|
5539 |
|
5540 | var idCounter = 0;
|
5541 |
|
5542 | var Interaction = function () {
|
5543 |
|
5544 | function Interaction(_ref) {
|
5545 | var _this = this;
|
5546 |
|
5547 | var pointerType = _ref.pointerType,
|
5548 | scopeFire = _ref.scopeFire;
|
5549 |
|
5550 | ___classCallCheck_19(this, Interaction);
|
5551 |
|
5552 | ___defineProperty_19(this, "interactable", null);
|
5553 |
|
5554 | ___defineProperty_19(this, "element", null);
|
5555 |
|
5556 | ___defineProperty_19(this, "rect", void 0);
|
5557 |
|
5558 | ___defineProperty_19(this, "_rects", void 0);
|
5559 |
|
5560 | ___defineProperty_19(this, "edges", void 0);
|
5561 |
|
5562 | ___defineProperty_19(this, "_scopeFire", void 0);
|
5563 |
|
5564 | ___defineProperty_19(this, "prepared", {
|
5565 | name: null,
|
5566 | axis: null,
|
5567 | edges: null
|
5568 | });
|
5569 |
|
5570 | ___defineProperty_19(this, "pointerType", void 0);
|
5571 |
|
5572 | ___defineProperty_19(this, "pointers", []);
|
5573 |
|
5574 | ___defineProperty_19(this, "downEvent", null);
|
5575 |
|
5576 | ___defineProperty_19(this, "downPointer", {});
|
5577 |
|
5578 | ___defineProperty_19(this, "_latestPointer", {
|
5579 | pointer: null,
|
5580 | event: null,
|
5581 | eventTarget: null
|
5582 | });
|
5583 |
|
5584 | ___defineProperty_19(this, "prevEvent", null);
|
5585 |
|
5586 | ___defineProperty_19(this, "pointerIsDown", false);
|
5587 |
|
5588 | ___defineProperty_19(this, "pointerWasMoved", false);
|
5589 |
|
5590 | ___defineProperty_19(this, "_interacting", false);
|
5591 |
|
5592 | ___defineProperty_19(this, "_ending", false);
|
5593 |
|
5594 | ___defineProperty_19(this, "_stopped", true);
|
5595 |
|
5596 | ___defineProperty_19(this, "_proxy", null);
|
5597 |
|
5598 | ___defineProperty_19(this, "simulation", null);
|
5599 |
|
5600 | ___defineProperty_19(this, "doMove", (0, _$misc_72.warnOnce)(function (signalArg) {
|
5601 | this.move(signalArg);
|
5602 | }, 'The interaction.doMove() method has been renamed to interaction.move()'));
|
5603 |
|
5604 | ___defineProperty_19(this, "coords", {
|
5605 |
|
5606 | start: _$pointerUtils_75.newCoords(),
|
5607 |
|
5608 | prev: _$pointerUtils_75.newCoords(),
|
5609 |
|
5610 | cur: _$pointerUtils_75.newCoords(),
|
5611 |
|
5612 | delta: _$pointerUtils_75.newCoords(),
|
5613 |
|
5614 | velocity: _$pointerUtils_75.newCoords()
|
5615 | });
|
5616 |
|
5617 | ___defineProperty_19(this, "_id", idCounter++);
|
5618 |
|
5619 | this._scopeFire = scopeFire;
|
5620 | this.pointerType = pointerType;
|
5621 | var that = this;
|
5622 | this._proxy = {};
|
5623 |
|
5624 | var _loop = function _loop(key) {
|
5625 | Object.defineProperty(_this._proxy, key, {
|
5626 | get: function get() {
|
5627 | return that[key];
|
5628 | }
|
5629 | });
|
5630 | };
|
5631 |
|
5632 | for (var key in _ProxyValues) {
|
5633 | _loop(key);
|
5634 | }
|
5635 |
|
5636 | var _loop2 = function _loop2(_key) {
|
5637 | Object.defineProperty(_this._proxy, _key, {
|
5638 | value: function value() {
|
5639 | return that[_key].apply(that, arguments);
|
5640 | }
|
5641 | });
|
5642 | };
|
5643 |
|
5644 | for (var _key in _ProxyMethods) {
|
5645 | _loop2(_key);
|
5646 | }
|
5647 |
|
5648 | this._scopeFire('interactions:new', {
|
5649 | interaction: this
|
5650 | });
|
5651 | }
|
5652 |
|
5653 | ___createClass_19(Interaction, [{
|
5654 | key: "pointerMoveTolerance",
|
5655 | get: // current interactable being interacted with
|
5656 | // the target element of the interactable
|
5657 | // action that's ready to be fired on next move event
|
5658 | // keep track of added pointers
|
5659 | // pointerdown/mousedown/touchstart event
|
5660 | // previous action event
|
5661 |
|
5662 | /** @internal */
|
5663 | function get() {
|
5664 | return 1;
|
5665 | }
|
5666 | |
5667 |
|
5668 |
|
5669 |
|
5670 | }, {
|
5671 | key: "pointerDown",
|
5672 | value: function pointerDown(pointer, event, eventTarget) {
|
5673 | var pointerIndex = this.updatePointer(pointer, event, eventTarget, true);
|
5674 | var pointerInfo = this.pointers[pointerIndex];
|
5675 |
|
5676 | this._scopeFire('interactions:down', {
|
5677 | pointer: pointer,
|
5678 | event: event,
|
5679 | eventTarget: eventTarget,
|
5680 | pointerIndex: pointerIndex,
|
5681 | pointerInfo: pointerInfo,
|
5682 | type: 'down',
|
5683 | interaction: this
|
5684 | });
|
5685 | }
|
5686 | |
5687 |
|
5688 |
|
5689 |
|
5690 |
|
5691 |
|
5692 |
|
5693 |
|
5694 |
|
5695 |
|
5696 |
|
5697 |
|
5698 |
|
5699 |
|
5700 |
|
5701 |
|
5702 |
|
5703 |
|
5704 |
|
5705 |
|
5706 |
|
5707 |
|
5708 |
|
5709 |
|
5710 |
|
5711 |
|
5712 |
|
5713 |
|
5714 |
|
5715 |
|
5716 |
|
5717 |
|
5718 | }, {
|
5719 | key: "start",
|
5720 | value: function start(action, interactable, element) {
|
5721 | if (this.interacting() || !this.pointerIsDown || this.pointers.length < (action.name === 'gesture' ? 2 : 1) || !interactable.options[action.name].enabled) {
|
5722 | return false;
|
5723 | }
|
5724 |
|
5725 | (0, _$misc_72.copyAction)(this.prepared, action);
|
5726 | this.interactable = interactable;
|
5727 | this.element = element;
|
5728 | this.rect = interactable.getRect(element);
|
5729 | this.edges = this.prepared.edges ? (0, _$extend_67.default)({}, this.prepared.edges) : {
|
5730 | left: true,
|
5731 | right: true,
|
5732 | top: true,
|
5733 | bottom: true
|
5734 | };
|
5735 | this._stopped = false;
|
5736 | this._interacting = this._doPhase({
|
5737 | interaction: this,
|
5738 | event: this.downEvent,
|
5739 | phase: 'start'
|
5740 | }) && !this._stopped;
|
5741 | return this._interacting;
|
5742 | }
|
5743 | }, {
|
5744 | key: "pointerMove",
|
5745 | value: function pointerMove(pointer, event, eventTarget) {
|
5746 | if (!this.simulation && !(this.modification && this.modification.endResult)) {
|
5747 | this.updatePointer(pointer, event, eventTarget, false);
|
5748 | }
|
5749 |
|
5750 | 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;
|
5751 | var dx;
|
5752 | var dy;
|
5753 |
|
5754 | if (this.pointerIsDown && !this.pointerWasMoved) {
|
5755 | dx = this.coords.cur.client.x - this.coords.start.client.x;
|
5756 | dy = this.coords.cur.client.y - this.coords.start.client.y;
|
5757 | this.pointerWasMoved = (0, _$hypot_69.default)(dx, dy) > this.pointerMoveTolerance;
|
5758 | }
|
5759 |
|
5760 | var pointerIndex = this.getPointerIndex(pointer);
|
5761 | var signalArg = {
|
5762 | pointer: pointer,
|
5763 | pointerIndex: pointerIndex,
|
5764 | pointerInfo: this.pointers[pointerIndex],
|
5765 | event: event,
|
5766 | type: 'move',
|
5767 | eventTarget: eventTarget,
|
5768 | dx: dx,
|
5769 | dy: dy,
|
5770 | duplicate: duplicateMove,
|
5771 | interaction: this
|
5772 | };
|
5773 |
|
5774 | if (!duplicateMove) {
|
5775 |
|
5776 | _$pointerUtils_75.setCoordVelocity(this.coords.velocity, this.coords.delta);
|
5777 | }
|
5778 |
|
5779 | this._scopeFire('interactions:move', signalArg);
|
5780 |
|
5781 | if (!duplicateMove && !this.simulation) {
|
5782 |
|
5783 | if (this.interacting()) {
|
5784 | signalArg.type = null;
|
5785 | this.move(signalArg);
|
5786 | }
|
5787 |
|
5788 | if (this.pointerWasMoved) {
|
5789 | _$pointerUtils_75.copyCoords(this.coords.prev, this.coords.cur);
|
5790 | }
|
5791 | }
|
5792 | }
|
5793 | |
5794 |
|
5795 |
|
5796 |
|
5797 |
|
5798 |
|
5799 |
|
5800 |
|
5801 |
|
5802 |
|
5803 |
|
5804 |
|
5805 |
|
5806 |
|
5807 |
|
5808 |
|
5809 |
|
5810 |
|
5811 |
|
5812 | }, {
|
5813 | key: "move",
|
5814 | value: function move(signalArg) {
|
5815 | if (!signalArg || !signalArg.event) {
|
5816 | _$pointerUtils_75.setZeroCoords(this.coords.delta);
|
5817 | }
|
5818 |
|
5819 | signalArg = (0, _$extend_67.default)({
|
5820 | pointer: this._latestPointer.pointer,
|
5821 | event: this._latestPointer.event,
|
5822 | eventTarget: this._latestPointer.eventTarget,
|
5823 | interaction: this
|
5824 | }, signalArg || {});
|
5825 | signalArg.phase = 'move';
|
5826 |
|
5827 | this._doPhase(signalArg);
|
5828 | }
|
5829 |
|
5830 | }, {
|
5831 | key: "pointerUp",
|
5832 | value: function pointerUp(pointer, event, eventTarget, curEventTarget) {
|
5833 | var pointerIndex = this.getPointerIndex(pointer);
|
5834 |
|
5835 | if (pointerIndex === -1) {
|
5836 | pointerIndex = this.updatePointer(pointer, event, eventTarget, false);
|
5837 | }
|
5838 |
|
5839 | var type = /cancel$/i.test(event.type) ? 'cancel' : 'up';
|
5840 |
|
5841 | this._scopeFire("interactions:".concat(type), {
|
5842 | pointer: pointer,
|
5843 | pointerIndex: pointerIndex,
|
5844 | pointerInfo: this.pointers[pointerIndex],
|
5845 | event: event,
|
5846 | eventTarget: eventTarget,
|
5847 | type: type,
|
5848 | curEventTarget: curEventTarget,
|
5849 | interaction: this
|
5850 | });
|
5851 |
|
5852 | if (!this.simulation) {
|
5853 | this.end(event);
|
5854 | }
|
5855 |
|
5856 | this.removePointer(pointer, event);
|
5857 | }
|
5858 | }, {
|
5859 | key: "documentBlur",
|
5860 | value: function documentBlur(event) {
|
5861 | this.end(event);
|
5862 |
|
5863 | this._scopeFire('interactions:blur', {
|
5864 | event: event,
|
5865 | type: 'blur',
|
5866 | interaction: this
|
5867 | });
|
5868 | }
|
5869 | |
5870 |
|
5871 |
|
5872 |
|
5873 |
|
5874 |
|
5875 |
|
5876 |
|
5877 |
|
5878 |
|
5879 |
|
5880 |
|
5881 |
|
5882 |
|
5883 |
|
5884 |
|
5885 |
|
5886 | }, {
|
5887 | key: "end",
|
5888 | value: function end(event) {
|
5889 | this._ending = true;
|
5890 | event = event || this._latestPointer.event;
|
5891 | var endPhaseResult;
|
5892 |
|
5893 | if (this.interacting()) {
|
5894 | endPhaseResult = this._doPhase({
|
5895 | event: event,
|
5896 | interaction: this,
|
5897 | phase: 'end'
|
5898 | });
|
5899 | }
|
5900 |
|
5901 | this._ending = false;
|
5902 |
|
5903 | if (endPhaseResult === true) {
|
5904 | this.stop();
|
5905 | }
|
5906 | }
|
5907 | }, {
|
5908 | key: "currentAction",
|
5909 | value: function currentAction() {
|
5910 | return this._interacting ? this.prepared.name : null;
|
5911 | }
|
5912 | }, {
|
5913 | key: "interacting",
|
5914 | value: function interacting() {
|
5915 | return this._interacting;
|
5916 | }
|
5917 |
|
5918 |
|
5919 | }, {
|
5920 | key: "stop",
|
5921 | value: function stop() {
|
5922 | this._scopeFire('interactions:stop', {
|
5923 | interaction: this
|
5924 | });
|
5925 |
|
5926 | this.interactable = this.element = null;
|
5927 | this._interacting = false;
|
5928 | this._stopped = true;
|
5929 | this.prepared.name = this.prevEvent = null;
|
5930 | }
|
5931 | }, {
|
5932 | key: "getPointerIndex",
|
5933 | value: function getPointerIndex(pointer) {
|
5934 | var pointerId = _$pointerUtils_75.getPointerId(pointer);
|
5935 |
|
5936 |
|
5937 | return this.pointerType === 'mouse' || this.pointerType === 'pen' ? this.pointers.length - 1 : _$arr_62.findIndex(this.pointers, function (curPointer) {
|
5938 | return curPointer.id === pointerId;
|
5939 | });
|
5940 | }
|
5941 | }, {
|
5942 | key: "getPointerInfo",
|
5943 | value: function getPointerInfo(pointer) {
|
5944 | return this.pointers[this.getPointerIndex(pointer)];
|
5945 | }
|
5946 | }, {
|
5947 | key: "updatePointer",
|
5948 | value: function updatePointer(pointer, event, eventTarget, down) {
|
5949 | var id = _$pointerUtils_75.getPointerId(pointer);
|
5950 |
|
5951 | var pointerIndex = this.getPointerIndex(pointer);
|
5952 | var pointerInfo = this.pointers[pointerIndex];
|
5953 | down = down === false ? false : down || /(down|start)$/i.test(event.type);
|
5954 |
|
5955 | if (!pointerInfo) {
|
5956 | pointerInfo = new _$PointerInfo_20.PointerInfo(id, pointer, event, null, null);
|
5957 | pointerIndex = this.pointers.length;
|
5958 | this.pointers.push(pointerInfo);
|
5959 | } else {
|
5960 | pointerInfo.pointer = pointer;
|
5961 | }
|
5962 |
|
5963 | _$pointerUtils_75.setCoords(this.coords.cur, this.pointers.map(function (p) {
|
5964 | return p.pointer;
|
5965 | }), this._now());
|
5966 |
|
5967 | _$pointerUtils_75.setCoordDeltas(this.coords.delta, this.coords.prev, this.coords.cur);
|
5968 |
|
5969 | if (down) {
|
5970 | this.pointerIsDown = true;
|
5971 | pointerInfo.downTime = this.coords.cur.timeStamp;
|
5972 | pointerInfo.downTarget = eventTarget;
|
5973 |
|
5974 | _$pointerUtils_75.pointerExtend(this.downPointer, pointer);
|
5975 |
|
5976 | if (!this.interacting()) {
|
5977 | _$pointerUtils_75.copyCoords(this.coords.start, this.coords.cur);
|
5978 |
|
5979 | _$pointerUtils_75.copyCoords(this.coords.prev, this.coords.cur);
|
5980 |
|
5981 | this.downEvent = event;
|
5982 | this.pointerWasMoved = false;
|
5983 | }
|
5984 | }
|
5985 |
|
5986 | this._updateLatestPointer(pointer, event, eventTarget);
|
5987 |
|
5988 | this._scopeFire('interactions:update-pointer', {
|
5989 | pointer: pointer,
|
5990 | event: event,
|
5991 | eventTarget: eventTarget,
|
5992 | down: down,
|
5993 | pointerInfo: pointerInfo,
|
5994 | pointerIndex: pointerIndex,
|
5995 | interaction: this
|
5996 | });
|
5997 |
|
5998 | return pointerIndex;
|
5999 | }
|
6000 | }, {
|
6001 | key: "removePointer",
|
6002 | value: function removePointer(pointer, event) {
|
6003 | var pointerIndex = this.getPointerIndex(pointer);
|
6004 | if (pointerIndex === -1) return;
|
6005 | var pointerInfo = this.pointers[pointerIndex];
|
6006 |
|
6007 | this._scopeFire('interactions:remove-pointer', {
|
6008 | pointer: pointer,
|
6009 | event: event,
|
6010 | eventTarget: null,
|
6011 | pointerIndex: pointerIndex,
|
6012 | pointerInfo: pointerInfo,
|
6013 | interaction: this
|
6014 | });
|
6015 |
|
6016 | this.pointers.splice(pointerIndex, 1);
|
6017 | this.pointerIsDown = false;
|
6018 | }
|
6019 | }, {
|
6020 | key: "_updateLatestPointer",
|
6021 | value: function _updateLatestPointer(pointer, event, eventTarget) {
|
6022 | this._latestPointer.pointer = pointer;
|
6023 | this._latestPointer.event = event;
|
6024 | this._latestPointer.eventTarget = eventTarget;
|
6025 | }
|
6026 | }, {
|
6027 | key: "destroy",
|
6028 | value: function destroy() {
|
6029 | this._latestPointer.pointer = null;
|
6030 | this._latestPointer.event = null;
|
6031 | this._latestPointer.eventTarget = null;
|
6032 | }
|
6033 | }, {
|
6034 | key: "_createPreparedEvent",
|
6035 | value: function _createPreparedEvent(event, phase, preEnd, type) {
|
6036 | return new _$InteractEvent_15.InteractEvent(this, event, this.prepared.name, phase, this.element, preEnd, type);
|
6037 | }
|
6038 | }, {
|
6039 | key: "_fireEvent",
|
6040 | value: function _fireEvent(iEvent) {
|
6041 | this.interactable.fire(iEvent);
|
6042 |
|
6043 | if (!this.prevEvent || iEvent.timeStamp >= this.prevEvent.timeStamp) {
|
6044 | this.prevEvent = iEvent;
|
6045 | }
|
6046 | }
|
6047 | }, {
|
6048 | key: "_doPhase",
|
6049 | value: function _doPhase(signalArg) {
|
6050 | var event = signalArg.event,
|
6051 | phase = signalArg.phase,
|
6052 | preEnd = signalArg.preEnd,
|
6053 | type = signalArg.type;
|
6054 | var rect = this.rect;
|
6055 |
|
6056 | if (rect && phase === 'move') {
|
6057 |
|
6058 | _$rect_77.addEdges(this.edges, rect, this.coords.delta[this.interactable.options.deltaSource]);
|
6059 |
|
6060 | rect.width = rect.right - rect.left;
|
6061 | rect.height = rect.bottom - rect.top;
|
6062 | }
|
6063 |
|
6064 | var beforeResult = this._scopeFire("interactions:before-action-".concat(phase), signalArg);
|
6065 |
|
6066 | if (beforeResult === false) {
|
6067 | return false;
|
6068 | }
|
6069 |
|
6070 | var iEvent = signalArg.iEvent = this._createPreparedEvent(event, phase, preEnd, type);
|
6071 |
|
6072 | this._scopeFire("interactions:action-".concat(phase), signalArg);
|
6073 |
|
6074 | if (phase === 'start') {
|
6075 | this.prevEvent = iEvent;
|
6076 | }
|
6077 |
|
6078 | this._fireEvent(iEvent);
|
6079 |
|
6080 | this._scopeFire("interactions:after-action-".concat(phase), signalArg);
|
6081 |
|
6082 | return true;
|
6083 | }
|
6084 | }, {
|
6085 | key: "_now",
|
6086 | value: function _now() {
|
6087 | return Date.now();
|
6088 | }
|
6089 | }]);
|
6090 |
|
6091 | return Interaction;
|
6092 | }();
|
6093 |
|
6094 | _$Interaction_19.Interaction = Interaction;
|
6095 | var ___default_19 = Interaction;
|
6096 | _$Interaction_19.default = ___default_19;
|
6097 | var _$plugin_50 = {};
|
6098 | "use strict";
|
6099 |
|
6100 | Object.defineProperty(_$plugin_50, "__esModule", {
|
6101 | value: true
|
6102 | });
|
6103 | _$plugin_50.addTotal = addTotal;
|
6104 | _$plugin_50.applyPending = applyPending;
|
6105 | _$plugin_50.default = void 0;
|
6106 |
|
6107 |
|
6108 | ;
|
6109 |
|
6110 |
|
6111 | ;
|
6112 | ;
|
6113 | _$Interaction_19._ProxyMethods.offsetBy = '';
|
6114 |
|
6115 | function addTotal(interaction) {
|
6116 | if (!interaction.pointerIsDown) {
|
6117 | return;
|
6118 | }
|
6119 |
|
6120 | addToCoords(interaction.coords.cur, interaction.offset.total);
|
6121 | interaction.offset.pending.x = 0;
|
6122 | interaction.offset.pending.y = 0;
|
6123 | }
|
6124 |
|
6125 | function beforeAction(_ref) {
|
6126 | var interaction = _ref.interaction;
|
6127 | applyPending(interaction);
|
6128 | }
|
6129 |
|
6130 | function beforeEnd(_ref2) {
|
6131 | var interaction = _ref2.interaction;
|
6132 | var hadPending = applyPending(interaction);
|
6133 | if (!hadPending) return;
|
6134 | interaction.move({
|
6135 | offset: true
|
6136 | });
|
6137 | interaction.end();
|
6138 | return false;
|
6139 | }
|
6140 |
|
6141 | function __end_50(_ref3) {
|
6142 | var interaction = _ref3.interaction;
|
6143 | interaction.offset.total.x = 0;
|
6144 | interaction.offset.total.y = 0;
|
6145 | interaction.offset.pending.x = 0;
|
6146 | interaction.offset.pending.y = 0;
|
6147 | }
|
6148 |
|
6149 | function applyPending(interaction) {
|
6150 | if (!hasPending(interaction)) {
|
6151 | return false;
|
6152 | }
|
6153 |
|
6154 | var pending = interaction.offset.pending;
|
6155 | addToCoords(interaction.coords.cur, pending);
|
6156 | addToCoords(interaction.coords.delta, pending);
|
6157 |
|
6158 | _$rect_77.addEdges(interaction.edges, interaction.rect, pending);
|
6159 |
|
6160 | pending.x = 0;
|
6161 | pending.y = 0;
|
6162 | return true;
|
6163 | }
|
6164 |
|
6165 | function offsetBy(_ref4) {
|
6166 | var x = _ref4.x,
|
6167 | y = _ref4.y;
|
6168 | this.offset.pending.x += x;
|
6169 | this.offset.pending.y += y;
|
6170 | this.offset.total.x += x;
|
6171 | this.offset.total.y += y;
|
6172 | }
|
6173 |
|
6174 | function addToCoords(_ref5, _ref6) {
|
6175 | var page = _ref5.page,
|
6176 | client = _ref5.client;
|
6177 | var x = _ref6.x,
|
6178 | y = _ref6.y;
|
6179 | page.x += x;
|
6180 | page.y += y;
|
6181 | client.x += x;
|
6182 | client.y += y;
|
6183 | }
|
6184 |
|
6185 | function hasPending(interaction) {
|
6186 | return !!(interaction.offset.pending.x || interaction.offset.pending.y);
|
6187 | }
|
6188 |
|
6189 | var offset = {
|
6190 | id: 'offset',
|
6191 | before: ['modifiers', 'pointer-events', 'actions', 'inertia'],
|
6192 | install: function install(scope) {
|
6193 | scope.Interaction.prototype.offsetBy = offsetBy;
|
6194 | },
|
6195 | listeners: {
|
6196 | 'interactions:new': function interactionsNew(_ref7) {
|
6197 | var interaction = _ref7.interaction;
|
6198 | interaction.offset = {
|
6199 | total: {
|
6200 | x: 0,
|
6201 | y: 0
|
6202 | },
|
6203 | pending: {
|
6204 | x: 0,
|
6205 | y: 0
|
6206 | }
|
6207 | };
|
6208 | },
|
6209 | 'interactions:update-pointer': function interactionsUpdatePointer(_ref8) {
|
6210 | var interaction = _ref8.interaction;
|
6211 | return addTotal(interaction);
|
6212 | },
|
6213 | 'interactions:before-action-start': beforeAction,
|
6214 | 'interactions:before-action-move': beforeAction,
|
6215 | 'interactions:before-action-end': beforeEnd,
|
6216 | 'interactions:stop': __end_50
|
6217 | }
|
6218 | };
|
6219 | var ___default_50 = offset;
|
6220 | _$plugin_50.default = ___default_50;
|
6221 | var _$plugin_30 = {};
|
6222 | "use strict";
|
6223 |
|
6224 | Object.defineProperty(_$plugin_30, "__esModule", {
|
6225 | value: true
|
6226 | });
|
6227 | _$plugin_30.default = _$plugin_30.InertiaState = void 0;
|
6228 |
|
6229 |
|
6230 | ;
|
6231 |
|
6232 |
|
6233 | ;
|
6234 |
|
6235 |
|
6236 | ;
|
6237 |
|
6238 |
|
6239 | ;
|
6240 |
|
6241 |
|
6242 | ;
|
6243 |
|
6244 |
|
6245 | ;
|
6246 |
|
6247 |
|
6248 | ;
|
6249 |
|
6250 |
|
6251 | ;
|
6252 |
|
6253 | function ___classCallCheck_30(instance, Constructor) {
|
6254 | if (!(instance instanceof Constructor)) {
|
6255 | throw new TypeError("Cannot call a class as a function");
|
6256 | }
|
6257 | }
|
6258 |
|
6259 | function ___defineProperties_30(target, props) {
|
6260 | for (var i = 0; i < props.length; i++) {
|
6261 | var descriptor = props[i];
|
6262 | descriptor.enumerable = descriptor.enumerable || false;
|
6263 | descriptor.configurable = true;
|
6264 | if ("value" in descriptor) descriptor.writable = true;
|
6265 | Object.defineProperty(target, descriptor.key, descriptor);
|
6266 | }
|
6267 | }
|
6268 |
|
6269 | function ___createClass_30(Constructor, protoProps, staticProps) {
|
6270 | if (protoProps) ___defineProperties_30(Constructor.prototype, protoProps);
|
6271 | if (staticProps) ___defineProperties_30(Constructor, staticProps);
|
6272 | return Constructor;
|
6273 | }
|
6274 |
|
6275 | function ___defineProperty_30(obj, key, value) {
|
6276 | if (key in obj) {
|
6277 | Object.defineProperty(obj, key, {
|
6278 | value: value,
|
6279 | enumerable: true,
|
6280 | configurable: true,
|
6281 | writable: true
|
6282 | });
|
6283 | } else {
|
6284 | obj[key] = value;
|
6285 | }
|
6286 |
|
6287 | return obj;
|
6288 | }
|
6289 |
|
6290 | function __install_30(scope) {
|
6291 | var defaults = scope.defaults;
|
6292 | scope.usePlugin(_$plugin_50.default);
|
6293 | scope.usePlugin(_$base_37.default);
|
6294 | scope.actions.phases.inertiastart = true;
|
6295 | scope.actions.phases.resume = true;
|
6296 | defaults.perAction.inertia = {
|
6297 | enabled: false,
|
6298 | resistance: 10,
|
6299 |
|
6300 | minSpeed: 100,
|
6301 |
|
6302 | endSpeed: 10,
|
6303 |
|
6304 | allowResume: true,
|
6305 |
|
6306 | smoothEndDuration: 300
|
6307 |
|
6308 | };
|
6309 | }
|
6310 |
|
6311 | var InertiaState = function () {
|
6312 |
|
6313 |
|
6314 | function InertiaState(interaction) {
|
6315 | ___classCallCheck_30(this, InertiaState);
|
6316 |
|
6317 | ___defineProperty_30(this, "active", false);
|
6318 |
|
6319 | ___defineProperty_30(this, "isModified", false);
|
6320 |
|
6321 | ___defineProperty_30(this, "smoothEnd", false);
|
6322 |
|
6323 | ___defineProperty_30(this, "allowResume", false);
|
6324 |
|
6325 | ___defineProperty_30(this, "modification", void 0);
|
6326 |
|
6327 | ___defineProperty_30(this, "modifierCount", 0);
|
6328 |
|
6329 | ___defineProperty_30(this, "modifierArg", void 0);
|
6330 |
|
6331 | ___defineProperty_30(this, "startCoords", void 0);
|
6332 |
|
6333 | ___defineProperty_30(this, "t0", 0);
|
6334 |
|
6335 | ___defineProperty_30(this, "v0", 0);
|
6336 |
|
6337 | ___defineProperty_30(this, "te", 0);
|
6338 |
|
6339 | ___defineProperty_30(this, "targetOffset", void 0);
|
6340 |
|
6341 | ___defineProperty_30(this, "modifiedOffset", void 0);
|
6342 |
|
6343 | ___defineProperty_30(this, "currentOffset", void 0);
|
6344 |
|
6345 | ___defineProperty_30(this, "lambda_v0", 0);
|
6346 |
|
6347 | ___defineProperty_30(this, "one_ve_v0", 0);
|
6348 |
|
6349 | ___defineProperty_30(this, "timeout", void 0);
|
6350 |
|
6351 | ___defineProperty_30(this, "interaction", void 0);
|
6352 |
|
6353 | this.interaction = interaction;
|
6354 | }
|
6355 |
|
6356 | ___createClass_30(InertiaState, [{
|
6357 | key: "start",
|
6358 | value: function start(event) {
|
6359 | var interaction = this.interaction;
|
6360 | var options = getOptions(interaction);
|
6361 |
|
6362 | if (!options || !options.enabled) {
|
6363 | return false;
|
6364 | }
|
6365 |
|
6366 | var velocityClient = interaction.coords.velocity.client;
|
6367 | var pointerSpeed = (0, _$hypot_69.default)(velocityClient.x, velocityClient.y);
|
6368 | var modification = this.modification || (this.modification = new _$Modification_33.default(interaction));
|
6369 | modification.copyFrom(interaction.modification);
|
6370 | this.t0 = interaction._now();
|
6371 | this.allowResume = options.allowResume;
|
6372 | this.v0 = pointerSpeed;
|
6373 | this.currentOffset = {
|
6374 | x: 0,
|
6375 | y: 0
|
6376 | };
|
6377 | this.startCoords = interaction.coords.cur.page;
|
6378 | this.modifierArg = modification.fillArg({
|
6379 | pageCoords: this.startCoords,
|
6380 | preEnd: true,
|
6381 | phase: 'inertiastart'
|
6382 | });
|
6383 | var thrown = this.t0 - interaction.coords.cur.timeStamp < 50 && pointerSpeed > options.minSpeed && pointerSpeed > options.endSpeed;
|
6384 |
|
6385 | if (thrown) {
|
6386 | this.startInertia();
|
6387 | } else {
|
6388 | modification.result = modification.setAll(this.modifierArg);
|
6389 |
|
6390 | if (!modification.result.changed) {
|
6391 | return false;
|
6392 | }
|
6393 |
|
6394 | this.startSmoothEnd();
|
6395 | }
|
6396 |
|
6397 |
|
6398 | interaction.modification.result.rect = null;
|
6399 |
|
6400 | interaction.offsetBy(this.targetOffset);
|
6401 |
|
6402 | interaction._doPhase({
|
6403 | interaction: interaction,
|
6404 | event: event,
|
6405 | phase: 'inertiastart'
|
6406 | });
|
6407 |
|
6408 | interaction.offsetBy({
|
6409 | x: -this.targetOffset.x,
|
6410 | y: -this.targetOffset.y
|
6411 | });
|
6412 |
|
6413 | interaction.modification.result.rect = null;
|
6414 | this.active = true;
|
6415 | interaction.simulation = this;
|
6416 | return true;
|
6417 | }
|
6418 | }, {
|
6419 | key: "startInertia",
|
6420 | value: function startInertia() {
|
6421 | var _this = this;
|
6422 |
|
6423 | var startVelocity = this.interaction.coords.velocity.client;
|
6424 | var options = getOptions(this.interaction);
|
6425 | var lambda = options.resistance;
|
6426 | var inertiaDur = -Math.log(options.endSpeed / this.v0) / lambda;
|
6427 | this.targetOffset = {
|
6428 | x: (startVelocity.x - inertiaDur) / lambda,
|
6429 | y: (startVelocity.y - inertiaDur) / lambda
|
6430 | };
|
6431 | this.te = inertiaDur;
|
6432 | this.lambda_v0 = lambda / this.v0;
|
6433 | this.one_ve_v0 = 1 - options.endSpeed / this.v0;
|
6434 | var modification = this.modification,
|
6435 | modifierArg = this.modifierArg;
|
6436 | modifierArg.pageCoords = {
|
6437 | x: this.startCoords.x + this.targetOffset.x,
|
6438 | y: this.startCoords.y + this.targetOffset.y
|
6439 | };
|
6440 | modification.result = modification.setAll(modifierArg);
|
6441 |
|
6442 | if (modification.result.changed) {
|
6443 | this.isModified = true;
|
6444 | this.modifiedOffset = {
|
6445 | x: this.targetOffset.x + modification.result.delta.x,
|
6446 | y: this.targetOffset.y + modification.result.delta.y
|
6447 | };
|
6448 | }
|
6449 |
|
6450 | this.onNextFrame(function () {
|
6451 | return _this.inertiaTick();
|
6452 | });
|
6453 | }
|
6454 | }, {
|
6455 | key: "startSmoothEnd",
|
6456 | value: function startSmoothEnd() {
|
6457 | var _this2 = this;
|
6458 |
|
6459 | this.smoothEnd = true;
|
6460 | this.isModified = true;
|
6461 | this.targetOffset = {
|
6462 | x: this.modification.result.delta.x,
|
6463 | y: this.modification.result.delta.y
|
6464 | };
|
6465 | this.onNextFrame(function () {
|
6466 | return _this2.smoothEndTick();
|
6467 | });
|
6468 | }
|
6469 | }, {
|
6470 | key: "onNextFrame",
|
6471 | value: function onNextFrame(tickFn) {
|
6472 | var _this3 = this;
|
6473 |
|
6474 | this.timeout = _$raf_76.default.request(function () {
|
6475 | if (_this3.active) {
|
6476 | tickFn();
|
6477 | }
|
6478 | });
|
6479 | }
|
6480 | }, {
|
6481 | key: "inertiaTick",
|
6482 | value: function inertiaTick() {
|
6483 | var _this4 = this;
|
6484 |
|
6485 | var interaction = this.interaction;
|
6486 | var options = getOptions(interaction);
|
6487 | var lambda = options.resistance;
|
6488 | var t = (interaction._now() - this.t0) / 1000;
|
6489 |
|
6490 | if (t < this.te) {
|
6491 | var progress = 1 - (Math.exp(-lambda * t) - this.lambda_v0) / this.one_ve_v0;
|
6492 | var newOffset;
|
6493 |
|
6494 | if (this.isModified) {
|
6495 | newOffset = getQuadraticCurvePoint(0, 0, this.targetOffset.x, this.targetOffset.y, this.modifiedOffset.x, this.modifiedOffset.y, progress);
|
6496 | } else {
|
6497 | newOffset = {
|
6498 | x: this.targetOffset.x * progress,
|
6499 | y: this.targetOffset.y * progress
|
6500 | };
|
6501 | }
|
6502 |
|
6503 | var delta = {
|
6504 | x: newOffset.x - this.currentOffset.x,
|
6505 | y: newOffset.y - this.currentOffset.y
|
6506 | };
|
6507 | this.currentOffset.x += delta.x;
|
6508 | this.currentOffset.y += delta.y;
|
6509 | interaction.offsetBy(delta);
|
6510 | interaction.move();
|
6511 | this.onNextFrame(function () {
|
6512 | return _this4.inertiaTick();
|
6513 | });
|
6514 | } else {
|
6515 | interaction.offsetBy({
|
6516 | x: this.modifiedOffset.x - this.currentOffset.x,
|
6517 | y: this.modifiedOffset.y - this.currentOffset.y
|
6518 | });
|
6519 | this.end();
|
6520 | }
|
6521 | }
|
6522 | }, {
|
6523 | key: "smoothEndTick",
|
6524 | value: function smoothEndTick() {
|
6525 | var _this5 = this;
|
6526 |
|
6527 | var interaction = this.interaction;
|
6528 | var t = interaction._now() - this.t0;
|
6529 |
|
6530 | var _getOptions = getOptions(interaction),
|
6531 | duration = _getOptions.smoothEndDuration;
|
6532 |
|
6533 | if (t < duration) {
|
6534 | var newOffset = {
|
6535 | x: easeOutQuad(t, 0, this.targetOffset.x, duration),
|
6536 | y: easeOutQuad(t, 0, this.targetOffset.y, duration)
|
6537 | };
|
6538 | var delta = {
|
6539 | x: newOffset.x - this.currentOffset.x,
|
6540 | y: newOffset.y - this.currentOffset.y
|
6541 | };
|
6542 | this.currentOffset.x += delta.x;
|
6543 | this.currentOffset.y += delta.y;
|
6544 | interaction.offsetBy(delta);
|
6545 | interaction.move({
|
6546 | skipModifiers: this.modifierCount
|
6547 | });
|
6548 | this.onNextFrame(function () {
|
6549 | return _this5.smoothEndTick();
|
6550 | });
|
6551 | } else {
|
6552 | interaction.offsetBy({
|
6553 | x: this.targetOffset.x - this.currentOffset.x,
|
6554 | y: this.targetOffset.y - this.currentOffset.y
|
6555 | });
|
6556 | this.end();
|
6557 | }
|
6558 | }
|
6559 | }, {
|
6560 | key: "resume",
|
6561 | value: function resume(_ref) {
|
6562 | var pointer = _ref.pointer,
|
6563 | event = _ref.event,
|
6564 | eventTarget = _ref.eventTarget;
|
6565 | var interaction = this.interaction;
|
6566 |
|
6567 | interaction.offsetBy({
|
6568 | x: -this.currentOffset.x,
|
6569 | y: -this.currentOffset.y
|
6570 | });
|
6571 |
|
6572 | interaction.updatePointer(pointer, event, eventTarget, true);
|
6573 |
|
6574 | interaction._doPhase({
|
6575 | interaction: interaction,
|
6576 | event: event,
|
6577 | phase: 'resume'
|
6578 | });
|
6579 |
|
6580 | (0, _$pointerUtils_75.copyCoords)(interaction.coords.prev, interaction.coords.cur);
|
6581 | this.stop();
|
6582 | }
|
6583 | }, {
|
6584 | key: "end",
|
6585 | value: function end() {
|
6586 | this.interaction.move();
|
6587 | this.interaction.end();
|
6588 | this.stop();
|
6589 | }
|
6590 | }, {
|
6591 | key: "stop",
|
6592 | value: function stop() {
|
6593 | this.active = this.smoothEnd = false;
|
6594 | this.interaction.simulation = null;
|
6595 |
|
6596 | _$raf_76.default.cancel(this.timeout);
|
6597 | }
|
6598 | }]);
|
6599 |
|
6600 | return InertiaState;
|
6601 | }();
|
6602 |
|
6603 | _$plugin_30.InertiaState = InertiaState;
|
6604 |
|
6605 | function __start_30(_ref2) {
|
6606 | var interaction = _ref2.interaction,
|
6607 | event = _ref2.event;
|
6608 |
|
6609 | if (!interaction._interacting || interaction.simulation) {
|
6610 | return null;
|
6611 | }
|
6612 |
|
6613 | var started = interaction.inertia.start(event);
|
6614 |
|
6615 | return started ? false : null;
|
6616 | }
|
6617 |
|
6618 |
|
6619 |
|
6620 | function resume(arg) {
|
6621 | var interaction = arg.interaction,
|
6622 | eventTarget = arg.eventTarget;
|
6623 | var state = interaction.inertia;
|
6624 | if (!state.active) return;
|
6625 | var element = eventTarget;
|
6626 |
|
6627 | while (_$is_70.default.element(element)) {
|
6628 |
|
6629 | if (element === interaction.element) {
|
6630 | state.resume(arg);
|
6631 | break;
|
6632 | }
|
6633 |
|
6634 | element = _$domUtils_66.parentNode(element);
|
6635 | }
|
6636 | }
|
6637 |
|
6638 | function stop(_ref3) {
|
6639 | var interaction = _ref3.interaction;
|
6640 | var state = interaction.inertia;
|
6641 |
|
6642 | if (state.active) {
|
6643 | state.stop();
|
6644 | }
|
6645 | }
|
6646 |
|
6647 | function getOptions(_ref4) {
|
6648 | var interactable = _ref4.interactable,
|
6649 | prepared = _ref4.prepared;
|
6650 | return interactable && interactable.options && prepared.name && interactable.options[prepared.name].inertia;
|
6651 | }
|
6652 |
|
6653 | var inertia = {
|
6654 | id: 'inertia',
|
6655 | before: ['modifiers', 'actions'],
|
6656 | install: __install_30,
|
6657 | listeners: {
|
6658 | 'interactions:new': function interactionsNew(_ref5) {
|
6659 | var interaction = _ref5.interaction;
|
6660 | interaction.inertia = new InertiaState(interaction);
|
6661 | },
|
6662 | 'interactions:before-action-end': __start_30,
|
6663 | 'interactions:down': resume,
|
6664 | 'interactions:stop': stop,
|
6665 | 'interactions:before-action-resume': function interactionsBeforeActionResume(arg) {
|
6666 | var modification = arg.interaction.modification;
|
6667 | modification.stop(arg);
|
6668 | modification.start(arg, arg.interaction.coords.cur.page);
|
6669 | modification.applyToInteraction(arg);
|
6670 | },
|
6671 | 'interactions:before-action-inertiastart': function interactionsBeforeActionInertiastart(arg) {
|
6672 | return arg.interaction.modification.setAndApply(arg);
|
6673 | },
|
6674 | 'interactions:action-resume': _$base_37.addEventModifiers,
|
6675 | 'interactions:action-inertiastart': _$base_37.addEventModifiers,
|
6676 | 'interactions:after-action-inertiastart': function interactionsAfterActionInertiastart(arg) {
|
6677 | return arg.interaction.modification.restoreInteractionCoords(arg);
|
6678 | },
|
6679 | 'interactions:after-action-resume': function interactionsAfterActionResume(arg) {
|
6680 | return arg.interaction.modification.restoreInteractionCoords(arg);
|
6681 | }
|
6682 | }
|
6683 | };
|
6684 |
|
6685 | function _getQBezierValue(t, p1, p2, p3) {
|
6686 | var iT = 1 - t;
|
6687 | return iT * iT * p1 + 2 * iT * t * p2 + t * t * p3;
|
6688 | }
|
6689 |
|
6690 | function getQuadraticCurvePoint(startX, startY, cpX, cpY, endX, endY, position) {
|
6691 | return {
|
6692 | x: _getQBezierValue(position, startX, cpX, endX),
|
6693 | y: _getQBezierValue(position, startY, cpY, endY)
|
6694 | };
|
6695 | }
|
6696 |
|
6697 |
|
6698 | function easeOutQuad(t, b, c, d) {
|
6699 | t /= d;
|
6700 | return -c * t * (t - 2) + b;
|
6701 | }
|
6702 |
|
6703 | var ___default_30 = inertia;
|
6704 | _$plugin_30.default = ___default_30;
|
6705 | var _$Eventable_14 = {};
|
6706 | "use strict";
|
6707 |
|
6708 | Object.defineProperty(_$Eventable_14, "__esModule", {
|
6709 | value: true
|
6710 | });
|
6711 | _$Eventable_14.Eventable = void 0;
|
6712 |
|
6713 |
|
6714 | ;
|
6715 |
|
6716 |
|
6717 | ;
|
6718 |
|
6719 |
|
6720 | ;
|
6721 |
|
6722 | function ___classCallCheck_14(instance, Constructor) {
|
6723 | if (!(instance instanceof Constructor)) {
|
6724 | throw new TypeError("Cannot call a class as a function");
|
6725 | }
|
6726 | }
|
6727 |
|
6728 | function ___defineProperties_14(target, props) {
|
6729 | for (var i = 0; i < props.length; i++) {
|
6730 | var descriptor = props[i];
|
6731 | descriptor.enumerable = descriptor.enumerable || false;
|
6732 | descriptor.configurable = true;
|
6733 | if ("value" in descriptor) descriptor.writable = true;
|
6734 | Object.defineProperty(target, descriptor.key, descriptor);
|
6735 | }
|
6736 | }
|
6737 |
|
6738 | function ___createClass_14(Constructor, protoProps, staticProps) {
|
6739 | if (protoProps) ___defineProperties_14(Constructor.prototype, protoProps);
|
6740 | if (staticProps) ___defineProperties_14(Constructor, staticProps);
|
6741 | return Constructor;
|
6742 | }
|
6743 |
|
6744 | function ___defineProperty_14(obj, key, value) {
|
6745 | if (key in obj) {
|
6746 | Object.defineProperty(obj, key, {
|
6747 | value: value,
|
6748 | enumerable: true,
|
6749 | configurable: true,
|
6750 | writable: true
|
6751 | });
|
6752 | } else {
|
6753 | obj[key] = value;
|
6754 | }
|
6755 |
|
6756 | return obj;
|
6757 | }
|
6758 |
|
6759 | function fireUntilImmediateStopped(event, listeners) {
|
6760 | for (var _i = 0; _i < listeners.length; _i++) {
|
6761 | var _ref;
|
6762 |
|
6763 | _ref = listeners[_i];
|
6764 | var listener = _ref;
|
6765 |
|
6766 | if (event.immediatePropagationStopped) {
|
6767 | break;
|
6768 | }
|
6769 |
|
6770 | listener(event);
|
6771 | }
|
6772 | }
|
6773 |
|
6774 | var Eventable = function () {
|
6775 | function Eventable(options) {
|
6776 | ___classCallCheck_14(this, Eventable);
|
6777 |
|
6778 | ___defineProperty_14(this, "options", void 0);
|
6779 |
|
6780 | ___defineProperty_14(this, "types", {});
|
6781 |
|
6782 | ___defineProperty_14(this, "propagationStopped", false);
|
6783 |
|
6784 | ___defineProperty_14(this, "immediatePropagationStopped", false);
|
6785 |
|
6786 | ___defineProperty_14(this, "global", void 0);
|
6787 |
|
6788 | this.options = (0, _$extend_67.default)({}, options || {});
|
6789 | }
|
6790 |
|
6791 | ___createClass_14(Eventable, [{
|
6792 | key: "fire",
|
6793 | value: function fire(event) {
|
6794 | var listeners;
|
6795 | var global = this.global;
|
6796 |
|
6797 |
|
6798 | if (listeners = this.types[event.type]) {
|
6799 | fireUntilImmediateStopped(event, listeners);
|
6800 | }
|
6801 |
|
6802 |
|
6803 | if (!event.propagationStopped && global && (listeners = global[event.type])) {
|
6804 | fireUntilImmediateStopped(event, listeners);
|
6805 | }
|
6806 | }
|
6807 | }, {
|
6808 | key: "on",
|
6809 | value: function on(type, listener) {
|
6810 | var listeners = (0, _$normalizeListeners_73.default)(type, listener);
|
6811 |
|
6812 | for (type in listeners) {
|
6813 | this.types[type] = _$arr_62.merge(this.types[type] || [], listeners[type]);
|
6814 | }
|
6815 | }
|
6816 | }, {
|
6817 | key: "off",
|
6818 | value: function off(type, listener) {
|
6819 | var listeners = (0, _$normalizeListeners_73.default)(type, listener);
|
6820 |
|
6821 | for (type in listeners) {
|
6822 | var eventList = this.types[type];
|
6823 |
|
6824 | if (!eventList || !eventList.length) {
|
6825 | continue;
|
6826 | }
|
6827 |
|
6828 | for (var _i2 = 0; _i2 < listeners[type].length; _i2++) {
|
6829 | var _ref2;
|
6830 |
|
6831 | _ref2 = listeners[type][_i2];
|
6832 | var subListener = _ref2;
|
6833 |
|
6834 | var _index = eventList.indexOf(subListener);
|
6835 |
|
6836 | if (_index !== -1) {
|
6837 | eventList.splice(_index, 1);
|
6838 | }
|
6839 | }
|
6840 | }
|
6841 | }
|
6842 | }, {
|
6843 | key: "getRect",
|
6844 | value: function getRect(_element) {
|
6845 | return null;
|
6846 | }
|
6847 | }]);
|
6848 |
|
6849 | return Eventable;
|
6850 | }();
|
6851 |
|
6852 | _$Eventable_14.Eventable = Eventable;
|
6853 | var _$isNonNativeEvent_25 = {};
|
6854 | "use strict";
|
6855 |
|
6856 | Object.defineProperty(_$isNonNativeEvent_25, "__esModule", {
|
6857 | value: true
|
6858 | });
|
6859 | _$isNonNativeEvent_25.default = isNonNativeEvent;
|
6860 |
|
6861 | function isNonNativeEvent(type, actions) {
|
6862 | if (actions.phaselessTypes[type]) {
|
6863 | return true;
|
6864 | }
|
6865 |
|
6866 | for (var name in actions.map) {
|
6867 | if (type.indexOf(name) === 0 && type.substr(name.length) in actions.phases) {
|
6868 | return true;
|
6869 | }
|
6870 | }
|
6871 |
|
6872 | return false;
|
6873 | }
|
6874 |
|
6875 | var _$InteractStatic_16 = {};
|
6876 | "use strict";
|
6877 |
|
6878 | Object.defineProperty(_$InteractStatic_16, "__esModule", {
|
6879 | value: true
|
6880 | });
|
6881 | _$InteractStatic_16.createInteractStatic = createInteractStatic;
|
6882 |
|
6883 |
|
6884 | ;
|
6885 |
|
6886 |
|
6887 | ;
|
6888 |
|
6889 |
|
6890 | ;
|
6891 |
|
6892 |
|
6893 | ;
|
6894 |
|
6895 |
|
6896 | ;
|
6897 |
|
6898 |
|
6899 | ;
|
6900 |
|
6901 |
|
6902 | function createInteractStatic(scope) {
|
6903 | |
6904 |
|
6905 |
|
6906 |
|
6907 |
|
6908 |
|
6909 |
|
6910 |
|
6911 |
|
6912 |
|
6913 |
|
6914 |
|
6915 |
|
6916 |
|
6917 |
|
6918 |
|
6919 |
|
6920 |
|
6921 |
|
6922 |
|
6923 |
|
6924 |
|
6925 |
|
6926 |
|
6927 |
|
6928 | var interact = function interact(target, options) {
|
6929 | var interactable = scope.interactables.get(target, options);
|
6930 |
|
6931 | if (!interactable) {
|
6932 | interactable = scope.interactables.new(target, options);
|
6933 | interactable.events.global = interact.globalEvents;
|
6934 | }
|
6935 |
|
6936 | return interactable;
|
6937 | };
|
6938 |
|
6939 |
|
6940 | interact.getPointerAverage = _$pointerUtils_75.pointerAverage;
|
6941 | interact.getTouchBBox = _$pointerUtils_75.touchBBox;
|
6942 | interact.getTouchDistance = _$pointerUtils_75.touchDistance;
|
6943 | interact.getTouchAngle = _$pointerUtils_75.touchAngle;
|
6944 | interact.getElementRect = _$domUtils_66.getElementRect;
|
6945 | interact.getElementClientRect = _$domUtils_66.getElementClientRect;
|
6946 | interact.matchesSelector = _$domUtils_66.matchesSelector;
|
6947 | interact.closest = _$domUtils_66.closest;
|
6948 | interact.globalEvents = {};
|
6949 |
|
6950 | interact.version = "1.10.11";
|
6951 | interact.scope = scope;
|
6952 | |
6953 |
|
6954 |
|
6955 |
|
6956 |
|
6957 |
|
6958 |
|
6959 | interact.use = function (plugin, options) {
|
6960 | this.scope.usePlugin(plugin, options);
|
6961 | return this;
|
6962 | };
|
6963 | |
6964 |
|
6965 |
|
6966 |
|
6967 |
|
6968 |
|
6969 |
|
6970 |
|
6971 |
|
6972 |
|
6973 |
|
6974 |
|
6975 |
|
6976 | interact.isSet = function (target, options) {
|
6977 | return !!this.scope.interactables.get(target, options && options.context);
|
6978 | };
|
6979 | |
6980 |
|
6981 |
|
6982 |
|
6983 |
|
6984 |
|
6985 |
|
6986 |
|
6987 |
|
6988 |
|
6989 |
|
6990 |
|
6991 |
|
6992 |
|
6993 | interact.on = (0, _$misc_72.warnOnce)(function on(type, listener, options) {
|
6994 | if (_$is_70.default.string(type) && type.search(' ') !== -1) {
|
6995 | type = type.trim().split(/ +/);
|
6996 | }
|
6997 |
|
6998 | if (_$is_70.default.array(type)) {
|
6999 | for (var _i = 0; _i < type.length; _i++) {
|
7000 | var _ref;
|
7001 |
|
7002 | _ref = type[_i];
|
7003 | var eventType = _ref;
|
7004 | this.on(eventType, listener, options);
|
7005 | }
|
7006 |
|
7007 | return this;
|
7008 | }
|
7009 |
|
7010 | if (_$is_70.default.object(type)) {
|
7011 | for (var prop in type) {
|
7012 | this.on(prop, type[prop], listener);
|
7013 | }
|
7014 |
|
7015 | return this;
|
7016 | }
|
7017 |
|
7018 |
|
7019 | if ((0, _$isNonNativeEvent_25.default)(type, this.scope.actions)) {
|
7020 |
|
7021 | if (!this.globalEvents[type]) {
|
7022 | this.globalEvents[type] = [listener];
|
7023 | } else {
|
7024 | this.globalEvents[type].push(listener);
|
7025 | }
|
7026 | }
|
7027 | else {
|
7028 | this.scope.events.add(this.scope.document, type, listener, {
|
7029 | options: options
|
7030 | });
|
7031 | }
|
7032 |
|
7033 | return this;
|
7034 | }, 'The interact.on() method is being deprecated');
|
7035 | |
7036 |
|
7037 |
|
7038 |
|
7039 |
|
7040 |
|
7041 |
|
7042 |
|
7043 |
|
7044 |
|
7045 |
|
7046 |
|
7047 |
|
7048 |
|
7049 | interact.off = (0, _$misc_72.warnOnce)(function off(type, listener, options) {
|
7050 | if (_$is_70.default.string(type) && type.search(' ') !== -1) {
|
7051 | type = type.trim().split(/ +/);
|
7052 | }
|
7053 |
|
7054 | if (_$is_70.default.array(type)) {
|
7055 | for (var _i2 = 0; _i2 < type.length; _i2++) {
|
7056 | var _ref2;
|
7057 |
|
7058 | _ref2 = type[_i2];
|
7059 | var eventType = _ref2;
|
7060 | this.off(eventType, listener, options);
|
7061 | }
|
7062 |
|
7063 | return this;
|
7064 | }
|
7065 |
|
7066 | if (_$is_70.default.object(type)) {
|
7067 | for (var prop in type) {
|
7068 | this.off(prop, type[prop], listener);
|
7069 | }
|
7070 |
|
7071 | return this;
|
7072 | }
|
7073 |
|
7074 | if ((0, _$isNonNativeEvent_25.default)(type, this.scope.actions)) {
|
7075 | var index;
|
7076 |
|
7077 | if (type in this.globalEvents && (index = this.globalEvents[type].indexOf(listener)) !== -1) {
|
7078 | this.globalEvents[type].splice(index, 1);
|
7079 | }
|
7080 | } else {
|
7081 | this.scope.events.remove(this.scope.document, type, listener, options);
|
7082 | }
|
7083 |
|
7084 | return this;
|
7085 | }, 'The interact.off() method is being deprecated');
|
7086 |
|
7087 | interact.debug = function () {
|
7088 | return this.scope;
|
7089 | };
|
7090 | |
7091 |
|
7092 |
|
7093 |
|
7094 |
|
7095 |
|
7096 |
|
7097 | interact.supportsTouch = function () {
|
7098 | return _$browser_63.default.supportsTouch;
|
7099 | };
|
7100 | |
7101 |
|
7102 |
|
7103 |
|
7104 |
|
7105 |
|
7106 |
|
7107 | interact.supportsPointerEvent = function () {
|
7108 | return _$browser_63.default.supportsPointerEvent;
|
7109 | };
|
7110 | |
7111 |
|
7112 |
|
7113 |
|
7114 |
|
7115 |
|
7116 |
|
7117 |
|
7118 |
|
7119 | interact.stop = function () {
|
7120 | for (var _i3 = 0; _i3 < this.scope.interactions.list.length; _i3++) {
|
7121 | var _ref3;
|
7122 |
|
7123 | _ref3 = this.scope.interactions.list[_i3];
|
7124 | var interaction = _ref3;
|
7125 | interaction.stop();
|
7126 | }
|
7127 |
|
7128 | return this;
|
7129 | };
|
7130 | |
7131 |
|
7132 |
|
7133 |
|
7134 |
|
7135 |
|
7136 |
|
7137 |
|
7138 |
|
7139 |
|
7140 |
|
7141 | interact.pointerMoveTolerance = function (newValue) {
|
7142 | if (_$is_70.default.number(newValue)) {
|
7143 | this.scope.interactions.pointerMoveTolerance = newValue;
|
7144 | return this;
|
7145 | }
|
7146 |
|
7147 | return this.scope.interactions.pointerMoveTolerance;
|
7148 | };
|
7149 |
|
7150 | interact.addDocument = function (doc, options) {
|
7151 | this.scope.addDocument(doc, options);
|
7152 | };
|
7153 |
|
7154 | interact.removeDocument = function (doc) {
|
7155 | this.scope.removeDocument(doc);
|
7156 | };
|
7157 |
|
7158 | return interact;
|
7159 | }
|
7160 |
|
7161 | var _$Interactable_17 = {};
|
7162 | "use strict";
|
7163 |
|
7164 | Object.defineProperty(_$Interactable_17, "__esModule", {
|
7165 | value: true
|
7166 | });
|
7167 | _$Interactable_17.Interactable = void 0;
|
7168 |
|
7169 |
|
7170 | ;
|
7171 |
|
7172 |
|
7173 | ;
|
7174 |
|
7175 |
|
7176 | ;
|
7177 |
|
7178 |
|
7179 | ;
|
7180 |
|
7181 |
|
7182 | ;
|
7183 |
|
7184 |
|
7185 | ;
|
7186 |
|
7187 |
|
7188 | ;
|
7189 |
|
7190 |
|
7191 | ;
|
7192 |
|
7193 |
|
7194 | ;
|
7195 |
|
7196 |
|
7197 | ;
|
7198 |
|
7199 |
|
7200 | ;
|
7201 |
|
7202 | function ___classCallCheck_17(instance, Constructor) {
|
7203 | if (!(instance instanceof Constructor)) {
|
7204 | throw new TypeError("Cannot call a class as a function");
|
7205 | }
|
7206 | }
|
7207 |
|
7208 | function ___defineProperties_17(target, props) {
|
7209 | for (var i = 0; i < props.length; i++) {
|
7210 | var descriptor = props[i];
|
7211 | descriptor.enumerable = descriptor.enumerable || false;
|
7212 | descriptor.configurable = true;
|
7213 | if ("value" in descriptor) descriptor.writable = true;
|
7214 | Object.defineProperty(target, descriptor.key, descriptor);
|
7215 | }
|
7216 | }
|
7217 |
|
7218 | function ___createClass_17(Constructor, protoProps, staticProps) {
|
7219 | if (protoProps) ___defineProperties_17(Constructor.prototype, protoProps);
|
7220 | if (staticProps) ___defineProperties_17(Constructor, staticProps);
|
7221 | return Constructor;
|
7222 | }
|
7223 |
|
7224 | function ___defineProperty_17(obj, key, value) {
|
7225 | if (key in obj) {
|
7226 | Object.defineProperty(obj, key, {
|
7227 | value: value,
|
7228 | enumerable: true,
|
7229 | configurable: true,
|
7230 | writable: true
|
7231 | });
|
7232 | } else {
|
7233 | obj[key] = value;
|
7234 | }
|
7235 |
|
7236 | return obj;
|
7237 | }
|
7238 |
|
7239 |
|
7240 |
|
7241 | var Interactable = function () {
|
7242 |
|
7243 | function Interactable(target, options, defaultContext, scopeEvents) {
|
7244 | ___classCallCheck_17(this, Interactable);
|
7245 |
|
7246 | ___defineProperty_17(this, "options", void 0);
|
7247 |
|
7248 | ___defineProperty_17(this, "_actions", void 0);
|
7249 |
|
7250 | ___defineProperty_17(this, "target", void 0);
|
7251 |
|
7252 | ___defineProperty_17(this, "events", new _$Eventable_14.Eventable());
|
7253 |
|
7254 | ___defineProperty_17(this, "_context", void 0);
|
7255 |
|
7256 | ___defineProperty_17(this, "_win", void 0);
|
7257 |
|
7258 | ___defineProperty_17(this, "_doc", void 0);
|
7259 |
|
7260 | ___defineProperty_17(this, "_scopeEvents", void 0);
|
7261 |
|
7262 | ___defineProperty_17(this, "_rectChecker", void 0);
|
7263 |
|
7264 | this._actions = options.actions;
|
7265 | this.target = target;
|
7266 | this._context = options.context || defaultContext;
|
7267 | this._win = (0, _$window_78.getWindow)((0, _$domUtils_66.trySelector)(target) ? this._context : target);
|
7268 | this._doc = this._win.document;
|
7269 | this._scopeEvents = scopeEvents;
|
7270 | this.set(options);
|
7271 | }
|
7272 |
|
7273 | ___createClass_17(Interactable, [{
|
7274 | key: "_defaults",
|
7275 | get:
|
7276 | /** @internal */
|
7277 | function get() {
|
7278 | return {
|
7279 | base: {},
|
7280 | perAction: {},
|
7281 | actions: {}
|
7282 | };
|
7283 | }
|
7284 | }, {
|
7285 | key: "setOnEvents",
|
7286 | value: function setOnEvents(actionName, phases) {
|
7287 | if (_$is_70.default.func(phases.onstart)) {
|
7288 | this.on("".concat(actionName, "start"), phases.onstart);
|
7289 | }
|
7290 |
|
7291 | if (_$is_70.default.func(phases.onmove)) {
|
7292 | this.on("".concat(actionName, "move"), phases.onmove);
|
7293 | }
|
7294 |
|
7295 | if (_$is_70.default.func(phases.onend)) {
|
7296 | this.on("".concat(actionName, "end"), phases.onend);
|
7297 | }
|
7298 |
|
7299 | if (_$is_70.default.func(phases.oninertiastart)) {
|
7300 | this.on("".concat(actionName, "inertiastart"), phases.oninertiastart);
|
7301 | }
|
7302 |
|
7303 | return this;
|
7304 | }
|
7305 | }, {
|
7306 | key: "updatePerActionListeners",
|
7307 | value: function updatePerActionListeners(actionName, prev, cur) {
|
7308 | if (_$is_70.default.array(prev) || _$is_70.default.object(prev)) {
|
7309 | this.off(actionName, prev);
|
7310 | }
|
7311 |
|
7312 | if (_$is_70.default.array(cur) || _$is_70.default.object(cur)) {
|
7313 | this.on(actionName, cur);
|
7314 | }
|
7315 | }
|
7316 | }, {
|
7317 | key: "setPerAction",
|
7318 | value: function setPerAction(actionName, options) {
|
7319 | var defaults = this._defaults;
|
7320 |
|
7321 | for (var optionName_ in options) {
|
7322 | var optionName = optionName_;
|
7323 | var actionOptions = this.options[actionName];
|
7324 | var optionValue = options[optionName];
|
7325 |
|
7326 | if (optionName === 'listeners') {
|
7327 | this.updatePerActionListeners(actionName, actionOptions.listeners, optionValue);
|
7328 | }
|
7329 |
|
7330 |
|
7331 | if (_$is_70.default.array(optionValue)) {
|
7332 | ;
|
7333 | actionOptions[optionName] = _$arr_62.from(optionValue);
|
7334 | }
|
7335 | else if (_$is_70.default.plainObject(optionValue)) {
|
7336 |
|
7337 | ;
|
7338 | actionOptions[optionName] = (0, _$extend_67.default)(actionOptions[optionName] || {}, (0, _$clone_64.default)(optionValue));
|
7339 |
|
7340 | if (_$is_70.default.object(defaults.perAction[optionName]) && 'enabled' in defaults.perAction[optionName]) {
|
7341 | ;
|
7342 | actionOptions[optionName].enabled = optionValue.enabled !== false;
|
7343 | }
|
7344 | }
|
7345 | else if (_$is_70.default.bool(optionValue) && _$is_70.default.object(defaults.perAction[optionName])) {
|
7346 | ;
|
7347 | actionOptions[optionName].enabled = optionValue;
|
7348 | }
|
7349 | else {
|
7350 | ;
|
7351 | actionOptions[optionName] = optionValue;
|
7352 | }
|
7353 | }
|
7354 | }
|
7355 | |
7356 |
|
7357 |
|
7358 |
|
7359 |
|
7360 |
|
7361 |
|
7362 |
|
7363 | }, {
|
7364 | key: "getRect",
|
7365 | value: function getRect(element) {
|
7366 | element = element || (_$is_70.default.element(this.target) ? this.target : null);
|
7367 |
|
7368 | if (_$is_70.default.string(this.target)) {
|
7369 | element = element || this._context.querySelector(this.target);
|
7370 | }
|
7371 |
|
7372 | return (0, _$domUtils_66.getElementRect)(element);
|
7373 | }
|
7374 | |
7375 |
|
7376 |
|
7377 |
|
7378 |
|
7379 |
|
7380 |
|
7381 |
|
7382 |
|
7383 | }, {
|
7384 | key: "rectChecker",
|
7385 | value: function rectChecker(checker) {
|
7386 | var _this = this;
|
7387 |
|
7388 | if (_$is_70.default.func(checker)) {
|
7389 | this._rectChecker = checker;
|
7390 |
|
7391 | this.getRect = function (element) {
|
7392 | var rect = (0, _$extend_67.default)({}, _this._rectChecker(element));
|
7393 |
|
7394 | if (!('width' in rect)) {
|
7395 | rect.width = rect.right - rect.left;
|
7396 | rect.height = rect.bottom - rect.top;
|
7397 | }
|
7398 |
|
7399 | return rect;
|
7400 | };
|
7401 |
|
7402 | return this;
|
7403 | }
|
7404 |
|
7405 | if (checker === null) {
|
7406 | delete this.getRect;
|
7407 | delete this._rectChecker;
|
7408 | return this;
|
7409 | }
|
7410 |
|
7411 | return this.getRect;
|
7412 | }
|
7413 | }, {
|
7414 | key: "_backCompatOption",
|
7415 | value: function _backCompatOption(optionName, newValue) {
|
7416 | if ((0, _$domUtils_66.trySelector)(newValue) || _$is_70.default.object(newValue)) {
|
7417 | ;
|
7418 | this.options[optionName] = newValue;
|
7419 |
|
7420 | for (var action in this._actions.map) {
|
7421 | ;
|
7422 | this.options[action][optionName] = newValue;
|
7423 | }
|
7424 |
|
7425 | return this;
|
7426 | }
|
7427 |
|
7428 | return this.options[optionName];
|
7429 | }
|
7430 | |
7431 |
|
7432 |
|
7433 |
|
7434 |
|
7435 |
|
7436 |
|
7437 |
|
7438 |
|
7439 |
|
7440 |
|
7441 | }, {
|
7442 | key: "origin",
|
7443 | value: function origin(newValue) {
|
7444 | return this._backCompatOption('origin', newValue);
|
7445 | }
|
7446 | |
7447 |
|
7448 |
|
7449 |
|
7450 |
|
7451 |
|
7452 |
|
7453 |
|
7454 |
|
7455 | }, {
|
7456 | key: "deltaSource",
|
7457 | value: function deltaSource(newValue) {
|
7458 | if (newValue === 'page' || newValue === 'client') {
|
7459 | this.options.deltaSource = newValue;
|
7460 | return this;
|
7461 | }
|
7462 |
|
7463 | return this.options.deltaSource;
|
7464 | }
|
7465 | |
7466 |
|
7467 |
|
7468 |
|
7469 |
|
7470 |
|
7471 |
|
7472 | }, {
|
7473 | key: "context",
|
7474 | value: function context() {
|
7475 | return this._context;
|
7476 | }
|
7477 | }, {
|
7478 | key: "inContext",
|
7479 | value: function inContext(element) {
|
7480 | return this._context === element.ownerDocument || (0, _$domUtils_66.nodeContains)(this._context, element);
|
7481 | }
|
7482 | }, {
|
7483 | key: "testIgnoreAllow",
|
7484 | value: function testIgnoreAllow(options, targetNode, eventTarget) {
|
7485 | return !this.testIgnore(options.ignoreFrom, targetNode, eventTarget) && this.testAllow(options.allowFrom, targetNode, eventTarget);
|
7486 | }
|
7487 | }, {
|
7488 | key: "testAllow",
|
7489 | value: function testAllow(allowFrom, targetNode, element) {
|
7490 | if (!allowFrom) {
|
7491 | return true;
|
7492 | }
|
7493 |
|
7494 | if (!_$is_70.default.element(element)) {
|
7495 | return false;
|
7496 | }
|
7497 |
|
7498 | if (_$is_70.default.string(allowFrom)) {
|
7499 | return (0, _$domUtils_66.matchesUpTo)(element, allowFrom, targetNode);
|
7500 | } else if (_$is_70.default.element(allowFrom)) {
|
7501 | return (0, _$domUtils_66.nodeContains)(allowFrom, element);
|
7502 | }
|
7503 |
|
7504 | return false;
|
7505 | }
|
7506 | }, {
|
7507 | key: "testIgnore",
|
7508 | value: function testIgnore(ignoreFrom, targetNode, element) {
|
7509 | if (!ignoreFrom || !_$is_70.default.element(element)) {
|
7510 | return false;
|
7511 | }
|
7512 |
|
7513 | if (_$is_70.default.string(ignoreFrom)) {
|
7514 | return (0, _$domUtils_66.matchesUpTo)(element, ignoreFrom, targetNode);
|
7515 | } else if (_$is_70.default.element(ignoreFrom)) {
|
7516 | return (0, _$domUtils_66.nodeContains)(ignoreFrom, element);
|
7517 | }
|
7518 |
|
7519 | return false;
|
7520 | }
|
7521 | |
7522 |
|
7523 |
|
7524 |
|
7525 |
|
7526 |
|
7527 |
|
7528 |
|
7529 |
|
7530 | }, {
|
7531 | key: "fire",
|
7532 | value: function fire(iEvent) {
|
7533 | this.events.fire(iEvent);
|
7534 | return this;
|
7535 | }
|
7536 | }, {
|
7537 | key: "_onOff",
|
7538 | value: function _onOff(method, typeArg, listenerArg, options) {
|
7539 | if (_$is_70.default.object(typeArg) && !_$is_70.default.array(typeArg)) {
|
7540 | options = listenerArg;
|
7541 | listenerArg = null;
|
7542 | }
|
7543 |
|
7544 | var addRemove = method === 'on' ? 'add' : 'remove';
|
7545 | var listeners = (0, _$normalizeListeners_73.default)(typeArg, listenerArg);
|
7546 |
|
7547 | for (var type in listeners) {
|
7548 | if (type === 'wheel') {
|
7549 | type = _$browser_63.default.wheelEvent;
|
7550 | }
|
7551 |
|
7552 | for (var _i = 0; _i < listeners[type].length; _i++) {
|
7553 | var _ref;
|
7554 |
|
7555 | _ref = listeners[type][_i];
|
7556 | var listener = _ref;
|
7557 |
|
7558 | if ((0, _$isNonNativeEvent_25.default)(type, this._actions)) {
|
7559 | this.events[method](type, listener);
|
7560 | }
|
7561 | else if (_$is_70.default.string(this.target)) {
|
7562 | this._scopeEvents["".concat(addRemove, "Delegate")](this.target, this._context, type, listener, options);
|
7563 | }
|
7564 | else {
|
7565 | this._scopeEvents[addRemove](this.target, type, listener, options);
|
7566 | }
|
7567 | }
|
7568 | }
|
7569 |
|
7570 | return this;
|
7571 | }
|
7572 | |
7573 |
|
7574 |
|
7575 |
|
7576 |
|
7577 |
|
7578 |
|
7579 |
|
7580 |
|
7581 |
|
7582 |
|
7583 | }, {
|
7584 | key: "on",
|
7585 | value: function on(types, listener, options) {
|
7586 | return this._onOff('on', types, listener, options);
|
7587 | }
|
7588 | |
7589 |
|
7590 |
|
7591 |
|
7592 |
|
7593 |
|
7594 |
|
7595 |
|
7596 |
|
7597 |
|
7598 |
|
7599 | }, {
|
7600 | key: "off",
|
7601 | value: function off(types, listener, options) {
|
7602 | return this._onOff('off', types, listener, options);
|
7603 | }
|
7604 | |
7605 |
|
7606 |
|
7607 |
|
7608 |
|
7609 |
|
7610 |
|
7611 | }, {
|
7612 | key: "set",
|
7613 | value: function set(options) {
|
7614 | var defaults = this._defaults;
|
7615 |
|
7616 | if (!_$is_70.default.object(options)) {
|
7617 | options = {};
|
7618 | }
|
7619 |
|
7620 | ;
|
7621 | this.options = (0, _$clone_64.default)(defaults.base);
|
7622 |
|
7623 | for (var actionName_ in this._actions.methodDict) {
|
7624 | var actionName = actionName_;
|
7625 | var methodName = this._actions.methodDict[actionName];
|
7626 | this.options[actionName] = {};
|
7627 | this.setPerAction(actionName, (0, _$extend_67.default)((0, _$extend_67.default)({}, defaults.perAction), defaults.actions[actionName]));
|
7628 | this[methodName](options[actionName]);
|
7629 | }
|
7630 |
|
7631 | for (var setting in options) {
|
7632 | if (_$is_70.default.func(this[setting])) {
|
7633 | ;
|
7634 | this[setting](options[setting]);
|
7635 | }
|
7636 | }
|
7637 |
|
7638 | return this;
|
7639 | }
|
7640 | |
7641 |
|
7642 |
|
7643 |
|
7644 |
|
7645 | }, {
|
7646 | key: "unset",
|
7647 | value: function unset() {
|
7648 | if (_$is_70.default.string(this.target)) {
|
7649 |
|
7650 | for (var type in this._scopeEvents.delegatedEvents) {
|
7651 | var delegated = this._scopeEvents.delegatedEvents[type];
|
7652 |
|
7653 | for (var i = delegated.length - 1; i >= 0; i--) {
|
7654 | var _delegated$i = delegated[i],
|
7655 | selector = _delegated$i.selector,
|
7656 | context = _delegated$i.context,
|
7657 | listeners = _delegated$i.listeners;
|
7658 |
|
7659 | if (selector === this.target && context === this._context) {
|
7660 | delegated.splice(i, 1);
|
7661 | }
|
7662 |
|
7663 | for (var l = listeners.length - 1; l >= 0; l--) {
|
7664 | this._scopeEvents.removeDelegate(this.target, this._context, type, listeners[l][0], listeners[l][1]);
|
7665 | }
|
7666 | }
|
7667 | }
|
7668 | } else {
|
7669 | this._scopeEvents.remove(this.target, 'all');
|
7670 | }
|
7671 | }
|
7672 | }]);
|
7673 |
|
7674 | return Interactable;
|
7675 | }();
|
7676 |
|
7677 | _$Interactable_17.Interactable = Interactable;
|
7678 | var _$InteractableSet_18 = {};
|
7679 | "use strict";
|
7680 |
|
7681 | Object.defineProperty(_$InteractableSet_18, "__esModule", {
|
7682 | value: true
|
7683 | });
|
7684 | _$InteractableSet_18.InteractableSet = void 0;
|
7685 |
|
7686 |
|
7687 | ;
|
7688 |
|
7689 |
|
7690 | ;
|
7691 |
|
7692 |
|
7693 | ;
|
7694 |
|
7695 |
|
7696 | ;
|
7697 |
|
7698 | function ___classCallCheck_18(instance, Constructor) {
|
7699 | if (!(instance instanceof Constructor)) {
|
7700 | throw new TypeError("Cannot call a class as a function");
|
7701 | }
|
7702 | }
|
7703 |
|
7704 | function ___defineProperties_18(target, props) {
|
7705 | for (var i = 0; i < props.length; i++) {
|
7706 | var descriptor = props[i];
|
7707 | descriptor.enumerable = descriptor.enumerable || false;
|
7708 | descriptor.configurable = true;
|
7709 | if ("value" in descriptor) descriptor.writable = true;
|
7710 | Object.defineProperty(target, descriptor.key, descriptor);
|
7711 | }
|
7712 | }
|
7713 |
|
7714 | function ___createClass_18(Constructor, protoProps, staticProps) {
|
7715 | if (protoProps) ___defineProperties_18(Constructor.prototype, protoProps);
|
7716 | if (staticProps) ___defineProperties_18(Constructor, staticProps);
|
7717 | return Constructor;
|
7718 | }
|
7719 |
|
7720 | function ___defineProperty_18(obj, key, value) {
|
7721 | if (key in obj) {
|
7722 | Object.defineProperty(obj, key, {
|
7723 | value: value,
|
7724 | enumerable: true,
|
7725 | configurable: true,
|
7726 | writable: true
|
7727 | });
|
7728 | } else {
|
7729 | obj[key] = value;
|
7730 | }
|
7731 |
|
7732 | return obj;
|
7733 | }
|
7734 |
|
7735 | var InteractableSet = function () {
|
7736 |
|
7737 | function InteractableSet(scope) {
|
7738 | var _this = this;
|
7739 |
|
7740 | ___classCallCheck_18(this, InteractableSet);
|
7741 |
|
7742 | ___defineProperty_18(this, "list", []);
|
7743 |
|
7744 | ___defineProperty_18(this, "selectorMap", {});
|
7745 |
|
7746 | ___defineProperty_18(this, "scope", void 0);
|
7747 |
|
7748 | this.scope = scope;
|
7749 | scope.addListeners({
|
7750 | 'interactable:unset': function interactableUnset(_ref) {
|
7751 | var interactable = _ref.interactable;
|
7752 | var target = interactable.target,
|
7753 | context = interactable._context;
|
7754 | var targetMappings = _$is_70.default.string(target) ? _this.selectorMap[target] : target[_this.scope.id];
|
7755 |
|
7756 | var targetIndex = _$arr_62.findIndex(targetMappings, function (m) {
|
7757 | return m.context === context;
|
7758 | });
|
7759 |
|
7760 | if (targetMappings[targetIndex]) {
|
7761 |
|
7762 | targetMappings[targetIndex].context = null;
|
7763 | targetMappings[targetIndex].interactable = null;
|
7764 | }
|
7765 |
|
7766 | targetMappings.splice(targetIndex, 1);
|
7767 | }
|
7768 | });
|
7769 | }
|
7770 |
|
7771 | ___createClass_18(InteractableSet, [{
|
7772 | key: "new",
|
7773 | value: function _new(target, options) {
|
7774 | options = (0, _$extend_67.default)(options || {}, {
|
7775 | actions: this.scope.actions
|
7776 | });
|
7777 | var interactable = new this.scope.Interactable(target, options, this.scope.document, this.scope.events);
|
7778 | var mappingInfo = {
|
7779 | context: interactable._context,
|
7780 | interactable: interactable
|
7781 | };
|
7782 | this.scope.addDocument(interactable._doc);
|
7783 | this.list.push(interactable);
|
7784 |
|
7785 | if (_$is_70.default.string(target)) {
|
7786 | if (!this.selectorMap[target]) {
|
7787 | this.selectorMap[target] = [];
|
7788 | }
|
7789 |
|
7790 | this.selectorMap[target].push(mappingInfo);
|
7791 | } else {
|
7792 | if (!interactable.target[this.scope.id]) {
|
7793 | Object.defineProperty(target, this.scope.id, {
|
7794 | value: [],
|
7795 | configurable: true
|
7796 | });
|
7797 | }
|
7798 |
|
7799 | ;
|
7800 | target[this.scope.id].push(mappingInfo);
|
7801 | }
|
7802 |
|
7803 | this.scope.fire('interactable:new', {
|
7804 | target: target,
|
7805 | options: options,
|
7806 | interactable: interactable,
|
7807 | win: this.scope._win
|
7808 | });
|
7809 | return interactable;
|
7810 | }
|
7811 | }, {
|
7812 | key: "get",
|
7813 | value: function get(target, options) {
|
7814 | var context = options && options.context || this.scope.document;
|
7815 |
|
7816 | var isSelector = _$is_70.default.string(target);
|
7817 |
|
7818 | var targetMappings = isSelector ? this.selectorMap[target] : target[this.scope.id];
|
7819 |
|
7820 | if (!targetMappings) {
|
7821 | return null;
|
7822 | }
|
7823 |
|
7824 | var found = _$arr_62.find(targetMappings, function (m) {
|
7825 | return m.context === context && (isSelector || m.interactable.inContext(target));
|
7826 | });
|
7827 |
|
7828 | return found && found.interactable;
|
7829 | }
|
7830 | }, {
|
7831 | key: "forEachMatch",
|
7832 | value: function forEachMatch(node, callback) {
|
7833 | for (var _i = 0; _i < this.list.length; _i++) {
|
7834 | var _ref2;
|
7835 |
|
7836 | _ref2 = this.list[_i];
|
7837 | var _interactable = _ref2;
|
7838 | var ret = void 0;
|
7839 |
|
7840 | if ((_$is_70.default.string(_interactable.target) ?
|
7841 | _$is_70.default.element(node) && _$domUtils_66.matchesSelector(node, _interactable.target) :
|
7842 | node === _interactable.target) &&
|
7843 | _interactable.inContext(node)) {
|
7844 | ret = callback(_interactable);
|
7845 | }
|
7846 |
|
7847 | if (ret !== undefined) {
|
7848 | return ret;
|
7849 | }
|
7850 | }
|
7851 | }
|
7852 | }]);
|
7853 |
|
7854 | return InteractableSet;
|
7855 | }();
|
7856 |
|
7857 | _$InteractableSet_18.InteractableSet = InteractableSet;
|
7858 | var _$events_21 = {};
|
7859 | "use strict";
|
7860 |
|
7861 | Object.defineProperty(_$events_21, "__esModule", {
|
7862 | value: true
|
7863 | });
|
7864 | _$events_21.default = void 0;
|
7865 |
|
7866 |
|
7867 | ;
|
7868 |
|
7869 |
|
7870 | ;
|
7871 |
|
7872 |
|
7873 | ;
|
7874 |
|
7875 |
|
7876 | ;
|
7877 |
|
7878 |
|
7879 | ;
|
7880 |
|
7881 |
|
7882 | ;
|
7883 |
|
7884 | function ___classCallCheck_21(instance, Constructor) {
|
7885 | if (!(instance instanceof Constructor)) {
|
7886 | throw new TypeError("Cannot call a class as a function");
|
7887 | }
|
7888 | }
|
7889 |
|
7890 | function ___defineProperties_21(target, props) {
|
7891 | for (var i = 0; i < props.length; i++) {
|
7892 | var descriptor = props[i];
|
7893 | descriptor.enumerable = descriptor.enumerable || false;
|
7894 | descriptor.configurable = true;
|
7895 | if ("value" in descriptor) descriptor.writable = true;
|
7896 | Object.defineProperty(target, descriptor.key, descriptor);
|
7897 | }
|
7898 | }
|
7899 |
|
7900 | function ___createClass_21(Constructor, protoProps, staticProps) {
|
7901 | if (protoProps) ___defineProperties_21(Constructor.prototype, protoProps);
|
7902 | if (staticProps) ___defineProperties_21(Constructor, staticProps);
|
7903 | return Constructor;
|
7904 | }
|
7905 |
|
7906 | function ___defineProperty_21(obj, key, value) {
|
7907 | if (key in obj) {
|
7908 | Object.defineProperty(obj, key, {
|
7909 | value: value,
|
7910 | enumerable: true,
|
7911 | configurable: true,
|
7912 | writable: true
|
7913 | });
|
7914 | } else {
|
7915 | obj[key] = value;
|
7916 | }
|
7917 |
|
7918 | return obj;
|
7919 | }
|
7920 |
|
7921 | function ___slicedToArray_21(arr, i) {
|
7922 | return ___arrayWithHoles_21(arr) || ___iterableToArrayLimit_21(arr, i) || ___unsupportedIterableToArray_21(arr, i) || ___nonIterableRest_21();
|
7923 | }
|
7924 |
|
7925 | function ___nonIterableRest_21() {
|
7926 | throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
7927 | }
|
7928 |
|
7929 | function ___unsupportedIterableToArray_21(o, minLen) {
|
7930 | if (!o) return;
|
7931 | if (typeof o === "string") return ___arrayLikeToArray_21(o, minLen);
|
7932 | var n = Object.prototype.toString.call(o).slice(8, -1);
|
7933 | if (n === "Object" && o.constructor) n = o.constructor.name;
|
7934 | if (n === "Map" || n === "Set") return Array.from(o);
|
7935 | if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return ___arrayLikeToArray_21(o, minLen);
|
7936 | }
|
7937 |
|
7938 | function ___arrayLikeToArray_21(arr, len) {
|
7939 | if (len == null || len > arr.length) len = arr.length;
|
7940 |
|
7941 | for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
7942 | arr2[i] = arr[i];
|
7943 | }
|
7944 |
|
7945 | return arr2;
|
7946 | }
|
7947 |
|
7948 | function ___iterableToArrayLimit_21(arr, i) {
|
7949 | if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
|
7950 | var _arr = [];
|
7951 | var _n = true;
|
7952 | var _d = false;
|
7953 | var _e = undefined;
|
7954 |
|
7955 | try {
|
7956 | for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
|
7957 | _arr.push(_s.value);
|
7958 |
|
7959 | if (i && _arr.length === i) break;
|
7960 | }
|
7961 | } catch (err) {
|
7962 | _d = true;
|
7963 | _e = err;
|
7964 | } finally {
|
7965 | try {
|
7966 | if (!_n && _i["return"] != null) _i["return"]();
|
7967 | } finally {
|
7968 | if (_d) throw _e;
|
7969 | }
|
7970 | }
|
7971 |
|
7972 | return _arr;
|
7973 | }
|
7974 |
|
7975 | function ___arrayWithHoles_21(arr) {
|
7976 | if (Array.isArray(arr)) return arr;
|
7977 | }
|
7978 |
|
7979 | function __install_21(scope) {
|
7980 | var _scope$document;
|
7981 |
|
7982 | var targets = [];
|
7983 | var delegatedEvents = {};
|
7984 | var documents = [];
|
7985 | var eventsMethods = {
|
7986 | add: add,
|
7987 | remove: remove,
|
7988 | addDelegate: addDelegate,
|
7989 | removeDelegate: removeDelegate,
|
7990 | delegateListener: delegateListener,
|
7991 | delegateUseCapture: delegateUseCapture,
|
7992 | delegatedEvents: delegatedEvents,
|
7993 | documents: documents,
|
7994 | targets: targets,
|
7995 | supportsOptions: false,
|
7996 | supportsPassive: false
|
7997 | };
|
7998 |
|
7999 | (_scope$document = scope.document) == null ? void 0 : _scope$document.createElement('div').addEventListener('test', null, {
|
8000 | get capture() {
|
8001 | return eventsMethods.supportsOptions = true;
|
8002 | },
|
8003 |
|
8004 | get passive() {
|
8005 | return eventsMethods.supportsPassive = true;
|
8006 | }
|
8007 |
|
8008 | });
|
8009 | scope.events = eventsMethods;
|
8010 |
|
8011 | function add(eventTarget, type, listener, optionalArg) {
|
8012 | var options = __getOptions_21(optionalArg);
|
8013 |
|
8014 | var target = _$arr_62.find(targets, function (t) {
|
8015 | return t.eventTarget === eventTarget;
|
8016 | });
|
8017 |
|
8018 | if (!target) {
|
8019 | target = {
|
8020 | eventTarget: eventTarget,
|
8021 | events: {}
|
8022 | };
|
8023 | targets.push(target);
|
8024 | }
|
8025 |
|
8026 | if (!target.events[type]) {
|
8027 | target.events[type] = [];
|
8028 | }
|
8029 |
|
8030 | if (eventTarget.addEventListener && !_$arr_62.contains(target.events[type], listener)) {
|
8031 | eventTarget.addEventListener(type, listener, eventsMethods.supportsOptions ? options : options.capture);
|
8032 | target.events[type].push(listener);
|
8033 | }
|
8034 | }
|
8035 |
|
8036 | function remove(eventTarget, type, listener, optionalArg) {
|
8037 | var options = __getOptions_21(optionalArg);
|
8038 |
|
8039 | var targetIndex = _$arr_62.findIndex(targets, function (t) {
|
8040 | return t.eventTarget === eventTarget;
|
8041 | });
|
8042 |
|
8043 | var target = targets[targetIndex];
|
8044 |
|
8045 | if (!target || !target.events) {
|
8046 | return;
|
8047 | }
|
8048 |
|
8049 | if (type === 'all') {
|
8050 | for (type in target.events) {
|
8051 | if (target.events.hasOwnProperty(type)) {
|
8052 | remove(eventTarget, type, 'all');
|
8053 | }
|
8054 | }
|
8055 |
|
8056 | return;
|
8057 | }
|
8058 |
|
8059 | var typeIsEmpty = false;
|
8060 | var typeListeners = target.events[type];
|
8061 |
|
8062 | if (typeListeners) {
|
8063 | if (listener === 'all') {
|
8064 | for (var i = typeListeners.length - 1; i >= 0; i--) {
|
8065 | remove(eventTarget, type, typeListeners[i], options);
|
8066 | }
|
8067 |
|
8068 | return;
|
8069 | } else {
|
8070 | for (var _i = 0; _i < typeListeners.length; _i++) {
|
8071 | if (typeListeners[_i] === listener) {
|
8072 | eventTarget.removeEventListener(type, listener, eventsMethods.supportsOptions ? options : options.capture);
|
8073 | typeListeners.splice(_i, 1);
|
8074 |
|
8075 | if (typeListeners.length === 0) {
|
8076 | delete target.events[type];
|
8077 | typeIsEmpty = true;
|
8078 | }
|
8079 |
|
8080 | break;
|
8081 | }
|
8082 | }
|
8083 | }
|
8084 | }
|
8085 |
|
8086 | if (typeIsEmpty && !Object.keys(target.events).length) {
|
8087 | targets.splice(targetIndex, 1);
|
8088 | }
|
8089 | }
|
8090 |
|
8091 | function addDelegate(selector, context, type, listener, optionalArg) {
|
8092 | var options = __getOptions_21(optionalArg);
|
8093 |
|
8094 | if (!delegatedEvents[type]) {
|
8095 | delegatedEvents[type] = [];
|
8096 |
|
8097 | for (var _i2 = 0; _i2 < documents.length; _i2++) {
|
8098 | var _ref;
|
8099 |
|
8100 | _ref = documents[_i2];
|
8101 | var doc = _ref;
|
8102 | add(doc, type, delegateListener);
|
8103 | add(doc, type, delegateUseCapture, true);
|
8104 | }
|
8105 | }
|
8106 |
|
8107 | var delegates = delegatedEvents[type];
|
8108 |
|
8109 | var delegate = _$arr_62.find(delegates, function (d) {
|
8110 | return d.selector === selector && d.context === context;
|
8111 | });
|
8112 |
|
8113 | if (!delegate) {
|
8114 | delegate = {
|
8115 | selector: selector,
|
8116 | context: context,
|
8117 | listeners: []
|
8118 | };
|
8119 | delegates.push(delegate);
|
8120 | }
|
8121 |
|
8122 | delegate.listeners.push([listener, options]);
|
8123 | }
|
8124 |
|
8125 | function removeDelegate(selector, context, type, listener, optionalArg) {
|
8126 | var options = __getOptions_21(optionalArg);
|
8127 |
|
8128 | var delegates = delegatedEvents[type];
|
8129 | var matchFound = false;
|
8130 | var index;
|
8131 | if (!delegates) return;
|
8132 |
|
8133 | for (index = delegates.length - 1; index >= 0; index--) {
|
8134 | var cur = delegates[index];
|
8135 |
|
8136 | if (cur.selector === selector && cur.context === context) {
|
8137 | var listeners = cur.listeners;
|
8138 |
|
8139 | for (var i = listeners.length - 1; i >= 0; i--) {
|
8140 | var _listeners$i = ___slicedToArray_21(listeners[i], 2),
|
8141 | fn = _listeners$i[0],
|
8142 | _listeners$i$ = _listeners$i[1],
|
8143 | capture = _listeners$i$.capture,
|
8144 | passive = _listeners$i$.passive;
|
8145 |
|
8146 |
|
8147 | if (fn === listener && capture === options.capture && passive === options.passive) {
|
8148 |
|
8149 | listeners.splice(i, 1);
|
8150 |
|
8151 |
|
8152 | if (!listeners.length) {
|
8153 | delegates.splice(index, 1);
|
8154 |
|
8155 | remove(context, type, delegateListener);
|
8156 | remove(context, type, delegateUseCapture, true);
|
8157 | }
|
8158 |
|
8159 |
|
8160 | matchFound = true;
|
8161 | break;
|
8162 | }
|
8163 | }
|
8164 |
|
8165 | if (matchFound) {
|
8166 | break;
|
8167 | }
|
8168 | }
|
8169 | }
|
8170 | }
|
8171 |
|
8172 |
|
8173 |
|
8174 | function delegateListener(event, optionalArg) {
|
8175 | var options = __getOptions_21(optionalArg);
|
8176 |
|
8177 | var fakeEvent = new FakeEvent(event);
|
8178 | var delegates = delegatedEvents[event.type];
|
8179 |
|
8180 | var _pointerUtils$getEven = _$pointerUtils_75.getEventTargets(event),
|
8181 | _pointerUtils$getEven2 = ___slicedToArray_21(_pointerUtils$getEven, 1),
|
8182 | eventTarget = _pointerUtils$getEven2[0];
|
8183 |
|
8184 | var element = eventTarget;
|
8185 |
|
8186 | while (_$is_70.default.element(element)) {
|
8187 | for (var i = 0; i < delegates.length; i++) {
|
8188 | var cur = delegates[i];
|
8189 | var selector = cur.selector,
|
8190 | context = cur.context;
|
8191 |
|
8192 | if (_$domUtils_66.matchesSelector(element, selector) && _$domUtils_66.nodeContains(context, eventTarget) && _$domUtils_66.nodeContains(context, element)) {
|
8193 | var listeners = cur.listeners;
|
8194 | fakeEvent.currentTarget = element;
|
8195 |
|
8196 | for (var _i3 = 0; _i3 < listeners.length; _i3++) {
|
8197 | var _ref2;
|
8198 |
|
8199 | _ref2 = listeners[_i3];
|
8200 |
|
8201 | var _ref3 = _ref2,
|
8202 | _ref4 = ___slicedToArray_21(_ref3, 2),
|
8203 | fn = _ref4[0],
|
8204 | _ref4$ = _ref4[1],
|
8205 | capture = _ref4$.capture,
|
8206 | passive = _ref4$.passive;
|
8207 |
|
8208 | if (capture === options.capture && passive === options.passive) {
|
8209 | fn(fakeEvent);
|
8210 | }
|
8211 | }
|
8212 | }
|
8213 | }
|
8214 |
|
8215 | element = _$domUtils_66.parentNode(element);
|
8216 | }
|
8217 | }
|
8218 |
|
8219 | function delegateUseCapture(event) {
|
8220 | return delegateListener.call(this, event, true);
|
8221 | }
|
8222 |
|
8223 |
|
8224 | return eventsMethods;
|
8225 | }
|
8226 |
|
8227 | var FakeEvent = function () {
|
8228 | function FakeEvent(originalEvent) {
|
8229 | ___classCallCheck_21(this, FakeEvent);
|
8230 |
|
8231 | ___defineProperty_21(this, "currentTarget", void 0);
|
8232 |
|
8233 | ___defineProperty_21(this, "originalEvent", void 0);
|
8234 |
|
8235 | ___defineProperty_21(this, "type", void 0);
|
8236 |
|
8237 | this.originalEvent = originalEvent;
|
8238 |
|
8239 | (0, _$pointerExtend_74.default)(this, originalEvent);
|
8240 | }
|
8241 |
|
8242 | ___createClass_21(FakeEvent, [{
|
8243 | key: "preventOriginalDefault",
|
8244 | value: function preventOriginalDefault() {
|
8245 | this.originalEvent.preventDefault();
|
8246 | }
|
8247 | }, {
|
8248 | key: "stopPropagation",
|
8249 | value: function stopPropagation() {
|
8250 | this.originalEvent.stopPropagation();
|
8251 | }
|
8252 | }, {
|
8253 | key: "stopImmediatePropagation",
|
8254 | value: function stopImmediatePropagation() {
|
8255 | this.originalEvent.stopImmediatePropagation();
|
8256 | }
|
8257 | }]);
|
8258 |
|
8259 | return FakeEvent;
|
8260 | }();
|
8261 |
|
8262 | function __getOptions_21(param) {
|
8263 | if (!_$is_70.default.object(param)) {
|
8264 | return {
|
8265 | capture: !!param,
|
8266 | passive: false
|
8267 | };
|
8268 | }
|
8269 |
|
8270 | var options = (0, _$extend_67.default)({}, param);
|
8271 | options.capture = !!param.capture;
|
8272 | options.passive = !!param.passive;
|
8273 | return options;
|
8274 | }
|
8275 |
|
8276 | var ___default_21 = {
|
8277 | id: 'events',
|
8278 | install: __install_21
|
8279 | };
|
8280 | _$events_21.default = ___default_21;
|
8281 | var _$interactionFinder_23 = {};
|
8282 | "use strict";
|
8283 |
|
8284 | Object.defineProperty(_$interactionFinder_23, "__esModule", {
|
8285 | value: true
|
8286 | });
|
8287 | _$interactionFinder_23.default = void 0;
|
8288 |
|
8289 |
|
8290 | ;
|
8291 | var finder = {
|
8292 | methodOrder: ['simulationResume', 'mouseOrPen', 'hasPointer', 'idle'],
|
8293 | search: function search(details) {
|
8294 | for (var _i = 0; _i < finder.methodOrder.length; _i++) {
|
8295 | var _ref;
|
8296 |
|
8297 | _ref = finder.methodOrder[_i];
|
8298 | var method = _ref;
|
8299 | var interaction = finder[method](details);
|
8300 |
|
8301 | if (interaction) {
|
8302 | return interaction;
|
8303 | }
|
8304 | }
|
8305 |
|
8306 | return null;
|
8307 | },
|
8308 |
|
8309 | simulationResume: function simulationResume(_ref2) {
|
8310 | var pointerType = _ref2.pointerType,
|
8311 | eventType = _ref2.eventType,
|
8312 | eventTarget = _ref2.eventTarget,
|
8313 | scope = _ref2.scope;
|
8314 |
|
8315 | if (!/down|start/i.test(eventType)) {
|
8316 | return null;
|
8317 | }
|
8318 |
|
8319 | for (var _i2 = 0; _i2 < scope.interactions.list.length; _i2++) {
|
8320 | var _ref3;
|
8321 |
|
8322 | _ref3 = scope.interactions.list[_i2];
|
8323 | var interaction = _ref3;
|
8324 | var element = eventTarget;
|
8325 |
|
8326 | if (interaction.simulation && interaction.simulation.allowResume && interaction.pointerType === pointerType) {
|
8327 | while (element) {
|
8328 |
|
8329 | if (element === interaction.element) {
|
8330 | return interaction;
|
8331 | }
|
8332 |
|
8333 | element = _$domUtils_66.parentNode(element);
|
8334 | }
|
8335 | }
|
8336 | }
|
8337 |
|
8338 | return null;
|
8339 | },
|
8340 |
|
8341 | mouseOrPen: function mouseOrPen(_ref4) {
|
8342 | var pointerId = _ref4.pointerId,
|
8343 | pointerType = _ref4.pointerType,
|
8344 | eventType = _ref4.eventType,
|
8345 | scope = _ref4.scope;
|
8346 |
|
8347 | if (pointerType !== 'mouse' && pointerType !== 'pen') {
|
8348 | return null;
|
8349 | }
|
8350 |
|
8351 | var firstNonActive;
|
8352 |
|
8353 | for (var _i3 = 0; _i3 < scope.interactions.list.length; _i3++) {
|
8354 | var _ref5;
|
8355 |
|
8356 | _ref5 = scope.interactions.list[_i3];
|
8357 | var interaction = _ref5;
|
8358 |
|
8359 | if (interaction.pointerType === pointerType) {
|
8360 |
|
8361 | if (interaction.simulation && !hasPointerId(interaction, pointerId)) {
|
8362 | continue;
|
8363 | }
|
8364 |
|
8365 |
|
8366 | if (interaction.interacting()) {
|
8367 | return interaction;
|
8368 | }
|
8369 | else if (!firstNonActive) {
|
8370 | firstNonActive = interaction;
|
8371 | }
|
8372 | }
|
8373 | }
|
8374 |
|
8375 |
|
8376 |
|
8377 | if (firstNonActive) {
|
8378 | return firstNonActive;
|
8379 | }
|
8380 |
|
8381 |
|
8382 |
|
8383 |
|
8384 | for (var _i4 = 0; _i4 < scope.interactions.list.length; _i4++) {
|
8385 | var _ref6;
|
8386 |
|
8387 | _ref6 = scope.interactions.list[_i4];
|
8388 | var _interaction = _ref6;
|
8389 |
|
8390 | if (_interaction.pointerType === pointerType && !(/down/i.test(eventType) && _interaction.simulation)) {
|
8391 | return _interaction;
|
8392 | }
|
8393 | }
|
8394 |
|
8395 | return null;
|
8396 | },
|
8397 |
|
8398 | hasPointer: function hasPointer(_ref7) {
|
8399 | var pointerId = _ref7.pointerId,
|
8400 | scope = _ref7.scope;
|
8401 |
|
8402 | for (var _i5 = 0; _i5 < scope.interactions.list.length; _i5++) {
|
8403 | var _ref8;
|
8404 |
|
8405 | _ref8 = scope.interactions.list[_i5];
|
8406 | var interaction = _ref8;
|
8407 |
|
8408 | if (hasPointerId(interaction, pointerId)) {
|
8409 | return interaction;
|
8410 | }
|
8411 | }
|
8412 |
|
8413 | return null;
|
8414 | },
|
8415 |
|
8416 | idle: function idle(_ref9) {
|
8417 | var pointerType = _ref9.pointerType,
|
8418 | scope = _ref9.scope;
|
8419 |
|
8420 | for (var _i6 = 0; _i6 < scope.interactions.list.length; _i6++) {
|
8421 | var _ref10;
|
8422 |
|
8423 | _ref10 = scope.interactions.list[_i6];
|
8424 | var interaction = _ref10;
|
8425 |
|
8426 | if (interaction.pointers.length === 1) {
|
8427 | var target = interaction.interactable;
|
8428 |
|
8429 |
|
8430 | if (target && !(target.options.gesture && target.options.gesture.enabled)) {
|
8431 | continue;
|
8432 | }
|
8433 | }
|
8434 | else if (interaction.pointers.length >= 2) {
|
8435 | continue;
|
8436 | }
|
8437 |
|
8438 | if (!interaction.interacting() && pointerType === interaction.pointerType) {
|
8439 | return interaction;
|
8440 | }
|
8441 | }
|
8442 |
|
8443 | return null;
|
8444 | }
|
8445 | };
|
8446 |
|
8447 | function hasPointerId(interaction, pointerId) {
|
8448 | return interaction.pointers.some(function (_ref11) {
|
8449 | var id = _ref11.id;
|
8450 | return id === pointerId;
|
8451 | });
|
8452 | }
|
8453 |
|
8454 | var ___default_23 = finder;
|
8455 | _$interactionFinder_23.default = ___default_23;
|
8456 | var _$interactions_24 = {};
|
8457 | "use strict";
|
8458 |
|
8459 | function ___typeof_24(obj) {
|
8460 | "@babel/helpers - typeof";
|
8461 |
|
8462 | if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
8463 | ___typeof_24 = function _typeof(obj) {
|
8464 | return typeof obj;
|
8465 | };
|
8466 | } else {
|
8467 | ___typeof_24 = function _typeof(obj) {
|
8468 | return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
8469 | };
|
8470 | }
|
8471 |
|
8472 | return ___typeof_24(obj);
|
8473 | }
|
8474 |
|
8475 | Object.defineProperty(_$interactions_24, "__esModule", {
|
8476 | value: true
|
8477 | });
|
8478 | _$interactions_24.default = void 0;
|
8479 |
|
8480 |
|
8481 | ;
|
8482 |
|
8483 |
|
8484 | ;
|
8485 |
|
8486 |
|
8487 | ;
|
8488 |
|
8489 |
|
8490 | ;
|
8491 |
|
8492 |
|
8493 | ;
|
8494 |
|
8495 |
|
8496 | ;
|
8497 |
|
8498 |
|
8499 | ;
|
8500 |
|
8501 | function ___slicedToArray_24(arr, i) {
|
8502 | return ___arrayWithHoles_24(arr) || ___iterableToArrayLimit_24(arr, i) || ___unsupportedIterableToArray_24(arr, i) || ___nonIterableRest_24();
|
8503 | }
|
8504 |
|
8505 | function ___nonIterableRest_24() {
|
8506 | throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
8507 | }
|
8508 |
|
8509 | function ___unsupportedIterableToArray_24(o, minLen) {
|
8510 | if (!o) return;
|
8511 | if (typeof o === "string") return ___arrayLikeToArray_24(o, minLen);
|
8512 | var n = Object.prototype.toString.call(o).slice(8, -1);
|
8513 | if (n === "Object" && o.constructor) n = o.constructor.name;
|
8514 | if (n === "Map" || n === "Set") return Array.from(o);
|
8515 | if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return ___arrayLikeToArray_24(o, minLen);
|
8516 | }
|
8517 |
|
8518 | function ___arrayLikeToArray_24(arr, len) {
|
8519 | if (len == null || len > arr.length) len = arr.length;
|
8520 |
|
8521 | for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
8522 | arr2[i] = arr[i];
|
8523 | }
|
8524 |
|
8525 | return arr2;
|
8526 | }
|
8527 |
|
8528 | function ___iterableToArrayLimit_24(arr, i) {
|
8529 | if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
|
8530 | var _arr = [];
|
8531 | var _n = true;
|
8532 | var _d = false;
|
8533 | var _e = undefined;
|
8534 |
|
8535 | try {
|
8536 | for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
|
8537 | _arr.push(_s.value);
|
8538 |
|
8539 | if (i && _arr.length === i) break;
|
8540 | }
|
8541 | } catch (err) {
|
8542 | _d = true;
|
8543 | _e = err;
|
8544 | } finally {
|
8545 | try {
|
8546 | if (!_n && _i["return"] != null) _i["return"]();
|
8547 | } finally {
|
8548 | if (_d) throw _e;
|
8549 | }
|
8550 | }
|
8551 |
|
8552 | return _arr;
|
8553 | }
|
8554 |
|
8555 | function ___arrayWithHoles_24(arr) {
|
8556 | if (Array.isArray(arr)) return arr;
|
8557 | }
|
8558 |
|
8559 | function ___classCallCheck_24(instance, Constructor) {
|
8560 | if (!(instance instanceof Constructor)) {
|
8561 | throw new TypeError("Cannot call a class as a function");
|
8562 | }
|
8563 | }
|
8564 |
|
8565 | function ___defineProperties_24(target, props) {
|
8566 | for (var i = 0; i < props.length; i++) {
|
8567 | var descriptor = props[i];
|
8568 | descriptor.enumerable = descriptor.enumerable || false;
|
8569 | descriptor.configurable = true;
|
8570 | if ("value" in descriptor) descriptor.writable = true;
|
8571 | Object.defineProperty(target, descriptor.key, descriptor);
|
8572 | }
|
8573 | }
|
8574 |
|
8575 | function ___createClass_24(Constructor, protoProps, staticProps) {
|
8576 | if (protoProps) ___defineProperties_24(Constructor.prototype, protoProps);
|
8577 | if (staticProps) ___defineProperties_24(Constructor, staticProps);
|
8578 | return Constructor;
|
8579 | }
|
8580 |
|
8581 | function ___inherits_24(subClass, superClass) {
|
8582 | if (typeof superClass !== "function" && superClass !== null) {
|
8583 | throw new TypeError("Super expression must either be null or a function");
|
8584 | }
|
8585 |
|
8586 | subClass.prototype = Object.create(superClass && superClass.prototype, {
|
8587 | constructor: {
|
8588 | value: subClass,
|
8589 | writable: true,
|
8590 | configurable: true
|
8591 | }
|
8592 | });
|
8593 | if (superClass) ___setPrototypeOf_24(subClass, superClass);
|
8594 | }
|
8595 |
|
8596 | function ___setPrototypeOf_24(o, p) {
|
8597 | ___setPrototypeOf_24 = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
8598 | o.__proto__ = p;
|
8599 | return o;
|
8600 | };
|
8601 |
|
8602 | return ___setPrototypeOf_24(o, p);
|
8603 | }
|
8604 |
|
8605 | function ___createSuper_24(Derived) {
|
8606 | var hasNativeReflectConstruct = ___isNativeReflectConstruct_24();
|
8607 |
|
8608 | return function _createSuperInternal() {
|
8609 | var Super = ___getPrototypeOf_24(Derived),
|
8610 | result;
|
8611 |
|
8612 | if (hasNativeReflectConstruct) {
|
8613 | var NewTarget = ___getPrototypeOf_24(this).constructor;
|
8614 |
|
8615 | result = Reflect.construct(Super, arguments, NewTarget);
|
8616 | } else {
|
8617 | result = Super.apply(this, arguments);
|
8618 | }
|
8619 |
|
8620 | return ___possibleConstructorReturn_24(this, result);
|
8621 | };
|
8622 | }
|
8623 |
|
8624 | function ___possibleConstructorReturn_24(self, call) {
|
8625 | if (call && (___typeof_24(call) === "object" || typeof call === "function")) {
|
8626 | return call;
|
8627 | }
|
8628 |
|
8629 | return ___assertThisInitialized_24(self);
|
8630 | }
|
8631 |
|
8632 | function ___assertThisInitialized_24(self) {
|
8633 | if (self === void 0) {
|
8634 | throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
8635 | }
|
8636 |
|
8637 | return self;
|
8638 | }
|
8639 |
|
8640 | function ___isNativeReflectConstruct_24() {
|
8641 | if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
8642 | if (Reflect.construct.sham) return false;
|
8643 | if (typeof Proxy === "function") return true;
|
8644 |
|
8645 | try {
|
8646 | Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
8647 | return true;
|
8648 | } catch (e) {
|
8649 | return false;
|
8650 | }
|
8651 | }
|
8652 |
|
8653 | function ___getPrototypeOf_24(o) {
|
8654 | ___getPrototypeOf_24 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
8655 | return o.__proto__ || Object.getPrototypeOf(o);
|
8656 | };
|
8657 | return ___getPrototypeOf_24(o);
|
8658 | }
|
8659 |
|
8660 | var methodNames = ['pointerDown', 'pointerMove', 'pointerUp', 'updatePointer', 'removePointer', 'windowBlur'];
|
8661 |
|
8662 | function __install_24(scope) {
|
8663 | var listeners = {};
|
8664 |
|
8665 | for (var _i = 0; _i < methodNames.length; _i++) {
|
8666 | var _ref;
|
8667 |
|
8668 | _ref = methodNames[_i];
|
8669 | var method = _ref;
|
8670 | listeners[method] = doOnInteractions(method, scope);
|
8671 | }
|
8672 |
|
8673 | var pEventTypes = _$browser_63.default.pEventTypes;
|
8674 | var docEvents;
|
8675 |
|
8676 | if (_$domObjects_65.default.PointerEvent) {
|
8677 | docEvents = [{
|
8678 | type: pEventTypes.down,
|
8679 | listener: releasePointersOnRemovedEls
|
8680 | }, {
|
8681 | type: pEventTypes.down,
|
8682 | listener: listeners.pointerDown
|
8683 | }, {
|
8684 | type: pEventTypes.move,
|
8685 | listener: listeners.pointerMove
|
8686 | }, {
|
8687 | type: pEventTypes.up,
|
8688 | listener: listeners.pointerUp
|
8689 | }, {
|
8690 | type: pEventTypes.cancel,
|
8691 | listener: listeners.pointerUp
|
8692 | }];
|
8693 | } else {
|
8694 | docEvents = [{
|
8695 | type: 'mousedown',
|
8696 | listener: listeners.pointerDown
|
8697 | }, {
|
8698 | type: 'mousemove',
|
8699 | listener: listeners.pointerMove
|
8700 | }, {
|
8701 | type: 'mouseup',
|
8702 | listener: listeners.pointerUp
|
8703 | }, {
|
8704 | type: 'touchstart',
|
8705 | listener: releasePointersOnRemovedEls
|
8706 | }, {
|
8707 | type: 'touchstart',
|
8708 | listener: listeners.pointerDown
|
8709 | }, {
|
8710 | type: 'touchmove',
|
8711 | listener: listeners.pointerMove
|
8712 | }, {
|
8713 | type: 'touchend',
|
8714 | listener: listeners.pointerUp
|
8715 | }, {
|
8716 | type: 'touchcancel',
|
8717 | listener: listeners.pointerUp
|
8718 | }];
|
8719 | }
|
8720 |
|
8721 | docEvents.push({
|
8722 | type: 'blur',
|
8723 | listener: function listener(event) {
|
8724 | for (var _i2 = 0; _i2 < scope.interactions.list.length; _i2++) {
|
8725 | var _ref2;
|
8726 |
|
8727 | _ref2 = scope.interactions.list[_i2];
|
8728 | var interaction = _ref2;
|
8729 | interaction.documentBlur(event);
|
8730 | }
|
8731 | }
|
8732 | });
|
8733 |
|
8734 | scope.prevTouchTime = 0;
|
8735 |
|
8736 | scope.Interaction = function (_InteractionBase) {
|
8737 | ___inherits_24(_class, _InteractionBase);
|
8738 |
|
8739 | var _super = ___createSuper_24(_class);
|
8740 |
|
8741 | function _class() {
|
8742 | ___classCallCheck_24(this, _class);
|
8743 |
|
8744 | return _super.apply(this, arguments);
|
8745 | }
|
8746 |
|
8747 | ___createClass_24(_class, [{
|
8748 | key: "pointerMoveTolerance",
|
8749 | get: function get() {
|
8750 | return scope.interactions.pointerMoveTolerance;
|
8751 | },
|
8752 | set: function set(value) {
|
8753 | scope.interactions.pointerMoveTolerance = value;
|
8754 | }
|
8755 | }, {
|
8756 | key: "_now",
|
8757 | value: function _now() {
|
8758 | return scope.now();
|
8759 | }
|
8760 | }]);
|
8761 |
|
8762 | return _class;
|
8763 | }(_$Interaction_19.default);
|
8764 |
|
8765 | scope.interactions = {
|
8766 |
|
8767 | list: [],
|
8768 | new: function _new(options) {
|
8769 | options.scopeFire = function (name, arg) {
|
8770 | return scope.fire(name, arg);
|
8771 | };
|
8772 |
|
8773 | var interaction = new scope.Interaction(options);
|
8774 | scope.interactions.list.push(interaction);
|
8775 | return interaction;
|
8776 | },
|
8777 | listeners: listeners,
|
8778 | docEvents: docEvents,
|
8779 | pointerMoveTolerance: 1
|
8780 | };
|
8781 |
|
8782 | function releasePointersOnRemovedEls() {
|
8783 |
|
8784 | for (var _i3 = 0; _i3 < scope.interactions.list.length; _i3++) {
|
8785 | var _ref3;
|
8786 |
|
8787 | _ref3 = scope.interactions.list[_i3];
|
8788 | var interaction = _ref3;
|
8789 |
|
8790 | if (!interaction.pointerIsDown || interaction.pointerType !== 'touch' || interaction._interacting) {
|
8791 | continue;
|
8792 | }
|
8793 |
|
8794 |
|
8795 | var _loop = function _loop() {
|
8796 | _ref4 = interaction.pointers[_i4];
|
8797 | var pointer = _ref4;
|
8798 |
|
8799 | if (!scope.documents.some(function (_ref5) {
|
8800 | var doc = _ref5.doc;
|
8801 | return (0, _$domUtils_66.nodeContains)(doc, pointer.downTarget);
|
8802 | })) {
|
8803 |
|
8804 | interaction.removePointer(pointer.pointer, pointer.event);
|
8805 | }
|
8806 | };
|
8807 |
|
8808 | for (var _i4 = 0; _i4 < interaction.pointers.length; _i4++) {
|
8809 | var _ref4;
|
8810 |
|
8811 | _loop();
|
8812 | }
|
8813 | }
|
8814 | }
|
8815 |
|
8816 | scope.usePlugin(_$interactablePreventDefault_22.default);
|
8817 | }
|
8818 |
|
8819 | function doOnInteractions(method, scope) {
|
8820 | return function (event) {
|
8821 | var interactions = scope.interactions.list;
|
8822 |
|
8823 | var pointerType = _$pointerUtils_75.getPointerType(event);
|
8824 |
|
8825 | var _pointerUtils$getEven = _$pointerUtils_75.getEventTargets(event),
|
8826 | _pointerUtils$getEven2 = ___slicedToArray_24(_pointerUtils$getEven, 2),
|
8827 | eventTarget = _pointerUtils$getEven2[0],
|
8828 | curEventTarget = _pointerUtils$getEven2[1];
|
8829 |
|
8830 | var matches = [];
|
8831 |
|
8832 | if (/^touch/.test(event.type)) {
|
8833 | scope.prevTouchTime = scope.now();
|
8834 |
|
8835 | for (var _i5 = 0; _i5 < event.changedTouches.length; _i5++) {
|
8836 | var _ref6;
|
8837 |
|
8838 | _ref6 = event.changedTouches[_i5];
|
8839 | var changedTouch = _ref6;
|
8840 | var pointer = changedTouch;
|
8841 |
|
8842 | var pointerId = _$pointerUtils_75.getPointerId(pointer);
|
8843 |
|
8844 | var searchDetails = {
|
8845 | pointer: pointer,
|
8846 | pointerId: pointerId,
|
8847 | pointerType: pointerType,
|
8848 | eventType: event.type,
|
8849 | eventTarget: eventTarget,
|
8850 | curEventTarget: curEventTarget,
|
8851 | scope: scope
|
8852 | };
|
8853 | var interaction = getInteraction(searchDetails);
|
8854 | matches.push([searchDetails.pointer, searchDetails.eventTarget, searchDetails.curEventTarget, interaction]);
|
8855 | }
|
8856 | } else {
|
8857 | var invalidPointer = false;
|
8858 |
|
8859 | if (!_$browser_63.default.supportsPointerEvent && /mouse/.test(event.type)) {
|
8860 |
|
8861 | for (var i = 0; i < interactions.length && !invalidPointer; i++) {
|
8862 | invalidPointer = interactions[i].pointerType !== 'mouse' && interactions[i].pointerIsDown;
|
8863 | }
|
8864 |
|
8865 |
|
8866 |
|
8867 | invalidPointer = invalidPointer || scope.now() - scope.prevTouchTime < 500 ||
|
8868 | event.timeStamp === 0;
|
8869 | }
|
8870 |
|
8871 | if (!invalidPointer) {
|
8872 | var _searchDetails = {
|
8873 | pointer: event,
|
8874 | pointerId: _$pointerUtils_75.getPointerId(event),
|
8875 | pointerType: pointerType,
|
8876 | eventType: event.type,
|
8877 | curEventTarget: curEventTarget,
|
8878 | eventTarget: eventTarget,
|
8879 | scope: scope
|
8880 | };
|
8881 |
|
8882 | var _interaction = getInteraction(_searchDetails);
|
8883 |
|
8884 | matches.push([_searchDetails.pointer, _searchDetails.eventTarget, _searchDetails.curEventTarget, _interaction]);
|
8885 | }
|
8886 | }
|
8887 |
|
8888 |
|
8889 | for (var _i6 = 0; _i6 < matches.length; _i6++) {
|
8890 | var _matches$_i = ___slicedToArray_24(matches[_i6], 4),
|
8891 | _pointer = _matches$_i[0],
|
8892 | _eventTarget = _matches$_i[1],
|
8893 | _curEventTarget = _matches$_i[2],
|
8894 | _interaction2 = _matches$_i[3];
|
8895 |
|
8896 | _interaction2[method](_pointer, event, _eventTarget, _curEventTarget);
|
8897 | }
|
8898 | };
|
8899 | }
|
8900 |
|
8901 | function getInteraction(searchDetails) {
|
8902 | var pointerType = searchDetails.pointerType,
|
8903 | scope = searchDetails.scope;
|
8904 |
|
8905 | var foundInteraction = _$interactionFinder_23.default.search(searchDetails);
|
8906 |
|
8907 | var signalArg = {
|
8908 | interaction: foundInteraction,
|
8909 | searchDetails: searchDetails
|
8910 | };
|
8911 | scope.fire('interactions:find', signalArg);
|
8912 | return signalArg.interaction || scope.interactions.new({
|
8913 | pointerType: pointerType
|
8914 | });
|
8915 | }
|
8916 |
|
8917 | function onDocSignal(_ref7, eventMethodName) {
|
8918 | var doc = _ref7.doc,
|
8919 | scope = _ref7.scope,
|
8920 | options = _ref7.options;
|
8921 | var docEvents = scope.interactions.docEvents,
|
8922 | events = scope.events;
|
8923 | var eventMethod = events[eventMethodName];
|
8924 |
|
8925 | if (scope.browser.isIOS && !options.events) {
|
8926 | options.events = {
|
8927 | passive: false
|
8928 | };
|
8929 | }
|
8930 |
|
8931 |
|
8932 | for (var eventType in events.delegatedEvents) {
|
8933 | eventMethod(doc, eventType, events.delegateListener);
|
8934 | eventMethod(doc, eventType, events.delegateUseCapture, true);
|
8935 | }
|
8936 |
|
8937 | var eventOptions = options && options.events;
|
8938 |
|
8939 | for (var _i7 = 0; _i7 < docEvents.length; _i7++) {
|
8940 | var _ref8;
|
8941 |
|
8942 | _ref8 = docEvents[_i7];
|
8943 | var _ref9 = _ref8,
|
8944 | _type = _ref9.type,
|
8945 | listener = _ref9.listener;
|
8946 | eventMethod(doc, _type, listener, eventOptions);
|
8947 | }
|
8948 | }
|
8949 |
|
8950 | var interactions = {
|
8951 | id: 'core/interactions',
|
8952 | install: __install_24,
|
8953 | listeners: {
|
8954 | 'scope:add-document': function scopeAddDocument(arg) {
|
8955 | return onDocSignal(arg, 'add');
|
8956 | },
|
8957 | 'scope:remove-document': function scopeRemoveDocument(arg) {
|
8958 | return onDocSignal(arg, 'remove');
|
8959 | },
|
8960 | 'interactable:unset': function interactableUnset(_ref10, scope) {
|
8961 | var interactable = _ref10.interactable;
|
8962 |
|
8963 | for (var i = scope.interactions.list.length - 1; i >= 0; i--) {
|
8964 | var interaction = scope.interactions.list[i];
|
8965 |
|
8966 | if (interaction.interactable !== interactable) {
|
8967 | continue;
|
8968 | }
|
8969 |
|
8970 | interaction.stop();
|
8971 | scope.fire('interactions:destroy', {
|
8972 | interaction: interaction
|
8973 | });
|
8974 | interaction.destroy();
|
8975 |
|
8976 | if (scope.interactions.list.length > 2) {
|
8977 | scope.interactions.list.splice(i, 1);
|
8978 | }
|
8979 | }
|
8980 | }
|
8981 | },
|
8982 | onDocSignal: onDocSignal,
|
8983 | doOnInteractions: doOnInteractions,
|
8984 | methodNames: methodNames
|
8985 | };
|
8986 | var ___default_24 = interactions;
|
8987 | _$interactions_24.default = ___default_24;
|
8988 | var _$scope_27 = {};
|
8989 | "use strict";
|
8990 |
|
8991 | function ___typeof_27(obj) {
|
8992 | "@babel/helpers - typeof";
|
8993 |
|
8994 | if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
8995 | ___typeof_27 = function _typeof(obj) {
|
8996 | return typeof obj;
|
8997 | };
|
8998 | } else {
|
8999 | ___typeof_27 = function _typeof(obj) {
|
9000 | return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
9001 | };
|
9002 | }
|
9003 |
|
9004 | return ___typeof_27(obj);
|
9005 | }
|
9006 |
|
9007 | Object.defineProperty(_$scope_27, "__esModule", {
|
9008 | value: true
|
9009 | });
|
9010 | _$scope_27.initScope = initScope;
|
9011 | _$scope_27.Scope = void 0;
|
9012 |
|
9013 |
|
9014 | ;
|
9015 |
|
9016 |
|
9017 | ;
|
9018 |
|
9019 |
|
9020 | ;
|
9021 |
|
9022 |
|
9023 | ;
|
9024 |
|
9025 |
|
9026 | ;
|
9027 |
|
9028 |
|
9029 | ;
|
9030 |
|
9031 |
|
9032 | ;
|
9033 |
|
9034 |
|
9035 | ;
|
9036 |
|
9037 |
|
9038 | ;
|
9039 |
|
9040 |
|
9041 | ;
|
9042 |
|
9043 |
|
9044 | ;
|
9045 |
|
9046 |
|
9047 | ;
|
9048 |
|
9049 |
|
9050 | ;
|
9051 |
|
9052 |
|
9053 | ;
|
9054 |
|
9055 |
|
9056 | ;
|
9057 |
|
9058 | function _get(target, property, receiver) {
|
9059 | if (typeof Reflect !== "undefined" && Reflect.get) {
|
9060 | _get = Reflect.get;
|
9061 | } else {
|
9062 | _get = function _get(target, property, receiver) {
|
9063 | var base = _superPropBase(target, property);
|
9064 |
|
9065 | if (!base) return;
|
9066 | var desc = Object.getOwnPropertyDescriptor(base, property);
|
9067 |
|
9068 | if (desc.get) {
|
9069 | return desc.get.call(receiver);
|
9070 | }
|
9071 |
|
9072 | return desc.value;
|
9073 | };
|
9074 | }
|
9075 |
|
9076 | return _get(target, property, receiver || target);
|
9077 | }
|
9078 |
|
9079 | function _superPropBase(object, property) {
|
9080 | while (!Object.prototype.hasOwnProperty.call(object, property)) {
|
9081 | object = ___getPrototypeOf_27(object);
|
9082 | if (object === null) break;
|
9083 | }
|
9084 |
|
9085 | return object;
|
9086 | }
|
9087 |
|
9088 | function ___inherits_27(subClass, superClass) {
|
9089 | if (typeof superClass !== "function" && superClass !== null) {
|
9090 | throw new TypeError("Super expression must either be null or a function");
|
9091 | }
|
9092 |
|
9093 | subClass.prototype = Object.create(superClass && superClass.prototype, {
|
9094 | constructor: {
|
9095 | value: subClass,
|
9096 | writable: true,
|
9097 | configurable: true
|
9098 | }
|
9099 | });
|
9100 | if (superClass) ___setPrototypeOf_27(subClass, superClass);
|
9101 | }
|
9102 |
|
9103 | function ___setPrototypeOf_27(o, p) {
|
9104 | ___setPrototypeOf_27 = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
9105 | o.__proto__ = p;
|
9106 | return o;
|
9107 | };
|
9108 |
|
9109 | return ___setPrototypeOf_27(o, p);
|
9110 | }
|
9111 |
|
9112 | function ___createSuper_27(Derived) {
|
9113 | var hasNativeReflectConstruct = ___isNativeReflectConstruct_27();
|
9114 |
|
9115 | return function _createSuperInternal() {
|
9116 | var Super = ___getPrototypeOf_27(Derived),
|
9117 | result;
|
9118 |
|
9119 | if (hasNativeReflectConstruct) {
|
9120 | var NewTarget = ___getPrototypeOf_27(this).constructor;
|
9121 |
|
9122 | result = Reflect.construct(Super, arguments, NewTarget);
|
9123 | } else {
|
9124 | result = Super.apply(this, arguments);
|
9125 | }
|
9126 |
|
9127 | return ___possibleConstructorReturn_27(this, result);
|
9128 | };
|
9129 | }
|
9130 |
|
9131 | function ___possibleConstructorReturn_27(self, call) {
|
9132 | if (call && (___typeof_27(call) === "object" || typeof call === "function")) {
|
9133 | return call;
|
9134 | }
|
9135 |
|
9136 | return ___assertThisInitialized_27(self);
|
9137 | }
|
9138 |
|
9139 | function ___assertThisInitialized_27(self) {
|
9140 | if (self === void 0) {
|
9141 | throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
9142 | }
|
9143 |
|
9144 | return self;
|
9145 | }
|
9146 |
|
9147 | function ___isNativeReflectConstruct_27() {
|
9148 | if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
9149 | if (Reflect.construct.sham) return false;
|
9150 | if (typeof Proxy === "function") return true;
|
9151 |
|
9152 | try {
|
9153 | Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
9154 | return true;
|
9155 | } catch (e) {
|
9156 | return false;
|
9157 | }
|
9158 | }
|
9159 |
|
9160 | function ___getPrototypeOf_27(o) {
|
9161 | ___getPrototypeOf_27 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
9162 | return o.__proto__ || Object.getPrototypeOf(o);
|
9163 | };
|
9164 | return ___getPrototypeOf_27(o);
|
9165 | }
|
9166 |
|
9167 | function ___classCallCheck_27(instance, Constructor) {
|
9168 | if (!(instance instanceof Constructor)) {
|
9169 | throw new TypeError("Cannot call a class as a function");
|
9170 | }
|
9171 | }
|
9172 |
|
9173 | function ___defineProperties_27(target, props) {
|
9174 | for (var i = 0; i < props.length; i++) {
|
9175 | var descriptor = props[i];
|
9176 | descriptor.enumerable = descriptor.enumerable || false;
|
9177 | descriptor.configurable = true;
|
9178 | if ("value" in descriptor) descriptor.writable = true;
|
9179 | Object.defineProperty(target, descriptor.key, descriptor);
|
9180 | }
|
9181 | }
|
9182 |
|
9183 | function ___createClass_27(Constructor, protoProps, staticProps) {
|
9184 | if (protoProps) ___defineProperties_27(Constructor.prototype, protoProps);
|
9185 | if (staticProps) ___defineProperties_27(Constructor, staticProps);
|
9186 | return Constructor;
|
9187 | }
|
9188 |
|
9189 | function ___defineProperty_27(obj, key, value) {
|
9190 | if (key in obj) {
|
9191 | Object.defineProperty(obj, key, {
|
9192 | value: value,
|
9193 | enumerable: true,
|
9194 | configurable: true,
|
9195 | writable: true
|
9196 | });
|
9197 | } else {
|
9198 | obj[key] = value;
|
9199 | }
|
9200 |
|
9201 | return obj;
|
9202 | }
|
9203 |
|
9204 | var Scope = function () {
|
9205 |
|
9206 |
|
9207 |
|
9208 |
|
9209 | function Scope() {
|
9210 | var _this = this;
|
9211 |
|
9212 | ___classCallCheck_27(this, Scope);
|
9213 |
|
9214 | ___defineProperty_27(this, "id", "__interact_scope_".concat(Math.floor(Math.random() * 100)));
|
9215 |
|
9216 | ___defineProperty_27(this, "isInitialized", false);
|
9217 |
|
9218 | ___defineProperty_27(this, "listenerMaps", []);
|
9219 |
|
9220 | ___defineProperty_27(this, "browser", _$browser_63.default);
|
9221 |
|
9222 | ___defineProperty_27(this, "defaults", (0, _$clone_64.default)(_$options_26.defaults));
|
9223 |
|
9224 | ___defineProperty_27(this, "Eventable", _$Eventable_14.Eventable);
|
9225 |
|
9226 | ___defineProperty_27(this, "actions", {
|
9227 | map: {},
|
9228 | phases: {
|
9229 | start: true,
|
9230 | move: true,
|
9231 | end: true
|
9232 | },
|
9233 | methodDict: {},
|
9234 | phaselessTypes: {}
|
9235 | });
|
9236 |
|
9237 | ___defineProperty_27(this, "interactStatic", (0, _$InteractStatic_16.createInteractStatic)(this));
|
9238 |
|
9239 | ___defineProperty_27(this, "InteractEvent", _$InteractEvent_15.InteractEvent);
|
9240 |
|
9241 | ___defineProperty_27(this, "Interactable", void 0);
|
9242 |
|
9243 | ___defineProperty_27(this, "interactables", new _$InteractableSet_18.InteractableSet(this));
|
9244 |
|
9245 | ___defineProperty_27(this, "_win", void 0);
|
9246 |
|
9247 | ___defineProperty_27(this, "document", void 0);
|
9248 |
|
9249 | ___defineProperty_27(this, "window", void 0);
|
9250 |
|
9251 | ___defineProperty_27(this, "documents", []);
|
9252 |
|
9253 | ___defineProperty_27(this, "_plugins", {
|
9254 | list: [],
|
9255 | map: {}
|
9256 | });
|
9257 |
|
9258 | ___defineProperty_27(this, "onWindowUnload", function (event) {
|
9259 | return _this.removeDocument(event.target);
|
9260 | });
|
9261 |
|
9262 | var scope = this;
|
9263 |
|
9264 | this.Interactable = function (_InteractableBase) {
|
9265 | ___inherits_27(_class, _InteractableBase);
|
9266 |
|
9267 | var _super = ___createSuper_27(_class);
|
9268 |
|
9269 | function _class() {
|
9270 | ___classCallCheck_27(this, _class);
|
9271 |
|
9272 | return _super.apply(this, arguments);
|
9273 | }
|
9274 |
|
9275 | ___createClass_27(_class, [{
|
9276 | key: "_defaults",
|
9277 | get: function get() {
|
9278 | return scope.defaults;
|
9279 | }
|
9280 | }, {
|
9281 | key: "set",
|
9282 | value: function set(options) {
|
9283 | _get(___getPrototypeOf_27(_class.prototype), "set", this).call(this, options);
|
9284 |
|
9285 | scope.fire('interactable:set', {
|
9286 | options: options,
|
9287 | interactable: this
|
9288 | });
|
9289 | return this;
|
9290 | }
|
9291 | }, {
|
9292 | key: "unset",
|
9293 | value: function unset() {
|
9294 | _get(___getPrototypeOf_27(_class.prototype), "unset", this).call(this);
|
9295 |
|
9296 | scope.interactables.list.splice(scope.interactables.list.indexOf(this), 1);
|
9297 | scope.fire('interactable:unset', {
|
9298 | interactable: this
|
9299 | });
|
9300 | }
|
9301 | }]);
|
9302 |
|
9303 | return _class;
|
9304 | }(_$Interactable_17.Interactable);
|
9305 | }
|
9306 |
|
9307 | ___createClass_27(Scope, [{
|
9308 | key: "addListeners",
|
9309 | value: function addListeners(map, id) {
|
9310 | this.listenerMaps.push({
|
9311 | id: id,
|
9312 | map: map
|
9313 | });
|
9314 | }
|
9315 | }, {
|
9316 | key: "fire",
|
9317 | value: function fire(name, arg) {
|
9318 | for (var _i = 0; _i < this.listenerMaps.length; _i++) {
|
9319 | var _ref;
|
9320 |
|
9321 | _ref = this.listenerMaps[_i];
|
9322 | var _ref2 = _ref,
|
9323 | listener = _ref2.map[name];
|
9324 |
|
9325 | if (!!listener && listener(arg, this, name) === false) {
|
9326 | return false;
|
9327 | }
|
9328 | }
|
9329 | }
|
9330 | }, {
|
9331 | key: "init",
|
9332 | value: function init(window) {
|
9333 | return this.isInitialized ? this : initScope(this, window);
|
9334 | }
|
9335 | }, {
|
9336 | key: "pluginIsInstalled",
|
9337 | value: function pluginIsInstalled(plugin) {
|
9338 | return this._plugins.map[plugin.id] || this._plugins.list.indexOf(plugin) !== -1;
|
9339 | }
|
9340 | }, {
|
9341 | key: "usePlugin",
|
9342 | value: function usePlugin(plugin, options) {
|
9343 | if (!this.isInitialized) {
|
9344 | return this;
|
9345 | }
|
9346 |
|
9347 | if (this.pluginIsInstalled(plugin)) {
|
9348 | return this;
|
9349 | }
|
9350 |
|
9351 | if (plugin.id) {
|
9352 | this._plugins.map[plugin.id] = plugin;
|
9353 | }
|
9354 |
|
9355 | this._plugins.list.push(plugin);
|
9356 |
|
9357 | if (plugin.install) {
|
9358 | plugin.install(this, options);
|
9359 | }
|
9360 |
|
9361 | if (plugin.listeners && plugin.before) {
|
9362 | var index = 0;
|
9363 | var len = this.listenerMaps.length;
|
9364 | var before = plugin.before.reduce(function (acc, id) {
|
9365 | acc[id] = true;
|
9366 | acc[pluginIdRoot(id)] = true;
|
9367 | return acc;
|
9368 | }, {});
|
9369 |
|
9370 | for (; index < len; index++) {
|
9371 | var otherId = this.listenerMaps[index].id;
|
9372 |
|
9373 | if (before[otherId] || before[pluginIdRoot(otherId)]) {
|
9374 | break;
|
9375 | }
|
9376 | }
|
9377 |
|
9378 | this.listenerMaps.splice(index, 0, {
|
9379 | id: plugin.id,
|
9380 | map: plugin.listeners
|
9381 | });
|
9382 | } else if (plugin.listeners) {
|
9383 | this.listenerMaps.push({
|
9384 | id: plugin.id,
|
9385 | map: plugin.listeners
|
9386 | });
|
9387 | }
|
9388 |
|
9389 | return this;
|
9390 | }
|
9391 | }, {
|
9392 | key: "addDocument",
|
9393 | value: function addDocument(doc, options) {
|
9394 |
|
9395 | if (this.getDocIndex(doc) !== -1) {
|
9396 | return false;
|
9397 | }
|
9398 |
|
9399 | var window = _$window_78.getWindow(doc);
|
9400 |
|
9401 | options = options ? (0, _$extend_67.default)({}, options) : {};
|
9402 | this.documents.push({
|
9403 | doc: doc,
|
9404 | options: options
|
9405 | });
|
9406 | this.events.documents.push(doc);
|
9407 |
|
9408 |
|
9409 | if (doc !== this.document) {
|
9410 | this.events.add(window, 'unload', this.onWindowUnload);
|
9411 | }
|
9412 |
|
9413 | this.fire('scope:add-document', {
|
9414 | doc: doc,
|
9415 | window: window,
|
9416 | scope: this,
|
9417 | options: options
|
9418 | });
|
9419 | }
|
9420 | }, {
|
9421 | key: "removeDocument",
|
9422 | value: function removeDocument(doc) {
|
9423 | var index = this.getDocIndex(doc);
|
9424 |
|
9425 | var window = _$window_78.getWindow(doc);
|
9426 |
|
9427 | var options = this.documents[index].options;
|
9428 | this.events.remove(window, 'unload', this.onWindowUnload);
|
9429 | this.documents.splice(index, 1);
|
9430 | this.events.documents.splice(index, 1);
|
9431 | this.fire('scope:remove-document', {
|
9432 | doc: doc,
|
9433 | window: window,
|
9434 | scope: this,
|
9435 | options: options
|
9436 | });
|
9437 | }
|
9438 | }, {
|
9439 | key: "getDocIndex",
|
9440 | value: function getDocIndex(doc) {
|
9441 | for (var i = 0; i < this.documents.length; i++) {
|
9442 | if (this.documents[i].doc === doc) {
|
9443 | return i;
|
9444 | }
|
9445 | }
|
9446 |
|
9447 | return -1;
|
9448 | }
|
9449 | }, {
|
9450 | key: "getDocOptions",
|
9451 | value: function getDocOptions(doc) {
|
9452 | var docIndex = this.getDocIndex(doc);
|
9453 | return docIndex === -1 ? null : this.documents[docIndex].options;
|
9454 | }
|
9455 | }, {
|
9456 | key: "now",
|
9457 | value: function now() {
|
9458 | return (this.window.Date || Date).now();
|
9459 | }
|
9460 | }]);
|
9461 |
|
9462 | return Scope;
|
9463 | }();
|
9464 |
|
9465 | _$scope_27.Scope = Scope;
|
9466 |
|
9467 | function initScope(scope, window) {
|
9468 | scope.isInitialized = true;
|
9469 |
|
9470 | if (_$is_70.default.window(window)) {
|
9471 | _$window_78.init(window);
|
9472 | }
|
9473 |
|
9474 | _$domObjects_65.default.init(window);
|
9475 |
|
9476 | _$browser_63.default.init(window);
|
9477 |
|
9478 | _$raf_76.default.init(window);
|
9479 |
|
9480 |
|
9481 | scope.window = window;
|
9482 | scope.document = window.document;
|
9483 | scope.usePlugin(_$interactions_24.default);
|
9484 | scope.usePlugin(_$events_21.default);
|
9485 | return scope;
|
9486 | }
|
9487 |
|
9488 | function pluginIdRoot(id) {
|
9489 | return id && id.replace(/\/.*$/, '');
|
9490 | }
|
9491 |
|
9492 | var _$index_31 = {};
|
9493 | "use strict";
|
9494 |
|
9495 | Object.defineProperty(_$index_31, "__esModule", {
|
9496 | value: true
|
9497 | });
|
9498 | _$index_31.default = void 0;
|
9499 |
|
9500 |
|
9501 | ;
|
9502 | var scope = new _$scope_27.Scope();
|
9503 | var interact = scope.interactStatic;
|
9504 | var ___default_31 = interact;
|
9505 | _$index_31.default = ___default_31;
|
9506 |
|
9507 | var _global = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : void 0;
|
9508 |
|
9509 | scope.init(_global);
|
9510 | var _$edgeTarget_58 = {};
|
9511 | "use strict";
|
9512 |
|
9513 | Object.defineProperty(_$edgeTarget_58, "__esModule", {
|
9514 | value: true
|
9515 | });
|
9516 | _$edgeTarget_58.default = void 0;
|
9517 |
|
9518 | var ___default_58 = function _default() {};
|
9519 |
|
9520 | _$edgeTarget_58.default = ___default_58;
|
9521 | var _$elements_59 = {};
|
9522 | "use strict";
|
9523 |
|
9524 | Object.defineProperty(_$elements_59, "__esModule", {
|
9525 | value: true
|
9526 | });
|
9527 | _$elements_59.default = void 0;
|
9528 |
|
9529 | var ___default_59 = function _default() {};
|
9530 |
|
9531 | _$elements_59.default = ___default_59;
|
9532 | var _$grid_60 = {};
|
9533 | "use strict";
|
9534 |
|
9535 | Object.defineProperty(_$grid_60, "__esModule", {
|
9536 | value: true
|
9537 | });
|
9538 | _$grid_60.default = void 0;
|
9539 |
|
9540 | function ___slicedToArray_60(arr, i) {
|
9541 | return ___arrayWithHoles_60(arr) || ___iterableToArrayLimit_60(arr, i) || ___unsupportedIterableToArray_60(arr, i) || ___nonIterableRest_60();
|
9542 | }
|
9543 |
|
9544 | function ___nonIterableRest_60() {
|
9545 | throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
9546 | }
|
9547 |
|
9548 | function ___unsupportedIterableToArray_60(o, minLen) {
|
9549 | if (!o) return;
|
9550 | if (typeof o === "string") return ___arrayLikeToArray_60(o, minLen);
|
9551 | var n = Object.prototype.toString.call(o).slice(8, -1);
|
9552 | if (n === "Object" && o.constructor) n = o.constructor.name;
|
9553 | if (n === "Map" || n === "Set") return Array.from(o);
|
9554 | if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return ___arrayLikeToArray_60(o, minLen);
|
9555 | }
|
9556 |
|
9557 | function ___arrayLikeToArray_60(arr, len) {
|
9558 | if (len == null || len > arr.length) len = arr.length;
|
9559 |
|
9560 | for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
9561 | arr2[i] = arr[i];
|
9562 | }
|
9563 |
|
9564 | return arr2;
|
9565 | }
|
9566 |
|
9567 | function ___iterableToArrayLimit_60(arr, i) {
|
9568 | if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
|
9569 | var _arr = [];
|
9570 | var _n = true;
|
9571 | var _d = false;
|
9572 | var _e = undefined;
|
9573 |
|
9574 | try {
|
9575 | for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
|
9576 | _arr.push(_s.value);
|
9577 |
|
9578 | if (i && _arr.length === i) break;
|
9579 | }
|
9580 | } catch (err) {
|
9581 | _d = true;
|
9582 | _e = err;
|
9583 | } finally {
|
9584 | try {
|
9585 | if (!_n && _i["return"] != null) _i["return"]();
|
9586 | } finally {
|
9587 | if (_d) throw _e;
|
9588 | }
|
9589 | }
|
9590 |
|
9591 | return _arr;
|
9592 | }
|
9593 |
|
9594 | function ___arrayWithHoles_60(arr) {
|
9595 | if (Array.isArray(arr)) return arr;
|
9596 | }
|
9597 |
|
9598 | var ___default_60 = function _default(grid) {
|
9599 | var coordFields = [['x', 'y'], ['left', 'top'], ['right', 'bottom'], ['width', 'height']].filter(function (_ref) {
|
9600 | var _ref2 = ___slicedToArray_60(_ref, 2),
|
9601 | xField = _ref2[0],
|
9602 | yField = _ref2[1];
|
9603 |
|
9604 | return xField in grid || yField in grid;
|
9605 | });
|
9606 |
|
9607 | var gridFunc = function gridFunc(x, y) {
|
9608 | var range = grid.range,
|
9609 | _grid$limits = grid.limits,
|
9610 | limits = _grid$limits === void 0 ? {
|
9611 | left: -Infinity,
|
9612 | right: Infinity,
|
9613 | top: -Infinity,
|
9614 | bottom: Infinity
|
9615 | } : _grid$limits,
|
9616 | _grid$offset = grid.offset,
|
9617 | offset = _grid$offset === void 0 ? {
|
9618 | x: 0,
|
9619 | y: 0
|
9620 | } : _grid$offset;
|
9621 | var result = {
|
9622 | range: range,
|
9623 | grid: grid,
|
9624 | x: null,
|
9625 | y: null
|
9626 | };
|
9627 |
|
9628 | for (var _i2 = 0; _i2 < coordFields.length; _i2++) {
|
9629 | var _ref3;
|
9630 |
|
9631 | _ref3 = coordFields[_i2];
|
9632 |
|
9633 | var _ref4 = _ref3,
|
9634 | _ref5 = ___slicedToArray_60(_ref4, 2),
|
9635 | xField = _ref5[0],
|
9636 | yField = _ref5[1];
|
9637 |
|
9638 | var gridx = Math.round((x - offset.x) / grid[xField]);
|
9639 | var gridy = Math.round((y - offset.y) / grid[yField]);
|
9640 | result[xField] = Math.max(limits.left, Math.min(limits.right, gridx * grid[xField] + offset.x));
|
9641 | result[yField] = Math.max(limits.top, Math.min(limits.bottom, gridy * grid[yField] + offset.y));
|
9642 | }
|
9643 |
|
9644 | return result;
|
9645 | };
|
9646 |
|
9647 | gridFunc.grid = grid;
|
9648 | gridFunc.coordFields = coordFields;
|
9649 | return gridFunc;
|
9650 | };
|
9651 |
|
9652 | _$grid_60.default = ___default_60;
|
9653 | var _$all_57 = {};
|
9654 | "use strict";
|
9655 |
|
9656 | Object.defineProperty(_$all_57, "__esModule", {
|
9657 | value: true
|
9658 | });
|
9659 | Object.defineProperty(_$all_57, "edgeTarget", {
|
9660 | enumerable: true,
|
9661 | get: function get() {
|
9662 | return _$edgeTarget_58.default;
|
9663 | }
|
9664 | });
|
9665 | Object.defineProperty(_$all_57, "elements", {
|
9666 | enumerable: true,
|
9667 | get: function get() {
|
9668 | return _$elements_59.default;
|
9669 | }
|
9670 | });
|
9671 | Object.defineProperty(_$all_57, "grid", {
|
9672 | enumerable: true,
|
9673 | get: function get() {
|
9674 | return _$grid_60.default;
|
9675 | }
|
9676 | });
|
9677 |
|
9678 |
|
9679 | ;
|
9680 |
|
9681 |
|
9682 | ;
|
9683 |
|
9684 |
|
9685 | ;
|
9686 | var _$plugin_61 = {};
|
9687 | "use strict";
|
9688 |
|
9689 | Object.defineProperty(_$plugin_61, "__esModule", {
|
9690 | value: true
|
9691 | });
|
9692 | _$plugin_61.default = void 0;
|
9693 |
|
9694 |
|
9695 | ;
|
9696 |
|
9697 |
|
9698 | ;
|
9699 | var snappersPlugin = {
|
9700 | id: 'snappers',
|
9701 | install: function install(scope) {
|
9702 | var interact = scope.interactStatic;
|
9703 | interact.snappers = (0, _$extend_67.default)(interact.snappers || {}, _$all_57);
|
9704 | interact.createSnapGrid = interact.snappers.grid;
|
9705 | }
|
9706 | };
|
9707 | var ___default_61 = snappersPlugin;
|
9708 | _$plugin_61.default = ___default_61;
|
9709 | var _$aspectRatio_35 = {};
|
9710 | "use strict";
|
9711 |
|
9712 | Object.defineProperty(_$aspectRatio_35, "__esModule", {
|
9713 | value: true
|
9714 | });
|
9715 | _$aspectRatio_35.aspectRatio = _$aspectRatio_35.default = void 0;
|
9716 |
|
9717 |
|
9718 | ;
|
9719 |
|
9720 |
|
9721 | ;
|
9722 |
|
9723 |
|
9724 | ;
|
9725 |
|
9726 |
|
9727 | ;
|
9728 |
|
9729 | function ownKeys(object, enumerableOnly) {
|
9730 | var keys = Object.keys(object);
|
9731 |
|
9732 | if (Object.getOwnPropertySymbols) {
|
9733 | var symbols = Object.getOwnPropertySymbols(object);
|
9734 | if (enumerableOnly) symbols = symbols.filter(function (sym) {
|
9735 | return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
9736 | });
|
9737 | keys.push.apply(keys, symbols);
|
9738 | }
|
9739 |
|
9740 | return keys;
|
9741 | }
|
9742 |
|
9743 | function _objectSpread(target) {
|
9744 | for (var i = 1; i < arguments.length; i++) {
|
9745 | var source = arguments[i] != null ? arguments[i] : {};
|
9746 |
|
9747 | if (i % 2) {
|
9748 | ownKeys(Object(source), true).forEach(function (key) {
|
9749 | ___defineProperty_35(target, key, source[key]);
|
9750 | });
|
9751 | } else if (Object.getOwnPropertyDescriptors) {
|
9752 | Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
9753 | } else {
|
9754 | ownKeys(Object(source)).forEach(function (key) {
|
9755 | Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
9756 | });
|
9757 | }
|
9758 | }
|
9759 |
|
9760 | return target;
|
9761 | }
|
9762 |
|
9763 | function ___defineProperty_35(obj, key, value) {
|
9764 | if (key in obj) {
|
9765 | Object.defineProperty(obj, key, {
|
9766 | value: value,
|
9767 | enumerable: true,
|
9768 | configurable: true,
|
9769 | writable: true
|
9770 | });
|
9771 | } else {
|
9772 | obj[key] = value;
|
9773 | }
|
9774 |
|
9775 | return obj;
|
9776 | }
|
9777 |
|
9778 | var aspectRatio = {
|
9779 | start: function start(arg) {
|
9780 | var state = arg.state,
|
9781 | rect = arg.rect,
|
9782 | originalEdges = arg.edges,
|
9783 | coords = arg.pageCoords;
|
9784 | var ratio = state.options.ratio;
|
9785 | var _state$options = state.options,
|
9786 | equalDelta = _state$options.equalDelta,
|
9787 | modifiers = _state$options.modifiers;
|
9788 |
|
9789 | if (ratio === 'preserve') {
|
9790 | ratio = rect.width / rect.height;
|
9791 | }
|
9792 |
|
9793 | state.startCoords = (0, _$extend_67.default)({}, coords);
|
9794 | state.startRect = (0, _$extend_67.default)({}, rect);
|
9795 | state.ratio = ratio;
|
9796 | state.equalDelta = equalDelta;
|
9797 | var linkedEdges = state.linkedEdges = {
|
9798 | top: originalEdges.top || originalEdges.left && !originalEdges.bottom,
|
9799 | left: originalEdges.left || originalEdges.top && !originalEdges.right,
|
9800 | bottom: originalEdges.bottom || originalEdges.right && !originalEdges.top,
|
9801 | right: originalEdges.right || originalEdges.bottom && !originalEdges.left
|
9802 | };
|
9803 | state.xIsPrimaryAxis = !!(originalEdges.left || originalEdges.right);
|
9804 |
|
9805 | if (state.equalDelta) {
|
9806 | state.edgeSign = (linkedEdges.left ? 1 : -1) * (linkedEdges.top ? 1 : -1);
|
9807 | } else {
|
9808 | var negativeSecondaryEdge = state.xIsPrimaryAxis ? linkedEdges.top : linkedEdges.left;
|
9809 | state.edgeSign = negativeSecondaryEdge ? -1 : 1;
|
9810 | }
|
9811 |
|
9812 | (0, _$extend_67.default)(arg.edges, linkedEdges);
|
9813 | if (!modifiers || !modifiers.length) return;
|
9814 | var subModification = new _$Modification_33.default(arg.interaction);
|
9815 | subModification.copyFrom(arg.interaction.modification);
|
9816 | subModification.prepareStates(modifiers);
|
9817 | state.subModification = subModification;
|
9818 | subModification.startAll(_objectSpread({}, arg));
|
9819 | },
|
9820 | set: function set(arg) {
|
9821 | var state = arg.state,
|
9822 | rect = arg.rect,
|
9823 | coords = arg.coords;
|
9824 | var initialCoords = (0, _$extend_67.default)({}, coords);
|
9825 | var aspectMethod = state.equalDelta ? setEqualDelta : setRatio;
|
9826 | aspectMethod(state, state.xIsPrimaryAxis, coords, rect);
|
9827 |
|
9828 | if (!state.subModification) {
|
9829 | return null;
|
9830 | }
|
9831 |
|
9832 | var correctedRect = (0, _$extend_67.default)({}, rect);
|
9833 | (0, _$rect_77.addEdges)(state.linkedEdges, correctedRect, {
|
9834 | x: coords.x - initialCoords.x,
|
9835 | y: coords.y - initialCoords.y
|
9836 | });
|
9837 | var result = state.subModification.setAll(_objectSpread(_objectSpread({}, arg), {}, {
|
9838 | rect: correctedRect,
|
9839 | edges: state.linkedEdges,
|
9840 | pageCoords: coords,
|
9841 | prevCoords: coords,
|
9842 | prevRect: correctedRect
|
9843 | }));
|
9844 | var delta = result.delta;
|
9845 |
|
9846 | if (result.changed) {
|
9847 | var xIsCriticalAxis = Math.abs(delta.x) > Math.abs(delta.y);
|
9848 |
|
9849 | aspectMethod(state, xIsCriticalAxis, result.coords, result.rect);
|
9850 | (0, _$extend_67.default)(coords, result.coords);
|
9851 | }
|
9852 |
|
9853 | return result.eventProps;
|
9854 | },
|
9855 | defaults: {
|
9856 | ratio: 'preserve',
|
9857 | equalDelta: false,
|
9858 | modifiers: [],
|
9859 | enabled: false
|
9860 | }
|
9861 | };
|
9862 | _$aspectRatio_35.aspectRatio = aspectRatio;
|
9863 |
|
9864 | function setEqualDelta(_ref, xIsPrimaryAxis, coords) {
|
9865 | var startCoords = _ref.startCoords,
|
9866 | edgeSign = _ref.edgeSign;
|
9867 |
|
9868 | if (xIsPrimaryAxis) {
|
9869 | coords.y = startCoords.y + (coords.x - startCoords.x) * edgeSign;
|
9870 | } else {
|
9871 | coords.x = startCoords.x + (coords.y - startCoords.y) * edgeSign;
|
9872 | }
|
9873 | }
|
9874 |
|
9875 | function setRatio(_ref2, xIsPrimaryAxis, coords, rect) {
|
9876 | var startRect = _ref2.startRect,
|
9877 | startCoords = _ref2.startCoords,
|
9878 | ratio = _ref2.ratio,
|
9879 | edgeSign = _ref2.edgeSign;
|
9880 |
|
9881 | if (xIsPrimaryAxis) {
|
9882 | var newHeight = rect.width / ratio;
|
9883 | coords.y = startCoords.y + (newHeight - startRect.height) * edgeSign;
|
9884 | } else {
|
9885 | var newWidth = rect.height * ratio;
|
9886 | coords.x = startCoords.x + (newWidth - startRect.width) * edgeSign;
|
9887 | }
|
9888 | }
|
9889 |
|
9890 | var ___default_35 = (0, _$base_37.makeModifier)(aspectRatio, 'aspectRatio');
|
9891 |
|
9892 | _$aspectRatio_35.default = ___default_35;
|
9893 | var _$noop_38 = {};
|
9894 | "use strict";
|
9895 |
|
9896 | Object.defineProperty(_$noop_38, "__esModule", {
|
9897 | value: true
|
9898 | });
|
9899 | _$noop_38.default = void 0;
|
9900 |
|
9901 | var noop = function noop() {};
|
9902 |
|
9903 | noop._defaults = {};
|
9904 | var ___default_38 = noop;
|
9905 | _$noop_38.default = ___default_38;
|
9906 | var _$avoid_36 = {};
|
9907 | "use strict";
|
9908 |
|
9909 | Object.defineProperty(_$avoid_36, "__esModule", {
|
9910 | value: true
|
9911 | });
|
9912 | Object.defineProperty(_$avoid_36, "default", {
|
9913 | enumerable: true,
|
9914 | get: function get() {
|
9915 | return _$noop_38.default;
|
9916 | }
|
9917 | });
|
9918 |
|
9919 |
|
9920 | ;
|
9921 | var _$pointer_41 = {};
|
9922 | "use strict";
|
9923 |
|
9924 | Object.defineProperty(_$pointer_41, "__esModule", {
|
9925 | value: true
|
9926 | });
|
9927 | _$pointer_41.getRestrictionRect = getRestrictionRect;
|
9928 | _$pointer_41.restrict = _$pointer_41.default = void 0;
|
9929 |
|
9930 |
|
9931 | ;
|
9932 |
|
9933 |
|
9934 | ;
|
9935 |
|
9936 |
|
9937 | ;
|
9938 |
|
9939 |
|
9940 | ;
|
9941 |
|
9942 | function __start_41(_ref) {
|
9943 | var rect = _ref.rect,
|
9944 | startOffset = _ref.startOffset,
|
9945 | state = _ref.state,
|
9946 | interaction = _ref.interaction,
|
9947 | pageCoords = _ref.pageCoords;
|
9948 | var options = state.options;
|
9949 | var elementRect = options.elementRect;
|
9950 | var offset = (0, _$extend_67.default)({
|
9951 | left: 0,
|
9952 | top: 0,
|
9953 | right: 0,
|
9954 | bottom: 0
|
9955 | }, options.offset || {});
|
9956 |
|
9957 | if (rect && elementRect) {
|
9958 | var restriction = getRestrictionRect(options.restriction, interaction, pageCoords);
|
9959 |
|
9960 | if (restriction) {
|
9961 | var widthDiff = restriction.right - restriction.left - rect.width;
|
9962 | var heightDiff = restriction.bottom - restriction.top - rect.height;
|
9963 |
|
9964 | if (widthDiff < 0) {
|
9965 | offset.left += widthDiff;
|
9966 | offset.right += widthDiff;
|
9967 | }
|
9968 |
|
9969 | if (heightDiff < 0) {
|
9970 | offset.top += heightDiff;
|
9971 | offset.bottom += heightDiff;
|
9972 | }
|
9973 | }
|
9974 |
|
9975 | offset.left += startOffset.left - rect.width * elementRect.left;
|
9976 | offset.top += startOffset.top - rect.height * elementRect.top;
|
9977 | offset.right += startOffset.right - rect.width * (1 - elementRect.right);
|
9978 | offset.bottom += startOffset.bottom - rect.height * (1 - elementRect.bottom);
|
9979 | }
|
9980 |
|
9981 | state.offset = offset;
|
9982 | }
|
9983 |
|
9984 | function set(_ref2) {
|
9985 | var coords = _ref2.coords,
|
9986 | interaction = _ref2.interaction,
|
9987 | state = _ref2.state;
|
9988 | var options = state.options,
|
9989 | offset = state.offset;
|
9990 | var restriction = getRestrictionRect(options.restriction, interaction, coords);
|
9991 | if (!restriction) return;
|
9992 |
|
9993 | var rect = _$rect_77.xywhToTlbr(restriction);
|
9994 |
|
9995 | coords.x = Math.max(Math.min(rect.right - offset.right, coords.x), rect.left + offset.left);
|
9996 | coords.y = Math.max(Math.min(rect.bottom - offset.bottom, coords.y), rect.top + offset.top);
|
9997 | }
|
9998 |
|
9999 | function getRestrictionRect(value, interaction, coords) {
|
10000 | if (_$is_70.default.func(value)) {
|
10001 | return _$rect_77.resolveRectLike(value, interaction.interactable, interaction.element, [coords.x, coords.y, interaction]);
|
10002 | } else {
|
10003 | return _$rect_77.resolveRectLike(value, interaction.interactable, interaction.element);
|
10004 | }
|
10005 | }
|
10006 |
|
10007 | var __defaults_41 = {
|
10008 | restriction: null,
|
10009 | elementRect: null,
|
10010 | offset: null,
|
10011 | endOnly: false,
|
10012 | enabled: false
|
10013 | };
|
10014 | var restrict = {
|
10015 | start: __start_41,
|
10016 | set: set,
|
10017 | defaults: __defaults_41
|
10018 | };
|
10019 | _$pointer_41.restrict = restrict;
|
10020 |
|
10021 | var ___default_41 = (0, _$base_37.makeModifier)(restrict, 'restrict');
|
10022 |
|
10023 | _$pointer_41.default = ___default_41;
|
10024 | var _$edges_40 = {};
|
10025 | "use strict";
|
10026 |
|
10027 | Object.defineProperty(_$edges_40, "__esModule", {
|
10028 | value: true
|
10029 | });
|
10030 | _$edges_40.restrictEdges = _$edges_40.default = void 0;
|
10031 |
|
10032 |
|
10033 | ;
|
10034 |
|
10035 |
|
10036 | ;
|
10037 |
|
10038 |
|
10039 | ;
|
10040 |
|
10041 |
|
10042 | ;
|
10043 |
|
10044 |
|
10045 |
|
10046 |
|
10047 |
|
10048 |
|
10049 |
|
10050 |
|
10051 |
|
10052 |
|
10053 | var noInner = {
|
10054 | top: +Infinity,
|
10055 | left: +Infinity,
|
10056 | bottom: -Infinity,
|
10057 | right: -Infinity
|
10058 | };
|
10059 | var noOuter = {
|
10060 | top: -Infinity,
|
10061 | left: -Infinity,
|
10062 | bottom: +Infinity,
|
10063 | right: +Infinity
|
10064 | };
|
10065 |
|
10066 | function __start_40(_ref) {
|
10067 | var interaction = _ref.interaction,
|
10068 | startOffset = _ref.startOffset,
|
10069 | state = _ref.state;
|
10070 | var options = state.options;
|
10071 | var offset;
|
10072 |
|
10073 | if (options) {
|
10074 | var offsetRect = (0, _$pointer_41.getRestrictionRect)(options.offset, interaction, interaction.coords.start.page);
|
10075 | offset = _$rect_77.rectToXY(offsetRect);
|
10076 | }
|
10077 |
|
10078 | offset = offset || {
|
10079 | x: 0,
|
10080 | y: 0
|
10081 | };
|
10082 | state.offset = {
|
10083 | top: offset.y + startOffset.top,
|
10084 | left: offset.x + startOffset.left,
|
10085 | bottom: offset.y - startOffset.bottom,
|
10086 | right: offset.x - startOffset.right
|
10087 | };
|
10088 | }
|
10089 |
|
10090 | function __set_40(_ref2) {
|
10091 | var coords = _ref2.coords,
|
10092 | edges = _ref2.edges,
|
10093 | interaction = _ref2.interaction,
|
10094 | state = _ref2.state;
|
10095 | var offset = state.offset,
|
10096 | options = state.options;
|
10097 |
|
10098 | if (!edges) {
|
10099 | return;
|
10100 | }
|
10101 |
|
10102 | var page = (0, _$extend_67.default)({}, coords);
|
10103 | var inner = (0, _$pointer_41.getRestrictionRect)(options.inner, interaction, page) || {};
|
10104 | var outer = (0, _$pointer_41.getRestrictionRect)(options.outer, interaction, page) || {};
|
10105 | fixRect(inner, noInner);
|
10106 | fixRect(outer, noOuter);
|
10107 |
|
10108 | if (edges.top) {
|
10109 | coords.y = Math.min(Math.max(outer.top + offset.top, page.y), inner.top + offset.top);
|
10110 | } else if (edges.bottom) {
|
10111 | coords.y = Math.max(Math.min(outer.bottom + offset.bottom, page.y), inner.bottom + offset.bottom);
|
10112 | }
|
10113 |
|
10114 | if (edges.left) {
|
10115 | coords.x = Math.min(Math.max(outer.left + offset.left, page.x), inner.left + offset.left);
|
10116 | } else if (edges.right) {
|
10117 | coords.x = Math.max(Math.min(outer.right + offset.right, page.x), inner.right + offset.right);
|
10118 | }
|
10119 | }
|
10120 |
|
10121 | function fixRect(rect, defaults) {
|
10122 | var _arr = ['top', 'left', 'bottom', 'right'];
|
10123 |
|
10124 | for (var _i = 0; _i < _arr.length; _i++) {
|
10125 | var edge = _arr[_i];
|
10126 |
|
10127 | if (!(edge in rect)) {
|
10128 | rect[edge] = defaults[edge];
|
10129 | }
|
10130 | }
|
10131 |
|
10132 | return rect;
|
10133 | }
|
10134 |
|
10135 | var __defaults_40 = {
|
10136 | inner: null,
|
10137 | outer: null,
|
10138 | offset: null,
|
10139 | endOnly: false,
|
10140 | enabled: false
|
10141 | };
|
10142 | var restrictEdges = {
|
10143 | noInner: noInner,
|
10144 | noOuter: noOuter,
|
10145 | start: __start_40,
|
10146 | set: __set_40,
|
10147 | defaults: __defaults_40
|
10148 | };
|
10149 | _$edges_40.restrictEdges = restrictEdges;
|
10150 |
|
10151 | var ___default_40 = (0, _$base_37.makeModifier)(restrictEdges, 'restrictEdges');
|
10152 |
|
10153 | _$edges_40.default = ___default_40;
|
10154 | var _$rect_42 = {};
|
10155 | "use strict";
|
10156 |
|
10157 | Object.defineProperty(_$rect_42, "__esModule", {
|
10158 | value: true
|
10159 | });
|
10160 | _$rect_42.restrictRect = _$rect_42.default = void 0;
|
10161 |
|
10162 |
|
10163 | ;
|
10164 |
|
10165 |
|
10166 | ;
|
10167 |
|
10168 |
|
10169 | ;
|
10170 |
|
10171 | var __defaults_42 = (0, _$extend_67.default)({
|
10172 | get elementRect() {
|
10173 | return {
|
10174 | top: 0,
|
10175 | left: 0,
|
10176 | bottom: 1,
|
10177 | right: 1
|
10178 | };
|
10179 | },
|
10180 |
|
10181 | set elementRect(_) {}
|
10182 |
|
10183 | }, _$pointer_41.restrict.defaults);
|
10184 |
|
10185 | var restrictRect = {
|
10186 | start: _$pointer_41.restrict.start,
|
10187 | set: _$pointer_41.restrict.set,
|
10188 | defaults: __defaults_42
|
10189 | };
|
10190 | _$rect_42.restrictRect = restrictRect;
|
10191 |
|
10192 | var ___default_42 = (0, _$base_37.makeModifier)(restrictRect, 'restrictRect');
|
10193 |
|
10194 | _$rect_42.default = ___default_42;
|
10195 | var _$size_43 = {};
|
10196 | "use strict";
|
10197 |
|
10198 | Object.defineProperty(_$size_43, "__esModule", {
|
10199 | value: true
|
10200 | });
|
10201 | _$size_43.restrictSize = _$size_43.default = void 0;
|
10202 |
|
10203 |
|
10204 | ;
|
10205 |
|
10206 |
|
10207 | ;
|
10208 |
|
10209 |
|
10210 | ;
|
10211 |
|
10212 |
|
10213 | ;
|
10214 |
|
10215 |
|
10216 | ;
|
10217 | var noMin = {
|
10218 | width: -Infinity,
|
10219 | height: -Infinity
|
10220 | };
|
10221 | var noMax = {
|
10222 | width: +Infinity,
|
10223 | height: +Infinity
|
10224 | };
|
10225 |
|
10226 | function __start_43(arg) {
|
10227 | return _$edges_40.restrictEdges.start(arg);
|
10228 | }
|
10229 |
|
10230 | function __set_43(arg) {
|
10231 | var interaction = arg.interaction,
|
10232 | state = arg.state,
|
10233 | rect = arg.rect,
|
10234 | edges = arg.edges;
|
10235 | var options = state.options;
|
10236 |
|
10237 | if (!edges) {
|
10238 | return;
|
10239 | }
|
10240 |
|
10241 | var minSize = _$rect_77.tlbrToXywh((0, _$pointer_41.getRestrictionRect)(options.min, interaction, arg.coords)) || noMin;
|
10242 | var maxSize = _$rect_77.tlbrToXywh((0, _$pointer_41.getRestrictionRect)(options.max, interaction, arg.coords)) || noMax;
|
10243 | state.options = {
|
10244 | endOnly: options.endOnly,
|
10245 | inner: (0, _$extend_67.default)({}, _$edges_40.restrictEdges.noInner),
|
10246 | outer: (0, _$extend_67.default)({}, _$edges_40.restrictEdges.noOuter)
|
10247 | };
|
10248 |
|
10249 | if (edges.top) {
|
10250 | state.options.inner.top = rect.bottom - minSize.height;
|
10251 | state.options.outer.top = rect.bottom - maxSize.height;
|
10252 | } else if (edges.bottom) {
|
10253 | state.options.inner.bottom = rect.top + minSize.height;
|
10254 | state.options.outer.bottom = rect.top + maxSize.height;
|
10255 | }
|
10256 |
|
10257 | if (edges.left) {
|
10258 | state.options.inner.left = rect.right - minSize.width;
|
10259 | state.options.outer.left = rect.right - maxSize.width;
|
10260 | } else if (edges.right) {
|
10261 | state.options.inner.right = rect.left + minSize.width;
|
10262 | state.options.outer.right = rect.left + maxSize.width;
|
10263 | }
|
10264 |
|
10265 | _$edges_40.restrictEdges.set(arg);
|
10266 |
|
10267 | state.options = options;
|
10268 | }
|
10269 |
|
10270 | var __defaults_43 = {
|
10271 | min: null,
|
10272 | max: null,
|
10273 | endOnly: false,
|
10274 | enabled: false
|
10275 | };
|
10276 | var restrictSize = {
|
10277 | start: __start_43,
|
10278 | set: __set_43,
|
10279 | defaults: __defaults_43
|
10280 | };
|
10281 | _$size_43.restrictSize = restrictSize;
|
10282 |
|
10283 | var ___default_43 = (0, _$base_37.makeModifier)(restrictSize, 'restrictSize');
|
10284 |
|
10285 | _$size_43.default = ___default_43;
|
10286 | var _$rubberband_44 = {};
|
10287 | "use strict";
|
10288 |
|
10289 | Object.defineProperty(_$rubberband_44, "__esModule", {
|
10290 | value: true
|
10291 | });
|
10292 | Object.defineProperty(_$rubberband_44, "default", {
|
10293 | enumerable: true,
|
10294 | get: function get() {
|
10295 | return _$noop_38.default;
|
10296 | }
|
10297 | });
|
10298 |
|
10299 |
|
10300 | ;
|
10301 | var _$pointer_46 = {};
|
10302 | "use strict";
|
10303 |
|
10304 | Object.defineProperty(_$pointer_46, "__esModule", {
|
10305 | value: true
|
10306 | });
|
10307 | _$pointer_46.snap = _$pointer_46.default = void 0;
|
10308 |
|
10309 |
|
10310 | ;
|
10311 |
|
10312 |
|
10313 | ;
|
10314 |
|
10315 |
|
10316 | ;
|
10317 |
|
10318 |
|
10319 | ;
|
10320 |
|
10321 |
|
10322 | ;
|
10323 |
|
10324 |
|
10325 | ;
|
10326 |
|
10327 | function __start_46(arg) {
|
10328 | var interaction = arg.interaction,
|
10329 | interactable = arg.interactable,
|
10330 | element = arg.element,
|
10331 | rect = arg.rect,
|
10332 | state = arg.state,
|
10333 | startOffset = arg.startOffset;
|
10334 | var options = state.options;
|
10335 | var origin = options.offsetWithOrigin ? getOrigin(arg) : {
|
10336 | x: 0,
|
10337 | y: 0
|
10338 | };
|
10339 | var snapOffset;
|
10340 |
|
10341 | if (options.offset === 'startCoords') {
|
10342 | snapOffset = {
|
10343 | x: interaction.coords.start.page.x,
|
10344 | y: interaction.coords.start.page.y
|
10345 | };
|
10346 | } else {
|
10347 | var offsetRect = (0, _$rect_77.resolveRectLike)(options.offset, interactable, element, [interaction]);
|
10348 | snapOffset = (0, _$rect_77.rectToXY)(offsetRect) || {
|
10349 | x: 0,
|
10350 | y: 0
|
10351 | };
|
10352 | snapOffset.x += origin.x;
|
10353 | snapOffset.y += origin.y;
|
10354 | }
|
10355 |
|
10356 | var relativePoints = options.relativePoints;
|
10357 | state.offsets = rect && relativePoints && relativePoints.length ? relativePoints.map(function (relativePoint, index) {
|
10358 | return {
|
10359 | index: index,
|
10360 | relativePoint: relativePoint,
|
10361 | x: startOffset.left - rect.width * relativePoint.x + snapOffset.x,
|
10362 | y: startOffset.top - rect.height * relativePoint.y + snapOffset.y
|
10363 | };
|
10364 | }) : [{
|
10365 | index: 0,
|
10366 | relativePoint: null,
|
10367 | x: snapOffset.x,
|
10368 | y: snapOffset.y
|
10369 | }];
|
10370 | }
|
10371 |
|
10372 | function __set_46(arg) {
|
10373 | var interaction = arg.interaction,
|
10374 | coords = arg.coords,
|
10375 | state = arg.state;
|
10376 | var options = state.options,
|
10377 | offsets = state.offsets;
|
10378 | var origin = (0, _$getOriginXY_68.default)(interaction.interactable, interaction.element, interaction.prepared.name);
|
10379 | var page = (0, _$extend_67.default)({}, coords);
|
10380 | var targets = [];
|
10381 |
|
10382 | if (!options.offsetWithOrigin) {
|
10383 | page.x -= origin.x;
|
10384 | page.y -= origin.y;
|
10385 | }
|
10386 |
|
10387 | for (var _i = 0; _i < offsets.length; _i++) {
|
10388 | var _ref;
|
10389 |
|
10390 | _ref = offsets[_i];
|
10391 | var _offset = _ref;
|
10392 | var relativeX = page.x - _offset.x;
|
10393 | var relativeY = page.y - _offset.y;
|
10394 |
|
10395 | for (var _index = 0, len = options.targets.length; _index < len; _index++) {
|
10396 | var snapTarget = options.targets[_index];
|
10397 | var target = void 0;
|
10398 |
|
10399 | if (_$is_70.default.func(snapTarget)) {
|
10400 | target = snapTarget(relativeX, relativeY, interaction._proxy, _offset, _index);
|
10401 | } else {
|
10402 | target = snapTarget;
|
10403 | }
|
10404 |
|
10405 | if (!target) {
|
10406 | continue;
|
10407 | }
|
10408 |
|
10409 | targets.push({
|
10410 | x: (_$is_70.default.number(target.x) ? target.x : relativeX) + _offset.x,
|
10411 | y: (_$is_70.default.number(target.y) ? target.y : relativeY) + _offset.y,
|
10412 | range: _$is_70.default.number(target.range) ? target.range : options.range,
|
10413 | source: snapTarget,
|
10414 | index: _index,
|
10415 | offset: _offset
|
10416 | });
|
10417 | }
|
10418 | }
|
10419 |
|
10420 | var closest = {
|
10421 | target: null,
|
10422 | inRange: false,
|
10423 | distance: 0,
|
10424 | range: 0,
|
10425 | delta: {
|
10426 | x: 0,
|
10427 | y: 0
|
10428 | }
|
10429 | };
|
10430 |
|
10431 | for (var _i2 = 0; _i2 < targets.length; _i2++) {
|
10432 | var _target = targets[_i2];
|
10433 | var range = _target.range;
|
10434 | var dx = _target.x - page.x;
|
10435 | var dy = _target.y - page.y;
|
10436 | var distance = (0, _$hypot_69.default)(dx, dy);
|
10437 | var inRange = distance <= range;
|
10438 |
|
10439 |
|
10440 | if (range === Infinity && closest.inRange && closest.range !== Infinity) {
|
10441 | inRange = false;
|
10442 | }
|
10443 |
|
10444 | if (!closest.target || (inRange ?
|
10445 | closest.inRange && range !== Infinity ?
|
10446 | distance / range < closest.distance / closest.range :
|
10447 | range === Infinity && closest.range !== Infinity ||
|
10448 | distance < closest.distance :
|
10449 | !closest.inRange && distance < closest.distance)) {
|
10450 | closest.target = _target;
|
10451 | closest.distance = distance;
|
10452 | closest.range = range;
|
10453 | closest.inRange = inRange;
|
10454 | closest.delta.x = dx;
|
10455 | closest.delta.y = dy;
|
10456 | }
|
10457 | }
|
10458 |
|
10459 | if (closest.inRange) {
|
10460 | coords.x = closest.target.x;
|
10461 | coords.y = closest.target.y;
|
10462 | }
|
10463 |
|
10464 | state.closest = closest;
|
10465 | return closest;
|
10466 | }
|
10467 |
|
10468 | function getOrigin(arg) {
|
10469 | var element = arg.interaction.element;
|
10470 | var optionsOrigin = (0, _$rect_77.rectToXY)((0, _$rect_77.resolveRectLike)(arg.state.options.origin, null, null, [element]));
|
10471 | var origin = optionsOrigin || (0, _$getOriginXY_68.default)(arg.interactable, element, arg.interaction.prepared.name);
|
10472 | return origin;
|
10473 | }
|
10474 |
|
10475 | var __defaults_46 = {
|
10476 | range: Infinity,
|
10477 | targets: null,
|
10478 | offset: null,
|
10479 | offsetWithOrigin: true,
|
10480 | origin: null,
|
10481 | relativePoints: null,
|
10482 | endOnly: false,
|
10483 | enabled: false
|
10484 | };
|
10485 | var snap = {
|
10486 | start: __start_46,
|
10487 | set: __set_46,
|
10488 | defaults: __defaults_46
|
10489 | };
|
10490 | _$pointer_46.snap = snap;
|
10491 |
|
10492 | var ___default_46 = (0, _$base_37.makeModifier)(snap, 'snap');
|
10493 |
|
10494 | _$pointer_46.default = ___default_46;
|
10495 | var _$size_47 = {};
|
10496 | "use strict";
|
10497 |
|
10498 | Object.defineProperty(_$size_47, "__esModule", {
|
10499 | value: true
|
10500 | });
|
10501 | _$size_47.snapSize = _$size_47.default = void 0;
|
10502 |
|
10503 |
|
10504 | ;
|
10505 |
|
10506 |
|
10507 | ;
|
10508 |
|
10509 |
|
10510 | ;
|
10511 |
|
10512 |
|
10513 | ;
|
10514 |
|
10515 | function ___slicedToArray_47(arr, i) {
|
10516 | return ___arrayWithHoles_47(arr) || ___iterableToArrayLimit_47(arr, i) || ___unsupportedIterableToArray_47(arr, i) || ___nonIterableRest_47();
|
10517 | }
|
10518 |
|
10519 | function ___nonIterableRest_47() {
|
10520 | throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
10521 | }
|
10522 |
|
10523 | function ___unsupportedIterableToArray_47(o, minLen) {
|
10524 | if (!o) return;
|
10525 | if (typeof o === "string") return ___arrayLikeToArray_47(o, minLen);
|
10526 | var n = Object.prototype.toString.call(o).slice(8, -1);
|
10527 | if (n === "Object" && o.constructor) n = o.constructor.name;
|
10528 | if (n === "Map" || n === "Set") return Array.from(o);
|
10529 | if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return ___arrayLikeToArray_47(o, minLen);
|
10530 | }
|
10531 |
|
10532 | function ___arrayLikeToArray_47(arr, len) {
|
10533 | if (len == null || len > arr.length) len = arr.length;
|
10534 |
|
10535 | for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
10536 | arr2[i] = arr[i];
|
10537 | }
|
10538 |
|
10539 | return arr2;
|
10540 | }
|
10541 |
|
10542 | function ___iterableToArrayLimit_47(arr, i) {
|
10543 | if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
|
10544 | var _arr = [];
|
10545 | var _n = true;
|
10546 | var _d = false;
|
10547 | var _e = undefined;
|
10548 |
|
10549 | try {
|
10550 | for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
|
10551 | _arr.push(_s.value);
|
10552 |
|
10553 | if (i && _arr.length === i) break;
|
10554 | }
|
10555 | } catch (err) {
|
10556 | _d = true;
|
10557 | _e = err;
|
10558 | } finally {
|
10559 | try {
|
10560 | if (!_n && _i["return"] != null) _i["return"]();
|
10561 | } finally {
|
10562 | if (_d) throw _e;
|
10563 | }
|
10564 | }
|
10565 |
|
10566 | return _arr;
|
10567 | }
|
10568 |
|
10569 | function ___arrayWithHoles_47(arr) {
|
10570 | if (Array.isArray(arr)) return arr;
|
10571 | }
|
10572 |
|
10573 | function __start_47(arg) {
|
10574 | var state = arg.state,
|
10575 | edges = arg.edges;
|
10576 | var options = state.options;
|
10577 |
|
10578 | if (!edges) {
|
10579 | return null;
|
10580 | }
|
10581 |
|
10582 | arg.state = {
|
10583 | options: {
|
10584 | targets: null,
|
10585 | relativePoints: [{
|
10586 | x: edges.left ? 0 : 1,
|
10587 | y: edges.top ? 0 : 1
|
10588 | }],
|
10589 | offset: options.offset || 'self',
|
10590 | origin: {
|
10591 | x: 0,
|
10592 | y: 0
|
10593 | },
|
10594 | range: options.range
|
10595 | }
|
10596 | };
|
10597 | state.targetFields = state.targetFields || [['width', 'height'], ['x', 'y']];
|
10598 |
|
10599 | _$pointer_46.snap.start(arg);
|
10600 |
|
10601 | state.offsets = arg.state.offsets;
|
10602 | arg.state = state;
|
10603 | }
|
10604 |
|
10605 | function __set_47(arg) {
|
10606 | var interaction = arg.interaction,
|
10607 | state = arg.state,
|
10608 | coords = arg.coords;
|
10609 | var options = state.options,
|
10610 | offsets = state.offsets;
|
10611 | var relative = {
|
10612 | x: coords.x - offsets[0].x,
|
10613 | y: coords.y - offsets[0].y
|
10614 | };
|
10615 | state.options = (0, _$extend_67.default)({}, options);
|
10616 | state.options.targets = [];
|
10617 |
|
10618 | for (var _i = 0; _i < (options.targets || []).length; _i++) {
|
10619 | var _ref;
|
10620 |
|
10621 | _ref = (options.targets || [])[_i];
|
10622 | var snapTarget = _ref;
|
10623 | var target = void 0;
|
10624 |
|
10625 | if (_$is_70.default.func(snapTarget)) {
|
10626 | target = snapTarget(relative.x, relative.y, interaction);
|
10627 | } else {
|
10628 | target = snapTarget;
|
10629 | }
|
10630 |
|
10631 | if (!target) {
|
10632 | continue;
|
10633 | }
|
10634 |
|
10635 | for (var _i2 = 0; _i2 < state.targetFields.length; _i2++) {
|
10636 | var _ref2;
|
10637 |
|
10638 | _ref2 = state.targetFields[_i2];
|
10639 |
|
10640 | var _ref3 = _ref2,
|
10641 | _ref4 = ___slicedToArray_47(_ref3, 2),
|
10642 | xField = _ref4[0],
|
10643 | yField = _ref4[1];
|
10644 |
|
10645 | if (xField in target || yField in target) {
|
10646 | target.x = target[xField];
|
10647 | target.y = target[yField];
|
10648 | break;
|
10649 | }
|
10650 | }
|
10651 |
|
10652 | state.options.targets.push(target);
|
10653 | }
|
10654 |
|
10655 | var returnValue = _$pointer_46.snap.set(arg);
|
10656 |
|
10657 | state.options = options;
|
10658 | return returnValue;
|
10659 | }
|
10660 |
|
10661 | var __defaults_47 = {
|
10662 | range: Infinity,
|
10663 | targets: null,
|
10664 | offset: null,
|
10665 | endOnly: false,
|
10666 | enabled: false
|
10667 | };
|
10668 | var snapSize = {
|
10669 | start: __start_47,
|
10670 | set: __set_47,
|
10671 | defaults: __defaults_47
|
10672 | };
|
10673 | _$size_47.snapSize = snapSize;
|
10674 |
|
10675 | var ___default_47 = (0, _$base_37.makeModifier)(snapSize, 'snapSize');
|
10676 |
|
10677 | _$size_47.default = ___default_47;
|
10678 | var _$edges_45 = {};
|
10679 | "use strict";
|
10680 |
|
10681 | Object.defineProperty(_$edges_45, "__esModule", {
|
10682 | value: true
|
10683 | });
|
10684 | _$edges_45.snapEdges = _$edges_45.default = void 0;
|
10685 |
|
10686 |
|
10687 | ;
|
10688 |
|
10689 |
|
10690 | ;
|
10691 |
|
10692 |
|
10693 | ;
|
10694 |
|
10695 |
|
10696 | ;
|
10697 | |
10698 |
|
10699 |
|
10700 |
|
10701 |
|
10702 |
|
10703 |
|
10704 |
|
10705 |
|
10706 |
|
10707 |
|
10708 |
|
10709 |
|
10710 |
|
10711 |
|
10712 |
|
10713 |
|
10714 |
|
10715 |
|
10716 |
|
10717 |
|
10718 |
|
10719 |
|
10720 |
|
10721 |
|
10722 |
|
10723 |
|
10724 |
|
10725 |
|
10726 | function __start_45(arg) {
|
10727 | var edges = arg.edges;
|
10728 |
|
10729 | if (!edges) {
|
10730 | return null;
|
10731 | }
|
10732 |
|
10733 | arg.state.targetFields = arg.state.targetFields || [[edges.left ? 'left' : 'right', edges.top ? 'top' : 'bottom']];
|
10734 | return _$size_47.snapSize.start(arg);
|
10735 | }
|
10736 |
|
10737 | var snapEdges = {
|
10738 | start: __start_45,
|
10739 | set: _$size_47.snapSize.set,
|
10740 | defaults: (0, _$extend_67.default)((0, _$clone_64.default)(_$size_47.snapSize.defaults), {
|
10741 | targets: null,
|
10742 | range: null,
|
10743 | offset: {
|
10744 | x: 0,
|
10745 | y: 0
|
10746 | }
|
10747 | })
|
10748 | };
|
10749 | _$edges_45.snapEdges = snapEdges;
|
10750 |
|
10751 | var ___default_45 = (0, _$base_37.makeModifier)(snapEdges, 'snapEdges');
|
10752 |
|
10753 | _$edges_45.default = ___default_45;
|
10754 | var _$spring_48 = {};
|
10755 | "use strict";
|
10756 |
|
10757 | Object.defineProperty(_$spring_48, "__esModule", {
|
10758 | value: true
|
10759 | });
|
10760 | Object.defineProperty(_$spring_48, "default", {
|
10761 | enumerable: true,
|
10762 | get: function get() {
|
10763 | return _$noop_38.default;
|
10764 | }
|
10765 | });
|
10766 |
|
10767 |
|
10768 | ;
|
10769 | var _$transform_49 = {};
|
10770 | "use strict";
|
10771 |
|
10772 | Object.defineProperty(_$transform_49, "__esModule", {
|
10773 | value: true
|
10774 | });
|
10775 | Object.defineProperty(_$transform_49, "default", {
|
10776 | enumerable: true,
|
10777 | get: function get() {
|
10778 | return _$noop_38.default;
|
10779 | }
|
10780 | });
|
10781 |
|
10782 |
|
10783 | ;
|
10784 | var _$all_34 = {};
|
10785 | "use strict";
|
10786 |
|
10787 | Object.defineProperty(_$all_34, "__esModule", {
|
10788 | value: true
|
10789 | });
|
10790 | _$all_34.default = void 0;
|
10791 |
|
10792 |
|
10793 | ;
|
10794 |
|
10795 |
|
10796 | ;
|
10797 |
|
10798 |
|
10799 | ;
|
10800 |
|
10801 |
|
10802 | ;
|
10803 |
|
10804 |
|
10805 | ;
|
10806 |
|
10807 |
|
10808 | ;
|
10809 |
|
10810 |
|
10811 | ;
|
10812 |
|
10813 |
|
10814 | ;
|
10815 |
|
10816 |
|
10817 | ;
|
10818 |
|
10819 |
|
10820 | ;
|
10821 |
|
10822 |
|
10823 | ;
|
10824 |
|
10825 |
|
10826 | ;
|
10827 |
|
10828 |
|
10829 | var ___default_34 = {
|
10830 | aspectRatio: _$aspectRatio_35.default,
|
10831 | restrictEdges: _$edges_40.default,
|
10832 | restrict: _$pointer_41.default,
|
10833 | restrictRect: _$rect_42.default,
|
10834 | restrictSize: _$size_43.default,
|
10835 | snapEdges: _$edges_45.default,
|
10836 | snap: _$pointer_46.default,
|
10837 | snapSize: _$size_47.default,
|
10838 | spring: _$spring_48.default,
|
10839 | avoid: _$avoid_36.default,
|
10840 | transform: _$transform_49.default,
|
10841 | rubberband: _$rubberband_44.default
|
10842 | };
|
10843 | _$all_34.default = ___default_34;
|
10844 | var _$plugin_39 = {};
|
10845 | "use strict";
|
10846 |
|
10847 | Object.defineProperty(_$plugin_39, "__esModule", {
|
10848 | value: true
|
10849 | });
|
10850 | _$plugin_39.default = void 0;
|
10851 |
|
10852 |
|
10853 | ;
|
10854 |
|
10855 |
|
10856 | ;
|
10857 |
|
10858 |
|
10859 | ;
|
10860 | var __modifiers_39 = {
|
10861 | id: 'modifiers',
|
10862 | install: function install(scope) {
|
10863 | var interact = scope.interactStatic;
|
10864 | scope.usePlugin(_$base_37.default);
|
10865 | scope.usePlugin(_$plugin_61.default);
|
10866 | interact.modifiers = _$all_34.default;
|
10867 |
|
10868 | for (var type in _$all_34.default) {
|
10869 | var _all = _$all_34.default[type],
|
10870 | _defaults = _all._defaults,
|
10871 | _methods = _all._methods;
|
10872 | _defaults._methods = _methods;
|
10873 | scope.defaults.perAction[type] = _defaults;
|
10874 | }
|
10875 | }
|
10876 | };
|
10877 | var ___default_39 = __modifiers_39;
|
10878 | _$plugin_39.default = ___default_39;
|
10879 | var _$PointerEvent_51 = {};
|
10880 | "use strict";
|
10881 |
|
10882 | function ___typeof_51(obj) {
|
10883 | "@babel/helpers - typeof";
|
10884 |
|
10885 | if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
10886 | ___typeof_51 = function _typeof(obj) {
|
10887 | return typeof obj;
|
10888 | };
|
10889 | } else {
|
10890 | ___typeof_51 = function _typeof(obj) {
|
10891 | return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
10892 | };
|
10893 | }
|
10894 |
|
10895 | return ___typeof_51(obj);
|
10896 | }
|
10897 |
|
10898 | Object.defineProperty(_$PointerEvent_51, "__esModule", {
|
10899 | value: true
|
10900 | });
|
10901 | _$PointerEvent_51.PointerEvent = _$PointerEvent_51.default = void 0;
|
10902 |
|
10903 |
|
10904 | ;
|
10905 |
|
10906 |
|
10907 | ;
|
10908 |
|
10909 | function ___classCallCheck_51(instance, Constructor) {
|
10910 | if (!(instance instanceof Constructor)) {
|
10911 | throw new TypeError("Cannot call a class as a function");
|
10912 | }
|
10913 | }
|
10914 |
|
10915 | function ___defineProperties_51(target, props) {
|
10916 | for (var i = 0; i < props.length; i++) {
|
10917 | var descriptor = props[i];
|
10918 | descriptor.enumerable = descriptor.enumerable || false;
|
10919 | descriptor.configurable = true;
|
10920 | if ("value" in descriptor) descriptor.writable = true;
|
10921 | Object.defineProperty(target, descriptor.key, descriptor);
|
10922 | }
|
10923 | }
|
10924 |
|
10925 | function ___createClass_51(Constructor, protoProps, staticProps) {
|
10926 | if (protoProps) ___defineProperties_51(Constructor.prototype, protoProps);
|
10927 | if (staticProps) ___defineProperties_51(Constructor, staticProps);
|
10928 | return Constructor;
|
10929 | }
|
10930 |
|
10931 | function ___inherits_51(subClass, superClass) {
|
10932 | if (typeof superClass !== "function" && superClass !== null) {
|
10933 | throw new TypeError("Super expression must either be null or a function");
|
10934 | }
|
10935 |
|
10936 | subClass.prototype = Object.create(superClass && superClass.prototype, {
|
10937 | constructor: {
|
10938 | value: subClass,
|
10939 | writable: true,
|
10940 | configurable: true
|
10941 | }
|
10942 | });
|
10943 | if (superClass) ___setPrototypeOf_51(subClass, superClass);
|
10944 | }
|
10945 |
|
10946 | function ___setPrototypeOf_51(o, p) {
|
10947 | ___setPrototypeOf_51 = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
10948 | o.__proto__ = p;
|
10949 | return o;
|
10950 | };
|
10951 |
|
10952 | return ___setPrototypeOf_51(o, p);
|
10953 | }
|
10954 |
|
10955 | function ___createSuper_51(Derived) {
|
10956 | var hasNativeReflectConstruct = ___isNativeReflectConstruct_51();
|
10957 |
|
10958 | return function _createSuperInternal() {
|
10959 | var Super = ___getPrototypeOf_51(Derived),
|
10960 | result;
|
10961 |
|
10962 | if (hasNativeReflectConstruct) {
|
10963 | var NewTarget = ___getPrototypeOf_51(this).constructor;
|
10964 |
|
10965 | result = Reflect.construct(Super, arguments, NewTarget);
|
10966 | } else {
|
10967 | result = Super.apply(this, arguments);
|
10968 | }
|
10969 |
|
10970 | return ___possibleConstructorReturn_51(this, result);
|
10971 | };
|
10972 | }
|
10973 |
|
10974 | function ___possibleConstructorReturn_51(self, call) {
|
10975 | if (call && (___typeof_51(call) === "object" || typeof call === "function")) {
|
10976 | return call;
|
10977 | }
|
10978 |
|
10979 | return ___assertThisInitialized_51(self);
|
10980 | }
|
10981 |
|
10982 | function ___assertThisInitialized_51(self) {
|
10983 | if (self === void 0) {
|
10984 | throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
10985 | }
|
10986 |
|
10987 | return self;
|
10988 | }
|
10989 |
|
10990 | function ___isNativeReflectConstruct_51() {
|
10991 | if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
10992 | if (Reflect.construct.sham) return false;
|
10993 | if (typeof Proxy === "function") return true;
|
10994 |
|
10995 | try {
|
10996 | Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
10997 | return true;
|
10998 | } catch (e) {
|
10999 | return false;
|
11000 | }
|
11001 | }
|
11002 |
|
11003 | function ___getPrototypeOf_51(o) {
|
11004 | ___getPrototypeOf_51 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
11005 | return o.__proto__ || Object.getPrototypeOf(o);
|
11006 | };
|
11007 | return ___getPrototypeOf_51(o);
|
11008 | }
|
11009 |
|
11010 | function ___defineProperty_51(obj, key, value) {
|
11011 | if (key in obj) {
|
11012 | Object.defineProperty(obj, key, {
|
11013 | value: value,
|
11014 | enumerable: true,
|
11015 | configurable: true,
|
11016 | writable: true
|
11017 | });
|
11018 | } else {
|
11019 | obj[key] = value;
|
11020 | }
|
11021 |
|
11022 | return obj;
|
11023 | }
|
11024 |
|
11025 | var PointerEvent = function (_BaseEvent) {
|
11026 | ___inherits_51(PointerEvent, _BaseEvent);
|
11027 |
|
11028 | var _super = ___createSuper_51(PointerEvent);
|
11029 |
|
11030 |
|
11031 |
|
11032 | function PointerEvent(type, pointer, event, eventTarget, interaction, timeStamp) {
|
11033 | var _this;
|
11034 |
|
11035 | ___classCallCheck_51(this, PointerEvent);
|
11036 |
|
11037 | _this = _super.call(this, interaction);
|
11038 |
|
11039 | ___defineProperty_51(___assertThisInitialized_51(_this), "type", void 0);
|
11040 |
|
11041 | ___defineProperty_51(___assertThisInitialized_51(_this), "originalEvent", void 0);
|
11042 |
|
11043 | ___defineProperty_51(___assertThisInitialized_51(_this), "pointerId", void 0);
|
11044 |
|
11045 | ___defineProperty_51(___assertThisInitialized_51(_this), "pointerType", void 0);
|
11046 |
|
11047 | ___defineProperty_51(___assertThisInitialized_51(_this), "double", void 0);
|
11048 |
|
11049 | ___defineProperty_51(___assertThisInitialized_51(_this), "pageX", void 0);
|
11050 |
|
11051 | ___defineProperty_51(___assertThisInitialized_51(_this), "pageY", void 0);
|
11052 |
|
11053 | ___defineProperty_51(___assertThisInitialized_51(_this), "clientX", void 0);
|
11054 |
|
11055 | ___defineProperty_51(___assertThisInitialized_51(_this), "clientY", void 0);
|
11056 |
|
11057 | ___defineProperty_51(___assertThisInitialized_51(_this), "dt", void 0);
|
11058 |
|
11059 | ___defineProperty_51(___assertThisInitialized_51(_this), "eventable", void 0);
|
11060 |
|
11061 | _$pointerUtils_75.pointerExtend(___assertThisInitialized_51(_this), event);
|
11062 |
|
11063 | if (event !== pointer) {
|
11064 | _$pointerUtils_75.pointerExtend(___assertThisInitialized_51(_this), pointer);
|
11065 | }
|
11066 |
|
11067 | _this.timeStamp = timeStamp;
|
11068 | _this.originalEvent = event;
|
11069 | _this.type = type;
|
11070 | _this.pointerId = _$pointerUtils_75.getPointerId(pointer);
|
11071 | _this.pointerType = _$pointerUtils_75.getPointerType(pointer);
|
11072 | _this.target = eventTarget;
|
11073 | _this.currentTarget = null;
|
11074 |
|
11075 | if (type === 'tap') {
|
11076 | var pointerIndex = interaction.getPointerIndex(pointer);
|
11077 | _this.dt = _this.timeStamp - interaction.pointers[pointerIndex].downTime;
|
11078 | var interval = _this.timeStamp - interaction.tapTime;
|
11079 | _this.double = !!(interaction.prevTap && interaction.prevTap.type !== 'doubletap' && interaction.prevTap.target === _this.target && interval < 500);
|
11080 | } else if (type === 'doubletap') {
|
11081 | _this.dt = pointer.timeStamp - interaction.tapTime;
|
11082 | }
|
11083 |
|
11084 | return _this;
|
11085 | }
|
11086 |
|
11087 | ___createClass_51(PointerEvent, [{
|
11088 | key: "_subtractOrigin",
|
11089 | value: function _subtractOrigin(_ref) {
|
11090 | var originX = _ref.x,
|
11091 | originY = _ref.y;
|
11092 | this.pageX -= originX;
|
11093 | this.pageY -= originY;
|
11094 | this.clientX -= originX;
|
11095 | this.clientY -= originY;
|
11096 | return this;
|
11097 | }
|
11098 | }, {
|
11099 | key: "_addOrigin",
|
11100 | value: function _addOrigin(_ref2) {
|
11101 | var originX = _ref2.x,
|
11102 | originY = _ref2.y;
|
11103 | this.pageX += originX;
|
11104 | this.pageY += originY;
|
11105 | this.clientX += originX;
|
11106 | this.clientY += originY;
|
11107 | return this;
|
11108 | }
|
11109 | |
11110 |
|
11111 |
|
11112 |
|
11113 | }, {
|
11114 | key: "preventDefault",
|
11115 | value: function preventDefault() {
|
11116 | this.originalEvent.preventDefault();
|
11117 | }
|
11118 | }]);
|
11119 |
|
11120 | return PointerEvent;
|
11121 | }(_$BaseEvent_13.BaseEvent);
|
11122 |
|
11123 | _$PointerEvent_51.PointerEvent = _$PointerEvent_51.default = PointerEvent;
|
11124 | var _$base_52 = {};
|
11125 | "use strict";
|
11126 |
|
11127 | Object.defineProperty(_$base_52, "__esModule", {
|
11128 | value: true
|
11129 | });
|
11130 | _$base_52.default = void 0;
|
11131 |
|
11132 |
|
11133 | ;
|
11134 |
|
11135 |
|
11136 | ;
|
11137 |
|
11138 |
|
11139 | ;
|
11140 |
|
11141 |
|
11142 | ;
|
11143 | var __defaults_52 = {
|
11144 | holdDuration: 600,
|
11145 | ignoreFrom: null,
|
11146 | allowFrom: null,
|
11147 | origin: {
|
11148 | x: 0,
|
11149 | y: 0
|
11150 | }
|
11151 | };
|
11152 | var pointerEvents = {
|
11153 | id: 'pointer-events/base',
|
11154 | before: ['inertia', 'modifiers', 'auto-start', 'actions'],
|
11155 | install: __install_52,
|
11156 | listeners: {
|
11157 | 'interactions:new': addInteractionProps,
|
11158 | 'interactions:update-pointer': addHoldInfo,
|
11159 | 'interactions:move': moveAndClearHold,
|
11160 | 'interactions:down': function interactionsDown(arg, scope) {
|
11161 | downAndStartHold(arg, scope);
|
11162 | fire(arg, scope);
|
11163 | },
|
11164 | 'interactions:up': function interactionsUp(arg, scope) {
|
11165 | clearHold(arg);
|
11166 | fire(arg, scope);
|
11167 | tapAfterUp(arg, scope);
|
11168 | },
|
11169 | 'interactions:cancel': function interactionsCancel(arg, scope) {
|
11170 | clearHold(arg);
|
11171 | fire(arg, scope);
|
11172 | }
|
11173 | },
|
11174 | PointerEvent: _$PointerEvent_51.PointerEvent,
|
11175 | fire: fire,
|
11176 | collectEventTargets: collectEventTargets,
|
11177 | defaults: __defaults_52,
|
11178 | types: {
|
11179 | down: true,
|
11180 | move: true,
|
11181 | up: true,
|
11182 | cancel: true,
|
11183 | tap: true,
|
11184 | doubletap: true,
|
11185 | hold: true
|
11186 | }
|
11187 | };
|
11188 |
|
11189 | function fire(arg, scope) {
|
11190 | var interaction = arg.interaction,
|
11191 | pointer = arg.pointer,
|
11192 | event = arg.event,
|
11193 | eventTarget = arg.eventTarget,
|
11194 | type = arg.type,
|
11195 | _arg$targets = arg.targets,
|
11196 | targets = _arg$targets === void 0 ? collectEventTargets(arg, scope) : _arg$targets;
|
11197 | var pointerEvent = new _$PointerEvent_51.PointerEvent(type, pointer, event, eventTarget, interaction, scope.now());
|
11198 | scope.fire('pointerEvents:new', {
|
11199 | pointerEvent: pointerEvent
|
11200 | });
|
11201 | var signalArg = {
|
11202 | interaction: interaction,
|
11203 | pointer: pointer,
|
11204 | event: event,
|
11205 | eventTarget: eventTarget,
|
11206 | targets: targets,
|
11207 | type: type,
|
11208 | pointerEvent: pointerEvent
|
11209 | };
|
11210 |
|
11211 | for (var i = 0; i < targets.length; i++) {
|
11212 | var target = targets[i];
|
11213 |
|
11214 | for (var prop in target.props || {}) {
|
11215 | ;
|
11216 | pointerEvent[prop] = target.props[prop];
|
11217 | }
|
11218 |
|
11219 | var origin = (0, _$getOriginXY_68.default)(target.eventable, target.node);
|
11220 |
|
11221 | pointerEvent._subtractOrigin(origin);
|
11222 |
|
11223 | pointerEvent.eventable = target.eventable;
|
11224 | pointerEvent.currentTarget = target.node;
|
11225 | target.eventable.fire(pointerEvent);
|
11226 |
|
11227 | pointerEvent._addOrigin(origin);
|
11228 |
|
11229 | if (pointerEvent.immediatePropagationStopped || pointerEvent.propagationStopped && i + 1 < targets.length && targets[i + 1].node !== pointerEvent.currentTarget) {
|
11230 | break;
|
11231 | }
|
11232 | }
|
11233 |
|
11234 | scope.fire('pointerEvents:fired', signalArg);
|
11235 |
|
11236 | if (type === 'tap') {
|
11237 |
|
11238 |
|
11239 | var prevTap = pointerEvent.double ? fire({
|
11240 | interaction: interaction,
|
11241 | pointer: pointer,
|
11242 | event: event,
|
11243 | eventTarget: eventTarget,
|
11244 | type: 'doubletap'
|
11245 | }, scope) : pointerEvent;
|
11246 | interaction.prevTap = prevTap;
|
11247 | interaction.tapTime = prevTap.timeStamp;
|
11248 | }
|
11249 |
|
11250 | return pointerEvent;
|
11251 | }
|
11252 |
|
11253 | function collectEventTargets(_ref, scope) {
|
11254 | var interaction = _ref.interaction,
|
11255 | pointer = _ref.pointer,
|
11256 | event = _ref.event,
|
11257 | eventTarget = _ref.eventTarget,
|
11258 | type = _ref.type;
|
11259 | var pointerIndex = interaction.getPointerIndex(pointer);
|
11260 | var pointerInfo = interaction.pointers[pointerIndex];
|
11261 |
|
11262 | if (type === 'tap' && (interaction.pointerWasMoved ||
|
11263 | !(pointerInfo && pointerInfo.downTarget === eventTarget))) {
|
11264 | return [];
|
11265 | }
|
11266 |
|
11267 | var path = _$domUtils_66.getPath(eventTarget);
|
11268 |
|
11269 | var signalArg = {
|
11270 | interaction: interaction,
|
11271 | pointer: pointer,
|
11272 | event: event,
|
11273 | eventTarget: eventTarget,
|
11274 | type: type,
|
11275 | path: path,
|
11276 | targets: [],
|
11277 | node: null
|
11278 | };
|
11279 |
|
11280 | for (var _i = 0; _i < path.length; _i++) {
|
11281 | var _ref2;
|
11282 |
|
11283 | _ref2 = path[_i];
|
11284 | var node = _ref2;
|
11285 | signalArg.node = node;
|
11286 | scope.fire('pointerEvents:collect-targets', signalArg);
|
11287 | }
|
11288 |
|
11289 | if (type === 'hold') {
|
11290 | signalArg.targets = signalArg.targets.filter(function (target) {
|
11291 | var _interaction$pointers;
|
11292 |
|
11293 | return target.eventable.options.holdDuration === ((_interaction$pointers = interaction.pointers[pointerIndex]) == null ? void 0 : _interaction$pointers.hold.duration);
|
11294 | });
|
11295 | }
|
11296 |
|
11297 | return signalArg.targets;
|
11298 | }
|
11299 |
|
11300 | function addInteractionProps(_ref3) {
|
11301 | var interaction = _ref3.interaction;
|
11302 | interaction.prevTap = null;
|
11303 |
|
11304 | interaction.tapTime = 0;
|
11305 | }
|
11306 |
|
11307 | function addHoldInfo(_ref4) {
|
11308 | var down = _ref4.down,
|
11309 | pointerInfo = _ref4.pointerInfo;
|
11310 |
|
11311 | if (!down && pointerInfo.hold) {
|
11312 | return;
|
11313 | }
|
11314 |
|
11315 | pointerInfo.hold = {
|
11316 | duration: Infinity,
|
11317 | timeout: null
|
11318 | };
|
11319 | }
|
11320 |
|
11321 | function clearHold(_ref5) {
|
11322 | var interaction = _ref5.interaction,
|
11323 | pointerIndex = _ref5.pointerIndex;
|
11324 | var hold = interaction.pointers[pointerIndex].hold;
|
11325 |
|
11326 | if (hold && hold.timeout) {
|
11327 | clearTimeout(hold.timeout);
|
11328 | hold.timeout = null;
|
11329 | }
|
11330 | }
|
11331 |
|
11332 | function moveAndClearHold(arg, scope) {
|
11333 | var interaction = arg.interaction,
|
11334 | pointer = arg.pointer,
|
11335 | event = arg.event,
|
11336 | eventTarget = arg.eventTarget,
|
11337 | duplicate = arg.duplicate;
|
11338 |
|
11339 | if (!duplicate && (!interaction.pointerIsDown || interaction.pointerWasMoved)) {
|
11340 | if (interaction.pointerIsDown) {
|
11341 | clearHold(arg);
|
11342 | }
|
11343 |
|
11344 | fire({
|
11345 | interaction: interaction,
|
11346 | pointer: pointer,
|
11347 | event: event,
|
11348 | eventTarget: eventTarget,
|
11349 | type: 'move'
|
11350 | }, scope);
|
11351 | }
|
11352 | }
|
11353 |
|
11354 | function downAndStartHold(_ref6, scope) {
|
11355 | var interaction = _ref6.interaction,
|
11356 | pointer = _ref6.pointer,
|
11357 | event = _ref6.event,
|
11358 | eventTarget = _ref6.eventTarget,
|
11359 | pointerIndex = _ref6.pointerIndex;
|
11360 | var timer = interaction.pointers[pointerIndex].hold;
|
11361 |
|
11362 | var path = _$domUtils_66.getPath(eventTarget);
|
11363 |
|
11364 | var signalArg = {
|
11365 | interaction: interaction,
|
11366 | pointer: pointer,
|
11367 | event: event,
|
11368 | eventTarget: eventTarget,
|
11369 | type: 'hold',
|
11370 | targets: [],
|
11371 | path: path,
|
11372 | node: null
|
11373 | };
|
11374 |
|
11375 | for (var _i2 = 0; _i2 < path.length; _i2++) {
|
11376 | var _ref7;
|
11377 |
|
11378 | _ref7 = path[_i2];
|
11379 | var node = _ref7;
|
11380 | signalArg.node = node;
|
11381 | scope.fire('pointerEvents:collect-targets', signalArg);
|
11382 | }
|
11383 |
|
11384 | if (!signalArg.targets.length) return;
|
11385 | var minDuration = Infinity;
|
11386 |
|
11387 | for (var _i3 = 0; _i3 < signalArg.targets.length; _i3++) {
|
11388 | var _ref8;
|
11389 |
|
11390 | _ref8 = signalArg.targets[_i3];
|
11391 | var target = _ref8;
|
11392 | var holdDuration = target.eventable.options.holdDuration;
|
11393 |
|
11394 | if (holdDuration < minDuration) {
|
11395 | minDuration = holdDuration;
|
11396 | }
|
11397 | }
|
11398 |
|
11399 | timer.duration = minDuration;
|
11400 | timer.timeout = setTimeout(function () {
|
11401 | fire({
|
11402 | interaction: interaction,
|
11403 | eventTarget: eventTarget,
|
11404 | pointer: pointer,
|
11405 | event: event,
|
11406 | type: 'hold'
|
11407 | }, scope);
|
11408 | }, minDuration);
|
11409 | }
|
11410 |
|
11411 | function tapAfterUp(_ref9, scope) {
|
11412 | var interaction = _ref9.interaction,
|
11413 | pointer = _ref9.pointer,
|
11414 | event = _ref9.event,
|
11415 | eventTarget = _ref9.eventTarget;
|
11416 |
|
11417 | if (!interaction.pointerWasMoved) {
|
11418 | fire({
|
11419 | interaction: interaction,
|
11420 | eventTarget: eventTarget,
|
11421 | pointer: pointer,
|
11422 | event: event,
|
11423 | type: 'tap'
|
11424 | }, scope);
|
11425 | }
|
11426 | }
|
11427 |
|
11428 | function __install_52(scope) {
|
11429 | scope.pointerEvents = pointerEvents;
|
11430 | scope.defaults.actions.pointerEvents = pointerEvents.defaults;
|
11431 | (0, _$extend_67.default)(scope.actions.phaselessTypes, pointerEvents.types);
|
11432 | }
|
11433 |
|
11434 | var ___default_52 = pointerEvents;
|
11435 | _$base_52.default = ___default_52;
|
11436 | var _$holdRepeat_53 = {};
|
11437 | "use strict";
|
11438 |
|
11439 | Object.defineProperty(_$holdRepeat_53, "__esModule", {
|
11440 | value: true
|
11441 | });
|
11442 | _$holdRepeat_53.default = void 0;
|
11443 |
|
11444 |
|
11445 | ;
|
11446 |
|
11447 | function __install_53(scope) {
|
11448 | scope.usePlugin(_$base_52.default);
|
11449 | var pointerEvents = scope.pointerEvents;
|
11450 |
|
11451 | pointerEvents.defaults.holdRepeatInterval = 0;
|
11452 | pointerEvents.types.holdrepeat = scope.actions.phaselessTypes.holdrepeat = true;
|
11453 | }
|
11454 |
|
11455 | function onNew(_ref) {
|
11456 | var pointerEvent = _ref.pointerEvent;
|
11457 | if (pointerEvent.type !== 'hold') return;
|
11458 | pointerEvent.count = (pointerEvent.count || 0) + 1;
|
11459 | }
|
11460 |
|
11461 | function onFired(_ref2, scope) {
|
11462 | var interaction = _ref2.interaction,
|
11463 | pointerEvent = _ref2.pointerEvent,
|
11464 | eventTarget = _ref2.eventTarget,
|
11465 | targets = _ref2.targets;
|
11466 | if (pointerEvent.type !== 'hold' || !targets.length) return;
|
11467 |
|
11468 | var interval = targets[0].eventable.options.holdRepeatInterval;
|
11469 |
|
11470 | if (interval <= 0) return;
|
11471 |
|
11472 | interaction.holdIntervalHandle = setTimeout(function () {
|
11473 | scope.pointerEvents.fire({
|
11474 | interaction: interaction,
|
11475 | eventTarget: eventTarget,
|
11476 | type: 'hold',
|
11477 | pointer: pointerEvent,
|
11478 | event: pointerEvent
|
11479 | }, scope);
|
11480 | }, interval);
|
11481 | }
|
11482 |
|
11483 | function endHoldRepeat(_ref3) {
|
11484 | var interaction = _ref3.interaction;
|
11485 |
|
11486 |
|
11487 | if (interaction.holdIntervalHandle) {
|
11488 | clearInterval(interaction.holdIntervalHandle);
|
11489 | interaction.holdIntervalHandle = null;
|
11490 | }
|
11491 | }
|
11492 |
|
11493 | var holdRepeat = {
|
11494 | id: 'pointer-events/holdRepeat',
|
11495 | install: __install_53,
|
11496 | listeners: ['move', 'up', 'cancel', 'endall'].reduce(function (acc, enderTypes) {
|
11497 | ;
|
11498 | acc["pointerEvents:".concat(enderTypes)] = endHoldRepeat;
|
11499 | return acc;
|
11500 | }, {
|
11501 | 'pointerEvents:new': onNew,
|
11502 | 'pointerEvents:fired': onFired
|
11503 | })
|
11504 | };
|
11505 | var ___default_53 = holdRepeat;
|
11506 | _$holdRepeat_53.default = ___default_53;
|
11507 | var _$interactableTargets_54 = {};
|
11508 | "use strict";
|
11509 |
|
11510 | Object.defineProperty(_$interactableTargets_54, "__esModule", {
|
11511 | value: true
|
11512 | });
|
11513 | _$interactableTargets_54.default = void 0;
|
11514 |
|
11515 |
|
11516 | ;
|
11517 |
|
11518 | function __install_54(scope) {
|
11519 | var Interactable = scope.Interactable;
|
11520 | Interactable.prototype.pointerEvents = pointerEventsMethod;
|
11521 | var __backCompatOption = Interactable.prototype._backCompatOption;
|
11522 |
|
11523 | Interactable.prototype._backCompatOption = function (optionName, newValue) {
|
11524 | var ret = __backCompatOption.call(this, optionName, newValue);
|
11525 |
|
11526 | if (ret === this) {
|
11527 | this.events.options[optionName] = newValue;
|
11528 | }
|
11529 |
|
11530 | return ret;
|
11531 | };
|
11532 | }
|
11533 |
|
11534 | function pointerEventsMethod(options) {
|
11535 | (0, _$extend_67.default)(this.events.options, options);
|
11536 | return this;
|
11537 | }
|
11538 |
|
11539 | var plugin = {
|
11540 | id: 'pointer-events/interactableTargets',
|
11541 | install: __install_54,
|
11542 | listeners: {
|
11543 | 'pointerEvents:collect-targets': function pointerEventsCollectTargets(_ref, scope) {
|
11544 | var targets = _ref.targets,
|
11545 | node = _ref.node,
|
11546 | type = _ref.type,
|
11547 | eventTarget = _ref.eventTarget;
|
11548 | scope.interactables.forEachMatch(node, function (interactable) {
|
11549 | var eventable = interactable.events;
|
11550 | var options = eventable.options;
|
11551 |
|
11552 | if (eventable.types[type] && eventable.types[type].length && interactable.testIgnoreAllow(options, node, eventTarget)) {
|
11553 | targets.push({
|
11554 | node: node,
|
11555 | eventable: eventable,
|
11556 | props: {
|
11557 | interactable: interactable
|
11558 | }
|
11559 | });
|
11560 | }
|
11561 | });
|
11562 | },
|
11563 | 'interactable:new': function interactableNew(_ref2) {
|
11564 | var interactable = _ref2.interactable;
|
11565 |
|
11566 | interactable.events.getRect = function (element) {
|
11567 | return interactable.getRect(element);
|
11568 | };
|
11569 | },
|
11570 | 'interactable:set': function interactableSet(_ref3, scope) {
|
11571 | var interactable = _ref3.interactable,
|
11572 | options = _ref3.options;
|
11573 | (0, _$extend_67.default)(interactable.events.options, scope.pointerEvents.defaults);
|
11574 | (0, _$extend_67.default)(interactable.events.options, options.pointerEvents || {});
|
11575 | }
|
11576 | }
|
11577 | };
|
11578 | var ___default_54 = plugin;
|
11579 | _$interactableTargets_54.default = ___default_54;
|
11580 | var _$plugin_55 = {};
|
11581 | "use strict";
|
11582 |
|
11583 | Object.defineProperty(_$plugin_55, "__esModule", {
|
11584 | value: true
|
11585 | });
|
11586 | _$plugin_55.default = void 0;
|
11587 |
|
11588 |
|
11589 | ;
|
11590 |
|
11591 |
|
11592 | ;
|
11593 |
|
11594 |
|
11595 | ;
|
11596 | var __plugin_55 = {
|
11597 | id: 'pointer-events',
|
11598 | install: function install(scope) {
|
11599 | scope.usePlugin(_$base_52);
|
11600 | scope.usePlugin(_$holdRepeat_53.default);
|
11601 | scope.usePlugin(_$interactableTargets_54.default);
|
11602 | }
|
11603 | };
|
11604 | var ___default_55 = __plugin_55;
|
11605 | _$plugin_55.default = ___default_55;
|
11606 | var _$plugin_56 = {};
|
11607 | "use strict";
|
11608 |
|
11609 | Object.defineProperty(_$plugin_56, "__esModule", {
|
11610 | value: true
|
11611 | });
|
11612 | _$plugin_56.install = __install_56;
|
11613 | _$plugin_56.default = void 0;
|
11614 |
|
11615 |
|
11616 | ;
|
11617 |
|
11618 |
|
11619 | ;
|
11620 |
|
11621 |
|
11622 | ;
|
11623 |
|
11624 |
|
11625 | ;
|
11626 |
|
11627 |
|
11628 | ;
|
11629 |
|
11630 | function __install_56(scope) {
|
11631 | var Interactable = scope.Interactable;
|
11632 | scope.actions.phases.reflow = true;
|
11633 | |
11634 |
|
11635 |
|
11636 |
|
11637 |
|
11638 |
|
11639 |
|
11640 |
|
11641 |
|
11642 |
|
11643 |
|
11644 |
|
11645 |
|
11646 |
|
11647 |
|
11648 |
|
11649 |
|
11650 | Interactable.prototype.reflow = function (action) {
|
11651 | return doReflow(this, action, scope);
|
11652 | };
|
11653 | }
|
11654 |
|
11655 | function doReflow(interactable, action, scope) {
|
11656 | var elements = _$is_70.default.string(interactable.target) ? _$arr_62.from(interactable._context.querySelectorAll(interactable.target)) : [interactable.target];
|
11657 |
|
11658 | var Promise = scope.window.Promise;
|
11659 | var promises = Promise ? [] : null;
|
11660 |
|
11661 | var _loop = function _loop() {
|
11662 | _ref = elements[_i];
|
11663 | var element = _ref;
|
11664 | var rect = interactable.getRect(element);
|
11665 |
|
11666 | if (!rect) {
|
11667 | return "break";
|
11668 | }
|
11669 |
|
11670 | var runningInteraction = _$arr_62.find(scope.interactions.list, function (interaction) {
|
11671 | return interaction.interacting() && interaction.interactable === interactable && interaction.element === element && interaction.prepared.name === action.name;
|
11672 | });
|
11673 |
|
11674 | var reflowPromise = void 0;
|
11675 |
|
11676 | if (runningInteraction) {
|
11677 | runningInteraction.move();
|
11678 |
|
11679 | if (promises) {
|
11680 | reflowPromise = runningInteraction._reflowPromise || new Promise(function (resolve) {
|
11681 | runningInteraction._reflowResolve = resolve;
|
11682 | });
|
11683 | }
|
11684 | } else {
|
11685 | var xywh = (0, _$rect_77.tlbrToXywh)(rect);
|
11686 | var coords = {
|
11687 | page: {
|
11688 | x: xywh.x,
|
11689 | y: xywh.y
|
11690 | },
|
11691 | client: {
|
11692 | x: xywh.x,
|
11693 | y: xywh.y
|
11694 | },
|
11695 | timeStamp: scope.now()
|
11696 | };
|
11697 |
|
11698 | var event = _$pointerUtils_75.coordsToEvent(coords);
|
11699 |
|
11700 | reflowPromise = startReflow(scope, interactable, element, action, event);
|
11701 | }
|
11702 |
|
11703 | if (promises) {
|
11704 | promises.push(reflowPromise);
|
11705 | }
|
11706 | };
|
11707 |
|
11708 | for (var _i = 0; _i < elements.length; _i++) {
|
11709 | var _ref;
|
11710 |
|
11711 | var _ret = _loop();
|
11712 |
|
11713 | if (_ret === "break") break;
|
11714 | }
|
11715 |
|
11716 | return promises && Promise.all(promises).then(function () {
|
11717 | return interactable;
|
11718 | });
|
11719 | }
|
11720 |
|
11721 | function startReflow(scope, interactable, element, action, event) {
|
11722 | var interaction = scope.interactions.new({
|
11723 | pointerType: 'reflow'
|
11724 | });
|
11725 | var signalArg = {
|
11726 | interaction: interaction,
|
11727 | event: event,
|
11728 | pointer: event,
|
11729 | eventTarget: element,
|
11730 | phase: 'reflow'
|
11731 | };
|
11732 | interaction.interactable = interactable;
|
11733 | interaction.element = element;
|
11734 | interaction.prevEvent = event;
|
11735 | interaction.updatePointer(event, event, element, true);
|
11736 |
|
11737 | _$pointerUtils_75.setZeroCoords(interaction.coords.delta);
|
11738 |
|
11739 | (0, _$misc_72.copyAction)(interaction.prepared, action);
|
11740 |
|
11741 | interaction._doPhase(signalArg);
|
11742 |
|
11743 | var _ref2 = scope.window,
|
11744 | Promise = _ref2.Promise;
|
11745 | var reflowPromise = Promise ? new Promise(function (resolve) {
|
11746 | interaction._reflowResolve = resolve;
|
11747 | }) : undefined;
|
11748 | interaction._reflowPromise = reflowPromise;
|
11749 | interaction.start(action, interactable, element);
|
11750 |
|
11751 | if (interaction._interacting) {
|
11752 | interaction.move(signalArg);
|
11753 | interaction.end(event);
|
11754 | } else {
|
11755 | interaction.stop();
|
11756 |
|
11757 | interaction._reflowResolve();
|
11758 | }
|
11759 |
|
11760 | interaction.removePointer(event, event);
|
11761 | return reflowPromise;
|
11762 | }
|
11763 |
|
11764 | var reflow = {
|
11765 | id: 'reflow',
|
11766 | install: __install_56,
|
11767 | listeners: {
|
11768 |
|
11769 | 'interactions:stop': function interactionsStop(_ref3, scope) {
|
11770 | var interaction = _ref3.interaction;
|
11771 |
|
11772 | if (interaction.pointerType === 'reflow') {
|
11773 | if (interaction._reflowResolve) {
|
11774 | interaction._reflowResolve();
|
11775 | }
|
11776 |
|
11777 | _$arr_62.remove(scope.interactions.list, interaction);
|
11778 | }
|
11779 | }
|
11780 | }
|
11781 | };
|
11782 | var ___default_56 = reflow;
|
11783 | _$plugin_56.default = ___default_56;
|
11784 | var _$index_32 = {
|
11785 | exports: {}
|
11786 | };
|
11787 | "use strict";
|
11788 |
|
11789 | Object.defineProperty(_$index_32.exports, "__esModule", {
|
11790 | value: true
|
11791 | });
|
11792 | _$index_32.exports.default = void 0;
|
11793 |
|
11794 |
|
11795 | ;
|
11796 |
|
11797 |
|
11798 | ;
|
11799 |
|
11800 |
|
11801 | ;
|
11802 |
|
11803 |
|
11804 | ;
|
11805 |
|
11806 |
|
11807 | ;
|
11808 |
|
11809 |
|
11810 | ;
|
11811 |
|
11812 |
|
11813 | ;
|
11814 |
|
11815 |
|
11816 | ;
|
11817 |
|
11818 |
|
11819 | ;
|
11820 |
|
11821 |
|
11822 | ;
|
11823 |
|
11824 |
|
11825 | ;
|
11826 |
|
11827 | function ___typeof_32(obj) {
|
11828 | "@babel/helpers - typeof";
|
11829 |
|
11830 | if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
11831 | ___typeof_32 = function _typeof(obj) {
|
11832 | return typeof obj;
|
11833 | };
|
11834 | } else {
|
11835 | ___typeof_32 = function _typeof(obj) {
|
11836 | return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
11837 | };
|
11838 | }
|
11839 |
|
11840 | return ___typeof_32(obj);
|
11841 | }
|
11842 |
|
11843 | _$index_31.default.use(_$interactablePreventDefault_22.default);
|
11844 |
|
11845 | _$index_31.default.use(_$plugin_50.default);
|
11846 |
|
11847 |
|
11848 | _$index_31.default.use(_$plugin_55.default);
|
11849 |
|
11850 |
|
11851 | _$index_31.default.use(_$plugin_30.default);
|
11852 |
|
11853 |
|
11854 | _$index_31.default.use(_$plugin_39.default);
|
11855 |
|
11856 |
|
11857 | _$index_31.default.use(_$plugin_12.default);
|
11858 |
|
11859 |
|
11860 | _$index_31.default.use(_$plugin_5.default);
|
11861 |
|
11862 |
|
11863 | _$index_31.default.use(_$plugin_7.default);
|
11864 |
|
11865 |
|
11866 | _$index_31.default.use(_$plugin_56.default);
|
11867 |
|
11868 |
|
11869 | if ("development" !== 'production') {
|
11870 | _$index_31.default.use(_$plugin_28.default);
|
11871 | }
|
11872 |
|
11873 | var ___default_32 = _$index_31.default;
|
11874 | _$index_32.exports.default = ___default_32;
|
11875 |
|
11876 | if (("object" === "undefined" ? "undefined" : ___typeof_32(_$index_32)) === 'object' && !!_$index_32) {
|
11877 | try {
|
11878 | _$index_32.exports = _$index_31.default;
|
11879 | } catch (_unused) {}
|
11880 | }
|
11881 |
|
11882 | ;
|
11883 | _$index_31.default.default = _$index_31.default;
|
11884 | _$index_32 = _$index_32.exports;
|
11885 | var _$index_79 = {
|
11886 | exports: {}
|
11887 | };
|
11888 | "use strict";
|
11889 |
|
11890 | Object.defineProperty(_$index_79.exports, "__esModule", {
|
11891 | value: true
|
11892 | });
|
11893 | _$index_79.exports.default = void 0;
|
11894 |
|
11895 |
|
11896 | ;
|
11897 |
|
11898 | function ___typeof_79(obj) {
|
11899 | "@babel/helpers - typeof";
|
11900 |
|
11901 | if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
11902 | ___typeof_79 = function _typeof(obj) {
|
11903 | return typeof obj;
|
11904 | };
|
11905 | } else {
|
11906 | ___typeof_79 = function _typeof(obj) {
|
11907 | return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
11908 | };
|
11909 | }
|
11910 |
|
11911 | return ___typeof_79(obj);
|
11912 | }
|
11913 |
|
11914 | var ___default_79 = _$index_32.default;
|
11915 | _$index_79.exports.default = ___default_79;
|
11916 |
|
11917 | if (("object" === "undefined" ? "undefined" : ___typeof_79(_$index_79)) === 'object' && !!_$index_79) {
|
11918 | try {
|
11919 | _$index_79.exports = _$index_32.default;
|
11920 | } catch (_unused) {}
|
11921 | }
|
11922 |
|
11923 | ;
|
11924 | _$index_32.default.default = _$index_32.default;
|
11925 | _$index_79 = _$index_79.exports;
|
11926 | return _$index_79;
|
11927 | }); |
\ | No newline at end of file |