apxor-qe 1.4.0 → 1.4.2

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 +1 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("apxor")):"function"==typeof define&&define.amd?define(["apxor"],e):(t=t||self)["apxor-qe"]=e(t.Apxor)}(this,(function(t){"use strict";function e(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function r(t){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?e(Object(n),!0).forEach((function(e){s(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):e(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,l(n.key),n)}}function a(t,e,r){return e&&o(t.prototype,e),r&&o(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function s(t,e,r){return(e=l(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function u(t){return function(t){if(Array.isArray(t))return c(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return c(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return c(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function l(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;var f=function(t){return void 0!==t&&!function(t){return null===t}(t)},d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function h(t,e){return Array.from(e).map((function(e,r){return String.fromCharCode(e^function(t,e){return t.charCodeAt(Math.floor(e%t.length))}(t,r))})).join("")}var v=function(t,e){return h(t,e=function(t){var e,r,n,i,o,a,s=0,u=[];if(!t)return t;t+="";do{e=(a=d.indexOf(t.charAt(s++))<<18|d.indexOf(t.charAt(s++))<<12|(i=d.indexOf(t.charAt(s++)))<<6|(o=d.indexOf(t.charAt(s++))))>>16&255,r=a>>8&255,n=255&a,u.push(e),64!==i&&(u.push(r),64!==o&&u.push(n))}while(s<t.length);return u}(e))},p=function(t){switch(t){case"app_event":return"AE";case"client_event":return"CE";case"activity_time":case"activity_event":return"AE"}return"Unknown"},g=function(t){return t.toUpperCase()},y=function(t,e,r){switch(r){case"EQ":return t===e;case"GT":return t>e;case"GTE":return t>=e;case"LT":return t<e;case"LTE":return t<=e;case"NEQ":return t!==e;case"R":return m(e).test(t);default:return!1}},m=function(t){var e=t.replace(/.*\/([gimuy]*)$/,"$1");e===t&&(e="");var r=e?t.replace(new RegExp("^/(.*?)/"+e+"$"),"$1"):t;return new RegExp(r,e)},_=function(){var t=new Date;return t.getDate()+"/"+t.getMonth()+"/"+t.getFullYear()},b=window.ApxorLogger,E=a((function e(){var r=this;i(this,e),s(this,"pfyk","ALL"),s(this,"oyin",[]),s(this,"Pifw",[]),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(r.pfyk=t.audience.audience_type,r.oyin=t.audience.attributes.user,r.Pifw=t.audience.attributes.session,!Array.isArray(r.oyin)||!Array.isArray(r.Pifw))return b.error("No attributes"),!1}catch(t){return b.error(t),!1}return!0})),s(this,"validate",(function(e,n){var i=!0;return"FTU"===r.pfyk&&(i=t.getController().getSessionInfo().is_first_session),i&&r.larY(e,r.oyin)&&r.larY(n,r.Pifw)})),s(this,"larY",(function(t,e){var r=e.length,n=!0;try{for(var i,o=function(){var r=e[a];if(!t[r.name]||!1===n)return{v:!1};var i=r.operator,o=r.type,s=r.value.map((function(t){return"s"===o?t:"l"===o?parseInt(t):"f"===o?parseFloat(t):void 0})),u=(Array.isArray(t[r.name])?t[r.name]:[t[r.name]]).some((function(t){return s.some((function(e){return y(t,e,i)}))}));n=n&&u},a=0;a<r;a++)if(i=o())return i.v}catch(t){b.error(t),n=!1}return n}))})),S=window.ApxorLogger,k=a((function t(){var e=this;i(this,t),s(this,"kedV",0),s(this,"VSmt",0),s(this,"YTxk","SESSION"),s(this,"zwPH",0),s(this,"gMHQ",0),s(this,"amzH",0),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{e.kedV=t.frequency.count,-1===e.kedV&&(e.kedV=1e3),e.amzH=e.kedV,e.VSmt=t.frequency.time_interval,e.YTxk=t.frequency.validity,e.gMHQ=t.frequency.ses_lmt,e._dayCount=t.frequency.day_lmt;var r=K.getInstance().getQeState();if(!f(r)||!f(r[t._id]))return!0;if("SESSION"===e.YTxk){if(e.kedV=parseInt(e.kedV)-parseInt(r[t._id].SESSION),e.kedV<=0)return console.warn("Max count limit reached for session:"+t._id),!1}else{if("OVERALL"!==e.YTxk)return S.info("Invalid config."),!1;if(e.kedV=parseInt(e.kedV)-parseInt(r[t._id].OVERALL),e.kedV<=0)return console.warn("Max count limit reached for overall:"+t._id),!1}}catch(t){return S.error(t),!1}return!0})),s(this,"oDrA",(function(){e.kedV=e.kedV-1})),s(this,"getFrequencyCount",(function(){return e.kedV})),s(this,"XbPF",(function(){"SESSION"===e.YTxk&&(e.kedV=e.amzH,S.info("Campaign Limit reset"))})),s(this,"WTEf",(function(t){try{if(e.kedV<=0)return!1;var r=K.getInstance().getQeState();if(!f(r)||!f(r[t]))return!0;if(0!==e.gMHQ)if(parseInt(e.gMHQ)-parseInt(r[t].SESSION)<=0)return!1;if(0!==e._dayCount){var n,i=_();if(parseInt(e._dayCount)-parseInt((null===(n=r[t])||void 0===n?void 0:n.DATES[i])||0)<=0)return!1}}catch(t){S.error("Error validating the frequency:"+t)}return!0}))})),D=a((function t(){var e=this;i(this,t),s(this,"EDaN",""),s(this,"pfyk",""),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var r;e.EDaN=t.meta.name,e.pfyk=t.meta.type,e._only_context=t.meta.only_context,e._attr=(null===(r=t.meta)||void 0===r?void 0:r.attr)||{}}catch(t){return window.ApxorLogger.error(t),!1}return!0}))})),w=window.ApxorLogger,I=a((function t(){var e=this;i(this,t),s(this,"isju",-1),s(this,"eexF",-1),s(this,"Xmbz",-1),s(this,"IRGG",-1),s(this,"jPEb",!1),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(isNaN(Date.parse(t.validity.start_date))||isNaN(Date.parse(t.validity.end_date)))return w.error("Not valid dates"),!1;if(e.isju=Date.parse(t.validity.start_date),e.eexF=Date.parse(t.validity.end_date),f(t.time_limits_in_day)&&(e.jPEb=t.time_limits_in_day,e.jPEb&&f(t.time_limits))){var r=(new Date).toISOString().split("T")[0];if(e.Xmbz=Date.parse(r+"T"+t.time_limits.start_time+".000Z"),e.IRGG=Date.parse(r+"T"+t.time_limits.end_time+".000Z"),isNaN(e.Xmbz)||isNaN(e.IRGG))return w.error("Not valid times"),!1}}catch(t){return w.error(t),!1}return!0})),s(this,"validate",(function(){var t=Date.now();return t>e.isju&&t<e.eexF&&(!e.jPEb||t>=e.Xmbz&&t<=e.IRGG)}))})),A=a((function t(){var e=this;i(this,t),s(this,"EDaN",""),s(this,"EpkX",{}),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{e.EDaN=t.name,e.EpkX=t.additional_info}catch(t){return!1}return!0}))})),O=a((function t(){var e=this;i(this,t),s(this,"vQNe",0),s(this,"idSb",0),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(e.vQNe=Number(t.lower),e.idSb=Number(t.upper),isNaN(e.vQNe)||isNaN(e.idSb))return!1}catch(t){return!1}return!0}))})),N=a((function t(){var e=this;i(this,t),s(this,"dAXx",0),s(this,"QksQ",""),s(this,"SmWY",""),s(this,"SbdV",new A),s(this,"OuAR",new O),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return e.QksQ=t.event_type,e.SmWY=t.activity,e.SbdV.parse(t.details)&&e.OuAR.parse(t.time_bounds)}catch(t){return!1}}))})),X=window.ApxorLogger,V=a((function t(){var e=this;i(this,t),s(this,"dAXx",0),s(this,"kVOA",-1),s(this,"kedV",0),s(this,"oakv",""),s(this,"SmWY",""),s(this,"QksQ",""),s(this,"OuAR",new O),s(this,"SbdV",new A),s(this,"YEhB",new N),s(this,"yHRM","AND"),s(this,"Pkry",!1),s(this,"pfyk",void 0),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return e.kVOA=t.sequence,e.kedV=t.count_config.count,e.oakv=t.count_config.operator,e.SmWY=t.activity,e.QksQ=t.event_type,e.yHRM=t.combine_operator,e.pfyk=t.type,e.SbdV.parse(t.details)&&e.YEhB.parse(t.trigger)&&e.OuAR.parse(t.time_bounds)}catch(t){return X.error(t),!1}}))})),q=window.ApxorLogger,T=a((function t(){var e=this;i(this,t),s(this,"kedV",0),s(this,"oakv",""),s(this,"QksQ",""),s(this,"OuAR",new O),s(this,"SbdV",new A),s(this,"yHRM","AND"),s(this,"parse",(function(t){try{return e.kedV=t.count_config.count,e.oakv=t.count_config.operator,e.QksQ=t.event_type,e.yHRM=t.combine_operator,e.SbdV.parse(t.details)&&e.OuAR.parse(t.time_bounds)}catch(t){return q.error(t),!1}}))})),j=window.ApxorLogger,x=function(){function e(){var r=this;i(this,e),s(this,"XsTp",0),s(this,"jaGt",""),s(this,"qXKr",new V),s(this,"yIMt",new T),s(this,"gZba",!1),s(this,"HPUo",!1),s(this,"RIDN",0),s(this,"yHRM","AND"),s(this,"mCal","OR"),s(this,"fTSz",-1),s(this,"eiXR",[]),s(this,"JfUj",{}),s(this,"rduQ",!1),s(this,"initialize",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"";if(r.jaGt=n,r.RIDN=i,r.eiXR=a,"termination"===s&&""!==s){r.yIMt.parse(e);return r.mCal=r.yIMt.yHRM,r.IIJM(),!0}var u=r.qXKr.parse(e);if(u){if(r.yHRM=r.qXKr.yHRM,r.qXKr.Pkry){var c=r.qXKr.SbdV.EDaN;"APX_PAGE_OPENED"===c&&(c=r.qXKr.SbdV.EpkX.navigation_id,c=f(c)?c:r.qXKr.SbdV.EDaN),r.fTSz=t.getController().getEventCount(c);var l=r.qXKr.kedV,d=r.qXKr.oakv;if(r.HPUo=r.jjDO(r.fTSz-1,l,d,!1),r.gZba=r.HPUo,r.HPUo&&"APX_PAGE_OPENED"===r.qXKr.SbdV.EDaN)return!0}return o&&0!==i||r.OJSD(),!0}return!1})),s(this,"OJSD",(function(){var t=r.qXKr,e=t.YEhB,n=K.getInstance();"app_start"===e.QksQ?(r.gZba=!0,n.registerForEvent(p(t.QksQ)+"___"+t.SbdV.EDaN,r.vJpn)):n.registerForEvent(p(t.QksQ)+"___"+e.SbdV.EDaN,r.vJpn)})),s(this,"IIJM",(function(){var t=r.yIMt,e=K.getInstance();r.gZba=!0,e.registerForEvent(p(t.QksQ)+"___"+t.SbdV.EDaN,r.nTnW)})),s(this,"aZcq",(function(t,e,n,i){var o,a=(Date.now()-r.JfUj[e])/1e3;(null===(o=r.qXKr)||void 0===o||null===(o=o.SbdV)||void 0===o||null===(o=o.EpkX)||void 0===o?void 0:o.time)/1e3>a&&r._displayCampaign(n)})),s(this,"EfFk",(function(t,e,n,i){var o,a;r.rduQ=!0;var s=Date.now(),u=null===(o=r.qXKr)||void 0===o||null===(o=o.YEhB)||void 0===o?void 0:o.SbdV.EDaN,c=(s-r.JfUj[u])/1e3,l=null===(a=r.qXKr)||void 0===a||null===(a=a.SbdV)||void 0===a||null===(a=a.EpkX)||void 0===a?void 0:a.time;(l/=1e3)>c&&r._displayCampaign(n)})),s(this,"vJpn",(function(t,e,n,i){var o=K.getInstance();if(r.gZba)p(r.qXKr.QksQ)===t&&r.oLnh(n-r.qXKr.YEhB.dAXx,r.qXKr.OuAR)&&r.qXKr.SbdV.EDaN===e&&r.MUef(r.qXKr.SbdV.EpkX,i)&&(r.XsTp+=1,r.HPUo=r.jjDO(r.XsTp,r.qXKr.kedV,r.qXKr.oakv),r.HPUo&&(r.qXKr.dAXx=n,o.validate(r.jaGt,r.RIDN)));else if(r.gZba=r.alII(t,e,n,i),r.gZba){var a=r.qXKr,s=a.YEhB;if(s.dAXx=n,"activity_time"===(null==a?void 0:a.QksQ)){var u,c,l,f=null==a||null===(u=a.SbdV)||void 0===u||null===(u=u.EpkX)||void 0===u?void 0:u.time;(null==a||null===(c=a.SbdV)||void 0===c||null===(c=c.EpkX)||void 0===c?void 0:c.nkpi.length)>0&&(setTimeout((function(){r.rduQ||(r.HPUo=!0,r.HPUo&&(r.XsTp+=1,r.HPUo=r.jjDO(r.XsTp,r.qXKr.kedV,r.qXKr.oakv),r.HPUo&&(r.qXKr.dAXx=n,o.validate(r.jaGt,r.RIDN)))),a.SbdV.EpkX.nkpi.map((function(t){o.unregisterFromEvent(g(a.SbdV.EpkX.et)+"___"+t,r)}))}),f),a.SbdV.EpkX.nkpi.map((function(t){o.registerForEvent(g(a.SbdV.EpkX.et)+"___"+t,r.EfFk)}))),(null==a||null===(l=a.SbdV)||void 0===l||null===(l=l.EpkX)||void 0===l?void 0:l.kpi.length)>0&&(setTimeout((function(){a.SbdV.EpkX.kpi.map((function(t){o.unregisterFromEvent(g(a.SbdV.EpkX.et)+"___"+t,r)}))}),f),a.SbdV.EpkX.kpi.map((function(t){t===a.YEhB.SbdV.EDaN?(o.unregisterFromEvent(p(s.QksQ)+"___"+s.SbdV.EDaN,r),o.registerForEvent(g(a.SbdV.EpkX.et)+"___"+t,r.aZcq)):o.registerForEvent(g(a.SbdV.EpkX.et)+"___"+t,r.EfFk)})))}else o.unregisterFromEvent(p(s.QksQ)+"___"+s.SbdV.EDaN,r),o.registerForEvent(p(a.QksQ)+"___"+a.SbdV.EDaN,r);r.JfUj[e]=Date.now()}})),s(this,"nTnW",(function(t,e,n,i){var o=K.getInstance();p(r.yIMt.QksQ)===t&&r.oLnh(n,r.yIMt.OuAR)&&r.yIMt.SbdV.EDaN===e&&r.MUef(r.yIMt.SbdV.EpkX,i)&&(r.XsTp+=1,r.HPUo=r.jjDO(r.XsTp,r.yIMt.kedV,r.yIMt.oakv),r.HPUo&&(r.yIMt.dAXx=n,o.validateForTermination(r.jaGt,r.RIDN)))})),s(this,"alII",(function(t,e,n,i){var o=r.qXKr.YEhB;return p(o.QksQ)===t&&o.SbdV.EDaN===e&&r.oLnh(n,o.OuAR)&&r.MUef(o.SbdV.EpkX,i)})),s(this,"oLnh",(function(t,e){var r=Math.ceil(t);return r>e.vQNe&&r<e.idSb})),s(this,"jjDO",(function(t,e,n){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];switch(i&&r.qXKr.Pkry&&(t+=r.fTSz),n){case"EQ":return t===e;case"GT":return t>e;case"GTE":return t>=e;case"LT":return t<e;case"LTE":return t<=e;default:return!1}})),s(this,"MUef",(function(t,e){var r=!0;try{var i,o=function(){if(!e[a]||!1===r)return{v:!1};if("object"===n(t[a])){var i,o=t[a].op,s=t[a].t;"s"===s?i=t[a].val:"l"!==s&&"f"!==s||(i=parseFloat(t[a].val));var u=(Array.isArray(e[a])?e[a]:[e[a]]).some((function(t){return y(t,i,o)}));r=r&&u}else r=r&&y(e[a],t[a],"EQ")};for(var a in t)if(i=o())return i.v}catch(t){j.error(t),r=!1}return r}))}return a(e,[{key:"_displayCampaign",value:function(t){var e=K.getInstance();this.HPUo=!0,this.HPUo&&(this.XsTp+=1,this.HPUo=this.jjDO(this.XsTp,this.qXKr.kedV,this.qXKr.oakv),this.HPUo&&(this.qXKr.dAXx=t,e.validate(this.jaGt,this.RIDN)))}}]),e}(),Q=window.ApxorLogger,F=a((function e(){var r=this;i(this,e),s(this,"kgNo",[]),s(this,"_ret_day",{}),s(this,"mequ",{}),s(this,"CRUL",!1),s(this,"mxWo",!1),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{r.kgNo=t.overall_cfg.events,r._ret_day=t.overall_cfg.ret_day,r.mequ=t.overall_cfg.session,r.CRUL=t.overall_cfg.toggleRetDay,r.kgNo=t.overall_cfg.events,r.mxWo=t.overall_cfg.toggleSession}catch(t){return Q.error(t),!1}return!0})),s(this,"validate",(function(){var e=parseInt(t.getController().getFromStorage("apx_retained_days")),n=parseInt(t.getController().getFromStorage("apx_retained_session"));if(r.CRUL&&!isNaN(e)&&!(e>=r._ret_day.from&&e<=r._ret_day.to))return!1;if(r.mxWo&&!isNaN(n)&&!(n>=r.mequ.from&&n<=r.mequ.to))return!1;try{for(var i=t.getController().getFromStorage("_apx_lt_count"),o=t.getSiteId(),a=JSON.parse((new TextDecoder).decode(function(t){for(var e=new ArrayBuffer(t.length),r=new Uint8Array(e),n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return e}(v(o,i)))),s=0;s<r.kgNo.length;s++){if(a[r.kgNo[s].name.replace("'","").replace("’","")])return!1}}catch(t){Q.error("Failed to validate the lt count:"+t)}return!0}))})),U=window.ApxorLogger,C=a((function t(){var e=this;i(this,t),s(this,"oyin",[]),s(this,"Pifw",[]),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(e.oyin=t.attributes.user,e.Pifw=t.attributes.session,!Array.isArray(e.oyin)||!Array.isArray(e.Pifw))return U.error("No attributes"),!1}catch(t){return U.error(t),!1}return!0})),s(this,"validate",(function(t,r){return e.larY(t,e.oyin)&&e.larY(r,e.Pifw)})),s(this,"larY",(function(t,e){var r=e.length,n=!0;try{for(var i,o=function(){var r=e[a];if(!t[r.name]||!1===n)return{v:!1};var i=r.operator,o=r.type,s=r.value.map((function(t){return"s"===o?t:"l"===o?parseInt(t):"f"===o?parseFloat(t):void 0})),u=(Array.isArray(t[r.name])?t[r.name]:[t[r.name]]).some((function(t){return s.some((function(e){return y(t,e,i)}))}));n=n&&u},a=0;a<r;a++)if(i=o())return i.v}catch(t){U.error(t),n=!1}return n}))})),P=a((function e(){var r=this;i(this,e),s(this,"NURV",t.getController()),s(this,"type",""),s(this,"_duration_seconds",0),s(this,"eUbV",1),s(this,"parse",(function(t){try{var e,n,i;if(r.pfyk=null===(e=t.terminate_info.time_based)||void 0===e?void 0:e.type,r._duration_seconds=null===(n=t.terminate_info)||void 0===n?void 0:n.time_based.duration_seconds,r.eUbV=null===(i=t.terminate_info.time_based)||void 0===i?void 0:i.days,r.qjgz(t._id))return r.NURV.persistTerminationInfoLocally(t._id),!1}catch(t){return!1}return!0})),s(this,"qjgz",(function(t){var e,n=JSON.parse(r.NURV.getFromStorage("apx_termination_ID"));if(!n[t]||null===(e=n[t])||void 0===e||!e.startDate)return!1;var i,o=new Date(n[t].startDate),a=new Date((i=new Date).getMonth()+"/"+i.getDate()+"/"+i.getFullYear()),s=parseInt((a-o)/864e5,10),u=function(){var t=new Date;return{hours:t.getHours(),mins:t.getMinutes()}}(),c=n[t].Xmbz;return s===r.eUbV&&u.hours>=c.hours||s>r.eUbV||n[t].goalAcheived}))})),R=a((function t(){var e=this;i(this,t),s(this,"enable_goal_events",!1),s(this,"attributes",{}),s(this,"WnkR",new C),s(this,"jcBj",new P),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var r,n,i;if(e.enable_time_based=null==t||null===(r=t.terminate_info)||void 0===r?void 0:r.enable_time_based,e.enable_time_based&&!e.jcBj.parse(t))return!1;if(e.enable_goal_events=null==t||null===(n=t.terminate_info)||void 0===n?void 0:n.enable_goal_events,e.enable_attributes=null==t||null===(i=t.terminate_info)||void 0===i?void 0:i.enable_attributes,e.enable_attributes&&!e.WnkR.parse(t.terminate_info))return!1}catch(t){return window.ApxorLogger.error(t),!1}return!0})),s(this,"validate",(function(t,r){return e.WnkR.validate(t,r)}))})),W=window.ApxorLogger,Y=a((function e(){var n=this;i(this,e),s(this,"oWeW",[]),s(this,"bwHJ",[]),s(this,"jaGt",""),s(this,"ylID",new D),s(this,"fGtu",new E),s(this,"YTxk",new I),s(this,"CWOw",new k),s(this,"VUII",new F),s(this,"xoSz",new R),s(this,"uZEl",!1),s(this,"TYUY",[]),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(!f(t._id))return W.error("No Id"),!1;if(!f(t.enabled)||!t.enabled)return W.error("Not enabled"),!1;if(!(n.ylID.parse(t)&&n.YTxk.parse(t)&&n.CWOw.parse(t)&&n.fGtu.parse(t)&&n.VUII.parse(t)&&n.xoSz.parse(t)))return!1;if(!f(t.conditions)||!Array.isArray(t.conditions))return W.error("No valid conditions",t.conditions),!1;n.jaGt=t._id,n.uZEl=!!f(t.sequence_enabled)&&t.sequence_enabled,n.uZEl&&t.conditions.sort((function(t,e){return t.sequence<e.sequence}));for(var e=t.conditions,r=e.length,i=0;i<r;i++){n.TYUY=[];var o=e[i];if("didn't"===o.type){var a,s={trigger_key:o.trigger.details.name,no_kpi_array:null==o||null===(a=o.details)||void 0===a||null===(a=a.additional_info)||void 0===a?void 0:a.nkpi,condition_id:null==o?void 0:o._id,time_bounds:o.time_bounds.upper};n.TYUY=[].concat(u(n.TYUY),[s])}var c=new x;c.initialize(o,n.jaGt,i,n.uZEl,n.TYUY)&&n.oWeW.push(c)}if(n.xoSz.enable_goal_events)for(var l=t.terminate_info.goal_events.events,d=l.length,h=0;h<d;h++){var v=new x;v.initialize(l[h],n.jaGt,h,!0,[],"termination")&&n.bwHJ.push(v)}return n.oWeW.length>0}catch(t){return W.error(t),!1}})),s(this,"Adtv",(function(t){if(!(t<0))if(n.uZEl){var e=n.oWeW[t];if(f(e)&&e.HPUo){var r=n.oWeW[t-1];if(f(r)&&!r.HPUo)return;var i=n.oWeW[t+1];f(i)?i.OJSD():n.BmHg()}}else n.BmHg()})),s(this,"RbFI",(function(t){t<0||n.GuEG()})),s(this,"BmHg",(function(){var e=t.getController().getUserAttributes(),i=t.getController().getSessionAttributes();if(n.YTxk.validate()&&n.fGtu.validate(e,i)&&n.VUII.validate()){for(var o=n.oWeW.length,a=o<1,s="",u=0;u<o;u++){var c=n.oWeW[u],l=c.HPUo;if(""===s.trim())a=l;else switch(s){case"AND":a=a&&l;break;case"OR":a=a||l}s=c.yHRM}if(a){if(console.debug("onCondition satisfied"),!n.CWOw.WTEf(n.jaGt))return void console.warn("Maximum limit reached",n.jaGt);console.log("Dispatching event",n.ylID.pfyk),!0===n.ylID._only_context&&t.logEvent("apx_context_evaluated",r(r({},n.ylID._attr),{},{message_name:n.ylID.EDaN,id:n.jaGt})),t.getController().dispatchEvent(n.ylID.pfyk,{name:n.ylID.pfyk,additional_info:{uuid:n.jaGt,name:n.ylID.EDaN}})}}})),s(this,"GuEG",(function(){for(var e=n.bwHJ.length,i=e<1,o="",a=0;a<e;a++){var s=n.bwHJ[a],u=s.HPUo;if(""===o.trim())i=u;else switch(o){case"AND":i=i&&u;break;case"OR":i=i||u}o=s.mCal}i&&(console.log("Dispatching event",n.ylID.pfyk),t.getController().persistTerminationInfoLocally(n.jaGt),!0===n.ylID._only_context&&t.logEvent("apx_context_evaluated",r(r({},n.ylID._attr),{},{message_name:n.ylID.EDaN,id:n.jaGt})),t.getController().dispatchEvent(n.ylID.pfyk,{name:n.ylID.pfyk,additional_info:{uuid:n.jaGt,name:n.ylID.EDaN}}))})),s(this,"validateForTerminationAttributes",(function(){var e=t.getController().getUserAttributes(),r=t.getController().getSessionAttributes();return n.xoSz.validate(e,r)})),s(this,"oDrA",(function(){n.CWOw.oDrA()})),s(this,"getFrequencyCount",(function(){return n.CWOw.getFrequencyCount()})),s(this,"XgXS",(function(){return n.CWOw.XbPF()}))})),H=a((function t(){var e=this;i(this,t),s(this,"IZYQ",{}),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{configs:[]};if(f(t)&&f(t.configs)){var r=t.configs;if(!Array.isArray(r))return;r.sort((function(t,e){var r,n;return(null!==(r=t.prio)&&void 0!==r?r:-1)-(null!==(n=e.prio)&&void 0!==n?n:-1)}));for(var n=0;n<r.length;n++){var i=r[n],o=i._id,a=new Y;a.parse(i)?e.IZYQ[o]=a:console.warn("Failed to parse cfg",o)}}})),s(this,"validate",(function(t,r){e.IZYQ[t]&&e.IZYQ[t].Adtv(r)})),s(this,"validateForTermination",(function(t,r){e.IZYQ[t]&&e.IZYQ[t].RbFI(r)})),s(this,"validateForTerminationAttributes",(function(t){return!!e.IZYQ[t]&&e.IZYQ[t].validateForTerminationAttributes()})),s(this,"oDrA",(function(t){e.IZYQ[t].oDrA()})),s(this,"getFrequencyCount",(function(t){return e.IZYQ[t].getFrequencyCount()})),s(this,"resetFrequencyCounts",(function(){var t=e.IZYQ;for(var r in t)t[r].XgXS()})),s(this,"NveP",(function(t){try{if(e.IZYQ){var r=e.IZYQ[t];if(r&&r.ylID)return r.ylID}}catch(t){console.log("Error in getting the campaign meta ".concat(t))}return{}}))})),L=window.ApxorLogger,G=a((function e(){var r=this;i(this,e),s(this,"FDcv",{}),s(this,"kJex",[]),s(this,"qMxr",!1),s(this,"initialize",(function(){var e=t.getController();e.registerForEvent("APP_EVENT",(function(t){return r.LtdS(t,"AE")})),e.registerForEvent("CLIENT_EVENT",(function(t){return r.LtdS(t,"CE")}))})),s(this,"zgeH",(function(){for(var t in r.kJex)r.rqKD(t.event,t.key,t.type);r.qMxr=!0})),s(this,"Weok",(function(t,e){var n;"function"==typeof e&&((n=r.FDcv[t]?r.FDcv[t]:[]).push(e),r.FDcv[t]=n,L.debug("Listeners list: ",r.FDcv))})),s(this,"unregisterFromEvent",(function(t,e){if(r.FDcv[t]){for(var n=r.FDcv[t],i=[],o=0;o<n.length;o++){var a=n[o];a!==e&&i.push(a)}r.FDcv[t]=i}})),s(this,"LtdS",(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"AE",n=e+"___"+t.name;r.rqKD(t,n,e)})),s(this,"rqKD",(function(e,n,i){if(r.qMxr){if(L.debug("Notifying listeners for event: "+e+", "+n,r.FDcv),r.FDcv[n])for(var o=r.FDcv[n],a=t.getController().getSDKRunningTimeInSec(),s=0;s<o.length;s++){(0,o[s])(i,e.name,a,e.additional_info)}}else r.kJex.push({event:e,key:n,type:i})}))})),M=window.ApxorLogger,K=function(){function e(){var r=this;return i(this,e),s(this,"EXbT",!1),s(this,"OqkB",null),s(this,"wsiO",_()),s(this,"DGNj",new G),s(this,"nawG",t.getSiteId()),s(this,"dWcU",{}),s(this,"getQeState",(function(){try{var e=t.getController().getFromStorage("qe_state");return e?JSON.parse(v(r.nawG,e)):(r.dWcU={},r.setQeState())}catch(t){return r.dWcU={},r.setQeState()}})),s(this,"setQeState",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";try{t.getController().persistToStorage("qe_state",r.dWcU,!0)}catch(n){""===e?r.dWcU={}:r.dWcU[e]={SESSION:0,OVERALL:0,DATES:{}},t.getController().persistToStorage("qe_state",r.dWcU,!0)}return r.dWcU})),s(this,"initialize",(function(){r.EXbT||(r.EXbT=!0,r.OqkB=new H,r.DGNj.initialize(),r.dWcU=r.getQeState(),M.info("QE Initialized.."))})),s(this,"parse",(function(t){r.TrIj()?(r.OqkB.parse(t),r.DGNj.zgeH()):M.warn("Must call init first. Unable to proceed")})),s(this,"validate",(function(t,e){r.TrIj()&&r.OqkB.validate(t,e)})),s(this,"validateForTermination",(function(t,e){r.TrIj()&&r.OqkB.validateForTermination(t,e)})),s(this,"validateForTerminationAttributes",(function(t,e){return r.OqkB.validateForTerminationAttributes(t,e)})),s(this,"updateCount",(function(t){try{f(r.dWcU[t])||r.createObjConfig(t),r.incrementFrequencies(t),r.setQeState(t),r.OqkB.oDrA(t)}catch(t){console.log("Could not update the count config:".concat(t))}})),s(this,"resetFrequencyCounts",(function(){r.OqkB.resetFrequencyCounts()})),s(this,"getFrequencyCount",(function(t){return r.OqkB.getFrequencyCount(t)})),s(this,"registerForEvent",(function(t,e){r.DGNj.Weok(t,e)})),s(this,"unregisterFromEvent",(function(t,e){r.DGNj.unregisterFromEvent(t,e)})),s(this,"fetch",(function(e,r,n,i){t.getController().fetchConfiguration(e,r,n,i)})),s(this,"TrIj",(function(){return r.EXbT})),s(this,"getCampaignMetaFromQueryEngine",(function(t){return r.OqkB.NveP(t)})),s(this,"ZCjh",(function(){return r.wsiO})),e.instance||(e.instance=this),e.instance}return a(e,[{key:"createObjConfig",value:function(t){try{this.dWcU=this.getQeState(),f(this.dWcU[t])||(this.dWcU[t]={SESSION:0,OVERALL:0,DATES:{}},this.wsiO&&(this.dWcU[t].DATES[this.wsiO]=0),this.setQeState(t))}catch(t){M.error("Can not create the frequency count object:"+t)}}},{key:"incrementFrequencies",value:function(t){this.dWcU=this.getQeState();var e=this.dWcU[t];e.SESSION=e.SESSION+1,e.OVERALL=e.OVERALL+1;var r=_();r===this.wsiO&&e.DATES&&e.DATES[r]||(this.wsiO=r,e.DATES={},e.DATES[this.wsiO]=0),e.DATES[this.wsiO]=e.DATES[this.wsiO]+1}}],[{key:"getInstance",value:function(){return e.instance||(e.instance=new e),e.instance}}]),e}();s(K,"instance",void 0),window.ceVersion=140;try{void 0===exports&&null===exports||(exports.default=K,module.exports=exports.default)}catch(t){}return K}));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("apxor")):"function"==typeof define&&define.amd?define(["apxor"],e):(t=t||self)["apxor-qe"]=e(t.Apxor)}(this,(function(t){"use strict";function e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function n(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){s(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,l(r.key),r)}}function a(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function s(t,e,n){return(e=l(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function u(t){return function(t){if(Array.isArray(t))return c(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return c(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function l(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;var f=function(t){return void 0!==t&&!function(t){return null===t}(t)},h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function v(t,e){return Array.from(e).map((function(e,n){return String.fromCharCode(e^function(t,e){return t.charCodeAt(Math.floor(e%t.length))}(t,n))})).join("")}var d=function(t,e){return v(t,e=function(t){var e,n,r,i,o,a,s=0,u=[];if(!t)return t;t+="";do{e=(a=h.indexOf(t.charAt(s++))<<18|h.indexOf(t.charAt(s++))<<12|(i=h.indexOf(t.charAt(s++)))<<6|(o=h.indexOf(t.charAt(s++))))>>16&255,n=a>>8&255,r=255&a,u.push(e),64!==i&&(u.push(n),64!==o&&u.push(r))}while(s<t.length);return u}(e))},g=function(t){switch(t){case"app_event":return"AE";case"client_event":return"CE";case"activity_time":case"activity_event":return"AE"}return"Unknown"},p=function(t){return t.toUpperCase()},_=function(t,e,n){switch(n){case"EQ":return t===e;case"GT":return t>e;case"GTE":return t>=e;case"LT":return t<e;case"LTE":return t<=e;case"NEQ":return t!==e;case"R":return y(e).test(t);default:return!1}},y=function(t){var e=t.replace(/.*\/([gimuy]*)$/,"$1");e===t&&(e="");var n=e?t.replace(new RegExp("^/(.*?)/"+e+"$"),"$1"):t;return new RegExp(n,e)},m=function(){var t=new Date;return t.getDate()+"/"+t.getMonth()+"/"+t.getFullYear()},b=window.ApxorLogger,w=a((function e(){var n=this;i(this,e),s(this,"KSOj","ALL"),s(this,"MSCc",[]),s(this,"HuDN",[]),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(n.KSOj=t.audience.audience_type,n.MSCc=t.audience.attributes.user,n.HuDN=t.audience.attributes.session,!Array.isArray(n.MSCc)||!Array.isArray(n.HuDN))return b.error("No attributes"),!1}catch(t){return b.error(t),!1}return!0})),s(this,"validate",(function(e,r){var i=!0;return"FTU"===n.KSOj&&(i=t.getController().getSessionInfo().is_first_session),i&&n.zQwl(e,n.MSCc)&&n.zQwl(r,n.HuDN)})),s(this,"zQwl",(function(t,e){var n=e.length,r=!0;try{for(var i,o=function(){var n=e[a];if(!t[n.name]||!1===r)return{v:!1};var i=n.operator,o=n.type,s=n.value.map((function(t){return"s"===o?t:"l"===o?parseInt(t):"f"===o?parseFloat(t):void 0})),u=(Array.isArray(t[n.name])?t[n.name]:[t[n.name]]).some((function(t){return s.some((function(e){return _(t,e,i)}))}));r=r&&u},a=0;a<n;a++)if(i=o())return i.v}catch(t){b.error(t),r=!1}return r}))})),S=window.ApxorLogger,N=a((function t(){var e=this;i(this,t),s(this,"oKkN",0),s(this,"uzZi",0),s(this,"Avzx","SESSION"),s(this,"CqAl",0),s(this,"ivKN",0),s(this,"cOKY",0),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{e.oKkN=t.frequency.count,-1===e.oKkN&&(e.oKkN=1e3),e.cOKY=e.oKkN,e.uzZi=t.frequency.time_interval,e.Avzx=t.frequency.validity,e.ivKN=t.frequency.ses_lmt,e._dayCount=t.frequency.day_lmt;var n=V.getInstance().getQeState();if(!f(n)||!f(n[t._id]))return!0;if("SESSION"===e.Avzx){if(e.oKkN=parseInt(e.oKkN)-parseInt(n[t._id].SESSION),e.oKkN<=0)return console.warn("Max count limit reached for session:"+t._id),!1}else{if("OVERALL"!==e.Avzx)return S.info("Invalid config."),!1;if(e.oKkN=parseInt(e.oKkN)-parseInt(n[t._id].OVERALL),e.oKkN<=0)return console.warn("Max count limit reached for overall:"+t._id),!1}}catch(t){return S.error(t),!1}return!0})),s(this,"ErGD",(function(){e.oKkN=e.oKkN-1})),s(this,"getFrequencyCount",(function(){return e.oKkN})),s(this,"Kbwh",(function(){"SESSION"===e.Avzx&&(e.oKkN=e.cOKY,S.info("Campaign Limit reset"))})),s(this,"TzLe",(function(t){try{if(e.oKkN<=0)return!1;var n=V.getInstance().getQeState();if(!f(n)||!f(n[t]))return!0;if(0!==e.ivKN)if(parseInt(e.ivKN)-parseInt(n[t].SESSION)<=0)return!1;if(0!==e._dayCount){var r,i=m();if(parseInt(e._dayCount)-parseInt((null===(r=n[t])||void 0===r?void 0:r.DATES[i])||0)<=0)return!1}}catch(t){S.error("Error validating the frequency:"+t)}return!0}))})),A=a((function t(){var e=this;i(this,t),s(this,"lKfZ",""),s(this,"KSOj",""),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var n;e.lKfZ=t.meta.name,e.KSOj=t.meta.type,e._only_context=t.meta.only_context,e._attr=(null===(n=t.meta)||void 0===n?void 0:n.attr)||{}}catch(t){return window.ApxorLogger.error(t),!1}return!0}))})),O=window.ApxorLogger,k=a((function t(){var e=this;i(this,t),s(this,"TVeC",-1),s(this,"AsSy",-1),s(this,"Hztt",-1),s(this,"ZTNT",-1),s(this,"eGYo",!1),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(isNaN(Date.parse(t.validity.start_date))||isNaN(Date.parse(t.validity.end_date)))return O.error("Not valid dates"),!1;if(e.TVeC=Date.parse(t.validity.start_date),e.AsSy=Date.parse(t.validity.end_date),f(t.time_limits_in_day)&&(e.eGYo=t.time_limits_in_day,e.eGYo&&f(t.time_limits))){var n=(new Date).toISOString().split("T")[0];if(e.Hztt=Date.parse(n+"T"+t.time_limits.start_time+".000Z"),e.ZTNT=Date.parse(n+"T"+t.time_limits.end_time+".000Z"),isNaN(e.Hztt)||isNaN(e.ZTNT))return O.error("Not valid times"),!1}}catch(t){return O.error(t),!1}return!0})),s(this,"validate",(function(){var t=Date.now();return t>e.TVeC&&t<e.AsSy&&(!e.eGYo||t>=e.Hztt&&t<=e.ZTNT)}))})),T=a((function t(){var e=this;i(this,t),s(this,"lKfZ",""),s(this,"xDaw",{}),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{e.lKfZ=t.name,e.xDaw=t.additional_info}catch(t){return!1}return!0}))})),D=a((function t(){var e=this;i(this,t),s(this,"MZxZ",0),s(this,"gheX",0),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(e.MZxZ=Number(t.lower),e.gheX=Number(t.upper),isNaN(e.MZxZ)||isNaN(e.gheX))return!1}catch(t){return!1}return!0}))})),x=a((function t(){var e=this;i(this,t),s(this,"SHrN",0),s(this,"rXTM",""),s(this,"bgoZ",""),s(this,"kuZn",new T),s(this,"tzep",new D),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return e.rXTM=t.event_type,e.bgoZ=t.activity,e.kuZn.parse(t.details)&&e.tzep.parse(t.time_bounds)}catch(t){return!1}}))})),E=window.ApxorLogger,C=a((function t(){var e=this;i(this,t),s(this,"SHrN",0),s(this,"eGRJ",-1),s(this,"oKkN",0),s(this,"CKgT",""),s(this,"bgoZ",""),s(this,"rXTM",""),s(this,"tzep",new D),s(this,"kuZn",new T),s(this,"xiSw",new x),s(this,"LNgq","AND"),s(this,"dWSg",!1),s(this,"KSOj",void 0),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return e.eGRJ=t.sequence,e.oKkN=t.count_config.count,e.CKgT=t.count_config.operator,e.bgoZ=t.activity,e.rXTM=t.event_type,e.LNgq=t.combine_operator,e.KSOj=t.type,e.kuZn.parse(t.details)&&e.xiSw.parse(t.trigger)&&e.tzep.parse(t.time_bounds)}catch(t){return E.error(t),!1}}))})),F=window.ApxorLogger,Z=a((function t(){var e=this;i(this,t),s(this,"oKkN",0),s(this,"CKgT",""),s(this,"rXTM",""),s(this,"tzep",new D),s(this,"kuZn",new T),s(this,"LNgq","AND"),s(this,"parse",(function(t){try{return e.oKkN=t.count_config.count,e.CKgT=t.count_config.operator,e.rXTM=t.event_type,e.LNgq=t.combine_operator,e.kuZn.parse(t.details)&&e.tzep.parse(t.time_bounds)}catch(t){return F.error(t),!1}}))})),K=window.ApxorLogger,X=function(){function e(){var n=this;i(this,e),s(this,"akXD",0),s(this,"FqJf",""),s(this,"ehaO",new C),s(this,"rkRi",new Z),s(this,"RlJN",!1),s(this,"GJsb",!1),s(this,"WLVW",0),s(this,"LNgq","AND"),s(this,"WFrp","OR"),s(this,"sVTX",-1),s(this,"GzsF",[]),s(this,"HATm",{}),s(this,"bqgA",!1),s(this,"initialize",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"";if(n.FqJf=r,n.WLVW=i,n.GzsF=a,"termination"===s&&""!==s){n.rkRi.parse(e);return n.WFrp=n.rkRi.LNgq,n.FoZP(),!0}var u=n.ehaO.parse(e);if(u){if(n.LNgq=n.ehaO.LNgq,n.ehaO.dWSg){var c=n.ehaO.kuZn.lKfZ;"APX_PAGE_OPENED"===c&&(c=n.ehaO.kuZn.xDaw.navigation_id,c=f(c)?c:n.ehaO.kuZn.lKfZ),n.sVTX=t.getController().getEventCount(c);var l=n.ehaO.oKkN,h=n.ehaO.CKgT;if(n.GJsb=n.BcDf(n.sVTX-1,l,h,!1),n.RlJN=n.GJsb,n.GJsb&&"APX_PAGE_OPENED"===n.ehaO.kuZn.lKfZ)return!0}return o&&0!==i||n.hian(),!0}return!1})),s(this,"hian",(function(){var t,e=n.ehaO,r=e.xiSw,i=V.getInstance();"app_start"===r.rXTM?(n.RlJN=!0,i.registerForEvent(g(e.rXTM)+"___"+e.kuZn.lKfZ,n.LkAU)):i.registerForEvent(g(e.rXTM)+"___"+r.kuZn.lKfZ,n.LkAU),null!==(t=window.ApxorRTM)&&void 0!==t&&t.badgesLists.includes(n.FqJf)&&i.registerForEvent(g(e.rXTM)+"___"+"apxor-badge-container-".concat("-".concat(n.FqJf).replaceAll(" ","").replace(/[^\w\s]/gi,"")),n.LkAU)})),s(this,"FoZP",(function(){var t=n.rkRi,e=V.getInstance();n.RlJN=!0,e.registerForEvent(g(t.rXTM)+"___"+t.kuZn.lKfZ,n.xsmN)})),s(this,"JTwT",(function(t,e,r,i){var o,a=(Date.now()-n.HATm[e])/1e3;(null===(o=n.ehaO)||void 0===o||null===(o=o.kuZn)||void 0===o||null===(o=o.xDaw)||void 0===o?void 0:o.time)/1e3>a&&n._displayCampaign(r)})),s(this,"sSky",(function(t,e,r,i){var o,a;n.bqgA=!0;var s=Date.now(),u=null===(o=n.ehaO)||void 0===o||null===(o=o.xiSw)||void 0===o?void 0:o.kuZn.lKfZ,c=(s-n.HATm[u])/1e3,l=null===(a=n.ehaO)||void 0===a||null===(a=a.kuZn)||void 0===a||null===(a=a.xDaw)||void 0===a?void 0:a.time;(l/=1e3)>c&&n._displayCampaign(r)})),s(this,"LkAU",(function(e,r,i,o){var a,s=V.getInstance();if(n.RlJN){if(null!==(a=window.ApxorRTM)&&void 0!==a&&a.isBadgePresent&&t.getController().isBadgeTriggerSatisfied(n.FqJf))return n.GJsb=!0,n.ehaO.SHrN=i,void s.validate(n.FqJf,n.WLVW);g(n.ehaO.rXTM)===e&&n.IHQA(i-n.ehaO.xiSw.SHrN,n.ehaO.tzep)&&n.ehaO.kuZn.lKfZ===r&&n.YnRU(n.ehaO.kuZn.xDaw,o)&&(n.akXD+=1,n.GJsb=n.BcDf(n.akXD,n.ehaO.oKkN,n.ehaO.CKgT),n.GJsb&&(n.ehaO.SHrN=i,s.validate(n.FqJf,n.WLVW)))}else if(n.RlJN=n.PCkN(e,r,i,o),n.RlJN){var u=n.ehaO,c=u.xiSw;if(c.SHrN=i,"activity_time"===(null==u?void 0:u.rXTM)){var l,f,h,v=null==u||null===(l=u.kuZn)||void 0===l||null===(l=l.xDaw)||void 0===l?void 0:l.time;(null==u||null===(f=u.kuZn)||void 0===f||null===(f=f.xDaw)||void 0===f?void 0:f.nkpi.length)>0&&(setTimeout((function(){n.bqgA||(n.GJsb=!0,n.GJsb&&(n.akXD+=1,n.GJsb=n.BcDf(n.akXD,n.ehaO.oKkN,n.ehaO.CKgT),n.GJsb&&(n.ehaO.SHrN=i,s.validate(n.FqJf,n.WLVW)))),u.kuZn.xDaw.nkpi.map((function(t){s.unregisterFromEvent(p(u.kuZn.xDaw.et)+"___"+t,n)}))}),v),u.kuZn.xDaw.nkpi.map((function(t){s.registerForEvent(p(u.kuZn.xDaw.et)+"___"+t,n.sSky)}))),(null==u||null===(h=u.kuZn)||void 0===h||null===(h=h.xDaw)||void 0===h?void 0:h.kpi.length)>0&&(setTimeout((function(){u.kuZn.xDaw.kpi.map((function(t){s.unregisterFromEvent(p(u.kuZn.xDaw.et)+"___"+t,n)}))}),v),u.kuZn.xDaw.kpi.map((function(t){t===u.xiSw.kuZn.lKfZ?(s.unregisterFromEvent(g(c.rXTM)+"___"+c.kuZn.lKfZ,n),s.registerForEvent(p(u.kuZn.xDaw.et)+"___"+t,n.JTwT)):s.registerForEvent(p(u.kuZn.xDaw.et)+"___"+t,n.sSky)})))}else s.unregisterFromEvent(g(c.rXTM)+"___"+c.kuZn.lKfZ,n),s.registerForEvent(g(u.rXTM)+"___"+u.kuZn.lKfZ,n);n.HATm[r]=Date.now()}})),s(this,"xsmN",(function(t,e,r,i){var o=V.getInstance();g(n.rkRi.rXTM)===t&&n.IHQA(r,n.rkRi.tzep)&&n.rkRi.kuZn.lKfZ===e&&n.YnRU(n.rkRi.kuZn.xDaw,i)&&(n.akXD+=1,n.GJsb=n.BcDf(n.akXD,n.rkRi.oKkN,n.rkRi.CKgT),n.GJsb&&(n.rkRi.SHrN=r,o.validateForTermination(n.FqJf,n.WLVW)))})),s(this,"PCkN",(function(t,e,r,i){var o=n.ehaO.xiSw;return g(o.rXTM)===t&&o.kuZn.lKfZ===e&&n.IHQA(r,o.tzep)&&n.YnRU(o.kuZn.xDaw,i)})),s(this,"IHQA",(function(t,e){var n=Math.ceil(t);return n>e.MZxZ&&n<e.gheX})),s(this,"BcDf",(function(t,e,r){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];switch(i&&n.ehaO.dWSg&&(t+=n.sVTX),r){case"EQ":return t===e;case"GT":return t>e;case"GTE":return t>=e;case"LT":return t<e;case"LTE":return t<=e;default:return!1}})),s(this,"YnRU",(function(t,e){var n=!0;try{var i,o=function(){if(!e[a]||!1===n)return{v:!1};if("object"===r(t[a])){var i,o=t[a].op,s=t[a].t;"s"===s?i=t[a].val:"l"!==s&&"f"!==s||(i=parseFloat(t[a].val));var u=(Array.isArray(e[a])?e[a]:[e[a]]).some((function(t){return _(t,i,o)}));n=n&&u}else n=n&&_(e[a],t[a],"EQ")};for(var a in t)if(i=o())return i.v}catch(t){K.error(t),n=!1}return n}))}return a(e,[{key:"_displayCampaign",value:function(t){var e=V.getInstance();this.GJsb=!0,this.GJsb&&(this.akXD+=1,this.GJsb=this.BcDf(this.akXD,this.ehaO.oKkN,this.ehaO.CKgT),this.GJsb&&(this.ehaO.SHrN=t,e.validate(this.FqJf,this.WLVW)))}}]),e}(),J=window.ApxorLogger,L=a((function e(){var n=this;i(this,e),s(this,"NpXz",[]),s(this,"_ret_day",{}),s(this,"MiYE",{}),s(this,"FLiS",!1),s(this,"DdTA",!1),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{n.NpXz=t.overall_cfg.events,n._ret_day=t.overall_cfg.ret_day,n.MiYE=t.overall_cfg.session,n.FLiS=t.overall_cfg.toggleRetDay,n.NpXz=t.overall_cfg.events,n.DdTA=t.overall_cfg.toggleSession}catch(t){return J.error(t),!1}return!0})),s(this,"validate",(function(){var e=parseInt(t.getController().getFromStorage("apx_retained_days")),r=parseInt(t.getController().getFromStorage("apx_retained_session"));if(n.FLiS&&!isNaN(e)&&!(e>=n._ret_day.from&&e<=n._ret_day.to))return!1;if(n.DdTA&&!isNaN(r)&&!(r>=n.MiYE.from&&r<=n.MiYE.to))return!1;try{for(var i=t.getController().getFromStorage("_apx_lt_count"),o=t.getSiteId(),a=JSON.parse((new TextDecoder).decode(function(t){for(var e=new ArrayBuffer(t.length),n=new Uint8Array(e),r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return e}(d(o,i)))),s=0;s<n.NpXz.length;s++){if(a[n.NpXz[s].name.replace("'","").replace("’","")])return!1}}catch(t){J.error("Failed to validate the lt count:"+t)}return!0}))})),z=window.ApxorLogger,q=a((function t(){var e=this;i(this,t),s(this,"MSCc",[]),s(this,"HuDN",[]),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(e.MSCc=t.attributes.user,e.HuDN=t.attributes.session,!Array.isArray(e.MSCc)||!Array.isArray(e.HuDN))return z.error("No attributes"),!1}catch(t){return z.error(t),!1}return!0})),s(this,"validate",(function(t,n){return e.zQwl(t,e.MSCc)&&e.zQwl(n,e.HuDN)})),s(this,"zQwl",(function(t,e){var n=e.length,r=!0;try{for(var i,o=function(){var n=e[a];if(!t[n.name]||!1===r)return{v:!1};var i=n.operator,o=n.type,s=n.value.map((function(t){return"s"===o?t:"l"===o?parseInt(t):"f"===o?parseFloat(t):void 0})),u=(Array.isArray(t[n.name])?t[n.name]:[t[n.name]]).some((function(t){return s.some((function(e){return _(t,e,i)}))}));r=r&&u},a=0;a<n;a++)if(i=o())return i.v}catch(t){z.error(t),r=!1}return r}))})),M=a((function e(){var n=this;i(this,e),s(this,"OCNT",t.getController()),s(this,"type",""),s(this,"_duration_seconds",0),s(this,"dXMg",1),s(this,"parse",(function(t){try{var e,r,i;if(n.KSOj=null===(e=t.terminate_info.time_based)||void 0===e?void 0:e.type,n._duration_seconds=null===(r=t.terminate_info)||void 0===r?void 0:r.time_based.duration_seconds,n.dXMg=null===(i=t.terminate_info.time_based)||void 0===i?void 0:i.days,n.OjHn(t._id))return n.OCNT.persistTerminationInfoLocally(t._id),!1}catch(t){return!1}return!0})),s(this,"OjHn",(function(t){var e,r=JSON.parse(n.OCNT.getFromStorage("apx_termination_ID"));if(!r[t]||null===(e=r[t])||void 0===e||!e.startDate)return!1;var i,o=new Date(r[t].startDate),a=new Date((i=new Date).getMonth()+"/"+i.getDate()+"/"+i.getFullYear()),s=parseInt((a-o)/864e5,10),u=function(){var t=new Date;return{hours:t.getHours(),mins:t.getMinutes()}}(),c=r[t].Hztt;return s===n.dXMg&&u.hours>=c.hours||s>n.dXMg||r[t].goalAcheived}))})),G=a((function t(){var e=this;i(this,t),s(this,"enable_goal_events",!1),s(this,"attributes",{}),s(this,"hQNV",new q),s(this,"NQJh",new M),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var n,r,i;if(e.enable_time_based=null==t||null===(n=t.terminate_info)||void 0===n?void 0:n.enable_time_based,e.enable_time_based&&!e.NQJh.parse(t))return!1;if(e.enable_goal_events=null==t||null===(r=t.terminate_info)||void 0===r?void 0:r.enable_goal_events,e.enable_attributes=null==t||null===(i=t.terminate_info)||void 0===i?void 0:i.enable_attributes,e.enable_attributes&&!e.hQNV.parse(t.terminate_info))return!1}catch(t){return window.ApxorLogger.error(t),!1}return!0})),s(this,"validate",(function(t,n){return e.hQNV.validate(t,n)}))})),H=window.ApxorLogger,j=a((function e(){var r=this;i(this,e),s(this,"xJBM",[]),s(this,"vlff",[]),s(this,"FqJf",""),s(this,"nWdU",new A),s(this,"NGHV",new w),s(this,"Avzx",new k),s(this,"znWc",new N),s(this,"TaRN",new L),s(this,"QowM",new G),s(this,"sajn",!1),s(this,"pzra",[]),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(!f(t._id))return H.error("No Id"),!1;if(!f(t.enabled)||!t.enabled)return H.error("Not enabled"),!1;if(!(r.nWdU.parse(t)&&r.Avzx.parse(t)&&r.znWc.parse(t)&&r.NGHV.parse(t)&&r.TaRN.parse(t)&&r.QowM.parse(t)))return!1;if(!f(t.conditions)||!Array.isArray(t.conditions))return H.error("No valid conditions",t.conditions),!1;r.FqJf=t._id,r.sajn=!!f(t.sequence_enabled)&&t.sequence_enabled,r.sajn&&t.conditions.sort((function(t,e){return t.sequence<e.sequence}));for(var e=t.conditions,n=e.length,i=0;i<n;i++){r.pzra=[];var o=e[i];if("didn't"===o.type){var a,s={trigger_key:o.trigger.details.name,no_kpi_array:null==o||null===(a=o.details)||void 0===a||null===(a=a.additional_info)||void 0===a?void 0:a.nkpi,condition_id:null==o?void 0:o._id,time_bounds:o.time_bounds.upper};r.pzra=[].concat(u(r.pzra),[s])}var c=new X;c.initialize(o,r.FqJf,i,r.sajn,r.pzra)&&r.xJBM.push(c)}if(r.QowM.enable_goal_events)for(var l=t.terminate_info.goal_events.events,h=l.length,v=0;v<h;v++){var d=new X;d.initialize(l[v],r.FqJf,v,!0,[],"termination")&&r.vlff.push(d)}return r.xJBM.length>0}catch(t){return H.error(t),!1}})),s(this,"GjfG",(function(t){if(!(t<0))if(r.sajn){var e=r.xJBM[t];if(f(e)&&e.GJsb){var n=r.xJBM[t-1];if(f(n)&&!n.GJsb)return;var i=r.xJBM[t+1];f(i)?i.hian():r.FnDf()}}else r.FnDf()})),s(this,"pYOs",(function(t){t<0||r.YpOv()})),s(this,"FnDf",(function(){var e=t.getController().getUserAttributes(),i=t.getController().getSessionAttributes();if(r.Avzx.validate()&&r.NGHV.validate(e,i)&&r.TaRN.validate()){for(var o=r.xJBM.length,a=o<1,s="",u=0;u<o;u++){var c=r.xJBM[u],l=c.GJsb;if(""===s.trim())a=l;else switch(s){case"AND":a=a&&l;break;case"OR":a=a||l}s=c.LNgq}if(a){if(console.debug("onCondition satisfied"),!r.znWc.TzLe(r.FqJf))return void console.warn("Maximum limit reached",r.FqJf);console.log("Dispatching event",r.nWdU.KSOj),!0===r.nWdU._only_context&&t.logEvent("apx_context_evaluated",n(n({},r.nWdU._attr),{},{message_name:r.nWdU.lKfZ,id:r.FqJf})),t.getController().dispatchEvent(r.nWdU.KSOj,{name:r.nWdU.KSOj,additional_info:{uuid:r.FqJf,name:r.nWdU.lKfZ}})}}})),s(this,"YpOv",(function(){for(var e=r.vlff.length,i=e<1,o="",a=0;a<e;a++){var s=r.vlff[a],u=s.GJsb;if(""===o.trim())i=u;else switch(o){case"AND":i=i&&u;break;case"OR":i=i||u}o=s.WFrp}i&&(console.log("Dispatching event",r.nWdU.KSOj),t.getController().persistTerminationInfoLocally(r.FqJf),!0===r.nWdU._only_context&&t.logEvent("apx_context_evaluated",n(n({},r.nWdU._attr),{},{message_name:r.nWdU.lKfZ,id:r.FqJf})),t.getController().dispatchEvent(r.nWdU.KSOj,{name:r.nWdU.KSOj,additional_info:{uuid:r.FqJf,name:r.nWdU.lKfZ}}))})),s(this,"validateForTerminationAttributes",(function(){var e=t.getController().getUserAttributes(),n=t.getController().getSessionAttributes();return r.QowM.validate(e,n)})),s(this,"ErGD",(function(){r.znWc.ErGD()})),s(this,"getFrequencyCount",(function(){return r.znWc.getFrequencyCount()})),s(this,"KnFr",(function(){return r.znWc.Kbwh()}))})),I=a((function t(){var e=this;i(this,t),s(this,"XvSv",{}),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{configs:[]};if(f(t)&&f(t.configs)){var n=t.configs;if(!Array.isArray(n))return;n.sort((function(t,e){var n,r;return(null!==(n=t.prio)&&void 0!==n?n:-1)-(null!==(r=e.prio)&&void 0!==r?r:-1)}));for(var r=0;r<n.length;r++){var i=n[r],o=i._id,a=new j;a.parse(i)?e.XvSv[o]=a:console.warn("Failed to parse cfg",o)}}})),s(this,"validate",(function(t,n){e.XvSv[t]&&e.XvSv[t].GjfG(n)})),s(this,"validateForTermination",(function(t,n){e.XvSv[t]&&e.XvSv[t].pYOs(n)})),s(this,"validateForTerminationAttributes",(function(t){return!!e.XvSv[t]&&e.XvSv[t].validateForTerminationAttributes()})),s(this,"ErGD",(function(t){e.XvSv[t].ErGD()})),s(this,"getFrequencyCount",(function(t){return e.XvSv[t].getFrequencyCount()})),s(this,"resetFrequencyCounts",(function(){var t=e.XvSv;for(var n in t)t[n].KnFr()})),s(this,"Asov",(function(t){try{if(e.XvSv){var n=e.XvSv[t];if(n&&n.nWdU)return n.nWdU}}catch(t){console.log("Error in getting the campaign meta ".concat(t))}return{}}))})),R=window.ApxorLogger,W=a((function e(){var n=this;i(this,e),s(this,"AZee",{}),s(this,"GHrG",[]),s(this,"HJfd",!1),s(this,"initialize",(function(){var e=t.getController();e.registerForEvent("APP_EVENT",(function(t){return n.gFEv(t,"AE")})),e.registerForEvent("CLIENT_EVENT",(function(t){return n.gFEv(t,"CE")}))})),s(this,"KqaR",(function(){for(var t in n.GHrG)n.wTap(t.event,t.key,t.type);n.HJfd=!0})),s(this,"HaQv",(function(t,e){var r;"function"==typeof e&&((r=n.AZee[t]?n.AZee[t]:[]).push(e),n.AZee[t]=r,R.debug("Listeners list: ",n.AZee))})),s(this,"unregisterFromEvent",(function(t,e){if(n.AZee[t]){for(var r=n.AZee[t],i=[],o=0;o<r.length;o++){var a=r[o];a!==e&&i.push(a)}n.AZee[t]=i}})),s(this,"gFEv",(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"AE",r=e+"___"+t.name;n.wTap(t,r,e)})),s(this,"wTap",(function(e,r,i){if(n.HJfd){if(R.debug("Notifying listeners for event: "+e+", "+r,n.AZee),n.AZee[r])for(var o=n.AZee[r],a=t.getController().getSDKRunningTimeInSec(),s=0;s<o.length;s++){(0,o[s])(i,e.name,a,e.additional_info)}}else n.GHrG.push({event:e,key:r,type:i})}))})),Q=window.ApxorLogger,V=function(){function e(){var n=this;return i(this,e),s(this,"RNCW",!1),s(this,"vozs",null),s(this,"OpCt",m()),s(this,"HLag",new W),s(this,"mhlV",t.getSiteId()),s(this,"Xhbc",{}),s(this,"getQeState",(function(){try{var e=t.getController().getFromStorage("qe_state");return e?JSON.parse(d(n.mhlV,e)):(n.Xhbc={},n.setQeState())}catch(t){return n.Xhbc={},n.setQeState()}})),s(this,"setQeState",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";try{t.getController().persistToStorage("qe_state",n.Xhbc,!0)}catch(r){""===e?n.Xhbc={}:n.Xhbc[e]={SESSION:0,OVERALL:0,DATES:{}},t.getController().persistToStorage("qe_state",n.Xhbc,!0)}return n.Xhbc})),s(this,"initialize",(function(){n.RNCW||(n.RNCW=!0,n.vozs=new I,n.HLag.initialize(),n.Xhbc=n.getQeState(),Q.info("QE Initialized.."))})),s(this,"parse",(function(t){n.wVJP()?(n.vozs.parse(t),n.HLag.KqaR()):Q.warn("Must call init first. Unable to proceed")})),s(this,"validate",(function(t,e){n.wVJP()&&n.vozs.validate(t,e)})),s(this,"validateForTermination",(function(t,e){n.wVJP()&&n.vozs.validateForTermination(t,e)})),s(this,"validateForTerminationAttributes",(function(t,e){return n.vozs.validateForTerminationAttributes(t,e)})),s(this,"updateCount",(function(t){try{f(n.Xhbc[t])||n.createObjConfig(t),n.incrementFrequencies(t),n.setQeState(t),n.vozs.ErGD(t)}catch(t){console.log("Could not update the count config:".concat(t))}})),s(this,"resetFrequencyCounts",(function(){n.vozs.resetFrequencyCounts()})),s(this,"getFrequencyCount",(function(t){return n.vozs.getFrequencyCount(t)})),s(this,"registerForEvent",(function(t,e){n.HLag.HaQv(t,e)})),s(this,"unregisterFromEvent",(function(t,e){n.HLag.unregisterFromEvent(t,e)})),s(this,"notifyEventListener",(function(t){n.HLag.gFEv(t)})),s(this,"fetch",(function(e,n,r,i){t.getController().fetchConfiguration(e,n,r,i)})),s(this,"wVJP",(function(){return n.RNCW})),s(this,"getCampaignMetaFromQueryEngine",(function(t){return n.vozs.Asov(t)})),s(this,"CmBi",(function(){return n.OpCt})),e.instance||(e.instance=this),e.instance}return a(e,[{key:"createObjConfig",value:function(t){try{this.Xhbc=this.getQeState(),f(this.Xhbc[t])||(this.Xhbc[t]={SESSION:0,OVERALL:0,DATES:{}},this.OpCt&&(this.Xhbc[t].DATES[this.OpCt]=0),this.setQeState(t))}catch(t){Q.error("Can not create the frequency count object:"+t)}}},{key:"incrementFrequencies",value:function(t){this.Xhbc=this.getQeState();var e=this.Xhbc[t];e.SESSION=e.SESSION+1,e.OVERALL=e.OVERALL+1;var n=m();n===this.OpCt&&e.DATES&&e.DATES[n]||(this.OpCt=n,e.DATES={},e.DATES[this.OpCt]=0),e.DATES[this.OpCt]=e.DATES[this.OpCt]+1}}],[{key:"getInstance",value:function(){return e.instance||(e.instance=new e),e.instance}}]),e}();s(V,"instance",void 0),window.ceVersion=142;try{void 0===exports&&null===exports||(exports.default=V,module.exports=exports.default)}catch(t){}return V}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apxor-qe",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
4
4
  "author": "Uma Sankar Yedida <umasankar.yedida@apxor.com> (https://www.apxor.com)",
5
5
  "contributors": [
6
6
  {
@@ -52,7 +52,7 @@
52
52
  },
53
53
  "dependencies": {
54
54
  "jsdom": "^22.1.0",
55
- "apxor": "2.3.0"
55
+ "apxor": "2.3.2"
56
56
  },
57
57
  "files": [
58
58
  "dist"