@epigraph/epigraph-std-lib 4.7.0-alpha → 5.0.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.
@@ -1,40 +1,40 @@
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 {
1
+ var c = /* @__PURE__ */ ((e) => (e.UNAVAILABLE = "unavailable", e.AVAILABLE = "available", e.RESTRICTED = "restricted", e))(c || {});
2
+ const m = Symbol("data"), p = Symbol("next"), D = class I {
3
3
  constructor(t) {
4
- this[g] = t, this[d] = null;
4
+ this[m] = t, this[p] = null;
5
5
  }
6
6
  get data() {
7
- return this[g];
7
+ return this[m];
8
8
  }
9
9
  set next(t) {
10
- if (!(t instanceof v) && t !== null)
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[d] = t;
14
+ this[p] = t;
15
15
  }
16
16
  get next() {
17
- return this[d];
17
+ return this[p];
18
18
  }
19
19
  };
20
- let E = P;
21
- const p = Symbol("head");
22
- class O {
20
+ let E = D;
21
+ const _ = Symbol("head");
22
+ class T {
23
23
  constructor() {
24
- this[p] = null;
24
+ this[_] = null;
25
25
  }
26
26
  set head(t) {
27
- this[p] = t;
27
+ this[_] = t;
28
28
  }
29
29
  get head() {
30
- return this[p];
30
+ return this[_];
31
31
  }
32
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);
33
+ let i = this.head;
34
+ if (i) {
35
+ for (; i.next !== null; )
36
+ i = i?.next;
37
+ return i.next = new E(t);
38
38
  }
39
39
  return this.head = new E(t);
40
40
  }
@@ -44,23 +44,23 @@ class O {
44
44
  return this.head = t.next, t.data;
45
45
  }
46
46
  }
47
- const m = Symbol("queue"), _ = Symbol("size");
48
- class N {
47
+ const f = Symbol("queue"), d = Symbol("size");
48
+ class y {
49
49
  constructor() {
50
- this[m] = new O(), this[_] = 0;
50
+ this[f] = new T(), this[d] = 0;
51
51
  }
52
52
  get queue() {
53
- return this[m];
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[_]--, t;
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, i, s, r, o) {
80
- this._pluginName = t, this._trackingId = e, this._experienceId = i, this._solution = s, this._initializer = r, this._status = o;
79
+ constructor(t, i, s, n, r, o) {
80
+ this._pluginName = t, this._trackingId = i, this._experienceId = s, this._solution = n, this._initializer = r, this._status = o;
81
81
  }
82
82
  updateStatus(t) {
83
83
  this._status = t;
@@ -85,9 +85,9 @@ class u {
85
85
  updateInitializer(t) {
86
86
  this._initializer = t;
87
87
  }
88
- notify(t, e) {
89
- console.log("Notifying", t, e);
90
- const i = {
88
+ notify(t, i) {
89
+ console.log("Notifying", t, i);
90
+ const s = {
91
91
  pluginName: this._pluginName,
92
92
  trackingId: this._trackingId,
93
93
  experienceId: this._experienceId,
@@ -95,19 +95,19 @@ class u {
95
95
  initializer: this._initializer,
96
96
  status: this._status,
97
97
  action: t,
98
- eventDetails: e
98
+ eventDetails: i
99
99
  };
100
- window.dispatchEvent(new CustomEvent("epg-notification", { detail: i }));
100
+ window.dispatchEvent(new CustomEvent("epg-notification", { detail: s }));
101
101
  }
102
102
  }
103
- class S {
103
+ class G {
104
104
  constructor({
105
105
  trackingID: t,
106
- experienceID: e,
107
- solution: i,
108
- verboseLogging: s = !1
106
+ experienceID: i,
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 = i, this.verboseLogging = s, this.__queue = new N(), this.__epigraphNotifier = new u(
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 = i, this.solution = s, this.verboseLogging = n, this.__queue = new y(), this.__epigraphNotifier = new u(
111
111
  this.pluginName,
112
112
  this.pluginName,
113
113
  this.experienceID,
@@ -146,8 +146,8 @@ class S {
146
146
  * @param analyticsEvent
147
147
  * @param consent boolean Whether consent is granted
148
148
  */
149
- async sendEvent(t, e) {
150
- if (this.__queue.enqueue(t), !e) {
149
+ async sendEvent(t, i) {
150
+ if (this.__queue.enqueue(t), !i) {
151
151
  this.__status = c.RESTRICTED;
152
152
  return;
153
153
  }
@@ -157,8 +157,8 @@ class S {
157
157
  }
158
158
  try {
159
159
  await this.dequeueAndSendEvents();
160
- } catch (i) {
161
- this.logger(i), await this.reportFailureToNexus("EVENT_SEND_ERROR", i?.toString() || "Unknown error");
160
+ } catch (s) {
161
+ this.logger(s), await this.reportFailureToNexus("EVENT_SEND_ERROR", s?.toString() || "Unknown error");
162
162
  }
163
163
  }
164
164
  initializePlugin() {
@@ -172,8 +172,8 @@ class S {
172
172
  if (this.__initializationAttempts > 0 && t - this.__lastInitializationAttempt < this.__initializationRetryDelay)
173
173
  return;
174
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(() => {
175
+ const i = this.detectAndSetupAnalytics();
176
+ i.success ? (this.__isInitialized = !0, this.__status = c.AVAILABLE, this.__initializationMethod = i.method, this.dataLayerName = i.dataLayerName, this.dataLayer = window[this.dataLayerName], this.logger(`Successfully initialized ${i.method} with dataLayer: ${this.dataLayerName}`), this.__epigraphNotifier.notify(u.ACTION_INITIALIZED, {}), this.__queue.size > 0 && this.dequeueAndSendEvents()) : (this.logger(`Initialization attempt ${this.__initializationAttempts} failed: ${i.error}`), this.__initializationAttempts < this.__maxInitializationAttempts && setTimeout(() => {
177
177
  this.initializePlugin();
178
178
  }, this.__initializationRetryDelay));
179
179
  }
@@ -185,13 +185,13 @@ class S {
185
185
  method: "GTM",
186
186
  dataLayerName: t.dataLayerName
187
187
  };
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"), {
188
+ const i = this.findGA4Info(this.trackingID);
189
+ if (i) {
190
+ const s = i.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: i
194
+ dataLayerName: s
195
195
  };
196
196
  }
197
197
  return {
@@ -203,14 +203,14 @@ class S {
203
203
  }
204
204
  detectGTM() {
205
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";
206
+ for (const i of Array.from(t)) {
207
+ const s = i.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: s[1],
213
+ containerId: n[1],
214
214
  dataLayerName: o
215
215
  };
216
216
  }
@@ -226,12 +226,12 @@ class S {
226
226
  if (!this.__isInitialized || !this.dataLayer)
227
227
  return;
228
228
  let t = this.__queue.size;
229
- for (let e = 0; e < t; e++) {
230
- const i = this.__queue.dequeue();
229
+ for (let i = 0; i < t; i++) {
230
+ const s = this.__queue.dequeue();
231
231
  try {
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);
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
  }
@@ -241,9 +241,9 @@ class S {
241
241
  * @private
242
242
  */
243
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));
244
+ let i = t.getGTMParameters(this.solution, this.experienceID, this.trackingID);
245
+ const s = i;
246
+ this.isValidPayload(i) || (i = await this.convertGTMParametersToEpgEventTag(t.eventName, i)), this.dataLayer && (this.dataLayer.push(i), this.__epigraphNotifier.notify(u.ACTION_SEND_EVENT, s));
247
247
  }
248
248
  /**
249
249
  * Send events to GA4 via Google Analytics 4.
@@ -251,9 +251,9 @@ class S {
251
251
  * @private
252
252
  */
253
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);
254
+ let i = t.getGa4Parameters(this.solution, this.experienceID, this.trackingID);
255
+ const s = i;
256
+ this.isValidPayload(i) || (i = await this.convertGA4ParametersToEpgEventTag(i)), window.gtag("event", t.eventName, i), 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 [s, r] of Object.entries(t))
270
- if (s !== "items" && (s.length > 40 || String(r).length > 100))
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
  }
@@ -279,16 +279,16 @@ class S {
279
279
  * @param {Record<string, unknown>} parameterPayload - A key-value pair object containing the parameters to be converted.
280
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.
281
281
  */
282
- async convertGTMParametersToEpgEventTag(t, e) {
282
+ async convertGTMParametersToEpgEventTag(t, i) {
283
283
  try {
284
- let i = await this.sendGA4LongParameters(e);
284
+ let s = await this.sendGA4LongParameters(i);
285
285
  return {
286
286
  event: t,
287
- epg_event_tag: i,
287
+ epg_event_tag: s,
288
288
  send_to: this.trackingID
289
289
  };
290
290
  } catch {
291
- return e;
291
+ return i;
292
292
  }
293
293
  }
294
294
  /**
@@ -315,55 +315,55 @@ 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", i = { parameters: t };
318
+ const i = "https://api.myepigraph.com/api/analytics/ga4/custom", s = { parameters: t };
319
319
  try {
320
- const s = await fetch(e, {
320
+ const n = await fetch(i, {
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(i)
327
+ body: JSON.stringify(s)
328
328
  });
329
- return s.ok ? (await s.json())?.id ?? "" : "";
329
+ return n.ok ? (await n.json())?.id ?? "" : "";
330
330
  } catch {
331
331
  return "";
332
332
  }
333
333
  }
334
- async reportFailureToNexus(t, e) {
334
+ async reportFailureToNexus(t, i) {
335
335
  try {
336
- const i = {
336
+ const s = {
337
337
  plugin: "GA4",
338
338
  trackingId: this.trackingID,
339
339
  solution: this.solution,
340
340
  experienceId: this.experienceID,
341
341
  failureType: t,
342
- errorMessage: e,
342
+ errorMessage: i,
343
343
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
344
344
  url: window.location.href,
345
345
  userAgent: navigator.userAgent
346
346
  };
347
- this.logger(`Failure reported to Nexus: ${JSON.stringify(i)}`);
348
- } catch (i) {
349
- this.logger(`Error reporting failure to Nexus: ${i}`);
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 i = window.google_tag_manager[t];
355
- if (i && i.dataLayerName)
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: i.dataLayerName
359
+ l: s.dataLayerName
360
360
  };
361
361
  }
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());
362
+ const i = document.querySelectorAll("script[src]");
363
+ for (const s of i) {
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 L {
377
+ class R {
378
378
  constructor({
379
379
  trackingID: t,
380
- experienceID: e,
381
- solution: i,
382
- sessionId: s,
380
+ experienceID: i,
381
+ solution: s,
382
+ sessionId: n,
383
383
  xPath: r,
384
384
  verboseLogging: o = !1,
385
- sendToStaging: y = !1
385
+ sendToStaging: P = !1
386
386
  }) {
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(
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 = i, this.solution = s, this.verboseLogging = o, this.__queue = new y(), this.url = P ? "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,
@@ -413,8 +413,8 @@ class L {
413
413
  }
414
414
  setupPlugin() {
415
415
  }
416
- async sendEvent(t, e) {
417
- if (this.__queue.enqueue(t), !e) {
416
+ async sendEvent(t, i) {
417
+ if (this.__queue.enqueue(t), !i) {
418
418
  this.__status = c.RESTRICTED, this.__epigraphNotifier.updateStatus(this.__status);
419
419
  return;
420
420
  }
@@ -422,12 +422,12 @@ 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(), i = {
425
+ const i = this.__queue.dequeue(), s = {
426
426
  send_to: this.trackingID,
427
427
  experience_id: this.experienceID,
428
428
  solution: this.solution,
429
- event: e.eventName,
430
- parameters: e.getNexusParameters()
429
+ event: i.eventName,
430
+ parameters: i.getNexusParameters()
431
431
  };
432
432
  try {
433
433
  return (await fetch(this.url, {
@@ -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(i)
444
- })).ok && this.__epigraphNotifier.notify(u.ACTION_SEND_EVENT, i), "";
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 C {
453
+ class z {
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((i) => {
466
- i === this.consentIdentifier && (this.consent = !0, this.consentSet = !0);
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 f = /* @__PURE__ */ ((n) => (n.OneTrust = "onetrust", n))(f || {});
479
+ var N = /* @__PURE__ */ ((e) => (e.OneTrust = "onetrust", e))(N || {});
480
480
  class a {
481
481
  constructor({
482
482
  eventName: t,
483
- interactiveEvent: e,
484
- customParameters: i
483
+ interactiveEvent: i,
484
+ customParameters: s
485
485
  }) {
486
- this.eventName = t, this.interactiveEvent = e, this.customParameters = i;
486
+ this.eventName = t, this.interactiveEvent = i, this.customParameters = s;
487
487
  }
488
- getGa4Parameters(t, e, i) {
489
- let s = {
488
+ getGa4Parameters(t, i, s) {
489
+ let n = {
490
490
  solution: t,
491
- experience_id: e,
491
+ experience_id: i,
492
492
  interactive_event: this.interactiveEvent,
493
- send_to: i
493
+ send_to: s
494
494
  };
495
- return s = Object.assign(s, JSON.parse(JSON.stringify(this.customParameters))), s;
495
+ return n = Object.assign(n, JSON.parse(JSON.stringify(this.customParameters))), n;
496
496
  }
497
- getGTMParameters(t, e, i) {
498
- let s = {
497
+ getGTMParameters(t, i, s) {
498
+ let n = {
499
499
  solution: t,
500
- experience_id: e,
500
+ experience_id: i,
501
501
  event: this.eventName,
502
502
  interactive_event: this.interactiveEvent,
503
- send_to: i
503
+ send_to: s
504
504
  };
505
- return s = Object.assign(s, JSON.parse(JSON.stringify(this.customParameters))), s;
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
- 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
- };
538
- class w extends a {
514
+ var g = /* @__PURE__ */ ((e) => (e.AR = "ar", e.QR = "qr", e.INFO = "info", e.DOWNLOAD = "download", e.PREVIEW_CART = "preview_cart", e.HOTSPOT_PANEL = "hotspot_panel", e.SHARE_MODAL = "share_modal", e.RESTART_MODAL = "restart_modal", e.REMOVE_MODAL = "remove_modal", e.LOAD_PRECONFIG_MODAL = "load_preconfig_modal", e.MOVE_MODAL = "move_modal", e.OUT_OF_STOCK_MODAL = "out_of_stock_modal", e))(g || {}), v = /* @__PURE__ */ ((e) => (e.AUTO = "auto", e.BUTTON = "button", e.HOTSPOT = "hotspot", e.GESTURE = "gesture", e))(v || {}), l = /* @__PURE__ */ ((e) => (e.USD = "USD", e.EUR = "EUR", e.GBP = "GBP", e.CAD = "CAD", e))(l || {}), A = /* @__PURE__ */ ((e) => (e.AR = "ar", e.QR = "qr", e.WEBGL2 = "webgl2", e))(A || {}), C = /* @__PURE__ */ ((e) => (e.AR_VIEW = "ar_view", e.DIMENSION_TOGGLE = "dimension_toggle", e.HOTSPOTS_TOGGLE = "hotspots_toggle", e.HELP_TOGGLE = "help_toggle", e.UTILITY_MENU_TOGGLE = "utility_menu_toggle", e.HOTSPOT_ENTER = "hotspot_enter", e.HOTSPOT_EXIT = "hotspot_exit", e.SHARE = "share", e.PDF_DOWNLOAD = "pdf_download", e.COPY = "copy", e.RESTART = "restart", e.INSTRUCTIONS_SHOW = "show_instructions", e.REVIEW_CART = "review_cart", e.SHOP_NOW = "shop_now", e.SUB_CATEGORY = "sub_category", e.NEXT_STEP = "next_step", e.PREVIOUS_STEP = "previous_step", e))(C || {}), O = /* @__PURE__ */ ((e) => (e.ZOOM = "zoom", e.ROTATE = "rotate", e))(O || {}), S = /* @__PURE__ */ ((e) => (e.ROTATE = "rotate", e.ZOOM = "zoom", e.PAN = "pan", e))(S || {}), w = /* @__PURE__ */ ((e) => (e.CONFIGURATION = "configuration", e.SCENE = "scene", e.PRODUCT = "product", e))(w || {}), L = /* @__PURE__ */ ((e) => (e.FACEBOOK = "facebook", e.TWITTER = "twitter", e.EMAIL = "email", e.COPY_LINK = "copy_link", e.WHATSAPP = "whatsapp", e.LINKEDIN = "linkedin", e))(L || {});
515
+ class M 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 R extends a {
526
+ class q extends a {
550
527
  constructor(t) {
551
528
  super({
552
529
  eventName: "epigraph_module_loading",
@@ -557,32 +534,32 @@ class R extends a {
557
534
  });
558
535
  }
559
536
  }
560
- class x extends a {
561
- constructor(t, e) {
537
+ class b extends a {
538
+ constructor(t, i) {
562
539
  super({
563
540
  eventName: "epigraph_module_ready",
564
541
  interactiveEvent: !1,
565
542
  customParameters: {
566
543
  is_pre_config: t,
567
- load_time_ms: e
544
+ load_time_ms: i
568
545
  }
569
546
  });
570
547
  }
571
548
  }
572
- class D extends a {
573
- constructor(t, e, i) {
549
+ class k extends a {
550
+ constructor(t, i, s) {
574
551
  super({
575
552
  eventName: "epigraph_module_failed",
576
553
  interactiveEvent: !1,
577
554
  customParameters: {
578
555
  is_pre_config: t,
579
- load_time_ms: e,
580
- error_type: i
556
+ load_time_ms: i,
557
+ error_type: s
581
558
  }
582
559
  });
583
560
  }
584
561
  }
585
- class z extends a {
562
+ class V extends a {
586
563
  constructor(t) {
587
564
  super({
588
565
  eventName: "epigraph_module_closed",
@@ -593,100 +570,75 @@ class z extends a {
593
570
  });
594
571
  }
595
572
  }
596
- class G extends a {
573
+ class $ 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
- constructor(t, e = {}) {
577
+ constructor(t, i = {}) {
605
578
  super({
606
579
  eventName: "epigraph_support_detected",
607
580
  interactiveEvent: !1,
608
581
  customParameters: {
609
582
  support_type: t,
610
- device_capabilities: e
583
+ device_capabilities: i
611
584
  }
612
585
  });
613
586
  }
614
587
  }
615
- class M extends a {
588
+ class F 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 = C;
639
591
  }
640
- constructor(t, e) {
592
+ constructor(t, i) {
641
593
  super({
642
594
  eventName: "epigraph_button_click",
643
595
  interactiveEvent: !0,
644
596
  customParameters: {
645
597
  button_type: t,
646
- button_name: e
598
+ button_name: i
647
599
  }
648
600
  });
649
601
  }
650
602
  }
651
- class q extends a {
603
+ class j extends a {
652
604
  static {
653
- this.PANEL_TYPE = I;
605
+ this.PANEL_TYPE = g;
654
606
  }
655
607
  static {
656
- this.TRIGGER_SOURCE = T;
608
+ this.TRIGGER_SOURCE = v;
657
609
  }
658
- constructor(t, e, i, s) {
610
+ constructor(t, i, s, n) {
659
611
  super({
660
612
  eventName: "epigraph_panel_opened",
661
613
  interactiveEvent: t,
662
614
  customParameters: {
663
- items: s,
664
- panel_type: e,
665
- trigger_source: i
615
+ items: n,
616
+ panel_type: i,
617
+ trigger_source: s
666
618
  }
667
619
  });
668
620
  }
669
621
  }
670
- class b extends a {
622
+ class U extends a {
671
623
  static {
672
- this.PANEL_TYPE = I;
624
+ this.PANEL_TYPE = g;
673
625
  }
674
626
  static {
675
- this.TRIGGER_SOURCE = T;
627
+ this.TRIGGER_SOURCE = v;
676
628
  }
677
- constructor(t, e, i, s) {
629
+ constructor(t, i, s, n) {
678
630
  super({
679
631
  eventName: "epigraph_panel_closed",
680
632
  interactiveEvent: t,
681
633
  customParameters: {
682
- items: s,
683
- panel_type: e,
684
- trigger_source: i
634
+ items: n,
635
+ panel_type: i,
636
+ trigger_source: s
685
637
  }
686
638
  });
687
639
  }
688
640
  }
689
- class U extends a {
641
+ class H 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 k extends a {
652
+ class W extends a {
701
653
  static {
702
- this.ACTION_PERFORMED = {
703
- ZOOM: "zoom",
704
- ROTATE: "rotate"
705
- };
654
+ this.ACTION_PERFORMED = O;
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 V extends a {
666
+ class J extends a {
718
667
  static {
719
- this.INTERACTION_TYPE = {
720
- ROTATE: "rotate",
721
- ZOOM: "zoom",
722
- PAN: "pan"
723
- };
668
+ this.INTERACTION_TYPE = S;
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 $ extends a {
680
+ class Z extends a {
736
681
  static {
737
682
  this.CURRENCY = l;
738
683
  }
739
- constructor(t, e, i, s, r) {
684
+ constructor(t, i, s, n, r) {
740
685
  super({
741
686
  eventName: "epigraph_item_added",
742
687
  interactiveEvent: t,
743
688
  customParameters: {
744
689
  items: r,
745
- value: e,
746
- currency: i,
747
- quantity: s
690
+ value: i,
691
+ currency: s,
692
+ quantity: n
748
693
  }
749
694
  });
750
695
  }
751
696
  }
752
- class H extends a {
697
+ class K extends a {
753
698
  constructor(t) {
754
699
  super({
755
700
  eventName: "epigraph_item_moved",
@@ -760,44 +705,50 @@ class H extends a {
760
705
  });
761
706
  }
762
707
  }
763
- class F extends a {
708
+ class X extends a {
764
709
  static {
765
710
  this.CURRENCY = l;
766
711
  }
767
- constructor(t, e, i, s) {
712
+ constructor(t, i, s, n) {
768
713
  super({
769
714
  eventName: "epigraph_item_removed",
770
715
  interactiveEvent: !0,
771
716
  customParameters: {
772
- items: s,
717
+ items: n,
773
718
  value: t,
774
- currency: e,
775
- quantity: i
719
+ currency: i,
720
+ quantity: s
776
721
  }
777
722
  });
778
723
  }
779
724
  }
780
- class B extends a {
781
- constructor(t, e) {
725
+ class Q extends a {
726
+ constructor(t, i) {
782
727
  super({
783
728
  eventName: "epigraph_variant_changed",
784
729
  interactiveEvent: !0,
785
730
  customParameters: {
786
- items: e,
731
+ items: i,
787
732
  change_type: t
788
733
  }
789
734
  });
790
735
  }
791
736
  }
792
- class j extends a {
793
- constructor(t, e, i) {
737
+ class B extends a {
738
+ static {
739
+ this.CONTENT_TYPES = w;
740
+ }
741
+ static {
742
+ this.SHARE_DESTINATIONS = L;
743
+ }
744
+ constructor(t, i, s) {
794
745
  super({
795
746
  eventName: "epigraph_content_shared",
796
747
  interactiveEvent: !0,
797
748
  customParameters: {
798
- items: i,
749
+ items: s,
799
750
  content_type: t,
800
- share_destination: e
751
+ share_destination: i
801
752
  }
802
753
  });
803
754
  }
@@ -806,35 +757,35 @@ class Y extends a {
806
757
  static {
807
758
  this.CURRENCY = l;
808
759
  }
809
- constructor(t, e, i) {
760
+ constructor(t, i, s) {
810
761
  super({
811
762
  eventName: "epigraph_checkout",
812
763
  interactiveEvent: !0,
813
764
  customParameters: {
814
- items: i,
765
+ items: s,
815
766
  value: t,
816
- currency: e
767
+ currency: i
817
768
  }
818
769
  });
819
770
  }
820
771
  }
821
- class W extends a {
772
+ class tt extends a {
822
773
  static {
823
774
  this.CURRENCY = l;
824
775
  }
825
- constructor(t, e, i) {
776
+ constructor(t, i, s) {
826
777
  super({
827
778
  eventName: "epigraph_conversion",
828
779
  interactiveEvent: !0,
829
780
  customParameters: {
830
- items: i,
781
+ items: s,
831
782
  value: t,
832
- currency: e
783
+ currency: i
833
784
  }
834
785
  });
835
786
  }
836
787
  }
837
- class J extends a {
788
+ class et extends a {
838
789
  constructor(t) {
839
790
  super({
840
791
  eventName: "epigraph_changeRate",
@@ -845,7 +796,7 @@ class J extends a {
845
796
  });
846
797
  }
847
798
  }
848
- class Z extends a {
799
+ class it extends a {
849
800
  constructor(t) {
850
801
  super({
851
802
  eventName: "epigraph_completionRate",
@@ -856,7 +807,7 @@ class Z extends a {
856
807
  });
857
808
  }
858
809
  }
859
- class X extends a {
810
+ class st extends a {
860
811
  constructor(t) {
861
812
  super({
862
813
  eventName: "epigraph_engagementRate",
@@ -867,12 +818,12 @@ class X extends a {
867
818
  });
868
819
  }
869
820
  }
870
- class K extends a {
871
- constructor(t, e, i) {
821
+ class nt extends a {
822
+ constructor(t, i, s) {
872
823
  super({
873
824
  eventName: t,
874
- interactiveEvent: e,
875
- customParameters: i
825
+ interactiveEvent: i,
826
+ customParameters: s
876
827
  });
877
828
  }
878
829
  }
@@ -892,18 +843,18 @@ class K extends a {
892
843
  * See the License for the specific language governing permissions and
893
844
  * limitations under the License.
894
845
  */
895
- var A;
846
+ var x;
896
847
  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);
848
+ x = h;
849
+ class at {
850
+ constructor(t, i) {
851
+ this[x] = /* @__PURE__ */ new Map(), this.__consentPlugin = null, t && i && (this.__consentPlugin = this.buildConsentPlugin(t, i)), window.addEventListener("epigraphAnalyticsConsentChange", this.__onConsentChangeFromEvent);
901
852
  }
902
853
  __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);
854
+ let i = t;
855
+ this.__overrideConsent = i.detail.hasConsent;
856
+ for (const s of this[h].values())
857
+ this.__hasConsent() || s.setStatus(c.RESTRICTED);
907
858
  }
908
859
  /**
909
860
  * Epigraph Analytics uses plugins to send events to multiple trackers at a time. You can create a customer tracker
@@ -934,8 +885,8 @@ class Q {
934
885
  * @param eventData
935
886
  */
936
887
  sendEvent(t) {
937
- this[h].forEach((e) => {
938
- e.sendEvent(t, this.__hasConsent());
888
+ this[h].forEach((i) => {
889
+ i.sendEvent(t, this.__hasConsent());
939
890
  });
940
891
  }
941
892
  /**
@@ -944,37 +895,46 @@ class Q {
944
895
  * @param consentIdentifier
945
896
  * @private
946
897
  */
947
- buildConsentPlugin(t, e) {
948
- return t.toLowerCase() === f.OneTrust.toLowerCase() ? new C(e) : null;
898
+ buildConsentPlugin(t, i) {
899
+ return t.toLowerCase() === N.OneTrust.toLowerCase() ? new z(i) : null;
949
900
  }
950
901
  }
951
902
  export {
952
- f as ConsentPluginNames,
953
- U as EpigraphAddToFavouritesEvent,
954
- Q as EpigraphAnalytics,
955
- w as EpigraphArRequestedEvent,
956
- M as EpigraphButtonClickEvent,
957
- J as EpigraphChangeRateEvent,
903
+ O as ACTION_PERFORMED,
904
+ C as BUTTON_TYPE,
905
+ w as CONTENT_TYPES,
906
+ l as CURRENCY,
907
+ N as ConsentPluginNames,
908
+ H as EpigraphAddToFavouritesEvent,
909
+ at as EpigraphAnalytics,
910
+ M as EpigraphArRequestedEvent,
911
+ F as EpigraphButtonClickEvent,
912
+ et as EpigraphChangeRateEvent,
958
913
  Y as EpigraphCheckoutEvent,
959
- Z as EpigraphCompletionRateEvent,
960
- j as EpigraphContentSharedEvent,
961
- W as EpigraphConversionEvent,
962
- K as EpigraphCustomEvent,
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
914
+ it as EpigraphCompletionRateEvent,
915
+ B as EpigraphContentSharedEvent,
916
+ tt as EpigraphConversionEvent,
917
+ nt as EpigraphCustomEvent,
918
+ st as EpigraphEngagementRateEvent,
919
+ Z as EpigraphItemAddedEvent,
920
+ K as EpigraphItemMovedEvent,
921
+ X as EpigraphItemRemovedEvent,
922
+ W as EpigraphKeyboardInteractionEvent,
923
+ V as EpigraphModuleClosedEvent,
924
+ k as EpigraphModuleFailedEvent,
925
+ q as EpigraphModuleLoadingEvent,
926
+ b as EpigraphModuleReadyEvent,
927
+ U as EpigraphPanelClosedEvent,
928
+ j as EpigraphPanelOpenedEvent,
929
+ $ as EpigraphSupportDetectedEvent,
930
+ J as EpigraphTouchInteractionEvent,
931
+ Q as EpigraphVariantChangedEvent,
932
+ G as GA4AnalyticsPlugin,
933
+ S as INTERACTION_TYPE,
934
+ R as NexusAnalyticsPlugin,
935
+ z as OneTrustConsentPlugin,
936
+ g as PANEL_TYPE,
937
+ L as SHARE_DESTINATIONS,
938
+ A as SUPPORT_TYPE,
939
+ v as TRIGGER_SOURCE
980
940
  };