@picked/analytics 0.0.12-next.9 → 0.0.12

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