@picked/analytics 0.0.33 → 0.0.34-next.1

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,1191 +0,0 @@
1
- import { trackSelfDescribingEvent as Pt, newTracker as Vt, addGlobalContexts as St, enableActivityTracking as Yt, enableActivityTrackingCallback as Bt } from "@snowplow/browser-tracker";
2
- import { ButtonClickTrackingPlugin as Ht, enableButtonClickTracking as At } from "@snowplow/browser-plugin-button-click-tracking";
3
- import { PerformanceNavigationTimingPlugin as qt } from "@snowplow/browser-plugin-performance-navigation-timing";
4
- import { ErrorTrackingPlugin as Ot, enableErrorTracking as jt } from "@snowplow/browser-plugin-error-tracking";
5
- import { WebVitalsPlugin as Ft } from "@snowplow/browser-plugin-web-vitals";
6
- import { supportsDocument as X, supportsWindow as Rt, supportsCookies as Wt } from "@picked/client";
7
- function J(t, e) {
8
- return `iglu:dev.pckd/${t}/jsonschema/${e}`;
9
- }
10
- function $(t, ...e) {
11
- }
12
- function L(t, ...e) {
13
- }
14
- function l(t, e, s = {}) {
15
- return {
16
- event: {
17
- schema: J("event", "1-0-0"),
18
- data: {
19
- type: t,
20
- meta: s
21
- }
22
- },
23
- context: e.filter(
24
- (i) => i !== void 0
25
- )
26
- };
27
- }
28
- function n(t, e, s) {
29
- return {
30
- schema: J(t, e),
31
- data: s
32
- };
33
- }
34
- function u(t, e) {
35
- return (s, i) => {
36
- const a = e(s, i);
37
- Pt(a);
38
- };
39
- }
40
- function _(t, e, s = { passive: !0 }) {
41
- const i = /* @__PURE__ */ new WeakMap();
42
- return (a, o) => {
43
- let r = i.get(a);
44
- if (r || (r = /* @__PURE__ */ new Set(), i.set(a, r)), r.has(t))
45
- return;
46
- function c(m) {
47
- const C = o();
48
- e({ event: m, analyticsContext: C });
49
- }
50
- a.addEventListener(t, c, s), r.add(t);
51
- };
52
- }
53
- function It(t, e) {
54
- const s = /* @__PURE__ */ new Set();
55
- return (i) => {
56
- if (s.has(t) || !X())
57
- return;
58
- function a(o) {
59
- const r = i();
60
- e({ event: o, analyticsContext: r });
61
- }
62
- document.addEventListener(t, a, { passive: !0 }), s.add(t);
63
- };
64
- }
65
- function h(t, e) {
66
- const s = /* @__PURE__ */ new Set();
67
- return (i) => {
68
- if (s.has(t) || !Rt())
69
- return;
70
- function a(o) {
71
- const r = i();
72
- e({ event: o, analyticsContext: r });
73
- }
74
- window.addEventListener(t, a, { passive: !0 }), s.add(t);
75
- };
76
- }
77
- function f(t) {
78
- var s;
79
- return { items: ((s = t.features) == null ? void 0 : s.map(({ feature: i, name: a, key: o, bucket: r }) => ({
80
- ab_feature: i,
81
- ab_name: a,
82
- ab_key: o,
83
- ab_bucket: r
84
- }))) || [] };
85
- }
86
- const D = "unknown";
87
- function d(t) {
88
- var i, a, o;
89
- const e = Mt(), s = {
90
- id: t.sessionId || null
91
- };
92
- return t.isUser !== void 0 && (s.is_user = t.isUser), t.identifiers && Object.assign(s, t.identifiers), e && (s.gaid = e), (i = t.shopifySession) != null && i.clientId && (s.shopify_client_id = t.shopifySession.clientId), (a = t.shopifySession) != null && a.customerId && (s.shopify_customer_id = t.shopifySession.customerId), (o = t.shopifySession) != null && o.checkoutToken && (s.shopify_checkout_token = t.shopifySession.checkoutToken), s;
93
- }
94
- function R(t) {
95
- if (t.fields)
96
- return {
97
- items: t.fields.map(({ id: e, type: s, label: i, options: a }) => ({
98
- id: e,
99
- type: s,
100
- label: i,
101
- options: Array.isArray(a) ? a : void 0
102
- }))
103
- };
104
- }
105
- function Q(t) {
106
- if (t.responses)
107
- return {
108
- items: t.responses.map(
109
- ({ fieldId: e, value: s }) => ({
110
- field_id: e,
111
- values: Array.isArray(s) ? s.map((i) => ({ value: i })) : [{ value: s }]
112
- })
113
- )
114
- };
115
- }
116
- function x(t, e = !1) {
117
- const { step: s } = t;
118
- if (s)
119
- return {
120
- id: s.id,
121
- title: s.label
122
- };
123
- if (e)
124
- return L('"step" is required for this event', t), {
125
- id: D,
126
- title: D
127
- };
128
- }
129
- function On(t, e = !1) {
130
- const { productList: s } = t;
131
- if (s) {
132
- const i = {};
133
- "title" in s && s.title && Object.assign(i, { title: s.title });
134
- const a = "items" in s ? s.items : s;
135
- return Object.assign(i, {
136
- items: a.map((o) => ({
137
- item_id: o.itemId,
138
- item_name: o.itemName,
139
- affiliation: o.affiliation,
140
- coupon: o.coupon,
141
- currency: o.currency,
142
- creative_name: o.creativeName,
143
- creative_slot: o.creativeSlot,
144
- discount: y(o.discount),
145
- index: y(o.index),
146
- item_brand: o.itemBrand,
147
- item_category: o.itemCategory,
148
- item_category2: o.itemCategory2,
149
- item_category3: o.itemCategory3,
150
- item_category4: o.itemCategory4,
151
- item_category5: o.itemCategory5,
152
- item_list_id: o.itemListId,
153
- item_list_name: o.itemListName,
154
- item_variant: o.itemVariant,
155
- location_id: o.locationId,
156
- price: y(o.price),
157
- promotion_id: o.promotionId,
158
- promotion_name: o.promotionName,
159
- quantity: y(o.quantity),
160
- in_stock: o.inStock
161
- }))
162
- }), i;
163
- }
164
- if (e)
165
- return L('"productList" is required for this event', t), {
166
- items: []
167
- };
168
- }
169
- function jn(t, e = !1) {
170
- const { order: s } = t;
171
- if (s) {
172
- const i = {
173
- id: s.id
174
- };
175
- return s.checkoutToken && (i.checkout_token = s.checkoutToken), s.cartToken && (i.cart_token = s.cartToken), s.customerId && (i.customer_id = s.customerId), i;
176
- }
177
- if (e)
178
- return L('"order" is required for this event', t), {
179
- id: D
180
- };
181
- }
182
- function p(t, e = !1) {
183
- const { experience: s } = t;
184
- if (s)
185
- return {
186
- id: s.id,
187
- title: s.title
188
- };
189
- if (e)
190
- return L('"experience" is required for this event', t), {
191
- id: D,
192
- title: D
193
- };
194
- }
195
- function Z(t, e = !1) {
196
- const { exception: s } = t;
197
- if (s)
198
- return typeof s == "string" ? { reason: s } : {
199
- reason: s.systemMessage
200
- };
201
- if (e)
202
- return L('"exception" is required for this event', t), {
203
- reason: D
204
- };
205
- }
206
- function w(t) {
207
- const { form: e } = t;
208
- return e ? {
209
- id: e.id,
210
- title: e.title
211
- } : (L('"form" is required for this event', t), {
212
- id: D,
213
- title: D
214
- });
215
- }
216
- function Fn(t) {
217
- const { modal: e } = t;
218
- return e ? {
219
- id: e.id,
220
- title: e.title
221
- } : (L('"modal" is required for this event', t), {
222
- id: D,
223
- title: D
224
- });
225
- }
226
- function P(t, e = 300) {
227
- let s;
228
- return function(...i) {
229
- clearTimeout(s), s = setTimeout(() => t.apply(this, i), e);
230
- };
231
- }
232
- function y(t) {
233
- if (typeof t == "number")
234
- return t;
235
- if (typeof t != "string")
236
- return;
237
- const e = parseFloat(t);
238
- if (!isNaN(e))
239
- return e;
240
- }
241
- function Mt() {
242
- if (!X() || !Wt())
243
- return null;
244
- const t = "_ga=", e = document.cookie ? document.cookie.split(";") : [];
245
- for (const s of e) {
246
- const i = s.trim();
247
- if (i.startsWith(t)) {
248
- const o = i.substring(t.length).split(".");
249
- if (o.length > 2)
250
- return o.slice(2).join(".");
251
- }
252
- }
253
- }
254
- function Ut(t) {
255
- const e = [];
256
- return t.trackErrors && ($(), e.push(Ot())), t.trackVitals && ($(), e.push(Ft())), t.trackPerformance && ($(), e.push(qt())), (t.trackButtonClickAllowList || t.trackButtonClickFilter) && e.push(Ht()), e;
257
- }
258
- function zt(t) {
259
- t.trackActivity && !t.trackActivityCallback && ($(), Yt({
260
- minimumVisitLength: 30,
261
- heartbeatDelay: 10
262
- })), t.trackActivity && t.trackActivityCallback && ($(), Bt({
263
- minimumVisitLength: 30,
264
- heartbeatDelay: 10,
265
- callback: t.trackActivityCallback
266
- })), (t.trackButtonClickAllowList || t.trackButtonClickFilter) && ($(), At({
267
- filter: t.trackButtonClickAllowList ? {
268
- allowlist: t.trackButtonClickAllowList
269
- } : t.trackButtonClickFilter
270
- })), t.trackErrors && ($(), jt());
271
- }
272
- function Rn({
273
- organizationId: t,
274
- projectId: e,
275
- cvlyX: s,
276
- deployment: i,
277
- collectorUrl: a = "evnts.pckd.dev",
278
- appId: o = "picked-analytics",
279
- trackVitals: r = !1,
280
- trackPerformance: c = !1,
281
- trackWebPage: m = !0,
282
- trackSessions: C = !0,
283
- trackBrowser: $t = !0,
284
- trackActivity: gt = !1,
285
- trackErrors: Lt = !1,
286
- trackActivityCallback: ht,
287
- trackButtonClickAllowList: yt
288
- }) {
289
- $();
290
- const W = {
291
- trackVitals: r,
292
- trackErrors: Lt,
293
- trackActivity: gt,
294
- trackPerformance: c,
295
- trackActivityCallback: ht,
296
- trackButtonClickAllowList: yt
297
- }, Nt = {
298
- appId: o,
299
- platform: "web",
300
- contexts: {
301
- webPage: m,
302
- session: C,
303
- browser: $t || !1
304
- },
305
- plugins: Ut(W)
306
- }, wt = Vt(o, a, Nt);
307
- return Gt({
308
- organizationId: t,
309
- projectId: e,
310
- cvlyX: s,
311
- deployment: i
312
- }), zt(W), wt;
313
- }
314
- function Gt({ organizationId: t, projectId: e, cvlyX: s, deployment: i }) {
315
- if (!t || !e)
316
- throw new Error("bindGlobalContext: Both organizationId and projectId are required");
317
- const a = [];
318
- a.push(
319
- n("app", "1-0-0", {
320
- organization_id: t,
321
- project_id: e
322
- }),
323
- n("deployment", "1-0-1", {
324
- sha: i.sha,
325
- id: i.id,
326
- env: i.env,
327
- host: i.host
328
- })
329
- ), s && a.push(
330
- n("cvly_x", "1-0-1", {
331
- vercel_deployment_id: s.vercelDeploymentId,
332
- vercel_env: s.vercelEnv,
333
- vercel_url: s.vercelUrl
334
- })
335
- ), St(a);
336
- }
337
- const tt = "app_close";
338
- function Kt(t, e) {
339
- const s = f(t), i = d(t), a = p(t), o = x(t);
340
- return l(
341
- tt,
342
- [
343
- n("feature_list", "2-0-0", s),
344
- n("session", "1-0-4", i),
345
- o ? n("step", "1-0-0", o) : void 0,
346
- a ? n("experience", "1-0-1", a) : void 0
347
- ],
348
- e
349
- );
350
- }
351
- const Wn = u(tt, Kt), et = "app_initialize";
352
- function Xt(t, e) {
353
- const s = f(t), i = d(t), a = p(t), o = x(t);
354
- return l(
355
- et,
356
- [
357
- n("feature_list", "2-0-0", s),
358
- n("session", "1-0-4", i),
359
- o ? n("step", "1-0-0", o) : void 0,
360
- a ? n("experience", "1-0-1", a) : void 0
361
- ],
362
- e
363
- );
364
- }
365
- const In = u(et, Xt), nt = "app_load";
366
- function Jt(t, e) {
367
- const s = f(t), i = d(t), a = p(t), o = x(t);
368
- return l(
369
- nt,
370
- [
371
- n("feature_list", "2-0-0", s),
372
- n("session", "1-0-4", i),
373
- o ? n("step", "1-0-0", o) : void 0,
374
- a ? n("experience", "1-0-1", a) : void 0
375
- ],
376
- e
377
- );
378
- }
379
- const Mn = u(nt, Jt), st = "app_open";
380
- function Qt(t, e) {
381
- const s = f(t), i = d(t), a = p(t), o = x(t);
382
- return l(
383
- st,
384
- [
385
- n("feature_list", "2-0-0", s),
386
- n("session", "1-0-4", i),
387
- o ? n("step", "1-0-0", o) : void 0,
388
- a ? n("experience", "1-0-1", a) : void 0
389
- ],
390
- e
391
- );
392
- }
393
- const Un = u(st, Qt), ot = "experience_load";
394
- function Zt(t, e) {
395
- const s = f(t), i = d(t), a = p(t, !0), o = x(t);
396
- return l(
397
- ot,
398
- [
399
- n("feature_list", "2-0-0", s),
400
- n("session", "1-0-4", i),
401
- n("experience", "1-0-1", a),
402
- o ? n("step", "1-0-0", o) : void 0
403
- ],
404
- e
405
- );
406
- }
407
- const zn = u(ot, Zt), at = "feature_decide";
408
- function te(t, e) {
409
- const s = f(t), i = d(t), a = p(t), o = x(t);
410
- return l(
411
- at,
412
- [
413
- n("feature_list", "2-0-0", s),
414
- n("session", "1-0-4", i),
415
- o ? n("step", "1-0-0", o) : void 0,
416
- a ? n("experience", "1-0-1", a) : void 0
417
- ],
418
- e
419
- );
420
- }
421
- const Gn = u(at, te), it = "field_validation_error";
422
- function ee(t, e) {
423
- const s = f(t), i = d(t), a = w(t), o = Z(t, !0), r = p(t), c = x(t);
424
- return l(
425
- it,
426
- [
427
- n("feature_list", "2-0-0", s),
428
- n("session", "1-0-4", i),
429
- n("exception", "1-0-0", o),
430
- n("form", "1-0-0", a),
431
- r && n("experience", "1-0-1", r),
432
- c && n("step", "1-0-0", c)
433
- ],
434
- e
435
- );
436
- }
437
- const Kn = u(it, ee), rt = "form_submit";
438
- function ne(t, e) {
439
- const s = f(t), i = d(t), a = w(t), o = p(t), r = x(t);
440
- return l(
441
- rt,
442
- [
443
- n("feature_list", "2-0-0", s),
444
- n("session", "1-0-4", i),
445
- n("form", "1-0-0", a),
446
- o && n("experience", "1-0-1", o),
447
- r && n("step", "1-0-0", r)
448
- ],
449
- e
450
- );
451
- }
452
- const Xn = u(rt, ne), ct = "form_submit_error";
453
- function se(t, e) {
454
- const s = f(t), i = d(t), a = w(t), o = Z(t, !0), r = p(t), c = x(t);
455
- return l(
456
- ct,
457
- [
458
- n("feature_list", "2-0-0", s),
459
- n("session", "1-0-4", i),
460
- n("form", "1-0-0", a),
461
- n("exception", "1-0-0", o),
462
- r && n("experience", "1-0-1", r),
463
- c && n("step", "1-0-0", c)
464
- ],
465
- e
466
- );
467
- }
468
- const Jn = u(ct, se), lt = "form_submit_success";
469
- function oe(t, e) {
470
- const s = f(t), i = d(t), a = w(t), o = p(t), r = x(t);
471
- return l(
472
- lt,
473
- [
474
- n("feature_list", "2-0-0", s),
475
- n("session", "1-0-4", i),
476
- n("form", "1-0-0", a),
477
- o && n("experience", "1-0-1", o),
478
- r && n("step", "1-0-0", r)
479
- ],
480
- e
481
- );
482
- }
483
- const Qn = u(lt, oe), ut = "step_enter";
484
- function ae(t, e) {
485
- const s = f(t), i = d(t), a = p(t), o = x(t, !0), r = R(t);
486
- return l(
487
- ut,
488
- [
489
- n("feature_list", "2-0-0", s),
490
- n("session", "1-0-4", i),
491
- n("step", "1-0-0", o),
492
- r && n("field_list", "1-0-0", r),
493
- a && n("experience", "1-0-1", a)
494
- ],
495
- e
496
- );
497
- }
498
- const Zn = u(ut, ae), ft = "step_submit";
499
- function ie(t, e) {
500
- const s = f(t), i = d(t), a = p(t), o = x(t, !0), r = Q(t), c = R(t);
501
- return l(
502
- ft,
503
- [
504
- n("feature_list", "2-0-0", s),
505
- n("session", "1-0-4", i),
506
- n("step", "1-0-0", o),
507
- c && n("field_list", "1-0-0", c),
508
- r && n("response_list", "1-0-0", r),
509
- a && n("experience", "1-0-1", a)
510
- ],
511
- e
512
- );
513
- }
514
- const ts = u(ft, ie), dt = "step_submit_success";
515
- function re(t, e) {
516
- const s = f(t), i = d(t), a = p(t), o = x(t, !0), r = R(t), c = Q(t);
517
- return l(
518
- dt,
519
- [
520
- n("feature_list", "2-0-0", s),
521
- n("session", "1-0-4", i),
522
- n("step", "1-0-0", o),
523
- r && n("field_list", "1-0-0", r),
524
- c && n("response_list", "1-0-0", c),
525
- a && n("experience", "1-0-1", a)
526
- ],
527
- e
528
- );
529
- }
530
- const es = u(dt, re);
531
- function k(t) {
532
- return t instanceof Element;
533
- }
534
- function T(t) {
535
- const e = [
536
- "a",
537
- "button",
538
- "input",
539
- "select",
540
- "textarea",
541
- "details",
542
- "summary",
543
- "label",
544
- "form",
545
- "fieldset",
546
- "legend",
547
- "optgroup",
548
- "option",
549
- "output",
550
- "datalist",
551
- "dialog",
552
- "menu",
553
- "menuitem",
554
- "iframe",
555
- "audio",
556
- "video",
557
- "embed",
558
- "object",
559
- "canvas"
560
- ].join(", ");
561
- return k(t) ? t.matches(e) ? t : t.closest(e) : null;
562
- }
563
- function v(t) {
564
- if (t instanceof HTMLSelectElement) {
565
- const e = t.selectedIndex || 0, s = t.options[e];
566
- return (s == null ? void 0 : s.text) ?? "";
567
- }
568
- return "innerText" in t && typeof t.innerText == "string" ? t.innerText : t.textContent;
569
- }
570
- function b(t) {
571
- const e = t.getAttribute("aria-label");
572
- if (e)
573
- return e;
574
- const s = t.getAttribute("aria-labelledby");
575
- if (s) {
576
- const a = document.getElementById(s);
577
- if (a) {
578
- const o = v(a);
579
- if (o)
580
- return o;
581
- }
582
- }
583
- if ("id" in t && t.id) {
584
- const a = document.querySelector(`label[for="${t.id}"]`);
585
- if (a) {
586
- const o = v(a);
587
- if (o)
588
- return o;
589
- }
590
- }
591
- let i = t.parentElement;
592
- for (; i; ) {
593
- if (i.tagName.toLowerCase() === "label") {
594
- const a = v(i);
595
- if (a)
596
- return a;
597
- }
598
- i = i.parentElement;
599
- }
600
- if (t instanceof HTMLInputElement && "labels" in t && t.labels) {
601
- const a = Array.from(t.labels).map((o) => v(o)).filter(Boolean).join(" ");
602
- if (a)
603
- return a;
604
- }
605
- return "placeholder" in t && typeof t.placeholder == "string" ? t.placeholder : null;
606
- }
607
- const ce = 255;
608
- function E(t) {
609
- return t ? t.slice(0, ce) : null;
610
- }
611
- const S = "rapid_scroll";
612
- function le(t, e) {
613
- const s = f(t.analyticsContext), i = d(t.analyticsContext), a = p(t.analyticsContext), o = x(t.analyticsContext), r = t.event.target || document.activeElement || t.event.currentTarget;
614
- if (!k(r)) {
615
- const C = {
616
- node_type: "unknown"
617
- };
618
- return l(
619
- S,
620
- [
621
- n("feature_list", "2-0-0", s),
622
- n("session", "1-0-4", i),
623
- o ? n("step", "1-0-0", o) : void 0,
624
- a ? n("experience", "1-0-1", a) : void 0,
625
- n("element", "1-0-0", C)
626
- ],
627
- e
628
- );
629
- }
630
- const c = T(r) || r, m = {
631
- id: c.id || null,
632
- node_type: c.nodeName.toLowerCase(),
633
- label: E(b(c)),
634
- text: E(v(c))
635
- };
636
- return l(
637
- S,
638
- [
639
- n("feature_list", "2-0-0", s),
640
- n("session", "1-0-4", i),
641
- o ? n("step", "1-0-0", o) : void 0,
642
- a ? n("experience", "1-0-1", a) : void 0,
643
- n("element", "1-0-0", m)
644
- ],
645
- e
646
- );
647
- }
648
- const ue = u(S, le), fe = 100, de = 100, xe = 300;
649
- let I = 0, M = 0;
650
- const pe = P(
651
- (t, e) => {
652
- ue(t, e);
653
- },
654
- xe
655
- );
656
- function me(t, e) {
657
- const s = t.event.target || document.documentElement;
658
- if (!(s instanceof HTMLElement))
659
- return;
660
- const i = s.scrollTop, a = Date.now() - M;
661
- Math.abs(i - I) > fe && a < de && pe(t.event, e), I = i, M = Date.now();
662
- }
663
- const Ee = _("scroll", me, !0), Y = "rapid_click";
664
- function Ce(t, e) {
665
- const s = f(t.analyticsContext), i = d(t.analyticsContext), a = p(t.analyticsContext), o = x(t.analyticsContext), r = t.event.target || document.activeElement || t.event.currentTarget;
666
- if (!k(r)) {
667
- const C = {
668
- node_type: "unknown"
669
- };
670
- return l(
671
- Y,
672
- [
673
- n("feature_list", "2-0-0", s),
674
- n("session", "1-0-4", i),
675
- n("element", "1-0-0", C),
676
- o ? n("step", "1-0-0", o) : void 0,
677
- a ? n("experience", "1-0-1", a) : void 0
678
- ],
679
- e
680
- );
681
- }
682
- const c = T(r) || r, m = {
683
- id: c.id || null,
684
- node_type: c.nodeName.toLowerCase(),
685
- label: E(b(c)),
686
- text: E(v(c))
687
- };
688
- return l(
689
- Y,
690
- [
691
- n("feature_list", "2-0-0", s),
692
- n("session", "1-0-4", i),
693
- n("element", "1-0-0", m),
694
- o ? n("step", "1-0-0", o) : void 0,
695
- a ? n("experience", "1-0-1", a) : void 0
696
- ],
697
- e
698
- );
699
- }
700
- const ve = u(Y, Ce);
701
- let N = 0, U = 0;
702
- const De = 3, _e = 500;
703
- function ke(t, e) {
704
- const s = (/* @__PURE__ */ new Date()).getTime();
705
- s - U < _e ? N++ : N = 1, U = s, N >= De && (ve(t, e), N = 0);
706
- }
707
- const Te = _("click", ke), B = "right_click";
708
- function be(t, e) {
709
- const s = f(t.analyticsContext), i = d(t.analyticsContext), a = p(t.analyticsContext), o = x(t.analyticsContext), r = t.event.target || document.activeElement || t.event.currentTarget;
710
- if (!k(r)) {
711
- const C = {
712
- node_type: "unknown"
713
- };
714
- return l(B, [
715
- n("feature_list", "2-0-0", s),
716
- n("session", "1-0-4", i),
717
- n("element", "1-0-0", C),
718
- o ? n("step", "1-0-0", o) : void 0,
719
- a ? n("experience", "1-0-1", a) : void 0
720
- ]);
721
- }
722
- const c = T(r) || r, m = {
723
- id: c.id || null,
724
- node_type: c.nodeName.toLowerCase(),
725
- label: E(b(c)),
726
- text: E(v(c))
727
- };
728
- return l(
729
- B,
730
- [
731
- n("feature_list", "2-0-0", s),
732
- n("session", "1-0-4", i),
733
- n("element", "1-0-0", m),
734
- o ? n("step", "1-0-0", o) : void 0,
735
- a ? n("experience", "1-0-1", a) : void 0
736
- ],
737
- e
738
- );
739
- }
740
- const $e = u(B, be);
741
- function ge(t, e) {
742
- $e(t, e);
743
- }
744
- const Le = _("contextmenu", ge), xt = "mouse_shake";
745
- function he(t, e) {
746
- const s = f(t.analyticsContext), i = d(t.analyticsContext), a = p(t.analyticsContext), o = x(t.analyticsContext);
747
- return l(
748
- xt,
749
- [
750
- n("feature_list", "2-0-0", s),
751
- n("session", "1-0-4", i),
752
- o ? n("step", "1-0-0", o) : void 0,
753
- a ? n("experience", "1-0-1", a) : void 0
754
- ],
755
- e
756
- );
757
- }
758
- const ye = u(xt, he), Ne = 5, we = 500, Pe = 500;
759
- let z = { x: 0 }, g = [], G = 0;
760
- const Ve = P(
761
- (t, e) => {
762
- ye(t, e);
763
- },
764
- we
765
- );
766
- function Se(t, e) {
767
- const s = Date.now(), i = t.event.clientX - z.x, a = Math.sign(i);
768
- s - G > Pe && (g = []), a !== 0 && (g.length === 0 || g[g.length - 1] !== a) && g.push(a), z = { x: t.event.clientX, y: t.event.clientY }, g.length >= Ne && (Ve(t, e), g = []), G = s;
769
- }
770
- const Ye = _("mousemove", Se), pt = "page_visible";
771
- function Be(t, e) {
772
- const s = f(t.analyticsContext), i = d(t.analyticsContext), a = p(t.analyticsContext), o = x(t.analyticsContext);
773
- return l(
774
- pt,
775
- [
776
- n("feature_list", "2-0-0", s),
777
- n("session", "1-0-4", i),
778
- o ? n("step", "1-0-0", o) : void 0,
779
- a ? n("experience", "1-0-1", a) : void 0
780
- ],
781
- e
782
- );
783
- }
784
- const He = u(pt, Be), mt = "page_hidden";
785
- function Ae(t, e) {
786
- const s = f(t.analyticsContext), i = d(t.analyticsContext), a = p(t.analyticsContext), o = x(t.analyticsContext);
787
- return l(
788
- mt,
789
- [
790
- n("feature_list", "2-0-0", s),
791
- n("session", "1-0-4", i),
792
- o ? n("step", "1-0-0", o) : void 0,
793
- a ? n("experience", "1-0-1", a) : void 0
794
- ],
795
- e
796
- );
797
- }
798
- const qe = u(mt, Ae);
799
- function Oe(t, e) {
800
- if (document.visibilityState === "visible") {
801
- He(t, e);
802
- return;
803
- }
804
- qe(t, e);
805
- }
806
- const je = It("visibilitychange", Oe), H = "backspace";
807
- function Fe(t, e) {
808
- const s = f(t.analyticsContext), i = d(t.analyticsContext), a = p(t.analyticsContext), o = x(t.analyticsContext), r = t.event.target || document.activeElement || t.event.currentTarget;
809
- if (!k(r)) {
810
- const C = {
811
- node_type: "unknown"
812
- };
813
- return l(
814
- H,
815
- [
816
- n("feature_list", "2-0-0", s),
817
- n("session", "1-0-4", i),
818
- n("element", "1-0-0", C),
819
- o ? n("step", "1-0-0", o) : void 0,
820
- a ? n("experience", "1-0-1", a) : void 0
821
- ],
822
- e
823
- );
824
- }
825
- const c = T(r) || r, m = {
826
- id: c.id || null,
827
- node_type: c.nodeName.toLowerCase(),
828
- label: E(b(c)),
829
- text: E(v(c))
830
- };
831
- return l(
832
- H,
833
- [
834
- n("feature_list", "2-0-0", s),
835
- n("session", "1-0-4", i),
836
- n("element", "1-0-0", m),
837
- o ? n("step", "1-0-0", o) : void 0,
838
- a ? n("experience", "1-0-1", a) : void 0
839
- ],
840
- e
841
- );
842
- }
843
- const Re = u(H, Fe);
844
- function We(t, e) {
845
- t.event.key === "Backspace" && Re(t, e);
846
- }
847
- const Ie = _("keydown", We), Et = "page_hide";
848
- function Me(t, e) {
849
- const s = f(t.analyticsContext), i = d(t.analyticsContext), a = p(t.analyticsContext), o = x(t.analyticsContext);
850
- return l(
851
- Et,
852
- [
853
- n("feature_list", "2-0-0", s),
854
- n("session", "1-0-4", i),
855
- o ? n("step", "1-0-0", o) : void 0,
856
- a ? n("experience", "1-0-1", a) : void 0
857
- ],
858
- e
859
- );
860
- }
861
- const Ue = u(Et, Me);
862
- function ze(t, e) {
863
- Ue(t, e);
864
- }
865
- const Ge = h("pagehide", ze), Ct = "page_show";
866
- function Ke(t, e) {
867
- const s = f(t.analyticsContext), i = d(t.analyticsContext), a = p(t.analyticsContext), o = x(t.analyticsContext);
868
- return l(
869
- Ct,
870
- [
871
- n("feature_list", "2-0-0", s),
872
- n("session", "1-0-4", i),
873
- o ? n("step", "1-0-0", o) : void 0,
874
- a ? n("experience", "1-0-1", a) : void 0
875
- ],
876
- e
877
- );
878
- }
879
- const Xe = u(Ct, Ke);
880
- function Je(t, e) {
881
- Xe(t, e);
882
- }
883
- const Qe = h("pageshow", Je), vt = "offline";
884
- function Ze(t, e) {
885
- const s = f(t.analyticsContext), i = d(t.analyticsContext), a = p(t.analyticsContext), o = x(t.analyticsContext);
886
- return l(
887
- vt,
888
- [
889
- n("feature_list", "2-0-0", s),
890
- n("session", "1-0-4", i),
891
- o ? n("step", "1-0-0", o) : void 0,
892
- a ? n("experience", "1-0-1", a) : void 0
893
- ],
894
- e
895
- );
896
- }
897
- const tn = u(vt, Ze);
898
- function en(t, e) {
899
- tn(t, e);
900
- }
901
- const nn = h("offline", en), A = "scroll";
902
- function sn(t, e) {
903
- const s = f(t.analyticsContext), i = d(t.analyticsContext), a = p(t.analyticsContext), o = x(t.analyticsContext), r = t.event.target || document.activeElement || t.event.currentTarget;
904
- if (!k(r))
905
- return l(
906
- A,
907
- [
908
- n("feature_list", "2-0-0", s),
909
- n("session", "1-0-4", i),
910
- o ? n("step", "1-0-0", o) : void 0,
911
- a ? n("experience", "1-0-1", a) : void 0
912
- ],
913
- e
914
- );
915
- const c = T(r) || r, m = {
916
- id: c.id || null,
917
- node_type: c.nodeName.toLowerCase(),
918
- label: E(b(c)),
919
- text: E(v(c))
920
- };
921
- return l(
922
- A,
923
- [
924
- n("feature_list", "2-0-0", s),
925
- n("session", "1-0-4", i),
926
- o ? n("step", "1-0-0", o) : void 0,
927
- a ? n("experience", "1-0-1", a) : void 0,
928
- n("element", "1-0-0", m)
929
- ],
930
- e
931
- );
932
- }
933
- const on = u(A, sn), an = P(
934
- (t, e) => {
935
- on(t, e);
936
- },
937
- 500
938
- ), rn = _("scroll", an, !0), Dt = "online";
939
- function cn(t, e) {
940
- const s = f(t.analyticsContext), i = d(t.analyticsContext), a = p(t.analyticsContext), o = x(t.analyticsContext);
941
- return l(
942
- Dt,
943
- [
944
- n("feature_list", "2-0-0", s),
945
- n("session", "1-0-4", i),
946
- o ? n("step", "1-0-0", o) : void 0,
947
- a ? n("experience", "1-0-1", a) : void 0
948
- ],
949
- e
950
- );
951
- }
952
- const ln = u(Dt, cn);
953
- function un(t, e) {
954
- ln(t, e);
955
- }
956
- const fn = h("online", un), _t = "resize";
957
- function dn(t, e) {
958
- const s = f(t.analyticsContext), i = d(t.analyticsContext), a = p(t.analyticsContext), o = x(t.analyticsContext);
959
- return l(
960
- _t,
961
- [
962
- n("feature_list", "2-0-0", s),
963
- n("session", "1-0-4", i),
964
- o ? n("step", "1-0-0", o) : void 0,
965
- a ? n("experience", "1-0-1", a) : void 0
966
- ],
967
- e
968
- );
969
- }
970
- const K = u(_t, dn);
971
- let V = 0;
972
- const xn = P(
973
- (t, e) => {
974
- const s = window.innerWidth;
975
- s !== V ? (K(t, e), V = s) : "ontouchstart" in window || K(t, e), V = s;
976
- },
977
- 300
978
- ), pn = h("resize", xn), kt = "unload";
979
- function mn(t, e) {
980
- const s = f(t.analyticsContext), i = d(t.analyticsContext), a = p(t.analyticsContext), o = x(t.analyticsContext);
981
- return l(
982
- kt,
983
- [
984
- n("feature_list", "2-0-0", s),
985
- n("session", "1-0-4", i),
986
- o ? n("step", "1-0-0", o) : void 0,
987
- a ? n("experience", "1-0-1", a) : void 0
988
- ],
989
- e
990
- );
991
- }
992
- const En = u(kt, mn);
993
- function Cn(t, e) {
994
- En(t, e);
995
- }
996
- const vn = h("unload", Cn), q = "click";
997
- function Dn(t, e) {
998
- const s = f(t.analyticsContext), i = d(t.analyticsContext), a = p(t.analyticsContext), o = x(t.analyticsContext), r = t.event.target || document.activeElement || t.event.currentTarget;
999
- if (!k(r)) {
1000
- const C = {
1001
- node_type: "unknown"
1002
- };
1003
- return l(
1004
- q,
1005
- [
1006
- n("feature_list", "2-0-0", s),
1007
- n("session", "1-0-4", i),
1008
- n("element", "1-0-0", C),
1009
- o ? n("step", "1-0-0", o) : void 0,
1010
- a ? n("experience", "1-0-1", a) : void 0
1011
- ],
1012
- e
1013
- );
1014
- }
1015
- const c = T(r) || r, m = {
1016
- id: c.id || null,
1017
- node_type: c.nodeName.toLowerCase(),
1018
- label: E(b(c)),
1019
- text: E(v(c))
1020
- };
1021
- return l(
1022
- q,
1023
- [
1024
- n("feature_list", "2-0-0", s),
1025
- n("session", "1-0-4", i),
1026
- n("element", "1-0-0", m),
1027
- o ? n("step", "1-0-0", o) : void 0,
1028
- a ? n("experience", "1-0-1", a) : void 0
1029
- ],
1030
- e
1031
- );
1032
- }
1033
- const _n = u(q, Dn);
1034
- function kn(t, e) {
1035
- _n(t, e);
1036
- }
1037
- const Tn = _("click", kn), O = "paste";
1038
- function bn(t, e) {
1039
- const s = f(t.analyticsContext), i = d(t.analyticsContext), a = p(t.analyticsContext), o = x(t.analyticsContext), r = t.event.target || document.activeElement || t.event.currentTarget;
1040
- if (!k(r))
1041
- return l(
1042
- O,
1043
- [
1044
- n("feature_list", "2-0-0", s),
1045
- n("session", "1-0-4", i),
1046
- o ? n("step", "1-0-0", o) : void 0,
1047
- a ? n("experience", "1-0-1", a) : void 0
1048
- ],
1049
- e
1050
- );
1051
- const c = T(r) || r, m = {
1052
- id: c.id || null,
1053
- node_type: c.nodeName.toLowerCase(),
1054
- label: E(b(c)),
1055
- text: E(v(c))
1056
- };
1057
- return l(
1058
- O,
1059
- [
1060
- n("feature_list", "2-0-0", s),
1061
- n("session", "1-0-4", i),
1062
- o ? n("step", "1-0-0", o) : void 0,
1063
- a ? n("experience", "1-0-1", a) : void 0,
1064
- n("element", "1-0-0", m)
1065
- ],
1066
- e
1067
- );
1068
- }
1069
- const $n = u(O, bn);
1070
- function gn(t, e) {
1071
- $n(t, e);
1072
- }
1073
- const Ln = _("paste", gn), j = "copy";
1074
- function hn(t, e) {
1075
- const s = f(t.analyticsContext), i = d(t.analyticsContext), a = p(t.analyticsContext), o = x(t.analyticsContext), r = t.event.target || document.activeElement || t.event.currentTarget;
1076
- if (!k(r))
1077
- return l(
1078
- j,
1079
- [
1080
- n("feature_list", "2-0-0", s),
1081
- n("session", "1-0-4", i),
1082
- o ? n("step", "1-0-0", o) : void 0,
1083
- a ? n("experience", "1-0-1", a) : void 0
1084
- ],
1085
- e
1086
- );
1087
- const c = T(r) || r, m = {
1088
- id: c.id || null,
1089
- node_type: c.nodeName.toLowerCase(),
1090
- label: E(b(c)),
1091
- text: E(v(c))
1092
- };
1093
- return l(
1094
- j,
1095
- [
1096
- n("feature_list", "2-0-0", s),
1097
- n("session", "1-0-4", i),
1098
- o ? n("step", "1-0-0", o) : void 0,
1099
- a ? n("experience", "1-0-1", a) : void 0,
1100
- n("element", "1-0-0", m)
1101
- ],
1102
- e
1103
- );
1104
- }
1105
- const yn = u(j, hn);
1106
- function Nn(t, e) {
1107
- yn(t, e);
1108
- }
1109
- const wn = _("copy", Nn), F = "drag";
1110
- function Pn(t, e) {
1111
- const s = f(t.analyticsContext), i = d(t.analyticsContext), a = p(t.analyticsContext), o = x(t.analyticsContext), r = t.event.target || document.activeElement || t.event.currentTarget;
1112
- if (!k(r))
1113
- return l(
1114
- F,
1115
- [
1116
- n("feature_list", "2-0-0", s),
1117
- n("session", "1-0-4", i),
1118
- o ? n("step", "1-0-0", o) : void 0,
1119
- a ? n("experience", "1-0-1", a) : void 0
1120
- ],
1121
- e
1122
- );
1123
- const c = T(r) || r, m = {
1124
- id: c.id || null,
1125
- node_type: c.nodeName.toLowerCase(),
1126
- label: E(b(c)),
1127
- text: E(v(c))
1128
- };
1129
- return l(
1130
- F,
1131
- [
1132
- n("feature_list", "2-0-0", s),
1133
- n("session", "1-0-4", i),
1134
- o ? n("step", "1-0-0", o) : void 0,
1135
- a ? n("experience", "1-0-1", a) : void 0,
1136
- n("element", "1-0-0", m)
1137
- ],
1138
- e
1139
- );
1140
- }
1141
- const Vn = u(F, Pn);
1142
- function Tt(t, e) {
1143
- const s = t.event.currentTarget;
1144
- if (!s || !(s instanceof HTMLElement))
1145
- return;
1146
- function i(a) {
1147
- Tt({ event: a, analyticsContext: t.analyticsContext });
1148
- }
1149
- s.removeEventListener("drag", i), s.addEventListener(
1150
- "dragend",
1151
- () => bt(s, () => t.analyticsContext)
1152
- ), Vn(t, e);
1153
- }
1154
- const bt = _("drag", Tt);
1155
- function ns(t, e) {
1156
- e && (Tn(e, t), Te(e, t), Le(e, t), wn(e, t), Ln(e, t), bt(e, t), Ie(e, t), rn(e, t), Ee(e, t), Ye(e, t));
1157
- }
1158
- function ss(t) {
1159
- je(t), Ge(t), Qe(t), nn(t), fn(t), pn(t), vn(t);
1160
- }
1161
- export {
1162
- Zn as A,
1163
- ts as B,
1164
- es as C,
1165
- d as a,
1166
- On as b,
1167
- u as c,
1168
- p as d,
1169
- x as e,
1170
- f,
1171
- l as g,
1172
- n as h,
1173
- jn as i,
1174
- Fn as j,
1175
- Q as k,
1176
- R as l,
1177
- Z as m,
1178
- Rn as n,
1179
- ns as o,
1180
- ss as p,
1181
- In as q,
1182
- Mn as r,
1183
- Un as s,
1184
- Wn as t,
1185
- zn as u,
1186
- Gn as v,
1187
- Kn as w,
1188
- Xn as x,
1189
- Jn as y,
1190
- Qn as z
1191
- };