@epigraph/epigraph-std-lib 4.7.1-alpha → 5.0.0-alpha.1

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,42 +1,42 @@
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 {
1
+ var c = /* @__PURE__ */ ((e) => (e.UNAVAILABLE = "unavailable", e.AVAILABLE = "available", e.RESTRICTED = "restricted", e))(c || {});
2
+ const E = Symbol("data"), p = Symbol("next"), z = class N {
3
3
  constructor(t) {
4
- this[m] = t, this[_] = null;
4
+ this[E] = t, this[p] = null;
5
5
  }
6
6
  get data() {
7
- return this[m];
7
+ return this[E];
8
8
  }
9
9
  set next(t) {
10
- if (!(t instanceof I) && t !== null)
10
+ if (!(t instanceof N) && t !== null)
11
11
  throw new Error(
12
12
  "This node is not an instance of the custom class 'Node'."
13
13
  );
14
- this[_] = t;
14
+ this[p] = t;
15
15
  }
16
16
  get next() {
17
- return this[_];
17
+ return this[p];
18
18
  }
19
19
  };
20
- let E = L;
21
- const p = Symbol("head");
22
- class D {
20
+ let f = z;
21
+ const _ = Symbol("head");
22
+ class R {
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 f(t);
38
38
  }
39
- return this.head = new E(t);
39
+ return this.head = new f(t);
40
40
  }
41
41
  removeHead() {
42
42
  const t = this.head;
@@ -44,13 +44,13 @@ class D {
44
44
  return this.head = t.next, t.data;
45
45
  }
46
46
  }
47
- const f = Symbol("queue"), d = Symbol("size");
48
- class N {
47
+ const I = Symbol("queue"), d = Symbol("size");
48
+ class y {
49
49
  constructor() {
50
- this[f] = new D(), this[d] = 0;
50
+ this[I] = new R(), this[d] = 0;
51
51
  }
52
52
  get queue() {
53
- return this[f];
53
+ return this[I];
54
54
  }
55
55
  get size() {
56
56
  return this[d];
@@ -76,8 +76,8 @@ class u {
76
76
  static {
77
77
  this.ACTION_FAILED_INITIALIZATION = "initialization-failed";
78
78
  }
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;
79
+ constructor(t, i, n, s, r, o) {
80
+ this._pluginName = t, this._trackingId = i, this._experienceId = n, this._solution = s, 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 s = {
88
+ notify(t, i) {
89
+ console.log("Notifying", t, i);
90
+ const n = {
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: s }));
100
+ window.dispatchEvent(new CustomEvent("epg-notification", { detail: n }));
101
101
  }
102
102
  }
103
- class z {
103
+ class D {
104
104
  constructor({
105
105
  trackingID: t,
106
- experienceID: e,
107
- solution: s,
108
- verboseLogging: n = !1
106
+ experienceID: i,
107
+ solution: n,
108
+ verboseLogging: s = !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 = s, this.verboseLogging = n, 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 = n, this.verboseLogging = s, 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 z {
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 z {
157
157
  }
158
158
  try {
159
159
  await this.dequeueAndSendEvents();
160
- } catch (s) {
161
- this.logger(s), await this.reportFailureToNexus("EVENT_SEND_ERROR", s?.toString() || "Unknown error");
160
+ } catch (n) {
161
+ this.logger(n), await this.reportFailureToNexus("EVENT_SEND_ERROR", n?.toString() || "Unknown error");
162
162
  }
163
163
  }
164
164
  initializePlugin() {
@@ -172,8 +172,8 @@ class z {
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 z {
185
185
  method: "GTM",
186
186
  dataLayerName: t.dataLayerName
187
187
  };
188
- const e = this.findGA4Info(this.trackingID);
189
- if (e) {
190
- const s = e.l || "dataLayer";
191
- return this.logger(`GA4 script found, setting up with dataLayer: ${s}`), this.__epigraphNotifier.updateInitializer("GA4"), {
188
+ const i = this.findGA4Info(this.trackingID);
189
+ if (i) {
190
+ const n = i.l || "dataLayer";
191
+ return this.logger(`GA4 script found, setting up with dataLayer: ${n}`), this.__epigraphNotifier.updateInitializer("GA4"), {
192
192
  success: !0,
193
193
  method: "GA4",
194
- dataLayerName: s
194
+ dataLayerName: n
195
195
  };
196
196
  }
197
197
  return {
@@ -203,14 +203,14 @@ class z {
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 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";
206
+ for (const i of Array.from(t)) {
207
+ const n = i.getAttribute("src");
208
+ if (n) {
209
+ const s = n.match(/gtm\.js\?id=([^&]+)/);
210
+ if (s && s.length > 0) {
211
+ const r = n.match(/&l=([^&]+)/), o = r ? r[1] : "dataLayer";
212
212
  return {
213
- containerId: n[1],
213
+ containerId: s[1],
214
214
  dataLayerName: o
215
215
  };
216
216
  }
@@ -226,12 +226,12 @@ class z {
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 s = this.__queue.dequeue();
229
+ for (let i = 0; i < t; i++) {
230
+ const n = this.__queue.dequeue();
231
231
  try {
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);
232
+ this.__initializationMethod === "GTM" ? (this.sendGTMEvent(n), this.__sentEventCount++, this.logger(`Analytics event successfully sent via ${this.__initializationMethod}: ${n.eventName}`)) : this.__initializationMethod === "GA4" ? (this.sendGA4Event(n), this.__sentEventCount++, this.logger(`Analytics event successfully sent via ${this.__initializationMethod}: ${n.eventName}`)) : this.__queue.enqueue(n);
233
+ } catch (s) {
234
+ this.logger(`Error sending event ${n.eventName}: ${s}`), this.__queue.enqueue(n);
235
235
  }
236
236
  }
237
237
  }
@@ -241,9 +241,9 @@ class z {
241
241
  * @private
242
242
  */
243
243
  async sendGTMEvent(t) {
244
- let e = t.getGTMParameters(this.solution, this.experienceID, this.trackingID);
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));
244
+ let i = t.getGTMParameters(this.solution, this.experienceID, this.trackingID);
245
+ const n = 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, n));
247
247
  }
248
248
  /**
249
249
  * Send events to GA4 via Google Analytics 4.
@@ -251,9 +251,9 @@ class z {
251
251
  * @private
252
252
  */
253
253
  async sendGA4Event(t) {
254
- let e = t.getGa4Parameters(this.solution, this.experienceID, this.trackingID);
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);
254
+ let i = t.getGa4Parameters(this.solution, this.experienceID, this.trackingID);
255
+ const n = i;
256
+ this.isValidPayload(i) || (i = await this.convertGA4ParametersToEpgEventTag(i)), window.gtag("event", t.eventName, i), this.__epigraphNotifier.notify(u.ACTION_SEND_EVENT, n);
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 z {
266
266
  isValidPayload(t) {
267
267
  if (Object.keys(t).length >= 25)
268
268
  return !1;
269
- for (const [n, r] of Object.entries(t))
270
- if (n !== "items" && (n.length > 40 || String(r).length > 100))
269
+ for (const [s, r] of Object.entries(t))
270
+ if (s !== "items" && (s.length > 40 || String(r).length > 100))
271
271
  return !1;
272
272
  return !0;
273
273
  }
@@ -279,16 +279,16 @@ class z {
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 s = await this.sendGA4LongParameters(e);
284
+ let n = await this.sendGA4LongParameters(i);
285
285
  return {
286
286
  event: t,
287
- epg_event_tag: s,
287
+ epg_event_tag: n,
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 z {
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", s = { parameters: t };
318
+ const i = "https://api.myepigraph.com/api/analytics/ga4/custom", n = { parameters: t };
319
319
  try {
320
- const n = await fetch(e, {
320
+ const s = 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(s)
327
+ body: JSON.stringify(n)
328
328
  });
329
- return n.ok ? (await n.json())?.id ?? "" : "";
329
+ return s.ok ? (await s.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 s = {
336
+ const n = {
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(s)}`);
348
- } catch (s) {
349
- this.logger(`Error reporting failure to Nexus: ${s}`);
347
+ this.logger(`Failure reported to Nexus: ${JSON.stringify(n)}`);
348
+ } catch (n) {
349
+ this.logger(`Error reporting failure to Nexus: ${n}`);
350
350
  }
351
351
  }
352
352
  findGA4Info(t) {
353
353
  if (window.google_tag_manager && window.google_tag_manager[t]) {
354
- const s = window.google_tag_manager[t];
355
- if (s && s.dataLayerName)
354
+ const n = window.google_tag_manager[t];
355
+ if (n && n.dataLayerName)
356
356
  return {
357
357
  fullSrc: "",
358
358
  id: t,
359
- l: s.dataLayerName
359
+ l: n.dataLayerName
360
360
  };
361
361
  }
362
- const e = document.querySelectorAll("script[src]");
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());
362
+ const i = document.querySelectorAll("script[src]");
363
+ for (const n of i) {
364
+ const s = n.getAttribute("src");
365
+ if (s && s.includes(t)) {
366
+ const r = new URL(s, 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 z {
374
374
  return null;
375
375
  }
376
376
  }
377
- class T {
377
+ class q {
378
378
  constructor({
379
379
  trackingID: t,
380
- experienceID: e,
381
- solution: s,
382
- sessionId: n,
380
+ experienceID: i,
381
+ solution: n,
382
+ sessionId: s,
383
383
  xPath: r,
384
384
  verboseLogging: o = !1,
385
- sendToStaging: x = !1
385
+ sendToStaging: P = !1
386
386
  }) {
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(
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 = i, this.solution = n, 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 T {
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 T {
422
422
  }
423
423
  async dequeueAndSendEvents() {
424
424
  for (let t = 0; t < this.__queue.size; t++) {
425
- const e = this.__queue.dequeue(), s = {
425
+ const i = this.__queue.dequeue(), n = {
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 T {
440
440
  "EPG-XPATH": this.xPath,
441
441
  Origin: typeof window < "u" ? window.location.origin : ""
442
442
  },
443
- body: JSON.stringify(s)
444
- })).ok && this.__epigraphNotifier.notify(u.ACTION_SEND_EVENT, s), "";
443
+ body: JSON.stringify(n)
444
+ })).ok && this.__epigraphNotifier.notify(u.ACTION_SEND_EVENT, n), "";
445
445
  } catch {
446
446
  return "";
447
447
  }
@@ -450,7 +450,7 @@ class T {
450
450
  return "";
451
451
  }
452
452
  }
453
- class P {
453
+ class G {
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 P {
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((s) => {
466
- s === this.consentIdentifier && (this.consent = !0, this.consentSet = !0);
465
+ t !== void 0 && t.split(",").forEach((n) => {
466
+ n === this.consentIdentifier && (this.consent = !0, this.consentSet = !0);
467
467
  });
468
468
  }
469
469
  return this.consent;
@@ -476,33 +476,33 @@ class P {
476
476
  });
477
477
  }
478
478
  }
479
- var y = /* @__PURE__ */ ((i) => (i.OneTrust = "onetrust", i))(y || {});
479
+ var A = /* @__PURE__ */ ((e) => (e.OneTrust = "onetrust", e))(A || {});
480
480
  class a {
481
481
  constructor({
482
482
  eventName: t,
483
- interactiveEvent: e,
484
- customParameters: s
483
+ interactiveEvent: i,
484
+ customParameters: n
485
485
  }) {
486
- this.eventName = t, this.interactiveEvent = e, this.customParameters = s;
486
+ this.eventName = t, this.interactiveEvent = i, this.customParameters = n;
487
487
  }
488
- getGa4Parameters(t, e, s) {
489
- let n = {
488
+ getGa4Parameters(t, i, n) {
489
+ let s = {
490
490
  solution: t,
491
- experience_id: e,
491
+ experience_id: i,
492
492
  interactive_event: this.interactiveEvent,
493
- send_to: s
493
+ send_to: n
494
494
  };
495
- return n = Object.assign(n, JSON.parse(JSON.stringify(this.customParameters))), n;
495
+ return s = Object.assign(s, JSON.parse(JSON.stringify(this.customParameters))), s;
496
496
  }
497
- getGTMParameters(t, e, s) {
498
- let n = {
497
+ getGTMParameters(t, i, n) {
498
+ let s = {
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: s
503
+ send_to: n
504
504
  };
505
- return n = Object.assign(n, JSON.parse(JSON.stringify(this.customParameters))), n;
505
+ return s = Object.assign(s, JSON.parse(JSON.stringify(this.customParameters))), s;
506
506
  }
507
507
  getNexusParameters() {
508
508
  let t = {
@@ -511,8 +511,8 @@ class a {
511
511
  return t = Object.assign(t, JSON.parse(JSON.stringify(this.customParameters))), t;
512
512
  }
513
513
  }
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 {
514
+ var C = /* @__PURE__ */ ((e) => (e.VARIANT = "variant", e.CATEGORY_VARIANT = "category_variant", e.GEOMETRY = "geometry", e.CATEGORY_GEOMETRY = "category_geometry", e.GLOBAL = "global", e))(C || {}), 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 || {}), O = /* @__PURE__ */ ((e) => (e.NETWORK = "network", e.EXPERIENCE_CONFIG_ERROR = "experience-config-error", e.SCENE_LOAD_ERROR = "scene-load-error", e.INITIAL_SCENE_LOAD_ERROR = "initial-scene-load-error", e.AUTHENTICATION_FAILED = "authentication-failed", e))(O || {}), 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 || {}), w = /* @__PURE__ */ ((e) => (e.AR = "ar", e.QR = "qr", e.AR_WEBGL2 = "ar-webgl2", e.QR_WEBGL2 = "qr-webgl2", e))(w || {}), L = /* @__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))(L || {}), m = /* @__PURE__ */ ((e) => (e.ZOOM = "zoom", e.ROTATE = "rotate", e.PAN = "pan", e))(m || {}), S = /* @__PURE__ */ ((e) => (e.CONFIGURATION = "configuration", e.SCENE = "scene", e.PRODUCT = "product", e))(S || {}), x = /* @__PURE__ */ ((e) => (e.FACEBOOK = "facebook", e.TWITTER = "twitter", e.EMAIL = "email", e.COPY_LINK = "copy_link", e.WHATSAPP = "whatsapp", e.LINKEDIN = "linkedin", e))(x || {});
515
+ class M extends a {
516
516
  constructor(t) {
517
517
  super({
518
518
  eventName: "epigraph_ar_requested",
@@ -523,7 +523,7 @@ class R extends a {
523
523
  });
524
524
  }
525
525
  }
526
- class q extends a {
526
+ class b extends a {
527
527
  constructor(t) {
528
528
  super({
529
529
  eventName: "epigraph_module_loading",
@@ -534,32 +534,35 @@ class q extends a {
534
534
  });
535
535
  }
536
536
  }
537
- class M extends a {
538
- constructor(t, e) {
537
+ class k extends a {
538
+ constructor(t, i) {
539
539
  super({
540
540
  eventName: "epigraph_module_ready",
541
541
  interactiveEvent: !1,
542
542
  customParameters: {
543
543
  is_pre_config: t,
544
- load_time_ms: e
544
+ load_time_ms: i
545
545
  }
546
546
  });
547
547
  }
548
548
  }
549
- class G extends a {
550
- constructor(t, e, s) {
549
+ class $ extends a {
550
+ static {
551
+ this.MODULE_FAILED_ERRORS = O;
552
+ }
553
+ constructor(t, i, n) {
551
554
  super({
552
555
  eventName: "epigraph_module_failed",
553
556
  interactiveEvent: !1,
554
557
  customParameters: {
555
558
  is_pre_config: t,
556
- load_time_ms: e,
557
- error_type: s
559
+ load_time_ms: i,
560
+ error_type: n
558
561
  }
559
562
  });
560
563
  }
561
564
  }
562
- class b extends a {
565
+ class V extends a {
563
566
  constructor(t) {
564
567
  super({
565
568
  eventName: "epigraph_module_closed",
@@ -570,75 +573,74 @@ class b extends a {
570
573
  });
571
574
  }
572
575
  }
573
- class k extends a {
576
+ class F extends a {
574
577
  static {
575
- this.SUPPORT_TYPE = A;
578
+ this.SUPPORT_TYPE = w;
576
579
  }
577
- constructor(t, e = {}) {
580
+ constructor(t) {
578
581
  super({
579
582
  eventName: "epigraph_support_detected",
580
583
  interactiveEvent: !1,
581
584
  customParameters: {
582
- support_type: t,
583
- device_capabilities: e
585
+ support_type: t
584
586
  }
585
587
  });
586
588
  }
587
589
  }
588
- class V extends a {
590
+ class j extends a {
589
591
  static {
590
- this.BUTTON_TYPE = S;
592
+ this.BUTTON_TYPE = L;
591
593
  }
592
- constructor(t, e) {
594
+ constructor(t, i) {
593
595
  super({
594
596
  eventName: "epigraph_button_click",
595
597
  interactiveEvent: !0,
596
598
  customParameters: {
597
599
  button_type: t,
598
- button_name: e
600
+ button_name: i
599
601
  }
600
602
  });
601
603
  }
602
604
  }
603
- class $ extends a {
605
+ class W extends a {
604
606
  static {
605
607
  this.PANEL_TYPE = g;
606
608
  }
607
609
  static {
608
610
  this.TRIGGER_SOURCE = v;
609
611
  }
610
- constructor(t, e, s, n) {
612
+ constructor(t, i, n, s) {
611
613
  super({
612
614
  eventName: "epigraph_panel_opened",
613
615
  interactiveEvent: t,
614
616
  customParameters: {
615
- items: n,
616
- panel_type: e,
617
- trigger_source: s
617
+ items: s,
618
+ panel_type: i,
619
+ trigger_source: n
618
620
  }
619
621
  });
620
622
  }
621
623
  }
622
- class H extends a {
624
+ class J extends a {
623
625
  static {
624
626
  this.PANEL_TYPE = g;
625
627
  }
626
628
  static {
627
629
  this.TRIGGER_SOURCE = v;
628
630
  }
629
- constructor(t, e, s, n) {
631
+ constructor(t, i, n, s) {
630
632
  super({
631
633
  eventName: "epigraph_panel_closed",
632
634
  interactiveEvent: t,
633
635
  customParameters: {
634
- items: n,
635
- panel_type: e,
636
- trigger_source: s
636
+ items: s,
637
+ panel_type: i,
638
+ trigger_source: n
637
639
  }
638
640
  });
639
641
  }
640
642
  }
641
- class F extends a {
643
+ class U extends a {
642
644
  constructor(t) {
643
645
  super({
644
646
  eventName: "epigraph_add_to_favourites",
@@ -649,9 +651,9 @@ class F extends a {
649
651
  });
650
652
  }
651
653
  }
652
- class j extends a {
654
+ class H extends a {
653
655
  static {
654
- this.ACTION_PERFORMED = C;
656
+ this.ACTION_PERFORMED = m;
655
657
  }
656
658
  constructor(t) {
657
659
  super({
@@ -663,9 +665,9 @@ class j extends a {
663
665
  });
664
666
  }
665
667
  }
666
- class W extends a {
668
+ class K extends a {
667
669
  static {
668
- this.INTERACTION_TYPE = O;
670
+ this.INTERACTION_TYPE = m;
669
671
  }
670
672
  constructor(t) {
671
673
  super({
@@ -677,19 +679,19 @@ class W extends a {
677
679
  });
678
680
  }
679
681
  }
680
- class J extends a {
682
+ class X extends a {
681
683
  static {
682
684
  this.CURRENCY = l;
683
685
  }
684
- constructor(t, e, s, n, r) {
686
+ constructor(t, i, n, s, r) {
685
687
  super({
686
688
  eventName: "epigraph_item_added",
687
689
  interactiveEvent: t,
688
690
  customParameters: {
689
691
  items: r,
690
- value: e,
691
- currency: s,
692
- quantity: n
692
+ value: i,
693
+ currency: n,
694
+ quantity: s
693
695
  }
694
696
  });
695
697
  }
@@ -705,81 +707,90 @@ class Z extends a {
705
707
  });
706
708
  }
707
709
  }
708
- class U extends a {
710
+ class Q extends a {
709
711
  static {
710
712
  this.CURRENCY = l;
711
713
  }
712
- constructor(t, e, s, n) {
714
+ constructor(t, i, n, s) {
713
715
  super({
714
716
  eventName: "epigraph_item_removed",
715
717
  interactiveEvent: !0,
716
718
  customParameters: {
717
- items: n,
719
+ items: s,
718
720
  value: t,
719
- currency: e,
720
- quantity: s
721
+ currency: i,
722
+ quantity: n
721
723
  }
722
724
  });
723
725
  }
724
726
  }
725
- class X extends a {
726
- constructor(t, e) {
727
+ class B extends a {
728
+ static {
729
+ this.VARIANT_CHANGE_TYPES = C;
730
+ }
731
+ constructor(t, i) {
727
732
  super({
728
733
  eventName: "epigraph_variant_changed",
729
734
  interactiveEvent: !0,
730
735
  customParameters: {
731
- items: e,
736
+ items: i,
732
737
  change_type: t
733
738
  }
734
739
  });
735
740
  }
736
741
  }
737
- class K extends a {
738
- constructor(t, e, s) {
742
+ class Y extends a {
743
+ static {
744
+ this.CONTENT_TYPES = S;
745
+ }
746
+ static {
747
+ this.SHARE_DESTINATIONS = x;
748
+ }
749
+ constructor(t, i, n) {
739
750
  super({
740
751
  eventName: "epigraph_content_shared",
741
752
  interactiveEvent: !0,
742
753
  customParameters: {
743
- items: s,
754
+ items: n,
744
755
  content_type: t,
745
- share_destination: e
756
+ share_destination: i
746
757
  }
747
758
  });
748
759
  }
749
760
  }
750
- class Q extends a {
761
+ class tt extends a {
751
762
  static {
752
763
  this.CURRENCY = l;
753
764
  }
754
- constructor(t, e, s) {
765
+ constructor(t, i, n) {
755
766
  super({
756
767
  eventName: "epigraph_checkout",
757
768
  interactiveEvent: !0,
758
769
  customParameters: {
759
- items: s,
770
+ items: n,
760
771
  value: t,
761
- currency: e
772
+ currency: i
762
773
  }
763
774
  });
764
775
  }
765
776
  }
766
- class B extends a {
777
+ class et extends a {
767
778
  static {
768
779
  this.CURRENCY = l;
769
780
  }
770
- constructor(t, e, s) {
781
+ constructor(t, i, n) {
771
782
  super({
772
783
  eventName: "epigraph_conversion",
773
784
  interactiveEvent: !0,
774
785
  customParameters: {
775
- items: s,
786
+ items: n,
776
787
  value: t,
777
- currency: e
788
+ currency: i
778
789
  }
779
790
  });
780
791
  }
781
792
  }
782
- class Y extends a {
793
+ class it extends a {
783
794
  constructor(t) {
784
795
  super({
785
796
  eventName: "epigraph_changeRate",
@@ -790,7 +801,7 @@ class Y extends a {
790
801
  });
791
802
  }
792
803
  }
793
- class tt extends a {
804
+ class nt extends a {
794
805
  constructor(t) {
795
806
  super({
796
807
  eventName: "epigraph_completionRate",
@@ -801,7 +812,7 @@ class tt extends a {
801
812
  });
802
813
  }
803
814
  }
804
- class et extends a {
815
+ class st extends a {
805
816
  constructor(t) {
806
817
  super({
807
818
  eventName: "epigraph_engagementRate",
@@ -812,12 +823,12 @@ class et extends a {
812
823
  });
813
824
  }
814
825
  }
815
- class it extends a {
816
- constructor(t, e, s) {
826
+ class at extends a {
827
+ constructor(t, i, n) {
817
828
  super({
818
829
  eventName: t,
819
- interactiveEvent: e,
820
- customParameters: s
830
+ interactiveEvent: i,
831
+ customParameters: n
821
832
  });
822
833
  }
823
834
  }
@@ -837,18 +848,18 @@ class it extends a {
837
848
  * See the License for the specific language governing permissions and
838
849
  * limitations under the License.
839
850
  */
840
- var w;
851
+ var T;
841
852
  const h = Symbol("analyticsPluginsMap");
842
- w = h;
843
- class st {
844
- constructor(t, e) {
845
- this[w] = /* @__PURE__ */ new Map(), this.__consentPlugin = null, t && e && (this.__consentPlugin = this.buildConsentPlugin(t, e)), window.addEventListener("epigraphAnalyticsConsentChange", this.__onConsentChangeFromEvent);
853
+ T = h;
854
+ class rt {
855
+ constructor(t, i) {
856
+ this[T] = /* @__PURE__ */ new Map(), this.__consentPlugin = null, t && i && (this.__consentPlugin = this.buildConsentPlugin(t, i)), window.addEventListener("epigraphAnalyticsConsentChange", this.__onConsentChangeFromEvent);
846
857
  }
847
858
  __onConsentChangeFromEvent(t) {
848
- let e = t;
849
- this.__overrideConsent = e.detail.hasConsent;
850
- for (const s of this[h].values())
851
- this.__hasConsent() || s.setStatus(c.RESTRICTED);
859
+ let i = t;
860
+ this.__overrideConsent = i.detail.hasConsent;
861
+ for (const n of this[h].values())
862
+ this.__hasConsent() || n.setStatus(c.RESTRICTED);
852
863
  }
853
864
  /**
854
865
  * Epigraph Analytics uses plugins to send events to multiple trackers at a time. You can create a customer tracker
@@ -879,8 +890,8 @@ class st {
879
890
  * @param eventData
880
891
  */
881
892
  sendEvent(t) {
882
- this[h].forEach((e) => {
883
- e.sendEvent(t, this.__hasConsent());
893
+ this[h].forEach((i) => {
894
+ i.sendEvent(t, this.__hasConsent());
884
895
  });
885
896
  }
886
897
  /**
@@ -889,44 +900,47 @@ class st {
889
900
  * @param consentIdentifier
890
901
  * @private
891
902
  */
892
- buildConsentPlugin(t, e) {
893
- return t.toLowerCase() === y.OneTrust.toLowerCase() ? new P(e) : null;
903
+ buildConsentPlugin(t, i) {
904
+ return t.toLowerCase() === A.OneTrust.toLowerCase() ? new G(i) : null;
894
905
  }
895
906
  }
896
907
  export {
897
- C as ACTION_PERFORMED,
898
- S as BUTTON_TYPE,
908
+ m as ACTION_PERFORMED,
909
+ L as BUTTON_TYPE,
910
+ S as CONTENT_TYPES,
899
911
  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,
912
+ A as ConsentPluginNames,
913
+ U as EpigraphAddToFavouritesEvent,
914
+ rt as EpigraphAnalytics,
915
+ M as EpigraphArRequestedEvent,
916
+ j as EpigraphButtonClickEvent,
917
+ it as EpigraphChangeRateEvent,
918
+ tt as EpigraphCheckoutEvent,
919
+ nt as EpigraphCompletionRateEvent,
920
+ Y as EpigraphContentSharedEvent,
921
+ et as EpigraphConversionEvent,
922
+ at as EpigraphCustomEvent,
923
+ st as EpigraphEngagementRateEvent,
924
+ X as EpigraphItemAddedEvent,
913
925
  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,
926
+ Q as EpigraphItemRemovedEvent,
927
+ H as EpigraphKeyboardInteractionEvent,
928
+ V as EpigraphModuleClosedEvent,
929
+ $ as EpigraphModuleFailedEvent,
930
+ b as EpigraphModuleLoadingEvent,
931
+ k as EpigraphModuleReadyEvent,
932
+ J as EpigraphPanelClosedEvent,
933
+ W as EpigraphPanelOpenedEvent,
934
+ F as EpigraphSupportDetectedEvent,
935
+ K as EpigraphTouchInteractionEvent,
936
+ B as EpigraphVariantChangedEvent,
937
+ D as GA4AnalyticsPlugin,
938
+ O as MODULE_FAILED_ERRORS,
939
+ q as NexusAnalyticsPlugin,
940
+ G as OneTrustConsentPlugin,
929
941
  g as PANEL_TYPE,
930
- A as SUPPORT_TYPE,
931
- v as TRIGGER_SOURCE
942
+ x as SHARE_DESTINATIONS,
943
+ w as SUPPORT_TYPE,
944
+ v as TRIGGER_SOURCE,
945
+ C as VARIANT_CHANGE_TYPES
932
946
  };