@epigraph/epigraph-std-lib 4.5.0-alpha → 4.5.1-alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var o=(s=>(s.UNAVAILABLE="unavailable",s.AVAILABLE="available",s.RESTRICTED="restricted",s))(o||{});const l=Symbol("data"),p=Symbol("next"),C=class m{constructor(e){this[l]=e,this[p]=null}get data(){return this[l]}set next(e){if(!(e instanceof m)&&e!==null)throw new Error("This node is not an instance of the custom class 'Node'.");this[p]=e}get next(){return this[p]}};let v=C;const d=Symbol("head");class w{constructor(){this[d]=null}set head(e){this[d]=e}get head(){return this[d]}addToTail(e){let t=this.head;if(t){for(;t.next!==null;)t=t?.next;return t.next=new v(e)}return this.head=new v(e)}removeHead(){const e=this.head;if(e)return this.head=e.next,e.data}}const E=Symbol("queue"),h=Symbol("size");class _{constructor(){this[E]=new w,this[h]=0}get queue(){return this[E]}get size(){return this[h]}enqueue(e){this.queue.addToTail(e),this[h]++}dequeue(){const e=this.queue.removeHead();return this[h]--,e}}class N{constructor({trackingID:e,experienceID:t,solution:n,verboseLogging:r=!1}){this.__status=o.UNAVAILABLE,this.__sentEventCount=0,this.name=this.pluginName="GA4-PLUGIN",this.trackingID=e,this.experienceID=t,this.solution=n,this.verboseLogging=r,this.__queue=new _,this.dataLayer=window.dataLayer,this.dataLayerName="dataLayer",this.setupDataLayer(),this.initGtag(this.dataLayerName,this.trackingID)}getStatus(){return this.__status}setStatus(e){this.__status=e}getPendingEventCount(){return this.__queue.size}getSentEventCount(){return this.__sentEventCount}getTotalEventCount(){return this.getPendingEventCount()+this.getSentEventCount()}getUniquePluginIdentifier(){return`${this.name}-${this.trackingID}`}setupPlugin(){this.dataLayer!==void 0&&this.dequeueAndSendEvents()}async sendEvent(e,t){if(this.__queue.enqueue(e),!t){this.__status=o.RESTRICTED;return}if(this.dataLayer!==void 0)try{await this.dequeueAndSendEvents()}catch(n){this.logger(n)}else this.logger("Cannot send Google Analytics 4 event: dataLayer is not defined.")}setupDataLayer(){if(this.dataLayer){this.__status=o.AVAILABLE;return}const t=this.findGA4ScriptInfo(this.trackingID)?.l;t&&(this.dataLayerName=t,this.dataLayer=window[t])}initGtag(e="dataLayer",t){window.epgDataLayerName=e,typeof window.gtag!="function"&&(window.gtag=function(){window[window.epgDataLayerName].push(arguments)},window.gtag("js",new Date),window.gtag("config",t,{send_page_view:!1}))}async dequeueAndSendEvents(){let e=this.__queue.size;for(let t=0;t<e;t++){const n=this.__queue.dequeue(),r=n.getGa4Parameters(this.solution,this.experienceID);if(n.customParameters&&Object.assign(r,n.customParameters),JSON.stringify(r).length>459)try{let u=await this.sendGA4LongParameters(r);r.epg_event_tag=u}catch{}gtag("event",n.eventName,r),this.__sentEventCount++,this.logger(`Google Analytics 4 event successfully sent: ${n.eventName}`)}}logger(e){this.verboseLogging&&console.warn(e)}async sendGA4LongParameters(e){const t="https://api.myepigraph.com/api/analytics/ga4/custom",n={parameters:e};try{const r=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(n)});if(r.ok){const i=await r.json();return i&&i.id?i.id:""}else return""}catch{return""}}findGA4ScriptInfo(e){const t=document.querySelectorAll("script[src]");for(const n of t){const r=n.getAttribute("src");if(r&&r.includes(e)){const i=new URL(r,location.href),u=Object.fromEntries(i.searchParams.entries());return{fullSrc:i.href,id:u.id||void 0,l:u.l||void 0}}}return null}}class S{constructor({trackingID:e,experienceID:t,solution:n,sessionId:r,xPath:i,verboseLogging:u=!1,sendToStaging:P=!1}){this.__status=o.UNAVAILABLE,this.__sentEventCount=0,this.sessionId=r,this.xPath=i,this.name=this.pluginName="NEXUS-PLUGIN",this.trackingID=e,this.experienceID=t,this.solution=n,this.verboseLogging=u,this.__queue=new _,this.url=P?"https://nexus.epigraph.dev/api/analytics/event":"https://api.myepigraph.com/api/analytics/event",this.__status=o.AVAILABLE}getStatus(){return this.__status}setStatus(e){this.__status=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,t){if(this.__queue.enqueue(e),!t){this.__status=o.RESTRICTED;return}await this.dequeueAndSendEvents()}async dequeueAndSendEvents(){for(let e=0;e<this.__queue.size;e++){const t=this.__queue.dequeue();t.customParameters.solution=this.solution;const n={trackingID:this.trackingID,experience_id:this.experienceID,action:t.eventName,parameters:t.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(n)})).status===200,""}catch{return""}this.__sentEventCount++}return""}}class f{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(n=>{n===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()})})}}var g=(s=>(s.OneTrust="onetrust",s))(g||{});class a{constructor({eventName:e,interactiveEvent:t,customParameters:n}){this.eventName=e,this.interactiveEvent=t,this.customParameters=n}getGa4Parameters(e,t){let n={solution:e,experience_id:t,interactive_event:this.interactiveEvent,items:[],epg_event_tag:""};return n=Object.assign(n,JSON.parse(JSON.stringify(this.customParameters))),n}getGTMParameters(){return{}}getNexusParameters(){let e={interactive_event:this.interactiveEvent,items:[]};return e=Object.assign(e,JSON.parse(JSON.stringify(this.customParameters))),e}}class A extends a{constructor(e=[]){super({eventName:"epigraph_ar_requested",interactiveEvent:!0,customParameters:{items:e}})}}class L extends a{constructor(e=[],t){super({eventName:"epigraph_module_loading",interactiveEvent:!1,customParameters:{items:e,is_pre_config:t}})}}class I extends a{constructor(e=[],t,n){super({eventName:"epigraph_module_ready",interactiveEvent:!1,customParameters:{items:e,is_pre_config:t,load_time_ms:n}})}}class x extends a{constructor(e=[],t,n,r){super({eventName:"epigraph_module_failed",interactiveEvent:!1,customParameters:{items:e,is_pre_config:t,load_time_ms:n,error_type:r}})}}class q extends a{constructor(e=[]){super({eventName:"epigraph_module_closed",interactiveEvent:!0,customParameters:{items:e}})}}class T extends a{constructor(e=[],t,n={}){super({eventName:"epigraph_support_detected",interactiveEvent:!1,customParameters:{items:e,support_type:t,device_capabilities:n}})}}class b extends a{constructor(e=[],t,n){super({eventName:"epigraph_button_click",interactiveEvent:!0,customParameters:{items:e,button_type:t,button_name:n}})}}class O extends a{constructor(e=[],t,n,r){super({eventName:"epigraph_panel_opened",interactiveEvent:t,customParameters:{items:e,panel_type:n,trigger_source:r}})}}class R extends a{constructor(e=[],t,n,r){super({eventName:"epigraph_panel_closed",interactiveEvent:t,customParameters:{items:e,panel_type:n,trigger_source:r}})}}class D extends a{constructor(e=[]){super({eventName:"epigraph_add_to_favourites",interactiveEvent:!0,customParameters:{items:e}})}}class G extends a{constructor(e=[],t){super({eventName:"epigraph_keyboard_interaction",interactiveEvent:!0,customParameters:{items:e,action_performed:t}})}}class k extends a{constructor(e=[],t){super({eventName:"epigraph_touch_interaction",interactiveEvent:!0,customParameters:{items:e,interaction_type:t}})}}class M extends a{constructor(e=[],t,n,r,i){super({eventName:"epigraph_item_added",interactiveEvent:t,customParameters:{items:e,value:n,currency:r,quantity:i}})}}class j extends a{constructor(e=[]){super({eventName:"epigraph_item_moved",interactiveEvent:!0,customParameters:{items:e}})}}class B extends a{constructor(e=[],t,n){super({eventName:"epigraph_item_removed",interactiveEvent:!0,customParameters:{items:e,currency:t,quantity:n}})}}class U extends a{constructor(e=[],t){super({eventName:"epigraph_variant_changed",interactiveEvent:!0,customParameters:{items:e,change_type:t}})}}class $ extends a{constructor(e=[],t,n){super({eventName:"epigraph_content_shared",interactiveEvent:!0,customParameters:{items:e,content_type:t,share_destination:n}})}}class z extends a{constructor(e=[],t,n){super({eventName:"epigraph_checkout",interactiveEvent:!0,customParameters:{items:e,value:t,currency:n}})}}class V extends a{constructor(e=[],t,n){super({eventName:"epigraph_conversion",interactiveEvent:!0,customParameters:{items:e,value:t,currency:n}})}}class J extends a{constructor(e=[],t){super({eventName:"epigraph_changeRate",interactiveEvent:!1,customParameters:{items:e,value:t}})}}class F extends a{constructor(e=[],t){super({eventName:"epigraph_completionRate",interactiveEvent:!1,customParameters:{items:e,value:t}})}}class H extends a{constructor(e=[],t){super({eventName:"epigraph_engagementRate",interactiveEvent:!1,customParameters:{items:e,value:t}})}}/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var o=(s=>(s.UNAVAILABLE="unavailable",s.AVAILABLE="available",s.RESTRICTED="restricted",s))(o||{});const l=Symbol("data"),p=Symbol("next"),C=class m{constructor(e){this[l]=e,this[p]=null}get data(){return this[l]}set next(e){if(!(e instanceof m)&&e!==null)throw new Error("This node is not an instance of the custom class 'Node'.");this[p]=e}get next(){return this[p]}};let v=C;const d=Symbol("head");class w{constructor(){this[d]=null}set head(e){this[d]=e}get head(){return this[d]}addToTail(e){let t=this.head;if(t){for(;t.next!==null;)t=t?.next;return t.next=new v(e)}return this.head=new v(e)}removeHead(){const e=this.head;if(e)return this.head=e.next,e.data}}const E=Symbol("queue"),h=Symbol("size");class _{constructor(){this[E]=new w,this[h]=0}get queue(){return this[E]}get size(){return this[h]}enqueue(e){this.queue.addToTail(e),this[h]++}dequeue(){const e=this.queue.removeHead();return this[h]--,e}}class N{constructor({trackingID:e,experienceID:t,solution:n,verboseLogging:r=!1}){this.__status=o.UNAVAILABLE,this.__sentEventCount=0,this.name=this.pluginName="GA4-PLUGIN",this.trackingID=e,this.experienceID=t,this.solution=n,this.verboseLogging=r,this.__queue=new _,this.dataLayer=window.dataLayer,this.dataLayerName="dataLayer",this.setupDataLayer(),this.initGtag(this.dataLayerName,this.trackingID)}getStatus(){return this.__status}setStatus(e){this.__status=e}getPendingEventCount(){return this.__queue.size}getSentEventCount(){return this.__sentEventCount}getTotalEventCount(){return this.getPendingEventCount()+this.getSentEventCount()}getUniquePluginIdentifier(){return`${this.name}-${this.trackingID}`}setupPlugin(){this.dataLayer!==void 0&&this.dequeueAndSendEvents()}async sendEvent(e,t){if(this.__queue.enqueue(e),!t){this.__status=o.RESTRICTED;return}if(this.dataLayer!==void 0)try{await this.dequeueAndSendEvents()}catch(n){this.logger(n)}else this.logger("Cannot send Google Analytics 4 event: dataLayer is not defined.")}setupDataLayer(){if(this.dataLayer){this.__status=o.AVAILABLE;return}const t=this.findGA4ScriptInfo(this.trackingID)?.l;t&&(this.dataLayerName=t,this.dataLayer=window[t])}initGtag(e="dataLayer",t){window.epgDataLayerName=e,typeof window.gtag!="function"&&(window.gtag=function(){window[window.epgDataLayerName].push(arguments)},window.gtag("js",new Date),window.gtag("config",t,{send_page_view:!1}))}async dequeueAndSendEvents(){let e=this.__queue.size;for(let t=0;t<e;t++){const n=this.__queue.dequeue(),r=n.getGa4Parameters(this.solution,this.experienceID);if(n.customParameters&&Object.assign(r,n.customParameters),JSON.stringify(r).length>459)try{let u=await this.sendGA4LongParameters(r);r.epg_event_tag=u}catch{}gtag("event",n.eventName,r),this.__sentEventCount++,this.logger(`Google Analytics 4 event successfully sent: ${n.eventName}`)}}logger(e){this.verboseLogging&&console.warn(e)}async sendGA4LongParameters(e){const t="https://api.myepigraph.com/api/analytics/ga4/custom",n={parameters:e};try{const r=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(n)});if(r.ok){const i=await r.json();return i&&i.id?i.id:""}else return""}catch{return""}}findGA4ScriptInfo(e){const t=document.querySelectorAll("script[src]");for(const n of t){const r=n.getAttribute("src");if(r&&r.includes(e)){const i=new URL(r,location.href),u=Object.fromEntries(i.searchParams.entries());return{fullSrc:i.href,id:u.id||void 0,l:u.l||void 0}}}return null}}class S{constructor({trackingID:e,experienceID:t,solution:n,sessionId:r,xPath:i,verboseLogging:u=!1,sendToStaging:P=!1}){this.__status=o.UNAVAILABLE,this.__sentEventCount=0,this.sessionId=r,this.xPath=i,this.name=this.pluginName="NEXUS-PLUGIN",this.trackingID=e,this.experienceID=t,this.solution=n,this.verboseLogging=u,this.__queue=new _,this.url=P?"https://nexus.epigraph.dev/api/analytics/event":"https://api.myepigraph.com/api/analytics/event",this.__status=o.AVAILABLE}getStatus(){return this.__status}setStatus(e){this.__status=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,t){if(this.__queue.enqueue(e),!t){this.__status=o.RESTRICTED;return}await this.dequeueAndSendEvents()}async dequeueAndSendEvents(){for(let e=0;e<this.__queue.size;e++){const t=this.__queue.dequeue();t.customParameters.solution=this.solution;const n={trackingID:this.trackingID,experience_id:this.experienceID,action:t.eventName,parameters:t.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(n)})).status===200,""}catch{return""}this.__sentEventCount++}return""}}class f{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(n=>{n===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()})})}}var g=(s=>(s.OneTrust="onetrust",s))(g||{});class a{constructor({eventName:e,interactiveEvent:t,customParameters:n}){this.eventName=e,this.interactiveEvent=t,this.customParameters=n}getGa4Parameters(e,t){let n={solution:e,experience_id:t,interactive_event:this.interactiveEvent,items:[],epg_event_tag:""};return n=Object.assign(n,JSON.parse(JSON.stringify(this.customParameters))),n}getGTMParameters(){return{}}getNexusParameters(){let e={interactive_event:this.interactiveEvent,items:[]};return e=Object.assign(e,JSON.parse(JSON.stringify(this.customParameters))),e}}class A extends a{constructor(e){super({eventName:"epigraph_ar_requested",interactiveEvent:!0,customParameters:{items:e}})}}class L extends a{constructor(e,t){super({eventName:"epigraph_module_loading",interactiveEvent:!1,customParameters:{items:e,is_pre_config:t}})}}class I extends a{constructor(e,t,n){super({eventName:"epigraph_module_ready",interactiveEvent:!1,customParameters:{items:e,is_pre_config:t,load_time_ms:n}})}}class x extends a{constructor(e,t,n,r){super({eventName:"epigraph_module_failed",interactiveEvent:!1,customParameters:{items:e,is_pre_config:t,load_time_ms:n,error_type:r}})}}class q extends a{constructor(e){super({eventName:"epigraph_module_closed",interactiveEvent:!0,customParameters:{items:e}})}}class T extends a{constructor(e,t,n){super({eventName:"epigraph_support_detected",interactiveEvent:!1,customParameters:{items:e,support_type:t,device_capabilities:n}})}}class b extends a{constructor(e,t,n){super({eventName:"epigraph_button_click",interactiveEvent:!0,customParameters:{items:e,button_type:t,button_name:n}})}}class O extends a{constructor(e,t,n,r){super({eventName:"epigraph_panel_opened",interactiveEvent:t,customParameters:{items:e,panel_type:n,trigger_source:r}})}}class R extends a{constructor(e,t,n,r){super({eventName:"epigraph_panel_closed",interactiveEvent:t,customParameters:{items:e,panel_type:n,trigger_source:r}})}}class D extends a{constructor(e){super({eventName:"epigraph_add_to_favourites",interactiveEvent:!0,customParameters:{items:e}})}}class G extends a{constructor(e,t){super({eventName:"epigraph_keyboard_interaction",interactiveEvent:!0,customParameters:{items:e,action_performed:t}})}}class k extends a{constructor(e,t){super({eventName:"epigraph_touch_interaction",interactiveEvent:!0,customParameters:{items:e,interaction_type:t}})}}class M extends a{constructor(e,t,n,r,i){super({eventName:"epigraph_item_added",interactiveEvent:t,customParameters:{items:e,value:n,currency:r,quantity:i}})}}class j extends a{constructor(e){super({eventName:"epigraph_item_moved",interactiveEvent:!0,customParameters:{items:e}})}}class B extends a{constructor(e,t,n){super({eventName:"epigraph_item_removed",interactiveEvent:!0,customParameters:{items:e,currency:t,quantity:n}})}}class U extends a{constructor(e,t){super({eventName:"epigraph_variant_changed",interactiveEvent:!0,customParameters:{items:e,change_type:t}})}}class $ extends a{constructor(e,t,n){super({eventName:"epigraph_content_shared",interactiveEvent:!0,customParameters:{items:e,content_type:t,share_destination:n}})}}class z extends a{constructor(e,t,n){super({eventName:"epigraph_checkout",interactiveEvent:!0,customParameters:{items:e,value:t,currency:n}})}}class V extends a{constructor(e,t,n){super({eventName:"epigraph_conversion",interactiveEvent:!0,customParameters:{items:e,value:t,currency:n}})}}class J extends a{constructor(e,t){super({eventName:"epigraph_changeRate",interactiveEvent:!1,customParameters:{items:e,value:t}})}}class F extends a{constructor(e,t){super({eventName:"epigraph_completionRate",interactiveEvent:!1,customParameters:{items:e,value:t}})}}class H extends a{constructor(e,t){super({eventName:"epigraph_engagementRate",interactiveEvent:!1,customParameters:{items:e,value:t}})}}/**
2
2
  * @license
3
3
  * Copyright (c) 2023 Epigraph LLC. All Rights Reserved.
4
4
  *
@@ -319,7 +319,7 @@ class a {
319
319
  }
320
320
  }
321
321
  class L extends a {
322
- constructor(e = []) {
322
+ constructor(e) {
323
323
  super({
324
324
  eventName: "epigraph_ar_requested",
325
325
  interactiveEvent: !0,
@@ -330,7 +330,7 @@ class L extends a {
330
330
  }
331
331
  }
332
332
  class A extends a {
333
- constructor(e = [], t) {
333
+ constructor(e, t) {
334
334
  super({
335
335
  eventName: "epigraph_module_loading",
336
336
  interactiveEvent: !1,
@@ -342,7 +342,7 @@ class A extends a {
342
342
  }
343
343
  }
344
344
  class x extends a {
345
- constructor(e = [], t, n) {
345
+ constructor(e, t, n) {
346
346
  super({
347
347
  eventName: "epigraph_module_ready",
348
348
  interactiveEvent: !1,
@@ -355,7 +355,7 @@ class x extends a {
355
355
  }
356
356
  }
357
357
  class I extends a {
358
- constructor(e = [], t, n, r) {
358
+ constructor(e, t, n, r) {
359
359
  super({
360
360
  eventName: "epigraph_module_failed",
361
361
  interactiveEvent: !1,
@@ -369,7 +369,7 @@ class I extends a {
369
369
  }
370
370
  }
371
371
  class q extends a {
372
- constructor(e = []) {
372
+ constructor(e) {
373
373
  super({
374
374
  eventName: "epigraph_module_closed",
375
375
  interactiveEvent: !0,
@@ -380,7 +380,7 @@ class q extends a {
380
380
  }
381
381
  }
382
382
  class T extends a {
383
- constructor(e = [], t, n = {}) {
383
+ constructor(e, t, n) {
384
384
  super({
385
385
  eventName: "epigraph_support_detected",
386
386
  interactiveEvent: !1,
@@ -393,7 +393,7 @@ class T extends a {
393
393
  }
394
394
  }
395
395
  class b extends a {
396
- constructor(e = [], t, n) {
396
+ constructor(e, t, n) {
397
397
  super({
398
398
  eventName: "epigraph_button_click",
399
399
  interactiveEvent: !0,
@@ -406,7 +406,7 @@ class b extends a {
406
406
  }
407
407
  }
408
408
  class O extends a {
409
- constructor(e = [], t, n, r) {
409
+ constructor(e, t, n, r) {
410
410
  super({
411
411
  eventName: "epigraph_panel_opened",
412
412
  interactiveEvent: t,
@@ -419,7 +419,7 @@ class O extends a {
419
419
  }
420
420
  }
421
421
  class D extends a {
422
- constructor(e = [], t, n, r) {
422
+ constructor(e, t, n, r) {
423
423
  super({
424
424
  eventName: "epigraph_panel_closed",
425
425
  interactiveEvent: t,
@@ -432,7 +432,7 @@ class D extends a {
432
432
  }
433
433
  }
434
434
  class R extends a {
435
- constructor(e = []) {
435
+ constructor(e) {
436
436
  super({
437
437
  eventName: "epigraph_add_to_favourites",
438
438
  interactiveEvent: !0,
@@ -443,7 +443,7 @@ class R extends a {
443
443
  }
444
444
  }
445
445
  class G extends a {
446
- constructor(e = [], t) {
446
+ constructor(e, t) {
447
447
  super({
448
448
  eventName: "epigraph_keyboard_interaction",
449
449
  interactiveEvent: !0,
@@ -455,7 +455,7 @@ class G extends a {
455
455
  }
456
456
  }
457
457
  class k extends a {
458
- constructor(e = [], t) {
458
+ constructor(e, t) {
459
459
  super({
460
460
  eventName: "epigraph_touch_interaction",
461
461
  interactiveEvent: !0,
@@ -467,7 +467,7 @@ class k extends a {
467
467
  }
468
468
  }
469
469
  class j extends a {
470
- constructor(e = [], t, n, r, i) {
470
+ constructor(e, t, n, r, i) {
471
471
  super({
472
472
  eventName: "epigraph_item_added",
473
473
  interactiveEvent: t,
@@ -481,7 +481,7 @@ class j extends a {
481
481
  }
482
482
  }
483
483
  class U extends a {
484
- constructor(e = []) {
484
+ constructor(e) {
485
485
  super({
486
486
  eventName: "epigraph_item_moved",
487
487
  interactiveEvent: !0,
@@ -492,7 +492,7 @@ class U extends a {
492
492
  }
493
493
  }
494
494
  class B extends a {
495
- constructor(e = [], t, n) {
495
+ constructor(e, t, n) {
496
496
  super({
497
497
  eventName: "epigraph_item_removed",
498
498
  interactiveEvent: !0,
@@ -505,7 +505,7 @@ class B extends a {
505
505
  }
506
506
  }
507
507
  class M extends a {
508
- constructor(e = [], t) {
508
+ constructor(e, t) {
509
509
  super({
510
510
  eventName: "epigraph_variant_changed",
511
511
  interactiveEvent: !0,
@@ -517,7 +517,7 @@ class M extends a {
517
517
  }
518
518
  }
519
519
  class $ extends a {
520
- constructor(e = [], t, n) {
520
+ constructor(e, t, n) {
521
521
  super({
522
522
  eventName: "epigraph_content_shared",
523
523
  interactiveEvent: !0,
@@ -530,7 +530,7 @@ class $ extends a {
530
530
  }
531
531
  }
532
532
  class z extends a {
533
- constructor(e = [], t, n) {
533
+ constructor(e, t, n) {
534
534
  super({
535
535
  eventName: "epigraph_checkout",
536
536
  interactiveEvent: !0,
@@ -543,7 +543,7 @@ class z extends a {
543
543
  }
544
544
  }
545
545
  class J extends a {
546
- constructor(e = [], t, n) {
546
+ constructor(e, t, n) {
547
547
  super({
548
548
  eventName: "epigraph_conversion",
549
549
  interactiveEvent: !0,
@@ -556,7 +556,7 @@ class J extends a {
556
556
  }
557
557
  }
558
558
  class V extends a {
559
- constructor(e = [], t) {
559
+ constructor(e, t) {
560
560
  super({
561
561
  eventName: "epigraph_changeRate",
562
562
  interactiveEvent: !1,
@@ -568,7 +568,7 @@ class V extends a {
568
568
  }
569
569
  }
570
570
  class F extends a {
571
- constructor(e = [], t) {
571
+ constructor(e, t) {
572
572
  super({
573
573
  eventName: "epigraph_completionRate",
574
574
  interactiveEvent: !1,
@@ -580,7 +580,7 @@ class F extends a {
580
580
  }
581
581
  }
582
582
  class H extends a {
583
- constructor(e = [], t) {
583
+ constructor(e, t) {
584
584
  super({
585
585
  eventName: "epigraph_engagementRate",
586
586
  interactiveEvent: !1,
@@ -22,69 +22,72 @@ declare class BaseAnalyticsEvent implements IAnalyticsEvent {
22
22
  };
23
23
  }
24
24
  export declare class EpigraphArRequestedEvent extends BaseAnalyticsEvent {
25
- constructor(items?: IAnalyticsParameterItems);
25
+ constructor(items: IAnalyticsParameterItems);
26
26
  }
27
27
  export declare class EpigraphModuleLoadingEvent extends BaseAnalyticsEvent {
28
- constructor(items: IAnalyticsParameterItems | undefined, isPreConfig: boolean);
28
+ constructor(items: IAnalyticsParameterItems, isPreConfig: boolean);
29
29
  }
30
30
  export declare class EpigraphModuleReadyEvent extends BaseAnalyticsEvent {
31
- constructor(items: IAnalyticsParameterItems | undefined, isPreConfig: boolean, loadTimeMs: number);
31
+ constructor(items: IAnalyticsParameterItems, isPreConfig: boolean, loadTimeMs: number);
32
32
  }
33
33
  export declare class EpigraphModuleFailedEvent extends BaseAnalyticsEvent {
34
- constructor(items: IAnalyticsParameterItems | undefined, isPreConfig: boolean, loadTimeMs: number, errorType: string);
34
+ constructor(items: IAnalyticsParameterItems, isPreConfig: boolean, loadTimeMs: number, errorType: string);
35
35
  }
36
36
  export declare class EpigraphModuleClosedEvent extends BaseAnalyticsEvent {
37
- constructor(items?: IAnalyticsParameterItems);
37
+ constructor(items: IAnalyticsParameterItems);
38
38
  }
39
39
  export declare class EpigraphSupportDetectedEvent extends BaseAnalyticsEvent {
40
- constructor(items: IAnalyticsParameterItems | undefined, supportType: string, deviceCapabilities?: Record<string, unknown>);
40
+ constructor(items: IAnalyticsParameterItems, supportType: string, deviceCapabilities: {
41
+ ar_supported: boolean;
42
+ camera_access: boolean;
43
+ });
41
44
  }
42
45
  export declare class EpigraphButtonClickEvent extends BaseAnalyticsEvent {
43
- constructor(items: IAnalyticsParameterItems | undefined, buttonType: string, buttonName: string);
46
+ constructor(items: IAnalyticsParameterItems, buttonType: string, buttonName: string);
44
47
  }
45
48
  export declare class EpigraphPanelOpenedEvent extends BaseAnalyticsEvent {
46
- constructor(items: IAnalyticsParameterItems | undefined, isInteractive: boolean, panelType: string, triggerSource: string);
49
+ constructor(items: IAnalyticsParameterItems, isInteractive: boolean, panelType: string, triggerSource: string);
47
50
  }
48
51
  export declare class EpigraphPanelClosedEvent extends BaseAnalyticsEvent {
49
- constructor(items: IAnalyticsParameterItems | undefined, isInteractive: boolean, panelType: string, triggerSource: string);
52
+ constructor(items: IAnalyticsParameterItems, isInteractive: boolean, panelType: string, triggerSource: string);
50
53
  }
51
54
  export declare class EpigraphAddToFavouritesEvent extends BaseAnalyticsEvent {
52
- constructor(items?: IAnalyticsParameterItems);
55
+ constructor(items: IAnalyticsParameterItems);
53
56
  }
54
57
  export declare class EpigraphKeyboardInteractionEvent extends BaseAnalyticsEvent {
55
- constructor(items: IAnalyticsParameterItems | undefined, actionPerformed: string);
58
+ constructor(items: IAnalyticsParameterItems, actionPerformed: string);
56
59
  }
57
60
  export declare class EpigraphTouchInteractionEvent extends BaseAnalyticsEvent {
58
- constructor(items: IAnalyticsParameterItems | undefined, interactionType: string);
61
+ constructor(items: IAnalyticsParameterItems, interactionType: string);
59
62
  }
60
63
  export declare class EpigraphItemAddedEvent extends BaseAnalyticsEvent {
61
- constructor(items: IAnalyticsParameterItems | undefined, isInteractive: boolean, value: number, currency: string, quantity: number);
64
+ constructor(items: IAnalyticsParameterItems, isInteractive: boolean, value: number, currency: string, quantity: number);
62
65
  }
63
66
  export declare class EpigraphItemMovedEvent extends BaseAnalyticsEvent {
64
- constructor(items?: IAnalyticsParameterItems);
67
+ constructor(items: IAnalyticsParameterItems);
65
68
  }
66
69
  export declare class EpigraphItemRemovedEvent extends BaseAnalyticsEvent {
67
- constructor(items: IAnalyticsParameterItems | undefined, currency: string, quantity: number);
70
+ constructor(items: IAnalyticsParameterItems, currency: string, quantity: number);
68
71
  }
69
72
  export declare class EpigraphVariantChangedEvent extends BaseAnalyticsEvent {
70
- constructor(items: IAnalyticsParameterItems | undefined, changeType: string);
73
+ constructor(items: IAnalyticsParameterItems, changeType: string);
71
74
  }
72
75
  export declare class EpigraphContentSharedEvent extends BaseAnalyticsEvent {
73
- constructor(items: IAnalyticsParameterItems | undefined, contentType: string, shareDestination: string);
76
+ constructor(items: IAnalyticsParameterItems, contentType: string, shareDestination: string);
74
77
  }
75
78
  export declare class EpigraphCheckoutEvent extends BaseAnalyticsEvent {
76
- constructor(items: Array<any> | undefined, value: number, currency: string);
79
+ constructor(items: IAnalyticsParameterItems, value: number, currency: string);
77
80
  }
78
81
  export declare class EpigraphConversionEvent extends BaseAnalyticsEvent {
79
- constructor(items: IAnalyticsParameterItems | undefined, value: number, currency: string);
82
+ constructor(items: IAnalyticsParameterItems, value: number, currency: string);
80
83
  }
81
84
  export declare class EpigraphChangeRateEvent extends BaseAnalyticsEvent {
82
- constructor(items: IAnalyticsParameterItems | undefined, value: number);
85
+ constructor(items: IAnalyticsParameterItems, value: number);
83
86
  }
84
87
  export declare class EpigraphCompletionRateEvent extends BaseAnalyticsEvent {
85
- constructor(items: IAnalyticsParameterItems | undefined, value: number);
88
+ constructor(items: IAnalyticsParameterItems, value: number);
86
89
  }
87
90
  export declare class EpigraphEngagementRateEvent extends BaseAnalyticsEvent {
88
- constructor(items: IAnalyticsParameterItems | undefined, value: number);
91
+ constructor(items: IAnalyticsParameterItems, value: number);
89
92
  }
90
93
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epigraph/epigraph-std-lib",
3
- "version": "4.5.0-alpha",
3
+ "version": "4.5.1-alpha",
4
4
  "type": "module",
5
5
  "main": "./dist/epigraph-std-lib.cjs",
6
6
  "module": "./dist/epigraph-std-lib.js",