@depict-ai/dpc 1.0.29 → 1.0.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/ES10/index.js ADDED
@@ -0,0 +1,290 @@
1
+ import { add_to_version_info as t, dlog as e, impression_track_element as i, derror as s, depict_click as r, foolproof_send_beacon as n, observer as o, instant_exec_on_suspect_history_change as a, catchify as d, get_tracking_event_context_data as c, send_depict_unfiltered as u } from "@depict-ai/utilishared/ES10";
2
+ import h from "@babel/runtime/helpers/classPrivateFieldLooseBase";
3
+ import _ from "@babel/runtime/helpers/classPrivateFieldLooseKey";
4
+ /*! Depict PerformanceClient */
5
+ import { register_es_version } from "../multi_import_deduplicator.mjs";
6
+ register_es_version("performance-client", "ES10");
7
+ const l = "1.0.31";
8
+ let m;
9
+ var p;
10
+ (p = m || (m = {}))[p.Recommendation = 0] = "Recommendation", p[p.SnakeRecommendation = 1] = "SnakeRecommendation", p[p.SearchResult = 2] = "SearchResult", p[p.ProductListingResult = 3] = "ProductListingResult";
11
+ const v = {
12
+ [m.Recommendation]: "recommendation_id",
13
+ [m.SnakeRecommendation]: "recommendation_id",
14
+ [m.SearchResult]: "search_result_id",
15
+ [m.ProductListingResult]: "product_listing_result_id"
16
+ },
17
+ f = ".depict-add-to-cart",
18
+ k = {
19
+ "data-recommendation_id": m.SnakeRecommendation,
20
+ "data-recommendation-id": m.Recommendation,
21
+ "data-search-result-id": m.SearchResult,
22
+ "data-product-listing-result-id": m.ProductListingResult
23
+ };
24
+ const g = (t, e) => {
25
+ if ("number" == typeof e && !isNaN(e)) return e.toString();
26
+ if ("string" != typeof e) throw new Error("".concat(t, " event requires a string as an argument"));
27
+ return e;
28
+ },
29
+ y = (t, e) => null == e ? e : g(t, e),
30
+ b = (t, e, i) => {
31
+ if ("purchase" !== e) "number" == typeof i && (i = i.toString()), "addToCart" === e ? t.sendAddToCartEvent({
32
+ product_id: g(e, i)
33
+ }) : "setMarket" === e ? t.setMarket(g(e, i)) : "setProductId" === e ? t.setProductId(g(e, i)) : "setUserId" === e ? t.setUserId(y(e, i)) : "setSessionId" === e && t.setSessionId(y(e, i));else {
34
+ if (!(t => {
35
+ if ("object" != typeof t || null === t) throw new Error("purchase event requires an object as an argument");
36
+ if (!Array.isArray(t.items)) throw new Error("purchase event requires an items array of purchased products");
37
+ if (!t.currency || "string" != typeof t.currency) throw new Error("purchase event requires a currency string");
38
+ if (!t.transaction_id || "string" != typeof t.transaction_id && "number" != typeof t.transaction_id) throw new Error("purchase event requires a transaction_id string");
39
+ t.transaction_id = t.transaction_id.toString();
40
+ for (const e of t.items) {
41
+ if ("" == e.item_id || "string" != typeof e.item_id && ("number" != typeof e.item_id || isNaN(e.item_id))) throw new Error("purchased item requires an item_id of the purchased product");
42
+ if (isNaN(e.price)) throw new Error("purchase item requires a unit price for the product purchased");
43
+ if (!e.quantity || isNaN(e.quantity)) throw new Error("purchase item requires a quantity of products purchased");
44
+ e.item_id = e.item_id.toString();
45
+ }
46
+ return !0;
47
+ })(i)) return;
48
+ t.sendPurchaseEvent(i);
49
+ }
50
+ },
51
+ w = t => {
52
+ var e, i;
53
+ const s = (e = window).dpq || (e.dpq = function () {
54
+ const t = function () {
55
+ const e = arguments;
56
+ t.send_event ? t.send_event.apply(this, e) : t.queue.push(e);
57
+ };
58
+ return t.queue = [], t;
59
+ }()),
60
+ r = (i = window).depict || (i.depict = {});
61
+ r.dpq = s, r.eventHistory = s.queue, r.dpc = t, s.send_event || (s.send_event = (e, i) => {
62
+ s.queue.push([e, i]), b(t, e, i);
63
+ }, s.queue.forEach(e => {
64
+ let [i, s] = e;
65
+ b(t, i, s);
66
+ }));
67
+ };
68
+ var R = _("has_sent_pageview_for_current_href"),
69
+ E = _("resetSentPageViewForCurrentHref"),
70
+ P = _("parseOptions"),
71
+ S = _("getContextData"),
72
+ C = _("sendTrackingEvent"),
73
+ q = _("getProductId");
74
+ class I {
75
+ constructor(t, i) {
76
+ var s;
77
+ if (Object.defineProperty(this, q, {
78
+ value: N
79
+ }), Object.defineProperty(this, C, {
80
+ value: T
81
+ }), Object.defineProperty(this, S, {
82
+ value: j
83
+ }), Object.defineProperty(this, P, {
84
+ value: L
85
+ }), Object.defineProperty(this, E, {
86
+ value: A
87
+ }), this.merchant = void 0, this.auto_observe = !0, this.market = void 0, this.latest_product_id = void 0, this.latest_product_id_path = void 0, this.latest_session_id = void 0, this.latest_user_id = void 0, Object.defineProperty(this, R, {
88
+ writable: !0,
89
+ value: !1
90
+ }), this.tracked_elements = new WeakSet(), (null === (s = window.depict) || void 0 === s ? void 0 : s.dpc) instanceof I) return e("DPC already initialized. Returning existing instance."), window.depict.dpc;
91
+ w(this), this.merchant = t, h(this, P)[P](i), h(this, E)[E](), this.auto_observe && (this.observeRecommendations(), this.observePDPA2CButton());
92
+ }
93
+ checkIfTracked(t) {
94
+ return this.tracked_elements.has(t) ? (e("Already tracked", t), !0) : (this.tracked_elements.add(t), !1);
95
+ }
96
+ trackProductCard(t, e, s) {
97
+ if (this.checkIfTracked(t)) return;
98
+ switch (s) {
99
+ case m.Recommendation:
100
+ case m.SnakeRecommendation:
101
+ t.addEventListener("click", () => this.sendRecommendationClickEvent(e)), i({
102
+ element: t,
103
+ data: {
104
+ recommendation_id: e,
105
+ ...h(this, S)[S]()
106
+ }
107
+ });
108
+ break;
109
+ case m.SearchResult:
110
+ t.addEventListener("click", () => this.sendSearchResultClickEvent(e)), i({
111
+ element: t,
112
+ data: {
113
+ search_result_id: e,
114
+ ...h(this, S)[S]()
115
+ }
116
+ });
117
+ break;
118
+ case m.ProductListingResult:
119
+ t.addEventListener("click", () => this.sendProductListingResultClickEvent(e)), i({
120
+ element: t,
121
+ data: {
122
+ product_listing_result_id: e,
123
+ ...h(this, S)[S]()
124
+ }
125
+ });
126
+ }
127
+ const r = t.querySelectorAll(f);
128
+ for (const e of r) this.trackAddToCartButton(e, t);
129
+ }
130
+ trackAddToCartButton(t, e) {
131
+ this.checkIfTracked(t) || t.addEventListener("click", () => {
132
+ if (!e) {
133
+ const e = h(this, q)[q]();
134
+ return e ? void this.sendAddToCartEvent({
135
+ product_id: e
136
+ }) : void s("No product ID set for add-to-cart click outside of product card", t);
137
+ }
138
+ for (const [t, i] of Object.entries(k)) {
139
+ const s = e.getAttribute(t);
140
+ if (!s) continue;
141
+ const r = {
142
+ [v[i]]: s
143
+ };
144
+ return void this.sendAddToCartEvent(r);
145
+ }
146
+ s("Could not find tracking data for add-to-cart click on button", t);
147
+ });
148
+ }
149
+ sendAddToCartEvent(t) {
150
+ h(this, C)[C]({
151
+ type: "add_to_cart",
152
+ ...t
153
+ });
154
+ }
155
+ sendRecommendationImpressionEvent(t) {
156
+ h(this, C)[C]({
157
+ type: "element_visible",
158
+ recommendation_id: t
159
+ });
160
+ }
161
+ sendSearchResultImpressionEvent(t) {
162
+ h(this, C)[C]({
163
+ type: "element_visible",
164
+ search_result_id: t
165
+ });
166
+ }
167
+ sendProductListingResultImpressionEvent(t) {
168
+ h(this, C)[C]({
169
+ type: "element_visible",
170
+ product_listing_result_id: t
171
+ });
172
+ }
173
+ sendRecommendationClickEvent(t) {
174
+ r({
175
+ recommendation_id: t,
176
+ ...h(this, S)[S]()
177
+ });
178
+ }
179
+ sendSearchResultClickEvent(t) {
180
+ r({
181
+ search_result_id: t,
182
+ ...h(this, S)[S]()
183
+ });
184
+ }
185
+ sendProductListingResultClickEvent(t) {
186
+ r({
187
+ product_listing_result_id: t,
188
+ ...h(this, S)[S]()
189
+ });
190
+ }
191
+ sendPurchaseEvent(t) {
192
+ if (!this.market) throw Error("Market not set");
193
+ const {
194
+ dsid: e,
195
+ user_id: i,
196
+ session_id: s
197
+ } = h(this, S)[S](),
198
+ r = t.items.map(t => ({
199
+ sku: t.item_id,
200
+ price: t.price,
201
+ quantity: t.quantity
202
+ })),
203
+ o = {
204
+ events: [{
205
+ event_type: "purchase",
206
+ dsid: e,
207
+ user_id: i,
208
+ session_id: s,
209
+ transaction_id: t.transaction_id,
210
+ currency: t.currency,
211
+ products: r
212
+ }],
213
+ tenant: this.merchant,
214
+ market: this.market
215
+ };
216
+ n(process.env.BASE_URL + "/v2/create-events", o);
217
+ }
218
+ setMarket(t) {
219
+ this.market = t;
220
+ }
221
+ setProductId(t) {
222
+ e("Setting product id", t), this.latest_product_id = t, this.latest_product_id_path = location.pathname, h(this, R)[R] || (h(this, C)[C]({
223
+ type: "page_view",
224
+ product_id: t
225
+ }), h(this, R)[R] = !0);
226
+ }
227
+ setUserId(t) {
228
+ e("Setting user id", t), this.latest_user_id = t || void 0;
229
+ }
230
+ setSessionId(t) {
231
+ e("Setting session id", t), this.latest_session_id = t || void 0;
232
+ }
233
+ observeRecommendations() {
234
+ for (const [t, i] of Object.entries(k)) {
235
+ const r = "[".concat(t, "]");
236
+ e("Starting to observe product cards with selector", r), o.onexists(r, e => {
237
+ let {
238
+ element: n
239
+ } = e;
240
+ const o = n.getAttribute(t);
241
+ o ? this.trackProductCard(n, o, i) : s("No tracking id found on element with attribute ".concat(r), n);
242
+ });
243
+ }
244
+ }
245
+ observePDPA2CButton() {
246
+ o.onexists(f, t => {
247
+ let {
248
+ element: i
249
+ } = t;
250
+ const s = Object.keys(k).map(t => "[".concat(t, "]")).join(","),
251
+ r = i.closest(s) || void 0;
252
+ e("Found ".concat(r ? "product card" : "pdp", " add-to-cart button"), i), this.trackAddToCartButton(i, r);
253
+ });
254
+ }
255
+ }
256
+ function A() {
257
+ let t = location.href;
258
+ a.add(d(() => {
259
+ const {
260
+ href: e
261
+ } = location;
262
+ t !== e && (h(this, R)[R] = !1, t = e);
263
+ }));
264
+ }
265
+ function L(t) {
266
+ void 0 !== t && (void 0 !== t.auto_observe && (this.auto_observe = t.auto_observe), void 0 !== t.market && (this.market = t.market));
267
+ }
268
+ function j() {
269
+ const t = {
270
+ market: this.market,
271
+ tenant: this.merchant,
272
+ user_id: this.latest_user_id,
273
+ session_id: this.latest_session_id
274
+ };
275
+ return {
276
+ ...c(),
277
+ ...t
278
+ };
279
+ }
280
+ function T(t) {
281
+ u([{
282
+ ...t,
283
+ ...h(this, S)[S]()
284
+ }], !0);
285
+ }
286
+ function N() {
287
+ if (this.latest_product_id_path === location.pathname) return this.latest_product_id;
288
+ }
289
+ t("dpc", l);
290
+ export { I as DPC, l as version };
@@ -0,0 +1,295 @@
1
+ var e = require("@depict-ai/utilishared/latest"),
2
+ t = require("@babel/runtime/helpers/classPrivateFieldLooseBase"),
3
+ i = require("@babel/runtime/helpers/classPrivateFieldLooseKey");
4
+ require("../multi_import_deduplicator.cjs").register_es_version("performance-client", "latest");
5
+ function r(e, t, i, r) {
6
+ Object.defineProperty(e, t, {
7
+ get: i,
8
+ set: r,
9
+ enumerable: !0,
10
+ configurable: !0
11
+ });
12
+ }
13
+ function s(e) {
14
+ return e && e.__esModule ? e.default : e;
15
+ }
16
+ r(module.exports, "DPC", () => y), r(module.exports, "version", () => n);
17
+ /*! Depict PerformanceClient */
18
+ const n = "1.0.31";
19
+ let o;
20
+ var d;
21
+ (d = o || (o = {}))[d.Recommendation = 0] = "Recommendation", d[d.SnakeRecommendation = 1] = "SnakeRecommendation", d[d.SearchResult = 2] = "SearchResult", d[d.ProductListingResult = 3] = "ProductListingResult";
22
+ const a = {
23
+ [o.Recommendation]: "recommendation_id",
24
+ [o.SnakeRecommendation]: "recommendation_id",
25
+ [o.SearchResult]: "search_result_id",
26
+ [o.ProductListingResult]: "product_listing_result_id"
27
+ },
28
+ c = ".depict-add-to-cart",
29
+ u = {
30
+ "data-recommendation_id": o.SnakeRecommendation,
31
+ "data-recommendation-id": o.Recommendation,
32
+ "data-search-result-id": o.SearchResult,
33
+ "data-product-listing-result-id": o.ProductListingResult
34
+ };
35
+ const h = (e, t) => {
36
+ if ("number" == typeof t && !isNaN(t)) return t.toString();
37
+ if ("string" != typeof t) throw new Error(`${e} event requires a string as an argument`);
38
+ return t;
39
+ },
40
+ _ = (e, t) => null == t ? t : h(e, t),
41
+ l = (e, t, i) => {
42
+ if ("purchase" !== t) "number" == typeof i && (i = i.toString()), "addToCart" === t ? e.sendAddToCartEvent({
43
+ product_id: h(t, i)
44
+ }) : "setMarket" === t ? e.setMarket(h(t, i)) : "setProductId" === t ? e.setProductId(h(t, i)) : "setUserId" === t ? e.setUserId(_(t, i)) : "setSessionId" === t && e.setSessionId(_(t, i));else {
45
+ if (!(e => {
46
+ if ("object" != typeof e || null === e) throw new Error("purchase event requires an object as an argument");
47
+ if (!Array.isArray(e.items)) throw new Error("purchase event requires an items array of purchased products");
48
+ if (!e.currency || "string" != typeof e.currency) throw new Error("purchase event requires a currency string");
49
+ if (!e.transaction_id || "string" != typeof e.transaction_id && "number" != typeof e.transaction_id) throw new Error("purchase event requires a transaction_id string");
50
+ e.transaction_id = e.transaction_id.toString();
51
+ for (const t of e.items) {
52
+ if ("" == t.item_id || "string" != typeof t.item_id && ("number" != typeof t.item_id || isNaN(t.item_id))) throw new Error("purchased item requires an item_id of the purchased product");
53
+ if (isNaN(t.price)) throw new Error("purchase item requires a unit price for the product purchased");
54
+ if (!t.quantity || isNaN(t.quantity)) throw new Error("purchase item requires a quantity of products purchased");
55
+ t.item_id = t.item_id.toString();
56
+ }
57
+ return !0;
58
+ })(i)) return;
59
+ e.sendPurchaseEvent(i);
60
+ }
61
+ },
62
+ m = e => {
63
+ const t = window.dpq ||= function () {
64
+ const e = function () {
65
+ const t = arguments;
66
+ e.send_event ? e.send_event.apply(this, t) : e.queue.push(t);
67
+ };
68
+ return e.queue = [], e;
69
+ }(),
70
+ i = window.depict ||= {};
71
+ i.dpq = t, i.eventHistory = t.queue, i.dpc = e, t.send_event || (t.send_event = (i, r) => {
72
+ t.queue.push([i, r]), l(e, i, r);
73
+ }, t.queue.forEach(([t, i]) => {
74
+ l(e, t, i);
75
+ }));
76
+ };
77
+ var p = s(i)("has_sent_pageview_for_current_href"),
78
+ v = s(i)("resetSentPageViewForCurrentHref"),
79
+ f = s(i)("parseOptions"),
80
+ k = s(i)("getContextData"),
81
+ g = s(i)("sendTrackingEvent"),
82
+ b = s(i)("getProductId");
83
+ class y {
84
+ constructor(i, r) {
85
+ if (Object.defineProperty(this, b, {
86
+ value: S
87
+ }), Object.defineProperty(this, g, {
88
+ value: E
89
+ }), Object.defineProperty(this, k, {
90
+ value: P
91
+ }), Object.defineProperty(this, f, {
92
+ value: R
93
+ }), Object.defineProperty(this, v, {
94
+ value: w
95
+ }), this.merchant = void 0, this.auto_observe = !0, this.market = void 0, this.latest_product_id = void 0, this.latest_product_id_path = void 0, this.latest_session_id = void 0, this.latest_user_id = void 0, Object.defineProperty(this, p, {
96
+ writable: !0,
97
+ value: !1
98
+ }), this.tracked_elements = new WeakSet(), window.depict?.dpc instanceof y) return (0, e.dlog)("DPC already initialized. Returning existing instance."), window.depict.dpc;
99
+ m(this), this.merchant = i, s(t)(this, f)[f](r), s(t)(this, v)[v](), this.auto_observe && (this.observeRecommendations(), this.observePDPA2CButton());
100
+ }
101
+ checkIfTracked(t) {
102
+ return this.tracked_elements.has(t) ? ((0, e.dlog)("Already tracked", t), !0) : (this.tracked_elements.add(t), !1);
103
+ }
104
+ trackProductCard(i, r, n) {
105
+ if (this.checkIfTracked(i)) return;
106
+ switch (n) {
107
+ case o.Recommendation:
108
+ case o.SnakeRecommendation:
109
+ i.addEventListener("click", () => this.sendRecommendationClickEvent(r)), (0, e.impression_track_element)({
110
+ element: i,
111
+ data: {
112
+ recommendation_id: r,
113
+ ...s(t)(this, k)[k]()
114
+ }
115
+ });
116
+ break;
117
+ case o.SearchResult:
118
+ i.addEventListener("click", () => this.sendSearchResultClickEvent(r)), (0, e.impression_track_element)({
119
+ element: i,
120
+ data: {
121
+ search_result_id: r,
122
+ ...s(t)(this, k)[k]()
123
+ }
124
+ });
125
+ break;
126
+ case o.ProductListingResult:
127
+ i.addEventListener("click", () => this.sendProductListingResultClickEvent(r)), (0, e.impression_track_element)({
128
+ element: i,
129
+ data: {
130
+ product_listing_result_id: r,
131
+ ...s(t)(this, k)[k]()
132
+ }
133
+ });
134
+ }
135
+ const d = i.querySelectorAll(c);
136
+ for (const e of d) this.trackAddToCartButton(e, i);
137
+ }
138
+ trackAddToCartButton(i, r) {
139
+ this.checkIfTracked(i) || i.addEventListener("click", () => {
140
+ if (!r) {
141
+ const r = s(t)(this, b)[b]();
142
+ return r ? void this.sendAddToCartEvent({
143
+ product_id: r
144
+ }) : void (0, e.derror)("No product ID set for add-to-cart click outside of product card", i);
145
+ }
146
+ for (const [e, t] of Object.entries(u)) {
147
+ const i = r.getAttribute(e);
148
+ if (!i) continue;
149
+ const s = {
150
+ [a[t]]: i
151
+ };
152
+ return void this.sendAddToCartEvent(s);
153
+ }
154
+ (0, e.derror)("Could not find tracking data for add-to-cart click on button", i);
155
+ });
156
+ }
157
+ sendAddToCartEvent(e) {
158
+ s(t)(this, g)[g]({
159
+ type: "add_to_cart",
160
+ ...e
161
+ });
162
+ }
163
+ sendRecommendationImpressionEvent(e) {
164
+ s(t)(this, g)[g]({
165
+ type: "element_visible",
166
+ recommendation_id: e
167
+ });
168
+ }
169
+ sendSearchResultImpressionEvent(e) {
170
+ s(t)(this, g)[g]({
171
+ type: "element_visible",
172
+ search_result_id: e
173
+ });
174
+ }
175
+ sendProductListingResultImpressionEvent(e) {
176
+ s(t)(this, g)[g]({
177
+ type: "element_visible",
178
+ product_listing_result_id: e
179
+ });
180
+ }
181
+ sendRecommendationClickEvent(i) {
182
+ (0, e.depict_click)({
183
+ recommendation_id: i,
184
+ ...s(t)(this, k)[k]()
185
+ });
186
+ }
187
+ sendSearchResultClickEvent(i) {
188
+ (0, e.depict_click)({
189
+ search_result_id: i,
190
+ ...s(t)(this, k)[k]()
191
+ });
192
+ }
193
+ sendProductListingResultClickEvent(i) {
194
+ (0, e.depict_click)({
195
+ product_listing_result_id: i,
196
+ ...s(t)(this, k)[k]()
197
+ });
198
+ }
199
+ sendPurchaseEvent(i) {
200
+ if (!this.market) throw Error("Market not set");
201
+ const {
202
+ dsid: r,
203
+ user_id: n,
204
+ session_id: o
205
+ } = s(t)(this, k)[k](),
206
+ d = i.items.map(e => ({
207
+ sku: e.item_id,
208
+ price: e.price,
209
+ quantity: e.quantity
210
+ })),
211
+ a = {
212
+ events: [{
213
+ event_type: "purchase",
214
+ dsid: r,
215
+ user_id: n,
216
+ session_id: o,
217
+ transaction_id: i.transaction_id,
218
+ currency: i.currency,
219
+ products: d
220
+ }],
221
+ tenant: this.merchant,
222
+ market: this.market
223
+ };
224
+ (0, e.foolproof_send_beacon)(process.env.BASE_URL + "/v2/create-events", a);
225
+ }
226
+ setMarket(e) {
227
+ this.market = e;
228
+ }
229
+ setProductId(i) {
230
+ (0, e.dlog)("Setting product id", i), this.latest_product_id = i, this.latest_product_id_path = location.pathname, s(t)(this, p)[p] || (s(t)(this, g)[g]({
231
+ type: "page_view",
232
+ product_id: i
233
+ }), s(t)(this, p)[p] = !0);
234
+ }
235
+ setUserId(t) {
236
+ (0, e.dlog)("Setting user id", t), this.latest_user_id = t || void 0;
237
+ }
238
+ setSessionId(t) {
239
+ (0, e.dlog)("Setting session id", t), this.latest_session_id = t || void 0;
240
+ }
241
+ observeRecommendations() {
242
+ for (const [t, i] of Object.entries(u)) {
243
+ const r = `[${t}]`;
244
+ (0, e.dlog)("Starting to observe product cards with selector", r), e.observer.onexists(r, ({
245
+ element: s
246
+ }) => {
247
+ const n = s.getAttribute(t);
248
+ n ? this.trackProductCard(s, n, i) : (0, e.derror)(`No tracking id found on element with attribute ${r}`, s);
249
+ });
250
+ }
251
+ }
252
+ observePDPA2CButton() {
253
+ e.observer.onexists(c, ({
254
+ element: t
255
+ }) => {
256
+ const i = Object.keys(u).map(e => `[${e}]`).join(","),
257
+ r = t.closest(i) || void 0;
258
+ (0, e.dlog)(`Found ${r ? "product card" : "pdp"} add-to-cart button`, t), this.trackAddToCartButton(t, r);
259
+ });
260
+ }
261
+ }
262
+ function w() {
263
+ let i = location.href;
264
+ e.instant_exec_on_suspect_history_change.add((0, e.catchify)(() => {
265
+ const {
266
+ href: e
267
+ } = location;
268
+ i !== e && (s(t)(this, p)[p] = !1, i = e);
269
+ }));
270
+ }
271
+ function R(e) {
272
+ void 0 !== e && (void 0 !== e.auto_observe && (this.auto_observe = e.auto_observe), void 0 !== e.market && (this.market = e.market));
273
+ }
274
+ function P() {
275
+ const t = {
276
+ market: this.market,
277
+ tenant: this.merchant,
278
+ user_id: this.latest_user_id,
279
+ session_id: this.latest_session_id
280
+ };
281
+ return {
282
+ ...(0, e.get_tracking_event_context_data)(),
283
+ ...t
284
+ };
285
+ }
286
+ function E(i) {
287
+ (0, e.send_depict_unfiltered)([{
288
+ ...i,
289
+ ...s(t)(this, k)[k]()
290
+ }], !0);
291
+ }
292
+ function S() {
293
+ if (this.latest_product_id_path === location.pathname) return this.latest_product_id;
294
+ }
295
+ (0, e.add_to_version_info)("dpc", n);