lx-video-player 1.1.5 → 1.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1188 +0,0 @@
1
- import { g as be } from "./_commonjsHelpers-10dfc225.js";
2
- var Jt = { exports: {} };
3
- /*! Hammer.JS - v2.0.7 - 2016-04-22
4
- * http://hammerjs.github.io/
5
- *
6
- * Copyright (c) 2016 Jorik Tangelder;
7
- * Licensed under the MIT license */
8
- (function(It) {
9
- (function(u, yt, Qt, l) {
10
- var Pt = ["", "webkit", "Moz", "MS", "ms", "o"], Kt = yt.createElement("div"), $t = "function", x = Math.round, S = Math.abs, at = Date.now;
11
- function ot(t, e, i) {
12
- return setTimeout(ht(t, i), e);
13
- }
14
- function L(t, e, i) {
15
- return Array.isArray(t) ? (P(t, i[e], i), !0) : !1;
16
- }
17
- function P(t, e, i) {
18
- var r;
19
- if (t)
20
- if (t.forEach)
21
- t.forEach(e, i);
22
- else if (t.length !== l)
23
- for (r = 0; r < t.length; )
24
- e.call(i, t[r], r, t), r++;
25
- else
26
- for (r in t)
27
- t.hasOwnProperty(r) && e.call(i, t[r], r, t);
28
- }
29
- function Nt(t, e, i) {
30
- var r = "DEPRECATED METHOD: " + e + `
31
- ` + i + ` AT
32
- `;
33
- return function() {
34
- var n = new Error("get-stack-trace"), s = n && n.stack ? n.stack.replace(/^[^\(]+?[\n$]/gm, "").replace(/^\s+at\s+/gm, "").replace(/^Object.<anonymous>\s*\(/gm, "{anonymous}()@") : "Unknown Stack Trace", a = u.console && (u.console.warn || u.console.log);
35
- return a && a.call(u.console, r, s), t.apply(this, arguments);
36
- };
37
- }
38
- var g;
39
- typeof Object.assign != "function" ? g = function(e) {
40
- if (e === l || e === null)
41
- throw new TypeError("Cannot convert undefined or null to object");
42
- for (var i = Object(e), r = 1; r < arguments.length; r++) {
43
- var n = arguments[r];
44
- if (n !== l && n !== null)
45
- for (var s in n)
46
- n.hasOwnProperty(s) && (i[s] = n[s]);
47
- }
48
- return i;
49
- } : g = Object.assign;
50
- var Ot = Nt(function(e, i, r) {
51
- for (var n = Object.keys(i), s = 0; s < n.length; )
52
- (!r || r && e[n[s]] === l) && (e[n[s]] = i[n[s]]), s++;
53
- return e;
54
- }, "extend", "Use `assign`."), te = Nt(function(e, i) {
55
- return Ot(e, i, !0);
56
- }, "merge", "Use `assign`.");
57
- function T(t, e, i) {
58
- var r = e.prototype, n;
59
- n = t.prototype = Object.create(r), n.constructor = t, n._super = r, i && g(n, i);
60
- }
61
- function ht(t, e) {
62
- return function() {
63
- return t.apply(e, arguments);
64
- };
65
- }
66
- function lt(t, e) {
67
- return typeof t == $t ? t.apply(e && e[0] || l, e) : t;
68
- }
69
- function At(t, e) {
70
- return t === l ? e : t;
71
- }
72
- function z(t, e, i) {
73
- P(Z(e), function(r) {
74
- t.addEventListener(r, i, !1);
75
- });
76
- }
77
- function k(t, e, i) {
78
- P(Z(e), function(r) {
79
- t.removeEventListener(r, i, !1);
80
- });
81
- }
82
- function Ct(t, e) {
83
- for (; t; ) {
84
- if (t == e)
85
- return !0;
86
- t = t.parentNode;
87
- }
88
- return !1;
89
- }
90
- function D(t, e) {
91
- return t.indexOf(e) > -1;
92
- }
93
- function Z(t) {
94
- return t.trim().split(/\s+/g);
95
- }
96
- function Y(t, e, i) {
97
- if (t.indexOf && !i)
98
- return t.indexOf(e);
99
- for (var r = 0; r < t.length; ) {
100
- if (i && t[r][i] == e || !i && t[r] === e)
101
- return r;
102
- r++;
103
- }
104
- return -1;
105
- }
106
- function B(t) {
107
- return Array.prototype.slice.call(t, 0);
108
- }
109
- function St(t, e, i) {
110
- for (var r = [], n = [], s = 0; s < t.length; ) {
111
- var a = e ? t[s][e] : t[s];
112
- Y(n, a) < 0 && r.push(t[s]), n[s] = a, s++;
113
- }
114
- return i && (e ? r = r.sort(function(c, v) {
115
- return c[e] > v[e];
116
- }) : r = r.sort()), r;
117
- }
118
- function j(t, e) {
119
- for (var i, r, n = e[0].toUpperCase() + e.slice(1), s = 0; s < Pt.length; ) {
120
- if (i = Pt[s], r = i ? i + n : e, r in t)
121
- return r;
122
- s++;
123
- }
124
- return l;
125
- }
126
- var ee = 1;
127
- function ie() {
128
- return ee++;
129
- }
130
- function Dt(t) {
131
- var e = t.ownerDocument || t;
132
- return e.defaultView || e.parentWindow || u;
133
- }
134
- var re = /mobile|tablet|ip(ad|hone|od)|android/i, Mt = "ontouchstart" in u, ne = j(u, "PointerEvent") !== l, se = Mt && re.test(navigator.userAgent), H = "touch", ae = "pen", ct = "mouse", oe = "kinect", he = 25, f = 1, M = 2, o = 4, p = 8, J = 1, F = 2, X = 4, V = 8, W = 16, _ = F | X, U = V | W, Ut = _ | U, Rt = ["x", "y"], Q = ["clientX", "clientY"];
135
- function m(t, e) {
136
- var i = this;
137
- this.manager = t, this.callback = e, this.element = t.element, this.target = t.options.inputTarget, this.domHandler = function(r) {
138
- lt(t.options.enable, [t]) && i.handler(r);
139
- }, this.init();
140
- }
141
- m.prototype = {
142
- /**
143
- * should handle the inputEvent data and trigger the callback
144
- * @virtual
145
- */
146
- handler: function() {
147
- },
148
- /**
149
- * bind the events
150
- */
151
- init: function() {
152
- this.evEl && z(this.element, this.evEl, this.domHandler), this.evTarget && z(this.target, this.evTarget, this.domHandler), this.evWin && z(Dt(this.element), this.evWin, this.domHandler);
153
- },
154
- /**
155
- * unbind the events
156
- */
157
- destroy: function() {
158
- this.evEl && k(this.element, this.evEl, this.domHandler), this.evTarget && k(this.target, this.evTarget, this.domHandler), this.evWin && k(Dt(this.element), this.evWin, this.domHandler);
159
- }
160
- };
161
- function le(t) {
162
- var e, i = t.options.inputClass;
163
- return i ? e = i : ne ? e = ft : se ? e = tt : Mt ? e = vt : e = $, new e(t, ce);
164
- }
165
- function ce(t, e, i) {
166
- var r = i.pointers.length, n = i.changedPointers.length, s = e & f && r - n === 0, a = e & (o | p) && r - n === 0;
167
- i.isFirst = !!s, i.isFinal = !!a, s && (t.session = {}), i.eventType = e, ue(t, i), t.emit("hammer.input", i), t.recognize(i), t.session.prevInput = i;
168
- }
169
- function ue(t, e) {
170
- var i = t.session, r = e.pointers, n = r.length;
171
- i.firstInput || (i.firstInput = xt(e)), n > 1 && !i.firstMultiple ? i.firstMultiple = xt(e) : n === 1 && (i.firstMultiple = !1);
172
- var s = i.firstInput, a = i.firstMultiple, h = a ? a.center : s.center, c = e.center = Lt(r);
173
- e.timeStamp = at(), e.deltaTime = e.timeStamp - s.timeStamp, e.angle = ut(h, c), e.distance = K(h, c), fe(i, e), e.offsetDirection = bt(e.deltaX, e.deltaY);
174
- var v = Yt(e.deltaTime, e.deltaX, e.deltaY);
175
- e.overallVelocityX = v.x, e.overallVelocityY = v.y, e.overallVelocity = S(v.x) > S(v.y) ? v.x : v.y, e.scale = a ? Te(a.pointers, r) : 1, e.rotation = a ? pe(a.pointers, r) : 0, e.maxPointers = i.prevInput ? e.pointers.length > i.prevInput.maxPointers ? e.pointers.length : i.prevInput.maxPointers : e.pointers.length, ve(i, e);
176
- var y = t.element;
177
- Ct(e.srcEvent.target, y) && (y = e.srcEvent.target), e.target = y;
178
- }
179
- function fe(t, e) {
180
- var i = e.center, r = t.offsetDelta || {}, n = t.prevDelta || {}, s = t.prevInput || {};
181
- (e.eventType === f || s.eventType === o) && (n = t.prevDelta = {
182
- x: s.deltaX || 0,
183
- y: s.deltaY || 0
184
- }, r = t.offsetDelta = {
185
- x: i.x,
186
- y: i.y
187
- }), e.deltaX = n.x + (i.x - r.x), e.deltaY = n.y + (i.y - r.y);
188
- }
189
- function ve(t, e) {
190
- var i = t.lastInterval || e, r = e.timeStamp - i.timeStamp, n, s, a, h;
191
- if (e.eventType != p && (r > he || i.velocity === l)) {
192
- var c = e.deltaX - i.deltaX, v = e.deltaY - i.deltaY, y = Yt(r, c, v);
193
- s = y.x, a = y.y, n = S(y.x) > S(y.y) ? y.x : y.y, h = bt(c, v), t.lastInterval = e;
194
- } else
195
- n = i.velocity, s = i.velocityX, a = i.velocityY, h = i.direction;
196
- e.velocity = n, e.velocityX = s, e.velocityY = a, e.direction = h;
197
- }
198
- function xt(t) {
199
- for (var e = [], i = 0; i < t.pointers.length; )
200
- e[i] = {
201
- clientX: x(t.pointers[i].clientX),
202
- clientY: x(t.pointers[i].clientY)
203
- }, i++;
204
- return {
205
- timeStamp: at(),
206
- pointers: e,
207
- center: Lt(e),
208
- deltaX: t.deltaX,
209
- deltaY: t.deltaY
210
- };
211
- }
212
- function Lt(t) {
213
- var e = t.length;
214
- if (e === 1)
215
- return {
216
- x: x(t[0].clientX),
217
- y: x(t[0].clientY)
218
- };
219
- for (var i = 0, r = 0, n = 0; n < e; )
220
- i += t[n].clientX, r += t[n].clientY, n++;
221
- return {
222
- x: x(i / e),
223
- y: x(r / e)
224
- };
225
- }
226
- function Yt(t, e, i) {
227
- return {
228
- x: e / t || 0,
229
- y: i / t || 0
230
- };
231
- }
232
- function bt(t, e) {
233
- return t === e ? J : S(t) >= S(e) ? t < 0 ? F : X : e < 0 ? V : W;
234
- }
235
- function K(t, e, i) {
236
- i || (i = Rt);
237
- var r = e[i[0]] - t[i[0]], n = e[i[1]] - t[i[1]];
238
- return Math.sqrt(r * r + n * n);
239
- }
240
- function ut(t, e, i) {
241
- i || (i = Rt);
242
- var r = e[i[0]] - t[i[0]], n = e[i[1]] - t[i[1]];
243
- return Math.atan2(n, r) * 180 / Math.PI;
244
- }
245
- function pe(t, e) {
246
- return ut(e[1], e[0], Q) + ut(t[1], t[0], Q);
247
- }
248
- function Te(t, e) {
249
- return K(e[0], e[1], Q) / K(t[0], t[1], Q);
250
- }
251
- var me = {
252
- mousedown: f,
253
- mousemove: M,
254
- mouseup: o
255
- }, de = "mousedown", Ee = "mousemove mouseup";
256
- function $() {
257
- this.evEl = de, this.evWin = Ee, this.pressed = !1, m.apply(this, arguments);
258
- }
259
- T($, m, {
260
- /**
261
- * handle mouse events
262
- * @param {Object} ev
263
- */
264
- handler: function(e) {
265
- var i = me[e.type];
266
- i & f && e.button === 0 && (this.pressed = !0), i & M && e.which !== 1 && (i = o), this.pressed && (i & o && (this.pressed = !1), this.callback(this.manager, i, {
267
- pointers: [e],
268
- changedPointers: [e],
269
- pointerType: ct,
270
- srcEvent: e
271
- }));
272
- }
273
- });
274
- var ge = {
275
- pointerdown: f,
276
- pointermove: M,
277
- pointerup: o,
278
- pointercancel: p,
279
- pointerout: p
280
- }, _e = {
281
- 2: H,
282
- 3: ae,
283
- 4: ct,
284
- 5: oe
285
- // see https://twitter.com/jacobrossi/status/480596438489890816
286
- }, Ht = "pointerdown", Ft = "pointermove pointerup pointercancel";
287
- u.MSPointerEvent && !u.PointerEvent && (Ht = "MSPointerDown", Ft = "MSPointerMove MSPointerUp MSPointerCancel");
288
- function ft() {
289
- this.evEl = Ht, this.evWin = Ft, m.apply(this, arguments), this.store = this.manager.session.pointerEvents = [];
290
- }
291
- T(ft, m, {
292
- /**
293
- * handle mouse events
294
- * @param {Object} ev
295
- */
296
- handler: function(e) {
297
- var i = this.store, r = !1, n = e.type.toLowerCase().replace("ms", ""), s = ge[n], a = _e[e.pointerType] || e.pointerType, h = a == H, c = Y(i, e.pointerId, "pointerId");
298
- s & f && (e.button === 0 || h) ? c < 0 && (i.push(e), c = i.length - 1) : s & (o | p) && (r = !0), !(c < 0) && (i[c] = e, this.callback(this.manager, s, {
299
- pointers: i,
300
- changedPointers: [e],
301
- pointerType: a,
302
- srcEvent: e
303
- }), r && i.splice(c, 1));
304
- }
305
- });
306
- var Ie = {
307
- touchstart: f,
308
- touchmove: M,
309
- touchend: o,
310
- touchcancel: p
311
- }, ye = "touchstart", Pe = "touchstart touchmove touchend touchcancel";
312
- function Xt() {
313
- this.evTarget = ye, this.evWin = Pe, this.started = !1, m.apply(this, arguments);
314
- }
315
- T(Xt, m, {
316
- handler: function(e) {
317
- var i = Ie[e.type];
318
- if (i === f && (this.started = !0), !!this.started) {
319
- var r = Ne.call(this, e, i);
320
- i & (o | p) && r[0].length - r[1].length === 0 && (this.started = !1), this.callback(this.manager, i, {
321
- pointers: r[0],
322
- changedPointers: r[1],
323
- pointerType: H,
324
- srcEvent: e
325
- });
326
- }
327
- }
328
- });
329
- function Ne(t, e) {
330
- var i = B(t.touches), r = B(t.changedTouches);
331
- return e & (o | p) && (i = St(i.concat(r), "identifier", !0)), [i, r];
332
- }
333
- var Oe = {
334
- touchstart: f,
335
- touchmove: M,
336
- touchend: o,
337
- touchcancel: p
338
- }, Ae = "touchstart touchmove touchend touchcancel";
339
- function tt() {
340
- this.evTarget = Ae, this.targetIds = {}, m.apply(this, arguments);
341
- }
342
- T(tt, m, {
343
- handler: function(e) {
344
- var i = Oe[e.type], r = Ce.call(this, e, i);
345
- r && this.callback(this.manager, i, {
346
- pointers: r[0],
347
- changedPointers: r[1],
348
- pointerType: H,
349
- srcEvent: e
350
- });
351
- }
352
- });
353
- function Ce(t, e) {
354
- var i = B(t.touches), r = this.targetIds;
355
- if (e & (f | M) && i.length === 1)
356
- return r[i[0].identifier] = !0, [i, i];
357
- var n, s, a = B(t.changedTouches), h = [], c = this.target;
358
- if (s = i.filter(function(v) {
359
- return Ct(v.target, c);
360
- }), e === f)
361
- for (n = 0; n < s.length; )
362
- r[s[n].identifier] = !0, n++;
363
- for (n = 0; n < a.length; )
364
- r[a[n].identifier] && h.push(a[n]), e & (o | p) && delete r[a[n].identifier], n++;
365
- if (h.length)
366
- return [
367
- // merge targetTouches with changedTargetTouches so it contains ALL touches, including 'end' and 'cancel'
368
- St(s.concat(h), "identifier", !0),
369
- h
370
- ];
371
- }
372
- var Se = 2500, Vt = 25;
373
- function vt() {
374
- m.apply(this, arguments);
375
- var t = ht(this.handler, this);
376
- this.touch = new tt(this.manager, t), this.mouse = new $(this.manager, t), this.primaryTouch = null, this.lastTouches = [];
377
- }
378
- T(vt, m, {
379
- /**
380
- * handle mouse and touch events
381
- * @param {Hammer} manager
382
- * @param {String} inputEvent
383
- * @param {Object} inputData
384
- */
385
- handler: function(e, i, r) {
386
- var n = r.pointerType == H, s = r.pointerType == ct;
387
- if (!(s && r.sourceCapabilities && r.sourceCapabilities.firesTouchEvents)) {
388
- if (n)
389
- De.call(this, i, r);
390
- else if (s && Me.call(this, r))
391
- return;
392
- this.callback(e, i, r);
393
- }
394
- },
395
- /**
396
- * remove the event listeners
397
- */
398
- destroy: function() {
399
- this.touch.destroy(), this.mouse.destroy();
400
- }
401
- });
402
- function De(t, e) {
403
- t & f ? (this.primaryTouch = e.changedPointers[0].identifier, Wt.call(this, e)) : t & (o | p) && Wt.call(this, e);
404
- }
405
- function Wt(t) {
406
- var e = t.changedPointers[0];
407
- if (e.identifier === this.primaryTouch) {
408
- var i = { x: e.clientX, y: e.clientY };
409
- this.lastTouches.push(i);
410
- var r = this.lastTouches, n = function() {
411
- var s = r.indexOf(i);
412
- s > -1 && r.splice(s, 1);
413
- };
414
- setTimeout(n, Se);
415
- }
416
- }
417
- function Me(t) {
418
- for (var e = t.srcEvent.clientX, i = t.srcEvent.clientY, r = 0; r < this.lastTouches.length; r++) {
419
- var n = this.lastTouches[r], s = Math.abs(e - n.x), a = Math.abs(i - n.y);
420
- if (s <= Vt && a <= Vt)
421
- return !0;
422
- }
423
- return !1;
424
- }
425
- var qt = j(Kt.style, "touchAction"), wt = qt !== l, Gt = "compute", zt = "auto", pt = "manipulation", R = "none", q = "pan-x", w = "pan-y", et = Re();
426
- function Tt(t, e) {
427
- this.manager = t, this.set(e);
428
- }
429
- Tt.prototype = {
430
- /**
431
- * set the touchAction value on the element or enable the polyfill
432
- * @param {String} value
433
- */
434
- set: function(t) {
435
- t == Gt && (t = this.compute()), wt && this.manager.element.style && et[t] && (this.manager.element.style[qt] = t), this.actions = t.toLowerCase().trim();
436
- },
437
- /**
438
- * just re-set the touchAction value
439
- */
440
- update: function() {
441
- this.set(this.manager.options.touchAction);
442
- },
443
- /**
444
- * compute the value for the touchAction property based on the recognizer's settings
445
- * @returns {String} value
446
- */
447
- compute: function() {
448
- var t = [];
449
- return P(this.manager.recognizers, function(e) {
450
- lt(e.options.enable, [e]) && (t = t.concat(e.getTouchAction()));
451
- }), Ue(t.join(" "));
452
- },
453
- /**
454
- * this method is called on each input cycle and provides the preventing of the browser behavior
455
- * @param {Object} input
456
- */
457
- preventDefaults: function(t) {
458
- var e = t.srcEvent, i = t.offsetDirection;
459
- if (this.manager.session.prevented) {
460
- e.preventDefault();
461
- return;
462
- }
463
- var r = this.actions, n = D(r, R) && !et[R], s = D(r, w) && !et[w], a = D(r, q) && !et[q];
464
- if (n) {
465
- var h = t.pointers.length === 1, c = t.distance < 2, v = t.deltaTime < 250;
466
- if (h && c && v)
467
- return;
468
- }
469
- if (!(a && s) && (n || s && i & _ || a && i & U))
470
- return this.preventSrc(e);
471
- },
472
- /**
473
- * call preventDefault to prevent the browser's default behavior (scrolling in most cases)
474
- * @param {Object} srcEvent
475
- */
476
- preventSrc: function(t) {
477
- this.manager.session.prevented = !0, t.preventDefault();
478
- }
479
- };
480
- function Ue(t) {
481
- if (D(t, R))
482
- return R;
483
- var e = D(t, q), i = D(t, w);
484
- return e && i ? R : e || i ? e ? q : w : D(t, pt) ? pt : zt;
485
- }
486
- function Re() {
487
- if (!wt)
488
- return !1;
489
- var t = {}, e = u.CSS && u.CSS.supports;
490
- return ["auto", "manipulation", "pan-y", "pan-x", "pan-x pan-y", "none"].forEach(function(i) {
491
- t[i] = e ? u.CSS.supports("touch-action", i) : !0;
492
- }), t;
493
- }
494
- var it = 1, d = 2, b = 4, C = 8, N = C, G = 16, I = 32;
495
- function O(t) {
496
- this.options = g({}, this.defaults, t || {}), this.id = ie(), this.manager = null, this.options.enable = At(this.options.enable, !0), this.state = it, this.simultaneous = {}, this.requireFail = [];
497
- }
498
- O.prototype = {
499
- /**
500
- * @virtual
501
- * @type {Object}
502
- */
503
- defaults: {},
504
- /**
505
- * set options
506
- * @param {Object} options
507
- * @return {Recognizer}
508
- */
509
- set: function(t) {
510
- return g(this.options, t), this.manager && this.manager.touchAction.update(), this;
511
- },
512
- /**
513
- * recognize simultaneous with an other recognizer.
514
- * @param {Recognizer} otherRecognizer
515
- * @returns {Recognizer} this
516
- */
517
- recognizeWith: function(t) {
518
- if (L(t, "recognizeWith", this))
519
- return this;
520
- var e = this.simultaneous;
521
- return t = rt(t, this), e[t.id] || (e[t.id] = t, t.recognizeWith(this)), this;
522
- },
523
- /**
524
- * drop the simultaneous link. it doesnt remove the link on the other recognizer.
525
- * @param {Recognizer} otherRecognizer
526
- * @returns {Recognizer} this
527
- */
528
- dropRecognizeWith: function(t) {
529
- return L(t, "dropRecognizeWith", this) ? this : (t = rt(t, this), delete this.simultaneous[t.id], this);
530
- },
531
- /**
532
- * recognizer can only run when an other is failing
533
- * @param {Recognizer} otherRecognizer
534
- * @returns {Recognizer} this
535
- */
536
- requireFailure: function(t) {
537
- if (L(t, "requireFailure", this))
538
- return this;
539
- var e = this.requireFail;
540
- return t = rt(t, this), Y(e, t) === -1 && (e.push(t), t.requireFailure(this)), this;
541
- },
542
- /**
543
- * drop the requireFailure link. it does not remove the link on the other recognizer.
544
- * @param {Recognizer} otherRecognizer
545
- * @returns {Recognizer} this
546
- */
547
- dropRequireFailure: function(t) {
548
- if (L(t, "dropRequireFailure", this))
549
- return this;
550
- t = rt(t, this);
551
- var e = Y(this.requireFail, t);
552
- return e > -1 && this.requireFail.splice(e, 1), this;
553
- },
554
- /**
555
- * has require failures boolean
556
- * @returns {boolean}
557
- */
558
- hasRequireFailures: function() {
559
- return this.requireFail.length > 0;
560
- },
561
- /**
562
- * if the recognizer can recognize simultaneous with an other recognizer
563
- * @param {Recognizer} otherRecognizer
564
- * @returns {Boolean}
565
- */
566
- canRecognizeWith: function(t) {
567
- return !!this.simultaneous[t.id];
568
- },
569
- /**
570
- * You should use `tryEmit` instead of `emit` directly to check
571
- * that all the needed recognizers has failed before emitting.
572
- * @param {Object} input
573
- */
574
- emit: function(t) {
575
- var e = this, i = this.state;
576
- function r(n) {
577
- e.manager.emit(n, t);
578
- }
579
- i < C && r(e.options.event + kt(i)), r(e.options.event), t.additionalEvent && r(t.additionalEvent), i >= C && r(e.options.event + kt(i));
580
- },
581
- /**
582
- * Check that all the require failure recognizers has failed,
583
- * if true, it emits a gesture event,
584
- * otherwise, setup the state to FAILED.
585
- * @param {Object} input
586
- */
587
- tryEmit: function(t) {
588
- if (this.canEmit())
589
- return this.emit(t);
590
- this.state = I;
591
- },
592
- /**
593
- * can we emit?
594
- * @returns {boolean}
595
- */
596
- canEmit: function() {
597
- for (var t = 0; t < this.requireFail.length; ) {
598
- if (!(this.requireFail[t].state & (I | it)))
599
- return !1;
600
- t++;
601
- }
602
- return !0;
603
- },
604
- /**
605
- * update the recognizer
606
- * @param {Object} inputData
607
- */
608
- recognize: function(t) {
609
- var e = g({}, t);
610
- if (!lt(this.options.enable, [this, e])) {
611
- this.reset(), this.state = I;
612
- return;
613
- }
614
- this.state & (N | G | I) && (this.state = it), this.state = this.process(e), this.state & (d | b | C | G) && this.tryEmit(e);
615
- },
616
- /**
617
- * return the state of the recognizer
618
- * the actual recognizing happens in this method
619
- * @virtual
620
- * @param {Object} inputData
621
- * @returns {Const} STATE
622
- */
623
- process: function(t) {
624
- },
625
- // jshint ignore:line
626
- /**
627
- * return the preferred touch-action
628
- * @virtual
629
- * @returns {Array}
630
- */
631
- getTouchAction: function() {
632
- },
633
- /**
634
- * called when the gesture isn't allowed to recognize
635
- * like when another is being recognized or it is disabled
636
- * @virtual
637
- */
638
- reset: function() {
639
- }
640
- };
641
- function kt(t) {
642
- return t & G ? "cancel" : t & C ? "end" : t & b ? "move" : t & d ? "start" : "";
643
- }
644
- function Zt(t) {
645
- return t == W ? "down" : t == V ? "up" : t == F ? "left" : t == X ? "right" : "";
646
- }
647
- function rt(t, e) {
648
- var i = e.manager;
649
- return i ? i.get(t) : t;
650
- }
651
- function E() {
652
- O.apply(this, arguments);
653
- }
654
- T(E, O, {
655
- /**
656
- * @namespace
657
- * @memberof AttrRecognizer
658
- */
659
- defaults: {
660
- /**
661
- * @type {Number}
662
- * @default 1
663
- */
664
- pointers: 1
665
- },
666
- /**
667
- * Used to check if it the recognizer receives valid input, like input.distance > 10.
668
- * @memberof AttrRecognizer
669
- * @param {Object} input
670
- * @returns {Boolean} recognized
671
- */
672
- attrTest: function(t) {
673
- var e = this.options.pointers;
674
- return e === 0 || t.pointers.length === e;
675
- },
676
- /**
677
- * Process the input and return the state for the recognizer
678
- * @memberof AttrRecognizer
679
- * @param {Object} input
680
- * @returns {*} State
681
- */
682
- process: function(t) {
683
- var e = this.state, i = t.eventType, r = e & (d | b), n = this.attrTest(t);
684
- return r && (i & p || !n) ? e | G : r || n ? i & o ? e | C : e & d ? e | b : d : I;
685
- }
686
- });
687
- function nt() {
688
- E.apply(this, arguments), this.pX = null, this.pY = null;
689
- }
690
- T(nt, E, {
691
- /**
692
- * @namespace
693
- * @memberof PanRecognizer
694
- */
695
- defaults: {
696
- event: "pan",
697
- threshold: 10,
698
- pointers: 1,
699
- direction: Ut
700
- },
701
- getTouchAction: function() {
702
- var t = this.options.direction, e = [];
703
- return t & _ && e.push(w), t & U && e.push(q), e;
704
- },
705
- directionTest: function(t) {
706
- var e = this.options, i = !0, r = t.distance, n = t.direction, s = t.deltaX, a = t.deltaY;
707
- return n & e.direction || (e.direction & _ ? (n = s === 0 ? J : s < 0 ? F : X, i = s != this.pX, r = Math.abs(t.deltaX)) : (n = a === 0 ? J : a < 0 ? V : W, i = a != this.pY, r = Math.abs(t.deltaY))), t.direction = n, i && r > e.threshold && n & e.direction;
708
- },
709
- attrTest: function(t) {
710
- return E.prototype.attrTest.call(this, t) && (this.state & d || !(this.state & d) && this.directionTest(t));
711
- },
712
- emit: function(t) {
713
- this.pX = t.deltaX, this.pY = t.deltaY;
714
- var e = Zt(t.direction);
715
- e && (t.additionalEvent = this.options.event + e), this._super.emit.call(this, t);
716
- }
717
- });
718
- function mt() {
719
- E.apply(this, arguments);
720
- }
721
- T(mt, E, {
722
- /**
723
- * @namespace
724
- * @memberof PinchRecognizer
725
- */
726
- defaults: {
727
- event: "pinch",
728
- threshold: 0,
729
- pointers: 2
730
- },
731
- getTouchAction: function() {
732
- return [R];
733
- },
734
- attrTest: function(t) {
735
- return this._super.attrTest.call(this, t) && (Math.abs(t.scale - 1) > this.options.threshold || this.state & d);
736
- },
737
- emit: function(t) {
738
- if (t.scale !== 1) {
739
- var e = t.scale < 1 ? "in" : "out";
740
- t.additionalEvent = this.options.event + e;
741
- }
742
- this._super.emit.call(this, t);
743
- }
744
- });
745
- function dt() {
746
- O.apply(this, arguments), this._timer = null, this._input = null;
747
- }
748
- T(dt, O, {
749
- /**
750
- * @namespace
751
- * @memberof PressRecognizer
752
- */
753
- defaults: {
754
- event: "press",
755
- pointers: 1,
756
- time: 251,
757
- // minimal time of the pointer to be pressed
758
- threshold: 9
759
- // a minimal movement is ok, but keep it low
760
- },
761
- getTouchAction: function() {
762
- return [zt];
763
- },
764
- process: function(t) {
765
- var e = this.options, i = t.pointers.length === e.pointers, r = t.distance < e.threshold, n = t.deltaTime > e.time;
766
- if (this._input = t, !r || !i || t.eventType & (o | p) && !n)
767
- this.reset();
768
- else if (t.eventType & f)
769
- this.reset(), this._timer = ot(function() {
770
- this.state = N, this.tryEmit();
771
- }, e.time, this);
772
- else if (t.eventType & o)
773
- return N;
774
- return I;
775
- },
776
- reset: function() {
777
- clearTimeout(this._timer);
778
- },
779
- emit: function(t) {
780
- this.state === N && (t && t.eventType & o ? this.manager.emit(this.options.event + "up", t) : (this._input.timeStamp = at(), this.manager.emit(this.options.event, this._input)));
781
- }
782
- });
783
- function Et() {
784
- E.apply(this, arguments);
785
- }
786
- T(Et, E, {
787
- /**
788
- * @namespace
789
- * @memberof RotateRecognizer
790
- */
791
- defaults: {
792
- event: "rotate",
793
- threshold: 0,
794
- pointers: 2
795
- },
796
- getTouchAction: function() {
797
- return [R];
798
- },
799
- attrTest: function(t) {
800
- return this._super.attrTest.call(this, t) && (Math.abs(t.rotation) > this.options.threshold || this.state & d);
801
- }
802
- });
803
- function gt() {
804
- E.apply(this, arguments);
805
- }
806
- T(gt, E, {
807
- /**
808
- * @namespace
809
- * @memberof SwipeRecognizer
810
- */
811
- defaults: {
812
- event: "swipe",
813
- threshold: 10,
814
- velocity: 0.3,
815
- direction: _ | U,
816
- pointers: 1
817
- },
818
- getTouchAction: function() {
819
- return nt.prototype.getTouchAction.call(this);
820
- },
821
- attrTest: function(t) {
822
- var e = this.options.direction, i;
823
- return e & (_ | U) ? i = t.overallVelocity : e & _ ? i = t.overallVelocityX : e & U && (i = t.overallVelocityY), this._super.attrTest.call(this, t) && e & t.offsetDirection && t.distance > this.options.threshold && t.maxPointers == this.options.pointers && S(i) > this.options.velocity && t.eventType & o;
824
- },
825
- emit: function(t) {
826
- var e = Zt(t.offsetDirection);
827
- e && this.manager.emit(this.options.event + e, t), this.manager.emit(this.options.event, t);
828
- }
829
- });
830
- function st() {
831
- O.apply(this, arguments), this.pTime = !1, this.pCenter = !1, this._timer = null, this._input = null, this.count = 0;
832
- }
833
- T(st, O, {
834
- /**
835
- * @namespace
836
- * @memberof PinchRecognizer
837
- */
838
- defaults: {
839
- event: "tap",
840
- pointers: 1,
841
- taps: 1,
842
- interval: 300,
843
- // max time between the multi-tap taps
844
- time: 250,
845
- // max time of the pointer to be down (like finger on the screen)
846
- threshold: 9,
847
- // a minimal movement is ok, but keep it low
848
- posThreshold: 10
849
- // a multi-tap can be a bit off the initial position
850
- },
851
- getTouchAction: function() {
852
- return [pt];
853
- },
854
- process: function(t) {
855
- var e = this.options, i = t.pointers.length === e.pointers, r = t.distance < e.threshold, n = t.deltaTime < e.time;
856
- if (this.reset(), t.eventType & f && this.count === 0)
857
- return this.failTimeout();
858
- if (r && n && i) {
859
- if (t.eventType != o)
860
- return this.failTimeout();
861
- var s = this.pTime ? t.timeStamp - this.pTime < e.interval : !0, a = !this.pCenter || K(this.pCenter, t.center) < e.posThreshold;
862
- this.pTime = t.timeStamp, this.pCenter = t.center, !a || !s ? this.count = 1 : this.count += 1, this._input = t;
863
- var h = this.count % e.taps;
864
- if (h === 0)
865
- return this.hasRequireFailures() ? (this._timer = ot(function() {
866
- this.state = N, this.tryEmit();
867
- }, e.interval, this), d) : N;
868
- }
869
- return I;
870
- },
871
- failTimeout: function() {
872
- return this._timer = ot(function() {
873
- this.state = I;
874
- }, this.options.interval, this), I;
875
- },
876
- reset: function() {
877
- clearTimeout(this._timer);
878
- },
879
- emit: function() {
880
- this.state == N && (this._input.tapCount = this.count, this.manager.emit(this.options.event, this._input));
881
- }
882
- });
883
- function A(t, e) {
884
- return e = e || {}, e.recognizers = At(e.recognizers, A.defaults.preset), new _t(t, e);
885
- }
886
- A.VERSION = "2.0.7", A.defaults = {
887
- /**
888
- * set if DOM events are being triggered.
889
- * But this is slower and unused by simple implementations, so disabled by default.
890
- * @type {Boolean}
891
- * @default false
892
- */
893
- domEvents: !1,
894
- /**
895
- * The value for the touchAction property/fallback.
896
- * When set to `compute` it will magically set the correct value based on the added recognizers.
897
- * @type {String}
898
- * @default compute
899
- */
900
- touchAction: Gt,
901
- /**
902
- * @type {Boolean}
903
- * @default true
904
- */
905
- enable: !0,
906
- /**
907
- * EXPERIMENTAL FEATURE -- can be removed/changed
908
- * Change the parent input target element.
909
- * If Null, then it is being set the to main element.
910
- * @type {Null|EventTarget}
911
- * @default null
912
- */
913
- inputTarget: null,
914
- /**
915
- * force an input class
916
- * @type {Null|Function}
917
- * @default null
918
- */
919
- inputClass: null,
920
- /**
921
- * Default recognizer setup when calling `Hammer()`
922
- * When creating a new Manager these will be skipped.
923
- * @type {Array}
924
- */
925
- preset: [
926
- // RecognizerClass, options, [recognizeWith, ...], [requireFailure, ...]
927
- [Et, { enable: !1 }],
928
- [mt, { enable: !1 }, ["rotate"]],
929
- [gt, { direction: _ }],
930
- [nt, { direction: _ }, ["swipe"]],
931
- [st],
932
- [st, { event: "doubletap", taps: 2 }, ["tap"]],
933
- [dt]
934
- ],
935
- /**
936
- * Some CSS properties can be used to improve the working of Hammer.
937
- * Add them to this method and they will be set when creating a new Manager.
938
- * @namespace
939
- */
940
- cssProps: {
941
- /**
942
- * Disables text selection to improve the dragging gesture. Mainly for desktop browsers.
943
- * @type {String}
944
- * @default 'none'
945
- */
946
- userSelect: "none",
947
- /**
948
- * Disable the Windows Phone grippers when pressing an element.
949
- * @type {String}
950
- * @default 'none'
951
- */
952
- touchSelect: "none",
953
- /**
954
- * Disables the default callout shown when you touch and hold a touch target.
955
- * On iOS, when you touch and hold a touch target such as a link, Safari displays
956
- * a callout containing information about the link. This property allows you to disable that callout.
957
- * @type {String}
958
- * @default 'none'
959
- */
960
- touchCallout: "none",
961
- /**
962
- * Specifies whether zooming is enabled. Used by IE10>
963
- * @type {String}
964
- * @default 'none'
965
- */
966
- contentZooming: "none",
967
- /**
968
- * Specifies that an entire element should be draggable instead of its contents. Mainly for desktop browsers.
969
- * @type {String}
970
- * @default 'none'
971
- */
972
- userDrag: "none",
973
- /**
974
- * Overrides the highlight color shown when the user taps a link or a JavaScript
975
- * clickable element in iOS. This property obeys the alpha value, if specified.
976
- * @type {String}
977
- * @default 'rgba(0,0,0,0)'
978
- */
979
- tapHighlightColor: "rgba(0,0,0,0)"
980
- }
981
- };
982
- var xe = 1, Bt = 2;
983
- function _t(t, e) {
984
- this.options = g({}, A.defaults, e || {}), this.options.inputTarget = this.options.inputTarget || t, this.handlers = {}, this.session = {}, this.recognizers = [], this.oldCssProps = {}, this.element = t, this.input = le(this), this.touchAction = new Tt(this, this.options.touchAction), jt(this, !0), P(this.options.recognizers, function(i) {
985
- var r = this.add(new i[0](i[1]));
986
- i[2] && r.recognizeWith(i[2]), i[3] && r.requireFailure(i[3]);
987
- }, this);
988
- }
989
- _t.prototype = {
990
- /**
991
- * set options
992
- * @param {Object} options
993
- * @returns {Manager}
994
- */
995
- set: function(t) {
996
- return g(this.options, t), t.touchAction && this.touchAction.update(), t.inputTarget && (this.input.destroy(), this.input.target = t.inputTarget, this.input.init()), this;
997
- },
998
- /**
999
- * stop recognizing for this session.
1000
- * This session will be discarded, when a new [input]start event is fired.
1001
- * When forced, the recognizer cycle is stopped immediately.
1002
- * @param {Boolean} [force]
1003
- */
1004
- stop: function(t) {
1005
- this.session.stopped = t ? Bt : xe;
1006
- },
1007
- /**
1008
- * run the recognizers!
1009
- * called by the inputHandler function on every movement of the pointers (touches)
1010
- * it walks through all the recognizers and tries to detect the gesture that is being made
1011
- * @param {Object} inputData
1012
- */
1013
- recognize: function(t) {
1014
- var e = this.session;
1015
- if (!e.stopped) {
1016
- this.touchAction.preventDefaults(t);
1017
- var i, r = this.recognizers, n = e.curRecognizer;
1018
- (!n || n && n.state & N) && (n = e.curRecognizer = null);
1019
- for (var s = 0; s < r.length; )
1020
- i = r[s], e.stopped !== Bt && // 1
1021
- (!n || i == n || // 2
1022
- i.canRecognizeWith(n)) ? i.recognize(t) : i.reset(), !n && i.state & (d | b | C) && (n = e.curRecognizer = i), s++;
1023
- }
1024
- },
1025
- /**
1026
- * get a recognizer by its event name.
1027
- * @param {Recognizer|String} recognizer
1028
- * @returns {Recognizer|Null}
1029
- */
1030
- get: function(t) {
1031
- if (t instanceof O)
1032
- return t;
1033
- for (var e = this.recognizers, i = 0; i < e.length; i++)
1034
- if (e[i].options.event == t)
1035
- return e[i];
1036
- return null;
1037
- },
1038
- /**
1039
- * add a recognizer to the manager
1040
- * existing recognizers with the same event name will be removed
1041
- * @param {Recognizer} recognizer
1042
- * @returns {Recognizer|Manager}
1043
- */
1044
- add: function(t) {
1045
- if (L(t, "add", this))
1046
- return this;
1047
- var e = this.get(t.options.event);
1048
- return e && this.remove(e), this.recognizers.push(t), t.manager = this, this.touchAction.update(), t;
1049
- },
1050
- /**
1051
- * remove a recognizer by name or instance
1052
- * @param {Recognizer|String} recognizer
1053
- * @returns {Manager}
1054
- */
1055
- remove: function(t) {
1056
- if (L(t, "remove", this))
1057
- return this;
1058
- if (t = this.get(t), t) {
1059
- var e = this.recognizers, i = Y(e, t);
1060
- i !== -1 && (e.splice(i, 1), this.touchAction.update());
1061
- }
1062
- return this;
1063
- },
1064
- /**
1065
- * bind event
1066
- * @param {String} events
1067
- * @param {Function} handler
1068
- * @returns {EventEmitter} this
1069
- */
1070
- on: function(t, e) {
1071
- if (t !== l && e !== l) {
1072
- var i = this.handlers;
1073
- return P(Z(t), function(r) {
1074
- i[r] = i[r] || [], i[r].push(e);
1075
- }), this;
1076
- }
1077
- },
1078
- /**
1079
- * unbind event, leave emit blank to remove all handlers
1080
- * @param {String} events
1081
- * @param {Function} [handler]
1082
- * @returns {EventEmitter} this
1083
- */
1084
- off: function(t, e) {
1085
- if (t !== l) {
1086
- var i = this.handlers;
1087
- return P(Z(t), function(r) {
1088
- e ? i[r] && i[r].splice(Y(i[r], e), 1) : delete i[r];
1089
- }), this;
1090
- }
1091
- },
1092
- /**
1093
- * emit event to the listeners
1094
- * @param {String} event
1095
- * @param {Object} data
1096
- */
1097
- emit: function(t, e) {
1098
- this.options.domEvents && Le(t, e);
1099
- var i = this.handlers[t] && this.handlers[t].slice();
1100
- if (!(!i || !i.length)) {
1101
- e.type = t, e.preventDefault = function() {
1102
- e.srcEvent.preventDefault();
1103
- };
1104
- for (var r = 0; r < i.length; )
1105
- i[r](e), r++;
1106
- }
1107
- },
1108
- /**
1109
- * destroy the manager and unbinds all events
1110
- * it doesn't unbind dom events, that is the user own responsibility
1111
- */
1112
- destroy: function() {
1113
- this.element && jt(this, !1), this.handlers = {}, this.session = {}, this.input.destroy(), this.element = null;
1114
- }
1115
- };
1116
- function jt(t, e) {
1117
- var i = t.element;
1118
- if (i.style) {
1119
- var r;
1120
- P(t.options.cssProps, function(n, s) {
1121
- r = j(i.style, s), e ? (t.oldCssProps[r] = i.style[r], i.style[r] = n) : i.style[r] = t.oldCssProps[r] || "";
1122
- }), e || (t.oldCssProps = {});
1123
- }
1124
- }
1125
- function Le(t, e) {
1126
- var i = yt.createEvent("Event");
1127
- i.initEvent(t, !0, !0), i.gesture = e, e.target.dispatchEvent(i);
1128
- }
1129
- g(A, {
1130
- INPUT_START: f,
1131
- INPUT_MOVE: M,
1132
- INPUT_END: o,
1133
- INPUT_CANCEL: p,
1134
- STATE_POSSIBLE: it,
1135
- STATE_BEGAN: d,
1136
- STATE_CHANGED: b,
1137
- STATE_ENDED: C,
1138
- STATE_RECOGNIZED: N,
1139
- STATE_CANCELLED: G,
1140
- STATE_FAILED: I,
1141
- DIRECTION_NONE: J,
1142
- DIRECTION_LEFT: F,
1143
- DIRECTION_RIGHT: X,
1144
- DIRECTION_UP: V,
1145
- DIRECTION_DOWN: W,
1146
- DIRECTION_HORIZONTAL: _,
1147
- DIRECTION_VERTICAL: U,
1148
- DIRECTION_ALL: Ut,
1149
- Manager: _t,
1150
- Input: m,
1151
- TouchAction: Tt,
1152
- TouchInput: tt,
1153
- MouseInput: $,
1154
- PointerEventInput: ft,
1155
- TouchMouseInput: vt,
1156
- SingleTouchInput: Xt,
1157
- Recognizer: O,
1158
- AttrRecognizer: E,
1159
- Tap: st,
1160
- Pan: nt,
1161
- Swipe: gt,
1162
- Pinch: mt,
1163
- Rotate: Et,
1164
- Press: dt,
1165
- on: z,
1166
- off: k,
1167
- each: P,
1168
- merge: te,
1169
- extend: Ot,
1170
- assign: g,
1171
- inherit: T,
1172
- bindFn: ht,
1173
- prefixed: j
1174
- });
1175
- var Ye = typeof u < "u" ? u : typeof self < "u" ? self : {};
1176
- Ye.Hammer = A, typeof l == "function" && l.amd ? l(function() {
1177
- return A;
1178
- }) : It.exports ? It.exports = A : u[Qt] = A;
1179
- })(window, document, "Hammer");
1180
- })(Jt);
1181
- var He = Jt.exports;
1182
- const Fe = /* @__PURE__ */ be(He), Ve = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1183
- __proto__: null,
1184
- default: Fe
1185
- }, Symbol.toStringTag, { value: "Module" }));
1186
- export {
1187
- Ve as h
1188
- };