gesturx 1.2.0 → 1.5.0

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.
package/dist/index.js CHANGED
@@ -1,128 +1,128 @@
1
1
  var ae = Object.defineProperty;
2
- var ce = (e, n, t) => n in e ? ae(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t;
3
- var w = (e, n, t) => (ce(e, typeof n != "symbol" ? n + "" : n, t), t);
4
- import { filter as v, NEVER as K, merge as A, BehaviorSubject as le, scan as E, map as h, fromEvent as b, mergeMap as T, defer as ge, of as q, takeUntil as x, endWith as he, switchMap as R, exhaustMap as j, shareReplay as Q, withLatestFrom as Y, first as O, share as M, skipUntil as $e, combineLatest as S, ignoreElements as ue, timer as de, buffer as ve, debounceTime as fe, distinctUntilChanged as z } from "rxjs";
5
- function Ae(e, n) {
2
+ var ce = (t, e, n) => e in t ? ae(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var m = (t, e, n) => (ce(t, typeof e != "symbol" ? e + "" : e, n), n);
4
+ import { filter as v, NEVER as K, merge as A, BehaviorSubject as le, scan as F, map as h, fromEvent as I, mergeMap as T, defer as ge, of as q, takeUntil as x, endWith as he, switchMap as R, exhaustMap as j, shareReplay as Q, withLatestFrom as Y, first as z, share as P, skipUntil as $e, combineLatest as S, ignoreElements as ue, timer as de, buffer as ve, debounceTime as fe, distinctUntilChanged as E } from "rxjs";
5
+ function Ae(t, e) {
6
6
  return Math.sqrt(
7
- Math.pow(n.x - e.x, 2) + Math.pow(n.y - e.y, 2)
7
+ Math.pow(e.x - t.x, 2) + Math.pow(e.y - t.y, 2)
8
8
  );
9
9
  }
10
- function De(e) {
11
- const n = e.length;
12
- if (n < 2)
10
+ function ye(t) {
11
+ const e = t.length;
12
+ if (e < 2)
13
13
  return 0;
14
- const t = e.reduce((o, r, p) => o + e.slice(p + 1).reduce((l, a) => l + Ae(r, a), 0), 0), s = n * (n - 1) / 2;
15
- return t / s;
14
+ const n = t.reduce((o, r, p) => o + t.slice(p + 1).reduce((l, a) => l + Ae(r, a), 0), 0), s = e * (e - 1) / 2;
15
+ return n / s;
16
16
  }
17
- function _(e, n) {
18
- const t = n.x - e.x, s = n.y - e.y;
19
- return Math.atan2(s, t);
17
+ function _(t, e) {
18
+ const n = e.x - t.x, s = e.y - t.y;
19
+ return Math.atan2(s, n);
20
20
  }
21
- function ye(e, n) {
22
- return _(e, n) * (180 / Math.PI);
21
+ function De(t, e) {
22
+ return _(t, e) * (180 / Math.PI);
23
23
  }
24
- function C(e) {
25
- const n = e.reduce(
24
+ function b(t) {
25
+ const e = t.reduce(
26
26
  (s, o) => (s.x += o.x, s.y += o.y, s),
27
27
  { x: 0, y: 0 }
28
- ), t = e.length || 1;
28
+ ), n = t.length || 1;
29
29
  return {
30
- x: n.x / t,
31
- y: n.y / t
30
+ x: e.x / n,
31
+ y: e.y / n
32
32
  };
33
33
  }
34
- function me(e, n) {
35
- if (e.length !== n.length)
34
+ function me(t, e) {
35
+ if (t.length !== e.length)
36
36
  throw new Error("Initial and new points arrays must have the same length.");
37
- const t = C(e), s = C(n);
37
+ const n = b(t), s = b(e);
38
38
  let o = 0;
39
- for (let l = 0; l < e.length; l++) {
39
+ for (let l = 0; l < t.length; l++) {
40
40
  const a = _(
41
- t,
42
- e[l]
41
+ n,
42
+ t[l]
43
43
  );
44
44
  let c = _(
45
45
  s,
46
- n[l]
46
+ e[l]
47
47
  ) - a;
48
48
  c > Math.PI ? c -= 2 * Math.PI : c < -Math.PI && (c += 2 * Math.PI), o += c;
49
49
  }
50
- const r = o / e.length, p = r * (180 / Math.PI);
50
+ const r = o / t.length, p = r * (180 / Math.PI);
51
51
  return { radianDelta: r, degreesDelta: p };
52
52
  }
53
- function we(e) {
54
- return e != null;
53
+ function we(t) {
54
+ return t != null;
55
55
  }
56
- const Pe = (e) => e.length > 0, Me = (e) => e.pipe(v(Pe));
57
- function Z(e, n, t) {
58
- const s = C([e]), o = C([n]);
59
- return Math.abs(o.x - s.x) > t || Math.abs(o.y - s.y) > t;
56
+ const Me = (t) => t.length > 0, Pe = (t) => t.pipe(v(Me));
57
+ function Z(t, e, n) {
58
+ const s = b([t]), o = b([e]);
59
+ return Math.abs(o.x - s.x) > n || Math.abs(o.y - s.y) > n;
60
60
  }
61
- const Te = (e) => e != null && e.length ? A(...(e == null ? void 0 : e.map(({ start$: n }) => n)) ?? []) : K, xe = (e, n, t) => {
62
- const s = e > 0 ? n / e : 0, o = e > 0 ? t / e : 0;
61
+ const Te = (t) => t != null && t.length ? A(...(t == null ? void 0 : t.map(({ start$: e }) => e)) ?? []) : K, xe = (t, e, n) => {
62
+ const s = t > 0 ? e / t : 0, o = t > 0 ? n / t : 0;
63
63
  return {
64
64
  velocityX: s,
65
65
  velocityY: o
66
66
  };
67
67
  };
68
- class F {
69
- constructor(n) {
70
- w(this, "config$", new le({}));
71
- w(this, "validConfig$", this.config$.pipe(
68
+ class C {
69
+ constructor(e) {
70
+ m(this, "config$", new le({}));
71
+ m(this, "validConfig$", this.config$.pipe(
72
72
  v(
73
- (n) => !!n.container
73
+ (e) => !!e.container
74
74
  )
75
75
  ));
76
- this.update(n);
76
+ this.update(e);
77
77
  }
78
- initialize(n) {
79
- const t = this.config$.getValue();
78
+ initialize(e) {
79
+ const n = this.config$.getValue();
80
80
  this.config$.next({
81
- ...t,
82
81
  ...n,
82
+ ...e,
83
83
  options: {
84
- ...t.options,
85
- ...n.options
84
+ ...n.options,
85
+ ...e.options
86
86
  }
87
87
  });
88
88
  }
89
- update(n) {
90
- const t = this.config$.getValue();
89
+ update(e) {
90
+ const n = this.config$.getValue();
91
91
  this.config$.next({
92
- ...t,
92
+ ...n,
93
93
  options: {
94
- ...t.options,
95
- ...n
94
+ ...n.options,
95
+ ...e
96
96
  }
97
97
  });
98
98
  }
99
99
  }
100
- const J = (e, n, t, s) => {
101
- const o = e.x - n.x + t, r = e.y - n.y + s;
100
+ const J = (t, e, n, s) => {
101
+ const o = t.x - e.x + n, r = t.y - e.y + s;
102
102
  return {
103
103
  deltaX: o,
104
104
  deltaY: r
105
105
  };
106
- }, W = (e) => {
107
- const n = (t) => C(
108
- t.latestActivePointers.length ? t.latestActivePointers : [t.event]
106
+ }, W = (t) => {
107
+ const e = (n) => b(
108
+ n.latestActivePointers.length ? n.latestActivePointers : [n.event]
109
109
  );
110
- return e.pipe(
111
- E(
112
- (t, s) => {
113
- var D, m;
114
- const o = n(s), r = t.center, p = t.deltaX, l = t.deltaY, a = ((D = t.latestActivePointers) == null ? void 0 : D.length) ?? 0, $ = ((m = s.latestActivePointers) == null ? void 0 : m.length) ?? 0, c = [
110
+ return t.pipe(
111
+ F(
112
+ (n, s) => {
113
+ var y, w;
114
+ const o = e(s), r = n.center, p = n.deltaX, l = n.deltaY, a = ((y = n.latestActivePointers) == null ? void 0 : y.length) ?? 0, $ = ((w = s.latestActivePointers) == null ? void 0 : w.length) ?? 0, c = [
115
115
  "pointerdown",
116
116
  "pointercancel",
117
117
  "pointerleave",
118
118
  "pointerup"
119
119
  ].includes(s.event.type) && a !== $, i = $ > 0, { deltaX: g, deltaY: d } = c && i ? J(o, o, p, l) : J(o, r, p, l), { degreesDelta: f } = a === $ && a >= 2 && $ >= 2 ? me(
120
- t.latestActivePointers ?? [],
120
+ n.latestActivePointers ?? [],
121
121
  s.latestActivePointers ?? []
122
122
  ) : { degreesDelta: 0 };
123
123
  return {
124
124
  startTime: (/* @__PURE__ */ new Date()).getTime(),
125
- ...t,
125
+ ...n,
126
126
  ...s,
127
127
  center: o,
128
128
  deltaX: g,
@@ -137,7 +137,7 @@ const J = (e, n, t, s) => {
137
137
  latestActivePointers: []
138
138
  }
139
139
  ),
140
- h((t) => {
140
+ h((n) => {
141
141
  const {
142
142
  deltaX: s,
143
143
  deltaY: o,
@@ -146,7 +146,7 @@ const J = (e, n, t, s) => {
146
146
  center: l,
147
147
  event: a,
148
148
  deltaPointersAngle: $
149
- } = t, c = r ?? [], g = Date.now() - p, { velocityX: d, velocityY: f } = xe(g, s, o), D = De(r);
149
+ } = n, c = r ?? [], g = Date.now() - p, { velocityX: d, velocityY: f } = xe(g, s, o), y = ye(r);
150
150
  return {
151
151
  deltaX: s,
152
152
  deltaY: o,
@@ -158,54 +158,54 @@ const J = (e, n, t, s) => {
158
158
  startTime: p,
159
159
  event: a,
160
160
  deltaPointersAngle: $,
161
- pointersAverageDistance: D
161
+ pointersAverageDistance: y
162
162
  };
163
163
  })
164
164
  );
165
165
  };
166
- function U(e) {
167
- return (n) => n.pipe(
168
- v((t) => t.pointerId === e.pointerId)
166
+ function U(t) {
167
+ return (e) => e.pipe(
168
+ v((n) => n.pointerId === t.pointerId)
169
169
  );
170
170
  }
171
171
  const N = ({
172
- container: e,
173
- afterEventReceived: n = (t) => t
172
+ container: t,
173
+ afterEventReceived: e = (n) => n
174
174
  }) => {
175
- const t = ee({ afterEventReceived: n, container: e }), s = b(e, "pointerup").pipe(
176
- h(n)
177
- ), o = b(e, "pointermove").pipe(
178
- h(n)
179
- ), r = b(e, "pointerleave").pipe(
180
- h(n)
181
- ), p = b(
182
- e,
175
+ const n = ee({ afterEventReceived: e, container: t }), s = I(t, "pointerup").pipe(
176
+ h(e)
177
+ ), o = I(t, "pointermove").pipe(
178
+ h(e)
179
+ ), r = I(t, "pointerleave").pipe(
180
+ h(e)
181
+ ), p = I(
182
+ t,
183
183
  "pointercancel"
184
- ).pipe(h(n));
184
+ ).pipe(h(e));
185
185
  return {
186
- pointerDown$: t,
186
+ pointerDown$: n,
187
187
  pointerCancel$: p,
188
188
  pointerLeave$: r,
189
189
  pointerUp$: s,
190
190
  pointerMove$: o
191
191
  };
192
192
  }, ee = ({
193
- container: e,
194
- afterEventReceived: n = (t) => t
195
- }) => b(e, "pointerdown").pipe(
196
- h(n)
193
+ container: t,
194
+ afterEventReceived: e = (n) => n
195
+ }) => I(t, "pointerdown").pipe(
196
+ h(e)
197
197
  ), V = ({
198
- pointerCancel$: e,
199
- pointerLeave$: n,
200
- pointerUp$: t,
198
+ pointerCancel$: t,
199
+ pointerLeave$: e,
200
+ pointerUp$: n,
201
201
  pointerMove$: s,
202
202
  trackMove: o
203
203
  }) => (r) => r.pipe(
204
204
  T((p) => {
205
205
  const l = A(
206
- t,
207
206
  n,
208
- e
207
+ e,
208
+ t
209
209
  ).pipe(U(p)), a = ge(() => q(p));
210
210
  return A(
211
211
  a,
@@ -217,7 +217,7 @@ const N = ({
217
217
  he({ id: p.pointerId, event: void 0 })
218
218
  );
219
219
  }),
220
- E(
220
+ F(
221
221
  (p, { event: l, id: a }) => {
222
222
  if (!l) {
223
223
  const { [a]: $, ...c } = p;
@@ -232,14 +232,14 @@ const N = ({
232
232
  ),
233
233
  h((p) => Object.values(p).filter(we))
234
234
  );
235
- class B extends F {
236
- constructor(t = {}) {
237
- super(t);
238
- w(this, "events$");
239
- w(this, "start$");
240
- w(this, "end$");
241
- w(this, "fingers$");
242
- this.options = t, this.events$ = this.validConfig$.pipe(
235
+ class B extends C {
236
+ constructor(n = {}) {
237
+ super(n);
238
+ m(this, "events$");
239
+ m(this, "start$");
240
+ m(this, "end$");
241
+ m(this, "fingers$");
242
+ this.options = n, this.events$ = this.validConfig$.pipe(
243
243
  R((s) => {
244
244
  const { container: o, afterEventReceived: r } = s, { posThreshold: p = 15 } = s.options ?? {}, {
245
245
  pointerCancel$: l,
@@ -262,7 +262,7 @@ class B extends F {
262
262
  $,
263
263
  c,
264
264
  i
265
- ), D = d.pipe(
265
+ ), y = d.pipe(
266
266
  V({
267
267
  pointerCancel$: l,
268
268
  pointerLeave$: $,
@@ -271,41 +271,41 @@ class B extends F {
271
271
  trackMove: !0
272
272
  }),
273
273
  Q()
274
- ), m = A(
274
+ ), w = A(
275
275
  i,
276
276
  $,
277
277
  l
278
278
  ).pipe(
279
- Y(D),
280
- v(([u, y]) => !y.length),
279
+ Y(y),
280
+ v(([u, D]) => !D.length),
281
281
  h(([u]) => u),
282
- O(),
283
- M()
284
- ), I = d.pipe(
282
+ z(),
283
+ P()
284
+ ), O = d.pipe(
285
285
  T(
286
286
  (u) => c.pipe(
287
287
  U(u),
288
288
  // we start pan only if the user started moving a certain distance
289
289
  v(
290
- (y) => Z(
290
+ (D) => Z(
291
291
  u,
292
- y,
292
+ D,
293
293
  p
294
294
  )
295
295
  )
296
296
  )
297
297
  ),
298
- O()
298
+ z()
299
299
  ).pipe(
300
300
  h(() => ({
301
301
  type: "panStart",
302
302
  event: g
303
303
  })),
304
- M(),
305
- x(m)
306
- ), k = I.pipe(
304
+ P(),
305
+ x(w)
306
+ ), k = O.pipe(
307
307
  T(
308
- () => m.pipe(
308
+ () => w.pipe(
309
309
  h((u) => ({
310
310
  type: "panEnd",
311
311
  event: u
@@ -313,33 +313,33 @@ class B extends F {
313
313
  )
314
314
  )
315
315
  ), L = f.pipe(
316
- $e(I),
316
+ $e(O),
317
317
  h((u) => ({
318
318
  type: "panMove",
319
319
  event: u
320
320
  })),
321
- x(m)
322
- ), X = A(I, L, k).pipe(
323
- Y(D),
324
- h(([u, y]) => ({
321
+ x(w)
322
+ ), X = A(O, L, k).pipe(
323
+ Y(y),
324
+ h(([u, D]) => ({
325
325
  ...u,
326
- latestActivePointers: y
326
+ latestActivePointers: D
327
327
  })),
328
- M()
328
+ P()
329
329
  );
330
330
  return S([
331
331
  X.pipe(W),
332
332
  X
333
333
  ]).pipe(
334
- h(([u, { type: y }]) => ({
334
+ h(([u, { type: D }]) => ({
335
335
  ...u,
336
- type: y
336
+ type: D
337
337
  }))
338
338
  );
339
339
  })
340
340
  );
341
341
  }),
342
- M()
342
+ P()
343
343
  ), this.start$ = this.events$.pipe(
344
344
  v((s) => s.type === "panStart")
345
345
  ), this.end$ = this.events$.pipe(v((s) => s.type === "panEnd")), this.fingers$ = this.validConfig$.pipe(
@@ -359,14 +359,14 @@ class B extends F {
359
359
  );
360
360
  }
361
361
  }
362
- const Re = (e) => (n) => n.pipe(
363
- v((t) => Math.abs(t.velocityX) >= e || Math.abs(t.velocityY) >= e)
362
+ const Re = (t) => (e) => e.pipe(
363
+ v((n) => Math.abs(n.velocityX) >= t || Math.abs(n.velocityY) >= t)
364
364
  );
365
- class be extends F {
366
- constructor(t = {}) {
367
- super(t);
368
- w(this, "events$");
369
- this.options = t, this.events$ = this.validConfig$.pipe(
365
+ class Ie extends C {
366
+ constructor(n = {}) {
367
+ super(n);
368
+ m(this, "events$");
369
+ this.options = n, this.events$ = this.validConfig$.pipe(
370
370
  R((s) => {
371
371
  const { escapeVelocity: o = 0.9, posThreshold: r } = s.options ?? {}, p = new B({ posThreshold: r });
372
372
  p.initialize(s);
@@ -375,11 +375,11 @@ class be extends F {
375
375
  );
376
376
  return p.start$.pipe(
377
377
  j((a) => p.end$.pipe(
378
- O(),
378
+ z(),
379
379
  Re(o),
380
380
  h(({ type: $, ...c }) => ({
381
381
  type: "swipe",
382
- angle: ye(
382
+ angle: De(
383
383
  a.event,
384
384
  c.event
385
385
  ),
@@ -387,17 +387,17 @@ class be extends F {
387
387
  })),
388
388
  x(l)
389
389
  )),
390
- M()
390
+ P()
391
391
  );
392
392
  })
393
393
  );
394
394
  }
395
395
  }
396
- class Ce extends F {
397
- constructor(t) {
398
- super(t);
399
- w(this, "events$");
400
- this.options = t, this.events$ = this.validConfig$.pipe(
396
+ class be extends C {
397
+ constructor(n) {
398
+ super(n);
399
+ m(this, "events$");
400
+ this.options = n, this.events$ = this.validConfig$.pipe(
401
401
  R((s) => {
402
402
  const { container: o, afterEventReceived: r } = s, {
403
403
  multiTapThreshold: p = 200,
@@ -411,7 +411,7 @@ class Ce extends F {
411
411
  } = s.options ?? {}, { pointerUp$: i, pointerLeave$: g, pointerCancel$: d, pointerMove$: f } = N({
412
412
  container: o,
413
413
  afterEventReceived: r
414
- }), D = ee({ container: o, afterEventReceived: r }), m = D.pipe(
414
+ }), y = ee({ container: o, afterEventReceived: r }), w = y.pipe(
415
415
  V({
416
416
  pointerCancel$: d,
417
417
  pointerLeave$: g,
@@ -420,37 +420,37 @@ class Ce extends F {
420
420
  trackMove: !1
421
421
  }),
422
422
  Q(1)
423
- ), G = m.pipe(
423
+ ), G = w.pipe(
424
424
  v((u) => u.length > 1)
425
- ), I = (u) => u.pipe(
426
- Y(m),
427
- v(([, y]) => y.length === 1),
428
- h(([y]) => y)
425
+ ), O = (u) => u.pipe(
426
+ Y(w),
427
+ v(([, D]) => D.length === 1),
428
+ h(([D]) => D)
429
429
  ), k = (u) => u.pipe(
430
430
  ve(i.pipe(fe(p))),
431
- O()
431
+ z()
432
432
  ), L = Te(c);
433
433
  return A(
434
- D,
435
- m.pipe(ue())
434
+ y,
435
+ w.pipe(ue())
436
436
  ).pipe(
437
- I,
437
+ O,
438
438
  j((u) => {
439
- const y = A(q(u), D), te = A(
439
+ const D = A(q(u), y), te = A(
440
440
  i,
441
441
  g,
442
442
  d,
443
443
  f
444
- ), ne = y.pipe(k), se = te.pipe(
444
+ ), ne = D.pipe(k), se = te.pipe(
445
445
  v(
446
- (P) => Z(
446
+ (M) => Z(
447
447
  u,
448
- P,
448
+ M,
449
449
  $
450
450
  )
451
451
  ),
452
- O()
453
- ), oe = m.pipe(
452
+ z()
453
+ ), oe = w.pipe(
454
454
  R(() => de(l))
455
455
  ), ie = A(
456
456
  L,
@@ -459,21 +459,21 @@ class Ce extends F {
459
459
  se,
460
460
  oe
461
461
  ), H = ne.pipe(
462
- Me,
463
- v((P) => P.length <= a),
464
- h((P) => ({
462
+ Pe,
463
+ v((M) => M.length <= a),
464
+ h((M) => ({
465
465
  type: "tap",
466
- taps: P.length,
467
- latestActivePointers: P,
468
- event: P[0]
466
+ taps: M.length,
467
+ latestActivePointers: M,
468
+ event: M[0]
469
469
  }))
470
470
  );
471
471
  return S([
472
472
  H.pipe(W),
473
473
  H
474
474
  ]).pipe(
475
- h(([P, { type: re, taps: pe }]) => ({
476
- ...P,
475
+ h(([M, { type: re, taps: pe }]) => ({
476
+ ...M,
477
477
  type: re,
478
478
  taps: pe
479
479
  })),
@@ -482,24 +482,24 @@ class Ce extends F {
482
482
  })
483
483
  );
484
484
  }),
485
- M()
485
+ P()
486
486
  );
487
487
  }
488
488
  }
489
- class Fe extends F {
490
- constructor(t = {}) {
491
- super(t);
492
- w(this, "events$");
493
- this.options = t, this.events$ = this.config$.pipe(
489
+ class Ce extends C {
490
+ constructor(n = {}) {
491
+ super(n);
492
+ m(this, "events$");
493
+ this.options = n, this.events$ = this.config$.pipe(
494
494
  R((s) => {
495
495
  const { posThreshold: o } = s.options ?? {}, r = new B({ posThreshold: o });
496
496
  r.initialize(s);
497
497
  const p = r.events$.pipe(
498
498
  v(({ pointers: i }) => i.length < 2),
499
- z()
499
+ E()
500
500
  ), a = r.events$.pipe(
501
501
  h((i) => [i, i.pointers.length > 1]),
502
- z(
502
+ E(
503
503
  ([i, g], [d, f]) => g === f
504
504
  ),
505
505
  v(([i, g]) => g)
@@ -513,7 +513,7 @@ class Fe extends F {
513
513
  ), $ = a.pipe(
514
514
  T(
515
515
  () => r.events$.pipe(
516
- E(
516
+ F(
517
517
  (i, g) => {
518
518
  const d = i.angle + g.deltaPointersAngle;
519
519
  return {
@@ -532,7 +532,7 @@ class Fe extends F {
532
532
  ), c = a.pipe(
533
533
  T(
534
534
  () => S([$, p]).pipe(
535
- O(),
535
+ z(),
536
536
  h(([i]) => ({
537
537
  ...i,
538
538
  type: "rotateEnd"
@@ -545,20 +545,20 @@ class Fe extends F {
545
545
  );
546
546
  }
547
547
  }
548
- class ze extends F {
549
- constructor(t = {}) {
550
- super(t);
551
- w(this, "events$");
552
- this.options = t, this.events$ = this.config$.pipe(
548
+ class Ee extends C {
549
+ constructor(n = {}) {
550
+ super(n);
551
+ m(this, "events$");
552
+ this.options = n, this.events$ = this.config$.pipe(
553
553
  R((s) => {
554
554
  const { posThreshold: o } = s.options ?? {}, r = new B({ posThreshold: o });
555
555
  r.initialize(s);
556
556
  const p = r.events$.pipe(
557
557
  v(({ pointers: i }) => i.length < 2),
558
- z()
558
+ E()
559
559
  ), a = r.events$.pipe(
560
560
  h((i) => [i, i.pointers.length > 1]),
561
- z(
561
+ E(
562
562
  ([i, g], [d, f]) => g === f
563
563
  ),
564
564
  v(([i, g]) => g)
@@ -573,13 +573,13 @@ class ze extends F {
573
573
  }))
574
574
  ), $ = a.pipe(
575
575
  T((i) => r.events$.pipe(
576
- E(
576
+ F(
577
577
  (g, d) => {
578
- const f = g.pointersAverageDistance ?? d.pointersAverageDistance, D = d.pointersAverageDistance / i.pointersAverageDistance;
578
+ const f = g.pointersAverageDistance ?? d.pointersAverageDistance, y = d.pointersAverageDistance / i.pointersAverageDistance;
579
579
  return {
580
580
  ...g,
581
581
  ...d,
582
- scale: D,
582
+ scale: y,
583
583
  distance: d.pointersAverageDistance - i.pointersAverageDistance,
584
584
  deltaDistance: d.pointersAverageDistance - f,
585
585
  deltaDistanceScale: d.pointersAverageDistance / f,
@@ -593,7 +593,7 @@ class ze extends F {
593
593
  ), c = a.pipe(
594
594
  T(
595
595
  () => S([$, p]).pipe(
596
- O(),
596
+ z(),
597
597
  h(([i]) => ({
598
598
  ...i,
599
599
  type: "pinchEnd"
@@ -606,22 +606,40 @@ class ze extends F {
606
606
  );
607
607
  }
608
608
  }
609
- const Ee = ({
610
- afterEventReceived: e = (t) => t,
611
- recognizers: n
609
+ class Fe {
610
+ constructor(e) {
611
+ m(this, "events$");
612
+ m(this, "recognizers");
613
+ this.options = e, this.recognizers = e.recognizers, this.events$ = A(
614
+ ...e.recognizers.map((n) => n.events$)
615
+ ).pipe(P());
616
+ }
617
+ initialize(e) {
618
+ e.style.touchAction = "none", e.style.userSelect = "none", this.options.recognizers.forEach((n) => {
619
+ n.initialize({
620
+ container: e,
621
+ afterEventReceived: this.options.afterEventReceived
622
+ });
623
+ });
624
+ }
625
+ }
626
+ const Se = ({
627
+ afterEventReceived: t = (n) => n,
628
+ recognizers: e
612
629
  }) => ({ events$: A(
613
- ...n.map((o) => o.events$)
614
- ).pipe(M()), initialize: (o) => {
615
- o.style.touchAction = "none", o.style.userSelect = "none", n.forEach((r) => {
616
- r.initialize({ container: o, afterEventReceived: e });
630
+ ...e.map((o) => o.events$)
631
+ ).pipe(P()), initialize: (o) => {
632
+ o.style.touchAction = "none", o.style.userSelect = "none", e.forEach((r) => {
633
+ r.initialize({ container: o, afterEventReceived: t });
617
634
  });
618
- }, recognizers: n });
635
+ }, recognizers: e });
619
636
  export {
637
+ Fe as Manager,
620
638
  B as PanRecognizer,
621
- ze as PinchRecognizer,
622
- Fe as RotateRecognizer,
623
- be as SwipeRecognizer,
624
- Ce as TapRecognizer,
625
- Ee as createManager
639
+ Ee as PinchRecognizer,
640
+ Ce as RotateRecognizer,
641
+ Ie as SwipeRecognizer,
642
+ be as TapRecognizer,
643
+ Se as createManager
626
644
  };
627
645
  //# sourceMappingURL=index.js.map