mergn-webapp-sdk 1.0.120 → 1.0.121

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,76 +1 @@
1
- /* Copyright (c) 2024 MERGN */
2
- "use strict";(()=>{var ln=Object.defineProperty,dn=Object.defineProperties;var un=Object.getOwnPropertyDescriptors;var ut=Object.getOwnPropertySymbols;var pn=Object.prototype.hasOwnProperty,gn=Object.prototype.propertyIsEnumerable;var gt=l=>{throw TypeError(l)};var pt=(l,e,t)=>e in l?ln(l,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):l[e]=t,z=(l,e)=>{for(var t in e||(e={}))pn.call(e,t)&&pt(l,t,e[t]);if(ut)for(var t of ut(e))gn.call(e,t)&&pt(l,t,e[t]);return l},Pe=(l,e)=>dn(l,un(e));var We=(l,e,t)=>e.has(l)||gt("Cannot "+t);var d=(l,e,t)=>(We(l,e,"read from private field"),t?t.call(l):e.get(l)),m=(l,e,t)=>e.has(l)?gt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(l):e.set(l,t),I=(l,e,t,n)=>(We(l,e,"write to private field"),n?n.call(l,t):e.set(l,t),t),i=(l,e,t)=>(We(l,e,"access private method"),t);var a=(l,e,t)=>new Promise((n,r)=>{var o=v=>{try{h(t.next(v))}catch(b){r(b)}},c=v=>{try{h(t.throw(v))}catch(b){r(b)}},h=v=>v.done?n(v.value):Promise.resolve(v.value).then(o,c);h((t=t.apply(l,e)).next())});var mt="1.0.120";var ge="https://u23z4zsda8.execute-api.ap-southeast-1.amazonaws.com/Prod/sdk-management/api",ke="/attribute",Et="/set-attribute",Fe="/event",vt="/record-event";var It="/customer",St="/device/add-device-token",ft="/set-identity",ht="/brand/get-web-push-public-key",bt="/brand/get-time";var yt=(v=>(v.UTM_SOURCE="utm_source",v.UTM_MEDIUM="utm_medium",v.UTM_CAMPAIGN="utm_campaign",v.UTM_TERM="utm_term",v.UTM_CONTENT="utm_content",v.GAD_SOURCE="gad_source",v.GCLID="gclid",v.FBCLID="fbclid",v))(yt||{});var wt=new Set(Object.values(yt));var te="Popup Action";var re,$,ne,w=class w{constructor(){m(this,$)}static getInstance(){return d(w,re)||I(w,re,new w),d(w,re)}updateAPIKey(e){w.apiKey=e;let t=e,n=/m(\d+)rgn/,r=t.match(n);r&&(w.brandId=r[1])}getAPIKey(){return w.apiKey}getBrandId(){return w.brandId}get(e){return a(this,null,function*(){try{return(yield fetch(ge+e,{headers:{Authorization:i(this,$,ne).call(this,w.apiKey),"Content-Type":"application/json"}})).json()}catch(t){let n=t.message;return this.getBrandId()==="67"&&n!=="Failed to fetch"&&n!=="Failed to load"&&u.recordEvent({eventName:"Debug Event",eventProperties:[{eventProperty:"message",value:`get - ${e} - ${i(this,$,ne).call(this,w.apiKey)} - ${t.message}`}]},!0),Promise.reject(t)}})}post(e,t,n){return a(this,null,function*(){try{return(yield fetch(ge+e,{body:JSON.stringify(t||{}),headers:{Authorization:i(this,$,ne).call(this,w.apiKey),"Content-Type":"application/json"},method:"POST",signal:n})).json()}catch(r){let o=r.message;return this.getBrandId()==="67"&&o!=="Failed to fetch"&&o!=="Failed to load"&&u.recordEvent({eventName:"Debug Event",eventProperties:[{eventProperty:"message",value:`post - ${e} - ${i(this,$,ne).call(this,w.apiKey)} - ${JSON.stringify(t||{})} -${r.message}`}]},!0),Promise.reject(r)}})}put(e,t){return a(this,null,function*(){return(yield fetch(ge+e,{body:JSON.stringify(t||{}),headers:{Authorization:i(this,$,ne).call(this,w.apiKey),"Content-Type":"application/json"},method:"PUT"})).json()})}syncRealWorldTime(){return a(this,null,function*(){try{let e=(yield(yield fetch(ge+bt)).json()).data;w.UTCDate=new Date(e),w.lastSyncTime=new Date}catch(e){s(2,"Failed to sync real-world time")}})}getCurrentUTCDate(){if(!w.UTCDate||!w.lastSyncTime)return s(2,"UTC Date or last sync time is not set"),new Date;let t=new Date().getTime()-w.lastSyncTime.getTime();return new Date(w.UTCDate.getTime()+t)}};re=new WeakMap,$=new WeakSet,ne=function(e){return btoa(`${e}:${new Date().getTime()}`)},m(w,re);var Be=w,N=Be.getInstance();var G,ie,x,Tt,$e,Pt,Nt,V=class V{constructor(){m(this,x);m(this,ie,!1)}static getInstance(){var e;return d(V,G)||(I(V,G,new V),i(e=d(V,G),x,Tt).call(e)),d(V,G)}recordAttribute(e,t,n){return a(this,null,function*(){yield A("# recordAttribute",()=>a(this,null,function*(){if(s(1,"Recording attribute"),C("Recording attribute",!0),L("Recording attribute Time",!0),s(1,`Attribute Payload:
3
- ${{attributeName:e,attributeProperties:n,attributeValue:t}})}`),!t||t===""){s(2,"Attribute value is required");return}yield E.checkTTL(),yield i(this,x,Pt).call(this);let r=JSON.parse(localStorage.getItem("attributes")||"{}"),o=n?i(this,x,$e).call(this,r,e,n):i(this,x,$e).call(this,r,e);if(typeof o=="string"){s(2,o);return}r[e].should_set_identity&&(yield E.setIdentity(typeof t=="string"?t:JSON.stringify(t))),E.updateSessionCreated();let{id:c}=r[e],h={attributeId:c,attributeProperties:o,customerId:localStorage.getItem("customer")||"",value:t};yield i(this,x,Nt).call(this,h);let v=JSON.parse(localStorage.getItem("preInitializedAttributes")||"[]");v.pop(),localStorage.setItem("preInitializedAttributes",JSON.stringify(v)),L("Recording attribute Time",!1),C("Recording attribute",!1)}))})}storeAttributeInLocalStorage(){return a(this,null,function*(){if(!localStorage.getItem("attributes")&&!d(this,ie)){I(this,ie,!0);try{let e=(yield this.fetchAttributeData()).data;e&&localStorage.setItem("attributes",JSON.stringify(e))}catch(e){throw new Error("Error storing attribute data in local storage")}finally{I(this,ie,!1)}}})}fetchAttributeData(){return a(this,null,function*(){try{return yield N.get(`${ke}`)}catch(e){throw new Error("Error fetching attribute data")}})}};G=new WeakMap,ie=new WeakMap,x=new WeakSet,Tt=function(){return a(this,null,function*(){})},$e=function(e,t,n){if(!Object.prototype.hasOwnProperty.call(e,t))return`Attribute ${t} is not valid.`;if(!n)return[];let r=e[t];if(!(r!=null&&r.attributeProperty))return`Attribute ${t} does not have a valid attributeProperty.`;let o=n.filter(({attributeProperty:c})=>!Object.prototype.hasOwnProperty.call(r.attributeProperty,c)).map(({attributeProperty:c})=>c);return o.length>0?`Attribute ${t} has invalid attributeProperties: ${o.join(", ")}.`:n.map(({attributeProperty:c,value:h})=>({attributePropertyId:r.attributeProperty[c].id,value:h}))},Pt=function(){return a(this,null,function*(){localStorage.getItem("attributes")||(yield this.storeAttributeInLocalStorage())})},Nt=function(e){return a(this,null,function*(){try{return yield N.post(`${ke}${Et}`,e)}catch(t){throw new Error("Error posting attribute record")}})},m(V,G);var Me=V,me=Me.getInstance();var Ve="Content Card Action";var Y,T,At,Je,Rt,Ot,se,Ne,Lt,Ct,Dt,_e,K=class K{constructor(){m(this,T);m(this,se,e=>{E.clearActionInLocalStorage({id:e,localStorageKey:"action"})});this.loadContentCardEventActionInLocalStorage=()=>{E.loadActionInLocalStorage({actionCondition:e=>e.message.name==="ContentCard",actionMethod:e=>i(this,T,Je).call(this,e.campaignId),localStorageKey:"action"})};m(this,_e,()=>{E.storeActionInLocalStorageInternal("action")})}static getInstance(){var e;return d(K,Y)||(I(K,Y,new K),i(e=d(K,Y),T,At).call(e)),d(K,Y)}showContentCard(e){let t=JSON.parse(localStorage.getItem("action")||"{}");if(t&&t[e==null?void 0:e.campaignId]){s(1,"ContentCard already in cache");return}i(this,T,Dt).call(this,e),d(this,_e).call(this),i(this,T,Je).call(this,e.campaignId)}isContentCardAction(e){return e==="content_card"}};Y=new WeakMap,T=new WeakSet,At=function(){return a(this,null,function*(){})},Je=function(e){let t=i(this,T,Rt).call(this);if(document.getElementById(`contentCard_container_${e}`)){s(1,"ContentCard already displayed"),d(this,se).call(this,e);return}if(t!=null&&t[e])switch(t[e].campaignEntryTime){case"DELAY":{i(this,T,Ot).call(this,t[e]);break}case"IMMEDIATELY":{i(this,T,Ne).call(this,t[e]);break}case"SCROLL":{i(this,T,Ct).call(this,t[e]);break}default:return}},Rt=function(){let e=localStorage.getItem("action");return e?JSON.parse(e):null},Ot=function(e){E.showDelayedAction({clearActionMethod:d(this,se).bind(this),data:e,displayMethod:i(this,T,Ne).bind(this),idKey:"campaignId",timeValueKey:"campaignEntryTimeValue"})},se=new WeakMap,Ne=function(e){var t;if(document.getElementById(`contentCard_container_${e.campaignId}`))s(1,"ContentCard already displayed");else{let n=i(this,T,Lt).call(this,"div",e),r=document.querySelector(`#${e.message.divId}`);r&&(r.innerHTML=n.outerHTML,u.recordEvent({campaignCustomerInstanceId:e.campaignCustomerInstanceId,campaignId:e.campaignId,eventName:Ve,eventProperties:[{eventProperty:"Content Card View",value:JSON.stringify({campaignId:e.campaignId})}],name:"view"}),(t=document.getElementById(`contentCard_container_${e.campaignId}`))==null||t.addEventListener("click",()=>{u.recordEvent({campaignCustomerInstanceId:e.campaignCustomerInstanceId,campaignId:e.campaignId,eventName:Ve,eventProperties:[{eventProperty:"Content Card Click",value:JSON.stringify({campaignId:e.campaignId})}],name:"click"})}))}d(this,se).call(this,e.campaignId)},Lt=function(e,t){var c;let{campaignId:n,message:{design:r}}=t,o=document.createElement(e);return o.id=`contentCard_container_${n}`,o.innerHTML=r,(c=o.querySelector(".u-close-button"))==null||c.remove(),o},Ct=function(e){E.showAfterScrollAction({data:e,displayMethod:i(this,T,Ne).bind(this),timeValueKey:"campaignEntryTimeValue"})},Dt=function(e){E.storeActionInLocalStorage(e,"action","campaignId")},_e=new WeakMap,m(K,Y);var Ke=K,ae=Ke.getInstance();var ce,B,le,q,Ee,ve,S,je,Ut,ze,Ae,xt,Le,Re,Ge,Wt,Oe,Ie,kt,f=class f{constructor(){m(this,S);this.permission=null;this.pushMessageToSW=e=>{s(1,"Pushing message to service worker"),navigator.serviceWorker.getRegistrations().then(t=>{var n,r;s(1,"Service Worker registration"),(n=t[0])!=null&&n.active&&(s(1,"Service Worker ready"),(r=t[0].active)==null||r.postMessage(JSON.stringify(e)))}).catch(t=>{s(2,`Failed to push message to service worker: ${t.message}`)})};this.loadWebPushActionInLocalStorage=()=>{E.loadActionInLocalStorage({actionCondition:()=>!0,actionMethod:e=>i(this,S,Re).call(this,Number(e.web_optin_instance_id)),localStorageKey:"web_push_action"})};m(this,Le,()=>{E.storeActionInLocalStorageInternal("web_push_action")});m(this,Ie,e=>{E.clearActionInLocalStorage({id:e,localStorageKey:"web_push_action"})})}static getInstance(){return d(f,ce)||I(f,ce,new f),d(f,ce)}init(e,t){return a(this,null,function*(){var n;if(s(1,"Initializing Notification Service"),u.recordDebugEvents({eventName:"init",eventProperties:[{eventProperty:"service_worker",value:"serviceWorker"in navigator},{eventProperty:"push_manager",value:"PushManager"in window}]}),"serviceWorker"in navigator&&"PushManager"in window){s(1,"Service Worker and Push Manager are supported");try{u.recordDebugEvents({eventName:"init_condition"}),I(f,B,yield navigator.serviceWorker.register(t||"/mergn-sw.js")),s(1,"Service Worker registered"),s(1,"Pushing message to service worker for initialization"),this.pushMessageToSW({customer:localStorage.getItem("customer")||"",events:u.getStoredEvents(),API_KEY:N.getAPIKey(),device_id:localStorage.getItem("uniqueIdentity")||"",operatingSystem:E.getOperatingSystem(),osVersion:E.getOSVersion(),Platform:E.getPlatform()}),I(f,Ee,!0);let r=i(this,S,Ge).call(this),o=Object.keys(r||{});if(o.length&&i(this,S,Re).call(this,Number(o[0])),!e)return;let c=yield(n=d(f,B))==null?void 0:n.pushManager.getSubscription();s(1,"Checking for existing subscription"),d(f,B)&&(s(1,"Service Worker registration is available"),d(f,B).update()),c?(s(1,"Existing subscription found"),u.recordDebugEvents({eventName:"existing_subscription"}),yield i(this,S,Ae).call(this),I(f,le,!0)):(s(1,"No existing subscription found"),yield i(this,S,je).call(this,d(f,ve)||void 0))}catch(r){let o=r&&r.message?r.message.substring(0,100):"undefined";yield u.recordDebugEvents({eventName:"Reachability Push Web",eventProperties:[{eventProperty:"message",value:`${o}`}]}),s(2,"Service Worker registration failed:"),s(2,o)}}})}showNotification(e){if(!d(f,Ee)){I(f,ve,e),u.recordDebugEvents({eventName:"notification_service_not_initialized"}),s(2,"Notification service is not initialized");return}A("showNotification",()=>a(this,null,function*(){let t=JSON.parse(localStorage.getItem("web_push_action")||"{}");if(t&&t[e.web_optin_instance_id]){s(1,"Notification already in cache");return}i(this,S,xt).call(this,e),d(this,Le).call(this),i(this,S,Re).call(this,e.web_optin_instance_id)}))}};ce=new WeakMap,B=new WeakMap,le=new WeakMap,q=new WeakMap,Ee=new WeakMap,ve=new WeakMap,S=new WeakSet,je=function(e){return a(this,null,function*(){s(1,`Checking notification permission: ${JSON.stringify(e)} `),u.recordDebugEvents({eventName:"check_permission"});let t;try{t=Notification.permission,t&&(s(1,`Notification permission: ${t}`),t==="default"?(e||(this.permission="default",u.recordDebugEvents({eventName:"Turned Off Notification Reset Permission"})),e&&(u.recordDebugEvents({eventName:"notification_data",eventProperties:[{eventProperty:"type",value:`${e==null?void 0:e.type}`}]}),d(this,Ie).call(this,e.web_optin_instance_id),e.type==="two_step"?i(this,S,Ut).call(this,e):yield i(this,S,ze).call(this,e))):t==="denied"?(u.recordDebugEvents({eventName:"Turned Off Notification"}),s(1,"The user has blocked notifications.")):(u.recordDebugEvents({eventName:"already_registered"}),s(1,"The user has already enabled notifications."),d(f,le)||(yield i(this,S,Ae).call(this),yield u.recordEvent({eventName:"Already Registered To Web Push"}),e||I(f,le,!0))))}catch(n){s(2,"Failed to check notification permission"),u.recordDebugEvents({eventName:"notification_permission_error"})}})},Ut=function(e){try{let t=document.createElement("div"),n;e.banner_design.banner_image&&(n=document.createElement("img"),n.src=e.banner_design.banner_image,n.alt="Image",n.id="centered-image");let r=document.createElement("div"),o=document.createElement("div"),c=document.createElement("div"),h=document.createElement("img"),v=document.createElement("div"),b=document.createElement("div"),y=document.createElement("div"),D=document.createElement("div"),k=document.createElement("div"),F=document.createElement("div"),O=document.createElement("button"),_=document.createElement("button");t.className="mergn-overlay",r.className="mergnWebPushPopup",o.className=D.className=k.className="mergn-row",c.className="mergn-column-25",v.className="mergn-column-75",F.className="button-container",b.id="title",y.id="subtitle",O.id="button-1",_.id="button-2",h.src=e.banner_design.banner_icon,h.alt="Image",h.id="logo",b.textContent=e.banner_design.banner_title,y.textContent=e.banner_design.banner_text,O.textContent=e.banner_design.button_1.text,_.textContent=e.banner_design.button_2.text,c.appendChild(h),v.appendChild(b),v.appendChild(y),o.appendChild(c),o.appendChild(v),n&&(D.appendChild(n),n.style.cssText=`
4
- max-width: 100%;
5
- height: auto;
6
- display: block;
7
- margin-left: auto;
8
- margin-right: auto;
9
- border-radius: 10px;
10
- max-width: 350px;
11
- aspect-ratio: 2 / 1;
12
- `),F.appendChild(O),F.appendChild(_),k.appendChild(F),r.appendChild(o),r.appendChild(D),r.appendChild(k),t.appendChild(r),t.style.cssText=`
13
- position: fixed;
14
- top: 0;
15
- left: 0;
16
- width: 100%;
17
- height: 100%;
18
- background-color: rgba(0, 0, 0, 0.5);
19
- z-index: 99999999999;
20
- display: flex;
21
- justify-content: center;
22
- align-items: start;
23
- `,r.style.cssText=`
24
- background-color: ${e.banner_design.banner_color};
25
- padding: 15px;
26
- border-radius: 5px;
27
- max-width: 380px;
28
- max-height: 463px;
29
- `,o.style.cssText=D.style.cssText=k.style.cssText=`
30
- display: flex;
31
- flex-wrap: wrap;
32
- margin-bottom: 10px;
33
- `,c.style.cssText=`
34
- width: 25%;
35
- `,v.style.cssText=`
36
- width: 73%;
37
- margin-left: 2%;
38
- `,h.style.cssText=`
39
- max-width: 100%;
40
- height: auto;
41
- `,O.style.cssText=`
42
- padding: 12px 20px;
43
- border: none;
44
- background-color: ${e.banner_design.button_1.backgroundColor};
45
- color: ${e.banner_design.button_1.color};
46
- cursor: pointer;
47
- border-radius: 5px;
48
- width: 48%;
49
- `,_.style.cssText=`
50
- padding: 12px 20px;
51
- border: none;
52
- background-color: ${e.banner_design.button_2.backgroundColor};
53
- color: ${e.banner_design.button_2.color};
54
- cursor: pointer;
55
- border-radius: 5px;
56
- width: 48%;
57
- `,F.style.cssText=`
58
- display: flex;
59
- justify-content: space-between;
60
- align-items: center;
61
- flex-wrap: nowrap;
62
- width: 100%;
63
- `,b.style.cssText=`
64
- margin-bottom: 5px;
65
- font-size: 16px;
66
- color: ${e.banner_design.text_color}
67
- `,y.style.cssText=`
68
- margin-bottom: 5px;
69
- font-size: 13px;
70
- color: ${e.banner_design.text_color}
71
- `,document.body.appendChild(t),document.body.style.overflow="hidden",u.recordEvent({eventName:"Viewed Web Push Soft-ask",name:"viewed",web_optin_instance_id:e.web_optin_instance_id}),O==null||O.addEventListener("click",()=>a(this,null,function*(){t.remove(),I(f,q,!1),document.body.style.overflow="auto",yield u.recordEvent({eventName:"Denied Web Push Soft-ask",web_optin_instance_id:e.web_optin_instance_id}),s(1,"User denied the notification permission.")})),_==null||_.addEventListener("click",()=>a(this,null,function*(){t.remove(),document.body.style.overflow="auto",u.recordEvent({eventName:"Accepted Web Push Soft-ask",web_optin_instance_id:e.web_optin_instance_id}),yield i(this,S,ze).call(this,e)}))}catch(t){}},ze=function(e){return a(this,null,function*(){try{u.recordEvent({eventName:"Displayed Web Push Subscription",name:"viewed",web_optin_instance_id:e.web_optin_instance_id});let t=yield Notification.requestPermission();t==="granted"?(s(1,"User granted the notification permission."),yield i(this,S,Ae).call(this),yield u.recordEvent({eventName:"Allowed Web Push Subscription",name:"subscribed",web_optin_instance_id:e.web_optin_instance_id})):t==="denied"?(yield u.recordEvent({eventName:"Blocked Web Push Subscription"}),s(1,"User denied the notification permission.")):t==="default"&&(yield u.recordEvent({eventName:"Closed Web Push Subscription"}),s(1,"User closed the notification permission dialog."))}catch(t){s(2,"Failed to request notification permission")}I(f,q,!1)})},Ae=function(){return a(this,null,function*(){var t,n;let e=yield N.get(`${ht}`);if(e.success){let r=yield(t=d(f,B))==null?void 0:t.pushManager.getSubscription();r&&(yield r.unsubscribe());let o=yield(n=d(f,B))==null?void 0:n.pushManager.subscribe({applicationServerKey:e.data||"",userVisibleOnly:!0});yield N.put(`${St}`,{device_id:localStorage.getItem("uniqueIdentity")||"",is_web_push_subscribed:!0,web_push_subscription_page_url:window.location.pathname,web_push_token:{token:JSON.parse(JSON.stringify(o))}}),s(1,"User is subscribed")}else throw new Error("Failed to subscribe the user")})},xt=function(e){E.storeActionInLocalStorage(e,"web_push_action","web_optin_instance_id")},Le=new WeakMap,Re=function(e){if(d(f,q))return;I(f,q,!0);let t=i(this,S,Ge).call(this);if(t!=null&&t[e])switch(t[e].entry_time){case"DELAY":{i(this,S,Wt).call(this,t[e]);break}case"IMMEDIATELY":{i(this,S,Oe).call(this,t[e]);break}case"SCROLL":{i(this,S,kt).call(this,t[e]);break}default:return}},Ge=function(){let e=localStorage.getItem("web_push_action");return e?JSON.parse(e):null},Wt=function(e){E.showDelayedAction({clearActionMethod:d(this,Ie).bind(this),data:e,displayMethod:i(this,S,Oe).bind(this),idKey:"web_optin_instance_id",timeValueKey:"entry_time_value"})},Oe=function(e){i(this,S,je).call(this,e)},Ie=new WeakMap,kt=function(e){E.showAfterScrollAction({data:e,displayMethod:i(this,S,Oe).bind(this),timeValueKey:"entry_time_value"})},m(f,ce),m(f,B,null),m(f,le,!1),m(f,q,!1),m(f,Ee,!1),m(f,ve,null);var He=f,W=He.getInstance();var Q,P,Ft,qe,Bt,Mt,de,Ce,$t,Vt,Kt,De,J=class J{constructor(){m(this,P);m(this,de,e=>{E.clearActionInLocalStorage({id:e,localStorageKey:"action"})});this.loadPopupEventActionInLocalStorage=()=>{E.loadActionInLocalStorage({actionCondition:e=>e.message.name==="Popup",actionMethod:e=>i(this,P,qe).call(this,e.campaignId),localStorageKey:"action"})};m(this,De,()=>{E.storeActionInLocalStorageInternal("action")})}static getInstance(){var e;return d(J,Q)||(I(J,Q,new J),i(e=d(J,Q),P,Ft).call(e)),d(J,Q)}showPopup(e){let t=JSON.parse(localStorage.getItem("action")||"{}");if(t&&t[e==null?void 0:e.campaignId]){s(1,"Popup already in cache");return}i(this,P,Kt).call(this,e),d(this,De).call(this),i(this,P,qe).call(this,e.campaignId)}isPopupAction(e){return e==="Popup"}};Q=new WeakMap,P=new WeakSet,Ft=function(){return a(this,null,function*(){})},qe=function(e){let t=i(this,P,Bt).call(this);if(document.getElementById(`popup_container_${e}`)){s(1,"Popup already displayed"),d(this,de).call(this,e);return}if(t!=null&&t[e])switch(t[e].campaignEntryTime){case"DELAY":{i(this,P,Mt).call(this,t[e]);break}case"IMMEDIATELY":{i(this,P,Ce).call(this,t[e]);break}case"SCROLL":{i(this,P,Vt).call(this,t[e]);break}default:return}},Bt=function(){let e=localStorage.getItem("action");return e?JSON.parse(e):null},Mt=function(e){E.showDelayedAction({clearActionMethod:d(this,de).bind(this),data:e,displayMethod:i(this,P,Ce).bind(this),idKey:"campaignId",timeValueKey:"campaignEntryTimeValue"})},de=new WeakMap,Ce=function(e){if(document.getElementById(`popup_container_${e.campaignId}`))s(1,"Popup already displayed");else{let t=i(this,P,$t).call(this,"div",e);document.body.appendChild(t),u.recordEvent({campaignCustomerInstanceId:e.campaignCustomerInstanceId,campaignId:e.campaignId,eventName:te,eventProperties:[{eventProperty:"Popup View",value:JSON.stringify({campaignId:e.campaignId})}],name:"view"})}d(this,de).call(this,e.campaignId)},$t=function(e,t){let{campaignCustomerInstanceId:n,campaignId:r,message:{design:o}}=t,c=document.createElement(e);c.id=`popup_container_${r}`,c.innerHTML=o,c.style.position="fixed",c.style.top="0",c.style.left="0",c.style.width="100%",c.style.height="100%",c.style.zIndex="99999999";let h=c.querySelector(".u-popup-container");h&&(h.style.zIndex="50");let v=h.querySelector(".u-popup-overlay");v&&(s(1,"Popup overlay element found"),v.style.setProperty("display","block","important")),c.querySelectorAll('[id^="u_content_form_"]').forEach(y=>{let D=y.querySelector("form");D&&D.addEventListener("submit",()=>a(this,null,function*(){c.remove();let k=new FormData(D),F={};for(let[O,_]of k.entries())F[O]=_;yield u.recordEvent({campaignCustomerInstanceId:n,campaignId:r,eventName:te,eventProperties:[{eventProperty:"Form Submit",value:JSON.stringify({campaignId:r,formId:y.id,formValues:F})},{eventProperty:"Campaign Id",value:r.toString()}],name:"form"})}))});let b=c.querySelector(".u-close-button");return(b==null?void 0:b.getAttribute("href"))==="#"&&b.removeAttribute("href"),b==null||b.addEventListener("click",()=>a(this,null,function*(){c.remove(),yield u.recordEvent({campaignCustomerInstanceId:n,campaignId:r,eventName:te,eventProperties:[{eventProperty:"Close Click",value:JSON.stringify({campaignId:r})}],name:"close"})})),c.querySelectorAll('[id^="u_content_button_"]').forEach(y=>{y.addEventListener("click",()=>a(this,null,function*(){c.remove(),yield u.recordEvent({campaignCustomerInstanceId:n,campaignId:r,eventName:te,eventProperties:[{eventProperty:"Button Click",value:JSON.stringify({buttonId:y.id,campaignId:r})}],name:"click"})}))}),c.querySelectorAll(".u-popup-container img").forEach(y=>{y.addEventListener("click",()=>a(this,null,function*(){c.remove(),yield u.recordEvent({campaignCustomerInstanceId:n,campaignId:r,eventName:te,eventProperties:[{eventProperty:"Image Click",value:JSON.stringify({campaignId:r,imageClassName:y.className,imageId:y.id})}],name:"click"})}))}),c},Vt=function(e){E.showAfterScrollAction({data:e,displayMethod:i(this,P,Ce).bind(this),timeValueKey:"campaignEntryTimeValue"})},Kt=function(e){E.storeActionInLocalStorage(e,"action","campaignId")},De=new WeakMap,m(J,Q);var Ye=J,H=Ye.getInstance();var ue,fe,he,be,ye,we,Te,Ue,p,Ht,jt,zt,Se,Ze,Xe,et,tt,Gt,Yt,qt,Qt,Zt,Xt,en,nt,rt,tn,nn,Z=class Z{constructor(){m(this,p);m(this,fe);m(this,he);m(this,be);m(this,ye,null);m(this,we,null);m(this,Te,!1);m(this,Ue,()=>{setInterval(()=>{let e=localStorage.getItem("mergn_shopify");if(e!==d(this,we)){I(this,we,e);let t=JSON.parse(e||"{}");if(t!=null&&t.pushMessageToSW){let n=t.pushMessageToSW;delete t.pushMessageToSW,localStorage.setItem("mergn_shopify",JSON.stringify(t)),W.pushMessageToSW(n)}if(t!=null&&t.optIn){let n=t.optIn;delete t.optIn,localStorage.setItem("mergn_shopify",JSON.stringify(t)),W.showNotification(n)}if(t!=null&&t.campaigns){let n=t.campaigns;delete t.campaigns,localStorage.setItem("mergn_shopify",JSON.stringify(t)),n.forEach(r=>{H.isPopupAction(r.message.name)?H.showPopup(r):ae.isContentCardAction(r.message.name)&&ae.showContentCard(r)})}}},1e3)});this.storeActionInLocalStorageInternal=e=>{let t=()=>{let n=JSON.parse(localStorage.getItem(e)||"{}");Object.keys(n).forEach(r=>{n[r].initialTime=new Date().getTime()}),localStorage.setItem(e,JSON.stringify(n))};t(),window.addEventListener("beforeunload",t)};this.clearActionInLocalStorage=({id:e,localStorageKey:t})=>{let n=JSON.parse(localStorage.getItem(t)||"{}");n[e]&&delete n[e],localStorage.setItem(t,JSON.stringify(n))};this.loadActionInLocalStorage=({actionCondition:e,actionMethod:t,localStorageKey:n})=>{let r=JSON.parse(localStorage.getItem(n)||"{}");Object.keys(r).forEach(o=>{e(r[o])&&t(r[o])})}}static getInstance(){return d(Z,ue)||I(Z,ue,new Z),d(Z,ue)}init(e,t){return a(this,null,function*(){s(1,"Initializing base service"),t!=null&&t.shopify&&I(this,Te,!0),i(this,p,Ht).call(this,e);let n=this.getPlatform();if(n==="Crawlers"||n==="Unknown"){s(2,"Not initializing base service for crawlers or unknown platforms");return}if(yield N.syncRealWorldTime(),s(1,"Verifying API Key"),yield i(this,p,nt).call(this),t!=null&&t.shopify&&d(this,Ue).call(this),t!=null&&t.identity)try{g.loading=!0,yield this.setIdentity(t.identity)}finally{g.loading=!1}setInterval(()=>a(this,null,function*(){s(1,"Verifying API Key after timeout"),yield i(this,p,nt).call(this)}),3e5);let r=i(this,p,Se).call(this);if(yield this.checkTTL(),yield u.recordEventsFromQueue(),u.recordDebugEvents({eventName:"base_init"}),s(1,"Initializing notification service from Base Service"),yield A("notification service",()=>a(this,null,function*(){yield W.init(r,t==null?void 0:t.swPath)})),!(t!=null&&t.shopify)){yield i(this,p,nn).call(this);let o=history.pushState;history.pushState=(...c)=>{o.apply(history,c),i(this,p,tn).call(this)}}s(1,"tracking page change register")})}setPlatform(e){I(this,fe,e)}setOSVersion(e){I(this,he,e)}setOperatingSystem(e){I(this,be,e)}setPreviousUrl(e){I(this,ye,e)}getPreviousUrl(){return d(this,ye)}getPlatform(){return d(this,fe)}getOSVersion(){return d(this,he)}getOperatingSystem(){return d(this,be)}updateSessionCreated(){localStorage.setItem("ttl",`${new Date().getTime()}`)}showAfterScrollAction({data:e,displayMethod:t,timeValueKey:n}){let r=()=>{var b;let o=window.innerHeight,c=document.documentElement.scrollHeight;window.scrollY/(c-o)*100>(((b=e[n])==null?void 0:b.value)||0)&&(window.removeEventListener("scroll",r),t(e))};window.addEventListener("scroll",r)}showDelayedAction({clearActionMethod:e,data:t,displayMethod:n,idKey:r,timeValueKey:o}){var v,b,y;let c=(v=t[o])==null?void 0:v.value;((b=t[o])==null?void 0:b.duration)==="min"&&(c=c*60);let h=t.initialTime-500+(c||0)*1e3-new Date().getTime();s(1,`Initial time: ${t.initialTime}`),s(1,`Time value: ${(y=t[o])==null?void 0:y.value}`),s(1,`Current time: ${new Date().getTime()}`),s(1,`Time difference: ${h}`),h>0?setTimeout(()=>{e(t[r]),n(t)},h):(e(t[r]),n(t))}storeActionInLocalStorage(e,t,n){var c;let r=JSON.parse(localStorage.getItem(t)||"{}"),o=(c=n in e&&e[n])!=null?c:"";o&&(r[o]=Pe(z({},e),{initialTime:new Date().getTime()}),localStorage.setItem(t,JSON.stringify(r)))}checkTTL(){return a(this,null,function*(){yield A("# check TTL",()=>a(this,null,function*(){if(d(this,Te))return;s(1,"Checking TTL"),C("Checking TTL",!0),L("Checking TTL Time",!0);let e=localStorage.getItem("ttl"),t=!1;if(e){if(t=i(this,p,Se).call(this,e),t){let n=localStorage.getItem("session"),r=localStorage.getItem("ttl");n&&r&&u.recordEvent({eventName:"Web Session Concluded",eventProperties:[{eventProperty:"SESSION_ID",value:localStorage.getItem("session")},{eventProperty:"SESSION_CREATED",value:new Date(parseInt(r,10)).toISOString()}]}),this.clearLocalStorage(),localStorage.setItem("ttl",`${new Date().getTime()}`)}}else localStorage.setItem("ttl",`${new Date().getTime()}`);(!e||t||i(this,p,Yt).call(this))&&(i(this,p,tt).call(this)&&i(this,p,qt).call(this),i(this,p,et).call(this)&&(yield this.setIdentity()),(i(this,p,Se).call(this)||i(this,p,Ze).call(this))&&(yield i(this,p,Xt).call(this)),yield i(this,p,Qt).call(this),(i(this,p,Se).call(this)||i(this,p,Xe).call(this))&&(yield i(this,p,en).call(this))),L("Checking TTL Time",!1),C("Checking TTL",!1)}))})}clearLocalStorage(){localStorage.removeItem("action"),localStorage.removeItem("events"),localStorage.removeItem("attributes"),localStorage.removeItem("offlineEvents"),localStorage.removeItem("ttl"),localStorage.removeItem("session")}setIdentity(e){return a(this,null,function*(){let t={deviceId:localStorage.getItem("uniqueIdentity")||crypto.randomUUID(),os:this.getPlatform()};if(e)t.identity=e;else if(!e&&localStorage.getItem("customer"))return;try{let n=yield i(this,p,Zt).call(this,t);if(n!==void 0){localStorage.setItem("customer",n);try{W.pushMessageToSW({customer:n})}catch(r){}}}catch(n){throw new Error("Error setting identity")}})}};ue=new WeakMap,fe=new WeakMap,he=new WeakMap,be=new WeakMap,ye=new WeakMap,we=new WeakMap,Te=new WeakMap,Ue=new WeakMap,p=new WeakSet,Ht=function(e){N.updateAPIKey(e),this.setPlatform(i(this,p,jt).call(this)),this.setOSVersion(i(this,p,zt).call(this)),this.setOperatingSystem(navigator.userAgent)},jt=function(){var t;let e=navigator.userAgent.toLowerCase();return/googlebot|bingbot|yandexbot|duckduckbot|slurp|twitterbot|linkedinbot|facebot|pinterest|vkshare|applebot|baiduspider|adsbot-google|msnbot|yahoobot|sogou|facebookexternalhit/i.test(e)?"Crawlers":/wv|wkwebview|instagram|facebook|fbav|fban|twitter|snapchat|pinterest|linkedin|tiktok/i.test(e)?"Mobile":/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(e)?("Notification"in window&&typeof((t=window==null?void 0:window.Notification)==null?void 0:t.permission)!="undefined","Mobile"):/windows|macintosh|linux|x11/i.test(e)?"Web":"Unknown"},zt=function(){let e=navigator.userAgent,t;return e.indexOf("Chrome")>-1?t="Google Chrome":e.indexOf("Safari")>-1?t="Safari":e.indexOf("Firefox")>-1?t="Mozilla Firefox":e.indexOf("Edg")>-1?t="Microsoft Edge":e.indexOf("MSIE")>-1?t="Internet Explorer":t="Unknown",t},Se=function(e){let t;return e||(t=localStorage.getItem("ttl")),e||t?new Date().getTime()-parseInt(e||t||"",10)>12e5:!0},Ze=function(){return!localStorage.getItem("events")},Xe=function(){return!localStorage.getItem("attributes")},et=function(){return!localStorage.getItem("customer")},tt=function(){return!localStorage.getItem("uniqueIdentity")},Gt=function(){return!localStorage.getItem("session")},Yt=function(){return i(this,p,Ze).call(this)||i(this,p,Xe).call(this)||i(this,p,et).call(this)||i(this,p,tt).call(this)||i(this,p,Gt).call(this)},qt=function(){let e=localStorage.getItem("uniqueIdentity");return e||(e=crypto.randomUUID(),localStorage.setItem("uniqueIdentity",e)),e},Qt=function(){return a(this,null,function*(){yield A("store session",()=>a(this,null,function*(){let e=localStorage.getItem("session");e||(e=crypto.randomUUID(),localStorage.setItem("session",e),yield u.recordEvent({eventName:"Web Session Started",eventProperties:[{eventProperty:"SESSION_ID",value:localStorage.getItem("session")},{eventProperty:"SESSION_CREATED",value:new Date(parseInt(localStorage.getItem("ttl")||"",10)).toISOString()}]}))}),e=>{u.recordEvent({eventName:"Debug Event",eventProperties:[{eventProperty:"message",value:`store session - ${e.message}`}]},!0)})})},Zt=function(e){return a(this,null,function*(){try{return(yield N.post(`${It}${ft}`,e)).data}catch(t){throw new Error("Error posting identity data")}})},Xt=function(){return a(this,null,function*(){yield u.storeEventsAndPropertiesInLocalStorage()})},en=function(){return a(this,null,function*(){yield me.storeAttributeInLocalStorage()})},nt=function(){return a(this,null,function*(){yield A("verify API key",()=>a(this,null,function*(){var e;try{let t=parseInt(localStorage.getItem("verifyTTL")||"0",10)||0;if(!t||t&&new Date().getTime()>t){let n=yield N.get("/brand");if(!(n!=null&&n.success))throw new Error(JSON.stringify(n));localStorage.setItem("verifyTTL",(new Date().getTime()+3e5).toString())}g.isInitialized=!0}catch(t){throw N.getBrandId()==="67"&&!((e=t==null?void 0:t.message)!=null&&e.startsWith("get"))&&u.recordEvent({eventName:"Debug Event",eventProperties:[{eventProperty:"message",value:`verifyAPIKey - ${t.message}`}]},!0),g.disableSDK=!0,new Error("Error verifying API key")}}))})},rt=function(){return a(this,null,function*(){var n;s(1,"Performing viewed web page event");let e=(n=window==null?void 0:window.location)==null?void 0:n.href;this.setPreviousUrl(e),u.recordDebugEvents({eventName:"pre_vwp"});let t=[];new URLSearchParams(new URL(window.location.href).search).forEach((r,o)=>a(this,null,function*(){wt.has(o)&&t.push({eventProperty:o,value:r})})),yield u.recordEvent({eventName:"Viewed Webpage",eventProperties:[{eventProperty:"URL",value:window.location.pathname},...t]})})},tn=function(){return a(this,null,function*(){var t;s(1,"Tracking page change");let e=(t=window==null?void 0:window.location)==null?void 0:t.href;(this.getPreviousUrl()===null||this.getPreviousUrl()===void 0||e!==this.getPreviousUrl())&&(yield i(this,p,rt).call(this))})},nn=function(){return a(this,null,function*(){var t,n;let e=(t=window==null?void 0:window.location)==null?void 0:t.href;u.recordDebugEvents({eventName:"show_notification_error",eventProperties:[{eventProperty:"message",value:`${e!==this.getPreviousUrl()}:${e}:${this.getPreviousUrl()}`}]});try{yield i(this,p,rt).call(this)}catch(r){let o=r&&r.message?(n=r==null?void 0:r.message)==null?void 0:n.substring(0,100):"undefined";yield u.recordDebugEvents({eventName:"vwp_error",eventProperties:[{eventProperty:"message",value:`${o}`}]})}})},m(Z,ue);var Qe=Z,E=Qe.getInstance();var X,R,rn,xe,on,sn,an,cn,j=class j{constructor(){m(this,R);this.queue=Promise.resolve()}static getInstance(){var e;return d(j,X)||(I(j,X,new j),i(e=d(j,X),R,rn).call(e)),d(j,X)}pushToQueue(e){let t=JSON.parse(localStorage.getItem("preInitializedEvents")||"[]");t.push(e),localStorage.setItem("preInitializedEvents",JSON.stringify(t))}recordEventsFromQueue(){return a(this,null,function*(){let e=JSON.parse(localStorage.getItem("preInitializedEvents")||"[]");if(Array.isArray(e))for(let t of e)yield this.recordEventPreInitialized(t)})}recordEvent(e,t){return a(this,null,function*(){g.isInitialized&&!g.loading?yield i(this,R,xe).call(this,e,t):this.pushToQueue(e)})}recordEventPreInitialized(e){return a(this,null,function*(){try{yield i(this,R,xe).call(this,e)}finally{i(this,R,cn).call(this,e.eventName)}})}recordDebugEvents(e){return a(this,null,function*(){g.debugLevel===4&&(!g.recordDebugEventsToggle||g.recordDebugEventsToggle[e.eventName])&&(yield i(this,R,xe).call(this,e))})}getStoredEvents(){let e=localStorage.getItem("events");return e?JSON.parse(e):{}}storeEventsAndPropertiesInLocalStorage(){return a(this,null,function*(){if(!localStorage.getItem("events")){let e=(yield this.fetchEventData()).data;if(e){localStorage.setItem("events",JSON.stringify(e));try{W.pushMessageToSW({events:e})}catch(t){}}}})}fetchEventData(){return a(this,null,function*(){try{return yield N.get(`${Fe}`)}catch(e){throw new Error("Error fetching event data")}})}postEventRecord(e,t){return a(this,null,function*(){let n=null,r=null,o=new AbortController;return this.queue=this.queue.then(()=>a(this,null,function*(){try{if(e.events.length===0)throw new Error("No events to record");let c=yield N.post(`/v2${Fe}${vt}`,e,o.signal);if(c.success)return r=c,c;if(c.message===`Customer with id ${localStorage.getItem("customer")} not exists`)throw localStorage.removeItem("customer"),new Error("Re initializing customer Id")}catch(c){throw s(2,"Error posting event record:"),s(2,`name: ${c.name}`),s(2,`message: ${c.message}`),(c.name==="AbortError"||c.name==="TypeError"&&c.message==="Failed to fetch")&&(s(2,"Request aborted"),t&&i(this,R,an).call(this,t)),n=new Error("Error posting event record"),c}return null})).catch(()=>{}),this.queue.then(()=>{if(n)throw n;return r})})}};X=new WeakMap,R=new WeakSet,rn=function(){return a(this,null,function*(){})},xe=function(e,t){return a(this,null,function*(){yield A("# record event",()=>a(this,null,function*(){var at,ct,lt,dt;let{campaignCustomerInstanceId:n,campaignId:r,eventName:o,eventProperties:c,name:h,web_optin_instance_id:v}=e;s(1,"# Recording event"),C("Recording event",!0),L("Recording event Time",!0),s(1,"Event Payload"),s(1,{campaignCustomerInstanceId:n,eventName:o,eventProperties:c,name:h,web_optin_instance_id:v});let b=E.getPlatform();if(b==="Crawlers"||b==="Unknown")throw new Error("Invalid platform");o!=="Web Session Concluded"&&(yield E.checkTTL());let y=[];c&&y.push(...c),y.push({eventProperty:"Platform",value:b}),y.push({eventProperty:"operating-system",value:E.getOperatingSystem()}),y.push({eventProperty:"os-version",value:E.getOSVersion()});let D=this.getStoredEvents(),k=i(this,R,on).call(this,D,o,y);if(typeof k=="string"){s(2,k);return}E.updateSessionCreated();let{id:F}=D[o],O=i(this,R,sn).call(this,z(Pe(z(z(z({},n?{campaignCustomerInstanceId:n}:{}),r?{campaignId:r}:{}),v?{web_optin_instance_id:v}:{}),{eventId:F,eventProperties:k,sessionId:localStorage.getItem("session")||""}),h?{name:h}:{}));if(g.offline){let M=JSON.parse(localStorage.getItem("offlineEvents")||"[]");M.length<=50&&(M.push(...O.events),localStorage.setItem("offlineEvents",JSON.stringify(M)));return}let _=yield this.postEventRecord(O,e);(at=_==null?void 0:_.data)!=null&&at.optIn?(yield this.recordDebugEvents({eventName:"optin_data"}),W.showNotification(_.data.optIn)):o==="Viewed Webpage"&&(yield this.recordDebugEvents({eventName:"no_optin",eventProperties:[{eventProperty:"message",value:`${"Notification"in window&&typeof((ct=window==null?void 0:window.Notification)==null?void 0:ct.permission)!="undefined"}`}]})),(dt=(lt=_==null?void 0:_.data)==null?void 0:lt.campaigns)==null||dt.forEach(M=>{H.isPopupAction(M.message.name)?H.showPopup(M):ae.isContentCardAction(M.message.name)&&ae.showContentCard(M)}),L("Recording event Time",!1),C("Recording event",!1)}),n=>{this.recordEvent({eventName:"Debug Event",eventProperties:[{eventProperty:"message",value:`record event - ${e} - ${n.message}`}]},!0)},t)})},on=function(e,t,n){if(!Object.prototype.hasOwnProperty.call(e,t))return`Event ${t} is not valid.`;if(!n)return[];let r=e[t];if(!(r!=null&&r.eventProperty))return`Event ${t} does not have a valid eventProperty.`;let o=n.filter(({eventProperty:c})=>!Object.prototype.hasOwnProperty.call(r.eventProperty,c)).map(({eventProperty:c})=>c);return o.length>0?`Event ${t} has invalid eventProperties: ${o.join(", ")}.`:n.map(({eventProperty:c,value:h})=>({eventPropertyId:r.eventProperty[c].id,value:h}))},sn=function(e){return{customerId:localStorage.getItem("customer")||"",deviceId:localStorage.getItem("uniqueIdentity")||"",events:[e]}},an=function(e){s(1,"Adding to pre-initialized event:"),s(1,e);let t=localStorage.getItem("preInitializedEvents");t&&t!=="undefined"?(t=JSON.parse(t),t.push(e)):t=[e],localStorage.setItem("preInitializedEvents",JSON.stringify(t))},cn=function(e){let t=JSON.parse(localStorage.getItem("preInitializedEvents")||"[]"),n=t.findIndex(r=>r.eventName===e);n>=0&&t.splice(n,1),localStorage.setItem("preInitializedEvents",JSON.stringify(t))},m(j,X);var it=j,u=it.getInstance();var g=class extends Error{constructor(e){super(e),this.name="MergnError"}};g.disableSDK=!1,g.offline=!navigator.onLine,g.debugLevel=0,g.isInitialized=!1,g.loading=!1;var vn=(l,e)=>{e instanceof g?s(2,`OriginateFrom: ${l}
72
- MergnError: ${e.message}`):e instanceof Error?s(2,`OriginateFrom: ${l}
73
- Unexpected error: ${e.message}`):s(2,`OriginateFrom: ${l}
74
- Unexpected error: ${String(e)}`)},A=(l,e,t,n=!1)=>a(void 0,null,function*(){try{C(l,!0),L(`${l} Time`,!0);try{if(g.disableSDK)throw new g("Mergn SDK is disabled!");if(l!=="record event"&&g.offline)throw new g("Mergn is offline!");if(l!=="init"&&l!=="verify API key"&&l!=="record event"&&l!=="recordAttribute"&&!g.isInitialized)throw new g("Mergn not initialized!");if(l!=="login"&&g.loading)throw new g("Mergn is loading!");return yield e()}catch(r){return t?t(r):(g.debugLevel===2||g.debugLevel===3)&&vn(l,r),!n&&N.getBrandId()==="67"&&r.message!=="Failed to fetch"&&u.recordEvent({eventName:"Debug Event",eventProperties:[{eventProperty:"message",value:`${l} - ${r.message}`}]},!0),null}finally{L(`${l} Time`,!1),C(l,!1)}}catch(r){return null}});var U=(o=>(o[o.NONE=0]="NONE",o[o.INFO=1]="INFO",o[o.ERROR=2]="ERROR",o[o.ALL=3]="ALL",o[o.DEBUG=4]="DEBUG",o))(U||{}),s=(l,e)=>{g.debugLevel!==0&&(g.debugLevel>=3?l===1?console.info(`INFO: ${new Date().toISOString()}`,e):l===2&&console.error(`ERROR: ${new Date().toISOString()}`,e):g.debugLevel===1&&l===1?console.info(`INFO: ${new Date().toISOString()}`,e):g.debugLevel===2&&l===2&&console.error(`ERROR: ${new Date().toISOString()}`,e))},L=(l,e)=>{g.debugLevel!==0&&(e?console.time(l):console.timeEnd(l))},C=(l,e)=>{g.debugLevel!==0&&(e?console.group(l):console.groupEnd())};var pe,ee=class ee{constructor(){}static getInstance(){return d(ee,pe)||I(ee,pe,new ee),d(ee,pe)}init(e,t){setTimeout(()=>{A("init",()=>a(this,null,function*(){s(1,"Initializing Mergn SDK"),yield E.init(e,t),u.recordDebugEvents({eventName:"mergn_init"}),s(1,"Mergn SDK Initialized");let n=JSON.parse(localStorage.getItem("preInitializedAttributes")||"[]");Array.isArray(n)&&n.forEach((r,o)=>a(this,null,function*(){yield me.recordAttribute(r.attributeName,r.attributeValue),n.splice(o,1),localStorage.setItem("preInitializedAttributes",JSON.stringify(n))})),window.addEventListener("online",()=>a(this,null,function*(){g.offline=!1;let r=JSON.parse(localStorage.getItem("offlineEvents")||"[]");Array.isArray(r)&&(yield u.postEventRecord({customerId:localStorage.getItem("customer")||"",deviceId:localStorage.getItem("uniqueIdentity")||"",events:r}),localStorage.removeItem("offlineEvents")),E.checkTTL(),E.updateSessionCreated()})),window.addEventListener("offline",()=>{g.offline=!0}),window.addEventListener("load",()=>{H.loadPopupEventActionInLocalStorage(),W.loadWebPushActionInLocalStorage()})}))})}setDebugLevel(e,t){if(!(e in U)){console.error(`Debug level must be according to:
75
- NONE: 0, INFO: 1, ERROR: 2, ALL: 3`);return}g.recordDebugEventsToggle=t||{},g.debugLevel=e;try{W.pushMessageToSW({debugLevel:e})}catch(n){}}recordAttribute(e,t){return a(this,null,function*(){return new Promise((n,r)=>{setTimeout(()=>a(this,null,function*(){try{yield A("recordAttribute",()=>a(this,null,function*(){let o;Array.isArray(t)?o=JSON.stringify(t):typeof t=="number"?o=`${t}`:o=t,s(1,"Recording attribute"),s(1,`Attribute Name: ${e}, Attribute Value: ${o}`);let c=JSON.parse(localStorage.getItem("preInitializedAttributes")||"[]");c.push({attributeName:e,attrValueStringified:o}),localStorage.setItem("preInitializedAttributes",JSON.stringify(c)),g.isInitialized&&(yield me.recordAttribute(e,o))})),n()}catch(o){r(o)}}))})})}login(e){return a(this,null,function*(){return new Promise((t,n)=>{setTimeout(()=>a(this,null,function*(){try{yield A("login",()=>a(this,null,function*(){s(1,"Logging in"),s(1,`Identity: ${e}`),g.loading=!0,yield E.setIdentity(e)})),t()}catch(r){n(r)}finally{g.loading=!1,yield u.recordEventsFromQueue()}}))})})}logout(){setTimeout(()=>{A("logout",()=>a(this,null,function*(){s(1,"Logging out"),E.clearLocalStorage()}))})}recordEvent(e,t){return a(this,null,function*(){return new Promise((n,r)=>{setTimeout(()=>a(this,null,function*(){try{yield A("record event",()=>a(this,null,function*(){s(1,"Recording event"),s(1,`Event Payload:
76
- ${{eventName:e,eventProperties:t}}`),yield u.recordEvent({eventName:e,eventProperties:t})})),n()}catch(o){r(o)}}))})})}getVersion(){return mt}};pe=new WeakMap,m(ee,pe);var ot=ee,st=ot.getInstance();typeof window!="undefined"&&(window.mergn=st);var Bi=st;})();
1
+ 'use strict';function _0x19fb(_0x2d2358,_0x1cf3e5){const _0x50684e=_0x5068();return _0x19fb=function(_0x19fb91,_0x36c5da){_0x19fb91=_0x19fb91-0xb4;let _0x925264=_0x50684e[_0x19fb91];return _0x925264;},_0x19fb(_0x2d2358,_0x1cf3e5);}(function(_0x212f5f,_0x5594b0){const _0x270845=_0x19fb,_0x6a03f1=_0x212f5f();while(!![]){try{const _0x176ebc=parseInt(_0x270845(0x162))/0x1+-parseInt(_0x270845(0x16b))/0x2*(parseInt(_0x270845(0xeb))/0x3)+parseInt(_0x270845(0x10f))/0x4+parseInt(_0x270845(0xcc))/0x5*(parseInt(_0x270845(0x1a0))/0x6)+-parseInt(_0x270845(0x14e))/0x7*(-parseInt(_0x270845(0x209))/0x8)+-parseInt(_0x270845(0x235))/0x9*(-parseInt(_0x270845(0x196))/0xa)+-parseInt(_0x270845(0x1ff))/0xb*(parseInt(_0x270845(0x242))/0xc);if(_0x176ebc===_0x5594b0)break;else _0x6a03f1['push'](_0x6a03f1['shift']());}catch(_0x473fa5){_0x6a03f1['push'](_0x6a03f1['shift']());}}}(_0x5068,0xe2e0c));function _0x5068(){const _0x34c48e=['utm_source','banner_text','SESSION_ID','Pushing\x20message\x20to\x20service\x20worker','offlineEvents','Failed\x20to\x20request\x20notification\x20permission','subtitle','Failed\x20to\x20load','height','addEventListener','\x20does\x20not\x20have\x20a\x20valid\x20eventProperty.','campaignEntryTimeValue','Initializing\x20notification\x20service\x20from\x20Base\x20Service','showContentCard','toString','getElementById','ERROR:\x20','entry_time','success','alt','debugLevel','Mergn\x20SDK\x20is\x20disabled!','TypeError','verifyAPIKey\x20-\x20','should_set_identity','DEBUG','post\x20-\x20','optIn','Edg','init_condition','campaigns','[id^=\x22u_content_button_\x22]','Checking\x20for\x20existing\x20subscription','Mobile','Service\x20Worker\x20and\x20Push\x20Manager\x20are\x20supported','add','Popup\x20Action','isContentCardAction','https://u23z4zsda8.execute-api.ap-southeast-1.amazonaws.com/Prod/sdk-management/api','denied','\x0apadding:\x2012px\x2020px;\x0aborder:\x20none;\x0abackground-color:\x20\x20','\x0amargin-bottom:\x205px;\x0afont-size:\x2013px;\x0acolor:\x20','#\x20record\x20event','vwp_error','store\x20session','isArray','removeItem','showAfterScrollAction','showDelayedAction','Crawlers','propertyIsEnumerable','form','body','remove','12935oVypDU','User\x20denied\x20the\x20notification\x20permission.','defineProperty','\x0abackground-color:\x20','pre_vwp','attributeProperty','campaignId','INFO:\x20','web_push_action','createElement','record\x20event','getTime','Failed\x20to\x20push\x20message\x20to\x20service\x20worker:\x20','img','Initializing\x20Mergn\x20SDK','postEventRecord','URL','text','MSIE','Popup\x20View','Attribute\x20','recordDebugEvents','Notification\x20permission:\x20','recordEventsFromQueue','granted','substring','DELAY','Not\x20initializing\x20base\x20service\x20for\x20crawlers\x20or\x20unknown\x20platforms','outerHTML','storeActionInLocalStorageInternal','getAttribute','13425icylmu','signal','push_manager','recordDebugEventsToggle','banner_title','Error\x20posting\x20event\x20record','Close\x20Click','getOSVersion','removeEventListener','utm_campaign','Service\x20Worker\x20registration','loading','button-2','getPreviousUrl','SCROLL','verify\x20API\x20key','1.0.121','init','Allowed\x20Web\x20Push\x20Subscription','active','login','utm_term','tracking\x20page\x20change\x20register','\x20not\x20exists','info','Notification','eventName','Error\x20posting\x20event\x20record:','.u-popup-container','eventProperty','storeActionInLocalStorage','get','display','Performing\x20viewed\x20web\x20page\x20event','Popup\x20overlay\x20element\x20found','PushManager','5891592MtIIeT','location','duration',';\x0acursor:\x20pointer;\x0aborder-radius:\x205px;\x0awidth:\x2048%;\x0a','values','popup_container_','Mergn\x20not\x20initialized!','Invalid\x20platform','permission','FBCLID','\x20is\x20not\x20valid.','100%','unsubscribe','verifyTTL','setPreviousUrl','join','click','querySelectorAll',',\x20Attribute\x20Value:\x20','set','isInteger','[id^=\x22u_content_form_\x22]','cssText','UTM_TERM','test','notification_permission_error','serviceWorker','name','online','GCLID','Service\x20Worker\x20registration\x20is\x20available','getOperatingSystem','getAPIKey','No\x20existing\x20subscription\x20found','default','loadWebPushActionInLocalStorage','recordEvent','Safari','events','showNotification','mergn','title','Recording\x20event\x20Time','mergn_init','style','getStoredEvents','error','shopify','resolve','isPopupAction','map','loadPopupEventActionInLocalStorage','brandId','initialTime','content_card','Closed\x20Web\x20Push\x20Subscription','Debug\x20Event','bind','hasOwnProperty','push','Attribute\x20value\x20is\x20required','subscribed','Turned\x20Off\x20Notification\x20Reset\x20Permission','28tuijLN','\x20has\x20invalid\x20attributeProperties:\x20','scroll','message','scrollY','apiKey','Adding\x20to\x20pre-initialized\x20event:','NONE','Error\x20fetching\x20attribute\x20data','innerHTML','startsWith','Viewed\x20Web\x20Push\x20Soft-ask','Web','UTC\x20Date\x20or\x20last\x20sync\x20time\x20is\x20not\x20set','updateAPIKey','two_step','text_color','Cannot\x20add\x20the\x20same\x20private\x20member\x20more\x20than\x20once','recordEventPreInitialized','access\x20private\x20method','325669TdaDgX','Service\x20Worker\x20registered','uniqueIdentity','service_worker','centered-image','findIndex','splice','zIndex','/brand/get-web-push-public-key','580ZCLaXp','catch','setOperatingSystem','stringify','banner_image','data','postMessage','width','Unknown','99999999','getItem','view','button_2','checkTTL','campaignEntryTime','UTCDate','gad_source','Event\x20','setIdentity','INFO','top','type','Recording\x20attribute\x20Time','post','UTM_MEDIUM','src','fetchAttributeData','button_1','string','getBrandId','GAD_SOURCE','keys','Internet\x20Explorer','getOwnPropertyDescriptors','mergn_shopify','time','notification\x20service','entry_time_value','getRegistrations','block','appendChild','application/json','next','1051570BKEllE','recordAttribute','setPlatform','/brand/get-time','Error\x20storing\x20attribute\x20data\x20in\x20local\x20storage','/event','customer','href','logout','Accepted\x20Web\x20Push\x20Soft-ask','1614xAwsxD','\x20-\x20\x20','Web\x20Session\x20Started','attributes','getOwnPropertySymbols','pushManager','parse','groupEnd','disableSDK','Blocked\x20Web\x20Push\x20Subscription','User\x20granted\x20the\x20notification\x20permission.','Image','check_permission','get\x20-\x20','Notification\x20already\x20in\x20cache','setOSVersion','utm_content','Checking\x20TTL','Web\x20Session\x20Concluded','Request\x20aborted','json','querySelector','os-version','campaignCustomerInstanceId','toLowerCase','submit','/customer','Platform','innerHeight','Recording\x20attribute','Error\x20posting\x20attribute\x20record','OriginateFrom:\x20','Service\x20Worker\x20registration\x20failed:','The\x20user\x20has\x20already\x20enabled\x20notifications.','put','queue','auto','loadContentCardEventActionInLocalStorage','fetchEventData','ERROR','Turned\x20Off\x20Notification','UTM_CONTENT','Recording\x20event','Firefox','mergn-column-75','SESSION_CREATED','min','#\x20check\x20TTL','backgroundColor','subscribe','Checking\x20TTL\x20Time','Logging\x20out','prototype',';\x0apadding:\x2015px;\x0aborder-radius:\x205px;\x0amax-width:\x20380px;\x0amax-height:\x20463px;\x0a','load','Event\x20Payload','swPath','Reachability\x20Push\x20Web','isInitialized','\x20has\x20invalid\x20eventProperties:\x20','name:\x20','optin_data','getCurrentUTCDate','identity','Popup\x20already\x20displayed','timeEnd','getPlatform','div','\x0adisplay:\x20flex;\x0ajustify-content:\x20space-between;\x0aalign-items:\x20center;\x0aflex-wrap:\x20nowrap;\x0awidth:\x20100%;\x0a','/brand','hidden','reject','pop','mergn-overlay','pushMessageToSW','call','.u-close-button','Time\x20value:\x20','scrollHeight','button-container','lastSyncTime','contentCard_container_','number','IMMEDIATELY','\x20Time','.u-popup-container\x20img','User\x20closed\x20the\x20notification\x20permission\x20dialog.','banner_color','removeAttribute','Logging\x20in','Button\x20Click','toISOString','preInitializedEvents','className','userAgent','4827097WcGqom','filter','getSubscription','.u-popup-overlay','Microsoft\x20Edge','The\x20user\x20has\x20blocked\x20notifications.','done','value','\x0awidth:\x2025%;\x0a','getInstance','2033384MQwqrW','banner_design','clearLocalStorage','action','updateSessionCreated','ContentCard','Initializing\x20Notification\x20Service','storeEventsAndPropertiesInLocalStorage','storeAttributeInLocalStorage','clearActionInLocalStorage','preInitializedAttributes','\x0amax-width:\x20100%;\x0aheight:\x20auto;\x0a','Pushing\x20message\x20to\x20service\x20worker\x20for\x20initialization','Re\x20initializing\x20customer\x20Id','Current\x20time:\x20','/attribute','\x0adisplay:\x20flex;\x0aflex-wrap:\x20wrap;\x0amargin-bottom:\x2010px;\x0a','Error\x20verifying\x20API\x20key','offline','mergn-column-25','Initial\x20time:\x20','AbortError','then','pathname',';\x0acolor:\x20','length','has','indexOf','Notification\x20service\x20is\x20not\x20initialized','Attribute\x20Payload:\x0a\x20','undefined','Error\x20fetching\x20event\x20data','documentElement','Popup','textContent','randomUUID','update','ContentCard\x20already\x20displayed','\x20does\x20not\x20have\x20a\x20valid\x20attributeProperty.','PUT','button','Time\x20difference:\x20','syncRealWorldTime','loadActionInLocalStorage','153dMmkMp','requestPermission','overflow','setItem','Customer\x20with\x20id\x20','ContentCard\x20already\x20in\x20cache','session','button-1','viewed','\x0aUnexpected\x20error:\x20','mergn-row','Existing\x20subscription\x20found','forEach','84IjLrja','already_registered','throw','showPopup','Displayed\x20Web\x20Push\x20Subscription','web_optin_instance_id','Checking\x20notification\x20permission:\x20','utm_medium','Failed\x20to\x20fetch','\x0amargin-bottom:\x205px;\x0afont-size:\x2016px;\x0acolor:\x20','color','write\x20to\x20private\x20field','/set-attribute','ttl','ALL','\x20-\x20','Mozilla\x20Firefox','attributeValue','show_notification_error','mergnWebPushPopup','entries','position'];_0x5068=function(){return _0x34c48e;};return _0x5068();}((()=>{const _0x45c3bc=_0x19fb;var _0x5f535d=Object[_0x45c3bc(0xce)],_0x2075d8=Object['defineProperties'],_0x52d907=Object[_0x45c3bc(0x18c)],_0x13882d=Object[_0x45c3bc(0x1a4)],_0x1fb9de=Object['prototype'][_0x45c3bc(0x149)],_0x2ba59a=Object['prototype'][_0x45c3bc(0xc8)],_0x1be584=_0x2c3f19=>{throw TypeError(_0x2c3f19);},_0x671bab=(_0x46348f,_0x5c163b,_0x4ad237)=>_0x5c163b in _0x46348f?_0x5f535d(_0x46348f,_0x5c163b,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x4ad237}):_0x46348f[_0x5c163b]=_0x4ad237,_0x520470=(_0x31c4e6,_0x3e4fee)=>{const _0x1e150c=_0x45c3bc;for(var _0x2e29ff in _0x3e4fee||(_0x3e4fee={}))_0x1fb9de[_0x1e150c(0x1eb)](_0x3e4fee,_0x2e29ff)&&_0x671bab(_0x31c4e6,_0x2e29ff,_0x3e4fee[_0x2e29ff]);if(_0x13882d){for(var _0x2e29ff of _0x13882d(_0x3e4fee))_0x2ba59a[_0x1e150c(0x1eb)](_0x3e4fee,_0x2e29ff)&&_0x671bab(_0x31c4e6,_0x2e29ff,_0x3e4fee[_0x2e29ff]);}return _0x31c4e6;},_0x8c46ba=(_0x11ea29,_0x594c2f)=>_0x2075d8(_0x11ea29,_0x52d907(_0x594c2f)),_0x44f7e6=(_0x54e150,_0x1ecc01,_0x33a054)=>_0x1ecc01[_0x45c3bc(0x223)](_0x54e150)||_0x1be584('Cannot\x20'+_0x33a054),_0x4db2d7=(_0x5823f1,_0x46fbcf,_0x6c224)=>(_0x44f7e6(_0x5823f1,_0x46fbcf,'read\x20from\x20private\x20field'),_0x6c224?_0x6c224[_0x45c3bc(0x1eb)](_0x5823f1):_0x46fbcf[_0x45c3bc(0x10a)](_0x5823f1)),_0x2b65cc=(_0x10e455,_0x463cad,_0x215173)=>_0x463cad[_0x45c3bc(0x223)](_0x10e455)?_0x1be584(_0x45c3bc(0x15f)):_0x463cad instanceof WeakSet?_0x463cad[_0x45c3bc(0xb9)](_0x10e455):_0x463cad[_0x45c3bc(0x122)](_0x10e455,_0x215173),_0x56fdc4=(_0x54d0b3,_0x24c9ff,_0x322cf9,_0x7fbd04)=>(_0x44f7e6(_0x54d0b3,_0x24c9ff,_0x45c3bc(0x24d)),_0x7fbd04?_0x7fbd04[_0x45c3bc(0x1eb)](_0x54d0b3,_0x322cf9):_0x24c9ff['set'](_0x54d0b3,_0x322cf9),_0x322cf9),_0x568680=(_0x516e05,_0x1ed18d,_0x12f2bd)=>(_0x44f7e6(_0x516e05,_0x1ed18d,_0x45c3bc(0x161)),_0x12f2bd),_0x2a2242=(_0x440a5c,_0x2d7e74,_0x3a1c9f)=>new Promise((_0x36a21c,_0x584aaf)=>{const _0x564c74=_0x45c3bc;var _0x1d81eb=_0x1a648d=>{const _0x259daa=_0x19fb;try{_0x3da3c5(_0x3a1c9f[_0x259daa(0x195)](_0x1a648d));}catch(_0x210a4e){_0x584aaf(_0x210a4e);}},_0x19983d=_0x4d9283=>{const _0x27ad4d=_0x19fb;try{_0x3da3c5(_0x3a1c9f[_0x27ad4d(0x244)](_0x4d9283));}catch(_0x5a3678){_0x584aaf(_0x5a3678);}},_0x3da3c5=_0x415ac3=>_0x415ac3[_0x564c74(0x205)]?_0x36a21c(_0x415ac3['value']):Promise[_0x564c74(0x13f)](_0x415ac3[_0x564c74(0x206)])['then'](_0x1d81eb,_0x19983d);_0x3da3c5((_0x3a1c9f=_0x3a1c9f['apply'](_0x440a5c,_0x2d7e74))[_0x564c74(0x195)]());}),_0x51ee6d=_0x45c3bc(0xfb),_0x587ffa=_0x45c3bc(0xbc),_0x5c035e=_0x45c3bc(0x218),_0x33072e=_0x45c3bc(0x24e),_0x2db61c=_0x45c3bc(0x19b),_0x56855d='/record-event',_0x3e5ca9=_0x45c3bc(0x1ba),_0x2350c1='/device/add-device-token',_0x4eb4d9='/set-identity',_0x271ad4=_0x45c3bc(0x16a),_0x5b73c0=_0x45c3bc(0x199),_0x18c678=(_0x5e93f3=>(_0x5e93f3['UTM_SOURCE']=_0x45c3bc(0x258),_0x5e93f3[_0x45c3bc(0x183)]=_0x45c3bc(0x249),_0x5e93f3['UTM_CAMPAIGN']=_0x45c3bc(0xf4),_0x5e93f3[_0x45c3bc(0x126)]=_0x45c3bc(0x100),_0x5e93f3[_0x45c3bc(0x1c9)]=_0x45c3bc(0x1b0),_0x5e93f3[_0x45c3bc(0x189)]=_0x45c3bc(0x17b),_0x5e93f3[_0x45c3bc(0x12c)]='gclid',_0x5e93f3[_0x45c3bc(0x118)]='fbclid',_0x5e93f3))(_0x18c678||{}),_0x16c7b2=new Set(Object[_0x45c3bc(0x113)](_0x18c678)),_0x3f25ee=_0x45c3bc(0xba),_0x3398a1,_0x28e0c4,_0x1c4b14,_0x1b2636=class _0x1846bf{constructor(){_0x2b65cc(this,_0x28e0c4);}static['getInstance'](){return _0x4db2d7(_0x1846bf,_0x3398a1)||_0x56fdc4(_0x1846bf,_0x3398a1,new _0x1846bf()),_0x4db2d7(_0x1846bf,_0x3398a1);}['updateAPIKey'](_0x4b4e99){const _0x104ed8=_0x45c3bc;_0x1846bf['apiKey']=_0x4b4e99;let _0x5927ed=_0x4b4e99,_0xb68ac8=/m(\d+)rgn/,_0x3988cf=_0x5927ed['match'](_0xb68ac8);_0x3988cf&&(_0x1846bf[_0x104ed8(0x143)]=_0x3988cf[0x1]);}[_0x45c3bc(0x12f)](){const _0xc0f0bf=_0x45c3bc;return _0x1846bf[_0xc0f0bf(0x153)];}[_0x45c3bc(0x188)](){const _0x19ce24=_0x45c3bc;return _0x1846bf[_0x19ce24(0x143)];}[_0x45c3bc(0x10a)](_0x2a68f7){return _0x2a2242(this,null,function*(){const _0x15bbae=_0x19fb;try{return(yield fetch(_0x587ffa+_0x2a68f7,{'headers':{'Authorization':_0x568680(this,_0x28e0c4,_0x1c4b14)['call'](this,_0x1846bf['apiKey']),'Content-Type':_0x15bbae(0x194)}}))['json']();}catch(_0x493c07){let _0x446e8a=_0x493c07[_0x15bbae(0x151)];return this['getBrandId']()==='67'&&_0x446e8a!==_0x15bbae(0x24a)&&_0x446e8a!=='Failed\x20to\x20load'&&_0x521f21[_0x15bbae(0x133)]({'eventName':'Debug\x20Event','eventProperties':[{'eventProperty':_0x15bbae(0x151),'value':_0x15bbae(0x1ad)+_0x2a68f7+_0x15bbae(0x251)+_0x568680(this,_0x28e0c4,_0x1c4b14)[_0x15bbae(0x1eb)](this,_0x1846bf['apiKey'])+_0x15bbae(0x1a1)+_0x493c07[_0x15bbae(0x151)]}]},!0x0),Promise[_0x15bbae(0x1e7)](_0x493c07);}});}[_0x45c3bc(0x182)](_0x3ed695,_0x5378b9,_0x1085ac){return _0x2a2242(this,null,function*(){const _0xf0acae=_0x19fb;try{return(yield fetch(_0x587ffa+_0x3ed695,{'body':JSON['stringify'](_0x5378b9||{}),'headers':{'Authorization':_0x568680(this,_0x28e0c4,_0x1c4b14)[_0xf0acae(0x1eb)](this,_0x1846bf[_0xf0acae(0x153)]),'Content-Type':'application/json'},'method':'POST','signal':_0x1085ac}))[_0xf0acae(0x1b4)]();}catch(_0x58a017){let _0x1156a2=_0x58a017[_0xf0acae(0x151)];return this[_0xf0acae(0x188)]()==='67'&&_0x1156a2!==_0xf0acae(0x24a)&&_0x1156a2!==_0xf0acae(0x25f)&&_0x521f21[_0xf0acae(0x133)]({'eventName':_0xf0acae(0x147),'eventProperties':[{'eventProperty':_0xf0acae(0x151),'value':_0xf0acae(0x272)+_0x3ed695+_0xf0acae(0x251)+_0x568680(this,_0x28e0c4,_0x1c4b14)[_0xf0acae(0x1eb)](this,_0x1846bf[_0xf0acae(0x153)])+'\x20-\x20'+JSON[_0xf0acae(0x16e)](_0x5378b9||{})+'\x20-'+_0x58a017[_0xf0acae(0x151)]}]},!0x0),Promise[_0xf0acae(0x1e7)](_0x58a017);}});}[_0x45c3bc(0x1c2)](_0x388083,_0x40b398){return _0x2a2242(this,null,function*(){const _0x4aeafb=_0x19fb;return(yield fetch(_0x587ffa+_0x388083,{'body':JSON['stringify'](_0x40b398||{}),'headers':{'Authorization':_0x568680(this,_0x28e0c4,_0x1c4b14)[_0x4aeafb(0x1eb)](this,_0x1846bf[_0x4aeafb(0x153)]),'Content-Type':_0x4aeafb(0x194)},'method':_0x4aeafb(0x230)}))[_0x4aeafb(0x1b4)]();});}[_0x45c3bc(0x233)](){return _0x2a2242(this,null,function*(){const _0x5badfd=_0x19fb;try{let _0x2cbdee=(yield(yield fetch(_0x587ffa+_0x5b73c0))['json']())['data'];_0x1846bf[_0x5badfd(0x17a)]=new Date(_0x2cbdee),_0x1846bf[_0x5badfd(0x1f0)]=new Date();}catch(_0x1311c1){_0x13e274(0x2,'Failed\x20to\x20sync\x20real-world\x20time');}});}[_0x45c3bc(0x1de)](){const _0x3ec683=_0x45c3bc;if(!_0x1846bf[_0x3ec683(0x17a)]||!_0x1846bf[_0x3ec683(0x1f0)])return _0x13e274(0x2,_0x3ec683(0x15b)),new Date();let _0x2dfdc9=new Date()[_0x3ec683(0xd7)]()-_0x1846bf[_0x3ec683(0x1f0)]['getTime']();return new Date(_0x1846bf[_0x3ec683(0x17a)][_0x3ec683(0xd7)]()+_0x2dfdc9);}};_0x3398a1=new WeakMap(),_0x28e0c4=new WeakSet(),_0x1c4b14=function(_0x5822d2){return btoa(_0x5822d2+':'+new Date()['getTime']());},_0x2b65cc(_0x1b2636,_0x3398a1);var _0x3cd7cc=_0x1b2636,_0x20436e=_0x3cd7cc[_0x45c3bc(0x208)](),_0x3b892c,_0x4b011f,_0x328429,_0x1e793b,_0x1135d6,_0x3c340b,_0x27fb83,_0x1b3113=class _0x3319d2{constructor(){_0x2b65cc(this,_0x328429),_0x2b65cc(this,_0x4b011f,!0x1);}static[_0x45c3bc(0x208)](){const _0x6ccab0=_0x45c3bc;var _0x59972b;return _0x4db2d7(_0x3319d2,_0x3b892c)||(_0x56fdc4(_0x3319d2,_0x3b892c,new _0x3319d2()),_0x568680(_0x59972b=_0x4db2d7(_0x3319d2,_0x3b892c),_0x328429,_0x1e793b)[_0x6ccab0(0x1eb)](_0x59972b)),_0x4db2d7(_0x3319d2,_0x3b892c);}[_0x45c3bc(0x197)](_0x2121ea,_0x3a0ae8,_0x327250){return _0x2a2242(this,null,function*(){yield _0x12b3f6('#\x20recordAttribute',()=>_0x2a2242(this,null,function*(){const _0x16e36c=_0x19fb;if(_0x13e274(0x1,_0x16e36c(0x1bd)),_0x4f60e7(_0x16e36c(0x1bd),!0x0),_0xbfebbb(_0x16e36c(0x181),!0x0),_0x13e274(0x1,_0x16e36c(0x226)+{'attributeName':_0x2121ea,'attributeProperties':_0x327250,'attributeValue':_0x3a0ae8}+')}'),!_0x3a0ae8||_0x3a0ae8===''){_0x13e274(0x2,_0x16e36c(0x14b));return;}yield _0x281447['checkTTL'](),yield _0x568680(this,_0x328429,_0x3c340b)[_0x16e36c(0x1eb)](this);let _0x254b8c=JSON['parse'](localStorage['getItem'](_0x16e36c(0x1a3))||'{}'),_0x2ccb1f=_0x327250?_0x568680(this,_0x328429,_0x1135d6)[_0x16e36c(0x1eb)](this,_0x254b8c,_0x2121ea,_0x327250):_0x568680(this,_0x328429,_0x1135d6)['call'](this,_0x254b8c,_0x2121ea);if(typeof _0x2ccb1f==_0x16e36c(0x187)){_0x13e274(0x2,_0x2ccb1f);return;}_0x254b8c[_0x2121ea][_0x16e36c(0x270)]&&(yield _0x281447[_0x16e36c(0x17d)](typeof _0x3a0ae8==_0x16e36c(0x187)?_0x3a0ae8:JSON[_0x16e36c(0x16e)](_0x3a0ae8))),_0x281447[_0x16e36c(0x20d)]();let {id:_0xb4c2ca}=_0x254b8c[_0x2121ea],_0x23183e={'attributeId':_0xb4c2ca,'attributeProperties':_0x2ccb1f,'customerId':localStorage['getItem'](_0x16e36c(0x19c))||'','value':_0x3a0ae8};yield _0x568680(this,_0x328429,_0x27fb83)[_0x16e36c(0x1eb)](this,_0x23183e);let _0x158682=JSON[_0x16e36c(0x1a6)](localStorage[_0x16e36c(0x175)](_0x16e36c(0x213))||'[]');_0x158682[_0x16e36c(0x1e8)](),localStorage[_0x16e36c(0x238)](_0x16e36c(0x213),JSON['stringify'](_0x158682)),_0xbfebbb(_0x16e36c(0x181),!0x1),_0x4f60e7(_0x16e36c(0x1bd),!0x1);}));});}[_0x45c3bc(0x211)](){return _0x2a2242(this,null,function*(){const _0x1de607=_0x19fb;if(!localStorage[_0x1de607(0x175)](_0x1de607(0x1a3))&&!_0x4db2d7(this,_0x4b011f)){_0x56fdc4(this,_0x4b011f,!0x0);try{let _0x29eb84=(yield this[_0x1de607(0x185)]())[_0x1de607(0x170)];_0x29eb84&&localStorage[_0x1de607(0x238)](_0x1de607(0x1a3),JSON[_0x1de607(0x16e)](_0x29eb84));}catch(_0x3b07ea){throw new Error(_0x1de607(0x19a));}finally{_0x56fdc4(this,_0x4b011f,!0x1);}}});}[_0x45c3bc(0x185)](){return _0x2a2242(this,null,function*(){const _0x21e598=_0x19fb;try{return yield _0x20436e[_0x21e598(0x10a)](''+_0x5c035e);}catch(_0x44e1f4){throw new Error(_0x21e598(0x156));}});}};_0x3b892c=new WeakMap(),_0x4b011f=new WeakMap(),_0x328429=new WeakSet(),_0x1e793b=function(){return _0x2a2242(this,null,function*(){});},_0x1135d6=function(_0x2a9b74,_0x1b7272,_0x40b871){const _0x4fab7e=_0x45c3bc;if(!Object[_0x4fab7e(0x1d4)][_0x4fab7e(0x149)]['call'](_0x2a9b74,_0x1b7272))return _0x4fab7e(0xe0)+_0x1b7272+_0x4fab7e(0x119);if(!_0x40b871)return[];let _0x321a3c=_0x2a9b74[_0x1b7272];if(!(_0x321a3c!=null&&_0x321a3c['attributeProperty']))return'Attribute\x20'+_0x1b7272+_0x4fab7e(0x22f);let _0x438cb3=_0x40b871[_0x4fab7e(0x200)](({attributeProperty:_0x497acd})=>!Object[_0x4fab7e(0x1d4)]['hasOwnProperty'][_0x4fab7e(0x1eb)](_0x321a3c['attributeProperty'],_0x497acd))['map'](({attributeProperty:_0x2cd5f1})=>_0x2cd5f1);return _0x438cb3[_0x4fab7e(0x222)]>0x0?'Attribute\x20'+_0x1b7272+_0x4fab7e(0x14f)+_0x438cb3[_0x4fab7e(0x11e)](',\x20')+'.':_0x40b871[_0x4fab7e(0x141)](({attributeProperty:_0x3bed31,value:_0x216995})=>({'attributePropertyId':_0x321a3c[_0x4fab7e(0xd1)][_0x3bed31]['id'],'value':_0x216995}));},_0x3c340b=function(){return _0x2a2242(this,null,function*(){const _0x2912dc=_0x19fb;localStorage[_0x2912dc(0x175)](_0x2912dc(0x1a3))||(yield this[_0x2912dc(0x211)]());});},_0x27fb83=function(_0x5d5da5){return _0x2a2242(this,null,function*(){const _0x4d2c72=_0x19fb;try{return yield _0x20436e[_0x4d2c72(0x182)](''+_0x5c035e+_0x33072e,_0x5d5da5);}catch(_0x1c6a7b){throw new Error(_0x4d2c72(0x1be));}});},_0x2b65cc(_0x1b3113,_0x3b892c);var _0xccb2b9=_0x1b3113,_0x27a081=_0xccb2b9[_0x45c3bc(0x208)](),_0x3498bb='Content\x20Card\x20Action',_0x2c3756,_0x5f3e93,_0x2f7135,_0x350d3e,_0x575f78,_0x22e96d,_0x539b3a,_0x23ae35,_0x121528,_0x51b235,_0x153e3f,_0x54a71b,_0xc9d9cf=class _0x4f577e{constructor(){const _0x409072=_0x45c3bc;_0x2b65cc(this,_0x5f3e93),_0x2b65cc(this,_0x539b3a,_0x3e5d96=>{const _0x2e56a3=_0x19fb;_0x281447[_0x2e56a3(0x212)]({'id':_0x3e5d96,'localStorageKey':_0x2e56a3(0x20c)});}),this[_0x409072(0x1c5)]=()=>{const _0x20d7b8=_0x409072;_0x281447[_0x20d7b8(0x234)]({'actionCondition':_0x1e7333=>_0x1e7333['message']['name']===_0x20d7b8(0x20e),'actionMethod':_0x418d9c=>_0x568680(this,_0x5f3e93,_0x350d3e)['call'](this,_0x418d9c[_0x20d7b8(0xd2)]),'localStorageKey':_0x20d7b8(0x20c)});},_0x2b65cc(this,_0x54a71b,()=>{const _0x3fc700=_0x409072;_0x281447[_0x3fc700(0xe9)](_0x3fc700(0x20c));});}static['getInstance'](){const _0x1e103f=_0x45c3bc;var _0x1cae88;return _0x4db2d7(_0x4f577e,_0x2c3756)||(_0x56fdc4(_0x4f577e,_0x2c3756,new _0x4f577e()),_0x568680(_0x1cae88=_0x4db2d7(_0x4f577e,_0x2c3756),_0x5f3e93,_0x2f7135)[_0x1e103f(0x1eb)](_0x1cae88)),_0x4db2d7(_0x4f577e,_0x2c3756);}[_0x45c3bc(0x265)](_0x17e2b4){const _0x5569ec=_0x45c3bc;let _0x43e505=JSON[_0x5569ec(0x1a6)](localStorage['getItem']('action')||'{}');if(_0x43e505&&_0x43e505[_0x17e2b4==null?void 0x0:_0x17e2b4[_0x5569ec(0xd2)]]){_0x13e274(0x1,_0x5569ec(0x23a));return;}_0x568680(this,_0x5f3e93,_0x153e3f)[_0x5569ec(0x1eb)](this,_0x17e2b4),_0x4db2d7(this,_0x54a71b)['call'](this),_0x568680(this,_0x5f3e93,_0x350d3e)[_0x5569ec(0x1eb)](this,_0x17e2b4[_0x5569ec(0xd2)]);}[_0x45c3bc(0xbb)](_0x5eca9e){const _0x5751f2=_0x45c3bc;return _0x5eca9e===_0x5751f2(0x145);}};_0x2c3756=new WeakMap(),_0x5f3e93=new WeakSet(),_0x2f7135=function(){return _0x2a2242(this,null,function*(){});},_0x350d3e=function(_0x595205){const _0x48a229=_0x45c3bc;let _0xff8284=_0x568680(this,_0x5f3e93,_0x575f78)['call'](this);if(document[_0x48a229(0x267)]('contentCard_container_'+_0x595205)){_0x13e274(0x1,_0x48a229(0x22e)),_0x4db2d7(this,_0x539b3a)[_0x48a229(0x1eb)](this,_0x595205);return;}if(_0xff8284!=null&&_0xff8284[_0x595205])switch(_0xff8284[_0x595205][_0x48a229(0x179)]){case'DELAY':{_0x568680(this,_0x5f3e93,_0x22e96d)[_0x48a229(0x1eb)](this,_0xff8284[_0x595205]);break;}case _0x48a229(0x1f3):{_0x568680(this,_0x5f3e93,_0x23ae35)[_0x48a229(0x1eb)](this,_0xff8284[_0x595205]);break;}case _0x48a229(0xf9):{_0x568680(this,_0x5f3e93,_0x51b235)[_0x48a229(0x1eb)](this,_0xff8284[_0x595205]);break;}default:return;}},_0x575f78=function(){const _0x8017d2=_0x45c3bc;let _0x3abea2=localStorage['getItem'](_0x8017d2(0x20c));return _0x3abea2?JSON[_0x8017d2(0x1a6)](_0x3abea2):null;},_0x22e96d=function(_0x464c98){const _0xfcb07f=_0x45c3bc;_0x281447[_0xfcb07f(0xc6)]({'clearActionMethod':_0x4db2d7(this,_0x539b3a)[_0xfcb07f(0x148)](this),'data':_0x464c98,'displayMethod':_0x568680(this,_0x5f3e93,_0x23ae35)[_0xfcb07f(0x148)](this),'idKey':'campaignId','timeValueKey':_0xfcb07f(0x263)});},_0x539b3a=new WeakMap(),_0x23ae35=function(_0x154daa){const _0x5eb50c=_0x45c3bc;var _0x6e1caa;if(document['getElementById'](_0x5eb50c(0x1f1)+_0x154daa['campaignId']))_0x13e274(0x1,_0x5eb50c(0x22e));else{let _0x4f90b0=_0x568680(this,_0x5f3e93,_0x121528)['call'](this,_0x5eb50c(0x1e3),_0x154daa),_0x230f30=document[_0x5eb50c(0x1b5)]('#'+_0x154daa['message']['divId']);_0x230f30&&(_0x230f30[_0x5eb50c(0x157)]=_0x4f90b0[_0x5eb50c(0xe8)],_0x521f21['recordEvent']({'campaignCustomerInstanceId':_0x154daa[_0x5eb50c(0x1b7)],'campaignId':_0x154daa[_0x5eb50c(0xd2)],'eventName':_0x3498bb,'eventProperties':[{'eventProperty':'Content\x20Card\x20View','value':JSON[_0x5eb50c(0x16e)]({'campaignId':_0x154daa[_0x5eb50c(0xd2)]})}],'name':_0x5eb50c(0x176)}),(_0x6e1caa=document['getElementById'](_0x5eb50c(0x1f1)+_0x154daa[_0x5eb50c(0xd2)]))==null||_0x6e1caa[_0x5eb50c(0x261)](_0x5eb50c(0x11f),()=>{const _0x3f8374=_0x5eb50c;_0x521f21['recordEvent']({'campaignCustomerInstanceId':_0x154daa['campaignCustomerInstanceId'],'campaignId':_0x154daa['campaignId'],'eventName':_0x3498bb,'eventProperties':[{'eventProperty':'Content\x20Card\x20Click','value':JSON['stringify']({'campaignId':_0x154daa[_0x3f8374(0xd2)]})}],'name':_0x3f8374(0x11f)});}));}_0x4db2d7(this,_0x539b3a)['call'](this,_0x154daa[_0x5eb50c(0xd2)]);},_0x121528=function(_0x7475fd,_0x2d680f){const _0x3c43b0=_0x45c3bc;var _0x4691e8;let {campaignId:_0x178650,message:{design:_0x3c3c28}}=_0x2d680f,_0x1bff32=document['createElement'](_0x7475fd);return _0x1bff32['id']=_0x3c43b0(0x1f1)+_0x178650,_0x1bff32['innerHTML']=_0x3c3c28,(_0x4691e8=_0x1bff32[_0x3c43b0(0x1b5)](_0x3c43b0(0x1ec)))==null||_0x4691e8[_0x3c43b0(0xcb)](),_0x1bff32;},_0x51b235=function(_0x171bc0){const _0x1998ee=_0x45c3bc;_0x281447['showAfterScrollAction']({'data':_0x171bc0,'displayMethod':_0x568680(this,_0x5f3e93,_0x23ae35)[_0x1998ee(0x148)](this),'timeValueKey':_0x1998ee(0x263)});},_0x153e3f=function(_0x10080a){const _0x1b5517=_0x45c3bc;_0x281447[_0x1b5517(0x109)](_0x10080a,_0x1b5517(0x20c),_0x1b5517(0xd2));},_0x54a71b=new WeakMap(),_0x2b65cc(_0xc9d9cf,_0x2c3756);var _0x34fc78=_0xc9d9cf,_0x289440=_0x34fc78[_0x45c3bc(0x208)](),_0xcdbf5,_0x25527a,_0x212029,_0x3a0b40,_0x1654a7,_0x464ab1,_0x2d14f2,_0xb6c90c,_0x35b500,_0x362fe3,_0x18b4b5,_0x4ed434,_0xc33d0,_0x2bc8c5,_0x49925e,_0x2b48fa,_0x283669,_0x34b1d9,_0x4488dc,_0x5925ac=class _0x129463{constructor(){const _0x13b697=_0x45c3bc;_0x2b65cc(this,_0x2d14f2),this[_0x13b697(0x117)]=null,this['pushMessageToSW']=_0x5b6054=>{const _0x41693d=_0x13b697;_0x13e274(0x1,_0x41693d(0x25b)),navigator[_0x41693d(0x129)][_0x41693d(0x191)]()[_0x41693d(0x21f)](_0x19198f=>{const _0x1c6d42=_0x41693d;var _0x232a12,_0x52fb7d;_0x13e274(0x1,_0x1c6d42(0xf5)),(_0x232a12=_0x19198f[0x0])!=null&&_0x232a12[_0x1c6d42(0xfe)]&&(_0x13e274(0x1,'Service\x20Worker\x20ready'),(_0x52fb7d=_0x19198f[0x0][_0x1c6d42(0xfe)])==null||_0x52fb7d[_0x1c6d42(0x171)](JSON['stringify'](_0x5b6054)));})[_0x41693d(0x16c)](_0x2be6bf=>{const _0x8127ac=_0x41693d;_0x13e274(0x2,_0x8127ac(0xd8)+_0x2be6bf['message']);});},this[_0x13b697(0x132)]=()=>{const _0x5c0e26=_0x13b697;_0x281447['loadActionInLocalStorage']({'actionCondition':()=>!0x0,'actionMethod':_0x27f932=>_0x568680(this,_0x2d14f2,_0x2bc8c5)[_0x5c0e26(0x1eb)](this,Number(_0x27f932[_0x5c0e26(0x247)])),'localStorageKey':'web_push_action'});},_0x2b65cc(this,_0xc33d0,()=>{const _0x57a925=_0x13b697;_0x281447[_0x57a925(0xe9)](_0x57a925(0xd4));}),_0x2b65cc(this,_0x34b1d9,_0x20fe17=>{const _0x2592f1=_0x13b697;_0x281447[_0x2592f1(0x212)]({'id':_0x20fe17,'localStorageKey':_0x2592f1(0xd4)});});}static['getInstance'](){return _0x4db2d7(_0x129463,_0xcdbf5)||_0x56fdc4(_0x129463,_0xcdbf5,new _0x129463()),_0x4db2d7(_0x129463,_0xcdbf5);}['init'](_0x1e93d4,_0x1a6a1f){return _0x2a2242(this,null,function*(){const _0x20f744=_0x19fb;var _0x5f3948;if(_0x13e274(0x1,_0x20f744(0x20f)),_0x521f21['recordDebugEvents']({'eventName':'init','eventProperties':[{'eventProperty':_0x20f744(0x165),'value':'serviceWorker'in navigator},{'eventProperty':_0x20f744(0xed),'value':_0x20f744(0x10e)in window}]}),_0x20f744(0x129)in navigator&&_0x20f744(0x10e)in window){_0x13e274(0x1,_0x20f744(0xb8));try{_0x521f21[_0x20f744(0xe1)]({'eventName':_0x20f744(0x275)}),_0x56fdc4(_0x129463,_0x25527a,yield navigator['serviceWorker']['register'](_0x1a6a1f||'/mergn-sw.js')),_0x13e274(0x1,_0x20f744(0x163)),_0x13e274(0x1,_0x20f744(0x215)),this[_0x20f744(0x1ea)]({'customer':localStorage['getItem'](_0x20f744(0x19c))||'','events':_0x521f21['getStoredEvents'](),'API_KEY':_0x20436e[_0x20f744(0x12f)](),'device_id':localStorage[_0x20f744(0x175)]('uniqueIdentity')||'','operatingSystem':_0x281447[_0x20f744(0x12e)](),'osVersion':_0x281447[_0x20f744(0xf2)](),'Platform':_0x281447[_0x20f744(0x1e2)]()}),_0x56fdc4(_0x129463,_0x1654a7,!0x0);let _0x2b4517=_0x568680(this,_0x2d14f2,_0x49925e)[_0x20f744(0x1eb)](this),_0x2055b9=Object['keys'](_0x2b4517||{});if(_0x2055b9[_0x20f744(0x222)]&&_0x568680(this,_0x2d14f2,_0x2bc8c5)['call'](this,Number(_0x2055b9[0x0])),!_0x1e93d4)return;let _0x4da74b=yield(_0x5f3948=_0x4db2d7(_0x129463,_0x25527a))==null?void 0x0:_0x5f3948[_0x20f744(0x1a5)]['getSubscription']();_0x13e274(0x1,_0x20f744(0xb6)),_0x4db2d7(_0x129463,_0x25527a)&&(_0x13e274(0x1,_0x20f744(0x12d)),_0x4db2d7(_0x129463,_0x25527a)[_0x20f744(0x22d)]()),_0x4da74b?(_0x13e274(0x1,_0x20f744(0x240)),_0x521f21[_0x20f744(0xe1)]({'eventName':'existing_subscription'}),yield _0x568680(this,_0x2d14f2,_0x18b4b5)[_0x20f744(0x1eb)](this),_0x56fdc4(_0x129463,_0x212029,!0x0)):(_0x13e274(0x1,_0x20f744(0x130)),yield _0x568680(this,_0x2d14f2,_0xb6c90c)[_0x20f744(0x1eb)](this,_0x4db2d7(_0x129463,_0x464ab1)||void 0x0));}catch(_0x4cbda7){let _0x1bfd33=_0x4cbda7&&_0x4cbda7[_0x20f744(0x151)]?_0x4cbda7[_0x20f744(0x151)][_0x20f744(0xe5)](0x0,0x64):_0x20f744(0x227);yield _0x521f21[_0x20f744(0xe1)]({'eventName':_0x20f744(0x1d9),'eventProperties':[{'eventProperty':_0x20f744(0x151),'value':''+_0x1bfd33}]}),_0x13e274(0x2,_0x20f744(0x1c0)),_0x13e274(0x2,_0x1bfd33);}}});}['showNotification'](_0x515f54){const _0x4766ed=_0x45c3bc;if(!_0x4db2d7(_0x129463,_0x1654a7)){_0x56fdc4(_0x129463,_0x464ab1,_0x515f54),_0x521f21[_0x4766ed(0xe1)]({'eventName':'notification_service_not_initialized'}),_0x13e274(0x2,_0x4766ed(0x225));return;}_0x12b3f6(_0x4766ed(0x136),()=>_0x2a2242(this,null,function*(){const _0x2e13bc=_0x4766ed;let _0x2dc2c4=JSON['parse'](localStorage[_0x2e13bc(0x175)]('web_push_action')||'{}');if(_0x2dc2c4&&_0x2dc2c4[_0x515f54['web_optin_instance_id']]){_0x13e274(0x1,_0x2e13bc(0x1ae));return;}_0x568680(this,_0x2d14f2,_0x4ed434)['call'](this,_0x515f54),_0x4db2d7(this,_0xc33d0)[_0x2e13bc(0x1eb)](this),_0x568680(this,_0x2d14f2,_0x2bc8c5)[_0x2e13bc(0x1eb)](this,_0x515f54[_0x2e13bc(0x247)]);}));}};_0xcdbf5=new WeakMap(),_0x25527a=new WeakMap(),_0x212029=new WeakMap(),_0x3a0b40=new WeakMap(),_0x1654a7=new WeakMap(),_0x464ab1=new WeakMap(),_0x2d14f2=new WeakSet(),_0xb6c90c=function(_0x58331d){return _0x2a2242(this,null,function*(){const _0x2a5773=_0x19fb;_0x13e274(0x1,_0x2a5773(0x248)+JSON[_0x2a5773(0x16e)](_0x58331d)+'\x20'),_0x521f21[_0x2a5773(0xe1)]({'eventName':_0x2a5773(0x1ac)});let _0x41fb34;try{_0x41fb34=Notification[_0x2a5773(0x117)],_0x41fb34&&(_0x13e274(0x1,_0x2a5773(0xe2)+_0x41fb34),_0x41fb34===_0x2a5773(0x131)?(_0x58331d||(this[_0x2a5773(0x117)]=_0x2a5773(0x131),_0x521f21[_0x2a5773(0xe1)]({'eventName':_0x2a5773(0x14d)})),_0x58331d&&(_0x521f21[_0x2a5773(0xe1)]({'eventName':'notification_data','eventProperties':[{'eventProperty':_0x2a5773(0x180),'value':''+(_0x58331d==null?void 0x0:_0x58331d[_0x2a5773(0x180)])}]}),_0x4db2d7(this,_0x34b1d9)['call'](this,_0x58331d[_0x2a5773(0x247)]),_0x58331d[_0x2a5773(0x180)]===_0x2a5773(0x15d)?_0x568680(this,_0x2d14f2,_0x35b500)[_0x2a5773(0x1eb)](this,_0x58331d):yield _0x568680(this,_0x2d14f2,_0x362fe3)[_0x2a5773(0x1eb)](this,_0x58331d))):_0x41fb34===_0x2a5773(0xbd)?(_0x521f21[_0x2a5773(0xe1)]({'eventName':_0x2a5773(0x1c8)}),_0x13e274(0x1,_0x2a5773(0x204))):(_0x521f21[_0x2a5773(0xe1)]({'eventName':_0x2a5773(0x243)}),_0x13e274(0x1,_0x2a5773(0x1c1)),_0x4db2d7(_0x5925ac,_0x212029)||(yield _0x568680(this,_0x2d14f2,_0x18b4b5)[_0x2a5773(0x1eb)](this),yield _0x521f21['recordEvent']({'eventName':'Already\x20Registered\x20To\x20Web\x20Push'}),_0x58331d||_0x56fdc4(_0x5925ac,_0x212029,!0x0))));}catch(_0x355bed){_0x13e274(0x2,'Failed\x20to\x20check\x20notification\x20permission'),_0x521f21[_0x2a5773(0xe1)]({'eventName':_0x2a5773(0x128)});}});},_0x35b500=function(_0x134e25){const _0x50ddbc=_0x45c3bc;try{let _0x95012d=document[_0x50ddbc(0xd5)](_0x50ddbc(0x1e3)),_0x4e67b9;_0x134e25[_0x50ddbc(0x20a)][_0x50ddbc(0x16f)]&&(_0x4e67b9=document[_0x50ddbc(0xd5)](_0x50ddbc(0xd9)),_0x4e67b9[_0x50ddbc(0x184)]=_0x134e25[_0x50ddbc(0x20a)][_0x50ddbc(0x16f)],_0x4e67b9['alt']=_0x50ddbc(0x1ab),_0x4e67b9['id']=_0x50ddbc(0x166));let _0x27fc7d=document[_0x50ddbc(0xd5)]('div'),_0x457742=document[_0x50ddbc(0xd5)](_0x50ddbc(0x1e3)),_0x3d5fb0=document[_0x50ddbc(0xd5)](_0x50ddbc(0x1e3)),_0x509d3b=document[_0x50ddbc(0xd5)]('img'),_0xc2db7a=document[_0x50ddbc(0xd5)](_0x50ddbc(0x1e3)),_0x1cb337=document[_0x50ddbc(0xd5)](_0x50ddbc(0x1e3)),_0x1ae935=document[_0x50ddbc(0xd5)]('div'),_0x350cae=document['createElement'](_0x50ddbc(0x1e3)),_0xbda1bb=document[_0x50ddbc(0xd5)](_0x50ddbc(0x1e3)),_0x35e36a=document[_0x50ddbc(0xd5)](_0x50ddbc(0x1e3)),_0x390ff0=document[_0x50ddbc(0xd5)](_0x50ddbc(0x231)),_0x596a61=document['createElement'](_0x50ddbc(0x231));_0x95012d[_0x50ddbc(0x1fd)]=_0x50ddbc(0x1e9),_0x27fc7d['className']=_0x50ddbc(0x255),_0x457742[_0x50ddbc(0x1fd)]=_0x350cae[_0x50ddbc(0x1fd)]=_0xbda1bb[_0x50ddbc(0x1fd)]=_0x50ddbc(0x23f),_0x3d5fb0[_0x50ddbc(0x1fd)]=_0x50ddbc(0x21c),_0xc2db7a[_0x50ddbc(0x1fd)]=_0x50ddbc(0x1cc),_0x35e36a['className']=_0x50ddbc(0x1ef),_0x1cb337['id']=_0x50ddbc(0x138),_0x1ae935['id']=_0x50ddbc(0x25e),_0x390ff0['id']=_0x50ddbc(0x23c),_0x596a61['id']=_0x50ddbc(0xf7),_0x509d3b[_0x50ddbc(0x184)]=_0x134e25[_0x50ddbc(0x20a)]['banner_icon'],_0x509d3b[_0x50ddbc(0x26b)]='Image',_0x509d3b['id']='logo',_0x1cb337[_0x50ddbc(0x22b)]=_0x134e25['banner_design'][_0x50ddbc(0xef)],_0x1ae935['textContent']=_0x134e25['banner_design'][_0x50ddbc(0x259)],_0x390ff0[_0x50ddbc(0x22b)]=_0x134e25[_0x50ddbc(0x20a)]['button_1'][_0x50ddbc(0xdd)],_0x596a61[_0x50ddbc(0x22b)]=_0x134e25[_0x50ddbc(0x20a)][_0x50ddbc(0x177)][_0x50ddbc(0xdd)],_0x3d5fb0[_0x50ddbc(0x193)](_0x509d3b),_0xc2db7a[_0x50ddbc(0x193)](_0x1cb337),_0xc2db7a[_0x50ddbc(0x193)](_0x1ae935),_0x457742[_0x50ddbc(0x193)](_0x3d5fb0),_0x457742[_0x50ddbc(0x193)](_0xc2db7a),_0x4e67b9&&(_0x350cae[_0x50ddbc(0x193)](_0x4e67b9),_0x4e67b9[_0x50ddbc(0x13b)]['cssText']='\x0amax-width:\x20100%;\x0aheight:\x20auto;\x0adisplay:\x20block;\x0amargin-left:\x20auto;\x0amargin-right:\x20auto;\x0aborder-radius:\x2010px;\x0amax-width:\x20350px;\x0aaspect-ratio:\x202\x20/\x201;\x0a'),_0x35e36a[_0x50ddbc(0x193)](_0x390ff0),_0x35e36a[_0x50ddbc(0x193)](_0x596a61),_0xbda1bb[_0x50ddbc(0x193)](_0x35e36a),_0x27fc7d[_0x50ddbc(0x193)](_0x457742),_0x27fc7d[_0x50ddbc(0x193)](_0x350cae),_0x27fc7d[_0x50ddbc(0x193)](_0xbda1bb),_0x95012d[_0x50ddbc(0x193)](_0x27fc7d),_0x95012d[_0x50ddbc(0x13b)]['cssText']='\x0aposition:\x20fixed;\x0atop:\x200;\x0aleft:\x200;\x0awidth:\x20100%;\x0aheight:\x20100%;\x0abackground-color:\x20rgba(0,\x200,\x200,\x200.5);\x0az-index:\x2099999999999;\x0adisplay:\x20flex;\x0ajustify-content:\x20center;\x0aalign-items:\x20start;\x0a',_0x27fc7d[_0x50ddbc(0x13b)][_0x50ddbc(0x125)]=_0x50ddbc(0xcf)+_0x134e25[_0x50ddbc(0x20a)][_0x50ddbc(0x1f7)]+_0x50ddbc(0x1d5),_0x457742[_0x50ddbc(0x13b)][_0x50ddbc(0x125)]=_0x350cae[_0x50ddbc(0x13b)][_0x50ddbc(0x125)]=_0xbda1bb[_0x50ddbc(0x13b)][_0x50ddbc(0x125)]=_0x50ddbc(0x219),_0x3d5fb0[_0x50ddbc(0x13b)]['cssText']=_0x50ddbc(0x207),_0xc2db7a[_0x50ddbc(0x13b)][_0x50ddbc(0x125)]='\x0awidth:\x2073%;\x0amargin-left:\x202%;\x0a',_0x509d3b[_0x50ddbc(0x13b)][_0x50ddbc(0x125)]=_0x50ddbc(0x214),_0x390ff0[_0x50ddbc(0x13b)][_0x50ddbc(0x125)]=_0x50ddbc(0xbe)+_0x134e25[_0x50ddbc(0x20a)][_0x50ddbc(0x186)]['backgroundColor']+_0x50ddbc(0x221)+_0x134e25[_0x50ddbc(0x20a)][_0x50ddbc(0x186)]['color']+_0x50ddbc(0x112),_0x596a61[_0x50ddbc(0x13b)][_0x50ddbc(0x125)]=_0x50ddbc(0xbe)+_0x134e25[_0x50ddbc(0x20a)]['button_2'][_0x50ddbc(0x1d0)]+_0x50ddbc(0x221)+_0x134e25[_0x50ddbc(0x20a)][_0x50ddbc(0x177)][_0x50ddbc(0x24c)]+_0x50ddbc(0x112),_0x35e36a['style']['cssText']=_0x50ddbc(0x1e4),_0x1cb337[_0x50ddbc(0x13b)][_0x50ddbc(0x125)]=_0x50ddbc(0x24b)+_0x134e25[_0x50ddbc(0x20a)][_0x50ddbc(0x15e)]+'\x0a',_0x1ae935[_0x50ddbc(0x13b)]['cssText']=_0x50ddbc(0xbf)+_0x134e25[_0x50ddbc(0x20a)][_0x50ddbc(0x15e)]+'\x0a',document[_0x50ddbc(0xca)][_0x50ddbc(0x193)](_0x95012d),document[_0x50ddbc(0xca)][_0x50ddbc(0x13b)][_0x50ddbc(0x237)]=_0x50ddbc(0x1e6),_0x521f21[_0x50ddbc(0x133)]({'eventName':_0x50ddbc(0x159),'name':_0x50ddbc(0x23d),'web_optin_instance_id':_0x134e25[_0x50ddbc(0x247)]}),_0x390ff0==null||_0x390ff0[_0x50ddbc(0x261)](_0x50ddbc(0x11f),()=>_0x2a2242(this,null,function*(){const _0x3e635a=_0x50ddbc;_0x95012d[_0x3e635a(0xcb)](),_0x56fdc4(_0x5925ac,_0x3a0b40,!0x1),document['body']['style']['overflow']='auto',yield _0x521f21[_0x3e635a(0x133)]({'eventName':'Denied\x20Web\x20Push\x20Soft-ask','web_optin_instance_id':_0x134e25[_0x3e635a(0x247)]}),_0x13e274(0x1,_0x3e635a(0xcd));})),_0x596a61==null||_0x596a61[_0x50ddbc(0x261)](_0x50ddbc(0x11f),()=>_0x2a2242(this,null,function*(){const _0x5b26d4=_0x50ddbc;_0x95012d[_0x5b26d4(0xcb)](),document[_0x5b26d4(0xca)][_0x5b26d4(0x13b)][_0x5b26d4(0x237)]=_0x5b26d4(0x1c4),_0x521f21[_0x5b26d4(0x133)]({'eventName':_0x5b26d4(0x19f),'web_optin_instance_id':_0x134e25[_0x5b26d4(0x247)]}),yield _0x568680(this,_0x2d14f2,_0x362fe3)[_0x5b26d4(0x1eb)](this,_0x134e25);}));}catch(_0x28d975){}},_0x362fe3=function(_0xf8bd38){return _0x2a2242(this,null,function*(){const _0x3e4185=_0x19fb;try{_0x521f21[_0x3e4185(0x133)]({'eventName':_0x3e4185(0x246),'name':_0x3e4185(0x23d),'web_optin_instance_id':_0xf8bd38['web_optin_instance_id']});let _0x44aa22=yield Notification[_0x3e4185(0x236)]();_0x44aa22===_0x3e4185(0xe4)?(_0x13e274(0x1,_0x3e4185(0x1aa)),yield _0x568680(this,_0x2d14f2,_0x18b4b5)[_0x3e4185(0x1eb)](this),yield _0x521f21[_0x3e4185(0x133)]({'eventName':_0x3e4185(0xfd),'name':_0x3e4185(0x14c),'web_optin_instance_id':_0xf8bd38['web_optin_instance_id']})):_0x44aa22===_0x3e4185(0xbd)?(yield _0x521f21[_0x3e4185(0x133)]({'eventName':_0x3e4185(0x1a9)}),_0x13e274(0x1,'User\x20denied\x20the\x20notification\x20permission.')):_0x44aa22===_0x3e4185(0x131)&&(yield _0x521f21[_0x3e4185(0x133)]({'eventName':_0x3e4185(0x146)}),_0x13e274(0x1,_0x3e4185(0x1f6)));}catch(_0x264d02){_0x13e274(0x2,_0x3e4185(0x25d));}_0x56fdc4(_0x5925ac,_0x3a0b40,!0x1);});},_0x18b4b5=function(){return _0x2a2242(this,null,function*(){const _0x460f7a=_0x19fb;var _0x532e0f,_0x3374f6;let _0x5156f3=yield _0x20436e[_0x460f7a(0x10a)](''+_0x271ad4);if(_0x5156f3[_0x460f7a(0x26a)]){let _0x4af95b=yield(_0x532e0f=_0x4db2d7(_0x5925ac,_0x25527a))==null?void 0x0:_0x532e0f[_0x460f7a(0x1a5)][_0x460f7a(0x201)]();_0x4af95b&&(yield _0x4af95b[_0x460f7a(0x11b)]());let _0x509582=yield(_0x3374f6=_0x4db2d7(_0x5925ac,_0x25527a))==null?void 0x0:_0x3374f6['pushManager'][_0x460f7a(0x1d1)]({'applicationServerKey':_0x5156f3[_0x460f7a(0x170)]||'','userVisibleOnly':!0x0});yield _0x20436e[_0x460f7a(0x1c2)](''+_0x2350c1,{'device_id':localStorage['getItem'](_0x460f7a(0x164))||'','is_web_push_subscribed':!0x0,'web_push_subscription_page_url':window[_0x460f7a(0x110)][_0x460f7a(0x220)],'web_push_token':{'token':JSON[_0x460f7a(0x1a6)](JSON['stringify'](_0x509582))}}),_0x13e274(0x1,'User\x20is\x20subscribed');}else throw new Error('Failed\x20to\x20subscribe\x20the\x20user');});},_0x4ed434=function(_0x421e25){const _0x5a3966=_0x45c3bc;_0x281447[_0x5a3966(0x109)](_0x421e25,_0x5a3966(0xd4),'web_optin_instance_id');},_0xc33d0=new WeakMap(),_0x2bc8c5=function(_0x2487f2){const _0x4eae0c=_0x45c3bc;if(_0x4db2d7(_0x5925ac,_0x3a0b40))return;_0x56fdc4(_0x5925ac,_0x3a0b40,!0x0);let _0x3decec=_0x568680(this,_0x2d14f2,_0x49925e)[_0x4eae0c(0x1eb)](this);if(_0x3decec!=null&&_0x3decec[_0x2487f2])switch(_0x3decec[_0x2487f2][_0x4eae0c(0x269)]){case _0x4eae0c(0xe6):{_0x568680(this,_0x2d14f2,_0x2b48fa)['call'](this,_0x3decec[_0x2487f2]);break;}case _0x4eae0c(0x1f3):{_0x568680(this,_0x2d14f2,_0x283669)[_0x4eae0c(0x1eb)](this,_0x3decec[_0x2487f2]);break;}case _0x4eae0c(0xf9):{_0x568680(this,_0x2d14f2,_0x4488dc)[_0x4eae0c(0x1eb)](this,_0x3decec[_0x2487f2]);break;}default:return;}},_0x49925e=function(){const _0x514ff9=_0x45c3bc;let _0x248be3=localStorage['getItem'](_0x514ff9(0xd4));return _0x248be3?JSON['parse'](_0x248be3):null;},_0x2b48fa=function(_0x48f467){const _0x2023e6=_0x45c3bc;_0x281447[_0x2023e6(0xc6)]({'clearActionMethod':_0x4db2d7(this,_0x34b1d9)[_0x2023e6(0x148)](this),'data':_0x48f467,'displayMethod':_0x568680(this,_0x2d14f2,_0x283669)[_0x2023e6(0x148)](this),'idKey':'web_optin_instance_id','timeValueKey':'entry_time_value'});},_0x283669=function(_0x2920d2){_0x568680(this,_0x2d14f2,_0xb6c90c)['call'](this,_0x2920d2);},_0x34b1d9=new WeakMap(),_0x4488dc=function(_0x1a995e){const _0x5afff5=_0x45c3bc;_0x281447[_0x5afff5(0xc5)]({'data':_0x1a995e,'displayMethod':_0x568680(this,_0x2d14f2,_0x283669)[_0x5afff5(0x148)](this),'timeValueKey':_0x5afff5(0x190)});},_0x2b65cc(_0x5925ac,_0xcdbf5),_0x2b65cc(_0x5925ac,_0x25527a,null),_0x2b65cc(_0x5925ac,_0x212029,!0x1),_0x2b65cc(_0x5925ac,_0x3a0b40,!0x1),_0x2b65cc(_0x5925ac,_0x1654a7,!0x1),_0x2b65cc(_0x5925ac,_0x464ab1,null);var _0x49bf6a=_0x5925ac,_0x1514bf=_0x49bf6a[_0x45c3bc(0x208)](),_0x2c5794,_0x5ed1c9,_0x5ad1c8,_0x21bafe,_0x1b2f27,_0x5aa2e9,_0x18467c,_0x1356eb,_0x545950,_0x428253,_0x2c9abe,_0x425299,_0x45ac28=class _0x44ef6e{constructor(){const _0x198818=_0x45c3bc;_0x2b65cc(this,_0x5ed1c9),_0x2b65cc(this,_0x18467c,_0x1851ff=>{_0x281447['clearActionInLocalStorage']({'id':_0x1851ff,'localStorageKey':'action'});}),this[_0x198818(0x142)]=()=>{const _0x376d5a=_0x198818;_0x281447['loadActionInLocalStorage']({'actionCondition':_0x29b06a=>_0x29b06a[_0x376d5a(0x151)][_0x376d5a(0x12a)]===_0x376d5a(0x22a),'actionMethod':_0x4c63c8=>_0x568680(this,_0x5ed1c9,_0x21bafe)['call'](this,_0x4c63c8[_0x376d5a(0xd2)]),'localStorageKey':_0x376d5a(0x20c)});},_0x2b65cc(this,_0x425299,()=>{const _0x593683=_0x198818;_0x281447[_0x593683(0xe9)]('action');});}static[_0x45c3bc(0x208)](){var _0x1f3110;return _0x4db2d7(_0x44ef6e,_0x2c5794)||(_0x56fdc4(_0x44ef6e,_0x2c5794,new _0x44ef6e()),_0x568680(_0x1f3110=_0x4db2d7(_0x44ef6e,_0x2c5794),_0x5ed1c9,_0x5ad1c8)['call'](_0x1f3110)),_0x4db2d7(_0x44ef6e,_0x2c5794);}[_0x45c3bc(0x245)](_0x5c5c74){const _0x1b1ce8=_0x45c3bc;let _0x3a720a=JSON['parse'](localStorage['getItem'](_0x1b1ce8(0x20c))||'{}');if(_0x3a720a&&_0x3a720a[_0x5c5c74==null?void 0x0:_0x5c5c74[_0x1b1ce8(0xd2)]]){_0x13e274(0x1,'Popup\x20already\x20in\x20cache');return;}_0x568680(this,_0x5ed1c9,_0x2c9abe)[_0x1b1ce8(0x1eb)](this,_0x5c5c74),_0x4db2d7(this,_0x425299)[_0x1b1ce8(0x1eb)](this),_0x568680(this,_0x5ed1c9,_0x21bafe)[_0x1b1ce8(0x1eb)](this,_0x5c5c74['campaignId']);}[_0x45c3bc(0x140)](_0x303695){return _0x303695==='Popup';}};_0x2c5794=new WeakMap(),_0x5ed1c9=new WeakSet(),_0x5ad1c8=function(){return _0x2a2242(this,null,function*(){});},_0x21bafe=function(_0xdb5cfc){const _0xbf2b8f=_0x45c3bc;let _0x2e6eff=_0x568680(this,_0x5ed1c9,_0x1b2f27)['call'](this);if(document[_0xbf2b8f(0x267)](_0xbf2b8f(0x114)+_0xdb5cfc)){_0x13e274(0x1,_0xbf2b8f(0x1e0)),_0x4db2d7(this,_0x18467c)[_0xbf2b8f(0x1eb)](this,_0xdb5cfc);return;}if(_0x2e6eff!=null&&_0x2e6eff[_0xdb5cfc])switch(_0x2e6eff[_0xdb5cfc]['campaignEntryTime']){case _0xbf2b8f(0xe6):{_0x568680(this,_0x5ed1c9,_0x5aa2e9)['call'](this,_0x2e6eff[_0xdb5cfc]);break;}case _0xbf2b8f(0x1f3):{_0x568680(this,_0x5ed1c9,_0x1356eb)['call'](this,_0x2e6eff[_0xdb5cfc]);break;}case _0xbf2b8f(0xf9):{_0x568680(this,_0x5ed1c9,_0x428253)[_0xbf2b8f(0x1eb)](this,_0x2e6eff[_0xdb5cfc]);break;}default:return;}},_0x1b2f27=function(){const _0x547434=_0x45c3bc;let _0x54e0e4=localStorage[_0x547434(0x175)]('action');return _0x54e0e4?JSON[_0x547434(0x1a6)](_0x54e0e4):null;},_0x5aa2e9=function(_0x35405d){const _0x3cd19b=_0x45c3bc;_0x281447[_0x3cd19b(0xc6)]({'clearActionMethod':_0x4db2d7(this,_0x18467c)[_0x3cd19b(0x148)](this),'data':_0x35405d,'displayMethod':_0x568680(this,_0x5ed1c9,_0x1356eb)[_0x3cd19b(0x148)](this),'idKey':_0x3cd19b(0xd2),'timeValueKey':'campaignEntryTimeValue'});},_0x18467c=new WeakMap(),_0x1356eb=function(_0x4726d1){const _0x3f076f=_0x45c3bc;if(document[_0x3f076f(0x267)](_0x3f076f(0x114)+_0x4726d1[_0x3f076f(0xd2)]))_0x13e274(0x1,_0x3f076f(0x1e0));else{let _0x437f3e=_0x568680(this,_0x5ed1c9,_0x545950)['call'](this,'div',_0x4726d1);document[_0x3f076f(0xca)][_0x3f076f(0x193)](_0x437f3e),_0x521f21[_0x3f076f(0x133)]({'campaignCustomerInstanceId':_0x4726d1['campaignCustomerInstanceId'],'campaignId':_0x4726d1[_0x3f076f(0xd2)],'eventName':_0x3f25ee,'eventProperties':[{'eventProperty':_0x3f076f(0xdf),'value':JSON[_0x3f076f(0x16e)]({'campaignId':_0x4726d1[_0x3f076f(0xd2)]})}],'name':_0x3f076f(0x176)});}_0x4db2d7(this,_0x18467c)[_0x3f076f(0x1eb)](this,_0x4726d1[_0x3f076f(0xd2)]);},_0x545950=function(_0x2ff8f3,_0x1169a1){const _0x599940=_0x45c3bc;let {campaignCustomerInstanceId:_0x3aaab,campaignId:_0xd17fdf,message:{design:_0x4aeaa9}}=_0x1169a1,_0x11c5d2=document[_0x599940(0xd5)](_0x2ff8f3);_0x11c5d2['id']=_0x599940(0x114)+_0xd17fdf,_0x11c5d2[_0x599940(0x157)]=_0x4aeaa9,_0x11c5d2['style'][_0x599940(0x257)]='fixed',_0x11c5d2[_0x599940(0x13b)][_0x599940(0x17f)]='0',_0x11c5d2[_0x599940(0x13b)]['left']='0',_0x11c5d2[_0x599940(0x13b)][_0x599940(0x172)]=_0x599940(0x11a),_0x11c5d2[_0x599940(0x13b)][_0x599940(0x260)]=_0x599940(0x11a),_0x11c5d2[_0x599940(0x13b)]['zIndex']=_0x599940(0x174);let _0x3b3c19=_0x11c5d2[_0x599940(0x1b5)](_0x599940(0x107));_0x3b3c19&&(_0x3b3c19[_0x599940(0x13b)][_0x599940(0x169)]='50');let _0x17f15d=_0x3b3c19[_0x599940(0x1b5)](_0x599940(0x202));_0x17f15d&&(_0x13e274(0x1,_0x599940(0x10d)),_0x17f15d[_0x599940(0x13b)]['setProperty'](_0x599940(0x10b),_0x599940(0x192),'important')),_0x11c5d2[_0x599940(0x120)](_0x599940(0x124))[_0x599940(0x241)](_0x3b85bd=>{const _0x5906c8=_0x599940;let _0x7fcdaa=_0x3b85bd['querySelector']('form');_0x7fcdaa&&_0x7fcdaa[_0x5906c8(0x261)](_0x5906c8(0x1b9),()=>_0x2a2242(this,null,function*(){const _0x2a31e7=_0x5906c8;_0x11c5d2[_0x2a31e7(0xcb)]();let _0x166af0=new FormData(_0x7fcdaa),_0x488a33={};for(let [_0x2ab29e,_0x5e27a7]of _0x166af0[_0x2a31e7(0x256)]())_0x488a33[_0x2ab29e]=_0x5e27a7;yield _0x521f21[_0x2a31e7(0x133)]({'campaignCustomerInstanceId':_0x3aaab,'campaignId':_0xd17fdf,'eventName':_0x3f25ee,'eventProperties':[{'eventProperty':'Form\x20Submit','value':JSON[_0x2a31e7(0x16e)]({'campaignId':_0xd17fdf,'formId':_0x3b85bd['id'],'formValues':_0x488a33})},{'eventProperty':'Campaign\x20Id','value':_0xd17fdf[_0x2a31e7(0x266)]()}],'name':_0x2a31e7(0xc9)});}));});let _0x4fc8ac=_0x11c5d2[_0x599940(0x1b5)]('.u-close-button');return(_0x4fc8ac==null?void 0x0:_0x4fc8ac[_0x599940(0xea)](_0x599940(0x19d)))==='#'&&_0x4fc8ac[_0x599940(0x1f8)](_0x599940(0x19d)),_0x4fc8ac==null||_0x4fc8ac[_0x599940(0x261)](_0x599940(0x11f),()=>_0x2a2242(this,null,function*(){const _0x51d1a6=_0x599940;_0x11c5d2[_0x51d1a6(0xcb)](),yield _0x521f21[_0x51d1a6(0x133)]({'campaignCustomerInstanceId':_0x3aaab,'campaignId':_0xd17fdf,'eventName':_0x3f25ee,'eventProperties':[{'eventProperty':_0x51d1a6(0xf1),'value':JSON[_0x51d1a6(0x16e)]({'campaignId':_0xd17fdf})}],'name':'close'});})),_0x11c5d2[_0x599940(0x120)](_0x599940(0xb5))[_0x599940(0x241)](_0x415619=>{_0x415619['addEventListener']('click',()=>_0x2a2242(this,null,function*(){const _0x1bea86=_0x19fb;_0x11c5d2[_0x1bea86(0xcb)](),yield _0x521f21[_0x1bea86(0x133)]({'campaignCustomerInstanceId':_0x3aaab,'campaignId':_0xd17fdf,'eventName':_0x3f25ee,'eventProperties':[{'eventProperty':_0x1bea86(0x1fa),'value':JSON[_0x1bea86(0x16e)]({'buttonId':_0x415619['id'],'campaignId':_0xd17fdf})}],'name':_0x1bea86(0x11f)});}));}),_0x11c5d2[_0x599940(0x120)](_0x599940(0x1f5))[_0x599940(0x241)](_0x483a41=>{const _0xe603ba=_0x599940;_0x483a41[_0xe603ba(0x261)](_0xe603ba(0x11f),()=>_0x2a2242(this,null,function*(){const _0x2468d3=_0xe603ba;_0x11c5d2[_0x2468d3(0xcb)](),yield _0x521f21[_0x2468d3(0x133)]({'campaignCustomerInstanceId':_0x3aaab,'campaignId':_0xd17fdf,'eventName':_0x3f25ee,'eventProperties':[{'eventProperty':'Image\x20Click','value':JSON[_0x2468d3(0x16e)]({'campaignId':_0xd17fdf,'imageClassName':_0x483a41['className'],'imageId':_0x483a41['id']})}],'name':'click'});}));}),_0x11c5d2;},_0x428253=function(_0x467223){const _0x18846a=_0x45c3bc;_0x281447[_0x18846a(0xc5)]({'data':_0x467223,'displayMethod':_0x568680(this,_0x5ed1c9,_0x1356eb)['bind'](this),'timeValueKey':_0x18846a(0x263)});},_0x2c9abe=function(_0x1d38db){const _0x4a0a0f=_0x45c3bc;_0x281447[_0x4a0a0f(0x109)](_0x1d38db,_0x4a0a0f(0x20c),_0x4a0a0f(0xd2));},_0x425299=new WeakMap(),_0x2b65cc(_0x45ac28,_0x2c5794);var _0x13648b=_0x45ac28,_0x910f2b=_0x13648b['getInstance'](),_0x1ef4e7,_0x1535a1,_0x1d4a65,_0x3c0257,_0x5179bc,_0x45be0b,_0x48b65f,_0x13b11,_0x51465d,_0x15acb7,_0x2c1943,_0x28abfb,_0x156b46,_0x1f3c92,_0x294549,_0x9734e7,_0x975990,_0x1ff31b,_0x5e7c5a,_0x199591,_0x3f51f2,_0x3cece7,_0x4ae6b8,_0x522813,_0x9d60ad,_0x377118,_0x1abd6e,_0x21b645,_0x337f1c=class _0x3a37a9{constructor(){const _0x47ee05=_0x45c3bc;_0x2b65cc(this,_0x51465d),_0x2b65cc(this,_0x1535a1),_0x2b65cc(this,_0x1d4a65),_0x2b65cc(this,_0x3c0257),_0x2b65cc(this,_0x5179bc,null),_0x2b65cc(this,_0x45be0b,null),_0x2b65cc(this,_0x48b65f,!0x1),_0x2b65cc(this,_0x13b11,()=>{setInterval(()=>{const _0x50629f=_0x19fb;let _0x509ffb=localStorage[_0x50629f(0x175)](_0x50629f(0x18d));if(_0x509ffb!==_0x4db2d7(this,_0x45be0b)){_0x56fdc4(this,_0x45be0b,_0x509ffb);let _0x53a145=JSON[_0x50629f(0x1a6)](_0x509ffb||'{}');if(_0x53a145!=null&&_0x53a145[_0x50629f(0x1ea)]){let _0x3294ec=_0x53a145['pushMessageToSW'];delete _0x53a145[_0x50629f(0x1ea)],localStorage[_0x50629f(0x238)](_0x50629f(0x18d),JSON[_0x50629f(0x16e)](_0x53a145)),_0x1514bf[_0x50629f(0x1ea)](_0x3294ec);}if(_0x53a145!=null&&_0x53a145[_0x50629f(0x273)]){let _0x458358=_0x53a145[_0x50629f(0x273)];delete _0x53a145[_0x50629f(0x273)],localStorage[_0x50629f(0x238)](_0x50629f(0x18d),JSON[_0x50629f(0x16e)](_0x53a145)),_0x1514bf[_0x50629f(0x136)](_0x458358);}if(_0x53a145!=null&&_0x53a145[_0x50629f(0xb4)]){let _0x57c64c=_0x53a145['campaigns'];delete _0x53a145[_0x50629f(0xb4)],localStorage[_0x50629f(0x238)](_0x50629f(0x18d),JSON['stringify'](_0x53a145)),_0x57c64c[_0x50629f(0x241)](_0x4a76ee=>{const _0x3d0123=_0x50629f;_0x910f2b[_0x3d0123(0x140)](_0x4a76ee[_0x3d0123(0x151)][_0x3d0123(0x12a)])?_0x910f2b[_0x3d0123(0x245)](_0x4a76ee):_0x289440[_0x3d0123(0xbb)](_0x4a76ee['message'][_0x3d0123(0x12a)])&&_0x289440[_0x3d0123(0x265)](_0x4a76ee);});}}},0x3e8);}),this[_0x47ee05(0xe9)]=_0x54e369=>{let _0x3c8a69=()=>{const _0x5c0e01=_0x19fb;let _0x2b7213=JSON[_0x5c0e01(0x1a6)](localStorage[_0x5c0e01(0x175)](_0x54e369)||'{}');Object['keys'](_0x2b7213)[_0x5c0e01(0x241)](_0x239183=>{_0x2b7213[_0x239183]['initialTime']=new Date()['getTime']();}),localStorage[_0x5c0e01(0x238)](_0x54e369,JSON[_0x5c0e01(0x16e)](_0x2b7213));};_0x3c8a69(),window['addEventListener']('beforeunload',_0x3c8a69);},this[_0x47ee05(0x212)]=({id:_0x4b058e,localStorageKey:_0x2a8a3b})=>{const _0x2ca865=_0x47ee05;let _0x5b745b=JSON[_0x2ca865(0x1a6)](localStorage[_0x2ca865(0x175)](_0x2a8a3b)||'{}');_0x5b745b[_0x4b058e]&&delete _0x5b745b[_0x4b058e],localStorage['setItem'](_0x2a8a3b,JSON['stringify'](_0x5b745b));},this[_0x47ee05(0x234)]=({actionCondition:_0x25c484,actionMethod:_0x362282,localStorageKey:_0x2a8d9e})=>{const _0x2cdb31=_0x47ee05;let _0x2584bd=JSON[_0x2cdb31(0x1a6)](localStorage['getItem'](_0x2a8d9e)||'{}');Object[_0x2cdb31(0x18a)](_0x2584bd)[_0x2cdb31(0x241)](_0x46d8fe=>{_0x25c484(_0x2584bd[_0x46d8fe])&&_0x362282(_0x2584bd[_0x46d8fe]);});};}static['getInstance'](){return _0x4db2d7(_0x3a37a9,_0x1ef4e7)||_0x56fdc4(_0x3a37a9,_0x1ef4e7,new _0x3a37a9()),_0x4db2d7(_0x3a37a9,_0x1ef4e7);}['init'](_0x106e14,_0x25c56b){return _0x2a2242(this,null,function*(){const _0x3dca77=_0x19fb;_0x13e274(0x1,'Initializing\x20base\x20service'),_0x25c56b!=null&&_0x25c56b[_0x3dca77(0x13e)]&&_0x56fdc4(this,_0x48b65f,!0x0),_0x568680(this,_0x51465d,_0x15acb7)[_0x3dca77(0x1eb)](this,_0x106e14);let _0x42c45b=this[_0x3dca77(0x1e2)]();if(_0x42c45b==='Crawlers'||_0x42c45b===_0x3dca77(0x173)){_0x13e274(0x2,_0x3dca77(0xe7));return;}if(yield _0x20436e[_0x3dca77(0x233)](),_0x13e274(0x1,'Verifying\x20API\x20Key'),yield _0x568680(this,_0x51465d,_0x9d60ad)[_0x3dca77(0x1eb)](this),_0x25c56b!=null&&_0x25c56b[_0x3dca77(0x13e)]&&_0x4db2d7(this,_0x13b11)[_0x3dca77(0x1eb)](this),_0x25c56b!=null&&_0x25c56b[_0x3dca77(0x1df)])try{_0x138cca[_0x3dca77(0xf6)]=!0x0,yield this[_0x3dca77(0x17d)](_0x25c56b[_0x3dca77(0x1df)]);}finally{_0x138cca[_0x3dca77(0xf6)]=!0x1;}setInterval(()=>_0x2a2242(this,null,function*(){const _0x49f847=_0x3dca77;_0x13e274(0x1,'Verifying\x20API\x20Key\x20after\x20timeout'),yield _0x568680(this,_0x51465d,_0x9d60ad)[_0x49f847(0x1eb)](this);}),0x493e0);let _0x140417=_0x568680(this,_0x51465d,_0x156b46)[_0x3dca77(0x1eb)](this);if(yield this[_0x3dca77(0x178)](),yield _0x521f21['recordEventsFromQueue'](),_0x521f21[_0x3dca77(0xe1)]({'eventName':'base_init'}),_0x13e274(0x1,_0x3dca77(0x264)),yield _0x12b3f6(_0x3dca77(0x18f),()=>_0x2a2242(this,null,function*(){const _0x189138=_0x3dca77;yield _0x1514bf['init'](_0x140417,_0x25c56b==null?void 0x0:_0x25c56b[_0x189138(0x1d8)]);})),!(_0x25c56b!=null&&_0x25c56b[_0x3dca77(0x13e)])){yield _0x568680(this,_0x51465d,_0x21b645)['call'](this);let _0x359011=history['pushState'];history['pushState']=(..._0x3f0cea)=>{const _0x468b52=_0x3dca77;_0x359011['apply'](history,_0x3f0cea),_0x568680(this,_0x51465d,_0x1abd6e)[_0x468b52(0x1eb)](this);};}_0x13e274(0x1,_0x3dca77(0x101));});}[_0x45c3bc(0x198)](_0x346f04){_0x56fdc4(this,_0x1535a1,_0x346f04);}[_0x45c3bc(0x1af)](_0x13eb45){_0x56fdc4(this,_0x1d4a65,_0x13eb45);}[_0x45c3bc(0x16d)](_0x16b532){_0x56fdc4(this,_0x3c0257,_0x16b532);}[_0x45c3bc(0x11d)](_0x49c914){_0x56fdc4(this,_0x5179bc,_0x49c914);}['getPreviousUrl'](){return _0x4db2d7(this,_0x5179bc);}[_0x45c3bc(0x1e2)](){return _0x4db2d7(this,_0x1535a1);}[_0x45c3bc(0xf2)](){return _0x4db2d7(this,_0x1d4a65);}[_0x45c3bc(0x12e)](){return _0x4db2d7(this,_0x3c0257);}[_0x45c3bc(0x20d)](){localStorage['setItem']('ttl',''+new Date()['getTime']());}['showAfterScrollAction']({data:_0x4f7f96,displayMethod:_0xa8c06,timeValueKey:_0x4275e3}){const _0x10b6b9=_0x45c3bc;let _0x3cd496=()=>{const _0x5e8134=_0x19fb;var _0x52abc0;let _0x365280=window[_0x5e8134(0x1bc)],_0x10108c=document[_0x5e8134(0x229)][_0x5e8134(0x1ee)];window[_0x5e8134(0x152)]/(_0x10108c-_0x365280)*0x64>(((_0x52abc0=_0x4f7f96[_0x4275e3])==null?void 0x0:_0x52abc0[_0x5e8134(0x206)])||0x0)&&(window[_0x5e8134(0xf3)]('scroll',_0x3cd496),_0xa8c06(_0x4f7f96));};window['addEventListener'](_0x10b6b9(0x150),_0x3cd496);}[_0x45c3bc(0xc6)]({clearActionMethod:_0x15ec61,data:_0x596128,displayMethod:_0x1dc177,idKey:_0x5aebfe,timeValueKey:_0x220ea8}){const _0x5d3020=_0x45c3bc;var _0x350e52,_0x118ce2,_0x4afbd9;let _0x128776=(_0x350e52=_0x596128[_0x220ea8])==null?void 0x0:_0x350e52[_0x5d3020(0x206)];((_0x118ce2=_0x596128[_0x220ea8])==null?void 0x0:_0x118ce2[_0x5d3020(0x111)])===_0x5d3020(0x1ce)&&(_0x128776=_0x128776*0x3c);let _0xc8015=_0x596128[_0x5d3020(0x144)]-0x1f4+(_0x128776||0x0)*0x3e8-new Date()[_0x5d3020(0xd7)]();_0x13e274(0x1,_0x5d3020(0x21d)+_0x596128['initialTime']),_0x13e274(0x1,_0x5d3020(0x1ed)+((_0x4afbd9=_0x596128[_0x220ea8])==null?void 0x0:_0x4afbd9['value'])),_0x13e274(0x1,_0x5d3020(0x217)+new Date()[_0x5d3020(0xd7)]()),_0x13e274(0x1,_0x5d3020(0x232)+_0xc8015),_0xc8015>0x0?setTimeout(()=>{_0x15ec61(_0x596128[_0x5aebfe]),_0x1dc177(_0x596128);},_0xc8015):(_0x15ec61(_0x596128[_0x5aebfe]),_0x1dc177(_0x596128));}[_0x45c3bc(0x109)](_0x39566d,_0x5a8e3c,_0x3965f2){const _0xcd71a1=_0x45c3bc;var _0x2d6666;let _0x38b667=JSON[_0xcd71a1(0x1a6)](localStorage[_0xcd71a1(0x175)](_0x5a8e3c)||'{}'),_0x97bcd8=(_0x2d6666=_0x3965f2 in _0x39566d&&_0x39566d[_0x3965f2])!=null?_0x2d6666:'';_0x97bcd8&&(_0x38b667[_0x97bcd8]=_0x8c46ba(_0x520470({},_0x39566d),{'initialTime':new Date()[_0xcd71a1(0xd7)]()}),localStorage[_0xcd71a1(0x238)](_0x5a8e3c,JSON[_0xcd71a1(0x16e)](_0x38b667)));}['checkTTL'](){return _0x2a2242(this,null,function*(){const _0x50cfa4=_0x19fb;yield _0x12b3f6(_0x50cfa4(0x1cf),()=>_0x2a2242(this,null,function*(){const _0x2ab651=_0x50cfa4;if(_0x4db2d7(this,_0x48b65f))return;_0x13e274(0x1,'Checking\x20TTL'),_0x4f60e7(_0x2ab651(0x1b1),!0x0),_0xbfebbb(_0x2ab651(0x1d2),!0x0);let _0x19394d=localStorage[_0x2ab651(0x175)](_0x2ab651(0x24f)),_0x41d47b=!0x1;if(_0x19394d){if(_0x41d47b=_0x568680(this,_0x51465d,_0x156b46)['call'](this,_0x19394d),_0x41d47b){let _0x2c4d22=localStorage[_0x2ab651(0x175)]('session'),_0x4cba38=localStorage[_0x2ab651(0x175)](_0x2ab651(0x24f));if(_0x2c4d22&&_0x4cba38){let _0x5b8e3b=parseInt(_0x4cba38,0xa);_0x521f21['recordEvent']({'eventName':_0x2ab651(0x1b2),'eventProperties':[{'eventProperty':_0x2ab651(0x25a),'value':localStorage['getItem'](_0x2ab651(0x23b))},{'eventProperty':_0x2ab651(0x1cd),'value':Number[_0x2ab651(0x123)](_0x5b8e3b)?new Date(_0x5b8e3b)['toISOString']():new Date()[_0x2ab651(0x1fb)]()}]});}this['clearLocalStorage'](),localStorage[_0x2ab651(0x238)](_0x2ab651(0x24f),''+new Date()[_0x2ab651(0xd7)]());}}else localStorage[_0x2ab651(0x238)]('ttl',''+new Date()[_0x2ab651(0xd7)]());(!_0x19394d||_0x41d47b||_0x568680(this,_0x51465d,_0x5e7c5a)['call'](this))&&(_0x568680(this,_0x51465d,_0x975990)['call'](this)&&_0x568680(this,_0x51465d,_0x199591)[_0x2ab651(0x1eb)](this),_0x568680(this,_0x51465d,_0x9734e7)['call'](this)&&(yield this['setIdentity']()),(_0x568680(this,_0x51465d,_0x156b46)[_0x2ab651(0x1eb)](this)||_0x568680(this,_0x51465d,_0x1f3c92)[_0x2ab651(0x1eb)](this))&&(yield _0x568680(this,_0x51465d,_0x4ae6b8)[_0x2ab651(0x1eb)](this)),yield _0x568680(this,_0x51465d,_0x3f51f2)[_0x2ab651(0x1eb)](this),(_0x568680(this,_0x51465d,_0x156b46)[_0x2ab651(0x1eb)](this)||_0x568680(this,_0x51465d,_0x294549)['call'](this))&&(yield _0x568680(this,_0x51465d,_0x522813)[_0x2ab651(0x1eb)](this))),_0xbfebbb(_0x2ab651(0x1d2),!0x1),_0x4f60e7(_0x2ab651(0x1b1),!0x1);}));});}[_0x45c3bc(0x20b)](){const _0x449892=_0x45c3bc;localStorage[_0x449892(0xc4)](_0x449892(0x20c)),localStorage[_0x449892(0xc4)](_0x449892(0x135)),localStorage[_0x449892(0xc4)](_0x449892(0x1a3)),localStorage[_0x449892(0xc4)](_0x449892(0x25c)),localStorage[_0x449892(0xc4)](_0x449892(0x24f)),localStorage[_0x449892(0xc4)](_0x449892(0x23b));}[_0x45c3bc(0x17d)](_0x2d734a){return _0x2a2242(this,null,function*(){const _0x4c5915=_0x19fb;let _0xb9c2ee={'deviceId':localStorage[_0x4c5915(0x175)](_0x4c5915(0x164))||crypto[_0x4c5915(0x22c)](),'os':this[_0x4c5915(0x1e2)]()};if(_0x2d734a)_0xb9c2ee[_0x4c5915(0x1df)]=_0x2d734a;else{if(!_0x2d734a&&localStorage[_0x4c5915(0x175)](_0x4c5915(0x19c)))return;}try{let _0x589360=yield _0x568680(this,_0x51465d,_0x3cece7)[_0x4c5915(0x1eb)](this,_0xb9c2ee);if(_0x589360!==void 0x0){localStorage[_0x4c5915(0x238)](_0x4c5915(0x19c),_0x589360);try{_0x1514bf['pushMessageToSW']({'customer':_0x589360});}catch(_0x1718b5){}}}catch(_0xf799a6){throw new Error('Error\x20setting\x20identity');}});}};_0x1ef4e7=new WeakMap(),_0x1535a1=new WeakMap(),_0x1d4a65=new WeakMap(),_0x3c0257=new WeakMap(),_0x5179bc=new WeakMap(),_0x45be0b=new WeakMap(),_0x48b65f=new WeakMap(),_0x13b11=new WeakMap(),_0x51465d=new WeakSet(),_0x15acb7=function(_0x172e43){const _0x2cfba0=_0x45c3bc;_0x20436e[_0x2cfba0(0x15c)](_0x172e43),this['setPlatform'](_0x568680(this,_0x51465d,_0x2c1943)[_0x2cfba0(0x1eb)](this)),this[_0x2cfba0(0x1af)](_0x568680(this,_0x51465d,_0x28abfb)['call'](this)),this[_0x2cfba0(0x16d)](navigator[_0x2cfba0(0x1fe)]);},_0x2c1943=function(){const _0x248bd9=_0x45c3bc;var _0x286ed4;let _0x1290dc=navigator[_0x248bd9(0x1fe)][_0x248bd9(0x1b8)]();return/googlebot|bingbot|yandexbot|duckduckbot|slurp|twitterbot|linkedinbot|facebot|pinterest|vkshare|applebot|baiduspider|adsbot-google|msnbot|yahoobot|sogou|facebookexternalhit/i[_0x248bd9(0x127)](_0x1290dc)?'Crawlers':/wv|wkwebview|instagram|facebook|fbav|fban|twitter|snapchat|pinterest|linkedin|tiktok/i[_0x248bd9(0x127)](_0x1290dc)?'Mobile':/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i[_0x248bd9(0x127)](_0x1290dc)?(_0x248bd9(0x104)in window&&typeof((_0x286ed4=window==null?void 0x0:window[_0x248bd9(0x104)])==null?void 0x0:_0x286ed4[_0x248bd9(0x117)])!=_0x248bd9(0x227),_0x248bd9(0xb7)):/windows|macintosh|linux|x11/i[_0x248bd9(0x127)](_0x1290dc)?_0x248bd9(0x15a):_0x248bd9(0x173);},_0x28abfb=function(){const _0x2e4ccb=_0x45c3bc;let _0x522155=navigator[_0x2e4ccb(0x1fe)],_0x77c265;return _0x522155[_0x2e4ccb(0x224)]('Chrome')>-0x1?_0x77c265='Google\x20Chrome':_0x522155[_0x2e4ccb(0x224)](_0x2e4ccb(0x134))>-0x1?_0x77c265='Safari':_0x522155['indexOf'](_0x2e4ccb(0x1cb))>-0x1?_0x77c265=_0x2e4ccb(0x252):_0x522155[_0x2e4ccb(0x224)](_0x2e4ccb(0x274))>-0x1?_0x77c265=_0x2e4ccb(0x203):_0x522155['indexOf'](_0x2e4ccb(0xde))>-0x1?_0x77c265=_0x2e4ccb(0x18b):_0x77c265='Unknown',_0x77c265;},_0x156b46=function(_0x511955){const _0x594d52=_0x45c3bc;let _0x433223;return _0x511955||(_0x433223=localStorage[_0x594d52(0x175)](_0x594d52(0x24f))),_0x511955||_0x433223?new Date()[_0x594d52(0xd7)]()-parseInt(_0x511955||_0x433223||'',0xa)>0x124f80:!0x0;},_0x1f3c92=function(){const _0x1dcbac=_0x45c3bc;return!localStorage['getItem'](_0x1dcbac(0x135));},_0x294549=function(){const _0x1b93a3=_0x45c3bc;return!localStorage[_0x1b93a3(0x175)](_0x1b93a3(0x1a3));},_0x9734e7=function(){const _0x260ea4=_0x45c3bc;return!localStorage[_0x260ea4(0x175)](_0x260ea4(0x19c));},_0x975990=function(){const _0x26be5c=_0x45c3bc;return!localStorage[_0x26be5c(0x175)](_0x26be5c(0x164));},_0x1ff31b=function(){const _0x4ac985=_0x45c3bc;return!localStorage[_0x4ac985(0x175)](_0x4ac985(0x23b));},_0x5e7c5a=function(){const _0x35c3b5=_0x45c3bc;return _0x568680(this,_0x51465d,_0x1f3c92)[_0x35c3b5(0x1eb)](this)||_0x568680(this,_0x51465d,_0x294549)[_0x35c3b5(0x1eb)](this)||_0x568680(this,_0x51465d,_0x9734e7)[_0x35c3b5(0x1eb)](this)||_0x568680(this,_0x51465d,_0x975990)[_0x35c3b5(0x1eb)](this)||_0x568680(this,_0x51465d,_0x1ff31b)['call'](this);},_0x199591=function(){const _0xc7ec19=_0x45c3bc;let _0x23f3a3=localStorage[_0xc7ec19(0x175)](_0xc7ec19(0x164));return _0x23f3a3||(_0x23f3a3=crypto[_0xc7ec19(0x22c)](),localStorage[_0xc7ec19(0x238)]('uniqueIdentity',_0x23f3a3)),_0x23f3a3;},_0x3f51f2=function(){return _0x2a2242(this,null,function*(){const _0x327728=_0x19fb;yield _0x12b3f6(_0x327728(0xc2),()=>_0x2a2242(this,null,function*(){const _0x29c20f=_0x327728;let _0x39afe3=localStorage[_0x29c20f(0x175)](_0x29c20f(0x23b));if(!_0x39afe3){_0x39afe3=crypto['randomUUID'](),localStorage[_0x29c20f(0x238)](_0x29c20f(0x23b),_0x39afe3);let _0x24d8db=localStorage[_0x29c20f(0x175)](_0x29c20f(0x24f)),_0x1b83a7=_0x24d8db?parseInt(_0x24d8db,0xa):'';yield _0x521f21['recordEvent']({'eventName':_0x29c20f(0x1a2),'eventProperties':[{'eventProperty':_0x29c20f(0x25a),'value':localStorage[_0x29c20f(0x175)](_0x29c20f(0x23b))},{'eventProperty':_0x29c20f(0x1cd),'value':_0x1b83a7?new Date(_0x1b83a7)['toISOString']():new Date()[_0x29c20f(0x1fb)]()}]});}}),_0x1ad4d0=>{const _0x5438c5=_0x327728;_0x521f21['recordEvent']({'eventName':_0x5438c5(0x147),'eventProperties':[{'eventProperty':'message','value':'store\x20session\x20-\x20'+_0x1ad4d0[_0x5438c5(0x151)]}]},!0x0);});});},_0x3cece7=function(_0x4a217d){return _0x2a2242(this,null,function*(){const _0x3cb6a4=_0x19fb;try{return(yield _0x20436e[_0x3cb6a4(0x182)](''+_0x3e5ca9+_0x4eb4d9,_0x4a217d))[_0x3cb6a4(0x170)];}catch(_0xea0975){throw new Error('Error\x20posting\x20identity\x20data');}});},_0x4ae6b8=function(){return _0x2a2242(this,null,function*(){const _0x1e4004=_0x19fb;yield _0x521f21[_0x1e4004(0x210)]();});},_0x522813=function(){return _0x2a2242(this,null,function*(){const _0x2cbf83=_0x19fb;yield _0x27a081[_0x2cbf83(0x211)]();});},_0x9d60ad=function(){return _0x2a2242(this,null,function*(){const _0x5e21a2=_0x19fb;yield _0x12b3f6(_0x5e21a2(0xfa),()=>_0x2a2242(this,null,function*(){const _0x45a4d4=_0x5e21a2;var _0x4abf19;try{let _0x32fab0=parseInt(localStorage[_0x45a4d4(0x175)](_0x45a4d4(0x11c))||'0',0xa)||0x0;if(!_0x32fab0||_0x32fab0&&new Date()[_0x45a4d4(0xd7)]()>_0x32fab0){let _0x3a65c6=yield _0x20436e[_0x45a4d4(0x10a)](_0x45a4d4(0x1e5));if(!(_0x3a65c6!=null&&_0x3a65c6['success']))throw new Error(JSON[_0x45a4d4(0x16e)](_0x3a65c6));localStorage[_0x45a4d4(0x238)]('verifyTTL',(new Date()['getTime']()+0x493e0)[_0x45a4d4(0x266)]());}_0x138cca['isInitialized']=!0x0;}catch(_0x590f6b){throw _0x20436e['getBrandId']()==='67'&&!((_0x4abf19=_0x590f6b==null?void 0x0:_0x590f6b['message'])!=null&&_0x4abf19[_0x45a4d4(0x158)](_0x45a4d4(0x10a)))&&_0x521f21['recordEvent']({'eventName':'Debug\x20Event','eventProperties':[{'eventProperty':'message','value':_0x45a4d4(0x26f)+_0x590f6b[_0x45a4d4(0x151)]}]},!0x0),_0x138cca['disableSDK']=!0x0,new Error(_0x45a4d4(0x21a));}}));});},_0x377118=function(){return _0x2a2242(this,null,function*(){const _0x1d34a6=_0x19fb;var _0x4a1b71;_0x13e274(0x1,_0x1d34a6(0x10c));let _0x298ebb=(_0x4a1b71=window==null?void 0x0:window[_0x1d34a6(0x110)])==null?void 0x0:_0x4a1b71[_0x1d34a6(0x19d)];this[_0x1d34a6(0x11d)](_0x298ebb),_0x521f21[_0x1d34a6(0xe1)]({'eventName':_0x1d34a6(0xd0)});let _0x2cadca=[];new URLSearchParams(new URL(window[_0x1d34a6(0x110)]['href'])['search'])[_0x1d34a6(0x241)]((_0x4ffad8,_0x26cedc)=>_0x2a2242(this,null,function*(){const _0x2ce0d2=_0x1d34a6;_0x16c7b2[_0x2ce0d2(0x223)](_0x26cedc)&&_0x2cadca['push']({'eventProperty':_0x26cedc,'value':_0x4ffad8});})),yield _0x521f21[_0x1d34a6(0x133)]({'eventName':'Viewed\x20Webpage','eventProperties':[{'eventProperty':_0x1d34a6(0xdc),'value':window[_0x1d34a6(0x110)][_0x1d34a6(0x220)]},..._0x2cadca]});});},_0x1abd6e=function(){return _0x2a2242(this,null,function*(){const _0x3ab79b=_0x19fb;var _0x9b990a;_0x13e274(0x1,'Tracking\x20page\x20change');let _0x5e0266=(_0x9b990a=window==null?void 0x0:window[_0x3ab79b(0x110)])==null?void 0x0:_0x9b990a[_0x3ab79b(0x19d)];(this[_0x3ab79b(0xf8)]()===null||this[_0x3ab79b(0xf8)]()===void 0x0||_0x5e0266!==this[_0x3ab79b(0xf8)]())&&(yield _0x568680(this,_0x51465d,_0x377118)[_0x3ab79b(0x1eb)](this));});},_0x21b645=function(){return _0x2a2242(this,null,function*(){const _0x467632=_0x19fb;var _0x409e4c,_0x2ba914;let _0x4816df=(_0x409e4c=window==null?void 0x0:window[_0x467632(0x110)])==null?void 0x0:_0x409e4c['href'];_0x521f21[_0x467632(0xe1)]({'eventName':_0x467632(0x254),'eventProperties':[{'eventProperty':_0x467632(0x151),'value':(_0x4816df!==this['getPreviousUrl']())+':'+_0x4816df+':'+this[_0x467632(0xf8)]()}]});try{yield _0x568680(this,_0x51465d,_0x377118)[_0x467632(0x1eb)](this);}catch(_0x105a8c){let _0x7817fa=_0x105a8c&&_0x105a8c[_0x467632(0x151)]?(_0x2ba914=_0x105a8c==null?void 0x0:_0x105a8c[_0x467632(0x151)])==null?void 0x0:_0x2ba914[_0x467632(0xe5)](0x0,0x64):'undefined';yield _0x521f21[_0x467632(0xe1)]({'eventName':_0x467632(0xc1),'eventProperties':[{'eventProperty':_0x467632(0x151),'value':''+_0x7817fa}]});}});},_0x2b65cc(_0x337f1c,_0x1ef4e7);var _0x3922fb=_0x337f1c,_0x281447=_0x3922fb[_0x45c3bc(0x208)](),_0x54f175,_0x4af590,_0x55d08f,_0x1bf808,_0x11fb60,_0x3a9bb7,_0x558b59,_0x5f5396,_0x24d305=class _0x4bbdbb{constructor(){const _0x573f2a=_0x45c3bc;_0x2b65cc(this,_0x4af590),this[_0x573f2a(0x1c3)]=Promise[_0x573f2a(0x13f)]();}static[_0x45c3bc(0x208)](){const _0x5d68cb=_0x45c3bc;var _0x20b3e7;return _0x4db2d7(_0x4bbdbb,_0x54f175)||(_0x56fdc4(_0x4bbdbb,_0x54f175,new _0x4bbdbb()),_0x568680(_0x20b3e7=_0x4db2d7(_0x4bbdbb,_0x54f175),_0x4af590,_0x55d08f)[_0x5d68cb(0x1eb)](_0x20b3e7)),_0x4db2d7(_0x4bbdbb,_0x54f175);}['pushToQueue'](_0x3c88f5){const _0x183d05=_0x45c3bc;let _0xe2bcae=JSON[_0x183d05(0x1a6)](localStorage['getItem']('preInitializedEvents')||'[]');_0xe2bcae[_0x183d05(0x14a)](_0x3c88f5),localStorage[_0x183d05(0x238)](_0x183d05(0x1fc),JSON[_0x183d05(0x16e)](_0xe2bcae));}[_0x45c3bc(0xe3)](){return _0x2a2242(this,null,function*(){const _0x4eabe0=_0x19fb;let _0x193363=JSON['parse'](localStorage['getItem'](_0x4eabe0(0x1fc))||'[]');if(Array[_0x4eabe0(0xc3)](_0x193363)){for(let _0x498c1c of _0x193363)yield this[_0x4eabe0(0x160)](_0x498c1c);}});}[_0x45c3bc(0x133)](_0x4319c1,_0x1280b3){return _0x2a2242(this,null,function*(){const _0x2f0ed9=_0x19fb;_0x138cca[_0x2f0ed9(0x1da)]&&!_0x138cca[_0x2f0ed9(0xf6)]?yield _0x568680(this,_0x4af590,_0x1bf808)['call'](this,_0x4319c1,_0x1280b3):this['pushToQueue'](_0x4319c1);});}[_0x45c3bc(0x160)](_0x742eaa){return _0x2a2242(this,null,function*(){const _0x5ae3af=_0x19fb;try{yield _0x568680(this,_0x4af590,_0x1bf808)[_0x5ae3af(0x1eb)](this,_0x742eaa);}finally{_0x568680(this,_0x4af590,_0x5f5396)[_0x5ae3af(0x1eb)](this,_0x742eaa[_0x5ae3af(0x105)]);}});}[_0x45c3bc(0xe1)](_0x1e58e7){return _0x2a2242(this,null,function*(){const _0x3df9f0=_0x19fb;_0x138cca[_0x3df9f0(0x26c)]===0x4&&(!_0x138cca[_0x3df9f0(0xee)]||_0x138cca[_0x3df9f0(0xee)][_0x1e58e7[_0x3df9f0(0x105)]])&&(yield _0x568680(this,_0x4af590,_0x1bf808)['call'](this,_0x1e58e7));});}['getStoredEvents'](){const _0x7e8575=_0x45c3bc;let _0x2c81d6=localStorage[_0x7e8575(0x175)](_0x7e8575(0x135));return _0x2c81d6?JSON[_0x7e8575(0x1a6)](_0x2c81d6):{};}['storeEventsAndPropertiesInLocalStorage'](){return _0x2a2242(this,null,function*(){const _0x2cfff4=_0x19fb;if(!localStorage[_0x2cfff4(0x175)](_0x2cfff4(0x135))){let _0x7b5677=(yield this[_0x2cfff4(0x1c6)]())[_0x2cfff4(0x170)];if(_0x7b5677){localStorage[_0x2cfff4(0x238)](_0x2cfff4(0x135),JSON['stringify'](_0x7b5677));try{_0x1514bf[_0x2cfff4(0x1ea)]({'events':_0x7b5677});}catch(_0x821e8c){}}}});}[_0x45c3bc(0x1c6)](){return _0x2a2242(this,null,function*(){const _0x2611b3=_0x19fb;try{return yield _0x20436e[_0x2611b3(0x10a)](''+_0x2db61c);}catch(_0x274cf2){throw new Error(_0x2611b3(0x228));}});}[_0x45c3bc(0xdb)](_0x2079ad,_0x51e6a1){return _0x2a2242(this,null,function*(){const _0x2f3a63=_0x19fb;let _0xb2fa91=null,_0x341d54=null,_0x20e0bc=new AbortController();return this['queue']=this['queue']['then'](()=>_0x2a2242(this,null,function*(){const _0x1311e4=_0x19fb;try{if(_0x2079ad['events'][_0x1311e4(0x222)]===0x0)throw new Error('No\x20events\x20to\x20record');let _0x64f742=yield _0x20436e[_0x1311e4(0x182)]('/v2'+_0x2db61c+_0x56855d,_0x2079ad,_0x20e0bc[_0x1311e4(0xec)]);if(_0x64f742[_0x1311e4(0x26a)])return _0x341d54=_0x64f742,_0x64f742;if(_0x64f742['message']===_0x1311e4(0x239)+localStorage[_0x1311e4(0x175)](_0x1311e4(0x19c))+_0x1311e4(0x102))throw localStorage['removeItem'](_0x1311e4(0x19c)),new Error(_0x1311e4(0x216));}catch(_0x34cc2c){throw _0x13e274(0x2,_0x1311e4(0x106)),_0x13e274(0x2,_0x1311e4(0x1dc)+_0x34cc2c[_0x1311e4(0x12a)]),_0x13e274(0x2,'message:\x20'+_0x34cc2c[_0x1311e4(0x151)]),(_0x34cc2c['name']===_0x1311e4(0x21e)||_0x34cc2c[_0x1311e4(0x12a)]===_0x1311e4(0x26e)&&_0x34cc2c[_0x1311e4(0x151)]===_0x1311e4(0x24a))&&(_0x13e274(0x2,_0x1311e4(0x1b3)),_0x51e6a1&&_0x568680(this,_0x4af590,_0x558b59)[_0x1311e4(0x1eb)](this,_0x51e6a1)),_0xb2fa91=new Error(_0x1311e4(0xf0)),_0x34cc2c;}return null;}))[_0x2f3a63(0x16c)](()=>{}),this[_0x2f3a63(0x1c3)][_0x2f3a63(0x21f)](()=>{if(_0xb2fa91)throw _0xb2fa91;return _0x341d54;});});}};_0x54f175=new WeakMap(),_0x4af590=new WeakSet(),_0x55d08f=function(){return _0x2a2242(this,null,function*(){});},_0x1bf808=function(_0x12aecf,_0x33f84a){return _0x2a2242(this,null,function*(){const _0x428369=_0x19fb;yield _0x12b3f6(_0x428369(0xc0),()=>_0x2a2242(this,null,function*(){const _0x432141=_0x428369;var _0x3e3044,_0x37ffa2,_0x5401fb,_0x1926c5;let {campaignCustomerInstanceId:_0x4067c4,campaignId:_0x5a615b,eventName:_0x342f10,eventProperties:_0x8fb3f0,name:_0x49a884,web_optin_instance_id:_0x5c2abf}=_0x12aecf;_0x13e274(0x1,'#\x20Recording\x20event'),_0x4f60e7(_0x432141(0x1ca),!0x0),_0xbfebbb(_0x432141(0x139),!0x0),_0x13e274(0x1,_0x432141(0x1d7)),_0x13e274(0x1,{'campaignCustomerInstanceId':_0x4067c4,'eventName':_0x342f10,'eventProperties':_0x8fb3f0,'name':_0x49a884,'web_optin_instance_id':_0x5c2abf});let _0x300c6d=_0x281447['getPlatform']();if(_0x300c6d===_0x432141(0xc7)||_0x300c6d===_0x432141(0x173))throw new Error(_0x432141(0x116));_0x342f10!==_0x432141(0x1b2)&&(yield _0x281447['checkTTL']());let _0x17db0e=[];_0x8fb3f0&&_0x17db0e[_0x432141(0x14a)](..._0x8fb3f0),_0x17db0e[_0x432141(0x14a)]({'eventProperty':_0x432141(0x1bb),'value':_0x300c6d}),_0x17db0e[_0x432141(0x14a)]({'eventProperty':'operating-system','value':_0x281447['getOperatingSystem']()}),_0x17db0e[_0x432141(0x14a)]({'eventProperty':_0x432141(0x1b6),'value':_0x281447[_0x432141(0xf2)]()});let _0x209eb8=this[_0x432141(0x13c)](),_0x13bcae=_0x568680(this,_0x4af590,_0x11fb60)[_0x432141(0x1eb)](this,_0x209eb8,_0x342f10,_0x17db0e);if(typeof _0x13bcae==_0x432141(0x187)){_0x13e274(0x2,_0x13bcae);return;}_0x281447[_0x432141(0x20d)]();let {id:_0x290dbd}=_0x209eb8[_0x342f10],_0x5c9c3f=_0x568680(this,_0x4af590,_0x3a9bb7)['call'](this,_0x520470(_0x8c46ba(_0x520470(_0x520470(_0x520470({},_0x4067c4?{'campaignCustomerInstanceId':_0x4067c4}:{}),_0x5a615b?{'campaignId':_0x5a615b}:{}),_0x5c2abf?{'web_optin_instance_id':_0x5c2abf}:{}),{'eventId':_0x290dbd,'eventProperties':_0x13bcae,'sessionId':localStorage[_0x432141(0x175)](_0x432141(0x23b))||''}),_0x49a884?{'name':_0x49a884}:{}));if(_0x138cca[_0x432141(0x21b)]){let _0x47dbc6=JSON[_0x432141(0x1a6)](localStorage['getItem'](_0x432141(0x25c))||'[]');_0x47dbc6[_0x432141(0x222)]<=0x32&&(_0x47dbc6[_0x432141(0x14a)](..._0x5c9c3f[_0x432141(0x135)]),localStorage[_0x432141(0x238)](_0x432141(0x25c),JSON[_0x432141(0x16e)](_0x47dbc6)));return;}let _0x41db24=yield this[_0x432141(0xdb)](_0x5c9c3f,_0x12aecf);(_0x3e3044=_0x41db24==null?void 0x0:_0x41db24[_0x432141(0x170)])!=null&&_0x3e3044[_0x432141(0x273)]?(yield this['recordDebugEvents']({'eventName':_0x432141(0x1dd)}),_0x1514bf['showNotification'](_0x41db24[_0x432141(0x170)]['optIn'])):_0x342f10==='Viewed\x20Webpage'&&(yield this['recordDebugEvents']({'eventName':'no_optin','eventProperties':[{'eventProperty':_0x432141(0x151),'value':''+(_0x432141(0x104)in window&&typeof((_0x37ffa2=window==null?void 0x0:window[_0x432141(0x104)])==null?void 0x0:_0x37ffa2['permission'])!=_0x432141(0x227))}]})),(_0x1926c5=(_0x5401fb=_0x41db24==null?void 0x0:_0x41db24[_0x432141(0x170)])==null?void 0x0:_0x5401fb['campaigns'])==null||_0x1926c5['forEach'](_0x28ecaa=>{const _0x4ea348=_0x432141;_0x910f2b['isPopupAction'](_0x28ecaa[_0x4ea348(0x151)][_0x4ea348(0x12a)])?_0x910f2b[_0x4ea348(0x245)](_0x28ecaa):_0x289440[_0x4ea348(0xbb)](_0x28ecaa[_0x4ea348(0x151)][_0x4ea348(0x12a)])&&_0x289440['showContentCard'](_0x28ecaa);}),_0xbfebbb(_0x432141(0x139),!0x1),_0x4f60e7('Recording\x20event',!0x1);}),_0x3240c2=>{const _0x2311f2=_0x428369;this['recordEvent']({'eventName':_0x2311f2(0x147),'eventProperties':[{'eventProperty':'message','value':'record\x20event\x20-\x20'+_0x12aecf+_0x2311f2(0x251)+_0x3240c2[_0x2311f2(0x151)]}]},!0x0);},_0x33f84a);});},_0x11fb60=function(_0x53526b,_0x3697bf,_0x5e581d){const _0xbf1961=_0x45c3bc;if(!Object[_0xbf1961(0x1d4)]['hasOwnProperty'][_0xbf1961(0x1eb)](_0x53526b,_0x3697bf))return _0xbf1961(0x17c)+_0x3697bf+_0xbf1961(0x119);if(!_0x5e581d)return[];let _0x385662=_0x53526b[_0x3697bf];if(!(_0x385662!=null&&_0x385662['eventProperty']))return _0xbf1961(0x17c)+_0x3697bf+_0xbf1961(0x262);let _0x53318e=_0x5e581d[_0xbf1961(0x200)](({eventProperty:_0x308ccc})=>!Object[_0xbf1961(0x1d4)][_0xbf1961(0x149)][_0xbf1961(0x1eb)](_0x385662['eventProperty'],_0x308ccc))['map'](({eventProperty:_0x45d816})=>_0x45d816);return _0x53318e[_0xbf1961(0x222)]>0x0?_0xbf1961(0x17c)+_0x3697bf+_0xbf1961(0x1db)+_0x53318e[_0xbf1961(0x11e)](',\x20')+'.':_0x5e581d['map'](({eventProperty:_0x2be2b4,value:_0x58d43e})=>({'eventPropertyId':_0x385662[_0xbf1961(0x108)][_0x2be2b4]['id'],'value':_0x58d43e}));},_0x3a9bb7=function(_0x461b9b){const _0x1e8f9b=_0x45c3bc;return{'customerId':localStorage['getItem'](_0x1e8f9b(0x19c))||'','deviceId':localStorage[_0x1e8f9b(0x175)](_0x1e8f9b(0x164))||'','events':[_0x461b9b]};},_0x558b59=function(_0x2a934f){const _0xec8044=_0x45c3bc;_0x13e274(0x1,_0xec8044(0x154)),_0x13e274(0x1,_0x2a934f);let _0x3f7cd7=localStorage[_0xec8044(0x175)](_0xec8044(0x1fc));_0x3f7cd7&&_0x3f7cd7!=='undefined'?(_0x3f7cd7=JSON[_0xec8044(0x1a6)](_0x3f7cd7),_0x3f7cd7['push'](_0x2a934f)):_0x3f7cd7=[_0x2a934f],localStorage[_0xec8044(0x238)]('preInitializedEvents',JSON['stringify'](_0x3f7cd7));},_0x5f5396=function(_0xb94188){const _0x4bc638=_0x45c3bc;let _0x4d86ca=JSON[_0x4bc638(0x1a6)](localStorage[_0x4bc638(0x175)](_0x4bc638(0x1fc))||'[]'),_0x1cde94=_0x4d86ca[_0x4bc638(0x167)](_0x4692d9=>_0x4692d9[_0x4bc638(0x105)]===_0xb94188);_0x1cde94>=0x0&&_0x4d86ca['splice'](_0x1cde94,0x1),localStorage['setItem']('preInitializedEvents',JSON[_0x4bc638(0x16e)](_0x4d86ca));},_0x2b65cc(_0x24d305,_0x54f175);var _0x2281a1=_0x24d305,_0x521f21=_0x2281a1['getInstance'](),_0x138cca=class extends Error{constructor(_0x383f0f){const _0x1fee31=_0x45c3bc;super(_0x383f0f),this[_0x1fee31(0x12a)]='MergnError';}};_0x138cca[_0x45c3bc(0x1a8)]=!0x1,_0x138cca[_0x45c3bc(0x21b)]=!navigator['onLine'],_0x138cca['debugLevel']=0x0,_0x138cca[_0x45c3bc(0x1da)]=!0x1,_0x138cca[_0x45c3bc(0xf6)]=!0x1;var _0x565051=(_0x524c86,_0x3e6539)=>{const _0x390a35=_0x45c3bc;_0x3e6539 instanceof _0x138cca?_0x13e274(0x2,_0x390a35(0x1bf)+_0x524c86+'\x0aMergnError:\x20'+_0x3e6539[_0x390a35(0x151)]):_0x3e6539 instanceof Error?_0x13e274(0x2,_0x390a35(0x1bf)+_0x524c86+_0x390a35(0x23e)+_0x3e6539['message']):_0x13e274(0x2,_0x390a35(0x1bf)+_0x524c86+_0x390a35(0x23e)+String(_0x3e6539));},_0x12b3f6=(_0x59c541,_0x254cef,_0x5c7da,_0x53e44f=!0x1)=>_0x2a2242(void 0x0,null,function*(){const _0xb16eef=_0x45c3bc;try{_0x4f60e7(_0x59c541,!0x0),_0xbfebbb(_0x59c541+_0xb16eef(0x1f4),!0x0);try{if(_0x138cca[_0xb16eef(0x1a8)])throw new _0x138cca(_0xb16eef(0x26d));if(_0x59c541!==_0xb16eef(0xd6)&&_0x138cca[_0xb16eef(0x21b)])throw new _0x138cca('Mergn\x20is\x20offline!');if(_0x59c541!==_0xb16eef(0xfc)&&_0x59c541!=='verify\x20API\x20key'&&_0x59c541!=='record\x20event'&&_0x59c541!=='recordAttribute'&&!_0x138cca[_0xb16eef(0x1da)])throw new _0x138cca(_0xb16eef(0x115));if(_0x59c541!==_0xb16eef(0xff)&&_0x138cca['loading'])throw new _0x138cca('Mergn\x20is\x20loading!');return yield _0x254cef();}catch(_0x5d0506){return _0x5c7da?_0x5c7da(_0x5d0506):(_0x138cca[_0xb16eef(0x26c)]===0x2||_0x138cca[_0xb16eef(0x26c)]===0x3)&&_0x565051(_0x59c541,_0x5d0506),!_0x53e44f&&_0x20436e[_0xb16eef(0x188)]()==='67'&&_0x5d0506[_0xb16eef(0x151)]!==_0xb16eef(0x24a)&&_0x521f21[_0xb16eef(0x133)]({'eventName':_0xb16eef(0x147),'eventProperties':[{'eventProperty':_0xb16eef(0x151),'value':_0x59c541+_0xb16eef(0x251)+_0x5d0506[_0xb16eef(0x151)]}]},!0x0),null;}finally{_0xbfebbb(_0x59c541+'\x20Time',!0x1),_0x4f60e7(_0x59c541,!0x1);}}catch(_0x3ba762){return null;}}),_0x2f956b=(_0x27480e=>(_0x27480e[_0x27480e[_0x45c3bc(0x155)]=0x0]='NONE',_0x27480e[_0x27480e[_0x45c3bc(0x17e)]=0x1]=_0x45c3bc(0x17e),_0x27480e[_0x27480e[_0x45c3bc(0x1c7)]=0x2]=_0x45c3bc(0x1c7),_0x27480e[_0x27480e[_0x45c3bc(0x250)]=0x3]=_0x45c3bc(0x250),_0x27480e[_0x27480e[_0x45c3bc(0x271)]=0x4]=_0x45c3bc(0x271),_0x27480e))(_0x2f956b||{}),_0x13e274=(_0xafcfe2,_0x10c78c)=>{const _0x12a7be=_0x45c3bc;_0x138cca[_0x12a7be(0x26c)]!==0x0&&(_0x138cca['debugLevel']>=0x3?_0xafcfe2===0x1?console[_0x12a7be(0x103)]('INFO:\x20'+new Date()[_0x12a7be(0x1fb)](),_0x10c78c):_0xafcfe2===0x2&&console[_0x12a7be(0x13d)](_0x12a7be(0x268)+new Date()['toISOString'](),_0x10c78c):_0x138cca[_0x12a7be(0x26c)]===0x1&&_0xafcfe2===0x1?console[_0x12a7be(0x103)](_0x12a7be(0xd3)+new Date()[_0x12a7be(0x1fb)](),_0x10c78c):_0x138cca[_0x12a7be(0x26c)]===0x2&&_0xafcfe2===0x2&&console[_0x12a7be(0x13d)](_0x12a7be(0x268)+new Date()[_0x12a7be(0x1fb)](),_0x10c78c));},_0xbfebbb=(_0x355de6,_0x587711)=>{const _0x4d76b8=_0x45c3bc;_0x138cca[_0x4d76b8(0x26c)]!==0x0&&(_0x587711?console[_0x4d76b8(0x18e)](_0x355de6):console[_0x4d76b8(0x1e1)](_0x355de6));},_0x4f60e7=(_0x139525,_0x136955)=>{const _0x3b120e=_0x45c3bc;_0x138cca[_0x3b120e(0x26c)]!==0x0&&(_0x136955?console['group'](_0x139525):console[_0x3b120e(0x1a7)]());},_0x3c79b6,_0x3ca4b8=class _0x1e7d58{constructor(){}static[_0x45c3bc(0x208)](){return _0x4db2d7(_0x1e7d58,_0x3c79b6)||_0x56fdc4(_0x1e7d58,_0x3c79b6,new _0x1e7d58()),_0x4db2d7(_0x1e7d58,_0x3c79b6);}[_0x45c3bc(0xfc)](_0x379d59,_0x5d6819){setTimeout(()=>{const _0x52cdcb=_0x19fb;_0x12b3f6(_0x52cdcb(0xfc),()=>_0x2a2242(this,null,function*(){const _0x248e15=_0x52cdcb;_0x13e274(0x1,_0x248e15(0xda)),yield _0x281447['init'](_0x379d59,_0x5d6819),_0x521f21[_0x248e15(0xe1)]({'eventName':_0x248e15(0x13a)}),_0x13e274(0x1,'Mergn\x20SDK\x20Initialized');let _0x1addfb=JSON[_0x248e15(0x1a6)](localStorage['getItem']('preInitializedAttributes')||'[]');Array[_0x248e15(0xc3)](_0x1addfb)&&_0x1addfb[_0x248e15(0x241)]((_0xf240bf,_0x7aed33)=>_0x2a2242(this,null,function*(){const _0x3ff96d=_0x248e15;yield _0x27a081[_0x3ff96d(0x197)](_0xf240bf['attributeName'],_0xf240bf[_0x3ff96d(0x253)]),_0x1addfb[_0x3ff96d(0x168)](_0x7aed33,0x1),localStorage[_0x3ff96d(0x238)](_0x3ff96d(0x213),JSON[_0x3ff96d(0x16e)](_0x1addfb));})),window[_0x248e15(0x261)](_0x248e15(0x12b),()=>_0x2a2242(this,null,function*(){const _0x4bc44e=_0x248e15;_0x138cca[_0x4bc44e(0x21b)]=!0x1;let _0x51a2f3=JSON['parse'](localStorage[_0x4bc44e(0x175)](_0x4bc44e(0x25c))||'[]');Array[_0x4bc44e(0xc3)](_0x51a2f3)&&(yield _0x521f21['postEventRecord']({'customerId':localStorage[_0x4bc44e(0x175)](_0x4bc44e(0x19c))||'','deviceId':localStorage[_0x4bc44e(0x175)](_0x4bc44e(0x164))||'','events':_0x51a2f3}),localStorage[_0x4bc44e(0xc4)](_0x4bc44e(0x25c))),_0x281447['checkTTL'](),_0x281447[_0x4bc44e(0x20d)]();})),window[_0x248e15(0x261)]('offline',()=>{const _0x4822c2=_0x248e15;_0x138cca[_0x4822c2(0x21b)]=!0x0;}),window[_0x248e15(0x261)](_0x248e15(0x1d6),()=>{const _0x1adad4=_0x248e15;_0x910f2b[_0x1adad4(0x142)](),_0x1514bf[_0x1adad4(0x132)]();});}));});}['setDebugLevel'](_0x5c89ef,_0x1725c2){const _0x5c817a=_0x45c3bc;if(!(_0x5c89ef in _0x2f956b)){console[_0x5c817a(0x13d)]('Debug\x20level\x20must\x20be\x20according\x20to:\x0a\x20NONE:\x200,\x20INFO:\x201,\x20ERROR:\x202,\x20ALL:\x203');return;}_0x138cca[_0x5c817a(0xee)]=_0x1725c2||{},_0x138cca[_0x5c817a(0x26c)]=_0x5c89ef;try{_0x1514bf[_0x5c817a(0x1ea)]({'debugLevel':_0x5c89ef});}catch(_0xc44c8c){}}[_0x45c3bc(0x197)](_0x467479,_0x59d7da){return _0x2a2242(this,null,function*(){return new Promise((_0x2daeb9,_0x16a063)=>{setTimeout(()=>_0x2a2242(this,null,function*(){const _0x117385=_0x19fb;try{yield _0x12b3f6(_0x117385(0x197),()=>_0x2a2242(this,null,function*(){const _0x2d7aac=_0x117385;let _0x47a1ea;Array[_0x2d7aac(0xc3)](_0x59d7da)?_0x47a1ea=JSON[_0x2d7aac(0x16e)](_0x59d7da):typeof _0x59d7da==_0x2d7aac(0x1f2)?_0x47a1ea=''+_0x59d7da:_0x47a1ea=_0x59d7da,_0x13e274(0x1,_0x2d7aac(0x1bd)),_0x13e274(0x1,'Attribute\x20Name:\x20'+_0x467479+_0x2d7aac(0x121)+_0x47a1ea);let _0x9472a3=JSON[_0x2d7aac(0x1a6)](localStorage[_0x2d7aac(0x175)]('preInitializedAttributes')||'[]');_0x9472a3[_0x2d7aac(0x14a)]({'attributeName':_0x467479,'attrValueStringified':_0x47a1ea}),localStorage[_0x2d7aac(0x238)](_0x2d7aac(0x213),JSON[_0x2d7aac(0x16e)](_0x9472a3)),_0x138cca['isInitialized']&&(yield _0x27a081[_0x2d7aac(0x197)](_0x467479,_0x47a1ea));})),_0x2daeb9();}catch(_0x5d6cf8){_0x16a063(_0x5d6cf8);}}));});});}['login'](_0x7e98ce){return _0x2a2242(this,null,function*(){return new Promise((_0x47c651,_0x9b8e60)=>{setTimeout(()=>_0x2a2242(this,null,function*(){const _0x3391e8=_0x19fb;try{yield _0x12b3f6(_0x3391e8(0xff),()=>_0x2a2242(this,null,function*(){const _0x1ee820=_0x3391e8;_0x13e274(0x1,_0x1ee820(0x1f9)),_0x13e274(0x1,'Identity:\x20'+_0x7e98ce),_0x138cca[_0x1ee820(0xf6)]=!0x0,yield _0x281447[_0x1ee820(0x17d)](_0x7e98ce);})),_0x47c651();}catch(_0x10c065){_0x9b8e60(_0x10c065);}finally{_0x138cca[_0x3391e8(0xf6)]=!0x1,yield _0x521f21[_0x3391e8(0xe3)]();}}));});});}[_0x45c3bc(0x19e)](){setTimeout(()=>{_0x12b3f6('logout',()=>_0x2a2242(this,null,function*(){const _0x496769=_0x19fb;_0x13e274(0x1,_0x496769(0x1d3)),_0x281447[_0x496769(0x20b)]();}));});}[_0x45c3bc(0x133)](_0x79c548,_0x25398c){return _0x2a2242(this,null,function*(){return new Promise((_0x20d2e0,_0x1f8b27)=>{setTimeout(()=>_0x2a2242(this,null,function*(){const _0x154084=_0x19fb;try{yield _0x12b3f6(_0x154084(0xd6),()=>_0x2a2242(this,null,function*(){const _0x4fda06=_0x154084;_0x13e274(0x1,_0x4fda06(0x1ca)),_0x13e274(0x1,'Event\x20Payload:\x0a\x20'+{'eventName':_0x79c548,'eventProperties':_0x25398c}),yield _0x521f21[_0x4fda06(0x133)]({'eventName':_0x79c548,'eventProperties':_0x25398c});})),_0x20d2e0();}catch(_0x3c0b13){_0x1f8b27(_0x3c0b13);}}));});});}['getVersion'](){return _0x51ee6d;}};_0x3c79b6=new WeakMap(),_0x2b65cc(_0x3ca4b8,_0x3c79b6);var _0x2f2514=_0x3ca4b8,_0x808bc4=_0x2f2514[_0x45c3bc(0x208)]();typeof window!='undefined'&&(window[_0x45c3bc(0x137)]=_0x808bc4);var _0x27885e=_0x808bc4;})());
package/dist/index.js CHANGED
@@ -1,76 +1 @@
1
- /* Copyright (c) 2024 MERGN */
2
- "use strict";var Pe=Object.defineProperty,un=Object.defineProperties,pn=Object.getOwnPropertyDescriptor,gn=Object.getOwnPropertyDescriptors,mn=Object.getOwnPropertyNames,pt=Object.getOwnPropertySymbols;var mt=Object.prototype.hasOwnProperty,En=Object.prototype.propertyIsEnumerable;var Et=l=>{throw TypeError(l)};var gt=(l,e,t)=>e in l?Pe(l,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):l[e]=t,z=(l,e)=>{for(var t in e||(e={}))mt.call(e,t)&&gt(l,t,e[t]);if(pt)for(var t of pt(e))En.call(e,t)&&gt(l,t,e[t]);return l},Ne=(l,e)=>un(l,gn(e));var vn=(l,e)=>{for(var t in e)Pe(l,t,{get:e[t],enumerable:!0})},In=(l,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of mn(e))!mt.call(l,n)&&n!==t&&Pe(l,n,{get:()=>e[n],enumerable:!(r=pn(e,n))||r.enumerable});return l};var Sn=l=>In(Pe({},"__esModule",{value:!0}),l);var ke=(l,e,t)=>e.has(l)||Et("Cannot "+t);var d=(l,e,t)=>(ke(l,e,"read from private field"),t?t.call(l):e.get(l)),m=(l,e,t)=>e.has(l)?Et("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(l):e.set(l,t),I=(l,e,t,r)=>(ke(l,e,"write to private field"),r?r.call(l,t):e.set(l,t),t),i=(l,e,t)=>(ke(l,e,"access private method"),t);var a=(l,e,t)=>new Promise((r,n)=>{var o=v=>{try{h(t.next(v))}catch(b){n(b)}},c=v=>{try{h(t.throw(v))}catch(b){n(b)}},h=v=>v.done?r(v.value):Promise.resolve(v.value).then(o,c);h((t=t.apply(l,e)).next())});var wn={};vn(wn,{default:()=>yn});module.exports=Sn(wn);var vt="1.0.120";var ge="https://u23z4zsda8.execute-api.ap-southeast-1.amazonaws.com/Prod/sdk-management/api",Fe="/attribute",It="/set-attribute",Be="/event",St="/record-event";var ft="/customer",ht="/device/add-device-token",bt="/set-identity",yt="/brand/get-web-push-public-key",wt="/brand/get-time";var Tt=(v=>(v.UTM_SOURCE="utm_source",v.UTM_MEDIUM="utm_medium",v.UTM_CAMPAIGN="utm_campaign",v.UTM_TERM="utm_term",v.UTM_CONTENT="utm_content",v.GAD_SOURCE="gad_source",v.GCLID="gclid",v.FBCLID="fbclid",v))(Tt||{});var Pt=new Set(Object.values(Tt));var te="Popup Action";var re,$,ne,w=class w{constructor(){m(this,$)}static getInstance(){return d(w,re)||I(w,re,new w),d(w,re)}updateAPIKey(e){w.apiKey=e;let t=e,r=/m(\d+)rgn/,n=t.match(r);n&&(w.brandId=n[1])}getAPIKey(){return w.apiKey}getBrandId(){return w.brandId}get(e){return a(this,null,function*(){try{return(yield fetch(ge+e,{headers:{Authorization:i(this,$,ne).call(this,w.apiKey),"Content-Type":"application/json"}})).json()}catch(t){let r=t.message;return this.getBrandId()==="67"&&r!=="Failed to fetch"&&r!=="Failed to load"&&u.recordEvent({eventName:"Debug Event",eventProperties:[{eventProperty:"message",value:`get - ${e} - ${i(this,$,ne).call(this,w.apiKey)} - ${t.message}`}]},!0),Promise.reject(t)}})}post(e,t,r){return a(this,null,function*(){try{return(yield fetch(ge+e,{body:JSON.stringify(t||{}),headers:{Authorization:i(this,$,ne).call(this,w.apiKey),"Content-Type":"application/json"},method:"POST",signal:r})).json()}catch(n){let o=n.message;return this.getBrandId()==="67"&&o!=="Failed to fetch"&&o!=="Failed to load"&&u.recordEvent({eventName:"Debug Event",eventProperties:[{eventProperty:"message",value:`post - ${e} - ${i(this,$,ne).call(this,w.apiKey)} - ${JSON.stringify(t||{})} -${n.message}`}]},!0),Promise.reject(n)}})}put(e,t){return a(this,null,function*(){return(yield fetch(ge+e,{body:JSON.stringify(t||{}),headers:{Authorization:i(this,$,ne).call(this,w.apiKey),"Content-Type":"application/json"},method:"PUT"})).json()})}syncRealWorldTime(){return a(this,null,function*(){try{let e=(yield(yield fetch(ge+wt)).json()).data;w.UTCDate=new Date(e),w.lastSyncTime=new Date}catch(e){s(2,"Failed to sync real-world time")}})}getCurrentUTCDate(){if(!w.UTCDate||!w.lastSyncTime)return s(2,"UTC Date or last sync time is not set"),new Date;let t=new Date().getTime()-w.lastSyncTime.getTime();return new Date(w.UTCDate.getTime()+t)}};re=new WeakMap,$=new WeakSet,ne=function(e){return btoa(`${e}:${new Date().getTime()}`)},m(w,re);var Me=w,N=Me.getInstance();var G,ie,x,Nt,Ve,_t,At,V=class V{constructor(){m(this,x);m(this,ie,!1)}static getInstance(){var e;return d(V,G)||(I(V,G,new V),i(e=d(V,G),x,Nt).call(e)),d(V,G)}recordAttribute(e,t,r){return a(this,null,function*(){yield A("# recordAttribute",()=>a(this,null,function*(){if(s(1,"Recording attribute"),C("Recording attribute",!0),L("Recording attribute Time",!0),s(1,`Attribute Payload:
3
- ${{attributeName:e,attributeProperties:r,attributeValue:t}})}`),!t||t===""){s(2,"Attribute value is required");return}yield E.checkTTL(),yield i(this,x,_t).call(this);let n=JSON.parse(localStorage.getItem("attributes")||"{}"),o=r?i(this,x,Ve).call(this,n,e,r):i(this,x,Ve).call(this,n,e);if(typeof o=="string"){s(2,o);return}n[e].should_set_identity&&(yield E.setIdentity(typeof t=="string"?t:JSON.stringify(t))),E.updateSessionCreated();let{id:c}=n[e],h={attributeId:c,attributeProperties:o,customerId:localStorage.getItem("customer")||"",value:t};yield i(this,x,At).call(this,h);let v=JSON.parse(localStorage.getItem("preInitializedAttributes")||"[]");v.pop(),localStorage.setItem("preInitializedAttributes",JSON.stringify(v)),L("Recording attribute Time",!1),C("Recording attribute",!1)}))})}storeAttributeInLocalStorage(){return a(this,null,function*(){if(!localStorage.getItem("attributes")&&!d(this,ie)){I(this,ie,!0);try{let e=(yield this.fetchAttributeData()).data;e&&localStorage.setItem("attributes",JSON.stringify(e))}catch(e){throw new Error("Error storing attribute data in local storage")}finally{I(this,ie,!1)}}})}fetchAttributeData(){return a(this,null,function*(){try{return yield N.get(`${Fe}`)}catch(e){throw new Error("Error fetching attribute data")}})}};G=new WeakMap,ie=new WeakMap,x=new WeakSet,Nt=function(){return a(this,null,function*(){})},Ve=function(e,t,r){if(!Object.prototype.hasOwnProperty.call(e,t))return`Attribute ${t} is not valid.`;if(!r)return[];let n=e[t];if(!(n!=null&&n.attributeProperty))return`Attribute ${t} does not have a valid attributeProperty.`;let o=r.filter(({attributeProperty:c})=>!Object.prototype.hasOwnProperty.call(n.attributeProperty,c)).map(({attributeProperty:c})=>c);return o.length>0?`Attribute ${t} has invalid attributeProperties: ${o.join(", ")}.`:r.map(({attributeProperty:c,value:h})=>({attributePropertyId:n.attributeProperty[c].id,value:h}))},_t=function(){return a(this,null,function*(){localStorage.getItem("attributes")||(yield this.storeAttributeInLocalStorage())})},At=function(e){return a(this,null,function*(){try{return yield N.post(`${Fe}${It}`,e)}catch(t){throw new Error("Error posting attribute record")}})},m(V,G);var $e=V,me=$e.getInstance();var Ke="Content Card Action";var Y,T,Ot,He,Lt,Ct,se,_e,Dt,Ut,xt,Ae,K=class K{constructor(){m(this,T);m(this,se,e=>{E.clearActionInLocalStorage({id:e,localStorageKey:"action"})});this.loadContentCardEventActionInLocalStorage=()=>{E.loadActionInLocalStorage({actionCondition:e=>e.message.name==="ContentCard",actionMethod:e=>i(this,T,He).call(this,e.campaignId),localStorageKey:"action"})};m(this,Ae,()=>{E.storeActionInLocalStorageInternal("action")})}static getInstance(){var e;return d(K,Y)||(I(K,Y,new K),i(e=d(K,Y),T,Ot).call(e)),d(K,Y)}showContentCard(e){let t=JSON.parse(localStorage.getItem("action")||"{}");if(t&&t[e==null?void 0:e.campaignId]){s(1,"ContentCard already in cache");return}i(this,T,xt).call(this,e),d(this,Ae).call(this),i(this,T,He).call(this,e.campaignId)}isContentCardAction(e){return e==="content_card"}};Y=new WeakMap,T=new WeakSet,Ot=function(){return a(this,null,function*(){})},He=function(e){let t=i(this,T,Lt).call(this);if(document.getElementById(`contentCard_container_${e}`)){s(1,"ContentCard already displayed"),d(this,se).call(this,e);return}if(t!=null&&t[e])switch(t[e].campaignEntryTime){case"DELAY":{i(this,T,Ct).call(this,t[e]);break}case"IMMEDIATELY":{i(this,T,_e).call(this,t[e]);break}case"SCROLL":{i(this,T,Ut).call(this,t[e]);break}default:return}},Lt=function(){let e=localStorage.getItem("action");return e?JSON.parse(e):null},Ct=function(e){E.showDelayedAction({clearActionMethod:d(this,se).bind(this),data:e,displayMethod:i(this,T,_e).bind(this),idKey:"campaignId",timeValueKey:"campaignEntryTimeValue"})},se=new WeakMap,_e=function(e){var t;if(document.getElementById(`contentCard_container_${e.campaignId}`))s(1,"ContentCard already displayed");else{let r=i(this,T,Dt).call(this,"div",e),n=document.querySelector(`#${e.message.divId}`);n&&(n.innerHTML=r.outerHTML,u.recordEvent({campaignCustomerInstanceId:e.campaignCustomerInstanceId,campaignId:e.campaignId,eventName:Ke,eventProperties:[{eventProperty:"Content Card View",value:JSON.stringify({campaignId:e.campaignId})}],name:"view"}),(t=document.getElementById(`contentCard_container_${e.campaignId}`))==null||t.addEventListener("click",()=>{u.recordEvent({campaignCustomerInstanceId:e.campaignCustomerInstanceId,campaignId:e.campaignId,eventName:Ke,eventProperties:[{eventProperty:"Content Card Click",value:JSON.stringify({campaignId:e.campaignId})}],name:"click"})}))}d(this,se).call(this,e.campaignId)},Dt=function(e,t){var c;let{campaignId:r,message:{design:n}}=t,o=document.createElement(e);return o.id=`contentCard_container_${r}`,o.innerHTML=n,(c=o.querySelector(".u-close-button"))==null||c.remove(),o},Ut=function(e){E.showAfterScrollAction({data:e,displayMethod:i(this,T,_e).bind(this),timeValueKey:"campaignEntryTimeValue"})},xt=function(e){E.storeActionInLocalStorage(e,"action","campaignId")},Ae=new WeakMap,m(K,Y);var Je=K,ae=Je.getInstance();var ce,B,le,q,Ee,ve,S,ze,Wt,Ge,Re,kt,Ce,Oe,Ye,Ft,Le,Ie,Bt,f=class f{constructor(){m(this,S);this.permission=null;this.pushMessageToSW=e=>{s(1,"Pushing message to service worker"),navigator.serviceWorker.getRegistrations().then(t=>{var r,n;s(1,"Service Worker registration"),(r=t[0])!=null&&r.active&&(s(1,"Service Worker ready"),(n=t[0].active)==null||n.postMessage(JSON.stringify(e)))}).catch(t=>{s(2,`Failed to push message to service worker: ${t.message}`)})};this.loadWebPushActionInLocalStorage=()=>{E.loadActionInLocalStorage({actionCondition:()=>!0,actionMethod:e=>i(this,S,Oe).call(this,Number(e.web_optin_instance_id)),localStorageKey:"web_push_action"})};m(this,Ce,()=>{E.storeActionInLocalStorageInternal("web_push_action")});m(this,Ie,e=>{E.clearActionInLocalStorage({id:e,localStorageKey:"web_push_action"})})}static getInstance(){return d(f,ce)||I(f,ce,new f),d(f,ce)}init(e,t){return a(this,null,function*(){var r;if(s(1,"Initializing Notification Service"),u.recordDebugEvents({eventName:"init",eventProperties:[{eventProperty:"service_worker",value:"serviceWorker"in navigator},{eventProperty:"push_manager",value:"PushManager"in window}]}),"serviceWorker"in navigator&&"PushManager"in window){s(1,"Service Worker and Push Manager are supported");try{u.recordDebugEvents({eventName:"init_condition"}),I(f,B,yield navigator.serviceWorker.register(t||"/mergn-sw.js")),s(1,"Service Worker registered"),s(1,"Pushing message to service worker for initialization"),this.pushMessageToSW({customer:localStorage.getItem("customer")||"",events:u.getStoredEvents(),API_KEY:N.getAPIKey(),device_id:localStorage.getItem("uniqueIdentity")||"",operatingSystem:E.getOperatingSystem(),osVersion:E.getOSVersion(),Platform:E.getPlatform()}),I(f,Ee,!0);let n=i(this,S,Ye).call(this),o=Object.keys(n||{});if(o.length&&i(this,S,Oe).call(this,Number(o[0])),!e)return;let c=yield(r=d(f,B))==null?void 0:r.pushManager.getSubscription();s(1,"Checking for existing subscription"),d(f,B)&&(s(1,"Service Worker registration is available"),d(f,B).update()),c?(s(1,"Existing subscription found"),u.recordDebugEvents({eventName:"existing_subscription"}),yield i(this,S,Re).call(this),I(f,le,!0)):(s(1,"No existing subscription found"),yield i(this,S,ze).call(this,d(f,ve)||void 0))}catch(n){let o=n&&n.message?n.message.substring(0,100):"undefined";yield u.recordDebugEvents({eventName:"Reachability Push Web",eventProperties:[{eventProperty:"message",value:`${o}`}]}),s(2,"Service Worker registration failed:"),s(2,o)}}})}showNotification(e){if(!d(f,Ee)){I(f,ve,e),u.recordDebugEvents({eventName:"notification_service_not_initialized"}),s(2,"Notification service is not initialized");return}A("showNotification",()=>a(this,null,function*(){let t=JSON.parse(localStorage.getItem("web_push_action")||"{}");if(t&&t[e.web_optin_instance_id]){s(1,"Notification already in cache");return}i(this,S,kt).call(this,e),d(this,Ce).call(this),i(this,S,Oe).call(this,e.web_optin_instance_id)}))}};ce=new WeakMap,B=new WeakMap,le=new WeakMap,q=new WeakMap,Ee=new WeakMap,ve=new WeakMap,S=new WeakSet,ze=function(e){return a(this,null,function*(){s(1,`Checking notification permission: ${JSON.stringify(e)} `),u.recordDebugEvents({eventName:"check_permission"});let t;try{t=Notification.permission,t&&(s(1,`Notification permission: ${t}`),t==="default"?(e||(this.permission="default",u.recordDebugEvents({eventName:"Turned Off Notification Reset Permission"})),e&&(u.recordDebugEvents({eventName:"notification_data",eventProperties:[{eventProperty:"type",value:`${e==null?void 0:e.type}`}]}),d(this,Ie).call(this,e.web_optin_instance_id),e.type==="two_step"?i(this,S,Wt).call(this,e):yield i(this,S,Ge).call(this,e))):t==="denied"?(u.recordDebugEvents({eventName:"Turned Off Notification"}),s(1,"The user has blocked notifications.")):(u.recordDebugEvents({eventName:"already_registered"}),s(1,"The user has already enabled notifications."),d(f,le)||(yield i(this,S,Re).call(this),yield u.recordEvent({eventName:"Already Registered To Web Push"}),e||I(f,le,!0))))}catch(r){s(2,"Failed to check notification permission"),u.recordDebugEvents({eventName:"notification_permission_error"})}})},Wt=function(e){try{let t=document.createElement("div"),r;e.banner_design.banner_image&&(r=document.createElement("img"),r.src=e.banner_design.banner_image,r.alt="Image",r.id="centered-image");let n=document.createElement("div"),o=document.createElement("div"),c=document.createElement("div"),h=document.createElement("img"),v=document.createElement("div"),b=document.createElement("div"),y=document.createElement("div"),D=document.createElement("div"),k=document.createElement("div"),F=document.createElement("div"),O=document.createElement("button"),_=document.createElement("button");t.className="mergn-overlay",n.className="mergnWebPushPopup",o.className=D.className=k.className="mergn-row",c.className="mergn-column-25",v.className="mergn-column-75",F.className="button-container",b.id="title",y.id="subtitle",O.id="button-1",_.id="button-2",h.src=e.banner_design.banner_icon,h.alt="Image",h.id="logo",b.textContent=e.banner_design.banner_title,y.textContent=e.banner_design.banner_text,O.textContent=e.banner_design.button_1.text,_.textContent=e.banner_design.button_2.text,c.appendChild(h),v.appendChild(b),v.appendChild(y),o.appendChild(c),o.appendChild(v),r&&(D.appendChild(r),r.style.cssText=`
4
- max-width: 100%;
5
- height: auto;
6
- display: block;
7
- margin-left: auto;
8
- margin-right: auto;
9
- border-radius: 10px;
10
- max-width: 350px;
11
- aspect-ratio: 2 / 1;
12
- `),F.appendChild(O),F.appendChild(_),k.appendChild(F),n.appendChild(o),n.appendChild(D),n.appendChild(k),t.appendChild(n),t.style.cssText=`
13
- position: fixed;
14
- top: 0;
15
- left: 0;
16
- width: 100%;
17
- height: 100%;
18
- background-color: rgba(0, 0, 0, 0.5);
19
- z-index: 99999999999;
20
- display: flex;
21
- justify-content: center;
22
- align-items: start;
23
- `,n.style.cssText=`
24
- background-color: ${e.banner_design.banner_color};
25
- padding: 15px;
26
- border-radius: 5px;
27
- max-width: 380px;
28
- max-height: 463px;
29
- `,o.style.cssText=D.style.cssText=k.style.cssText=`
30
- display: flex;
31
- flex-wrap: wrap;
32
- margin-bottom: 10px;
33
- `,c.style.cssText=`
34
- width: 25%;
35
- `,v.style.cssText=`
36
- width: 73%;
37
- margin-left: 2%;
38
- `,h.style.cssText=`
39
- max-width: 100%;
40
- height: auto;
41
- `,O.style.cssText=`
42
- padding: 12px 20px;
43
- border: none;
44
- background-color: ${e.banner_design.button_1.backgroundColor};
45
- color: ${e.banner_design.button_1.color};
46
- cursor: pointer;
47
- border-radius: 5px;
48
- width: 48%;
49
- `,_.style.cssText=`
50
- padding: 12px 20px;
51
- border: none;
52
- background-color: ${e.banner_design.button_2.backgroundColor};
53
- color: ${e.banner_design.button_2.color};
54
- cursor: pointer;
55
- border-radius: 5px;
56
- width: 48%;
57
- `,F.style.cssText=`
58
- display: flex;
59
- justify-content: space-between;
60
- align-items: center;
61
- flex-wrap: nowrap;
62
- width: 100%;
63
- `,b.style.cssText=`
64
- margin-bottom: 5px;
65
- font-size: 16px;
66
- color: ${e.banner_design.text_color}
67
- `,y.style.cssText=`
68
- margin-bottom: 5px;
69
- font-size: 13px;
70
- color: ${e.banner_design.text_color}
71
- `,document.body.appendChild(t),document.body.style.overflow="hidden",u.recordEvent({eventName:"Viewed Web Push Soft-ask",name:"viewed",web_optin_instance_id:e.web_optin_instance_id}),O==null||O.addEventListener("click",()=>a(this,null,function*(){t.remove(),I(f,q,!1),document.body.style.overflow="auto",yield u.recordEvent({eventName:"Denied Web Push Soft-ask",web_optin_instance_id:e.web_optin_instance_id}),s(1,"User denied the notification permission.")})),_==null||_.addEventListener("click",()=>a(this,null,function*(){t.remove(),document.body.style.overflow="auto",u.recordEvent({eventName:"Accepted Web Push Soft-ask",web_optin_instance_id:e.web_optin_instance_id}),yield i(this,S,Ge).call(this,e)}))}catch(t){}},Ge=function(e){return a(this,null,function*(){try{u.recordEvent({eventName:"Displayed Web Push Subscription",name:"viewed",web_optin_instance_id:e.web_optin_instance_id});let t=yield Notification.requestPermission();t==="granted"?(s(1,"User granted the notification permission."),yield i(this,S,Re).call(this),yield u.recordEvent({eventName:"Allowed Web Push Subscription",name:"subscribed",web_optin_instance_id:e.web_optin_instance_id})):t==="denied"?(yield u.recordEvent({eventName:"Blocked Web Push Subscription"}),s(1,"User denied the notification permission.")):t==="default"&&(yield u.recordEvent({eventName:"Closed Web Push Subscription"}),s(1,"User closed the notification permission dialog."))}catch(t){s(2,"Failed to request notification permission")}I(f,q,!1)})},Re=function(){return a(this,null,function*(){var t,r;let e=yield N.get(`${yt}`);if(e.success){let n=yield(t=d(f,B))==null?void 0:t.pushManager.getSubscription();n&&(yield n.unsubscribe());let o=yield(r=d(f,B))==null?void 0:r.pushManager.subscribe({applicationServerKey:e.data||"",userVisibleOnly:!0});yield N.put(`${ht}`,{device_id:localStorage.getItem("uniqueIdentity")||"",is_web_push_subscribed:!0,web_push_subscription_page_url:window.location.pathname,web_push_token:{token:JSON.parse(JSON.stringify(o))}}),s(1,"User is subscribed")}else throw new Error("Failed to subscribe the user")})},kt=function(e){E.storeActionInLocalStorage(e,"web_push_action","web_optin_instance_id")},Ce=new WeakMap,Oe=function(e){if(d(f,q))return;I(f,q,!0);let t=i(this,S,Ye).call(this);if(t!=null&&t[e])switch(t[e].entry_time){case"DELAY":{i(this,S,Ft).call(this,t[e]);break}case"IMMEDIATELY":{i(this,S,Le).call(this,t[e]);break}case"SCROLL":{i(this,S,Bt).call(this,t[e]);break}default:return}},Ye=function(){let e=localStorage.getItem("web_push_action");return e?JSON.parse(e):null},Ft=function(e){E.showDelayedAction({clearActionMethod:d(this,Ie).bind(this),data:e,displayMethod:i(this,S,Le).bind(this),idKey:"web_optin_instance_id",timeValueKey:"entry_time_value"})},Le=function(e){i(this,S,ze).call(this,e)},Ie=new WeakMap,Bt=function(e){E.showAfterScrollAction({data:e,displayMethod:i(this,S,Le).bind(this),timeValueKey:"entry_time_value"})},m(f,ce),m(f,B,null),m(f,le,!1),m(f,q,!1),m(f,Ee,!1),m(f,ve,null);var je=f,W=je.getInstance();var Q,P,Mt,Qe,$t,Vt,de,De,Kt,Jt,Ht,Ue,J=class J{constructor(){m(this,P);m(this,de,e=>{E.clearActionInLocalStorage({id:e,localStorageKey:"action"})});this.loadPopupEventActionInLocalStorage=()=>{E.loadActionInLocalStorage({actionCondition:e=>e.message.name==="Popup",actionMethod:e=>i(this,P,Qe).call(this,e.campaignId),localStorageKey:"action"})};m(this,Ue,()=>{E.storeActionInLocalStorageInternal("action")})}static getInstance(){var e;return d(J,Q)||(I(J,Q,new J),i(e=d(J,Q),P,Mt).call(e)),d(J,Q)}showPopup(e){let t=JSON.parse(localStorage.getItem("action")||"{}");if(t&&t[e==null?void 0:e.campaignId]){s(1,"Popup already in cache");return}i(this,P,Ht).call(this,e),d(this,Ue).call(this),i(this,P,Qe).call(this,e.campaignId)}isPopupAction(e){return e==="Popup"}};Q=new WeakMap,P=new WeakSet,Mt=function(){return a(this,null,function*(){})},Qe=function(e){let t=i(this,P,$t).call(this);if(document.getElementById(`popup_container_${e}`)){s(1,"Popup already displayed"),d(this,de).call(this,e);return}if(t!=null&&t[e])switch(t[e].campaignEntryTime){case"DELAY":{i(this,P,Vt).call(this,t[e]);break}case"IMMEDIATELY":{i(this,P,De).call(this,t[e]);break}case"SCROLL":{i(this,P,Jt).call(this,t[e]);break}default:return}},$t=function(){let e=localStorage.getItem("action");return e?JSON.parse(e):null},Vt=function(e){E.showDelayedAction({clearActionMethod:d(this,de).bind(this),data:e,displayMethod:i(this,P,De).bind(this),idKey:"campaignId",timeValueKey:"campaignEntryTimeValue"})},de=new WeakMap,De=function(e){if(document.getElementById(`popup_container_${e.campaignId}`))s(1,"Popup already displayed");else{let t=i(this,P,Kt).call(this,"div",e);document.body.appendChild(t),u.recordEvent({campaignCustomerInstanceId:e.campaignCustomerInstanceId,campaignId:e.campaignId,eventName:te,eventProperties:[{eventProperty:"Popup View",value:JSON.stringify({campaignId:e.campaignId})}],name:"view"})}d(this,de).call(this,e.campaignId)},Kt=function(e,t){let{campaignCustomerInstanceId:r,campaignId:n,message:{design:o}}=t,c=document.createElement(e);c.id=`popup_container_${n}`,c.innerHTML=o,c.style.position="fixed",c.style.top="0",c.style.left="0",c.style.width="100%",c.style.height="100%",c.style.zIndex="99999999";let h=c.querySelector(".u-popup-container");h&&(h.style.zIndex="50");let v=h.querySelector(".u-popup-overlay");v&&(s(1,"Popup overlay element found"),v.style.setProperty("display","block","important")),c.querySelectorAll('[id^="u_content_form_"]').forEach(y=>{let D=y.querySelector("form");D&&D.addEventListener("submit",()=>a(this,null,function*(){c.remove();let k=new FormData(D),F={};for(let[O,_]of k.entries())F[O]=_;yield u.recordEvent({campaignCustomerInstanceId:r,campaignId:n,eventName:te,eventProperties:[{eventProperty:"Form Submit",value:JSON.stringify({campaignId:n,formId:y.id,formValues:F})},{eventProperty:"Campaign Id",value:n.toString()}],name:"form"})}))});let b=c.querySelector(".u-close-button");return(b==null?void 0:b.getAttribute("href"))==="#"&&b.removeAttribute("href"),b==null||b.addEventListener("click",()=>a(this,null,function*(){c.remove(),yield u.recordEvent({campaignCustomerInstanceId:r,campaignId:n,eventName:te,eventProperties:[{eventProperty:"Close Click",value:JSON.stringify({campaignId:n})}],name:"close"})})),c.querySelectorAll('[id^="u_content_button_"]').forEach(y=>{y.addEventListener("click",()=>a(this,null,function*(){c.remove(),yield u.recordEvent({campaignCustomerInstanceId:r,campaignId:n,eventName:te,eventProperties:[{eventProperty:"Button Click",value:JSON.stringify({buttonId:y.id,campaignId:n})}],name:"click"})}))}),c.querySelectorAll(".u-popup-container img").forEach(y=>{y.addEventListener("click",()=>a(this,null,function*(){c.remove(),yield u.recordEvent({campaignCustomerInstanceId:r,campaignId:n,eventName:te,eventProperties:[{eventProperty:"Image Click",value:JSON.stringify({campaignId:n,imageClassName:y.className,imageId:y.id})}],name:"click"})}))}),c},Jt=function(e){E.showAfterScrollAction({data:e,displayMethod:i(this,P,De).bind(this),timeValueKey:"campaignEntryTimeValue"})},Ht=function(e){E.storeActionInLocalStorage(e,"action","campaignId")},Ue=new WeakMap,m(J,Q);var qe=J,H=qe.getInstance();var ue,fe,he,be,ye,we,Te,xe,p,zt,Gt,Yt,Se,Xe,et,tt,nt,qt,Qt,Zt,Xt,en,tn,nn,rt,it,rn,on,Z=class Z{constructor(){m(this,p);m(this,fe);m(this,he);m(this,be);m(this,ye,null);m(this,we,null);m(this,Te,!1);m(this,xe,()=>{setInterval(()=>{let e=localStorage.getItem("mergn_shopify");if(e!==d(this,we)){I(this,we,e);let t=JSON.parse(e||"{}");if(t!=null&&t.pushMessageToSW){let r=t.pushMessageToSW;delete t.pushMessageToSW,localStorage.setItem("mergn_shopify",JSON.stringify(t)),W.pushMessageToSW(r)}if(t!=null&&t.optIn){let r=t.optIn;delete t.optIn,localStorage.setItem("mergn_shopify",JSON.stringify(t)),W.showNotification(r)}if(t!=null&&t.campaigns){let r=t.campaigns;delete t.campaigns,localStorage.setItem("mergn_shopify",JSON.stringify(t)),r.forEach(n=>{H.isPopupAction(n.message.name)?H.showPopup(n):ae.isContentCardAction(n.message.name)&&ae.showContentCard(n)})}}},1e3)});this.storeActionInLocalStorageInternal=e=>{let t=()=>{let r=JSON.parse(localStorage.getItem(e)||"{}");Object.keys(r).forEach(n=>{r[n].initialTime=new Date().getTime()}),localStorage.setItem(e,JSON.stringify(r))};t(),window.addEventListener("beforeunload",t)};this.clearActionInLocalStorage=({id:e,localStorageKey:t})=>{let r=JSON.parse(localStorage.getItem(t)||"{}");r[e]&&delete r[e],localStorage.setItem(t,JSON.stringify(r))};this.loadActionInLocalStorage=({actionCondition:e,actionMethod:t,localStorageKey:r})=>{let n=JSON.parse(localStorage.getItem(r)||"{}");Object.keys(n).forEach(o=>{e(n[o])&&t(n[o])})}}static getInstance(){return d(Z,ue)||I(Z,ue,new Z),d(Z,ue)}init(e,t){return a(this,null,function*(){s(1,"Initializing base service"),t!=null&&t.shopify&&I(this,Te,!0),i(this,p,zt).call(this,e);let r=this.getPlatform();if(r==="Crawlers"||r==="Unknown"){s(2,"Not initializing base service for crawlers or unknown platforms");return}if(yield N.syncRealWorldTime(),s(1,"Verifying API Key"),yield i(this,p,rt).call(this),t!=null&&t.shopify&&d(this,xe).call(this),t!=null&&t.identity)try{g.loading=!0,yield this.setIdentity(t.identity)}finally{g.loading=!1}setInterval(()=>a(this,null,function*(){s(1,"Verifying API Key after timeout"),yield i(this,p,rt).call(this)}),3e5);let n=i(this,p,Se).call(this);if(yield this.checkTTL(),yield u.recordEventsFromQueue(),u.recordDebugEvents({eventName:"base_init"}),s(1,"Initializing notification service from Base Service"),yield A("notification service",()=>a(this,null,function*(){yield W.init(n,t==null?void 0:t.swPath)})),!(t!=null&&t.shopify)){yield i(this,p,on).call(this);let o=history.pushState;history.pushState=(...c)=>{o.apply(history,c),i(this,p,rn).call(this)}}s(1,"tracking page change register")})}setPlatform(e){I(this,fe,e)}setOSVersion(e){I(this,he,e)}setOperatingSystem(e){I(this,be,e)}setPreviousUrl(e){I(this,ye,e)}getPreviousUrl(){return d(this,ye)}getPlatform(){return d(this,fe)}getOSVersion(){return d(this,he)}getOperatingSystem(){return d(this,be)}updateSessionCreated(){localStorage.setItem("ttl",`${new Date().getTime()}`)}showAfterScrollAction({data:e,displayMethod:t,timeValueKey:r}){let n=()=>{var b;let o=window.innerHeight,c=document.documentElement.scrollHeight;window.scrollY/(c-o)*100>(((b=e[r])==null?void 0:b.value)||0)&&(window.removeEventListener("scroll",n),t(e))};window.addEventListener("scroll",n)}showDelayedAction({clearActionMethod:e,data:t,displayMethod:r,idKey:n,timeValueKey:o}){var v,b,y;let c=(v=t[o])==null?void 0:v.value;((b=t[o])==null?void 0:b.duration)==="min"&&(c=c*60);let h=t.initialTime-500+(c||0)*1e3-new Date().getTime();s(1,`Initial time: ${t.initialTime}`),s(1,`Time value: ${(y=t[o])==null?void 0:y.value}`),s(1,`Current time: ${new Date().getTime()}`),s(1,`Time difference: ${h}`),h>0?setTimeout(()=>{e(t[n]),r(t)},h):(e(t[n]),r(t))}storeActionInLocalStorage(e,t,r){var c;let n=JSON.parse(localStorage.getItem(t)||"{}"),o=(c=r in e&&e[r])!=null?c:"";o&&(n[o]=Ne(z({},e),{initialTime:new Date().getTime()}),localStorage.setItem(t,JSON.stringify(n)))}checkTTL(){return a(this,null,function*(){yield A("# check TTL",()=>a(this,null,function*(){if(d(this,Te))return;s(1,"Checking TTL"),C("Checking TTL",!0),L("Checking TTL Time",!0);let e=localStorage.getItem("ttl"),t=!1;if(e){if(t=i(this,p,Se).call(this,e),t){let r=localStorage.getItem("session"),n=localStorage.getItem("ttl");r&&n&&u.recordEvent({eventName:"Web Session Concluded",eventProperties:[{eventProperty:"SESSION_ID",value:localStorage.getItem("session")},{eventProperty:"SESSION_CREATED",value:new Date(parseInt(n,10)).toISOString()}]}),this.clearLocalStorage(),localStorage.setItem("ttl",`${new Date().getTime()}`)}}else localStorage.setItem("ttl",`${new Date().getTime()}`);(!e||t||i(this,p,Qt).call(this))&&(i(this,p,nt).call(this)&&i(this,p,Zt).call(this),i(this,p,tt).call(this)&&(yield this.setIdentity()),(i(this,p,Se).call(this)||i(this,p,Xe).call(this))&&(yield i(this,p,tn).call(this)),yield i(this,p,Xt).call(this),(i(this,p,Se).call(this)||i(this,p,et).call(this))&&(yield i(this,p,nn).call(this))),L("Checking TTL Time",!1),C("Checking TTL",!1)}))})}clearLocalStorage(){localStorage.removeItem("action"),localStorage.removeItem("events"),localStorage.removeItem("attributes"),localStorage.removeItem("offlineEvents"),localStorage.removeItem("ttl"),localStorage.removeItem("session")}setIdentity(e){return a(this,null,function*(){let t={deviceId:localStorage.getItem("uniqueIdentity")||crypto.randomUUID(),os:this.getPlatform()};if(e)t.identity=e;else if(!e&&localStorage.getItem("customer"))return;try{let r=yield i(this,p,en).call(this,t);if(r!==void 0){localStorage.setItem("customer",r);try{W.pushMessageToSW({customer:r})}catch(n){}}}catch(r){throw new Error("Error setting identity")}})}};ue=new WeakMap,fe=new WeakMap,he=new WeakMap,be=new WeakMap,ye=new WeakMap,we=new WeakMap,Te=new WeakMap,xe=new WeakMap,p=new WeakSet,zt=function(e){N.updateAPIKey(e),this.setPlatform(i(this,p,Gt).call(this)),this.setOSVersion(i(this,p,Yt).call(this)),this.setOperatingSystem(navigator.userAgent)},Gt=function(){var t;let e=navigator.userAgent.toLowerCase();return/googlebot|bingbot|yandexbot|duckduckbot|slurp|twitterbot|linkedinbot|facebot|pinterest|vkshare|applebot|baiduspider|adsbot-google|msnbot|yahoobot|sogou|facebookexternalhit/i.test(e)?"Crawlers":/wv|wkwebview|instagram|facebook|fbav|fban|twitter|snapchat|pinterest|linkedin|tiktok/i.test(e)?"Mobile":/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(e)?("Notification"in window&&typeof((t=window==null?void 0:window.Notification)==null?void 0:t.permission)!="undefined","Mobile"):/windows|macintosh|linux|x11/i.test(e)?"Web":"Unknown"},Yt=function(){let e=navigator.userAgent,t;return e.indexOf("Chrome")>-1?t="Google Chrome":e.indexOf("Safari")>-1?t="Safari":e.indexOf("Firefox")>-1?t="Mozilla Firefox":e.indexOf("Edg")>-1?t="Microsoft Edge":e.indexOf("MSIE")>-1?t="Internet Explorer":t="Unknown",t},Se=function(e){let t;return e||(t=localStorage.getItem("ttl")),e||t?new Date().getTime()-parseInt(e||t||"",10)>12e5:!0},Xe=function(){return!localStorage.getItem("events")},et=function(){return!localStorage.getItem("attributes")},tt=function(){return!localStorage.getItem("customer")},nt=function(){return!localStorage.getItem("uniqueIdentity")},qt=function(){return!localStorage.getItem("session")},Qt=function(){return i(this,p,Xe).call(this)||i(this,p,et).call(this)||i(this,p,tt).call(this)||i(this,p,nt).call(this)||i(this,p,qt).call(this)},Zt=function(){let e=localStorage.getItem("uniqueIdentity");return e||(e=crypto.randomUUID(),localStorage.setItem("uniqueIdentity",e)),e},Xt=function(){return a(this,null,function*(){yield A("store session",()=>a(this,null,function*(){let e=localStorage.getItem("session");e||(e=crypto.randomUUID(),localStorage.setItem("session",e),yield u.recordEvent({eventName:"Web Session Started",eventProperties:[{eventProperty:"SESSION_ID",value:localStorage.getItem("session")},{eventProperty:"SESSION_CREATED",value:new Date(parseInt(localStorage.getItem("ttl")||"",10)).toISOString()}]}))}),e=>{u.recordEvent({eventName:"Debug Event",eventProperties:[{eventProperty:"message",value:`store session - ${e.message}`}]},!0)})})},en=function(e){return a(this,null,function*(){try{return(yield N.post(`${ft}${bt}`,e)).data}catch(t){throw new Error("Error posting identity data")}})},tn=function(){return a(this,null,function*(){yield u.storeEventsAndPropertiesInLocalStorage()})},nn=function(){return a(this,null,function*(){yield me.storeAttributeInLocalStorage()})},rt=function(){return a(this,null,function*(){yield A("verify API key",()=>a(this,null,function*(){var e;try{let t=parseInt(localStorage.getItem("verifyTTL")||"0",10)||0;if(!t||t&&new Date().getTime()>t){let r=yield N.get("/brand");if(!(r!=null&&r.success))throw new Error(JSON.stringify(r));localStorage.setItem("verifyTTL",(new Date().getTime()+3e5).toString())}g.isInitialized=!0}catch(t){throw N.getBrandId()==="67"&&!((e=t==null?void 0:t.message)!=null&&e.startsWith("get"))&&u.recordEvent({eventName:"Debug Event",eventProperties:[{eventProperty:"message",value:`verifyAPIKey - ${t.message}`}]},!0),g.disableSDK=!0,new Error("Error verifying API key")}}))})},it=function(){return a(this,null,function*(){var r;s(1,"Performing viewed web page event");let e=(r=window==null?void 0:window.location)==null?void 0:r.href;this.setPreviousUrl(e),u.recordDebugEvents({eventName:"pre_vwp"});let t=[];new URLSearchParams(new URL(window.location.href).search).forEach((n,o)=>a(this,null,function*(){Pt.has(o)&&t.push({eventProperty:o,value:n})})),yield u.recordEvent({eventName:"Viewed Webpage",eventProperties:[{eventProperty:"URL",value:window.location.pathname},...t]})})},rn=function(){return a(this,null,function*(){var t;s(1,"Tracking page change");let e=(t=window==null?void 0:window.location)==null?void 0:t.href;(this.getPreviousUrl()===null||this.getPreviousUrl()===void 0||e!==this.getPreviousUrl())&&(yield i(this,p,it).call(this))})},on=function(){return a(this,null,function*(){var t,r;let e=(t=window==null?void 0:window.location)==null?void 0:t.href;u.recordDebugEvents({eventName:"show_notification_error",eventProperties:[{eventProperty:"message",value:`${e!==this.getPreviousUrl()}:${e}:${this.getPreviousUrl()}`}]});try{yield i(this,p,it).call(this)}catch(n){let o=n&&n.message?(r=n==null?void 0:n.message)==null?void 0:r.substring(0,100):"undefined";yield u.recordDebugEvents({eventName:"vwp_error",eventProperties:[{eventProperty:"message",value:`${o}`}]})}})},m(Z,ue);var Ze=Z,E=Ze.getInstance();var X,R,sn,We,an,cn,ln,dn,j=class j{constructor(){m(this,R);this.queue=Promise.resolve()}static getInstance(){var e;return d(j,X)||(I(j,X,new j),i(e=d(j,X),R,sn).call(e)),d(j,X)}pushToQueue(e){let t=JSON.parse(localStorage.getItem("preInitializedEvents")||"[]");t.push(e),localStorage.setItem("preInitializedEvents",JSON.stringify(t))}recordEventsFromQueue(){return a(this,null,function*(){let e=JSON.parse(localStorage.getItem("preInitializedEvents")||"[]");if(Array.isArray(e))for(let t of e)yield this.recordEventPreInitialized(t)})}recordEvent(e,t){return a(this,null,function*(){g.isInitialized&&!g.loading?yield i(this,R,We).call(this,e,t):this.pushToQueue(e)})}recordEventPreInitialized(e){return a(this,null,function*(){try{yield i(this,R,We).call(this,e)}finally{i(this,R,dn).call(this,e.eventName)}})}recordDebugEvents(e){return a(this,null,function*(){g.debugLevel===4&&(!g.recordDebugEventsToggle||g.recordDebugEventsToggle[e.eventName])&&(yield i(this,R,We).call(this,e))})}getStoredEvents(){let e=localStorage.getItem("events");return e?JSON.parse(e):{}}storeEventsAndPropertiesInLocalStorage(){return a(this,null,function*(){if(!localStorage.getItem("events")){let e=(yield this.fetchEventData()).data;if(e){localStorage.setItem("events",JSON.stringify(e));try{W.pushMessageToSW({events:e})}catch(t){}}}})}fetchEventData(){return a(this,null,function*(){try{return yield N.get(`${Be}`)}catch(e){throw new Error("Error fetching event data")}})}postEventRecord(e,t){return a(this,null,function*(){let r=null,n=null,o=new AbortController;return this.queue=this.queue.then(()=>a(this,null,function*(){try{if(e.events.length===0)throw new Error("No events to record");let c=yield N.post(`/v2${Be}${St}`,e,o.signal);if(c.success)return n=c,c;if(c.message===`Customer with id ${localStorage.getItem("customer")} not exists`)throw localStorage.removeItem("customer"),new Error("Re initializing customer Id")}catch(c){throw s(2,"Error posting event record:"),s(2,`name: ${c.name}`),s(2,`message: ${c.message}`),(c.name==="AbortError"||c.name==="TypeError"&&c.message==="Failed to fetch")&&(s(2,"Request aborted"),t&&i(this,R,ln).call(this,t)),r=new Error("Error posting event record"),c}return null})).catch(()=>{}),this.queue.then(()=>{if(r)throw r;return n})})}};X=new WeakMap,R=new WeakSet,sn=function(){return a(this,null,function*(){})},We=function(e,t){return a(this,null,function*(){yield A("# record event",()=>a(this,null,function*(){var ct,lt,dt,ut;let{campaignCustomerInstanceId:r,campaignId:n,eventName:o,eventProperties:c,name:h,web_optin_instance_id:v}=e;s(1,"# Recording event"),C("Recording event",!0),L("Recording event Time",!0),s(1,"Event Payload"),s(1,{campaignCustomerInstanceId:r,eventName:o,eventProperties:c,name:h,web_optin_instance_id:v});let b=E.getPlatform();if(b==="Crawlers"||b==="Unknown")throw new Error("Invalid platform");o!=="Web Session Concluded"&&(yield E.checkTTL());let y=[];c&&y.push(...c),y.push({eventProperty:"Platform",value:b}),y.push({eventProperty:"operating-system",value:E.getOperatingSystem()}),y.push({eventProperty:"os-version",value:E.getOSVersion()});let D=this.getStoredEvents(),k=i(this,R,an).call(this,D,o,y);if(typeof k=="string"){s(2,k);return}E.updateSessionCreated();let{id:F}=D[o],O=i(this,R,cn).call(this,z(Ne(z(z(z({},r?{campaignCustomerInstanceId:r}:{}),n?{campaignId:n}:{}),v?{web_optin_instance_id:v}:{}),{eventId:F,eventProperties:k,sessionId:localStorage.getItem("session")||""}),h?{name:h}:{}));if(g.offline){let M=JSON.parse(localStorage.getItem("offlineEvents")||"[]");M.length<=50&&(M.push(...O.events),localStorage.setItem("offlineEvents",JSON.stringify(M)));return}let _=yield this.postEventRecord(O,e);(ct=_==null?void 0:_.data)!=null&&ct.optIn?(yield this.recordDebugEvents({eventName:"optin_data"}),W.showNotification(_.data.optIn)):o==="Viewed Webpage"&&(yield this.recordDebugEvents({eventName:"no_optin",eventProperties:[{eventProperty:"message",value:`${"Notification"in window&&typeof((lt=window==null?void 0:window.Notification)==null?void 0:lt.permission)!="undefined"}`}]})),(ut=(dt=_==null?void 0:_.data)==null?void 0:dt.campaigns)==null||ut.forEach(M=>{H.isPopupAction(M.message.name)?H.showPopup(M):ae.isContentCardAction(M.message.name)&&ae.showContentCard(M)}),L("Recording event Time",!1),C("Recording event",!1)}),r=>{this.recordEvent({eventName:"Debug Event",eventProperties:[{eventProperty:"message",value:`record event - ${e} - ${r.message}`}]},!0)},t)})},an=function(e,t,r){if(!Object.prototype.hasOwnProperty.call(e,t))return`Event ${t} is not valid.`;if(!r)return[];let n=e[t];if(!(n!=null&&n.eventProperty))return`Event ${t} does not have a valid eventProperty.`;let o=r.filter(({eventProperty:c})=>!Object.prototype.hasOwnProperty.call(n.eventProperty,c)).map(({eventProperty:c})=>c);return o.length>0?`Event ${t} has invalid eventProperties: ${o.join(", ")}.`:r.map(({eventProperty:c,value:h})=>({eventPropertyId:n.eventProperty[c].id,value:h}))},cn=function(e){return{customerId:localStorage.getItem("customer")||"",deviceId:localStorage.getItem("uniqueIdentity")||"",events:[e]}},ln=function(e){s(1,"Adding to pre-initialized event:"),s(1,e);let t=localStorage.getItem("preInitializedEvents");t&&t!=="undefined"?(t=JSON.parse(t),t.push(e)):t=[e],localStorage.setItem("preInitializedEvents",JSON.stringify(t))},dn=function(e){let t=JSON.parse(localStorage.getItem("preInitializedEvents")||"[]"),r=t.findIndex(n=>n.eventName===e);r>=0&&t.splice(r,1),localStorage.setItem("preInitializedEvents",JSON.stringify(t))},m(j,X);var ot=j,u=ot.getInstance();var g=class extends Error{constructor(e){super(e),this.name="MergnError"}};g.disableSDK=!1,g.offline=!navigator.onLine,g.debugLevel=0,g.isInitialized=!1,g.loading=!1;var bn=(l,e)=>{e instanceof g?s(2,`OriginateFrom: ${l}
72
- MergnError: ${e.message}`):e instanceof Error?s(2,`OriginateFrom: ${l}
73
- Unexpected error: ${e.message}`):s(2,`OriginateFrom: ${l}
74
- Unexpected error: ${String(e)}`)},A=(l,e,t,r=!1)=>a(void 0,null,function*(){try{C(l,!0),L(`${l} Time`,!0);try{if(g.disableSDK)throw new g("Mergn SDK is disabled!");if(l!=="record event"&&g.offline)throw new g("Mergn is offline!");if(l!=="init"&&l!=="verify API key"&&l!=="record event"&&l!=="recordAttribute"&&!g.isInitialized)throw new g("Mergn not initialized!");if(l!=="login"&&g.loading)throw new g("Mergn is loading!");return yield e()}catch(n){return t?t(n):(g.debugLevel===2||g.debugLevel===3)&&bn(l,n),!r&&N.getBrandId()==="67"&&n.message!=="Failed to fetch"&&u.recordEvent({eventName:"Debug Event",eventProperties:[{eventProperty:"message",value:`${l} - ${n.message}`}]},!0),null}finally{L(`${l} Time`,!1),C(l,!1)}}catch(n){return null}});var U=(o=>(o[o.NONE=0]="NONE",o[o.INFO=1]="INFO",o[o.ERROR=2]="ERROR",o[o.ALL=3]="ALL",o[o.DEBUG=4]="DEBUG",o))(U||{}),s=(l,e)=>{g.debugLevel!==0&&(g.debugLevel>=3?l===1?console.info(`INFO: ${new Date().toISOString()}`,e):l===2&&console.error(`ERROR: ${new Date().toISOString()}`,e):g.debugLevel===1&&l===1?console.info(`INFO: ${new Date().toISOString()}`,e):g.debugLevel===2&&l===2&&console.error(`ERROR: ${new Date().toISOString()}`,e))},L=(l,e)=>{g.debugLevel!==0&&(e?console.time(l):console.timeEnd(l))},C=(l,e)=>{g.debugLevel!==0&&(e?console.group(l):console.groupEnd())};var pe,ee=class ee{constructor(){}static getInstance(){return d(ee,pe)||I(ee,pe,new ee),d(ee,pe)}init(e,t){setTimeout(()=>{A("init",()=>a(this,null,function*(){s(1,"Initializing Mergn SDK"),yield E.init(e,t),u.recordDebugEvents({eventName:"mergn_init"}),s(1,"Mergn SDK Initialized");let r=JSON.parse(localStorage.getItem("preInitializedAttributes")||"[]");Array.isArray(r)&&r.forEach((n,o)=>a(this,null,function*(){yield me.recordAttribute(n.attributeName,n.attributeValue),r.splice(o,1),localStorage.setItem("preInitializedAttributes",JSON.stringify(r))})),window.addEventListener("online",()=>a(this,null,function*(){g.offline=!1;let n=JSON.parse(localStorage.getItem("offlineEvents")||"[]");Array.isArray(n)&&(yield u.postEventRecord({customerId:localStorage.getItem("customer")||"",deviceId:localStorage.getItem("uniqueIdentity")||"",events:n}),localStorage.removeItem("offlineEvents")),E.checkTTL(),E.updateSessionCreated()})),window.addEventListener("offline",()=>{g.offline=!0}),window.addEventListener("load",()=>{H.loadPopupEventActionInLocalStorage(),W.loadWebPushActionInLocalStorage()})}))})}setDebugLevel(e,t){if(!(e in U)){console.error(`Debug level must be according to:
75
- NONE: 0, INFO: 1, ERROR: 2, ALL: 3`);return}g.recordDebugEventsToggle=t||{},g.debugLevel=e;try{W.pushMessageToSW({debugLevel:e})}catch(r){}}recordAttribute(e,t){return a(this,null,function*(){return new Promise((r,n)=>{setTimeout(()=>a(this,null,function*(){try{yield A("recordAttribute",()=>a(this,null,function*(){let o;Array.isArray(t)?o=JSON.stringify(t):typeof t=="number"?o=`${t}`:o=t,s(1,"Recording attribute"),s(1,`Attribute Name: ${e}, Attribute Value: ${o}`);let c=JSON.parse(localStorage.getItem("preInitializedAttributes")||"[]");c.push({attributeName:e,attrValueStringified:o}),localStorage.setItem("preInitializedAttributes",JSON.stringify(c)),g.isInitialized&&(yield me.recordAttribute(e,o))})),r()}catch(o){n(o)}}))})})}login(e){return a(this,null,function*(){return new Promise((t,r)=>{setTimeout(()=>a(this,null,function*(){try{yield A("login",()=>a(this,null,function*(){s(1,"Logging in"),s(1,`Identity: ${e}`),g.loading=!0,yield E.setIdentity(e)})),t()}catch(n){r(n)}finally{g.loading=!1,yield u.recordEventsFromQueue()}}))})})}logout(){setTimeout(()=>{A("logout",()=>a(this,null,function*(){s(1,"Logging out"),E.clearLocalStorage()}))})}recordEvent(e,t){return a(this,null,function*(){return new Promise((r,n)=>{setTimeout(()=>a(this,null,function*(){try{yield A("record event",()=>a(this,null,function*(){s(1,"Recording event"),s(1,`Event Payload:
76
- ${{eventName:e,eventProperties:t}}`),yield u.recordEvent({eventName:e,eventProperties:t})})),r()}catch(o){n(o)}}))})})}getVersion(){return vt}};pe=new WeakMap,m(ee,pe);var st=ee,at=st.getInstance();typeof window!="undefined"&&(window.mergn=at);var yn=at;
1
+ 'use strict';const _0xc40304=_0x383b;(function(_0x4e0756,_0x36cc54){const _0x4aadb=_0x383b,_0x14c908=_0x4e0756();while(!![]){try{const _0x7bfef7=parseInt(_0x4aadb(0x253))/0x1*(parseInt(_0x4aadb(0x1d5))/0x2)+-parseInt(_0x4aadb(0x1e4))/0x3+-parseInt(_0x4aadb(0x1df))/0x4+-parseInt(_0x4aadb(0x1c1))/0x5+-parseInt(_0x4aadb(0x2b4))/0x6+parseInt(_0x4aadb(0x254))/0x7+parseInt(_0x4aadb(0x23d))/0x8;if(_0x7bfef7===_0x36cc54)break;else _0x14c908['push'](_0x14c908['shift']());}catch(_0x4dca19){_0x14c908['push'](_0x14c908['shift']());}}}(_0x1d44,0x40946));var Pe=Object[_0xc40304(0x30c)],un=Object[_0xc40304(0x260)],pn=Object[_0xc40304(0x2c6)],gn=Object[_0xc40304(0x29f)],mn=Object[_0xc40304(0x23e)],pt=Object[_0xc40304(0x2f6)],mt=Object[_0xc40304(0x255)][_0xc40304(0x1ea)],En=Object[_0xc40304(0x255)][_0xc40304(0x310)],Et=_0x332bf7=>{throw TypeError(_0x332bf7);},gt=(_0x25ea0c,_0x9d87b5,_0x57a607)=>_0x9d87b5 in _0x25ea0c?Pe(_0x25ea0c,_0x9d87b5,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x57a607}):_0x25ea0c[_0x9d87b5]=_0x57a607,z=(_0x213e3c,_0x4a3bf0)=>{const _0x3a1709=_0xc40304;for(var _0x1fe9ed in _0x4a3bf0||(_0x4a3bf0={}))mt[_0x3a1709(0x252)](_0x4a3bf0,_0x1fe9ed)&&gt(_0x213e3c,_0x1fe9ed,_0x4a3bf0[_0x1fe9ed]);if(pt){for(var _0x1fe9ed of pt(_0x4a3bf0))En[_0x3a1709(0x252)](_0x4a3bf0,_0x1fe9ed)&&gt(_0x213e3c,_0x1fe9ed,_0x4a3bf0[_0x1fe9ed]);}return _0x213e3c;},Ne=(_0x1aff03,_0x5ed26c)=>un(_0x1aff03,gn(_0x5ed26c)),vn=(_0x29cf05,_0x5101ec)=>{for(var _0x26c2b9 in _0x5101ec)Pe(_0x29cf05,_0x26c2b9,{'get':_0x5101ec[_0x26c2b9],'enumerable':!0x0});},In=(_0x4c3b9f,_0x4f1db7,_0x5ceef2,_0x2ca5f3)=>{const _0x4be636=_0xc40304;if(_0x4f1db7&&typeof _0x4f1db7==_0x4be636(0x31b)||typeof _0x4f1db7==_0x4be636(0x1db)){for(let _0x205601 of mn(_0x4f1db7))!mt[_0x4be636(0x252)](_0x4c3b9f,_0x205601)&&_0x205601!==_0x5ceef2&&Pe(_0x4c3b9f,_0x205601,{'get':()=>_0x4f1db7[_0x205601],'enumerable':!(_0x2ca5f3=pn(_0x4f1db7,_0x205601))||_0x2ca5f3['enumerable']});}return _0x4c3b9f;},Sn=_0x28699f=>In(Pe({},'__esModule',{'value':!0x0}),_0x28699f),ke=(_0x5c6a48,_0x172e07,_0x293fe8)=>_0x172e07[_0xc40304(0x163)](_0x5c6a48)||Et(_0xc40304(0x1c6)+_0x293fe8),d=(_0x5d6d47,_0x3f577c,_0x2aa178)=>(ke(_0x5d6d47,_0x3f577c,_0xc40304(0x178)),_0x2aa178?_0x2aa178[_0xc40304(0x252)](_0x5d6d47):_0x3f577c[_0xc40304(0x207)](_0x5d6d47)),m=(_0x4a83b1,_0x43c761,_0x1e9e84)=>_0x43c761['has'](_0x4a83b1)?Et(_0xc40304(0x264)):_0x43c761 instanceof WeakSet?_0x43c761['add'](_0x4a83b1):_0x43c761[_0xc40304(0x2b1)](_0x4a83b1,_0x1e9e84),I=(_0x4937e4,_0x6e7cf7,_0x5af5b3,_0x1b0274)=>(ke(_0x4937e4,_0x6e7cf7,_0xc40304(0x304)),_0x1b0274?_0x1b0274[_0xc40304(0x252)](_0x4937e4,_0x5af5b3):_0x6e7cf7['set'](_0x4937e4,_0x5af5b3),_0x5af5b3),i=(_0x141f17,_0xac2738,_0x38c5f6)=>(ke(_0x141f17,_0xac2738,_0xc40304(0x2cb)),_0x38c5f6),a=(_0x5076e5,_0x4e5f78,_0x56ec1e)=>new Promise((_0x3f7cd7,_0x1e5302)=>{const _0x2410f9=_0xc40304;var _0x151b65=_0x1e38dd=>{const _0x66efaf=_0x383b;try{_0x53e200(_0x56ec1e[_0x66efaf(0x235)](_0x1e38dd));}catch(_0x4d53ab){_0x1e5302(_0x4d53ab);}},_0x1dd950=_0xb645da=>{const _0x458ff2=_0x383b;try{_0x53e200(_0x56ec1e[_0x458ff2(0x187)](_0xb645da));}catch(_0x374cae){_0x1e5302(_0x374cae);}},_0x53e200=_0x281c4c=>_0x281c4c[_0x2410f9(0x315)]?_0x3f7cd7(_0x281c4c[_0x2410f9(0x1e7)]):Promise['resolve'](_0x281c4c[_0x2410f9(0x1e7)])[_0x2410f9(0x2d5)](_0x151b65,_0x1dd950);_0x53e200((_0x56ec1e=_0x56ec1e['apply'](_0x5076e5,_0x4e5f78))[_0x2410f9(0x235)]());}),wn={};vn(wn,{'default':()=>yn}),module[_0xc40304(0x26d)]=Sn(wn);function _0x383b(_0x23c904,_0x52be15){const _0x1d4467=_0x1d44();return _0x383b=function(_0x383b94,_0x559ed6){_0x383b94=_0x383b94-0x15f;let _0x4dd54e=_0x1d4467[_0x383b94];return _0x4dd54e;},_0x383b(_0x23c904,_0x52be15);}var vt=_0xc40304(0x1eb),ge='https://u23z4zsda8.execute-api.ap-southeast-1.amazonaws.com/Prod/sdk-management/api',Fe=_0xc40304(0x27e),It=_0xc40304(0x2d7),Be=_0xc40304(0x2ea),St=_0xc40304(0x28b),ft=_0xc40304(0x247),ht=_0xc40304(0x30f),bt=_0xc40304(0x21a),yt=_0xc40304(0x240),wt=_0xc40304(0x31e),Tt=(_0x335c68=>(_0x335c68[_0xc40304(0x230)]='utm_source',_0x335c68[_0xc40304(0x1d6)]=_0xc40304(0x280),_0x335c68[_0xc40304(0x27a)]=_0xc40304(0x289),_0x335c68[_0xc40304(0x245)]=_0xc40304(0x215),_0x335c68['UTM_CONTENT']='utm_content',_0x335c68[_0xc40304(0x1be)]=_0xc40304(0x31c),_0x335c68[_0xc40304(0x181)]='gclid',_0x335c68['FBCLID']=_0xc40304(0x30b),_0x335c68))(Tt||{}),Pt=new Set(Object['values'](Tt)),te=_0xc40304(0x29d),re,$,ne,w=class w{constructor(){m(this,$);}static[_0xc40304(0x2fb)](){return d(w,re)||I(w,re,new w()),d(w,re);}[_0xc40304(0x160)](_0x3df191){const _0x522f4a=_0xc40304;w['apiKey']=_0x3df191;let _0x499940=_0x3df191,_0x52c86c=/m(\d+)rgn/,_0x1c708d=_0x499940[_0x522f4a(0x1d4)](_0x52c86c);_0x1c708d&&(w[_0x522f4a(0x197)]=_0x1c708d[0x1]);}[_0xc40304(0x2f1)](){const _0x2cf1be=_0xc40304;return w[_0x2cf1be(0x29e)];}[_0xc40304(0x2c7)](){const _0x42d7f7=_0xc40304;return w[_0x42d7f7(0x197)];}[_0xc40304(0x207)](_0x5aa43a){return a(this,null,function*(){const _0x3c9072=_0x383b;try{return(yield fetch(ge+_0x5aa43a,{'headers':{'Authorization':i(this,$,ne)[_0x3c9072(0x252)](this,w[_0x3c9072(0x29e)]),'Content-Type':_0x3c9072(0x250)}}))['json']();}catch(_0x533edd){let _0xecb84b=_0x533edd[_0x3c9072(0x16c)];return this['getBrandId']()==='67'&&_0xecb84b!=='Failed\x20to\x20fetch'&&_0xecb84b!==_0x3c9072(0x18d)&&u[_0x3c9072(0x26a)]({'eventName':_0x3c9072(0x19c),'eventProperties':[{'eventProperty':_0x3c9072(0x16c),'value':_0x3c9072(0x24d)+_0x5aa43a+'\x20-\x20'+i(this,$,ne)[_0x3c9072(0x252)](this,w[_0x3c9072(0x29e)])+_0x3c9072(0x297)+_0x533edd[_0x3c9072(0x16c)]}]},!0x0),Promise[_0x3c9072(0x2b6)](_0x533edd);}});}[_0xc40304(0x2b3)](_0xfb907,_0x55f58a,_0x370613){return a(this,null,function*(){const _0x3a32aa=_0x383b;try{return(yield fetch(ge+_0xfb907,{'body':JSON[_0x3a32aa(0x185)](_0x55f58a||{}),'headers':{'Authorization':i(this,$,ne)['call'](this,w[_0x3a32aa(0x29e)]),'Content-Type':_0x3a32aa(0x250)},'method':_0x3a32aa(0x20d),'signal':_0x370613}))['json']();}catch(_0x7d9832){let _0x491906=_0x7d9832[_0x3a32aa(0x16c)];return this['getBrandId']()==='67'&&_0x491906!=='Failed\x20to\x20fetch'&&_0x491906!==_0x3a32aa(0x18d)&&u['recordEvent']({'eventName':'Debug\x20Event','eventProperties':[{'eventProperty':_0x3a32aa(0x16c),'value':_0x3a32aa(0x2a9)+_0xfb907+_0x3a32aa(0x284)+i(this,$,ne)[_0x3a32aa(0x252)](this,w[_0x3a32aa(0x29e)])+'\x20-\x20'+JSON[_0x3a32aa(0x185)](_0x55f58a||{})+'\x20-'+_0x7d9832[_0x3a32aa(0x16c)]}]},!0x0),Promise[_0x3a32aa(0x2b6)](_0x7d9832);}});}[_0xc40304(0x16e)](_0x2e8209,_0x5c6bdf){return a(this,null,function*(){const _0x2e7f64=_0x383b;return(yield fetch(ge+_0x2e8209,{'body':JSON[_0x2e7f64(0x185)](_0x5c6bdf||{}),'headers':{'Authorization':i(this,$,ne)['call'](this,w['apiKey']),'Content-Type':'application/json'},'method':'PUT'}))[_0x2e7f64(0x17a)]();});}[_0xc40304(0x19f)](){return a(this,null,function*(){const _0x2ef3bd=_0x383b;try{let _0x9a210e=(yield(yield fetch(ge+wt))[_0x2ef3bd(0x17a)]())[_0x2ef3bd(0x293)];w[_0x2ef3bd(0x195)]=new Date(_0x9a210e),w[_0x2ef3bd(0x1c5)]=new Date();}catch(_0x19b328){s(0x2,_0x2ef3bd(0x275));}});}[_0xc40304(0x1f3)](){const _0x1176bc=_0xc40304;if(!w[_0x1176bc(0x195)]||!w[_0x1176bc(0x1c5)])return s(0x2,_0x1176bc(0x317)),new Date();let _0x3960c3=new Date()[_0x1176bc(0x1cd)]()-w[_0x1176bc(0x1c5)][_0x1176bc(0x1cd)]();return new Date(w[_0x1176bc(0x195)][_0x1176bc(0x1cd)]()+_0x3960c3);}};function _0x1d44(){const _0x3b4bb7=['Recording\x20attribute\x20Time','length','Popup\x20View','optIn','UTM_TERM','Safari','/customer','scrollY','Image\x20Click','shopify','Current\x20time:\x20','#\x20check\x20TTL','get\x20-\x20','mergn','granted','application/json','/mergn-sw.js','call','2488tHPwNb','3574074imnpyZ','prototype','attributeValue','Popup\x20already\x20in\x20cache','active','getItem','Web\x20Session\x20Concluded','pushToQueue','record\x20event\x20-\x20','events','showNotification','uniqueIdentity','defineProperties','mergn_init','Firefox','isPopupAction','Cannot\x20add\x20the\x20same\x20private\x20member\x20more\x20than\x20once','Adding\x20to\x20pre-initialized\x20event:','logo','push_manager','Failed\x20to\x20fetch','Popup\x20overlay\x20element\x20found','recordEvent','Microsoft\x20Edge','getOSVersion','exports','info','TypeError','attributes','setDebugLevel','Displayed\x20Web\x20Push\x20Subscription','Logging\x20in','href','Failed\x20to\x20sync\x20real-world\x20time','updateSessionCreated','width','Not\x20initializing\x20base\x20service\x20for\x20crawlers\x20or\x20unknown\x20platforms','pushMessageToSW','UTM_CAMPAIGN','offlineEvents',',\x20Attribute\x20Value:\x20','min','/attribute','showContentCard','utm_medium','identity','Mobile','Edg','\x20-\x20','Checking\x20notification\x20permission:\x20','viewed','vwp_error','campaignEntryTimeValue','utm_campaign','undefined','/record-event','text_color','Already\x20Registered\x20To\x20Web\x20Push','preInitializedAttributes','init_condition','campaignCustomerInstanceId','className','fetchEventData','data','onLine','findIndex','mergnWebPushPopup','\x20-\x20\x20','eventProperty','Initial\x20time:\x20','button-2','Recording\x20event','indexOf','Popup\x20Action','apiKey','getOwnPropertyDescriptors','scroll','auto','Internet\x20Explorer',';\x0acolor:\x20',';\x0acursor:\x20pointer;\x0aborder-radius:\x205px;\x0awidth:\x2048%;\x0a','Error\x20setting\x20identity','update','ContentCard\x20already\x20displayed','\x0abackground-color:\x20','post\x20-\x20','PushManager','Service\x20Worker\x20registration','pushState','ERROR:\x20','Event\x20Payload:\x0a\x20','serviceWorker','cssText','set','contentCard_container_','post','684594qgedpF','isInitialized','reject','requestPermission','Mozilla\x20Firefox','campaigns','service_worker','Error\x20verifying\x20API\x20key','campaignId','default','Web','\x20not\x20exists','close','entries','storeActionInLocalStorageInternal','\x0aposition:\x20fixed;\x0atop:\x200;\x0aleft:\x200;\x0awidth:\x20100%;\x0aheight:\x20100%;\x0abackground-color:\x20rgba(0,\x200,\x200,\x200.5);\x0az-index:\x2099999999999;\x0adisplay:\x20flex;\x0ajustify-content:\x20center;\x0aalign-items:\x20start;\x0a','ERROR','verifyTTL','getOwnPropertyDescriptor','getBrandId','Initializing\x20notification\x20service\x20from\x20Base\x20Service','Notification','splice','access\x20private\x20method','campaignEntryTime','getOperatingSystem','postMessage','Tracking\x20page\x20change','queue','No\x20existing\x20subscription\x20found','entry_time','OriginateFrom:\x20','Service\x20Worker\x20ready','then','Mergn\x20is\x20offline!','/set-attribute','loadPopupEventActionInLocalStorage','alt','getSubscription','Request\x20aborted','isArray','parse','title','customer','Recording\x20attribute','Attribute\x20value\x20is\x20required','style','Popup','banner_image','Failed\x20to\x20request\x20notification\x20permission','ContentCard','Initializing\x20Mergn\x20SDK','setOperatingSystem','button_1','/event','session','action','Accepted\x20Web\x20Push\x20Soft-ask','ContentCard\x20already\x20in\x20cache','signal','overflow','getAPIKey','web_optin_instance_id','\x0amax-width:\x20100%;\x0aheight:\x20auto;\x0a','offline','innerHeight','getOwnPropertySymbols','record\x20event','Denied\x20Web\x20Push\x20Soft-ask','Notification\x20service\x20is\x20not\x20initialized','search','getInstance','.u-close-button','storeAttributeInLocalStorage','Failed\x20to\x20push\x20message\x20to\x20service\x20worker:\x20','Google\x20Chrome','text','recordAttribute','mergn-column-75','src','write\x20to\x20private\x20field','should_set_identity','IMMEDIATELY','loadWebPushActionInLocalStorage','div','Attribute\x20','Campaign\x20Id','fbclid','defineProperty','The\x20user\x20has\x20blocked\x20notifications.','SESSION_CREATED','/device/add-device-token','propertyIsEnumerable','No\x20events\x20to\x20record','Re\x20initializing\x20customer\x20Id','recordEventsFromQueue','Attribute\x20Name:\x20','done','Checking\x20TTL','UTC\x20Date\x20or\x20last\x20sync\x20time\x20is\x20not\x20set','hidden','Form\x20Submit','block','object','gad_source','group','/brand/get-time','disableSDK','Popup\x20already\x20displayed','recordEventPreInitialized','entry_time_value','error','storeActionInLocalStorage','Content\x20Card\x20Action','push','/brand','99999999','clearActionInLocalStorage','updateAPIKey','Allowed\x20Web\x20Push\x20Subscription','clearLocalStorage','has','banner_color','mergn-overlay','view','login','getPlatform','INFO:\x20','Service\x20Worker\x20and\x20Push\x20Manager\x20are\x20supported','Identity:\x20','message','Existing\x20subscription\x20found','put','Invalid\x20platform','img','notification_permission_error','groupEnd','setProperty','showDelayedAction','zIndex','pushManager','Pushing\x20message\x20to\x20service\x20worker\x20for\x20initialization','read\x20from\x20private\x20field','showAfterScrollAction','json','button','querySelectorAll','Content\x20Card\x20Click','Attribute\x20Payload:\x0a\x20','showPopup','eventName','GCLID','querySelector','Viewed\x20Webpage','setIdentity','stringify','loading','throw','.u-popup-overlay','time','\x0aUnexpected\x20error:\x20','\x20has\x20invalid\x20attributeProperties:\x20','mergn_shopify','Failed\x20to\x20load','URL','Turned\x20Off\x20Notification\x20Reset\x20Permission','height','timeEnd','createElement','bind','randomUUID','UTCDate','Turned\x20Off\x20Notification','brandId','removeItem','test','Event\x20','preInitializedEvents','Debug\x20Event','DEBUG','\x0amargin-bottom:\x205px;\x0afont-size:\x2013px;\x0acolor:\x20','syncRealWorldTime','100%','toString','SESSION_ID','Error\x20posting\x20identity\x20data','recordDebugEventsToggle','Logging\x20out','setItem','userAgent','Error\x20fetching\x20event\x20data','Performing\x20viewed\x20web\x20page\x20event','[id^=\x22u_content_button_\x22]','mergn-column-25','Image','click','debugLevel','map','substring','/v2','scrollHeight','type','duration','Service\x20Worker\x20registration\x20is\x20available','banner_icon','Service\x20Worker\x20registration\x20failed:','body','getStoredEvents','online','Debug\x20level\x20must\x20be\x20according\x20to:\x0a\x20NONE:\x200,\x20INFO:\x201,\x20ERROR:\x202,\x20ALL:\x203','Recording\x20event\x20Time','\x20Time','GAD_SOURCE','verify\x20API\x20key','Checking\x20for\x20existing\x20subscription','2394490HadeGz','content_card','[id^=\x22u_content_form_\x22]','subscribed','lastSyncTime','Cannot\x20','Error\x20posting\x20attribute\x20record','toLowerCase','postEventRecord','SCROLL','location','User\x20is\x20subscribed','getTime','appendChild','innerHTML','swPath','addEventListener','button_2','Mergn\x20not\x20initialized!','match','206cyEpYp','UTM_MEDIUM','divId','remove','Checking\x20TTL\x20Time','register','function','setPreviousUrl','beforeunload','permission','226308HGZeJu','textContent','color','Unknown','getVersion','968601jVOGmr','Content\x20Card\x20View','name','value','setPlatform','initialTime','hasOwnProperty','1.0.121','join','Mergn\x20SDK\x20is\x20disabled!','storeEventsAndPropertiesInLocalStorage','Notification\x20already\x20in\x20cache','top','NONE','logout','getCurrentUTCDate','\x20is\x20not\x20valid.','\x20does\x20not\x20have\x20a\x20valid\x20attributeProperty.','ttl','forEach','\x0adisplay:\x20flex;\x0ajustify-content:\x20space-between;\x0aalign-items:\x20center;\x0aflex-wrap:\x20nowrap;\x0awidth:\x20100%;\x0a','show_notification_error','submit','form','popup_container_','tracking\x20page\x20change\x20register','apply','\x0apadding:\x2012px\x2020px;\x0aborder:\x20none;\x0abackground-color:\x20\x20','isContentCardAction','documentElement','catch','\x20has\x20invalid\x20eventProperties:\x20','.u-popup-container','Notification\x20permission:\x20','position','get','Mergn\x20SDK\x20Initialized','button-1','Error\x20fetching\x20attribute\x20data','success','Service\x20Worker\x20registered','POST','loadContentCardEventActionInLocalStorage','removeAttribute','checkTTL','already_registered','User\x20closed\x20the\x20notification\x20permission\x20dialog.','keys','getElementById','utm_term','getPreviousUrl','banner_design','init','\x0aMergnError:\x20','/set-identity','Error\x20storing\x20attribute\x20data\x20in\x20local\x20storage','User\x20denied\x20the\x20notification\x20permission.','store\x20session','Close\x20Click','web_push_action','toISOString','User\x20granted\x20the\x20notification\x20permission.','Initializing\x20base\x20service','DELAY','Error\x20posting\x20event\x20record:','filter','optin_data','important','existing_subscription','getRegistrations','resolve','store\x20session\x20-\x20','loadActionInLocalStorage','Verifying\x20API\x20Key','os-version','display','UTM_SOURCE','startsWith','Crawlers','Pushing\x20message\x20to\x20service\x20worker','Event\x20Payload','next','attributeProperty','button-container','Failed\x20to\x20subscribe\x20the\x20user','getAttribute','name:\x20','recordDebugEvents','two_step','3760904UwhNkp','getOwnPropertyNames','string','/brand/get-web-push-public-key'];_0x1d44=function(){return _0x3b4bb7;};return _0x1d44();}re=new WeakMap(),$=new WeakSet(),ne=function(_0x43349a){const _0x161ae0=_0xc40304;return btoa(_0x43349a+':'+new Date()[_0x161ae0(0x1cd)]());},m(w,re);var Me=w,N=Me[_0xc40304(0x2fb)](),G,ie,x,Nt,Ve,_t,At,V=class V{constructor(){m(this,x),m(this,ie,!0x1);}static[_0xc40304(0x2fb)](){const _0x7f5c6a=_0xc40304;var _0x482d41;return d(V,G)||(I(V,G,new V()),i(_0x482d41=d(V,G),x,Nt)[_0x7f5c6a(0x252)](_0x482d41)),d(V,G);}['recordAttribute'](_0x37aa54,_0x163864,_0x25f754){return a(this,null,function*(){yield A('#\x20recordAttribute',()=>a(this,null,function*(){const _0x3c3db9=_0x383b;if(s(0x1,_0x3c3db9(0x2e0)),C('Recording\x20attribute',!0x0),L(_0x3c3db9(0x241),!0x0),s(0x1,_0x3c3db9(0x17e)+{'attributeName':_0x37aa54,'attributeProperties':_0x25f754,'attributeValue':_0x163864}+')}'),!_0x163864||_0x163864===''){s(0x2,_0x3c3db9(0x2e1));return;}yield E[_0x3c3db9(0x210)](),yield i(this,x,_t)[_0x3c3db9(0x252)](this);let _0x4b1fbd=JSON[_0x3c3db9(0x2dd)](localStorage[_0x3c3db9(0x259)]('attributes')||'{}'),_0x23b364=_0x25f754?i(this,x,Ve)[_0x3c3db9(0x252)](this,_0x4b1fbd,_0x37aa54,_0x25f754):i(this,x,Ve)['call'](this,_0x4b1fbd,_0x37aa54);if(typeof _0x23b364==_0x3c3db9(0x23f)){s(0x2,_0x23b364);return;}_0x4b1fbd[_0x37aa54][_0x3c3db9(0x305)]&&(yield E['setIdentity'](typeof _0x163864==_0x3c3db9(0x23f)?_0x163864:JSON['stringify'](_0x163864))),E[_0x3c3db9(0x276)]();let {id:_0x431ae1}=_0x4b1fbd[_0x37aa54],_0x2cad12={'attributeId':_0x431ae1,'attributeProperties':_0x23b364,'customerId':localStorage[_0x3c3db9(0x259)](_0x3c3db9(0x2df))||'','value':_0x163864};yield i(this,x,At)[_0x3c3db9(0x252)](this,_0x2cad12);let _0x31ceb3=JSON[_0x3c3db9(0x2dd)](localStorage[_0x3c3db9(0x259)](_0x3c3db9(0x28e))||'[]');_0x31ceb3['pop'](),localStorage[_0x3c3db9(0x1a6)](_0x3c3db9(0x28e),JSON[_0x3c3db9(0x185)](_0x31ceb3)),L(_0x3c3db9(0x241),!0x1),C(_0x3c3db9(0x2e0),!0x1);}));});}[_0xc40304(0x2fd)](){return a(this,null,function*(){const _0x5c84fd=_0x383b;if(!localStorage[_0x5c84fd(0x259)]('attributes')&&!d(this,ie)){I(this,ie,!0x0);try{let _0x1ef368=(yield this['fetchAttributeData']())[_0x5c84fd(0x293)];_0x1ef368&&localStorage['setItem'](_0x5c84fd(0x270),JSON[_0x5c84fd(0x185)](_0x1ef368));}catch(_0x5c2b13){throw new Error(_0x5c84fd(0x21b));}finally{I(this,ie,!0x1);}}});}['fetchAttributeData'](){return a(this,null,function*(){const _0x5dc048=_0x383b;try{return yield N['get'](''+Fe);}catch(_0x43518f){throw new Error(_0x5dc048(0x20a));}});}};G=new WeakMap(),ie=new WeakMap(),x=new WeakSet(),Nt=function(){return a(this,null,function*(){});},Ve=function(_0x540941,_0x3450b0,_0x20a044){const _0x11181f=_0xc40304;if(!Object['prototype'][_0x11181f(0x1ea)]['call'](_0x540941,_0x3450b0))return _0x11181f(0x309)+_0x3450b0+_0x11181f(0x1f4);if(!_0x20a044)return[];let _0x4ff72a=_0x540941[_0x3450b0];if(!(_0x4ff72a!=null&&_0x4ff72a[_0x11181f(0x236)]))return _0x11181f(0x309)+_0x3450b0+_0x11181f(0x1f5);let _0x24bb00=_0x20a044[_0x11181f(0x225)](({attributeProperty:_0x33cf04})=>!Object['prototype']['hasOwnProperty']['call'](_0x4ff72a['attributeProperty'],_0x33cf04))[_0x11181f(0x1af)](({attributeProperty:_0x5c5e97})=>_0x5c5e97);return _0x24bb00['length']>0x0?'Attribute\x20'+_0x3450b0+_0x11181f(0x18b)+_0x24bb00[_0x11181f(0x1ec)](',\x20')+'.':_0x20a044[_0x11181f(0x1af)](({attributeProperty:_0x20903d,value:_0x533dec})=>({'attributePropertyId':_0x4ff72a[_0x11181f(0x236)][_0x20903d]['id'],'value':_0x533dec}));},_t=function(){return a(this,null,function*(){const _0x23162e=_0x383b;localStorage[_0x23162e(0x259)](_0x23162e(0x270))||(yield this[_0x23162e(0x2fd)]());});},At=function(_0x90cec){return a(this,null,function*(){const _0x277e08=_0x383b;try{return yield N[_0x277e08(0x2b3)](''+Fe+It,_0x90cec);}catch(_0x49a276){throw new Error(_0x277e08(0x1c7));}});},m(V,G);var $e=V,me=$e[_0xc40304(0x2fb)](),Ke=_0xc40304(0x325),Y,T,Ot,He,Lt,Ct,se,_e,Dt,Ut,xt,Ae,K=class K{constructor(){const _0x456614=_0xc40304;m(this,T),m(this,se,_0x569a5d=>{const _0x1d4124=_0x383b;E[_0x1d4124(0x15f)]({'id':_0x569a5d,'localStorageKey':_0x1d4124(0x2ec)});}),this[_0x456614(0x20e)]=()=>{const _0xc3002d=_0x456614;E[_0xc3002d(0x22c)]({'actionCondition':_0xabe256=>_0xabe256[_0xc3002d(0x16c)][_0xc3002d(0x1e6)]===_0xc3002d(0x2e6),'actionMethod':_0x4fd8b4=>i(this,T,He)[_0xc3002d(0x252)](this,_0x4fd8b4[_0xc3002d(0x2bc)]),'localStorageKey':_0xc3002d(0x2ec)});},m(this,Ae,()=>{const _0x1d5237=_0x456614;E['storeActionInLocalStorageInternal'](_0x1d5237(0x2ec));});}static[_0xc40304(0x2fb)](){const _0x3aa094=_0xc40304;var _0x2bfd57;return d(K,Y)||(I(K,Y,new K()),i(_0x2bfd57=d(K,Y),T,Ot)[_0x3aa094(0x252)](_0x2bfd57)),d(K,Y);}[_0xc40304(0x27f)](_0x1dcf9c){const _0x421ee9=_0xc40304;let _0x460cd4=JSON[_0x421ee9(0x2dd)](localStorage[_0x421ee9(0x259)](_0x421ee9(0x2ec))||'{}');if(_0x460cd4&&_0x460cd4[_0x1dcf9c==null?void 0x0:_0x1dcf9c[_0x421ee9(0x2bc)]]){s(0x1,_0x421ee9(0x2ee));return;}i(this,T,xt)['call'](this,_0x1dcf9c),d(this,Ae)[_0x421ee9(0x252)](this),i(this,T,He)[_0x421ee9(0x252)](this,_0x1dcf9c['campaignId']);}[_0xc40304(0x200)](_0x5a5d21){const _0x38aafa=_0xc40304;return _0x5a5d21===_0x38aafa(0x1c2);}};Y=new WeakMap(),T=new WeakSet(),Ot=function(){return a(this,null,function*(){});},He=function(_0x578f7c){const _0x40ca7b=_0xc40304;let _0x647f99=i(this,T,Lt)[_0x40ca7b(0x252)](this);if(document[_0x40ca7b(0x214)](_0x40ca7b(0x2b2)+_0x578f7c)){s(0x1,_0x40ca7b(0x2a7)),d(this,se)['call'](this,_0x578f7c);return;}if(_0x647f99!=null&&_0x647f99[_0x578f7c])switch(_0x647f99[_0x578f7c]['campaignEntryTime']){case _0x40ca7b(0x223):{i(this,T,Ct)[_0x40ca7b(0x252)](this,_0x647f99[_0x578f7c]);break;}case _0x40ca7b(0x306):{i(this,T,_e)[_0x40ca7b(0x252)](this,_0x647f99[_0x578f7c]);break;}case _0x40ca7b(0x1ca):{i(this,T,Ut)[_0x40ca7b(0x252)](this,_0x647f99[_0x578f7c]);break;}default:return;}},Lt=function(){const _0x3817bb=_0xc40304;let _0x2f3441=localStorage['getItem'](_0x3817bb(0x2ec));return _0x2f3441?JSON[_0x3817bb(0x2dd)](_0x2f3441):null;},Ct=function(_0x2de426){const _0x325d4d=_0xc40304;E['showDelayedAction']({'clearActionMethod':d(this,se)['bind'](this),'data':_0x2de426,'displayMethod':i(this,T,_e)[_0x325d4d(0x193)](this),'idKey':'campaignId','timeValueKey':_0x325d4d(0x288)});},se=new WeakMap(),_e=function(_0x422a19){const _0x69b652=_0xc40304;var _0x3e671c;if(document[_0x69b652(0x214)]('contentCard_container_'+_0x422a19[_0x69b652(0x2bc)]))s(0x1,_0x69b652(0x2a7));else{let _0x4a968d=i(this,T,Dt)[_0x69b652(0x252)](this,_0x69b652(0x308),_0x422a19),_0x3ee101=document['querySelector']('#'+_0x422a19[_0x69b652(0x16c)][_0x69b652(0x1d7)]);_0x3ee101&&(_0x3ee101['innerHTML']=_0x4a968d['outerHTML'],u[_0x69b652(0x26a)]({'campaignCustomerInstanceId':_0x422a19['campaignCustomerInstanceId'],'campaignId':_0x422a19['campaignId'],'eventName':Ke,'eventProperties':[{'eventProperty':_0x69b652(0x1e5),'value':JSON[_0x69b652(0x185)]({'campaignId':_0x422a19[_0x69b652(0x2bc)]})}],'name':'view'}),(_0x3e671c=document[_0x69b652(0x214)]('contentCard_container_'+_0x422a19[_0x69b652(0x2bc)]))==null||_0x3e671c[_0x69b652(0x1d1)]('click',()=>{const _0x5bea66=_0x69b652;u[_0x5bea66(0x26a)]({'campaignCustomerInstanceId':_0x422a19['campaignCustomerInstanceId'],'campaignId':_0x422a19[_0x5bea66(0x2bc)],'eventName':Ke,'eventProperties':[{'eventProperty':_0x5bea66(0x17d),'value':JSON[_0x5bea66(0x185)]({'campaignId':_0x422a19[_0x5bea66(0x2bc)]})}],'name':'click'});}));}d(this,se)[_0x69b652(0x252)](this,_0x422a19['campaignId']);},Dt=function(_0xe9e5b6,_0x290a7e){const _0xec1bdf=_0xc40304;var _0x59199d;let {campaignId:_0x12273f,message:{design:_0x53de70}}=_0x290a7e,_0x1dcc12=document[_0xec1bdf(0x192)](_0xe9e5b6);return _0x1dcc12['id']=_0xec1bdf(0x2b2)+_0x12273f,_0x1dcc12[_0xec1bdf(0x1cf)]=_0x53de70,(_0x59199d=_0x1dcc12[_0xec1bdf(0x182)](_0xec1bdf(0x2fc)))==null||_0x59199d['remove'](),_0x1dcc12;},Ut=function(_0x45e0b8){const _0x1bfa83=_0xc40304;E[_0x1bfa83(0x179)]({'data':_0x45e0b8,'displayMethod':i(this,T,_e)[_0x1bfa83(0x193)](this),'timeValueKey':_0x1bfa83(0x288)});},xt=function(_0x5255a3){const _0x3978f4=_0xc40304;E[_0x3978f4(0x324)](_0x5255a3,_0x3978f4(0x2ec),'campaignId');},Ae=new WeakMap(),m(K,Y);var Je=K,ae=Je[_0xc40304(0x2fb)](),ce,B,le,q,Ee,ve,S,ze,Wt,Ge,Re,kt,Ce,Oe,Ye,Ft,Le,Ie,Bt,f=class f{constructor(){const _0x5e8017=_0xc40304;m(this,S),this['permission']=null,this[_0x5e8017(0x279)]=_0x291291=>{const _0x1ac3fc=_0x5e8017;s(0x1,_0x1ac3fc(0x233)),navigator[_0x1ac3fc(0x2af)][_0x1ac3fc(0x229)]()[_0x1ac3fc(0x2d5)](_0x344c4c=>{const _0x19dbf9=_0x1ac3fc;var _0x46afa4,_0x345955;s(0x1,_0x19dbf9(0x2ab)),(_0x46afa4=_0x344c4c[0x0])!=null&&_0x46afa4[_0x19dbf9(0x258)]&&(s(0x1,_0x19dbf9(0x2d4)),(_0x345955=_0x344c4c[0x0]['active'])==null||_0x345955[_0x19dbf9(0x2ce)](JSON[_0x19dbf9(0x185)](_0x291291)));})[_0x1ac3fc(0x202)](_0x41b6f6=>{const _0x473fe5=_0x1ac3fc;s(0x2,_0x473fe5(0x2fe)+_0x41b6f6[_0x473fe5(0x16c)]);});},this[_0x5e8017(0x307)]=()=>{const _0xc2cc23=_0x5e8017;E[_0xc2cc23(0x22c)]({'actionCondition':()=>!0x0,'actionMethod':_0x29e651=>i(this,S,Oe)['call'](this,Number(_0x29e651[_0xc2cc23(0x2f2)])),'localStorageKey':_0xc2cc23(0x21f)});},m(this,Ce,()=>{const _0x525ecc=_0x5e8017;E[_0x525ecc(0x2c2)](_0x525ecc(0x21f));}),m(this,Ie,_0x57324c=>{const _0x4d6625=_0x5e8017;E[_0x4d6625(0x15f)]({'id':_0x57324c,'localStorageKey':_0x4d6625(0x21f)});});}static['getInstance'](){return d(f,ce)||I(f,ce,new f()),d(f,ce);}['init'](_0xc199c,_0xd5c85c){return a(this,null,function*(){const _0x10b74f=_0x383b;var _0x1b6862;if(s(0x1,'Initializing\x20Notification\x20Service'),u['recordDebugEvents']({'eventName':_0x10b74f(0x218),'eventProperties':[{'eventProperty':_0x10b74f(0x2ba),'value':'serviceWorker'in navigator},{'eventProperty':_0x10b74f(0x267),'value':_0x10b74f(0x2aa)in window}]}),_0x10b74f(0x2af)in navigator&&_0x10b74f(0x2aa)in window){s(0x1,_0x10b74f(0x16a));try{u[_0x10b74f(0x23b)]({'eventName':_0x10b74f(0x28f)}),I(f,B,yield navigator['serviceWorker'][_0x10b74f(0x1da)](_0xd5c85c||_0x10b74f(0x251))),s(0x1,_0x10b74f(0x20c)),s(0x1,_0x10b74f(0x177)),this[_0x10b74f(0x279)]({'customer':localStorage[_0x10b74f(0x259)](_0x10b74f(0x2df))||'','events':u[_0x10b74f(0x1b9)](),'API_KEY':N[_0x10b74f(0x2f1)](),'device_id':localStorage['getItem'](_0x10b74f(0x25f))||'','operatingSystem':E[_0x10b74f(0x2cd)](),'osVersion':E['getOSVersion'](),'Platform':E[_0x10b74f(0x168)]()}),I(f,Ee,!0x0);let _0xd0b029=i(this,S,Ye)['call'](this),_0x3a9129=Object[_0x10b74f(0x213)](_0xd0b029||{});if(_0x3a9129['length']&&i(this,S,Oe)[_0x10b74f(0x252)](this,Number(_0x3a9129[0x0])),!_0xc199c)return;let _0x40e3ef=yield(_0x1b6862=d(f,B))==null?void 0x0:_0x1b6862['pushManager'][_0x10b74f(0x2da)]();s(0x1,_0x10b74f(0x1c0)),d(f,B)&&(s(0x1,_0x10b74f(0x1b5)),d(f,B)[_0x10b74f(0x2a6)]()),_0x40e3ef?(s(0x1,_0x10b74f(0x16d)),u[_0x10b74f(0x23b)]({'eventName':_0x10b74f(0x228)}),yield i(this,S,Re)[_0x10b74f(0x252)](this),I(f,le,!0x0)):(s(0x1,_0x10b74f(0x2d1)),yield i(this,S,ze)[_0x10b74f(0x252)](this,d(f,ve)||void 0x0));}catch(_0x22be26){let _0x538fc6=_0x22be26&&_0x22be26[_0x10b74f(0x16c)]?_0x22be26[_0x10b74f(0x16c)][_0x10b74f(0x1b0)](0x0,0x64):_0x10b74f(0x28a);yield u['recordDebugEvents']({'eventName':'Reachability\x20Push\x20Web','eventProperties':[{'eventProperty':_0x10b74f(0x16c),'value':''+_0x538fc6}]}),s(0x2,_0x10b74f(0x1b7)),s(0x2,_0x538fc6);}}});}[_0xc40304(0x25e)](_0x502a46){const _0x50e71f=_0xc40304;if(!d(f,Ee)){I(f,ve,_0x502a46),u[_0x50e71f(0x23b)]({'eventName':'notification_service_not_initialized'}),s(0x2,_0x50e71f(0x2f9));return;}A(_0x50e71f(0x25e),()=>a(this,null,function*(){const _0x470bbf=_0x50e71f;let _0xd2386=JSON[_0x470bbf(0x2dd)](localStorage['getItem'](_0x470bbf(0x21f))||'{}');if(_0xd2386&&_0xd2386[_0x502a46[_0x470bbf(0x2f2)]]){s(0x1,_0x470bbf(0x1ef));return;}i(this,S,kt)[_0x470bbf(0x252)](this,_0x502a46),d(this,Ce)[_0x470bbf(0x252)](this),i(this,S,Oe)[_0x470bbf(0x252)](this,_0x502a46[_0x470bbf(0x2f2)]);}));}};ce=new WeakMap(),B=new WeakMap(),le=new WeakMap(),q=new WeakMap(),Ee=new WeakMap(),ve=new WeakMap(),S=new WeakSet(),ze=function(_0x4288ea){return a(this,null,function*(){const _0x443998=_0x383b;s(0x1,_0x443998(0x285)+JSON[_0x443998(0x185)](_0x4288ea)+'\x20'),u[_0x443998(0x23b)]({'eventName':'check_permission'});let _0x1b6b8b;try{_0x1b6b8b=Notification[_0x443998(0x1de)],_0x1b6b8b&&(s(0x1,_0x443998(0x205)+_0x1b6b8b),_0x1b6b8b===_0x443998(0x2bd)?(_0x4288ea||(this[_0x443998(0x1de)]=_0x443998(0x2bd),u[_0x443998(0x23b)]({'eventName':_0x443998(0x18f)})),_0x4288ea&&(u['recordDebugEvents']({'eventName':'notification_data','eventProperties':[{'eventProperty':'type','value':''+(_0x4288ea==null?void 0x0:_0x4288ea['type'])}]}),d(this,Ie)[_0x443998(0x252)](this,_0x4288ea[_0x443998(0x2f2)]),_0x4288ea[_0x443998(0x1b3)]===_0x443998(0x23c)?i(this,S,Wt)[_0x443998(0x252)](this,_0x4288ea):yield i(this,S,Ge)['call'](this,_0x4288ea))):_0x1b6b8b==='denied'?(u[_0x443998(0x23b)]({'eventName':_0x443998(0x196)}),s(0x1,_0x443998(0x30d))):(u[_0x443998(0x23b)]({'eventName':_0x443998(0x211)}),s(0x1,'The\x20user\x20has\x20already\x20enabled\x20notifications.'),d(f,le)||(yield i(this,S,Re)[_0x443998(0x252)](this),yield u['recordEvent']({'eventName':_0x443998(0x28d)}),_0x4288ea||I(f,le,!0x0))));}catch(_0x15a1fe){s(0x2,'Failed\x20to\x20check\x20notification\x20permission'),u[_0x443998(0x23b)]({'eventName':_0x443998(0x171)});}});},Wt=function(_0x225047){const _0x4d0922=_0xc40304;try{let _0x21e597=document['createElement'](_0x4d0922(0x308)),_0x54349a;_0x225047[_0x4d0922(0x217)][_0x4d0922(0x2e4)]&&(_0x54349a=document['createElement'](_0x4d0922(0x170)),_0x54349a[_0x4d0922(0x303)]=_0x225047[_0x4d0922(0x217)]['banner_image'],_0x54349a['alt']='Image',_0x54349a['id']='centered-image');let _0x4ae70e=document[_0x4d0922(0x192)]('div'),_0x2cb4d5=document[_0x4d0922(0x192)](_0x4d0922(0x308)),_0x75429c=document[_0x4d0922(0x192)]('div'),_0x1c8728=document['createElement'](_0x4d0922(0x170)),_0x31bfbf=document[_0x4d0922(0x192)](_0x4d0922(0x308)),_0xa5cf03=document[_0x4d0922(0x192)](_0x4d0922(0x308)),_0x3d65a9=document['createElement']('div'),_0x512a75=document['createElement'](_0x4d0922(0x308)),_0x77455e=document[_0x4d0922(0x192)](_0x4d0922(0x308)),_0x3736f5=document[_0x4d0922(0x192)](_0x4d0922(0x308)),_0xcc61c8=document[_0x4d0922(0x192)]('button'),_0x49e3c8=document[_0x4d0922(0x192)](_0x4d0922(0x17b));_0x21e597['className']=_0x4d0922(0x165),_0x4ae70e['className']=_0x4d0922(0x296),_0x2cb4d5[_0x4d0922(0x291)]=_0x512a75[_0x4d0922(0x291)]=_0x77455e[_0x4d0922(0x291)]='mergn-row',_0x75429c['className']=_0x4d0922(0x1ab),_0x31bfbf[_0x4d0922(0x291)]=_0x4d0922(0x302),_0x3736f5['className']=_0x4d0922(0x237),_0xa5cf03['id']=_0x4d0922(0x2de),_0x3d65a9['id']='subtitle',_0xcc61c8['id']=_0x4d0922(0x209),_0x49e3c8['id']=_0x4d0922(0x29a),_0x1c8728[_0x4d0922(0x303)]=_0x225047[_0x4d0922(0x217)][_0x4d0922(0x1b6)],_0x1c8728[_0x4d0922(0x2d9)]=_0x4d0922(0x1ac),_0x1c8728['id']=_0x4d0922(0x266),_0xa5cf03[_0x4d0922(0x1e0)]=_0x225047[_0x4d0922(0x217)]['banner_title'],_0x3d65a9[_0x4d0922(0x1e0)]=_0x225047[_0x4d0922(0x217)]['banner_text'],_0xcc61c8[_0x4d0922(0x1e0)]=_0x225047['banner_design']['button_1'][_0x4d0922(0x300)],_0x49e3c8[_0x4d0922(0x1e0)]=_0x225047[_0x4d0922(0x217)][_0x4d0922(0x1d2)]['text'],_0x75429c[_0x4d0922(0x1ce)](_0x1c8728),_0x31bfbf[_0x4d0922(0x1ce)](_0xa5cf03),_0x31bfbf[_0x4d0922(0x1ce)](_0x3d65a9),_0x2cb4d5[_0x4d0922(0x1ce)](_0x75429c),_0x2cb4d5[_0x4d0922(0x1ce)](_0x31bfbf),_0x54349a&&(_0x512a75[_0x4d0922(0x1ce)](_0x54349a),_0x54349a[_0x4d0922(0x2e2)][_0x4d0922(0x2b0)]='\x0amax-width:\x20100%;\x0aheight:\x20auto;\x0adisplay:\x20block;\x0amargin-left:\x20auto;\x0amargin-right:\x20auto;\x0aborder-radius:\x2010px;\x0amax-width:\x20350px;\x0aaspect-ratio:\x202\x20/\x201;\x0a'),_0x3736f5[_0x4d0922(0x1ce)](_0xcc61c8),_0x3736f5[_0x4d0922(0x1ce)](_0x49e3c8),_0x77455e[_0x4d0922(0x1ce)](_0x3736f5),_0x4ae70e['appendChild'](_0x2cb4d5),_0x4ae70e['appendChild'](_0x512a75),_0x4ae70e['appendChild'](_0x77455e),_0x21e597[_0x4d0922(0x1ce)](_0x4ae70e),_0x21e597[_0x4d0922(0x2e2)][_0x4d0922(0x2b0)]=_0x4d0922(0x2c3),_0x4ae70e['style'][_0x4d0922(0x2b0)]=_0x4d0922(0x2a8)+_0x225047[_0x4d0922(0x217)][_0x4d0922(0x164)]+';\x0apadding:\x2015px;\x0aborder-radius:\x205px;\x0amax-width:\x20380px;\x0amax-height:\x20463px;\x0a',_0x2cb4d5[_0x4d0922(0x2e2)][_0x4d0922(0x2b0)]=_0x512a75['style'][_0x4d0922(0x2b0)]=_0x77455e[_0x4d0922(0x2e2)][_0x4d0922(0x2b0)]='\x0adisplay:\x20flex;\x0aflex-wrap:\x20wrap;\x0amargin-bottom:\x2010px;\x0a',_0x75429c[_0x4d0922(0x2e2)]['cssText']='\x0awidth:\x2025%;\x0a',_0x31bfbf[_0x4d0922(0x2e2)][_0x4d0922(0x2b0)]='\x0awidth:\x2073%;\x0amargin-left:\x202%;\x0a',_0x1c8728['style']['cssText']=_0x4d0922(0x2f3),_0xcc61c8[_0x4d0922(0x2e2)][_0x4d0922(0x2b0)]=_0x4d0922(0x1ff)+_0x225047[_0x4d0922(0x217)][_0x4d0922(0x2e9)]['backgroundColor']+';\x0acolor:\x20'+_0x225047['banner_design']['button_1']['color']+_0x4d0922(0x2a4),_0x49e3c8[_0x4d0922(0x2e2)][_0x4d0922(0x2b0)]='\x0apadding:\x2012px\x2020px;\x0aborder:\x20none;\x0abackground-color:\x20\x20'+_0x225047[_0x4d0922(0x217)][_0x4d0922(0x1d2)]['backgroundColor']+_0x4d0922(0x2a3)+_0x225047[_0x4d0922(0x217)][_0x4d0922(0x1d2)][_0x4d0922(0x1e1)]+_0x4d0922(0x2a4),_0x3736f5['style'][_0x4d0922(0x2b0)]=_0x4d0922(0x1f8),_0xa5cf03[_0x4d0922(0x2e2)][_0x4d0922(0x2b0)]='\x0amargin-bottom:\x205px;\x0afont-size:\x2016px;\x0acolor:\x20'+_0x225047[_0x4d0922(0x217)][_0x4d0922(0x28c)]+'\x0a',_0x3d65a9[_0x4d0922(0x2e2)][_0x4d0922(0x2b0)]=_0x4d0922(0x19e)+_0x225047[_0x4d0922(0x217)]['text_color']+'\x0a',document[_0x4d0922(0x1b8)]['appendChild'](_0x21e597),document[_0x4d0922(0x1b8)][_0x4d0922(0x2e2)][_0x4d0922(0x2f0)]=_0x4d0922(0x318),u[_0x4d0922(0x26a)]({'eventName':'Viewed\x20Web\x20Push\x20Soft-ask','name':_0x4d0922(0x286),'web_optin_instance_id':_0x225047['web_optin_instance_id']}),_0xcc61c8==null||_0xcc61c8[_0x4d0922(0x1d1)](_0x4d0922(0x1ad),()=>a(this,null,function*(){const _0x33d7d5=_0x4d0922;_0x21e597['remove'](),I(f,q,!0x1),document[_0x33d7d5(0x1b8)][_0x33d7d5(0x2e2)]['overflow']=_0x33d7d5(0x2a1),yield u[_0x33d7d5(0x26a)]({'eventName':_0x33d7d5(0x2f8),'web_optin_instance_id':_0x225047[_0x33d7d5(0x2f2)]}),s(0x1,_0x33d7d5(0x21c));})),_0x49e3c8==null||_0x49e3c8['addEventListener']('click',()=>a(this,null,function*(){const _0x331a02=_0x4d0922;_0x21e597[_0x331a02(0x1d8)](),document[_0x331a02(0x1b8)][_0x331a02(0x2e2)][_0x331a02(0x2f0)]=_0x331a02(0x2a1),u[_0x331a02(0x26a)]({'eventName':_0x331a02(0x2ed),'web_optin_instance_id':_0x225047[_0x331a02(0x2f2)]}),yield i(this,S,Ge)[_0x331a02(0x252)](this,_0x225047);}));}catch(_0x3ff35c){}},Ge=function(_0x279559){return a(this,null,function*(){const _0x2819e2=_0x383b;try{u[_0x2819e2(0x26a)]({'eventName':_0x2819e2(0x272),'name':_0x2819e2(0x286),'web_optin_instance_id':_0x279559[_0x2819e2(0x2f2)]});let _0x3d6f37=yield Notification[_0x2819e2(0x2b7)]();_0x3d6f37===_0x2819e2(0x24f)?(s(0x1,_0x2819e2(0x221)),yield i(this,S,Re)[_0x2819e2(0x252)](this),yield u[_0x2819e2(0x26a)]({'eventName':_0x2819e2(0x161),'name':_0x2819e2(0x1c4),'web_optin_instance_id':_0x279559[_0x2819e2(0x2f2)]})):_0x3d6f37==='denied'?(yield u['recordEvent']({'eventName':'Blocked\x20Web\x20Push\x20Subscription'}),s(0x1,'User\x20denied\x20the\x20notification\x20permission.')):_0x3d6f37===_0x2819e2(0x2bd)&&(yield u[_0x2819e2(0x26a)]({'eventName':'Closed\x20Web\x20Push\x20Subscription'}),s(0x1,_0x2819e2(0x212)));}catch(_0x47325c){s(0x2,_0x2819e2(0x2e5));}I(f,q,!0x1);});},Re=function(){return a(this,null,function*(){const _0x3eb9aa=_0x383b;var _0x291a3b,_0x794670;let _0xc31b66=yield N[_0x3eb9aa(0x207)](''+yt);if(_0xc31b66[_0x3eb9aa(0x20b)]){let _0x28c636=yield(_0x291a3b=d(f,B))==null?void 0x0:_0x291a3b[_0x3eb9aa(0x176)][_0x3eb9aa(0x2da)]();_0x28c636&&(yield _0x28c636['unsubscribe']());let _0x4141d1=yield(_0x794670=d(f,B))==null?void 0x0:_0x794670['pushManager']['subscribe']({'applicationServerKey':_0xc31b66[_0x3eb9aa(0x293)]||'','userVisibleOnly':!0x0});yield N[_0x3eb9aa(0x16e)](''+ht,{'device_id':localStorage[_0x3eb9aa(0x259)]('uniqueIdentity')||'','is_web_push_subscribed':!0x0,'web_push_subscription_page_url':window['location']['pathname'],'web_push_token':{'token':JSON['parse'](JSON[_0x3eb9aa(0x185)](_0x4141d1))}}),s(0x1,_0x3eb9aa(0x1cc));}else throw new Error(_0x3eb9aa(0x238));});},kt=function(_0x3eea62){const _0x375ddf=_0xc40304;E[_0x375ddf(0x324)](_0x3eea62,'web_push_action',_0x375ddf(0x2f2));},Ce=new WeakMap(),Oe=function(_0x221639){const _0x1ada2c=_0xc40304;if(d(f,q))return;I(f,q,!0x0);let _0x4f0b18=i(this,S,Ye)[_0x1ada2c(0x252)](this);if(_0x4f0b18!=null&&_0x4f0b18[_0x221639])switch(_0x4f0b18[_0x221639][_0x1ada2c(0x2d2)]){case _0x1ada2c(0x223):{i(this,S,Ft)[_0x1ada2c(0x252)](this,_0x4f0b18[_0x221639]);break;}case _0x1ada2c(0x306):{i(this,S,Le)['call'](this,_0x4f0b18[_0x221639]);break;}case _0x1ada2c(0x1ca):{i(this,S,Bt)[_0x1ada2c(0x252)](this,_0x4f0b18[_0x221639]);break;}default:return;}},Ye=function(){const _0xd3f4c1=_0xc40304;let _0x45cad4=localStorage['getItem'](_0xd3f4c1(0x21f));return _0x45cad4?JSON[_0xd3f4c1(0x2dd)](_0x45cad4):null;},Ft=function(_0x2be38b){const _0x5734e7=_0xc40304;E[_0x5734e7(0x174)]({'clearActionMethod':d(this,Ie)['bind'](this),'data':_0x2be38b,'displayMethod':i(this,S,Le)[_0x5734e7(0x193)](this),'idKey':_0x5734e7(0x2f2),'timeValueKey':_0x5734e7(0x322)});},Le=function(_0x1069dc){const _0x2b970b=_0xc40304;i(this,S,ze)[_0x2b970b(0x252)](this,_0x1069dc);},Ie=new WeakMap(),Bt=function(_0x2f7af4){const _0x15de28=_0xc40304;E[_0x15de28(0x179)]({'data':_0x2f7af4,'displayMethod':i(this,S,Le)[_0x15de28(0x193)](this),'timeValueKey':_0x15de28(0x322)});},m(f,ce),m(f,B,null),m(f,le,!0x1),m(f,q,!0x1),m(f,Ee,!0x1),m(f,ve,null);var je=f,W=je[_0xc40304(0x2fb)](),Q,P,Mt,Qe,$t,Vt,de,De,Kt,Jt,Ht,Ue,J=class J{constructor(){m(this,P),m(this,de,_0x911559=>{const _0x56c9fb=_0x383b;E[_0x56c9fb(0x15f)]({'id':_0x911559,'localStorageKey':_0x56c9fb(0x2ec)});}),this['loadPopupEventActionInLocalStorage']=()=>{const _0x1127b3=_0x383b;E[_0x1127b3(0x22c)]({'actionCondition':_0x18965e=>_0x18965e[_0x1127b3(0x16c)][_0x1127b3(0x1e6)]===_0x1127b3(0x2e3),'actionMethod':_0x22faa2=>i(this,P,Qe)[_0x1127b3(0x252)](this,_0x22faa2[_0x1127b3(0x2bc)]),'localStorageKey':_0x1127b3(0x2ec)});},m(this,Ue,()=>{const _0x4854d7=_0x383b;E[_0x4854d7(0x2c2)](_0x4854d7(0x2ec));});}static['getInstance'](){var _0x205bdd;return d(J,Q)||(I(J,Q,new J()),i(_0x205bdd=d(J,Q),P,Mt)['call'](_0x205bdd)),d(J,Q);}[_0xc40304(0x17f)](_0x45c024){const _0x8e2cf3=_0xc40304;let _0x1de178=JSON[_0x8e2cf3(0x2dd)](localStorage[_0x8e2cf3(0x259)](_0x8e2cf3(0x2ec))||'{}');if(_0x1de178&&_0x1de178[_0x45c024==null?void 0x0:_0x45c024['campaignId']]){s(0x1,_0x8e2cf3(0x257));return;}i(this,P,Ht)[_0x8e2cf3(0x252)](this,_0x45c024),d(this,Ue)['call'](this),i(this,P,Qe)[_0x8e2cf3(0x252)](this,_0x45c024[_0x8e2cf3(0x2bc)]);}[_0xc40304(0x263)](_0x2d160e){return _0x2d160e==='Popup';}};Q=new WeakMap(),P=new WeakSet(),Mt=function(){return a(this,null,function*(){});},Qe=function(_0x338fc1){const _0x4e198d=_0xc40304;let _0x1ebeee=i(this,P,$t)[_0x4e198d(0x252)](this);if(document[_0x4e198d(0x214)](_0x4e198d(0x1fc)+_0x338fc1)){s(0x1,_0x4e198d(0x320)),d(this,de)[_0x4e198d(0x252)](this,_0x338fc1);return;}if(_0x1ebeee!=null&&_0x1ebeee[_0x338fc1])switch(_0x1ebeee[_0x338fc1][_0x4e198d(0x2cc)]){case'DELAY':{i(this,P,Vt)[_0x4e198d(0x252)](this,_0x1ebeee[_0x338fc1]);break;}case _0x4e198d(0x306):{i(this,P,De)[_0x4e198d(0x252)](this,_0x1ebeee[_0x338fc1]);break;}case _0x4e198d(0x1ca):{i(this,P,Jt)[_0x4e198d(0x252)](this,_0x1ebeee[_0x338fc1]);break;}default:return;}},$t=function(){const _0x86b1b1=_0xc40304;let _0x561be5=localStorage[_0x86b1b1(0x259)]('action');return _0x561be5?JSON[_0x86b1b1(0x2dd)](_0x561be5):null;},Vt=function(_0x595adf){const _0x2d8e36=_0xc40304;E[_0x2d8e36(0x174)]({'clearActionMethod':d(this,de)['bind'](this),'data':_0x595adf,'displayMethod':i(this,P,De)['bind'](this),'idKey':_0x2d8e36(0x2bc),'timeValueKey':_0x2d8e36(0x288)});},de=new WeakMap(),De=function(_0x59504e){const _0x2f85cd=_0xc40304;if(document['getElementById'](_0x2f85cd(0x1fc)+_0x59504e['campaignId']))s(0x1,_0x2f85cd(0x320));else{let _0x4a7a0c=i(this,P,Kt)[_0x2f85cd(0x252)](this,_0x2f85cd(0x308),_0x59504e);document[_0x2f85cd(0x1b8)][_0x2f85cd(0x1ce)](_0x4a7a0c),u[_0x2f85cd(0x26a)]({'campaignCustomerInstanceId':_0x59504e[_0x2f85cd(0x290)],'campaignId':_0x59504e[_0x2f85cd(0x2bc)],'eventName':te,'eventProperties':[{'eventProperty':_0x2f85cd(0x243),'value':JSON[_0x2f85cd(0x185)]({'campaignId':_0x59504e[_0x2f85cd(0x2bc)]})}],'name':_0x2f85cd(0x166)});}d(this,de)[_0x2f85cd(0x252)](this,_0x59504e[_0x2f85cd(0x2bc)]);},Kt=function(_0x987944,_0x432f6d){const _0x41a9e7=_0xc40304;let {campaignCustomerInstanceId:_0x1dd7d4,campaignId:_0x3f6c45,message:{design:_0x50f36d}}=_0x432f6d,_0x92129c=document[_0x41a9e7(0x192)](_0x987944);_0x92129c['id']=_0x41a9e7(0x1fc)+_0x3f6c45,_0x92129c[_0x41a9e7(0x1cf)]=_0x50f36d,_0x92129c[_0x41a9e7(0x2e2)][_0x41a9e7(0x206)]='fixed',_0x92129c['style'][_0x41a9e7(0x1f0)]='0',_0x92129c[_0x41a9e7(0x2e2)]['left']='0',_0x92129c[_0x41a9e7(0x2e2)][_0x41a9e7(0x277)]=_0x41a9e7(0x1a0),_0x92129c[_0x41a9e7(0x2e2)][_0x41a9e7(0x190)]='100%',_0x92129c['style'][_0x41a9e7(0x175)]=_0x41a9e7(0x328);let _0x4737b0=_0x92129c['querySelector'](_0x41a9e7(0x204));_0x4737b0&&(_0x4737b0['style'][_0x41a9e7(0x175)]='50');let _0x452843=_0x4737b0[_0x41a9e7(0x182)](_0x41a9e7(0x188));_0x452843&&(s(0x1,_0x41a9e7(0x269)),_0x452843['style'][_0x41a9e7(0x173)](_0x41a9e7(0x22f),_0x41a9e7(0x31a),_0x41a9e7(0x227))),_0x92129c[_0x41a9e7(0x17c)](_0x41a9e7(0x1c3))[_0x41a9e7(0x1f7)](_0x48aaee=>{const _0x34f55e=_0x41a9e7;let _0xa3dc34=_0x48aaee[_0x34f55e(0x182)](_0x34f55e(0x1fb));_0xa3dc34&&_0xa3dc34[_0x34f55e(0x1d1)](_0x34f55e(0x1fa),()=>a(this,null,function*(){const _0x54bd83=_0x34f55e;_0x92129c['remove']();let _0x1adda9=new FormData(_0xa3dc34),_0x6bc672={};for(let [_0x4b0d21,_0x4b2431]of _0x1adda9[_0x54bd83(0x2c1)]())_0x6bc672[_0x4b0d21]=_0x4b2431;yield u[_0x54bd83(0x26a)]({'campaignCustomerInstanceId':_0x1dd7d4,'campaignId':_0x3f6c45,'eventName':te,'eventProperties':[{'eventProperty':_0x54bd83(0x319),'value':JSON[_0x54bd83(0x185)]({'campaignId':_0x3f6c45,'formId':_0x48aaee['id'],'formValues':_0x6bc672})},{'eventProperty':_0x54bd83(0x30a),'value':_0x3f6c45[_0x54bd83(0x1a1)]()}],'name':_0x54bd83(0x1fb)});}));});let _0x334e66=_0x92129c['querySelector']('.u-close-button');return(_0x334e66==null?void 0x0:_0x334e66[_0x41a9e7(0x239)](_0x41a9e7(0x274)))==='#'&&_0x334e66[_0x41a9e7(0x20f)](_0x41a9e7(0x274)),_0x334e66==null||_0x334e66[_0x41a9e7(0x1d1)](_0x41a9e7(0x1ad),()=>a(this,null,function*(){const _0x3f6cdd=_0x41a9e7;_0x92129c['remove'](),yield u[_0x3f6cdd(0x26a)]({'campaignCustomerInstanceId':_0x1dd7d4,'campaignId':_0x3f6c45,'eventName':te,'eventProperties':[{'eventProperty':_0x3f6cdd(0x21e),'value':JSON['stringify']({'campaignId':_0x3f6c45})}],'name':_0x3f6cdd(0x2c0)});})),_0x92129c[_0x41a9e7(0x17c)](_0x41a9e7(0x1aa))[_0x41a9e7(0x1f7)](_0x31d21b=>{const _0x5d4c8a=_0x41a9e7;_0x31d21b[_0x5d4c8a(0x1d1)](_0x5d4c8a(0x1ad),()=>a(this,null,function*(){const _0x26fc30=_0x5d4c8a;_0x92129c['remove'](),yield u[_0x26fc30(0x26a)]({'campaignCustomerInstanceId':_0x1dd7d4,'campaignId':_0x3f6c45,'eventName':te,'eventProperties':[{'eventProperty':'Button\x20Click','value':JSON[_0x26fc30(0x185)]({'buttonId':_0x31d21b['id'],'campaignId':_0x3f6c45})}],'name':_0x26fc30(0x1ad)});}));}),_0x92129c['querySelectorAll']('.u-popup-container\x20img')[_0x41a9e7(0x1f7)](_0x10db8f=>{const _0x118898=_0x41a9e7;_0x10db8f[_0x118898(0x1d1)]('click',()=>a(this,null,function*(){const _0x56a709=_0x118898;_0x92129c[_0x56a709(0x1d8)](),yield u[_0x56a709(0x26a)]({'campaignCustomerInstanceId':_0x1dd7d4,'campaignId':_0x3f6c45,'eventName':te,'eventProperties':[{'eventProperty':_0x56a709(0x249),'value':JSON[_0x56a709(0x185)]({'campaignId':_0x3f6c45,'imageClassName':_0x10db8f[_0x56a709(0x291)],'imageId':_0x10db8f['id']})}],'name':_0x56a709(0x1ad)});}));}),_0x92129c;},Jt=function(_0x58903e){const _0x1551a6=_0xc40304;E[_0x1551a6(0x179)]({'data':_0x58903e,'displayMethod':i(this,P,De)[_0x1551a6(0x193)](this),'timeValueKey':'campaignEntryTimeValue'});},Ht=function(_0x170f0f){const _0x26bd16=_0xc40304;E[_0x26bd16(0x324)](_0x170f0f,_0x26bd16(0x2ec),_0x26bd16(0x2bc));},Ue=new WeakMap(),m(J,Q);var qe=J,H=qe[_0xc40304(0x2fb)](),ue,fe,he,be,ye,we,Te,xe,p,zt,Gt,Yt,Se,Xe,et,tt,nt,qt,Qt,Zt,Xt,en,tn,nn,rt,it,rn,on,Z=class Z{constructor(){const _0x1ee160=_0xc40304;m(this,p),m(this,fe),m(this,he),m(this,be),m(this,ye,null),m(this,we,null),m(this,Te,!0x1),m(this,xe,()=>{setInterval(()=>{const _0x32913c=_0x383b;let _0x116508=localStorage['getItem'](_0x32913c(0x18c));if(_0x116508!==d(this,we)){I(this,we,_0x116508);let _0x4a0e04=JSON[_0x32913c(0x2dd)](_0x116508||'{}');if(_0x4a0e04!=null&&_0x4a0e04[_0x32913c(0x279)]){let _0x410031=_0x4a0e04[_0x32913c(0x279)];delete _0x4a0e04[_0x32913c(0x279)],localStorage[_0x32913c(0x1a6)](_0x32913c(0x18c),JSON['stringify'](_0x4a0e04)),W[_0x32913c(0x279)](_0x410031);}if(_0x4a0e04!=null&&_0x4a0e04['optIn']){let _0x379905=_0x4a0e04[_0x32913c(0x244)];delete _0x4a0e04[_0x32913c(0x244)],localStorage[_0x32913c(0x1a6)](_0x32913c(0x18c),JSON[_0x32913c(0x185)](_0x4a0e04)),W[_0x32913c(0x25e)](_0x379905);}if(_0x4a0e04!=null&&_0x4a0e04[_0x32913c(0x2b9)]){let _0x4579d3=_0x4a0e04[_0x32913c(0x2b9)];delete _0x4a0e04[_0x32913c(0x2b9)],localStorage[_0x32913c(0x1a6)](_0x32913c(0x18c),JSON[_0x32913c(0x185)](_0x4a0e04)),_0x4579d3[_0x32913c(0x1f7)](_0x5d2e1d=>{const _0x1adadf=_0x32913c;H[_0x1adadf(0x263)](_0x5d2e1d['message'][_0x1adadf(0x1e6)])?H[_0x1adadf(0x17f)](_0x5d2e1d):ae[_0x1adadf(0x200)](_0x5d2e1d[_0x1adadf(0x16c)][_0x1adadf(0x1e6)])&&ae[_0x1adadf(0x27f)](_0x5d2e1d);});}}},0x3e8);}),this[_0x1ee160(0x2c2)]=_0x4c78c5=>{const _0x256e35=_0x1ee160;let _0x3b9050=()=>{const _0x14f900=_0x383b;let _0x34d513=JSON[_0x14f900(0x2dd)](localStorage[_0x14f900(0x259)](_0x4c78c5)||'{}');Object[_0x14f900(0x213)](_0x34d513)['forEach'](_0x1c78e4=>{const _0x20a6b6=_0x14f900;_0x34d513[_0x1c78e4]['initialTime']=new Date()[_0x20a6b6(0x1cd)]();}),localStorage[_0x14f900(0x1a6)](_0x4c78c5,JSON['stringify'](_0x34d513));};_0x3b9050(),window['addEventListener'](_0x256e35(0x1dd),_0x3b9050);},this[_0x1ee160(0x15f)]=({id:_0x14e494,localStorageKey:_0x52e9bd})=>{const _0x4d766c=_0x1ee160;let _0x5953bb=JSON[_0x4d766c(0x2dd)](localStorage[_0x4d766c(0x259)](_0x52e9bd)||'{}');_0x5953bb[_0x14e494]&&delete _0x5953bb[_0x14e494],localStorage[_0x4d766c(0x1a6)](_0x52e9bd,JSON[_0x4d766c(0x185)](_0x5953bb));},this[_0x1ee160(0x22c)]=({actionCondition:_0x292d4f,actionMethod:_0x51e8de,localStorageKey:_0x474fba})=>{const _0x53d74e=_0x1ee160;let _0x5b1009=JSON[_0x53d74e(0x2dd)](localStorage[_0x53d74e(0x259)](_0x474fba)||'{}');Object[_0x53d74e(0x213)](_0x5b1009)[_0x53d74e(0x1f7)](_0x5d4b02=>{_0x292d4f(_0x5b1009[_0x5d4b02])&&_0x51e8de(_0x5b1009[_0x5d4b02]);});};}static['getInstance'](){return d(Z,ue)||I(Z,ue,new Z()),d(Z,ue);}['init'](_0xf96637,_0x34048c){return a(this,null,function*(){const _0x3100b7=_0x383b;s(0x1,_0x3100b7(0x222)),_0x34048c!=null&&_0x34048c[_0x3100b7(0x24a)]&&I(this,Te,!0x0),i(this,p,zt)[_0x3100b7(0x252)](this,_0xf96637);let _0x47af5f=this[_0x3100b7(0x168)]();if(_0x47af5f==='Crawlers'||_0x47af5f==='Unknown'){s(0x2,_0x3100b7(0x278));return;}if(yield N[_0x3100b7(0x19f)](),s(0x1,_0x3100b7(0x22d)),yield i(this,p,rt)['call'](this),_0x34048c!=null&&_0x34048c[_0x3100b7(0x24a)]&&d(this,xe)[_0x3100b7(0x252)](this),_0x34048c!=null&&_0x34048c[_0x3100b7(0x281)])try{g[_0x3100b7(0x186)]=!0x0,yield this[_0x3100b7(0x184)](_0x34048c[_0x3100b7(0x281)]);}finally{g[_0x3100b7(0x186)]=!0x1;}setInterval(()=>a(this,null,function*(){const _0x89db8c=_0x3100b7;s(0x1,'Verifying\x20API\x20Key\x20after\x20timeout'),yield i(this,p,rt)[_0x89db8c(0x252)](this);}),0x493e0);let _0x3aed41=i(this,p,Se)[_0x3100b7(0x252)](this);if(yield this[_0x3100b7(0x210)](),yield u[_0x3100b7(0x313)](),u['recordDebugEvents']({'eventName':'base_init'}),s(0x1,_0x3100b7(0x2c8)),yield A('notification\x20service',()=>a(this,null,function*(){const _0x2899bf=_0x3100b7;yield W[_0x2899bf(0x218)](_0x3aed41,_0x34048c==null?void 0x0:_0x34048c[_0x2899bf(0x1d0)]);})),!(_0x34048c!=null&&_0x34048c['shopify'])){yield i(this,p,on)[_0x3100b7(0x252)](this);let _0x476006=history[_0x3100b7(0x2ac)];history[_0x3100b7(0x2ac)]=(..._0x529d17)=>{const _0x582466=_0x3100b7;_0x476006[_0x582466(0x1fe)](history,_0x529d17),i(this,p,rn)[_0x582466(0x252)](this);};}s(0x1,_0x3100b7(0x1fd));});}[_0xc40304(0x1e8)](_0x59fda8){I(this,fe,_0x59fda8);}['setOSVersion'](_0x23ade6){I(this,he,_0x23ade6);}[_0xc40304(0x2e8)](_0x51d1e4){I(this,be,_0x51d1e4);}[_0xc40304(0x1dc)](_0x24c734){I(this,ye,_0x24c734);}[_0xc40304(0x216)](){return d(this,ye);}[_0xc40304(0x168)](){return d(this,fe);}['getOSVersion'](){return d(this,he);}['getOperatingSystem'](){return d(this,be);}[_0xc40304(0x276)](){const _0x1464ea=_0xc40304;localStorage[_0x1464ea(0x1a6)](_0x1464ea(0x1f6),''+new Date()[_0x1464ea(0x1cd)]());}[_0xc40304(0x179)]({data:_0x283cd2,displayMethod:_0x5caa7c,timeValueKey:_0x4d98a8}){const _0x243a6d=_0xc40304;let _0x5cdd99=()=>{const _0x97eb8c=_0x383b;var _0x3c6fb1;let _0x5a4007=window[_0x97eb8c(0x2f5)],_0x13fb72=document[_0x97eb8c(0x201)][_0x97eb8c(0x1b2)];window[_0x97eb8c(0x248)]/(_0x13fb72-_0x5a4007)*0x64>(((_0x3c6fb1=_0x283cd2[_0x4d98a8])==null?void 0x0:_0x3c6fb1[_0x97eb8c(0x1e7)])||0x0)&&(window['removeEventListener'](_0x97eb8c(0x2a0),_0x5cdd99),_0x5caa7c(_0x283cd2));};window[_0x243a6d(0x1d1)](_0x243a6d(0x2a0),_0x5cdd99);}[_0xc40304(0x174)]({clearActionMethod:_0x5735b0,data:_0x230b9b,displayMethod:_0x4c7d54,idKey:_0x53d145,timeValueKey:_0x32cb18}){const _0x413c9f=_0xc40304;var _0x1dd161,_0x1ed25d,_0x252ed9;let _0x451cd7=(_0x1dd161=_0x230b9b[_0x32cb18])==null?void 0x0:_0x1dd161[_0x413c9f(0x1e7)];((_0x1ed25d=_0x230b9b[_0x32cb18])==null?void 0x0:_0x1ed25d[_0x413c9f(0x1b4)])===_0x413c9f(0x27d)&&(_0x451cd7=_0x451cd7*0x3c);let _0x4eb85c=_0x230b9b['initialTime']-0x1f4+(_0x451cd7||0x0)*0x3e8-new Date()[_0x413c9f(0x1cd)]();s(0x1,_0x413c9f(0x299)+_0x230b9b[_0x413c9f(0x1e9)]),s(0x1,'Time\x20value:\x20'+((_0x252ed9=_0x230b9b[_0x32cb18])==null?void 0x0:_0x252ed9['value'])),s(0x1,_0x413c9f(0x24b)+new Date()[_0x413c9f(0x1cd)]()),s(0x1,'Time\x20difference:\x20'+_0x4eb85c),_0x4eb85c>0x0?setTimeout(()=>{_0x5735b0(_0x230b9b[_0x53d145]),_0x4c7d54(_0x230b9b);},_0x4eb85c):(_0x5735b0(_0x230b9b[_0x53d145]),_0x4c7d54(_0x230b9b));}[_0xc40304(0x324)](_0x1059c9,_0x448f8f,_0x5c68ac){const _0x2a7f50=_0xc40304;var _0x2a3735;let _0x2f73a6=JSON[_0x2a7f50(0x2dd)](localStorage[_0x2a7f50(0x259)](_0x448f8f)||'{}'),_0x53b6af=(_0x2a3735=_0x5c68ac in _0x1059c9&&_0x1059c9[_0x5c68ac])!=null?_0x2a3735:'';_0x53b6af&&(_0x2f73a6[_0x53b6af]=Ne(z({},_0x1059c9),{'initialTime':new Date()[_0x2a7f50(0x1cd)]()}),localStorage['setItem'](_0x448f8f,JSON['stringify'](_0x2f73a6)));}[_0xc40304(0x210)](){return a(this,null,function*(){const _0x2be65f=_0x383b;yield A(_0x2be65f(0x24c),()=>a(this,null,function*(){const _0x5db033=_0x2be65f;if(d(this,Te))return;s(0x1,_0x5db033(0x316)),C(_0x5db033(0x316),!0x0),L(_0x5db033(0x1d9),!0x0);let _0x390b8c=localStorage['getItem']('ttl'),_0x3dd213=!0x1;if(_0x390b8c){if(_0x3dd213=i(this,p,Se)['call'](this,_0x390b8c),_0x3dd213){let _0x2b52e9=localStorage[_0x5db033(0x259)](_0x5db033(0x2eb)),_0x19f6e=localStorage[_0x5db033(0x259)](_0x5db033(0x1f6));if(_0x2b52e9&&_0x19f6e){let _0x1a9107=parseInt(_0x19f6e,0xa);u[_0x5db033(0x26a)]({'eventName':_0x5db033(0x25a),'eventProperties':[{'eventProperty':'SESSION_ID','value':localStorage[_0x5db033(0x259)](_0x5db033(0x2eb))},{'eventProperty':_0x5db033(0x30e),'value':Number['isInteger'](_0x1a9107)?new Date(_0x1a9107)[_0x5db033(0x220)]():new Date()[_0x5db033(0x220)]()}]});}this[_0x5db033(0x162)](),localStorage[_0x5db033(0x1a6)]('ttl',''+new Date()[_0x5db033(0x1cd)]());}}else localStorage[_0x5db033(0x1a6)](_0x5db033(0x1f6),''+new Date()['getTime']());(!_0x390b8c||_0x3dd213||i(this,p,Qt)['call'](this))&&(i(this,p,nt)[_0x5db033(0x252)](this)&&i(this,p,Zt)['call'](this),i(this,p,tt)[_0x5db033(0x252)](this)&&(yield this[_0x5db033(0x184)]()),(i(this,p,Se)[_0x5db033(0x252)](this)||i(this,p,Xe)['call'](this))&&(yield i(this,p,tn)[_0x5db033(0x252)](this)),yield i(this,p,Xt)[_0x5db033(0x252)](this),(i(this,p,Se)['call'](this)||i(this,p,et)[_0x5db033(0x252)](this))&&(yield i(this,p,nn)[_0x5db033(0x252)](this))),L(_0x5db033(0x1d9),!0x1),C('Checking\x20TTL',!0x1);}));});}[_0xc40304(0x162)](){const _0x1a2bf1=_0xc40304;localStorage[_0x1a2bf1(0x198)]('action'),localStorage[_0x1a2bf1(0x198)](_0x1a2bf1(0x25d)),localStorage[_0x1a2bf1(0x198)](_0x1a2bf1(0x270)),localStorage[_0x1a2bf1(0x198)](_0x1a2bf1(0x27b)),localStorage[_0x1a2bf1(0x198)]('ttl'),localStorage[_0x1a2bf1(0x198)](_0x1a2bf1(0x2eb));}[_0xc40304(0x184)](_0x70d8bc){return a(this,null,function*(){const _0x1c4b1f=_0x383b;let _0x944b4c={'deviceId':localStorage[_0x1c4b1f(0x259)]('uniqueIdentity')||crypto[_0x1c4b1f(0x194)](),'os':this['getPlatform']()};if(_0x70d8bc)_0x944b4c[_0x1c4b1f(0x281)]=_0x70d8bc;else{if(!_0x70d8bc&&localStorage[_0x1c4b1f(0x259)](_0x1c4b1f(0x2df)))return;}try{let _0x4ba12e=yield i(this,p,en)[_0x1c4b1f(0x252)](this,_0x944b4c);if(_0x4ba12e!==void 0x0){localStorage['setItem'](_0x1c4b1f(0x2df),_0x4ba12e);try{W['pushMessageToSW']({'customer':_0x4ba12e});}catch(_0x1a2bbe){}}}catch(_0xabce4d){throw new Error(_0x1c4b1f(0x2a5));}});}};ue=new WeakMap(),fe=new WeakMap(),he=new WeakMap(),be=new WeakMap(),ye=new WeakMap(),we=new WeakMap(),Te=new WeakMap(),xe=new WeakMap(),p=new WeakSet(),zt=function(_0x4fba17){const _0x1a603e=_0xc40304;N[_0x1a603e(0x160)](_0x4fba17),this[_0x1a603e(0x1e8)](i(this,p,Gt)['call'](this)),this['setOSVersion'](i(this,p,Yt)['call'](this)),this[_0x1a603e(0x2e8)](navigator[_0x1a603e(0x1a7)]);},Gt=function(){const _0x354cda=_0xc40304;var _0x233865;let _0x1880d1=navigator[_0x354cda(0x1a7)][_0x354cda(0x1c8)]();return/googlebot|bingbot|yandexbot|duckduckbot|slurp|twitterbot|linkedinbot|facebot|pinterest|vkshare|applebot|baiduspider|adsbot-google|msnbot|yahoobot|sogou|facebookexternalhit/i[_0x354cda(0x199)](_0x1880d1)?'Crawlers':/wv|wkwebview|instagram|facebook|fbav|fban|twitter|snapchat|pinterest|linkedin|tiktok/i[_0x354cda(0x199)](_0x1880d1)?_0x354cda(0x282):/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i['test'](_0x1880d1)?(_0x354cda(0x2c9)in window&&typeof((_0x233865=window==null?void 0x0:window['Notification'])==null?void 0x0:_0x233865[_0x354cda(0x1de)])!=_0x354cda(0x28a),_0x354cda(0x282)):/windows|macintosh|linux|x11/i[_0x354cda(0x199)](_0x1880d1)?_0x354cda(0x2be):_0x354cda(0x1e2);},Yt=function(){const _0x19d463=_0xc40304;let _0xf5230d=navigator[_0x19d463(0x1a7)],_0x211980;return _0xf5230d[_0x19d463(0x29c)]('Chrome')>-0x1?_0x211980=_0x19d463(0x2ff):_0xf5230d[_0x19d463(0x29c)]('Safari')>-0x1?_0x211980=_0x19d463(0x246):_0xf5230d[_0x19d463(0x29c)](_0x19d463(0x262))>-0x1?_0x211980=_0x19d463(0x2b8):_0xf5230d[_0x19d463(0x29c)](_0x19d463(0x283))>-0x1?_0x211980=_0x19d463(0x26b):_0xf5230d[_0x19d463(0x29c)]('MSIE')>-0x1?_0x211980=_0x19d463(0x2a2):_0x211980=_0x19d463(0x1e2),_0x211980;},Se=function(_0x239da9){const _0x59b8ca=_0xc40304;let _0x5c8c82;return _0x239da9||(_0x5c8c82=localStorage[_0x59b8ca(0x259)]('ttl')),_0x239da9||_0x5c8c82?new Date()[_0x59b8ca(0x1cd)]()-parseInt(_0x239da9||_0x5c8c82||'',0xa)>0x124f80:!0x0;},Xe=function(){const _0x2f35b0=_0xc40304;return!localStorage[_0x2f35b0(0x259)](_0x2f35b0(0x25d));},et=function(){const _0x194dd4=_0xc40304;return!localStorage['getItem'](_0x194dd4(0x270));},tt=function(){const _0x3ee979=_0xc40304;return!localStorage[_0x3ee979(0x259)]('customer');},nt=function(){const _0x438e50=_0xc40304;return!localStorage[_0x438e50(0x259)](_0x438e50(0x25f));},qt=function(){const _0x491e64=_0xc40304;return!localStorage[_0x491e64(0x259)](_0x491e64(0x2eb));},Qt=function(){const _0x2e8bd5=_0xc40304;return i(this,p,Xe)[_0x2e8bd5(0x252)](this)||i(this,p,et)['call'](this)||i(this,p,tt)['call'](this)||i(this,p,nt)[_0x2e8bd5(0x252)](this)||i(this,p,qt)[_0x2e8bd5(0x252)](this);},Zt=function(){const _0x3bc208=_0xc40304;let _0xbf9e2e=localStorage['getItem'](_0x3bc208(0x25f));return _0xbf9e2e||(_0xbf9e2e=crypto[_0x3bc208(0x194)](),localStorage['setItem'](_0x3bc208(0x25f),_0xbf9e2e)),_0xbf9e2e;},Xt=function(){return a(this,null,function*(){const _0x354db8=_0x383b;yield A(_0x354db8(0x21d),()=>a(this,null,function*(){const _0x548cf5=_0x354db8;let _0x30f023=localStorage[_0x548cf5(0x259)](_0x548cf5(0x2eb));if(!_0x30f023){_0x30f023=crypto[_0x548cf5(0x194)](),localStorage[_0x548cf5(0x1a6)](_0x548cf5(0x2eb),_0x30f023);let _0x422e4d=localStorage[_0x548cf5(0x259)](_0x548cf5(0x1f6)),_0x5f1d8d=_0x422e4d?parseInt(_0x422e4d,0xa):'';yield u[_0x548cf5(0x26a)]({'eventName':'Web\x20Session\x20Started','eventProperties':[{'eventProperty':_0x548cf5(0x1a2),'value':localStorage[_0x548cf5(0x259)](_0x548cf5(0x2eb))},{'eventProperty':_0x548cf5(0x30e),'value':_0x5f1d8d?new Date(_0x5f1d8d)['toISOString']():new Date()[_0x548cf5(0x220)]()}]});}}),_0x1c5429=>{const _0x3213ca=_0x354db8;u[_0x3213ca(0x26a)]({'eventName':_0x3213ca(0x19c),'eventProperties':[{'eventProperty':'message','value':_0x3213ca(0x22b)+_0x1c5429[_0x3213ca(0x16c)]}]},!0x0);});});},en=function(_0x1dfb6f){return a(this,null,function*(){const _0x540162=_0x383b;try{return(yield N[_0x540162(0x2b3)](''+ft+bt,_0x1dfb6f))['data'];}catch(_0x55534c){throw new Error(_0x540162(0x1a3));}});},tn=function(){return a(this,null,function*(){const _0x12eb28=_0x383b;yield u[_0x12eb28(0x1ee)]();});},nn=function(){return a(this,null,function*(){const _0x511520=_0x383b;yield me[_0x511520(0x2fd)]();});},rt=function(){return a(this,null,function*(){const _0x47aead=_0x383b;yield A(_0x47aead(0x1bf),()=>a(this,null,function*(){const _0x733cfb=_0x47aead;var _0x2347be;try{let _0x3ff08b=parseInt(localStorage[_0x733cfb(0x259)]('verifyTTL')||'0',0xa)||0x0;if(!_0x3ff08b||_0x3ff08b&&new Date()['getTime']()>_0x3ff08b){let _0x124685=yield N[_0x733cfb(0x207)](_0x733cfb(0x327));if(!(_0x124685!=null&&_0x124685[_0x733cfb(0x20b)]))throw new Error(JSON['stringify'](_0x124685));localStorage[_0x733cfb(0x1a6)](_0x733cfb(0x2c5),(new Date()[_0x733cfb(0x1cd)]()+0x493e0)[_0x733cfb(0x1a1)]());}g[_0x733cfb(0x2b5)]=!0x0;}catch(_0x269bad){throw N[_0x733cfb(0x2c7)]()==='67'&&!((_0x2347be=_0x269bad==null?void 0x0:_0x269bad[_0x733cfb(0x16c)])!=null&&_0x2347be[_0x733cfb(0x231)]('get'))&&u['recordEvent']({'eventName':'Debug\x20Event','eventProperties':[{'eventProperty':'message','value':'verifyAPIKey\x20-\x20'+_0x269bad[_0x733cfb(0x16c)]}]},!0x0),g[_0x733cfb(0x31f)]=!0x0,new Error(_0x733cfb(0x2bb));}}));});},it=function(){return a(this,null,function*(){const _0x4cd549=_0x383b;var _0x35968d;s(0x1,_0x4cd549(0x1a9));let _0x964747=(_0x35968d=window==null?void 0x0:window['location'])==null?void 0x0:_0x35968d[_0x4cd549(0x274)];this[_0x4cd549(0x1dc)](_0x964747),u[_0x4cd549(0x23b)]({'eventName':'pre_vwp'});let _0x57f17e=[];new URLSearchParams(new URL(window[_0x4cd549(0x1cb)][_0x4cd549(0x274)])[_0x4cd549(0x2fa)])[_0x4cd549(0x1f7)]((_0x357ea,_0x3b3c65)=>a(this,null,function*(){const _0x5220e2=_0x4cd549;Pt[_0x5220e2(0x163)](_0x3b3c65)&&_0x57f17e[_0x5220e2(0x326)]({'eventProperty':_0x3b3c65,'value':_0x357ea});})),yield u[_0x4cd549(0x26a)]({'eventName':_0x4cd549(0x183),'eventProperties':[{'eventProperty':_0x4cd549(0x18e),'value':window[_0x4cd549(0x1cb)]['pathname']},..._0x57f17e]});});},rn=function(){return a(this,null,function*(){const _0x1c57f9=_0x383b;var _0x660e40;s(0x1,_0x1c57f9(0x2cf));let _0x755cb5=(_0x660e40=window==null?void 0x0:window['location'])==null?void 0x0:_0x660e40[_0x1c57f9(0x274)];(this['getPreviousUrl']()===null||this[_0x1c57f9(0x216)]()===void 0x0||_0x755cb5!==this['getPreviousUrl']())&&(yield i(this,p,it)[_0x1c57f9(0x252)](this));});},on=function(){return a(this,null,function*(){const _0xc6817e=_0x383b;var _0x42b07a,_0x3dfdd3;let _0x45ca5a=(_0x42b07a=window==null?void 0x0:window[_0xc6817e(0x1cb)])==null?void 0x0:_0x42b07a[_0xc6817e(0x274)];u['recordDebugEvents']({'eventName':_0xc6817e(0x1f9),'eventProperties':[{'eventProperty':_0xc6817e(0x16c),'value':(_0x45ca5a!==this[_0xc6817e(0x216)]())+':'+_0x45ca5a+':'+this['getPreviousUrl']()}]});try{yield i(this,p,it)['call'](this);}catch(_0x1bc28b){let _0x55d8ef=_0x1bc28b&&_0x1bc28b[_0xc6817e(0x16c)]?(_0x3dfdd3=_0x1bc28b==null?void 0x0:_0x1bc28b[_0xc6817e(0x16c)])==null?void 0x0:_0x3dfdd3['substring'](0x0,0x64):'undefined';yield u[_0xc6817e(0x23b)]({'eventName':_0xc6817e(0x287),'eventProperties':[{'eventProperty':_0xc6817e(0x16c),'value':''+_0x55d8ef}]});}});},m(Z,ue);var Ze=Z,E=Ze[_0xc40304(0x2fb)](),X,R,sn,We,an,cn,ln,dn,j=class j{constructor(){const _0x5e5aac=_0xc40304;m(this,R),this[_0x5e5aac(0x2d0)]=Promise[_0x5e5aac(0x22a)]();}static[_0xc40304(0x2fb)](){const _0x53f4bc=_0xc40304;var _0x4ad64f;return d(j,X)||(I(j,X,new j()),i(_0x4ad64f=d(j,X),R,sn)[_0x53f4bc(0x252)](_0x4ad64f)),d(j,X);}[_0xc40304(0x25b)](_0x5bad2b){const _0x24b51e=_0xc40304;let _0x182ce4=JSON[_0x24b51e(0x2dd)](localStorage[_0x24b51e(0x259)](_0x24b51e(0x19b))||'[]');_0x182ce4['push'](_0x5bad2b),localStorage['setItem'](_0x24b51e(0x19b),JSON['stringify'](_0x182ce4));}[_0xc40304(0x313)](){return a(this,null,function*(){const _0x495c93=_0x383b;let _0x402ea6=JSON[_0x495c93(0x2dd)](localStorage[_0x495c93(0x259)](_0x495c93(0x19b))||'[]');if(Array[_0x495c93(0x2dc)](_0x402ea6)){for(let _0x2abef8 of _0x402ea6)yield this[_0x495c93(0x321)](_0x2abef8);}});}[_0xc40304(0x26a)](_0xaec2ad,_0x270947){return a(this,null,function*(){const _0xeac39f=_0x383b;g['isInitialized']&&!g[_0xeac39f(0x186)]?yield i(this,R,We)[_0xeac39f(0x252)](this,_0xaec2ad,_0x270947):this['pushToQueue'](_0xaec2ad);});}[_0xc40304(0x321)](_0x2bd938){return a(this,null,function*(){const _0x1dc434=_0x383b;try{yield i(this,R,We)[_0x1dc434(0x252)](this,_0x2bd938);}finally{i(this,R,dn)[_0x1dc434(0x252)](this,_0x2bd938['eventName']);}});}[_0xc40304(0x23b)](_0xa21501){return a(this,null,function*(){const _0x1363b9=_0x383b;g[_0x1363b9(0x1ae)]===0x4&&(!g[_0x1363b9(0x1a4)]||g[_0x1363b9(0x1a4)][_0xa21501[_0x1363b9(0x180)]])&&(yield i(this,R,We)[_0x1363b9(0x252)](this,_0xa21501));});}[_0xc40304(0x1b9)](){const _0x1e7f9a=_0xc40304;let _0x5a8fa2=localStorage[_0x1e7f9a(0x259)](_0x1e7f9a(0x25d));return _0x5a8fa2?JSON[_0x1e7f9a(0x2dd)](_0x5a8fa2):{};}[_0xc40304(0x1ee)](){return a(this,null,function*(){const _0x3c38b7=_0x383b;if(!localStorage[_0x3c38b7(0x259)](_0x3c38b7(0x25d))){let _0x49c24f=(yield this[_0x3c38b7(0x292)]())[_0x3c38b7(0x293)];if(_0x49c24f){localStorage[_0x3c38b7(0x1a6)](_0x3c38b7(0x25d),JSON[_0x3c38b7(0x185)](_0x49c24f));try{W[_0x3c38b7(0x279)]({'events':_0x49c24f});}catch(_0x54b48c){}}}});}['fetchEventData'](){return a(this,null,function*(){const _0xcf6490=_0x383b;try{return yield N[_0xcf6490(0x207)](''+Be);}catch(_0x1389c5){throw new Error(_0xcf6490(0x1a8));}});}[_0xc40304(0x1c9)](_0x10a9ee,_0x5d64a1){return a(this,null,function*(){const _0xe48fe5=_0x383b;let _0x1bdbbd=null,_0x595940=null,_0x9e4d56=new AbortController();return this['queue']=this[_0xe48fe5(0x2d0)][_0xe48fe5(0x2d5)](()=>a(this,null,function*(){const _0x2fbfee=_0xe48fe5;try{if(_0x10a9ee[_0x2fbfee(0x25d)][_0x2fbfee(0x242)]===0x0)throw new Error(_0x2fbfee(0x311));let _0x58da12=yield N[_0x2fbfee(0x2b3)](_0x2fbfee(0x1b1)+Be+St,_0x10a9ee,_0x9e4d56[_0x2fbfee(0x2ef)]);if(_0x58da12[_0x2fbfee(0x20b)])return _0x595940=_0x58da12,_0x58da12;if(_0x58da12['message']==='Customer\x20with\x20id\x20'+localStorage['getItem'](_0x2fbfee(0x2df))+_0x2fbfee(0x2bf))throw localStorage[_0x2fbfee(0x198)](_0x2fbfee(0x2df)),new Error(_0x2fbfee(0x312));}catch(_0x467583){throw s(0x2,_0x2fbfee(0x224)),s(0x2,_0x2fbfee(0x23a)+_0x467583[_0x2fbfee(0x1e6)]),s(0x2,'message:\x20'+_0x467583[_0x2fbfee(0x16c)]),(_0x467583[_0x2fbfee(0x1e6)]==='AbortError'||_0x467583[_0x2fbfee(0x1e6)]===_0x2fbfee(0x26f)&&_0x467583[_0x2fbfee(0x16c)]==='Failed\x20to\x20fetch')&&(s(0x2,_0x2fbfee(0x2db)),_0x5d64a1&&i(this,R,ln)[_0x2fbfee(0x252)](this,_0x5d64a1)),_0x1bdbbd=new Error('Error\x20posting\x20event\x20record'),_0x467583;}return null;}))[_0xe48fe5(0x202)](()=>{}),this[_0xe48fe5(0x2d0)][_0xe48fe5(0x2d5)](()=>{if(_0x1bdbbd)throw _0x1bdbbd;return _0x595940;});});}};X=new WeakMap(),R=new WeakSet(),sn=function(){return a(this,null,function*(){});},We=function(_0xc7b03,_0x51a1f2){return a(this,null,function*(){yield A('#\x20record\x20event',()=>a(this,null,function*(){const _0x3687a2=_0x383b;var _0x1661d2,_0x3af574,_0x2e909b,_0x48c837;let {campaignCustomerInstanceId:_0x121241,campaignId:_0x3738ae,eventName:_0x42af7e,eventProperties:_0x6abf1,name:_0x326831,web_optin_instance_id:_0x45ca7c}=_0xc7b03;s(0x1,'#\x20Recording\x20event'),C('Recording\x20event',!0x0),L(_0x3687a2(0x1bc),!0x0),s(0x1,_0x3687a2(0x234)),s(0x1,{'campaignCustomerInstanceId':_0x121241,'eventName':_0x42af7e,'eventProperties':_0x6abf1,'name':_0x326831,'web_optin_instance_id':_0x45ca7c});let _0x1429e4=E[_0x3687a2(0x168)]();if(_0x1429e4===_0x3687a2(0x232)||_0x1429e4===_0x3687a2(0x1e2))throw new Error(_0x3687a2(0x16f));_0x42af7e!==_0x3687a2(0x25a)&&(yield E[_0x3687a2(0x210)]());let _0x32d9e4=[];_0x6abf1&&_0x32d9e4[_0x3687a2(0x326)](..._0x6abf1),_0x32d9e4[_0x3687a2(0x326)]({'eventProperty':'Platform','value':_0x1429e4}),_0x32d9e4[_0x3687a2(0x326)]({'eventProperty':'operating-system','value':E[_0x3687a2(0x2cd)]()}),_0x32d9e4['push']({'eventProperty':_0x3687a2(0x22e),'value':E[_0x3687a2(0x26c)]()});let _0x51ec8f=this[_0x3687a2(0x1b9)](),_0x8588df=i(this,R,an)[_0x3687a2(0x252)](this,_0x51ec8f,_0x42af7e,_0x32d9e4);if(typeof _0x8588df==_0x3687a2(0x23f)){s(0x2,_0x8588df);return;}E[_0x3687a2(0x276)]();let {id:_0x7584eb}=_0x51ec8f[_0x42af7e],_0x13ee3b=i(this,R,cn)[_0x3687a2(0x252)](this,z(Ne(z(z(z({},_0x121241?{'campaignCustomerInstanceId':_0x121241}:{}),_0x3738ae?{'campaignId':_0x3738ae}:{}),_0x45ca7c?{'web_optin_instance_id':_0x45ca7c}:{}),{'eventId':_0x7584eb,'eventProperties':_0x8588df,'sessionId':localStorage[_0x3687a2(0x259)]('session')||''}),_0x326831?{'name':_0x326831}:{}));if(g['offline']){let _0x2857d3=JSON[_0x3687a2(0x2dd)](localStorage['getItem'](_0x3687a2(0x27b))||'[]');_0x2857d3['length']<=0x32&&(_0x2857d3[_0x3687a2(0x326)](..._0x13ee3b[_0x3687a2(0x25d)]),localStorage[_0x3687a2(0x1a6)](_0x3687a2(0x27b),JSON['stringify'](_0x2857d3)));return;}let _0x5c7c51=yield this[_0x3687a2(0x1c9)](_0x13ee3b,_0xc7b03);(_0x1661d2=_0x5c7c51==null?void 0x0:_0x5c7c51[_0x3687a2(0x293)])!=null&&_0x1661d2[_0x3687a2(0x244)]?(yield this[_0x3687a2(0x23b)]({'eventName':_0x3687a2(0x226)}),W[_0x3687a2(0x25e)](_0x5c7c51['data']['optIn'])):_0x42af7e===_0x3687a2(0x183)&&(yield this[_0x3687a2(0x23b)]({'eventName':'no_optin','eventProperties':[{'eventProperty':_0x3687a2(0x16c),'value':''+(_0x3687a2(0x2c9)in window&&typeof((_0x3af574=window==null?void 0x0:window[_0x3687a2(0x2c9)])==null?void 0x0:_0x3af574[_0x3687a2(0x1de)])!=_0x3687a2(0x28a))}]})),(_0x48c837=(_0x2e909b=_0x5c7c51==null?void 0x0:_0x5c7c51['data'])==null?void 0x0:_0x2e909b[_0x3687a2(0x2b9)])==null||_0x48c837['forEach'](_0x1c3c08=>{const _0x3de844=_0x3687a2;H[_0x3de844(0x263)](_0x1c3c08[_0x3de844(0x16c)][_0x3de844(0x1e6)])?H[_0x3de844(0x17f)](_0x1c3c08):ae[_0x3de844(0x200)](_0x1c3c08[_0x3de844(0x16c)]['name'])&&ae['showContentCard'](_0x1c3c08);}),L(_0x3687a2(0x1bc),!0x1),C('Recording\x20event',!0x1);}),_0x568f7f=>{const _0x2a487c=_0x383b;this['recordEvent']({'eventName':_0x2a487c(0x19c),'eventProperties':[{'eventProperty':_0x2a487c(0x16c),'value':_0x2a487c(0x25c)+_0xc7b03+_0x2a487c(0x284)+_0x568f7f[_0x2a487c(0x16c)]}]},!0x0);},_0x51a1f2);});},an=function(_0x314c9d,_0x210cad,_0x11f199){const _0x4565a1=_0xc40304;if(!Object[_0x4565a1(0x255)][_0x4565a1(0x1ea)][_0x4565a1(0x252)](_0x314c9d,_0x210cad))return'Event\x20'+_0x210cad+_0x4565a1(0x1f4);if(!_0x11f199)return[];let _0x4ab246=_0x314c9d[_0x210cad];if(!(_0x4ab246!=null&&_0x4ab246['eventProperty']))return _0x4565a1(0x19a)+_0x210cad+'\x20does\x20not\x20have\x20a\x20valid\x20eventProperty.';let _0x3277b3=_0x11f199[_0x4565a1(0x225)](({eventProperty:_0xcaa8f7})=>!Object[_0x4565a1(0x255)][_0x4565a1(0x1ea)][_0x4565a1(0x252)](_0x4ab246[_0x4565a1(0x298)],_0xcaa8f7))[_0x4565a1(0x1af)](({eventProperty:_0x5f90ca})=>_0x5f90ca);return _0x3277b3[_0x4565a1(0x242)]>0x0?_0x4565a1(0x19a)+_0x210cad+_0x4565a1(0x203)+_0x3277b3[_0x4565a1(0x1ec)](',\x20')+'.':_0x11f199[_0x4565a1(0x1af)](({eventProperty:_0x2448f8,value:_0x3f59d0})=>({'eventPropertyId':_0x4ab246['eventProperty'][_0x2448f8]['id'],'value':_0x3f59d0}));},cn=function(_0x3a1c19){const _0xcf436e=_0xc40304;return{'customerId':localStorage['getItem'](_0xcf436e(0x2df))||'','deviceId':localStorage[_0xcf436e(0x259)](_0xcf436e(0x25f))||'','events':[_0x3a1c19]};},ln=function(_0x286fa1){const _0x12e212=_0xc40304;s(0x1,_0x12e212(0x265)),s(0x1,_0x286fa1);let _0x3faf84=localStorage[_0x12e212(0x259)]('preInitializedEvents');_0x3faf84&&_0x3faf84!==_0x12e212(0x28a)?(_0x3faf84=JSON[_0x12e212(0x2dd)](_0x3faf84),_0x3faf84[_0x12e212(0x326)](_0x286fa1)):_0x3faf84=[_0x286fa1],localStorage[_0x12e212(0x1a6)](_0x12e212(0x19b),JSON[_0x12e212(0x185)](_0x3faf84));},dn=function(_0x596a22){const _0x31d066=_0xc40304;let _0x3f9f0e=JSON[_0x31d066(0x2dd)](localStorage['getItem'](_0x31d066(0x19b))||'[]'),_0x1f780f=_0x3f9f0e[_0x31d066(0x295)](_0xdd8a99=>_0xdd8a99[_0x31d066(0x180)]===_0x596a22);_0x1f780f>=0x0&&_0x3f9f0e['splice'](_0x1f780f,0x1),localStorage[_0x31d066(0x1a6)](_0x31d066(0x19b),JSON[_0x31d066(0x185)](_0x3f9f0e));},m(j,X);var ot=j,u=ot[_0xc40304(0x2fb)](),g=class extends Error{constructor(_0x4359bf){const _0x10ac1b=_0xc40304;super(_0x4359bf),this[_0x10ac1b(0x1e6)]='MergnError';}};g[_0xc40304(0x31f)]=!0x1,g[_0xc40304(0x2f4)]=!navigator[_0xc40304(0x294)],g[_0xc40304(0x1ae)]=0x0,g[_0xc40304(0x2b5)]=!0x1,g[_0xc40304(0x186)]=!0x1;var bn=(_0x50ed78,_0x1039a5)=>{const _0x2a3e84=_0xc40304;_0x1039a5 instanceof g?s(0x2,'OriginateFrom:\x20'+_0x50ed78+_0x2a3e84(0x219)+_0x1039a5[_0x2a3e84(0x16c)]):_0x1039a5 instanceof Error?s(0x2,_0x2a3e84(0x2d3)+_0x50ed78+_0x2a3e84(0x18a)+_0x1039a5[_0x2a3e84(0x16c)]):s(0x2,'OriginateFrom:\x20'+_0x50ed78+'\x0aUnexpected\x20error:\x20'+String(_0x1039a5));},A=(_0x30895a,_0x307371,_0x5b8830,_0x591601=!0x1)=>a(void 0x0,null,function*(){const _0x108562=_0xc40304;try{C(_0x30895a,!0x0),L(_0x30895a+_0x108562(0x1bd),!0x0);try{if(g['disableSDK'])throw new g(_0x108562(0x1ed));if(_0x30895a!==_0x108562(0x2f7)&&g[_0x108562(0x2f4)])throw new g(_0x108562(0x2d6));if(_0x30895a!==_0x108562(0x218)&&_0x30895a!==_0x108562(0x1bf)&&_0x30895a!=='record\x20event'&&_0x30895a!==_0x108562(0x301)&&!g[_0x108562(0x2b5)])throw new g(_0x108562(0x1d3));if(_0x30895a!==_0x108562(0x167)&&g['loading'])throw new g('Mergn\x20is\x20loading!');return yield _0x307371();}catch(_0x2bea74){return _0x5b8830?_0x5b8830(_0x2bea74):(g['debugLevel']===0x2||g[_0x108562(0x1ae)]===0x3)&&bn(_0x30895a,_0x2bea74),!_0x591601&&N[_0x108562(0x2c7)]()==='67'&&_0x2bea74[_0x108562(0x16c)]!==_0x108562(0x268)&&u['recordEvent']({'eventName':'Debug\x20Event','eventProperties':[{'eventProperty':_0x108562(0x16c),'value':_0x30895a+'\x20-\x20'+_0x2bea74[_0x108562(0x16c)]}]},!0x0),null;}finally{L(_0x30895a+'\x20Time',!0x1),C(_0x30895a,!0x1);}}catch(_0x666d16){return null;}}),U=(_0x1b986b=>(_0x1b986b[_0x1b986b[_0xc40304(0x1f1)]=0x0]=_0xc40304(0x1f1),_0x1b986b[_0x1b986b['INFO']=0x1]='INFO',_0x1b986b[_0x1b986b['ERROR']=0x2]=_0xc40304(0x2c4),_0x1b986b[_0x1b986b['ALL']=0x3]='ALL',_0x1b986b[_0x1b986b[_0xc40304(0x19d)]=0x4]=_0xc40304(0x19d),_0x1b986b))(U||{}),s=(_0x950ba2,_0x21e8e9)=>{const _0x7580bb=_0xc40304;g[_0x7580bb(0x1ae)]!==0x0&&(g[_0x7580bb(0x1ae)]>=0x3?_0x950ba2===0x1?console['info'](_0x7580bb(0x169)+new Date()[_0x7580bb(0x220)](),_0x21e8e9):_0x950ba2===0x2&&console[_0x7580bb(0x323)]('ERROR:\x20'+new Date()[_0x7580bb(0x220)](),_0x21e8e9):g['debugLevel']===0x1&&_0x950ba2===0x1?console[_0x7580bb(0x26e)](_0x7580bb(0x169)+new Date()[_0x7580bb(0x220)](),_0x21e8e9):g[_0x7580bb(0x1ae)]===0x2&&_0x950ba2===0x2&&console[_0x7580bb(0x323)](_0x7580bb(0x2ad)+new Date()['toISOString'](),_0x21e8e9));},L=(_0x34fcf7,_0x5f2216)=>{const _0x27aa96=_0xc40304;g[_0x27aa96(0x1ae)]!==0x0&&(_0x5f2216?console[_0x27aa96(0x189)](_0x34fcf7):console[_0x27aa96(0x191)](_0x34fcf7));},C=(_0x33e3b0,_0x527352)=>{const _0x8d0ae3=_0xc40304;g[_0x8d0ae3(0x1ae)]!==0x0&&(_0x527352?console[_0x8d0ae3(0x31d)](_0x33e3b0):console[_0x8d0ae3(0x172)]());},pe,ee=class ee{constructor(){}static[_0xc40304(0x2fb)](){return d(ee,pe)||I(ee,pe,new ee()),d(ee,pe);}[_0xc40304(0x218)](_0x187682,_0x4b5105){setTimeout(()=>{const _0x32a2ed=_0x383b;A(_0x32a2ed(0x218),()=>a(this,null,function*(){const _0x2662e8=_0x32a2ed;s(0x1,_0x2662e8(0x2e7)),yield E[_0x2662e8(0x218)](_0x187682,_0x4b5105),u[_0x2662e8(0x23b)]({'eventName':_0x2662e8(0x261)}),s(0x1,_0x2662e8(0x208));let _0x3099ce=JSON[_0x2662e8(0x2dd)](localStorage[_0x2662e8(0x259)]('preInitializedAttributes')||'[]');Array['isArray'](_0x3099ce)&&_0x3099ce[_0x2662e8(0x1f7)]((_0x66e247,_0x479e5e)=>a(this,null,function*(){const _0x58d461=_0x2662e8;yield me[_0x58d461(0x301)](_0x66e247['attributeName'],_0x66e247[_0x58d461(0x256)]),_0x3099ce[_0x58d461(0x2ca)](_0x479e5e,0x1),localStorage[_0x58d461(0x1a6)](_0x58d461(0x28e),JSON[_0x58d461(0x185)](_0x3099ce));})),window[_0x2662e8(0x1d1)](_0x2662e8(0x1ba),()=>a(this,null,function*(){const _0x53887c=_0x2662e8;g['offline']=!0x1;let _0x18ddac=JSON['parse'](localStorage['getItem'](_0x53887c(0x27b))||'[]');Array[_0x53887c(0x2dc)](_0x18ddac)&&(yield u[_0x53887c(0x1c9)]({'customerId':localStorage[_0x53887c(0x259)](_0x53887c(0x2df))||'','deviceId':localStorage[_0x53887c(0x259)](_0x53887c(0x25f))||'','events':_0x18ddac}),localStorage[_0x53887c(0x198)]('offlineEvents')),E[_0x53887c(0x210)](),E[_0x53887c(0x276)]();})),window[_0x2662e8(0x1d1)](_0x2662e8(0x2f4),()=>{const _0x45defa=_0x2662e8;g[_0x45defa(0x2f4)]=!0x0;}),window['addEventListener']('load',()=>{const _0x4de557=_0x2662e8;H[_0x4de557(0x2d8)](),W[_0x4de557(0x307)]();});}));});}[_0xc40304(0x271)](_0x4e1366,_0x1e6b9c){const _0x177409=_0xc40304;if(!(_0x4e1366 in U)){console['error'](_0x177409(0x1bb));return;}g[_0x177409(0x1a4)]=_0x1e6b9c||{},g[_0x177409(0x1ae)]=_0x4e1366;try{W[_0x177409(0x279)]({'debugLevel':_0x4e1366});}catch(_0x5a206e){}}[_0xc40304(0x301)](_0x4bb5d9,_0x19c5b8){return a(this,null,function*(){return new Promise((_0x54a52f,_0x3418a4)=>{setTimeout(()=>a(this,null,function*(){const _0x379b9e=_0x383b;try{yield A(_0x379b9e(0x301),()=>a(this,null,function*(){const _0x3bff4c=_0x379b9e;let _0x6f7f3e;Array[_0x3bff4c(0x2dc)](_0x19c5b8)?_0x6f7f3e=JSON[_0x3bff4c(0x185)](_0x19c5b8):typeof _0x19c5b8=='number'?_0x6f7f3e=''+_0x19c5b8:_0x6f7f3e=_0x19c5b8,s(0x1,_0x3bff4c(0x2e0)),s(0x1,_0x3bff4c(0x314)+_0x4bb5d9+_0x3bff4c(0x27c)+_0x6f7f3e);let _0x1947e1=JSON[_0x3bff4c(0x2dd)](localStorage[_0x3bff4c(0x259)](_0x3bff4c(0x28e))||'[]');_0x1947e1[_0x3bff4c(0x326)]({'attributeName':_0x4bb5d9,'attrValueStringified':_0x6f7f3e}),localStorage[_0x3bff4c(0x1a6)](_0x3bff4c(0x28e),JSON['stringify'](_0x1947e1)),g['isInitialized']&&(yield me[_0x3bff4c(0x301)](_0x4bb5d9,_0x6f7f3e));})),_0x54a52f();}catch(_0x76ffc9){_0x3418a4(_0x76ffc9);}}));});});}[_0xc40304(0x167)](_0x40b6da){return a(this,null,function*(){return new Promise((_0x10452e,_0x349977)=>{setTimeout(()=>a(this,null,function*(){const _0x2608f7=_0x383b;try{yield A(_0x2608f7(0x167),()=>a(this,null,function*(){const _0x3367b2=_0x2608f7;s(0x1,_0x3367b2(0x273)),s(0x1,_0x3367b2(0x16b)+_0x40b6da),g['loading']=!0x0,yield E[_0x3367b2(0x184)](_0x40b6da);})),_0x10452e();}catch(_0x3a221f){_0x349977(_0x3a221f);}finally{g[_0x2608f7(0x186)]=!0x1,yield u[_0x2608f7(0x313)]();}}));});});}[_0xc40304(0x1f2)](){setTimeout(()=>{const _0x374945=_0x383b;A(_0x374945(0x1f2),()=>a(this,null,function*(){const _0x19307f=_0x374945;s(0x1,_0x19307f(0x1a5)),E['clearLocalStorage']();}));});}[_0xc40304(0x26a)](_0x38660e,_0x3c4ada){return a(this,null,function*(){return new Promise((_0x58d151,_0x7d7a1a)=>{setTimeout(()=>a(this,null,function*(){try{yield A('record\x20event',()=>a(this,null,function*(){const _0x3a7b2b=_0x383b;s(0x1,_0x3a7b2b(0x29b)),s(0x1,_0x3a7b2b(0x2ae)+{'eventName':_0x38660e,'eventProperties':_0x3c4ada}),yield u[_0x3a7b2b(0x26a)]({'eventName':_0x38660e,'eventProperties':_0x3c4ada});})),_0x58d151();}catch(_0x5a0e63){_0x7d7a1a(_0x5a0e63);}}));});});}[_0xc40304(0x1e3)](){return vt;}};pe=new WeakMap(),m(ee,pe);var st=ee,at=st[_0xc40304(0x2fb)]();typeof window!=_0xc40304(0x28a)&&(window[_0xc40304(0x24e)]=at);var yn=at;
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ const _0x8a0233=_0x5ea2;(function(_0x2feb25,_0x120a0a){const _0x34c931=_0x5ea2,_0x1910c6=_0x2feb25();while(!![]){try{const _0x1d1f19=-parseInt(_0x34c931(0xf6))/0x1+parseInt(_0x34c931(0x12d))/0x2*(-parseInt(_0x34c931(0x1cf))/0x3)+-parseInt(_0x34c931(0x17b))/0x4+parseInt(_0x34c931(0xdd))/0x5+-parseInt(_0x34c931(0x1ff))/0x6*(parseInt(_0x34c931(0x229))/0x7)+-parseInt(_0x34c931(0x1e5))/0x8*(parseInt(_0x34c931(0x1fe))/0x9)+parseInt(_0x34c931(0x168))/0xa;if(_0x1d1f19===_0x120a0a)break;else _0x1910c6['push'](_0x1910c6['shift']());}catch(_0x2dd3d9){_0x1910c6['push'](_0x1910c6['shift']());}}}(_0x8acf,0xea3bd));function _0x8acf(){const _0x73b2bc=['recordEvent','Web\x20Session\x20Concluded','action','/device/add-device-token','pushMessageToSW','querySelectorAll','scrollHeight','GAD_SOURCE','campaignEntryTime','MSIE','Customer\x20with\x20id\x20','style','close','done','Crawlers','type','Denied\x20Web\x20Push\x20Soft-ask','verifyTTL','OriginateFrom:\x20','optIn','button-2','banner_icon','55631210JXRSUM','recordEventsFromQueue','search','click','SCROLL','call','fixed','onLine','/brand','preInitializedEvents','attributeName','undefined','Popup\x20overlay\x20element\x20found','recordAttribute','/attribute','UTM_TERM','className','recordDebugEventsToggle','removeEventListener','6852984ZvHXDP','SESSION_ID','PushManager','INFO:\x20','Recording\x20event','show_notification_error','SESSION_CREATED','notification_service_not_initialized','match','\x0amax-width:\x20100%;\x0aheight:\x20auto;\x0a','Displayed\x20Web\x20Push\x20Subscription','Popup\x20View','NONE','pushManager','ERROR','setOSVersion','img','/brand/get-time','querySelector','granted',';\x0acursor:\x20pointer;\x0aborder-radius:\x205px;\x0awidth:\x2048%;\x0a','Popup\x20already\x20displayed','banner_image','\x0aUnexpected\x20error:\x20','Mergn\x20SDK\x20Initialized','reject','AbortError','campaignId','isContentCardAction','Recording\x20event\x20Time','web_optin_instance_id','utm_content','events','clearLocalStorage','Viewed\x20Webpage','Mergn\x20not\x20initialized!','\x20is\x20not\x20valid.','Failed\x20to\x20request\x20notification\x20permission','utm_term','subtitle','Error\x20verifying\x20API\x20key','\x0apadding:\x2012px\x2020px;\x0aborder:\x20none;\x0abackground-color:\x20\x20','MergnError','isInteger','storeAttributeInLocalStorage','contentCard_container_','Service\x20Worker\x20registration','important','Event\x20','button_2','Content\x20Card\x20Action','Adding\x20to\x20pre-initialized\x20event:','Popup','createElement','setPreviousUrl','storeEventsAndPropertiesInLocalStorage','notification\x20service','defineProperties','active','group','showAfterScrollAction','syncRealWorldTime','zIndex','Error\x20posting\x20identity\x20data','getPreviousUrl','toLowerCase','substring','getOwnPropertyDescriptors','customer','button-container','hidden','remove','Pushing\x20message\x20to\x20service\x20worker\x20for\x20initialization','Viewed\x20Web\x20Push\x20Soft-ask','optin_data','Cannot\x20add\x20the\x20same\x20private\x20member\x20more\x20than\x20once','Notification','Logging\x20out','forEach','Initializing\x20Notification\x20Service','Service\x20Worker\x20registration\x20is\x20available','Initializing\x20notification\x20service\x20from\x20Base\x20Service','post','Performing\x20viewed\x20web\x20page\x20event','587991leMzCF','getTime','Error\x20setting\x20identity','button-1','ALL','updateSessionCreated','pushToQueue','tracking\x20page\x20change\x20register','preInitializedAttributes','getPlatform','title','Platform','href','Edg','gclid','The\x20user\x20has\x20already\x20enabled\x20notifications.','value','utm_campaign','isPopupAction','os-version','Failed\x20to\x20sync\x20real-world\x20time','identity','16JVpWJd','login','removeItem','No\x20existing\x20subscription\x20found','clearActionInLocalStorage','UTC\x20Date\x20or\x20last\x20sync\x20time\x20is\x20not\x20set','duration','loadPopupEventActionInLocalStorage','Error\x20storing\x20attribute\x20data\x20in\x20local\x20storage','Initial\x20time:\x20','timeEnd','Checking\x20TTL\x20Time','Mergn\x20is\x20offline!','popup_container_','shopify','serviceWorker','\x0amax-width:\x20100%;\x0aheight:\x20auto;\x0adisplay:\x20block;\x0amargin-left:\x20auto;\x0amargin-right:\x20auto;\x0aborder-radius:\x2010px;\x0amax-width:\x20350px;\x0aaspect-ratio:\x202\x20/\x201;\x0a','mergn_init','Service\x20Worker\x20and\x20Push\x20Manager\x20are\x20supported','updateAPIKey','length','apiKey','submit','getInstance','loadActionInLocalStorage','5025843iCUhsa','18TgXXBJ','UTM_CONTENT','get','width','textContent','verifyAPIKey\x20-\x20','error','backgroundColor','\x20Time','Microsoft\x20Edge','name:\x20','campaignEntryTimeValue','innerHeight','getBrandId','form','Debug\x20Event','.u-popup-container\x20img','banner_title','join','banner_text','addEventListener','Campaign\x20Id','attributes','queue','splice','pop','Already\x20Registered\x20To\x20Web\x20Push','\x20-\x20\x20','push','\x0amargin-bottom:\x205px;\x0afont-size:\x2013px;\x0acolor:\x20',',\x20Attribute\x20Value:\x20','Error\x20posting\x20attribute\x20record','get\x20-\x20','already_registered','getCurrentUTCDate','then','\x0awidth:\x2073%;\x0amargin-left:\x202%;\x0a','Checking\x20notification\x20permission:\x20','Verifying\x20API\x20Key\x20after\x20timeout','IMMEDIATELY','has','attributeValue','1916103ZfnHVs','map','\x20has\x20invalid\x20eventProperties:\x20','cssText','requestPermission','beforeunload','lastSyncTime','POST','load','Error\x20posting\x20event\x20record:','view','Attribute\x20value\x20is\x20required','location','startsWith','overflow','\x0amargin-bottom:\x205px;\x0afont-size:\x2016px;\x0acolor:\x20','User\x20denied\x20the\x20notification\x20permission.','Safari','denied','Error\x20posting\x20event\x20record','Reachability\x20Push\x20Web','success',';\x0acolor:\x20','showNotification','string','postEventRecord','content_card','\x20-\x20','pre_vwp','ERROR:\x20','indexOf','Service\x20Worker\x20ready','\x0aMergnError:\x20','\x20does\x20not\x20have\x20a\x20valid\x20attributeProperty.','Event\x20Payload:\x0a\x20','uniqueIdentity','next','Notification\x20service\x20is\x20not\x20initialized','Checking\x20for\x20existing\x20subscription','Failed\x20to\x20fetch','Mergn\x20SDK\x20is\x20disabled!','debugLevel','getStoredEvents','storeActionInLocalStorageInternal','catch','auto','button_1','add','button','getOSVersion','json','recordEventPreInitialized','color','appendChild','Recording\x20attribute\x20Time','pathname','99999999','Service\x20Worker\x20registration\x20failed:','div','Attribute\x20','recordDebugEvents','display','Debug\x20level\x20must\x20be\x20according\x20to:\x0a\x20NONE:\x200,\x20INFO:\x201,\x20ERROR:\x202,\x20ALL:\x203','storeActionInLocalStorage','Form\x20Submit','Firefox','removeAttribute','scroll','parse','check_permission','Image\x20Click','block','Failed\x20to\x20check\x20notification\x20permission','/event','message:\x20','info','init_condition','User\x20closed\x20the\x20notification\x20permission\x20dialog.','divId','attributeProperty','viewed','resolve','ContentCard\x20already\x20displayed','utm_source','scrollY','/record-event','gad_source','hasOwnProperty','documentElement','loading','Current\x20time:\x20','Popup\x20Action','Re\x20initializing\x20customer\x20Id','Turned\x20Off\x20Notification\x20Reset\x20Permission','Time\x20difference:\x20','entry_time_value','Failed\x20to\x20load','.u-popup-overlay','entry_time','campaignCustomerInstanceId','\x20has\x20invalid\x20attributeProperties:\x20','defineProperty','setDebugLevel','\x0adisplay:\x20flex;\x0aflex-wrap:\x20wrap;\x0amargin-bottom:\x2010px;\x0a','ContentCard\x20already\x20in\x20cache','existing_subscription','init','record\x20event\x20-\x20','#\x20check\x20TTL','time','mergn_shopify','Image','1.0.121','entries','banner_design','getOperatingSystem','TypeError','no_optin','getAttribute','mergn','Recording\x20attribute','showPopup','ContentCard','subscribed','User\x20granted\x20the\x20notification\x20permission.','test','checkTTL','Error\x20fetching\x20event\x20data','4581930NSFKHL','Cannot\x20','offlineEvents','set','Notification\x20permission:\x20','Not\x20initializing\x20base\x20service\x20for\x20crawlers\x20or\x20unknown\x20platforms','UTM_CAMPAIGN','/v2','[id^=\x22u_content_button_\x22]','put','unsubscribe','body','.u-close-button','filter','throw','number','getSubscription','values','min','groupEnd','online','showDelayedAction','userAgent','findIndex','Error\x20fetching\x20attribute\x20data','1672802ysnmsC','/mergn-sw.js','Web\x20Session\x20Started','banner_color','setPlatform','FBCLID','toString','DEBUG','DELAY','Mozilla\x20Firefox','Button\x20Click','UTCDate','getOwnPropertySymbols','offline','register','mergnWebPushPopup','campaigns','/customer','bind','vwp_error','isArray','Chrome','Web','initialTime','keys','INFO','mergn-row','Attribute\x20Payload:\x0a\x20','position','Initializing\x20base\x20service','fbclid','default','[id^=\x22u_content_form_\x22]','loadWebPushActionInLocalStorage','alt','verify\x20API\x20key','getItem','text','randomUUID','setOperatingSystem','data','base_init','access\x20private\x20method','Checking\x20TTL','src','mergn-overlay','setItem','User\x20is\x20subscribed','getRegistrations','UTM_MEDIUM','read\x20from\x20private\x20field','setIdentity','innerHTML','Notification\x20already\x20in\x20cache','setProperty','2pbMuvX','name','/set-attribute','two_step','getVersion','ttl','prototype','top','disableSDK','web_push_action','Content\x20Card\x20Click','No\x20events\x20to\x20record','eventName','permission','100%','should_set_identity','Unknown','getElementById','stringify','session','pushState','record\x20event','post\x20-\x20','push_manager','toISOString','application/json','brandId','message','fetchEventData','GCLID','logout','Identity:\x20','showContentCard','isInitialized','notification_permission_error','eventProperty','fetchAttributeData'];_0x8acf=function(){return _0x73b2bc;};return _0x8acf();}var ln=Object[_0x8a0233(0xc2)],dn=Object[_0x8a0233(0x1b4)],un=Object[_0x8a0233(0x1be)],ut=Object[_0x8a0233(0x102)],pn=Object['prototype'][_0x8a0233(0xb4)],gn=Object['prototype']['propertyIsEnumerable'],gt=_0x1f704f=>{throw TypeError(_0x1f704f);},pt=(_0x3b0d86,_0x736383,_0x2058fe)=>_0x736383 in _0x3b0d86?ln(_0x3b0d86,_0x736383,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x2058fe}):_0x3b0d86[_0x736383]=_0x2058fe,z=(_0x9d7e5a,_0x178587)=>{const _0x326a05=_0x8a0233;for(var _0x49c028 in _0x178587||(_0x178587={}))pn[_0x326a05(0x16d)](_0x178587,_0x49c028)&&pt(_0x9d7e5a,_0x49c028,_0x178587[_0x49c028]);if(ut){for(var _0x49c028 of ut(_0x178587))gn[_0x326a05(0x16d)](_0x178587,_0x49c028)&&pt(_0x9d7e5a,_0x49c028,_0x178587[_0x49c028]);}return _0x9d7e5a;},Pe=(_0x46c5da,_0x3f8354)=>dn(_0x46c5da,un(_0x3f8354)),We=(_0x308d9a,_0x43d2c0,_0x11c926)=>_0x43d2c0['has'](_0x308d9a)||gt(_0x8a0233(0xde)+_0x11c926),d=(_0x3520f3,_0x1a1c95,_0x4ea457)=>(We(_0x3520f3,_0x1a1c95,_0x8a0233(0x128)),_0x4ea457?_0x4ea457['call'](_0x3520f3):_0x1a1c95['get'](_0x3520f3)),m=(_0x247c29,_0x13b4ff,_0x483fc4)=>_0x13b4ff[_0x8a0233(0x227)](_0x247c29)?gt(_0x8a0233(0x1c6)):_0x13b4ff instanceof WeakSet?_0x13b4ff[_0x8a0233(0x8c)](_0x247c29):_0x13b4ff[_0x8a0233(0xe0)](_0x247c29,_0x483fc4),I=(_0x74fe86,_0x16dd7e,_0x220993,_0x2e7b50)=>(We(_0x74fe86,_0x16dd7e,'write\x20to\x20private\x20field'),_0x2e7b50?_0x2e7b50['call'](_0x74fe86,_0x220993):_0x16dd7e[_0x8a0233(0xe0)](_0x74fe86,_0x220993),_0x220993),i=(_0x4e8952,_0x91be75,_0x4eabcd)=>(We(_0x4e8952,_0x91be75,_0x8a0233(0x120)),_0x4eabcd),a=(_0x5b01cd,_0x182ef8,_0x14ea59)=>new Promise((_0x166d82,_0x228d13)=>{const _0x105a0a=_0x8a0233;var _0x6daa89=_0x4b1aab=>{const _0x288597=_0x5ea2;try{_0x5cec61(_0x14ea59[_0x288597(0x81)](_0x4b1aab));}catch(_0x553335){_0x228d13(_0x553335);}},_0x2a0e18=_0x10fc97=>{const _0x286276=_0x5ea2;try{_0x5cec61(_0x14ea59[_0x286276(0xeb)](_0x10fc97));}catch(_0x30f600){_0x228d13(_0x30f600);}},_0x5cec61=_0x52be24=>_0x52be24[_0x105a0a(0x15f)]?_0x166d82(_0x52be24[_0x105a0a(0x1df)]):Promise[_0x105a0a(0xae)](_0x52be24[_0x105a0a(0x1df)])[_0x105a0a(0x222)](_0x6daa89,_0x2a0e18);_0x5cec61((_0x14ea59=_0x14ea59['apply'](_0x5b01cd,_0x182ef8))[_0x105a0a(0x81)]());}),mt=_0x8a0233(0xcd),ge='https://u23z4zsda8.execute-api.ap-southeast-1.amazonaws.com/Prod/sdk-management/api',ke=_0x8a0233(0x176),Et=_0x8a0233(0x12f),Fe=_0x8a0233(0xa6),vt=_0x8a0233(0xb2),It=_0x8a0233(0x107),St=_0x8a0233(0x155),ft='/set-identity',ht='/brand/get-web-push-public-key',bt=_0x8a0233(0x18c),yt=(_0x2c0ecf=>(_0x2c0ecf['UTM_SOURCE']=_0x8a0233(0xb0),_0x2c0ecf[_0x8a0233(0x127)]='utm_medium',_0x2c0ecf[_0x8a0233(0xe3)]=_0x8a0233(0x1e0),_0x2c0ecf[_0x8a0233(0x177)]=_0x8a0233(0x1a1),_0x2c0ecf[_0x8a0233(0x200)]=_0x8a0233(0x19a),_0x2c0ecf[_0x8a0233(0x159)]=_0x8a0233(0xb3),_0x2c0ecf[_0x8a0233(0x14a)]=_0x8a0233(0x1dd),_0x2c0ecf[_0x8a0233(0xfb)]=_0x8a0233(0x114),_0x2c0ecf))(yt||{}),wt=new Set(Object[_0x8a0233(0xee)](yt)),te=_0x8a0233(0xb8),re,$,ne,w=class w{constructor(){m(this,$);}static[_0x8a0233(0x1fc)](){return d(w,re)||I(w,re,new w()),d(w,re);}[_0x8a0233(0x1f8)](_0x474561){const _0x3d5865=_0x8a0233;w['apiKey']=_0x474561;let _0x3dbe88=_0x474561,_0x453a32=/m(\d+)rgn/,_0x47ce61=_0x3dbe88[_0x3d5865(0x183)](_0x453a32);_0x47ce61&&(w[_0x3d5865(0x147)]=_0x47ce61[0x1]);}['getAPIKey'](){const _0x3b3cd9=_0x8a0233;return w[_0x3b3cd9(0x1fa)];}[_0x8a0233(0x20c)](){return w['brandId'];}['get'](_0x70cbce){return a(this,null,function*(){const _0x4a8f5c=_0x5ea2;try{return(yield fetch(ge+_0x70cbce,{'headers':{'Authorization':i(this,$,ne)[_0x4a8f5c(0x16d)](this,w[_0x4a8f5c(0x1fa)]),'Content-Type':_0x4a8f5c(0x146)}}))[_0x4a8f5c(0x8f)]();}catch(_0x4df877){let _0x168f12=_0x4df877['message'];return this[_0x4a8f5c(0x20c)]()==='67'&&_0x168f12!==_0x4a8f5c(0x84)&&_0x168f12!==_0x4a8f5c(0xbd)&&u['recordEvent']({'eventName':'Debug\x20Event','eventProperties':[{'eventProperty':_0x4a8f5c(0x148),'value':_0x4a8f5c(0x21f)+_0x70cbce+_0x4a8f5c(0x244)+i(this,$,ne)['call'](this,w['apiKey'])+_0x4a8f5c(0x21a)+_0x4df877['message']}]},!0x0),Promise[_0x4a8f5c(0x194)](_0x4df877);}});}[_0x8a0233(0x1cd)](_0x38ab41,_0x47d3aa,_0x1086df){return a(this,null,function*(){const _0x29af48=_0x5ea2;try{return(yield fetch(ge+_0x38ab41,{'body':JSON['stringify'](_0x47d3aa||{}),'headers':{'Authorization':i(this,$,ne)[_0x29af48(0x16d)](this,w[_0x29af48(0x1fa)]),'Content-Type':_0x29af48(0x146)},'method':_0x29af48(0x230),'signal':_0x1086df}))[_0x29af48(0x8f)]();}catch(_0x42bd13){let _0x5e0336=_0x42bd13[_0x29af48(0x148)];return this[_0x29af48(0x20c)]()==='67'&&_0x5e0336!==_0x29af48(0x84)&&_0x5e0336!==_0x29af48(0xbd)&&u[_0x29af48(0x152)]({'eventName':_0x29af48(0x20e),'eventProperties':[{'eventProperty':'message','value':_0x29af48(0x143)+_0x38ab41+_0x29af48(0x244)+i(this,$,ne)[_0x29af48(0x16d)](this,w[_0x29af48(0x1fa)])+'\x20-\x20'+JSON[_0x29af48(0x13f)](_0x47d3aa||{})+'\x20-'+_0x42bd13['message']}]},!0x0),Promise['reject'](_0x42bd13);}});}[_0x8a0233(0xe6)](_0x4ad0f2,_0x537f88){return a(this,null,function*(){const _0x23cb8e=_0x5ea2;return(yield fetch(ge+_0x4ad0f2,{'body':JSON[_0x23cb8e(0x13f)](_0x537f88||{}),'headers':{'Authorization':i(this,$,ne)['call'](this,w['apiKey']),'Content-Type':'application/json'},'method':'PUT'}))[_0x23cb8e(0x8f)]();});}[_0x8a0233(0x1b8)](){return a(this,null,function*(){const _0x3af2d2=_0x5ea2;try{let _0x569555=(yield(yield fetch(ge+bt))[_0x3af2d2(0x8f)]())[_0x3af2d2(0x11e)];w[_0x3af2d2(0x101)]=new Date(_0x569555),w[_0x3af2d2(0x22f)]=new Date();}catch(_0x126f49){s(0x2,_0x3af2d2(0x1e3));}});}[_0x8a0233(0x221)](){const _0x2e0869=_0x8a0233;if(!w['UTCDate']||!w['lastSyncTime'])return s(0x2,_0x2e0869(0x1ea)),new Date();let _0x2c4948=new Date()[_0x2e0869(0x1d0)]()-w[_0x2e0869(0x22f)][_0x2e0869(0x1d0)]();return new Date(w['UTCDate'][_0x2e0869(0x1d0)]()+_0x2c4948);}};re=new WeakMap(),$=new WeakSet(),ne=function(_0x1b3d91){const _0x131b24=_0x8a0233;return btoa(_0x1b3d91+':'+new Date()[_0x131b24(0x1d0)]());},m(w,re);var Be=w,N=Be['getInstance'](),G,ie,x,Tt,$e,Pt,Nt,V=class V{constructor(){m(this,x),m(this,ie,!0x1);}static[_0x8a0233(0x1fc)](){const _0x51fc8c=_0x8a0233;var _0x399307;return d(V,G)||(I(V,G,new V()),i(_0x399307=d(V,G),x,Tt)[_0x51fc8c(0x16d)](_0x399307)),d(V,G);}[_0x8a0233(0x175)](_0x5151e2,_0x1864b0,_0x264081){return a(this,null,function*(){yield A('#\x20recordAttribute',()=>a(this,null,function*(){const _0x3fcae4=_0x5ea2;if(s(0x1,_0x3fcae4(0xd5)),C('Recording\x20attribute',!0x0),L(_0x3fcae4(0x93),!0x0),s(0x1,_0x3fcae4(0x111)+{'attributeName':_0x5151e2,'attributeProperties':_0x264081,'attributeValue':_0x1864b0}+')}'),!_0x1864b0||_0x1864b0===''){s(0x2,_0x3fcae4(0x234));return;}yield E[_0x3fcae4(0xdb)](),yield i(this,x,Pt)[_0x3fcae4(0x16d)](this);let _0x1b07d1=JSON[_0x3fcae4(0xa1)](localStorage['getItem']('attributes')||'{}'),_0x407738=_0x264081?i(this,x,$e)[_0x3fcae4(0x16d)](this,_0x1b07d1,_0x5151e2,_0x264081):i(this,x,$e)[_0x3fcae4(0x16d)](this,_0x1b07d1,_0x5151e2);if(typeof _0x407738==_0x3fcae4(0x241)){s(0x2,_0x407738);return;}_0x1b07d1[_0x5151e2][_0x3fcae4(0x13c)]&&(yield E[_0x3fcae4(0x129)](typeof _0x1864b0==_0x3fcae4(0x241)?_0x1864b0:JSON[_0x3fcae4(0x13f)](_0x1864b0))),E[_0x3fcae4(0x1d4)]();let {id:_0x4d1b45}=_0x1b07d1[_0x5151e2],_0x3f46e3={'attributeId':_0x4d1b45,'attributeProperties':_0x407738,'customerId':localStorage['getItem']('customer')||'','value':_0x1864b0};yield i(this,x,Nt)['call'](this,_0x3f46e3);let _0x5cc196=JSON[_0x3fcae4(0xa1)](localStorage['getItem']('preInitializedAttributes')||'[]');_0x5cc196[_0x3fcae4(0x218)](),localStorage['setItem'](_0x3fcae4(0x1d7),JSON[_0x3fcae4(0x13f)](_0x5cc196)),L(_0x3fcae4(0x93),!0x1),C('Recording\x20attribute',!0x1);}));});}[_0x8a0233(0x1a7)](){return a(this,null,function*(){const _0x188016=_0x5ea2;if(!localStorage[_0x188016(0x11a)](_0x188016(0x215))&&!d(this,ie)){I(this,ie,!0x0);try{let _0x504578=(yield this[_0x188016(0x151)]())['data'];_0x504578&&localStorage['setItem']('attributes',JSON[_0x188016(0x13f)](_0x504578));}catch(_0x3bfe5c){throw new Error(_0x188016(0x1ed));}finally{I(this,ie,!0x1);}}});}[_0x8a0233(0x151)](){return a(this,null,function*(){const _0x6709be=_0x5ea2;try{return yield N[_0x6709be(0x201)](''+ke);}catch(_0x212621){throw new Error(_0x6709be(0xf5));}});}};G=new WeakMap(),ie=new WeakMap(),x=new WeakSet(),Tt=function(){return a(this,null,function*(){});},$e=function(_0x21a40a,_0x4c41c3,_0x4a99a7){const _0x5e340e=_0x8a0233;if(!Object[_0x5e340e(0x133)]['hasOwnProperty']['call'](_0x21a40a,_0x4c41c3))return _0x5e340e(0x98)+_0x4c41c3+_0x5e340e(0x19f);if(!_0x4a99a7)return[];let _0x200e17=_0x21a40a[_0x4c41c3];if(!(_0x200e17!=null&&_0x200e17['attributeProperty']))return _0x5e340e(0x98)+_0x4c41c3+_0x5e340e(0x7e);let _0x32b20e=_0x4a99a7[_0x5e340e(0xea)](({attributeProperty:_0x325178})=>!Object[_0x5e340e(0x133)]['hasOwnProperty'][_0x5e340e(0x16d)](_0x200e17[_0x5e340e(0xac)],_0x325178))['map'](({attributeProperty:_0x815d8b})=>_0x815d8b);return _0x32b20e[_0x5e340e(0x1f9)]>0x0?_0x5e340e(0x98)+_0x4c41c3+_0x5e340e(0xc1)+_0x32b20e[_0x5e340e(0x211)](',\x20')+'.':_0x4a99a7[_0x5e340e(0x22a)](({attributeProperty:_0x36eb31,value:_0xbc90e6})=>({'attributePropertyId':_0x200e17[_0x5e340e(0xac)][_0x36eb31]['id'],'value':_0xbc90e6}));},Pt=function(){return a(this,null,function*(){const _0x2a373b=_0x5ea2;localStorage[_0x2a373b(0x11a)](_0x2a373b(0x215))||(yield this['storeAttributeInLocalStorage']());});},Nt=function(_0x176565){return a(this,null,function*(){const _0x2232e4=_0x5ea2;try{return yield N[_0x2232e4(0x1cd)](''+ke+Et,_0x176565);}catch(_0x5aa060){throw new Error(_0x2232e4(0x21e));}});},m(V,G);var Me=V,me=Me[_0x8a0233(0x1fc)](),Ve=_0x8a0233(0x1ad),Y,T,At,Je,Rt,Ot,se,Ne,Lt,Ct,Dt,_e,K=class K{constructor(){m(this,T),m(this,se,_0x40cb49=>{const _0x14c54e=_0x5ea2;E['clearActionInLocalStorage']({'id':_0x40cb49,'localStorageKey':_0x14c54e(0x154)});}),this['loadContentCardEventActionInLocalStorage']=()=>{const _0x1fdd01=_0x5ea2;E[_0x1fdd01(0x1fd)]({'actionCondition':_0x39218f=>_0x39218f[_0x1fdd01(0x148)][_0x1fdd01(0x12e)]===_0x1fdd01(0xd7),'actionMethod':_0x4cb62b=>i(this,T,Je)[_0x1fdd01(0x16d)](this,_0x4cb62b['campaignId']),'localStorageKey':_0x1fdd01(0x154)});},m(this,_e,()=>{const _0x341a22=_0x5ea2;E[_0x341a22(0x88)](_0x341a22(0x154));});}static['getInstance'](){const _0x129977=_0x8a0233;var _0x252232;return d(K,Y)||(I(K,Y,new K()),i(_0x252232=d(K,Y),T,At)[_0x129977(0x16d)](_0x252232)),d(K,Y);}[_0x8a0233(0x14d)](_0x69e667){const _0x4122b6=_0x8a0233;let _0x256ffe=JSON[_0x4122b6(0xa1)](localStorage[_0x4122b6(0x11a)](_0x4122b6(0x154))||'{}');if(_0x256ffe&&_0x256ffe[_0x69e667==null?void 0x0:_0x69e667[_0x4122b6(0x196)]]){s(0x1,_0x4122b6(0xc5));return;}i(this,T,Dt)['call'](this,_0x69e667),d(this,_e)[_0x4122b6(0x16d)](this),i(this,T,Je)[_0x4122b6(0x16d)](this,_0x69e667[_0x4122b6(0x196)]);}['isContentCardAction'](_0x13d3ca){const _0x4bf2f9=_0x8a0233;return _0x13d3ca===_0x4bf2f9(0x243);}};Y=new WeakMap(),T=new WeakSet(),At=function(){return a(this,null,function*(){});},Je=function(_0x44399f){const _0x359805=_0x8a0233;let _0x892e91=i(this,T,Rt)['call'](this);if(document[_0x359805(0x13e)](_0x359805(0x1a8)+_0x44399f)){s(0x1,'ContentCard\x20already\x20displayed'),d(this,se)[_0x359805(0x16d)](this,_0x44399f);return;}if(_0x892e91!=null&&_0x892e91[_0x44399f])switch(_0x892e91[_0x44399f][_0x359805(0x15a)]){case _0x359805(0xfe):{i(this,T,Ot)[_0x359805(0x16d)](this,_0x892e91[_0x44399f]);break;}case'IMMEDIATELY':{i(this,T,Ne)[_0x359805(0x16d)](this,_0x892e91[_0x44399f]);break;}case _0x359805(0x16c):{i(this,T,Ct)[_0x359805(0x16d)](this,_0x892e91[_0x44399f]);break;}default:return;}},Rt=function(){const _0x4d829b=_0x8a0233;let _0x332572=localStorage[_0x4d829b(0x11a)]('action');return _0x332572?JSON[_0x4d829b(0xa1)](_0x332572):null;},Ot=function(_0x55623c){const _0xba8cc4=_0x8a0233;E['showDelayedAction']({'clearActionMethod':d(this,se)[_0xba8cc4(0x108)](this),'data':_0x55623c,'displayMethod':i(this,T,Ne)[_0xba8cc4(0x108)](this),'idKey':_0xba8cc4(0x196),'timeValueKey':'campaignEntryTimeValue'});},se=new WeakMap(),Ne=function(_0x211118){const _0x353ff3=_0x8a0233;var _0x41cad8;if(document['getElementById']('contentCard_container_'+_0x211118[_0x353ff3(0x196)]))s(0x1,_0x353ff3(0xaf));else{let _0x44446f=i(this,T,Lt)[_0x353ff3(0x16d)](this,_0x353ff3(0x97),_0x211118),_0x42b459=document[_0x353ff3(0x18d)]('#'+_0x211118['message'][_0x353ff3(0xab)]);_0x42b459&&(_0x42b459[_0x353ff3(0x12a)]=_0x44446f['outerHTML'],u[_0x353ff3(0x152)]({'campaignCustomerInstanceId':_0x211118[_0x353ff3(0xc0)],'campaignId':_0x211118[_0x353ff3(0x196)],'eventName':Ve,'eventProperties':[{'eventProperty':'Content\x20Card\x20View','value':JSON['stringify']({'campaignId':_0x211118[_0x353ff3(0x196)]})}],'name':_0x353ff3(0x233)}),(_0x41cad8=document[_0x353ff3(0x13e)](_0x353ff3(0x1a8)+_0x211118[_0x353ff3(0x196)]))==null||_0x41cad8[_0x353ff3(0x213)](_0x353ff3(0x16b),()=>{const _0x749673=_0x353ff3;u['recordEvent']({'campaignCustomerInstanceId':_0x211118[_0x749673(0xc0)],'campaignId':_0x211118['campaignId'],'eventName':Ve,'eventProperties':[{'eventProperty':_0x749673(0x137),'value':JSON[_0x749673(0x13f)]({'campaignId':_0x211118['campaignId']})}],'name':_0x749673(0x16b)});}));}d(this,se)[_0x353ff3(0x16d)](this,_0x211118[_0x353ff3(0x196)]);},Lt=function(_0x386df8,_0x422c2c){const _0x384fdf=_0x8a0233;var _0x592cf9;let {campaignId:_0x4832f5,message:{design:_0xb1133c}}=_0x422c2c,_0x12c0b8=document[_0x384fdf(0x1b0)](_0x386df8);return _0x12c0b8['id']='contentCard_container_'+_0x4832f5,_0x12c0b8['innerHTML']=_0xb1133c,(_0x592cf9=_0x12c0b8[_0x384fdf(0x18d)](_0x384fdf(0xe9)))==null||_0x592cf9[_0x384fdf(0x1c2)](),_0x12c0b8;},Ct=function(_0x5d35e3){const _0x3dec28=_0x8a0233;E['showAfterScrollAction']({'data':_0x5d35e3,'displayMethod':i(this,T,Ne)['bind'](this),'timeValueKey':_0x3dec28(0x20a)});},Dt=function(_0x25137e){const _0xf10527=_0x8a0233;E[_0xf10527(0x9c)](_0x25137e,'action',_0xf10527(0x196));},_e=new WeakMap(),m(K,Y);var Ke=K,ae=Ke['getInstance'](),ce,B,le,q,Ee,ve,S,je,Ut,ze,Ae,xt,Le,Re,Ge,Wt,Oe,Ie,kt,f=class f{constructor(){const _0x4a4f53=_0x8a0233;m(this,S),this[_0x4a4f53(0x13a)]=null,this[_0x4a4f53(0x156)]=_0x42bfa2=>{const _0x30cda0=_0x4a4f53;s(0x1,'Pushing\x20message\x20to\x20service\x20worker'),navigator[_0x30cda0(0x1f4)][_0x30cda0(0x126)]()[_0x30cda0(0x222)](_0x4a01c3=>{const _0x34e612=_0x30cda0;var _0x540d2d,_0x2dfa1a;s(0x1,_0x34e612(0x1a9)),(_0x540d2d=_0x4a01c3[0x0])!=null&&_0x540d2d['active']&&(s(0x1,_0x34e612(0x7c)),(_0x2dfa1a=_0x4a01c3[0x0][_0x34e612(0x1b5)])==null||_0x2dfa1a['postMessage'](JSON[_0x34e612(0x13f)](_0x42bfa2)));})[_0x30cda0(0x89)](_0x265319=>{s(0x2,'Failed\x20to\x20push\x20message\x20to\x20service\x20worker:\x20'+_0x265319['message']);});},this['loadWebPushActionInLocalStorage']=()=>{const _0x285ef9=_0x4a4f53;E[_0x285ef9(0x1fd)]({'actionCondition':()=>!0x0,'actionMethod':_0x2a52aa=>i(this,S,Re)[_0x285ef9(0x16d)](this,Number(_0x2a52aa[_0x285ef9(0x199)])),'localStorageKey':_0x285ef9(0x136)});},m(this,Le,()=>{const _0x2de34a=_0x4a4f53;E[_0x2de34a(0x88)](_0x2de34a(0x136));}),m(this,Ie,_0x367a60=>{const _0x3040bb=_0x4a4f53;E[_0x3040bb(0x1e9)]({'id':_0x367a60,'localStorageKey':_0x3040bb(0x136)});});}static[_0x8a0233(0x1fc)](){return d(f,ce)||I(f,ce,new f()),d(f,ce);}['init'](_0x553989,_0x5ba42a){return a(this,null,function*(){const _0x42ebe9=_0x5ea2;var _0x35c002;if(s(0x1,_0x42ebe9(0x1ca)),u[_0x42ebe9(0x99)]({'eventName':_0x42ebe9(0xc7),'eventProperties':[{'eventProperty':'service_worker','value':_0x42ebe9(0x1f4)in navigator},{'eventProperty':_0x42ebe9(0x144),'value':_0x42ebe9(0x17d)in window}]}),'serviceWorker'in navigator&&_0x42ebe9(0x17d)in window){s(0x1,_0x42ebe9(0x1f7));try{u['recordDebugEvents']({'eventName':_0x42ebe9(0xa9)}),I(f,B,yield navigator['serviceWorker'][_0x42ebe9(0x104)](_0x5ba42a||_0x42ebe9(0xf7))),s(0x1,'Service\x20Worker\x20registered'),s(0x1,_0x42ebe9(0x1c3)),this[_0x42ebe9(0x156)]({'customer':localStorage['getItem']('customer')||'','events':u[_0x42ebe9(0x87)](),'API_KEY':N['getAPIKey'](),'device_id':localStorage['getItem'](_0x42ebe9(0x80))||'','operatingSystem':E[_0x42ebe9(0xd0)](),'osVersion':E[_0x42ebe9(0x8e)](),'Platform':E[_0x42ebe9(0x1d8)]()}),I(f,Ee,!0x0);let _0x2e49e5=i(this,S,Ge)[_0x42ebe9(0x16d)](this),_0x1be87f=Object['keys'](_0x2e49e5||{});if(_0x1be87f['length']&&i(this,S,Re)[_0x42ebe9(0x16d)](this,Number(_0x1be87f[0x0])),!_0x553989)return;let _0x17aecb=yield(_0x35c002=d(f,B))==null?void 0x0:_0x35c002[_0x42ebe9(0x188)][_0x42ebe9(0xed)]();s(0x1,_0x42ebe9(0x83)),d(f,B)&&(s(0x1,_0x42ebe9(0x1cb)),d(f,B)['update']()),_0x17aecb?(s(0x1,'Existing\x20subscription\x20found'),u[_0x42ebe9(0x99)]({'eventName':_0x42ebe9(0xc6)}),yield i(this,S,Ae)[_0x42ebe9(0x16d)](this),I(f,le,!0x0)):(s(0x1,_0x42ebe9(0x1e8)),yield i(this,S,je)['call'](this,d(f,ve)||void 0x0));}catch(_0x333494){let _0x59b004=_0x333494&&_0x333494[_0x42ebe9(0x148)]?_0x333494[_0x42ebe9(0x148)][_0x42ebe9(0x1bd)](0x0,0x64):_0x42ebe9(0x173);yield u[_0x42ebe9(0x99)]({'eventName':_0x42ebe9(0x23d),'eventProperties':[{'eventProperty':'message','value':''+_0x59b004}]}),s(0x2,_0x42ebe9(0x96)),s(0x2,_0x59b004);}}});}[_0x8a0233(0x240)](_0x5a3580){const _0x52c5c3=_0x8a0233;if(!d(f,Ee)){I(f,ve,_0x5a3580),u['recordDebugEvents']({'eventName':_0x52c5c3(0x182)}),s(0x2,_0x52c5c3(0x82));return;}A('showNotification',()=>a(this,null,function*(){const _0x5835f8=_0x52c5c3;let _0x4bdcda=JSON[_0x5835f8(0xa1)](localStorage[_0x5835f8(0x11a)](_0x5835f8(0x136))||'{}');if(_0x4bdcda&&_0x4bdcda[_0x5a3580[_0x5835f8(0x199)]]){s(0x1,_0x5835f8(0x12b));return;}i(this,S,xt)[_0x5835f8(0x16d)](this,_0x5a3580),d(this,Le)[_0x5835f8(0x16d)](this),i(this,S,Re)[_0x5835f8(0x16d)](this,_0x5a3580[_0x5835f8(0x199)]);}));}};ce=new WeakMap(),B=new WeakMap(),le=new WeakMap(),q=new WeakMap(),Ee=new WeakMap(),ve=new WeakMap(),S=new WeakSet(),je=function(_0x1764db){return a(this,null,function*(){const _0x23ff56=_0x5ea2;s(0x1,_0x23ff56(0x224)+JSON[_0x23ff56(0x13f)](_0x1764db)+'\x20'),u['recordDebugEvents']({'eventName':_0x23ff56(0xa2)});let _0x3a247c;try{_0x3a247c=Notification[_0x23ff56(0x13a)],_0x3a247c&&(s(0x1,_0x23ff56(0xe1)+_0x3a247c),_0x3a247c===_0x23ff56(0x115)?(_0x1764db||(this[_0x23ff56(0x13a)]=_0x23ff56(0x115),u[_0x23ff56(0x99)]({'eventName':_0x23ff56(0xba)})),_0x1764db&&(u[_0x23ff56(0x99)]({'eventName':'notification_data','eventProperties':[{'eventProperty':_0x23ff56(0x161),'value':''+(_0x1764db==null?void 0x0:_0x1764db[_0x23ff56(0x161)])}]}),d(this,Ie)[_0x23ff56(0x16d)](this,_0x1764db[_0x23ff56(0x199)]),_0x1764db['type']===_0x23ff56(0x130)?i(this,S,Ut)['call'](this,_0x1764db):yield i(this,S,ze)[_0x23ff56(0x16d)](this,_0x1764db))):_0x3a247c===_0x23ff56(0x23b)?(u['recordDebugEvents']({'eventName':'Turned\x20Off\x20Notification'}),s(0x1,'The\x20user\x20has\x20blocked\x20notifications.')):(u[_0x23ff56(0x99)]({'eventName':_0x23ff56(0x220)}),s(0x1,_0x23ff56(0x1de)),d(f,le)||(yield i(this,S,Ae)[_0x23ff56(0x16d)](this),yield u[_0x23ff56(0x152)]({'eventName':_0x23ff56(0x219)}),_0x1764db||I(f,le,!0x0))));}catch(_0x225379){s(0x2,_0x23ff56(0xa5)),u[_0x23ff56(0x99)]({'eventName':_0x23ff56(0x14f)});}});},Ut=function(_0x519e62){const _0x108d1c=_0x8a0233;try{let _0x343262=document[_0x108d1c(0x1b0)](_0x108d1c(0x97)),_0x95b02d;_0x519e62[_0x108d1c(0xcf)][_0x108d1c(0x191)]&&(_0x95b02d=document[_0x108d1c(0x1b0)](_0x108d1c(0x18b)),_0x95b02d['src']=_0x519e62[_0x108d1c(0xcf)]['banner_image'],_0x95b02d[_0x108d1c(0x118)]=_0x108d1c(0xcc),_0x95b02d['id']='centered-image');let _0x48e813=document[_0x108d1c(0x1b0)](_0x108d1c(0x97)),_0x5254c9=document[_0x108d1c(0x1b0)](_0x108d1c(0x97)),_0x2f0992=document[_0x108d1c(0x1b0)](_0x108d1c(0x97)),_0x2a5d32=document[_0x108d1c(0x1b0)](_0x108d1c(0x18b)),_0x381aa7=document[_0x108d1c(0x1b0)]('div'),_0x255450=document[_0x108d1c(0x1b0)](_0x108d1c(0x97)),_0x38afca=document[_0x108d1c(0x1b0)](_0x108d1c(0x97)),_0x59b390=document['createElement']('div'),_0x1d34f2=document['createElement'](_0x108d1c(0x97)),_0x399a01=document[_0x108d1c(0x1b0)](_0x108d1c(0x97)),_0x4a43cb=document[_0x108d1c(0x1b0)]('button'),_0x41f8cf=document[_0x108d1c(0x1b0)](_0x108d1c(0x8d));_0x343262[_0x108d1c(0x178)]=_0x108d1c(0x123),_0x48e813['className']=_0x108d1c(0x105),_0x5254c9[_0x108d1c(0x178)]=_0x59b390[_0x108d1c(0x178)]=_0x1d34f2['className']=_0x108d1c(0x110),_0x2f0992[_0x108d1c(0x178)]='mergn-column-25',_0x381aa7[_0x108d1c(0x178)]='mergn-column-75',_0x399a01[_0x108d1c(0x178)]=_0x108d1c(0x1c0),_0x255450['id']=_0x108d1c(0x1d9),_0x38afca['id']=_0x108d1c(0x1a2),_0x4a43cb['id']=_0x108d1c(0x1d2),_0x41f8cf['id']=_0x108d1c(0x166),_0x2a5d32[_0x108d1c(0x122)]=_0x519e62[_0x108d1c(0xcf)][_0x108d1c(0x167)],_0x2a5d32[_0x108d1c(0x118)]=_0x108d1c(0xcc),_0x2a5d32['id']='logo',_0x255450[_0x108d1c(0x203)]=_0x519e62[_0x108d1c(0xcf)][_0x108d1c(0x210)],_0x38afca['textContent']=_0x519e62[_0x108d1c(0xcf)][_0x108d1c(0x212)],_0x4a43cb[_0x108d1c(0x203)]=_0x519e62[_0x108d1c(0xcf)][_0x108d1c(0x8b)][_0x108d1c(0x11b)],_0x41f8cf['textContent']=_0x519e62[_0x108d1c(0xcf)][_0x108d1c(0x1ac)][_0x108d1c(0x11b)],_0x2f0992['appendChild'](_0x2a5d32),_0x381aa7[_0x108d1c(0x92)](_0x255450),_0x381aa7[_0x108d1c(0x92)](_0x38afca),_0x5254c9['appendChild'](_0x2f0992),_0x5254c9[_0x108d1c(0x92)](_0x381aa7),_0x95b02d&&(_0x59b390[_0x108d1c(0x92)](_0x95b02d),_0x95b02d[_0x108d1c(0x15d)][_0x108d1c(0x22c)]=_0x108d1c(0x1f5)),_0x399a01['appendChild'](_0x4a43cb),_0x399a01[_0x108d1c(0x92)](_0x41f8cf),_0x1d34f2[_0x108d1c(0x92)](_0x399a01),_0x48e813[_0x108d1c(0x92)](_0x5254c9),_0x48e813[_0x108d1c(0x92)](_0x59b390),_0x48e813['appendChild'](_0x1d34f2),_0x343262[_0x108d1c(0x92)](_0x48e813),_0x343262['style'][_0x108d1c(0x22c)]='\x0aposition:\x20fixed;\x0atop:\x200;\x0aleft:\x200;\x0awidth:\x20100%;\x0aheight:\x20100%;\x0abackground-color:\x20rgba(0,\x200,\x200,\x200.5);\x0az-index:\x2099999999999;\x0adisplay:\x20flex;\x0ajustify-content:\x20center;\x0aalign-items:\x20start;\x0a',_0x48e813['style']['cssText']='\x0abackground-color:\x20'+_0x519e62[_0x108d1c(0xcf)][_0x108d1c(0xf9)]+';\x0apadding:\x2015px;\x0aborder-radius:\x205px;\x0amax-width:\x20380px;\x0amax-height:\x20463px;\x0a',_0x5254c9['style'][_0x108d1c(0x22c)]=_0x59b390[_0x108d1c(0x15d)][_0x108d1c(0x22c)]=_0x1d34f2['style'][_0x108d1c(0x22c)]=_0x108d1c(0xc4),_0x2f0992[_0x108d1c(0x15d)]['cssText']='\x0awidth:\x2025%;\x0a',_0x381aa7[_0x108d1c(0x15d)][_0x108d1c(0x22c)]=_0x108d1c(0x223),_0x2a5d32[_0x108d1c(0x15d)][_0x108d1c(0x22c)]=_0x108d1c(0x184),_0x4a43cb[_0x108d1c(0x15d)]['cssText']=_0x108d1c(0x1a4)+_0x519e62[_0x108d1c(0xcf)][_0x108d1c(0x8b)][_0x108d1c(0x206)]+';\x0acolor:\x20'+_0x519e62['banner_design'][_0x108d1c(0x8b)]['color']+_0x108d1c(0x18f),_0x41f8cf[_0x108d1c(0x15d)]['cssText']=_0x108d1c(0x1a4)+_0x519e62[_0x108d1c(0xcf)]['button_2'][_0x108d1c(0x206)]+_0x108d1c(0x23f)+_0x519e62[_0x108d1c(0xcf)]['button_2'][_0x108d1c(0x91)]+_0x108d1c(0x18f),_0x399a01[_0x108d1c(0x15d)][_0x108d1c(0x22c)]='\x0adisplay:\x20flex;\x0ajustify-content:\x20space-between;\x0aalign-items:\x20center;\x0aflex-wrap:\x20nowrap;\x0awidth:\x20100%;\x0a',_0x255450[_0x108d1c(0x15d)]['cssText']=_0x108d1c(0x238)+_0x519e62[_0x108d1c(0xcf)]['text_color']+'\x0a',_0x38afca[_0x108d1c(0x15d)][_0x108d1c(0x22c)]=_0x108d1c(0x21c)+_0x519e62[_0x108d1c(0xcf)]['text_color']+'\x0a',document['body']['appendChild'](_0x343262),document[_0x108d1c(0xe8)]['style'][_0x108d1c(0x237)]=_0x108d1c(0x1c1),u[_0x108d1c(0x152)]({'eventName':_0x108d1c(0x1c4),'name':_0x108d1c(0xad),'web_optin_instance_id':_0x519e62['web_optin_instance_id']}),_0x4a43cb==null||_0x4a43cb[_0x108d1c(0x213)](_0x108d1c(0x16b),()=>a(this,null,function*(){const _0x953234=_0x108d1c;_0x343262[_0x953234(0x1c2)](),I(f,q,!0x1),document['body'][_0x953234(0x15d)][_0x953234(0x237)]=_0x953234(0x8a),yield u[_0x953234(0x152)]({'eventName':_0x953234(0x162),'web_optin_instance_id':_0x519e62[_0x953234(0x199)]}),s(0x1,_0x953234(0x239));})),_0x41f8cf==null||_0x41f8cf[_0x108d1c(0x213)](_0x108d1c(0x16b),()=>a(this,null,function*(){const _0x1ddb74=_0x108d1c;_0x343262[_0x1ddb74(0x1c2)](),document[_0x1ddb74(0xe8)][_0x1ddb74(0x15d)][_0x1ddb74(0x237)]='auto',u[_0x1ddb74(0x152)]({'eventName':'Accepted\x20Web\x20Push\x20Soft-ask','web_optin_instance_id':_0x519e62[_0x1ddb74(0x199)]}),yield i(this,S,ze)[_0x1ddb74(0x16d)](this,_0x519e62);}));}catch(_0x41baaa){}},ze=function(_0x530a23){return a(this,null,function*(){const _0x2eebf4=_0x5ea2;try{u[_0x2eebf4(0x152)]({'eventName':_0x2eebf4(0x185),'name':_0x2eebf4(0xad),'web_optin_instance_id':_0x530a23[_0x2eebf4(0x199)]});let _0x5af7e4=yield Notification[_0x2eebf4(0x22d)]();_0x5af7e4===_0x2eebf4(0x18e)?(s(0x1,_0x2eebf4(0xd9)),yield i(this,S,Ae)[_0x2eebf4(0x16d)](this),yield u[_0x2eebf4(0x152)]({'eventName':'Allowed\x20Web\x20Push\x20Subscription','name':_0x2eebf4(0xd8),'web_optin_instance_id':_0x530a23[_0x2eebf4(0x199)]})):_0x5af7e4==='denied'?(yield u[_0x2eebf4(0x152)]({'eventName':'Blocked\x20Web\x20Push\x20Subscription'}),s(0x1,_0x2eebf4(0x239))):_0x5af7e4===_0x2eebf4(0x115)&&(yield u[_0x2eebf4(0x152)]({'eventName':'Closed\x20Web\x20Push\x20Subscription'}),s(0x1,_0x2eebf4(0xaa)));}catch(_0x4e91d7){s(0x2,_0x2eebf4(0x1a0));}I(f,q,!0x1);});},Ae=function(){return a(this,null,function*(){const _0x1a6b4f=_0x5ea2;var _0x5b6205,_0x48e8fc;let _0x564ce2=yield N[_0x1a6b4f(0x201)](''+ht);if(_0x564ce2[_0x1a6b4f(0x23e)]){let _0xa2cbd8=yield(_0x5b6205=d(f,B))==null?void 0x0:_0x5b6205['pushManager'][_0x1a6b4f(0xed)]();_0xa2cbd8&&(yield _0xa2cbd8[_0x1a6b4f(0xe7)]());let _0x2ca2d0=yield(_0x48e8fc=d(f,B))==null?void 0x0:_0x48e8fc[_0x1a6b4f(0x188)]['subscribe']({'applicationServerKey':_0x564ce2['data']||'','userVisibleOnly':!0x0});yield N[_0x1a6b4f(0xe6)](''+St,{'device_id':localStorage[_0x1a6b4f(0x11a)](_0x1a6b4f(0x80))||'','is_web_push_subscribed':!0x0,'web_push_subscription_page_url':window[_0x1a6b4f(0x235)]['pathname'],'web_push_token':{'token':JSON['parse'](JSON[_0x1a6b4f(0x13f)](_0x2ca2d0))}}),s(0x1,_0x1a6b4f(0x125));}else throw new Error('Failed\x20to\x20subscribe\x20the\x20user');});},xt=function(_0x60e83a){const _0x2b3455=_0x8a0233;E[_0x2b3455(0x9c)](_0x60e83a,_0x2b3455(0x136),_0x2b3455(0x199));},Le=new WeakMap(),Re=function(_0x106fc3){const _0x58890c=_0x8a0233;if(d(f,q))return;I(f,q,!0x0);let _0x1ed211=i(this,S,Ge)[_0x58890c(0x16d)](this);if(_0x1ed211!=null&&_0x1ed211[_0x106fc3])switch(_0x1ed211[_0x106fc3][_0x58890c(0xbf)]){case'DELAY':{i(this,S,Wt)['call'](this,_0x1ed211[_0x106fc3]);break;}case _0x58890c(0x226):{i(this,S,Oe)[_0x58890c(0x16d)](this,_0x1ed211[_0x106fc3]);break;}case _0x58890c(0x16c):{i(this,S,kt)[_0x58890c(0x16d)](this,_0x1ed211[_0x106fc3]);break;}default:return;}},Ge=function(){const _0x36286a=_0x8a0233;let _0x4af255=localStorage[_0x36286a(0x11a)](_0x36286a(0x136));return _0x4af255?JSON[_0x36286a(0xa1)](_0x4af255):null;},Wt=function(_0x421fe6){const _0x48d3a8=_0x8a0233;E[_0x48d3a8(0xf2)]({'clearActionMethod':d(this,Ie)[_0x48d3a8(0x108)](this),'data':_0x421fe6,'displayMethod':i(this,S,Oe)['bind'](this),'idKey':_0x48d3a8(0x199),'timeValueKey':_0x48d3a8(0xbc)});},Oe=function(_0x31e1ea){const _0x12ca79=_0x8a0233;i(this,S,je)[_0x12ca79(0x16d)](this,_0x31e1ea);},Ie=new WeakMap(),kt=function(_0x5badbf){const _0x240b60=_0x8a0233;E['showAfterScrollAction']({'data':_0x5badbf,'displayMethod':i(this,S,Oe)[_0x240b60(0x108)](this),'timeValueKey':'entry_time_value'});},m(f,ce),m(f,B,null),m(f,le,!0x1),m(f,q,!0x1),m(f,Ee,!0x1),m(f,ve,null);var He=f,W=He[_0x8a0233(0x1fc)](),Q,P,Ft,qe,Bt,Mt,de,Ce,$t,Vt,Kt,De,J=class J{constructor(){const _0x4fef67=_0x8a0233;m(this,P),m(this,de,_0x5aefb0=>{const _0xcea087=_0x5ea2;E[_0xcea087(0x1e9)]({'id':_0x5aefb0,'localStorageKey':'action'});}),this[_0x4fef67(0x1ec)]=()=>{const _0x130a20=_0x4fef67;E['loadActionInLocalStorage']({'actionCondition':_0x28ce44=>_0x28ce44[_0x130a20(0x148)]['name']==='Popup','actionMethod':_0x347c06=>i(this,P,qe)['call'](this,_0x347c06[_0x130a20(0x196)]),'localStorageKey':_0x130a20(0x154)});},m(this,De,()=>{const _0x13e2b5=_0x4fef67;E['storeActionInLocalStorageInternal'](_0x13e2b5(0x154));});}static[_0x8a0233(0x1fc)](){const _0x56bf64=_0x8a0233;var _0x1ed528;return d(J,Q)||(I(J,Q,new J()),i(_0x1ed528=d(J,Q),P,Ft)[_0x56bf64(0x16d)](_0x1ed528)),d(J,Q);}['showPopup'](_0x421bd4){const _0x401627=_0x8a0233;let _0x124631=JSON[_0x401627(0xa1)](localStorage[_0x401627(0x11a)](_0x401627(0x154))||'{}');if(_0x124631&&_0x124631[_0x421bd4==null?void 0x0:_0x421bd4[_0x401627(0x196)]]){s(0x1,'Popup\x20already\x20in\x20cache');return;}i(this,P,Kt)[_0x401627(0x16d)](this,_0x421bd4),d(this,De)[_0x401627(0x16d)](this),i(this,P,qe)[_0x401627(0x16d)](this,_0x421bd4[_0x401627(0x196)]);}['isPopupAction'](_0x2d46e8){const _0x30c8bb=_0x8a0233;return _0x2d46e8===_0x30c8bb(0x1af);}};Q=new WeakMap(),P=new WeakSet(),Ft=function(){return a(this,null,function*(){});},qe=function(_0x30b610){const _0x561546=_0x8a0233;let _0x41f24d=i(this,P,Bt)[_0x561546(0x16d)](this);if(document[_0x561546(0x13e)]('popup_container_'+_0x30b610)){s(0x1,'Popup\x20already\x20displayed'),d(this,de)[_0x561546(0x16d)](this,_0x30b610);return;}if(_0x41f24d!=null&&_0x41f24d[_0x30b610])switch(_0x41f24d[_0x30b610]['campaignEntryTime']){case _0x561546(0xfe):{i(this,P,Mt)[_0x561546(0x16d)](this,_0x41f24d[_0x30b610]);break;}case _0x561546(0x226):{i(this,P,Ce)[_0x561546(0x16d)](this,_0x41f24d[_0x30b610]);break;}case _0x561546(0x16c):{i(this,P,Vt)[_0x561546(0x16d)](this,_0x41f24d[_0x30b610]);break;}default:return;}},Bt=function(){const _0x2f9491=_0x8a0233;let _0x20edd9=localStorage[_0x2f9491(0x11a)](_0x2f9491(0x154));return _0x20edd9?JSON[_0x2f9491(0xa1)](_0x20edd9):null;},Mt=function(_0x4673aa){const _0x2d0930=_0x8a0233;E[_0x2d0930(0xf2)]({'clearActionMethod':d(this,de)['bind'](this),'data':_0x4673aa,'displayMethod':i(this,P,Ce)[_0x2d0930(0x108)](this),'idKey':'campaignId','timeValueKey':'campaignEntryTimeValue'});},de=new WeakMap(),Ce=function(_0x1e99c0){const _0x2ff2e9=_0x8a0233;if(document['getElementById']('popup_container_'+_0x1e99c0[_0x2ff2e9(0x196)]))s(0x1,_0x2ff2e9(0x190));else{let _0x11a7be=i(this,P,$t)[_0x2ff2e9(0x16d)](this,_0x2ff2e9(0x97),_0x1e99c0);document['body']['appendChild'](_0x11a7be),u[_0x2ff2e9(0x152)]({'campaignCustomerInstanceId':_0x1e99c0[_0x2ff2e9(0xc0)],'campaignId':_0x1e99c0[_0x2ff2e9(0x196)],'eventName':te,'eventProperties':[{'eventProperty':_0x2ff2e9(0x186),'value':JSON[_0x2ff2e9(0x13f)]({'campaignId':_0x1e99c0[_0x2ff2e9(0x196)]})}],'name':_0x2ff2e9(0x233)});}d(this,de)['call'](this,_0x1e99c0[_0x2ff2e9(0x196)]);},$t=function(_0x41c4d0,_0x234cda){const _0x5a25=_0x8a0233;let {campaignCustomerInstanceId:_0x57712d,campaignId:_0x445a7c,message:{design:_0x3a6127}}=_0x234cda,_0x3d9cc2=document[_0x5a25(0x1b0)](_0x41c4d0);_0x3d9cc2['id']=_0x5a25(0x1f2)+_0x445a7c,_0x3d9cc2['innerHTML']=_0x3a6127,_0x3d9cc2[_0x5a25(0x15d)][_0x5a25(0x112)]=_0x5a25(0x16e),_0x3d9cc2['style'][_0x5a25(0x134)]='0',_0x3d9cc2['style']['left']='0',_0x3d9cc2[_0x5a25(0x15d)][_0x5a25(0x202)]=_0x5a25(0x13b),_0x3d9cc2[_0x5a25(0x15d)]['height']=_0x5a25(0x13b),_0x3d9cc2['style'][_0x5a25(0x1b9)]=_0x5a25(0x95);let _0xd72767=_0x3d9cc2[_0x5a25(0x18d)]('.u-popup-container');_0xd72767&&(_0xd72767['style'][_0x5a25(0x1b9)]='50');let _0x14f438=_0xd72767[_0x5a25(0x18d)](_0x5a25(0xbe));_0x14f438&&(s(0x1,_0x5a25(0x174)),_0x14f438[_0x5a25(0x15d)][_0x5a25(0x12c)](_0x5a25(0x9a),_0x5a25(0xa4),_0x5a25(0x1aa))),_0x3d9cc2[_0x5a25(0x157)](_0x5a25(0x116))[_0x5a25(0x1c9)](_0x4abf37=>{const _0x30a45a=_0x5a25;let _0x3a074c=_0x4abf37['querySelector'](_0x30a45a(0x20d));_0x3a074c&&_0x3a074c[_0x30a45a(0x213)](_0x30a45a(0x1fb),()=>a(this,null,function*(){const _0x3778b2=_0x30a45a;_0x3d9cc2[_0x3778b2(0x1c2)]();let _0x1df042=new FormData(_0x3a074c),_0x3a6c03={};for(let [_0x1e55b9,_0x1e6237]of _0x1df042[_0x3778b2(0xce)]())_0x3a6c03[_0x1e55b9]=_0x1e6237;yield u['recordEvent']({'campaignCustomerInstanceId':_0x57712d,'campaignId':_0x445a7c,'eventName':te,'eventProperties':[{'eventProperty':_0x3778b2(0x9d),'value':JSON['stringify']({'campaignId':_0x445a7c,'formId':_0x4abf37['id'],'formValues':_0x3a6c03})},{'eventProperty':_0x3778b2(0x214),'value':_0x445a7c[_0x3778b2(0xfc)]()}],'name':_0x3778b2(0x20d)});}));});let _0x5dac7c=_0x3d9cc2[_0x5a25(0x18d)](_0x5a25(0xe9));return(_0x5dac7c==null?void 0x0:_0x5dac7c[_0x5a25(0xd3)](_0x5a25(0x1db)))==='#'&&_0x5dac7c[_0x5a25(0x9f)](_0x5a25(0x1db)),_0x5dac7c==null||_0x5dac7c[_0x5a25(0x213)](_0x5a25(0x16b),()=>a(this,null,function*(){const _0x38dd3a=_0x5a25;_0x3d9cc2['remove'](),yield u[_0x38dd3a(0x152)]({'campaignCustomerInstanceId':_0x57712d,'campaignId':_0x445a7c,'eventName':te,'eventProperties':[{'eventProperty':'Close\x20Click','value':JSON['stringify']({'campaignId':_0x445a7c})}],'name':_0x38dd3a(0x15e)});})),_0x3d9cc2['querySelectorAll'](_0x5a25(0xe5))[_0x5a25(0x1c9)](_0x1e0d86=>{const _0x44de80=_0x5a25;_0x1e0d86['addEventListener'](_0x44de80(0x16b),()=>a(this,null,function*(){const _0x2a707b=_0x44de80;_0x3d9cc2[_0x2a707b(0x1c2)](),yield u['recordEvent']({'campaignCustomerInstanceId':_0x57712d,'campaignId':_0x445a7c,'eventName':te,'eventProperties':[{'eventProperty':_0x2a707b(0x100),'value':JSON[_0x2a707b(0x13f)]({'buttonId':_0x1e0d86['id'],'campaignId':_0x445a7c})}],'name':_0x2a707b(0x16b)});}));}),_0x3d9cc2[_0x5a25(0x157)](_0x5a25(0x20f))[_0x5a25(0x1c9)](_0x500280=>{const _0x242a56=_0x5a25;_0x500280[_0x242a56(0x213)](_0x242a56(0x16b),()=>a(this,null,function*(){const _0x29a3f9=_0x242a56;_0x3d9cc2[_0x29a3f9(0x1c2)](),yield u[_0x29a3f9(0x152)]({'campaignCustomerInstanceId':_0x57712d,'campaignId':_0x445a7c,'eventName':te,'eventProperties':[{'eventProperty':_0x29a3f9(0xa3),'value':JSON['stringify']({'campaignId':_0x445a7c,'imageClassName':_0x500280[_0x29a3f9(0x178)],'imageId':_0x500280['id']})}],'name':_0x29a3f9(0x16b)});}));}),_0x3d9cc2;},Vt=function(_0x16b903){const _0x3ec778=_0x8a0233;E[_0x3ec778(0x1b7)]({'data':_0x16b903,'displayMethod':i(this,P,Ce)[_0x3ec778(0x108)](this),'timeValueKey':_0x3ec778(0x20a)});},Kt=function(_0x3c2f6c){const _0x1ae855=_0x8a0233;E[_0x1ae855(0x9c)](_0x3c2f6c,_0x1ae855(0x154),_0x1ae855(0x196));},De=new WeakMap(),m(J,Q);var Ye=J,H=Ye['getInstance'](),ue,fe,he,be,ye,we,Te,Ue,p,Ht,jt,zt,Se,Ze,Xe,et,tt,Gt,Yt,qt,Qt,Zt,Xt,en,nt,rt,tn,nn,Z=class Z{constructor(){const _0x52ee17=_0x8a0233;m(this,p),m(this,fe),m(this,he),m(this,be),m(this,ye,null),m(this,we,null),m(this,Te,!0x1),m(this,Ue,()=>{setInterval(()=>{const _0x409d41=_0x5ea2;let _0x1d6fe4=localStorage['getItem'](_0x409d41(0xcb));if(_0x1d6fe4!==d(this,we)){I(this,we,_0x1d6fe4);let _0x437767=JSON[_0x409d41(0xa1)](_0x1d6fe4||'{}');if(_0x437767!=null&&_0x437767['pushMessageToSW']){let _0x598085=_0x437767[_0x409d41(0x156)];delete _0x437767[_0x409d41(0x156)],localStorage[_0x409d41(0x124)](_0x409d41(0xcb),JSON[_0x409d41(0x13f)](_0x437767)),W[_0x409d41(0x156)](_0x598085);}if(_0x437767!=null&&_0x437767['optIn']){let _0x512a97=_0x437767[_0x409d41(0x165)];delete _0x437767[_0x409d41(0x165)],localStorage[_0x409d41(0x124)](_0x409d41(0xcb),JSON[_0x409d41(0x13f)](_0x437767)),W[_0x409d41(0x240)](_0x512a97);}if(_0x437767!=null&&_0x437767[_0x409d41(0x106)]){let _0xa3056d=_0x437767[_0x409d41(0x106)];delete _0x437767['campaigns'],localStorage[_0x409d41(0x124)]('mergn_shopify',JSON[_0x409d41(0x13f)](_0x437767)),_0xa3056d['forEach'](_0x4c0e84=>{const _0x3ea65d=_0x409d41;H['isPopupAction'](_0x4c0e84[_0x3ea65d(0x148)][_0x3ea65d(0x12e)])?H[_0x3ea65d(0xd6)](_0x4c0e84):ae[_0x3ea65d(0x197)](_0x4c0e84['message'][_0x3ea65d(0x12e)])&&ae[_0x3ea65d(0x14d)](_0x4c0e84);});}}},0x3e8);}),this['storeActionInLocalStorageInternal']=_0x89fb70=>{const _0x5f1da9=_0x5ea2;let _0x3ca289=()=>{const _0x5cc22f=_0x5ea2;let _0x30775b=JSON[_0x5cc22f(0xa1)](localStorage[_0x5cc22f(0x11a)](_0x89fb70)||'{}');Object[_0x5cc22f(0x10e)](_0x30775b)[_0x5cc22f(0x1c9)](_0x1f344e=>{_0x30775b[_0x1f344e]['initialTime']=new Date()['getTime']();}),localStorage[_0x5cc22f(0x124)](_0x89fb70,JSON[_0x5cc22f(0x13f)](_0x30775b));};_0x3ca289(),window[_0x5f1da9(0x213)](_0x5f1da9(0x22e),_0x3ca289);},this[_0x52ee17(0x1e9)]=({id:_0x2b1450,localStorageKey:_0x23c39a})=>{const _0x202f5e=_0x52ee17;let _0x511e97=JSON[_0x202f5e(0xa1)](localStorage[_0x202f5e(0x11a)](_0x23c39a)||'{}');_0x511e97[_0x2b1450]&&delete _0x511e97[_0x2b1450],localStorage['setItem'](_0x23c39a,JSON['stringify'](_0x511e97));},this[_0x52ee17(0x1fd)]=({actionCondition:_0x12fe2e,actionMethod:_0x2a6fbb,localStorageKey:_0xbd52c4})=>{const _0xd495cb=_0x52ee17;let _0x6c43d5=JSON[_0xd495cb(0xa1)](localStorage[_0xd495cb(0x11a)](_0xbd52c4)||'{}');Object['keys'](_0x6c43d5)[_0xd495cb(0x1c9)](_0x5ab0d2=>{_0x12fe2e(_0x6c43d5[_0x5ab0d2])&&_0x2a6fbb(_0x6c43d5[_0x5ab0d2]);});};}static[_0x8a0233(0x1fc)](){return d(Z,ue)||I(Z,ue,new Z()),d(Z,ue);}['init'](_0x92eecf,_0x2dac9f){return a(this,null,function*(){const _0xc50ad3=_0x5ea2;s(0x1,_0xc50ad3(0x113)),_0x2dac9f!=null&&_0x2dac9f[_0xc50ad3(0x1f3)]&&I(this,Te,!0x0),i(this,p,Ht)[_0xc50ad3(0x16d)](this,_0x92eecf);let _0x582594=this[_0xc50ad3(0x1d8)]();if(_0x582594===_0xc50ad3(0x160)||_0x582594==='Unknown'){s(0x2,_0xc50ad3(0xe2));return;}if(yield N[_0xc50ad3(0x1b8)](),s(0x1,'Verifying\x20API\x20Key'),yield i(this,p,nt)[_0xc50ad3(0x16d)](this),_0x2dac9f!=null&&_0x2dac9f[_0xc50ad3(0x1f3)]&&d(this,Ue)['call'](this),_0x2dac9f!=null&&_0x2dac9f['identity'])try{g[_0xc50ad3(0xb6)]=!0x0,yield this[_0xc50ad3(0x129)](_0x2dac9f[_0xc50ad3(0x1e4)]);}finally{g[_0xc50ad3(0xb6)]=!0x1;}setInterval(()=>a(this,null,function*(){const _0x2a4027=_0xc50ad3;s(0x1,_0x2a4027(0x225)),yield i(this,p,nt)[_0x2a4027(0x16d)](this);}),0x493e0);let _0x523b0c=i(this,p,Se)[_0xc50ad3(0x16d)](this);if(yield this[_0xc50ad3(0xdb)](),yield u[_0xc50ad3(0x169)](),u['recordDebugEvents']({'eventName':_0xc50ad3(0x11f)}),s(0x1,_0xc50ad3(0x1cc)),yield A(_0xc50ad3(0x1b3),()=>a(this,null,function*(){const _0x3137d9=_0xc50ad3;yield W[_0x3137d9(0xc7)](_0x523b0c,_0x2dac9f==null?void 0x0:_0x2dac9f['swPath']);})),!(_0x2dac9f!=null&&_0x2dac9f['shopify'])){yield i(this,p,nn)['call'](this);let _0x1adb2e=history[_0xc50ad3(0x141)];history[_0xc50ad3(0x141)]=(..._0x3fb6ac)=>{const _0x198fac=_0xc50ad3;_0x1adb2e['apply'](history,_0x3fb6ac),i(this,p,tn)[_0x198fac(0x16d)](this);};}s(0x1,_0xc50ad3(0x1d6));});}[_0x8a0233(0xfa)](_0x5775a8){I(this,fe,_0x5775a8);}[_0x8a0233(0x18a)](_0x1aefd8){I(this,he,_0x1aefd8);}[_0x8a0233(0x11d)](_0x1cef31){I(this,be,_0x1cef31);}[_0x8a0233(0x1b1)](_0x598e4c){I(this,ye,_0x598e4c);}[_0x8a0233(0x1bb)](){return d(this,ye);}[_0x8a0233(0x1d8)](){return d(this,fe);}[_0x8a0233(0x8e)](){return d(this,he);}[_0x8a0233(0xd0)](){return d(this,be);}[_0x8a0233(0x1d4)](){const _0x2ff291=_0x8a0233;localStorage[_0x2ff291(0x124)](_0x2ff291(0x132),''+new Date()[_0x2ff291(0x1d0)]());}['showAfterScrollAction']({data:_0x4d57ae,displayMethod:_0x41f76f,timeValueKey:_0x2e77f5}){const _0x57f576=_0x8a0233;let _0x533c05=()=>{const _0x5e71b3=_0x5ea2;var _0x1f6c37;let _0x138ee9=window[_0x5e71b3(0x20b)],_0x1928c6=document[_0x5e71b3(0xb5)][_0x5e71b3(0x158)];window[_0x5e71b3(0xb1)]/(_0x1928c6-_0x138ee9)*0x64>(((_0x1f6c37=_0x4d57ae[_0x2e77f5])==null?void 0x0:_0x1f6c37[_0x5e71b3(0x1df)])||0x0)&&(window[_0x5e71b3(0x17a)]('scroll',_0x533c05),_0x41f76f(_0x4d57ae));};window[_0x57f576(0x213)](_0x57f576(0xa0),_0x533c05);}[_0x8a0233(0xf2)]({clearActionMethod:_0x3688f4,data:_0x72b99c,displayMethod:_0x8358e9,idKey:_0x16b06d,timeValueKey:_0x14e1f1}){const _0x270156=_0x8a0233;var _0xc2e07e,_0x150959,_0x42b630;let _0x45a552=(_0xc2e07e=_0x72b99c[_0x14e1f1])==null?void 0x0:_0xc2e07e['value'];((_0x150959=_0x72b99c[_0x14e1f1])==null?void 0x0:_0x150959[_0x270156(0x1eb)])===_0x270156(0xef)&&(_0x45a552=_0x45a552*0x3c);let _0x3f86d2=_0x72b99c[_0x270156(0x10d)]-0x1f4+(_0x45a552||0x0)*0x3e8-new Date()[_0x270156(0x1d0)]();s(0x1,_0x270156(0x1ee)+_0x72b99c[_0x270156(0x10d)]),s(0x1,'Time\x20value:\x20'+((_0x42b630=_0x72b99c[_0x14e1f1])==null?void 0x0:_0x42b630[_0x270156(0x1df)])),s(0x1,_0x270156(0xb7)+new Date()[_0x270156(0x1d0)]()),s(0x1,_0x270156(0xbb)+_0x3f86d2),_0x3f86d2>0x0?setTimeout(()=>{_0x3688f4(_0x72b99c[_0x16b06d]),_0x8358e9(_0x72b99c);},_0x3f86d2):(_0x3688f4(_0x72b99c[_0x16b06d]),_0x8358e9(_0x72b99c));}[_0x8a0233(0x9c)](_0x27fc5f,_0x164f0c,_0x13fcad){const _0x21708f=_0x8a0233;var _0x2adc3a;let _0x10a9ea=JSON[_0x21708f(0xa1)](localStorage[_0x21708f(0x11a)](_0x164f0c)||'{}'),_0x1fdf1c=(_0x2adc3a=_0x13fcad in _0x27fc5f&&_0x27fc5f[_0x13fcad])!=null?_0x2adc3a:'';_0x1fdf1c&&(_0x10a9ea[_0x1fdf1c]=Pe(z({},_0x27fc5f),{'initialTime':new Date()[_0x21708f(0x1d0)]()}),localStorage[_0x21708f(0x124)](_0x164f0c,JSON[_0x21708f(0x13f)](_0x10a9ea)));}[_0x8a0233(0xdb)](){return a(this,null,function*(){const _0x2e0337=_0x5ea2;yield A(_0x2e0337(0xc9),()=>a(this,null,function*(){const _0x5707c1=_0x2e0337;if(d(this,Te))return;s(0x1,_0x5707c1(0x121)),C(_0x5707c1(0x121),!0x0),L(_0x5707c1(0x1f0),!0x0);let _0x3d88e9=localStorage['getItem']('ttl'),_0x2db3de=!0x1;if(_0x3d88e9){if(_0x2db3de=i(this,p,Se)['call'](this,_0x3d88e9),_0x2db3de){let _0xbd4e31=localStorage[_0x5707c1(0x11a)](_0x5707c1(0x140)),_0x4ae70f=localStorage[_0x5707c1(0x11a)](_0x5707c1(0x132));if(_0xbd4e31&&_0x4ae70f){let _0x11c9ea=parseInt(_0x4ae70f,0xa);u[_0x5707c1(0x152)]({'eventName':'Web\x20Session\x20Concluded','eventProperties':[{'eventProperty':'SESSION_ID','value':localStorage[_0x5707c1(0x11a)](_0x5707c1(0x140))},{'eventProperty':_0x5707c1(0x181),'value':Number[_0x5707c1(0x1a6)](_0x11c9ea)?new Date(_0x11c9ea)[_0x5707c1(0x145)]():new Date()[_0x5707c1(0x145)]()}]});}this[_0x5707c1(0x19c)](),localStorage[_0x5707c1(0x124)]('ttl',''+new Date()[_0x5707c1(0x1d0)]());}}else localStorage[_0x5707c1(0x124)](_0x5707c1(0x132),''+new Date()[_0x5707c1(0x1d0)]());(!_0x3d88e9||_0x2db3de||i(this,p,Yt)[_0x5707c1(0x16d)](this))&&(i(this,p,tt)[_0x5707c1(0x16d)](this)&&i(this,p,qt)[_0x5707c1(0x16d)](this),i(this,p,et)[_0x5707c1(0x16d)](this)&&(yield this[_0x5707c1(0x129)]()),(i(this,p,Se)['call'](this)||i(this,p,Ze)[_0x5707c1(0x16d)](this))&&(yield i(this,p,Xt)[_0x5707c1(0x16d)](this)),yield i(this,p,Qt)[_0x5707c1(0x16d)](this),(i(this,p,Se)[_0x5707c1(0x16d)](this)||i(this,p,Xe)['call'](this))&&(yield i(this,p,en)[_0x5707c1(0x16d)](this))),L(_0x5707c1(0x1f0),!0x1),C('Checking\x20TTL',!0x1);}));});}[_0x8a0233(0x19c)](){const _0x415075=_0x8a0233;localStorage[_0x415075(0x1e7)]('action'),localStorage[_0x415075(0x1e7)]('events'),localStorage[_0x415075(0x1e7)](_0x415075(0x215)),localStorage['removeItem'](_0x415075(0xdf)),localStorage[_0x415075(0x1e7)](_0x415075(0x132)),localStorage[_0x415075(0x1e7)](_0x415075(0x140));}[_0x8a0233(0x129)](_0x1a869f){return a(this,null,function*(){const _0x47879b=_0x5ea2;let _0x5a2553={'deviceId':localStorage['getItem'](_0x47879b(0x80))||crypto[_0x47879b(0x11c)](),'os':this['getPlatform']()};if(_0x1a869f)_0x5a2553[_0x47879b(0x1e4)]=_0x1a869f;else{if(!_0x1a869f&&localStorage[_0x47879b(0x11a)](_0x47879b(0x1bf)))return;}try{let _0x28ef80=yield i(this,p,Zt)[_0x47879b(0x16d)](this,_0x5a2553);if(_0x28ef80!==void 0x0){localStorage[_0x47879b(0x124)]('customer',_0x28ef80);try{W[_0x47879b(0x156)]({'customer':_0x28ef80});}catch(_0x556765){}}}catch(_0x5b440a){throw new Error(_0x47879b(0x1d1));}});}};ue=new WeakMap(),fe=new WeakMap(),he=new WeakMap(),be=new WeakMap(),ye=new WeakMap(),we=new WeakMap(),Te=new WeakMap(),Ue=new WeakMap(),p=new WeakSet(),Ht=function(_0x51493d){const _0x15b5e1=_0x8a0233;N[_0x15b5e1(0x1f8)](_0x51493d),this[_0x15b5e1(0xfa)](i(this,p,jt)[_0x15b5e1(0x16d)](this)),this[_0x15b5e1(0x18a)](i(this,p,zt)['call'](this)),this[_0x15b5e1(0x11d)](navigator[_0x15b5e1(0xf3)]);},jt=function(){const _0x12092f=_0x8a0233;var _0x3baf22;let _0x234ef5=navigator[_0x12092f(0xf3)][_0x12092f(0x1bc)]();return/googlebot|bingbot|yandexbot|duckduckbot|slurp|twitterbot|linkedinbot|facebot|pinterest|vkshare|applebot|baiduspider|adsbot-google|msnbot|yahoobot|sogou|facebookexternalhit/i[_0x12092f(0xda)](_0x234ef5)?_0x12092f(0x160):/wv|wkwebview|instagram|facebook|fbav|fban|twitter|snapchat|pinterest|linkedin|tiktok/i[_0x12092f(0xda)](_0x234ef5)?'Mobile':/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i[_0x12092f(0xda)](_0x234ef5)?(_0x12092f(0x1c7)in window&&typeof((_0x3baf22=window==null?void 0x0:window[_0x12092f(0x1c7)])==null?void 0x0:_0x3baf22['permission'])!='undefined','Mobile'):/windows|macintosh|linux|x11/i[_0x12092f(0xda)](_0x234ef5)?_0x12092f(0x10c):'Unknown';},zt=function(){const _0x15506c=_0x8a0233;let _0x2635ce=navigator[_0x15506c(0xf3)],_0x890b3b;return _0x2635ce[_0x15506c(0x7b)](_0x15506c(0x10b))>-0x1?_0x890b3b='Google\x20Chrome':_0x2635ce[_0x15506c(0x7b)](_0x15506c(0x23a))>-0x1?_0x890b3b=_0x15506c(0x23a):_0x2635ce[_0x15506c(0x7b)](_0x15506c(0x9e))>-0x1?_0x890b3b=_0x15506c(0xff):_0x2635ce['indexOf'](_0x15506c(0x1dc))>-0x1?_0x890b3b=_0x15506c(0x208):_0x2635ce[_0x15506c(0x7b)](_0x15506c(0x15b))>-0x1?_0x890b3b='Internet\x20Explorer':_0x890b3b='Unknown',_0x890b3b;},Se=function(_0x519922){const _0x246c17=_0x8a0233;let _0x447e89;return _0x519922||(_0x447e89=localStorage['getItem'](_0x246c17(0x132))),_0x519922||_0x447e89?new Date()[_0x246c17(0x1d0)]()-parseInt(_0x519922||_0x447e89||'',0xa)>0x124f80:!0x0;},Ze=function(){const _0x159fd9=_0x8a0233;return!localStorage[_0x159fd9(0x11a)](_0x159fd9(0x19b));},Xe=function(){const _0x4d7dd0=_0x8a0233;return!localStorage[_0x4d7dd0(0x11a)](_0x4d7dd0(0x215));},et=function(){const _0x50de05=_0x8a0233;return!localStorage[_0x50de05(0x11a)](_0x50de05(0x1bf));},tt=function(){const _0x141166=_0x8a0233;return!localStorage['getItem'](_0x141166(0x80));},Gt=function(){const _0x31d901=_0x8a0233;return!localStorage[_0x31d901(0x11a)](_0x31d901(0x140));},Yt=function(){const _0x235d84=_0x8a0233;return i(this,p,Ze)[_0x235d84(0x16d)](this)||i(this,p,Xe)[_0x235d84(0x16d)](this)||i(this,p,et)[_0x235d84(0x16d)](this)||i(this,p,tt)[_0x235d84(0x16d)](this)||i(this,p,Gt)[_0x235d84(0x16d)](this);},qt=function(){const _0x5e3540=_0x8a0233;let _0x4c7a4b=localStorage['getItem'](_0x5e3540(0x80));return _0x4c7a4b||(_0x4c7a4b=crypto[_0x5e3540(0x11c)](),localStorage[_0x5e3540(0x124)](_0x5e3540(0x80),_0x4c7a4b)),_0x4c7a4b;},Qt=function(){return a(this,null,function*(){yield A('store\x20session',()=>a(this,null,function*(){const _0x1199fe=_0x5ea2;let _0x56e9e=localStorage[_0x1199fe(0x11a)](_0x1199fe(0x140));if(!_0x56e9e){_0x56e9e=crypto[_0x1199fe(0x11c)](),localStorage[_0x1199fe(0x124)](_0x1199fe(0x140),_0x56e9e);let _0x4423e0=localStorage[_0x1199fe(0x11a)]('ttl'),_0xf636df=_0x4423e0?parseInt(_0x4423e0,0xa):'';yield u[_0x1199fe(0x152)]({'eventName':_0x1199fe(0xf8),'eventProperties':[{'eventProperty':_0x1199fe(0x17c),'value':localStorage[_0x1199fe(0x11a)](_0x1199fe(0x140))},{'eventProperty':_0x1199fe(0x181),'value':_0xf636df?new Date(_0xf636df)[_0x1199fe(0x145)]():new Date()[_0x1199fe(0x145)]()}]});}}),_0x10f7eb=>{const _0x18b191=_0x5ea2;u[_0x18b191(0x152)]({'eventName':_0x18b191(0x20e),'eventProperties':[{'eventProperty':'message','value':'store\x20session\x20-\x20'+_0x10f7eb['message']}]},!0x0);});});},Zt=function(_0x3ce188){return a(this,null,function*(){const _0x130011=_0x5ea2;try{return(yield N[_0x130011(0x1cd)](''+It+ft,_0x3ce188))[_0x130011(0x11e)];}catch(_0xa37951){throw new Error(_0x130011(0x1ba));}});},Xt=function(){return a(this,null,function*(){const _0x5b862e=_0x5ea2;yield u[_0x5b862e(0x1b2)]();});},en=function(){return a(this,null,function*(){const _0x7312f4=_0x5ea2;yield me[_0x7312f4(0x1a7)]();});},nt=function(){return a(this,null,function*(){yield A('verify\x20API\x20key',()=>a(this,null,function*(){const _0x2eeed3=_0x5ea2;var _0x326b51;try{let _0x38f0fd=parseInt(localStorage['getItem'](_0x2eeed3(0x163))||'0',0xa)||0x0;if(!_0x38f0fd||_0x38f0fd&&new Date()[_0x2eeed3(0x1d0)]()>_0x38f0fd){let _0x58a72e=yield N['get'](_0x2eeed3(0x170));if(!(_0x58a72e!=null&&_0x58a72e[_0x2eeed3(0x23e)]))throw new Error(JSON['stringify'](_0x58a72e));localStorage['setItem'](_0x2eeed3(0x163),(new Date()[_0x2eeed3(0x1d0)]()+0x493e0)[_0x2eeed3(0xfc)]());}g[_0x2eeed3(0x14e)]=!0x0;}catch(_0x387188){throw N[_0x2eeed3(0x20c)]()==='67'&&!((_0x326b51=_0x387188==null?void 0x0:_0x387188[_0x2eeed3(0x148)])!=null&&_0x326b51[_0x2eeed3(0x236)](_0x2eeed3(0x201)))&&u[_0x2eeed3(0x152)]({'eventName':_0x2eeed3(0x20e),'eventProperties':[{'eventProperty':_0x2eeed3(0x148),'value':_0x2eeed3(0x204)+_0x387188['message']}]},!0x0),g['disableSDK']=!0x0,new Error(_0x2eeed3(0x1a3));}}));});},rt=function(){return a(this,null,function*(){const _0x2e70b0=_0x5ea2;var _0xf9fe;s(0x1,_0x2e70b0(0x1ce));let _0x1c2393=(_0xf9fe=window==null?void 0x0:window['location'])==null?void 0x0:_0xf9fe[_0x2e70b0(0x1db)];this['setPreviousUrl'](_0x1c2393),u[_0x2e70b0(0x99)]({'eventName':_0x2e70b0(0x79)});let _0x39f062=[];new URLSearchParams(new URL(window[_0x2e70b0(0x235)][_0x2e70b0(0x1db)])[_0x2e70b0(0x16a)])[_0x2e70b0(0x1c9)]((_0x33caab,_0x2e67d0)=>a(this,null,function*(){const _0xa56991=_0x2e70b0;wt['has'](_0x2e67d0)&&_0x39f062[_0xa56991(0x21b)]({'eventProperty':_0x2e67d0,'value':_0x33caab});})),yield u[_0x2e70b0(0x152)]({'eventName':_0x2e70b0(0x19d),'eventProperties':[{'eventProperty':'URL','value':window[_0x2e70b0(0x235)][_0x2e70b0(0x94)]},..._0x39f062]});});},tn=function(){return a(this,null,function*(){const _0x504fa4=_0x5ea2;var _0x519ff0;s(0x1,'Tracking\x20page\x20change');let _0x15fc2f=(_0x519ff0=window==null?void 0x0:window[_0x504fa4(0x235)])==null?void 0x0:_0x519ff0[_0x504fa4(0x1db)];(this[_0x504fa4(0x1bb)]()===null||this['getPreviousUrl']()===void 0x0||_0x15fc2f!==this[_0x504fa4(0x1bb)]())&&(yield i(this,p,rt)[_0x504fa4(0x16d)](this));});},nn=function(){return a(this,null,function*(){const _0x96e6c9=_0x5ea2;var _0x369fc8,_0x2b3d3e;let _0x2c8ff0=(_0x369fc8=window==null?void 0x0:window[_0x96e6c9(0x235)])==null?void 0x0:_0x369fc8[_0x96e6c9(0x1db)];u[_0x96e6c9(0x99)]({'eventName':_0x96e6c9(0x180),'eventProperties':[{'eventProperty':_0x96e6c9(0x148),'value':(_0x2c8ff0!==this[_0x96e6c9(0x1bb)]())+':'+_0x2c8ff0+':'+this[_0x96e6c9(0x1bb)]()}]});try{yield i(this,p,rt)[_0x96e6c9(0x16d)](this);}catch(_0xf3d882){let _0x36652b=_0xf3d882&&_0xf3d882['message']?(_0x2b3d3e=_0xf3d882==null?void 0x0:_0xf3d882[_0x96e6c9(0x148)])==null?void 0x0:_0x2b3d3e[_0x96e6c9(0x1bd)](0x0,0x64):_0x96e6c9(0x173);yield u[_0x96e6c9(0x99)]({'eventName':_0x96e6c9(0x109),'eventProperties':[{'eventProperty':'message','value':''+_0x36652b}]});}});},m(Z,ue);var Qe=Z,E=Qe[_0x8a0233(0x1fc)](),X,R,rn,xe,on,sn,an,cn,j=class j{constructor(){const _0x30fcc0=_0x8a0233;m(this,R),this[_0x30fcc0(0x216)]=Promise['resolve']();}static[_0x8a0233(0x1fc)](){const _0x30c521=_0x8a0233;var _0x1f6cd4;return d(j,X)||(I(j,X,new j()),i(_0x1f6cd4=d(j,X),R,rn)[_0x30c521(0x16d)](_0x1f6cd4)),d(j,X);}['pushToQueue'](_0xc7be55){const _0x2013cb=_0x8a0233;let _0x36320c=JSON['parse'](localStorage[_0x2013cb(0x11a)]('preInitializedEvents')||'[]');_0x36320c[_0x2013cb(0x21b)](_0xc7be55),localStorage['setItem'](_0x2013cb(0x171),JSON['stringify'](_0x36320c));}[_0x8a0233(0x169)](){return a(this,null,function*(){const _0x43a268=_0x5ea2;let _0x2f1143=JSON[_0x43a268(0xa1)](localStorage[_0x43a268(0x11a)]('preInitializedEvents')||'[]');if(Array[_0x43a268(0x10a)](_0x2f1143)){for(let _0x6e1dd8 of _0x2f1143)yield this[_0x43a268(0x90)](_0x6e1dd8);}});}['recordEvent'](_0x38555d,_0x10c442){return a(this,null,function*(){const _0x37e3b8=_0x5ea2;g[_0x37e3b8(0x14e)]&&!g[_0x37e3b8(0xb6)]?yield i(this,R,xe)[_0x37e3b8(0x16d)](this,_0x38555d,_0x10c442):this[_0x37e3b8(0x1d5)](_0x38555d);});}[_0x8a0233(0x90)](_0x48e4da){return a(this,null,function*(){const _0xc2aeb5=_0x5ea2;try{yield i(this,R,xe)[_0xc2aeb5(0x16d)](this,_0x48e4da);}finally{i(this,R,cn)[_0xc2aeb5(0x16d)](this,_0x48e4da[_0xc2aeb5(0x139)]);}});}[_0x8a0233(0x99)](_0x5b0f83){return a(this,null,function*(){const _0x435218=_0x5ea2;g[_0x435218(0x86)]===0x4&&(!g[_0x435218(0x179)]||g[_0x435218(0x179)][_0x5b0f83[_0x435218(0x139)]])&&(yield i(this,R,xe)[_0x435218(0x16d)](this,_0x5b0f83));});}[_0x8a0233(0x87)](){const _0x1ed183=_0x8a0233;let _0x15e207=localStorage[_0x1ed183(0x11a)](_0x1ed183(0x19b));return _0x15e207?JSON['parse'](_0x15e207):{};}[_0x8a0233(0x1b2)](){return a(this,null,function*(){const _0x145ef5=_0x5ea2;if(!localStorage['getItem'](_0x145ef5(0x19b))){let _0x28477d=(yield this[_0x145ef5(0x149)]())[_0x145ef5(0x11e)];if(_0x28477d){localStorage[_0x145ef5(0x124)](_0x145ef5(0x19b),JSON[_0x145ef5(0x13f)](_0x28477d));try{W[_0x145ef5(0x156)]({'events':_0x28477d});}catch(_0x22f0de){}}}});}['fetchEventData'](){return a(this,null,function*(){const _0x11f66f=_0x5ea2;try{return yield N[_0x11f66f(0x201)](''+Fe);}catch(_0x109438){throw new Error(_0x11f66f(0xdc));}});}[_0x8a0233(0x242)](_0x57ca1f,_0x1fdff1){return a(this,null,function*(){const _0x2a01b9=_0x5ea2;let _0x3ca19c=null,_0x4e59b8=null,_0x5de345=new AbortController();return this[_0x2a01b9(0x216)]=this['queue'][_0x2a01b9(0x222)](()=>a(this,null,function*(){const _0x50b0bf=_0x2a01b9;try{if(_0x57ca1f[_0x50b0bf(0x19b)]['length']===0x0)throw new Error(_0x50b0bf(0x138));let _0x327b4f=yield N[_0x50b0bf(0x1cd)](_0x50b0bf(0xe4)+Fe+vt,_0x57ca1f,_0x5de345['signal']);if(_0x327b4f['success'])return _0x4e59b8=_0x327b4f,_0x327b4f;if(_0x327b4f['message']===_0x50b0bf(0x15c)+localStorage[_0x50b0bf(0x11a)](_0x50b0bf(0x1bf))+'\x20not\x20exists')throw localStorage[_0x50b0bf(0x1e7)](_0x50b0bf(0x1bf)),new Error(_0x50b0bf(0xb9));}catch(_0x346401){throw s(0x2,_0x50b0bf(0x232)),s(0x2,_0x50b0bf(0x209)+_0x346401[_0x50b0bf(0x12e)]),s(0x2,_0x50b0bf(0xa7)+_0x346401['message']),(_0x346401[_0x50b0bf(0x12e)]===_0x50b0bf(0x195)||_0x346401['name']===_0x50b0bf(0xd1)&&_0x346401[_0x50b0bf(0x148)]===_0x50b0bf(0x84))&&(s(0x2,'Request\x20aborted'),_0x1fdff1&&i(this,R,an)[_0x50b0bf(0x16d)](this,_0x1fdff1)),_0x3ca19c=new Error(_0x50b0bf(0x23c)),_0x346401;}return null;}))['catch'](()=>{}),this[_0x2a01b9(0x216)]['then'](()=>{if(_0x3ca19c)throw _0x3ca19c;return _0x4e59b8;});});}};X=new WeakMap(),R=new WeakSet(),rn=function(){return a(this,null,function*(){});},xe=function(_0x2c7ef2,_0x160ff3){return a(this,null,function*(){yield A('#\x20record\x20event',()=>a(this,null,function*(){const _0x9fccf7=_0x5ea2;var _0x1c3c59,_0xe06360,_0x53627b,_0x48985c;let {campaignCustomerInstanceId:_0x1bf6cc,campaignId:_0x38646d,eventName:_0x389cc6,eventProperties:_0x36df1d,name:_0xc73475,web_optin_instance_id:_0x487bd0}=_0x2c7ef2;s(0x1,'#\x20Recording\x20event'),C(_0x9fccf7(0x17f),!0x0),L(_0x9fccf7(0x198),!0x0),s(0x1,'Event\x20Payload'),s(0x1,{'campaignCustomerInstanceId':_0x1bf6cc,'eventName':_0x389cc6,'eventProperties':_0x36df1d,'name':_0xc73475,'web_optin_instance_id':_0x487bd0});let _0x52b04f=E[_0x9fccf7(0x1d8)]();if(_0x52b04f==='Crawlers'||_0x52b04f===_0x9fccf7(0x13d))throw new Error('Invalid\x20platform');_0x389cc6!==_0x9fccf7(0x153)&&(yield E[_0x9fccf7(0xdb)]());let _0x3e940=[];_0x36df1d&&_0x3e940[_0x9fccf7(0x21b)](..._0x36df1d),_0x3e940['push']({'eventProperty':_0x9fccf7(0x1da),'value':_0x52b04f}),_0x3e940[_0x9fccf7(0x21b)]({'eventProperty':'operating-system','value':E[_0x9fccf7(0xd0)]()}),_0x3e940[_0x9fccf7(0x21b)]({'eventProperty':_0x9fccf7(0x1e2),'value':E[_0x9fccf7(0x8e)]()});let _0x5573f8=this[_0x9fccf7(0x87)](),_0x30e7aa=i(this,R,on)[_0x9fccf7(0x16d)](this,_0x5573f8,_0x389cc6,_0x3e940);if(typeof _0x30e7aa=='string'){s(0x2,_0x30e7aa);return;}E[_0x9fccf7(0x1d4)]();let {id:_0x446e91}=_0x5573f8[_0x389cc6],_0x5b6a2e=i(this,R,sn)[_0x9fccf7(0x16d)](this,z(Pe(z(z(z({},_0x1bf6cc?{'campaignCustomerInstanceId':_0x1bf6cc}:{}),_0x38646d?{'campaignId':_0x38646d}:{}),_0x487bd0?{'web_optin_instance_id':_0x487bd0}:{}),{'eventId':_0x446e91,'eventProperties':_0x30e7aa,'sessionId':localStorage[_0x9fccf7(0x11a)](_0x9fccf7(0x140))||''}),_0xc73475?{'name':_0xc73475}:{}));if(g['offline']){let _0x23d6c5=JSON[_0x9fccf7(0xa1)](localStorage['getItem'](_0x9fccf7(0xdf))||'[]');_0x23d6c5[_0x9fccf7(0x1f9)]<=0x32&&(_0x23d6c5[_0x9fccf7(0x21b)](..._0x5b6a2e['events']),localStorage[_0x9fccf7(0x124)]('offlineEvents',JSON[_0x9fccf7(0x13f)](_0x23d6c5)));return;}let _0x252bbf=yield this['postEventRecord'](_0x5b6a2e,_0x2c7ef2);(_0x1c3c59=_0x252bbf==null?void 0x0:_0x252bbf[_0x9fccf7(0x11e)])!=null&&_0x1c3c59['optIn']?(yield this['recordDebugEvents']({'eventName':_0x9fccf7(0x1c5)}),W[_0x9fccf7(0x240)](_0x252bbf['data'][_0x9fccf7(0x165)])):_0x389cc6==='Viewed\x20Webpage'&&(yield this[_0x9fccf7(0x99)]({'eventName':_0x9fccf7(0xd2),'eventProperties':[{'eventProperty':_0x9fccf7(0x148),'value':''+(_0x9fccf7(0x1c7)in window&&typeof((_0xe06360=window==null?void 0x0:window[_0x9fccf7(0x1c7)])==null?void 0x0:_0xe06360[_0x9fccf7(0x13a)])!=_0x9fccf7(0x173))}]})),(_0x48985c=(_0x53627b=_0x252bbf==null?void 0x0:_0x252bbf[_0x9fccf7(0x11e)])==null?void 0x0:_0x53627b[_0x9fccf7(0x106)])==null||_0x48985c['forEach'](_0x3803ba=>{const _0x12b317=_0x9fccf7;H[_0x12b317(0x1e1)](_0x3803ba[_0x12b317(0x148)]['name'])?H[_0x12b317(0xd6)](_0x3803ba):ae[_0x12b317(0x197)](_0x3803ba['message']['name'])&&ae['showContentCard'](_0x3803ba);}),L(_0x9fccf7(0x198),!0x1),C(_0x9fccf7(0x17f),!0x1);}),_0x3d14db=>{const _0x1f5f10=_0x5ea2;this[_0x1f5f10(0x152)]({'eventName':_0x1f5f10(0x20e),'eventProperties':[{'eventProperty':_0x1f5f10(0x148),'value':_0x1f5f10(0xc8)+_0x2c7ef2+_0x1f5f10(0x244)+_0x3d14db[_0x1f5f10(0x148)]}]},!0x0);},_0x160ff3);});},on=function(_0x263fa2,_0x109ca3,_0x15bad2){const _0x3d2e5a=_0x8a0233;if(!Object['prototype'][_0x3d2e5a(0xb4)][_0x3d2e5a(0x16d)](_0x263fa2,_0x109ca3))return'Event\x20'+_0x109ca3+_0x3d2e5a(0x19f);if(!_0x15bad2)return[];let _0x375468=_0x263fa2[_0x109ca3];if(!(_0x375468!=null&&_0x375468[_0x3d2e5a(0x150)]))return _0x3d2e5a(0x1ab)+_0x109ca3+'\x20does\x20not\x20have\x20a\x20valid\x20eventProperty.';let _0x1d70e8=_0x15bad2[_0x3d2e5a(0xea)](({eventProperty:_0x23842b})=>!Object[_0x3d2e5a(0x133)][_0x3d2e5a(0xb4)][_0x3d2e5a(0x16d)](_0x375468['eventProperty'],_0x23842b))[_0x3d2e5a(0x22a)](({eventProperty:_0x5e36b7})=>_0x5e36b7);return _0x1d70e8[_0x3d2e5a(0x1f9)]>0x0?_0x3d2e5a(0x1ab)+_0x109ca3+_0x3d2e5a(0x22b)+_0x1d70e8[_0x3d2e5a(0x211)](',\x20')+'.':_0x15bad2[_0x3d2e5a(0x22a)](({eventProperty:_0x23979d,value:_0x47bd2d})=>({'eventPropertyId':_0x375468['eventProperty'][_0x23979d]['id'],'value':_0x47bd2d}));},sn=function(_0x520a57){const _0x5b5e04=_0x8a0233;return{'customerId':localStorage[_0x5b5e04(0x11a)](_0x5b5e04(0x1bf))||'','deviceId':localStorage[_0x5b5e04(0x11a)](_0x5b5e04(0x80))||'','events':[_0x520a57]};},an=function(_0x1d0af8){const _0x35550b=_0x8a0233;s(0x1,_0x35550b(0x1ae)),s(0x1,_0x1d0af8);let _0x3462b5=localStorage[_0x35550b(0x11a)]('preInitializedEvents');_0x3462b5&&_0x3462b5!==_0x35550b(0x173)?(_0x3462b5=JSON[_0x35550b(0xa1)](_0x3462b5),_0x3462b5[_0x35550b(0x21b)](_0x1d0af8)):_0x3462b5=[_0x1d0af8],localStorage['setItem'](_0x35550b(0x171),JSON[_0x35550b(0x13f)](_0x3462b5));},cn=function(_0x381c15){const _0x351435=_0x8a0233;let _0x3d8ba0=JSON[_0x351435(0xa1)](localStorage[_0x351435(0x11a)](_0x351435(0x171))||'[]'),_0x2fe48a=_0x3d8ba0[_0x351435(0xf4)](_0x2602c3=>_0x2602c3[_0x351435(0x139)]===_0x381c15);_0x2fe48a>=0x0&&_0x3d8ba0[_0x351435(0x217)](_0x2fe48a,0x1),localStorage[_0x351435(0x124)]('preInitializedEvents',JSON[_0x351435(0x13f)](_0x3d8ba0));},m(j,X);var it=j,u=it[_0x8a0233(0x1fc)](),g=class extends Error{constructor(_0x896e73){const _0x4c3a4b=_0x8a0233;super(_0x896e73),this[_0x4c3a4b(0x12e)]=_0x4c3a4b(0x1a5);}};g[_0x8a0233(0x135)]=!0x1,g[_0x8a0233(0x103)]=!navigator[_0x8a0233(0x16f)],g[_0x8a0233(0x86)]=0x0,g[_0x8a0233(0x14e)]=!0x1,g[_0x8a0233(0xb6)]=!0x1;var vn=(_0x27161b,_0x21f4df)=>{const _0x383985=_0x8a0233;_0x21f4df instanceof g?s(0x2,_0x383985(0x164)+_0x27161b+_0x383985(0x7d)+_0x21f4df['message']):_0x21f4df instanceof Error?s(0x2,_0x383985(0x164)+_0x27161b+_0x383985(0x192)+_0x21f4df[_0x383985(0x148)]):s(0x2,_0x383985(0x164)+_0x27161b+'\x0aUnexpected\x20error:\x20'+String(_0x21f4df));},A=(_0x5774d1,_0x5cc934,_0x5c6e99,_0x2e0e2b=!0x1)=>a(void 0x0,null,function*(){const _0x3dbaa4=_0x8a0233;try{C(_0x5774d1,!0x0),L(_0x5774d1+_0x3dbaa4(0x207),!0x0);try{if(g[_0x3dbaa4(0x135)])throw new g(_0x3dbaa4(0x85));if(_0x5774d1!=='record\x20event'&&g[_0x3dbaa4(0x103)])throw new g(_0x3dbaa4(0x1f1));if(_0x5774d1!==_0x3dbaa4(0xc7)&&_0x5774d1!==_0x3dbaa4(0x119)&&_0x5774d1!==_0x3dbaa4(0x142)&&_0x5774d1!==_0x3dbaa4(0x175)&&!g[_0x3dbaa4(0x14e)])throw new g(_0x3dbaa4(0x19e));if(_0x5774d1!==_0x3dbaa4(0x1e6)&&g['loading'])throw new g('Mergn\x20is\x20loading!');return yield _0x5cc934();}catch(_0x66da6){return _0x5c6e99?_0x5c6e99(_0x66da6):(g[_0x3dbaa4(0x86)]===0x2||g[_0x3dbaa4(0x86)]===0x3)&&vn(_0x5774d1,_0x66da6),!_0x2e0e2b&&N[_0x3dbaa4(0x20c)]()==='67'&&_0x66da6[_0x3dbaa4(0x148)]!=='Failed\x20to\x20fetch'&&u['recordEvent']({'eventName':_0x3dbaa4(0x20e),'eventProperties':[{'eventProperty':_0x3dbaa4(0x148),'value':_0x5774d1+'\x20-\x20'+_0x66da6[_0x3dbaa4(0x148)]}]},!0x0),null;}finally{L(_0x5774d1+_0x3dbaa4(0x207),!0x1),C(_0x5774d1,!0x1);}}catch(_0x267512){return null;}}),U=(_0x37b18e=>(_0x37b18e[_0x37b18e[_0x8a0233(0x187)]=0x0]=_0x8a0233(0x187),_0x37b18e[_0x37b18e[_0x8a0233(0x10f)]=0x1]=_0x8a0233(0x10f),_0x37b18e[_0x37b18e[_0x8a0233(0x189)]=0x2]='ERROR',_0x37b18e[_0x37b18e[_0x8a0233(0x1d3)]=0x3]='ALL',_0x37b18e[_0x37b18e[_0x8a0233(0xfd)]=0x4]=_0x8a0233(0xfd),_0x37b18e))(U||{}),s=(_0x1fdf1d,_0x191ddf)=>{const _0x2f1f43=_0x8a0233;g[_0x2f1f43(0x86)]!==0x0&&(g[_0x2f1f43(0x86)]>=0x3?_0x1fdf1d===0x1?console[_0x2f1f43(0xa8)]('INFO:\x20'+new Date()[_0x2f1f43(0x145)](),_0x191ddf):_0x1fdf1d===0x2&&console[_0x2f1f43(0x205)]('ERROR:\x20'+new Date()[_0x2f1f43(0x145)](),_0x191ddf):g[_0x2f1f43(0x86)]===0x1&&_0x1fdf1d===0x1?console['info'](_0x2f1f43(0x17e)+new Date()[_0x2f1f43(0x145)](),_0x191ddf):g[_0x2f1f43(0x86)]===0x2&&_0x1fdf1d===0x2&&console[_0x2f1f43(0x205)](_0x2f1f43(0x7a)+new Date()[_0x2f1f43(0x145)](),_0x191ddf));},L=(_0x329bb0,_0x5196a5)=>{const _0x367c26=_0x8a0233;g[_0x367c26(0x86)]!==0x0&&(_0x5196a5?console[_0x367c26(0xca)](_0x329bb0):console[_0x367c26(0x1ef)](_0x329bb0));},C=(_0x1b542f,_0x25259a)=>{const _0x173fbe=_0x8a0233;g['debugLevel']!==0x0&&(_0x25259a?console[_0x173fbe(0x1b6)](_0x1b542f):console[_0x173fbe(0xf0)]());},pe,ee=class ee{constructor(){}static[_0x8a0233(0x1fc)](){return d(ee,pe)||I(ee,pe,new ee()),d(ee,pe);}[_0x8a0233(0xc7)](_0x581ede,_0x32d75f){setTimeout(()=>{A('init',()=>a(this,null,function*(){const _0x1e89cf=_0x5ea2;s(0x1,'Initializing\x20Mergn\x20SDK'),yield E['init'](_0x581ede,_0x32d75f),u[_0x1e89cf(0x99)]({'eventName':_0x1e89cf(0x1f6)}),s(0x1,_0x1e89cf(0x193));let _0x375053=JSON[_0x1e89cf(0xa1)](localStorage[_0x1e89cf(0x11a)](_0x1e89cf(0x1d7))||'[]');Array[_0x1e89cf(0x10a)](_0x375053)&&_0x375053[_0x1e89cf(0x1c9)]((_0xba2493,_0x3916ce)=>a(this,null,function*(){const _0x4ada8d=_0x1e89cf;yield me[_0x4ada8d(0x175)](_0xba2493[_0x4ada8d(0x172)],_0xba2493[_0x4ada8d(0x228)]),_0x375053[_0x4ada8d(0x217)](_0x3916ce,0x1),localStorage[_0x4ada8d(0x124)](_0x4ada8d(0x1d7),JSON['stringify'](_0x375053));})),window[_0x1e89cf(0x213)](_0x1e89cf(0xf1),()=>a(this,null,function*(){const _0x18142a=_0x1e89cf;g[_0x18142a(0x103)]=!0x1;let _0x17c4f1=JSON['parse'](localStorage[_0x18142a(0x11a)](_0x18142a(0xdf))||'[]');Array[_0x18142a(0x10a)](_0x17c4f1)&&(yield u[_0x18142a(0x242)]({'customerId':localStorage[_0x18142a(0x11a)](_0x18142a(0x1bf))||'','deviceId':localStorage['getItem'](_0x18142a(0x80))||'','events':_0x17c4f1}),localStorage[_0x18142a(0x1e7)](_0x18142a(0xdf))),E[_0x18142a(0xdb)](),E[_0x18142a(0x1d4)]();})),window[_0x1e89cf(0x213)](_0x1e89cf(0x103),()=>{g['offline']=!0x0;}),window[_0x1e89cf(0x213)](_0x1e89cf(0x231),()=>{const _0x5ec513=_0x1e89cf;H[_0x5ec513(0x1ec)](),W[_0x5ec513(0x117)]();});}));});}[_0x8a0233(0xc3)](_0x2f1a8f,_0xcf25eb){const _0xc74b2a=_0x8a0233;if(!(_0x2f1a8f in U)){console[_0xc74b2a(0x205)](_0xc74b2a(0x9b));return;}g[_0xc74b2a(0x179)]=_0xcf25eb||{},g[_0xc74b2a(0x86)]=_0x2f1a8f;try{W[_0xc74b2a(0x156)]({'debugLevel':_0x2f1a8f});}catch(_0xbe2834){}}['recordAttribute'](_0x382de8,_0x5644b9){return a(this,null,function*(){return new Promise((_0x24d474,_0x36e394)=>{setTimeout(()=>a(this,null,function*(){const _0x255159=_0x5ea2;try{yield A(_0x255159(0x175),()=>a(this,null,function*(){const _0x3e338b=_0x255159;let _0x11ae25;Array[_0x3e338b(0x10a)](_0x5644b9)?_0x11ae25=JSON[_0x3e338b(0x13f)](_0x5644b9):typeof _0x5644b9==_0x3e338b(0xec)?_0x11ae25=''+_0x5644b9:_0x11ae25=_0x5644b9,s(0x1,_0x3e338b(0xd5)),s(0x1,'Attribute\x20Name:\x20'+_0x382de8+_0x3e338b(0x21d)+_0x11ae25);let _0x5b4de7=JSON['parse'](localStorage['getItem']('preInitializedAttributes')||'[]');_0x5b4de7[_0x3e338b(0x21b)]({'attributeName':_0x382de8,'attrValueStringified':_0x11ae25}),localStorage[_0x3e338b(0x124)]('preInitializedAttributes',JSON[_0x3e338b(0x13f)](_0x5b4de7)),g[_0x3e338b(0x14e)]&&(yield me[_0x3e338b(0x175)](_0x382de8,_0x11ae25));})),_0x24d474();}catch(_0x590753){_0x36e394(_0x590753);}}));});});}[_0x8a0233(0x1e6)](_0xa2d343){return a(this,null,function*(){return new Promise((_0x2028a0,_0x5e0f9a)=>{setTimeout(()=>a(this,null,function*(){const _0x461f75=_0x5ea2;try{yield A('login',()=>a(this,null,function*(){const _0x3cf544=_0x5ea2;s(0x1,'Logging\x20in'),s(0x1,_0x3cf544(0x14c)+_0xa2d343),g[_0x3cf544(0xb6)]=!0x0,yield E['setIdentity'](_0xa2d343);})),_0x2028a0();}catch(_0x1d3565){_0x5e0f9a(_0x1d3565);}finally{g[_0x461f75(0xb6)]=!0x1,yield u['recordEventsFromQueue']();}}));});});}['logout'](){setTimeout(()=>{const _0x55138e=_0x5ea2;A(_0x55138e(0x14b),()=>a(this,null,function*(){const _0x4223d4=_0x55138e;s(0x1,_0x4223d4(0x1c8)),E[_0x4223d4(0x19c)]();}));});}['recordEvent'](_0x100322,_0x1eeb55){return a(this,null,function*(){return new Promise((_0x21bed7,_0x4a6a9b)=>{setTimeout(()=>a(this,null,function*(){try{yield A('record\x20event',()=>a(this,null,function*(){const _0x59ca82=_0x5ea2;s(0x1,_0x59ca82(0x17f)),s(0x1,_0x59ca82(0x7f)+{'eventName':_0x100322,'eventProperties':_0x1eeb55}),yield u[_0x59ca82(0x152)]({'eventName':_0x100322,'eventProperties':_0x1eeb55});})),_0x21bed7();}catch(_0x1aaa81){_0x4a6a9b(_0x1aaa81);}}));});});}[_0x8a0233(0x131)](){return mt;}};pe=new WeakMap(),m(ee,pe);var ot=ee,st=ot['getInstance']();typeof window!=_0x8a0233(0x173)&&(window[_0x8a0233(0xd4)]=st);function _0x5ea2(_0x23a87b,_0xe71919){const _0x8acfef=_0x8acf();return _0x5ea2=function(_0x5ea2ce,_0x31f2d4){_0x5ea2ce=_0x5ea2ce-0x79;let _0x3039b5=_0x8acfef[_0x5ea2ce];return _0x3039b5;},_0x5ea2(_0x23a87b,_0xe71919);}var Bi=st;export{Bi as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mergn-webapp-sdk",
3
- "version": "1.0.120",
3
+ "version": "1.0.121",
4
4
  "description": "",
5
5
  "author": "yaseenmergn123",
6
6
  "main": "./dist/index.js",
package/dist/index2.js DELETED
@@ -1,76 +0,0 @@
1
- /* Copyright (c) 2024 MERGN */
2
- var ln=Object.defineProperty,dn=Object.defineProperties;var un=Object.getOwnPropertyDescriptors;var ut=Object.getOwnPropertySymbols;var pn=Object.prototype.hasOwnProperty,gn=Object.prototype.propertyIsEnumerable;var gt=l=>{throw TypeError(l)};var pt=(l,e,t)=>e in l?ln(l,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):l[e]=t,z=(l,e)=>{for(var t in e||(e={}))pn.call(e,t)&&pt(l,t,e[t]);if(ut)for(var t of ut(e))gn.call(e,t)&&pt(l,t,e[t]);return l},Pe=(l,e)=>dn(l,un(e));var We=(l,e,t)=>e.has(l)||gt("Cannot "+t);var d=(l,e,t)=>(We(l,e,"read from private field"),t?t.call(l):e.get(l)),m=(l,e,t)=>e.has(l)?gt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(l):e.set(l,t),I=(l,e,t,n)=>(We(l,e,"write to private field"),n?n.call(l,t):e.set(l,t),t),i=(l,e,t)=>(We(l,e,"access private method"),t);var a=(l,e,t)=>new Promise((n,r)=>{var o=v=>{try{h(t.next(v))}catch(b){r(b)}},c=v=>{try{h(t.throw(v))}catch(b){r(b)}},h=v=>v.done?n(v.value):Promise.resolve(v.value).then(o,c);h((t=t.apply(l,e)).next())});var mt="1.0.120";var ge="https://u23z4zsda8.execute-api.ap-southeast-1.amazonaws.com/Prod/sdk-management/api",ke="/attribute",Et="/set-attribute",Fe="/event",vt="/record-event";var It="/customer",St="/device/add-device-token",ft="/set-identity",ht="/brand/get-web-push-public-key",bt="/brand/get-time";var yt=(v=>(v.UTM_SOURCE="utm_source",v.UTM_MEDIUM="utm_medium",v.UTM_CAMPAIGN="utm_campaign",v.UTM_TERM="utm_term",v.UTM_CONTENT="utm_content",v.GAD_SOURCE="gad_source",v.GCLID="gclid",v.FBCLID="fbclid",v))(yt||{});var wt=new Set(Object.values(yt));var te="Popup Action";var re,$,ne,w=class w{constructor(){m(this,$)}static getInstance(){return d(w,re)||I(w,re,new w),d(w,re)}updateAPIKey(e){w.apiKey=e;let t=e,n=/m(\d+)rgn/,r=t.match(n);r&&(w.brandId=r[1])}getAPIKey(){return w.apiKey}getBrandId(){return w.brandId}get(e){return a(this,null,function*(){try{return(yield fetch(ge+e,{headers:{Authorization:i(this,$,ne).call(this,w.apiKey),"Content-Type":"application/json"}})).json()}catch(t){let n=t.message;return this.getBrandId()==="67"&&n!=="Failed to fetch"&&n!=="Failed to load"&&u.recordEvent({eventName:"Debug Event",eventProperties:[{eventProperty:"message",value:`get - ${e} - ${i(this,$,ne).call(this,w.apiKey)} - ${t.message}`}]},!0),Promise.reject(t)}})}post(e,t,n){return a(this,null,function*(){try{return(yield fetch(ge+e,{body:JSON.stringify(t||{}),headers:{Authorization:i(this,$,ne).call(this,w.apiKey),"Content-Type":"application/json"},method:"POST",signal:n})).json()}catch(r){let o=r.message;return this.getBrandId()==="67"&&o!=="Failed to fetch"&&o!=="Failed to load"&&u.recordEvent({eventName:"Debug Event",eventProperties:[{eventProperty:"message",value:`post - ${e} - ${i(this,$,ne).call(this,w.apiKey)} - ${JSON.stringify(t||{})} -${r.message}`}]},!0),Promise.reject(r)}})}put(e,t){return a(this,null,function*(){return(yield fetch(ge+e,{body:JSON.stringify(t||{}),headers:{Authorization:i(this,$,ne).call(this,w.apiKey),"Content-Type":"application/json"},method:"PUT"})).json()})}syncRealWorldTime(){return a(this,null,function*(){try{let e=(yield(yield fetch(ge+bt)).json()).data;w.UTCDate=new Date(e),w.lastSyncTime=new Date}catch(e){s(2,"Failed to sync real-world time")}})}getCurrentUTCDate(){if(!w.UTCDate||!w.lastSyncTime)return s(2,"UTC Date or last sync time is not set"),new Date;let t=new Date().getTime()-w.lastSyncTime.getTime();return new Date(w.UTCDate.getTime()+t)}};re=new WeakMap,$=new WeakSet,ne=function(e){return btoa(`${e}:${new Date().getTime()}`)},m(w,re);var Be=w,N=Be.getInstance();var G,ie,x,Tt,$e,Pt,Nt,V=class V{constructor(){m(this,x);m(this,ie,!1)}static getInstance(){var e;return d(V,G)||(I(V,G,new V),i(e=d(V,G),x,Tt).call(e)),d(V,G)}recordAttribute(e,t,n){return a(this,null,function*(){yield A("# recordAttribute",()=>a(this,null,function*(){if(s(1,"Recording attribute"),C("Recording attribute",!0),L("Recording attribute Time",!0),s(1,`Attribute Payload:
3
- ${{attributeName:e,attributeProperties:n,attributeValue:t}})}`),!t||t===""){s(2,"Attribute value is required");return}yield E.checkTTL(),yield i(this,x,Pt).call(this);let r=JSON.parse(localStorage.getItem("attributes")||"{}"),o=n?i(this,x,$e).call(this,r,e,n):i(this,x,$e).call(this,r,e);if(typeof o=="string"){s(2,o);return}r[e].should_set_identity&&(yield E.setIdentity(typeof t=="string"?t:JSON.stringify(t))),E.updateSessionCreated();let{id:c}=r[e],h={attributeId:c,attributeProperties:o,customerId:localStorage.getItem("customer")||"",value:t};yield i(this,x,Nt).call(this,h);let v=JSON.parse(localStorage.getItem("preInitializedAttributes")||"[]");v.pop(),localStorage.setItem("preInitializedAttributes",JSON.stringify(v)),L("Recording attribute Time",!1),C("Recording attribute",!1)}))})}storeAttributeInLocalStorage(){return a(this,null,function*(){if(!localStorage.getItem("attributes")&&!d(this,ie)){I(this,ie,!0);try{let e=(yield this.fetchAttributeData()).data;e&&localStorage.setItem("attributes",JSON.stringify(e))}catch(e){throw new Error("Error storing attribute data in local storage")}finally{I(this,ie,!1)}}})}fetchAttributeData(){return a(this,null,function*(){try{return yield N.get(`${ke}`)}catch(e){throw new Error("Error fetching attribute data")}})}};G=new WeakMap,ie=new WeakMap,x=new WeakSet,Tt=function(){return a(this,null,function*(){})},$e=function(e,t,n){if(!Object.prototype.hasOwnProperty.call(e,t))return`Attribute ${t} is not valid.`;if(!n)return[];let r=e[t];if(!(r!=null&&r.attributeProperty))return`Attribute ${t} does not have a valid attributeProperty.`;let o=n.filter(({attributeProperty:c})=>!Object.prototype.hasOwnProperty.call(r.attributeProperty,c)).map(({attributeProperty:c})=>c);return o.length>0?`Attribute ${t} has invalid attributeProperties: ${o.join(", ")}.`:n.map(({attributeProperty:c,value:h})=>({attributePropertyId:r.attributeProperty[c].id,value:h}))},Pt=function(){return a(this,null,function*(){localStorage.getItem("attributes")||(yield this.storeAttributeInLocalStorage())})},Nt=function(e){return a(this,null,function*(){try{return yield N.post(`${ke}${Et}`,e)}catch(t){throw new Error("Error posting attribute record")}})},m(V,G);var Me=V,me=Me.getInstance();var Ve="Content Card Action";var Y,T,At,Je,Rt,Ot,se,Ne,Lt,Ct,Dt,_e,K=class K{constructor(){m(this,T);m(this,se,e=>{E.clearActionInLocalStorage({id:e,localStorageKey:"action"})});this.loadContentCardEventActionInLocalStorage=()=>{E.loadActionInLocalStorage({actionCondition:e=>e.message.name==="ContentCard",actionMethod:e=>i(this,T,Je).call(this,e.campaignId),localStorageKey:"action"})};m(this,_e,()=>{E.storeActionInLocalStorageInternal("action")})}static getInstance(){var e;return d(K,Y)||(I(K,Y,new K),i(e=d(K,Y),T,At).call(e)),d(K,Y)}showContentCard(e){let t=JSON.parse(localStorage.getItem("action")||"{}");if(t&&t[e==null?void 0:e.campaignId]){s(1,"ContentCard already in cache");return}i(this,T,Dt).call(this,e),d(this,_e).call(this),i(this,T,Je).call(this,e.campaignId)}isContentCardAction(e){return e==="content_card"}};Y=new WeakMap,T=new WeakSet,At=function(){return a(this,null,function*(){})},Je=function(e){let t=i(this,T,Rt).call(this);if(document.getElementById(`contentCard_container_${e}`)){s(1,"ContentCard already displayed"),d(this,se).call(this,e);return}if(t!=null&&t[e])switch(t[e].campaignEntryTime){case"DELAY":{i(this,T,Ot).call(this,t[e]);break}case"IMMEDIATELY":{i(this,T,Ne).call(this,t[e]);break}case"SCROLL":{i(this,T,Ct).call(this,t[e]);break}default:return}},Rt=function(){let e=localStorage.getItem("action");return e?JSON.parse(e):null},Ot=function(e){E.showDelayedAction({clearActionMethod:d(this,se).bind(this),data:e,displayMethod:i(this,T,Ne).bind(this),idKey:"campaignId",timeValueKey:"campaignEntryTimeValue"})},se=new WeakMap,Ne=function(e){var t;if(document.getElementById(`contentCard_container_${e.campaignId}`))s(1,"ContentCard already displayed");else{let n=i(this,T,Lt).call(this,"div",e),r=document.querySelector(`#${e.message.divId}`);r&&(r.innerHTML=n.outerHTML,u.recordEvent({campaignCustomerInstanceId:e.campaignCustomerInstanceId,campaignId:e.campaignId,eventName:Ve,eventProperties:[{eventProperty:"Content Card View",value:JSON.stringify({campaignId:e.campaignId})}],name:"view"}),(t=document.getElementById(`contentCard_container_${e.campaignId}`))==null||t.addEventListener("click",()=>{u.recordEvent({campaignCustomerInstanceId:e.campaignCustomerInstanceId,campaignId:e.campaignId,eventName:Ve,eventProperties:[{eventProperty:"Content Card Click",value:JSON.stringify({campaignId:e.campaignId})}],name:"click"})}))}d(this,se).call(this,e.campaignId)},Lt=function(e,t){var c;let{campaignId:n,message:{design:r}}=t,o=document.createElement(e);return o.id=`contentCard_container_${n}`,o.innerHTML=r,(c=o.querySelector(".u-close-button"))==null||c.remove(),o},Ct=function(e){E.showAfterScrollAction({data:e,displayMethod:i(this,T,Ne).bind(this),timeValueKey:"campaignEntryTimeValue"})},Dt=function(e){E.storeActionInLocalStorage(e,"action","campaignId")},_e=new WeakMap,m(K,Y);var Ke=K,ae=Ke.getInstance();var ce,B,le,q,Ee,ve,S,je,Ut,ze,Ae,xt,Le,Re,Ge,Wt,Oe,Ie,kt,f=class f{constructor(){m(this,S);this.permission=null;this.pushMessageToSW=e=>{s(1,"Pushing message to service worker"),navigator.serviceWorker.getRegistrations().then(t=>{var n,r;s(1,"Service Worker registration"),(n=t[0])!=null&&n.active&&(s(1,"Service Worker ready"),(r=t[0].active)==null||r.postMessage(JSON.stringify(e)))}).catch(t=>{s(2,`Failed to push message to service worker: ${t.message}`)})};this.loadWebPushActionInLocalStorage=()=>{E.loadActionInLocalStorage({actionCondition:()=>!0,actionMethod:e=>i(this,S,Re).call(this,Number(e.web_optin_instance_id)),localStorageKey:"web_push_action"})};m(this,Le,()=>{E.storeActionInLocalStorageInternal("web_push_action")});m(this,Ie,e=>{E.clearActionInLocalStorage({id:e,localStorageKey:"web_push_action"})})}static getInstance(){return d(f,ce)||I(f,ce,new f),d(f,ce)}init(e,t){return a(this,null,function*(){var n;if(s(1,"Initializing Notification Service"),u.recordDebugEvents({eventName:"init",eventProperties:[{eventProperty:"service_worker",value:"serviceWorker"in navigator},{eventProperty:"push_manager",value:"PushManager"in window}]}),"serviceWorker"in navigator&&"PushManager"in window){s(1,"Service Worker and Push Manager are supported");try{u.recordDebugEvents({eventName:"init_condition"}),I(f,B,yield navigator.serviceWorker.register(t||"/mergn-sw.js")),s(1,"Service Worker registered"),s(1,"Pushing message to service worker for initialization"),this.pushMessageToSW({customer:localStorage.getItem("customer")||"",events:u.getStoredEvents(),API_KEY:N.getAPIKey(),device_id:localStorage.getItem("uniqueIdentity")||"",operatingSystem:E.getOperatingSystem(),osVersion:E.getOSVersion(),Platform:E.getPlatform()}),I(f,Ee,!0);let r=i(this,S,Ge).call(this),o=Object.keys(r||{});if(o.length&&i(this,S,Re).call(this,Number(o[0])),!e)return;let c=yield(n=d(f,B))==null?void 0:n.pushManager.getSubscription();s(1,"Checking for existing subscription"),d(f,B)&&(s(1,"Service Worker registration is available"),d(f,B).update()),c?(s(1,"Existing subscription found"),u.recordDebugEvents({eventName:"existing_subscription"}),yield i(this,S,Ae).call(this),I(f,le,!0)):(s(1,"No existing subscription found"),yield i(this,S,je).call(this,d(f,ve)||void 0))}catch(r){let o=r&&r.message?r.message.substring(0,100):"undefined";yield u.recordDebugEvents({eventName:"Reachability Push Web",eventProperties:[{eventProperty:"message",value:`${o}`}]}),s(2,"Service Worker registration failed:"),s(2,o)}}})}showNotification(e){if(!d(f,Ee)){I(f,ve,e),u.recordDebugEvents({eventName:"notification_service_not_initialized"}),s(2,"Notification service is not initialized");return}A("showNotification",()=>a(this,null,function*(){let t=JSON.parse(localStorage.getItem("web_push_action")||"{}");if(t&&t[e.web_optin_instance_id]){s(1,"Notification already in cache");return}i(this,S,xt).call(this,e),d(this,Le).call(this),i(this,S,Re).call(this,e.web_optin_instance_id)}))}};ce=new WeakMap,B=new WeakMap,le=new WeakMap,q=new WeakMap,Ee=new WeakMap,ve=new WeakMap,S=new WeakSet,je=function(e){return a(this,null,function*(){s(1,`Checking notification permission: ${JSON.stringify(e)} `),u.recordDebugEvents({eventName:"check_permission"});let t;try{t=Notification.permission,t&&(s(1,`Notification permission: ${t}`),t==="default"?(e||(this.permission="default",u.recordDebugEvents({eventName:"Turned Off Notification Reset Permission"})),e&&(u.recordDebugEvents({eventName:"notification_data",eventProperties:[{eventProperty:"type",value:`${e==null?void 0:e.type}`}]}),d(this,Ie).call(this,e.web_optin_instance_id),e.type==="two_step"?i(this,S,Ut).call(this,e):yield i(this,S,ze).call(this,e))):t==="denied"?(u.recordDebugEvents({eventName:"Turned Off Notification"}),s(1,"The user has blocked notifications.")):(u.recordDebugEvents({eventName:"already_registered"}),s(1,"The user has already enabled notifications."),d(f,le)||(yield i(this,S,Ae).call(this),yield u.recordEvent({eventName:"Already Registered To Web Push"}),e||I(f,le,!0))))}catch(n){s(2,"Failed to check notification permission"),u.recordDebugEvents({eventName:"notification_permission_error"})}})},Ut=function(e){try{let t=document.createElement("div"),n;e.banner_design.banner_image&&(n=document.createElement("img"),n.src=e.banner_design.banner_image,n.alt="Image",n.id="centered-image");let r=document.createElement("div"),o=document.createElement("div"),c=document.createElement("div"),h=document.createElement("img"),v=document.createElement("div"),b=document.createElement("div"),y=document.createElement("div"),D=document.createElement("div"),k=document.createElement("div"),F=document.createElement("div"),O=document.createElement("button"),_=document.createElement("button");t.className="mergn-overlay",r.className="mergnWebPushPopup",o.className=D.className=k.className="mergn-row",c.className="mergn-column-25",v.className="mergn-column-75",F.className="button-container",b.id="title",y.id="subtitle",O.id="button-1",_.id="button-2",h.src=e.banner_design.banner_icon,h.alt="Image",h.id="logo",b.textContent=e.banner_design.banner_title,y.textContent=e.banner_design.banner_text,O.textContent=e.banner_design.button_1.text,_.textContent=e.banner_design.button_2.text,c.appendChild(h),v.appendChild(b),v.appendChild(y),o.appendChild(c),o.appendChild(v),n&&(D.appendChild(n),n.style.cssText=`
4
- max-width: 100%;
5
- height: auto;
6
- display: block;
7
- margin-left: auto;
8
- margin-right: auto;
9
- border-radius: 10px;
10
- max-width: 350px;
11
- aspect-ratio: 2 / 1;
12
- `),F.appendChild(O),F.appendChild(_),k.appendChild(F),r.appendChild(o),r.appendChild(D),r.appendChild(k),t.appendChild(r),t.style.cssText=`
13
- position: fixed;
14
- top: 0;
15
- left: 0;
16
- width: 100%;
17
- height: 100%;
18
- background-color: rgba(0, 0, 0, 0.5);
19
- z-index: 99999999999;
20
- display: flex;
21
- justify-content: center;
22
- align-items: start;
23
- `,r.style.cssText=`
24
- background-color: ${e.banner_design.banner_color};
25
- padding: 15px;
26
- border-radius: 5px;
27
- max-width: 380px;
28
- max-height: 463px;
29
- `,o.style.cssText=D.style.cssText=k.style.cssText=`
30
- display: flex;
31
- flex-wrap: wrap;
32
- margin-bottom: 10px;
33
- `,c.style.cssText=`
34
- width: 25%;
35
- `,v.style.cssText=`
36
- width: 73%;
37
- margin-left: 2%;
38
- `,h.style.cssText=`
39
- max-width: 100%;
40
- height: auto;
41
- `,O.style.cssText=`
42
- padding: 12px 20px;
43
- border: none;
44
- background-color: ${e.banner_design.button_1.backgroundColor};
45
- color: ${e.banner_design.button_1.color};
46
- cursor: pointer;
47
- border-radius: 5px;
48
- width: 48%;
49
- `,_.style.cssText=`
50
- padding: 12px 20px;
51
- border: none;
52
- background-color: ${e.banner_design.button_2.backgroundColor};
53
- color: ${e.banner_design.button_2.color};
54
- cursor: pointer;
55
- border-radius: 5px;
56
- width: 48%;
57
- `,F.style.cssText=`
58
- display: flex;
59
- justify-content: space-between;
60
- align-items: center;
61
- flex-wrap: nowrap;
62
- width: 100%;
63
- `,b.style.cssText=`
64
- margin-bottom: 5px;
65
- font-size: 16px;
66
- color: ${e.banner_design.text_color}
67
- `,y.style.cssText=`
68
- margin-bottom: 5px;
69
- font-size: 13px;
70
- color: ${e.banner_design.text_color}
71
- `,document.body.appendChild(t),document.body.style.overflow="hidden",u.recordEvent({eventName:"Viewed Web Push Soft-ask",name:"viewed",web_optin_instance_id:e.web_optin_instance_id}),O==null||O.addEventListener("click",()=>a(this,null,function*(){t.remove(),I(f,q,!1),document.body.style.overflow="auto",yield u.recordEvent({eventName:"Denied Web Push Soft-ask",web_optin_instance_id:e.web_optin_instance_id}),s(1,"User denied the notification permission.")})),_==null||_.addEventListener("click",()=>a(this,null,function*(){t.remove(),document.body.style.overflow="auto",u.recordEvent({eventName:"Accepted Web Push Soft-ask",web_optin_instance_id:e.web_optin_instance_id}),yield i(this,S,ze).call(this,e)}))}catch(t){}},ze=function(e){return a(this,null,function*(){try{u.recordEvent({eventName:"Displayed Web Push Subscription",name:"viewed",web_optin_instance_id:e.web_optin_instance_id});let t=yield Notification.requestPermission();t==="granted"?(s(1,"User granted the notification permission."),yield i(this,S,Ae).call(this),yield u.recordEvent({eventName:"Allowed Web Push Subscription",name:"subscribed",web_optin_instance_id:e.web_optin_instance_id})):t==="denied"?(yield u.recordEvent({eventName:"Blocked Web Push Subscription"}),s(1,"User denied the notification permission.")):t==="default"&&(yield u.recordEvent({eventName:"Closed Web Push Subscription"}),s(1,"User closed the notification permission dialog."))}catch(t){s(2,"Failed to request notification permission")}I(f,q,!1)})},Ae=function(){return a(this,null,function*(){var t,n;let e=yield N.get(`${ht}`);if(e.success){let r=yield(t=d(f,B))==null?void 0:t.pushManager.getSubscription();r&&(yield r.unsubscribe());let o=yield(n=d(f,B))==null?void 0:n.pushManager.subscribe({applicationServerKey:e.data||"",userVisibleOnly:!0});yield N.put(`${St}`,{device_id:localStorage.getItem("uniqueIdentity")||"",is_web_push_subscribed:!0,web_push_subscription_page_url:window.location.pathname,web_push_token:{token:JSON.parse(JSON.stringify(o))}}),s(1,"User is subscribed")}else throw new Error("Failed to subscribe the user")})},xt=function(e){E.storeActionInLocalStorage(e,"web_push_action","web_optin_instance_id")},Le=new WeakMap,Re=function(e){if(d(f,q))return;I(f,q,!0);let t=i(this,S,Ge).call(this);if(t!=null&&t[e])switch(t[e].entry_time){case"DELAY":{i(this,S,Wt).call(this,t[e]);break}case"IMMEDIATELY":{i(this,S,Oe).call(this,t[e]);break}case"SCROLL":{i(this,S,kt).call(this,t[e]);break}default:return}},Ge=function(){let e=localStorage.getItem("web_push_action");return e?JSON.parse(e):null},Wt=function(e){E.showDelayedAction({clearActionMethod:d(this,Ie).bind(this),data:e,displayMethod:i(this,S,Oe).bind(this),idKey:"web_optin_instance_id",timeValueKey:"entry_time_value"})},Oe=function(e){i(this,S,je).call(this,e)},Ie=new WeakMap,kt=function(e){E.showAfterScrollAction({data:e,displayMethod:i(this,S,Oe).bind(this),timeValueKey:"entry_time_value"})},m(f,ce),m(f,B,null),m(f,le,!1),m(f,q,!1),m(f,Ee,!1),m(f,ve,null);var He=f,W=He.getInstance();var Q,P,Ft,qe,Bt,Mt,de,Ce,$t,Vt,Kt,De,J=class J{constructor(){m(this,P);m(this,de,e=>{E.clearActionInLocalStorage({id:e,localStorageKey:"action"})});this.loadPopupEventActionInLocalStorage=()=>{E.loadActionInLocalStorage({actionCondition:e=>e.message.name==="Popup",actionMethod:e=>i(this,P,qe).call(this,e.campaignId),localStorageKey:"action"})};m(this,De,()=>{E.storeActionInLocalStorageInternal("action")})}static getInstance(){var e;return d(J,Q)||(I(J,Q,new J),i(e=d(J,Q),P,Ft).call(e)),d(J,Q)}showPopup(e){let t=JSON.parse(localStorage.getItem("action")||"{}");if(t&&t[e==null?void 0:e.campaignId]){s(1,"Popup already in cache");return}i(this,P,Kt).call(this,e),d(this,De).call(this),i(this,P,qe).call(this,e.campaignId)}isPopupAction(e){return e==="Popup"}};Q=new WeakMap,P=new WeakSet,Ft=function(){return a(this,null,function*(){})},qe=function(e){let t=i(this,P,Bt).call(this);if(document.getElementById(`popup_container_${e}`)){s(1,"Popup already displayed"),d(this,de).call(this,e);return}if(t!=null&&t[e])switch(t[e].campaignEntryTime){case"DELAY":{i(this,P,Mt).call(this,t[e]);break}case"IMMEDIATELY":{i(this,P,Ce).call(this,t[e]);break}case"SCROLL":{i(this,P,Vt).call(this,t[e]);break}default:return}},Bt=function(){let e=localStorage.getItem("action");return e?JSON.parse(e):null},Mt=function(e){E.showDelayedAction({clearActionMethod:d(this,de).bind(this),data:e,displayMethod:i(this,P,Ce).bind(this),idKey:"campaignId",timeValueKey:"campaignEntryTimeValue"})},de=new WeakMap,Ce=function(e){if(document.getElementById(`popup_container_${e.campaignId}`))s(1,"Popup already displayed");else{let t=i(this,P,$t).call(this,"div",e);document.body.appendChild(t),u.recordEvent({campaignCustomerInstanceId:e.campaignCustomerInstanceId,campaignId:e.campaignId,eventName:te,eventProperties:[{eventProperty:"Popup View",value:JSON.stringify({campaignId:e.campaignId})}],name:"view"})}d(this,de).call(this,e.campaignId)},$t=function(e,t){let{campaignCustomerInstanceId:n,campaignId:r,message:{design:o}}=t,c=document.createElement(e);c.id=`popup_container_${r}`,c.innerHTML=o,c.style.position="fixed",c.style.top="0",c.style.left="0",c.style.width="100%",c.style.height="100%",c.style.zIndex="99999999";let h=c.querySelector(".u-popup-container");h&&(h.style.zIndex="50");let v=h.querySelector(".u-popup-overlay");v&&(s(1,"Popup overlay element found"),v.style.setProperty("display","block","important")),c.querySelectorAll('[id^="u_content_form_"]').forEach(y=>{let D=y.querySelector("form");D&&D.addEventListener("submit",()=>a(this,null,function*(){c.remove();let k=new FormData(D),F={};for(let[O,_]of k.entries())F[O]=_;yield u.recordEvent({campaignCustomerInstanceId:n,campaignId:r,eventName:te,eventProperties:[{eventProperty:"Form Submit",value:JSON.stringify({campaignId:r,formId:y.id,formValues:F})},{eventProperty:"Campaign Id",value:r.toString()}],name:"form"})}))});let b=c.querySelector(".u-close-button");return(b==null?void 0:b.getAttribute("href"))==="#"&&b.removeAttribute("href"),b==null||b.addEventListener("click",()=>a(this,null,function*(){c.remove(),yield u.recordEvent({campaignCustomerInstanceId:n,campaignId:r,eventName:te,eventProperties:[{eventProperty:"Close Click",value:JSON.stringify({campaignId:r})}],name:"close"})})),c.querySelectorAll('[id^="u_content_button_"]').forEach(y=>{y.addEventListener("click",()=>a(this,null,function*(){c.remove(),yield u.recordEvent({campaignCustomerInstanceId:n,campaignId:r,eventName:te,eventProperties:[{eventProperty:"Button Click",value:JSON.stringify({buttonId:y.id,campaignId:r})}],name:"click"})}))}),c.querySelectorAll(".u-popup-container img").forEach(y=>{y.addEventListener("click",()=>a(this,null,function*(){c.remove(),yield u.recordEvent({campaignCustomerInstanceId:n,campaignId:r,eventName:te,eventProperties:[{eventProperty:"Image Click",value:JSON.stringify({campaignId:r,imageClassName:y.className,imageId:y.id})}],name:"click"})}))}),c},Vt=function(e){E.showAfterScrollAction({data:e,displayMethod:i(this,P,Ce).bind(this),timeValueKey:"campaignEntryTimeValue"})},Kt=function(e){E.storeActionInLocalStorage(e,"action","campaignId")},De=new WeakMap,m(J,Q);var Ye=J,H=Ye.getInstance();var ue,fe,he,be,ye,we,Te,Ue,p,Ht,jt,zt,Se,Ze,Xe,et,tt,Gt,Yt,qt,Qt,Zt,Xt,en,nt,rt,tn,nn,Z=class Z{constructor(){m(this,p);m(this,fe);m(this,he);m(this,be);m(this,ye,null);m(this,we,null);m(this,Te,!1);m(this,Ue,()=>{setInterval(()=>{let e=localStorage.getItem("mergn_shopify");if(e!==d(this,we)){I(this,we,e);let t=JSON.parse(e||"{}");if(t!=null&&t.pushMessageToSW){let n=t.pushMessageToSW;delete t.pushMessageToSW,localStorage.setItem("mergn_shopify",JSON.stringify(t)),W.pushMessageToSW(n)}if(t!=null&&t.optIn){let n=t.optIn;delete t.optIn,localStorage.setItem("mergn_shopify",JSON.stringify(t)),W.showNotification(n)}if(t!=null&&t.campaigns){let n=t.campaigns;delete t.campaigns,localStorage.setItem("mergn_shopify",JSON.stringify(t)),n.forEach(r=>{H.isPopupAction(r.message.name)?H.showPopup(r):ae.isContentCardAction(r.message.name)&&ae.showContentCard(r)})}}},1e3)});this.storeActionInLocalStorageInternal=e=>{let t=()=>{let n=JSON.parse(localStorage.getItem(e)||"{}");Object.keys(n).forEach(r=>{n[r].initialTime=new Date().getTime()}),localStorage.setItem(e,JSON.stringify(n))};t(),window.addEventListener("beforeunload",t)};this.clearActionInLocalStorage=({id:e,localStorageKey:t})=>{let n=JSON.parse(localStorage.getItem(t)||"{}");n[e]&&delete n[e],localStorage.setItem(t,JSON.stringify(n))};this.loadActionInLocalStorage=({actionCondition:e,actionMethod:t,localStorageKey:n})=>{let r=JSON.parse(localStorage.getItem(n)||"{}");Object.keys(r).forEach(o=>{e(r[o])&&t(r[o])})}}static getInstance(){return d(Z,ue)||I(Z,ue,new Z),d(Z,ue)}init(e,t){return a(this,null,function*(){s(1,"Initializing base service"),t!=null&&t.shopify&&I(this,Te,!0),i(this,p,Ht).call(this,e);let n=this.getPlatform();if(n==="Crawlers"||n==="Unknown"){s(2,"Not initializing base service for crawlers or unknown platforms");return}if(yield N.syncRealWorldTime(),s(1,"Verifying API Key"),yield i(this,p,nt).call(this),t!=null&&t.shopify&&d(this,Ue).call(this),t!=null&&t.identity)try{g.loading=!0,yield this.setIdentity(t.identity)}finally{g.loading=!1}setInterval(()=>a(this,null,function*(){s(1,"Verifying API Key after timeout"),yield i(this,p,nt).call(this)}),3e5);let r=i(this,p,Se).call(this);if(yield this.checkTTL(),yield u.recordEventsFromQueue(),u.recordDebugEvents({eventName:"base_init"}),s(1,"Initializing notification service from Base Service"),yield A("notification service",()=>a(this,null,function*(){yield W.init(r,t==null?void 0:t.swPath)})),!(t!=null&&t.shopify)){yield i(this,p,nn).call(this);let o=history.pushState;history.pushState=(...c)=>{o.apply(history,c),i(this,p,tn).call(this)}}s(1,"tracking page change register")})}setPlatform(e){I(this,fe,e)}setOSVersion(e){I(this,he,e)}setOperatingSystem(e){I(this,be,e)}setPreviousUrl(e){I(this,ye,e)}getPreviousUrl(){return d(this,ye)}getPlatform(){return d(this,fe)}getOSVersion(){return d(this,he)}getOperatingSystem(){return d(this,be)}updateSessionCreated(){localStorage.setItem("ttl",`${new Date().getTime()}`)}showAfterScrollAction({data:e,displayMethod:t,timeValueKey:n}){let r=()=>{var b;let o=window.innerHeight,c=document.documentElement.scrollHeight;window.scrollY/(c-o)*100>(((b=e[n])==null?void 0:b.value)||0)&&(window.removeEventListener("scroll",r),t(e))};window.addEventListener("scroll",r)}showDelayedAction({clearActionMethod:e,data:t,displayMethod:n,idKey:r,timeValueKey:o}){var v,b,y;let c=(v=t[o])==null?void 0:v.value;((b=t[o])==null?void 0:b.duration)==="min"&&(c=c*60);let h=t.initialTime-500+(c||0)*1e3-new Date().getTime();s(1,`Initial time: ${t.initialTime}`),s(1,`Time value: ${(y=t[o])==null?void 0:y.value}`),s(1,`Current time: ${new Date().getTime()}`),s(1,`Time difference: ${h}`),h>0?setTimeout(()=>{e(t[r]),n(t)},h):(e(t[r]),n(t))}storeActionInLocalStorage(e,t,n){var c;let r=JSON.parse(localStorage.getItem(t)||"{}"),o=(c=n in e&&e[n])!=null?c:"";o&&(r[o]=Pe(z({},e),{initialTime:new Date().getTime()}),localStorage.setItem(t,JSON.stringify(r)))}checkTTL(){return a(this,null,function*(){yield A("# check TTL",()=>a(this,null,function*(){if(d(this,Te))return;s(1,"Checking TTL"),C("Checking TTL",!0),L("Checking TTL Time",!0);let e=localStorage.getItem("ttl"),t=!1;if(e){if(t=i(this,p,Se).call(this,e),t){let n=localStorage.getItem("session"),r=localStorage.getItem("ttl");n&&r&&u.recordEvent({eventName:"Web Session Concluded",eventProperties:[{eventProperty:"SESSION_ID",value:localStorage.getItem("session")},{eventProperty:"SESSION_CREATED",value:new Date(parseInt(r,10)).toISOString()}]}),this.clearLocalStorage(),localStorage.setItem("ttl",`${new Date().getTime()}`)}}else localStorage.setItem("ttl",`${new Date().getTime()}`);(!e||t||i(this,p,Yt).call(this))&&(i(this,p,tt).call(this)&&i(this,p,qt).call(this),i(this,p,et).call(this)&&(yield this.setIdentity()),(i(this,p,Se).call(this)||i(this,p,Ze).call(this))&&(yield i(this,p,Xt).call(this)),yield i(this,p,Qt).call(this),(i(this,p,Se).call(this)||i(this,p,Xe).call(this))&&(yield i(this,p,en).call(this))),L("Checking TTL Time",!1),C("Checking TTL",!1)}))})}clearLocalStorage(){localStorage.removeItem("action"),localStorage.removeItem("events"),localStorage.removeItem("attributes"),localStorage.removeItem("offlineEvents"),localStorage.removeItem("ttl"),localStorage.removeItem("session")}setIdentity(e){return a(this,null,function*(){let t={deviceId:localStorage.getItem("uniqueIdentity")||crypto.randomUUID(),os:this.getPlatform()};if(e)t.identity=e;else if(!e&&localStorage.getItem("customer"))return;try{let n=yield i(this,p,Zt).call(this,t);if(n!==void 0){localStorage.setItem("customer",n);try{W.pushMessageToSW({customer:n})}catch(r){}}}catch(n){throw new Error("Error setting identity")}})}};ue=new WeakMap,fe=new WeakMap,he=new WeakMap,be=new WeakMap,ye=new WeakMap,we=new WeakMap,Te=new WeakMap,Ue=new WeakMap,p=new WeakSet,Ht=function(e){N.updateAPIKey(e),this.setPlatform(i(this,p,jt).call(this)),this.setOSVersion(i(this,p,zt).call(this)),this.setOperatingSystem(navigator.userAgent)},jt=function(){var t;let e=navigator.userAgent.toLowerCase();return/googlebot|bingbot|yandexbot|duckduckbot|slurp|twitterbot|linkedinbot|facebot|pinterest|vkshare|applebot|baiduspider|adsbot-google|msnbot|yahoobot|sogou|facebookexternalhit/i.test(e)?"Crawlers":/wv|wkwebview|instagram|facebook|fbav|fban|twitter|snapchat|pinterest|linkedin|tiktok/i.test(e)?"Mobile":/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(e)?("Notification"in window&&typeof((t=window==null?void 0:window.Notification)==null?void 0:t.permission)!="undefined","Mobile"):/windows|macintosh|linux|x11/i.test(e)?"Web":"Unknown"},zt=function(){let e=navigator.userAgent,t;return e.indexOf("Chrome")>-1?t="Google Chrome":e.indexOf("Safari")>-1?t="Safari":e.indexOf("Firefox")>-1?t="Mozilla Firefox":e.indexOf("Edg")>-1?t="Microsoft Edge":e.indexOf("MSIE")>-1?t="Internet Explorer":t="Unknown",t},Se=function(e){let t;return e||(t=localStorage.getItem("ttl")),e||t?new Date().getTime()-parseInt(e||t||"",10)>12e5:!0},Ze=function(){return!localStorage.getItem("events")},Xe=function(){return!localStorage.getItem("attributes")},et=function(){return!localStorage.getItem("customer")},tt=function(){return!localStorage.getItem("uniqueIdentity")},Gt=function(){return!localStorage.getItem("session")},Yt=function(){return i(this,p,Ze).call(this)||i(this,p,Xe).call(this)||i(this,p,et).call(this)||i(this,p,tt).call(this)||i(this,p,Gt).call(this)},qt=function(){let e=localStorage.getItem("uniqueIdentity");return e||(e=crypto.randomUUID(),localStorage.setItem("uniqueIdentity",e)),e},Qt=function(){return a(this,null,function*(){yield A("store session",()=>a(this,null,function*(){let e=localStorage.getItem("session");e||(e=crypto.randomUUID(),localStorage.setItem("session",e),yield u.recordEvent({eventName:"Web Session Started",eventProperties:[{eventProperty:"SESSION_ID",value:localStorage.getItem("session")},{eventProperty:"SESSION_CREATED",value:new Date(parseInt(localStorage.getItem("ttl")||"",10)).toISOString()}]}))}),e=>{u.recordEvent({eventName:"Debug Event",eventProperties:[{eventProperty:"message",value:`store session - ${e.message}`}]},!0)})})},Zt=function(e){return a(this,null,function*(){try{return(yield N.post(`${It}${ft}`,e)).data}catch(t){throw new Error("Error posting identity data")}})},Xt=function(){return a(this,null,function*(){yield u.storeEventsAndPropertiesInLocalStorage()})},en=function(){return a(this,null,function*(){yield me.storeAttributeInLocalStorage()})},nt=function(){return a(this,null,function*(){yield A("verify API key",()=>a(this,null,function*(){var e;try{let t=parseInt(localStorage.getItem("verifyTTL")||"0",10)||0;if(!t||t&&new Date().getTime()>t){let n=yield N.get("/brand");if(!(n!=null&&n.success))throw new Error(JSON.stringify(n));localStorage.setItem("verifyTTL",(new Date().getTime()+3e5).toString())}g.isInitialized=!0}catch(t){throw N.getBrandId()==="67"&&!((e=t==null?void 0:t.message)!=null&&e.startsWith("get"))&&u.recordEvent({eventName:"Debug Event",eventProperties:[{eventProperty:"message",value:`verifyAPIKey - ${t.message}`}]},!0),g.disableSDK=!0,new Error("Error verifying API key")}}))})},rt=function(){return a(this,null,function*(){var n;s(1,"Performing viewed web page event");let e=(n=window==null?void 0:window.location)==null?void 0:n.href;this.setPreviousUrl(e),u.recordDebugEvents({eventName:"pre_vwp"});let t=[];new URLSearchParams(new URL(window.location.href).search).forEach((r,o)=>a(this,null,function*(){wt.has(o)&&t.push({eventProperty:o,value:r})})),yield u.recordEvent({eventName:"Viewed Webpage",eventProperties:[{eventProperty:"URL",value:window.location.pathname},...t]})})},tn=function(){return a(this,null,function*(){var t;s(1,"Tracking page change");let e=(t=window==null?void 0:window.location)==null?void 0:t.href;(this.getPreviousUrl()===null||this.getPreviousUrl()===void 0||e!==this.getPreviousUrl())&&(yield i(this,p,rt).call(this))})},nn=function(){return a(this,null,function*(){var t,n;let e=(t=window==null?void 0:window.location)==null?void 0:t.href;u.recordDebugEvents({eventName:"show_notification_error",eventProperties:[{eventProperty:"message",value:`${e!==this.getPreviousUrl()}:${e}:${this.getPreviousUrl()}`}]});try{yield i(this,p,rt).call(this)}catch(r){let o=r&&r.message?(n=r==null?void 0:r.message)==null?void 0:n.substring(0,100):"undefined";yield u.recordDebugEvents({eventName:"vwp_error",eventProperties:[{eventProperty:"message",value:`${o}`}]})}})},m(Z,ue);var Qe=Z,E=Qe.getInstance();var X,R,rn,xe,on,sn,an,cn,j=class j{constructor(){m(this,R);this.queue=Promise.resolve()}static getInstance(){var e;return d(j,X)||(I(j,X,new j),i(e=d(j,X),R,rn).call(e)),d(j,X)}pushToQueue(e){let t=JSON.parse(localStorage.getItem("preInitializedEvents")||"[]");t.push(e),localStorage.setItem("preInitializedEvents",JSON.stringify(t))}recordEventsFromQueue(){return a(this,null,function*(){let e=JSON.parse(localStorage.getItem("preInitializedEvents")||"[]");if(Array.isArray(e))for(let t of e)yield this.recordEventPreInitialized(t)})}recordEvent(e,t){return a(this,null,function*(){g.isInitialized&&!g.loading?yield i(this,R,xe).call(this,e,t):this.pushToQueue(e)})}recordEventPreInitialized(e){return a(this,null,function*(){try{yield i(this,R,xe).call(this,e)}finally{i(this,R,cn).call(this,e.eventName)}})}recordDebugEvents(e){return a(this,null,function*(){g.debugLevel===4&&(!g.recordDebugEventsToggle||g.recordDebugEventsToggle[e.eventName])&&(yield i(this,R,xe).call(this,e))})}getStoredEvents(){let e=localStorage.getItem("events");return e?JSON.parse(e):{}}storeEventsAndPropertiesInLocalStorage(){return a(this,null,function*(){if(!localStorage.getItem("events")){let e=(yield this.fetchEventData()).data;if(e){localStorage.setItem("events",JSON.stringify(e));try{W.pushMessageToSW({events:e})}catch(t){}}}})}fetchEventData(){return a(this,null,function*(){try{return yield N.get(`${Fe}`)}catch(e){throw new Error("Error fetching event data")}})}postEventRecord(e,t){return a(this,null,function*(){let n=null,r=null,o=new AbortController;return this.queue=this.queue.then(()=>a(this,null,function*(){try{if(e.events.length===0)throw new Error("No events to record");let c=yield N.post(`/v2${Fe}${vt}`,e,o.signal);if(c.success)return r=c,c;if(c.message===`Customer with id ${localStorage.getItem("customer")} not exists`)throw localStorage.removeItem("customer"),new Error("Re initializing customer Id")}catch(c){throw s(2,"Error posting event record:"),s(2,`name: ${c.name}`),s(2,`message: ${c.message}`),(c.name==="AbortError"||c.name==="TypeError"&&c.message==="Failed to fetch")&&(s(2,"Request aborted"),t&&i(this,R,an).call(this,t)),n=new Error("Error posting event record"),c}return null})).catch(()=>{}),this.queue.then(()=>{if(n)throw n;return r})})}};X=new WeakMap,R=new WeakSet,rn=function(){return a(this,null,function*(){})},xe=function(e,t){return a(this,null,function*(){yield A("# record event",()=>a(this,null,function*(){var at,ct,lt,dt;let{campaignCustomerInstanceId:n,campaignId:r,eventName:o,eventProperties:c,name:h,web_optin_instance_id:v}=e;s(1,"# Recording event"),C("Recording event",!0),L("Recording event Time",!0),s(1,"Event Payload"),s(1,{campaignCustomerInstanceId:n,eventName:o,eventProperties:c,name:h,web_optin_instance_id:v});let b=E.getPlatform();if(b==="Crawlers"||b==="Unknown")throw new Error("Invalid platform");o!=="Web Session Concluded"&&(yield E.checkTTL());let y=[];c&&y.push(...c),y.push({eventProperty:"Platform",value:b}),y.push({eventProperty:"operating-system",value:E.getOperatingSystem()}),y.push({eventProperty:"os-version",value:E.getOSVersion()});let D=this.getStoredEvents(),k=i(this,R,on).call(this,D,o,y);if(typeof k=="string"){s(2,k);return}E.updateSessionCreated();let{id:F}=D[o],O=i(this,R,sn).call(this,z(Pe(z(z(z({},n?{campaignCustomerInstanceId:n}:{}),r?{campaignId:r}:{}),v?{web_optin_instance_id:v}:{}),{eventId:F,eventProperties:k,sessionId:localStorage.getItem("session")||""}),h?{name:h}:{}));if(g.offline){let M=JSON.parse(localStorage.getItem("offlineEvents")||"[]");M.length<=50&&(M.push(...O.events),localStorage.setItem("offlineEvents",JSON.stringify(M)));return}let _=yield this.postEventRecord(O,e);(at=_==null?void 0:_.data)!=null&&at.optIn?(yield this.recordDebugEvents({eventName:"optin_data"}),W.showNotification(_.data.optIn)):o==="Viewed Webpage"&&(yield this.recordDebugEvents({eventName:"no_optin",eventProperties:[{eventProperty:"message",value:`${"Notification"in window&&typeof((ct=window==null?void 0:window.Notification)==null?void 0:ct.permission)!="undefined"}`}]})),(dt=(lt=_==null?void 0:_.data)==null?void 0:lt.campaigns)==null||dt.forEach(M=>{H.isPopupAction(M.message.name)?H.showPopup(M):ae.isContentCardAction(M.message.name)&&ae.showContentCard(M)}),L("Recording event Time",!1),C("Recording event",!1)}),n=>{this.recordEvent({eventName:"Debug Event",eventProperties:[{eventProperty:"message",value:`record event - ${e} - ${n.message}`}]},!0)},t)})},on=function(e,t,n){if(!Object.prototype.hasOwnProperty.call(e,t))return`Event ${t} is not valid.`;if(!n)return[];let r=e[t];if(!(r!=null&&r.eventProperty))return`Event ${t} does not have a valid eventProperty.`;let o=n.filter(({eventProperty:c})=>!Object.prototype.hasOwnProperty.call(r.eventProperty,c)).map(({eventProperty:c})=>c);return o.length>0?`Event ${t} has invalid eventProperties: ${o.join(", ")}.`:n.map(({eventProperty:c,value:h})=>({eventPropertyId:r.eventProperty[c].id,value:h}))},sn=function(e){return{customerId:localStorage.getItem("customer")||"",deviceId:localStorage.getItem("uniqueIdentity")||"",events:[e]}},an=function(e){s(1,"Adding to pre-initialized event:"),s(1,e);let t=localStorage.getItem("preInitializedEvents");t&&t!=="undefined"?(t=JSON.parse(t),t.push(e)):t=[e],localStorage.setItem("preInitializedEvents",JSON.stringify(t))},cn=function(e){let t=JSON.parse(localStorage.getItem("preInitializedEvents")||"[]"),n=t.findIndex(r=>r.eventName===e);n>=0&&t.splice(n,1),localStorage.setItem("preInitializedEvents",JSON.stringify(t))},m(j,X);var it=j,u=it.getInstance();var g=class extends Error{constructor(e){super(e),this.name="MergnError"}};g.disableSDK=!1,g.offline=!navigator.onLine,g.debugLevel=0,g.isInitialized=!1,g.loading=!1;var vn=(l,e)=>{e instanceof g?s(2,`OriginateFrom: ${l}
72
- MergnError: ${e.message}`):e instanceof Error?s(2,`OriginateFrom: ${l}
73
- Unexpected error: ${e.message}`):s(2,`OriginateFrom: ${l}
74
- Unexpected error: ${String(e)}`)},A=(l,e,t,n=!1)=>a(void 0,null,function*(){try{C(l,!0),L(`${l} Time`,!0);try{if(g.disableSDK)throw new g("Mergn SDK is disabled!");if(l!=="record event"&&g.offline)throw new g("Mergn is offline!");if(l!=="init"&&l!=="verify API key"&&l!=="record event"&&l!=="recordAttribute"&&!g.isInitialized)throw new g("Mergn not initialized!");if(l!=="login"&&g.loading)throw new g("Mergn is loading!");return yield e()}catch(r){return t?t(r):(g.debugLevel===2||g.debugLevel===3)&&vn(l,r),!n&&N.getBrandId()==="67"&&r.message!=="Failed to fetch"&&u.recordEvent({eventName:"Debug Event",eventProperties:[{eventProperty:"message",value:`${l} - ${r.message}`}]},!0),null}finally{L(`${l} Time`,!1),C(l,!1)}}catch(r){return null}});var U=(o=>(o[o.NONE=0]="NONE",o[o.INFO=1]="INFO",o[o.ERROR=2]="ERROR",o[o.ALL=3]="ALL",o[o.DEBUG=4]="DEBUG",o))(U||{}),s=(l,e)=>{g.debugLevel!==0&&(g.debugLevel>=3?l===1?console.info(`INFO: ${new Date().toISOString()}`,e):l===2&&console.error(`ERROR: ${new Date().toISOString()}`,e):g.debugLevel===1&&l===1?console.info(`INFO: ${new Date().toISOString()}`,e):g.debugLevel===2&&l===2&&console.error(`ERROR: ${new Date().toISOString()}`,e))},L=(l,e)=>{g.debugLevel!==0&&(e?console.time(l):console.timeEnd(l))},C=(l,e)=>{g.debugLevel!==0&&(e?console.group(l):console.groupEnd())};var pe,ee=class ee{constructor(){}static getInstance(){return d(ee,pe)||I(ee,pe,new ee),d(ee,pe)}init(e,t){setTimeout(()=>{A("init",()=>a(this,null,function*(){s(1,"Initializing Mergn SDK"),yield E.init(e,t),u.recordDebugEvents({eventName:"mergn_init"}),s(1,"Mergn SDK Initialized");let n=JSON.parse(localStorage.getItem("preInitializedAttributes")||"[]");Array.isArray(n)&&n.forEach((r,o)=>a(this,null,function*(){yield me.recordAttribute(r.attributeName,r.attributeValue),n.splice(o,1),localStorage.setItem("preInitializedAttributes",JSON.stringify(n))})),window.addEventListener("online",()=>a(this,null,function*(){g.offline=!1;let r=JSON.parse(localStorage.getItem("offlineEvents")||"[]");Array.isArray(r)&&(yield u.postEventRecord({customerId:localStorage.getItem("customer")||"",deviceId:localStorage.getItem("uniqueIdentity")||"",events:r}),localStorage.removeItem("offlineEvents")),E.checkTTL(),E.updateSessionCreated()})),window.addEventListener("offline",()=>{g.offline=!0}),window.addEventListener("load",()=>{H.loadPopupEventActionInLocalStorage(),W.loadWebPushActionInLocalStorage()})}))})}setDebugLevel(e,t){if(!(e in U)){console.error(`Debug level must be according to:
75
- NONE: 0, INFO: 1, ERROR: 2, ALL: 3`);return}g.recordDebugEventsToggle=t||{},g.debugLevel=e;try{W.pushMessageToSW({debugLevel:e})}catch(n){}}recordAttribute(e,t){return a(this,null,function*(){return new Promise((n,r)=>{setTimeout(()=>a(this,null,function*(){try{yield A("recordAttribute",()=>a(this,null,function*(){let o;Array.isArray(t)?o=JSON.stringify(t):typeof t=="number"?o=`${t}`:o=t,s(1,"Recording attribute"),s(1,`Attribute Name: ${e}, Attribute Value: ${o}`);let c=JSON.parse(localStorage.getItem("preInitializedAttributes")||"[]");c.push({attributeName:e,attrValueStringified:o}),localStorage.setItem("preInitializedAttributes",JSON.stringify(c)),g.isInitialized&&(yield me.recordAttribute(e,o))})),n()}catch(o){r(o)}}))})})}login(e){return a(this,null,function*(){return new Promise((t,n)=>{setTimeout(()=>a(this,null,function*(){try{yield A("login",()=>a(this,null,function*(){s(1,"Logging in"),s(1,`Identity: ${e}`),g.loading=!0,yield E.setIdentity(e)})),t()}catch(r){n(r)}finally{g.loading=!1,yield u.recordEventsFromQueue()}}))})})}logout(){setTimeout(()=>{A("logout",()=>a(this,null,function*(){s(1,"Logging out"),E.clearLocalStorage()}))})}recordEvent(e,t){return a(this,null,function*(){return new Promise((n,r)=>{setTimeout(()=>a(this,null,function*(){try{yield A("record event",()=>a(this,null,function*(){s(1,"Recording event"),s(1,`Event Payload:
76
- ${{eventName:e,eventProperties:t}}`),yield u.recordEvent({eventName:e,eventProperties:t})})),n()}catch(o){r(o)}}))})})}getVersion(){return mt}};pe=new WeakMap,m(ee,pe);var ot=ee,st=ot.getInstance();typeof window!="undefined"&&(window.mergn=st);var Bi=st;export{Bi as default};