-
Notifications
You must be signed in to change notification settings - Fork 0
/
clevertap.min.js
1 lines (1 loc) · 68.7 KB
/
clevertap.min.js
1
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).clevertap=t()}(this,(function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function o(e,t,o){return t&&i(e.prototype,t),o&&i(e,o),e}function r(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function n(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,o)}return i}function a(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?n(Object(i),!0).forEach((function(t){r(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function u(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function d(e,t,i){return(d=u()?Reflect.construct:function(e,t,i){var o=[null];o.push.apply(o,t);var r=new(Function.bind.apply(e,o));return i&&c(r,i.prototype),r}).apply(null,arguments)}function f(e){var t="function"==typeof Map?new Map:void 0;return(f=function(e){if(null===e||(i=e,-1===Function.toString.call(i).indexOf("[native code]")))return e;var i;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,o)}function o(){return d(e,arguments,l(this).constructor)}return o.prototype=Object.create(e.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),c(o,e)})(e)}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?p(e):t}function v(e){var t=u();return function(){var i,o=l(e);if(t){var r=l(this).constructor;i=Reflect.construct(o,arguments,r)}else i=o.apply(this,arguments);return h(this,i)}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,o=new Array(t);i<t;i++)o[i]=e[i];return o}function b(e,t){var i;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(i=function(e,t){if(e){if("string"==typeof e)return g(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?g(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,a=!0,s=!1;return{s:function(){i=e[Symbol.iterator]()},n:function(){var e=i.next();return a=e.done,e},e:function(e){s=!0,n=e},f:function(){try{a||null==i.return||i.return()}finally{if(s)throw n}}}}var y=0;function m(e){return"__private_"+y+++"_"+e}function w(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var k,P="clevertap-prod.com",C="https:",O=m("accountId"),S=m("region"),A=m("targetDomain"),_=function(){function e(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=i.id,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:P;t(this,e),Object.defineProperty(this,O,{writable:!0,value:void 0}),Object.defineProperty(this,S,{writable:!0,value:""}),Object.defineProperty(this,A,{writable:!0,value:P}),this.id=o,r&&(this.region=r),n&&(this.targetDomain=n)}return o(e,[{key:"id",get:function(){return w(this,O)[O]},set:function(e){w(this,O)[O]=e}},{key:"region",get:function(){return w(this,S)[S]},set:function(e){w(this,S)[S]=e}},{key:"targetDomain",get:function(){return w(this,A)[A]},set:function(e){w(this,A)[A]=e}},{key:"finalTargetDomain",get:function(){return this.region?"".concat(this.region,".").concat(this.targetDomain):this.targetDomain===P?"".concat("eu1",".").concat(this.targetDomain):this.targetDomain}},{key:"dataPostURL",get:function(){return"".concat(C,"//").concat(this.finalTargetDomain,"/a?t=96")}},{key:"recorderURL",get:function(){return"".concat(C,"//").concat(this.finalTargetDomain,"/r?r=1")}},{key:"emailURL",get:function(){return"".concat(C,"//").concat(this.finalTargetDomain,"/e?r=1")}}]),e}(),j=new RegExp("^\\s+|\\.|:|\\$|'|\"|\\\\|\\s+$","g"),x=new RegExp("^\\s+|'|\"|\\\\|\\s+$","g"),E=new RegExp("'","g"),R="clear",L="Charged ID",D="WZRK_CHARGED_ID",T="WZRK_G",I="WZRK_K",M="WZRK_CAMP",N="WZRK_EV",z="WZRK_META",F="WZRK_PR",U="WZRK_ARP",q="WZRK_L",W="optOut",B="useIP",G="WZRK_X",K="push",Z=31536e4,J="2",$="wzrk_id",V="Notification Viewed",H="Notification Clicked",Y="WZRK_FPU",Q="WZRK_PSD",X=["Stayed","UTM Visited","App Launched","Notification Sent",V,H],ee=function(e){return"string"==typeof e||e instanceof String},te=function(e){return"[object Object]"===Object.prototype.toString.call(e)},ie=function(t){return"object"===e(t)&&t instanceof Date},oe=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},re=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},ne=function(e){return/^-?[\d.]+(?:e-?\d+)?$/.test(e)&&"number"==typeof e},ae=function(e){return null!=e&&"undefined"!==e},se=function t(i,o){var r;if("object"!==e(i))return ee(i)?(r=le(i,x)).length>1024&&(r=r.substring(0,1024),o.reportError(521,r+"... length exceeded 1024 chars. Trimmed.")):r=i,r;for(var n in i)if(i.hasOwnProperty(n)){var a=t(i[n],o),s=void 0;(s=le(n,j)).length>1024&&(s=s.substring(0,1024),o.reportError(520,s+"... length exceeded 1024 chars. Trimmed.")),delete i[n],i[s]=a}return i},le=function(e,t){return e.replace(t,"")},ce=function(){var e=new Date;return e.getFullYear()+""+e.getMonth()+e.getDay()},ue=function(){return Math.floor((new Date).getTime()/1e3)},de=function(e){return"$D_"+Math.round(e.getTime()/1e3)},fe=function(e){if(pe(e))return"$D_"+e},pe=function(e){var t=/^(\d{4})(\d{2})(\d{2})$/.exec(e);if(null==t)return!1;var i=t[3],o=t[2]-1,r=t[1],n=new Date(r,o,i);return n.getDate()==i&&n.getMonth()==o&&n.getFullYear()==r},he=function(){function e(){t(this,e)}return o(e,null,[{key:"save",value:function(e,t){return!(!e||!t)&&(this._isLocalStorageSupported()?(localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),!0):void 0)}},{key:"read",value:function(e){if(!e)return!1;var t=null;if(this._isLocalStorageSupported()&&(t=localStorage.getItem(e)),null!=t)try{t=JSON.parse(t)}catch(e){}return t}},{key:"remove",value:function(e){return!!e&&(this._isLocalStorageSupported()?(localStorage.removeItem(e),!0):void 0)}},{key:"removeCookie",value:function(e,t){var i=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";t&&(i=i+" domain="+t+"; path=/"),document.cookie=i}},{key:"createCookie",value:function(e,t,i,o){var r="",n="";if(i){var a=new Date;a.setTime(a.getTime()+1e3*i),r="; expires="+a.toGMTString()}o&&(n="; domain="+o),t=encodeURIComponent(t),document.cookie=e+"="+t+r+n+"; path=/"}},{key:"readCookie",value:function(e){for(var t=e+"=",i=document.cookie.split(";"),o=0;o<i.length;o++){for(var r=i[o];" "===r.charAt(0);)r=r.substring(1,r.length);if(0==r.indexOf(t))return decodeURIComponent(r.substring(t.length,r.length))}return null}},{key:"_isLocalStorageSupported",value:function(){return"localStorage"in window&&null!==window.localStorage&&"function"==typeof window.localStorage.setItem}},{key:"saveToLSorCookie",value:function(e,t){if(null!=t)try{this._isLocalStorageSupported()?this.save(e,encodeURIComponent(JSON.stringify(t))):e===T?this.createCookie(e,encodeURIComponent(t),0,window.location.hostname):this.createCookie(e,encodeURIComponent(JSON.stringify(t)),0,window.location.hostname),ve.globalCache[e]=t}catch(e){}}},{key:"readFromLSorCookie",value:function(e){var t;if(ve.globalCache.hasOwnProperty(e))return ve.globalCache[e];if(null!=(t=this._isLocalStorageSupported()?this.read(e):this.readCookie(e))&&("function"!=typeof t.trim||""!==t.trim())){var i;try{i=JSON.parse(decodeURIComponent(t))}catch(e){i=decodeURIComponent(t)}return ve.globalCache[e]=i,i}}},{key:"createBroadCookie",value:function(e,t,i,o){if(o){var r=ve.broadDomain;if(null==r)for(var n=o.split("."),a="",s=n.length-1;s>=0;s--){if(a=0===s?n[s]+a:"."+n[s]+a,this.readCookie(e)){var l="test_"+e+s;if(this.createCookie(l,t,10,a),!this.readCookie(l))continue;this.removeCookie(l,a)}if(this.createCookie(e,t,i,a),this.readCookie(e)==t){r=a,ve.broadDomain=r;break}}else this.createCookie(e,t,i,r)}else this.createCookie(e,t,i,o)}},{key:"getMetaProp",value:function(e){var t=this.readFromLSorCookie(z);if(null!=t)return t[e]}},{key:"setMetaProp",value:function(e,t){if(this._isLocalStorageSupported()){var i=this.readFromLSorCookie(z);null==i&&(i={}),void 0===t?delete i[e]:i[e]=t,this.saveToLSorCookie(z,i)}}},{key:"getAndClearMetaProp",value:function(e){var t=this.getMetaProp(e);return this.setMetaProp(e,void 0),t}},{key:"setInstantDeleteFlagInK",value:function(){var e=this.readFromLSorCookie(I);null==e&&(e={}),e.flag=!0,this.saveToLSorCookie(I,e)}},{key:"backupEvent",value:function(e,t,i){var o=this.readFromLSorCookie(q);void 0===o&&(o={}),o[t]={q:e},this.saveToLSorCookie(q,o),i.debug("stored in ".concat(q," reqNo : ").concat(t," -> ").concat(e))}},{key:"removeBackup",value:function(e,t){var i=this.readFromLSorCookie(q);null!=i&&void 0!==i[e]&&(t.debug("del event: ".concat(e," data-> ").concat(i[e].q)),delete i[e],this.saveToLSorCookie(q,i))}}]),e}(),ve={globalCache:{gcookie:null,REQ_N:0,RESP_N:0},LRU_cache:null,globalProfileMap:void 0,globalEventsMap:void 0,blockRequest:!1,isOptInRequest:!1,broadDomain:null,webPushEnabled:null,campaignDivMap:{},currentSessionId:null,wiz_counter:0,notifApi:{notifEnabledFromApi:!1},unsubGroups:[],updatedCategoryLong:null},ge=m("keyOrder"),be=m("deleteFromObject"),ye=function(){function e(i){t(this,e),Object.defineProperty(this,be,{value:me}),Object.defineProperty(this,ge,{writable:!0,value:void 0}),this.max=i;var o=he.readFromLSorCookie(G);if(o){var r={};for(var n in w(this,ge)[ge]=[],o=o.cache)o.hasOwnProperty(n)&&(r[o[n][0]]=o[n][1],w(this,ge)[ge].push(o[n][0]));this.cache=r}else this.cache={},w(this,ge)[ge]=[]}return o(e,[{key:"get",value:function(e){var t=this.cache[e];return t&&(this.cache=w(this,be)[be](e,this.cache),this.cache[e]=t,w(this,ge)[ge].push(e)),this.saveCacheToLS(this.cache),t}},{key:"set",value:function(e,t){var i=this.cache[e],o=w(this,ge)[ge];null!=i?this.cache=w(this,be)[be](e,this.cache):o.length===this.max&&(this.cache=w(this,be)[be](o[0],this.cache)),this.cache[e]=t,w(this,ge)[ge][w(this,ge)[ge]-1]!==e&&w(this,ge)[ge].push(e),this.saveCacheToLS(this.cache)}},{key:"saveCacheToLS",value:function(e){var t=[],i=w(this,ge)[ge];for(var o in i)if(i.hasOwnProperty(o)){var r=[];r.push(i[o]),r.push(e[i[o]]),t.push(r)}he.saveToLSorCookie(G,{cache:t})}},{key:"getKey",value:function(e){if(null===e)return null;var t=w(this,ge)[ge];for(var i in t)if(t.hasOwnProperty(i)&&this.cache[t[i]]===e)return t[i];return null}},{key:"getSecondLastKey",value:function(){var e=w(this,ge)[ge];return null!=e&&e.length>1?e[e.length-2]:-1}},{key:"getLastKey",value:function(){var e=w(this,ge)[ge].length;if(e)return w(this,ge)[ge][e-1]}}]),e}(),me=function(e,t){var i,o=JSON.parse(JSON.stringify(w(this,ge)[ge])),r={};for(var n in o)o.hasOwnProperty(n)&&(o[n]!==e?r[o[n]]=t[o[n]]:i=n);return o.splice(i,1),w(this,ge)[ge]=JSON.parse(JSON.stringify(o)),r},we=m("logger"),ke=m("request"),Pe=m("device"),Ce=m("session"),Oe=function(){function e(i){var o=i.logger,r=i.request,n=i.device,a=i.session;t(this,e),Object.defineProperty(this,we,{writable:!0,value:void 0}),Object.defineProperty(this,ke,{writable:!0,value:void 0}),Object.defineProperty(this,Pe,{writable:!0,value:void 0}),Object.defineProperty(this,Ce,{writable:!0,value:void 0}),w(this,we)[we]=o,w(this,ke)[ke]=r,w(this,Pe)[Pe]=n,w(this,Ce)[Ce]=a}return o(e,[{key:"s",value:function(e,t,i,o,r){if(void 0===o&&(o=0),he.removeBackup(o,w(this,we)[we]),!(o>ve.globalCache.REQ_N)){if(!ae(w(this,Pe)[Pe].gcookie)||i||"boolean"==typeof r){if(ae(w(this,Pe)[Pe].gcookie)||he.getAndClearMetaProp(B),w(this,we)[we].debug("Cookie was ".concat(w(this,Pe)[Pe].gcookie," set to ").concat(e)),w(this,Pe)[Pe].gcookie=e,e&&he._isLocalStorageSupported()){null==ve.LRU_CACHE&&(ve.LRU_CACHE=new ye(100));var n=he.readFromLSorCookie(I);if(null!=n&&n.id&&i)ve.LRU_CACHE.cache[n.id]||(he.saveToLSorCookie(Y,!0),ve.LRU_CACHE.set(n.id,e));he.saveToLSorCookie(T,e);var a=ve.LRU_CACHE.getSecondLastKey();if(he.readFromLSorCookie(Y)&&-1!==a){var s=ve.LRU_CACHE.cache[a];w(this,ke)[ke].unregisterTokenForGuid(s)}}he.createBroadCookie(T,e,Z,window.location.hostname),he.saveToLSorCookie(T,e)}i&&(ve.blockRequest=!1,w(this,we)[we].debug("Resumed requests")),he._isLocalStorageSupported()&&w(this,Ce)[Ce].manageSession(t);var l=w(this,Ce)[Ce].getSessionCookieObject();(void 0===l.s||l.s<=t)&&(l.s=t,l.t=ue(),w(this,Ce)[Ce].setSessionCookieObject(l)),i&&!w(this,ke)[ke].processingBackup&&w(this,ke)[ke].processBackupEvents(),ve.globalCache.RESP_N=o}}}]),e}(),Se=m("logger"),Ae=function(){function e(i){var o=i.logger;t(this,e),Object.defineProperty(this,Se,{writable:!0,value:void 0}),this.gcookie=void 0,w(this,Se)[Se]=o,this.gcookie=this.getGuid()}return o(e,[{key:"getGuid",value:function(){var e=null;if(ae(this.gcookie))return this.gcookie;if(he._isLocalStorageSupported()){var t=he.read(T);if(ae(t)){try{e=JSON.parse(decodeURIComponent(t))}catch(i){w(this,Se)[Se].debug("Cannot parse Gcookie from localstorage - must be encoded "+t),32===t.length?(e=t,he.saveToLSorCookie(T,t)):w(this,Se)[Se].error("Illegal guid "+t)}ae(e)&&he.createBroadCookie(T,e,Z,window.location.hostname)}}return ae(e)||(e=he.readCookie(T),!ae(e)||0!==e.indexOf("%")&&0!==e.indexOf("'")&&0!==e.indexOf('"')||(e=null),ae(e)&&he.saveToLSorCookie(T,e)),e}}]),e}(),_e="This property has been ignored.",je="CleverTap error:",xe="".concat(je," Incorrect embed script."),Ee="".concat(je," Event structure not valid. ").concat(_e),Re="".concat(je," Gender value should be either M or F. ").concat(_e),Le="".concat(je," Employed value should be either Y or N. ").concat(_e),De="".concat(je," Married value should be either Y or N. ").concat(_e),Te="".concat(je," Education value should be either School, College or Graduate. ").concat(_e),Ie="".concat(je," Age value should be a number. ").concat(_e),Me="".concat(je," DOB value should be a Date Object"),Ne="".concat(je," setEnum(value). value should be a string or a number"),ze="".concat(je," Phone number should be formatted as +[country code][number]"),Fe=function(e){if(te(e)){for(var t in e)if(e.hasOwnProperty(t)){if(te(e[t])||Array.isArray(e[t]))return!1;ie(e[t])&&(e[t]=de(e[t]))}return!0}return!1},Ue=function(e,t){if(te(e)){for(var i in e)if(e.hasOwnProperty(i))if("Items"===i){if(!Array.isArray(e[i]))return!1;for(var o in e[i].length>16&&t.reportError(522,"Charged Items exceed 16 limit. Actual count: "+e[i].length+". Additional items will be dropped."),e[i])if(e[i].hasOwnProperty(o)&&(!te(e[i][o])||!Fe(e[i][o])))return!1}else{if(te(e[i])||Array.isArray(e[i]))return!1;ie(e[i])&&(e[i]=de(e[i]))}if(ee(e[L])||ne(e[L])){var r=e[L]+"";if(void 0===k&&(k=he.readFromLSorCookie(D)),void 0!==k&&k.trim()===r.trim())return t.error("Duplicate charged Id - Dropped"+e),!1;k=r,he.saveToLSorCookie(D,r)}return!0}return!1},qe=m("logger"),We=m("oldValues"),Be=m("request"),Ge=m("isPersonalisationActive"),Ke=m("processEventArray"),Ze=function(e){s(r,e);var i=v(r);function r(e,o){var n,a=e.logger,s=e.request,l=e.isPersonalisationActive;return t(this,r),n=i.call(this),Object.defineProperty(p(n),Ke,{value:Je}),Object.defineProperty(p(n),qe,{writable:!0,value:void 0}),Object.defineProperty(p(n),We,{writable:!0,value:void 0}),Object.defineProperty(p(n),Be,{writable:!0,value:void 0}),Object.defineProperty(p(n),Ge,{writable:!0,value:void 0}),w(p(n),qe)[qe]=a,w(p(n),We)[We]=o,w(p(n),Be)[Be]=s,w(p(n),Ge)[Ge]=l,n}return o(r,[{key:"push",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return w(this,Ke)[Ke](t),0}},{key:"_processOldValues",value:function(){w(this,We)[We]&&w(this,Ke)[Ke](w(this,We)[We]),w(this,We)[We]=null}},{key:"getDetails",value:function(e){if(w(this,Ge)[Ge]()&&(void 0===ve.globalEventsMap&&(ve.globalEventsMap=he.readFromLSorCookie(N)),void 0!==ve.globalEventsMap)){var t=ve.globalEventsMap[e],i={};return void 0!==t?(i.firstTime=new Date(1e3*t[1]),i.lastTime=new Date(1e3*t[2]),i.count=t[0],i):void 0}}}]),r}(f(Array)),Je=function(e){if(Array.isArray(e))for(;e.length>0;){var t=e.shift();if(ee(t))if(t.length>1024&&(t=t.substring(0,1024),w(this,qe)[qe].reportError(510,t+"... length exceeded 1024 chars. Trimmed.")),X.includes(t))w(this,qe)[qe].reportError(513,t+" is a restricted system event. It cannot be used as an event name.");else{var i={type:"event"};if(i.evtName=le(t,j),0!==e.length){var o=e.shift();if(te(o)){if("Charged"===t){if(!Ue(o,w(this,qe)[qe])){w(this,qe)[qe].reportError(511,"Charged event structure invalid. Not sent.");continue}}else if(!Fe(o)){w(this,qe)[qe].reportError(512,t+" event structure invalid. Not sent.");continue}i.evtData=o}else e.unshift(o)}w(this,Be)[Be].processEvent(i)}else w(this,qe)[qe].error(Ee)}},$e=function(e){var t={},i=e.indexOf("?");if(i>1){var o,r=e.substring(i+1),n=/\+/g,a=/([^&=]+)=?([^&]*)/g,s=function(e){var t=e.replace(n," ");try{t=decodeURIComponent(t)}catch(e){}return t};for(o=a.exec(r);o;)t[s(o[1])]=s(o[2]),o=a.exec(r)}return t},Ve=function(e,t,i){return e+"&"+t+"="+encodeURIComponent(i)},He=function(){return window.location.hostname},Ye=function(e,t){return t&&"function"==typeof t.debug&&t.debug("dobj:"+e),Xe(e)},Qe=function(){var e="",t=0;for(t=0;t<=25;t++)e+=String.fromCharCode(t+65);for(t=0;t<=25;t++)e+=String.fromCharCode(t+97);for(t=0;t<10;t++)e+=t;return e+"+/="}(),Xe=function(e){if(null==e)return"";var t,i,o,r,n,a,s,l="",c=0;for(e=function(e){if(null==e)return"";var t,i,o,r={},n={},a="",s="",l="",c=2,u=3,d=2,f="",p=0,h=0,v=String.fromCharCode;for(o=0;o<e.length;o+=1)if(a=e.charAt(o),Object.prototype.hasOwnProperty.call(r,a)||(r[a]=u++,n[a]=!0),s=l+a,Object.prototype.hasOwnProperty.call(r,s))l=s;else{if(Object.prototype.hasOwnProperty.call(n,l)){if(l.charCodeAt(0)<256){for(t=0;t<d;t++)p<<=1,15==h?(h=0,f+=v(p),p=0):h++;for(i=l.charCodeAt(0),t=0;t<8;t++)p=p<<1|1&i,15==h?(h=0,f+=v(p),p=0):h++,i>>=1}else{for(i=1,t=0;t<d;t++)p=p<<1|i,15==h?(h=0,f+=v(p),p=0):h++,i=0;for(i=l.charCodeAt(0),t=0;t<16;t++)p=p<<1|1&i,15==h?(h=0,f+=v(p),p=0):h++,i>>=1}0==--c&&(c=Math.pow(2,d),d++),delete n[l]}else for(i=r[l],t=0;t<d;t++)p=p<<1|1&i,15==h?(h=0,f+=v(p),p=0):h++,i>>=1;0==--c&&(c=Math.pow(2,d),d++),r[s]=u++,l=String(a)}if(""!==l){if(Object.prototype.hasOwnProperty.call(n,l)){if(l.charCodeAt(0)<256){for(t=0;t<d;t++)p<<=1,15==h?(h=0,f+=v(p),p=0):h++;for(i=l.charCodeAt(0),t=0;t<8;t++)p=p<<1|1&i,15==h?(h=0,f+=v(p),p=0):h++,i>>=1}else{for(i=1,t=0;t<d;t++)p=p<<1|i,15==h?(h=0,f+=v(p),p=0):h++,i=0;for(i=l.charCodeAt(0),t=0;t<16;t++)p=p<<1|1&i,15==h?(h=0,f+=v(p),p=0):h++,i>>=1}0==--c&&(c=Math.pow(2,d),d++),delete n[l]}else for(i=r[l],t=0;t<d;t++)p=p<<1|1&i,15==h?(h=0,f+=v(p),p=0):h++,i>>=1;0==--c&&(c=Math.pow(2,d),d++)}for(i=2,t=0;t<d;t++)p=p<<1|1&i,15==h?(h=0,f+=v(p),p=0):h++,i>>=1;for(;;){if(p<<=1,15==h){f+=v(p);break}h++}return f}(e);c<2*e.length;)c%2==0?(t=e.charCodeAt(c/2)>>8,i=255&e.charCodeAt(c/2),o=c/2+1<e.length?e.charCodeAt(c/2+1)>>8:NaN):(t=255&e.charCodeAt((c-1)/2),(c+1)/2<e.length?(i=e.charCodeAt((c+1)/2)>>8,o=255&e.charCodeAt((c+1)/2)):i=o=NaN),c+=3,r=t>>2,n=(3&t)<<4|i>>4,a=(15&i)<<2|o>>6,s=63&o,isNaN(i)?a=s=64:isNaN(o)&&(s=64),l=l+Qe.charAt(r)+Qe.charAt(n)+Qe.charAt(a)+Qe.charAt(s);return l},et=m("fireRequest"),tt=m("dropRequestDueToOptOut"),it=m("addUseIPToRequest"),ot=m("addARPToRequest"),rt=function(){function e(){t(this,e)}return o(e,null,[{key:"fireRequest",value:function(e,t,i){w(this,et)[et](e,1,t,i)}}]),e}();rt.logger=void 0,rt.device=void 0,Object.defineProperty(rt,et,{value:function(e,t,i,o){var r,n,a=this;if(w(this,tt)[tt]())this.logger.debug("req dropped due to optout cookie: "+this.device.gcookie);else if(!ae(this.device.gcookie)&&ve.globalCache.RESP_N<ve.globalCache.REQ_N-1&&t<50)setTimeout((function(){a.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(t)),w(a,et)[et](e,t+1,i,o)}),50);else{if(o||(ae(this.device.gcookie)&&(e=Ve(e,"gc",this.device.gcookie)),e=w(this,ot)[ot](e,i)),e=w(this,it)[it](e),e=Ve(e,"r",(new Date).getTime()),(null===(r=window.clevertap)||void 0===r?void 0:r.hasOwnProperty("plugin"))||(null===(n=window.wizrocket)||void 0===n?void 0:n.hasOwnProperty("plugin"))){var s=window.clevertap.plugin||window.wizrocket.plugin;e=Ve(e,"ct_pl",s)}-1!==e.indexOf("chrome-extension:")&&(e=e.replace("chrome-extension:","https:"));for(var l=document.getElementsByClassName("ct-jp-cb");l[0];)l[0].parentNode.removeChild(l[0]);var c=document.createElement("script");c.setAttribute("type","text/javascript"),c.setAttribute("src",e),c.setAttribute("class","ct-jp-cb"),c.setAttribute("rel","nofollow"),c.async=!0,document.getElementsByTagName("head")[0].appendChild(c),this.logger.debug("req snt -> url: "+e)}}}),Object.defineProperty(rt,tt,{value:function(){return!ve.isOptInRequest&&ae(this.device.gcookie)&&ee(this.device.gcookie)?":OO"===this.device.gcookie.slice(-3):(ve.isOptInRequest=!1,!1)}}),Object.defineProperty(rt,it,{value:function(e){var t=he.getMetaProp(B);return"boolean"!=typeof t&&(t=!1),Ve(e,B,t?"true":"false")}}),Object.defineProperty(rt,ot,{value:function(e,t){if(!0===t){var i={skipResARP:!0};return Ve(e,"arp",Ye(JSON.stringify(i),this.logger))}return he._isLocalStorageSupported()&&void 0!==localStorage.getItem(U)&&null!==localStorage.getItem(U)?Ve(e,"arp",Ye(JSON.stringify(he.readFromLSorCookie(U)),this.logger)):e}});var nt=function(){var e={};return he._isLocalStorageSupported()&&(e=null!=(e=he.read(M))?JSON.parse(decodeURIComponent(e).replace(E,'"')):{}),e},at=function(e){if(he._isLocalStorageSupported()){var t=JSON.stringify(e);he.save(M,encodeURIComponent(t))}},st=function(){var e={};if(he._isLocalStorageSupported()){var t=[],i=(e=nt()).global,o=e[ce()];if(void 0!==i){var r=Object.keys(i);for(var n in r)if(r.hasOwnProperty(n)){var a=0,s=0,l=r[n];if("tc"===l)continue;void 0!==o&&void 0!==o[l]&&(a=o[l]),void 0!==i&&void 0!==i[l]&&(s=i[l]);var c=[l,a,s];t.push(c)}}var u=0;return void 0!==o&&void 0!==o.tc&&(u=o.tc),t={wmp:u,tlc:t}}},lt=function(e,t){var i=t.logger,o=!1;if(te(e))for(var r in e)if(e.hasOwnProperty(r)){o=!0;var n=e[r];if(null==n){delete e[r];continue}"Gender"!==r||n.match(/^M$|^F$/)||(o=!1,i.error(Re)),"Employed"!==r||n.match(/^Y$|^N$/)||(o=!1,i.error(Le)),"Married"!==r||n.match(/^Y$|^N$/)||(o=!1,i.error(De)),"Education"!==r||n.match(/^School$|^College$|^Graduate$/)||(o=!1,i.error(Te)),"Age"===r&&null!=n&&(re(n)?e.Age=+n:(o=!1,i.error(Ie))),"DOB"===r?(/^\$D_/.test(n)&&11===(n+"").length||ie(n)||(o=!1,i.error(Me)),ie(n)&&(e[r]=de(n))):ie(n)&&(e[r]=de(n)),"Phone"!==r||oe(n)||(n.length>8&&"+"===n.charAt(0)?(n=n.substring(1,n.length),re(n)?e.Phone=+n:(o=!1,i.error(ze+". Removed."))):(o=!1,i.error(ze+". Removed."))),o||delete e[r]}return o},ct=function(e){var t={};t.Name=e.name,null!=e.id&&(t.FBID=e.id+""),"male"===e.gender?t.Gender="M":"female"===e.gender?t.Gender="F":t.Gender="O";null!=e.relationship_status&&(t.Married="N","Married"===e.relationship_status&&(t.Married="Y"));var i=function(e){if(null!=e){for(var t="",i="",o=0;o<e.length;o++){var r=e[o];if(null!=r.type){var n=r.type;if("Graduate School"===n)return"Graduate";"College"===n?t="1":"High School"===n&&(i="1")}}if("1"===t)return"College";if("1"===i)return"School"}}(e.education);null!=i&&(t.Education=i);var o=null!=e.work?e.work.length:0;if(t.Employed=o>0?"Y":"N",null!=e.email&&(t.Email=e.email),null!=e.birthday){var r=e.birthday.split("/");t.DOB=fe(r[2]+r[0]+r[1])}return t},ut=function(e,t){var i=t.logger,o={};if(null!=e.displayName&&(o.Name=e.displayName),null!=e.id&&(o.GPID=e.id+""),null!=e.gender&&("male"===e.gender?o.Gender="M":"female"===e.gender?o.Gender="F":"other"===e.gender&&(o.Gender="O")),null!=e.image&&!1===e.image.isDefault&&(o.Photo=e.image.url.split("?sz")[0]),null!=e.emails)for(var r=0;r<e.emails.length;r++){var n=e.emails[r];"account"===n.type&&(o.Email=n.value)}if(null!=e.organizations){o.Employed="N";for(var a=0;a<e.organizations.length;a++){"work"===e.organizations[a].type&&(o.Employed="Y")}}if(null!=e.birthday){var s=e.birthday.split("-");o.DOB=fe(s[0]+s[1]+s[2])}return null!=e.relationshipStatus&&(o.Married="N","married"===e.relationshipStatus&&(o.Married="Y")),i.debug("gplus usr profile "+JSON.stringify(o)),o},dt=function(e,t){if(he._isLocalStorageSupported()){if(null==ve.globalProfileMap&&(ve.globalProfileMap=he.readFromLSorCookie(F),null==ve.globalProfileMap&&(ve.globalProfileMap={})),null!=e._custom){var i=e._custom;for(var o in i)i.hasOwnProperty(o)&&(e[o]=i[o]);delete e._custom}for(var r in e)if(e.hasOwnProperty(r)){if(ve.globalProfileMap.hasOwnProperty(r)&&!t)continue;ve.globalProfileMap[r]=e[r]}null!=ve.globalProfileMap._custom&&delete ve.globalProfileMap._custom,he.saveToLSorCookie(F,ve.globalProfileMap)}},ft=function(e,t,i){if(null!=e&&"-1"!==e&&he._isLocalStorageSupported()){var o=nt(),r=o[i];null==r&&(r={},o[i]=r),r[e]="dnd",at(o)}if(null!=ve.campaignDivMap){var n=ve.campaignDivMap[e];null!=n&&(document.getElementById(n).style.display="none","intentPreview"===n&&null!=document.getElementById("intentOpacityDiv")&&(document.getElementById("intentOpacityDiv").style.display="none"))}},pt=function(e,t){if(ee(e)||ne(e))return"$E_"+e;t.error(Ne)},ht=function(e,t,i,o,r){var n=$e(location.href),a=n.e,s=n.p;if(void 0!==a){var l={};l.id=o.id,l.unsubGroups=ve.unsubGroups,ve.updatedCategoryLong&&(l.cUsY=ve.updatedCategoryLong);var c=o.emailURL;i&&(c=Ve(c,"fetchGroups",i)),t&&(c=Ve(c,"encoded",t)),c=Ve(c,"e",a),c=Ve(c,"d",Ye(JSON.stringify(l),r)),s&&(c=Ve(c,"p",s)),"-1"!==e&&(c=Ve(c,"sub",e)),rt.fireRequest(c)}},vt=m("logger"),gt=m("request"),bt=m("account"),yt=m("oldValues"),mt=m("isPersonalisationActive"),wt=m("processProfileArray"),kt=function(e){s(r,e);var i=v(r);function r(e,o){var n,a=e.logger,s=e.request,l=e.account,c=e.isPersonalisationActive;return t(this,r),n=i.call(this),Object.defineProperty(p(n),wt,{value:Pt}),Object.defineProperty(p(n),vt,{writable:!0,value:void 0}),Object.defineProperty(p(n),gt,{writable:!0,value:void 0}),Object.defineProperty(p(n),bt,{writable:!0,value:void 0}),Object.defineProperty(p(n),yt,{writable:!0,value:void 0}),Object.defineProperty(p(n),mt,{writable:!0,value:void 0}),w(p(n),vt)[vt]=a,w(p(n),gt)[gt]=s,w(p(n),bt)[bt]=l,w(p(n),yt)[yt]=o,w(p(n),mt)[mt]=c,n}return o(r,[{key:"push",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return w(this,wt)[wt](t),0}},{key:"_processOldValues",value:function(){w(this,yt)[yt]&&w(this,wt)[wt](w(this,yt)[yt]),w(this,yt)[yt]=null}},{key:"getAttribute",value:function(e){if(w(this,mt)[mt]())return null==ve.globalProfileMap&&(ve.globalProfileMap=StorageManager.readFromLSorCookie(F)),null!=ve.globalProfileMap?ve.globalProfileMap[e]:void 0}}]),r}(f(Array)),Pt=function(e){if(Array.isArray(e)&&e.length>0)for(var t in e)if(e.hasOwnProperty(t)){var i=e[t],o={},r=void 0;if(null!=i.Site){if(r=i.Site,oe(r)||!lt(r,{logger:w(this,vt)[vt]}))return}else if(null!=i.Facebook){var n=i.Facebook;oe(n)||n.error||(r=ct(n))}else if(null!=i["Google Plus"]){var a=i["Google Plus"];oe(a)||a.error||(r=ut(a,{logger:w(this,vt)[vt]}))}if(null!=r&&!oe(r)){o.type="profile",null==r.tz&&(r.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),o.profile=r,dt(r,!0),o=w(this,gt)[gt].addSystemDataToObject(o,void 0),w(this,gt)[gt].addFlags(o);var s=Ye(JSON.stringify(o),w(this,vt)[vt]),l=w(this,bt)[bt].dataPostURL;l=Ve(l,"type",K),l=Ve(l,"d",s),w(this,gt)[gt].saveAndFireRequest(l,ve.blockRequeust)}}},Ct=m("request"),Ot=m("logger"),St=m("account"),At=m("session"),_t=m("oldValues"),jt=m("device"),xt=m("processOUL"),Et=m("handleCookieFromCache"),Rt=m("deleteUser"),Lt=m("processLoginArray"),Dt=function(e){s(r,e);var i=v(r);function r(e,o){var n,a=e.request,s=e.account,l=e.session,c=e.logger,u=e.device;return t(this,r),n=i.call(this),Object.defineProperty(p(n),Lt,{value:Nt}),Object.defineProperty(p(n),Rt,{value:Mt}),Object.defineProperty(p(n),Et,{value:It}),Object.defineProperty(p(n),xt,{value:Tt}),Object.defineProperty(p(n),Ct,{writable:!0,value:void 0}),Object.defineProperty(p(n),Ot,{writable:!0,value:void 0}),Object.defineProperty(p(n),St,{writable:!0,value:void 0}),Object.defineProperty(p(n),At,{writable:!0,value:void 0}),Object.defineProperty(p(n),_t,{writable:!0,value:void 0}),Object.defineProperty(p(n),jt,{writable:!0,value:void 0}),w(p(n),Ct)[Ct]=a,w(p(n),St)[St]=s,w(p(n),At)[At]=l,w(p(n),Ot)[Ot]=c,w(p(n),_t)[_t]=o,w(p(n),jt)[jt]=u,n}return o(r,[{key:"clear",value:function(){w(this,Ot)[Ot].debug("clear called. Reset flag has been set."),w(this,Rt)[Rt](),he.setMetaProp(R,!0)}},{key:"push",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return w(this,Lt)[Lt](t),0}},{key:"_processOldValues",value:function(){w(this,_t)[_t]&&w(this,Lt)[Lt](w(this,_t)[_t]),w(this,_t)[_t]=null}}]),r}(f(Array)),Tt=function(e){var t=this,i=!0;he.saveToLSorCookie(Y,i);var o=function(e){var o,r=he.readFromLSorCookie(I),n=he.readFromLSorCookie(T);if(null==r)r={},o=e;else{var a=!1,s=!1;if(null==(o=r.id)&&(o=e[0],a=!0),null==ve.LRU_CACHE&&he._isLocalStorageSupported()&&(ve.LRU_CACHE=new ye(100)),a)null!=n&&(ve.LRU_CACHE.set(o,n),ve.blockRequeust=!1);else for(var l in e)if(e.hasOwnProperty(l)){var c=e[l];if(ve.LRU_CACHE.cache[c]){o=c,s=!0;break}}if(s){o!==ve.LRU_CACHE.getLastKey()?w(t,Et)[Et]():(i=!1,he.saveToLSorCookie(Y,i));var u=ve.LRU_CACHE.get(o);ve.LRU_CACHE.set(o,u),he.saveToLSorCookie(T,u),w(t,jt)[jt].gcookie=u;var d=ve.LRU_CACHE.getSecondLastKey();if(he.readFromLSorCookie(Y)&&-1!==d){var f=ve.LRU_CACHE.cache[d];w(t,Ct)[Ct].unregisterTokenForGuid(f)}}else a?null!=n&&(w(t,jt)[jt].gcookie=n,he.saveToLSorCookie(T,n),i=!1):t.clear(),he.saveToLSorCookie(Y,!1),o=e[0]}r.id=o,he.saveToLSorCookie(I,r)};if(Array.isArray(e)&&e.length>0)for(var r in e)if(e.hasOwnProperty(r)){var n=e[r],a={},s=void 0;if(null!=n.Site){if(s=n.Site,oe(s)||!lt(s,{logger:w(this,Ot)[Ot]}))return}else if(null!=n.Facebook){var l=n.Facebook;oe(l)||l.error||(s=ct(l))}else if(null!=n["Google Plus"]){var c=n["Google Plus"];oe(c)&&!c.error&&(s=ut(c,{logger:w(this,Ot)[Ot]}))}if(null!=s&&!oe(s)){a.type="profile",null==s.tz&&(s.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),a.profile=s;var u=[];he._isLocalStorageSupported()&&(null!=s.Identity&&u.push(s.Identity),null!=s.Email&&u.push(s.Email),null!=s.GPID&&u.push("GP:"+s.GPID),null!=s.FBID&&u.push("FB:"+s.FBID),u.length>0&&o(u)),dt(s,!0),a=w(this,Ct)[Ct].addSystemDataToObject(a,void 0),w(this,Ct)[Ct].addFlags(a),i&&(a.isOUL=!0);var d=Ye(JSON.stringify(a),w(this,Ot)[Ot]),f=w(this,St)[St].dataPostURL;f=Ve(f,"type",K),f=Ve(f,"d",d),w(this,Ct)[Ct].saveAndFireRequest(f,ve.blockRequeust,i)}}},It=function(){ve.blockRequeust=!1,console.debug("Block request is false"),he._isLocalStorageSupported()&&(delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),he.removeCookie(M,He()),he.removeCookie(w(this,At)[At].cookieName,ve.broadDomain),he.removeCookie(U,ve.broadDomain),w(this,At)[At].setSessionCookieObject("")},Mt=function(){ve.blockRequeust=!0,w(this,Ot)[Ot].debug("Block request is true"),ve.globalCache={},he._isLocalStorageSupported()&&(delete localStorage.WZRK_G,delete localStorage.WZRK_K,delete localStorage.WZRK_PR,delete localStorage.WZRK_EV,delete localStorage.WZRK_META,delete localStorage.WZRK_ARP,delete localStorage.WZRK_CAMP,delete localStorage.WZRK_CHARGED_ID),he.removeCookie(T,ve.broadDomain),he.removeCookie(M,He()),he.removeCookie(I,He()),he.removeCookie(w(this,At)[At].cookieName,ve.broadDomain),he.removeCookie(U,ve.broadDomain),w(this,jt)[jt].gcookie=null,w(this,At)[At].setSessionCookieObject("")},Nt=function(e){if(Array.isArray(e)&&e.length>0){var t=e.pop();if(null!=t&&te(t)&&(null!=t.Site&&Object.keys(t.Site).length>0||null!=t.Facebook&&Object.keys(t.Facebook).length>0||null!=t["Google Plus"]&&Object.keys(t["Google Plus"]).length>0)){he.setInstantDeleteFlagInK();try{w(this,xt)[xt]([t])}catch(e){w(this,Ot)[Ot].debug(e)}}else w(this,Ot)[Ot].error("Profile object is in incorrect format")}},zt=function e(t,i){var o,n=i.device,s=i.session,l=i.request,c=i.logger,u=n,d=s,f=l,p=c,h=0,v=function(i){var o=i.wzrk_id.split("_")[0],r=ce(),n=function(e,t,i){var o=0,r=0;null!=e[t]&&(o=e[t]),o++,null!=e.tc&&(r=e.tc),i<0&&r++,e.tc=r,e[t]=o};if(he._isLocalStorageSupported()){delete sessionStorage.WZRK_CAMP;var a=nt();null==i.display.wmc&&(i.display.wmc=1);var s=-1,l=-1,c=-1,h=-1,v=-1,g=-1;null!=i.display.efc&&(s=parseInt(i.display.efc,10)),null!=i.display.mdc&&(l=parseInt(i.display.mdc,10)),null!=i.display.tdc&&(c=parseInt(i.display.tdc,10)),null!=i.display.tlc&&(h=parseInt(i.display.tlc,10)),null!=i.display.wmp&&(v=parseInt(i.display.wmp,10)),null!=i.display.wmc&&(g=parseInt(i.display.wmc,10));var b=a[d.sessionId];if(b){var y=b[o],m=b.tc;if("dnd"===y)return!1;if(g>0&&m>=g&&s<0)return!1;if(l>0&&y>=l)return!1}else b={},a[d.sessionId]=b;var w=a[r];if(null!=w){var k=w[o],P=w.tc;if(v>0&&P>=v&&s<0)return!1;if(c>0&&k>=c)return!1}else w={},a[r]=w;var C=a.global;if(null!=C){var O=C[o];if(h>0&&O>=h)return!1}else C={},a.global=C}if(null!=i.display.delay&&i.display.delay>0){var S=i.display.delay;return i.display.delay=0,setTimeout(e,1e3*S,t,{device:u,session:d,request:f,logger:p}),!1}var A=d.getSessionCookieObject();n(A,o,s),n(w,o,s),n(C,o,s);var _={};_[d.sessionId]=A,_[r]=w,_.global=C,at(_)},g=function(){var e=u.getGuid(),t=d.getSessionCookieObject();return"&t=wc&d="+encodeURIComponent(Xe(e+"|"+t.p+"|"+t.s))},y=function(e,t){var i=window.parent[e];"function"==typeof i&&(null!=t.display.kv?i(t.display.kv):i())},m=function(e,t,i,o,r){w(t),function(e,t,i,o,r){if(""!==e&&null!=e){var n,a;r?n=i:null!=(a=i.getElementsByClassName("jsCT_CTA"))&&1===a.length&&(n=a[0]);var s=t.display.jsFunc,l=t.display.preview;null==l&&(e+=g()),null!=n&&(n.onclick=function(){if(null!=s)return null==l&&rt.fireRequest(e),y(s,t),void ft("-1",0,d.sessionId);1===t.display.window?window.open(e,"_blank"):window.location=e})}}(e,t,i,0,r)},w=function(e){var t={type:"event"};t.evtName=V,t.evtData=r({},$,e.wzrk_id),f.processEvent(t)},k=function(e){console.log(e)},P=!1,C=function(e){var t=e.display.onClick;if(window.clevertap.hasOwnProperty("notificationCallback")&&void 0!==window.clevertap.notificationCallback&&"function"==typeof window.clevertap.notificationCallback){var i=window.clevertap.notificationCallback;if(!P){var o={};o.msgContent=e.msgContent,o.msgId=e.wzrk_id,null!=e.display.kv&&(o.kv=e.display.kv),window.clevertap.raiseNotificationClicked=function(){if(""!==t&&null!=t){var i=e.display.jsFunc;if(t+=g(),null!=i)return rt.fireRequest(t),void y(i,e);1===e.display.window?window.open(t,"_blank"):window.location=t}},window.clevertap.raiseNotificationViewed=function(){w(e)},i(o),P=!0}}else if(function(e){console.log("Inside Render Footer Notification");var t=e.wzrk_id.split("_")[0],i=e.display;if(1===i.layout)return O(void 0,e);if(!1!==v(e)){var o="wizParDiv"+i.layout;if(null==document.getElementById(o)){ve.campaignDivMap[t]=o;var r=2===i.layout,n=document.createElement("div");n.id=o;var a=window.innerHeight,s=window.innerWidth,l=!1;if(r)n.setAttribute("style",i.iFrameStyle);else{var c=10,u=5*s/100,d=c+5*a/100,f=30*s/100+20,p="width:30%;";(/mobile/i.test(navigator.userAgent)||/mini/i.test(navigator.userAgent))&&!1===/iPad/i.test(navigator.userAgent)?(f=85*s/100+20,u=5*s/100,d=5*a/100,p="width:80%;"):("ontouchstart"in window||/tablet/i.test(navigator.userAgent))&&(f=50*s/100+20,u=5*s/100,d=5*a/100,p="width:50%;"),null==i.proto?(l=!0,n.setAttribute("style","display:block;overflow:hidden; bottom:"+d+"px !important;width:"+f+"px !important;right:"+u+"px !important;position:fixed;z-index:2147483647;")):n.setAttribute("style",p+i.iFrameStyle)}document.body.appendChild(n);var h=document.createElement("iframe"),g=!1===i.br?"0":"8";h.frameborder="0px",h.marginheight="0px",h.marginwidth="0px",h.scrolling="no",h.id="wiz-iframe";var b,y=e.display.onClick,w="";if(""!==y&&null!=y&&(w="cursor:pointer;"),1===e.msgContent.type)b=(b=e.msgContent.html).replace(/##campaignId##/g,t);else{var P,C,S,A,_,j='<style type="text/css">body{margin:0;padding:0;}#contentDiv.wzrk{overflow:hidden;padding:0;text-align:center;'+w+"}#contentDiv.wzrk td{padding:15px 10px;}.wzrkPPtitle{font-weight: bold;font-size: 16px;font-family:arial;padding-bottom:10px;word-break: break-word;}.wzrkPPdscr{font-size: 14px;font-family:arial;line-height:16px;word-break: break-word;display:inline-block;}.PL15{padding-left:15px;}.wzrkPPwarp{margin:20px 20px 0 5px;padding:0px;border-radius: "+g+"px;box-shadow: 1px 1px 5px #888888;}a.wzrkClose{cursor:pointer;position: absolute;top: 11px;right: 11px;z-index: 2147483647;font-size:19px;font-family:arial;font-weight:bold;text-decoration: none;width: 25px;/*height: 25px;*/text-align: center; -webkit-appearance: none; line-height: 25px;background: #353535;border: #fff 2px solid;border-radius: 100%;box-shadow: #777 2px 2px 2px;color:#fff;}a:hover.wzrkClose{background-color:#d1914a !important;color:#fff !important; -webkit-appearance: none;}td{vertical-align:top;}td.imgTd{border-top-left-radius:8px;border-bottom-left-radius:8px;}</style>";"dark"===e.display.theme?(P="#2d2d2e",C="#eaeaea",S="#353535",A="#353535",_="#ffffff"):(P="#ffffff",C="#000000",A="#f4f4f4",S="#a5a6a6",_="#ffffff");var x=e.msgContent.title,E=e.msgContent.description,R="";null!=e.msgContent.imageUrl&&""!==e.msgContent.imageUrl&&(R="<td class='imgTd' style='background-color:"+A+"'><img src='"+e.msgContent.imageUrl+"' height='60' width='60'></td>"),b=j+"<div class='wzrkPPwarp' style='color:"+C+";background-color:"+P+";'><a href='javascript:void(0);' onclick=parent.$WZRK_WR.closeIframe("+t+",'"+o+"'); class='wzrkClose' style='background-color:"+S+";color:"+_+"'>×</a><div id='contentDiv' class='wzrk'><table cellpadding='0' cellspacing='0' border='0'><tr>"+R+"<td style='vertical-align:top;'><div class='wzrkPPtitle' style='color:"+C+"'>"+x+"</div><div class='wzrkPPdscr' style='color:"+C+"'>"+E+"<div></td></tr></table></div>"}h.setAttribute("style","z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;"),n.appendChild(h);var L=(h.contentWindow?h.contentWindow:h.contentDocument.document?h.contentDocument.document:h.contentDocument).document;L.open(),L.write(b),L.close();var D=function(){c=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv").scrollHeight,!0===i["custom-editor"]||r||(c+=25),document.getElementById("wiz-iframe").contentDocument.body.style.margin="0px",document.getElementById("wiz-iframe").style.height=c+"px"},T=navigator.userAgent.toLowerCase();if(-1!==T.indexOf("safari"))if(T.indexOf("chrome")>-1)h.onload=function(){D();var t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");m(y,e,t,0,l)};else{var I=h.contentDocument||h.contentWindow;I.document&&(I=I.document),D();var M=setInterval((function(){if("complete"===I.readyState){clearInterval(M),D();var t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");m(y,e,t,0,l)}}),10)}else h.onload=function(){D();var t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");m(y,e,t,0,l)};window.addEventListener("message",k)}}}(e),window.clevertap.hasOwnProperty("popupCallback")&&void 0!==window.clevertap.popupCallback&&"function"==typeof window.clevertap.popupCallback){var n=window.clevertap.popupCallback,s={};s.msgContent=e.msgContent,s.msgId=e.wzrk_id;var l=[];for(var c in e)if(c.startsWith("wzrk_")&&c!==$){var u=r({},c,e[c]);l.push(u)}l.length>0&&(s.msgCTkv=l),null!=e.display.kv&&(s.kv=e.display.kv),window.clevertap.raisePopupNotificationClicked=function(e){if(e&&e.msgId){var t={type:"event"};if(t.evtName=H,t.evtData=r({},$,e.msgId),e.msgCTkv){var i,o=b(e.msgCTkv);try{for(o.s();!(i=o.n()).done;){var n=i.value;t.evtData=a(a({},t.evtData),n)}}catch(e){o.e(e)}finally{o.f()}}f.processEvent(t)}},n(s)}},O=function(e,t){var i;if(!(null!=e&&e.clientY>0||(i=null==t?o:t,null!=document.getElementById("intentPreview")||null==i.display.layout&&(/mobile/i.test(navigator.userAgent)||/mini/i.test(navigator.userAgent)||/iPad/i.test(navigator.userAgent)||"ontouchstart"in window||/tablet/i.test(navigator.userAgent))))){var r=i.wzrk_id.split("_")[0];if(!1!==v(i)){ve.campaignDivMap[r]="intentPreview";var n=!1,a=document.createElement("div");a.id="intentOpacityDiv",a.setAttribute("style","position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: rgba(0,0,0,0.7);"),document.body.appendChild(a);var s=document.createElement("div");s.id="intentPreview",null==i.display.proto?(n=!0,s.setAttribute("style","display:block;overflow:hidden;top:55% !important;left:50% !important;position:fixed;z-index:2147483647;width:600px !important;height:600px !important;margin:-300px 0 0 -300px !important;")):s.setAttribute("style",i.display.iFrameStyle),document.body.appendChild(s);var l=document.createElement("iframe"),c=!1===i.display.br?"0":"8";l.frameborder="0px",l.marginheight="0px",l.marginwidth="0px",l.scrolling="no",l.id="wiz-iframe-intent";var u,d=i.display.onClick,f="";if(""!==d&&null!=d&&(f="cursor:pointer;"),1===i.msgContent.type)u=(u=i.msgContent.html).replace(/##campaignId##/g,r);else{var p,h,g,b,y='<style type="text/css">body{margin:0;padding:0;}#contentDiv.wzrk{overflow:hidden;padding:0 0 20px 0;text-align:center;'+f+"}#contentDiv.wzrk td{padding:15px 10px;}.wzrkPPtitle{font-weight: bold;font-size: 24px;font-family:arial;word-break: break-word;padding-top:20px;}.wzrkPPdscr{font-size: 14px;font-family:arial;line-height:16px;word-break: break-word;display:inline-block;padding:20px 20px 0 20px;line-height:20px;}.PL15{padding-left:15px;}.wzrkPPwarp{margin:20px 20px 0 5px;padding:0px;border-radius: "+c+"px;box-shadow: 1px 1px 5px #888888;}a.wzrkClose{cursor:pointer;position: absolute;top: 11px;right: 11px;z-index: 2147483647;font-size:19px;font-family:arial;font-weight:bold;text-decoration: none;width: 25px;/*height: 25px;*/text-align: center; -webkit-appearance: none; line-height: 25px;background: #353535;border: #fff 2px solid;border-radius: 100%;box-shadow: #777 2px 2px 2px;color:#fff;}a:hover.wzrkClose{background-color:#d1914a !important;color:#fff !important; -webkit-appearance: none;}#contentDiv .button{padding-top:20px;}#contentDiv .button a{font-size: 14px;font-weight:bold;font-family:arial;text-align:center;display:inline-block;text-decoration:none;padding:0 30px;height:40px;line-height:40px;background:#ea693b;color:#fff;border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px;}</style>";"dark"===i.display.theme?(p="#2d2d2e",h="#eaeaea",g="#353535",b="#ffffff"):(p="#ffffff",h="#000000",g="#a5a6a6",b="#ffffff");var w=i.msgContent.title,k=i.msgContent.description,P="";null!=i.msgContent.ctaText&&""!==i.msgContent.ctaText&&(P="<div class='button'><a href='#'>"+i.msgContent.ctaText+"</a></div>");var C="";null!=i.msgContent.imageUrl&&""!==i.msgContent.imageUrl&&(C="<div style='padding-top:20px;'><img src='"+i.msgContent.imageUrl+"' width='500' alt="+w+" /></div>"),u=y+("<div class='wzrkPPwarp' style='color:"+h+";background-color:"+p+";'><a href='javascript:void(0);' onclick="+("parent.$WZRK_WR.closeIframe("+r+",'intentPreview');")+" class='wzrkClose' style='background-color:"+g+";color:"+b+"'>×</a><div id='contentDiv' class='wzrk'><div class='wzrkPPtitle' style='color:"+h+"'>"+w+"</div>")+("<div class='wzrkPPdscr' style='color:"+h+"'>"+k+"</div>"+C+P+"</div></div>")}l.setAttribute("style","z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;"),s.appendChild(l);var O=(l.contentWindow?l.contentWindow:l.contentDocument.document?l.contentDocument.document:l.contentDocument).document;O.open(),O.write(u),O.close();var S=document.getElementById("wiz-iframe-intent").contentDocument.getElementById("contentDiv");m(d,i,S,0,n)}}};if(document.body){if(null!=t.inapp_notifs)for(var S=0;S<t.inapp_notifs.length;S++){var A=t.inapp_notifs[S];null==A.display.wtarget_type||0===A.display.wtarget_type?C(A):1===A.display.wtarget_type&&(o=A,window.document.body.onmouseleave=O)}if(he._isLocalStorageSupported())try{if(null!=t.evpr){var _=t.evpr.events,j=t.evpr.profile,x=t.evpr.expires_in,E=ue();he.setMetaProp("lsTime",E),he.setMetaProp("exTs",x),function(e){if(null!=ve.globalEventsMap||(ve.globalEventsMap=he.readFromLSorCookie(N),null!=ve.globalEventsMap)){for(var t in e)if(e.hasOwnProperty(t)){var i=ve.globalEventsMap[t],o=e[t];null!=ve.globalEventsMap[t]?null!=o[0]&&o[0]>i[0]&&(ve.globalEventsMap[t]=o):ve.globalEventsMap[t]=o}}else ve.globalEventsMap=e}(_),he.saveToLSorCookie(N,ve.globalEventsMap),null==ve.globalProfileMap?dt(j,!0):dt(j,!1)}if(null!=t.arp&&function(e){if(null!=e.skipResARP&&e.skipResARP)return console.debug("Update ARP Request rejected",e),null;var t=!(null==e.isOUL||!0!==e.isOUL);if(he._isLocalStorageSupported())try{var i=he.readFromLSorCookie(U);for(var o in(null==i||t)&&(i={}),e)e.hasOwnProperty(o)&&(-1===e[o]?delete i[o]:i[o]=e[o]);he.saveToLSorCookie(U,i)}catch(e){console.error("Unable to parse ARP JSON: "+e)}}(t.arp),null!=t.inapp_stale){var R=nt(),L=R.global;if(null!=L)for(var D in t.inapp_stale)t.inapp_stale.hasOwnProperty(D)&&delete L[t.inapp_stale[D]];at(R)}}catch(e){p.error("Unable to persist evrp/arp: "+e)}}else h<6&&(h++,setTimeout(e,1e3,t,{device:u,session:d,request:f,logger:p}))},Ft=m("isPersonalisationActive"),Ut=function(){function e(i){var o=i.isPersonalisationActive;t(this,e),Object.defineProperty(this,Ft,{writable:!0,value:void 0}),w(this,Ft)[Ft]=o}return o(e,[{key:"getTotalVisits",value:function(){if(w(this,Ft)[Ft]()){var e=he.getMetaProp("sc");return null==e&&(e=1),e}}},{key:"getLastVisit",value:function(){if(w(this,Ft)[Ft]()){var e=he.getMetaProp("ps");return null!=e?new Date(1e3*e):void 0}}}]),e}(),qt=1,Wt=2,Bt=3,Gt=m("logLevel"),Kt=m("log"),Zt=m("isLegacyDebug"),Jt=function(){function e(i){t(this,e),Object.defineProperty(this,Zt,{get:Vt,set:void 0}),Object.defineProperty(this,Kt,{value:$t}),Object.defineProperty(this,Gt,{writable:!0,value:void 0}),this.wzrkError={},w(this,Gt)[Gt]=null==i?i:Wt,this.wzrkError={}}return o(e,[{key:"error",value:function(e){w(this,Gt)[Gt]>=qt&&w(this,Kt)[Kt]("error",e)}},{key:"info",value:function(e){w(this,Gt)[Gt]>=Wt&&w(this,Kt)[Kt]("log",e)}},{key:"debug",value:function(e){(w(this,Gt)[Gt]>=Bt||w(this,Zt)[Zt])&&w(this,Kt)[Kt]("debug",e)}},{key:"reportError",value:function(e,t){this.wzrkError.c=e,this.wzrkError.d=t,this.error("".concat(je," ").concat(e,": ").concat(t))}},{key:"logLevel",get:function(){return w(this,Gt)[Gt]},set:function(e){w(this,Gt)[Gt]=e}}]),e}(),$t=function(e,t){if(window.console)try{var i=(new Date).getTime();console[e]("CleverTap [".concat(i,"]: ").concat(t))}catch(e){}},Vt=function(){return"undefined"!=typeof sessionStorage&&""===sessionStorage.WZRK_D},Ht=m("logger"),Yt=m("sessionId"),Qt=m("isPersonalisationActive"),Xt=function(){function e(i){var o=i.logger,r=i.isPersonalisationActive;t(this,e),Object.defineProperty(this,Ht,{writable:!0,value:void 0}),Object.defineProperty(this,Yt,{writable:!0,value:void 0}),Object.defineProperty(this,Qt,{writable:!0,value:void 0}),this.cookieName=void 0,this.scookieObj=void 0,this.sessionId=he.getMetaProp("cs"),w(this,Ht)[Ht]=o,w(this,Qt)[Qt]=r}return o(e,[{key:"getSessionCookieObject",value:function(){var e=he.readCookie(this.cookieName),t={};if(null!=e)if(e=e.replace(E,'"'),t=JSON.parse(e),te(t)){if(void 0!==t.t){var i=t.t;ue()-i>1260&&(t={})}}else t={};return this.scookieObj=t,t}},{key:"setSessionCookieObject",value:function(e){var t=JSON.stringify(e);he.createBroadCookie(this.cookieName,t,1200,He())}},{key:"manageSession",value:function(e){if(void 0===this.sessionId||this.sessionId!==e){var t=he.getMetaProp("cs");if(void 0===t)he.setMetaProp("ps",e),he.setMetaProp("cs",e),he.setMetaProp("sc",1);else if(t!==e){he.setMetaProp("ps",t),he.setMetaProp("cs",e);var i=he.getMetaProp("sc");void 0===i&&(i=0),he.setMetaProp("sc",i+1)}this.sessionId=e}}},{key:"getTimeElapsed",value:function(){if(w(this,Qt)[Qt]()){null!=this.scookieObj&&(this.scookieObj=this.getSessionCookieObject());var e=this.scookieObj.s;if(null!=e){var t=ue();return Math.floor(t-e)}}}},{key:"getPageCount",value:function(){if(w(this,Qt)[Qt]())return null!=this.scookieObj&&(this.scookieObj=this.getSessionCookieObject()),this.scookieObj.p}},{key:"sessionId",get:function(){return w(this,Yt)[Yt]},set:function(e){w(this,Yt)[Yt]=e}}]),e}(),ei=0,ti=0,ii=m("logger"),oi=m("account"),ri=m("device"),ni=m("session"),ai=m("isPersonalisationActive"),si=m("clearCookie"),li=m("addToLocalEventMap"),ci=function(){function e(i){var o=i.logger,r=i.account,n=i.device,a=i.session,s=i.isPersonalisationActive;t(this,e),Object.defineProperty(this,li,{value:ui}),Object.defineProperty(this,ii,{writable:!0,value:void 0}),Object.defineProperty(this,oi,{writable:!0,value:void 0}),Object.defineProperty(this,ri,{writable:!0,value:void 0}),Object.defineProperty(this,ni,{writable:!0,value:void 0}),Object.defineProperty(this,ai,{writable:!0,value:void 0}),Object.defineProperty(this,si,{writable:!0,value:!1}),this.processingBackup=!1,w(this,ii)[ii]=o,w(this,oi)[oi]=r,w(this,ri)[ri]=n,w(this,ni)[ni]=a,w(this,ai)[ai]=s,rt.logger=o,rt.device=n}return o(e,[{key:"processBackupEvents",value:function(){var e=he.readFromLSorCookie(q);if(null!=e){for(var t in this.processingBackup=!0,e)if(e.hasOwnProperty(t)){var i=e[t];void 0===i.fired&&(w(this,ii)[ii].debug("Processing backup event : "+i.q),void 0!==i.q&&rt.fireRequest(i.q),i.fired=!0)}he.saveToLSorCookie(q,e),this.processingBackup=!1}}},{key:"addSystemDataToObject",value:function(e,t){void 0===t&&(e=se(e,w(this,ii)[ii])),oe(w(this,ii)[ii].wzrkError)||(e.wzrk_error=w(this,ii)[ii].wzrkError,w(this,ii)[ii].wzrkError={}),e.id=w(this,oi)[oi].id,ae(w(this,ri)[ri].gcookie)&&(e.g=w(this,ri)[ri].gcookie);var i=w(this,ni)[ni].getSessionCookieObject();return e.s=i.s,e.pg=void 0===i.p?1:i.p,e}},{key:"addFlags",value:function(e){if(w(this,si)[si]=he.getAndClearMetaProp(R),void 0!==w(this,si)[si]&&w(this,si)[si]&&(e.rc=!0,w(this,ii)[ii].debug("reset cookie sent in request and cleared from meta for future requests.")),w(this,ai)[ai]()){var t=he.getMetaProp("lsTime"),i=he.getMetaProp("exTs");if(void 0===t||void 0===i)return void(e.dsync=!0);t+i<ue()&&(e.dsync=!0)}}},{key:"saveAndFireRequest",value:function(e,t,i){var o=ue(),r=(e=Ve(e,"rn",++ve.globalCache.REQ_N))+"&i="+o+"&sn="+ei;he.backupEvent(r,ve.globalCache.REQ_N,w(this,ii)[ii]),!ve.blockRequest||t||void 0!==w(this,si)[si]&&w(this,si)[si]?(o===ti?ei++:(ti=o,ei=0),rt.fireRequest(r,!1,i)):w(this,ii)[ii].debug("Not fired due to block request - ".concat(ve.blockRequest," or clearCookie - ").concat(w(this,si)[si]))}},{key:"unregisterTokenForGuid",value:function(e){var t={type:"data"};ae(e)&&(t.g=e),t.action="unregister",t.id=w(this,oi)[oi].id;var i=w(this,ni)[ni].getSessionCookieObject();t.s=i.s;var o=Ye(JSON.stringify(t),w(this,ii)[ii]),r=w(this,oi)[oi].dataPostURL;r=Ve(r,"type","data"),r=Ve(r,"d",o),he.saveToLSorCookie(Y,!1),rt.fireRequest(r,!0);var n=he.readFromLSorCookie(Q);this.registerToken(n)}},{key:"registerToken",value:function(e){if(e){e=this.addSystemDataToObject(e,!0),e=JSON.stringify(e);var t=w(this,oi)[oi].dataPostURL;t=Ve(t,"type","data"),t=Ve(t,"d",Ye(e,w(this,ii)[ii])),rt.fireRequest(t),he.save("WZRK_WPR","ok")}}},{key:"processEvent",value:function(e){w(this,li)[li](e.evtName),e=this.addSystemDataToObject(e,void 0),this.addFlags(e),e.WZRK_CAMP=st();var t=Ye(JSON.stringify(e),w(this,ii)[ii]),i=w(this,oi)[oi].dataPostURL;i=Ve(i,"type",K),i=Ve(i,"d",t),this.saveAndFireRequest(i,!1)}}]),e}(),ui=function(e){if(he._isLocalStorageSupported()){void 0===ve.globalEventsMap&&(ve.globalEventsMap=he.readFromLSorCookie(N),void 0===ve.globalEventsMap&&(ve.globalEventsMap={}));var t=ue(),i=ve.globalEventsMap[e];void 0!==i?(i[2]=t,i[0]++):((i=[]).push(1),i.push(t),i.push(t)),ve.globalEventsMap[e]=i,he.saveToLSorCookie(N,ve.globalEventsMap)}},di=m("request"),fi=m("account"),pi=m("oldValues"),hi=m("logger"),vi=m("processPrivacyArray"),gi=function(e){s(r,e);var i=v(r);function r(e,o){var n,a=e.request,s=e.account,l=e.logger;return t(this,r),n=i.call(this),Object.defineProperty(p(n),vi,{value:bi}),Object.defineProperty(p(n),di,{writable:!0,value:void 0}),Object.defineProperty(p(n),fi,{writable:!0,value:void 0}),Object.defineProperty(p(n),pi,{writable:!0,value:void 0}),Object.defineProperty(p(n),hi,{writable:!0,value:void 0}),w(p(n),hi)[hi]=l,w(p(n),di)[di]=a,w(p(n),fi)[fi]=s,w(p(n),pi)[pi]=o,n}return o(r,[{key:"push",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return w(this,vi)[vi](t),0}},{key:"_processOldValues",value:function(){w(this,pi)[pi]&&w(this,vi)[vi](w(this,pi)[pi]),w(this,pi)[pi]=null}}]),r}(f(Array)),bi=function(e){if(Array.isArray(e)&&e.length>0){var t=e[0],i={},o={},r=!1;if(t.hasOwnProperty(W)&&"boolean"==typeof(r=t.optOut)&&(o.ct_optout=r,ve.isOptInRequest=!r),t.hasOwnProperty(B)){var n=t.useIP,a="boolean"==typeof n&&n;he.setMetaProp(B,a)}if(!oe(o)){i.type="profile",i.profile=o,i=w(this,di)[di].addSystemDataToObject(i,void 0);var s=Ye(JSON.stringify(i),w(this,hi)[hi]),l=w(this,fi)[fi].dataPostURL;l=Ve(l,"type",K),l=Ve(l,"d",s),l=Ve(l,W,r?"true":"false"),w(this,di)[di].saveAndFireRequest(l,ve.blockRequeust)}}},yi=m("oldValues"),mi=m("logger"),wi=m("request"),ki=m("account"),Pi=m("wizAlertJSPath"),Ci=m("fcmPublicKey"),Oi=m("setUpWebPush"),Si=m("setUpWebPushNotifications"),Ai=m("setApplicationServerKey"),_i=m("setUpSafariNotifications"),ji=m("setUpChromeFirefoxNotifications"),xi=m("addWizAlertJS"),Ei=m("removeWizAlertJS"),Ri=m("handleNotificationRegistration"),Li=function(e){s(r,e);var i=v(r);function r(e,o){var n,a=e.logger,s=(e.session,e.request),l=e.account;return t(this,r),n=i.call(this),Object.defineProperty(p(n),Ri,{value:Ui}),Object.defineProperty(p(n),Ei,{value:Fi}),Object.defineProperty(p(n),xi,{value:zi}),Object.defineProperty(p(n),ji,{value:Ni}),Object.defineProperty(p(n),_i,{value:Mi}),Object.defineProperty(p(n),Ai,{value:Ii}),Object.defineProperty(p(n),Si,{value:Ti}),Object.defineProperty(p(n),Oi,{value:Di}),Object.defineProperty(p(n),yi,{writable:!0,value:void 0}),Object.defineProperty(p(n),mi,{writable:!0,value:void 0}),Object.defineProperty(p(n),wi,{writable:!0,value:void 0}),Object.defineProperty(p(n),ki,{writable:!0,value:void 0}),Object.defineProperty(p(n),Pi,{writable:!0,value:void 0}),Object.defineProperty(p(n),Ci,{writable:!0,value:void 0}),w(p(n),Pi)[Pi]="https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js",w(p(n),Ci)[Ci]=null,w(p(n),yi)[yi]=o,w(p(n),mi)[mi]=a,w(p(n),wi)[wi]=s,w(p(n),ki)[ki]=l,n}return o(r,[{key:"push",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return w(this,Oi)[Oi](t),0}},{key:"_processOldValues",value:function(){w(this,yi)[yi]&&w(this,Oi)[Oi](w(this,yi)[yi]),w(this,yi)[yi]=null}},{key:"_enableWebPush",value:function(e,t){ve.webPushEnabled=e,null!=t&&w(this,Ai)[Ai](t),ve.webPushEnabled&&ve.notifApi.notifEnabledFromApi?w(this,Ri)[Ri](ve.notifApi.displayArgs):!ve.webPushEnabled&&ve.notifApi.notifEnabledFromApi&&w(this,mi)[mi].error("Ensure that web push notifications are fully enabled and integrated before requesting them")}}]),r}(f(Array)),Di=function(e){ve.webPushEnabled&&e.length>0?w(this,Ri)[Ri](e):null==ve.webPushEnabled&&e.length>0?(ve.notifApi.notifEnabledFromApi=!0,ve.notifApi.displayArgs=e.slice()):!1===ve.webPushEnabled&&e.length>0&&w(this,mi)[mi].error("Make sure push notifications are fully enabled and integrated")},Ti=function(e,t,i,o){-1!==navigator.userAgent.indexOf("Chrome")||-1!==navigator.userAgent.indexOf("Firefox")?w(this,ji)[ji](e,t):-1!==navigator.userAgent.indexOf("Safari")&&w(this,_i)[_i](e,i,o)},Ii=function(e){w(this,Ci)[Ci]=e},Mi=function(e,t,i){var o=this;void 0===t&&w(this,mi)[mi].error("Ensure that APNS Web Push ID is supplied"),void 0===i&&w(this,mi)[mi].error("Ensure that APNS Web Push service path is supplied"),"safari"in window&&"pushNotification"in window.safari&&window.safari.pushNotification.requestPermission(i,t,{},(function(e){if("granted"===e.permission){var t=JSON.parse(JSON.stringify(e));t.endpoint=e.deviceToken,t.browser="Safari",he.saveToLSorCookie(Q,t),w(o,wi)[wi].registerToken(t),w(o,mi)[mi].info("Safari Web Push registered. Device Token: "+e.deviceToken)}else"denied"===e.permission&&w(o,mi)[mi].info("Error subscribing to Safari web push")}))},Ni=function(e,t){var i=this,o="";"serviceWorker"in navigator&&navigator.serviceWorker.register(t).then((function(e){if("undefined"!=typeof __wzrk_account_id)return new Promise((function(t){return setTimeout((function(){return t(e)}),5e3)}));o=e.scope;return/^(\.?)(\/?)([^/]*).js$/.test(t)?navigator.serviceWorker.ready:-1!==navigator.userAgent.indexOf("Chrome")?new Promise((function(t){return setTimeout((function(){return t(e)}),5e3)})):navigator.serviceWorker.getRegistrations()})).then((function(t){-1!==navigator.userAgent.indexOf("Firefox")&&Array.isArray(t)&&(t=t.filter((function(e){return e.scope===o}))[0]);var r={userVisibleOnly:!0};null!=w(i,Ci)[Ci]&&(r.applicationServerKey=function(e){for(var t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),i=window.atob(t),o=[],r=0;r<i.length;r++)o.push(i.charCodeAt(r));return new Uint8Array(o)}(w(i,Ci)[Ci])),t.pushManager.subscribe(r).then((function(t){w(i,mi)[mi].info("Service Worker registered. Endpoint: "+t.endpoint);var o=JSON.parse(JSON.stringify(t));-1!==navigator.userAgent.indexOf("Chrome")?(o.endpoint=o.endpoint.split("/").pop(),o.browser="Chrome"):-1!==navigator.userAgent.indexOf("Firefox")&&(o.endpoint=o.endpoint.split("/").pop(),o.browser="Firefox"),he.saveToLSorCookie(Q,o),w(i,wi)[wi].registerToken(o),void 0!==e&&"function"==typeof e&&e()})).catch((function(e){w(i,mi)[mi].error("Error subscribing: "+e),t.pushManager.getSubscription().then((function(e){null!==e&&e.unsubscribe().then((function(e){w(i,mi)[mi].info("Unsubscription successful")})).catch((function(e){w(i,mi)[mi].error("Error unsubscribing: "+e)}))}))}))})).catch((function(e){w(i,mi)[mi].error("error registering service worker: "+e)}))},zi=function(){var e=document.createElement("script");return e.setAttribute("type","text/javascript"),e.setAttribute("id","wzrk-alert-js"),e.setAttribute("src",w(this,Pi)[Pi]),document.getElementsByTagName("body")[0].appendChild(e),e},Fi=function(){var e=document.getElementById("wzrk-alert-js");e.parentNode.removeChild(e)},Ui=function(e){var t,i,o,r,n,a,s,l,c,u,d,f,p,h,v,g,b=this;if(1===e.length){if(te(e[0])){var y=e[0];t=y.titleText,i=y.bodyText,o=y.okButtonText,r=y.rejectButtonText,n=y.okButtonColor,a=y.skipDialog,s=y.askAgainTimeInSeconds,l=y.okCallback,c=y.rejectCallback,u=y.subscriptionCallback,d=y.hidePoweredByCT,f=y.serviceWorkerPath,p=y.httpsPopupPath,h=y.httpsIframePath,v=y.apnsWebPushId,g=y.apnsWebPushServiceUrl}}else t=e[0],i=e[1],o=e[2],r=e[3],n=e[4],a=e[5],s=e[6];if(null==a&&(a=!1),null==d&&(d=!1),null==f&&(f="/clevertap_sw.js"),void 0!==navigator.serviceWorker){var m=null!=p&&null!=h;if("https:"===window.location.protocol||"localhost"===document.location.hostname||m){if(-1!==navigator.userAgent.indexOf("Chrome")){var k=navigator.userAgent.match(/Chrome\/(\d+)/);if(null==k||parseInt(k[1],10)<50)return}else if(-1!==navigator.userAgent.indexOf("Firefox")){var P=navigator.userAgent.match(/Firefox\/(\d+)/);if(null==P||parseInt(P[1],10)<50)return}else{if(-1===navigator.userAgent.indexOf("Safari"))return;var C=navigator.userAgent.match(/Safari\/(\d+)/);if(null==C||parseInt(C[1],10)<50)return}if(!m){if(null==Notification)return;if("granted"===Notification.permission)return void w(this,Si)[Si](u,f,v,g);if("denied"===Notification.permission)return;if(a)return void w(this,Si)[Si](u,f,v,g)}if(t&&i&&o&&r){null!=n&&n.match(/^#[a-f\d]{6}$/i)||(n="#f28046");var O=(new Date).getTime()/1e3;if(null==he.getMetaProp("notif_last_time"))he.setMetaProp("notif_last_time",O);else{if(null==s&&(s=604800),O-he.getMetaProp("notif_last_time")<s)return;he.setMetaProp("notif_last_time",O)}if(m){var S=document.createElement("iframe");S.setAttribute("style","display:none;"),S.setAttribute("src",h),document.body.appendChild(S),window.addEventListener("message",(function(e){if(null!=e.data){var a={};try{a=JSON.parse(e.data)}catch(e){return}null!=a.state&&"ct"===a.from&&"not"===a.state&&(w(b,xi)[xi]().onload=function(){window.wzrkPermissionPopup.wizAlert({title:t,body:i,confirmButtonText:o,confirmButtonColor:n,rejectButtonText:r,hidePoweredByCT:d},(function(e){e?("function"==typeof l&&l(),window.open(p)):"function"==typeof c&&c(),w(b,Ei)[Ei]()}))})}}),!1)}else w(this,xi)[xi]().onload=function(){window.wzrkPermissionPopup.wizAlert({title:t,body:i,confirmButtonText:o,confirmButtonColor:n,rejectButtonText:r,hidePoweredByCT:d},(function(e){e?("function"==typeof l&&l(),w(b,Si)[Si](u,f,v,g)):"function"==typeof c&&c(),w(b,Ei)[Ei]()}))}}else w(this,mi)[mi].error("Missing input parameters; please specify title, body, ok button and cancel button text")}else w(this,mi)[mi].error("Make sure you are https or localhost to register for notifications")}},qi=m("logger"),Wi=m("api"),Bi=m("onloadcalled"),Gi=m("device"),Ki=m("session"),Zi=m("account"),Ji=m("request"),$i=m("isSpa"),Vi=m("previousUrl"),Hi=m("boundCheckPageChanged"),Yi=m("processOldValues"),Qi=m("checkPageChanged"),Xi=m("pingRequest"),eo=m("isPingContinuous"),to=m("overrideDSyncFlag"),io=function(){function e(){var i,o,r=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t(this,e),Object.defineProperty(this,to,{value:so}),Object.defineProperty(this,eo,{value:ao}),Object.defineProperty(this,Xi,{value:no}),Object.defineProperty(this,Qi,{value:ro}),Object.defineProperty(this,Yi,{value:oo}),Object.defineProperty(this,qi,{writable:!0,value:void 0}),Object.defineProperty(this,Wi,{writable:!0,value:void 0}),Object.defineProperty(this,Bi,{writable:!0,value:void 0}),Object.defineProperty(this,Gi,{writable:!0,value:void 0}),Object.defineProperty(this,Ki,{writable:!0,value:void 0}),Object.defineProperty(this,Zi,{writable:!0,value:void 0}),Object.defineProperty(this,Ji,{writable:!0,value:void 0}),Object.defineProperty(this,$i,{writable:!0,value:void 0}),Object.defineProperty(this,Vi,{writable:!0,value:void 0}),Object.defineProperty(this,Hi,{writable:!0,value:w(this,Qi)[Qi].bind(this)}),this.enablePersonalization=void 0,w(this,Bi)[Bi]=0,this._isPersonalisationActive=this._isPersonalisationActive.bind(this),this.raiseNotificationClicked=function(){},w(this,qi)[qi]=new Jt(Wt),w(this,Zi)[Zi]=new _(null===(i=n.account)||void 0===i?void 0:i[0],n.region,n.targetDomain),w(this,Gi)[Gi]=new Ae({logger:w(this,qi)[qi]}),w(this,Ki)[Ki]=new Xt({logger:w(this,qi)[qi],isPersonalisationActive:this._isPersonalisationActive}),w(this,Ji)[Ji]=new ci({logger:w(this,qi)[qi],account:w(this,Zi)[Zi],device:w(this,Gi)[Gi],session:w(this,Ki)[Ki],isPersonalisationActive:this._isPersonalisationActive}),this.enablePersonalization=n.enablePersonalization||!1,this.event=new Ze({logger:w(this,qi)[qi],request:w(this,Ji)[Ji],isPersonalisationActive:this._isPersonalisationActive},n.event),this.profile=new kt({logger:w(this,qi)[qi],request:w(this,Ji)[Ji],account:w(this,Zi)[Zi],isPersonalisationActive:this._isPersonalisationActive},n.profile),this.onUserLogin=new Dt({request:w(this,Ji)[Ji],account:w(this,Zi)[Zi],session:w(this,Ki)[Ki],logger:w(this,qi)[qi],device:w(this,Gi)[Gi]},n.onUserLogin),this.privacy=new gi({request:w(this,Ji)[Ji],account:w(this,Zi)[Zi],logger:w(this,qi)[qi]},n.privacy),this.notifications=new Li({logger:w(this,qi)[qi],request:w(this,Ji)[Ji],account:w(this,Zi)[Zi]},n.notifications),w(this,Wi)[Wi]=new Oe({logger:w(this,qi)[qi],request:w(this,Ji)[Ji],device:w(this,Gi)[Gi],session:w(this,Ki)[Ki]}),this.spa=n.spa,this.user=new Ut({isPersonalisationActive:this._isPersonalisationActive}),this.session={getTimeElapsed:function(){return w(r,Ki)[Ki].getTimeElapsed()},getPageCount:function(){return w(r,Ki)[Ki].getPageCount()}},this.logout=function(){w(r,qi)[qi].debug("logout called"),he.setInstantDeleteFlagInK()},this.clear=function(){r.onUserLogin.clear()},this.getCleverTapID=function(){return w(r,Gi)[Gi].getGuid()},this.getAccountID=function(){var e;return null===(e=n.account)||void 0===e?void 0:e[0].id},this.setLogLevel=function(e){w(r,qi)[qi].logLevel=Number(e)};var a=function(e,t,i){ht(e,t,i,w(r,Zi)[Zi],w(r,qi)[qi])},s=w(this,Wi)[Wi];s.logout=this.logout,s.clear=this.clear,s.closeIframe=function(e,t){ft(e,0,w(r,Ki)[Ki].sessionId)},s.enableWebPush=function(e,t){r.notifications._enableWebPush(e,t)},s.tr=function(e){zt(e,{device:w(r,Gi)[Gi],session:w(r,Ki)[Ki],request:w(r,Ji)[Ji],logger:w(r,qi)[qi]})},s.setEnum=function(e){pt(e,w(r,qi)[qi])},s.is_onloadcalled=function(){return 1===w(r,Bi)[Bi]},s.subEmail=function(e){a("1",e)},s.getEmail=function(e,t){a("-1",e,t)},s.unSubEmail=function(e){a("0",e)},s.unsubEmailGroups=function(e){ve.unsubGroups=[];for(var t=document.getElementsByClassName("ct-unsub-group-input-item"),i=0;i<t.length;i++){var o=t[i];if(o.name){var r={name:o.name,isUnsubscribed:o.checked};ve.unsubGroups.push(r)}}a(J,e)},s.setSubscriptionGroups=function(e){ve.unsubGroups=e},s.getSubscriptionGroups=function(){return ve.unsubGroups},s.changeSubscriptionGroups=function(e,t){s.setSubscriptionGroups(t),a(J,e)},s.setUpdatedCategoryLong=function(e){e.cUsY&&(ve.updatedCategoryLong=e.cUsY)},window.$CLTP_WR=window.$WZRK_WR=s,(null===(o=n.account)||void 0===o?void 0:o[0].id)&&this.init()}return o(e,[{key:"spa",get:function(){return w(this,$i)[$i]},set:function(e){var t=!0===e;w(this,$i)[$i]!==t&&1===w(this,Bi)[Bi]&&(t?document.addEventListener("click",w(this,Hi)[Hi]):document.removeEventListener("click",w(this,Hi)[Hi])),w(this,$i)[$i]=t}}]),o(e,[{key:"raiseNotificationClicked",value:function(){}},{key:"init",value:function(e,t,i){if(1!==w(this,Bi)[Bi]){if(he.removeCookie("WZRK_P",window.location.hostname),!w(this,Zi)[Zi].id){if(!e)return void w(this,qi)[qi].error(xe);w(this,Zi)[Zi].id=e}w(this,Ki)[Ki].cookieName="WZRK_S_"+w(this,Zi)[Zi].id,t&&(w(this,Zi)[Zi].region=t),i&&(w(this,Zi)[Zi].targetDomain=i);var o=location.href,r=$e(o.toLowerCase());void 0!==r.e&&"0"==r.wzrk_ex||(w(this,Ji)[Ji].processBackupEvents(),w(this,Yi)[Yi](),this.pageChanged(),w(this,$i)[$i]?document.addEventListener("click",w(this,Hi)[Hi]):document.removeEventListener("click",w(this,Hi)[Hi]),w(this,Bi)[Bi]=1)}}},{key:"pageChanged",value:function(){var e=this,t=window.location.href,i=$e(t.toLowerCase()),o=w(this,Ki)[Ki].getSessionCookieObject(),r=void 0===o.p?0:o.p;o.p=++r,w(this,Ki)[Ki].setSessionCookieObject(o);var n={},a=function(e){if(""===e)return"";var t=document.createElement("a");return t.href=e,t.hostname}(document.referrer);if(window.location.hostname!==a){var s=120;""!==a&&(a=a.length>s?a.substring(0,s):a,n.referrer=a);var l=i.utm_source||i.wzrk_source;void 0!==l&&(l=l.length>s?l.substring(0,s):l,n.us=l);var c=i.utm_medium||i.wzrk_medium;void 0!==c&&(c=c.length>s?c.substring(0,s):c,n.um=c);var u=i.utm_campaign||i.wzrk_campaign;if(void 0!==u&&(u=u.length>s?u.substring(0,s):u,n.uc=u),void 0!==i.wzrk_medium){var d=i.wzrk_medium;d.match(/^email$|^social$|^search$/)&&(n.wm=d)}}(n=w(this,Ji)[Ji].addSystemDataToObject(n,void 0)).cpg=t,n.WZRK_CAMP=st();var f=w(this,Zi)[Zi].dataPostURL;w(this,Ji)[Ji].addFlags(n),1===parseInt(n.pg)&&w(this,to)[to](n),n.af={lib:"web-sdk-v1.1.2"},f=Ve(f,"type","page"),f=Ve(f,"d",Ye(JSON.stringify(n),w(this,qi)[qi])),w(this,Ji)[Ji].saveAndFireRequest(f,!1),w(this,Vi)[Vi]=t,setTimeout((function(){r<=3&&w(e,Xi)[Xi](),w(e,eo)[eo]()&&setInterval((function(){w(e,Xi)[Xi]()}),3e5)}),12e4)}},{key:"_isPersonalisationActive",value:function(){return he._isLocalStorageSupported()&&this.enablePersonalization}}]),e}(),oo=function(){this.onUserLogin._processOldValues(),this.privacy._processOldValues(),this.event._processOldValues(),this.profile._processOldValues(),this.notifications._processOldValues()},ro=function(){w(this,Vi)[Vi]!==location.href&&this.pageChanged()},no=function(){var e=w(this,Zi)[Zi].dataPostURL,t={};t=w(this,Ji)[Ji].addSystemDataToObject(t,void 0),e=Ve(e,"type","ping"),e=Ve(e,"d",Ye(JSON.stringify(t),w(this,qi)[qi])),w(this,Ji)[Ji].saveAndFireRequest(e,!1)},ao=function(){return void 0!==window.wzrk_d&&"continuous"===window.wzrk_d.ping},so=function(e){this._isPersonalisationActive()&&(e.dsync=!0)},lo=new io(window.clevertap);return window.clevertap=window.wizrocket=lo,lo}));