/*! Analytics - Mon, 15 Apr 2024 17:56:43 GMT */ "use strict";(self.webpackChunkom_api_js=self.webpackChunkom_api_js||[]).push([[1],{5624:function(t,i,e){e.r(i),e.d(i,{default:function(){return m}});var s={};e.r(s),e.d(s,{GoogleAnalytics:function(){return g},GoogleAnalytics4:function(){return y},Native:function(){return l}});var n=e(2843),a=e(9213),r=e(2888);function o(t,i,e){return(i=function(t){var i=function(t,i){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var s=e.call(t,i||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===i?String:Number)(t)}(t,"string");return"symbol"==typeof i?i:String(i)}(i))in t?Object.defineProperty(t,i,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[i]=e,t}class l{constructor(t){o(this,"track",(()=>{(0,r.trigger)(document,"Native.track",{Native:this,Campaign:this.C}),this.enabled&&this.run()})),o(this,"run",(()=>{(0,r.trigger)(document,"Native.track",{Native:this,Campaign:this.C});let t="impression"===this.analytics.type?(0,r.getUrl)(this.C.defaults,"impressions"):(0,r.getUrl)(this.C.defaults,"conversions"),i={aid:this.C.defaults.user,cid:this.C.id,sid:this.C.Sites.current().id||0,rt:(0,r.visitorReturning)(),dv:n.Z.get(),cty:this.C.type,url:(0,r.urlPath)(),v:5};this.request(t,i),(0,r.trigger)(document,"Native."+this.analytics.type,{Native:this,Campaign:this.C,data:i})})),o(this,"request",((t,i)=>{(new a.Z).get(t,i).setCache(!1).setTimeout(5e3).send().then((()=>{})).catch((()=>{}))})),this.type="native",this.analytics=t,this.C=t.C,this.enabled=!0,this.init()}init(){(0,r.trigger)(document,"Native.init",{Native:this,Campaign:this.C})}}var c=e(7075),h=e(7624);function d(t,i,e){return(i=function(t){var i=function(t,i){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var s=e.call(t,i||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===i?String:Number)(t)}(t,"string");return"symbol"==typeof i?i:String(i)}(i))in t?Object.defineProperty(t,i,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[i]=e,t}class g{constructor(t,i){d(this,"track",(()=>{(0,r.trigger)(document,"GoogleAnalytics.track",{GoogleAnalytics:this,Campaign:this.C,version:3}),window["ga-disable-"+this.settings.ua_id]||this.enabled&&(this.ready||this.C.Timeouts.set((()=>{this.track()}),500),this.object&&(0,r.hasProp)(this.object,"getAll")&&((0,r.each)(this.object.getAll(),((t,i)=>{i.get("trackingId")===this.settings.ua_id&&(this.tracker=i)})),this.tracker||(this.object("create",this.settings.ua_id,"auto","omTracker"+this.C.id),(0,r.hasProp)(this.object,"getByName")&&(this.tracker=this.object.getByName("omTracker"+this.C.id))),this.tracker?(this.tracker.send("event",this.C.name,this.analytics.type,this.C.id,{nonInteraction:!0,_r:0}),(0,r.trigger)(document,"GoogleAnalytics."+this.analytics.type,{GoogleAnalytics:this,Campaign:this.C,version:3})):this.warned||(c.Z.debug('A Google Analytics tracker could not be created or retrieved for the "'+this.C.name+'" campaign. Contact support for more details.'),this.warned=!0)))})),this.analytics=t,this.C=t.C,this.id=i.id,this.type=i.type,this.settings=i.settings,this.object=null,this.tracker=null,this.ready=!1,this.enabled=!0,this.warned=!1,this.tries=0,void 0===window[h.GLOBAL_OM].scripts.analytics.googleAnalytics&&(window[h.GLOBAL_OM].scripts.analytics.googleAnalytics={data:{},error:"",object:null,status:"ready"}),this.init()}init(){if((0,r.trigger)(document,"GoogleAnalytics.init",{GoogleAnalytics:this,Campaign:this.C,version:3}),"failed"===window[h.GLOBAL_OM].scripts.analytics.googleAnalytics.status)return;if("loading"===window[h.GLOBAL_OM].scripts.analytics.googleAnalytics.status)return void this.C.Timeouts.set((()=>{this.init()}),500);if(8<++this.tries)return void c.Z.debug("Google Analytics could not be initialized for the "+this.C.name+" ("+this.C.id+") campaign because the analytics object is invalid.");if(!this.settings.ua_id)return void(this.enabled=!1);void 0!==window.__gtagTracker?this.object=window.__gtagTracker:void 0!==window.__gaTracker?this.object=window.__gaTracker:void 0!==window.gaTracker?this.object=window.gaTracker:void 0!==window.__omGaTracker?this.object=window.__omGaTracker:void 0!==window.ga?this.object=window.ga:(0,r.hasProp)(window,"GoogleAnalyticsObject")&&void 0!==window[window.GoogleAnalyticsObject]&&(this.object=window[window.GoogleAnalyticsObject]);let t=Promise.resolve();this.object&&(0,r.hasProp)(this.object,"loaded")&&!0===this.object.loaded||(t=new Promise((t=>{if("loaded"===window[h.GLOBAL_OM].scripts.analytics.googleAnalytics.status)return t();window[h.GLOBAL_OM].scripts.analytics.googleAnalytics.status="loading",(0,r.addScript)(this.settings.url,!0,(()=>{window[h.GLOBAL_OM].scripts.analytics.googleAnalytics.status="loaded",this.object=window.ga,t()}),(()=>{window[h.GLOBAL_OM].scripts.analytics.googleAnalytics.status="failed",c.Z.debug("Google Analytics could not be initialized for the "+this.C.name+" ("+this.C.id+") campaign because the script failed to load.")}))}))),t.then((()=>{this.ready=!0,this.object&&(0,r.hasProp)(this.object,"getAll")||(void 0!==window.ga&&(0,r.hasProp)(window.ga,"getAll")?this.object=window.ga:(this.object=null,this.C.Timeouts.set((()=>{this.init()}),500)))}))}}function u(t,i,e){return(i=function(t){var i=function(t,i){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var s=e.call(t,i||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===i?String:Number)(t)}(t,"string");return"symbol"==typeof i?i:String(i)}(i))in t?Object.defineProperty(t,i,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[i]=e,t}class y{constructor(t,i){u(this,"track",(()=>{if((0,r.trigger)(document,"GoogleAnalytics.track",{GoogleAnalytics:this,Campaign:this.C,version:4}),window["ga-disable-"+this.settings.ua_id])return;if(!this.enabled)return;if(!this.ready)return void this.C.Timeouts.set((()=>{this.track()}),500);if(!this.object)return;if(this.tracker=this.object,!this.tracker)return void(this.warned||(c.Z.debug('A Google Analytics tracker could not be created or retrieved for the "'+this.C.name+'" campaign. Contact support for more details.'),this.warned=!0));let t={name:`optinmonster_${this.analytics.type}`,params:{om_campaign_name:this.C.name,om_campaign_id:this.C.id,send_to:this.settings.ua_id}};(0,r.trigger)(document,"GoogleAnalytics.pre"+(0,r.toUpperCaseFirst)(this.analytics.type)+"Event",{GoogleAnalytics:this,Campaign:this.C,gaEvent:t}),this.tracker("event",t.name,t.params),(0,r.trigger)(document,"GoogleAnalytics."+this.analytics.type,{GoogleAnalytics:this,Campaign:this.C,version:4})})),this.analytics=t,this.C=t.C,this.id=i.id,this.type=i.type,this.settings=i.settings,this.object=null,this.tracker=null,this.ready=!1,this.enabled=!0,this.warned=!1,this.tries=0,this.dataLayerProp="dataLayer",this.gtagConfig={send_page_view:!1},void 0===window[h.GLOBAL_OM].scripts.analytics.googleAnalytics4&&(window[h.GLOBAL_OM].scripts.analytics.googleAnalytics4={data:{},error:"",object:null,status:"ready"}),this.init()}init(){if((0,r.trigger)(document,"GoogleAnalytics.init",{GoogleAnalytics:this,Campaign:this.C,version:4}),this.settings.ua_id||(this.enabled=!1),!this.enabled)return;if("failed"===window[h.GLOBAL_OM].scripts.analytics.googleAnalytics4.status)return;if("loading"===window[h.GLOBAL_OM].scripts.analytics.googleAnalytics4.status)return void this.C.Timeouts.set((()=>{this.init()}),500);if(8<++this.tries)return void c.Z.debug("Google Analytics could not be initialized for the "+this.C.name+" ("+this.C.id+") campaign because the analytics object is invalid.");if(this.object||(void 0!==window.__gtagTracker&&(this.object=window.__gtagTracker),(0,r.isFunction)(window.gtag)&&(this.object=window.gtag)),this.object)return void(this.ready=!0);let t=Promise.resolve();this.object||(0,r.getDOMElement)(`script[src^="${this.settings.url}"]`)||(t=new Promise((t=>{if("loaded"===window[h.GLOBAL_OM].scripts.analytics.googleAnalytics4.status)return t();window[h.GLOBAL_OM].scripts.analytics.googleAnalytics4.status="loading",(0,r.addScript)(this.settings.url,!0,(()=>{if(window[h.GLOBAL_OM].scripts.analytics.googleAnalytics4.status="loaded",(0,r.trigger)(document,"GoogleAnalytics.gtagConfig",{GoogleAnalytics:this,Campaign:this.C,version:4}),!this.object){const t=this.dataLayerProp;window[t]=window[t]||[];const i=function(){window[t].push(arguments)};i("js",new Date),i("config",this.settings.ua_id,this.gtagConfig),this.object=i}t()}),(()=>{window[h.GLOBAL_OM].scripts.analytics.googleAnalytics4.status="failed",c.Z.debug("Google Analytics could not be initialized for the "+this.C.name+" ("+this.C.id+") campaign because the script failed to load.")}))}))),t.then((()=>{this.ready=!0,this.object||(void 0!==window[this.dataLayerProp]?this.object=function(){window[this.dataLayerProp].push(arguments)}:(this.object=null,this.C.Timeouts.set((()=>{this.init()}),500)))}))}}function p(t,i,e){return(i=function(t){var i=function(t,i){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var s=e.call(t,i||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===i?String:Number)(t)}(t,"string");return"symbol"==typeof i?i:String(i)}(i))in t?Object.defineProperty(t,i,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[i]=e,t}class m{constructor(t){p(this,"track",(()=>{this.C.preview||this.C.override||this.C.ruleTest||(0,r.disableTrackingEnabled)()||"production"!==this.C.defaults.env||(0,r.inArray)(this.type,this.tracked)||((0,r.trigger)(document,`Analytics.${this.type}`,{Analytics:this,Campaign:this.C}),(0,r.trigger)(document,"Analytics.track",{Analytics:this,Campaign:this.C}),(0,r.each)(this.analytics,((t,i)=>{i.track()})),this.tracked.push(this.type))})),p(this,"impression",(()=>{if(!this.C.Types.isInline()||this.visible())return this.type="impression",this.track();this.scrollOn()})),p(this,"scrollOn",(()=>{(0,r.trigger)(document,"Analytics.init.scrollListener",{Analytics:this,Campaign:this.C}),this.scrollElement=this.scrollElement||this.C.getCustomScrollElement(window),(0,r.on)(this.scrollElement,"scroll.omAnalytics."+this.C.id,this.hasScrolled)})),p(this,"hasScrolled",(()=>{this.C.Types.isInline()?this.visible()&&(this.type="impression",this.track(),this.scrollOff()):this.scrollOff()})),p(this,"visible",(()=>49{this.scrollElement=this.scrollElement||this.C.getCustomScrollElement(window),(0,r.off)(this.scrollElement,"scroll.omAnalytics."+this.C.id)})),p(this,"conversion",(()=>{this.type="conversion",this.track()})),this.C=t,this.type="impression",this.tracked=[],this.analytics=[new l(this)],this.scrollElement=null,(0,r.each)(t.analytics,((t,i)=>{this.analytics.push(new(s[(0,r.convertClassName)(i.type)])(this,i))})),this.init()}init(){(0,r.trigger)(document,"Analytics.init",{Analytics:this,Campaign:this.C})}}}}]);