gesturx 1.8.1 → 1.8.3

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,28 +1,28 @@
1
- var se = Object.defineProperty;
2
- var pe = (t, n, e) => n in t ? se(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
3
- var $ = (t, n, e) => pe(t, typeof n != "symbol" ? n + "" : n, e);
4
- import { filter as h, fromEvent as I, mergeMap as S, defer as oe, of as T, merge as y, takeWhile as V, scan as U, map as c, BehaviorSubject as q, switchMap as g, distinctUntilChanged as re, startWith as H, shareReplay as M, combineLatest as W, exhaustMap as J, first as F, share as P, timer as K, withLatestFrom as L, takeUntil as b, skip as ae, tap as Q, ignoreElements as le, buffer as he, debounceTime as ce, pairwise as $e } from "rxjs";
5
- function ue(t, n) {
1
+ var ie = Object.defineProperty;
2
+ var se = (t, n, e) => n in t ? ie(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
3
+ var u = (t, n, e) => se(t, typeof n != "symbol" ? n + "" : n, e);
4
+ import { filter as c, fromEvent as S, mergeMap as b, defer as pe, of as I, merge as g, takeWhile as V, scan as U, map as h, BehaviorSubject as q, switchMap as v, distinctUntilChanged as oe, startWith as re, shareReplay as E, combineLatest as j, exhaustMap as H, first as R, share as w, timer as J, withLatestFrom as z, takeUntil as T, skip as ae, tap as K, ignoreElements as le, buffer as he, debounceTime as ce, NEVER as ue, defaultIfEmpty as $e } from "rxjs";
5
+ function de(t, n) {
6
6
  return Math.sqrt(
7
7
  Math.pow(n.x - t.x, 2) + Math.pow(n.y - t.y, 2)
8
8
  );
9
9
  }
10
- function de(t) {
10
+ function ve(t) {
11
11
  const n = t.length;
12
12
  if (n < 2) return 0;
13
- const e = t.reduce((s, p, a) => s + t.slice(a + 1).reduce((o, r) => o + ue(p, r), 0), 0), i = n * (n - 1) / 2;
13
+ const e = t.reduce((o, p, a) => o + t.slice(a + 1).reduce((s, r) => s + de(p, r), 0), 0), i = n * (n - 1) / 2;
14
14
  return e / i;
15
15
  }
16
16
  function N(t, n) {
17
17
  const e = n.x - t.x, i = n.y - t.y;
18
18
  return Math.atan2(i, e);
19
19
  }
20
- function ve(t, n) {
20
+ function ge(t, n) {
21
21
  return N(t, n) * (180 / Math.PI);
22
22
  }
23
- function R(t) {
23
+ function k(t) {
24
24
  const n = t.reduce(
25
- (i, s) => (i.x += s.x, i.y += s.y, i),
25
+ (i, o) => (i.x += o.x, i.y += o.y, i),
26
26
  { x: 0, y: 0 }
27
27
  ), e = t.length || 1;
28
28
  return {
@@ -30,87 +30,87 @@ function R(t) {
30
30
  y: n.y / e
31
31
  };
32
32
  }
33
- function ge(t, n) {
33
+ function ye(t, n) {
34
34
  if (t.length !== n.length)
35
35
  throw new Error("Initial and new points arrays must have the same length.");
36
- const e = R(t), i = R(n);
37
- let s = 0;
38
- for (let o = 0; o < t.length; o++) {
36
+ const e = k(t), i = k(n);
37
+ let o = 0;
38
+ for (let s = 0; s < t.length; s++) {
39
39
  const r = N(
40
40
  e,
41
- t[o]
41
+ t[s]
42
42
  );
43
- let u = N(
43
+ let $ = N(
44
44
  i,
45
- n[o]
45
+ n[s]
46
46
  ) - r;
47
- u > Math.PI ? u -= 2 * Math.PI : u < -Math.PI && (u += 2 * Math.PI), s += u;
47
+ $ > Math.PI ? $ -= 2 * Math.PI : $ < -Math.PI && ($ += 2 * Math.PI), o += $;
48
48
  }
49
- const p = s / t.length, a = p * (180 / Math.PI);
49
+ const p = o / t.length, a = p * (180 / Math.PI);
50
50
  return { radianDelta: p, degreesDelta: a };
51
51
  }
52
- function ye(t) {
52
+ function fe(t) {
53
53
  return t != null;
54
54
  }
55
- const me = (t) => t.length > 0, fe = (t) => t.pipe(h(me));
56
- function Z(t, n, e) {
57
- const i = R([t]), s = R([n]);
58
- return Math.abs(s.x - i.x) >= e || Math.abs(s.y - i.y) >= e;
55
+ const me = (t) => t.length > 0, Ae = (t) => t.pipe(c(me));
56
+ function Q(t, n, e) {
57
+ const i = k([t]), o = k([n]);
58
+ return Math.abs(o.x - i.x) >= e || Math.abs(o.y - i.y) >= e;
59
59
  }
60
- const Ae = (t, n, e) => {
61
- const i = t > 0 ? n / t : 0, s = t > 0 ? e / t : 0;
60
+ const De = (t, n, e) => {
61
+ const i = t > 0 ? n / t : 0, o = t > 0 ? e / t : 0;
62
62
  return {
63
63
  velocityX: i,
64
- velocityY: s
64
+ velocityY: o
65
65
  };
66
66
  };
67
- function X(t) {
67
+ function W(t) {
68
68
  return (n) => n.pipe(
69
- h((e) => e.pointerId === t.pointerId)
69
+ c((e) => e.pointerId === t.pointerId)
70
70
  );
71
71
  }
72
- const ee = (t) => t.type === "pointerleave" || t.type === "pointercancel" || t.type === "pointerup", De = ({
72
+ const Z = (t) => t.type === "pointerleave" || t.type === "pointercancel" || t.type === "pointerup", Pe = ({
73
73
  container: t,
74
74
  afterEventReceived: n = (e) => e
75
- }) => I(t, "pointerdown").pipe(
76
- c(n)
77
- ), te = ({
75
+ }) => S(t, "pointerdown").pipe(
76
+ h(n)
77
+ ), ee = ({
78
78
  pointerEvent$: t
79
79
  }) => (n) => {
80
80
  const e = t.pipe(
81
- h((r) => r.type === "pointerup")
81
+ c((r) => r.type === "pointerup")
82
82
  ), i = t.pipe(
83
- h((r) => r.type === "pointerleave")
84
- ), s = t.pipe(
85
- h((r) => r.type === "pointercancel")
83
+ c((r) => r.type === "pointerleave")
84
+ ), o = t.pipe(
85
+ c((r) => r.type === "pointercancel")
86
86
  ), p = t.pipe(
87
- h((r) => r.type === "pointermove")
88
- ), a = I(window, "contextmenu"), o = (r) => ["pointercancel", "pointerleave", "pointerup", "contextmenu"].includes(
87
+ c((r) => r.type === "pointermove")
88
+ ), a = S(window, "contextmenu"), s = (r) => ["pointercancel", "pointerleave", "pointerup", "contextmenu"].includes(
89
89
  r.type
90
90
  );
91
91
  return n.pipe(
92
- S((r) => {
93
- const l = oe(() => T(r));
94
- return y(
92
+ b((r) => {
93
+ const l = pe(() => I(r));
94
+ return g(
95
95
  l,
96
- y(
96
+ g(
97
97
  p,
98
- s,
98
+ o,
99
99
  i,
100
100
  e,
101
101
  a
102
102
  )
103
103
  ).pipe(
104
- X(r),
105
- V((f) => !o(f), !0)
104
+ W(r),
105
+ V((m) => !s(m), !0)
106
106
  );
107
107
  }),
108
108
  U((r, l) => {
109
- if (o(l)) {
110
- const { [l.pointerId]: u, ...f } = (r == null ? void 0 : r.pointers) ?? {};
109
+ if (s(l)) {
110
+ const { [l.pointerId]: $, ...m } = (r == null ? void 0 : r.pointers) ?? {};
111
111
  return {
112
112
  event: l,
113
- pointers: f
113
+ pointers: m
114
114
  };
115
115
  }
116
116
  return {
@@ -121,27 +121,27 @@ const ee = (t) => t.type === "pointerleave" || t.type === "pointercancel" || t.t
121
121
  }
122
122
  };
123
123
  }, void 0),
124
- c(({ event: r, pointers: l }) => ({
124
+ h(({ event: r, pointers: l }) => ({
125
125
  event: r,
126
- pointers: Object.values(l).filter(ye)
126
+ pointers: Object.values(l).filter(fe)
127
127
  }))
128
128
  );
129
129
  }, _ = (t, n, e, i) => {
130
- const s = t.x - n.x + e, p = t.y - n.y + i;
130
+ const o = t.x - n.x + e, p = t.y - n.y + i;
131
131
  return {
132
- deltaX: s,
132
+ deltaX: o,
133
133
  deltaY: p
134
134
  };
135
- }, ne = (t) => {
136
- const n = (e) => R(
135
+ }, te = (t) => {
136
+ const n = (e) => k(
137
137
  e.latestActivePointers.length ? e.latestActivePointers : [e.event]
138
138
  );
139
139
  return t.pipe(
140
140
  U((e, i) => {
141
- var m, D;
142
- const s = n(i), p = (e == null ? void 0 : e.center) ?? s, a = (e == null ? void 0 : e.deltaX) ?? 0, o = (e == null ? void 0 : e.deltaY) ?? 0, r = ((m = e == null ? void 0 : e.latestActivePointers) == null ? void 0 : m.length) ?? 1, l = ((D = i.latestActivePointers) == null ? void 0 : D.length) ?? 1, u = ["pointerdown", "pointercancel", "pointerleave", "pointerup"].includes(
141
+ var f, P;
142
+ const o = n(i), p = (e == null ? void 0 : e.center) ?? o, a = (e == null ? void 0 : e.deltaX) ?? 0, s = (e == null ? void 0 : e.deltaY) ?? 0, r = ((f = e == null ? void 0 : e.latestActivePointers) == null ? void 0 : f.length) ?? 1, l = ((P = i.latestActivePointers) == null ? void 0 : P.length) ?? 1, $ = ["pointerdown", "pointercancel", "pointerleave", "pointerup"].includes(
143
143
  i.event.type
144
- ) && r !== l, f = l > 0, { deltaX: d, deltaY: E } = u && f ? _(s, s, a, o) : _(s, p, a, o), { degreesDelta: A } = r === l && r >= 2 && l >= 2 ? ge(
144
+ ) && r !== l, m = l > 0, { deltaX: y, deltaY: A } = $ && m ? _(o, o, a, s) : _(o, p, a, s), { degreesDelta: D } = r === l && r >= 2 && l >= 2 ? ye(
145
145
  (e == null ? void 0 : e.latestActivePointers) ?? [],
146
146
  i.latestActivePointers ?? []
147
147
  ) : { degreesDelta: 0 };
@@ -149,221 +149,221 @@ const ee = (t) => t.type === "pointerleave" || t.type === "pointercancel" || t.t
149
149
  startTime: (/* @__PURE__ */ new Date()).getTime(),
150
150
  ...e,
151
151
  ...i,
152
- center: s,
153
- deltaX: d,
154
- deltaY: E,
155
- deltaPointersAngle: A
152
+ center: o,
153
+ deltaX: y,
154
+ deltaY: A,
155
+ deltaPointersAngle: D
156
156
  };
157
157
  }, void 0),
158
- c((e) => {
158
+ h((e) => {
159
159
  const {
160
160
  deltaX: i,
161
- deltaY: s,
161
+ deltaY: o,
162
162
  latestActivePointers: p,
163
163
  startTime: a,
164
- center: o,
164
+ center: s,
165
165
  event: r,
166
166
  deltaPointersAngle: l
167
- } = e, u = p ?? [], d = Date.now() - a, { velocityX: E, velocityY: A } = Ae(d, i, s), m = de(p);
167
+ } = e, $ = p ?? [], y = Date.now() - a, { velocityX: A, velocityY: D } = De(y, i, o), f = ve(p);
168
168
  return {
169
169
  deltaX: i,
170
- deltaY: s,
171
- velocityX: E,
172
- velocityY: A,
173
- delay: d,
174
- center: o,
175
- pointers: u,
170
+ deltaY: o,
171
+ velocityX: A,
172
+ velocityY: D,
173
+ delay: y,
174
+ center: s,
175
+ pointers: $,
176
176
  startTime: a,
177
177
  event: r,
178
178
  deltaPointersAngle: l,
179
- pointersAverageDistance: m
179
+ pointersAverageDistance: f
180
180
  };
181
181
  })
182
182
  );
183
183
  }, G = (t) => t.pipe(
184
- h(
184
+ c(
185
185
  (n) => !!n.container
186
186
  )
187
- ), ie = (t) => t.pipe(h(ee)), Pe = ({
187
+ ), ne = (t) => t.pipe(c(Z)), we = ({
188
188
  container: t,
189
189
  afterEventReceived: n = (e) => e
190
190
  }) => {
191
- const e = De({ afterEventReceived: n, container: t }), i = I(t, "pointerup").pipe(
192
- c(n)
193
- ), s = I(t, "pointermove").pipe(
194
- c(n)
195
- ), p = I(t, "pointerleave").pipe(
196
- c(n)
197
- ), a = I(
191
+ const e = Pe({ afterEventReceived: n, container: t }), i = S(t, "pointerup").pipe(
192
+ h(n)
193
+ ), o = S(t, "pointermove").pipe(
194
+ h(n)
195
+ ), p = S(t, "pointerleave").pipe(
196
+ h(n)
197
+ ), a = S(
198
198
  t,
199
199
  "pointercancel"
200
- ).pipe(c(n));
201
- return y(
200
+ ).pipe(h(n));
201
+ return g(
202
202
  e,
203
203
  a,
204
204
  p,
205
205
  i,
206
- s
206
+ o
207
207
  );
208
208
  };
209
- class z {
209
+ class F {
210
210
  constructor(n, e) {
211
- $(this, "configSubject", new q({}));
212
- $(this, "pan$");
213
- $(this, "panStart$");
214
- $(this, "panMove$");
215
- $(this, "panEnd$");
216
- $(this, "pointerEvent$");
217
- $(this, "pointerDown$");
218
- $(this, "pointerUp$");
219
- $(this, "pointerCancel$");
220
- $(this, "pointerMove$");
221
- $(this, "pointerOff$");
222
- $(this, "state$");
223
- $(this, "config$", this.configSubject.pipe(G));
211
+ u(this, "configSubject", new q({}));
212
+ u(this, "pan$");
213
+ u(this, "panStart$");
214
+ u(this, "panMove$");
215
+ u(this, "panEnd$");
216
+ u(this, "pointerEvent$");
217
+ u(this, "pointerDown$");
218
+ u(this, "pointerUp$");
219
+ u(this, "pointerCancel$");
220
+ u(this, "pointerMove$");
221
+ u(this, "pointerOff$");
222
+ u(this, "state$");
223
+ u(this, "config$", this.configSubject.pipe(G));
224
224
  /**
225
225
  * Track active running failWith recognizers
226
226
  */
227
- $(this, "failWithActive$");
227
+ u(this, "failWithActive$");
228
228
  const i = new q({
229
229
  fingers: 0
230
230
  });
231
231
  this.pointerEvent$ = this.config$.pipe(
232
- g(
233
- ({ container: p, afterEventReceived: a }) => Pe({
232
+ v(
233
+ ({ container: p, afterEventReceived: a }) => we({
234
234
  container: p,
235
235
  afterEventReceived: a
236
236
  })
237
237
  )
238
238
  ), this.pointerDown$ = this.pointerEvent$.pipe(
239
- h((p) => p.type === "pointerdown")
239
+ c((p) => p.type === "pointerdown")
240
240
  ), this.pointerUp$ = this.pointerEvent$.pipe(
241
- h((p) => p.type === "pointerup")
241
+ c((p) => p.type === "pointerup")
242
242
  ), this.pointerMove$ = this.pointerEvent$.pipe(
243
- h((p) => p.type === "pointermove")
243
+ c((p) => p.type === "pointermove")
244
244
  ), this.pointerCancel$ = this.pointerEvent$.pipe(
245
- h((p) => p.type === "pointercancel")
246
- ), this.pointerOff$ = this.pointerEvent$.pipe(ie);
247
- const s = this.config$.pipe(
248
- c(({ failWith: p }) => p),
249
- re()
245
+ c((p) => p.type === "pointercancel")
246
+ ), this.pointerOff$ = this.pointerEvent$.pipe(ne);
247
+ const o = this.config$.pipe(
248
+ h(({ failWith: p }) => p),
249
+ oe()
250
250
  );
251
- this.failWithActive$ = s.pipe(
252
- g((p) => {
253
- const a = p == null ? void 0 : p.map((o) => {
254
- const r = o.start$.pipe(c(() => !0)), l = o.end$.pipe(c(() => !1));
255
- return y(r, l).pipe(
256
- H(!1),
257
- M(1)
251
+ this.failWithActive$ = o.pipe(
252
+ v((p) => {
253
+ const a = p == null ? void 0 : p.map((s) => {
254
+ const r = s.start$.pipe(h(() => !0)), l = s.end$.pipe(h(() => !1));
255
+ return g(r, l).pipe(
256
+ re(!1),
257
+ E(1)
258
258
  );
259
259
  });
260
- return a != null && a.length ? W(a) : W([T(!1)]);
260
+ return a != null && a.length ? j(a) : j([I(!1)]);
261
261
  }),
262
- c((p) => p.some((a) => a)),
263
- M(1)
262
+ h((p) => p.some((a) => a)),
263
+ E(1)
264
264
  ), this.pan$ = this.configSubject.pipe(
265
265
  G,
266
- g((p) => {
267
- var d, E, A;
268
- const a = Math.max(1, ((d = p.panConfig) == null ? void 0 : d.numInputs) ?? 1), o = Math.max(0, ((E = p.panConfig) == null ? void 0 : E.posThreshold) ?? 0), r = Math.max(0, ((A = p.panConfig) == null ? void 0 : A.delay) ?? 0), l = this.pointerDown$.pipe(
269
- te({
266
+ v((p) => {
267
+ var y, A, D;
268
+ const a = Math.max(1, ((y = p.panConfig) == null ? void 0 : y.numInputs) ?? 1), s = Math.max(0, ((A = p.panConfig) == null ? void 0 : A.posThreshold) ?? 0), r = Math.max(0, ((D = p.panConfig) == null ? void 0 : D.delay) ?? 0), l = this.pointerDown$.pipe(
269
+ ee({
270
270
  pointerEvent$: this.pointerEvent$,
271
271
  trackMove: !0
272
272
  }),
273
- M(1)
274
- ), u = (m) => m.pipe(
275
- h(
276
- (D) => D.pointers.length >= a
273
+ E(1)
274
+ ), $ = (f) => f.pipe(
275
+ c(
276
+ (P) => P.pointers.length >= a
277
277
  )
278
- ), f = (m) => m.pipe(h((D) => D.pointers.length < a));
278
+ ), m = (f) => f.pipe(c((P) => P.pointers.length < a));
279
279
  return l.pipe(
280
- u,
281
- J(({ pointers: m }) => {
282
- const D = l.pipe(
283
- f,
284
- F(),
285
- P()
286
- ), Y = K(r), C = y(
287
- ...m.map((v) => T(v)),
280
+ $,
281
+ H(({ pointers: f }) => {
282
+ const P = l.pipe(
283
+ m,
284
+ R(),
285
+ w()
286
+ ), X = J(r), C = g(
287
+ ...f.map((d) => I(d)),
288
288
  this.pointerDown$
289
289
  ).pipe(
290
- S(
291
- (v) => y(this.pointerMove$, T(v)).pipe(
292
- X(v),
293
- h(
294
- (x) => Z(
295
- v,
290
+ b(
291
+ (d) => g(this.pointerMove$, I(d)).pipe(
292
+ W(d),
293
+ c(
294
+ (x) => Q(
295
+ d,
296
296
  x,
297
- o
297
+ s
298
298
  )
299
299
  )
300
300
  )
301
301
  ),
302
- F()
302
+ R()
303
303
  ).pipe(
304
- g(() => Y),
305
- L(l),
306
- c(([, { event: v, pointers: x }]) => ({
304
+ v(() => X),
305
+ z(l),
306
+ h(([, { event: d, pointers: x }]) => ({
307
307
  type: "start",
308
- event: v,
308
+ event: d,
309
309
  latestActivePointers: x
310
310
  })),
311
- M({
311
+ E({
312
312
  bufferSize: 1,
313
313
  refCount: !1
314
314
  }),
315
- b(D)
316
- ), k = C.pipe(
317
- S(
315
+ T(P)
316
+ ), O = C.pipe(
317
+ b(
318
318
  () => l.pipe(
319
319
  ae(1),
320
- c(({ event: v, pointers: x }) => ({
320
+ h(({ event: d, pointers: x }) => ({
321
321
  type: "move",
322
- event: v,
322
+ event: d,
323
323
  latestActivePointers: x
324
324
  }))
325
325
  )
326
326
  ),
327
- b(D)
328
- ), w = C.pipe(
329
- S(
330
- () => D.pipe(
331
- c(({ event: v, pointers: x }) => ({
327
+ T(P)
328
+ ), M = C.pipe(
329
+ b(
330
+ () => P.pipe(
331
+ h(({ event: d, pointers: x }) => ({
332
332
  type: "end",
333
- event: v,
333
+ event: d,
334
334
  latestActivePointers: x
335
335
  }))
336
336
  )
337
337
  )
338
- ), O = y(C, k, w).pipe(
339
- M(1)
338
+ ), L = g(C, O, M).pipe(
339
+ E(1)
340
340
  );
341
- return O.pipe(
342
- ne,
343
- L(O),
344
- c(([v, { type: x }]) => ({
345
- ...v,
341
+ return L.pipe(
342
+ te,
343
+ z(L),
344
+ h(([d, { type: x }]) => ({
345
+ ...d,
346
346
  type: x
347
347
  }))
348
348
  );
349
349
  })
350
350
  );
351
351
  }),
352
- Q((p) => {
352
+ K((p) => {
353
353
  i.next({
354
354
  fingers: p.pointers.length
355
355
  });
356
356
  }),
357
- P()
357
+ w()
358
358
  ), this.panStart$ = this.pan$.pipe(
359
- h((p) => p.type === "start"),
360
- c(({ type: p, ...a }) => a)
359
+ c((p) => p.type === "start"),
360
+ h(({ type: p, ...a }) => a)
361
361
  ), this.panMove$ = this.pan$.pipe(
362
- h((p) => p.type === "move"),
363
- c(({ type: p, ...a }) => a)
362
+ c((p) => p.type === "move"),
363
+ h(({ type: p, ...a }) => a)
364
364
  ), this.panEnd$ = this.pan$.pipe(
365
- h((p) => p.type === "end"),
366
- c(({ type: p, ...a }) => a)
365
+ c((p) => p.type === "end"),
366
+ h(({ type: p, ...a }) => a)
367
367
  ), this.state$ = i.asObservable(), this.updateInternal(n ?? {}, e);
368
368
  }
369
369
  updateInternal(n, e) {
@@ -384,92 +384,92 @@ class z {
384
384
  this.updateInternal(n, e);
385
385
  }
386
386
  }
387
- class Ie extends z {
387
+ class Se extends F {
388
388
  constructor(e) {
389
389
  var a;
390
390
  super(e, {
391
391
  ...e,
392
392
  posThreshold: ((a = e == null ? void 0 : e.options) == null ? void 0 : a.posThreshold) ?? 15
393
393
  });
394
- $(this, "events$");
395
- $(this, "start$");
396
- $(this, "end$");
394
+ u(this, "events$");
395
+ u(this, "start$");
396
+ u(this, "end$");
397
397
  const i = this.panStart$.pipe(
398
- c((o) => ({
398
+ h((s) => ({
399
399
  type: "panStart",
400
- ...o
400
+ ...s
401
401
  })),
402
- L(this.failWithActive$),
403
- h(([, o]) => !o),
404
- c(([o]) => o),
405
- P()
406
- ), s = this.panEnd$.pipe(
407
- c((o) => ({
402
+ z(this.failWithActive$),
403
+ c(([, s]) => !s),
404
+ h(([s]) => s),
405
+ w()
406
+ ), o = this.panEnd$.pipe(
407
+ h((s) => ({
408
408
  type: "panEnd",
409
- ...o
409
+ ...s
410
410
  })),
411
- P()
411
+ w()
412
412
  ), p = this.panMove$.pipe(
413
- c((o) => ({
413
+ h((s) => ({
414
414
  type: "panMove",
415
- ...o
415
+ ...s
416
416
  }))
417
417
  );
418
418
  this.events$ = i.pipe(
419
- g((o) => {
420
- let r = o;
421
- const l = this.failWithActive$.pipe(
422
- h((d) => d),
423
- F()
424
- ), u = y(T(o), p, s).pipe(
425
- Q((d) => {
426
- r = d;
419
+ v((s) => {
420
+ let r = s;
421
+ const l = I(s), $ = this.failWithActive$.pipe(
422
+ c((A) => A),
423
+ R()
424
+ ), m = g(l, p, o).pipe(
425
+ K((A) => {
426
+ r = A;
427
427
  }),
428
- b(l)
429
- ), f = l.pipe(
430
- c(() => ({
428
+ T($)
429
+ ), y = $.pipe(
430
+ h(() => ({
431
431
  ...r,
432
432
  type: "panEnd"
433
433
  })),
434
- b(s)
434
+ T(o)
435
435
  );
436
- return y(u, f);
436
+ return g(m, y);
437
437
  }),
438
- P()
438
+ w()
439
439
  ), this.start$ = this.events$.pipe(
440
- h((o) => o.type === "panStart")
441
- ), this.end$ = this.events$.pipe(h((o) => o.type === "panEnd"));
440
+ c((s) => s.type === "panStart")
441
+ ), this.end$ = this.events$.pipe(c((s) => s.type === "panEnd"));
442
442
  }
443
443
  update(e) {
444
444
  super.update(e, e.options);
445
445
  }
446
446
  }
447
- const we = (t) => (n) => n.pipe(
448
- h((e) => Math.abs(e.velocityX) >= t || Math.abs(e.velocityY) >= t)
447
+ const Me = (t) => (n) => n.pipe(
448
+ c((e) => Math.abs(e.velocityX) >= t || Math.abs(e.velocityY) >= t)
449
449
  );
450
- class Se extends z {
450
+ class be extends F {
451
451
  constructor(e) {
452
452
  super(e, {
453
453
  posThreshold: 0,
454
454
  numInputs: 1
455
455
  });
456
- $(this, "events$");
456
+ u(this, "events$");
457
457
  this.events$ = this.config$.pipe(
458
- g((i) => {
459
- const { escapeVelocity: s = 0.9 } = i.options ?? {};
458
+ v((i) => {
459
+ const { escapeVelocity: o = 0.9 } = i.options ?? {};
460
460
  return this.panStart$.pipe(
461
- g((p) => this.panEnd$.pipe(
462
- we(s),
463
- c((a) => ({
461
+ v((p) => this.panEnd$.pipe(
462
+ Me(o),
463
+ h((a) => ({
464
464
  type: "swipe",
465
- angle: ve(
465
+ angle: ge(
466
466
  p.event,
467
467
  a.event
468
468
  ),
469
469
  ...a
470
470
  }))
471
471
  )),
472
- P()
472
+ w()
473
473
  );
474
474
  })
475
475
  );
@@ -478,132 +478,132 @@ class Se extends z {
478
478
  super.update(e);
479
479
  }
480
480
  }
481
- const Me = ({
481
+ const Ee = ({
482
482
  timeout: t,
483
483
  pointerEvent$: n
484
484
  }) => (e) => e.pipe(
485
- S(
486
- (i) => K(t).pipe(
487
- b(
488
- n.pipe(ie, X(i))
485
+ b(
486
+ (i) => J(t).pipe(
487
+ T(
488
+ n.pipe(ne, W(i))
489
489
  )
490
490
  )
491
491
  )
492
- ), Ee = ({
492
+ ), xe = ({
493
493
  initialPointerEvent: t,
494
494
  pointerEvent$: n,
495
495
  tolerance: e
496
496
  }) => (i) => i.pipe(
497
- S(
498
- (s) => n.pipe(
499
- X(s),
500
- V((p) => !ee(p), !0),
501
- h(
502
- (p) => Z(t, p, e)
497
+ b(
498
+ (o) => n.pipe(
499
+ W(o),
500
+ V((p) => !Z(p), !0),
501
+ c(
502
+ (p) => Q(t, p, e)
503
503
  )
504
504
  )
505
505
  )
506
506
  );
507
- class be extends z {
507
+ class Ce extends F {
508
508
  constructor(e) {
509
509
  super(e);
510
- $(this, "events$");
510
+ u(this, "events$");
511
511
  this.events$ = this.config$.pipe(
512
- g((i) => {
513
- var d, E;
514
- const s = ((d = i.options) == null ? void 0 : d.maxTaps) ?? 1, p = ((E = i.options) == null ? void 0 : E.multiTapThreshold) ?? 100 * (s - 1), { maximumPressTime: a = 150, tolerance: o = 10 } = i.options ?? {}, r = this.pointerDown$.pipe(
515
- te({
512
+ v((i) => {
513
+ var y, A;
514
+ const o = ((y = i.options) == null ? void 0 : y.maxTaps) ?? 1, p = ((A = i.options) == null ? void 0 : A.multiTapThreshold) ?? 100 * (o - 1), { maximumPressTime: a = 150, tolerance: s = 10 } = i.options ?? {}, r = this.pointerDown$.pipe(
515
+ ee({
516
516
  pointerEvent$: this.pointerEvent$,
517
517
  trackMove: !0
518
518
  }),
519
- M(1)
519
+ E(1)
520
520
  ), l = r.pipe(
521
- h(({ pointers: A }) => A.length > 1)
522
- ), u = (A) => A.pipe(
521
+ c(({ pointers: D }) => D.length > 1)
522
+ ), $ = (D) => D.pipe(
523
523
  he(this.pointerUp$.pipe(ce(p))),
524
- F()
524
+ R()
525
525
  );
526
- return y(
526
+ return g(
527
527
  this.pointerDown$,
528
528
  r.pipe(le())
529
529
  ).pipe(
530
- J((A) => {
531
- const m = y(
532
- T(A),
530
+ H((D) => {
531
+ const f = g(
532
+ I(D),
533
533
  this.pointerDown$
534
- ).pipe(M(1)), D = m.pipe(u), Y = m.pipe(
535
- Ee({
536
- initialPointerEvent: A,
534
+ ).pipe(E(1)), P = f.pipe($), X = f.pipe(
535
+ xe({
536
+ initialPointerEvent: D,
537
537
  pointerEvent$: this.pointerEvent$,
538
- tolerance: o
538
+ tolerance: s
539
539
  })
540
- ), B = m.pipe(
541
- Me({
540
+ ), B = f.pipe(
541
+ Ee({
542
542
  pointerEvent$: this.pointerEvent$,
543
543
  timeout: a
544
544
  })
545
- ), C = y(
546
- this.failWithActive$.pipe(h((w) => w)),
545
+ ), C = g(
546
+ this.failWithActive$.pipe(c((M) => M)),
547
547
  this.pointerCancel$,
548
548
  l,
549
- Y,
549
+ X,
550
550
  B
551
- ), k = D.pipe(
552
- fe,
553
- h((w) => w.length <= s),
554
- c((w) => ({
551
+ ), O = P.pipe(
552
+ Ae,
553
+ c((M) => M.length <= o),
554
+ h((M) => ({
555
555
  type: "tap",
556
- taps: w.length,
557
- latestActivePointers: w,
558
- event: w[0]
556
+ taps: M.length,
557
+ latestActivePointers: M,
558
+ event: M[0]
559
559
  })),
560
- M(1)
560
+ E(1)
561
561
  );
562
- return k.pipe(
563
- ne,
564
- L(k),
565
- c(([w, { type: O, taps: v }]) => ({
566
- ...w,
567
- type: O,
568
- taps: v
562
+ return O.pipe(
563
+ te,
564
+ z(O),
565
+ h(([M, { type: L, taps: d }]) => ({
566
+ ...M,
567
+ type: L,
568
+ taps: d
569
569
  })),
570
- b(C)
570
+ T(C)
571
571
  );
572
572
  })
573
573
  );
574
574
  }),
575
- P()
575
+ w()
576
576
  );
577
577
  }
578
578
  update(e) {
579
579
  super.update(e);
580
580
  }
581
581
  }
582
- class Ce extends z {
582
+ class Re extends F {
583
583
  constructor(e = {}) {
584
584
  super(e, {
585
585
  numInputs: 2,
586
586
  posThreshold: 15,
587
587
  ...e.options
588
588
  });
589
- $(this, "events$");
589
+ u(this, "events$");
590
590
  this.events$ = this.config$.pipe(
591
- g(() => {
591
+ v(() => {
592
592
  const i = this.panStart$.pipe(
593
- c((o) => ({
594
- ...o,
593
+ h((s) => ({
594
+ ...s,
595
595
  type: "rotateStart",
596
596
  angle: 0,
597
597
  deltaAngle: 0
598
598
  })),
599
- M(1)
600
- ), s = i.pipe(
601
- g(
599
+ E(1)
600
+ ), o = i.pipe(
601
+ v(
602
602
  () => this.pan$.pipe(
603
- U((o, r) => {
604
- const l = ((o == null ? void 0 : o.angle) ?? 0) + r.deltaPointersAngle;
603
+ U((s, r) => {
604
+ const l = ((s == null ? void 0 : s.angle) ?? 0) + r.deltaPointersAngle;
605
605
  return {
606
- ...o,
606
+ ...s,
607
607
  ...r,
608
608
  angle: l,
609
609
  deltaAngle: r.deltaPointersAngle
@@ -611,114 +611,121 @@ class Ce extends z {
611
611
  }, void 0)
612
612
  )
613
613
  ),
614
- P()
615
- ), p = s.pipe(
616
- h((o) => o.type === "move"),
617
- c((o) => ({ ...o, type: "rotateMove" }))
618
- ), a = s.pipe(
619
- h((o) => o.type === "end"),
620
- c((o) => ({ ...o, type: "rotateEnd" }))
614
+ w()
615
+ ), p = o.pipe(
616
+ c((s) => s.type === "move"),
617
+ h((s) => ({ ...s, type: "rotateMove" }))
618
+ ), a = o.pipe(
619
+ c((s) => s.type === "end"),
620
+ h((s) => ({ ...s, type: "rotateEnd" }))
621
621
  );
622
- return y(i, p, a);
622
+ return g(i, p, a);
623
623
  }),
624
- P()
624
+ w()
625
625
  );
626
626
  }
627
627
  update(e) {
628
628
  super.update(e, e.options);
629
629
  }
630
630
  }
631
- const j = ({
631
+ const Y = ({
632
632
  type: t,
633
633
  initialEvent: n
634
634
  }) => (e) => e.pipe(
635
- U((i, s) => {
636
- const a = ((i == null ? void 0 : i.pointers.length) ?? 0) !== s.pointers.length, o = (i == null ? void 0 : i.pointersAverageDistance) ?? s.pointersAverageDistance, r = a ? s.pointersAverageDistance : i && "initialPointersAverageDistance" in i ? i.initialPointersAverageDistance : s.pointersAverageDistance, l = r === 0 ? 1 : s.pointersAverageDistance / r, u = s.pointersAverageDistance - r, f = s.pointersAverageDistance - r, d = a || o === 0 ? 1 : s.pointersAverageDistance / o;
635
+ U((i, o) => {
636
+ const a = ((i == null ? void 0 : i.pointers.length) ?? 0) !== o.pointers.length, s = (i == null ? void 0 : i.pointersAverageDistance) ?? o.pointersAverageDistance, r = a ? o.pointersAverageDistance : i && "initialPointersAverageDistance" in i ? i.initialPointersAverageDistance : o.pointersAverageDistance, l = r === 0 ? 1 : o.pointersAverageDistance / r, $ = o.pointersAverageDistance - r, m = o.pointersAverageDistance - r, y = a || s === 0 ? 1 : o.pointersAverageDistance / s;
637
637
  return {
638
638
  ...i,
639
- ...s,
639
+ ...o,
640
640
  type: t,
641
641
  initialPointersAverageDistance: r,
642
642
  scale: l,
643
- distance: u,
644
- deltaDistance: f,
645
- deltaDistanceScale: d
643
+ distance: $,
644
+ deltaDistance: m,
645
+ deltaDistanceScale: y
646
646
  };
647
647
  }, n),
648
- c(({ initialPointersAverageDistance: i, ...s }) => s)
648
+ h(({ initialPointersAverageDistance: i, ...o }) => o)
649
649
  );
650
- class Re extends z {
650
+ class ze extends F {
651
651
  constructor(e) {
652
652
  super(e, {
653
653
  ...e == null ? void 0 : e.options,
654
654
  numInputs: 2
655
655
  });
656
- $(this, "events$");
657
- $(this, "start$");
658
- $(this, "end$");
659
- const i = this.panStart$.pipe(
660
- g(
661
- (s) => T(s).pipe(
662
- j({
663
- type: "pinchStart",
664
- initialEvent: void 0
665
- })
666
- )
667
- ),
668
- P()
669
- );
656
+ u(this, "events$");
657
+ u(this, "start$");
658
+ u(this, "end$");
670
659
  this.events$ = this.config$.pipe(
671
- g(() => {
672
- const s = i.pipe(M(1)), p = s.pipe(
673
- g((o) => this.pan$.pipe(
660
+ v(() => {
661
+ const i = this.panStart$.pipe(
662
+ z(this.failWithActive$),
663
+ c(([, s]) => !s),
664
+ h(([s]) => s),
665
+ v(
666
+ (s) => I(s).pipe(
667
+ // we don't want a scan on pinch start
668
+ Y({
669
+ type: "pinchStart",
670
+ initialEvent: void 0
671
+ })
672
+ )
673
+ ),
674
+ E(1)
675
+ ), o = this.failWithActive$.pipe(
676
+ c((s) => s),
677
+ R()
678
+ ), p = i.pipe(
679
+ v((s) => this.pan$.pipe(
674
680
  V((r) => r.type !== "end"),
675
- j({
681
+ Y({
676
682
  type: "pinchMove",
677
- initialEvent: o
683
+ initialEvent: s
678
684
  })
679
- ))
680
- ), a = s.pipe(
681
- g(
682
- (o) => this.pan$.pipe(
683
- // we cannot have a panEnd without a previous event so it will always emit
684
- H(o),
685
- $e(),
686
- h(([, r]) => r.type === "end"),
687
- g(
688
- ([r, l]) => T(l).pipe(
689
- j({
690
- type: "pinchEnd",
691
- initialEvent: r
692
- })
693
- )
694
- )
695
- )
696
- )
685
+ )),
686
+ T(o)
687
+ ), a = i.pipe(
688
+ v((s) => {
689
+ let r = s;
690
+ return this.pan$.pipe(
691
+ v((l) => l.type === "end" ? I(l) : (r = l, ue)),
692
+ T(o),
693
+ $e(null),
694
+ h(
695
+ (l) => l || r
696
+ ),
697
+ Y({
698
+ type: "pinchEnd",
699
+ initialEvent: r
700
+ }),
701
+ w()
702
+ );
703
+ })
697
704
  );
698
- return y(s, p, a);
705
+ return g(i, p, a);
699
706
  }),
700
- P()
707
+ w()
701
708
  ), this.start$ = this.events$.pipe(
702
- h((s) => s.type === "pinchStart")
703
- ), this.end$ = this.events$.pipe(h((s) => s.type === "pinchEnd"));
709
+ c((i) => i.type === "pinchStart")
710
+ ), this.end$ = this.events$.pipe(c((i) => i.type === "pinchEnd"));
704
711
  }
705
712
  update(e) {
706
713
  super.update(e, e.options);
707
714
  }
708
715
  }
709
- class ze {
716
+ class ke {
710
717
  constructor(n) {
711
- $(this, "events$");
712
- $(this, "recognizers");
713
- $(this, "state$");
714
- this.options = n, this.recognizers = n.recognizers, this.events$ = y(
718
+ u(this, "events$");
719
+ u(this, "recognizers");
720
+ u(this, "state$");
721
+ this.options = n, this.recognizers = n.recognizers, this.events$ = g(
715
722
  ...n.recognizers.map((e) => e.events$)
716
- ).pipe(P()), this.state$ = W(
723
+ ).pipe(w()), this.state$ = j(
717
724
  this.recognizers.map((e) => e.state$)
718
725
  ).pipe(
719
- c(
720
- (e) => e.reduce((i, s) => ({
721
- fingers: Math.max(i.fingers, s.fingers)
726
+ h(
727
+ (e) => e.reduce((i, o) => ({
728
+ fingers: Math.max(i.fingers, o.fingers)
722
729
  }))
723
730
  )
724
731
  ), this.update(n);
@@ -730,12 +737,12 @@ class ze {
730
737
  }
731
738
  }
732
739
  export {
733
- Ie as PanRecognizer,
734
- Re as PinchRecognizer,
735
- ze as Recognizable,
736
- z as Recognizer,
737
- Ce as RotateRecognizer,
738
- Se as SwipeRecognizer,
739
- be as TapRecognizer
740
+ Se as PanRecognizer,
741
+ ze as PinchRecognizer,
742
+ ke as Recognizable,
743
+ F as Recognizer,
744
+ Re as RotateRecognizer,
745
+ be as SwipeRecognizer,
746
+ Ce as TapRecognizer
740
747
  };
741
748
  //# sourceMappingURL=index.js.map