@epigraph/epigraph-std-lib 4.7.0-alpha → 4.7.1-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/EpigraphLibs/EpigraphAnalytics/epigraphAnalytics.cjs +2 -2
- package/dist/EpigraphLibs/EpigraphAnalytics/epigraphAnalytics.js +179 -227
- package/dist/EpigraphLibs/EpigraphAnalytics/epigraphAnalyticsEventLibrary.d.ts +83 -109
- package/dist/EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.cjs +1 -1
- package/dist/EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.d.ts +2 -1
- package/dist/EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.js +1 -1
- package/dist/epigraph-std-lib.cjs +1 -1
- package/dist/epigraph-std-lib.js +61 -54
- package/package.json +1 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
var c = /* @__PURE__ */ ((
|
|
2
|
-
const
|
|
1
|
+
var c = /* @__PURE__ */ ((i) => (i.UNAVAILABLE = "unavailable", i.AVAILABLE = "available", i.RESTRICTED = "restricted", i))(c || {});
|
|
2
|
+
const m = Symbol("data"), _ = Symbol("next"), L = class I {
|
|
3
3
|
constructor(t) {
|
|
4
|
-
this[
|
|
4
|
+
this[m] = t, this[_] = null;
|
|
5
5
|
}
|
|
6
6
|
get data() {
|
|
7
|
-
return this[
|
|
7
|
+
return this[m];
|
|
8
8
|
}
|
|
9
9
|
set next(t) {
|
|
10
|
-
if (!(t instanceof
|
|
10
|
+
if (!(t instanceof I) && t !== null)
|
|
11
11
|
throw new Error(
|
|
12
12
|
"This node is not an instance of the custom class 'Node'."
|
|
13
13
|
);
|
|
14
|
-
this[
|
|
14
|
+
this[_] = t;
|
|
15
15
|
}
|
|
16
16
|
get next() {
|
|
17
|
-
return this[
|
|
17
|
+
return this[_];
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
let E =
|
|
20
|
+
let E = L;
|
|
21
21
|
const p = Symbol("head");
|
|
22
|
-
class
|
|
22
|
+
class D {
|
|
23
23
|
constructor() {
|
|
24
24
|
this[p] = null;
|
|
25
25
|
}
|
|
@@ -44,23 +44,23 @@ class O {
|
|
|
44
44
|
return this.head = t.next, t.data;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
const
|
|
47
|
+
const f = Symbol("queue"), d = Symbol("size");
|
|
48
48
|
class N {
|
|
49
49
|
constructor() {
|
|
50
|
-
this[
|
|
50
|
+
this[f] = new D(), this[d] = 0;
|
|
51
51
|
}
|
|
52
52
|
get queue() {
|
|
53
|
-
return this[
|
|
53
|
+
return this[f];
|
|
54
54
|
}
|
|
55
55
|
get size() {
|
|
56
|
-
return this[
|
|
56
|
+
return this[d];
|
|
57
57
|
}
|
|
58
58
|
enqueue(t) {
|
|
59
|
-
this.queue.addToTail(t), this[
|
|
59
|
+
this.queue.addToTail(t), this[d]++;
|
|
60
60
|
}
|
|
61
61
|
dequeue() {
|
|
62
62
|
const t = this.queue.removeHead();
|
|
63
|
-
return this[
|
|
63
|
+
return this[d]--, t;
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
class u {
|
|
@@ -76,8 +76,8 @@ class u {
|
|
|
76
76
|
static {
|
|
77
77
|
this.ACTION_FAILED_INITIALIZATION = "initialization-failed";
|
|
78
78
|
}
|
|
79
|
-
constructor(t, e,
|
|
80
|
-
this._pluginName = t, this._trackingId = e, this._experienceId =
|
|
79
|
+
constructor(t, e, s, n, r, o) {
|
|
80
|
+
this._pluginName = t, this._trackingId = e, this._experienceId = s, this._solution = n, this._initializer = r, this._status = o;
|
|
81
81
|
}
|
|
82
82
|
updateStatus(t) {
|
|
83
83
|
this._status = t;
|
|
@@ -87,7 +87,7 @@ class u {
|
|
|
87
87
|
}
|
|
88
88
|
notify(t, e) {
|
|
89
89
|
console.log("Notifying", t, e);
|
|
90
|
-
const
|
|
90
|
+
const s = {
|
|
91
91
|
pluginName: this._pluginName,
|
|
92
92
|
trackingId: this._trackingId,
|
|
93
93
|
experienceId: this._experienceId,
|
|
@@ -97,17 +97,17 @@ class u {
|
|
|
97
97
|
action: t,
|
|
98
98
|
eventDetails: e
|
|
99
99
|
};
|
|
100
|
-
window.dispatchEvent(new CustomEvent("epg-notification", { detail:
|
|
100
|
+
window.dispatchEvent(new CustomEvent("epg-notification", { detail: s }));
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
-
class
|
|
103
|
+
class z {
|
|
104
104
|
constructor({
|
|
105
105
|
trackingID: t,
|
|
106
106
|
experienceID: e,
|
|
107
|
-
solution:
|
|
108
|
-
verboseLogging:
|
|
107
|
+
solution: s,
|
|
108
|
+
verboseLogging: n = !1
|
|
109
109
|
}) {
|
|
110
|
-
this.__status = c.UNAVAILABLE, this.__sentEventCount = 0, this.__initializationAttempts = 0, this.__lastInitializationAttempt = performance.now(), this.__maxInitializationAttempts = 10, this.__initializationRetryDelay = 2e3, this.__isInitialized = !1, this.__initializationMethod = "NONE", this.__nexusFailureReported = !1, this.name = this.pluginName = "GA4-PLUGIN", this.trackingID = t, this.experienceID = e, this.solution =
|
|
110
|
+
this.__status = c.UNAVAILABLE, this.__sentEventCount = 0, this.__initializationAttempts = 0, this.__lastInitializationAttempt = performance.now(), this.__maxInitializationAttempts = 10, this.__initializationRetryDelay = 2e3, this.__isInitialized = !1, this.__initializationMethod = "NONE", this.__nexusFailureReported = !1, this.name = this.pluginName = "GA4-PLUGIN", this.trackingID = t, this.experienceID = e, this.solution = s, this.verboseLogging = n, this.__queue = new N(), this.__epigraphNotifier = new u(
|
|
111
111
|
this.pluginName,
|
|
112
112
|
this.pluginName,
|
|
113
113
|
this.experienceID,
|
|
@@ -157,8 +157,8 @@ class S {
|
|
|
157
157
|
}
|
|
158
158
|
try {
|
|
159
159
|
await this.dequeueAndSendEvents();
|
|
160
|
-
} catch (
|
|
161
|
-
this.logger(
|
|
160
|
+
} catch (s) {
|
|
161
|
+
this.logger(s), await this.reportFailureToNexus("EVENT_SEND_ERROR", s?.toString() || "Unknown error");
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
initializePlugin() {
|
|
@@ -187,11 +187,11 @@ class S {
|
|
|
187
187
|
};
|
|
188
188
|
const e = this.findGA4Info(this.trackingID);
|
|
189
189
|
if (e) {
|
|
190
|
-
const
|
|
191
|
-
return this.logger(`GA4 script found, setting up with dataLayer: ${
|
|
190
|
+
const s = e.l || "dataLayer";
|
|
191
|
+
return this.logger(`GA4 script found, setting up with dataLayer: ${s}`), this.__epigraphNotifier.updateInitializer("GA4"), {
|
|
192
192
|
success: !0,
|
|
193
193
|
method: "GA4",
|
|
194
|
-
dataLayerName:
|
|
194
|
+
dataLayerName: s
|
|
195
195
|
};
|
|
196
196
|
}
|
|
197
197
|
return {
|
|
@@ -204,13 +204,13 @@ class S {
|
|
|
204
204
|
detectGTM() {
|
|
205
205
|
const t = document.querySelectorAll('script[src*="googletagmanager.com/gtm"]');
|
|
206
206
|
for (const e of Array.from(t)) {
|
|
207
|
-
const
|
|
208
|
-
if (
|
|
209
|
-
const
|
|
210
|
-
if (
|
|
211
|
-
const r =
|
|
207
|
+
const s = e.getAttribute("src");
|
|
208
|
+
if (s) {
|
|
209
|
+
const n = s.match(/gtm\.js\?id=([^&]+)/);
|
|
210
|
+
if (n && n.length > 0) {
|
|
211
|
+
const r = s.match(/&l=([^&]+)/), o = r ? r[1] : "dataLayer";
|
|
212
212
|
return {
|
|
213
|
-
containerId:
|
|
213
|
+
containerId: n[1],
|
|
214
214
|
dataLayerName: o
|
|
215
215
|
};
|
|
216
216
|
}
|
|
@@ -227,11 +227,11 @@ class S {
|
|
|
227
227
|
return;
|
|
228
228
|
let t = this.__queue.size;
|
|
229
229
|
for (let e = 0; e < t; e++) {
|
|
230
|
-
const
|
|
230
|
+
const s = this.__queue.dequeue();
|
|
231
231
|
try {
|
|
232
|
-
this.__initializationMethod === "GTM" ? (this.sendGTMEvent(
|
|
233
|
-
} catch (
|
|
234
|
-
this.logger(`Error sending event ${
|
|
232
|
+
this.__initializationMethod === "GTM" ? (this.sendGTMEvent(s), this.__sentEventCount++, this.logger(`Analytics event successfully sent via ${this.__initializationMethod}: ${s.eventName}`)) : this.__initializationMethod === "GA4" ? (this.sendGA4Event(s), this.__sentEventCount++, this.logger(`Analytics event successfully sent via ${this.__initializationMethod}: ${s.eventName}`)) : this.__queue.enqueue(s);
|
|
233
|
+
} catch (n) {
|
|
234
|
+
this.logger(`Error sending event ${s.eventName}: ${n}`), this.__queue.enqueue(s);
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
237
|
}
|
|
@@ -242,8 +242,8 @@ class S {
|
|
|
242
242
|
*/
|
|
243
243
|
async sendGTMEvent(t) {
|
|
244
244
|
let e = t.getGTMParameters(this.solution, this.experienceID, this.trackingID);
|
|
245
|
-
const
|
|
246
|
-
this.isValidPayload(e) || (e = await this.convertGTMParametersToEpgEventTag(t.eventName, e)), this.dataLayer && (this.dataLayer.push(e), this.__epigraphNotifier.notify(u.ACTION_SEND_EVENT,
|
|
245
|
+
const s = e;
|
|
246
|
+
this.isValidPayload(e) || (e = await this.convertGTMParametersToEpgEventTag(t.eventName, e)), this.dataLayer && (this.dataLayer.push(e), this.__epigraphNotifier.notify(u.ACTION_SEND_EVENT, s));
|
|
247
247
|
}
|
|
248
248
|
/**
|
|
249
249
|
* Send events to GA4 via Google Analytics 4.
|
|
@@ -252,8 +252,8 @@ class S {
|
|
|
252
252
|
*/
|
|
253
253
|
async sendGA4Event(t) {
|
|
254
254
|
let e = t.getGa4Parameters(this.solution, this.experienceID, this.trackingID);
|
|
255
|
-
const
|
|
256
|
-
this.isValidPayload(e) || (e = await this.convertGA4ParametersToEpgEventTag(e)), window.gtag("event", t.eventName, e), this.__epigraphNotifier.notify(u.ACTION_SEND_EVENT,
|
|
255
|
+
const s = e;
|
|
256
|
+
this.isValidPayload(e) || (e = await this.convertGA4ParametersToEpgEventTag(e)), window.gtag("event", t.eventName, e), this.__epigraphNotifier.notify(u.ACTION_SEND_EVENT, s);
|
|
257
257
|
}
|
|
258
258
|
/**
|
|
259
259
|
* Validates a payload by checking its parameter count and the constraints of parameter names and values.
|
|
@@ -266,8 +266,8 @@ class S {
|
|
|
266
266
|
isValidPayload(t) {
|
|
267
267
|
if (Object.keys(t).length >= 25)
|
|
268
268
|
return !1;
|
|
269
|
-
for (const [
|
|
270
|
-
if (
|
|
269
|
+
for (const [n, r] of Object.entries(t))
|
|
270
|
+
if (n !== "items" && (n.length > 40 || String(r).length > 100))
|
|
271
271
|
return !1;
|
|
272
272
|
return !0;
|
|
273
273
|
}
|
|
@@ -281,10 +281,10 @@ class S {
|
|
|
281
281
|
*/
|
|
282
282
|
async convertGTMParametersToEpgEventTag(t, e) {
|
|
283
283
|
try {
|
|
284
|
-
let
|
|
284
|
+
let s = await this.sendGA4LongParameters(e);
|
|
285
285
|
return {
|
|
286
286
|
event: t,
|
|
287
|
-
epg_event_tag:
|
|
287
|
+
epg_event_tag: s,
|
|
288
288
|
send_to: this.trackingID
|
|
289
289
|
};
|
|
290
290
|
} catch {
|
|
@@ -315,25 +315,25 @@ class S {
|
|
|
315
315
|
this.verboseLogging && console.warn(t);
|
|
316
316
|
}
|
|
317
317
|
async sendGA4LongParameters(t) {
|
|
318
|
-
const e = "https://api.myepigraph.com/api/analytics/ga4/custom",
|
|
318
|
+
const e = "https://api.myepigraph.com/api/analytics/ga4/custom", s = { parameters: t };
|
|
319
319
|
try {
|
|
320
|
-
const
|
|
320
|
+
const n = await fetch(e, {
|
|
321
321
|
method: "POST",
|
|
322
322
|
// Assuming it's a POST request, adjust if necessary
|
|
323
323
|
headers: {
|
|
324
324
|
"Content-Type": "application/json",
|
|
325
325
|
Accept: "application/json"
|
|
326
326
|
},
|
|
327
|
-
body: JSON.stringify(
|
|
327
|
+
body: JSON.stringify(s)
|
|
328
328
|
});
|
|
329
|
-
return
|
|
329
|
+
return n.ok ? (await n.json())?.id ?? "" : "";
|
|
330
330
|
} catch {
|
|
331
331
|
return "";
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
334
|
async reportFailureToNexus(t, e) {
|
|
335
335
|
try {
|
|
336
|
-
const
|
|
336
|
+
const s = {
|
|
337
337
|
plugin: "GA4",
|
|
338
338
|
trackingId: this.trackingID,
|
|
339
339
|
solution: this.solution,
|
|
@@ -344,26 +344,26 @@ class S {
|
|
|
344
344
|
url: window.location.href,
|
|
345
345
|
userAgent: navigator.userAgent
|
|
346
346
|
};
|
|
347
|
-
this.logger(`Failure reported to Nexus: ${JSON.stringify(
|
|
348
|
-
} catch (
|
|
349
|
-
this.logger(`Error reporting failure to Nexus: ${
|
|
347
|
+
this.logger(`Failure reported to Nexus: ${JSON.stringify(s)}`);
|
|
348
|
+
} catch (s) {
|
|
349
|
+
this.logger(`Error reporting failure to Nexus: ${s}`);
|
|
350
350
|
}
|
|
351
351
|
}
|
|
352
352
|
findGA4Info(t) {
|
|
353
353
|
if (window.google_tag_manager && window.google_tag_manager[t]) {
|
|
354
|
-
const
|
|
355
|
-
if (
|
|
354
|
+
const s = window.google_tag_manager[t];
|
|
355
|
+
if (s && s.dataLayerName)
|
|
356
356
|
return {
|
|
357
357
|
fullSrc: "",
|
|
358
358
|
id: t,
|
|
359
|
-
l:
|
|
359
|
+
l: s.dataLayerName
|
|
360
360
|
};
|
|
361
361
|
}
|
|
362
362
|
const e = document.querySelectorAll("script[src]");
|
|
363
|
-
for (const
|
|
364
|
-
const
|
|
365
|
-
if (
|
|
366
|
-
const r = new URL(
|
|
363
|
+
for (const s of e) {
|
|
364
|
+
const n = s.getAttribute("src");
|
|
365
|
+
if (n && n.includes(t)) {
|
|
366
|
+
const r = new URL(n, location.href), o = Object.fromEntries(r.searchParams.entries());
|
|
367
367
|
return {
|
|
368
368
|
fullSrc: r.href,
|
|
369
369
|
id: o.id || void 0,
|
|
@@ -374,17 +374,17 @@ class S {
|
|
|
374
374
|
return null;
|
|
375
375
|
}
|
|
376
376
|
}
|
|
377
|
-
class
|
|
377
|
+
class T {
|
|
378
378
|
constructor({
|
|
379
379
|
trackingID: t,
|
|
380
380
|
experienceID: e,
|
|
381
|
-
solution:
|
|
382
|
-
sessionId:
|
|
381
|
+
solution: s,
|
|
382
|
+
sessionId: n,
|
|
383
383
|
xPath: r,
|
|
384
384
|
verboseLogging: o = !1,
|
|
385
|
-
sendToStaging:
|
|
385
|
+
sendToStaging: x = !1
|
|
386
386
|
}) {
|
|
387
|
-
this.__status = c.UNAVAILABLE, this.__sentEventCount = 0, this.sessionId =
|
|
387
|
+
this.__status = c.UNAVAILABLE, this.__sentEventCount = 0, this.sessionId = n, this.xPath = r, this.name = this.pluginName = "NEXUS-PLUGIN", this.trackingID = t, this.experienceID = e, this.solution = s, this.verboseLogging = o, this.__queue = new N(), this.url = x ? "https://nexus.epigraph.dev/api/analytics/event" : "https://api.myepigraph.com/api/analytics/event", this.__status = c.AVAILABLE, this.__epigraphNotifier = new u(
|
|
388
388
|
this.pluginName,
|
|
389
389
|
this.trackingID,
|
|
390
390
|
this.experienceID,
|
|
@@ -422,7 +422,7 @@ class L {
|
|
|
422
422
|
}
|
|
423
423
|
async dequeueAndSendEvents() {
|
|
424
424
|
for (let t = 0; t < this.__queue.size; t++) {
|
|
425
|
-
const e = this.__queue.dequeue(),
|
|
425
|
+
const e = this.__queue.dequeue(), s = {
|
|
426
426
|
send_to: this.trackingID,
|
|
427
427
|
experience_id: this.experienceID,
|
|
428
428
|
solution: this.solution,
|
|
@@ -440,8 +440,8 @@ class L {
|
|
|
440
440
|
"EPG-XPATH": this.xPath,
|
|
441
441
|
Origin: typeof window < "u" ? window.location.origin : ""
|
|
442
442
|
},
|
|
443
|
-
body: JSON.stringify(
|
|
444
|
-
})).ok && this.__epigraphNotifier.notify(u.ACTION_SEND_EVENT,
|
|
443
|
+
body: JSON.stringify(s)
|
|
444
|
+
})).ok && this.__epigraphNotifier.notify(u.ACTION_SEND_EVENT, s), "";
|
|
445
445
|
} catch {
|
|
446
446
|
return "";
|
|
447
447
|
}
|
|
@@ -450,7 +450,7 @@ class L {
|
|
|
450
450
|
return "";
|
|
451
451
|
}
|
|
452
452
|
}
|
|
453
|
-
class
|
|
453
|
+
class P {
|
|
454
454
|
constructor(t) {
|
|
455
455
|
this.consentSet = !1, this.consent = !1, this.pluginName = "OneTrustConsentPlugin", this.consentIdentifier = t, this.consent = !1, this.addConsentChangedListener();
|
|
456
456
|
}
|
|
@@ -462,8 +462,8 @@ class C {
|
|
|
462
462
|
return this.consent;
|
|
463
463
|
if (window.OnetrustActiveGroups !== void 0) {
|
|
464
464
|
let t = window.OnetrustActiveGroups;
|
|
465
|
-
t !== void 0 && t.split(",").forEach((
|
|
466
|
-
|
|
465
|
+
t !== void 0 && t.split(",").forEach((s) => {
|
|
466
|
+
s === this.consentIdentifier && (this.consent = !0, this.consentSet = !0);
|
|
467
467
|
});
|
|
468
468
|
}
|
|
469
469
|
return this.consent;
|
|
@@ -476,33 +476,33 @@ class C {
|
|
|
476
476
|
});
|
|
477
477
|
}
|
|
478
478
|
}
|
|
479
|
-
var
|
|
479
|
+
var y = /* @__PURE__ */ ((i) => (i.OneTrust = "onetrust", i))(y || {});
|
|
480
480
|
class a {
|
|
481
481
|
constructor({
|
|
482
482
|
eventName: t,
|
|
483
483
|
interactiveEvent: e,
|
|
484
|
-
customParameters:
|
|
484
|
+
customParameters: s
|
|
485
485
|
}) {
|
|
486
|
-
this.eventName = t, this.interactiveEvent = e, this.customParameters =
|
|
486
|
+
this.eventName = t, this.interactiveEvent = e, this.customParameters = s;
|
|
487
487
|
}
|
|
488
|
-
getGa4Parameters(t, e,
|
|
489
|
-
let
|
|
488
|
+
getGa4Parameters(t, e, s) {
|
|
489
|
+
let n = {
|
|
490
490
|
solution: t,
|
|
491
491
|
experience_id: e,
|
|
492
492
|
interactive_event: this.interactiveEvent,
|
|
493
|
-
send_to:
|
|
493
|
+
send_to: s
|
|
494
494
|
};
|
|
495
|
-
return
|
|
495
|
+
return n = Object.assign(n, JSON.parse(JSON.stringify(this.customParameters))), n;
|
|
496
496
|
}
|
|
497
|
-
getGTMParameters(t, e,
|
|
498
|
-
let
|
|
497
|
+
getGTMParameters(t, e, s) {
|
|
498
|
+
let n = {
|
|
499
499
|
solution: t,
|
|
500
500
|
experience_id: e,
|
|
501
501
|
event: this.eventName,
|
|
502
502
|
interactive_event: this.interactiveEvent,
|
|
503
|
-
send_to:
|
|
503
|
+
send_to: s
|
|
504
504
|
};
|
|
505
|
-
return
|
|
505
|
+
return n = Object.assign(n, JSON.parse(JSON.stringify(this.customParameters))), n;
|
|
506
506
|
}
|
|
507
507
|
getNexusParameters() {
|
|
508
508
|
let t = {
|
|
@@ -511,31 +511,8 @@ class a {
|
|
|
511
511
|
return t = Object.assign(t, JSON.parse(JSON.stringify(this.customParameters))), t;
|
|
512
512
|
}
|
|
513
513
|
}
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
QR: "qr",
|
|
517
|
-
INFO: "info",
|
|
518
|
-
DOWNLOAD: "download",
|
|
519
|
-
PREVIEW_CART: "preview_cart",
|
|
520
|
-
HOTSPOT_PANEL: "hotspot_panel",
|
|
521
|
-
SHARE_MODAL: "share_modal",
|
|
522
|
-
RESTART_MODAL: "restart_modal",
|
|
523
|
-
REMOVE_MODAL: "remove_modal",
|
|
524
|
-
LOAD_PRECONFIG_MODAL: "load_preconfig_modal",
|
|
525
|
-
MOVE_MODAL: "move_modal",
|
|
526
|
-
OUT_OF_STOCK_MODAL: "out_of_stock_modal"
|
|
527
|
-
}, T = {
|
|
528
|
-
AUTO: "auto",
|
|
529
|
-
BUTTON: "button",
|
|
530
|
-
HOTSPOT: "hotspot",
|
|
531
|
-
GESTURE: "gesture"
|
|
532
|
-
}, l = {
|
|
533
|
-
USD: "USD",
|
|
534
|
-
EUR: "EUR",
|
|
535
|
-
GBP: "GBP",
|
|
536
|
-
CAD: "CAD"
|
|
537
|
-
};
|
|
538
|
-
class w extends a {
|
|
514
|
+
var g = /* @__PURE__ */ ((i) => (i.AR = "ar", i.QR = "qr", i.INFO = "info", i.DOWNLOAD = "download", i.PREVIEW_CART = "preview_cart", i.HOTSPOT_PANEL = "hotspot_panel", i.SHARE_MODAL = "share_modal", i.RESTART_MODAL = "restart_modal", i.REMOVE_MODAL = "remove_modal", i.LOAD_PRECONFIG_MODAL = "load_preconfig_modal", i.MOVE_MODAL = "move_modal", i.OUT_OF_STOCK_MODAL = "out_of_stock_modal", i))(g || {}), v = /* @__PURE__ */ ((i) => (i.AUTO = "auto", i.BUTTON = "button", i.HOTSPOT = "hotspot", i.GESTURE = "gesture", i))(v || {}), l = /* @__PURE__ */ ((i) => (i.USD = "USD", i.EUR = "EUR", i.GBP = "GBP", i.CAD = "CAD", i))(l || {}), A = /* @__PURE__ */ ((i) => (i.AR = "ar", i.QR = "qr", i.WEBGL2 = "webgl2", i))(A || {}), S = /* @__PURE__ */ ((i) => (i.AR_VIEW = "ar_view", i.DIMENSION_SHOW = "dimension_show", i.DIMENSION_HIDE = "dimension_hide", i.HOTSPOTS_SHOW = "hotspots_show", i.HOTSPOTS_HIDE = "hotspots_hide", i.HELP_SHOW = "help_show", i.HELP_HIDE = "help_hide", i.HOTSPOT_ENTER = "hotspot_enter", i.HOTSPOT_EXIT = "hotspot_exit", i.SHARE = "share", i.PDF_DOWNLOAD = "pdf_download", i.COPY = "copy", i.RESTART = "restart", i.INSTRUCTIONS_SHOW = "show_instructions", i.REVIEW_CART = "review_cart", i.SHOP_NOW = "shop_now", i.SUB_CATEGORY = "sub_category", i.NEXT_STEP = "next_step", i.PREVIOUS_STEP = "previous_step", i))(S || {}), C = /* @__PURE__ */ ((i) => (i.ZOOM = "zoom", i.ROTATE = "rotate", i))(C || {}), O = /* @__PURE__ */ ((i) => (i.ROTATE = "rotate", i.ZOOM = "zoom", i.PAN = "pan", i))(O || {});
|
|
515
|
+
class R extends a {
|
|
539
516
|
constructor(t) {
|
|
540
517
|
super({
|
|
541
518
|
eventName: "epigraph_ar_requested",
|
|
@@ -546,7 +523,7 @@ class w extends a {
|
|
|
546
523
|
});
|
|
547
524
|
}
|
|
548
525
|
}
|
|
549
|
-
class
|
|
526
|
+
class q extends a {
|
|
550
527
|
constructor(t) {
|
|
551
528
|
super({
|
|
552
529
|
eventName: "epigraph_module_loading",
|
|
@@ -557,7 +534,7 @@ class R extends a {
|
|
|
557
534
|
});
|
|
558
535
|
}
|
|
559
536
|
}
|
|
560
|
-
class
|
|
537
|
+
class M extends a {
|
|
561
538
|
constructor(t, e) {
|
|
562
539
|
super({
|
|
563
540
|
eventName: "epigraph_module_ready",
|
|
@@ -569,20 +546,20 @@ class x extends a {
|
|
|
569
546
|
});
|
|
570
547
|
}
|
|
571
548
|
}
|
|
572
|
-
class
|
|
573
|
-
constructor(t, e,
|
|
549
|
+
class G extends a {
|
|
550
|
+
constructor(t, e, s) {
|
|
574
551
|
super({
|
|
575
552
|
eventName: "epigraph_module_failed",
|
|
576
553
|
interactiveEvent: !1,
|
|
577
554
|
customParameters: {
|
|
578
555
|
is_pre_config: t,
|
|
579
556
|
load_time_ms: e,
|
|
580
|
-
error_type:
|
|
557
|
+
error_type: s
|
|
581
558
|
}
|
|
582
559
|
});
|
|
583
560
|
}
|
|
584
561
|
}
|
|
585
|
-
class
|
|
562
|
+
class b extends a {
|
|
586
563
|
constructor(t) {
|
|
587
564
|
super({
|
|
588
565
|
eventName: "epigraph_module_closed",
|
|
@@ -593,13 +570,9 @@ class z extends a {
|
|
|
593
570
|
});
|
|
594
571
|
}
|
|
595
572
|
}
|
|
596
|
-
class
|
|
573
|
+
class k extends a {
|
|
597
574
|
static {
|
|
598
|
-
this.SUPPORT_TYPE =
|
|
599
|
-
AR: "ar",
|
|
600
|
-
QR: "qr",
|
|
601
|
-
WEBGL2: "webgl2"
|
|
602
|
-
};
|
|
575
|
+
this.SUPPORT_TYPE = A;
|
|
603
576
|
}
|
|
604
577
|
constructor(t, e = {}) {
|
|
605
578
|
super({
|
|
@@ -612,30 +585,9 @@ class G extends a {
|
|
|
612
585
|
});
|
|
613
586
|
}
|
|
614
587
|
}
|
|
615
|
-
class
|
|
588
|
+
class V extends a {
|
|
616
589
|
static {
|
|
617
|
-
this.BUTTON_TYPE =
|
|
618
|
-
AR_VIEW: "ar_view",
|
|
619
|
-
DIMENSION_SHOW: "dimension_show",
|
|
620
|
-
DIMENSION_HIDE: "dimension_hide",
|
|
621
|
-
HOTSPOTS_SHOW: "hotspots_show",
|
|
622
|
-
HOTSPOTS_HIDE: "hotspots_hide",
|
|
623
|
-
HELP_SHOW: "help_show",
|
|
624
|
-
HELP_HIDE: "help_hide",
|
|
625
|
-
HOTSPOT_ENTER: "hotspot_enter",
|
|
626
|
-
HOTSPOT_EXIT: "hotspot_exit",
|
|
627
|
-
SHARE: "share",
|
|
628
|
-
PDF_DOWNLOAD: "pdf_download",
|
|
629
|
-
COPY: "copy",
|
|
630
|
-
RESTART: "restart",
|
|
631
|
-
INSTRUCTIONS_SHOW: "show_instructions",
|
|
632
|
-
REVIEW_CART: "review_cart",
|
|
633
|
-
// Need these?
|
|
634
|
-
SHOP_NOW: "shop_now",
|
|
635
|
-
SUB_CATEGORY: "sub_category",
|
|
636
|
-
NEXT_STEP: "next_step",
|
|
637
|
-
PREVIOUS_STEP: "previous_step"
|
|
638
|
-
};
|
|
590
|
+
this.BUTTON_TYPE = S;
|
|
639
591
|
}
|
|
640
592
|
constructor(t, e) {
|
|
641
593
|
super({
|
|
@@ -648,45 +600,45 @@ class M extends a {
|
|
|
648
600
|
});
|
|
649
601
|
}
|
|
650
602
|
}
|
|
651
|
-
class
|
|
603
|
+
class $ extends a {
|
|
652
604
|
static {
|
|
653
|
-
this.PANEL_TYPE =
|
|
605
|
+
this.PANEL_TYPE = g;
|
|
654
606
|
}
|
|
655
607
|
static {
|
|
656
|
-
this.TRIGGER_SOURCE =
|
|
608
|
+
this.TRIGGER_SOURCE = v;
|
|
657
609
|
}
|
|
658
|
-
constructor(t, e,
|
|
610
|
+
constructor(t, e, s, n) {
|
|
659
611
|
super({
|
|
660
612
|
eventName: "epigraph_panel_opened",
|
|
661
613
|
interactiveEvent: t,
|
|
662
614
|
customParameters: {
|
|
663
|
-
items:
|
|
615
|
+
items: n,
|
|
664
616
|
panel_type: e,
|
|
665
|
-
trigger_source:
|
|
617
|
+
trigger_source: s
|
|
666
618
|
}
|
|
667
619
|
});
|
|
668
620
|
}
|
|
669
621
|
}
|
|
670
|
-
class
|
|
622
|
+
class H extends a {
|
|
671
623
|
static {
|
|
672
|
-
this.PANEL_TYPE =
|
|
624
|
+
this.PANEL_TYPE = g;
|
|
673
625
|
}
|
|
674
626
|
static {
|
|
675
|
-
this.TRIGGER_SOURCE =
|
|
627
|
+
this.TRIGGER_SOURCE = v;
|
|
676
628
|
}
|
|
677
|
-
constructor(t, e,
|
|
629
|
+
constructor(t, e, s, n) {
|
|
678
630
|
super({
|
|
679
631
|
eventName: "epigraph_panel_closed",
|
|
680
632
|
interactiveEvent: t,
|
|
681
633
|
customParameters: {
|
|
682
|
-
items:
|
|
634
|
+
items: n,
|
|
683
635
|
panel_type: e,
|
|
684
|
-
trigger_source:
|
|
636
|
+
trigger_source: s
|
|
685
637
|
}
|
|
686
638
|
});
|
|
687
639
|
}
|
|
688
640
|
}
|
|
689
|
-
class
|
|
641
|
+
class F extends a {
|
|
690
642
|
constructor(t) {
|
|
691
643
|
super({
|
|
692
644
|
eventName: "epigraph_add_to_favourites",
|
|
@@ -697,12 +649,9 @@ class U extends a {
|
|
|
697
649
|
});
|
|
698
650
|
}
|
|
699
651
|
}
|
|
700
|
-
class
|
|
652
|
+
class j extends a {
|
|
701
653
|
static {
|
|
702
|
-
this.ACTION_PERFORMED =
|
|
703
|
-
ZOOM: "zoom",
|
|
704
|
-
ROTATE: "rotate"
|
|
705
|
-
};
|
|
654
|
+
this.ACTION_PERFORMED = C;
|
|
706
655
|
}
|
|
707
656
|
constructor(t) {
|
|
708
657
|
super({
|
|
@@ -714,13 +663,9 @@ class k extends a {
|
|
|
714
663
|
});
|
|
715
664
|
}
|
|
716
665
|
}
|
|
717
|
-
class
|
|
666
|
+
class W extends a {
|
|
718
667
|
static {
|
|
719
|
-
this.INTERACTION_TYPE =
|
|
720
|
-
ROTATE: "rotate",
|
|
721
|
-
ZOOM: "zoom",
|
|
722
|
-
PAN: "pan"
|
|
723
|
-
};
|
|
668
|
+
this.INTERACTION_TYPE = O;
|
|
724
669
|
}
|
|
725
670
|
constructor(t) {
|
|
726
671
|
super({
|
|
@@ -732,24 +677,24 @@ class V extends a {
|
|
|
732
677
|
});
|
|
733
678
|
}
|
|
734
679
|
}
|
|
735
|
-
class
|
|
680
|
+
class J extends a {
|
|
736
681
|
static {
|
|
737
682
|
this.CURRENCY = l;
|
|
738
683
|
}
|
|
739
|
-
constructor(t, e,
|
|
684
|
+
constructor(t, e, s, n, r) {
|
|
740
685
|
super({
|
|
741
686
|
eventName: "epigraph_item_added",
|
|
742
687
|
interactiveEvent: t,
|
|
743
688
|
customParameters: {
|
|
744
689
|
items: r,
|
|
745
690
|
value: e,
|
|
746
|
-
currency:
|
|
747
|
-
quantity:
|
|
691
|
+
currency: s,
|
|
692
|
+
quantity: n
|
|
748
693
|
}
|
|
749
694
|
});
|
|
750
695
|
}
|
|
751
696
|
}
|
|
752
|
-
class
|
|
697
|
+
class Z extends a {
|
|
753
698
|
constructor(t) {
|
|
754
699
|
super({
|
|
755
700
|
eventName: "epigraph_item_moved",
|
|
@@ -760,24 +705,24 @@ class H extends a {
|
|
|
760
705
|
});
|
|
761
706
|
}
|
|
762
707
|
}
|
|
763
|
-
class
|
|
708
|
+
class U extends a {
|
|
764
709
|
static {
|
|
765
710
|
this.CURRENCY = l;
|
|
766
711
|
}
|
|
767
|
-
constructor(t, e,
|
|
712
|
+
constructor(t, e, s, n) {
|
|
768
713
|
super({
|
|
769
714
|
eventName: "epigraph_item_removed",
|
|
770
715
|
interactiveEvent: !0,
|
|
771
716
|
customParameters: {
|
|
772
|
-
items:
|
|
717
|
+
items: n,
|
|
773
718
|
value: t,
|
|
774
719
|
currency: e,
|
|
775
|
-
quantity:
|
|
720
|
+
quantity: s
|
|
776
721
|
}
|
|
777
722
|
});
|
|
778
723
|
}
|
|
779
724
|
}
|
|
780
|
-
class
|
|
725
|
+
class X extends a {
|
|
781
726
|
constructor(t, e) {
|
|
782
727
|
super({
|
|
783
728
|
eventName: "epigraph_variant_changed",
|
|
@@ -789,52 +734,52 @@ class B extends a {
|
|
|
789
734
|
});
|
|
790
735
|
}
|
|
791
736
|
}
|
|
792
|
-
class
|
|
793
|
-
constructor(t, e,
|
|
737
|
+
class K extends a {
|
|
738
|
+
constructor(t, e, s) {
|
|
794
739
|
super({
|
|
795
740
|
eventName: "epigraph_content_shared",
|
|
796
741
|
interactiveEvent: !0,
|
|
797
742
|
customParameters: {
|
|
798
|
-
items:
|
|
743
|
+
items: s,
|
|
799
744
|
content_type: t,
|
|
800
745
|
share_destination: e
|
|
801
746
|
}
|
|
802
747
|
});
|
|
803
748
|
}
|
|
804
749
|
}
|
|
805
|
-
class
|
|
750
|
+
class Q extends a {
|
|
806
751
|
static {
|
|
807
752
|
this.CURRENCY = l;
|
|
808
753
|
}
|
|
809
|
-
constructor(t, e,
|
|
754
|
+
constructor(t, e, s) {
|
|
810
755
|
super({
|
|
811
756
|
eventName: "epigraph_checkout",
|
|
812
757
|
interactiveEvent: !0,
|
|
813
758
|
customParameters: {
|
|
814
|
-
items:
|
|
759
|
+
items: s,
|
|
815
760
|
value: t,
|
|
816
761
|
currency: e
|
|
817
762
|
}
|
|
818
763
|
});
|
|
819
764
|
}
|
|
820
765
|
}
|
|
821
|
-
class
|
|
766
|
+
class B extends a {
|
|
822
767
|
static {
|
|
823
768
|
this.CURRENCY = l;
|
|
824
769
|
}
|
|
825
|
-
constructor(t, e,
|
|
770
|
+
constructor(t, e, s) {
|
|
826
771
|
super({
|
|
827
772
|
eventName: "epigraph_conversion",
|
|
828
773
|
interactiveEvent: !0,
|
|
829
774
|
customParameters: {
|
|
830
|
-
items:
|
|
775
|
+
items: s,
|
|
831
776
|
value: t,
|
|
832
777
|
currency: e
|
|
833
778
|
}
|
|
834
779
|
});
|
|
835
780
|
}
|
|
836
781
|
}
|
|
837
|
-
class
|
|
782
|
+
class Y extends a {
|
|
838
783
|
constructor(t) {
|
|
839
784
|
super({
|
|
840
785
|
eventName: "epigraph_changeRate",
|
|
@@ -845,7 +790,7 @@ class J extends a {
|
|
|
845
790
|
});
|
|
846
791
|
}
|
|
847
792
|
}
|
|
848
|
-
class
|
|
793
|
+
class tt extends a {
|
|
849
794
|
constructor(t) {
|
|
850
795
|
super({
|
|
851
796
|
eventName: "epigraph_completionRate",
|
|
@@ -856,7 +801,7 @@ class Z extends a {
|
|
|
856
801
|
});
|
|
857
802
|
}
|
|
858
803
|
}
|
|
859
|
-
class
|
|
804
|
+
class et extends a {
|
|
860
805
|
constructor(t) {
|
|
861
806
|
super({
|
|
862
807
|
eventName: "epigraph_engagementRate",
|
|
@@ -867,12 +812,12 @@ class X extends a {
|
|
|
867
812
|
});
|
|
868
813
|
}
|
|
869
814
|
}
|
|
870
|
-
class
|
|
871
|
-
constructor(t, e,
|
|
815
|
+
class it extends a {
|
|
816
|
+
constructor(t, e, s) {
|
|
872
817
|
super({
|
|
873
818
|
eventName: t,
|
|
874
819
|
interactiveEvent: e,
|
|
875
|
-
customParameters:
|
|
820
|
+
customParameters: s
|
|
876
821
|
});
|
|
877
822
|
}
|
|
878
823
|
}
|
|
@@ -892,18 +837,18 @@ class K extends a {
|
|
|
892
837
|
* See the License for the specific language governing permissions and
|
|
893
838
|
* limitations under the License.
|
|
894
839
|
*/
|
|
895
|
-
var
|
|
840
|
+
var w;
|
|
896
841
|
const h = Symbol("analyticsPluginsMap");
|
|
897
|
-
|
|
898
|
-
class
|
|
842
|
+
w = h;
|
|
843
|
+
class st {
|
|
899
844
|
constructor(t, e) {
|
|
900
|
-
this[
|
|
845
|
+
this[w] = /* @__PURE__ */ new Map(), this.__consentPlugin = null, t && e && (this.__consentPlugin = this.buildConsentPlugin(t, e)), window.addEventListener("epigraphAnalyticsConsentChange", this.__onConsentChangeFromEvent);
|
|
901
846
|
}
|
|
902
847
|
__onConsentChangeFromEvent(t) {
|
|
903
848
|
let e = t;
|
|
904
849
|
this.__overrideConsent = e.detail.hasConsent;
|
|
905
|
-
for (const
|
|
906
|
-
this.__hasConsent() ||
|
|
850
|
+
for (const s of this[h].values())
|
|
851
|
+
this.__hasConsent() || s.setStatus(c.RESTRICTED);
|
|
907
852
|
}
|
|
908
853
|
/**
|
|
909
854
|
* Epigraph Analytics uses plugins to send events to multiple trackers at a time. You can create a customer tracker
|
|
@@ -945,36 +890,43 @@ class Q {
|
|
|
945
890
|
* @private
|
|
946
891
|
*/
|
|
947
892
|
buildConsentPlugin(t, e) {
|
|
948
|
-
return t.toLowerCase() ===
|
|
893
|
+
return t.toLowerCase() === y.OneTrust.toLowerCase() ? new P(e) : null;
|
|
949
894
|
}
|
|
950
895
|
}
|
|
951
896
|
export {
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
q as
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
897
|
+
C as ACTION_PERFORMED,
|
|
898
|
+
S as BUTTON_TYPE,
|
|
899
|
+
l as CURRENCY,
|
|
900
|
+
y as ConsentPluginNames,
|
|
901
|
+
F as EpigraphAddToFavouritesEvent,
|
|
902
|
+
st as EpigraphAnalytics,
|
|
903
|
+
R as EpigraphArRequestedEvent,
|
|
904
|
+
V as EpigraphButtonClickEvent,
|
|
905
|
+
Y as EpigraphChangeRateEvent,
|
|
906
|
+
Q as EpigraphCheckoutEvent,
|
|
907
|
+
tt as EpigraphCompletionRateEvent,
|
|
908
|
+
K as EpigraphContentSharedEvent,
|
|
909
|
+
B as EpigraphConversionEvent,
|
|
910
|
+
it as EpigraphCustomEvent,
|
|
911
|
+
et as EpigraphEngagementRateEvent,
|
|
912
|
+
J as EpigraphItemAddedEvent,
|
|
913
|
+
Z as EpigraphItemMovedEvent,
|
|
914
|
+
U as EpigraphItemRemovedEvent,
|
|
915
|
+
j as EpigraphKeyboardInteractionEvent,
|
|
916
|
+
b as EpigraphModuleClosedEvent,
|
|
917
|
+
G as EpigraphModuleFailedEvent,
|
|
918
|
+
q as EpigraphModuleLoadingEvent,
|
|
919
|
+
M as EpigraphModuleReadyEvent,
|
|
920
|
+
H as EpigraphPanelClosedEvent,
|
|
921
|
+
$ as EpigraphPanelOpenedEvent,
|
|
922
|
+
k as EpigraphSupportDetectedEvent,
|
|
923
|
+
W as EpigraphTouchInteractionEvent,
|
|
924
|
+
X as EpigraphVariantChangedEvent,
|
|
925
|
+
z as GA4AnalyticsPlugin,
|
|
926
|
+
O as INTERACTION_TYPE,
|
|
927
|
+
T as NexusAnalyticsPlugin,
|
|
928
|
+
P as OneTrustConsentPlugin,
|
|
929
|
+
g as PANEL_TYPE,
|
|
930
|
+
A as SUPPORT_TYPE,
|
|
931
|
+
v as TRIGGER_SOURCE
|
|
980
932
|
};
|