@epigraph/epigraph-std-lib 5.0.0-alpha.12 → 5.0.0-alpha.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/EpigraphLibs/EpigraphAnalytics/epigraphAnalytics.cjs +1 -1
- package/dist/EpigraphLibs/EpigraphAnalytics/epigraphAnalytics.js +1 -1
- package/dist/epigraph-std-lib.cjs +1 -1
- package/dist/epigraph-std-lib.js +1 -1
- package/dist/{epigraphAnalytics-82LQ7BZw.js → epigraphAnalytics-CF9Czp8C.js} +1 -1
- package/dist/epigraphAnalytics-H3EZRDUh.cjs +1 -0
- package/package.json +1 -1
- package/dist/epigraphAnalytics-BnYfMId9.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../epigraphAnalytics-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../epigraphAnalytics-H3EZRDUh.cjs");exports.ACTION_PERFORMED=e.n,exports.BUTTON_TYPE=e.r,exports.CONTENT_TYPES=e.i,exports.CURRENCY=e.a,exports.ConsentPluginNames=e.F,exports.EpigraphAddToFavouritesEvent=e.o,exports.EpigraphAnalytics=e.t,exports.EpigraphArRequestedEvent=e.s,exports.EpigraphButtonClickEvent=e.c,exports.EpigraphChangeRateEvent=e.l,exports.EpigraphCheckoutEvent=e.u,exports.EpigraphCompletionRateEvent=e.d,exports.EpigraphContentSharedEvent=e.f,exports.EpigraphConversionEvent=e.p,exports.EpigraphCustomEvent=e.m,exports.EpigraphEngagementRateEvent=e.h,exports.EpigraphItemAddedEvent=e.g,exports.EpigraphItemMovedEvent=e._,exports.EpigraphItemRemovedEvent=e.v,exports.EpigraphKeyboardInteractionEvent=e.y,exports.EpigraphModuleClosedEvent=e.b,exports.EpigraphModuleFailedEvent=e.x,exports.EpigraphModuleLoadingEvent=e.S,exports.EpigraphModuleReadyEvent=e.C,exports.EpigraphPanelClosedEvent=e.w,exports.EpigraphPanelOpenedEvent=e.T,exports.EpigraphSupportDetectedEvent=e.E,exports.EpigraphTouchInteractionEvent=e.D,exports.EpigraphVariantChangedEvent=e.O,exports.GA4AnalyticsPlugin=e.R,exports.MODULE_FAILED_ERRORS=e.k,exports.NexusAnalyticsPlugin=e.L,exports.OneTrustConsentPlugin=e.I,exports.PANEL_TYPE=e.A,exports.SHARE_DESTINATIONS=e.j,exports.SUPPORT_TYPE=e.M,exports.TRIGGER_SOURCE=e.N,exports.VARIANT_CHANGE_TYPES=e.P;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as e, C as t, D as n, E as r, F as i, I as a, L as o, M as s, N as c, O as l, P as u, R as d, S as f, T as p, _ as m, a as h, b as g, c as _, d as v, f as y, g as b, h as x, i as S, j as C, k as w, l as T, m as E, n as D, o as O, p as k, r as A, s as j, t as M, u as N, v as P, w as F, x as I, y as L } from "../../epigraphAnalytics-
|
|
1
|
+
import { A as e, C as t, D as n, E as r, F as i, I as a, L as o, M as s, N as c, O as l, P as u, R as d, S as f, T as p, _ as m, a as h, b as g, c as _, d as v, f as y, g as b, h as x, i as S, j as C, k as w, l as T, m as E, n as D, o as O, p as k, r as A, s as j, t as M, u as N, v as P, w as F, x as I, y as L } from "../../epigraphAnalytics-CF9Czp8C.js";
|
|
2
2
|
export { D as ACTION_PERFORMED, A as BUTTON_TYPE, S as CONTENT_TYPES, h as CURRENCY, i as ConsentPluginNames, O as EpigraphAddToFavouritesEvent, M as EpigraphAnalytics, j as EpigraphArRequestedEvent, _ as EpigraphButtonClickEvent, T as EpigraphChangeRateEvent, N as EpigraphCheckoutEvent, v as EpigraphCompletionRateEvent, y as EpigraphContentSharedEvent, k as EpigraphConversionEvent, E as EpigraphCustomEvent, x as EpigraphEngagementRateEvent, b as EpigraphItemAddedEvent, m as EpigraphItemMovedEvent, P as EpigraphItemRemovedEvent, L as EpigraphKeyboardInteractionEvent, g as EpigraphModuleClosedEvent, I as EpigraphModuleFailedEvent, f as EpigraphModuleLoadingEvent, t as EpigraphModuleReadyEvent, F as EpigraphPanelClosedEvent, p as EpigraphPanelOpenedEvent, r as EpigraphSupportDetectedEvent, n as EpigraphTouchInteractionEvent, l as EpigraphVariantChangedEvent, d as GA4AnalyticsPlugin, w as MODULE_FAILED_ERRORS, o as NexusAnalyticsPlugin, a as OneTrustConsentPlugin, e as PANEL_TYPE, C as SHARE_DESTINATIONS, s as SUPPORT_TYPE, c as TRIGGER_SOURCE, u as VARIANT_CHANGE_TYPES };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./epigraphQrCodeGenerator-F2eLrPC_.cjs"),t=require("./EpigraphLibs/EpigraphLogger/epigraphLogger.cjs"),n=require("./enums-PfFMiIoe.cjs"),r=require("./EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.cjs"),i=require("./Epigraph/epigraph.cjs"),a=require("./Epigraph/epigraphBaseSolutions.cjs"),o=require("./epigraphAnalytics-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./epigraphQrCodeGenerator-F2eLrPC_.cjs"),t=require("./EpigraphLibs/EpigraphLogger/epigraphLogger.cjs"),n=require("./enums-PfFMiIoe.cjs"),r=require("./EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.cjs"),i=require("./Epigraph/epigraph.cjs"),a=require("./Epigraph/epigraphBaseSolutions.cjs"),o=require("./epigraphAnalytics-H3EZRDUh.cjs"),s=require("./EpigraphLibs/EpigraphResultFactory/epigraphResultFactory.cjs"),c=require("./EpigraphLibs/EpigraphNexusApi/epigraphNexusApi.cjs"),l=require("./epigraphUnitsConverter-CwpmWl7p.cjs");exports.ACTION_PERFORMED=o.n,exports.BUTTON_TYPE=o.r,exports.CONTENT_TYPES=o.i,exports.CURRENCY=o.a,exports.ConsentPluginNames=o.F,exports.Distance=l.t,exports.DistanceUnits=l.n,exports.ENVIRONMENT_TYPE=n.t,exports.Epigraph=i.Epigraph,exports.EpigraphAddToFavouritesEvent=o.o,exports.EpigraphAnalytics=o.t,exports.EpigraphArRequestedEvent=o.s,exports.EpigraphBaseSolutionHtmlElement=a.EpigraphBaseSolutionHtmlElement,exports.EpigraphBaseSolutionLitElement=a.EpigraphBaseSolutionLitElement,exports.EpigraphButtonClickEvent=o.c,exports.EpigraphChangeRateEvent=o.l,exports.EpigraphCheckoutEvent=o.u,exports.EpigraphCompletionRateEvent=o.d,exports.EpigraphContentSharedEvent=o.f,exports.EpigraphConversionEvent=o.p,exports.EpigraphCustomEvent=o.m,exports.EpigraphEngagementRateEvent=o.h,exports.EpigraphItemAddedEvent=o.g,exports.EpigraphItemMovedEvent=o._,exports.EpigraphItemRemovedEvent=o.v,exports.EpigraphKeyboardInteractionEvent=o.y,exports.EpigraphLogger=t.EpigraphLogger,exports.EpigraphModuleClosedEvent=o.b,exports.EpigraphModuleFailedEvent=o.x,exports.EpigraphModuleLoadingEvent=o.S,exports.EpigraphModuleReadyEvent=o.C,exports.EpigraphNexusAPI=c.EpigraphNexusAPI,exports.EpigraphPanelClosedEvent=o.w,exports.EpigraphPanelOpenedEvent=o.T,exports.EpigraphQrCodeGenerator=e.t,exports.EpigraphSupportDetectedEvent=o.E,exports.EpigraphTouchInteractionEvent=o.D,exports.EpigraphUrlProcessor=r.EpigraphUrlProcessor,exports.EpigraphVariantChangedEvent=o.O,exports.GA4AnalyticsPlugin=o.R,exports.HTTPMethod=c.HTTPMethod,exports.LogTypes=t.LogTypes,exports.LoggerModeNames=t.LoggerModeNames,exports.MODULE_FAILED_ERRORS=o.k,exports.NexusAPIResourceIdentifier=c.NexusAPIResourceIdentifier,exports.NexusAPIRoutes=c.NexusAPIRoutes,exports.NexusAPIVersions=c.NexusAPIVersions,exports.NexusAnalyticsPlugin=o.L,exports.NexusEndpoints=n.n,exports.OneTrustConsentPlugin=o.I,exports.PANEL_TYPE=o.A,exports.QUERY_PARAMETER_ACTION_NAMES=r.QUERY_PARAMETER_ACTION_NAMES,exports.QUERY_PARAMETER_NAMES=r.QUERY_PARAMETER_NAMES,exports.Result=s.Result,exports.SHARE_DESTINATIONS=o.j,exports.SUPPORT_TYPE=o.M,exports.TRIGGER_SOURCE=o.N,exports.UnitTypes=l.r,exports.VARIANT_CHANGE_TYPES=o.P,exports.failureResult=s.failureResult,exports.successResult=s.successResult;
|
package/dist/epigraph-std-lib.js
CHANGED
|
@@ -3,7 +3,7 @@ import { n as r, t as i } from "./enums-BSSe4NAs.js";
|
|
|
3
3
|
import { EpigraphUrlProcessor as a, QUERY_PARAMETER_ACTION_NAMES as o, QUERY_PARAMETER_NAMES as s } from "./EpigraphLibs/EpigraphUrlProcessor/epigraphUrlProcessor.js";
|
|
4
4
|
import { Epigraph as c } from "./Epigraph/epigraph.js";
|
|
5
5
|
import { EpigraphBaseSolutionHtmlElement as l, EpigraphBaseSolutionLitElement as u } from "./Epigraph/epigraphBaseSolutions.js";
|
|
6
|
-
import { A as d, C as f, D as p, E as m, F as h, I as g, L as _, M as v, N as y, O as b, P as x, R as S, S as C, T as w, _ as T, a as E, b as D, c as O, d as k, f as A, g as j, h as M, i as N, j as P, k as F, l as I, m as L, n as R, o as z, p as B, r as V, s as H, t as U, u as W, v as G, w as K, x as q, y as J } from "./epigraphAnalytics-
|
|
6
|
+
import { A as d, C as f, D as p, E as m, F as h, I as g, L as _, M as v, N as y, O as b, P as x, R as S, S as C, T as w, _ as T, a as E, b as D, c as O, d as k, f as A, g as j, h as M, i as N, j as P, k as F, l as I, m as L, n as R, o as z, p as B, r as V, s as H, t as U, u as W, v as G, w as K, x as q, y as J } from "./epigraphAnalytics-CF9Czp8C.js";
|
|
7
7
|
import { Result as Y, failureResult as X, successResult as Z } from "./EpigraphLibs/EpigraphResultFactory/epigraphResultFactory.js";
|
|
8
8
|
import { EpigraphNexusAPI as Q, HTTPMethod as $, NexusAPIResourceIdentifier as ee, NexusAPIRoutes as te, NexusAPIVersions as ne } from "./EpigraphLibs/EpigraphNexusApi/epigraphNexusApi.js";
|
|
9
9
|
import { t as re } from "./epigraphQrCodeGenerator-BXUNL2XK.js";
|
|
@@ -292,7 +292,7 @@ var t = /* @__PURE__ */ function(e) {
|
|
|
292
292
|
}
|
|
293
293
|
}, f = class {
|
|
294
294
|
constructor({ trackingID: n, experienceID: r, solution: i, sessionId: a, xPath: o, verboseLogging: s = !1, baseUrl: c = e.PRODUCTION }) {
|
|
295
|
-
this.__status = t.UNAVAILABLE, this.__sentEventCount = 0, this.sessionId = a, this.xPath = o, this.name = this.pluginName = "NEXUS-PLUGIN", this.trackingID = n, this.experienceID = r, this.solution = i, this.verboseLogging = s, this.__queue = new l(), this.url = `${c}
|
|
295
|
+
this.__status = t.UNAVAILABLE, this.__sentEventCount = 0, this.sessionId = a, this.xPath = o, this.name = this.pluginName = "NEXUS-PLUGIN", this.trackingID = n, this.experienceID = r, this.solution = i, this.verboseLogging = s, this.__queue = new l(), this.url = `${c}analytics/event`, this.__status = t.AVAILABLE, this.__epigraphNotifier = new u(this.pluginName, this.trackingID, this.experienceID, this.solution, "NEXUS", this.__status), this.__epigraphNotifier.notify(u.ACTION_INITIALIZED, {});
|
|
296
296
|
}
|
|
297
297
|
getStatus() {
|
|
298
298
|
return this.__status;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./enums-PfFMiIoe.cjs");var t=function(e){return e.UNAVAILABLE=`unavailable`,e.AVAILABLE=`available`,e.RESTRICTED=`restricted`,e}({}),n=Symbol(`data`),r=Symbol(`next`),i=class e{constructor(e){this[n]=e,this[r]=null}get data(){return this[n]}set next(t){if(!(t instanceof e)&&t!==null)throw Error(`This node is not an instance of the custom class 'Node'.`);this[r]=t}get next(){return this[r]}},a=Symbol(`head`),o=class{constructor(){this[a]=null}set head(e){this[a]=e}get head(){return this[a]}addToTail(e){let t=this.head;if(t){for(;t.next!==null;)t=t?.next;return t.next=new i(e)}return this.head=new i(e)}removeHead(){let e=this.head;if(e)return this.head=e.next,e.data}},s=Symbol(`queue`),c=Symbol(`size`),l=class{constructor(){this[s]=new o,this[c]=0}get queue(){return this[s]}get size(){return this[c]}enqueue(e){this.queue.addToTail(e),this[c]++}dequeue(){let e=this.queue.removeHead();return this[c]--,e}},u=class{static{this.NOTIFICATION_NAME=`epg-notification`}static{this.ACTION_SEND_EVENT=`send-event`}static{this.ACTION_INITIALIZED=`initialized`}static{this.ACTION_FAILED_INITIALIZATION=`initialization-failed`}constructor(e,t,n,r,i,a){this._pluginName=e,this._trackingId=t,this._experienceId=n,this._solution=r,this._initializer=i,this._status=a}updateStatus(e){this._status=e}updateInitializer(e){this._initializer=e}notify(e,t){let n={pluginName:this._pluginName,trackingId:this._trackingId,experienceId:this._experienceId,solution:this._solution,initializer:this._initializer,status:this._status,action:e,eventDetails:t};window.dispatchEvent(new CustomEvent(`epg-notification`,{detail:n}))}},d=class{constructor({trackingID:e,experienceID:n,solution:r,verboseLogging:i=!1}){this.__status=t.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=e,this.experienceID=n,this.solution=r,this.verboseLogging=i,this.__queue=new l,this.__epigraphNotifier=new u(this.pluginName,this.pluginName,this.experienceID,this.solution,this.__initializationMethod,this.__status),this.initializePlugin()}getStatus(){return this.__status}setStatus(e){this.__status=e,this.__epigraphNotifier.updateStatus(e)}getPendingEventCount(){return this.__queue.size}getSentEventCount(){return this.__sentEventCount}getTotalEventCount(){return this.getPendingEventCount()+this.getSentEventCount()}getUniquePluginIdentifier(){return`${this.name}-${this.trackingID}`}setupPlugin(){this.__isInitialized&&this.dataLayer!==void 0&&this.dequeueAndSendEvents()}async sendEvent(e,n){if(this.__queue.enqueue(e),!n){this.__status=t.RESTRICTED;return}if(!this.__isInitialized){this.logger(`Cannot send analytics event: dataLayer not defined or plugin not initialized.`);return}try{await this.dequeueAndSendEvents()}catch(e){this.logger(e),await this.reportFailureToNexus(`EVENT_SEND_ERROR`,e?.toString()||`Unknown error`)}}initializePlugin(){if(this.__isInitialized)return;if(this.__initializationAttempts>=this.__maxInitializationAttempts){this.__nexusFailureReported||(this.reportFailureToNexus(`MAX_INITIALIZATION_ATTEMPTS`,`Maximum initialization attempts reached`),this.__nexusFailureReported=!0,this.__epigraphNotifier.notify(u.ACTION_FAILED_INITIALIZATION,{}));return}let e=performance.now();if(this.__initializationAttempts>0&&e-this.__lastInitializationAttempt<this.__initializationRetryDelay)return;this.__lastInitializationAttempt=e,this.__initializationAttempts++;let n=this.detectAndSetupAnalytics();n.success?(this.__isInitialized=!0,this.__status=t.AVAILABLE,this.__initializationMethod=n.method,this.dataLayerName=n.dataLayerName,this.dataLayer=window[this.dataLayerName],this.logger(`Successfully initialized ${n.method} with dataLayer: ${this.dataLayerName}`),this.__epigraphNotifier.notify(u.ACTION_INITIALIZED,{}),this.__queue.size>0&&this.dequeueAndSendEvents()):(this.logger(`Initialization attempt ${this.__initializationAttempts} failed: ${n.error}`),this.__initializationAttempts<this.__maxInitializationAttempts&&setTimeout(()=>{this.initializePlugin()},this.__initializationRetryDelay))}detectAndSetupAnalytics(){let e=this.detectGTM();if(e)return this.logger(`GTM detected with container ID: ${e.containerId}`),this.__epigraphNotifier.updateInitializer(`GTM`),{success:!0,method:`GTM`,dataLayerName:e.dataLayerName};let t=this.findGA4Info(this.trackingID);if(t){let e=t.l||`dataLayer`;return this.logger(`GA4 script found, setting up with dataLayer: ${e}`),this.__epigraphNotifier.updateInitializer(`GA4`),{success:!0,method:`GA4`,dataLayerName:e}}return{success:!1,method:`NONE`,dataLayerName:`dataLayer`,error:`No analytics setup found and unable to create one`}}detectGTM(){let e=document.querySelectorAll(`script[src*="googletagmanager.com/gtm"]`);for(let t of Array.from(e)){let e=t.getAttribute(`src`);if(e){let t=e.match(/gtm\.js\?id=([^&]+)/);if(t&&t.length>0){let n=e.match(/&l=([^&]+)/),r=n?n[1]:`dataLayer`;return{containerId:t[1],dataLayerName:r}}}}return null}async dequeueAndSendEvents(){if(!this.__isInitialized||!this.dataLayer)return;let e=this.__queue.size;for(let t=0;t<e;t++){let e=this.__queue.dequeue();try{this.__initializationMethod===`GTM`?(this.sendGTMEvent(e),this.__sentEventCount++,this.logger(`Analytics event successfully sent via ${this.__initializationMethod}: ${e.eventName}`)):this.__initializationMethod===`GA4`?(this.sendGA4Event(e),this.__sentEventCount++,this.logger(`Analytics event successfully sent via ${this.__initializationMethod}: ${e.eventName}`)):this.__queue.enqueue(e)}catch(t){this.logger(`Error sending event ${e.eventName}: ${t}`),this.__queue.enqueue(e)}}}async sendGTMEvent(e){let t=e.getGTMParameters(this.solution,this.experienceID,this.trackingID),n=t;this.isValidPayload(t)||(t=await this.convertGTMParametersToEpgEventTag(e.eventName,t)),this.dataLayer&&(this.dataLayer.push(t),this.__epigraphNotifier.notify(u.ACTION_SEND_EVENT,n))}async sendGA4Event(e){let t=e.getGa4Parameters(this.solution,this.experienceID,this.trackingID),n=t;this.isValidPayload(t)||(t=await this.convertGA4ParametersToEpgEventTag(t)),window.gtag(`event`,e.eventName,t),this.__epigraphNotifier.notify(u.ACTION_SEND_EVENT,n)}isValidPayload(e){if(Object.keys(e).length>=25)return!1;for(let[t,n]of Object.entries(e))if(t!==`items`&&(t.length>40||String(n).length>100))return!1;return!0}async convertGTMParametersToEpgEventTag(e,t){try{return{event:e,epg_event_tag:await this.sendGA4LongParameters(t),send_to:this.trackingID}}catch{return t}}async convertGA4ParametersToEpgEventTag(e){try{return{epg_event_tag:await this.sendGA4LongParameters(e),send_to:this.trackingID}}catch{return e}}logger(e){this.verboseLogging&&console.warn(e)}async sendGA4LongParameters(e){let t={parameters:e};try{let e=await fetch(`https://api.myepigraph.com/api/analytics/ga4/custom`,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:JSON.stringify(t)});return e.ok?(await e.json())?.id??``:``}catch{return``}}async reportFailureToNexus(e,t){try{let n={plugin:`GA4`,trackingId:this.trackingID,solution:this.solution,experienceId:this.experienceID,failureType:e,errorMessage:t,timestamp:new Date().toISOString(),url:window.location.href,userAgent:navigator.userAgent};this.logger(`Failure reported to Nexus: ${JSON.stringify(n)}`)}catch(e){this.logger(`Error reporting failure to Nexus: ${e}`)}}findGA4Info(e){if(window.google_tag_manager&&window.google_tag_manager[e]){let t=window.google_tag_manager[e];if(t&&t.dataLayerName)return{fullSrc:``,id:e,l:t.dataLayerName}}let t=document.querySelectorAll(`script[src]`);for(let n of t){let t=n.getAttribute(`src`);if(t&&t.includes(e)){let e=new URL(t,location.href),n=Object.fromEntries(e.searchParams.entries());return{fullSrc:e.href,id:n.id||void 0,l:n.l||void 0}}}return null}},f=class{constructor({trackingID:n,experienceID:r,solution:i,sessionId:a,xPath:o,verboseLogging:s=!1,baseUrl:c=e.n.PRODUCTION}){this.__status=t.UNAVAILABLE,this.__sentEventCount=0,this.sessionId=a,this.xPath=o,this.name=this.pluginName=`NEXUS-PLUGIN`,this.trackingID=n,this.experienceID=r,this.solution=i,this.verboseLogging=s,this.__queue=new l,this.url=`${c}analytics/event`,this.__status=t.AVAILABLE,this.__epigraphNotifier=new u(this.pluginName,this.trackingID,this.experienceID,this.solution,`NEXUS`,this.__status),this.__epigraphNotifier.notify(u.ACTION_INITIALIZED,{})}getStatus(){return this.__status}setStatus(e){this.__status=e,this.__epigraphNotifier.updateStatus(e)}getPendingEventCount(){return this.__queue.size}getSentEventCount(){return this.__sentEventCount}getTotalEventCount(){return this.getPendingEventCount()+this.getSentEventCount()}getUniquePluginIdentifier(){return this.name+`-`+this.trackingID}setupPlugin(){}async sendEvent(e,n){if(this.__queue.enqueue(e),!n){this.__status=t.RESTRICTED,this.__epigraphNotifier.updateStatus(this.__status);return}await this.dequeueAndSendEvents()}async dequeueAndSendEvents(){for(let e=0;e<this.__queue.size;e++){let e=this.__queue.dequeue(),t={send_to:this.trackingID,experience_id:this.experienceID,solution:this.solution,event:e.eventName,parameters:e.getNexusParameters()};try{return(await fetch(this.url,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`,"EPG-SESSION-ID":this.sessionId,"EPG-XPATH":this.xPath,Origin:typeof window<`u`?window.location.origin:``},body:JSON.stringify(t)})).ok&&this.__epigraphNotifier.notify(u.ACTION_SEND_EVENT,t),``}catch{return``}this.__sentEventCount++}return``}},p=class{constructor(e){this.consentSet=!1,this.consent=!1,this.pluginName=`OneTrustConsentPlugin`,this.consentIdentifier=e,this.consent=!1,this.addConsentChangedListener()}hasConsent(){if(this.consentSet)return this.consent;if(window.OnetrustActiveGroups!==void 0){let e=window.OnetrustActiveGroups;e!==void 0&&e.split(`,`).forEach(e=>{e===this.consentIdentifier&&(this.consent=!0,this.consentSet=!0)})}return this.consent}addConsentChangedListener(){window.addEventListener(`load`,()=>{this.hasConsent(),window.OneTrust!==void 0&&typeof window.OneTrust==`object`&&window.OneTrust.OnConsentChanged(()=>{this.consentSet=!1,this.hasConsent()})})}},m=function(e){return e.OneTrust=`onetrust`,e}({}),h=class{constructor({eventName:e,interactiveEvent:t,customParameters:n}){this.eventName=e,this.interactiveEvent=t,this.customParameters=n}getGa4Parameters(e,t,n){let r={solution:e,experience_id:t,interactive_event:this.interactiveEvent,send_to:n};return r=Object.assign(r,JSON.parse(JSON.stringify(this.customParameters))),r}getGTMParameters(e,t,n){let r={solution:e,experience_id:t,event:this.eventName,interactive_event:this.interactiveEvent,send_to:n};return r=Object.assign(r,JSON.parse(JSON.stringify(this.customParameters))),r}getNexusParameters(){let e={interactive_event:this.interactiveEvent};return e=Object.assign(e,JSON.parse(JSON.stringify(this.customParameters))),e}},g=function(e){return e.VARIANT=`variant`,e.CATEGORY_VARIANT=`category_variant`,e.GEOMETRY=`geometry`,e.CATEGORY_GEOMETRY=`category_geometry`,e.GLOBAL=`global`,e}({}),_=function(e){return e.AR=`ar`,e.QR=`qr`,e.INFO=`info`,e.INSTRUCTIONS=`instructions`,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}({}),v=function(e){return 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}({}),y=function(e){return e.AUTO=`auto`,e.BUTTON=`button`,e.HOTSPOT=`hotspot`,e.GESTURE=`gesture`,e}({}),b=function(e){return e.USD=`USD`,e.EUR=`EUR`,e.GBP=`GBP`,e.CAD=`CAD`,e}({}),x=function(e){return e.AR=`ar`,e.QR=`qr`,e.AR_WEBGL2=`ar-webgl2`,e.QR_WEBGL2=`qr-webgl2`,e}({}),S=function(e){return 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=function(e){return e.ZOOM=`zoom`,e.ROTATE=`rotate`,e.PAN=`pan`,e}({}),w=function(e){return e.CONFIGURATION=`configuration`,e.SCENE=`scene`,e.PRODUCT=`product`,e}({}),T=function(e){return e.FACEBOOK=`facebook`,e.TWITTER=`twitter`,e.EMAIL=`email`,e.COPY_LINK=`copy_link`,e.WHATSAPP=`whatsapp`,e.LINKEDIN=`linkedin`,e}({}),E=class extends h{constructor(e){super({eventName:`epigraph_ar_requested`,interactiveEvent:!0,customParameters:{items:e}})}},D=class extends h{constructor(e){super({eventName:`epigraph_module_loading`,interactiveEvent:!1,customParameters:{is_pre_config:e}})}},O=class extends h{constructor(e,t){super({eventName:`epigraph_module_ready`,interactiveEvent:!1,customParameters:{is_pre_config:e,load_time_ms:t}})}},k=class extends h{static{this.MODULE_FAILED_ERRORS=v}constructor(e,t,n){super({eventName:`epigraph_module_failed`,interactiveEvent:!1,customParameters:{is_pre_config:e,load_time_ms:t,error_type:n}})}},A=class extends h{constructor(e){super({eventName:`epigraph_module_closed`,interactiveEvent:!0,customParameters:{items:e}})}},j=class extends h{static{this.SUPPORT_TYPE=x}constructor(e){super({eventName:`epigraph_support_detected`,interactiveEvent:!1,customParameters:{support_type:e}})}},M=class extends h{static{this.BUTTON_TYPE=S}constructor(e,t){super({eventName:`epigraph_button_click`,interactiveEvent:!0,customParameters:{button_type:e,button_name:t}})}},N=class extends h{static{this.PANEL_TYPE=_}static{this.TRIGGER_SOURCE=y}constructor(e,t,n,r){super({eventName:`epigraph_panel_opened`,interactiveEvent:e,customParameters:{items:r,panel_type:t,trigger_source:n}})}},P=class extends h{static{this.PANEL_TYPE=_}static{this.TRIGGER_SOURCE=y}constructor(e,t,n,r){super({eventName:`epigraph_panel_closed`,interactiveEvent:e,customParameters:{items:r,panel_type:t,trigger_source:n}})}},F=class extends h{constructor(e){super({eventName:`epigraph_add_to_favourites`,interactiveEvent:!0,customParameters:{items:e}})}},I=class extends h{static{this.ACTION_PERFORMED=C}constructor(e){super({eventName:`epigraph_keyboard_interaction`,interactiveEvent:!0,customParameters:{action_performed:e}})}},L=class extends h{static{this.INTERACTION_TYPE=C}constructor(e){super({eventName:`epigraph_touch_interaction`,interactiveEvent:!0,customParameters:{interaction_type:e}})}},R=class extends h{static{this.CURRENCY=b}constructor(e,t,n,r,i){super({eventName:`epigraph_item_added`,interactiveEvent:e,customParameters:{items:i,value:t,currency:n,quantity:r}})}},z=class extends h{constructor(e){super({eventName:`epigraph_item_moved`,interactiveEvent:!0,customParameters:{items:e}})}},B=class extends h{static{this.CURRENCY=b}constructor(e,t,n,r){super({eventName:`epigraph_item_removed`,interactiveEvent:!0,customParameters:{items:r,value:e,currency:t,quantity:n}})}},V=class extends h{static{this.VARIANT_CHANGE_TYPES=g}constructor(e,t){super({eventName:`epigraph_variant_changed`,interactiveEvent:!0,customParameters:{items:t,change_type:e}})}},H=class extends h{static{this.CONTENT_TYPES=w}static{this.SHARE_DESTINATIONS=T}constructor(e,t,n){super({eventName:`epigraph_content_shared`,interactiveEvent:!0,customParameters:{items:n,content_type:e,share_destination:t}})}},U=class extends h{static{this.CURRENCY=b}constructor(e,t,n){super({eventName:`epigraph_checkout`,interactiveEvent:!0,customParameters:{items:n,value:e,currency:t}})}},W=class extends h{static{this.CURRENCY=b}constructor(e,t,n){super({eventName:`epigraph_conversion`,interactiveEvent:!0,customParameters:{items:n,value:e,currency:t}})}},G=class extends h{constructor(e){super({eventName:`epigraph_changeRate`,interactiveEvent:!1,customParameters:{value:e}})}},K=class extends h{constructor(e){super({eventName:`epigraph_completionRate`,interactiveEvent:!1,customParameters:{value:e}})}},q=class extends h{constructor(e){super({eventName:`epigraph_engagementRate`,interactiveEvent:!1,customParameters:{value:e}})}},J=class extends h{constructor(e,t,n){super({eventName:e,interactiveEvent:t,customParameters:n})}},Y=Symbol(`analyticsPluginsMap`),X=class{constructor(e,t){this[Y]=new Map,this.__consentPlugin=null,e&&t&&(this.__consentPlugin=this.buildConsentPlugin(e,t)),window.addEventListener(`epigraphAnalyticsConsentChange`,this.__onConsentChangeFromEvent)}__onConsentChangeFromEvent(e){let n=e;this.__overrideConsent=n.detail.hasConsent;for(let e of this[Y].values())this.__hasConsent()||e.setStatus(t.RESTRICTED)}addEventPlugin(e){this[Y].has(e.getUniquePluginIdentifier())||(this[Y].set(e.getUniquePluginIdentifier(),e),e.setupPlugin())}__hasConsent(){let e=!0;return this.__overrideConsent===void 0?(this.__consentPlugin&&(e=this.__consentPlugin.hasConsent()),e):(e=this.__overrideConsent,e)}sendEvent(e){this[Y].forEach(t=>{t.sendEvent(e,this.__hasConsent())})}buildConsentPlugin(e,t){return e.toLowerCase()===m.OneTrust.toLowerCase()?new p(t):null}};Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"R",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return I}});
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./enums-PfFMiIoe.cjs");var t=function(e){return e.UNAVAILABLE=`unavailable`,e.AVAILABLE=`available`,e.RESTRICTED=`restricted`,e}({}),n=Symbol(`data`),r=Symbol(`next`),i=class e{constructor(e){this[n]=e,this[r]=null}get data(){return this[n]}set next(t){if(!(t instanceof e)&&t!==null)throw Error(`This node is not an instance of the custom class 'Node'.`);this[r]=t}get next(){return this[r]}},a=Symbol(`head`),o=class{constructor(){this[a]=null}set head(e){this[a]=e}get head(){return this[a]}addToTail(e){let t=this.head;if(t){for(;t.next!==null;)t=t?.next;return t.next=new i(e)}return this.head=new i(e)}removeHead(){let e=this.head;if(e)return this.head=e.next,e.data}},s=Symbol(`queue`),c=Symbol(`size`),l=class{constructor(){this[s]=new o,this[c]=0}get queue(){return this[s]}get size(){return this[c]}enqueue(e){this.queue.addToTail(e),this[c]++}dequeue(){let e=this.queue.removeHead();return this[c]--,e}},u=class{static{this.NOTIFICATION_NAME=`epg-notification`}static{this.ACTION_SEND_EVENT=`send-event`}static{this.ACTION_INITIALIZED=`initialized`}static{this.ACTION_FAILED_INITIALIZATION=`initialization-failed`}constructor(e,t,n,r,i,a){this._pluginName=e,this._trackingId=t,this._experienceId=n,this._solution=r,this._initializer=i,this._status=a}updateStatus(e){this._status=e}updateInitializer(e){this._initializer=e}notify(e,t){let n={pluginName:this._pluginName,trackingId:this._trackingId,experienceId:this._experienceId,solution:this._solution,initializer:this._initializer,status:this._status,action:e,eventDetails:t};window.dispatchEvent(new CustomEvent(`epg-notification`,{detail:n}))}},d=class{constructor({trackingID:e,experienceID:n,solution:r,verboseLogging:i=!1}){this.__status=t.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=e,this.experienceID=n,this.solution=r,this.verboseLogging=i,this.__queue=new l,this.__epigraphNotifier=new u(this.pluginName,this.pluginName,this.experienceID,this.solution,this.__initializationMethod,this.__status),this.initializePlugin()}getStatus(){return this.__status}setStatus(e){this.__status=e,this.__epigraphNotifier.updateStatus(e)}getPendingEventCount(){return this.__queue.size}getSentEventCount(){return this.__sentEventCount}getTotalEventCount(){return this.getPendingEventCount()+this.getSentEventCount()}getUniquePluginIdentifier(){return`${this.name}-${this.trackingID}`}setupPlugin(){this.__isInitialized&&this.dataLayer!==void 0&&this.dequeueAndSendEvents()}async sendEvent(e,n){if(this.__queue.enqueue(e),!n){this.__status=t.RESTRICTED;return}if(!this.__isInitialized){this.logger(`Cannot send analytics event: dataLayer not defined or plugin not initialized.`);return}try{await this.dequeueAndSendEvents()}catch(e){this.logger(e),await this.reportFailureToNexus(`EVENT_SEND_ERROR`,e?.toString()||`Unknown error`)}}initializePlugin(){if(this.__isInitialized)return;if(this.__initializationAttempts>=this.__maxInitializationAttempts){this.__nexusFailureReported||(this.reportFailureToNexus(`MAX_INITIALIZATION_ATTEMPTS`,`Maximum initialization attempts reached`),this.__nexusFailureReported=!0,this.__epigraphNotifier.notify(u.ACTION_FAILED_INITIALIZATION,{}));return}let e=performance.now();if(this.__initializationAttempts>0&&e-this.__lastInitializationAttempt<this.__initializationRetryDelay)return;this.__lastInitializationAttempt=e,this.__initializationAttempts++;let n=this.detectAndSetupAnalytics();n.success?(this.__isInitialized=!0,this.__status=t.AVAILABLE,this.__initializationMethod=n.method,this.dataLayerName=n.dataLayerName,this.dataLayer=window[this.dataLayerName],this.logger(`Successfully initialized ${n.method} with dataLayer: ${this.dataLayerName}`),this.__epigraphNotifier.notify(u.ACTION_INITIALIZED,{}),this.__queue.size>0&&this.dequeueAndSendEvents()):(this.logger(`Initialization attempt ${this.__initializationAttempts} failed: ${n.error}`),this.__initializationAttempts<this.__maxInitializationAttempts&&setTimeout(()=>{this.initializePlugin()},this.__initializationRetryDelay))}detectAndSetupAnalytics(){let e=this.detectGTM();if(e)return this.logger(`GTM detected with container ID: ${e.containerId}`),this.__epigraphNotifier.updateInitializer(`GTM`),{success:!0,method:`GTM`,dataLayerName:e.dataLayerName};let t=this.findGA4Info(this.trackingID);if(t){let e=t.l||`dataLayer`;return this.logger(`GA4 script found, setting up with dataLayer: ${e}`),this.__epigraphNotifier.updateInitializer(`GA4`),{success:!0,method:`GA4`,dataLayerName:e}}return{success:!1,method:`NONE`,dataLayerName:`dataLayer`,error:`No analytics setup found and unable to create one`}}detectGTM(){let e=document.querySelectorAll(`script[src*="googletagmanager.com/gtm"]`);for(let t of Array.from(e)){let e=t.getAttribute(`src`);if(e){let t=e.match(/gtm\.js\?id=([^&]+)/);if(t&&t.length>0){let n=e.match(/&l=([^&]+)/),r=n?n[1]:`dataLayer`;return{containerId:t[1],dataLayerName:r}}}}return null}async dequeueAndSendEvents(){if(!this.__isInitialized||!this.dataLayer)return;let e=this.__queue.size;for(let t=0;t<e;t++){let e=this.__queue.dequeue();try{this.__initializationMethod===`GTM`?(this.sendGTMEvent(e),this.__sentEventCount++,this.logger(`Analytics event successfully sent via ${this.__initializationMethod}: ${e.eventName}`)):this.__initializationMethod===`GA4`?(this.sendGA4Event(e),this.__sentEventCount++,this.logger(`Analytics event successfully sent via ${this.__initializationMethod}: ${e.eventName}`)):this.__queue.enqueue(e)}catch(t){this.logger(`Error sending event ${e.eventName}: ${t}`),this.__queue.enqueue(e)}}}async sendGTMEvent(e){let t=e.getGTMParameters(this.solution,this.experienceID,this.trackingID),n=t;this.isValidPayload(t)||(t=await this.convertGTMParametersToEpgEventTag(e.eventName,t)),this.dataLayer&&(this.dataLayer.push(t),this.__epigraphNotifier.notify(u.ACTION_SEND_EVENT,n))}async sendGA4Event(e){let t=e.getGa4Parameters(this.solution,this.experienceID,this.trackingID),n=t;this.isValidPayload(t)||(t=await this.convertGA4ParametersToEpgEventTag(t)),window.gtag(`event`,e.eventName,t),this.__epigraphNotifier.notify(u.ACTION_SEND_EVENT,n)}isValidPayload(e){if(Object.keys(e).length>=25)return!1;for(let[t,n]of Object.entries(e))if(t!==`items`&&(t.length>40||String(n).length>100))return!1;return!0}async convertGTMParametersToEpgEventTag(e,t){try{return{event:e,epg_event_tag:await this.sendGA4LongParameters(t),send_to:this.trackingID}}catch{return t}}async convertGA4ParametersToEpgEventTag(e){try{return{epg_event_tag:await this.sendGA4LongParameters(e),send_to:this.trackingID}}catch{return e}}logger(e){this.verboseLogging&&console.warn(e)}async sendGA4LongParameters(e){let t={parameters:e};try{let e=await fetch(`https://api.myepigraph.com/api/analytics/ga4/custom`,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`},body:JSON.stringify(t)});return e.ok?(await e.json())?.id??``:``}catch{return``}}async reportFailureToNexus(e,t){try{let n={plugin:`GA4`,trackingId:this.trackingID,solution:this.solution,experienceId:this.experienceID,failureType:e,errorMessage:t,timestamp:new Date().toISOString(),url:window.location.href,userAgent:navigator.userAgent};this.logger(`Failure reported to Nexus: ${JSON.stringify(n)}`)}catch(e){this.logger(`Error reporting failure to Nexus: ${e}`)}}findGA4Info(e){if(window.google_tag_manager&&window.google_tag_manager[e]){let t=window.google_tag_manager[e];if(t&&t.dataLayerName)return{fullSrc:``,id:e,l:t.dataLayerName}}let t=document.querySelectorAll(`script[src]`);for(let n of t){let t=n.getAttribute(`src`);if(t&&t.includes(e)){let e=new URL(t,location.href),n=Object.fromEntries(e.searchParams.entries());return{fullSrc:e.href,id:n.id||void 0,l:n.l||void 0}}}return null}},f=class{constructor({trackingID:n,experienceID:r,solution:i,sessionId:a,xPath:o,verboseLogging:s=!1,baseUrl:c=e.n.PRODUCTION}){this.__status=t.UNAVAILABLE,this.__sentEventCount=0,this.sessionId=a,this.xPath=o,this.name=this.pluginName=`NEXUS-PLUGIN`,this.trackingID=n,this.experienceID=r,this.solution=i,this.verboseLogging=s,this.__queue=new l,this.url=`${c}/analytics/event`,this.__status=t.AVAILABLE,this.__epigraphNotifier=new u(this.pluginName,this.trackingID,this.experienceID,this.solution,`NEXUS`,this.__status),this.__epigraphNotifier.notify(u.ACTION_INITIALIZED,{})}getStatus(){return this.__status}setStatus(e){this.__status=e,this.__epigraphNotifier.updateStatus(e)}getPendingEventCount(){return this.__queue.size}getSentEventCount(){return this.__sentEventCount}getTotalEventCount(){return this.getPendingEventCount()+this.getSentEventCount()}getUniquePluginIdentifier(){return this.name+`-`+this.trackingID}setupPlugin(){}async sendEvent(e,n){if(this.__queue.enqueue(e),!n){this.__status=t.RESTRICTED,this.__epigraphNotifier.updateStatus(this.__status);return}await this.dequeueAndSendEvents()}async dequeueAndSendEvents(){for(let e=0;e<this.__queue.size;e++){let e=this.__queue.dequeue(),t={send_to:this.trackingID,experience_id:this.experienceID,solution:this.solution,event:e.eventName,parameters:e.getNexusParameters()};try{return(await fetch(this.url,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`application/json`,"EPG-SESSION-ID":this.sessionId,"EPG-XPATH":this.xPath,Origin:typeof window<`u`?window.location.origin:``},body:JSON.stringify(t)})).ok&&this.__epigraphNotifier.notify(u.ACTION_SEND_EVENT,t),``}catch{return``}this.__sentEventCount++}return``}},p=class{constructor(e){this.consentSet=!1,this.consent=!1,this.pluginName=`OneTrustConsentPlugin`,this.consentIdentifier=e,this.consent=!1,this.addConsentChangedListener()}hasConsent(){if(this.consentSet)return this.consent;if(window.OnetrustActiveGroups!==void 0){let e=window.OnetrustActiveGroups;e!==void 0&&e.split(`,`).forEach(e=>{e===this.consentIdentifier&&(this.consent=!0,this.consentSet=!0)})}return this.consent}addConsentChangedListener(){window.addEventListener(`load`,()=>{this.hasConsent(),window.OneTrust!==void 0&&typeof window.OneTrust==`object`&&window.OneTrust.OnConsentChanged(()=>{this.consentSet=!1,this.hasConsent()})})}},m=function(e){return e.OneTrust=`onetrust`,e}({}),h=class{constructor({eventName:e,interactiveEvent:t,customParameters:n}){this.eventName=e,this.interactiveEvent=t,this.customParameters=n}getGa4Parameters(e,t,n){let r={solution:e,experience_id:t,interactive_event:this.interactiveEvent,send_to:n};return r=Object.assign(r,JSON.parse(JSON.stringify(this.customParameters))),r}getGTMParameters(e,t,n){let r={solution:e,experience_id:t,event:this.eventName,interactive_event:this.interactiveEvent,send_to:n};return r=Object.assign(r,JSON.parse(JSON.stringify(this.customParameters))),r}getNexusParameters(){let e={interactive_event:this.interactiveEvent};return e=Object.assign(e,JSON.parse(JSON.stringify(this.customParameters))),e}},g=function(e){return e.VARIANT=`variant`,e.CATEGORY_VARIANT=`category_variant`,e.GEOMETRY=`geometry`,e.CATEGORY_GEOMETRY=`category_geometry`,e.GLOBAL=`global`,e}({}),_=function(e){return e.AR=`ar`,e.QR=`qr`,e.INFO=`info`,e.INSTRUCTIONS=`instructions`,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}({}),v=function(e){return 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}({}),y=function(e){return e.AUTO=`auto`,e.BUTTON=`button`,e.HOTSPOT=`hotspot`,e.GESTURE=`gesture`,e}({}),b=function(e){return e.USD=`USD`,e.EUR=`EUR`,e.GBP=`GBP`,e.CAD=`CAD`,e}({}),x=function(e){return e.AR=`ar`,e.QR=`qr`,e.AR_WEBGL2=`ar-webgl2`,e.QR_WEBGL2=`qr-webgl2`,e}({}),S=function(e){return 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=function(e){return e.ZOOM=`zoom`,e.ROTATE=`rotate`,e.PAN=`pan`,e}({}),w=function(e){return e.CONFIGURATION=`configuration`,e.SCENE=`scene`,e.PRODUCT=`product`,e}({}),T=function(e){return e.FACEBOOK=`facebook`,e.TWITTER=`twitter`,e.EMAIL=`email`,e.COPY_LINK=`copy_link`,e.WHATSAPP=`whatsapp`,e.LINKEDIN=`linkedin`,e}({}),E=class extends h{constructor(e){super({eventName:`epigraph_ar_requested`,interactiveEvent:!0,customParameters:{items:e}})}},D=class extends h{constructor(e){super({eventName:`epigraph_module_loading`,interactiveEvent:!1,customParameters:{is_pre_config:e}})}},O=class extends h{constructor(e,t){super({eventName:`epigraph_module_ready`,interactiveEvent:!1,customParameters:{is_pre_config:e,load_time_ms:t}})}},k=class extends h{static{this.MODULE_FAILED_ERRORS=v}constructor(e,t,n){super({eventName:`epigraph_module_failed`,interactiveEvent:!1,customParameters:{is_pre_config:e,load_time_ms:t,error_type:n}})}},A=class extends h{constructor(e){super({eventName:`epigraph_module_closed`,interactiveEvent:!0,customParameters:{items:e}})}},j=class extends h{static{this.SUPPORT_TYPE=x}constructor(e){super({eventName:`epigraph_support_detected`,interactiveEvent:!1,customParameters:{support_type:e}})}},M=class extends h{static{this.BUTTON_TYPE=S}constructor(e,t){super({eventName:`epigraph_button_click`,interactiveEvent:!0,customParameters:{button_type:e,button_name:t}})}},N=class extends h{static{this.PANEL_TYPE=_}static{this.TRIGGER_SOURCE=y}constructor(e,t,n,r){super({eventName:`epigraph_panel_opened`,interactiveEvent:e,customParameters:{items:r,panel_type:t,trigger_source:n}})}},P=class extends h{static{this.PANEL_TYPE=_}static{this.TRIGGER_SOURCE=y}constructor(e,t,n,r){super({eventName:`epigraph_panel_closed`,interactiveEvent:e,customParameters:{items:r,panel_type:t,trigger_source:n}})}},F=class extends h{constructor(e){super({eventName:`epigraph_add_to_favourites`,interactiveEvent:!0,customParameters:{items:e}})}},I=class extends h{static{this.ACTION_PERFORMED=C}constructor(e){super({eventName:`epigraph_keyboard_interaction`,interactiveEvent:!0,customParameters:{action_performed:e}})}},L=class extends h{static{this.INTERACTION_TYPE=C}constructor(e){super({eventName:`epigraph_touch_interaction`,interactiveEvent:!0,customParameters:{interaction_type:e}})}},R=class extends h{static{this.CURRENCY=b}constructor(e,t,n,r,i){super({eventName:`epigraph_item_added`,interactiveEvent:e,customParameters:{items:i,value:t,currency:n,quantity:r}})}},z=class extends h{constructor(e){super({eventName:`epigraph_item_moved`,interactiveEvent:!0,customParameters:{items:e}})}},B=class extends h{static{this.CURRENCY=b}constructor(e,t,n,r){super({eventName:`epigraph_item_removed`,interactiveEvent:!0,customParameters:{items:r,value:e,currency:t,quantity:n}})}},V=class extends h{static{this.VARIANT_CHANGE_TYPES=g}constructor(e,t){super({eventName:`epigraph_variant_changed`,interactiveEvent:!0,customParameters:{items:t,change_type:e}})}},H=class extends h{static{this.CONTENT_TYPES=w}static{this.SHARE_DESTINATIONS=T}constructor(e,t,n){super({eventName:`epigraph_content_shared`,interactiveEvent:!0,customParameters:{items:n,content_type:e,share_destination:t}})}},U=class extends h{static{this.CURRENCY=b}constructor(e,t,n){super({eventName:`epigraph_checkout`,interactiveEvent:!0,customParameters:{items:n,value:e,currency:t}})}},W=class extends h{static{this.CURRENCY=b}constructor(e,t,n){super({eventName:`epigraph_conversion`,interactiveEvent:!0,customParameters:{items:n,value:e,currency:t}})}},G=class extends h{constructor(e){super({eventName:`epigraph_changeRate`,interactiveEvent:!1,customParameters:{value:e}})}},K=class extends h{constructor(e){super({eventName:`epigraph_completionRate`,interactiveEvent:!1,customParameters:{value:e}})}},q=class extends h{constructor(e){super({eventName:`epigraph_engagementRate`,interactiveEvent:!1,customParameters:{value:e}})}},J=class extends h{constructor(e,t,n){super({eventName:e,interactiveEvent:t,customParameters:n})}},Y=Symbol(`analyticsPluginsMap`),X=class{constructor(e,t){this[Y]=new Map,this.__consentPlugin=null,e&&t&&(this.__consentPlugin=this.buildConsentPlugin(e,t)),window.addEventListener(`epigraphAnalyticsConsentChange`,this.__onConsentChangeFromEvent)}__onConsentChangeFromEvent(e){let n=e;this.__overrideConsent=n.detail.hasConsent;for(let e of this[Y].values())this.__hasConsent()||e.setStatus(t.RESTRICTED)}addEventPlugin(e){this[Y].has(e.getUniquePluginIdentifier())||(this[Y].set(e.getUniquePluginIdentifier(),e),e.setupPlugin())}__hasConsent(){let e=!0;return this.__overrideConsent===void 0?(this.__consentPlugin&&(e=this.__consentPlugin.hasConsent()),e):(e=this.__overrideConsent,e)}sendEvent(e){this[Y].forEach(t=>{t.sendEvent(e,this.__hasConsent())})}buildConsentPlugin(e,t){return e.toLowerCase()===m.OneTrust.toLowerCase()?new p(t):null}};Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"R",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return I}});
|