-
Notifications
You must be signed in to change notification settings - Fork 17
/
clevertap.min.js
1 lines (1 loc) · 143 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";var e=0;function t(t){return"__private_"+e+++"_"+t}function i(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}const o="clevertap-prod.com",n="https:";var r=t("accountId"),s=t("region"),a=t("targetDomain"),l=t("dcSdkversion"),c=t("token");class d{constructor(){let{id:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:o,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";Object.defineProperty(this,r,{writable:!0,value:void 0}),Object.defineProperty(this,s,{writable:!0,value:""}),Object.defineProperty(this,a,{writable:!0,value:o}),Object.defineProperty(this,l,{writable:!0,value:""}),Object.defineProperty(this,c,{writable:!0,value:""}),this.id=e,t&&(this.region=t),i&&(this.targetDomain=i),n&&(this.token=n)}get id(){return i(this,r)[r]}set id(e){i(this,r)[r]=e}get region(){return i(this,s)[s]}set region(e){i(this,s)[s]=e}get dcSDKVersion(){return i(this,l)[l]}set dcSDKVersion(e){i(this,l)[l]=e}get targetDomain(){return i(this,a)[a]}set targetDomain(e){i(this,a)[a]=e}get token(){return i(this,c)[c]}set token(e){i(this,c)[c]=e}get finalTargetDomain(){return this.region?"".concat(this.region,".").concat(this.targetDomain):this.targetDomain===o?"".concat("eu1",".").concat(this.targetDomain):this.targetDomain}get dataPostPEURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/defineVars")}get dataPostURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/a?t=96")}get recorderURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/r?r=1")}get emailURL(){return"".concat(n,"//").concat(this.finalTargetDomain,"/e?r=1")}}const u=new RegExp("^\\s+|\\.|:|\\$|'|\"|\\\\|\\s+$","g"),h=new RegExp("^\\s+|'|\"|\\\\|\\s+$","g"),p=new RegExp("'","g"),g="clear",f="Charged ID",b="WZRK_CHARGED_ID",v="WZRK_G",m="WZRK_K",y="WZRK_CAMP",w="WZRK_CAMP_G",C="WZRK_EV",k="WZRK_META",x="WZRK_PR",I="WZRK_ARP",M="WZRK_L",S="global",P="optOut",O="useIP",_="WZRK_X",E="push",A=31536e3,D="wzrk_",L="wzrk_id",T="Notification Viewed",z="Notification Clicked",j="WZRK_FPU",N="WZRK_PSD",R="$incr",B="$add",U="$remove",F="$delete",V="WZRK_INBOX_CONFIG",W="WZRK_INBOX",q=1e3,G="wzrk_fetch",H="WZRK_PUSH_CONFIG",K=["Stayed","UTM Visited","App Launched","Notification Sent",T,z],Z=e=>"string"==typeof e||e instanceof String,J=e=>"[object Object]"===Object.prototype.toString.call(e),Q=e=>"object"==typeof e&&e instanceof Date,Y=e=>{for(const t in e)if(e.hasOwnProperty(t))return!1;return!0},$=e=>!isNaN(parseFloat(e))&&isFinite(e),X=e=>/^-?[\d.]+(?:e-?\d+)?$/.test(e)&&"number"==typeof e,ee=e=>null!=e&&"undefined"!==e,te=(e,t)=>{if("object"!=typeof e){let i;return Z(e)?(i=ie(e,h),i.length>1024&&(i=i.substring(0,1024),t.reportError(521,i+"... length exceeded 1024 chars. Trimmed."))):i=e,i}for(const i in e)if(e.hasOwnProperty(i)){const o=te(e[i],t);let n;n=ie(i,u),n.length>1024&&(n=n.substring(0,1024),t.reportError(520,n+"... length exceeded 1024 chars. Trimmed.")),delete e[i],e[n]=o}return e},ie=(e,t)=>e.replace(t,""),oe=()=>{const e=new Date;return e.getFullYear()+""+e.getMonth()+e.getDay()},ne=()=>Math.floor((new Date).getTime()/1e3),re=e=>"$D_"+Math.round(e.getTime()/1e3),se=e=>{if(ae(e))return"$D_"+e},ae=e=>{const t=/^(\d{4})(\d{2})(\d{2})$/.exec(e);if(null==t)return!1;const i=t[3],o=t[2]-1,n=t[1],r=new Date(n,o,i);return r.getDate()==i&&r.getMonth()==o&&r.getFullYear()==n};class le{static save(e,t){return!(!e||!t)&&(this._isLocalStorageSupported()?(localStorage.setItem(e,"string"==typeof t?t:JSON.stringify(t)),!0):void 0)}static read(e){if(!e)return!1;let t=null;if(this._isLocalStorageSupported()&&(t=localStorage.getItem(e)),null!=t)try{t=JSON.parse(t)}catch(e){}return t}static remove(e){return!!e&&(this._isLocalStorageSupported()?(localStorage.removeItem(e),!0):void 0)}static removeCookie(e,t){let i=e+"=; expires=Thu, 01 Jan 1970 00:00:01 GMT;";t&&(i=i+" domain="+t+"; path=/"),document.cookie=i}static createCookie(e,t,i,o){let n="",r="";if(i){const e=new Date;e.setTime(e.getTime()+1e3*i),n="; expires="+e.toGMTString()}o&&(r="; domain="+o),t=encodeURIComponent(t),document.cookie=e+"="+t+n+r+"; path=/"}static readCookie(e){const t=e+"=",i=document.cookie.split(";");for(let e=0;e<i.length;e++){let o=i[e];for(;" "===o.charAt(0);)o=o.substring(1,o.length);if(0==o.indexOf(t))return decodeURIComponent(o.substring(t.length,o.length))}return null}static _isLocalStorageSupported(){return"localStorage"in window&&null!==window.localStorage&&"function"==typeof window.localStorage.setItem}static saveToLSorCookie(e,t){if(null!=t)try{this._isLocalStorageSupported()?this.save(e,encodeURIComponent(JSON.stringify(t))):e===v?this.createCookie(e,encodeURIComponent(t),0,window.location.hostname):this.createCookie(e,encodeURIComponent(JSON.stringify(t)),0,window.location.hostname),ce.globalCache[e]=t}catch(e){}}static readFromLSorCookie(e){let t;if(ce.globalCache.hasOwnProperty(e))return ce.globalCache[e];if(t=this._isLocalStorageSupported()?this.read(e):this.readCookie(e),null!=t&&("function"!=typeof t.trim||""!==t.trim())){let i;try{i=JSON.parse(decodeURIComponent(t))}catch(e){i=decodeURIComponent(t)}return ce.globalCache[e]=i,i}}static createBroadCookie(e,t,i,o){if(o){let r=ce.broadDomain;if(null==r){const s=o.split(".");let a="";for(let o=s.length-1;o>=0;o--){if(a=0===o?s[o]+a:"."+s[o]+a,this.readCookie(e)){var n="test_"+e+o;if(this.createCookie(n,t,10,a),!this.readCookie(n))continue;this.removeCookie(n,a)}this.createCookie(e,t,i,a);if(this.readCookie(e)==t){r=a,ce.broadDomain=r;break}}}else this.createCookie(e,t,i,r)}else this.createCookie(e,t,i,o)}static getMetaProp(e){const t=this.readFromLSorCookie(k);if(null!=t)return t[e]}static setMetaProp(e,t){if(this._isLocalStorageSupported()){let i=this.readFromLSorCookie(k);null==i&&(i={}),void 0===t?delete i[e]:i[e]=t,this.saveToLSorCookie(k,i)}}static getAndClearMetaProp(e){const t=this.getMetaProp(e);return this.setMetaProp(e,void 0),t}static setInstantDeleteFlagInK(){let e=this.readFromLSorCookie(m);null==e&&(e={}),e.flag=!0,this.saveToLSorCookie(m,e)}static backupEvent(e,t,i){let o=this.readFromLSorCookie(M);void 0===o&&(o={}),o[t]={q:e},this.saveToLSorCookie(M,o),i.debug("stored in ".concat(M," reqNo : ").concat(t," -> ").concat(e))}static removeBackup(e,t){const i=this.readFromLSorCookie(M);null!=i&&void 0!==i[e]&&(t.debug("del event: ".concat(e," data-> ").concat(i[e].q)),delete i[e],this.saveToLSorCookie(M,i))}}const ce={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,inbox:null,isPrivacyArrPushed:!1,privacyArray:[],offline:!1,location:null,dismissSpamControl:!1,globalUnsubscribe:!0,flutterVersion:null,variableStore:{},pushConfig:null};var de=t("keyOrder"),ue=t("deleteFromObject");class he{constructor(e){Object.defineProperty(this,ue,{value:pe}),Object.defineProperty(this,de,{writable:!0,value:void 0}),this.max=e;let t=le.readFromLSorCookie(_);if(t){const e={};i(this,de)[de]=[],t=t.cache;for(const o in t)t.hasOwnProperty(o)&&(e[t[o][0]]=t[o][1],i(this,de)[de].push(t[o][0]));this.cache=e}else this.cache={},i(this,de)[de]=[]}get(e){const t=this.cache[e];return t&&(this.cache=i(this,ue)[ue](e,this.cache),this.cache[e]=t,i(this,de)[de].push(e)),this.saveCacheToLS(this.cache),t}set(e,t){const o=this.cache[e],n=i(this,de)[de];null!=o?this.cache=i(this,ue)[ue](e,this.cache):n.length===this.max&&(this.cache=i(this,ue)[ue](n[0],this.cache)),this.cache[e]=t,i(this,de)[de][i(this,de)[de]-1]!==e&&i(this,de)[de].push(e),this.saveCacheToLS(this.cache)}saveCacheToLS(e){const t=[],o=i(this,de)[de];for(const i in o)if(o.hasOwnProperty(i)){const n=[];n.push(o[i]),n.push(e[o[i]]),t.push(n)}le.saveToLSorCookie(_,{cache:t})}getKey(e){if(null===e)return null;const t=i(this,de)[de];for(const i in t)if(t.hasOwnProperty(i)&&this.cache[t[i]]===e)return t[i];return null}getSecondLastKey(){const e=i(this,de)[de];return null!=e&&e.length>1?e[e.length-2]:-1}getLastKey(){const e=i(this,de)[de].length;if(e)return i(this,de)[de][e-1]}}var pe=function(e,t){const o=JSON.parse(JSON.stringify(i(this,de)[de])),n={};let r;for(const i in o)o.hasOwnProperty(i)&&(o[i]!==e?n[o[i]]=t[o[i]]:r=i);return o.splice(r,1),i(this,de)[de]=JSON.parse(JSON.stringify(o)),n},ge=t("logger"),fe=t("request"),be=t("device"),ve=t("session");class me{constructor(e){let{logger:t,request:o,device:n,session:r}=e;Object.defineProperty(this,ge,{writable:!0,value:void 0}),Object.defineProperty(this,fe,{writable:!0,value:void 0}),Object.defineProperty(this,be,{writable:!0,value:void 0}),Object.defineProperty(this,ve,{writable:!0,value:void 0}),i(this,ge)[ge]=t,i(this,fe)[fe]=o,i(this,be)[be]=n,i(this,ve)[ve]=r}s(e,t,o,n,r){let s=!1,a=!1;if(window.isOULInProgress&&(o||"undefined"!==n&&n===window.oulReqN)&&(window.isOULInProgress=!1,s=!0),void 0===n&&(n=0),le.removeBackup(n,i(this,ge)[ge]),n>ce.globalCache.REQ_N)return;if(ee(i(this,be)[be].gcookie)||e&&(a=!0),!ee(i(this,be)[be].gcookie)||o||"boolean"==typeof r){const n=i(this,ve)[ve].getSessionCookieObject();if(window.isOULInProgress||n.s&&t<n.s)return;if(i(this,ge)[ge].debug("Cookie was ".concat(i(this,be)[be].gcookie," set to ").concat(e)),i(this,be)[be].gcookie=e,ee(i(this,be)[be].gcookie)||le.getAndClearMetaProp(O),e&&le._isLocalStorageSupported()){null==ce.LRU_CACHE&&(ce.LRU_CACHE=new he(100));const t=le.readFromLSorCookie(m);let n;null!=t&&t.id&&(n=ce.LRU_CACHE.cache[t.id],o&&(n||(le.saveToLSorCookie(j,!0),ce.LRU_CACHE.set(t.id,e)))),le.saveToLSorCookie(v,e);const r=ce.LRU_CACHE.getSecondLastKey();if(le.readFromLSorCookie(j)&&-1!==r){const e=ce.LRU_CACHE.cache[r];i(this,fe)[fe].unregisterTokenForGuid(e)}}le.createBroadCookie(v,e,A,window.location.hostname),le.saveToLSorCookie(v,e)}le._isLocalStorageSupported()&&i(this,ve)[ve].manageSession(t);const l=i(this,ve)[ve].getSessionCookieObject();(void 0===l.s||l.s<=t)&&(l.s=t,l.t=ne(),i(this,ve)[ve].setSessionCookieObject(l)),ee(i(this,be)[be].gcookie)&&(ce.blockRequest=!1),!s&&!a||i(this,fe)[fe].processingBackup||i(this,fe)[fe].processBackupEvents(),ce.globalCache.RESP_N=n}}var ye=t("logger");class we{constructor(e){let{logger:t}=e;Object.defineProperty(this,ye,{writable:!0,value:void 0}),this.gcookie=void 0,i(this,ye)[ye]=t,this.gcookie=this.getGuid()}getGuid(){let e=null;if(ee(this.gcookie))return this.gcookie;if(le._isLocalStorageSupported()){const t=le.read(v);if(ee(t)){try{e=JSON.parse(decodeURIComponent(t))}catch(o){i(this,ye)[ye].debug("Cannot parse Gcookie from localstorage - must be encoded "+t),32===t.length?(e=t,le.saveToLSorCookie(v,t)):i(this,ye)[ye].error("Illegal guid "+t)}ee(e)&&le.createBroadCookie(v,e,A,window.location.hostname)}}return ee(e)||(e=le.readCookie(v),!ee(e)||0!==e.indexOf("%")&&0!==e.indexOf("'")&&0!==e.indexOf('"')||(e=null),ee(e)&&le.saveToLSorCookie(v,e)),e}}const Ce="This property has been ignored.",ke="CleverTap error:",xe="".concat(ke," Incorrect embed script."),Ie="".concat(ke," Event structure not valid. ").concat(Ce),Me="".concat(ke," Gender value should one of the following: m,f,o,u,male,female,unknown,others (case insensitive). ").concat(Ce),Se="".concat(ke," Employed value should be either Y or N. ").concat(Ce),Pe="".concat(ke," Married value should be either Y or N. ").concat(Ce),Oe="".concat(ke," Education value should be either School, College or Graduate. ").concat(Ce),_e="".concat(ke," Age value should be a number. ").concat(Ce),Ee="".concat(ke," DOB value should be a Date Object"),Ae="".concat(ke," setEnum(value). value should be a string or a number"),De="".concat(ke," Phone number should be formatted as +[country code][number]");let Le;const Te=e=>{if(J(e)){for(var t in e)if(e.hasOwnProperty(t)){if(J(e[t])||Array.isArray(e[t]))return!1;Q(e[t])&&(e[t]=re(e[t]))}return!0}return!1},ze=(e,t)=>{if(J(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>50&&t.reportError(522,"Charged Items exceed 50 limit. Actual count: "+e[i].length),e[i])if(e[i].hasOwnProperty(o)&&(!J(e[i][o])||!Te(e[i][o])))return!1}else{if(J(e[i])||Array.isArray(e[i]))return!1;Q(e[i])&&(e[i]=re(e[i]))}if(Z(e[f])||X(e[f])){const i=e[f]+"";if(void 0===Le&&(Le=le.readFromLSorCookie(b)),void 0!==Le&&Le.trim()===i.trim())return t.error("Duplicate charged Id - Dropped"+e),!1;Le=i,le.saveToLSorCookie(b,i)}return!0}return!1};var je=t("logger"),Ne=t("oldValues"),Re=t("request"),Be=t("isPersonalisationActive"),Ue=t("processEventArray");class Fe extends Array{constructor(e,t){let{logger:o,request:n,isPersonalisationActive:r}=e;super(),Object.defineProperty(this,Ue,{value:Ve}),Object.defineProperty(this,je,{writable:!0,value:void 0}),Object.defineProperty(this,Ne,{writable:!0,value:void 0}),Object.defineProperty(this,Re,{writable:!0,value:void 0}),Object.defineProperty(this,Be,{writable:!0,value:void 0}),i(this,je)[je]=o,i(this,Ne)[Ne]=t,i(this,Re)[Re]=n,i(this,Be)[Be]=r}push(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return i(this,Ue)[Ue](t),0}_processOldValues(){i(this,Ne)[Ne]&&i(this,Ue)[Ue](i(this,Ne)[Ne]),i(this,Ne)[Ne]=null}getDetails(e){if(!i(this,Be)[Be]())return;if(void 0===ce.globalEventsMap&&(ce.globalEventsMap=le.readFromLSorCookie(C)),void 0===ce.globalEventsMap)return;const t=ce.globalEventsMap[e],o={};return void 0!==t?(o.firstTime=new Date(1e3*t[1]),o.lastTime=new Date(1e3*t[2]),o.count=t[0],o):void 0}}var Ve=function(e){if(Array.isArray(e))for(;e.length>0;){var t=e.shift();if(!Z(t)){i(this,je)[je].error(Ie);continue}if(t.length>1024&&(t=t.substring(0,1024),i(this,je)[je].reportError(510,t+"... length exceeded 1024 chars. Trimmed.")),K.includes(t)){i(this,je)[je].reportError(513,t+" is a restricted system event. It cannot be used as an event name.");continue}const o={type:"event"};if(o.evtName=ie(t,u),0!==e.length){const n=e.shift();if(J(n)){if("Charged"===t){if(!ze(n,i(this,je)[je])){i(this,je)[je].reportError(511,"Charged event structure invalid. Not sent.");continue}}else if(!Te(n)){i(this,je)[je].reportError(512,t+" event structure invalid. Not sent.");continue}o.evtData=n}else e.unshift(n)}i(this,Re)[Re].processEvent(o)}};const We=e=>{const t={},i=e.indexOf("?");if(i>1){const o=e.substring(i+1);let n;const r=/\+/g,s=/([^&=]+)=?([^&]*)/g,a=function(e){let t=e.replace(r," ");try{t=decodeURIComponent(t)}catch(e){}return t};for(n=s.exec(o);n;)t[a(n[1])]=a(n[2]),n=s.exec(o)}return t},qe=(e,t,i)=>e+"&"+t+"="+encodeURIComponent(i),Ge=()=>window.location.hostname,He=(e,t)=>(t&&"function"==typeof t.debug&&t.debug("dobj:"+e),Ze(e)),Ke=(()=>{let 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+"+/="})(),Ze=e=>{if(null==e)return"";var t,i,o,n,r,s,a,l="",c=0;for(e=(e=>{if(null==e)return"";let t,i,o,n={},r={},s="",a="",l="",c=2,d=3,u=2,h="",p=0,g=0,f=String.fromCharCode;for(o=0;o<e.length;o+=1)if(s=e.charAt(o),Object.prototype.hasOwnProperty.call(n,s)||(n[s]=d++,r[s]=!0),a=l+s,Object.prototype.hasOwnProperty.call(n,a))l=a;else{if(Object.prototype.hasOwnProperty.call(r,l)){if(l.charCodeAt(0)<256){for(t=0;t<u;t++)p<<=1,15==g?(g=0,h+=f(p),p=0):g++;for(i=l.charCodeAt(0),t=0;t<8;t++)p=p<<1|1&i,15==g?(g=0,h+=f(p),p=0):g++,i>>=1}else{for(i=1,t=0;t<u;t++)p=p<<1|i,15==g?(g=0,h+=f(p),p=0):g++,i=0;for(i=l.charCodeAt(0),t=0;t<16;t++)p=p<<1|1&i,15==g?(g=0,h+=f(p),p=0):g++,i>>=1}c--,0==c&&(c=Math.pow(2,u),u++),delete r[l]}else for(i=n[l],t=0;t<u;t++)p=p<<1|1&i,15==g?(g=0,h+=f(p),p=0):g++,i>>=1;c--,0==c&&(c=Math.pow(2,u),u++),n[a]=d++,l=String(s)}if(""!==l){if(Object.prototype.hasOwnProperty.call(r,l)){if(l.charCodeAt(0)<256){for(t=0;t<u;t++)p<<=1,15==g?(g=0,h+=f(p),p=0):g++;for(i=l.charCodeAt(0),t=0;t<8;t++)p=p<<1|1&i,15==g?(g=0,h+=f(p),p=0):g++,i>>=1}else{for(i=1,t=0;t<u;t++)p=p<<1|i,15==g?(g=0,h+=f(p),p=0):g++,i=0;for(i=l.charCodeAt(0),t=0;t<16;t++)p=p<<1|1&i,15==g?(g=0,h+=f(p),p=0):g++,i>>=1}c--,0==c&&(c=Math.pow(2,u),u++),delete r[l]}else for(i=n[l],t=0;t<u;t++)p=p<<1|1&i,15==g?(g=0,h+=f(p),p=0):g++,i>>=1;c--,0==c&&(c=Math.pow(2,u),u++)}for(i=2,t=0;t<u;t++)p=p<<1|1&i,15==g?(g=0,h+=f(p),p=0):g++,i>>=1;for(;;){if(p<<=1,15==g){h+=f(p);break}g++}return h})(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,n=t>>2,r=(3&t)<<4|i>>4,s=(15&i)<<2|o>>6,a=63&o,isNaN(i)?s=a=64:isNaN(o)&&(a=64),l=l+Ke.charAt(n)+Ke.charAt(r)+Ke.charAt(s)+Ke.charAt(a);return l};var Je=t("fireRequest"),Qe=t("dropRequestDueToOptOut"),Ye=t("addUseIPToRequest"),$e=t("addARPToRequest");class Xe{constructor(){this.networkRetryCount=0,this.minDelayFrequency=0}static fireRequest(e,t,o,n){i(this,Je)[Je](e,1,t,o,n)}getDelayFrequency(){if(this.logger.debug("Network retry #"+this.networkRetryCount),this.networkRetryCount<10)return this.logger.debug(this.account.id,"Failure count is "+this.networkRetryCount+". Setting delay frequency to 1s"),this.minDelayFrequency=q,this.minDelayFrequency;if(null==this.account.region)return this.logger.debug(this.account.id,"Setting delay frequency to 1s"),q;{const e=1e3*(Math.floor(10*Math.random())+1);return this.minDelayFrequency+=e,this.minDelayFrequency<6e5?(this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency):(this.minDelayFrequency=q,this.logger.debug(this.account.id,"Setting delay frequency to "+this.minDelayFrequency),this.minDelayFrequency)}}}Xe.logger=void 0,Xe.device=void 0,Xe.account=void 0,Object.defineProperty(Xe,Je,{value:function(e,t,o,n,r){var s,a;if(i(this,Qe)[Qe]())return void this.logger.debug("req dropped due to optout cookie: "+this.device.gcookie);if(ee(this.device.gcookie)||(ce.blockRequest=!0),r&&r===G)!ee(this.device.gcookie)&&ce.globalCache.RESP_N<ce.globalCache.REQ_N-1&&setTimeout((()=>{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(this.networkRetryCount)),i(this,Je)[Je](e,void 0,o,n)}),this.getDelayFrequency());else if(!ee(this.device.gcookie)&&ce.globalCache.RESP_N<ce.globalCache.REQ_N-1&&t<200)return void setTimeout((()=>{this.logger.debug("retrying fire request for url: ".concat(e,", tries: ").concat(t)),i(this,Je)[Je](e,t+1,o,n)}),50);if(n?window.isOULInProgress=!0:(ee(this.device.gcookie)&&(e=qe(e,"gc",this.device.gcookie)),e=i(this,$e)[$e](e,o)),e=qe(e,"tries",t),e=i(this,Ye)[Ye](e),e=qe(e,"r",(new Date).getTime()),(null===(s=window.clevertap)||void 0===s?void 0:s.hasOwnProperty("plugin"))||(null===(a=window.wizrocket)||void 0===a?void 0:a.hasOwnProperty("plugin"))){const t=window.clevertap.plugin||window.wizrocket.plugin;e=qe(e,"ct_pl",t)}-1!==e.indexOf("chrome-extension:")&&(e=e.replace("chrome-extension:","https:"));for(var l=document.getElementsByClassName("ct-jp-cb");l[0]&&l[0].parentNode;)l[0].parentNode.removeChild(l[0]);const 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(Xe,Qe,{value:function(){return!ce.isOptInRequest&&ee(this.device.gcookie)&&Z(this.device.gcookie)?":OO"===this.device.gcookie.slice(-3):(ce.isOptInRequest=!1,!1)}}),Object.defineProperty(Xe,Ye,{value:function(e){var t=le.getMetaProp(O);return"boolean"!=typeof t&&(t=!1),qe(e,O,t?"true":"false")}}),Object.defineProperty(Xe,$e,{value:function(e,t){if(!0===t){const t={skipResARP:!0};return qe(e,"arp",He(JSON.stringify(t),this.logger))}return le._isLocalStorageSupported()&&void 0!==localStorage.getItem(I)&&null!==localStorage.getItem(I)?qe(e,"arp",He(JSON.stringify(le.readFromLSorCookie(I)),this.logger)):e}});const et=()=>{let e={};if(le._isLocalStorageSupported()){let t=le.read(y);null!=t?(t=JSON.parse(decodeURIComponent(t).replace(p,'"')),t.hasOwnProperty("global")?e.wp=t:e=t):e={}}return e},tt=e=>{if(le._isLocalStorageSupported()){const t={...et(),...e},i=JSON.stringify(t);le.save(y,encodeURIComponent(i)),it()}},it=()=>{if(le._isLocalStorageSupported()){let i=le.read(v);if(ee(i))try{i=JSON.parse(decodeURIComponent(le.read(v)));const o=le.read(w)?JSON.parse(decodeURIComponent(le.read(w))):{};if(i&&le._isLocalStorageSupported()){var e={},t=et();Object.keys(t).forEach((n=>{const r=i in o&&Object.keys(o[i]).length&&o[i][n]?o[i][n]:{},s=t[n].global,a=oe(),l=t[n][a];if(void 0!==s){const e=Object.keys(s);for(const t in e){let i=[];if(e.hasOwnProperty(t)){let o=0,n=0;const a=e[t];if("tc"===a)continue;void 0!==l&&void 0!==l[a]&&(o=l[a]),void 0!==s&&void 0!==s[a]&&(n=s[a]),i=[a,o,n],r[a]=i}}}e={...e,[n]:r}})),o[i]=e,le.save(w,encodeURIComponent(JSON.stringify(o)))}}catch(e){console.error("Invalid clevertap Id "+e)}}},ot=()=>{const e=JSON.parse(decodeURIComponent(le.read(v)));let t={};if(le._isLocalStorageSupported()){let i={};t=et();const o=le.read(w),n=o?decodeURIComponent(o):null,r=n?JSON.parse(n):null,s=e&&null!=o&&r&&r[e]&&r[e].wp?Object.values(r[e].wp):[],a=e&&null!=o&&r&&r[e]&&r[e].wi?Object.values(r[e].wi):[],l=oe();let c=0,d=0;return t.wp&&t.wp[l]&&"undefined"!==t.wp[l].tc&&(c=t.wp[l].tc),t.wi&&t.wi[l]&&"undefined"!==t.wi[l].tc&&(d=t.wi[l].tc),i={wmp:c,wimp:d,tlc:s,witlc:a},i}},nt=(e,t)=>{let{logger:i}=t,o=!1;if(J(e))for(const t in e)if(e.hasOwnProperty(t)){o=!0;let n=e[t];if(null==n){delete e[t];continue}"Gender"!==t||n.match(/\b(?:[mM](?:ale)?|[fF](?:emale)?|[oO](?:thers)?|[uU](?:nknown)?)\b/)||(o=!1,i.error(Me)),"Employed"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Se)),"Married"!==t||n.match(/^Y$|^N$/)||(o=!1,i.error(Pe)),"Education"!==t||n.match(/^School$|^College$|^Graduate$/)||(o=!1,i.error(Oe)),"Age"===t&&null!=n&&($(n)?e.Age=+n:(o=!1,i.error(_e))),"DOB"===t?(/^\$D_/.test(n)&&11===(n+"").length||Q(n)||(o=!1,i.error(Ee)),Q(n)&&(e[t]=re(n))):Q(n)&&(e[t]=re(n)),"Phone"!==t||Y(n)||(n.length>8&&"+"===n.charAt(0)?(n=n.substring(1,n.length),$(n)?e.Phone=+n:(o=!1,i.error(De+". Removed."))):(o=!1,i.error(De+". Removed."))),o||delete e[t]}return o},rt=e=>{const 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"));const i=function(e){if(null!=e){let t="",i="";for(let o=0;o<e.length;o++){const n=e[o];if(null!=n.type){const e=n.type;if("Graduate School"===e)return"Graduate";"College"===e?t="1":"High School"===e&&(i="1")}}if("1"===t)return"College";if("1"===i)return"School"}}(e.education);null!=i&&(t.Education=i);const 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){const i=e.birthday.split("/");t.DOB=se(i[2]+i[0]+i[1])}return t},st=(e,t)=>{let{logger:i}=t;const 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(let t=0;t<e.emails.length;t++){const i=e.emails[t];"account"===i.type&&(o.Email=i.value)}if(null!=e.organizations){o.Employed="N";for(let t=0;t<e.organizations.length;t++){"work"===e.organizations[t].type&&(o.Employed="Y")}}if(null!=e.birthday){const t=e.birthday.split("-");o.DOB=se(t[0]+t[1]+t[2])}return null!=e.relationshipStatus&&(o.Married="N","married"===e.relationshipStatus&&(o.Married="Y")),i.debug("gplus usr profile "+JSON.stringify(o)),o},at=(e,t)=>{if(le._isLocalStorageSupported()){if(null==ce.globalProfileMap&&(ce.globalProfileMap=le.readFromLSorCookie(x),null==ce.globalProfileMap&&(ce.globalProfileMap={})),null!=e._custom){const t=e._custom;for(const i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);delete e._custom}for(const i in e)if(e.hasOwnProperty(i)){if(ce.globalProfileMap.hasOwnProperty(i)&&!t)continue;ce.globalProfileMap[i]=e[i]}null!=ce.globalProfileMap._custom&&delete ce.globalProfileMap._custom,le.saveToLSorCookie(x,ce.globalProfileMap)}},lt=(e,t,i)=>{if(null!=e&&"-1"!==e&&le._isLocalStorageSupported()){const t=et();let o=t.wp[i];null==o&&(o={},t[i]=o),o[e]="dnd",tt(t)}if(null!=ce.campaignDivMap){const t=ce.campaignDivMap[e];null!=t&&(document.getElementById(t).remove(),"intentPreview"===t?null!=document.getElementById("intentOpacityDiv")&&document.getElementById("intentOpacityDiv").remove():"wizParDiv0"===t?null!=document.getElementById("intentOpacityDiv0")&&document.getElementById("intentOpacityDiv0").remove():"wizParDiv2"===t&&null!=document.getElementById("intentOpacityDiv2")&&document.getElementById("intentOpacityDiv2").remove())}};var ct=t("logger"),dt=t("request"),ut=t("account"),ht=t("oldValues"),pt=t("isPersonalisationActive"),gt=t("processProfileArray");class ft extends Array{constructor(e,t){let{logger:o,request:n,account:r,isPersonalisationActive:s}=e;super(),Object.defineProperty(this,gt,{value:bt}),Object.defineProperty(this,ct,{writable:!0,value:void 0}),Object.defineProperty(this,dt,{writable:!0,value:void 0}),Object.defineProperty(this,ut,{writable:!0,value:void 0}),Object.defineProperty(this,ht,{writable:!0,value:void 0}),Object.defineProperty(this,pt,{writable:!0,value:void 0}),i(this,ct)[ct]=o,i(this,dt)[dt]=n,i(this,ut)[ut]=r,i(this,ht)[ht]=t,i(this,pt)[pt]=s}push(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return i(this,gt)[gt](t),0}_processOldValues(){i(this,ht)[ht]&&i(this,gt)[gt](i(this,ht)[ht]),i(this,ht)[ht]=null}getAttribute(e){if(i(this,pt)[pt]())return null==ce.globalProfileMap&&(ce.globalProfileMap=le.readFromLSorCookie(x)),null!=ce.globalProfileMap?ce.globalProfileMap[e]:void 0}_handleIncrementDecrementValue(e,t,o){var n;if(null==ce.globalProfileMap&&(ce.globalProfileMap=le.readFromLSorCookie(x)),null!=ce.globalProfileMap||(null===(n=ce.globalProfileMap)||void 0===n?void 0:n.hasOwnProperty(e)))if(!t||"number"!=typeof t||t<=0)console.error("Value should be a number greater than 0");else{ce.globalProfileMap[e]=o===R?ce.globalProfileMap[e]+t:ce.globalProfileMap[e]-t,le.saveToLSorCookie(x,ce.globalProfileMap);let n={};const r={};n.type="profile",r[e]={[o]:t},null==r.tz&&(r.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),n.profile=r,n=i(this,dt)[dt].addSystemDataToObject(n,!0),i(this,dt)[dt].addFlags(n);const s=He(JSON.stringify(n),i(this,ct)[ct]);let a=i(this,ut)[ut].dataPostURL;a=qe(a,"type",E),a=qe(a,"d",s),i(this,dt)[dt].saveAndFireRequest(a,ce.blockRequest)}else console.error("Kindly create profile with required proprty to increment/decrement.")}_handleMultiValueSet(e,t,i){const o=[];for(let e=0;e<t.length;e++)"number"!=typeof t[e]||o.includes(t[e])?"string"!=typeof t[e]||o.includes(t[e].toLowerCase())?console.error("array supports only string or number type values"):o.push(t[e].toLowerCase()):o.push(t[e]);var n;null==ce.globalProfileMap&&(ce.globalProfileMap=null!==(n=le.readFromLSorCookie(x))&&void 0!==n?n:{});ce.globalProfileMap[e]=o,le.saveToLSorCookie(x,ce.globalProfileMap),this.sendMultiValueData(e,t,i)}_handleMultiValueAdd(e,t,o){null==ce.globalProfileMap&&(ce.globalProfileMap=le.readFromLSorCookie(x)||{});const n=ce.globalProfileMap[e],r=Array.isArray(n)?n:null!=n?[n]:[],s=e=>{const t="number"==typeof e?e:e.toLowerCase();r.includes(t)||r.push(t)};if(Array.isArray(t))t.forEach((e=>{"string"==typeof e||"number"==typeof e?s(e):i(this,ct)[ct].error("Array supports only string or number type values")}));else{if("string"!=typeof t&&"number"!=typeof t)return void i(this,ct)[ct].error("Unsupported value type");s(t)}ce.globalProfileMap[e]=r,le.saveToLSorCookie(x,ce.globalProfileMap),this.sendMultiValueData(e,t,o)}_handleMultiValueRemove(e,t,o){if(null==ce.globalProfileMap&&(ce.globalProfileMap=le.readFromLSorCookie(x)||{}),!ce.globalProfileMap.hasOwnProperty(e))return void i(this,ct)[ct].error("The property ".concat(e," does not exist."));const n=t=>{const i=ce.globalProfileMap[e].indexOf(t);-1!==i&&ce.globalProfileMap[e].splice(i,1)};if(Array.isArray(t))t.forEach(n);else{if("string"!=typeof t&&"number"!=typeof t)return void i(this,ct)[ct].error("Unsupported propVal type");n(t)}0===ce.globalProfileMap[e].length&&delete ce.globalProfileMap[e],le.saveToLSorCookie(x,ce.globalProfileMap),this.sendMultiValueData(e,t,o)}_handleMultiValueDelete(e,t){var o;null==ce.globalProfileMap&&(ce.globalProfileMap=le.readFromLSorCookie(x)),(null==ce||null===(o=ce.globalProfileMap)||void 0===o?void 0:o.hasOwnProperty(e))?delete ce.globalProfileMap[e]:i(this,ct)[ct].error("The property ".concat(e," does not exist.")),le.saveToLSorCookie(x,ce.globalProfileMap),this.sendMultiValueData(e,null,t)}sendMultiValueData(e,t,o){let n={};const r={};n.type="profile",r[e]={[o]:o===F||t},null==r.tz&&(r.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),n.profile=r,n=i(this,dt)[dt].addSystemDataToObject(n,!0),i(this,dt)[dt].addFlags(n);const s=He(JSON.stringify(n),i(this,ct)[ct]);let a=i(this,ut)[ut].dataPostURL;a=qe(a,"type",E),a=qe(a,"d",s),i(this,dt)[dt].saveAndFireRequest(a,ce.blockRequest)}}var bt=function(e){if(Array.isArray(e)&&e.length>0)for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];let n,r={};if(null!=o.Site){if(n=o.Site,Y(n)||!nt(n,{logger:i(this,ct)[ct]}))return}else if(null!=o.Facebook){const e=o.Facebook;Y(e)||e.error||(n=rt(e))}else if(null!=o["Google Plus"]){const e=o["Google Plus"];Y(e)||e.error||(n=st(e,{logger:i(this,ct)[ct]}))}if(null!=n&&!Y(n)){r.type="profile",null==n.tz&&(n.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),r.profile=n,at(n,!0),r=i(this,dt)[dt].addSystemDataToObject(r,void 0),i(this,dt)[dt].addFlags(r);const e=He(JSON.stringify(r),i(this,ct)[ct]);let t=i(this,ut)[ut].dataPostURL;t=qe(t,"type",E),t=qe(t,"d",e),i(this,dt)[dt].saveAndFireRequest(t,ce.blockRequest)}}},vt=t("request"),mt=t("logger"),yt=t("account"),wt=t("session"),Ct=t("oldValues"),kt=t("device"),xt=t("processOUL"),It=t("handleCookieFromCache"),Mt=t("deleteUser"),St=t("processLoginArray");class Pt extends Array{constructor(e,t){let{request:o,account:n,session:r,logger:s,device:a}=e;super(),Object.defineProperty(this,St,{value:At}),Object.defineProperty(this,Mt,{value:Et}),Object.defineProperty(this,It,{value:_t}),Object.defineProperty(this,xt,{value:Ot}),Object.defineProperty(this,vt,{writable:!0,value:void 0}),Object.defineProperty(this,mt,{writable:!0,value:void 0}),Object.defineProperty(this,yt,{writable:!0,value:void 0}),Object.defineProperty(this,wt,{writable:!0,value:void 0}),Object.defineProperty(this,Ct,{writable:!0,value:void 0}),Object.defineProperty(this,kt,{writable:!0,value:void 0}),i(this,vt)[vt]=o,i(this,yt)[yt]=n,i(this,wt)[wt]=r,i(this,mt)[mt]=s,i(this,Ct)[Ct]=t,i(this,kt)[kt]=a}clear(){i(this,mt)[mt].debug("clear called. Reset flag has been set."),i(this,Mt)[Mt](),le.setMetaProp(g,!0)}push(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return i(this,St)[St](t),0}_processOldValues(){i(this,Ct)[Ct]&&i(this,St)[St](i(this,Ct)[Ct]),i(this,Ct)[Ct]=null}}var Ot=function(e){let t=!0;le.saveToLSorCookie(j,t);const o=e=>{let o=le.readFromLSorCookie(m);const n=le.readFromLSorCookie(v);let r;if(null==o)o={},r=e;else{r=o.id;let s=!1,a=!1;if(null==r&&(r=e[0],s=!0),null==ce.LRU_CACHE&&le._isLocalStorageSupported()&&(ce.LRU_CACHE=new he(100)),s)null!=n&&(ce.LRU_CACHE.set(r,n),ce.blockRequest=!1);else for(const t in e)if(e.hasOwnProperty(t)){const i=e[t];if(ce.LRU_CACHE.cache[i]){r=i,a=!0;break}}if(a){r!==ce.LRU_CACHE.getLastKey()?i(this,It)[It]():(t=!1,le.saveToLSorCookie(j,t));const e=ce.LRU_CACHE.get(r);ce.LRU_CACHE.set(r,e),le.saveToLSorCookie(v,e),i(this,kt)[kt].gcookie=e;const o=ce.LRU_CACHE.getSecondLastKey();if(le.readFromLSorCookie(j)&&-1!==o){const e=ce.LRU_CACHE.cache[o];i(this,vt)[vt].unregisterTokenForGuid(e)}}else s?null!=n&&(i(this,kt)[kt].gcookie=n,le.saveToLSorCookie(v,n),t=!1):this.clear(),le.saveToLSorCookie(j,!1),r=e[0]}o.id=r,le.saveToLSorCookie(m,o)};if(Array.isArray(e)&&e.length>0)for(const n in e)if(e.hasOwnProperty(n)){const r=e[n];let s,a={};if(null!=r.Site){if(s=r.Site,Y(s)||!nt(s,{logger:i(this,mt)[mt]}))return}else if(null!=r.Facebook){const e=r.Facebook;Y(e)||e.error||(s=rt(e))}else if(null!=r["Google Plus"]){const e=r["Google Plus"];Y(e)&&!e.error&&(s=st(e,{logger:i(this,mt)[mt]}))}if(null!=s&&!Y(s)){a.type="profile",null==s.tz&&(s.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),a.profile=s;const e=[];le._isLocalStorageSupported()&&(s.Identity&&e.push(s.Identity),s.Email&&e.push(s.Email),s.GPID&&e.push("GP:"+s.GPID),s.FBID&&e.push("FB:"+s.FBID),e.length>0&&o(e)),at(s,!0),a=i(this,vt)[vt].addSystemDataToObject(a,void 0),i(this,vt)[vt].addFlags(a),t&&(a.isOUL=!0);const n=He(JSON.stringify(a),i(this,mt)[mt]);let r=i(this,yt)[yt].dataPostURL;r=qe(r,"type",E),r=qe(r,"d",n),i(this,vt)[vt].saveAndFireRequest(r,ce.blockRequest,t)}}},_t=function(){ce.blockRequest=!1,console.debug("Block request is false"),le._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),le.removeCookie(y,Ge()),le.removeCookie(i(this,wt)[wt].cookieName,ce.broadDomain),le.removeCookie(I,ce.broadDomain),i(this,wt)[wt].setSessionCookieObject("")},Et=function(){ce.blockRequest=!0,i(this,mt)[mt].debug("Block request is true"),ce.globalCache={gcookie:null,REQ_N:0,RESP_N:0},le._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),le.removeCookie(v,ce.broadDomain),le.removeCookie(y,Ge()),le.removeCookie(m,Ge()),le.removeCookie(i(this,wt)[wt].cookieName,ce.broadDomain),le.removeCookie(I,ce.broadDomain),i(this,kt)[kt].gcookie=null,i(this,wt)[wt].setSessionCookieObject("")},At=function(e){if(Array.isArray(e)&&e.length>0){const t=e.pop();if(null!=t&&J(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)){le.setInstantDeleteFlagInK();try{i(this,xt)[xt]([t])}catch(e){i(this,mt)[mt].debug(e)}}else i(this,mt)[mt].error("Profile object is in incorrect format")}};class Dt extends HTMLElement{constructor(){super(),this._target=null,this._session=null,this.shadow=null,this.popup=null,this.container=null,this.resizeObserver=null,this.shadow=this.attachShadow({mode:"open"})}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderImageOnlyPopup())}get session(){return this._session||""}set session(e){this._session=e}get msgId(){return this.target.wzrk_id}get pivotId(){return this.target.wzrk_pivot}get onClickUrl(){return this.target.display.onClickUrl}renderImageOnlyPopup(){const e=this.target.wzrk_id.split("_")[0],t=this.session.sessionId;this.shadow.innerHTML=this.getImageOnlyPopupContent(),this.popup=this.shadowRoot.getElementById("imageOnlyPopup"),this.container=this.shadowRoot.getElementById("container"),this.closeIcon=this.shadowRoot.getElementById("close"),this.popup.addEventListener("load",this.updateImageAndContainerWidth()),this.resizeObserver=new ResizeObserver((()=>this.handleResize(this.popup,this.container))),this.resizeObserver.observe(this.popup),this.closeIcon.addEventListener("click",(()=>{if(this.resizeObserver.unobserve(this.popup),document.getElementById("wzrkImageOnlyDiv").style.display="none",this.remove(),null!=e&&"-1"!==e&&le._isLocalStorageSupported()){const i=et();let o=i.wp[t];null==o&&(o={},i[t]=o),o[e]="dnd",tt(i)}})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId}),this.onClickUrl&&this.popup.addEventListener("click",(()=>{this.target.display.window?window.open(this.onClickUrl,"_blank"):window.parent.location.href=this.onClickUrl,window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})}))}handleResize(e,t){const i=this.getRenderedImageWidth(e);t.style.setProperty("width","".concat(i,"px"))}getImageOnlyPopupContent(){return"\n ".concat(this.target.msgContent.css,"\n ").concat(this.target.msgContent.html,"\n ")}updateImageAndContainerWidth(){return()=>{const e=this.getRenderedImageWidth(this.popup);this.popup.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("width","".concat(e,"px")),this.container.style.setProperty("height","auto"),this.container.style.setProperty("position","fixed"),this.popup.style.setProperty("visibility","visible"),this.closeIcon.style.setProperty("visibility","visible"),document.getElementById("wzrkImageOnlyDiv").style.visibility="visible"}}getRenderedImageWidth(e){const t=e.naturalWidth/e.naturalHeight;return e.height*t}}class Lt extends HTMLElement{constructor(e,t){super(),this.wrapper=null,this.snackBar=null,this.shadow=this.attachShadow({mode:"open"}),this.config=e,this.message=t,this.renderMessage(t)}get pivotId(){return this.message.wzrk_pivot}get campaignId(){return this.message.wzrk_id}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}renderMessage(e){switch(this.wrapper=this.createEl("div","messageWrapper"),e.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":{const t=this.prepareBasicMessage(e.msg[0]);this.wrapper.appendChild(t)}}const t=this.createEl("div","timeStamp");if(t.innerHTML="<span>".concat(Wt(e.id.split("_")[1]),"<span>"),!e.viewed){const e=this.createEl("span","unreadMarker");t.appendChild(e)}this.wrapper.appendChild(t),this.shadow.appendChild(this.wrapper)}prepareBasicMessage(e){const t=this.createEl("div","message");if(e.imageUrl){const i=this.addImage(e.imageUrl,"mainImg");t.appendChild(i)}const i=this.createEl("div","iconTitleDescWrapper");if(e.iconUrl){const t=this.addImage(e.iconUrl,"iconImg");i.appendChild(t)}const o=this.createEl("div","titleDescWrapper");if(e.title){const t=this.createEl("div","title");t.innerText=e.title,o.appendChild(t)}if(e.description){const t=this.createEl("div","description");t.innerText=e.description,o.appendChild(t)}if((e.title||e.description)&&i.appendChild(o),(e.iconUrl||e.title||e.description)&&t.appendChild(i),e.buttons&&e.buttons.length){const i=this.addButtons(e.buttons);t.appendChild(i)}return t}addButtons(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.createEl("div","buttonsContainer");let i=!1;return e.forEach(((e,o)=>{const n=this.createEl("button","button-".concat(o),"button");n.innerText=e.text,o>0&&(n.style.cssText+="margin-left: 2px;"),"copy"===e.action&&(i=!0),t.appendChild(n)})),i&&this.addSnackbar(t),t}addSnackbar(e){this.snackBar=this.createEl("div","snackbar-".concat(this.campaignId),"snackbar"),this.snackBar.innerHTML=Ht;const t=this.createEl("span","snackbar-msg-".concat(this.campaignId),"snackbar-msg");t.innerText="Copied to clipboard",this.snackBar.appendChild(t),e.appendChild(this.snackBar)}addImage(e,t){const i=this.createEl("div","".concat(t,"Container")),o=this.createEl("img",t);return o.setAttribute("src",e),o.setAttribute("loading","lazy"),i.appendChild(o),i}raiseClickedEvent(e,t){switch(this.message.templateType){case"text-only":case"text-with-icon":case"text-with-icon-and-image":this.raiseClickedForBasicTemplates(e,t)}}raiseClickedForBasicTemplates(e,t){const i=this.message.msg[0],o={msgId:this.campaignId,pivotId:this.pivotId};if("BUTTON"===e.tagName){const t=e.id.split("-")[1],n=i.buttons[t];o.kv={wzrk_c2a:n.text},"url"===n.action?n.openUrlInNewTab?window.open(n.url,"_blank"):window.location=n.url:"copy"===n.action&&(window.focus(),navigator.clipboard.writeText(n.clipboardText),this.snackBar.style.setProperty("display","flex","important"),setTimeout((()=>{this.snackBar.style.setProperty("display","none","important")}),2e3))}else"CT-INBOX-MESSAGE"===e.tagName&&i.onClickUrl&&(i.openUrlInNewTab?window.open(i.onClickUrl,"_blank"):window.location=i.onClickUrl);t?console.log("Notifiction clicked event will be raised at run time with payload ::",o):window.clevertap.renderNotificationClicked(o)}}class Tt extends HTMLElement{constructor(e){super(),this.isInboxOpen=!1,this.isInboxFromFlutter=!1,this.selectedCategory=null,this.unviewedMessages={},this.unviewedCounter=0,this.isPreview=!1,this.inboxConfigForPreview={},this.inboxSelector=null,this.inbox=null,this.emptyInboxMsg=null,this.inboxCard=null,this.unviewedBadge=null,this.observer=null,this.selectedCategoryRef=null,this.addClickListenerOnDocument=(()=>e=>{if(e.composedPath().includes(this.inbox)){const t=e.path||e.composedPath&&e.composedPath();if(t.length){const e=t[0].id;if("closeInbox"===e)this.toggleInbox();else if(e.startsWith("category-"))this.prevCategoryRef=this.selectedCategoryRef,this.selectedCategoryRef=t[0],this.updateActiveCategory(t[0].innerText);else{const e=t.filter((e=>{var t;return(null===(t=e.id)||void 0===t?void 0:t.startsWith("button-"))||"CT-INBOX-MESSAGE"===e.tagName}));if(e.length){e[e.length-1].raiseClickedEvent(e[0],this.isPreview)}}}}else(this.checkForWebInbox(e)||this.isInboxOpen)&&(this.isInboxFromFlutter?this.isInboxFromFlutter=!1:this.toggleInbox(e))})(),this.setBadgeStyle=e=>{null!==this.unviewedBadge&&(this.unviewedBadge.innerText=e>9?"9+":e,this.unviewedBadge.style.display=e>0?"flex":"none")},this.logger=e,this.shadow=this.attachShadow({mode:"open"})}get incomingMessages(){return[]}set incomingMessages(e){void 0===e&&(e=[]),e.length>0&&this.updateInboxMessages(e)}get incomingMessagesForPreview(){return[]}set incomingMessagesForPreview(e){void 0===e&&(e=[]);const t={};e.length>0&&this.inbox&&(this.isPreview=!0,this.unviewedCounter=0,e.forEach((e=>{const i="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=i,t[i]=e,this.unviewedMessages[i]=e,this.unviewedCounter++})),this.buildUIForMessages(t),this.updateUnviewedBadgeCounter())}connectedCallback(){this.init()}init(){this.config=this.isPreview?this.inboxConfigForPreview:le.readFromLSorCookie(V)||{},0!==Object.keys(this.config).length&&(this.inboxSelector=document.getElementById(this.config.inboxSelector),null!==this.inboxSelector&&(this.config.styles.notificationsBadge?this.addUnviewedBadge():this.unviewedBadge&&this.unviewedBadge.remove(),this.createinbox(),document.removeEventListener("click",this.addClickListenerOnDocument),document.addEventListener("click",this.addClickListenerOnDocument),this.config.categories.length&&this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadow.innerHTML=this.getInboxStyles(),this.shadow.appendChild(this.inbox)))}addMsgsToInboxFromLS(){const e=this.deleteExpiredAndGetUnexpiredMsgs(!1),t=e?Object.keys(e):[];0!==t.length&&(t.forEach((t=>{e[t].viewed||(this.unviewedMessages[t]=e[t],this.unviewedCounter++)})),this.buildUIForMessages(e),this.updateUnviewedBadgeCounter())}deleteExpiredAndGetUnexpiredMsgs(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=Rt();const i=Math.floor(Date.now()/1e3);for(const o in t)if(t[o].wzrk_ttl&&t[o].wzrk_ttl>0&&t[o].wzrk_ttl<i){if(e&&this.inbox){const e=this.shadowRoot.getElementById(t[o].id);e&&e.remove(),t[o].viewed||(this.unviewedCounter--,this.updateUnviewedBadgeCounter())}delete t[o]}return t&&t.length>0&&(t=Object.values(t).sort(((e,t)=>t.date-e.date)).reduce(((e,t)=>(e[t.id]=t,e)),{})),Bt(t),t}updateInboxMessages(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t=this.deleteExpiredAndGetUnexpiredMsgs(),i=Date.now(),o={};e.forEach(((e,n)=>{const r="".concat(e.wzrk_id.split("_")[0],"_").concat(Date.now());e.id=r,e.date=i-n,e.viewed=0,t[r]=e,o[r]=e,this.unviewedMessages[r]=e,this.unviewedCounter++})),Bt(t),this.inbox&&(this.buildUIForMessages(o),this.updateUnviewedBadgeCounter())}createEl(e,t,i){const o=document.createElement(e);return o.setAttribute("id",t),o.setAttribute("part",i||t),o}addUnviewedBadge(){this.unviewedBadge||(this.unviewedBadge=this.createEl("div","unviewedBadge"),this.unviewedBadge.style.cssText="display: none; position: absolute; height: 16px; width: 26px; border-radius: 8px; background-color: ".concat(this.config.styles.notificationsBadge.backgroundColor,"; font-size: 12px; color: ").concat(this.config.styles.notificationsBadge.textColor,"; font-weight: bold; align-items: center; justify-content: center;"),document.body.appendChild(this.unviewedBadge)),this.updateUnviewedBadgePosition(),window.addEventListener("resize",(()=>{this.updateUnviewedBadgePosition()}))}updateUnviewedBadgePosition(){const{top:e,right:t}=this.inboxSelector.getBoundingClientRect();this.unviewedBadge.style.top="".concat(e-8,"px"),this.unviewedBadge.style.left="".concat(t-8,"px")}createinbox(){this.inbox=this.createEl("div","inbox");const e=this.createEl("div","header"),t=this.createEl("div","headerTitle");t.innerText=this.config.title;const i=this.createEl("div","closeInbox");if(i.innerHTML="×",e.appendChild(t),e.appendChild(i),this.inbox.appendChild(e),this.config.categories.length){const e=this.createCategories();this.inbox.appendChild(e)}this.inboxCard=this.createEl("div","inboxCard"),this.inbox.appendChild(this.inboxCard),this.emptyInboxMsg=this.createEl("div","emptyInboxMsg"),this.emptyInboxMsg.innerText="All messages will be displayed here.",this.inboxCard.appendChild(this.emptyInboxMsg);const o={root:this.inboxCard,rootMargin:"0px",threshold:.5};this.observer=new IntersectionObserver(((e,t)=>{this.handleMessageViewed(e)}),o),this.addMsgsToInboxFromLS()}createCategories(){const e=this.createEl("div","categoriesContainer"),t=this.createEl("div","leftArrow");t.innerHTML=Gt,t.children[0].style="transform: rotate(180deg)",t.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(-70,0)})),e.appendChild(t);const i=this.createEl("div","categoriesWrapper");["All",...this.config.categories].forEach(((e,t)=>{const o=this.createEl("div","category-".concat(t),"category");o.innerText=e,0===t&&(this.selectedCategoryRef=o),i.appendChild(o)})),e.appendChild(i);const o=this.createEl("div","rightArrow");o.innerHTML=Gt,o.addEventListener("click",(()=>{this.shadowRoot.getElementById("categoriesWrapper").scrollBy(70,0)})),e.appendChild(o);const n={root:e,threshold:.9},r=i.children[0],s=i.children[this.config.categories.length];new IntersectionObserver((e=>{this.categoryObserverCb(t,e[0].intersectionRatio>=.9)}),n).observe(r);return new IntersectionObserver((e=>{this.categoryObserverCb(o,e[0].intersectionRatio>=.9)}),n).observe(s),e}categoryObserverCb(e,t){e&&(e.style.display=t?"none":"flex")}updateActiveCategory(e){this.selectedCategory=e,this.inboxCard.scrollTop=0;let t=0;this.prevCategoryRef&&this.prevCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef.setAttribute("selected","true"),this.inboxCard.childNodes.forEach((e=>{"emptyInboxMsg"!==e.getAttribute("id")&&(e.style.display="All"===this.selectedCategory||e.getAttribute("category")===this.selectedCategory?"block":"none","block"===e.style.display&&t++)})),0===t?(this.emptyInboxMsg.innerText="".concat(e," messages will be displayed here."),this.emptyInboxMsg.style.display="block"):this.emptyInboxMsg.style.display="none"}buildUIForMessages(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!this.isPreview&&this.updateTSForRenderedMsgs(),this.inboxCard.scrollTop=0;const i=null!==(e=this.config.maxMsgsInInbox)&&void 0!==e?e:15,o=this.inboxCard.firstChild,n=Object.values(t).sort(((e,t)=>t.date-e.date)).map((e=>e.id));for(const e of n){const i=new Lt(this.config,t[e]);i.setAttribute("id",t[e].id),i.setAttribute("pivot",t[e].wzrk_pivot),i.setAttribute("part","ct-inbox-message"),this.config.categories.length>0?(i.setAttribute("category",t[e].tags[0]||""),i.style.display="All"===this.selectedCategory||t[e].category===this.selectedCategory?"block":"none"):i.style.display="block",this.inboxCard.insertBefore(i,o),this.observer.observe(i)}let r=this.inboxCard.querySelectorAll("ct-inbox-message").length;for(;r>i;){const e=this.inboxCard.querySelectorAll("ct-inbox-message");e.length>0&&e[e.length-1].remove(),r--}const s=this.inboxCard.querySelectorAll('ct-inbox-message[style*="display: block"]').length;this.emptyInboxMsg.style.display=s?"none":"block"}checkForWebInbox(e){const t=le.readFromLSorCookie(V)||{};return this.inboxSelector.contains(e.target)||document.getElementById(t.inboxSelector).contains(e.target)}handleMessageViewed(e){const t=!this.isPreview;this.isInboxOpen&&e.forEach((e=>{e.isIntersecting&&this.unviewedMessages.hasOwnProperty(e.target.id)&&0===e.target.message.viewed&&(e.target.message.viewed=1,t?(window.clevertap.renderNotificationViewed({msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.updateMessageInLS(e.target.id,{...e.target.message,viewed:1}),setTimeout((()=>{e.target.shadowRoot.getElementById("unreadMarker").style.display="none"}),1e3)):console.log("Notifiction viewed event will be raised at run time with payload ::",{msgId:e.target.campaignId,pivotId:e.target.pivotId}),this.unviewedCounter--,this.updateUnviewedBadgeCounter(),delete this.unviewedMessages[e.target.id])}))}updateMessageInLS(e,t){if(!this.isPreview){const i=Rt();i[e]=t,Bt(i)}}toggleInbox(e){this.isInboxOpen=!this.isInboxOpen,this.isInboxFromFlutter=!!(null==e?void 0:e.rect),this.isInboxOpen?(this.inboxCard.scrollTop=0,!this.isPreview&&this.deleteExpiredAndGetUnexpiredMsgs(),this.inbox.style.display="block",this.inbox.style.zIndex="2147483647",this.config.categories.length&&(this.selectedCategoryRef.setAttribute("selected","false"),this.selectedCategoryRef=this.shadowRoot.getElementById("category-0"),this.updateActiveCategory(this.selectedCategoryRef.innerText),this.shadowRoot.getElementById("categoriesWrapper").scrollLeft-=this.shadowRoot.getElementById("categoriesWrapper").scrollWidth),this.setInboxPosition(e)):this.inbox.style.display="none"}setInboxPosition(e){const t=window.outerWidth,i=getComputedStyle(ce.inbox),o=i.getPropertyValue("--inbox-top"),n=i.getPropertyValue("--inbox-bottom"),r=i.getPropertyValue("--inbox-left"),s=i.getPropertyValue("--inbox-right");if(t>481&&!(o||n||r||s)){const t=Vt(e,this.inbox.clientHeight,this.inbox.clientWidth),i=t.xPos,o=t.yPos;this.inbox.style.top=o+"px",this.inbox.style.left=i+"px"}}updateUnviewedBadgeCounter(){if(this.isPreview)return void this.setBadgeStyle(this.unviewedCounter);let e=0;this.inboxCard.querySelectorAll("ct-inbox-message").forEach((t=>{const i=Rt();i[t.id]&&0===i[t.id].viewed&&e++})),this.setBadgeStyle(e)}updateTSForRenderedMsgs(){this.inboxCard.querySelectorAll("ct-inbox-message").forEach((e=>{const t=e.id.split("_")[1];e.shadow.getElementById("timeStamp").firstChild.innerText=Wt(t)}))}getInboxStyles(){const e=this.config.categories.length?64:16,t={panelBackgroundColor:this.config.styles.panelBackgroundColor,panelBorderColor:this.config.styles.panelBorderColor,headerBackgroundColor:this.config.styles.header.backgroundColor,headerTitleColor:this.config.styles.header.titleColor,closeIconColor:this.config.styles.closeIconColor,categoriesTabColor:this.config.styles.categories.tabColor,categoriesTitleColor:this.config.styles.categories.titleColor,selectedCategoryTabColor:this.config.styles.categories.selectedTab.tabColor,selectedCategoryTitleColor:this.config.styles.categories.selectedTab.titleColor,headerCategoryHeight:36+e};this.config.styles.categories.borderColor&&(t.categoriesBorderColor=this.config.styles.categories.borderColor),this.config.styles.categories.selectedTab.borderColor&&(t.selectedCategoryBorderColor=this.config.styles.categories.selectedTab.borderColor);const i=(e=>{let{panelBackgroundColor:t,panelBorderColor:i,headerBackgroundColor:o,headerTitleColor:n,closeIconColor:r,categoriesTabColor:s,categoriesTitleColor:a,categoriesBorderColor:l,selectedCategoryTabColor:c,selectedCategoryTitleColor:d,selectedCategoryBorderColor:u,headerCategoryHeight:h}=e;return'\n <style id="webInboxStyles">\n #inbox {\n width: 100%;\n position: fixed;\n background-color: #fff; \n display: none; \n box-shadow: 0px 2px 10px 0px #d7d7d791;\n background-color: '.concat(t,"; \n border: 1px solid ").concat(i,";\n top: 0;\n left: 0;\n height: 100%;\n overflow: auto;\n z-index: 1;\n box-sizing: content-box;\n border-radius: 4px;\n }\n \n #emptyInboxMsg {\n display: block;\n padding: 10px;\n text-align: center;\n color: black;\n }\n \n #header {\n height: 36px; \n width: 100%; \n display: flex; \n justify-content: center; \n align-items: center; \n background-color: ").concat(o,"; \n background-color: var(--card-bg, ").concat(o,");\n color: ").concat(n,"\n }\n \n #closeInbox {\n font-size: 20px; \n margin-right: 12px; \n color: ").concat(r,"; \n cursor: pointer;\n }\n \n #headerTitle {\n font-size: 14px; \n line-height: 20px; \n flex-grow: 1; \n font-weight: 700; \n text-align: center;\n flex-grow: 1;\n text-align: center;\n }\n \n #categoriesContainer {\n padding: 16px 16px 0 16px; \n height: 32px; \n display: flex;\n scroll-behavior: smooth;\n position: relative;\n }\n\n #categoriesWrapper {\n height: 32px; \n overflow-x: scroll;\n display: flex;\n white-space: nowrap;\n scrollbar-width: none;\n }\n\n #categoriesWrapper::-webkit-scrollbar {\n display: none;\n }\n \n #leftArrow, #rightArrow {\n height: 32px;\n align-items: center;\n font-weight: 700;\n position: absolute;\n z-index: 2;\n pointer-events: auto;\n cursor: pointer;\n display: none;\n }\n\n #leftArrow {\n left: 0;\n padding-left: 4px;\n padding-right: 16px;\n background: linear-gradient(90deg, ").concat(t," 0%, ").concat(t,"99 80%, ").concat(t,"0d 100%);\n }\n\n #rightArrow {\n right: 0;\n padding-right: 4px;\n padding-left: 16px;\n background: linear-gradient(-90deg, ").concat(t," 0%, ").concat(t,"99 80%, ").concat(t,'0d 100%);\n }\n\n [id^="category-"] {\n display: flex; \n flex: 1 1 0; \n justify-content: center; \n align-items: center; \n font-size: 14px; \n line-height: 20px; \n background-color: ').concat(s,"; \n color: ").concat(a,"; \n cursor: pointer;\n padding: 6px 24px;\n margin: 0 3px;\n border-radius: 16px;\n border: ").concat(l?"1px solid "+l:"none",';\n }\n\n [id^="category-"][selected="true"] {\n background-color: ').concat(c,"; \n color: ").concat(d,"; \n border: ").concat(u?"1px solid "+u:"none","\n }\n \n #inboxCard {\n padding: 0 16px 0 16px;\n overflow-y: auto;\n box-sizing: border-box;\n margin-top: 16px;\n }\n\n @media only screen and (min-width: 480px) {\n #inbox {\n width: var(--inbox-width, 392px);\n height: var(--inbox-height, 546px);\n position: var(--inbox-position, fixed);\n right: var(--inbox-right, unset);\n bottom: var(--inbox-bottom, unset);\n top: var(--inbox-top, unset);\n left: var(--inbox-left, unset);\n }\n \n #inboxCard {\n height: calc(var(--inbox-height, 546px) - ").concat(h,"px); \n }\n \n }\n </style>\n ")})(t),o=this.config.styles.cards;return i+(e=>{let{backgroundColor:t,borderColor:i,titleColor:o,descriptionColor:n,buttonColor:r,buttonTextColor:s,unreadMarkerColor:a}=e;return'\n <style id="messageStyles">\n ct-inbox-message::part(messageWrapper) {\n margin-bottom: 16px; \n }\n ct-inbox-message::part(message) {\n background-color: '.concat(t,"; \n border: 1px solid ").concat(i,";\n border-radius: 4px; \n overflow: hidden;\n min-height: 40px;\n }\n ct-inbox-message::part(message):hover {\n box-shadow: 0px 4px 8px rgb(0 0 0 / 10%);\n cursor: pointer;\n }\n ct-inbox-message::part(iconTitleDescWrapper) {\n display: flex; \n padding: 16px;\n }\n ct-inbox-message::part(titleDescWrapper) {\n display: flex; \n flex-direction: column;\n }\n ct-inbox-message::part(iconImgContainer) {\n display: flex; \n margin-right: 16px;\n }\n ct-inbox-message::part(mainImgContainer) {\n line-height: 0;\n }\n ct-inbox-message::part(mainImg) {\n width: 100%; \n background: #b2b1ae;\n }\n ct-inbox-message::part(iconImg) {\n height: 40px; \n width: 40px;\n }\n ct-inbox-message::part(title) {\n font-size: 14px !important; \n line-height: 20px; \n font-weight: 600; \n color: ").concat(o,"\n }\n ct-inbox-message::part(description) {\n font-size: 14px !important; \n line-height: 20px; \n font-weight: 400; \n color: ").concat(n,"\n }\n ct-inbox-message::part(button) {\n background-color: ").concat(r,"; \n color: ").concat(s,"; \n padding: 8px 16px; \n font-size: 12px; \n line-height: 16px; \n font-weight: 600; \n flex: 1; \n border-radius: 0px; \n text-transform: capitalize; \n cursor: pointer; \n border: none;\n }\n ct-inbox-message::part(buttonsContainer) {\n display: flex;\n position: relative;\n }\n ct-inbox-message::part(snackbar) {\n position: absolute;\n top: calc(-100% - 12px);\n left: 50%;\n transform: translate(-50%, 0px);\n font-size: 14px;\n font-weight: 400;\n background: #FFFFFF;\n border: 1px solid #ECEDF2;\n box-shadow: 0px 4px 8px rgb(0 0 0 / 6%), 0px 0px 2px rgb(0 0 0 / 4%);\n border-radius: 4px;\n z-index: 2;\n display: none;\n width: max-content;\n align-items: center;\n padding: 8px 16px;\n justify-content: center;\n }\n\n ct-inbox-message::part(snackbar-msg) {\n color: black;\n margin-left: 8px;\n }\n\n ct-inbox-message::part(timeStamp) {\n display: flex; \n justify-content: end; \n align-items: center; \n margin-top: 4px; \n font-size: 12px !important; \n line-height: 16px; \n color: black;\n }\n ct-inbox-message::part(unreadMarker) {\n height: 8px; \n width: 8px; \n border-radius: 50%; \n background-color: ").concat(a,"; \n margin-left: 8px;\n }\n @media only screen and (min-width: 420px) {\n ct-inbox-message::part(mainImg) {\n height: 180px;\n }\n }\n </style>\n ")})({backgroundColor:o.backgroundColor,borderColor:o.borderColor,titleColor:o.titleColor,descriptionColor:o.descriptionColor,buttonColor:o.buttonColor,buttonTextColor:o.buttonTextColor,unreadMarkerColor:o.unreadMarkerColor})}}const zt=e=>{e.inbox_preview?ce.inbox.incomingMessagesForPreview=e.inbox_notifs:ce.inbox.incomingMessages=e},jt=e=>{Ft(),ce.inbox=new Tt({logger:e}),document.body.appendChild(ce.inbox)},Nt=e=>{const t=le.readFromLSorCookie(W)||{};if(Object.keys(t).length>0&&Object.keys(t)[0].includes("_")){const i={};return i[e]=t,le.saveToLSorCookie(W,i),i}return t},Rt=()=>{const e=JSON.parse(decodeURIComponent(le.read(v)));if(!ee(e))return{};const t=Nt(e);return t.hasOwnProperty(e)?t[e]:{}},Bt=e=>{const t=JSON.parse(decodeURIComponent(le.read(v)));if(!ee(t))return;const i={...Nt(t),[t]:e};le.saveToLSorCookie(W,i)},Ut=e=>new Promise(((t,i)=>{if(document.addEventListener("readystatechange",(function(){"complete"===document.readyState&&(jt(e),t())})),"complete"===document.readyState)jt(e),t();else{const i=le.readFromLSorCookie(V)||{},o=()=>{null===ce.inbox&&jt(e),t()};window.addEventListener("load",(()=>{if(document.getElementById(i.inboxSelector))o();else{let n=0;if(n<20){const r=setInterval((()=>{document.getElementById(i.inboxSelector)?(o(),clearInterval(r),t()):n>=20&&(clearInterval(r),e.debug("Failed to add inbox")),n++}),500)}}}))}})),Ft=()=>{void 0===customElements.get("ct-web-inbox")&&(customElements.define("ct-web-inbox",Tt),customElements.define("ct-inbox-message",Lt))},Vt=(e,t,i)=>{const o=document.scrollingElement.scrollLeft,n=document.scrollingElement.scrollTop,r=window.innerWidth+o,s=window.innerHeight+n,a=e.rect||e.target.getBoundingClientRect(),l=a.x+o,c=a.y+n,d=a.left+o,u=a.right+o,h=a.top+n,p=a.bottom,g=a.height,f=a.width;let b,v,m=!1;const y=16;if(p+t<=s){const e=s-(p+t);v=e>=y?p+y:p+e}else if(h-t>=n){const e=h-t;v=e>=y?h-t-y:h-t-e}else m=!0,v=c+g/2-t/2,v<n?v=n:v+t>s&&(v=s-t);if(m){const e=u+i;if(e<=r){b=u+(e+y<=r?y:r-e)}else{const e=d-i;b=e-(e-y>=o?y:e-o)}}else b=l+f/2-i/2,b<o?b=d+i<=r?d:o:b+i>r&&(b=u-i>=o?u-i:r-i);return{xPos:b,yPos:v}},Wt=e=>{const t=Date.now();let i=Math.floor((t-e)/6e4);return i<5?"Just now":i<60?"".concat(i," minute").concat(i>1?"s":""," ago"):(i=Math.floor(i/60),i<24?"".concat(i," hour").concat(i>1?"s":""," ago"):(i=Math.floor(i/24),"".concat(i," day").concat(i>1?"s":""," ago")))},qt=()=>Object.keys(le.readFromLSorCookie(V)||{}).length>0,Gt='<svg width="6" height="10" viewBox="0 0 6 10" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M0.258435 9.74751C-0.0478584 9.44825 -0.081891 8.98373 0.156337 8.64775L0.258435 8.52836L3.87106 5L0.258435 1.47164C-0.0478588 1.17239 -0.0818914 0.707867 0.156337 0.371887L0.258435 0.252494C0.564728 -0.0467585 1.04018 -0.0800085 1.38407 0.152743L1.50627 0.252494L5.74156 4.39042C6.04786 4.68968 6.08189 5.1542 5.84366 5.49018L5.74156 5.60957L1.50627 9.74751C1.16169 10.0842 0.603015 10.0842 0.258435 9.74751Z" fill="#63698F"/>\n</svg>\n',Ht='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16C12.4183 16 16 12.4183 16 8ZM9.6839 5.93602C9.97083 5.55698 10.503 5.48833 10.8725 5.78269C11.2135 6.0544 11.2968 6.54044 11.0819 6.91173L11.0219 7.00198L8.09831 10.864C7.80581 11.2504 7.26654 11.3086 6.90323 11.0122L6.82822 10.9433L5.04597 9.10191C4.71635 8.76136 4.71826 8.21117 5.05023 7.87303C5.35666 7.5609 5.83722 7.53855 6.16859 7.80482L6.24814 7.87739L7.35133 9.01717L9.6839 5.93602Z" fill="#03A387"/>\n</svg>\n',Kt="https://web-native-display-campaign.clevertap.com/production/lib-overlay/style.css",Zt="wve-anti-flicker-show",Jt="wve-anti-flicker-hide",Qt="wve-flicker-style",Yt=e=>{if(e.data&&function(e){try{const t=new URL(e);return Boolean(t)}catch(e){return!1}}(e.data.originUrl)){{const t=new URL(e.data.originUrl).origin;if(e.origin!==t)return}var t,i;if("Dashboard"===e.data.message)window.evtMaster=e.data.personalisation.evtMaster,$t(e.data.url,null!==(t=e.data.variant)&&void 0!==t?t:null,null!==(i=e.data.details)&&void 0!==i?i:{},e.data.personalisation);else"Overlay"===e.data.message&&oi(e.data,!0)}},$t=(e,t,i,o)=>{"complete"===document.readyState?ii(e,t,i,o):document.addEventListener("readystatechange",(()=>{"complete"===document.readyState&&ii(e,t,i,o)}))};let Xt,ei=!1,ti=!1;function ii(e,t,i,o){if(!ei){window.Shopify&&(ti=!0),document.body.innerHTML="",document.head.innerHTML="",document.documentElement.innerHTML="",Xt=document.createElement("div"),Xt.id="overlayDiv",Xt.style.position="relative",Xt.style.display="flex",document.body.appendChild(Xt);(function(e,t,i,o,n){return new Promise(((r,s)=>{var a=document.createElement("script");a.type="module",a.src=e,a.onload=function(){"function"==typeof window.Overlay?(window.Overlay({id:"#overlayDiv",url:t,variant:i,details:o,isShopify:ti,personalisation:n}),r()):s(new Error("ContentLayout not found in overlay.js"))},a.onerror=function(e){s(e)},document.head.appendChild(a)}))})("https://web-native-display-campaign.clevertap.com/production/lib-overlay/overlay.js",e,t,i,o).then((()=>{console.log("Overlay script loaded successfully."),ei=!0})).catch((e=>{console.error("Error loading overlay script:",e)})),(n=document.createElement("link")).rel="stylesheet",n.type="text/css",n.href=Kt,document.head.appendChild(n)}var n}const oi=(e,t)=>{const i=t?e.details:e.display.details;let o=!1;const n={msgId:e.wzrk_id,pivotId:e.wzrk_pivot},r=()=>{t||o||(o=!0,window.clevertap.renderNotificationViewed(n))},s=(i,o)=>{var r;o.values&&(o.values.html?i.outerHTML=t?o.values.html.text:o.values.html:(null===(r=o.values)||void 0===r?void 0:r.json)?function(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o={};o.msgId=e.wzrk_id,e.wzrk_pivot&&(o.pivotId=e.wzrk_pivot);null!=t.json&&(o.json=i?t.json.text:t.json);const n=new CustomEvent("CT_web_native_display_buider",{detail:o});document.dispatchEvent(n)}(e,o.values,t):(n.msgCTkv={wzrk_selector:o.selector},function(e,t,i){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(void 0!==t.style&&Object.keys(t.style).forEach((i=>{e.style.setProperty(i,t.style[i])})),void 0!==t.underline){const i=e.style.textDecoration;t.underline?e.style.textDecoration="".concat(i," underline").trim():e.style.textDecoration=i.replace("underline","").trim()}if(void 0!==t.text&&(e.innerText=o?t.text.text:t.text),void 0!==t.clickDetails){const n=t.clickDetails.clickUrl;e.onclick=t.clickDetails.newTab?()=>{o||window.clevertap.raiseNotificationClicked(i),window.open(n,"_blank").focus()}:()=>{o||window.clevertap.raiseNotificationClicked(i),window.location.href=n}}if(void 0!==t.imgURL&&"img"===e.tagName.toLowerCase()&&(e.src=t.imgURL),void 0!==t.elementCss){const e=document.createElement("style");e.innerHTML=t.elementCss,document.head.appendChild(e)}}(i,o.values.form,n,t)))};i.forEach((e=>{e.url===window.location.href.split("?")[0]&&e.selectorData.forEach((e=>{const t=document.querySelector(e.selector);t?(r(),s(t,e)):(e=>{let t=0;const i=setInterval((()=>{const o=document.querySelector(e.selector);o?(r(),s(o,e),clearInterval(i)):++t>=20&&(console.log("No element present on DOM with selector '".concat(e,"'.")),clearInterval(i))}),500)})(e)}))}))};function ni(e){const{personalizedSelectors:t=[],delayTime:i=2e3}=e,o={};let n,r=0;function s(e){function t(e){const t=[];e.forEach((e=>{const i=document.querySelectorAll(e);i.length?(i.forEach((e=>{(function(e){const t=e.getBoundingClientRect(),{innerHeight:i,innerWidth:o}=window;return t.bottom>0&&t.right>0&&t.top<i&&t.left<o})(e)&&t.push(e)})),delete o[e]):o[e]=!1})),function(e){e.forEach((e=>e.classList.add(Jt))),setTimeout((()=>{e.forEach((e=>{e.classList.remove(Jt),e.classList.add(Zt)}))}),i)}(t)}t(e),Object.keys(o).length&&(n=setInterval((function(){t(Object.keys(o)),r++,(0===Object.keys(o).length||r>20)&&(r=0,clearInterval(n))}),100))}!function(){const e=Qt;if(!document.getElementById(e)){const t=document.createElement("style");t.id=e,t.textContent="\n .wve-anti-flicker-hide {\n opacity: 0 !important;\n }\n .wve-anti-flicker-show {\n transition: opacity 0.5s, filter 0.5s !important;\n }\n ",document.head.appendChild(t)}}(),window.addEventListener("DOMContentLoaded",(()=>{!function(){let e=document.location.href;new MutationObserver((()=>{e!==document.location.href&&(e=document.location.href,s(t))})).observe(document.body,{childList:!0,subtree:!0})}()})),s(t)}class ri extends HTMLElement{constructor(){super(),this._details=null,this.shadow=null,this.shadow=this.attachShadow({mode:"open"})}get details(){return this._details||""}set details(e){null===this._details&&(this._details=e,this.renderBanner())}renderBanner(){this.shadow.innerHTML=this.getBannerContent(),!1!==this.trackClick&&this.addEventListener("click",(()=>{const e=this.details.onClick;e&&(this.details.window?window.open(e,"_blank"):window.parent.location.href=e),window.clevertap.renderNotificationClicked({msgId:this.msgId,pivotId:this.pivotId})})),window.clevertap.renderNotificationViewed({msgId:this.msgId,pivotId:this.pivotId})}getBannerContent(){return'\n <style type="text/css">\n .banner {\n position: relative;\n cursor: '.concat(this.details.onClick?"pointer":"","\n }\n img {\n height: ").concat(this.divHeight?this.divHeight:"auto",";\n width: 100%;\n }\n .wrapper:is(.left, .right, .center) {\n display: flex;\n justify-content: center;\n flex-direction: column;\n align-items: center;\n position: absolute;\n width: 100%;\n height: 100%;\n overflow: auto;\n top: 0;\n }\n ").concat(this.details.css?this.details.css:"",'\n </style>\n <div class="banner">\n <picture>\n <source media="(min-width:480px)" srcset="').concat(this.details.desktopImageURL,'">\n <source srcset="').concat(this.details.mobileImageURL,'">\n <img src="').concat(this.details.desktopImageURL,'" alt="Please upload a picture" style="width:100%;" part="banner__img">\n </picture>\n ').concat(this.details.html?this.details.html:"","\n </div>\n ")}}class si extends HTMLElement{constructor(){super(),this._target=null,this._carousel=null,this.shadow=null,this.slides=0,this.previouslySelectedItem=-1,this.selectedItem=1,this.autoSlide=null,this.stopAutoSlideTimeout=null,this.shadow=this.attachShadow({mode:"open"}),void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",ri)}get target(){return this._target||""}set target(e){null===this._target&&(this._target=e,this.renderCarousel())}get details(){return this.target.display.details}get display(){return this.target.display}renderCarousel(){this.slides=this.details.length,this.shadow.innerHTML=this.getStyles();const e=this.getCarouselContent();this.display.showNavBtns&&e.insertAdjacentHTML("beforeend",this.display.navBtnsHtml),this.display.showNavArrows&&(e.insertAdjacentHTML("beforeend",this.display.leftNavArrowHtml),e.insertAdjacentHTML("beforeend",this.display.rightNavArrowHtml)),this._carousel=e,this.shadow.appendChild(e),this.setupClick(),this.updateSelectedItem(),this.startAutoSlide(),this.setupOnHover(),window.clevertap.renderNotificationViewed({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot})}setupClick(){this._carousel.addEventListener("click",(e=>{const t=e.target.id;if(t.startsWith("carousel__button")){const e=+t.split("-")[1];e!==this.selectedItem&&(this.previouslySelectedItem=this.selectedItem,this.selectedItem=e,this.updateSelectedItem(),this.startAutoSlide())}else if(t.startsWith("carousel__arrow"))t.endsWith("right")?this.goToNext():this.goToPrev(),this.startAutoSlide();else if(t.indexOf("-")>-1){const e=+t.split("-")[1],i=e-1;window.parent.clevertap&&window.clevertap.renderNotificationClicked({msgId:this.target.wzrk_id,pivotId:this.target.wzrk_pivot,wzrk_slideNo:e});const o=this.details[i].onClick;""!==o&&(this.details[i].window?window.open(o,"_blank"):window.location.href=o)}}))}setupOnHover(){this._carousel.addEventListener("mouseenter",(e=>{this.stopAutoSlideTimeout=setTimeout((()=>{this.autoSlide=clearInterval(this.autoSlide)}),500)})),this._carousel.addEventListener("mouseleave",(e=>{clearTimeout(this.stopAutoSlideTimeout),void 0===this.autoSlide&&this.startAutoSlide()}))}getCarouselContent(){const e=document.createElement("div");return e.setAttribute("class","carousel"),this.details.forEach(((t,i)=>{const o=document.createElement("ct-web-personalisation-banner");o.classList.add("carousel__item"),o.trackClick=!1,o.setAttribute("id","carousel__item-".concat(i+1)),o.details=t,e.appendChild(o)})),e}getStyles(){var e,t;return"\n <style>\n .carousel {\n position: relative;\n }\n\n .carousel__item {\n display: none;\n background-repeat: no-repeat;\n background-size: cover;\n }\n\n ct-web-personalisation-banner::part(banner__img) {\n height: ".concat((null==this||null===(e=this.target)||void 0===e||null===(t=e.display)||void 0===t?void 0:t.divHeight)?this.target.display.divHeight:"auto",";\n width: 100%;\n transition: 2s;\n }\n\n .carousel__item--selected {\n display: block;\n }\n ").concat(this.display.navBtnsCss,"\n ").concat(this.display.navArrowsCss,"\n </style>\n ")}updateSelectedItem(){if(-1!==this.previouslySelectedItem){const e=this.shadow.getElementById("carousel__item-".concat(this.previouslySelectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.previouslySelectedItem));e.classList.remove("carousel__item--selected"),t&&t.classList.remove("carousel__button--selected")}const e=this.shadow.getElementById("carousel__item-".concat(this.selectedItem)),t=this.shadow.getElementById("carousel__button-".concat(this.selectedItem));e.classList.add("carousel__item--selected"),t&&t.classList.add("carousel__button--selected")}startAutoSlide(){clearInterval(this.autoSlide),this.autoSlide=setInterval((()=>{this.goToNext()}),this.display.sliderTime?1e3*this.display.sliderTime:3e3)}goToNext(){this.goTo(this.selectedItem,(this.selectedItem+1)%this.slides)}goToPrev(){this.goTo(this.selectedItem,this.selectedItem-1)}goTo(e,t){this.previouslySelectedItem=e,this.selectedItem=t,0===t&&(this.selectedItem=this.slides),this.updateSelectedItem()}}const ai=e=>{var t;void 0===customElements.get("ct-web-personalisation-banner")&&customElements.define("ct-web-personalisation-banner",ri);const i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,o=document.createElement("ct-web-personalisation-banner");o.msgId=e.wzrk_id,o.pivotId=e.wzrk_pivot,o.divHeight=e.display.divHeight,o.details=e.display.details[0];const n=e.display.divId?document.getElementById(i):document.querySelector(i);n.innerHTML="",n.appendChild(o)},li=e=>{var t;void 0===customElements.get("ct-web-personalisation-carousel")&&customElements.define("ct-web-personalisation-carousel",si);const i=null!==(t=e.display.divId)&&void 0!==t?t:e.display.divSelector,o=document.createElement("ct-web-personalisation-carousel");o.target=e;const n=e.display.divId?document.getElementById(i):document.querySelector(i);n.innerHTML="",n.appendChild(o)},ci=e=>{const t={};t.msgId=e.wzrk_id,e.wzrk_pivot&&(t.pivotId=e.wzrk_pivot),null!=e.msgContent.kv&&(t.kv=e.msgContent.kv);const i=new CustomEvent("CT_web_native_display",{detail:t});document.dispatchEvent(i)},di=(e,t)=>{const i=window.parent[e];"function"==typeof i&&(null!=t.display.kv?i(t.display.kv):i())},ui=(e,t)=>{const i="<script>\n const ct__camapignId = '".concat(e.wzrk_id,"';\n const ct__formatVal = (v) => {\n return v && v.trim().substring(0, 20);\n }\n const ct__parentOrigin = window.parent.origin;\n document.body.addEventListener('click', (event) => {\n const elem = event.target.closest?.('a[wzrk_c2a], button[wzrk_c2a]');\n if (elem) {\n const {innerText, id, name, value, href} = elem;\n const clickAttr = elem.getAttribute('onclick') || elem.getAttribute('click');\n const onclickURL = clickAttr?.match(/(window.open)[(](\"|')(.*)(\"|',)/)?.[3] || clickAttr?.match(/(location.href *= *)(\"|')(.*)(\"|')/)?.[3];\n const props = {innerText, id, name, value};\n let msgCTkv = Object.keys(props).reduce((acc, c) => {\n const formattedVal = ct__formatVal(props[c]);\n formattedVal && (acc['wzrk_click_' + c] = formattedVal);\n return acc;\n }, {});\n if(onclickURL) { msgCTkv['wzrk_click_' + 'url'] = onclickURL; }\n if(href) { msgCTkv['wzrk_click_' + 'c2a'] = href; }\n const notifData = { msgId: ct__camapignId, msgCTkv, pivotId: '").concat(e.wzrk_pivot,"' };\n window.parent.clevertap.renderNotificationClicked(notifData);\n }\n });\n <\/script>\n ");return t.replace(/(<\s*\/\s*body)/,"".concat(i,"\n$1"))},hi=(e,t)=>{const i=et(),o=i[t].global;if(null!=o&&t)for(const i in e)if(e.hasOwnProperty(i)&&(delete o[e[i]],le.read(w))){const o=JSON.parse(decodeURIComponent(le.read(w))),n=JSON.parse(decodeURIComponent(le.read(v)));o[n]&&o[n][t]&&o[n][t][e[i]]&&(delete o[n][t][e[i]],le.save(w,encodeURIComponent(JSON.stringify(o))))}tt(i)},pi=(e,t)=>{const i={type:"event"};i.evtName=T,i.evtData={[L]:e.wzrk_id},e.wzrk_pivot&&(i.evtData={...i.evtData,wzrk_pivot:e.wzrk_pivot}),t.processEvent(i)},gi=(e,t)=>{const i=e.getGuid(),o=t.getSessionCookieObject();return"&t=wc&d="+encodeURIComponent(Ze(i+"|"+o.p+"|"+o.s))},fi=e=>{const t=328-(e.card.borderEnabled?2*e.card.border.borderWidth:0);return"\n #pnWrapper {\n width: 360px;\n }\n\n #pnOverlay {\n background-color: ".concat(e.overlay.color||"rgba(0, 0, 0, .15)",";\n position: fixed;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n z-index: 10000\n }\n\n #pnCard {\n background-color: ").concat(e.card.color,";\n border-radius: ").concat(e.card.borderRadius,"px;\n padding: 16px;\n width: ").concat(t,"px;\n position: fixed;\n z-index: 999999;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n ").concat(e.card.borderEnabled?"\n border-width: ".concat(e.card.border.borderWidth,"px;\n border-color: ").concat(e.card.border.borderColor,";\n border-style: solid;\n "):"","\n height: fit-content;\n }\n\n #iconTitleDescWrapper {\n display: flex;\n align-items: center;\n margin-bottom: 16px;\n gap: 12px;\n }\n\n #iconContainer {\n min-width: 64px;\n max-width: 64px;\n aspect-ratio: 1;\n object-fit: cover;\n }\n\n #titleDescWrapper {\n flex-grow: 1;\n overflow: hidden;\n overflow-wrap: break-word;\n }\n\n #title {\n font-size: 16px;\n font-weight: 700;\n color: ").concat(e.text.titleColor,";\n margin-bottom: 4px;\n line-height: 24px;\n }\n\n #description {\n font-size: 14px;\n font-weight: 500;\n color: ").concat(e.text.descriptionColor,";\n line-height: 20px;\n }\n\n #buttonsContainer {\n display: flex;\n justify-content: space-between;\n min-height: 32px;\n gap: 8px;\n align-items: center;\n }\n\n #primaryButton, #secondaryButton {\n padding: 6px 24px;\n flex: 1;\n cursor: pointer;\n font-weight: bold;\n display: flex;\n align-items: center;\n justify-content: center;\n height: max-content;\n font-size: 14px;\n font-weight: 500;\n line-height: 20px;\n }\n\n #primaryButton {\n background-color: ").concat(e.buttons.primaryButton.buttonColor,";\n color: ").concat(e.buttons.primaryButton.textColor,";\n border-radius: ").concat(e.buttons.primaryButton.borderRadius,"px;\n ").concat(e.buttons.primaryButton.borderEnabled?"\n border-width: ".concat(e.buttons.primaryButton.border.borderWidth,"px;\n border-color: ").concat(e.buttons.primaryButton.border.borderColor,";\n border-style: solid;\n "):"border: none;","\n }\n\n #secondaryButton {\n background-color: ").concat(e.buttons.secondaryButton.buttonColor,";\n color: ").concat(e.buttons.secondaryButton.textColor,";\n border-radius: ").concat(e.buttons.secondaryButton.borderRadius,"px;\n ").concat(e.buttons.secondaryButton.borderEnabled?"\n border-width: ".concat(e.buttons.secondaryButton.border.borderWidth,"px;\n border-color: ").concat(e.buttons.secondaryButton.border.borderColor,";\n border-style: solid;\n "):"border: none;","\n }\n\n #primaryButton:hover, #secondaryButton:hover {\n opacity: 0.9;\n }\n ")},bi=e=>"\n #bell_wrapper {\n position: fixed;\n cursor: pointer;\n background-color: ".concat(e.card.backgroundColor,";\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n width: 48px;\n height: 48px;\n border-radius: 50%;\n display: flex;\n flex-direction: column;\n gap: 8px;\n z-index: 999999;\n }\n\n #bell_icon {\n display: block;\n width: 48px;\n height: 48px;\n }\n\n #bell_wrapper:hover {\n transform: scale(1.05);\n transition: transform 0.2s ease-in-out;\n }\n\n #bell_tooltip {\n display: none;\n background-color: #2b2e3e;\n color: #fff;\n border-radius: 4px;\n padding: 4px;\n white-space: nowrap;\n pointer-events: none;\n font-size: 14px;\n line-height: 1.4;\n }\n\n #gif_modal {\n display: none;\n background-color: #ffffff;\n padding: 4px;\n width: 400px;\n height: 256px;\n border-radius: 4px;\n position: relative;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n cursor: default;\n }\n\n #gif_image {\n object-fit: contain;\n width: 100%;\n height: 100%;\n }\n\n #close_modal {\n position: absolute;\n width: 24px;\n height: 24px;\n top: 8px;\n right: 8px;\n background: rgba(238, 238, 238, 0.8);\n text-align: center;\n line-height: 20px;\n border-radius: 4px;\n color: #000000;\n font-size: 22px;\n cursor: pointer;\n }\n ");var vi=t("oldValues"),mi=t("logger"),yi=t("request"),wi=t("account"),Ci=t("wizAlertJSPath"),ki=t("fcmPublicKey"),xi=t("setUpWebPush"),Ii=t("setUpSafariNotifications"),Mi=t("setUpChromeFirefoxNotifications"),Si=t("addWizAlertJS"),Pi=t("removeWizAlertJS"),Oi=t("handleNotificationRegistration");class _i extends Array{constructor(e,t){let{logger:o,session:n,request:r,account:s}=e;super(),Object.defineProperty(this,Oi,{value:zi}),Object.defineProperty(this,Pi,{value:Ti}),Object.defineProperty(this,Si,{value:Li}),Object.defineProperty(this,Mi,{value:Di}),Object.defineProperty(this,Ii,{value:Ai}),Object.defineProperty(this,xi,{value:Ei}),Object.defineProperty(this,vi,{writable:!0,value:void 0}),Object.defineProperty(this,mi,{writable:!0,value:void 0}),Object.defineProperty(this,yi,{writable:!0,value:void 0}),Object.defineProperty(this,wi,{writable:!0,value:void 0}),Object.defineProperty(this,Ci,{writable:!0,value:void 0}),Object.defineProperty(this,ki,{writable:!0,value:void 0}),i(this,Ci)[Ci]="https://d2r1yp2w7bby2u.cloudfront.net/js/wzrk_dialog.min.js",i(this,ki)[ki]=null,i(this,vi)[vi]=t,i(this,mi)[mi]=o,i(this,yi)[yi]=r,i(this,wi)[wi]=s}push(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return i(this,xi)[xi](t),0}enable(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{swPath:t}=e;Bi(i(this,mi)[mi],i(this,wi)[wi],i(this,yi)[yi],t)}_processOldValues(){i(this,vi)[vi]&&i(this,xi)[xi](i(this,vi)[vi]),i(this,vi)[vi]=null}setUpWebPushNotifications(e,t,o,n){-1!==navigator.userAgent.indexOf("Chrome")||-1!==navigator.userAgent.indexOf("Firefox")?i(this,Mi)[Mi](e,t):-1!==navigator.userAgent.indexOf("Safari")&&i(this,Ii)[Ii](e,o,n)}setApplicationServerKey(e){i(this,ki)[ki]=e}_enableWebPush(e,t){ce.webPushEnabled=e,null!=t&&this.setApplicationServerKey(t),ce.webPushEnabled&&ce.notifApi.notifEnabledFromApi?i(this,Oi)[Oi](ce.notifApi.displayArgs):!ce.webPushEnabled&&ce.notifApi.notifEnabledFromApi&&i(this,mi)[mi].error("Ensure that web push notifications are fully enabled and integrated before requesting them")}}var Ei=function(e){ce.webPushEnabled&&e.length>0?i(this,Oi)[Oi](e):null==ce.webPushEnabled&&e.length>0?(ce.notifApi.notifEnabledFromApi=!0,ce.notifApi.displayArgs=e.slice()):!1===ce.webPushEnabled&&e.length>0&&i(this,mi)[mi].error("Make sure push notifications are fully enabled and integrated")},Ai=function(e,t,o){void 0===t&&i(this,mi)[mi].error("Ensure that APNS Web Push ID is supplied"),void 0===o&&i(this,mi)[mi].error("Ensure that APNS Web Push service path is supplied"),"safari"in window&&"pushNotification"in window.safari&&window.safari.pushNotification.requestPermission(o,t,{},(e=>{if("granted"===e.permission){const t=JSON.parse(JSON.stringify(e));t.endpoint=e.deviceToken,t.browser="Safari",le.saveToLSorCookie(N,t),i(this,yi)[yi].registerToken(t),i(this,mi)[mi].info("Safari Web Push registered. Device Token: "+e.deviceToken)}else"denied"===e.permission&&i(this,mi)[mi].info("Error subscribing to Safari web push")}))},Di=function(e,t){let o="";"serviceWorker"in navigator&&navigator.serviceWorker.register(t).then((e=>{if("undefined"!=typeof __wzrk_account_id)return new Promise((t=>setTimeout((()=>t(e)),5e3)));o=e.scope;return/^(\.?)(\/?)([^/]*).js$/.test(t)?navigator.serviceWorker.ready:-1!==navigator.userAgent.indexOf("Chrome")?new Promise((t=>setTimeout((()=>t(e)),5e3))):navigator.serviceWorker.getRegistrations()})).then((t=>{-1!==navigator.userAgent.indexOf("Firefox")&&Array.isArray(t)&&(t=t.filter((e=>e.scope===o))[0]);const n={userVisibleOnly:!0};null!=i(this,ki)[ki]&&(n.applicationServerKey=(e=>{let t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),i=window.atob(t),o=[];for(let e=0;e<i.length;e++)o.push(i.charCodeAt(e));return new Uint8Array(o)})(i(this,ki)[ki])),t.pushManager.subscribe(n).then((t=>{i(this,mi)[mi].info("Service Worker registered. Endpoint: "+t.endpoint);const 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"),le.saveToLSorCookie(N,o),i(this,yi)[yi].registerToken(o),void 0!==e&&"function"==typeof e&&e();const n=document.getElementById("bell_wrapper");n&&n.parentNode.removeChild(n)})).catch((e=>{t.pushManager.getSubscription().then((e=>{null!==e&&e.unsubscribe().then((e=>{i(this,mi)[mi].info("Unsubscription successful"),window.clevertap.notifications.push({skipDialog:!0})})).catch((e=>{i(this,mi)[mi].error("Error unsubscribing: "+e)}))})),i(this,mi)[mi].error("Error subscribing: "+e)}))})).catch((e=>{i(this,mi)[mi].error("error registering service worker: "+e)}))},Li=function(){const e=document.createElement("script");return e.setAttribute("type","text/javascript"),e.setAttribute("id","wzrk-alert-js"),e.setAttribute("src",i(this,Ci)[Ci]),document.getElementsByTagName("body")[0].appendChild(e),e},Ti=function(){const e=document.getElementById("wzrk-alert-js");e.parentNode.removeChild(e)},zi=function(e){let t,o,n,r,s,a,l,c,d,u,h,p,g,f,b;if(1===e.length){if(J(e[0])){const i=e[0];t=i.titleText,o=i.bodyText,n=i.okButtonText,r=i.rejectButtonText,s=i.okButtonColor,a=i.skipDialog,l=i.askAgainTimeInSeconds,c=i.okCallback,d=i.rejectCallback,u=i.subscriptionCallback,h=i.serviceWorkerPath,p=i.httpsPopupPath,g=i.httpsIframePath,f=i.apnsWebPushId,b=i.apnsWebPushServiceUrl}}else t=e[0],o=e[1],n=e[2],r=e[3],s=e[4],a=e[5],l=e[6];if(null==a&&(a=!1),null==h&&(h="/clevertap_sw.js"),void 0===navigator.serviceWorker)return;const v=null!=p&&null!=g;if("https:"!==window.location.protocol&&"localhost"!==document.location.hostname&&!v)return void i(this,mi)[mi].error("Make sure you are https or localhost to register for notifications");if(-1!==navigator.userAgent.indexOf("Chrome")){const e=navigator.userAgent.match(/Chrome\/(\d+)/);if(null==e||parseInt(e[1],10)<50)return}else if(-1!==navigator.userAgent.indexOf("Firefox")){const e=navigator.userAgent.match(/Firefox\/(\d+)/);if(null==e||parseInt(e[1],10)<50)return}else{if(-1===navigator.userAgent.indexOf("Safari"))return;{const e=navigator.userAgent.match(/Safari\/(\d+)/);if(null==e||parseInt(e[1],10)<50)return}}if(!v){if(!("Notification"in window)||null==Notification)return void i(this,mi)[mi].error("Notification not supported on this Device or Browser");if("granted"===Notification.permission)return void this.setUpWebPushNotifications(u,h,f,b);if("denied"===Notification.permission)return;if(a)return void this.setUpWebPushNotifications(u,h,f,b)}if(!(t&&o&&n&&r))return void i(this,mi)[mi].error("Missing input parameters; please specify title, body, ok button and cancel button text");null!=s&&s.match(/^#[a-f\d]{6}$/i)||(s="#f28046");const m=(new Date).getTime()/1e3;if(null==le.getMetaProp("notif_last_time"))le.setMetaProp("notif_last_time",m);else{if(null==l&&(l=604800),m-le.getMetaProp("notif_last_time")<l)return;le.setMetaProp("notif_last_time",m)}if(v){const e=document.createElement("iframe");e.setAttribute("style","display:none;"),e.setAttribute("src",g),document.body.appendChild(e),window.addEventListener("message",(e=>{if(null!=e.data){let a={};try{a=JSON.parse(e.data)}catch(e){return}null!=a.state&&"ct"===a.from&&"not"===a.state&&(i(this,Si)[Si]().onload=()=>{window.wzrkPermissionPopup.wizAlert({title:t,body:o,confirmButtonText:n,confirmButtonColor:s,rejectButtonText:r},(e=>{e?("function"==typeof c&&c(),window.open(p)):"function"==typeof d&&d(),i(this,Pi)[Pi]()}))})}}),!1)}else i(this,Si)[Si]().onload=()=>{window.wzrkPermissionPopup.wizAlert({title:t,body:o,confirmButtonText:n,confirmButtonColor:s,rejectButtonText:r},(e=>{e?("function"==typeof c&&c(),this.setUpWebPushNotifications(u,h,f,b)):"function"==typeof d&&d(),i(this,Pi)[Pi]()}))}};let ji=null,Ni="/clevertap_sw.js",Ri=null;const Bi=(e,t,i,o)=>{const n=le.readFromLSorCookie(H)||{};if(ce.pushConfig=n,!ce.pushConfig)return void e.error("Web Push config data not present");o&&(Ni=o),Ri=new _i({logger:e,session:{},request:i,account:t});const{showBox:r,boxType:s,showBellIcon:a,isPreview:l}=ce.pushConfig;l?(ce.pushConfig.boxConfig&&Fi(ce.pushConfig),ce.pushConfig.bellIconConfig&&Vi(ce.pushConfig)):(r&&"new"===s&&Fi(ce.pushConfig),a&&Vi(ce.pushConfig))},Ui=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=document.createElement(e);return Object.entries(t).forEach((e=>{let[t,o]=e;i[t]=o})),i},Fi=e=>{if(document.getElementById("pnWrapper"))return;const{boxConfig:{content:t,style:i}}=e,o=Ui("div",{id:"pnWrapper"}),n=Ui("div",{id:"pnOverlay"}),r=Ui("div",{id:"pnCard"}),s=Ui("div",{id:"iconTitleDescWrapper"}),a=Ui("img",{id:"iconContainer",src:"default"===t.icon.type?"data:image/svg+xml;base64,".concat("PHN2ZyB3aWR0aD0iNjQiIGhlaWdodD0iNjQiIHZpZXdCb3g9IjAgMCA2NCA2NCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjY0IiBoZWlnaHQ9IjY0IiByeD0iMzIiIGZpbGw9IiMwMEFFQjkiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zMS45OTg2IDIwQzMwLjkxOTggMjAgMzAuMDQyOCAyMC44NzQ2IDMwLjA0MjggMjEuOTUzNEwzMC4wNDI5IDIxLjk3MzRDMjYuNTQzNCAyMi41NTM1IDIzLjg3NSAyNS41OTQzIDIzLjg3NSAyOS4yNTgyVjM4LjA5OTVIMjMuODczNUMyMy4wNTg5IDM4LjA5OTUgMjIuMzk4NCAzOC43NiAyMi4zOTg0IDM5LjU3NDZDMjIuMzk4NCA0MC4zODkzIDIzLjA1ODkgNDEuMDQ5NyAyMy44NzM1IDQxLjA0OTdIMjkuNzgxMlY0MS43ODQyQzI5Ljc4MTIgNDMuMDA3NyAzMC43NzMxIDQzLjk5OTYgMzEuOTk2NiA0My45OTk2QzMzLjIyMDIgNDMuOTk5NiAzNC4yMTIgNDMuMDA3NyAzNC4yMTIgNDEuNzg0MlY0MS4wNDk3SDQwLjEyMzNDNDAuOTM4IDQxLjA0OTcgNDEuNTk4NCA0MC4zODkzIDQxLjU5ODQgMzkuNTc0NkM0MS41OTg0IDM4Ljc2IDQwLjkzOCAzOC4wOTk1IDQwLjEyMzMgMzguMDk5NUg0MC4xMjEyVjI5LjI1ODJDNDAuMTIxMiAyNS41OTQ2IDM3LjQ1MzMgMjIuNTU0MiAzMy45NTQzIDIxLjk3MzZMMzMuOTU0NCAyMS45NTM0QzMzLjk1NDQgMjAuODc0NiAzMy4wNzc1IDIwIDMxLjk5ODYgMjBaIiBmaWxsPSJ3aGl0ZSIvPgo8cmVjdCBvcGFjaXR5PSIwLjUiIHg9IjcuNSIgeT0iNy41IiB3aWR0aD0iNDkiIGhlaWdodD0iNDkiIHJ4PSIyNC41IiBzdHJva2U9IndoaXRlIi8+CjxyZWN0IG9wYWNpdHk9IjAuMyIgeD0iNC41IiB5PSI0LjUiIHdpZHRoPSI1NSIgaGVpZ2h0PSI1NSIgcng9IjI3LjUiIHN0cm9rZT0id2hpdGUiLz4KPHJlY3Qgb3BhY2l0eT0iMC44IiB4PSIxMC41IiB5PSIxMC41IiB3aWR0aD0iNDMiIGhlaWdodD0iNDMiIHJ4PSIyMS41IiBzdHJva2U9IndoaXRlIi8+Cjwvc3ZnPgo="):t.icon.url});s.appendChild(a);const l=Ui("div",{id:"titleDescWrapper"});l.appendChild(Ui("div",{id:"title",textContent:t.title})),l.appendChild(Ui("div",{id:"description",textContent:t.description})),s.appendChild(l);const c=Ui("div",{id:"buttonsContainer"}),d=Ui("button",{id:"primaryButton",textContent:t.buttons.primaryButtonText}),u=Ui("button",{id:"secondaryButton",textContent:t.buttons.secondaryButtonText});c.appendChild(u),c.appendChild(d),r.appendChild(s),r.appendChild(c);const h=Ui("style",{textContent:fi(i)});o.appendChild(h),o.appendChild(r),o.appendChild(n),Gi(r,i.card.position);const p=(new Date).getTime()/1e3,g=le.getMetaProp("webpush_last_notif_time"),f=t.popupFrequency||604800;(!g||p-g>=24*f*60*60)&&(document.body.appendChild(o),e.isPreview||Wi(o))},Vi=e=>{if(document.getElementById("bell_wrapper")||"granted"===Notification.permission)return;const{bellIconConfig:{content:t,style:i}}=e,o=Ui("div",{id:"bell_wrapper"}),n=Ui("img",{id:"bell_icon",src:"default"===t.icon.type?"data:image/svg+xml;base64,".concat("PHN2ZyB3aWR0aD0iNDgiIGhlaWdodD0iNDgiIHZpZXdCb3g9IjAgMCA0OCA0OCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMi40OTYyIDUuMjQzOTVDMTIuODM5MSA1LjAzMzE3IDEzLjI4NDcgNS4xNDY4OSAxMy40OTczIDUuNDg4NjdDMTMuNzIyMyA1Ljg1MDE4IDEzLjYwMDIgNi4zMjUxOCAxMy4yMzggNi41NDkwMkM3LjM5Mzk5IDEwLjE2MDYgMy41IDE2LjYyNTcgMy41IDI0LjAwMDNDMy41IDM1LjMyMjEgMTIuNjc4MiA0NC41MDAzIDI0IDQ0LjUwMDNDMjguMDA1NSA0NC41MDAzIDMxLjc0MjYgNDMuMzUxNSAzNC45IDQxLjM2NTVDMzUuMjYwOCA0MS4xMzg1IDM1Ljc0MTYgNDEuMjM4NiAzNS45NjY4IDQxLjYwMDZDMzYuMTc5MiA0MS45NDE5IDM2LjA4NSA0Mi4zOTExIDM1Ljc0NTIgNDIuNjA2QzMyLjM0NjggNDQuNzU1OSAyOC4zMTg3IDQ2LjAwMDMgMjQgNDYuMDAwM0MxMS44NDk3IDQ2LjAwMDMgMiAzNi4xNTA1IDIgMjQuMDAwM0MyIDE2LjA2NjkgNi4xOTkyMSA5LjExNDMyIDEyLjQ5NjIgNS4yNDM5NVpNMzguOCAzOS45MDAzQzM4LjggNDAuMzk3MyAzOC4zOTcxIDQwLjgwMDMgMzcuOSA0MC44MDAzQzM3LjQwMjkgNDAuODAwMyAzNyA0MC4zOTczIDM3IDM5LjkwMDNDMzcgMzkuNDAzMiAzNy40MDI5IDM5LjAwMDMgMzcuOSAzOS4wMDAzQzM4LjM5NzEgMzkuMDAwMyAzOC44IDM5LjQwMzIgMzguOCAzOS45MDAzWiIgZmlsbD0id2hpdGUiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0yNCAxMkMyMi44OTU0IDEyIDIyIDEyLjg5NTQgMjIgMTRWMTQuMjUyQzE4LjU0OTUgMTUuMTQwMSAxNiAxOC4yNzIzIDE2IDIyVjI5LjVIMTUuNDc2OUMxNC42NjEyIDI5LjUgMTQgMzAuMTYxMiAxNCAzMC45NzY5VjMxLjAyMzFDMTQgMzEuODM4OCAxNC42NjEyIDMyLjUgMTUuNDc2OSAzMi41SDMyLjUyMzFDMzMuMzM4OCAzMi41IDM0IDMxLjgzODggMzQgMzEuMDIzMVYzMC45NzY5QzM0IDMwLjE2MTIgMzMuMzM4OCAyOS41IDMyLjUyMzEgMjkuNUgzMlYyMkMzMiAxOC4yNzIzIDI5LjQ1MDUgMTUuMTQwMSAyNiAxNC4yNTJWMTRDMjYgMTIuODk1NCAyNS4xMDQ2IDEyIDI0IDEyWk0yNiAzNFYzMy41SDIyVjM0QzIyIDM1LjEwNDYgMjIuODk1NCAzNiAyNCAzNkMyNS4xMDQ2IDM2IDI2IDM1LjEwNDYgMjYgMzRaIiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K"):t.icon.url}),r=Ui("div",{id:"gif_modal",style:"display: none;"}),s=Ui("img",{id:"gif_image",src:"https://d2r1yp2w7bby2u.cloudfront.net/js/permission_grant.gif"}),a=Ui("div",{id:"close_modal",innerHTML:"×"});if(r.appendChild(s),r.appendChild(a),o.appendChild(n),o.appendChild(r),t.hoverText.enabled){const e=Ui("div",{id:"bell_tooltip",textContent:t.hoverText.text});o.appendChild(e)}Gi(o,i.card.position);const l=Ui("style",{textContent:bi(i)});return document.head.appendChild(l),document.body.appendChild(o),e.isPreview||qi(o),o},Wi=e=>{const t=e.querySelector("#primaryButton"),i=e.querySelector("#secondaryButton"),o=()=>{var t;return null===(t=e.parentNode)||void 0===t?void 0:t.removeChild(e)};t.addEventListener("click",(()=>{o(),Ri.setApplicationServerKey(ji),Ri.setUpWebPushNotifications(null,Ni,null,null)})),i.addEventListener("click",(()=>{le.setMetaProp("webpush_last_notif_time",Date.now()/1e3),o()}))},qi=e=>{const t=e.querySelector("#bell_icon");t.addEventListener("click",(()=>{"denied"===Notification.permission?Zi(e):(Ri.setApplicationServerKey(ji),Ri.setUpWebPushNotifications(null,Ni,null,null),"granted"===Notification.permission&&e.remove())})),t.addEventListener("mouseenter",(()=>Hi(e))),t.addEventListener("mouseleave",(()=>Ki(e))),e.querySelector("#close_modal").addEventListener("click",(()=>Zi(e)))},Gi=(e,t)=>{Object.assign(e.style,{inset:"auto",transform:"none"});const i={"Top Right":{inset:"16px 16px auto auto"},"Top Left":{inset:"16px auto auto 16px"},"Bottom Right":{inset:"auto 16px 16px auto"},"Bottom Left":{inset:"auto auto 16px 16px"},Center:{inset:"50%",transform:"translate(-50%, -50%)"},Top:{inset:"16px auto auto 50%",transform:"translateX(-50%)"},Bottom:{inset:"auto auto 16px 50%",transform:"translateX(-50%)"}};Object.assign(e.style,i[t]||i["top-right"])},Hi=e=>{if("flex"===e.querySelector("#gif_modal").style.display)return;const t=e.querySelector("#bell_tooltip");t&&(t.style.display="flex");const i=e.querySelector("#bell_icon").getBoundingClientRect();var o=window.innerWidth/2,n=window.innerHeight/2;e.style["flex-direction"]=i.y>n?"column-reverse":"column",e.style["align-items"]=i.x>o?"flex-end":"flex-start"},Ki=e=>{const t=e.querySelector("#bell_tooltip");t&&(t.style.display="none")},Zi=e=>{Ki(e);const t=e.querySelector("#gif_modal");t.style.display="none"===t.style.display?"flex":"none"},Ji=(e,t)=>{let{device:i,session:o,request:n,logger:r}=t;const s=i,a=o,l=n,c=r;let d=0;const u=t=>{const i=t.wzrk_id.split("_")[0],o=oe(),n=(e,t,i)=>{let o=0,n=0;null!=e[t]&&(o=e[t]),o++,null!=e.tc&&(n=e.tc),i<0&&n++,e.tc=n,e[t]=o};if(le._isLocalStorageSupported()){delete sessionStorage.WZRK_CAMP;var r={};const e=et();r=3===t.display.wtarget_type&&e.hasOwnProperty("wi")?e.wi:0!==t.display.wtarget_type&&1!==t.display.wtarget_type||!e.hasOwnProperty("wp")?{}:e.wp,e.hasOwnProperty("global")&&(r.wp=e),null==t.display.wmc&&(t.display.wmc=1),null==t.display.wimc&&(t.display.wimc=1);var d=-1;let n=-1,s=-1,l=-1,c=-1,g=-1,f=-1;null!=t.display.efc&&(d=parseInt(t.display.efc,10)),null!=t.display.mdc&&(n=parseInt(t.display.mdc,10)),null!=t.display.tdc&&(s=parseInt(t.display.tdc,10)),null!=t.display.tlc&&(l=parseInt(t.display.tlc,10)),null!=t.display.wmp&&(c=parseInt(t.display.wmp,10)),null!=t.display.wmc&&(g=parseInt(t.display.wmc,10)),null!=t.display.wimc&&(f=parseInt(t.display.wimc,10));var u=r[a.sessionId];if(u){const e=u[i],o=u.tc;if("dnd"===e&&!ce.dismissSpamControl)return!1;if(3===t.display.wtarget_type){if(f>0&&o>=f&&d<0)return!1}else if(g>0&&o>=g&&d<0)return!1;if(n>0&&e>=n)return!1}else u={},r[a.sessionId]=u;var h=r[o];if(null!=h){const e=h[i],t=h.tc;if(c>0&&t>=c&&d<0)return!1;if(s>0&&e>=s)return!1}else h={},r[o]=h;var p=r.global;if(null!=p){const e=p[i];if(l>0&&e>=l)return!1}else p={},r.global=p}const g=t.display;if(null!=g.delay&&g.delay>0){const t=g.delay;return g.delay=0,setTimeout(Ji,1e3*t,e,{device:s,session:a,request:l,logger:c}),!1}n(u,i,d),n(h,i,d),n(p,i,d);let f="wp";3===t.display.wtarget_type&&(f="wi");const b={};b[a.sessionId]=u,b[o]=h,b.global=p,tt({[f]:b})},h=(e,t,i,o,n)=>{pi(t,l),((e,t,i,o,n,r,s)=>{if(""!==e&&null!=e){let o,a;n?o=i:null!==i&&(a=i.getElementsByClassName("jsCT_CTA"),null!=a&&1===a.length&&(o=a[0]));const l=t.display.jsFunc,c=t.display.preview;null==c&&(e+=gi(r,s)),null!=o&&(o.onclick=()=>{if(null!=l)null==c&&Xe.fireRequest(e),di(l,t),lt("-1",0,s.sessionId);else{const i=t.display.preview?t.display.onClick:new URL(t.display.onClick).searchParams.get("r"),o=t.wzrk_id.split("_")[0];"pushPrompt"===i?(t.display.preview||window.parent.clevertap.renderNotificationClicked({msgId:t.wzrk_id,pivotId:t.wzrk_pivot}),window.clevertap.notifications.push({skipDialog:!0}),lt(o,0,s.sessionId)):"none"===i?lt(o,0,s.sessionId):1===t.display.window?(window.open(e,"_blank"),t.display["close-popup"]&<(o,0,s.sessionId),t.display.preview||window.parent.clevertap.renderNotificationClicked({msgId:t.wzrk_id,pivotId:t.wzrk_pivot})):window.location=e}})}})(e,t,i,0,n,s,a)},p=e=>{const t="wzrkImageOnlyDiv";if(!1===u(e))return;if(ce.dismissSpamControl&&null!=document.getElementById(t)){document.getElementById(t).remove()}if(null!=document.getElementById(t)||null!=document.getElementById("intentPreview"))return;const i=document.createElement("div");return i.id=t,document.body.appendChild(i),void 0===customElements.get("ct-web-popup-imageonly")&&customElements.define("ct-web-popup-imageonly",Dt),((e,t)=>{const i=document.createElement("ct-web-popup-imageonly");i.session=t,i.target=e;const o=document.getElementById("wzrkImageOnlyDiv");o.innerHTML="",o.style.visibility="hidden",o.appendChild(i)})(e,a)},g=e=>{const t=document.getElementById("wiz-iframe-intent")||document.getElementById("wiz-iframe");if(t){return(t.contentDocument||t.contentWindow.document).documentElement.innerHTML.includes(e)}return!1},f=(e,t)=>{const i=e.wzrk_id.split("_")[0],o=e.display;if(1===o.layout)return x(void 0,e);if(3===o.layout)return void p(e);if(!1===u(e))return;const n="wizParDiv"+o.layout,r="intentOpacityDiv"+o.layout;if(ce.dismissSpamControl&&null!=document.getElementById(n)){const e=document.getElementById(n),t=document.getElementById(r);e&&e.remove(),t&&t.remove()}if(g(i))return;if(null!=document.getElementById(n))return;ce.campaignDivMap[i]=n;const s=2===o.layout;if(t){const t=document.createElement("div");t.id=r;const i=e.display.opacity||.7,o="rgba(0,0,0,".concat(i,")");t.setAttribute("style","position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ".concat(o,";")),document.body.appendChild(t)}const a=document.createElement("div");a.id=n;const l=window.innerHeight,c=window.innerWidth;let d=!1;if(s)a.setAttribute("style",o.iFrameStyle);else{var f=10;let e=5*c/100,t=f+5*l/100,i=30*c/100+20,n="width:30%;";(/mobile/i.test(navigator.userAgent)||/mini/i.test(navigator.userAgent))&&!1===/iPad/i.test(navigator.userAgent)?(i=85*c/100+20,e=5*c/100,t=5*l/100,n="width:80%;"):("ontouchstart"in window||/tablet/i.test(navigator.userAgent))&&(i=50*c/100+20,e=5*c/100,t=5*l/100,n="width:50%;"),null==o.proto?(d=!0,a.setAttribute("style","display:block;overflow:hidden; bottom:"+t+"px !important;width:"+i+"px !important;right:"+e+"px !important;position:fixed;z-index:2147483647;")):a.setAttribute("style",n+o.iFrameStyle)}document.body.appendChild(a);const b=document.createElement("iframe"),v=!1===o.br?"0":"8";b.frameborder="0px",b.marginheight="0px",b.marginwidth="0px",b.scrolling="no",b.id="wiz-iframe";const m=e.display.onClick;let y,w="";if(""!==m&&null!=m&&(w="cursor:pointer;"),o.preview&&o["custom-editor"]&&(b.sandbox="allow-scripts allow-popups allow-popups-to-escape-sandbox"),1===e.msgContent.type)y=e.msgContent.html,y=y.replace(/##campaignId##/g,i),y=y.replace(/##campaignId_batchId##/g,e.wzrk_id);else{const t='<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: "+v+"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>";let o,r,s,a,l;"dark"===e.display.theme?(o="#2d2d2e",r="#eaeaea",s="#353535",a="#353535",l="#ffffff"):(o="#ffffff",r="#000000",a="#f4f4f4",s="#a5a6a6",l="#ffffff");const c=e.msgContent.title,d=e.msgContent.description;let u="";null!=e.msgContent.imageUrl&&""!==e.msgContent.imageUrl&&(u="<td class='imgTd' style='background-color:"+a+"'><img src='"+e.msgContent.imageUrl+"' height='60' width='60'></td>");y=t+("<div class='wzrkPPwarp' style='color:"+r+";background-color:"+o+";'><a href='javascript:void(0);' onclick="+("parent.$WZRK_WR.closeIframe("+i+",'"+n+"');")+" class='wzrkClose' style='background-color:"+s+";color:"+l+"'>×</a><div id='contentDiv' class='wzrk'><table cellpadding='0' cellspacing='0' border='0'><tr>"+u+"<td style='vertical-align:top;'><div class='wzrkPPtitle' style='color:"+r+"'>"+c+"</div>")+("<div class='wzrkPPdscr' style='color:"+r+"'>"+d+"<div></td></tr></table></div>")}b.setAttribute("style","z-index: 2147483647; display:block; width: 100% !important; border:0px !important; border-color:none !important;"),a.appendChild(b);const C=new Event("CT_campaign_rendered");document.dispatchEvent(C),o["custom-editor"]&&(y=ui(e,y)),b.srcdoc=y;const k=()=>{f=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv").scrollHeight,!0===o["custom-editor"]||s||(f+=25),document.getElementById("wiz-iframe").contentDocument.body.style.margin="0px",document.getElementById("wiz-iframe").style.height=f+"px"},I=navigator.userAgent.toLowerCase();if(-1!==I.indexOf("safari"))if(I.indexOf("chrome")>-1)b.onload=()=>{k();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");h(m,e,t,0,d)};else{let t=b.contentDocument||b.contentWindow;t.document&&(t=t.document);const i=setInterval((()=>{if("complete"===t.readyState){clearInterval(i),k();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");h(m,e,t,0,d)}}),300)}else b.onload=()=>{k();const t=document.getElementById("wiz-iframe").contentDocument.getElementById("contentDiv");h(m,e,t,0,d)}},b=e=>{f(e,!1)};let v=!1;const m=e=>{let t=e.display.onClick;const i=e.display;if(window.clevertap.hasOwnProperty("notificationCallback")&&void 0!==window.clevertap.notificationCallback&&"function"==typeof window.clevertap.notificationCallback){const i=window.clevertap.notificationCallback;if(!v){const o={};o.msgContent=e.msgContent,o.msgId=e.wzrk_id,e.wzrk_pivot&&(o.pivotId=e.wzrk_pivot),null!=e.display.kv&&(o.kv=e.display.kv),window.clevertap.raiseNotificationClicked=()=>{if(""!==t&&null!=t){const i=e.display.jsFunc;if(t+=gi(s,a),null!=i)return Xe.fireRequest(t),void di(i,e);1===e.display.window?window.open(t,"_blank"):window.location=t}},window.clevertap.raiseNotificationViewed=()=>{pi(e)},i(o),v=!0}}else{if(window.clevertap.popupCurrentWzrkId=e.wzrk_id,i.deliveryTrigger){i.deliveryTrigger.inactive&&y(e),i.deliveryTrigger.scroll&&w(e),i.deliveryTrigger.isExitIntent&&(k=e,window.document.body.onmouseleave=x);const t=i.delay||i.deliveryTrigger.deliveryDelayed;null!=t&&t>0&&setTimeout((()=>{b(e)}),1e3*t)}else b(e);if(window.clevertap.hasOwnProperty("popupCallbacks")&&void 0!==window.clevertap.popupCallbacks&&"function"==typeof window.clevertap.popupCallbacks[e.wzrk_id]){const t=window.clevertap.popupCallbacks[e.wzrk_id],i={};i.msgContent=e.msgContent,i.msgId=e.wzrk_id,e.wzrk_pivot&&(i.pivotId=e.wzrk_pivot);var o=[];for(var n in e)if(n.startsWith(D)&&n!==L){const t={[n]:e[n]};o.push(t)}o.length>0&&(i.msgCTkv=o),null!=e.display.kv&&(i.kv=e.display.kv),window.clevertap.raisePopupNotificationClicked=t=>{if(!t||!t.msgId)return;const i={type:"event"};if(i.evtName=z,i.evtData={[L]:t.msgId},e.wzrk_pivot&&(i.evtData={...i.evtData,wzrk_pivot:t.pivotId}),t.msgCTkv)for(var o of t.msgCTkv)i.evtData={...i.evtData,...o};l.processEvent(i)},t(i)}}},y=e=>{const t=1e3*e.display.deliveryTrigger.inactive;let i;const o=["mousemove","keypress","scroll","mousedown","touchmove","click"],n=()=>{clearTimeout(i),i=setTimeout((()=>{b(e),s()}),t)},r=()=>{n()},s=()=>{o.forEach((e=>window.removeEventListener(e,r)))};return o.forEach((e=>window.addEventListener(e,r,{passive:!0}))),n(),s},w=e=>{const t=((e,t)=>{let i=!1;return function(){const o=this;if(!i){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];e.apply(o,r),i=!0,setTimeout((()=>{i=!1}),t)}}})((()=>{(()=>{const{scrollHeight:e,clientHeight:t,scrollTop:i}=document.documentElement;return i/(e-t)*100})()>=e.display.deliveryTrigger.scroll&&(b(e),window.removeEventListener("scroll",t))}),200);return window.addEventListener("scroll",t,{passive:!0}),()=>window.removeEventListener("scroll",t)};let k;const x=(e,t)=>{if((null==e?void 0:e.clientY)>0)return;const i=t||k,o=i.wzrk_id.split("_")[0],n=i.display.layout;if(g(o))return;if(0===i.display.wtarget_type&&(0===n||2===n||3===n))return void f(i,!0);if(!1===u(i))return;if(ce.dismissSpamControl&&0===i.display.wtarget_type){const e=document.getElementById("intentPreview"),t=document.getElementById("intentOpacityDiv");e&&t&&(e.remove(),t.remove())}if(null!=document.getElementById("intentPreview")||null!=document.getElementById("wzrkImageOnlyDiv"))return;if(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)))return;ce.campaignDivMap[o]="intentPreview";let r=!1;const s=document.createElement("div");s.id="intentOpacityDiv";const a=i.display.opacity||.7,l="rgba(0,0,0,".concat(a,")");s.setAttribute("style","position: fixed;top: 0;bottom: 0;left: 0;width: 100%;height: 100%;z-index: 2147483646;background: ".concat(l,";")),document.body.appendChild(s);const c=document.createElement("div");c.id="intentPreview",null==i.display.proto?(r=!0,c.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;")):c.setAttribute("style",i.display.iFrameStyle),document.body.appendChild(c);const d=document.createElement("iframe"),p=!1===i.display.br?"0":"8";d.frameborder="0px",d.marginheight="0px",d.marginwidth="0px",d.scrolling="no",d.id="wiz-iframe-intent";const b=i.display.onClick;let v,m="";if(""!==b&&null!=b&&(m="cursor:pointer;"),i.display.preview&&i.display["custom-editor"]&&(d.sandbox="allow-scripts allow-popups allow-popups-to-escape-sandbox"),1===i.msgContent.type)v=i.msgContent.html,v=v.replace(/##campaignId##/g,o),v=v.replace(/##campaignId_batchId##/g,i.wzrk_id);else{const e='<style type="text/css">body{margin:0;padding:0;}#contentDiv.wzrk{overflow:hidden;padding:0 0 20px 0;text-align:center;'+m+"}#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: "+p+"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>";let t,n,r,s;"dark"===i.display.theme?(t="#2d2d2e",n="#eaeaea",r="#353535",s="#ffffff"):(t="#ffffff",n="#000000",r="#a5a6a6",s="#ffffff");const a=i.msgContent.title,l=i.msgContent.description;let c="";null!=i.msgContent.ctaText&&""!==i.msgContent.ctaText&&(c="<div class='button'><a href='#'>"+i.msgContent.ctaText+"</a></div>");let d="";null!=i.msgContent.imageUrl&&""!==i.msgContent.imageUrl&&(d="<div style='padding-top:20px;'><img src='"+i.msgContent.imageUrl+"' width='500' alt="+a+" /></div>");v=e+("<div class='wzrkPPwarp' style='color:"+n+";background-color:"+t+";'><a href='javascript:void(0);' onclick="+("parent.$WZRK_WR.closeIframe("+o+",'intentPreview');")+" class='wzrkClose' style='background-color:"+r+";color:"+s+"'>×</a><div id='contentDiv' class='wzrk'><div class='wzrkPPtitle' style='color:"+n+"'>"+a+"</div>")+("<div class='wzrkPPdscr' style='color:"+n+"'>"+l+"</div>"+d+c+"</div></div>")}d.setAttribute("style","color-scheme: none; z-index: 2147483647; display:block; height: 100% !important; width: 100% !important;min-height:80px !important;border:0px !important; border-color:none !important;"),c.appendChild(d);const y=new Event("CT_campaign_rendered");document.dispatchEvent(y),i.display["custom-editor"]&&(v=ui(i,v)),d.srcdoc=v,d.onload=()=>{const e=document.getElementById("wiz-iframe-intent").contentDocument.getElementById("contentDiv");h(b,i,e,0,r)}};if(!document.body)return void(d<6&&(d++,setTimeout(Ji,1e3,e,{device:s,session:a,request:l,logger:c})));const M=e=>{Object.keys(e).map((t=>{var i,o;e[t].display.divId?(i=e[t].display.divId,o=document.getElementById(i)):(i=e[t].display.divSelector,o=document.querySelector(i)),null!==o&&(2===e[t].msgContent.type?ai(e[t]):li(e[t]),delete e[t])}))};if(null!=e.inapp_notifs){const t={};for(let i=0;i<e.inapp_notifs.length;i++){const o=e.inapp_notifs[i];if(null==o.display.wtarget_type||0===o.display.wtarget_type)m(o);else if(1===o.display.wtarget_type)k=o,window.document.body.onmouseleave=x;else if(2===o.display.wtarget_type)if(1===o.msgContent.type)ci(o);else if(2===o.msgContent.type||3===o.msgContent.type){null!==(o.display.divId?document.getElementById(o.display.divId):document.querySelector(o.display.divSelector))?2===o.msgContent.type?ai(o):li(o):t[o.wzrk_id.split("_")[0]]=o}else 4===o.msgContent.type?oi(o,!1):m(o)}Object.keys(t).length&&("complete"===document.readyState?M(t):(e=>{window.addEventListener("load",(()=>{let t=0;if(t<20){const i=setInterval((()=>{M(e),0!==Object.keys(e).length&&20!==t||(clearInterval(i),e={}),t++}),500)}}))})(t))}const S=()=>{if(e.inbox_preview)zt(e);else if(e.inbox_notifs){const t=[];for(let i=0;i<e.inbox_notifs.length;i++)!1!==u(e.inbox_notifs[i])&&t.push(e.inbox_notifs[i]);zt(t)}};if((e.webInboxSetting||null!=e.inbox_notifs)&&(qt()&&Ft(),null===ce.inbox?(e.webInboxSetting&&function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=le.readFromLSorCookie(V)||{};t?(ce.inbox.inboxConfigForPreview=e,ce.inbox.isPreview=!0,ce.inbox&&ce.inbox.init()):JSON.stringify(i)!==JSON.stringify(e)&&(le.saveToLSorCookie(V,e),ce.inbox&&ce.inbox.init())}(e.webInboxSetting),Ut(c).then((()=>{S()})).catch((e=>{}))):S()),e.webPushConfig&&((e,t,i)=>{const o=le.readFromLSorCookie(H)||{},n=()=>{ce.pushConfig=e,le.saveToLSorCookie(H,e)};e.isPreview?(n(),Bi(t,null,i)):JSON.stringify(o)!==JSON.stringify(e)&&n()})(e.webPushConfig,r,n),e.vars)ce.variableStore.mergeVariables(e.vars);else if(le._isLocalStorageSupported())try{if(null!=e.evpr){const t=e.evpr.events,i=e.evpr.profile,o=e.evpr.expires_in,n=ne();le.setMetaProp("lsTime",n),le.setMetaProp("exTs",o),(e=>{if(null!=ce.globalEventsMap||(ce.globalEventsMap=le.readFromLSorCookie(C),null!=ce.globalEventsMap)){for(const t in e)if(e.hasOwnProperty(t)){const i=ce.globalEventsMap[t],o=e[t];null!=ce.globalEventsMap[t]?null!=o[0]&&o[0]>i[0]&&(ce.globalEventsMap[t]=o):ce.globalEventsMap[t]=o}}else ce.globalEventsMap=e})(t),le.saveToLSorCookie(C,ce.globalEventsMap),null==ce.globalProfileMap?at(i,!0):at(i,!1)}null!=e.arp&&(e=>{if(null!=e.skipResARP&&e.skipResARP)return console.debug("Update ARP Request rejected",e),null;const t=!0===e.isOUL;if(le._isLocalStorageSupported())try{let i=le.readFromLSorCookie(I);if(null==i||t){i={};for(const t in e)e.hasOwnProperty(t)&&(-1===e[t]?delete i[t]:i[t]=e[t]);le.saveToLSorCookie(I,i)}}catch(e){console.error("Unable to parse ARP JSON: "+e)}})(e.arp),null!=e.inapp_stale&&e.inapp_stale.length>0&&hi(e.inapp_stale,"wp"),null!=e.inbox_stale&&e.inbox_stale.length>0&&hi(e.inbox_stale,"wi")}catch(e){c.error("Unable to persist evrp/arp: "+e)}};var Qi=t("isPersonalisationActive");class Yi{constructor(e){let{isPersonalisationActive:t}=e;Object.defineProperty(this,Qi,{writable:!0,value:void 0}),i(this,Qi)[Qi]=t}getTotalVisits(){if(!i(this,Qi)[Qi]())return;let e=le.getMetaProp("sc");return null==e&&(e=1),e}getLastVisit(){if(!i(this,Qi)[Qi]())return;const e=le.getMetaProp("ps");return null!=e?new Date(1e3*e):void 0}}const $i=1,Xi=2,eo=3,to=4;var io=t("logLevel"),oo=t("log"),no=t("isLegacyDebug");class ro{constructor(e){Object.defineProperty(this,no,{get:ao,set:void 0}),Object.defineProperty(this,oo,{value:so}),Object.defineProperty(this,io,{writable:!0,value:void 0}),this.wzrkError={},i(this,io)[io]=null==e?e:Xi,this.wzrkError={}}get logLevel(){return i(this,io)[io]}set logLevel(e){i(this,io)[io]=e}error(e){i(this,io)[io]>=$i&&i(this,oo)[oo]("error",e)}info(e){i(this,io)[io]>=Xi&&i(this,oo)[oo]("log",e)}debug(e){(i(this,io)[io]>=eo||i(this,no)[no])&&i(this,oo)[oo]("debug",e)}debugPE(e){i(this,io)[io]>=to&&i(this,oo)[oo]("debug_pe",e)}reportError(e,t){this.wzrkError.c=e,this.wzrkError.d=t,this.error("".concat(ke," ").concat(e,": ").concat(t))}}var so=function(e,t){if(window.console)try{const i=(new Date).getTime();console[e]("CleverTap [".concat(i,"]: ").concat(t))}catch(e){}},ao=function(){return"undefined"!=typeof sessionStorage&&""===sessionStorage.WZRK_D},lo=t("logger"),co=t("sessionId"),uo=t("isPersonalisationActive");class ho{constructor(e){let{logger:t,isPersonalisationActive:o}=e;Object.defineProperty(this,lo,{writable:!0,value:void 0}),Object.defineProperty(this,co,{writable:!0,value:void 0}),Object.defineProperty(this,uo,{writable:!0,value:void 0}),this.cookieName=void 0,this.scookieObj=void 0,this.sessionId=le.getMetaProp("cs"),i(this,lo)[lo]=t,i(this,uo)[uo]=o}get sessionId(){return i(this,co)[co]}set sessionId(e){i(this,co)[co]=e}getSessionCookieObject(){let e=le.readCookie(this.cookieName),t={};if(null!=e)if(e=e.replace(p,'"'),t=JSON.parse(e),J(t)){if(void 0!==t.t){const e=t.t;ne()-e>1260&&(t={})}}else t={};return this.scookieObj=t,t}setSessionCookieObject(e){const t=JSON.stringify(e);le.createBroadCookie(this.cookieName,t,1200,Ge())}manageSession(e){if(void 0===this.sessionId||this.sessionId!==e){const t=le.getMetaProp("cs");if(void 0===t)le.setMetaProp("ps",e),le.setMetaProp("cs",e),le.setMetaProp("sc",1);else if(t!==e){le.setMetaProp("ps",t),le.setMetaProp("cs",e);let i=le.getMetaProp("sc");void 0===i&&(i=0),le.setMetaProp("sc",i+1)}this.sessionId=e}}getTimeElapsed(){if(!i(this,uo)[uo]())return;null!=this.scookieObj&&(this.scookieObj=this.getSessionCookieObject());const e=this.scookieObj.s;if(null!=e){const t=ne();return Math.floor(t-e)}}getPageCount(){if(i(this,uo)[uo]())return null!=this.scookieObj&&(this.scookieObj=this.getSessionCookieObject()),this.scookieObj.p}}let po=0,go=0;var fo=t("logger"),bo=t("account"),vo=t("device"),mo=t("session"),yo=t("isPersonalisationActive"),wo=t("clearCookie"),Co=t("addToLocalEventMap");class ko{constructor(e){let{logger:t,account:o,device:n,session:r,isPersonalisationActive:s}=e;Object.defineProperty(this,Co,{value:xo}),Object.defineProperty(this,fo,{writable:!0,value:void 0}),Object.defineProperty(this,bo,{writable:!0,value:void 0}),Object.defineProperty(this,vo,{writable:!0,value:void 0}),Object.defineProperty(this,mo,{writable:!0,value:void 0}),Object.defineProperty(this,yo,{writable:!0,value:void 0}),Object.defineProperty(this,wo,{writable:!0,value:!1}),this.processingBackup=!1,i(this,fo)[fo]=t,i(this,bo)[bo]=o,i(this,vo)[vo]=n,i(this,mo)[mo]=r,i(this,yo)[yo]=s,Xe.logger=t,Xe.device=n,Xe.account=o}processBackupEvents(){const e=le.readFromLSorCookie(M);if(null!=e){this.processingBackup=!0;for(const t in e)if(e.hasOwnProperty(t)){const o=e[t];void 0===o.fired&&(i(this,fo)[fo].debug("Processing backup event : "+o.q),void 0!==o.q&&Xe.fireRequest(o.q),o.fired=!0)}le.saveToLSorCookie(M,e),this.processingBackup=!1}}addSystemDataToObject(e,t){void 0===t&&(e=te(e,i(this,fo)[fo])),Y(i(this,fo)[fo].wzrkError)||(e.wzrk_error=i(this,fo)[fo].wzrkError,i(this,fo)[fo].wzrkError={}),e.id=i(this,bo)[bo].id,ee(i(this,vo)[vo].gcookie)&&(e.g=i(this,vo)[vo].gcookie);const o=i(this,mo)[mo].getSessionCookieObject();e.s=o.s,e.pg=void 0===o.p?1:o.p;let n=document.location.protocol;return n=n.replace(":",""),e.af={...e.af,lib:"web-sdk-v1.11.12",protocol:n,...ce.flutterVersion},sessionStorage.hasOwnProperty("WZRK_D")&&(e.debug=!0),e}addFlags(e){if(i(this,wo)[wo]=le.getAndClearMetaProp(g),void 0!==i(this,wo)[wo]&&i(this,wo)[wo]&&(e.rc=!0,i(this,fo)[fo].debug("reset cookie sent in request and cleared from meta for future requests.")),i(this,yo)[yo]()){const t=le.getMetaProp("lsTime"),i=le.getMetaProp("exTs");if(void 0===t||void 0===i)return void(e.dsync=!0);t+i<ne()&&(e.dsync=!0)}}saveAndFireRequest(e,t,o,n){const r=ne(),s=(e=qe(e,"rn",++ce.globalCache.REQ_N))+"&i="+r+"&sn="+po;le.backupEvent(s,ce.globalCache.REQ_N,i(this,fo)[fo]),ce.offline||(t&&(void 0===i(this,wo)[wo]||!i(this,wo)[wo])||window.isOULInProgress?i(this,fo)[fo].debug("Not fired due to override - ".concat(ce.blockRequest," or clearCookie - ").concat(i(this,wo)[wo]," or OUL request in progress - ").concat(window.isOULInProgress)):(r===go?po++:(go=r,po=0),window.oulReqN=ce.globalCache.REQ_N,Xe.fireRequest(s,!1,o,n)))}unregisterTokenForGuid(e){const t=le.readFromLSorCookie(N);if(t){const t={type:"data"};ee(e)&&(t.g=e),t.action="unregister",t.id=i(this,bo)[bo].id;const o=i(this,mo)[mo].getSessionCookieObject();t.s=o.s;const n=He(JSON.stringify(t),i(this,fo)[fo]);let r=i(this,bo)[bo].dataPostURL;r=qe(r,"type","data"),r=qe(r,"d",n),Xe.fireRequest(r,!0),le.saveToLSorCookie(j,!1)}this.registerToken(t)}registerToken(e){if(!e)return;e=this.addSystemDataToObject(e,!0),e=JSON.stringify(e);let t=i(this,bo)[bo].dataPostURL;t=qe(t,"type","data"),t=qe(t,"d",He(e,i(this,fo)[fo])),Xe.fireRequest(t),le.save("WZRK_WPR","ok")}processEvent(e){i(this,Co)[Co](e.evtName),e=this.addSystemDataToObject(e,void 0),this.addFlags(e),e.WZRK_CAMP=ot();const t=He(JSON.stringify(e),i(this,fo)[fo]);let o=i(this,bo)[bo].dataPostURL;o=qe(o,"type",E),o=qe(o,"d",t),this.saveAndFireRequest(o,ce.blockRequest,!1,e.evtName)}post(e,t){return fetch(e,{method:"post",headers:{"Content-Type":"application/json"},body:t}).then((e=>{if(e.ok)return e.json();throw e})).then((e=>(i(this,fo)[fo].debug("Sync data successful",e),e))).catch((e=>{throw i(this,fo)[fo].debug("Error in syncing variables",e),e}))}}var xo=function(e){if(le._isLocalStorageSupported()){void 0===ce.globalEventsMap&&(ce.globalEventsMap=le.readFromLSorCookie(C),void 0===ce.globalEventsMap&&(ce.globalEventsMap={}));const t=ne();let i=ce.globalEventsMap[e];void 0!==i?(i[2]=t,i[0]++):(i=[],i.push(1),i.push(t),i.push(t)),ce.globalEventsMap[e]=i,le.saveToLSorCookie(C,ce.globalEventsMap)}},Io=t("request"),Mo=t("account"),So=t("oldValues"),Po=t("logger"),Oo=t("processPrivacyArray");class _o extends Array{constructor(e,t){let{request:o,account:n,logger:r}=e;super(),Object.defineProperty(this,Oo,{value:Eo}),Object.defineProperty(this,Io,{writable:!0,value:void 0}),Object.defineProperty(this,Mo,{writable:!0,value:void 0}),Object.defineProperty(this,So,{writable:!0,value:void 0}),Object.defineProperty(this,Po,{writable:!0,value:void 0}),i(this,Po)[Po]=r,i(this,Io)[Io]=o,i(this,Mo)[Mo]=n,i(this,So)[So]=t}push(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return ce.isPrivacyArrPushed?i(this,Oo)[Oo](ce.privacyArray.length>0?ce.privacyArray:t):ce.privacyArray.push(...t),0}_processOldValues(){i(this,So)[So]&&i(this,Oo)[Oo](i(this,So)[So]),i(this,So)[So]=null}}var Eo=function(e){if(Array.isArray(e)&&e.length>0){const o=e.reduce(((e,t)=>({...e,...t})),{});let n={};const r={};var t=!1;if(o.hasOwnProperty(P)&&"boolean"==typeof(t=o.optOut)&&(r.ct_optout=t,ce.isOptInRequest=!t),o.hasOwnProperty(O)){const e=o.useIP,t="boolean"==typeof e&&e;le.setMetaProp(O,t)}if(!Y(r)){n.type="profile",n.profile=r,n=i(this,Io)[Io].addSystemDataToObject(n,void 0);const o=He(JSON.stringify(n),i(this,Po)[Po]);let s=i(this,Mo)[Mo].dataPostURL;s=qe(s,"type",E),s=qe(s,"d",o),s=qe(s,P,t?"true":"false"),i(this,Io)[Io].saveAndFireRequest(s,ce.blockRequest),e.splice(0,e.length)}}},Ao=t("variableStore");class Do{constructor(e){let{variableStore:t}=e;Object.defineProperty(this,Ao,{writable:!0,value:void 0}),this.name=null,this.defaultValue=null,this.value=null,this.type=null,this.hadStarted=!1,this.valueChangedCallbacks=[],i(this,Ao)[Ao]=t}getValue(){return this.value}getdefaultValue(){return this.defaultValue}static define(e,t,i){if(!e||"string"!=typeof e)return console.error("Empty or invalid name parameter provided."),null;if(e.startsWith(".")||e.endsWith("."))return console.error("Variable name starts or ends with a `.` which is not allowed: "+e),null;const o=typeof t;if("string"!==o&&"number"!==o&&"boolean"!==o)return console.error("Only primitive types (string, number, boolean) are accepted as value"),null;const n=i.getVariable(e);if(n)return n;const r=new Do({variableStore:i});try{r.name=e,r.defaultValue=t,r.value=t,r.type=o,i.registerVariable(r),r.update(t)}catch(e){console.error(e)}return r}update(e){const t=this.value;this.value=e,null===e&&null===t||null!==e&&e===t&&this.hadStarted||i(this,Ao)[Ao].hasVarsRequestCompleted()&&(this.hadStarted=!0,this.triggerValueChanged())}triggerValueChanged(){this.valueChangedCallbacks.forEach((e=>{e(this)}))}addValueChangedCallback(e){e?(this.valueChangedCallbacks.push(e),i(this,Ao)[Ao].hasVarsRequestCompleted()&&e(this)):console.log("Invalid callback parameter provided.")}removeValueChangedCallback(e){const t=this.valueChangedCallbacks.indexOf(e);-1!==t&&this.valueChangedCallbacks.splice(t,1)}clearStartFlag(){this.hadStarted=!1}}var Lo=t("logger"),To=t("account"),zo=t("request"),jo=t("event"),No=t("variables"),Ro=t("remoteVariables"),Bo=t("fetchCallback"),Uo=t("variablesChangedCallbacks"),Fo=t("oneTimeVariablesChangedCallbacks"),Vo=t("hasVarsRequestCompleted"),Wo=t("runVariablesChangedCallback");class qo{constructor(e){let{logger:t,request:o,account:n,event:r}=e;Object.defineProperty(this,Wo,{value:Go}),Object.defineProperty(this,Lo,{writable:!0,value:void 0}),Object.defineProperty(this,To,{writable:!0,value:void 0}),Object.defineProperty(this,zo,{writable:!0,value:void 0}),Object.defineProperty(this,jo,{writable:!0,value:void 0}),Object.defineProperty(this,No,{writable:!0,value:void 0}),Object.defineProperty(this,Ro,{writable:!0,value:void 0}),Object.defineProperty(this,Bo,{writable:!0,value:void 0}),Object.defineProperty(this,Uo,{writable:!0,value:void 0}),Object.defineProperty(this,Fo,{writable:!0,value:void 0}),Object.defineProperty(this,Vo,{writable:!0,value:!1}),i(this,Lo)[Lo]=t,i(this,To)[To]=n,i(this,zo)[zo]=o,i(this,jo)[jo]=r,i(this,No)[No]={},i(this,Ro)[Ro]={},i(this,Uo)[Uo]=[],i(this,Fo)[Fo]=[],ce.variableStore=this}registerVariable(e){const{name:t}=e;i(this,No)[No][t]=e,console.log("registerVariable",i(this,No)[No])}getVariable(e){return i(this,No)[No][e]}hasVarsRequestCompleted(){return i(this,Vo)[Vo]}syncVariables(e,t){if(!i(this,To)[To].token){const e="Account token is missing.";return i(this,Lo)[Lo].error(e),Promise.reject(new Error(e))}const o={type:"varsPayload",vars:{}};for(const e in i(this,No)[No])o.vars[e]={defaultValue:i(this,No)[No][e].defaultValue,type:i(this,No)[No][e].type};if(0===Object.keys(o.vars).length){const e="No variables are defined.";return i(this,Lo)[Lo].error(e),Promise.reject(new Error(e))}let n={};n=i(this,zo)[zo].addSystemDataToObject(n,void 0),n.tk=i(this,To)[To].token,n.type="meta";const r=JSON.stringify([n,o]),s=i(this,To)[To].dataPostPEURL;return i(this,zo)[zo].post(s,r).then((t=>(e&&"function"==typeof e&&e(t),t))).catch((e=>{throw t&&"function"==typeof t&&t(e),400===e.status?i(this,Lo)[Lo].error("Invalid sync payload or clear the existing draft"):401===e.status?i(this,Lo)[Lo].error("This is not a test profile"):i(this,Lo)[Lo].error("Sync variable failed"),e}))}fetchVariables(e){i(this,jo)[jo].push(G,{t:4}),e&&"function"==typeof e&&(i(this,Bo)[Bo]=e)}mergeVariables(e){console.log("msg vars is ",e),i(this,Vo)[Vo]=!0,le.saveToLSorCookie("WZRK_PE",e),i(this,Ro)[Ro]=e;for(const t in i(this,No)[No])e.hasOwnProperty(t)&&i(this,No)[No][t].update(e[t]);i(this,Bo)[Bo]&&i(this,Bo)[Bo](),i(this,Wo)[Wo]()}addVariablesChangedCallback(e){e&&"function"==typeof e?(i(this,Uo)[Uo].push(e),this.hasVarsRequestCompleted()&&e()):i(this,Lo)[Lo].error("callback is not a function")}addOneTimeVariablesChangedCallback(e){e&&"function"==typeof e&&(this.hasVarsRequestCompleted()?e():i(this,Fo)[Fo].push(e))}removeVariablesChangedCallback(e){const t=i(this,Uo)[Uo].indexOf(e);-1!==t&&i(this,Uo)[Uo].splice(t,1)}removeOneTimeVariablesChangedCallback(e){const t=i(this,Fo)[Fo].indexOf(e);-1!==t&&i(this,Fo)[Fo].splice(t,1)}}var Go=function(){for(var e of i(this,Uo)[Uo])e();for(var t of i(this,Fo)[Fo])t();i(this,Fo)[Fo].length=0},Ho=t("logger"),Ko=t("api"),Zo=t("onloadcalled"),Jo=t("device"),Qo=t("session"),Yo=t("account"),$o=t("request"),Xo=t("variableStore"),en=t("isSpa"),tn=t("previousUrl"),on=t("boundCheckPageChanged"),nn=t("dismissSpamControl"),rn=t("processOldValues"),sn=t("debounce"),an=t("checkPageChanged"),ln=t("pingRequest"),cn=t("isPingContinuous"),dn=t("overrideDSyncFlag"),un=t("sendLocationData");var hn=function(){this.onUserLogin._processOldValues(),this.privacy._processOldValues(),this.event._processOldValues(),this.profile._processOldValues(),this.notifications._processOldValues()},pn=function(e){let t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300;return function(){clearTimeout(t),t=setTimeout(e,i)}},gn=function(){i(this,sn)[sn]((()=>{i(this,tn)[tn]!==location.href&&this.pageChanged()}))()},fn=function(){let e=i(this,Yo)[Yo].dataPostURL,t={};t=i(this,$o)[$o].addSystemDataToObject(t,void 0),e=qe(e,"type","ping"),e=qe(e,"d",He(JSON.stringify(t),i(this,Ho)[Ho])),i(this,$o)[$o].saveAndFireRequest(e,ce.blockRequest)},bn=function(){return void 0!==window.wzrk_d&&"continuous"===window.wzrk_d.ping},vn=function(e){this._isPersonalisationActive()&&(e.dsync=!0)},mn=function(e){let t={af:{}};const o={};if(t.type="profile",null==o.tz&&(o.tz=(new Date).toString().match(/([A-Z]+[\+-][0-9]+)/)[1]),t.profile=o,e){Object.keys(e).forEach((i=>{t.af[i]=e[i]}))}ce.location&&(t.af={...t.af,...ce.location}),t=i(this,$o)[$o].addSystemDataToObject(t,!0),i(this,$o)[$o].addFlags(t);const n=He(JSON.stringify(t),i(this,Ho)[Ho]);let r=i(this,Yo)[Yo].dataPostURL;r=qe(r,"type",E),r=qe(r,"d",n),i(this,$o)[$o].saveAndFireRequest(r,ce.blockRequest)};const yn=new class{get spa(){return i(this,en)[en]}set spa(e){const t=!0===e;i(this,en)[en]!==t&&1===i(this,Zo)[Zo]&&(t?document.addEventListener("click",i(this,on)[on]):document.removeEventListener("click",i(this,on)[on])),i(this,en)[en]=t}get dismissSpamControl(){return i(this,nn)[nn]}set dismissSpamControl(e){const t=!0===e;i(this,nn)[nn]=t,ce.dismissSpamControl=t}constructor(){var e,t,o,n,r;let s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.defineProperty(this,un,{value:mn}),Object.defineProperty(this,dn,{value:vn}),Object.defineProperty(this,cn,{value:bn}),Object.defineProperty(this,ln,{value:fn}),Object.defineProperty(this,an,{value:gn}),Object.defineProperty(this,sn,{value:pn}),Object.defineProperty(this,rn,{value:hn}),Object.defineProperty(this,Ho,{writable:!0,value:void 0}),Object.defineProperty(this,Ko,{writable:!0,value:void 0}),Object.defineProperty(this,Zo,{writable:!0,value:void 0}),Object.defineProperty(this,Jo,{writable:!0,value:void 0}),Object.defineProperty(this,Qo,{writable:!0,value:void 0}),Object.defineProperty(this,Yo,{writable:!0,value:void 0}),Object.defineProperty(this,$o,{writable:!0,value:void 0}),Object.defineProperty(this,Xo,{writable:!0,value:void 0}),Object.defineProperty(this,en,{writable:!0,value:void 0}),Object.defineProperty(this,tn,{writable:!0,value:void 0}),Object.defineProperty(this,on,{writable:!0,value:i(this,an)[an].bind(this)}),Object.defineProperty(this,nn,{writable:!0,value:void 0}),this.enablePersonalization=void 0,this.popupCallbacks={},this.popupCurrentWzrkId="",i(this,Zo)[Zo]=0,this._isPersonalisationActive=this._isPersonalisationActive.bind(this),this.raiseNotificationClicked=()=>{},i(this,Ho)[Ho]=new ro(Xi),i(this,Yo)[Yo]=new d(null===(e=s.account)||void 0===e?void 0:e[0],s.region||(null===(t=s.account)||void 0===t?void 0:t[1]),s.targetDomain||(null===(o=s.account)||void 0===o?void 0:o[2]),s.token||(null===(n=s.account)||void 0===n?void 0:n[3])),i(this,Jo)[Jo]=new we({logger:i(this,Ho)[Ho]}),i(this,nn)[nn]=s.dismissSpamControl||!1,this.shpfyProxyPath=s.shpfyProxyPath||"",i(this,Qo)[Qo]=new ho({logger:i(this,Ho)[Ho],isPersonalisationActive:this._isPersonalisationActive}),i(this,$o)[$o]=new ko({logger:i(this,Ho)[Ho],account:i(this,Yo)[Yo],device:i(this,Jo)[Jo],session:i(this,Qo)[Qo],isPersonalisationActive:this._isPersonalisationActive}),this.enablePersonalization=s.enablePersonalization||!1,this.event=new Fe({logger:i(this,Ho)[Ho],request:i(this,$o)[$o],isPersonalisationActive:this._isPersonalisationActive},s.event),this.profile=new ft({logger:i(this,Ho)[Ho],request:i(this,$o)[$o],account:i(this,Yo)[Yo],isPersonalisationActive:this._isPersonalisationActive},s.profile),this.onUserLogin=new Pt({request:i(this,$o)[$o],account:i(this,Yo)[Yo],session:i(this,Qo)[Qo],logger:i(this,Ho)[Ho],device:i(this,Jo)[Jo]},s.onUserLogin),this.privacy=new _o({request:i(this,$o)[$o],account:i(this,Yo)[Yo],logger:i(this,Ho)[Ho]},s.privacy),this.notifications=new _i({logger:i(this,Ho)[Ho],request:i(this,$o)[$o],account:i(this,Yo)[Yo]},s.notifications),i(this,Xo)[Xo]=new qo({logger:i(this,Ho)[Ho],request:i(this,$o)[$o],account:i(this,Yo)[Yo],event:this.event}),i(this,Ko)[Ko]=new me({logger:i(this,Ho)[Ho],request:i(this,$o)[$o],device:i(this,Jo)[Jo],session:i(this,Qo)[Qo]}),this.spa=s.spa,this.dismissSpamControl=s.dismissSpamControl,this.user=new Yi({isPersonalisationActive:this._isPersonalisationActive}),this.session={getTimeElapsed:()=>i(this,Qo)[Qo].getTimeElapsed(),getPageCount:()=>i(this,Qo)[Qo].getPageCount()},this.logout=()=>{i(this,Ho)[Ho].debug("logout called"),le.setInstantDeleteFlagInK()},this.clear=()=>{this.onUserLogin.clear()},this.getCleverTapID=()=>i(this,Jo)[Jo].getGuid(),this.getAccountID=()=>i(this,Yo)[Yo].id,this.getSCDomain=()=>i(this,Yo)[Yo].finalTargetDomain,this.setLibrary=(e,t)=>{ce.flutterVersion={[e]:t}},this.setSCSDKVersion=e=>{i(this,Yo)[Yo].scSDKVersion=e;const t={};t.af={scv:"sc-sdk-v"+i(this,Yo)[Yo].scSDKVersion};let o=i(this,Yo)[Yo].dataPostURL;o=qe(o,"type","page"),o=qe(o,"d",He(JSON.stringify(t),i(this,Ho)[Ho])),i(this,$o)[$o].saveAndFireRequest(o,ce.blockRequest)},qt()&&(Ft(),Ut(i(this,Ho)[Ho])),this.getInboxMessageCount=()=>{const e=Rt();return Object.keys(e).length},this.getInboxMessageUnreadCount=()=>{if(ce.inbox)return ce.inbox.unviewedCounter;i(this,Ho)[Ho].debug("No unread messages")},this.getAllInboxMessages=()=>Rt(),this.getUnreadInboxMessages=()=>{if(ce.inbox)return ce.inbox.unviewedMessages;i(this,Ho)[Ho].debug("No unread messages")},this.getInboxMessageForId=e=>{const t=Rt();if((null!==e||""!==e)&&t.hasOwnProperty(e))return t[e];i(this,Ho)[Ho].error("No message available for message Id "+e)},this.deleteInboxMessage=e=>{const t=Rt();if(null===e&&""===e||!t.hasOwnProperty(e))i(this,Ho)[Ho].error("No message available for message Id "+e);else{if(0===t[e].viewed){ce.inbox.unviewedCounter--,delete ce.inbox.unviewedMessages[e];const t=document.getElementById("unviewedBadge");t&&(t.innerText=ce.inbox.unviewedCounter,t.style.display=ce.inbox.unviewedCounter>0?"flex":"none")}const i=document.querySelector("ct-web-inbox");if(i){const t=i.shadowRoot.getElementById(e);t&&t.remove()}delete t[e],Bt(t)}},this.markReadInboxMessage=e=>{const t=ce.inbox.unviewedMessages,o=Rt();if(null===e&&""===e||!t.hasOwnProperty(e))i(this,Ho)[Ho].error("No message available for message Id "+e);else{const t=document.querySelector("ct-web-inbox");if(t){const i=t.shadowRoot.getElementById(e);null!==i&&(i.shadowRoot.getElementById("unreadMarker").style.display="none")}o[e].viewed=1;const i=document.getElementById("unviewedBadge");if(i){var n=parseInt(i.innerText)-1;i.innerText=n,i.style.display=n>0?"flex":"none"}window.clevertap.renderNotificationViewed({msgId:o[e].wzrk_id,pivotId:o[e].pivotId}),ce.inbox.unviewedCounter--,delete ce.inbox.unviewedMessages[e],Bt(o)}},this.markReadInboxMessagesForIds=e=>{if(Array.isArray(e))for(var t=0;t<e.length;t++)this.markReadInboxMessage(e[t])},this.markReadAllInboxMessage=()=>{const e=ce.inbox.unviewedMessages,t=Rt();if(Object.keys(e).length>0){Object.keys(e).forEach((e=>{const i=document.querySelector("ct-web-inbox");if(i){const t=i.shadowRoot.getElementById(e);null!==t&&(t.shadowRoot.getElementById("unreadMarker").style.display="none")}t[e].viewed=1,window.clevertap.renderNotificationViewed({msgId:t[e].wzrk_id,pivotId:t[e].wzrk_pivot})}));const i=document.getElementById("unviewedBadge");i&&(i.innerText=0,i.style.display="none"),Bt(t),ce.inbox.unviewedCounter=0,ce.inbox.unviewedMessages={}}else i(this,Ho)[Ho].debug("All messages are already read")},this.toggleInbox=e=>{var t;return null===(t=ce.inbox)||void 0===t?void 0:t.toggleInbox(e)},this.renderNotificationViewed=e=>{a(T,e)},this.renderNotificationClicked=e=>{a(z,e)};const a=(e,t)=>{if(!t||!t.msgId)return;const o={type:"event"};if(o.evtName=e,o.evtData={[L]:t.msgId},t.pivotId&&(o.evtData={...o.evtData,wzrk_pivot:t.pivotId}),t.wzrk_slideNo&&(o.evtData={...o.evtData,wzrk_slideNo:t.wzrk_slideNo}),t.kv&&null!==t.kv&&void 0!==t.kv)for(const e in t.kv)e.startsWith(D)&&(o.evtData={...o.evtData,[e]:t.kv[e]});if(t.msgCTkv&&null!==t.msgCTkv&&void 0!==t.msgCTkv)for(const e in t.msgCTkv)e.startsWith(D)&&(o.evtData={...o.evtData,[e]:t.msgCTkv[e]});i(this,$o)[$o].processEvent(o)};this.setLogLevel=e=>{i(this,Ho)[Ho].logLevel=Number(e),3===e?sessionStorage.WZRK_D="":delete sessionStorage.WZRK_D},this.handleIncrementValue=(e,t)=>{this.profile._handleIncrementDecrementValue(e,t,R)},this.handleDecrementValue=(e,t)=>{this.profile._handleIncrementDecrementValue(e,t,"$decr")},this.setMultiValuesForKey=(e,t)=>{Array.isArray(t)?this.profile._handleMultiValueSet(e,t,"$set"):console.error("setMultiValuesForKey should be called with a value of type array")},this.addMultiValueForKey=(e,t)=>{"string"==typeof t||"number"==typeof t?this.profile._handleMultiValueAdd(e,t,B):console.error("addMultiValueForKey should be called with a value of type string or number.")},this.addMultiValuesForKey=(e,t)=>{Array.isArray(t)?this.profile._handleMultiValueAdd(e,t,B):console.error("addMultiValuesForKey should be called with a value of type array.")},this.removeMultiValueForKey=(e,t)=>{"string"==typeof t||"number"==typeof t?this.profile._handleMultiValueRemove(e,t,U):console.error("removeMultiValueForKey should be called with a value of type string or number.")},this.removeMultiValuesForKey=(e,t)=>{Array.isArray(t)?this.profile._handleMultiValueRemove(e,t,U):console.error("removeMultiValuesForKey should be called with a value of type array.")},this.removeValueForKey=e=>{this.profile._handleMultiValueDelete(e,F)};const l=(e,t,o)=>{((e,t,i,o,n)=>{const r=We(location.href),s=r.e,a=r.p,l=r.page_type;if(void 0!==s){const r={};r.id=o.id,r.unsubGroups=ce.unsubGroups,ce.updatedCategoryLong&&(r.cUsY=ce.updatedCategoryLong);let c=o.emailURL;i&&(c=qe(c,"fetchGroups",i)),t&&(c=qe(c,"encoded",t)),c=qe(c,"e",s),c=qe(c,"d",He(JSON.stringify(r),n)),a&&(c=qe(c,"p",a)),"-1"!==e&&(c=qe(c,"sub",e)),l&&(ce.globalUnsubscribe=l===S,c=qe(c,"page_type",l)),Xe.fireRequest(c)}})(e,t,o,i(this,Yo)[Yo],i(this,Ho)[Ho])};function c(e){var t=e.coords.latitude,o=e.coords.longitude;ce.location={Latitude:t,Longitude:o},i(this,un)[un]({Latitude:t,Longitude:o})}function u(e){switch(e.code){case e.PERMISSION_DENIED:console.log("User denied the request for Geolocation.");break;case e.POSITION_UNAVAILABLE:console.log("Location information is unavailable.");break;case e.TIMEOUT:console.log("The request to get user location timed out.");break;case e.UNKNOWN_ERROR:console.log("An unknown error occurred.")}}this.getLocation=function(e,t){if(e&&"number"!=typeof e||t&&"number"!=typeof t)console.log("Latitude and Longitude must be of number type");else if(e&&t){if(e<=-90||e>90)return void console.log("A vaid latitude must range between -90 and 90");if(t<=-180||t>180)return void console.log("A valid longitude must range between -180 and 180");ce.location={Latitude:e,Longitude:t},i(this,un)[un]({Latitude:e,Longitude:t})}else navigator.geolocation?navigator.geolocation.getCurrentPosition(c.bind(this),u):console.log("Geolocation is not supported by this browser.")};const h=i(this,Ko)[Ko];h.logout=this.logout,h.clear=this.clear,h.closeIframe=(e,t)=>{lt(e,0,i(this,Qo)[Qo].sessionId)},h.enableWebPush=(e,t)=>{ji=t,this.notifications._enableWebPush(e,t)},h.tr=e=>{Ji(e,{device:i(this,Jo)[Jo],session:i(this,Qo)[Qo],request:i(this,$o)[$o],logger:i(this,Ho)[Ho]})},h.setEnum=e=>{((e,t)=>{if(Z(e)||X(e))return"$E_"+e;t.error(Ae)})(e,i(this,Ho)[Ho])},h.is_onloadcalled=()=>1===i(this,Zo)[Zo],h.subEmail=e=>{l("1",e)},h.getEmail=(e,t)=>{l("-1",e,t)},h.unSubEmail=e=>{l("0",e)},h.unsubEmailGroups=e=>{ce.unsubGroups=[];const t=document.getElementsByClassName("ct-unsub-group-input-item");for(let e=0;e<t.length;e++){const i=t[e];if(i.name){const e={name:i.name,isUnsubscribed:i.checked};ce.unsubGroups.push(e)}}l("2",e)},h.setSubscriptionGroups=e=>{ce.unsubGroups=e},h.getSubscriptionGroups=()=>ce.unsubGroups,h.changeSubscriptionGroups=(e,t)=>{h.setSubscriptionGroups(t),l("2",e)},h.isGlobalUnsubscribe=()=>ce.globalUnsubscribe,h.setIsGlobalUnsubscribe=e=>{ce.globalUnsubscribe=e},h.setUpdatedCategoryLong=e=>{e.cUsY&&(ce.updatedCategoryLong=e.cUsY)},window.$CLTP_WR=window.$WZRK_WR=h,(null===(r=s.account)||void 0===r?void 0:r[0].id)&&this.init()}init(e,t,o,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if(Object.keys(r).length>0&&ni(r),1===i(this,Zo)[Zo])return;if(le.removeCookie("WZRK_P",window.location.hostname),!i(this,Yo)[Yo].id){if(!e)return void i(this,Ho)[Ho].error(xe);i(this,Yo)[Yo].id=e}((e,t)=>{const i=window.location.search,o=window.opener;if("?ctBuilder"===i)return e.debug("open in visual builder mode"),window.addEventListener("message",Yt,!1),void(o&&o.postMessage({message:"builder",originUrl:window.location.href},"*"));if("?ctBuilderPreview"===i&&(window.addEventListener("message",Yt,!1),o&&o.postMessage({message:"preview",originUrl:window.location.href},"*")),"?ctBuilderSDKCheck"===i&&o){const e="1.11.12";o.postMessage({message:"SDKVersion",accountId:t,originUrl:window.location.href,sdkVersion:e},"*")}})(i(this,Ho)[Ho],i(this,Yo)[Yo].id),i(this,Qo)[Qo].cookieName="WZRK_S_"+i(this,Yo)[Yo].id,t&&(i(this,Yo)[Yo].region=t),o&&(i(this,Yo)[Yo].targetDomain=o),n&&(i(this,Yo)[Yo].token=n);const s=location.href,a=We(s.toLowerCase());if(void 0!==a.e&&"0"==a.wzrk_ex)return;ce.isPrivacyArrPushed=!0,ce.privacyArray.length>0&&this.privacy.push(ce.privacyArray),i(this,rn)[rn](),this.pageChanged();const l=setInterval((()=>{i(this,Jo)[Jo].gcookie&&(clearInterval(l),i(this,$o)[$o].processBackupEvents())}),3e3);i(this,en)[en]?document.addEventListener("click",i(this,on)[on]):document.removeEventListener("click",i(this,on)[on]),i(this,Zo)[Zo]=1}pageChanged(){const e=window.location.href,t=We(e.toLowerCase()),o=i(this,Qo)[Qo].getSessionCookieObject();let n=void 0===o.p?0:o.p;o.p=++n,i(this,Qo)[Qo].setSessionCookieObject(o);let r={},s=(e=>{if(""===e)return"";var t=document.createElement("a");return t.href=e,t.hostname})(document.referrer);if(window.location.hostname!==s){const e=120;""!==s&&(s=s.length>e?s.substring(0,e):s,r.referrer=s);let i=t.utm_source||t.wzrk_source;void 0!==i&&(i=i.length>e?i.substring(0,e):i,r.us=i);let o=t.utm_medium||t.wzrk_medium;void 0!==o&&(o=o.length>e?o.substring(0,e):o,r.um=o);let n=t.utm_campaign||t.wzrk_campaign;if(void 0!==n&&(n=n.length>e?n.substring(0,e):n,r.uc=n),void 0!==t.wzrk_medium){const e=t.wzrk_medium;e.match(/^email$|^social$|^search$/)&&(r.wm=e)}}r=i(this,$o)[$o].addSystemDataToObject(r,void 0),r.cpg=e,r.WZRK_CAMP=ot();let a=i(this,Yo)[Yo].dataPostURL;i(this,$o)[$o].addFlags(r),1===parseInt(r.pg)&&i(this,dn)[dn](r),a=qe(a,"type","page"),a=qe(a,"d",He(JSON.stringify(r),i(this,Ho)[Ho])),i(this,$o)[$o].saveAndFireRequest(a,ce.blockRequest),1===parseInt(r.pg)&&this.event.push(G,{t:4}),i(this,tn)[tn]=e,setTimeout((()=>{n<=3&&i(this,ln)[ln](),i(this,cn)[cn]()&&setInterval((()=>{i(this,ln)[ln]()}),3e5)}),12e4)}_isPersonalisationActive(){return le._isLocalStorageSupported()&&this.enablePersonalization}set popupCallback(e){this.popupCallbacks[this.popupCurrentWzrkId]=e}setOffline(e){"boolean"==typeof e?(ce.offline=e,e||i(this,$o)[$o].processBackupEvents()):console.error("setOffline should be called with a value of type boolean")}getSDKVersion(){return"web-sdk-v1.11.12"}defineVariable(e,t){return Do.define(e,t,i(this,Xo)[Xo])}syncVariables(e,t){if(4===i(this,Ho)[Ho].logLevel)return i(this,Xo)[Xo].syncVariables(e,t);{const e="App log level is not set to 4";return i(this,Ho)[Ho].error(e),Promise.reject(new Error(e))}}fetchVariables(e){i(this,Xo)[Xo].fetchVariables(e)}addVariablesChangedCallback(e){i(this,Xo)[Xo].addVariablesChangedCallback(e)}addOneTimeVariablesChangedCallback(e){i(this,Xo)[Xo].addOneTimeVariablesChangedCallback(e)}}(window.clevertap);return window.clevertap=window.wizrocket=yn,yn}));