@picked/analytics 0.0.1-dev.1772412203098 → 0.0.1-dev.1773363643396

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