@epigraph/epigraph-std-lib 4.5.5-alpha → 4.7.0-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/README.md +68 -68
- package/dist/EpigraphLibs/EpigraphAnalytics/epigraphAnalytics.cjs +2 -2
- package/dist/EpigraphLibs/EpigraphAnalytics/epigraphAnalytics.js +445 -301
- package/dist/EpigraphLibs/EpigraphAnalytics/epigraphAnalyticsEventLibrary.d.ts +114 -15
- package/dist/EpigraphLibs/EpigraphAnalytics/generics/epigraph-notifier.d.ts +17 -0
- package/dist/EpigraphLibs/EpigraphAnalytics/plugins/ga4-analytics-plugin.d.ts +1 -0
- package/dist/EpigraphLibs/EpigraphAnalytics/plugins/nexus-analytics-plugin.d.ts +1 -0
- package/package.json +41 -41
|
@@ -1,82 +1,126 @@
|
|
|
1
|
-
var
|
|
2
|
-
const
|
|
3
|
-
constructor(
|
|
4
|
-
this[
|
|
1
|
+
var c = /* @__PURE__ */ ((n) => (n.UNAVAILABLE = "unavailable", n.AVAILABLE = "available", n.RESTRICTED = "restricted", n))(c || {});
|
|
2
|
+
const g = Symbol("data"), d = Symbol("next"), P = class v {
|
|
3
|
+
constructor(t) {
|
|
4
|
+
this[g] = t, this[d] = null;
|
|
5
5
|
}
|
|
6
6
|
get data() {
|
|
7
|
-
return this[
|
|
7
|
+
return this[g];
|
|
8
8
|
}
|
|
9
|
-
set next(
|
|
10
|
-
if (!(
|
|
9
|
+
set next(t) {
|
|
10
|
+
if (!(t instanceof v) && 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[d] = t;
|
|
15
15
|
}
|
|
16
16
|
get next() {
|
|
17
|
-
return this[
|
|
17
|
+
return this[d];
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
let
|
|
21
|
-
const
|
|
22
|
-
class
|
|
20
|
+
let E = P;
|
|
21
|
+
const p = Symbol("head");
|
|
22
|
+
class O {
|
|
23
23
|
constructor() {
|
|
24
|
-
this[
|
|
24
|
+
this[p] = null;
|
|
25
25
|
}
|
|
26
|
-
set head(
|
|
27
|
-
this[
|
|
26
|
+
set head(t) {
|
|
27
|
+
this[p] = t;
|
|
28
28
|
}
|
|
29
29
|
get head() {
|
|
30
|
-
return this[
|
|
30
|
+
return this[p];
|
|
31
31
|
}
|
|
32
|
-
addToTail(
|
|
33
|
-
let
|
|
34
|
-
if (
|
|
35
|
-
for (;
|
|
36
|
-
|
|
37
|
-
return
|
|
32
|
+
addToTail(t) {
|
|
33
|
+
let e = this.head;
|
|
34
|
+
if (e) {
|
|
35
|
+
for (; e.next !== null; )
|
|
36
|
+
e = e?.next;
|
|
37
|
+
return e.next = new E(t);
|
|
38
38
|
}
|
|
39
|
-
return this.head = new
|
|
39
|
+
return this.head = new E(t);
|
|
40
40
|
}
|
|
41
41
|
removeHead() {
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
44
|
-
return this.head =
|
|
42
|
+
const t = this.head;
|
|
43
|
+
if (t)
|
|
44
|
+
return this.head = t.next, t.data;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
const
|
|
48
|
-
class
|
|
47
|
+
const m = Symbol("queue"), _ = Symbol("size");
|
|
48
|
+
class N {
|
|
49
49
|
constructor() {
|
|
50
|
-
this[
|
|
50
|
+
this[m] = new O(), this[_] = 0;
|
|
51
51
|
}
|
|
52
52
|
get queue() {
|
|
53
|
-
return this[
|
|
53
|
+
return this[m];
|
|
54
54
|
}
|
|
55
55
|
get size() {
|
|
56
|
-
return this[
|
|
56
|
+
return this[_];
|
|
57
57
|
}
|
|
58
|
-
enqueue(
|
|
59
|
-
this.queue.addToTail(
|
|
58
|
+
enqueue(t) {
|
|
59
|
+
this.queue.addToTail(t), this[_]++;
|
|
60
60
|
}
|
|
61
61
|
dequeue() {
|
|
62
|
-
const
|
|
63
|
-
return this[
|
|
62
|
+
const t = this.queue.removeHead();
|
|
63
|
+
return this[_]--, t;
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
class
|
|
66
|
+
class u {
|
|
67
|
+
static {
|
|
68
|
+
this.NOTIFICATION_NAME = "epg-notification";
|
|
69
|
+
}
|
|
70
|
+
static {
|
|
71
|
+
this.ACTION_SEND_EVENT = "send-event";
|
|
72
|
+
}
|
|
73
|
+
static {
|
|
74
|
+
this.ACTION_INITIALIZED = "initialized";
|
|
75
|
+
}
|
|
76
|
+
static {
|
|
77
|
+
this.ACTION_FAILED_INITIALIZATION = "initialization-failed";
|
|
78
|
+
}
|
|
79
|
+
constructor(t, e, i, s, r, o) {
|
|
80
|
+
this._pluginName = t, this._trackingId = e, this._experienceId = i, this._solution = s, this._initializer = r, this._status = o;
|
|
81
|
+
}
|
|
82
|
+
updateStatus(t) {
|
|
83
|
+
this._status = t;
|
|
84
|
+
}
|
|
85
|
+
updateInitializer(t) {
|
|
86
|
+
this._initializer = t;
|
|
87
|
+
}
|
|
88
|
+
notify(t, e) {
|
|
89
|
+
console.log("Notifying", t, e);
|
|
90
|
+
const i = {
|
|
91
|
+
pluginName: this._pluginName,
|
|
92
|
+
trackingId: this._trackingId,
|
|
93
|
+
experienceId: this._experienceId,
|
|
94
|
+
solution: this._solution,
|
|
95
|
+
initializer: this._initializer,
|
|
96
|
+
status: this._status,
|
|
97
|
+
action: t,
|
|
98
|
+
eventDetails: e
|
|
99
|
+
};
|
|
100
|
+
window.dispatchEvent(new CustomEvent("epg-notification", { detail: i }));
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
class S {
|
|
67
104
|
constructor({
|
|
68
|
-
trackingID:
|
|
69
|
-
experienceID:
|
|
70
|
-
solution:
|
|
71
|
-
verboseLogging:
|
|
105
|
+
trackingID: t,
|
|
106
|
+
experienceID: e,
|
|
107
|
+
solution: i,
|
|
108
|
+
verboseLogging: s = !1
|
|
72
109
|
}) {
|
|
73
|
-
this.__status =
|
|
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 = i, this.verboseLogging = s, this.__queue = new N(), this.__epigraphNotifier = new u(
|
|
111
|
+
this.pluginName,
|
|
112
|
+
this.pluginName,
|
|
113
|
+
this.experienceID,
|
|
114
|
+
this.solution,
|
|
115
|
+
this.__initializationMethod,
|
|
116
|
+
this.__status
|
|
117
|
+
), this.initializePlugin();
|
|
74
118
|
}
|
|
75
119
|
getStatus() {
|
|
76
120
|
return this.__status;
|
|
77
121
|
}
|
|
78
|
-
setStatus(
|
|
79
|
-
this.__status =
|
|
122
|
+
setStatus(t) {
|
|
123
|
+
this.__status = t, this.__epigraphNotifier.updateStatus(t);
|
|
80
124
|
}
|
|
81
125
|
getPendingEventCount() {
|
|
82
126
|
return this.__queue.size;
|
|
@@ -102,9 +146,9 @@ class I {
|
|
|
102
146
|
* @param analyticsEvent
|
|
103
147
|
* @param consent boolean Whether consent is granted
|
|
104
148
|
*/
|
|
105
|
-
async sendEvent(
|
|
106
|
-
if (this.__queue.enqueue(
|
|
107
|
-
this.__status =
|
|
149
|
+
async sendEvent(t, e) {
|
|
150
|
+
if (this.__queue.enqueue(t), !e) {
|
|
151
|
+
this.__status = c.RESTRICTED;
|
|
108
152
|
return;
|
|
109
153
|
}
|
|
110
154
|
if (!this.__isInitialized) {
|
|
@@ -113,41 +157,41 @@ class I {
|
|
|
113
157
|
}
|
|
114
158
|
try {
|
|
115
159
|
await this.dequeueAndSendEvents();
|
|
116
|
-
} catch (
|
|
117
|
-
this.logger(
|
|
160
|
+
} catch (i) {
|
|
161
|
+
this.logger(i), await this.reportFailureToNexus("EVENT_SEND_ERROR", i?.toString() || "Unknown error");
|
|
118
162
|
}
|
|
119
163
|
}
|
|
120
164
|
initializePlugin() {
|
|
121
165
|
if (this.__isInitialized)
|
|
122
166
|
return;
|
|
123
167
|
if (this.__initializationAttempts >= this.__maxInitializationAttempts) {
|
|
124
|
-
this.__nexusFailureReported || (this.reportFailureToNexus("MAX_INITIALIZATION_ATTEMPTS", "Maximum initialization attempts reached"), this.__nexusFailureReported = !0);
|
|
168
|
+
this.__nexusFailureReported || (this.reportFailureToNexus("MAX_INITIALIZATION_ATTEMPTS", "Maximum initialization attempts reached"), this.__nexusFailureReported = !0, this.__epigraphNotifier.notify(u.ACTION_FAILED_INITIALIZATION, {}));
|
|
125
169
|
return;
|
|
126
170
|
}
|
|
127
|
-
const
|
|
128
|
-
if (this.__initializationAttempts > 0 &&
|
|
171
|
+
const t = performance.now();
|
|
172
|
+
if (this.__initializationAttempts > 0 && t - this.__lastInitializationAttempt < this.__initializationRetryDelay)
|
|
129
173
|
return;
|
|
130
|
-
this.__lastInitializationAttempt =
|
|
131
|
-
const
|
|
132
|
-
|
|
174
|
+
this.__lastInitializationAttempt = t, this.__initializationAttempts++;
|
|
175
|
+
const e = this.detectAndSetupAnalytics();
|
|
176
|
+
e.success ? (this.__isInitialized = !0, this.__status = c.AVAILABLE, this.__initializationMethod = e.method, this.dataLayerName = e.dataLayerName, this.dataLayer = window[this.dataLayerName], this.logger(`Successfully initialized ${e.method} with dataLayer: ${this.dataLayerName}`), this.__epigraphNotifier.notify(u.ACTION_INITIALIZED, {}), this.__queue.size > 0 && this.dequeueAndSendEvents()) : (this.logger(`Initialization attempt ${this.__initializationAttempts} failed: ${e.error}`), this.__initializationAttempts < this.__maxInitializationAttempts && setTimeout(() => {
|
|
133
177
|
this.initializePlugin();
|
|
134
178
|
}, this.__initializationRetryDelay));
|
|
135
179
|
}
|
|
136
180
|
detectAndSetupAnalytics() {
|
|
137
|
-
const
|
|
138
|
-
if (
|
|
139
|
-
return this.logger(`GTM detected with container ID: ${
|
|
181
|
+
const t = this.detectGTM();
|
|
182
|
+
if (t)
|
|
183
|
+
return this.logger(`GTM detected with container ID: ${t.containerId}`), this.__epigraphNotifier.updateInitializer("GTM"), {
|
|
140
184
|
success: !0,
|
|
141
185
|
method: "GTM",
|
|
142
|
-
dataLayerName:
|
|
186
|
+
dataLayerName: t.dataLayerName
|
|
143
187
|
};
|
|
144
|
-
const
|
|
145
|
-
if (
|
|
146
|
-
const
|
|
147
|
-
return this.logger(`GA4 script found, setting up with dataLayer: ${
|
|
188
|
+
const e = this.findGA4Info(this.trackingID);
|
|
189
|
+
if (e) {
|
|
190
|
+
const i = e.l || "dataLayer";
|
|
191
|
+
return this.logger(`GA4 script found, setting up with dataLayer: ${i}`), this.__epigraphNotifier.updateInitializer("GA4"), {
|
|
148
192
|
success: !0,
|
|
149
193
|
method: "GA4",
|
|
150
|
-
dataLayerName:
|
|
194
|
+
dataLayerName: i
|
|
151
195
|
};
|
|
152
196
|
}
|
|
153
197
|
return {
|
|
@@ -158,16 +202,16 @@ class I {
|
|
|
158
202
|
};
|
|
159
203
|
}
|
|
160
204
|
detectGTM() {
|
|
161
|
-
const
|
|
162
|
-
for (const
|
|
163
|
-
const
|
|
164
|
-
if (
|
|
165
|
-
const
|
|
166
|
-
if (
|
|
167
|
-
const r =
|
|
205
|
+
const t = document.querySelectorAll('script[src*="googletagmanager.com/gtm"]');
|
|
206
|
+
for (const e of Array.from(t)) {
|
|
207
|
+
const i = e.getAttribute("src");
|
|
208
|
+
if (i) {
|
|
209
|
+
const s = i.match(/gtm\.js\?id=([^&]+)/);
|
|
210
|
+
if (s && s.length > 0) {
|
|
211
|
+
const r = i.match(/&l=([^&]+)/), o = r ? r[1] : "dataLayer";
|
|
168
212
|
return {
|
|
169
|
-
containerId:
|
|
170
|
-
dataLayerName:
|
|
213
|
+
containerId: s[1],
|
|
214
|
+
dataLayerName: o
|
|
171
215
|
};
|
|
172
216
|
}
|
|
173
217
|
}
|
|
@@ -181,13 +225,13 @@ class I {
|
|
|
181
225
|
async dequeueAndSendEvents() {
|
|
182
226
|
if (!this.__isInitialized || !this.dataLayer)
|
|
183
227
|
return;
|
|
184
|
-
let
|
|
185
|
-
for (let
|
|
186
|
-
const
|
|
228
|
+
let t = this.__queue.size;
|
|
229
|
+
for (let e = 0; e < t; e++) {
|
|
230
|
+
const i = this.__queue.dequeue();
|
|
187
231
|
try {
|
|
188
|
-
this.__initializationMethod === "GTM" ? (this.sendGTMEvent(
|
|
189
|
-
} catch (
|
|
190
|
-
this.logger(`Error sending event ${
|
|
232
|
+
this.__initializationMethod === "GTM" ? (this.sendGTMEvent(i), this.__sentEventCount++, this.logger(`Analytics event successfully sent via ${this.__initializationMethod}: ${i.eventName}`)) : this.__initializationMethod === "GA4" ? (this.sendGA4Event(i), this.__sentEventCount++, this.logger(`Analytics event successfully sent via ${this.__initializationMethod}: ${i.eventName}`)) : this.__queue.enqueue(i);
|
|
233
|
+
} catch (s) {
|
|
234
|
+
this.logger(`Error sending event ${i.eventName}: ${s}`), this.__queue.enqueue(i);
|
|
191
235
|
}
|
|
192
236
|
}
|
|
193
237
|
}
|
|
@@ -196,18 +240,20 @@ class I {
|
|
|
196
240
|
* @param event
|
|
197
241
|
* @private
|
|
198
242
|
*/
|
|
199
|
-
async sendGTMEvent(
|
|
200
|
-
let
|
|
201
|
-
|
|
243
|
+
async sendGTMEvent(t) {
|
|
244
|
+
let e = t.getGTMParameters(this.solution, this.experienceID, this.trackingID);
|
|
245
|
+
const i = 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, i));
|
|
202
247
|
}
|
|
203
248
|
/**
|
|
204
249
|
* Send events to GA4 via Google Analytics 4.
|
|
205
250
|
* @param event
|
|
206
251
|
* @private
|
|
207
252
|
*/
|
|
208
|
-
async sendGA4Event(
|
|
209
|
-
let
|
|
210
|
-
|
|
253
|
+
async sendGA4Event(t) {
|
|
254
|
+
let e = t.getGa4Parameters(this.solution, this.experienceID, this.trackingID);
|
|
255
|
+
const i = e;
|
|
256
|
+
this.isValidPayload(e) || (e = await this.convertGA4ParametersToEpgEventTag(e)), window.gtag("event", t.eventName, e), this.__epigraphNotifier.notify(u.ACTION_SEND_EVENT, i);
|
|
211
257
|
}
|
|
212
258
|
/**
|
|
213
259
|
* Validates a payload by checking its parameter count and the constraints of parameter names and values.
|
|
@@ -217,11 +263,11 @@ class I {
|
|
|
217
263
|
* The keys represent parameter names and the values represent parameter values.
|
|
218
264
|
* @return {boolean} Returns true if the payload meets the validation criteria; false otherwise.
|
|
219
265
|
*/
|
|
220
|
-
isValidPayload(
|
|
221
|
-
if (Object.keys(
|
|
266
|
+
isValidPayload(t) {
|
|
267
|
+
if (Object.keys(t).length >= 25)
|
|
222
268
|
return !1;
|
|
223
|
-
for (const [
|
|
224
|
-
if (
|
|
269
|
+
for (const [s, r] of Object.entries(t))
|
|
270
|
+
if (s !== "items" && (s.length > 40 || String(r).length > 100))
|
|
225
271
|
return !1;
|
|
226
272
|
return !0;
|
|
227
273
|
}
|
|
@@ -233,16 +279,16 @@ class I {
|
|
|
233
279
|
* @param {Record<string, unknown>} parameterPayload - A key-value pair object containing the parameters to be converted.
|
|
234
280
|
* @return {Promise<Record<string, unknown>>} A promise that resolves to an object containing the event name and the generated EPG event tag, or the original payload upon failure.
|
|
235
281
|
*/
|
|
236
|
-
async convertGTMParametersToEpgEventTag(
|
|
282
|
+
async convertGTMParametersToEpgEventTag(t, e) {
|
|
237
283
|
try {
|
|
238
|
-
let
|
|
284
|
+
let i = await this.sendGA4LongParameters(e);
|
|
239
285
|
return {
|
|
240
|
-
event:
|
|
241
|
-
epg_event_tag:
|
|
286
|
+
event: t,
|
|
287
|
+
epg_event_tag: i,
|
|
242
288
|
send_to: this.trackingID
|
|
243
289
|
};
|
|
244
290
|
} catch {
|
|
245
|
-
return
|
|
291
|
+
return e;
|
|
246
292
|
}
|
|
247
293
|
}
|
|
248
294
|
/**
|
|
@@ -251,100 +297,107 @@ class I {
|
|
|
251
297
|
* @param {Record<string, unknown>} parameterPayload - The GA4 parameters to be converted.
|
|
252
298
|
* @return {Promise<Record<string, any>>} A promise resolving to an object containing the EPG event tag or the original payload if the conversion fails.
|
|
253
299
|
*/
|
|
254
|
-
async convertGA4ParametersToEpgEventTag(
|
|
300
|
+
async convertGA4ParametersToEpgEventTag(t) {
|
|
255
301
|
try {
|
|
256
302
|
return {
|
|
257
|
-
epg_event_tag: await this.sendGA4LongParameters(
|
|
303
|
+
epg_event_tag: await this.sendGA4LongParameters(t),
|
|
258
304
|
send_to: this.trackingID
|
|
259
305
|
};
|
|
260
306
|
} catch {
|
|
261
|
-
return
|
|
307
|
+
return t;
|
|
262
308
|
}
|
|
263
309
|
}
|
|
264
310
|
/**
|
|
265
311
|
* Checks if verboseLogging is enabled, then logs the error
|
|
266
312
|
* @param err
|
|
267
313
|
*/
|
|
268
|
-
logger(
|
|
269
|
-
this.verboseLogging && console.warn(
|
|
314
|
+
logger(t) {
|
|
315
|
+
this.verboseLogging && console.warn(t);
|
|
270
316
|
}
|
|
271
|
-
async sendGA4LongParameters(
|
|
272
|
-
const
|
|
317
|
+
async sendGA4LongParameters(t) {
|
|
318
|
+
const e = "https://api.myepigraph.com/api/analytics/ga4/custom", i = { parameters: t };
|
|
273
319
|
try {
|
|
274
|
-
const
|
|
320
|
+
const s = await fetch(e, {
|
|
275
321
|
method: "POST",
|
|
276
322
|
// Assuming it's a POST request, adjust if necessary
|
|
277
323
|
headers: {
|
|
278
324
|
"Content-Type": "application/json",
|
|
279
325
|
Accept: "application/json"
|
|
280
326
|
},
|
|
281
|
-
body: JSON.stringify(
|
|
327
|
+
body: JSON.stringify(i)
|
|
282
328
|
});
|
|
283
|
-
return
|
|
329
|
+
return s.ok ? (await s.json())?.id ?? "" : "";
|
|
284
330
|
} catch {
|
|
285
331
|
return "";
|
|
286
332
|
}
|
|
287
333
|
}
|
|
288
|
-
async reportFailureToNexus(
|
|
334
|
+
async reportFailureToNexus(t, e) {
|
|
289
335
|
try {
|
|
290
|
-
const
|
|
336
|
+
const i = {
|
|
291
337
|
plugin: "GA4",
|
|
292
338
|
trackingId: this.trackingID,
|
|
293
339
|
solution: this.solution,
|
|
294
340
|
experienceId: this.experienceID,
|
|
295
|
-
failureType:
|
|
296
|
-
errorMessage:
|
|
341
|
+
failureType: t,
|
|
342
|
+
errorMessage: e,
|
|
297
343
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
298
344
|
url: window.location.href,
|
|
299
345
|
userAgent: navigator.userAgent
|
|
300
346
|
};
|
|
301
|
-
this.logger(`Failure reported to Nexus: ${JSON.stringify(
|
|
302
|
-
} catch (
|
|
303
|
-
this.logger(`Error reporting failure to Nexus: ${
|
|
347
|
+
this.logger(`Failure reported to Nexus: ${JSON.stringify(i)}`);
|
|
348
|
+
} catch (i) {
|
|
349
|
+
this.logger(`Error reporting failure to Nexus: ${i}`);
|
|
304
350
|
}
|
|
305
351
|
}
|
|
306
|
-
findGA4Info(
|
|
307
|
-
if (window.google_tag_manager && window.google_tag_manager[
|
|
308
|
-
const
|
|
309
|
-
if (
|
|
352
|
+
findGA4Info(t) {
|
|
353
|
+
if (window.google_tag_manager && window.google_tag_manager[t]) {
|
|
354
|
+
const i = window.google_tag_manager[t];
|
|
355
|
+
if (i && i.dataLayerName)
|
|
310
356
|
return {
|
|
311
357
|
fullSrc: "",
|
|
312
|
-
id:
|
|
313
|
-
l:
|
|
358
|
+
id: t,
|
|
359
|
+
l: i.dataLayerName
|
|
314
360
|
};
|
|
315
361
|
}
|
|
316
|
-
const
|
|
317
|
-
for (const
|
|
318
|
-
const
|
|
319
|
-
if (
|
|
320
|
-
const r = new URL(
|
|
362
|
+
const e = document.querySelectorAll("script[src]");
|
|
363
|
+
for (const i of e) {
|
|
364
|
+
const s = i.getAttribute("src");
|
|
365
|
+
if (s && s.includes(t)) {
|
|
366
|
+
const r = new URL(s, location.href), o = Object.fromEntries(r.searchParams.entries());
|
|
321
367
|
return {
|
|
322
368
|
fullSrc: r.href,
|
|
323
|
-
id:
|
|
324
|
-
l:
|
|
369
|
+
id: o.id || void 0,
|
|
370
|
+
l: o.l || void 0
|
|
325
371
|
};
|
|
326
372
|
}
|
|
327
373
|
}
|
|
328
374
|
return null;
|
|
329
375
|
}
|
|
330
376
|
}
|
|
331
|
-
class
|
|
377
|
+
class L {
|
|
332
378
|
constructor({
|
|
333
|
-
trackingID:
|
|
334
|
-
experienceID:
|
|
335
|
-
solution:
|
|
336
|
-
sessionId:
|
|
379
|
+
trackingID: t,
|
|
380
|
+
experienceID: e,
|
|
381
|
+
solution: i,
|
|
382
|
+
sessionId: s,
|
|
337
383
|
xPath: r,
|
|
338
|
-
verboseLogging:
|
|
384
|
+
verboseLogging: o = !1,
|
|
339
385
|
sendToStaging: y = !1
|
|
340
386
|
}) {
|
|
341
|
-
this.__status =
|
|
387
|
+
this.__status = c.UNAVAILABLE, this.__sentEventCount = 0, this.sessionId = s, this.xPath = r, this.name = this.pluginName = "NEXUS-PLUGIN", this.trackingID = t, this.experienceID = e, this.solution = i, this.verboseLogging = o, this.__queue = new N(), this.url = y ? "https://nexus.epigraph.dev/api/analytics/event" : "https://api.myepigraph.com/api/analytics/event", this.__status = c.AVAILABLE, this.__epigraphNotifier = new u(
|
|
388
|
+
this.pluginName,
|
|
389
|
+
this.trackingID,
|
|
390
|
+
this.experienceID,
|
|
391
|
+
this.solution,
|
|
392
|
+
"NEXUS",
|
|
393
|
+
this.__status
|
|
394
|
+
), this.__epigraphNotifier.notify(u.ACTION_INITIALIZED, {});
|
|
342
395
|
}
|
|
343
396
|
getStatus() {
|
|
344
397
|
return this.__status;
|
|
345
398
|
}
|
|
346
|
-
setStatus(
|
|
347
|
-
this.__status =
|
|
399
|
+
setStatus(t) {
|
|
400
|
+
this.__status = t, this.__epigraphNotifier.updateStatus(t);
|
|
348
401
|
}
|
|
349
402
|
getPendingEventCount() {
|
|
350
403
|
return this.__queue.size;
|
|
@@ -360,22 +413,21 @@ class C {
|
|
|
360
413
|
}
|
|
361
414
|
setupPlugin() {
|
|
362
415
|
}
|
|
363
|
-
async sendEvent(
|
|
364
|
-
if (this.__queue.enqueue(
|
|
365
|
-
this.__status =
|
|
416
|
+
async sendEvent(t, e) {
|
|
417
|
+
if (this.__queue.enqueue(t), !e) {
|
|
418
|
+
this.__status = c.RESTRICTED, this.__epigraphNotifier.updateStatus(this.__status);
|
|
366
419
|
return;
|
|
367
420
|
}
|
|
368
421
|
await this.dequeueAndSendEvents();
|
|
369
422
|
}
|
|
370
423
|
async dequeueAndSendEvents() {
|
|
371
|
-
for (let
|
|
372
|
-
const
|
|
373
|
-
|
|
374
|
-
const n = {
|
|
375
|
-
trackingID: this.trackingID,
|
|
424
|
+
for (let t = 0; t < this.__queue.size; t++) {
|
|
425
|
+
const e = this.__queue.dequeue(), i = {
|
|
426
|
+
send_to: this.trackingID,
|
|
376
427
|
experience_id: this.experienceID,
|
|
377
|
-
|
|
378
|
-
|
|
428
|
+
solution: this.solution,
|
|
429
|
+
event: e.eventName,
|
|
430
|
+
parameters: e.getNexusParameters()
|
|
379
431
|
};
|
|
380
432
|
try {
|
|
381
433
|
return (await fetch(this.url, {
|
|
@@ -388,8 +440,8 @@ class C {
|
|
|
388
440
|
"EPG-XPATH": this.xPath,
|
|
389
441
|
Origin: typeof window < "u" ? window.location.origin : ""
|
|
390
442
|
},
|
|
391
|
-
body: JSON.stringify(
|
|
392
|
-
})).
|
|
443
|
+
body: JSON.stringify(i)
|
|
444
|
+
})).ok && this.__epigraphNotifier.notify(u.ACTION_SEND_EVENT, i), "";
|
|
393
445
|
} catch {
|
|
394
446
|
return "";
|
|
395
447
|
}
|
|
@@ -398,9 +450,9 @@ class C {
|
|
|
398
450
|
return "";
|
|
399
451
|
}
|
|
400
452
|
}
|
|
401
|
-
class
|
|
402
|
-
constructor(
|
|
403
|
-
this.consentSet = !1, this.consent = !1, this.pluginName = "OneTrustConsentPlugin", this.consentIdentifier =
|
|
453
|
+
class C {
|
|
454
|
+
constructor(t) {
|
|
455
|
+
this.consentSet = !1, this.consent = !1, this.pluginName = "OneTrustConsentPlugin", this.consentIdentifier = t, this.consent = !1, this.addConsentChangedListener();
|
|
404
456
|
}
|
|
405
457
|
/**
|
|
406
458
|
* Checks to see if the user has consented. If this is false, it will block all analytics
|
|
@@ -409,9 +461,9 @@ class A {
|
|
|
409
461
|
if (this.consentSet)
|
|
410
462
|
return this.consent;
|
|
411
463
|
if (window.OnetrustActiveGroups !== void 0) {
|
|
412
|
-
let
|
|
413
|
-
|
|
414
|
-
|
|
464
|
+
let t = window.OnetrustActiveGroups;
|
|
465
|
+
t !== void 0 && t.split(",").forEach((i) => {
|
|
466
|
+
i === this.consentIdentifier && (this.consent = !0, this.consentSet = !0);
|
|
415
467
|
});
|
|
416
468
|
}
|
|
417
469
|
return this.consent;
|
|
@@ -424,223 +476,309 @@ class A {
|
|
|
424
476
|
});
|
|
425
477
|
}
|
|
426
478
|
}
|
|
427
|
-
var
|
|
479
|
+
var f = /* @__PURE__ */ ((n) => (n.OneTrust = "onetrust", n))(f || {});
|
|
428
480
|
class a {
|
|
429
481
|
constructor({
|
|
430
|
-
eventName:
|
|
431
|
-
interactiveEvent:
|
|
432
|
-
customParameters:
|
|
482
|
+
eventName: t,
|
|
483
|
+
interactiveEvent: e,
|
|
484
|
+
customParameters: i
|
|
433
485
|
}) {
|
|
434
|
-
this.eventName =
|
|
486
|
+
this.eventName = t, this.interactiveEvent = e, this.customParameters = i;
|
|
435
487
|
}
|
|
436
|
-
getGa4Parameters(
|
|
437
|
-
let
|
|
438
|
-
solution:
|
|
439
|
-
experience_id:
|
|
488
|
+
getGa4Parameters(t, e, i) {
|
|
489
|
+
let s = {
|
|
490
|
+
solution: t,
|
|
491
|
+
experience_id: e,
|
|
440
492
|
interactive_event: this.interactiveEvent,
|
|
441
|
-
send_to:
|
|
493
|
+
send_to: i
|
|
442
494
|
};
|
|
443
|
-
return
|
|
495
|
+
return s = Object.assign(s, JSON.parse(JSON.stringify(this.customParameters))), s;
|
|
444
496
|
}
|
|
445
|
-
getGTMParameters(
|
|
446
|
-
let
|
|
447
|
-
solution:
|
|
448
|
-
experience_id:
|
|
497
|
+
getGTMParameters(t, e, i) {
|
|
498
|
+
let s = {
|
|
499
|
+
solution: t,
|
|
500
|
+
experience_id: e,
|
|
449
501
|
event: this.eventName,
|
|
450
502
|
interactive_event: this.interactiveEvent,
|
|
451
|
-
send_to:
|
|
503
|
+
send_to: i
|
|
452
504
|
};
|
|
453
|
-
return
|
|
505
|
+
return s = Object.assign(s, JSON.parse(JSON.stringify(this.customParameters))), s;
|
|
454
506
|
}
|
|
455
507
|
getNexusParameters() {
|
|
456
|
-
let
|
|
508
|
+
let t = {
|
|
457
509
|
interactive_event: this.interactiveEvent
|
|
458
510
|
};
|
|
459
|
-
return
|
|
511
|
+
return t = Object.assign(t, JSON.parse(JSON.stringify(this.customParameters))), t;
|
|
460
512
|
}
|
|
461
513
|
}
|
|
514
|
+
const I = {
|
|
515
|
+
AR: "ar",
|
|
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
|
+
};
|
|
462
538
|
class w extends a {
|
|
463
|
-
constructor(
|
|
539
|
+
constructor(t) {
|
|
464
540
|
super({
|
|
465
541
|
eventName: "epigraph_ar_requested",
|
|
466
542
|
interactiveEvent: !0,
|
|
467
543
|
customParameters: {
|
|
468
|
-
items:
|
|
544
|
+
items: t
|
|
469
545
|
}
|
|
470
546
|
});
|
|
471
547
|
}
|
|
472
548
|
}
|
|
473
|
-
class
|
|
474
|
-
constructor(
|
|
549
|
+
class R extends a {
|
|
550
|
+
constructor(t) {
|
|
475
551
|
super({
|
|
476
552
|
eventName: "epigraph_module_loading",
|
|
477
553
|
interactiveEvent: !1,
|
|
478
554
|
customParameters: {
|
|
479
|
-
is_pre_config:
|
|
555
|
+
is_pre_config: t
|
|
480
556
|
}
|
|
481
557
|
});
|
|
482
558
|
}
|
|
483
559
|
}
|
|
484
|
-
class
|
|
485
|
-
constructor(
|
|
560
|
+
class x extends a {
|
|
561
|
+
constructor(t, e) {
|
|
486
562
|
super({
|
|
487
563
|
eventName: "epigraph_module_ready",
|
|
488
564
|
interactiveEvent: !1,
|
|
489
565
|
customParameters: {
|
|
490
|
-
is_pre_config:
|
|
491
|
-
load_time_ms:
|
|
566
|
+
is_pre_config: t,
|
|
567
|
+
load_time_ms: e
|
|
492
568
|
}
|
|
493
569
|
});
|
|
494
570
|
}
|
|
495
571
|
}
|
|
496
|
-
class
|
|
497
|
-
constructor(
|
|
572
|
+
class D extends a {
|
|
573
|
+
constructor(t, e, i) {
|
|
498
574
|
super({
|
|
499
575
|
eventName: "epigraph_module_failed",
|
|
500
576
|
interactiveEvent: !1,
|
|
501
577
|
customParameters: {
|
|
502
|
-
is_pre_config:
|
|
503
|
-
load_time_ms:
|
|
504
|
-
error_type:
|
|
578
|
+
is_pre_config: t,
|
|
579
|
+
load_time_ms: e,
|
|
580
|
+
error_type: i
|
|
505
581
|
}
|
|
506
582
|
});
|
|
507
583
|
}
|
|
508
584
|
}
|
|
509
|
-
class
|
|
510
|
-
constructor(
|
|
585
|
+
class z extends a {
|
|
586
|
+
constructor(t) {
|
|
511
587
|
super({
|
|
512
588
|
eventName: "epigraph_module_closed",
|
|
513
589
|
interactiveEvent: !0,
|
|
514
590
|
customParameters: {
|
|
515
|
-
items:
|
|
591
|
+
items: t
|
|
516
592
|
}
|
|
517
593
|
});
|
|
518
594
|
}
|
|
519
595
|
}
|
|
520
|
-
class
|
|
521
|
-
|
|
596
|
+
class G extends a {
|
|
597
|
+
static {
|
|
598
|
+
this.SUPPORT_TYPE = {
|
|
599
|
+
AR: "ar",
|
|
600
|
+
QR: "qr",
|
|
601
|
+
WEBGL2: "webgl2"
|
|
602
|
+
};
|
|
603
|
+
}
|
|
604
|
+
constructor(t, e = {}) {
|
|
522
605
|
super({
|
|
523
606
|
eventName: "epigraph_support_detected",
|
|
524
607
|
interactiveEvent: !1,
|
|
525
608
|
customParameters: {
|
|
526
|
-
support_type:
|
|
527
|
-
device_capabilities:
|
|
609
|
+
support_type: t,
|
|
610
|
+
device_capabilities: e
|
|
528
611
|
}
|
|
529
612
|
});
|
|
530
613
|
}
|
|
531
614
|
}
|
|
532
|
-
class
|
|
533
|
-
|
|
615
|
+
class M extends a {
|
|
616
|
+
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
|
+
};
|
|
639
|
+
}
|
|
640
|
+
constructor(t, e) {
|
|
534
641
|
super({
|
|
535
642
|
eventName: "epigraph_button_click",
|
|
536
643
|
interactiveEvent: !0,
|
|
537
644
|
customParameters: {
|
|
538
|
-
button_type:
|
|
539
|
-
button_name:
|
|
645
|
+
button_type: t,
|
|
646
|
+
button_name: e
|
|
540
647
|
}
|
|
541
648
|
});
|
|
542
649
|
}
|
|
543
650
|
}
|
|
544
|
-
class
|
|
545
|
-
|
|
651
|
+
class q extends a {
|
|
652
|
+
static {
|
|
653
|
+
this.PANEL_TYPE = I;
|
|
654
|
+
}
|
|
655
|
+
static {
|
|
656
|
+
this.TRIGGER_SOURCE = T;
|
|
657
|
+
}
|
|
658
|
+
constructor(t, e, i, s) {
|
|
546
659
|
super({
|
|
547
660
|
eventName: "epigraph_panel_opened",
|
|
548
661
|
interactiveEvent: t,
|
|
549
662
|
customParameters: {
|
|
550
|
-
items:
|
|
551
|
-
panel_type:
|
|
663
|
+
items: s,
|
|
664
|
+
panel_type: e,
|
|
552
665
|
trigger_source: i
|
|
553
666
|
}
|
|
554
667
|
});
|
|
555
668
|
}
|
|
556
669
|
}
|
|
557
|
-
class
|
|
558
|
-
|
|
670
|
+
class b extends a {
|
|
671
|
+
static {
|
|
672
|
+
this.PANEL_TYPE = I;
|
|
673
|
+
}
|
|
674
|
+
static {
|
|
675
|
+
this.TRIGGER_SOURCE = T;
|
|
676
|
+
}
|
|
677
|
+
constructor(t, e, i, s) {
|
|
559
678
|
super({
|
|
560
679
|
eventName: "epigraph_panel_closed",
|
|
561
680
|
interactiveEvent: t,
|
|
562
681
|
customParameters: {
|
|
563
|
-
items:
|
|
564
|
-
panel_type:
|
|
682
|
+
items: s,
|
|
683
|
+
panel_type: e,
|
|
565
684
|
trigger_source: i
|
|
566
685
|
}
|
|
567
686
|
});
|
|
568
687
|
}
|
|
569
688
|
}
|
|
570
|
-
class
|
|
571
|
-
constructor(
|
|
689
|
+
class U extends a {
|
|
690
|
+
constructor(t) {
|
|
572
691
|
super({
|
|
573
692
|
eventName: "epigraph_add_to_favourites",
|
|
574
693
|
interactiveEvent: !0,
|
|
575
694
|
customParameters: {
|
|
576
|
-
items:
|
|
695
|
+
items: t
|
|
577
696
|
}
|
|
578
697
|
});
|
|
579
698
|
}
|
|
580
699
|
}
|
|
581
|
-
class
|
|
582
|
-
|
|
700
|
+
class k extends a {
|
|
701
|
+
static {
|
|
702
|
+
this.ACTION_PERFORMED = {
|
|
703
|
+
ZOOM: "zoom",
|
|
704
|
+
ROTATE: "rotate"
|
|
705
|
+
};
|
|
706
|
+
}
|
|
707
|
+
constructor(t) {
|
|
583
708
|
super({
|
|
584
709
|
eventName: "epigraph_keyboard_interaction",
|
|
585
710
|
interactiveEvent: !0,
|
|
586
711
|
customParameters: {
|
|
587
|
-
action_performed:
|
|
712
|
+
action_performed: t
|
|
588
713
|
}
|
|
589
714
|
});
|
|
590
715
|
}
|
|
591
716
|
}
|
|
592
|
-
class
|
|
593
|
-
|
|
717
|
+
class V extends a {
|
|
718
|
+
static {
|
|
719
|
+
this.INTERACTION_TYPE = {
|
|
720
|
+
ROTATE: "rotate",
|
|
721
|
+
ZOOM: "zoom",
|
|
722
|
+
PAN: "pan"
|
|
723
|
+
};
|
|
724
|
+
}
|
|
725
|
+
constructor(t) {
|
|
594
726
|
super({
|
|
595
727
|
eventName: "epigraph_touch_interaction",
|
|
596
728
|
interactiveEvent: !0,
|
|
597
729
|
customParameters: {
|
|
598
|
-
interaction_type:
|
|
730
|
+
interaction_type: t
|
|
599
731
|
}
|
|
600
732
|
});
|
|
601
733
|
}
|
|
602
734
|
}
|
|
603
|
-
class
|
|
604
|
-
|
|
735
|
+
class $ extends a {
|
|
736
|
+
static {
|
|
737
|
+
this.CURRENCY = l;
|
|
738
|
+
}
|
|
739
|
+
constructor(t, e, i, s, r) {
|
|
605
740
|
super({
|
|
606
741
|
eventName: "epigraph_item_added",
|
|
607
742
|
interactiveEvent: t,
|
|
608
743
|
customParameters: {
|
|
609
|
-
items:
|
|
610
|
-
value:
|
|
744
|
+
items: r,
|
|
745
|
+
value: e,
|
|
611
746
|
currency: i,
|
|
612
|
-
quantity:
|
|
747
|
+
quantity: s
|
|
613
748
|
}
|
|
614
749
|
});
|
|
615
750
|
}
|
|
616
751
|
}
|
|
617
|
-
class
|
|
618
|
-
constructor(
|
|
752
|
+
class H extends a {
|
|
753
|
+
constructor(t) {
|
|
619
754
|
super({
|
|
620
755
|
eventName: "epigraph_item_moved",
|
|
621
756
|
interactiveEvent: !0,
|
|
622
757
|
customParameters: {
|
|
623
|
-
items:
|
|
758
|
+
items: t
|
|
624
759
|
}
|
|
625
760
|
});
|
|
626
761
|
}
|
|
627
762
|
}
|
|
628
|
-
class
|
|
629
|
-
|
|
763
|
+
class F extends a {
|
|
764
|
+
static {
|
|
765
|
+
this.CURRENCY = l;
|
|
766
|
+
}
|
|
767
|
+
constructor(t, e, i, s) {
|
|
630
768
|
super({
|
|
631
769
|
eventName: "epigraph_item_removed",
|
|
632
770
|
interactiveEvent: !0,
|
|
633
771
|
customParameters: {
|
|
634
|
-
items:
|
|
772
|
+
items: s,
|
|
635
773
|
value: t,
|
|
636
|
-
currency:
|
|
774
|
+
currency: e,
|
|
637
775
|
quantity: i
|
|
638
776
|
}
|
|
639
777
|
});
|
|
640
778
|
}
|
|
641
779
|
}
|
|
642
|
-
class
|
|
643
|
-
constructor(
|
|
780
|
+
class B extends a {
|
|
781
|
+
constructor(t, e) {
|
|
644
782
|
super({
|
|
645
783
|
eventName: "epigraph_variant_changed",
|
|
646
784
|
interactiveEvent: !0,
|
|
@@ -651,84 +789,90 @@ class j extends a {
|
|
|
651
789
|
});
|
|
652
790
|
}
|
|
653
791
|
}
|
|
654
|
-
class
|
|
655
|
-
constructor(
|
|
792
|
+
class j extends a {
|
|
793
|
+
constructor(t, e, i) {
|
|
656
794
|
super({
|
|
657
795
|
eventName: "epigraph_content_shared",
|
|
658
796
|
interactiveEvent: !0,
|
|
659
797
|
customParameters: {
|
|
660
|
-
items:
|
|
798
|
+
items: i,
|
|
661
799
|
content_type: t,
|
|
662
|
-
share_destination:
|
|
800
|
+
share_destination: e
|
|
663
801
|
}
|
|
664
802
|
});
|
|
665
803
|
}
|
|
666
804
|
}
|
|
667
|
-
class
|
|
668
|
-
|
|
805
|
+
class Y extends a {
|
|
806
|
+
static {
|
|
807
|
+
this.CURRENCY = l;
|
|
808
|
+
}
|
|
809
|
+
constructor(t, e, i) {
|
|
669
810
|
super({
|
|
670
811
|
eventName: "epigraph_checkout",
|
|
671
812
|
interactiveEvent: !0,
|
|
672
813
|
customParameters: {
|
|
673
|
-
items:
|
|
814
|
+
items: i,
|
|
674
815
|
value: t,
|
|
675
|
-
currency:
|
|
816
|
+
currency: e
|
|
676
817
|
}
|
|
677
818
|
});
|
|
678
819
|
}
|
|
679
820
|
}
|
|
680
|
-
class
|
|
681
|
-
|
|
821
|
+
class W extends a {
|
|
822
|
+
static {
|
|
823
|
+
this.CURRENCY = l;
|
|
824
|
+
}
|
|
825
|
+
constructor(t, e, i) {
|
|
682
826
|
super({
|
|
683
827
|
eventName: "epigraph_conversion",
|
|
684
828
|
interactiveEvent: !0,
|
|
685
829
|
customParameters: {
|
|
686
|
-
items:
|
|
830
|
+
items: i,
|
|
687
831
|
value: t,
|
|
688
|
-
currency:
|
|
832
|
+
currency: e
|
|
689
833
|
}
|
|
690
834
|
});
|
|
691
835
|
}
|
|
692
836
|
}
|
|
693
|
-
class
|
|
694
|
-
constructor(
|
|
837
|
+
class J extends a {
|
|
838
|
+
constructor(t) {
|
|
695
839
|
super({
|
|
696
840
|
eventName: "epigraph_changeRate",
|
|
697
841
|
interactiveEvent: !1,
|
|
698
842
|
customParameters: {
|
|
699
|
-
value:
|
|
843
|
+
value: t
|
|
700
844
|
}
|
|
701
845
|
});
|
|
702
846
|
}
|
|
703
847
|
}
|
|
704
|
-
class
|
|
705
|
-
constructor(
|
|
848
|
+
class Z extends a {
|
|
849
|
+
constructor(t) {
|
|
706
850
|
super({
|
|
707
851
|
eventName: "epigraph_completionRate",
|
|
708
852
|
interactiveEvent: !1,
|
|
709
853
|
customParameters: {
|
|
710
|
-
value:
|
|
854
|
+
value: t
|
|
711
855
|
}
|
|
712
856
|
});
|
|
713
857
|
}
|
|
714
858
|
}
|
|
715
|
-
class
|
|
716
|
-
constructor(
|
|
859
|
+
class X extends a {
|
|
860
|
+
constructor(t) {
|
|
717
861
|
super({
|
|
718
862
|
eventName: "epigraph_engagementRate",
|
|
719
863
|
interactiveEvent: !1,
|
|
720
864
|
customParameters: {
|
|
721
|
-
value:
|
|
865
|
+
value: t
|
|
722
866
|
}
|
|
723
867
|
});
|
|
724
868
|
}
|
|
725
869
|
}
|
|
726
870
|
class K extends a {
|
|
727
|
-
constructor(
|
|
871
|
+
constructor(t, e, i) {
|
|
728
872
|
super({
|
|
729
|
-
eventName:
|
|
730
|
-
interactiveEvent:
|
|
731
|
-
customParameters:
|
|
873
|
+
eventName: t,
|
|
874
|
+
interactiveEvent: e,
|
|
875
|
+
customParameters: i
|
|
732
876
|
});
|
|
733
877
|
}
|
|
734
878
|
}
|
|
@@ -748,18 +892,18 @@ class K extends a {
|
|
|
748
892
|
* See the License for the specific language governing permissions and
|
|
749
893
|
* limitations under the License.
|
|
750
894
|
*/
|
|
751
|
-
var
|
|
752
|
-
const
|
|
753
|
-
|
|
754
|
-
class
|
|
755
|
-
constructor(
|
|
756
|
-
this[
|
|
757
|
-
}
|
|
758
|
-
__onConsentChangeFromEvent(
|
|
759
|
-
let
|
|
760
|
-
this.__overrideConsent =
|
|
761
|
-
for (const
|
|
762
|
-
this.__hasConsent() ||
|
|
895
|
+
var A;
|
|
896
|
+
const h = Symbol("analyticsPluginsMap");
|
|
897
|
+
A = h;
|
|
898
|
+
class Q {
|
|
899
|
+
constructor(t, e) {
|
|
900
|
+
this[A] = /* @__PURE__ */ new Map(), this.__consentPlugin = null, t && e && (this.__consentPlugin = this.buildConsentPlugin(t, e)), window.addEventListener("epigraphAnalyticsConsentChange", this.__onConsentChangeFromEvent);
|
|
901
|
+
}
|
|
902
|
+
__onConsentChangeFromEvent(t) {
|
|
903
|
+
let e = t;
|
|
904
|
+
this.__overrideConsent = e.detail.hasConsent;
|
|
905
|
+
for (const i of this[h].values())
|
|
906
|
+
this.__hasConsent() || i.setStatus(c.RESTRICTED);
|
|
763
907
|
}
|
|
764
908
|
/**
|
|
765
909
|
* Epigraph Analytics uses plugins to send events to multiple trackers at a time. You can create a customer tracker
|
|
@@ -768,30 +912,30 @@ class X {
|
|
|
768
912
|
*
|
|
769
913
|
* @param plugin
|
|
770
914
|
*/
|
|
771
|
-
addEventPlugin(
|
|
772
|
-
this[
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
),
|
|
915
|
+
addEventPlugin(t) {
|
|
916
|
+
this[h].has(t.getUniquePluginIdentifier()) || (this[h].set(
|
|
917
|
+
t.getUniquePluginIdentifier(),
|
|
918
|
+
t
|
|
919
|
+
), t.setupPlugin());
|
|
776
920
|
}
|
|
777
921
|
/**
|
|
778
922
|
* Resolves session consent by prioritizing this._overrideConsent and if not found,
|
|
779
923
|
* getting the value from the consent plugin, if available.
|
|
780
|
-
*
|
|
924
|
+
*
|
|
781
925
|
* @returns {boolean} Whether the session has consent to track analytics or not.
|
|
782
926
|
*/
|
|
783
927
|
__hasConsent() {
|
|
784
|
-
let
|
|
785
|
-
return this.__overrideConsent !== void 0 ? (
|
|
928
|
+
let t = !0;
|
|
929
|
+
return this.__overrideConsent !== void 0 ? (t = this.__overrideConsent, t) : (this.__consentPlugin && (t = this.__consentPlugin.hasConsent()), t);
|
|
786
930
|
}
|
|
787
931
|
/**
|
|
788
932
|
* Send an Event to all plugins
|
|
789
933
|
*
|
|
790
934
|
* @param eventData
|
|
791
935
|
*/
|
|
792
|
-
sendEvent(
|
|
793
|
-
this[
|
|
794
|
-
|
|
936
|
+
sendEvent(t) {
|
|
937
|
+
this[h].forEach((e) => {
|
|
938
|
+
e.sendEvent(t, this.__hasConsent());
|
|
795
939
|
});
|
|
796
940
|
}
|
|
797
941
|
/**
|
|
@@ -800,37 +944,37 @@ class X {
|
|
|
800
944
|
* @param consentIdentifier
|
|
801
945
|
* @private
|
|
802
946
|
*/
|
|
803
|
-
buildConsentPlugin(
|
|
804
|
-
return
|
|
947
|
+
buildConsentPlugin(t, e) {
|
|
948
|
+
return t.toLowerCase() === f.OneTrust.toLowerCase() ? new C(e) : null;
|
|
805
949
|
}
|
|
806
950
|
}
|
|
807
951
|
export {
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
952
|
+
f as ConsentPluginNames,
|
|
953
|
+
U as EpigraphAddToFavouritesEvent,
|
|
954
|
+
Q as EpigraphAnalytics,
|
|
811
955
|
w as EpigraphArRequestedEvent,
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
956
|
+
M as EpigraphButtonClickEvent,
|
|
957
|
+
J as EpigraphChangeRateEvent,
|
|
958
|
+
Y as EpigraphCheckoutEvent,
|
|
959
|
+
Z as EpigraphCompletionRateEvent,
|
|
960
|
+
j as EpigraphContentSharedEvent,
|
|
961
|
+
W as EpigraphConversionEvent,
|
|
818
962
|
K as EpigraphCustomEvent,
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
963
|
+
X as EpigraphEngagementRateEvent,
|
|
964
|
+
$ as EpigraphItemAddedEvent,
|
|
965
|
+
H as EpigraphItemMovedEvent,
|
|
966
|
+
F as EpigraphItemRemovedEvent,
|
|
967
|
+
k as EpigraphKeyboardInteractionEvent,
|
|
968
|
+
z as EpigraphModuleClosedEvent,
|
|
969
|
+
D as EpigraphModuleFailedEvent,
|
|
970
|
+
R as EpigraphModuleLoadingEvent,
|
|
971
|
+
x as EpigraphModuleReadyEvent,
|
|
972
|
+
b as EpigraphPanelClosedEvent,
|
|
973
|
+
q as EpigraphPanelOpenedEvent,
|
|
974
|
+
G as EpigraphSupportDetectedEvent,
|
|
975
|
+
V as EpigraphTouchInteractionEvent,
|
|
976
|
+
B as EpigraphVariantChangedEvent,
|
|
977
|
+
S as GA4AnalyticsPlugin,
|
|
978
|
+
L as NexusAnalyticsPlugin,
|
|
979
|
+
C as OneTrustConsentPlugin
|
|
836
980
|
};
|