1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="89007670-aed6-f24d-b259-2ee24ae0ccfe")}catch(e){}}(); 2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,358102,346297,664034,79824,539151,349986,275147,617799,425005,638309,8212,978865,953310,653415,730159,419469,793124,805218,324310,92305,840647,544687,781427,627202,844381,t=>{"use strict";function e(t){let e,i=null==t?void 0:t.dt(tt.ft.uE);return i&&(e={label:i.l,name:i.a}),e}t.s(["OPTIONS",()=>t7,"default",()=>t9],358102),t.s(["STORAGE_KEYS",()=>tt,"default",()=>te],978865),t.s(["BRAZE_ACTION_URI_REGEX",()=>U,"isValidBrazeActionJson",()=>q,"isValidBrazeActionType",()=>G,"isValidEmail",()=>W,"validateCustomAttributeArrayType",()=>F,"validateCustomAttributeKey",()=>z,"validateCustomProperties",()=>j,"validateCustomString",()=>D,"validatePropertyType",()=>P,"validateStandardString",()=>$],638309),t.s(["default",()=>td],793124),t.s(["default",()=>tg],805218),t.s(["TriggersProviderFactory",()=>tQ],781427);let i={init:function(t){void 0===t&&void 0!==i.zg||(i.zg=!!t),i.i||(i.i=!0)},destroy:function(){i.i=!1,i.zg=void 0,i.Rd=void 0},setLogger:function(t){"function"==typeof t?(i.init(),i.Rd=t):i.info("Ignoring setLogger call since logger is not a function")},toggleLogging:function(){i.init(),i.zg?(console.log("Disabling Braze logging"),i.zg=!1):(console.log("Enabled Braze logging"),i.zg=!0)},info:function(t){if(i.zg){let e="Braze: "+t;null!=i.Rd?i.Rd(e):console.log(e)}},warn:function(t){if(i.zg){let e="Braze SDK Warning: "+t+" (v6.5.0)";null!=i.Rd?i.Rd(e):console.warn(e)}},error:function(t){if(i.zg){let e="Braze SDK Error: "+t+" (v6.5.0)";null!=i.Rd?i.Rd(e):console.error(e)}}};function s(t){let e=[];for(let i in t)Object.prototype.hasOwnProperty.call(t,i)&&void 0!==t[i]&&e.push(t[i]);return e}function n(t,e,n,r){let o=s(t);return -1!==o.indexOf(e)||(i.error(`${n} Valid values from ${r} are "${o.join('"/"')}".`),!1)}function r(t){return Array.isArray?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)}function o(t){return"[object Date]"===Object.prototype.toString.call(t)}function l(t){return"[object Object]"===Object.prototype.toString.call(t)}function a(t){let e=[];for(let i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.push(i);return e}function u(t,e){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return t===e;let i=t.toString();if(i!==e.toString())return!1;switch(i){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e}let s="[object Array]"===i;if(!s){if("object"!=typeof t||"object"!=typeof e)return!1;let i=t.constructor,s=e.constructor;if(i!==s&&!("function"==typeof i&&i instanceof i&&"function"==typeof s&&s instanceof s)&&"constructor"in t&&"constructor"in e)return!1}let n=[],r=[],o=n.length;for(;o--;)if(n[o]===t)return r[o]===e;if(n.push(t),r.push(e),s){if((o=t.length)!==e.length)return!1;for(;o--;)if(!u(t[o],e[o]))return!1}else{let i,s=a(t);if(o=s.length,a(e).length!==o)return!1;for(;o--;)if(i=s[o],!Object.prototype.hasOwnProperty.call(e,i)||!u(t[i],e[i]))return!1}return n.pop(),r.pop(),!0}function h(t,e=!1){let i=t/1e3;return e&&(i=Math.floor(i)),i}function c(t){return 1e3*t}function d(t){if(null==t)return null;let e=parseInt(t.toString());return isNaN(e)?null:new Date(1e3*e)}function f(t){return null!=t&&o(t)?t.toISOString().replace(/\.[0-9]{3}Z$/,""):t}function g(t){return null==t||""===t?null:new Date(t)}function m(t){return null==t||""===t?new Date().valueOf():t}function p(t){return(new Date().valueOf()-t.valueOf())/1e3}function v(t){return(t.valueOf()-new Date().valueOf())/1e3}t.s(["default",0,i],346297),t.s(["logger",0,i],664034),t.s(["isArray",0,r,"isDate",0,o,"isEqual",0,u,"isObject",0,l,"keys",0,a,"validateValueIsFromEnum",0,n,"values",0,s],79824),t.s(["convertMsToSeconds",0,h,"convertSecondsToMs",0,c,"dateFromUnixTimestamp",0,d,"rehydrateDateAfterJsonization",0,g,"secondsAgo",0,p,"secondsInTheFuture",0,v,"timestampOrNow",0,m,"toValidBackendTimeString",0,f],539151);class b{constructor(t,e,i,s,n){this.userId=t,this.type=e,this.time=i,this.sessionId=s,this.data=n,this.userId=t,this.type=e,this.time=m(i),this.sessionId=s,this.data=n}Hn(){var t;
2let i={name:this.type,time:h(this.time),data:this.data||{},session_id:this.sessionId};null!=this.userId&&(i.user_id=this.userId);let s=(null==(t=t9.Sr())?void 0:t.wh())||!1;if(!i.user_id&&!s){let t=e(t9.p());t&&(i.alias=t)}return i}gt(){return{u:this.userId,t:this.type,ts:this.time,s:this.sessionId,d:this.data}}static fromJson(t){return new b(t.user_id,t.name,t.time,t.session_id,t.data)}static gE(t){return null!=t&&l(t)&&null!=t.t&&""!==t.t}static _u(t){return new b(t.u,t.t,t.ts,t.s,t.d)}}let y=function(){if("u">typeof window&&window.crypto){if("function"==typeof window.crypto.randomUUID)return window.crypto.randomUUID();if("function"==typeof window.crypto.getRandomValues)try{let t=new Uint8Array(16);window.crypto.getRandomValues(t),t[6]=15&t[6]|64,t[8]=63&t[8]|128;let e=Array.from(t,t=>("0"+t.toString(16)).slice(-2));return[e.slice(0,4).join(""),e.slice(4,6).join(""),e.slice(6,8).join(""),e.slice(8,10).join(""),e.slice(10,16).join("")].join("-")}catch(t){}}let t=(t=!1)=>{let e=(Math.random().toString(16)+"000000000").substr(2,8);return t?"-"+e.substr(0,4)+"-"+e.substr(4,4):e};return t()+t(!0)+t(!0)+t()},E=t=>t instanceof Error?t.message:String(t);t.s(["getErrorMessage",0,E],349986);class w{constructor(t,e,i){this.Tu=t,null==t&&(t=y()),!i||isNaN(i)?this.lm=new Date().valueOf():this.lm=i,this.Tu=t,this.gm=new Date().valueOf(),this.pm=e}gt(){return`g:${encodeURIComponent(this.Tu)}|e:${this.pm}|c:${this.lm}|l:${this.gm}`}static AE(t){let e;if("string"!=typeof t)return null;let i=t.lastIndexOf("|e:"),s=t.substring(0,i),n=s.split("g:")[1];return e=/[|:]/.test(n)?encodeURIComponent(n):n,t=t.replace(s,`g:${e}`)}static _u(t){let e;if("string"==typeof t)try{let i=t.split("|");if(!r(i)||4!==i.length)return null;let s=t=>t.split(":")[1],n=t=>{let e=parseInt(s(t));if(!isNaN(e))return e};(e=new w(decodeURIComponent(s(i[0])),n(i[1]),n(i[2]))).gm=n(i[3])}catch(e){i.info(`Unable to parse cookie string ${t}, failed with error: ${E(e)}`)}else{if(null==t||null==t.g)return null;(e=new w(t.g,t.e,t.c)).gm=t.l}return e}}let S={CustomEvent:"ce",Pr:"p",jd:"pc",ev:"ca",Fl:"i",wl:"ie",Xt:"cci",Zt:"ccic",Lt:"ccc",Qt:"ccd",Sm:"ss",hm:"se",wn:"si",zn:"sc",Sn:"sbc",tv:"sfe",om:"iec",yd:"lr",kd:"uae",Dd:"lcaa",Ad:"lcar",Zu:"inc",Qu:"add",Xu:"rem",Yu:"set",Vu:"ncam",$d:"sgu",xo:"ffi",ro:"bi",ut:"bc"};function T(t){let e=t.length;for(let i=t.length-1;i>=0;i--){let s=t.charCodeAt(i);s>127&&s<=2047?e++:s>2047&&s<=65535&&(e+=2),s>=56320&&s<=57343&&i--}return e}function I(t){try{t=t.replace(/-/g,"+").replace(/_/g,"/");let e=window.atob(t),i=new Uint8Array(e.length);for(let t=0;t<e.length;t++)i[t]=e.charCodeAt(t);let s=new Uint16Array(i.buffer);return String.fromCharCode(...s)}catch(t){return i.error("Unable to decode Base64: "+t),null}}t.s(["EventTypes",0,S],275147),t.s(["decodeBrazeActions",0,I,"getByteLength",0,T],617799);let _={io:"container",logCustomEvent:"logCustomEvent",setEmailNotificationSubscriptionType:"setEmailNotificationSubscriptionType",setPushNotificationSubscriptionType:"setPushNotificationSubscriptionType",setCustomUserAttribute:"setCustomUserAttribute",requestPushPermission:"requestPushPermission",addToSubscriptionGroup:"addToSubscriptionGroup",removeFromSubscriptionGroup:"removeFromSubscriptionGroup",addToCustomAttributeArray:"addToCustomAttributeArray",removeFromCustomAttributeArray:"removeFromCustomAttributeArray",mo:"openLink",uo:"openLinkInWebView"},B="type",k="steps",C="args",R="unknownBrazeAction";function O(t,e){let i=!1;if(e){for(let s of e)if(i=i||t(s))return!0}return!1}let A={ee:"Braze must be initialized before calling methods.",$e:"logCustomEvent",Ku:"setCustomUserAttribute"};t.s(["CoreStrings",0,A,"FEED_ANIMATION_DURATION",0,500,"GLOBAL_RATE_LIMIT_CAPACITY_DEFAULT",0,30,"GLOBAL_RATE_LIMIT_REFILL_RATE_DEFAULT",0,30,"LAST_REQUEST_TO_ENDPOINT_MS_AGO_DEFAULT",0,72e5,"MAX_RETRY_COUNT_PER_REQUEST",0,15,"REQUEST_ATTEMPT_DEFAULT",0,1,"REQUEST_BACKOFF_MAX_SLEEP_MS_DEFAULT",0,3e5,"REQUEST_BACKOFF_MIN_SLEEP_MS_DEFAULT",0,1e4,"REQUEST_BACKOFF_SCALE_FACTOR_DEFAULT",0,3],425005);let N=/^[^\x00-\x1F\x22]+$/,L=/[$.]/,x=["$add","$update","$remove","$identifier_key","$identifier_value","$new_object","$time","$google_ad_personalization","$google_ad_user_data"],M=/^[^@\s]+@[^@\s]+\.[^@\s]+$/,U=/^brazeActions:\/\/v\d+\//;function D(t,e,s){let n=null!=t&&"string"==typeof t&&(""===t||null!=t.match(N));return n||i.error(`Cannot ${e} because ${s} "${t}
2" is invalid.`),n}function z(t){return null!=t&&t.match(L)&&-1===x.indexOf(t)&&i.warn("Custom attribute keys cannot contain '$' or '.'"),D(t,"set custom user attribute","the given key")}function P(t){let e=typeof t;return null==t||"number"===e||"boolean"===e||o(t)||"string"===e}function $(t,e,s,n=!1){let r="string"==typeof t||null===t&&n;return r||i.error(`Cannot ${e} because ${s} "${t}" is invalid.`),r}function j(t,e,s,n,u){let h,c,d;if(null==t&&(t={}),"object"!=typeof t||r(t))return i.error(`${e} requires that ${s} be an object. Ignoring ${u}.`),[!1,null];e===A.Ku?(h=76800,c="75KB"):(h=51200,c="50KB");let g=JSON.stringify(t);if(T(g)>h)return i.error(`Could not ${n} because ${s} was greater than the max size of ${c}.`),[!1,null];try{d=JSON.parse(g)}catch(t){return i.error(`Could not ${n} because ${s} did not contain valid JSON.`),[!1,null]}for(let s in t){if(e===A.Ku&&!z(s)||!D(s,n,`the ${u} property name`))return[!1,null];let h=t[s];if(e!==A.Ku&&null==h){delete t[s],delete d[s];continue}if(o(h)&&(d[s]=f(h)),!function(t,e,s,n,u){let h;return(h=l(t)||r(t)?function t(e,s,n){let u=-1!==n;if(u&&n>50)return i.error("Nested attributes cannot be more than 50 levels deep."),!1;let h=u?n+1:-1;if(r(e)&&r(s)){for(let i=0;i<e.length&&i<s.length;i++)if(o(e[i])&&(s[i]=f(e[i])),!t(e[i],s[i],h))return!1}else{if(!l(e))return P(e);for(let i of a(e)){let n=e[i];if(u&&!z(i)||(o(n)&&(s[i]=f(n)),!t(n,s[i],h)))return!1}}return!0}(t,e,u?1:-1):P(t))||i.error(`Cannot ${s} because ${n} "${t}" is invalid.`),h}(h,d[s],n,`the ${u} property "${s}"`,e===A.Ku))return[!1,null]}return[!0,d]}function F(t,e){let s=!1,n=!1,r=()=>{i.error("Custom attribute arrays must be either string arrays or object arrays.")};for(let i of e)if("string"==typeof i){if(n)return r(),[!1,!1];if(!D(i,`set custom user attribute "${t}"`,"the element in the given array"))return[!1,!1];s=!0}else{if(!l(i)||s)return r(),[!1,!1];if(!j(i,A.Ku,"attribute value",`set custom user attribute "${t}"`,"custom user attribute"))return[!1,!1];n=!0}return[s,n]}function W(t){if("string"!=typeof t)return!1;let e=t.length;return!(0===e||e>256)&&M.test(t.toLowerCase())}function q(t){if(!(B in t))return!1;switch(t[B]){case _.io:if(k in t)return!0;break;case _.logCustomEvent:case _.setEmailNotificationSubscriptionType:case _.setPushNotificationSubscriptionType:case _.setCustomUserAttribute:case _.addToSubscriptionGroup:case _.removeFromSubscriptionGroup:case _.addToCustomAttributeArray:case _.removeFromCustomAttributeArray:case _.mo:case _.uo:if(C in t)return!0;break;case _.requestPushPermission:return!0}return!1}function G(t){let e=!1;return Object.keys(_).forEach(i=>{_[i]!==t.toString()||(e=!0)}),e}class H{constructor(t,e){this.vs=t,this.Ru=e,this.vs=t,this.Ru=e}getUserId(t){let e=this.vs.getUserId();if("function"!=typeof t)return e;i.warn("The callback for getUserId is deprecated. You can access its return value directly instead (e.g. `const id = braze.getUser().getUserId()`)"),t(e)}addAlias(t,e){return!$(t,"add alias","the alias",!1)||t.length<=0?(i.error("addAlias requires a non-empty alias"),!1):!$(e,"add alias","the label",!1)||e.length<=0?(i.error("addAlias requires a non-empty label"),!1):this.Ru.Gu(t,e).W}setFirstName(t){return!!$(t,"set first name","the firstName",!0)&&this.vs.zu("first_name",t)}setLastName(t){return!!$(t,"set last name","the lastName",!0)&&this.vs.zu("last_name",t)}setEmail(t){return null===t||W(t)?this.vs.zu("email",t):(i.error(`Cannot set email address - "${t}" did not pass RFC-5322 validation.`),!1)}setGender(t){return"string"==typeof t&&(t=t.toLowerCase()),!(null!==t&&!n(H.Genders,t,`Gender "${t}" is not a valid gender.`,"User.Genders"))&&this.vs.zu("gender",t)}setDateOfBirth(t,e,s){return null===t&&null===e&&null===s?this.vs.zu("dob",null):(t=null!=t?parseInt(t.toString()):null,e=null!=e?parseInt(e.toString()):null,s=null!=s?parseInt(s.toString()):null,null==t||null==e||null==s||isNaN(t)||isNaN(e)||isNaN(s)||e>12||e<1||s>31||s<1?(i.error("Cannot set date of birth - parameters should comprise a valid date e.g. setDateOfBirth(1776, 7, 4);"),!1):this.vs.zu("dob",`${t}-${e}-${s}`))}setCountry(t){return!!$(t,"set country","the country",!0)&&this.vs.zu("country",t)}setHomeCity(t){return!!$(t,"set home city","the homeCity",!0)&&this.vs.zu("home_city",t)}setLanguage(t){return!!$(t,"set language","the language",!0)&&this.vs.zu("language",t)}setEmailNotificationSubscriptionType(t){return!!n(H.NotificationSubscriptionTypes,t,`Email notification setting "${t}" is not a valid subscription type.`,"User.NotificationSubscriptionTypes")&&this.vs.zu("email_subscribe",t)}setPushNotificationSubscriptionType(t){return!!n(H.NotificationSubscriptionTypes,t,`Push notification setting "${t}" is not a valid subscription type.`,"User.NotificationSubscriptionTypes")&&this.vs.zu("push_subscribe",t)}setPhoneNumber(t){return!!$(t,"set phone number","the phoneNumber",!0)&&(null===t||t.match(H.Hu)?this.vs.zu("phone",t):(i.error(`Cannot set phone number - "${t}
2" did not pass validation.`),!1))}setLastKnownLocation(t,e,s,n,r){return null==t||null==e?(i.error("Cannot set last-known location - latitude and longitude are required."),!1):(t=parseFloat(t.toString()),e=parseFloat(e.toString()),null!=s&&(s=parseFloat(s.toString())),null!=n&&(n=parseFloat(n.toString())),null!=r&&(r=parseFloat(r.toString())),isNaN(t)||isNaN(e)||null!=s&&isNaN(s)||null!=n&&isNaN(n)||null!=r&&isNaN(r)?(i.error("Cannot set last-known location - all supplied parameters must be numeric."),!1):t>90||t<-90||e>180||e<-180?(i.error("Cannot set last-known location - latitude and longitude are bounded by ±90 and ±180 respectively."),!1):null!=s&&s<0||null!=r&&r<0?(i.error("Cannot set last-known location - accuracy and altitudeAccuracy may not be negative."),!1):this.Ru.setLastKnownLocation(this.vs.getUserId(),t,e,n,s,r).W)}setCustomUserAttribute(t,e,i){if(!z(t))return!1;let s=e=>{let[i]=j(e,A.Ku,"attribute value",`set custom user attribute "${t}"`,"custom user attribute");return i};if(r(e)){let[i,n]=F(t,e);if(!i&&!n&&0!==e.length)return!1;if(i||0===e.length)return this.Ru.Mu(S.Yu,t,e).W;for(let t of e)if(!s(t))return!1}else if(l(e)){if(!s(e))return!1;if(i)return this.Ru.Mu(S.Vu,t,e).W}else if(!(void 0!==e&&P(e))||(o(e)&&(e=f(e)),"string"==typeof e&&!D(e,`set custom user attribute "${t}"`,"the element in the given array")))return!1;return this.vs.setCustomUserAttribute(t,e)}addToCustomAttributeArray(t,e){return!!D(t,"add to custom user attribute array","the given key")&&!(null!=e&&!D(e,"add to custom user attribute array","the given value"))&&this.Ru.Mu(S.Qu,t,e).W}removeFromCustomAttributeArray(t,e){return!!D(t,"remove from custom user attribute array","the given key")&&!(null!=e&&!D(e,"remove from custom user attribute array","the given value"))&&this.Ru.Mu(S.Xu,t,e).W}incrementCustomUserAttribute(t,e){if(!D(t,"increment custom user attribute","the given key"))return!1;null==e&&(e=1);let s=parseInt(e.toString());return isNaN(s)||s!==parseFloat(e.toString())?(i.error(`Cannot increment custom user attribute because the given incrementValue "${e}" is not an integer.`),!1):this.Ru.Mu(S.Zu,t,s).W}setCustomLocationAttribute(t,e,s){return!!D(t,"set custom location attribute","the given key")&&((null!==e||null!==s)&&(e=null!=e?parseFloat(e.toString()):null,s=null!=s?parseFloat(s.toString()):null,null==e&&null!=s||null!=e&&null==s||null!=e&&(isNaN(e)||e>90||e<-90)||null!=s&&(isNaN(s)||s>180||s<-180))?(i.error("Received invalid values for latitude and/or longitude. Latitude and longitude are bounded by ±90 and ±180 respectively, or must both be null for removal."),!1):this.Ru.Na(t,e,s).W)}addToSubscriptionGroup(t){return!$(t,"add user to subscription group","subscription group ID",!1)||t.length<=0?(i.error("addToSubscriptionGroup requires a non-empty subscription group ID"),!1):this.Ru.Ra(t,H.Pa.SUBSCRIBED).W}removeFromSubscriptionGroup(t){return!$(t,"remove user from subscription group","subscription group ID",!1)||t.length<=0?(i.error("removeFromSubscriptionGroup requires a non-empty subscription group ID"),!1):this.Ru.Ra(t,H.Pa.UNSUBSCRIBED).W}setLineId(t){return $(t,"set LINE user ID","the ID",!0)&&0!==(null==t?void 0:t.length)?t&&t.length>H.Oa?(i.error(`Rejected LINE user ID ${t} because it is longer than ${H.Oa} characters.`),!1):this.vs.zu("native_line_id",t):(i.error("setLineId requires a non-empty ID"),!1)}gu(t,e,i,s,n){this.vs.gu(t,e,i,s,n),this.Ru.Ya()}wu(t){this.vs.wu(t)}}H.Genders={MALE:"m",FEMALE:"f",OTHER:"o",UNKNOWN:"u",NOT_APPLICABLE:"n",PREFER_NOT_TO_SAY:"p"},H.NotificationSubscriptionTypes={OPTED_IN:"opted_in",SUBSCRIBED:"subscribed",UNSUBSCRIBED:"unsubscribed"},H.Hu=/^[0-9 .\\(\\)\\+\\-]+$/,H.Pa={SUBSCRIBED:"subscribed",UNSUBSCRIBED:"unsubscribed"},H.Va="user_id",H.Bu="custom",H.mr=997,H.Oa=33,t.s(["User",0,H],8212);class K{ff(){}cf(){}rc(t){}static lf(t,e){if(t&&e){if(t=t.toLowerCase(),r(e.uf)){for(let i=0;i<e.uf.length;i++)if(-1!==t.indexOf(e.uf[i].toLowerCase()))return e.identity}else if(-1!==t.indexOf(e.uf.toLowerCase()))return e.identity}}}let V={rO:"Chrome",eO:"Edge",oO:"Opera",Bg:"Safari",OO:"Firefox",Sg:"ChatGPTBrowser"},J="Android";class Z extends K{constructor(){if(super(),this.userAgentData=navigator.userAgentData,this.browser=null,this.version=null,this.userAgentData){const t=this.hf();this.browser=t.browser||"Unknown Browser",this.version=t.version||"Unknown Version"}this.OS=null}ff(){return this.browser}cf(){return this.version}rc(t){if(this.OS)return Promise.resolve(this.OS);let e=e=>{for(let i=0;i<t.length;i++){let s=Z.lf(e,t[i]);if(s)return this.OS=s,this.OS}return e};return this.userAgentData.platform?Promise.resolve(e(this.userAgentData.platform)):this.getHighEntropyValues().then(t=>t.platform?e(t.platform):navigator.platform).catch(()=>navigator.platform)}hf(){let t={},e=this.userAgentData.brands;if(e&&e.length)for(let i of e){let e=this.af(V),s=i.brand.match(e);if(s&&s.length>0){t.browser=s[0],t.version=i.version;break}}return t}af(t){let e=[];for(let i in t)e.push(t[i]);return RegExp("("+e.join("|")+")","i")}getHighEntropyValues(){return this.userAgentData.getHighEntropyValues?this.userAgentData.getHighEntropyValues(["platform"]):Promise.reject()}}class X extends K{constructor(){super(),this.Vd=X.hf(navigator.userAgent||"")}
2ff(){return this.Vd[0]||"Unknown Browser"}cf(){return this.Vd[1]||"Unknown Version"}rc(t){for(let e=0;e<t.length;e++){let i=t[e].string,s=X.lf(i,t[e]);if(s)return"Mac"===s&&navigator.maxTouchPoints>1&&(s="iOS"),Promise.resolve(s)}return Promise.resolve(navigator.platform)}static hf(t){let e,i=t.match(/(samsungbrowser|tizen|roku|konqueror|icab|crios|opera|ucbrowser|chatgptbrowser|chrome|safari|firefox|camino|msie|trident(?=\/))\/?\s*(\.?\d+(\.\d+)*)/i)||[];if(-1!==t.indexOf("(Web0S; Linux/SmartTV)"))return["LG Smart TV",null];if(-1!==t.indexOf("CrKey"))return["Chromecast",null];if(-1!==t.indexOf("BRAVIA")||-1!==t.indexOf("SonyCEBrowser")||-1!==t.indexOf("SonyDTV"))return["Sony Smart TV",null];if(-1!==t.indexOf("PhilipsTV"))return["Philips Smart TV",null];if(t.match(/\b(Roku)\b/))return["Roku",null];if(t.match(/\bAFTM\b/))return["Amazon Fire Stick",null];if(i[1]===V.rO){if(t.includes(V.Sg))return[V.Sg,i[2]];if(null!=(e=t.match(/\b(OPR|Edge|EdgA|Edg|UCBrowser)\/(\.?\d+(\.\d+)*)/)))return(e=e.slice(1))[0]=e[0].replace("OPR",V.oO),e[0]=e[0].replace("EdgA",V.eO),"Edg"===e[0]&&(e[0]=V.eO),[e[0],e[1]]}if(i[1]===V.Bg&&null!=(e=t.match(/\b(EdgiOS)\/(\.?\d+(\.\d+)*)/)))return(e=e.slice(1))[0]=e[0].replace("EdgiOS",V.eO),[e[0],e[1]];if((i=i[2]?[i[1],i[2]]:[null,null])[0]===V.Bg&&null!=(e=t.match(/version\/(\.?\d+(\.\d+)*)/i))&&i.splice(1,1,e[1]),null!=(e=t.match(/\b(UCBrowser)\/(\.?\d+(\.\d+)*)/))&&i.splice(1,1,e[2]),i[0]===V.oO&&null!=(e=t.match(/mini\/(\.?\d+(\.\d+)*)/i)))return["Opera Mini",e[1]||""];if(i[0]){let t=i[0].toLowerCase();"crios"===t&&(i[0]=V.rO),"tizen"===t&&(i[0]="Samsung Smart TV",i[1]=null),"samsungbrowser"===t&&(i[0]="Samsung Browser")}return i}}class Y{constructor(){let t;t=navigator.userAgent.toLowerCase().includes(V.Sg.toLowerCase())||!navigator.userAgentData?X:Z,this.vg=new t,this.userAgent=navigator.userAgent,this.browser=this.vg.ff(),this.version=this.vg.cf(),this.OS=null,this.rc().then(t=>this.OS=t);const e=navigator;this.language=(e.userLanguage||e.language||e.browserLanguage||e.systemLanguage||"").toLowerCase(),this.Il=Y.xg(this.userAgent)}fE(){return this.browser===V.Bg}nc(){return this.OS||null}rc(){return this.OS?Promise.resolve(this.OS):this.vg.rc(Y.Og).then(t=>(this.OS=t,t))}static xg(t){t=t.toLowerCase();let e=["bot","slurp","baiduspider","yandex","facebookexternalhit","sogou","ia_archiver","https://github.com/prerender/prerender","aolbuild","bingpreview","mediapartners-google","teoma","taiko","facebookexternalhit","facebookcatalog","meta-webindexer","meta-externalads","meta-externalagent","meta-externalfetcher"];for(let i=0;i<e.length;i++)if(-1!==t.indexOf(e[i]))return!0;return!1}}Y.Og=[{string:navigator.platform,uf:"Win",identity:"Windows"},{string:navigator.platform,uf:"Mac",identity:"Mac"},{string:navigator.platform,uf:"BlackBerry",identity:"BlackBerry"},{string:navigator.platform,uf:"FreeBSD",identity:"FreeBSD"},{string:navigator.platform,uf:"OpenBSD",identity:"OpenBSD"},{string:navigator.platform,uf:"Nintendo",identity:"Nintendo"},{string:navigator.platform,uf:"SunOS",identity:"SunOS"},{string:navigator.platform,uf:"PlayStation",identity:"PlayStation"},{string:navigator.platform,uf:"X11",identity:"X11"},{string:navigator.userAgent,uf:["iPhone","iPad","iPod"],identity:"iOS"},{string:navigator.platform,uf:"Pike v",identity:"iOS"},{string:navigator.userAgent,uf:["Web0S"],identity:"WebOS"},{string:navigator.userAgent,uf:"Tizen",identity:"Tizen"},{string:navigator.userAgent,uf:"Coolita",identity:"Other Smart TV"},{string:navigator.userAgent,uf:"WhaleTV",identity:"Other Smart TV"},{string:navigator.platform,uf:["Linux armv7l","Android"],identity:J},{string:navigator.userAgent,uf:["Android"],identity:J},{string:navigator.platform,uf:"Linux",identity:"Linux"}];let Q=new Y,tt={Ou:{Cu:"ab.storage.userId",tl:"ab.storage.deviceId",um:"ab.storage.sessionId"},ft:{Qc:"ab.test",tE:"ab.storage.events",eE:"ab.storage.attributes",sE:"ab.storage.attributes.anonymous_user",ac:"ab.storage.device",Dl:"ab.storage.sdk_metadata",Tl:"ab.storage.session_id_for_cached_metadata",Uu:"ab.storage.pushToken",rE:"ab.storage.cardImpressions",jc:"ab.storage.serverConfig",oE:"ab.storage.triggers",nE:"ab.storage.triggers.ts",dm:"ab.storage.messagingSessionStart",Ps:"ab.storage.cc",Gs:"ab.storage.ccLastFullSync",Hs:"ab.storage.ccLastCardUpdated",uc:"ab.storage.globalRateLimitCurrentTokenCount",fc:"ab.storage.dynamicRateLimitCurrentTokenCount",Jt:"ab.storage.ccClicks",Vt:"ab.storage.ccImpressions",Pt:"ab.storage.ccDismissals",aE:"ab.storage.lastDisplayedTriggerTimesById",iE:"ab.storage.lastDisplayedTriggerTime",EE:"ab.storage.triggerFireInstancesById",xh:"ab.storage.signature",SE:"ab.storage.brazeSyncRetryCount",Qs:"ab.storage.sdkVersion",lo:"ab.storage.ff",vo:"ab.storage.ffImpressions",Do:"ab.storage.ff
2LastRefreshAt",Co:"ab.storage.ff.sessionId",lE:"ab.storage.lastReqToEndpoint",_E:"ab.storage.requestAttempts",Wn:"ab.storage.deferredIam",Jl:"ab.storage.lastSdkReq",uE:"ab.storage.alias",vt:"ab.storage.banners",Dt:"ab.storage.banners.impressions",Bt:"ab.storage.banners.sessionId",Ue:"ab.storage.dust.mite",Ne:"ab.storage.dust.host",Te:"ab.storage.dust.auth",ze:"ab.storage.dust.expiration"},pe:"ab.optOut"};class te{constructor(t,e){this.TE=t,this.cE=e,this.TE=t,this.cE=e}Sl(t){let e=a(tt.Ou),i=new te.le(t);for(let t of e)i.remove(tt.Ou[t])}Iu(t,e){let i=null;null!=e&&e instanceof w&&(i=e.gt()),this.TE.store(t,i)}hE(t){let e=this.$u(t);null!=e&&(e.gm=new Date().valueOf(),this.Iu(t,e))}$u(t){let e,i=this.TE.jr(t),s=(t=>{let e;try{e=JSON.parse(t)}catch(t){e=null}return e})(i);if(s)(e=w._u(s)||null)&&this.Iu(t,e);else{let s=w.AE(i);e=w._u(s)||null,s!==i&&e&&this.Iu(t,e)}return e}xm(t){this.TE.remove(t)}Al(){let t;for(let e of a(tt.Ou))null!=(t=this.$u(tt.Ou[e]))&&this.Iu(tt.Ou[e],t)}ol(t){let e;if(null==t||0===t.length)return!1;e=r(t)?t:[t];let i=this.cE.jr(tt.ft.tE);null!=i&&r(i)||(i=[]);for(let t=0;t<e.length;t++)i.push(e[t].gt());return this.cE.store(tt.ft.tE,i)}wm(t){return null!=t&&this.ol([t])}RE(){let t=this.cE.jr(tt.ft.tE);this.cE.remove(tt.ft.tE),null==t&&(t=[]);let e=[],i=!1,s=null;if(r(t))for(let i=0;i<t.length;i++)b.gE(t[i])?e.push(b._u(t[i])):s=i;else i=!0;if(i||null!=s){let n="Stored events could not be deserialized as Events";i&&(n+=", was "+Object.prototype.toString.call(t)+" not an array"),null!=s&&(n+=", value at index "+s+" does not look like an event"),n+=", serialized values were of type "+typeof t+": "+JSON.stringify(t),e.push(new b(null,S.wl,new Date().valueOf(),null,{e:n}))}return e}bt(t,e){return!!n(tt.ft,t,"StorageManager cannot store object.","STORAGE_KEYS.OBJECTS")&&this.cE.store(t,e)}dt(t){return!!n(tt.ft,t,"StorageManager cannot retrieve object.","STORAGE_KEYS.OBJECTS")&&this.cE.jr(t)}zt(t){return!!n(tt.ft,t,"StorageManager cannot remove object.","STORAGE_KEYS.OBJECTS")&&(this.cE.remove(t),!0)}clearData(){let t=a(tt.Ou),e=a(tt.ft);for(let e=0;e<t.length;e++){let i=t[e];this.TE.remove(tt.Ou[i])}for(let t=0;t<e.length;t++){let i=e[t];this.cE.remove(tt.ft[i])}}OE(t){return t||tt.ft.sE}Xl(t){let e=this.cE.jr(tt.ft.eE);null==e&&(e={});let i=this.OE(t[H.Va]),s=e[i];for(let n in t)n!==H.Va&&(null==e[i]||s&&null==s[n])&&this.Eu(t[H.Va],n,t[n])}Eu(t,e,i){let s=this.cE.jr(tt.ft.eE);null==s&&(s={});let n=this.OE(t),r=s[n];if(null==r&&(r={},null!=t&&(r[H.Va]=t)),e===H.Bu)for(let t in null==r[e]&&(r[e]={}),i)r[e][t]=i[t];else r[e]=i;return s[n]=r,this.cE.store(tt.ft.eE,s)}IE(){let t=this.cE.jr(tt.ft.eE);this.cE.remove(tt.ft.eE);let e=[];for(let i in t)null!=t[i]&&e.push(t[i]);return e}Lu(t){let e=this.cE.jr(tt.ft.eE);if(null!=e){let i=this.OE(null),s=e[i];null!=s&&(e[i]=void 0,this.cE.store(tt.ft.eE,e),s[H.Va]=t,this.Xl(s))}let i=this.$u(tt.Ou.um),s=null;null!=i&&(s=i.Tu);let n=this.RE();if(null!=n)for(let e=0;e<n.length;e++){let i=n[e];null==i.userId&&i.sessionId==s&&(i.userId=t),this.wm(i)}}dE(){return this.cE.bE}}te.Wc=class{constructor(t){this.tu=t,this.tu=t,this.bE=Q.fE()?3:10}mE(t){return t+"."+this.tu}store(t,e){try{return localStorage.setItem(this.mE(t),JSON.stringify({v:e})),!0}catch(t){return i.info("Storage failure: "+E(t)),!1}}jr(t){try{let e=null,i=localStorage.getItem(this.mE(t));return null!=i&&(e=JSON.parse(i)),null==e?null:e.v}catch(t){return i.info("Storage retrieval failure: "+E(t)),null}}remove(t){try{localStorage.removeItem(this.mE(t))}catch(t){return i.info("Storage removal failure: "+E(t)),!1}}},te.Xc=class{constructor(){this.KE={},this.YE=5242880,this.bE=3}store(t,e){let s=this.NE(e);return s>this.YE?(i.info("Storage failure: object is â"+s+" bytes which is greater than the max of "+this.YE),!1):(this.KE[t]={value:e},!0)}NE(t){let e=[],i=[t],s=0;for(;i.length;){let t=i.pop();if("boolean"==typeof t)s+=4;else if("string"==typeof t)s+=2*t.length;else if("number"==typeof t)s+=8;else if("object"==typeof t&&-1===e.indexOf(t))for(let s in e.push(t),t)i.push(t[s])}return s}jr(t){let e=this.KE[t];return null==e?null:e.value}remove(t){this.KE[t]=null}},te.le=class{constructor(t,e){this.tu=t,this.DE=e,this.tu=t,this.GE=this.CE(),this.ME=576e3,this.DE=!!e}mE(t){return null!=this.tu?t+"."+this.tu:t}CE(){let t=0,e=document.location.hostname,i=e.split("."),s="ab._gd";
2for(;t<i.length-1&&-1===document.cookie.indexOf(s+"="+s);)t++,e="."+i.slice(-1-t).join("."),document.cookie=s+"="+s+";domain="+e+";";return document.cookie=s+"=;expires="+new Date(0).toUTCString()+";domain="+e+";",e}me(){let t=new Date;return t.setTime(t.getTime()+60*this.ME*1e3),t.getFullYear()}pE(){let t=s(tt.Ou),e=document.cookie.split(";");for(let i=0;i<e.length;i++){let s=e[i];for(;" "===s.charAt(0);)s=s.substring(1);let n=!1;for(let e=0;e<t.length;e++)if(0===s.indexOf(t[e])){n=!0;break}if(n){let t=s.split("=")[0];-1===t.indexOf("."+this.tu)&&this.UE(t)}}}store(t,e){let s;this.pE();let n=new Date;n.setTime(n.getTime()+60*this.ME*1e3);let r="expires="+n.toUTCString(),o="domain="+this.GE;s=this.DE?e:encodeURIComponent(e);let l=this.mE(t)+"="+s+";"+r+";"+o+";path=/";return l.length>=4093?(i.info("Storage failure: string is "+l.length+" chars which is too large to store as a cookie."),!1):(document.cookie=l,!0)}jr(t){let e=[],s=this.mE(t)+"=",n=document.cookie.split(";");for(let r=0;r<n.length;r++){let o=n[r];for(;" "===o.charAt(0);)o=o.substring(1);if(0===o.indexOf(s))try{let t;t=this.DE?o.substring(s.length,o.length):decodeURIComponent(o.substring(s.length,o.length)),e.push(t)}catch(e){return i.info("Storage retrieval failure: "+E(e)),this.remove(t),null}}return e.length>0?e[e.length-1]:null}remove(t){this.UE(this.mE(t))}UE(t){let e=t+"=;expires="+new Date(0).toUTCString();document.cookie=e,document.cookie=e+";path=/";let i=e+";domain="+this.GE;document.cookie=i,document.cookie=i+";path=/"}},te.Jc=class{constructor(t,e,i){this.tu=t,this.vE=[],e&&this.vE.push(new te.le(t)),i&&this.vE.push(new te.Wc(t)),this.vE.push(new te.Xc)}store(t,e){let i=!0;for(let s=0;s<this.vE.length;s++)i=this.vE[s].store(t,e)&&i;return i}jr(t){for(let e=0;e<this.vE.length;e++){let i=this.vE[e].jr(t);if(null!=i)return i}return null}remove(t){new te.le(this.tu).remove(t);for(let e=0;e<this.vE.length;e++)this.vE[e].remove(t)}};class ti{constructor(){this.jn={}}Rt(t){if("function"!=typeof t)return null;let e=y();return this.jn[e]=t,e}removeSubscription(t){delete this.jn[t]}removeAllSubscriptions(){this.jn={}}De(){return Object.keys(this.jn).length}L(t){let e=[];for(let i in this.jn){let s=this.jn[i];e.push(s(t))}return e}}t.s(["default",0,ti],953310);class ts{constructor(t,e){this.database=t,this.Rd=e,this.parent="u"<typeof window?self:window,this.database=t,this.Rd=e}Ud(){if("indexedDB"in this.parent)return this.parent.indexedDB}isSupported(){var t;try{if(null==this.Ud())return!1;{let e=null==(t=this.Ud())?void 0:t.open("Braze IndexedDB Support Test");if(e&&(e.onupgradeneeded=()=>e.result.close(),e.onsuccess=()=>e.result.close()),"u">typeof window){let t=window,e=t.chrome||t.browser||t.Od;if(e&&e.runtime&&e.runtime.id)return this.Rd.info("Not using IndexedDB for storage because we are running inside an extension"),!1}return!0}}catch(t){return this.Rd.info("Not using IndexedDB for storage due to following error: "+t),!1}}Kd(t,e){var i;let s=null==(i=this.Ud())?void 0:i.open(this.database.Ld,this.database.VERSION);if(null==s)return"function"==typeof e&&e(),!1;let n=this;return s.onupgradeneeded=t=>{var e;n.Rd.info("Upgrading indexedDB "+n.database.Ld+" to v"+n.database.VERSION+"...");let i=null==(e=t.target)?void 0:e.result;for(let t in n.database.Fs)n.database.Fs.hasOwnProperty(t)&&!i.objectStoreNames.contains(n.database.Fs[t])&&i.createObjectStore(n.database.Fs[t])},s.onsuccess=i=>{var s;let r=null==(s=i.target)?void 0:s.result;r.onversionchange=()=>{r.close(),"function"==typeof e&&e(),n.Rd.error("Needed to close the database unexpectedly because of an upgrade in another tab")},t(r)},s.onerror=t=>{var i;return n.Rd.info("Could not open indexedDB "+n.database.Ld+" v"+n.database.VERSION+": "+(null==(i=t.target)?void 0:i.errorCode)),"function"==typeof e&&e(),!0},!0}setItem(t,e,i,s,n){if(!this.isSupported())return"function"==typeof n&&n(),!1;let r=this;return this.Kd(o=>{if(!o.objectStoreNames.contains(t))return r.Rd.error("Could not store object "+e+" in "+t+" on indexedDB "+r.database.Ld+" - "+t+" is not a valid objectStore"),"function"==typeof n&&n(),void o.close();let l=o.transaction([t],"readwrite");l.oncomplete=()=>o.close();let a=l.objectStore(t).put(i,e);a.onerror=()=>{r.Rd.error("Could not store object "+e+" in "+t+" on indexedDB "+r.database.Ld),"function"==typeof n&&n()},a.onsuccess=()=>{"function"==typeof s&&s()}},n)}getItem(t,e,i){if(!this.isSupported())return!1;let s=this;return this.Kd(n=>{if(!n.objectStoreNames.contains(t))return s.Rd.error("Could not retrieve object "+e+" in "+t+" on indexedDB "+s.database.Ld+" - "+t+" is not a valid objectStore"),void n.close();let r=n.transaction([t],"readonly");r.oncomplete=()=>n.close();let o=r.objectStore(t).get(e);o.onerror=()=>{s.Rd.error("Could not retrieve object "+e+" in "+t+" on indexedDB "+s.database.Ld)},o.onsuccess=t=>{var e;let s=null==(e=t.target)?void 0:e.result;null!=s&&i(s)}})}kr(t,e,i){if(!this.isSupported())return"function"==typeof i&&i(),!1;let s=this;return this.Kd(n=>{if(!n.objectStoreNames.contains(t))return s.Rd.error("Could not retrieve last record from "+t+" on indexedDB "+s.database.Ld+" - "+t+" is not a valid objectStore"),"function"==typeof i&&i(),void n.close();let r=n.transaction([t],"readonly");r.oncomplete=()=>n.close();let o=r.objectStore(t).openCursor(null,"prev");o.onerror=()=>{s.Rd.error("Could not open cursor for "+t+" on indexedDB "+s.database.Ld),"function"==typeof i&&i()},o.onsuccess=t=>{var s;let n=null==(s=t.target)?void 0:s.result;null!=n&&null!=n.value&&null!=n.key?e(n.key,n.value):"function"==typeof i&&i()}},i)}je(t,e){if(!this.isSupported())return!1;let i=this;return this.Kd(s=>{if(!s.objectStoreNames.contains(t))return i.Rd.error("Could not delete record "+e+" from "+t+" on indexedDB "+i.database.Ld+" - "+t+" is not a valid objectStore"),void s.close();let n=s.transaction([t],"readwrite");n.oncomplete=()=>s.close(),n.objectStore(t).delete(e).onerror=()=>{i.Rd.error("Could not delete record "+e+" from "+t+" on indexedDB "+i.database.Ld)}})}Ds(t,e){if(!this.isSupported())return!1;let i=this;return this.Kd(s=>{if(!s.objectStoreNames.contains(t))return i.Rd.error("Could not retrieve objects from "+t+" on indexedDB "+i.database.Ld+" - "+t+" is not a valid objectStore"),void s.close();let n=s.transaction([t],"readwrite");n.oncomplete=()=>s.close();let r=n.objectStore(t),o=r.openCursor(),l=[];o.onerror=()=>{l.length>0?(i.Rd.info("Cursor closed midway through for "+t+" on indexedDB "+i.database.Ld),e(l)):i.Rd.error("Could not open cursor for "+t+" on indexedDB "+i.database.Ld)},o.onsuccess=t=>{var i;let s=null==(i=t.target)?void 0:i.result;null!=s?(null!=s.value&&null!=s.key&&(r.delete(s.key).onsuccess=()=>{l.push(s.value)}),"function"==typeof s.continue&&s.continue()):l.length>0&&e(l)}})}clearData(){if(!this.isSupported())return!1;let t=[];for(let e in this.database.Fs)this.database.Fs.hasOwnProperty(e)&&this.database.Fs[e]!==this.database.Fs.be&&t.push(this.database.Fs[e]);let e=this;return this.Kd(function(i){let s=i.transaction(t,"readwrite");s.oncomplete=()=>i.close();for(let i=0;i<t.length;i++){let n=t[i];s.objectStore(n).clear().onerror=function(){e.Rd.error("Could not clear "+this.source.name+" on indexedDB "+e.database.Ld)}}s.onerror=function(){e.Rd.error("Could not clear object stores on indexedDB "+e.database.Ld)}})}}ts.Us={Rs:{Ld:"AppboyServiceWorkerAsyncStorage",VERSION:6,Fs:{Ze:"data",vr:"pushClicks",Fu:"pushSubscribed",Gd:"fallbackDevice",As:"cardUpdates",be:"optOut",zr:"pendingData",qh:"sdkAuthenticationSignature"},fe:1}},t.s(["IndexedDBAdapter",0,ts],653415);class tn{constructor(t,e,i){this.B=t,this.gh=e,this.ph=i,this.B=t,this.gh=e||!1,this.ph=i,this.Fh=new ti,this.kh=0,this.fh=1}wh(){return this.gh}jh(){return this.B.dt(tt.ft.xh)}setSdkAuthenticationSignature(t){let e=this.jh();this.B.bt(tt.ft.xh,t);let s=ts.Us.Rs;new ts(s,i).setItem(s.Fs.qh,this.fh,t),e!==t&&this.Z()}yh(){this.B.zt(tt.ft.xh);let t=ts.Us.Rs;new ts(t,i).je(t.Fs.qh,this.fh)}subscribeToSdkAuthenticationFailures(t){return this.ph.Rt(t)}Bh(t){this.ph.L(t)}Gh(){this.Fh.removeAllSubscriptions()}Hh(){this.kh+=1}Jh(){return this.kh}Z(){this.kh=0}}class tr{N(t){}changeUser(t=!1){}clearData(t=!1){}}t.s(["default",0,tr],730159);class to{constructor(t){this.id=t,this.id=t}Hn(){let t={};return null!=this.browser&&(t.browser=this.browser),null!=this.ec&&(t.browser_version=this.ec),null!=this.os&&(t.os_version=this.os),null!=this.resolution&&(t.resolution=this.resolution),null!=this.language&&(t.locale=this.language),null!=this.timeZone&&(t.time_zone=this.timeZone),null!=this.userAgent&&(t.user_agent=this.userAgent),t}}let tl={BROWSER:"browser",BROWSER_VERSION:"browserVersion",OS:"os",RESOLUTION:"resolution",LANGUAGE:"language",TIME_ZONE:"timeZone",USER_AGENT:"userAgent"};class ta{constructor(t,e){this.B=t,this.tc=e,this.B=t,null==e&&(e=s(tl)),this.tc=e}ve(t=!0){let e=this.B.$u(tt.Ou.tl);null==e&&(e=new w(y()),t&&this.B.Iu(tt.Ou.tl,e));let i=new to(e.Tu);for(let t=0;t<this.tc.length;t++)switch(this.tc[t]){case tl.BROWSER:i.browser=Q.browser;break;case tl.BROWSER_VERSION:i.ec=Q.version;break;case tl.OS:i.os=this.rc();break;case tl.RESOLUTION:i.sc=screen.width+"x"+screen.height;break;case tl.LANGUAGE:i.language=Q.language;break;case tl.TIME_ZONE:i.timeZone=this.oc(new Date);break;case tl.USER_AGENT:i.userAgent=Q.userAgent}return i}rc(){if(Q.nc())return Q.nc();let t=this.B.dt(tt.ft.ac);return t&&t.os_version?t.os_version:Q.rc()}oc(t){let e=!1;if("u">typeof Intl&&"function"==typeof Intl.DateTimeFormat)try{if("function"==typeof Intl.DateTimeFormat().resolvedOptions){let t=Intl.DateTimeFormat().resolvedOptions().timeZone;if(null!=t&&""!==t)return t}}catch(t){i.info("Intl.DateTimeFormat threw an error, cannot detect user's time zone:"+E(t)),e=!0}if(e)return"";let s=t.getTimezoneOffset();return this.cc(s)}cc(t){let e=Math.trunc(t/60),i=Math.trunc(t%60),s="GMT";return 0!==t&&(s+=(t<0?"+":"-")+(("00"+Math.abs(e)).slice(-2)+":")+("00"+Math.abs(i)).slice(-2)),s}}let tu="invalid_json_response",th="empty_response";class tc{constructor(t=!1,e=[]){this.W=t,this.Ee=e,this.W=t,this.Ee=e}
2Yt(t){this.W=this.W&&t.W,this.Ee.push(...t.Ee)}}t.s(["default",0,tc],419469);let td={lt:(t,e,s)=>{var n,r;let o=new tc,l=t9.u();if(!l)return i.info(`Not logging event with type "${t}" because the current session ID could not be found.`),o;let a=l.el();return o.Ee.push(new b(s||(null==(n=t9.ir())?void 0:n.getUserId()),t,new Date().valueOf(),a,e)),o.W=(null==(r=t9.p())?void 0:r.ol(o.Ee))||!1,o}},tf={H:{Ze:"data",vi:"content_cards/sync",wo:"feature_flags/sync",On:"template",G:"banners/sync"},bc:t=>null==t?void 0:t.dt(tt.ft.lE),Am:t=>null==t?void 0:t.dt(tt.ft._E),Rm:(t,e)=>{null==t||t.bt(tt.ft.lE,e)},qm:(t,e)=>{null==t||t.bt(tt.ft._E,e)},Pl:(t,e)=>{if(!t||!e)return -1;let i=tf.bc(t);if(null==i)return -1;let s=i[e];return null==s||isNaN(s)?-1:s},Ul:(t,e)=>{let i=1;if(!t||!e)return i;let s=tf.Am(t);return null==s?i:null==(i=s[e])||isNaN(i)?1:i},K:(t,e,i)=>{if(!t||!e)return;let s=tf.bc(t);null==s&&(s={}),s[e]=i,tf.Rm(t,s)},xl:(t,e,i)=>{if(!t||!e)return;let s=tf.Am(t);null==s&&(s={}),s[e]=i,tf.qm(t,s)},fi:(t,e)=>{t&&e&&tf.xl(t,e,1)},Zl:(t,e)=>{if(!t||!e)return;let i=tf.Ul(t,e);tf.xl(t,e,i+1)}},tg=tf,tm=t=>{let e,i,s={},n=t.toString().split("\r\n");if(!n)return s;for(let t of n)t&&(e=t.slice(0,t.indexOf(":")).toLowerCase().trim(),i=t.slice(t.indexOf(":")+1).trim(),s[e]=i);return s},tp={O:t=>{let e,s;try{let n=!1;if(window.XMLHttpRequest&&(n=!0),!n)return void i.error("This browser does not have any supported ajax options!");e=new XMLHttpRequest;let r=i=>{"function"==typeof t.error&&t.error(e.status),"function"==typeof t.tt&&t.tt(!1,i)};for(let i of(e.onload=()=>{let i=!1;if(4!==e.readyState)return;i=e.status>=200&&e.status<300||304===e.status;let s=e.getAllResponseHeaders();if(i){if("function"==typeof t.W){let i;try{i=JSON.parse(e.responseText)}catch(n){let i={error:""===e.responseText?th:tu,response:e.responseText};(0,t.W)(i,s)}i&&t.W(i,s)}"function"==typeof t.tt&&t.tt(!0,s)}else r(s)},e.onerror=()=>{r(e.getAllResponseHeaders())},e.ontimeout=()=>{r()},s=JSON.stringify(t.data),e.open("POST",t.url,!0),e.setRequestHeader("Content-type","application/json"),e.setRequestHeader("X-Requested-With","XMLHttpRequest"),t.headers||[]))e.setRequestHeader(i[0],i[1]);e.send(s)}catch(t){i.error(`Network request error: ${E(t)}`)}}};t.s(["default",0,tp,"readResponseHeaders",0,tm],324310);class tv{constructor(t,e,i,s,n,r,o,l,a,u,h,c){this.eu=t,this.B=e,this.hl=i,this.vs=s,this.C=n,this.h=r,this.tu=o,this.al=l,this.sl=a,this.rl=u,this.appVersion=h,this.vl=c,this.Rl=t=>null==t?"":`${t} `,this.eu=t,this.B=e,this.hl=i,this.vs=s,this.C=n,this.h=r,this.tu=o,this.al=l,this.sl=a,this.rl=u,this.appVersion=h,this.vl=c,this.bl=["npm"],this.ql={}}$(t,i=!1,s=!1){let n=this.eu.ve(!s),r=n.Hn();u(this.B.dt(tt.ft.ac),r)||(t.device=r),t.api_key=this.tu,t.time=h(new Date().valueOf(),!0);let o=this.B.dt(tt.ft.Dl)||[],l=this.B.dt(tt.ft.Tl)||"";this.bl.length>0&&(!u(o,this.bl)||l!==this.C.yt())&&(t.sdk_metadata=this.bl),t.sdk_version=this.sl,this.rl&&(t.sdk_flavor=this.rl),t.app_version=this.appVersion,t.app_version_code=this.vl,t.device_id=n.id;let a=this.vs.getUserId();if(i&&null!==a&&(t.user_id=a),!a&&!this.hl.wh()){let i=e(this.B);i&&(t.alias=i)}return t}Y(t,e,s){let n=e.auth_error,o=e.error;if(!n&&!o)return!0;if(n){let e;this.hl.Hh();let o={errorCode:n.error_code};for(let t of s)r(t)&&"X-Braze-Auth-Signature"===t[0]&&(o.signature=t[1]);t.respond_with&&t.respond_with.user_id?o.userId=t.respond_with.user_id:t.user_id&&(o.userId=t.user_id);let l=n.reason;return l?(o.reason=l,e=`due to ${l}`):e=`with error code ${n.error_code}.`,this.hl.wh()||(e+=' Please use the "enableSdkAuthentication" initialization option to enable authentication.'),i.error(`SDK Authentication failed ${e}`),this.kl(t.events||[],t.attributes||[]),this.hl.Bh(o),!1}if(o){let s,n=o;switch(n){case th:return s="Received successful response with empty body.",td.lt(S.wl,{e:s}),i.info(s),!1;case tu:return s="Received successful response with invalid JSON",td.lt(S.wl,{e:s+": "+e.response}),i.info(s),!1;case"invalid_api_key":n=`The API key "${t.api_key}" is invalid for the baseUrl ${this.al}`;break;case"blacklisted":n="Sorry, we are not currently accepting your requests. If you think this is in error, please contact us.";break;case"no_device_identifier":n="No device identifier. Please contact [email protected]"}i.error("Backend error: "+n)}return!1}Ml(t,e,i){return!!(t&&0!==t.length||e&&0!==e.length||i)}$l(t,e,i,s=!1){let n=[],r=t=>t||"",o=r(this.vs.getUserId()),l=this.Xn(t),a=[],u=[],h,c=null;if(e.length>0){let t=[];
2for(let i of e){if(h=i.Hn(),this.hl.wh()){if(o&&!h.user_id){c||(c={}),c.events||(c.events=[]),c.events.push(h);continue}if(r(h.user_id)!==o){u.push(h);continue}}t.push(h)}t.length>0&&(l.events=t)}if(i.length>0){let t=[];for(let e of i)e&&(this.hl.wh()&&r(e.user_id)!==o?a.push(e):t.push(e));t.length>0&&(l.attributes=t)}if(this.kl(u,a),l=this.$(l,!1,s),c){let t={requestData:c=this.$(c,!1,s),headers:this.A(c,tg.H.Ze)};n.push(t)}if(l&&!this.Ml(l.events,l.attributes,t))return c?n:null;let d={requestData:l,headers:this.A(l,tg.H.Ze)};return n.push(d),n}kl(t,e){if(t){let e=[];for(let i of t){let t=b.fromJson(i);t.time=c(t.time),e.push(t)}this.B.ol(e)}if(e)for(let t of e)this.B.Xl(t)}_(t,e){let s="HTTP error ";null!=t&&(s+=t+" "),s+=e,i.error(s)}Ll(t){return td.lt(S.Fl,{n:t})}Xn(t,i){let s={};t&&(s.triggers=!0);let n=null!=i?i:this.vs.getUserId();if(n&&(s.user_id=n),!s.user_id&&!this.hl.wh()){let t=e(this.B);t&&(s.alias=t)}return s.config={config_time:this.h.xt()},{respond_with:s}}Kl(t){let e=new Date().valueOf(),i="7200000",s=tg.Pl(this.B,t);return -1!==s&&(i=(e-s).toString()),i}A(t,e,i=!1){let s=[["X-Braze-Api-Key",this.tu]],n=this.Kl(e);s.push(["X-Braze-Last-Req-Ms-Ago",n]);let r=tg.Ul(this.B,e).toString();s.push(["X-Braze-Req-Attempt",r]);let o=!1;if(null!=t.respond_with&&t.respond_with.triggers&&(s.push(["X-Braze-TriggersRequest","true"]),o=!0),e===tg.H.vi){s.push(["X-Braze-ContentCardsRequest","true"]);let t=tg.Ul(this.B,tg.H.vi);t&&!i||(t=1,tg.xl(this.B,tg.H.vi,t));let e=Math.max(0,t-1);s.push(["BRAZE-SYNC-RETRY-COUNT",e.toString()]),o=!0}if(e===tg.H.wo&&(s.push(["X-Braze-FeatureFlagsRequest","true"]),o=!0),o&&s.push(["X-Braze-DataRequest","true"]),this.hl.wh()){let t=this.hl.jh();null!=t&&s.push(["X-Braze-Auth-Signature",t])}return s}Hl(t,e,s,n){if(this.ql[n])return;let r=window.setTimeout(()=>{i.info(`Retrying rate limited ${this.Rl(n)}SDK request.`),this.J(e,s,n)},t);this.ql[n]=r}fo(){for(let t in this.ql){let e=this.ql[t];window.clearTimeout(e)}this.ql={}}J(t,e,s,n){if(!this.Ol(s))return i.info(`${this.Rl(s)}SDK request being rate limited.`),void("function"==typeof n&&n());let r=this.Gl();if(!r.Wl)return this.Hl(r.Yl,t,e,s),void i.info(`${this.Rl(s)}SDK request being rate limited. Request will be retried in ${Math.trunc(r.Yl/1e3)} seconds.`);this.B.bt(tt.ft.Jl,new Date().valueOf());let o=t.device;o&&o.os_version instanceof Promise?o.os_version.then(i=>{t.device.os_version=i,e(r.Ql)}):e(r.Ql)}Vl(t){let e=t?tm(t):null;if(!e||!e["retry-after"])return null;let i=e["retry-after"];return isNaN(i)&&!isNaN(Date.parse(i))?{type:"date",value:Date.parse(i)}:isNaN(parseFloat(i.toString()))?(td.lt(S.wl,{e:"Received unexpected value for retry-after header in /sync response: "+i}),null):{type:"timestamp",value:1e3*parseFloat(i.toString())}}et(t,e,i,s,n,r){let o;if(tg.Ul(this.B,i)>=15)return;r=r||0;let l=this.Vl(t);n();let a=t=>{s(window.setTimeout(()=>{e()},t)),tg.Zl(this.B,i)};if(l&&!isNaN(l.value)){switch(l.type){case"date":(o=l.value-new Date().getTime()+r)<0&&e();break;case"timestamp":o=l.value+r}a(o)}else r?a(r):tg.fi(this.B,i)}hc(t){var e;null==(e=this.B)||e.bt(tt.ft.uc,t)}lc(t,e){let i=this.dc();null==i&&(i={}),i[t]=e,this.B.bt(tt.ft.fc,i)}mc(){var t;return null==(t=this.B)?void 0:t.dt(tt.ft.uc)}dc(){var t;return null==(t=this.B)?void 0:t.dt(tt.ft.fc)}vc(t,e,i,s,n=""){let r;if(n){let t=this.dc();r=null==t||isNaN(t[n])?e:t[n]}else(null==(r=this.mc())||isNaN(r))&&(r=e);return Math.min(r+(t-s)/1e3/i,e)}Rc(t,e){return Math.max(0,(1-t)*e*1e3)}gc(t,e=""){var i,s,n,r,o;let l={Wl:!0,Ql:-1,Yl:0};if(null==t&&(t=!0),!t&&!e)return l;let a,u,h=null;if(t)h=null==(i=this.B)?void 0:i.dt(tt.ft.Jl);else{let t=tg.bc(this.B);if(null==t||null==t[e])return l;h=t[e]}
2if(null==h||isNaN(h)||(t?(a=(null==(s=this.h)?void 0:s.qc())||-1,u=(null==(n=this.h)?void 0:n.Ac())||-1):(a=(null==(r=this.h)?void 0:r.Dc(e))||-1,u=(null==(o=this.h)?void 0:o.Tc(e))||-1),-1===a||-1===u))return l;let c=new Date().valueOf(),d=this.vc(c,a,u,h,e);return d<1?(l.Wl=!1,l.Yl=this.Rc(d,u)):(l.Ql=d=Math.trunc(d)-1,t?this.hc(d):this.lc(e,d)),l}Gl(){return this.gc(!0)}Ol(t){let e=this.gc(!1,t);return!(e&&!e.Wl)}Z(){this.hl.Z()}V(){return this.al}addSdkMetadata(t){for(let e of t)-1===this.bl.indexOf(e)&&this.bl.push(e)}}let tb=(t,e)=>(t=Math.ceil(t),Math.floor(Math.random()*((e=Math.floor(e))-t+1))+t);t.s(["randomInclusive",0,tb],92305);let ty={cu:()=>"serviceWorker"in navigator&&"u">typeof ServiceWorkerRegistration&&"showNotification"in ServiceWorkerRegistration.prototype&&"PushManager"in window,lu:()=>"safari"in window&&"pushNotification"in window.safari&&"function"==typeof window.safari.pushNotification.permission&&"function"==typeof window.safari.pushNotification.requestPermission,isPushSupported:()=>ty.cu()||ty.lu(),isPushBlocked:()=>{let t=ty.isPushSupported()&&"Notification"in window&&null!=window.Notification&&null!=window.Notification.permission&&"denied"===window.Notification.permission,e=ty.isPushSupported()&&(!("Notification"in window)||null==window.Notification);return t||e},isPushPermissionGranted:()=>ty.isPushSupported()&&"Notification"in window&&null!=window.Notification&&null!=window.Notification.permission&&"granted"===window.Notification.permission,En:()=>ty.isPushBlocked()?{Gn:!1,reason:"blocked"}:ty.isPushSupported()?ty.isPushPermissionGranted()?{Gn:!1,reason:"permissionGranted"}:{Gn:!0}:{Gn:!1,reason:"unsupported"},Nn:(t,e)=>"blocked"===t?`${e} containing a push prompt is not being shown because the user has already declined push permission prompt.`:"unsupported"===t?`${e} containing a push prompt is not being shown because the browser doesn't support push notifications.`:`${e} containing a push prompt is not being shown because the user has already accepted the permission prompt.`};t.s(["default",0,ty],840647);let tE="ab-pause-scrolling";class tw{constructor(t,e,i,s,n,r,o,l,a,u){this.tu=t,this.baseUrl=e,this.C=i,this.eu=s,this.vs=n,this.h=r,this.B=o,this.$c=l,this.hl=a,this.j=u,this.tu=t,this.baseUrl=e,this.Zc=0,this.bE=o.dE()||0,this.sd=null,this.C=i,this.eu=s,this.vs=n,this.h=r,this.B=o,this.hl=a,this.j=u,this.$c=l,this.hd=new ti,this.nd=null,this.rd=50,this.ld=!1,this.ud=!1}ad(t,e){return!t&&!e&&this.hl.Jh()>=this.rd}md(t){let e=this.C.am();if(t.length>0){let i=this.vs.getUserId();for(let s of t){let t=!s.userId&&!i||s.userId===i;s.type===S.Sm&&t&&(e=!0)}}return e}fd(t=!1,e=!0,s,n,r,o=!1,l=!1){e&&this.gd();let a=this.B.RE(),u=this.B.IE(),h=!1,c=(t,i,o=-1)=>{let l=new Date().valueOf();tg.K(this.B,tg.H.Ze,l),-1!==o&&i.push(["X-Braze-Req-Tokens-Remaining",o.toString()]);let a=!1;tp.O({url:this.baseUrl+"/data/",data:t,headers:i,W:e=>{null!=t.respond_with&&t.respond_with.triggers&&(this.Zc=Math.max(this.Zc-1,0)),this.j.Y(t,e,i)?(this.hl.Z(),this.h.Sc(e),null!=t.respond_with&&t.respond_with.user_id!=this.vs.getUserId()||(null!=t.device&&this.B.bt(tt.ft.ac,t.device),null!=t.sdk_metadata&&(this.B.bt(tt.ft.Dl,t.sdk_metadata),this.B.bt(tt.ft.Tl,this.C.yt())),this.$c(e),tg.xl(this.B,tg.H.Ze,1),"function"==typeof s&&s())):e.auth_error&&(a=!0)},error:()=>{a=!0,null!=t.respond_with&&t.respond_with.triggers&&(this.Zc=Math.max(this.Zc-1,0)),this.j.kl(t.events,t.attributes),"function"==typeof n&&n()},tt:(t,i)=>{"function"==typeof r&&r(!a);let s=this.j.Vl(i),n=0;if(s)switch(s.type){case"date":n=Math.max(s.value-new Date().valueOf(),0);break;case"timestamp":n=s.value}if(e&&!h){if(a){tg.Zl(this.B,tg.H.Ze);let t=this.h.st(),e=this.h.it(),i=this.h.nt(),s=this.sd;(null==s||s<t)&&(s=t);let r=Math.min(i,tb(t,s*e))+n;this.pd(r)}else this.pd(Math.max(1e3*this.bE,n));h=!0}}})},d=this.md(a),f=t||d;if(this.ad(o,d))return void i.info("Declining to flush data due to 50 consecutive authentication failures");if(e&&!this.j.Ml(a,u,f))return this.pd(),void("function"==typeof r&&r(!0));let g=this.j.$l(f,a,u,l);f&&this.Zc++;let m=!1;if(g)for(let t of g)this.j.J(t.requestData,e=>c(t.requestData,t.headers,e),tg.H.Ze,n),m=!0;this.hl.wh()&&e&&!m?this.pd():d&&(i.info("Invoking new session subscriptions"),this.hd.L(),this.ud=!0)}vd(){return this.Zc>0}pd(t=1e3*this.bE){this.ld||(this.gd(),this.nd=window.setTimeout(()=>{if(document.hidden){let t="visibilitychange",e=()=>{document.hidden||(document.removeEventListener(t,e,!1),this.fd())};document.addEventListener(t,e,!1)}else this.fd()},t),this.sd=t)}gd(){null!=this.nd&&(clearTimeout(this.nd),this.nd=null)}initialize(){this.ld=!1,this.pd()}destroy(){this.hd.removeAllSubscriptions(),this.hl.Gh(),this.gd(),this.ld=!0,this.fd(void 0,!1,void 0,void 0,void 0,void 0,!0),this.nd=null,this.ud=!1}rn(t){return this.ud?(t(),null):this.hd.Rt(t)}openSession(){let e=this.C.yt()!==this.C.el();e&&(this.B.hE(tt.Ou.tl),this.B.hE(tt.Ou.Cu)),this.fd(!1,void 0,()=>{e&&(this.B.zt(tt.ft.vo),this.B.zt(tt.ft.Dt))}),this.Ya(),e&&t.A(621515).then(t=>{if(this.ld)return;let e=t.default.ra();if(null!=e&&(ty.isPushPermissionGranted()||ty.isPushBlocked())){let t=()=>{e.du()?i.info("Push token maintenance is disabled, not refreshing token for backend."):e.subscribe()},s=()=>{let e=this.B.dt(tt.ft.Uu);(null==e||e)&&t()},n=ts.Us.Rs;
2new ts(n,i).kr(n.Fs.Fu,(e,i)=>{i&&t()},s)}})}bd(){this.B.zt(tt.ft.lo),this.B.zt(tt.ft.Ps),this.B.zt(tt.ft.Wn)}wd(){var t,e;this.B.zt(tt.ft.Jl),this.B.zt(tt.ft.lE);let i=tg.H;for(let e in i){let s=i[e];this.j.lc(s,null==(t=this.h)?void 0:t.Dc(s))}this.j.hc(null==(e=this.h)?void 0:e.qc())}changeUser(t,e,s){let n=this.vs.getUserId();if(n!==t){this.C.jm(),this.bd(),function(){let t=document.querySelectorAll(".ab-iam-root");for(let e=0;e<t.length;e++){let i=t[e];if(i.id){let t=i.id+"-css",e=document.getElementById(t);e&&e.parentNode&&e.parentNode.removeChild(e)}i.parentNode&&i.parentNode.removeChild(i)}let e=document.getElementsByClassName(tE);for(let t=0;t<e.length;t++){let i=e[t].classList;i.contains(tE)&&i.remove(tE)}}(),null!=n&&this.fd(void 0,!1,void 0,void 0,void 0),this.vs.Ju(t),s?this.hl.setSdkAuthenticationSignature(s):this.hl.yh();for(let t=0;t<e.length;t++)e[t].changeUser(null==n);this.j.fo(),null!=n&&this.B.zt(tt.ft.rE),this.B.zt(tt.ft.ac),this.B.zt(tt.ft.uE),this.wd(),this.openSession(),i.info('Changed user to "'+t+'".')}else{let e="Doing nothing.";s&&this.hl.jh()!==s&&(this.hl.setSdkAuthenticationSignature(s),e="Updated SDK authentication signature"),i.info(`Current user is already ${t}. ${e}`)}}requestImmediateDataFlush(t){this.gd(),this.C.el(),this.fd(void 0,void 0,void 0,()=>{i.error("Failed to flush data, request will be retried automatically.")},t,!0)}yr(t,e){this.C.el(),i.info("Requesting explicit trigger refresh."),this.fd(!0,void 0,t,e)}Gu(t,e){let s=S.kd,n={a:t,l:e},r=td.lt(s,n);return r&&(i.info(`Logged alias ${t} with label ${e}`),this.B.bt(tt.ft.uE,n)),r}Mu(t,e,s){if(this.h.qu(e))return i.info(`Custom Attribute "${e}" is blocklisted, ignoring.`),new tc;let n=td.lt(t,{key:e,value:s});if(n){let t="object"==typeof s?JSON.stringify(s,null,2):s;i.info(`Logged custom attribute: ${e} with value: ${t}`)}return n}setLastKnownLocation(t,e,s,n,r,o){let l={latitude:e,longitude:s};null!=n&&(l.altitude=n),null!=r&&(l.ll_accuracy=r),null!=o&&(l.alt_accuracy=o);let a=td.lt(S.yd,l,t||void 0);return a&&i.info(`Set user last known location as ${JSON.stringify(l,null,2)}`),a}$r(t,e){let i=this.C.el();return new b(this.vs.getUserId(),S.jd,t,i,{cid:e})}Sd(t,e){return new ts(t,e)}Ya(){let t=ts.Us.Rs;this.Sd(t,i).setItem(t.Fs.Ze,1,{baseUrl:this.baseUrl,data:{api_key:this.tu,device_id:this.eu.ve().id},userId:this.vs.getUserId(),sdkAuthEnabled:this.hl.wh()})}Fr(t){for(let e of t)if(e.api_key===this.tu)this.j.kl(e.events,e.attributes);else{let t=ts.Us.Rs;new ts(t,i).setItem(t.Fs.zr,y(),e)}}Na(t,e,s){let n,r;return this.h.qu(t)?(i.info(`Custom Attribute "${t}" is blocklisted, ignoring.`),new tc):(null===e&&null===s?(n=S.Ad,r={key:t}):(n=S.Dd,r={key:t,latitude:e,longitude:s}),td.lt(n,r))}Ra(t,e){return td.lt(S.$d,{group_id:t,status:e})}}class tS{constructor(t=0,e=[],i=[],s=[],n=null,r=null,o={enabled:!1},l={enabled:!1,refresh_rate_limit:void 0},a={enabled:!0,capacity:30,refill_rate:30,endpoint_overrides:{}},u=null,h=null,c=null){this.kc=t,this.Ic=e,this.Kc=i,this.Pc=s,this.Oc=n,this.xc=r,this.Gc=o,this.Xr=l,this.Nc=a,this.banners=u,this.dust=h,this.Hc=c,this.kc=t,this.Ic=e,this.Kc=i,this.Pc=s,this.Oc=n,this.xc=r,this.Gc=o,this.Xr=l,this.Nc=a,this.banners=u,this.dust=h,this.Hc=c}gt(){return{s:"6.5.0",l:this.kc,e:this.Ic,a:this.Kc,p:this.Pc,m:this.Oc,v:this.xc,c:this.Gc,f:this.Xr,grl:this.Nc,b:this.banners,d:this.dust,rb:this.Hc}}static _u(t){let e=t.l;return"6.5.0"!==t.s&&(e=0),new tS(e,t.e,t.a,t.p,t.m,t.v,t.c,t.f,t.grl,t.b,t.d,t.rb)}}class tT{constructor(t){this.B=t,this.B=t,this.Ec=new ti,this.Bc=new ti,this.wc=new ti,this.Cc=new ti,this.yc=new ti,this.Fc=null,this.Lc=null}Mc(){if(null==this.Lc){let t=this.B.dt(tt.ft.jc);this.Lc=null!=t?tS._u(t):new tS}return this.Lc}xt(){return this.Mc().kc}Sc(t){var e,i,s,n;if(null!=t&&null!=t.config){let r=t.config;if(r.time>this.Mc().kc){let t=t=>null==t?this.Mc().Nc:t,o=new tS(r.time,r.events_blacklist,r.attributes_blacklist,r.purchases_blacklist,r.messaging_session_timeout,r.vapid_public_key,r.content_cards,r.feature_flags,t(r.global_request_rate_limit),r.banners,r.dust,r.request_backoff),l=!1;null!=o.xc&&this.ju()!==o.xc&&(l=!0);let a=!1;null!=o.Gc.enabled&&this.wi()!==o.Gc.enabled&&(a=!0);let u=!1;null!=o.Xr.enabled&&this.Yr()!==o.Xr.enabled&&(u=!0);let h=!1;null!=(null==(e=o.banners)?void 0:e.enabled)&&this.kt()!==(null==(i=o.banners)?void 0:i.enabled)&&(h=!0);let c=!1;null!=(null==(s=o.dust)?void 0:s.enabled)&&this.Ye()!==(null==(n=o.dust)?void 0:n.enabled)&&(c=!0),this.Lc=o,this.B.bt(tt.ft.jc,o.gt()),l&&this.Ec.L(),a&&this.Bc.L(),u&&this.wc.L(),h&&this.Cc.L(),c&&this.yc.L()}}}xu(t){let e=this.Ec.Rt(t);return this.Fc&&this.Ec.removeSubscription(this.Fc),this.Fc=e,e}Ci(t){return this.Bc.Rt(t)}
2jo(t){return this.wc.Rt(t)}P(t){return this.Cc.Rt(t)}Tr(t){return this.yc.Rt(t)}Ce(t){return -1!==this.Mc().Ic.indexOf(t)}qu(t){return -1!==this.Mc().Kc.indexOf(t)}Dr(t){return -1!==this.Mc().Pc.indexOf(t)}_c(){return this.Mc().Oc}ju(){return this.Mc().xc}wi(){return this.Mc().Gc.enabled||!1}Vc(){let t=this.Mc().Nc;return!(!t||null==t.enabled)&&t.enabled}qc(){if(!this.Vc())return -1;let t=this.Mc().Nc;return null==t.capacity||t.capacity<10?-1:t.capacity}Ac(){if(!this.Vc())return -1;let t=this.Mc().Nc;return null==t.refill_rate||t.refill_rate<=0?-1:t.refill_rate}zc(t){let e=this.Mc().Nc.endpoint_overrides;return null==e?null:e[t]}Dc(t){let e=this.zc(t);return null==e||isNaN(e.capacity)||e.capacity<=0?-1:e.capacity}Tc(t){let e=this.zc(t);return null==e||isNaN(e.refill_rate)||e.refill_rate<=0?-1:e.refill_rate}Yr(){return this.Mc().Xr.enabled&&null==this.yo()?(td.lt(S.wl,{e:"Missing feature flag refresh_rate_limit."}),!1):this.Mc().Xr.enabled||!1}yo(){return this.Mc().Xr.refresh_rate_limit}kt(){var t;return(null==(t=this.Mc().banners)?void 0:t.enabled)||null}oe(){var t;return(null==(t=this.Mc().banners)?void 0:t.max_placements)||0}Ye(){var t;return(null==(t=this.Mc().dust)?void 0:t.enabled)||!1}st(){var t;let e=null==(t=this.Mc().Hc)?void 0:t.min_sleep_duration_ms;return null!=e?e:1e4}it(){var t;let e=null==(t=this.Mc().Hc)?void 0:t.scale_factor;return null!=e?e:3}nt(){var t;let e=null==(t=this.Mc().Hc)?void 0:t.max_sleep_duration_ms;return null!=e?e:3e5}}class tI{constructor(t,e,s,n){this.B=t,this.vs=e,this.h=s,this.tm=n,this.B=t,this.vs=e,this.h=s,this.im=1e3,(null==n||isNaN(n))&&(n=1800),n<this.im/1e3&&(i.info("Specified session timeout of "+n+"s is too small, using the minimum session timeout of "+this.im/1e3+"s instead."),n=this.im/1e3),this.tm=n}nm(t,e){return new b(this.vs.getUserId(),S.hm,t,e.Tu,{d:h(t-e.lm)})}yt(){let t=this.B.$u(tt.Ou.um);return null==t?null:t.Tu}am(){let t=new Date().valueOf(),e=this.h._c();if(null==e)return!1;let i=this.B.dt(tt.ft.dm),s=null==i||t-i>1e3*e;return s&&this.B.bt(tt.ft.dm,t),s}fm(t,e){return null==e||null==e.pm||!(t-e.lm<this.im)&&e.pm<t}el(){let t=new Date().valueOf(),e=t+1e3*this.tm,s=this.B.$u(tt.Ou.um);if(this.fm(t,s)){let n="Generating session start event with time "+t;if(null!=s){let t=s.gm;t-s.lm<this.im&&(t=s.lm+this.im),this.B.wm(this.nm(t,s)),n+=" (old session ended "+t+")"}n+=". Will expire "+e.valueOf(),i.info(n);let r=new w(y(),e);return this.B.wm(new b(this.vs.getUserId(),S.Sm,t,r.Tu)),this.B.Iu(tt.Ou.um,r),null==this.B.dt(tt.ft.dm)&&this.B.bt(tt.ft.dm,t),r.Tu}if(null!=s)return s.gm=t,s.pm=e,this.B.Iu(tt.Ou.um,s),s.Tu}jm(){let t=this.B.$u(tt.Ou.um);null!=t&&(this.B.xm(tt.Ou.um),this.B.wm(this.nm(new Date().valueOf(),t)))}}let t_={_l:function(t,e=!1){let s,n=!1;try{if(localStorage&&localStorage.getItem)try{localStorage.setItem(tt.ft.Qc,"true"),localStorage.getItem(tt.ft.Qc)&&(localStorage.removeItem(tt.ft.Qc),n=!0)}catch(t){if(!(t instanceof Error&&("QuotaExceededError"===t.name||"NS_ERROR_DOM_QUOTA_REACHED"===t.name)&&localStorage.length>0))throw t;n=!0}}catch(t){i.info("Local Storage not supported!")}let r=t_.Uc(),o=new te.Jc(t,r&&!e,n);return s=n?new te.Wc(t):new te.Xc,new te(o,s)},Uc:function(){return navigator.cookieEnabled||"cookie"in document&&(document.cookie.length>0||(document.cookie="test").indexOf.call(document.cookie,"test")>-1)}};class tB{constructor(t,e){this.triggerId=t,this.messageExtras=e,this.triggerId=t,this.messageExtras=e,this.extras={},this.isControl=!0,this.Gt=!1}static fromJson(t){return new tB(t.trigger_id,t.message_extras)}Wt(){return!this.Gt&&(this.Gt=!0,!0)}sm(){return this.Gt}}let tk={lp:null,td:function(t,e=!1,i=!1,s=!1){if(null==t)return!1;e=e||!1,i=i||!1;let n=t.getBoundingClientRect();return null!=n&&(n.top>=0&&n.top<=(window.innerHeight||document.documentElement.clientHeight)||!e)&&(n.left>=0||!s)&&(n.bottom>=0&&n.bottom<=(window.innerHeight||document.documentElement.clientHeight)||!i)&&(n.right<=(window.innerWidth||document.documentElement.clientWidth)||!s)}};function tC(t){if(t.onclick){let e=document.createEvent("MouseEvents");e.initEvent("click",!0,!0),t.onclick.apply(t,[e])}}let tR=t=>null!==t&&"IFRAME"===t.tagName;class tO{constructor(t,e,i,s,n,r,o,l,a,u,h,c,d,f,g,m,p,v,b,y,E,w,S,T,I,_,B,k,C,R,O,A){this.message=t,this.messageAlignment=e,this.slideFrom=i,this.extras=s,this.triggerId=n,this.clickAction=r,this.uri=o,this.openTarget=l,this.dismissType=a,this.duration=u,this.icon=h,this.imageUrl=c,this.imageStyle=d,this.iconColor=f,this.iconBackgroun
2dColor=g,this.backgroundColor=m,this.textColor=p,this.closeButtonColor=v,this.animateIn=b,this.animateOut=y,this.header=E,this.headerAlignment=w,this.headerTextColor=S,this.frameColor=T,this.buttons=I,this.cropType=_,this.orientation=B,this.htmlId=k,this.css=C,this.messageExtras=R,this.language=O,this.altImageText=A,this.message=t,this.messageAlignment=e||tO.TextAlignment.CENTER,this.duration=u||5e3,this.slideFrom=i||tO.SlideFrom.BOTTOM,this.extras=s||{},this.triggerId=n,this.clickAction=r||tO.ClickAction.NONE,this.uri=o,this.openTarget=l||tO.OpenTarget.NONE,this.dismissType=a||tO.DismissType.AUTO_DISMISS,this.icon=h,this.imageUrl=c,this.imageStyle=d||tO.ImageStyle.TOP,this.iconColor=f||tO.th.ih,this.iconBackgroundColor=g||tO.th.sh,this.backgroundColor=m||tO.th.ih,this.textColor=p||tO.th.hh,this.closeButtonColor=v||tO.th.eh,this.animateIn=b,null==this.animateIn&&(this.animateIn=!0),this.animateOut=y,null==this.animateOut&&(this.animateOut=!0),this.header=E,this.headerAlignment=w||tO.TextAlignment.CENTER,this.headerTextColor=S||tO.th.hh,this.frameColor=T||tO.th.Eh,this.buttons=I||[],this.cropType=_||tO.CropType.FIT_CENTER,this.orientation=B,this.htmlId=k,this.css=C,this.isControl=!1,this.messageExtras=R,this.language=O,this.altImageText=A,this.nh=!1,this.Gt=!1,this.dd=!1,this.Th=!1,this.qo=null,this.$o=null,this.ti=new ti,this.oh=new ti,this.Io=tO.TextAlignment.CENTER}subscribeToClickedEvent(t){return this.ti.Rt(t)}subscribeToDismissedEvent(t){return this.oh.Rt(t)}removeSubscription(t){this.ti.removeSubscription(t),this.oh.removeSubscription(t)}removeAllSubscriptions(){this.ti.removeAllSubscriptions(),this.oh.removeAllSubscriptions()}closeMessage(){this.ll(this.qo)}zo(){return!0}od(){return this.zo()}_o(){return null!=this.htmlId&&this.htmlId.length>4}Mo(){return this._o()&&null!=this.css&&this.css.length>0}Oo(){if(this._o()&&this.Mo())return this.htmlId+"-css"}Wt(){return!this.Gt&&(this.Gt=!0,!0)}sm(){return this.Gt}$t(t){return!this.dd&&(this.dd=!0,this.ti.L(),!0)}Ot(){return!this.Th&&(this.Th=!0,this.oh.L(),!0)}hide(t){if(t&&t.parentNode){let e=t.closest(".ab-iam-root");if(null==e&&(e=t),this.zo()&&null!=e.parentNode){let t=e.parentNode.classList;t&&t.contains(tE)&&t.remove(tE),document.body.removeEventListener("touchmove",tO.rh)}e.className=e.className.replace(tO.lh,tO.uh)}return this.animateOut||!1}ll(t,e){let i,s;if(null==t)return;this.qo=null;let n=!1;(i=-1===t.className.indexOf("ab-in-app-message")?t.getElementsByClassName("ab-in-app-message")[0]:t)&&(n=this.hide(i));let r=document.body;null!=r&&(s=r.scrollTop);let o=()=>{if(t&&t.parentNode){let e=t.closest(".ab-iam-root");null==e&&(e=t),e.parentNode&&e.parentNode.removeChild(e)}let i=this.Oo();if(null!=i){let t=document.getElementById(i);t&&t.parentNode&&t.parentNode.removeChild(t)}null!=r&&"Safari"===Q.browser&&(r.scrollTop=s),e?e():this.Ot()};n?setTimeout(o,tO.hr):o(),this.$o&&this.$o.focus()}No(){return document.createTextNode(this.message||"")}Jo(t){t.setAttribute("alt",this.altImageText||"")}static rh(t){if(t.targetTouches&&t.targetTouches.length>1)return;let e=t.target;e&&e.classList&&e.classList.contains("ab-message-text")&&e.scrollHeight>e.clientHeight||document.querySelector(`.${tE}`)&&t.cancelable&&t.preventDefault()}ah(t){let e=t.parentNode;this.zo()&&null!=e&&this.orientation!==tO.Orientation.LANDSCAPE&&(null!=e.classList&&e.classList.add(tE),document.body.addEventListener("touchmove",tO.rh,!!function(){if(null==tk.lp){tk.lp=!1;try{let t=Object.defineProperty({},"passive",{get:()=>{tk.lp=!0}});window.addEventListener("testPassive",()=>{},t),window.removeEventListener("testPassive",()=>{},t)}catch(t){i.error(E(t))}}return tk.lp}()&&{passive:!1})),t.className+=" "+tO.lh}static Ah(t){if(27===t.keyCode&&!t9.re(t7.Oh)&&document.querySelectorAll(".ab-modal-interactions").length>0){let t=document.getElementsByClassName("ab-html-message"),e=!1;for(let i of t){let t=null;tR(i)&&i.contentWindow&&(t=i.contentWindow.document.getElementsByClassName("ab-programmatic-close-button")[0]),null!=t&&(tC(t),e=!0)}if(!e){let t=document.querySelectorAll(".ab-modal-interactions > .ab-close-button")[0];null!=t&&tC(t)}}}Lh(){this.nh||t9.re(t7.Oh)||(document.addEventListener("keydown",tO.Ah,!1),t9.mh(()=>{document.removeEventListener("keydown",tO.Ah)}),this.nh=!0)}gt(t){let e={};return t&&(e[tO.ss.pa]=this.message,e[tO.ss.ma]=this.messageAlignment,e[tO.ss._h]=this.slideFrom,e[tO.ss.xs]=this.extras,e[tO.ss.ua]=this.triggerId,e[tO.ss.ca]=this.clickAction,e[tO.ss.URI]=this.uri,e[tO.ss.fa]=this.openTarget,e[tO.ss.da]=this.dismissType,e[tO.ss.la]=this.duration,e[tO.ss.ga]=this.icon,e[tO.ss.ns]=this.imageUrl,e[tO.ss.ja]=this.imageStyle,e[tO.ss.xa]=this.iconColor,e[tO.ss.za]=this.iconBackgroun
2dColor,e[tO.ss.ha]=this.backgroundColor,e[tO.ss.va]=this.textColor,e[tO.ss.wa]=this.closeButtonColor,e[tO.ss.ya]=this.animateIn,e[tO.ss.Sa]=this.animateOut,e[tO.ss.ba]=this.header,e[tO.ss.ka]=this.headerAlignment,e[tO.ss.qa]=this.headerTextColor,e[tO.ss.Aa]=this.frameColor,e[tO.ss.Ba]=this.buttons,e[tO.ss.Ca]=this.cropType,e[tO.ss.Da]=this.orientation,e[tO.ss.Ea]=this.htmlId,e[tO.ss.CSS]=this.css,e[tO.ss.ts]=t,e[tO.ss.Fa]=this.messageExtras,e[tO.ss.LANGUAGE]=this.language,e[tO.ss.ks]=this.altImageText),e}}tO.th={hh:0xff333333,ih:0xffffffff,sh:0xff0073d5,Nh:0xffefefef,Rh:0xff555555,Eh:0xc0333333,eh:0xff9b9b9b},tO.Ao={Sh:"hd",Lo:"ias",Mh:"of",Dh:"do",Ch:"umt",dh:"tf",Uh:"te"},tO.SlideFrom={TOP:"TOP",BOTTOM:"BOTTOM"},tO.ClickAction={URI:"URI",NONE:"NONE"},tO.DismissType={AUTO_DISMISS:"AUTO_DISMISS",MANUAL:"SWIPE"},tO.OpenTarget={NONE:"NONE",BLANK:"BLANK"},tO.ImageStyle={TOP:"TOP",GRAPHIC:"GRAPHIC"},tO.Orientation={PORTRAIT:"PORTRAIT",LANDSCAPE:"LANDSCAPE"},tO.TextAlignment={START:"START",CENTER:"CENTER",END:"END"},tO.CropType={CENTER_CROP:"CENTER_CROP",FIT_CENTER:"FIT_CENTER"},tO.Eo={ia:"SLIDEUP",ta:"MODAL",Xo:"MODAL_STYLED",Yn:"FULL",Zo:"WEB_HTML",Bo:"HTML",Yo:"HTML_FULL"},tO.hr=500,tO.bh=200,tO.lh="ab-show",tO.uh="ab-hide",tO.ss={pa:"m",ma:"ma",_h:"sf",xs:"e",ua:"ti",ca:"ca",URI:"u",fa:"oa",da:"dt",la:"d",ga:"i",ns:"iu",ja:"is",xa:"ic",za:"ibc",ha:"bc",va:"tc",wa:"cbc",ya:"ai",Sa:"ao",ba:"h",ka:"ha",qa:"htc",Aa:"fc",Ba:"b",Ca:"ct",Da:"o",Ea:"hi",CSS:"css",ts:"type",ed:"messageFields",Fa:"me",LANGUAGE:"l",ks:"ia"};class tA extends tO{constructor(t,e,i,s,n,r,o,l,a,u,h,c){super(t,void 0,void 0,e,i,void 0,void 0,void 0,s=s||tO.DismissType.MANUAL,n,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,r,o,void 0,void 0,void 0,l,void 0,void 0,void 0,a,u,c,void 0,void 0),this.messageFields=h,this.messageFields=h}od(){return!1}$t(t){if(this.ko===tO.Eo.Zo){if(this.dd)return!1;this.dd=!0}return this.ti.L(t),!0}gt(){let t=super.gt(tA.es);return t[tO.ss.ed]=this.messageFields,t}static Zn(t){return new tA(t[tO.ss.pa],t[tO.ss.xs],t[tO.ss.ua],t[tO.ss.da],t[tO.ss.la],t[tO.ss.ya],t[tO.ss.Sa],t[tO.ss.Aa],t[tO.ss.Ea],t[tO.ss.CSS],t[tO.ss.ed],t[tO.ss.Fa])}}tA.es=tO.Eo.Zo;class tN{constructor(t,e,i,s,n,r,o){this.text=t,this.backgroundColor=e,this.textColor=i,this.borderColor=s,this.clickAction=n,this.uri=r,this.id=o,this.text=t||"",this.backgroundColor=e||tO.th.sh,this.textColor=i||tO.th.ih,this.borderColor=s||this.backgroundColor,this.clickAction=n||tO.ClickAction.NONE,this.uri=r,null==o&&(o=tN._n),this.id=o,this.dd=!1,this.ti=new ti}subscribeToClickedEvent(t){return this.ti.Rt(t)}removeSubscription(t){this.ti.removeSubscription(t)}removeAllSubscriptions(){this.ti.removeAllSubscriptions()}$t(){return!this.dd&&(this.dd=!0,this.ti.L(),!0)}static fromJson(t){return new tN(t.text,t.bg_color,t.text_color,t.border_color,t.click_action,t.uri,t.id)}}tN._n=-1;class tL extends tO{constructor(t,e,i,s,n,r,o,l,a,u,h,c,d,f,g,m,p,v,b,y,E,w,S,T,I,_,B,k,C,R,O){l=l||tO.DismissType.MANUAL,_=_||tO.Orientation.PORTRAIT,super(t,e,void 0,i,s,n,r,o,l,a,u,h,c,d,f,g,m,p,v,b,y,E,w,S,T,I=I||tO.CropType.CENTER_CROP,_,B,k,C,R,O),this.Io=tO.TextAlignment.CENTER}gt(){return super.gt(tL.es)}static Zn(t){return new tL(t[tO.ss.pa],t[tO.ss.ma],t[tO.ss.xs],t[tO.ss.ua],t[tO.ss.ca],t[tO.ss.URI],t[tO.ss.fa],t[tO.ss.da],t[tO.ss.la],t[tO.ss.ga],t[tO.ss.ns],t[tO.ss.ja],t[tO.ss.xa],t[tO.ss.za],t[tO.ss.ha],t[tO.ss.va],t[tO.ss.wa],t[tO.ss.ya],t[tO.ss.Sa],t[tO.ss.ba],t[tO.ss.ka],t[tO.ss.qa],t[tO.ss.Aa],tD(t[tO.ss.Ba]),t[tO.ss.Ca],t[tO.ss.Da],t[tO.ss.Ea],t[tO.ss.CSS],t[tO.ss.Fa],t[tO.ss.LANGUAGE],t[tO.ss.ks])}}tL.es=tO.Eo.Yn;class tx extends tO{constructor(t,e,i,s,n,r,o,l,a,u,h,c,d,f,g,m,p,v,b,y,E,w,S,T,I,_,B,k,C,R){super(t,e,void 0,i,s,n,r,o,l=l||tO.DismissType.MANUAL,a,u,h,c,d,f,g,m,p,v,b,y,E,w,S,T,I=I||tO.CropType.FIT_CENTER,void 0,_,B,k,C,R),this.Io=tO.TextAlignment.CENTER}gt(){return super.gt(tx.es)}static Zn(t){return new tx(t[tO.ss.pa],t[tO.ss.ma],t[tO.ss.xs],t[tO.ss.ua],t[tO.ss.ca],t[tO.ss.URI],t[tO.ss.fa],t[tO.ss.da],t[tO.ss.la],t[tO.ss.ga],t[tO.ss.ns],t[tO.ss.ja],t[tO.ss.xa],t[tO.ss.za],t[tO.ss.ha],t[tO.ss.va],t[tO.ss.wa],t[tO.ss.ya],t[tO.ss.Sa],t[tO.ss.ba],t[tO.ss.ka],t[tO.ss.qa],t[tO.ss.Aa],tD(t[tO.ss.Ba]),t[tO.ss.Ca],t[tO.ss.Ea],t[tO.ss.CSS],t[tO.ss.Fa],t[tO.ss.LANGUAGE],t[tO.ss.ks])}}tx.es=tO.Eo.ta;
2class tM extends tO{constructor(t,e,i,s,n,r,o,l,a,u,h,c,d,f,g,m,p,v,b,y,E,w,S,T){m=m||tO.th.Rh,g=g||tO.th.Nh,super(t,e=e||tO.TextAlignment.START,i,s,n,r,o,l,a,u,h,c,void 0,d,f,g,m,p,v,b,void 0,void 0,void 0,void 0,void 0,void 0,void 0,y,E,w,S,T),this.Io=tO.TextAlignment.START}zo(){return!1}No(){let t=document.createElement("span");return t.appendChild(document.createTextNode(this.message||"")),t}ah(t){let e=t.getElementsByClassName("ab-in-app-message")[0];tk.td(e,!0,!0)||(this.slideFrom===tO.SlideFrom.TOP?e.style.top="0px":e.style.bottom="0px"),super.ah(t)}gt(){return super.gt(tM.es)}static Zn(t){return new tM(t[tO.ss.pa],t[tO.ss.ma],t[tO.ss._h],t[tO.ss.xs],t[tO.ss.ua],t[tO.ss.ca],t[tO.ss.URI],t[tO.ss.fa],t[tO.ss.da],t[tO.ss.la],t[tO.ss.ga],t[tO.ss.ns],t[tO.ss.xa],t[tO.ss.za],t[tO.ss.ha],t[tO.ss.va],t[tO.ss.wa],t[tO.ss.ya],t[tO.ss.Sa],t[tO.ss.Ea],t[tO.ss.CSS],t[tO.ss.Fa],t[tO.ss.LANGUAGE],t[tO.ss.ks])}}function tU(t){let e;if(!t)return null;if(t.is_control)return tB.fromJson(t);let s=t.type;null!=s&&(s=s.toUpperCase());let n=t.message,r=t.text_align_message,o=t.slide_from,l=t.extras,a=t.trigger_id,u=t.click_action,h=t.uri,c=t.open_target,d=t.message_close,f=t.duration,g=t.icon,m=t.image_url,p=t.image_style,v=t.icon_color,b=t.icon_bg_color,y=t.bg_color,E=t.text_color,w=t.close_btn_color,S=t.header,T=t.text_align_header,I=t.header_text_color,_=t.frame_color,B=[],k=t.btns;null==k&&(k=[]);for(let t=0;t<k.length;t++)B.push(tN.fromJson(k[t]));let C=t.crop_type,R=t.orientation,O=t.animate_in,A=t.animate_out,N=t.html_id,L=t.css;null!=N&&""!==N&&null!=L&&""!==L||(N=void 0,L=void 0);let x=t.message_extras,M=t.language,U=t.image_alt;if(s===tx.es||s===tO.Eo.Xo)e=new tx(n,r,l,a,u,h,c,d,f,g,m,p,v,b,y,E,w,O,A,S,T,I,_,B,C,N,L,x,M,U);else if(s===tL.es)e=new tL(n,r,l,a,u,h,c,d,f,g,m,p,v,b,y,E,w,O,A,S,T,I,_,B,C,R,N,L,x,M,U);else if(s===tM.es)e=new tM(n,r,o,l,a,u,h,c,d,f,g,m,v,b,y,E,w,O,A,N,L,x,M,U);else{if(s!==tA.es&&s!==tO.Eo.Bo&&s!==tO.Eo.Yo)return void i.error("Ignoring message with unknown type "+s);(e=new tA(n,l,a,d,f,O,A,_,N,L,t.message_fields,x)).trusted=t.trusted||!1}return e.ko=s,e}function tD(t){let e=[];for(let i of t)e.push(new tN(i.text,i.backgroundColor,i.textColor,i.borderColor,i.clickAction,i.uri,i.id));return e}tM.es=tO.Eo.ia;class tz{constructor(t){this.tf=t,this.tf=t}sf(t){return null==this.tf||this.tf===t[0]}static fromJson(t){return new tz(t?t.event_name:null)}gt(){return this.tf}}class tP{constructor(t,e,i,s){this.yE=t,this.HE=e,this.comparator=i,this.LE=s,this.yE=t,this.HE=e,this.comparator=i,this.LE=s,this.HE===tP.XE.QE&&this.comparator!==tP.BE.wE&&this.comparator!==tP.BE.jE&&this.comparator!==tP.BE.zE&&this.comparator!==tP.BE.FE&&(this.LE=d(this.LE))}sf(t){let e=null;switch(null!=t&&(e=t[this.yE]),this.comparator){case tP.BE.kE:return null!=e&&e.valueOf()===this.LE.valueOf();case tP.BE.xE:return null==e||e.valueOf()!==this.LE.valueOf();case tP.BE.JE:return null!=e&&typeof e==typeof this.LE&&e>this.LE;case tP.BE.wE:return this.HE===tP.XE.QE?null!=e&&o(e)&&p(e)<=this.LE.valueOf():null!=e&&typeof e==typeof this.LE&&e>=this.LE;case tP.BE.VE:return null!=e&&typeof e==typeof this.LE&&e<this.LE;case tP.BE.jE:return this.HE===tP.XE.QE?null!=e&&o(e)&&p(e)>=this.LE.valueOf():null!=e&&typeof e==typeof this.LE&&e<=this.LE;case tP.BE.qE:return null!=e&&"string"==typeof e&&typeof e==typeof this.LE&&null!=e.match(this.LE);case tP.BE.PE:return null!=e;case tP.BE.WE:return null==e;case tP.BE.zE:return null!=e&&o(e)&&v(e)<this.LE;case tP.BE.FE:return null!=e&&o(e)&&v(e)>this.LE;case tP.BE.ZE:return null==e||typeof e!=typeof this.LE||"string"!=typeof e||null==e.match(this.LE)}return!1}static fromJson(t){return new tP(t.property_key,t.property_type,t.comparator,t.property_value)}gt(){let t=this.LE;return o(this.LE)&&(t=h(t.valueOf())),{k:this.yE,t:this.HE,c:this.comparator,v:t}}static _u(t){return new tP(t.k,t.t,t.c,t.v)}}tP.XE={$E:"boolean",tT:"number",sT:"string",QE:"date"},tP.BE={kE:1,xE:2,JE:3,wE:4,VE:5,jE:6,qE:10,PE:11,WE:12,zE:15,FE:16,ZE:17};class t${constructor(t){this.filters=t,this.filters=t}sf(t){let e=!0;for(let i=0;i<this.filters.length;i++){let s=this.filters[i],n=!1;for(let e=0;e<s.length;e++)if(s[e].sf(t)){n=!0;break}if(!n){e=!1;break}}return e}static fromJson(t){if(null==t||!r(t))return null;let e=[];for(let i=0;i<t.length;i++){let s=[],n=t[i];for(let t=0;t<n.length;t++)s.push(tP.fromJson(n[t]));e.push(s)}return new t$(e)}gt(){let t=[];for(let e=0;e<this.filters.length;e++){let i=this.filters[e],s=[];for(let t=0;t<i.length;t++)s.push(i[t].gt());t.push(s)}return t}static _u(t){let e=[];for(let i=0;i<t.length;i++){let s=[],n=t[i];for(let t=0;t<n.length;t++)s.push(tP._u(n[t]));e.push(s)}return new t$(e)}}class tj{constructor(t,e){this.tf=t,this.if=e,this.tf=t,this.if=e}sf(t){if(null==this.tf||null==this.if)return!1;let e=t[0],i=t[1];return e===this.tf&&this.if.sf(i)}static fromJson(t){return new tj(t?t.event_name:null,t?t$.fromJson(t.property_filters):null)}gt(){return{e:this.tf,pf:this.if?this.if.gt():null}}}class tF{constructor(t,e){this.rf=t,this.nf=e,this.rf=t,this.nf=e}sf(t){if(null==this.rf)return!1;let e=tK.ef(t[0],this.rf);if(!e)return!1;let i=null==this.nf||0===this.nf.length;if(null!=this.nf){for(let e=0;e<this.nf.length;e++)if(this.nf[e]===t[1]){i=!0;break}}return e&&i}static fromJson(t){return new tF(t?t.id:null,t?t.buttons:null)}gt(){return this.rf}}class tW{constructor(t){this.productId=t,this.productId=t}sf(t){return null==this.productId||t[0]===this.productId}static fromJson(t){return new tW(t?t.product_id:null)}gt(){return this.productId}}class tq{constructor(t,e){this.productId=t,this.if=e,this.productId=t,this.if=e}sf(t){if(null==this.productId||null==this.if)return!1;let e=t[0],i=t[1];return e===this.productId&&this.if.sf(i)}static fromJson(t){return new tq(t?t.product_id:null,t?t$.fromJson(t.property_filters):null)}gt(){return{id:this.productId,pf:this.if?this.if.gt():null}}}class tG{constructor(t){this.rf=t,this.rf=t}sf(t){return null==this.rf||tK.ef(t[0],this.rf)}static fromJson(t){return new tG(t?t.campaign_id:null)}gt(){return this.rf}}let tH={OPEN:"open",Rr:"purchase",wr:"push_click",xe:"custom_event",rm:"iam_click",qs:"test"};t.s(["default",0,tH],544687);class tK{constructor(t,e){this.type=t,this.data=e,this.type=t,this.data=e}km(t,e){return tK._m[this.type]===t&&(null==this.data||this.data.sf(e))}static ef(t,e){let s=null;try{s=window.atob(t)}catch(e){return i.info("Failed to unencode analytics id "+t+": "+E(e)),!1}return e===s.split("_")[0]}static fromJson(t){let e=t.type,i=null;switch(e){case tK.Ln.OPEN:case tK.Ln.qs:break;case tK.Ln.Rr:i=tW.fromJson(t.data);break;case tK.Ln.bm:i=tq.fromJson(t.data);break;case tK.Ln.wr:i=tG.fromJson(t.data);break;case tK.Ln.xe:i=tz.fromJson(t.data);break;case tK.Ln.Em:i=tj.fromJson(t.data);break;case tK.Ln.rm:i=tF.fromJson(t.data)}return new tK(e,i)}
2gt(){return{t:this.type,d:this.data?this.data.gt():null}}static _u(t){let e,i=null;switch(t.t){case tK.Ln.OPEN:case tK.Ln.qs:break;case tK.Ln.Rr:i=new tW(t.d);break;case tK.Ln.bm:i=new tq((e=t.d||{}).id,t$._u(e.pf||[]));break;case tK.Ln.wr:i=new tG(t.d);break;case tK.Ln.xe:i=new tz(t.d);break;case tK.Ln.Em:i=new tj((e=t.d||{}).e,t$._u(e.pf||[]));break;case tK.Ln.rm:i=new tF(t.d)}return new tK(t.t,i)}}tK.Ln={OPEN:"open",Rr:"purchase",bm:"purchase_property",wr:"push_click",xe:"custom_event",Em:"custom_event_property",rm:"iam_click",qs:"test"},tK._m={},tK._m[tK.Ln.OPEN]=tH.OPEN,tK._m[tK.Ln.Rr]=tH.Rr,tK._m[tK.Ln.bm]=tH.Rr,tK._m[tK.Ln.wr]=tH.wr,tK._m[tK.Ln.xe]=tH.xe,tK._m[tK.Ln.Em]=tH.xe,tK._m[tK.Ln.rm]=tH.rm,tK._m[tK.Ln.qs]=tH.qs;class tV{constructor(t,e=[],i,s,n=0,r,o,l=0,a=tV.Td,u,h,c){this.id=t,this.Pd=e,this.startTime=i,this.endTime=s,this.priority=n,this.type=r,this.data=o,this.Ed=l,this.Nd=a,this.Vn=u,this._d=h,this.Id=c,this.id=t,this.Pd=e||[],void 0===i&&(i=null),this.startTime=i,void 0===s&&(s=null),this.endTime=s,this.priority=n||0,this.type=r,this.Ed=l||0,null==u&&(u=1e3*(this.Ed+30)),this.Vn=u,this.data=o,null!=a&&(this.Nd=a),this._d=h,this.Id=c||null}xd(t){return null==this.Id||this.Nd!==tV.Td&&t-this.Id>=1e3*this.Nd}zd(t){this.Id=t}Md(t){return Math.max(t+1e3*this.Ed-new Date().valueOf(),0)}Bd(t){let e=new Date().valueOf()-t,s=null==t||isNaN(e)||null==this.Vn||e<this.Vn;return s||i.info(`Trigger action ${this.type} is no longer eligible for display - fired ${e}ms ago and has a timeout of ${this.Vn}ms.`),!s}static fromJson(t){let e=t.id,i=[];for(let e=0;e<t.trigger_condition.length;e++)i.push(tK.fromJson(t.trigger_condition[e]));let s=d(t.start_time),r=d(t.end_time),o=t.priority,l=t.type,a=t.delay,u=t.re_eligibility,h=t.timeout,c=t.data,f=t.min_seconds_since_last_trigger;return n(tV.Ln,l,"Could not construct Trigger from server data","Trigger.Types")?new tV(e,i,s,r,o,l,c,a,u,h,f):null}gt(){let t=[];for(let e=0;e<this.Pd.length;e++)t.push(this.Pd[e].gt());return{i:this.id,c:t,s:this.startTime,e:this.endTime,p:this.priority,t:this.type,da:this.data,d:this.Ed,r:this.Nd,tm:this.Vn,ss:this._d,ld:this.Id}}static _u(t){let e=[],i=t.c||[];for(let t=0;t<i.length;t++)e.push(tK._u(i[t]));return new tV(t.i,e,g(t.s),g(t.e),t.p,t.t,t.da,t.d,t.r,t.tm,t.ss,t.ld)}}tV.Ln={Kn:"inapp",Cd:"templated_iam"},tV.Td=-1;class tJ{constructor(t,e,i,s){this.j=t,this.C=e,this.B=i,this.vs=s,this.j=t,this.C=e,this.B=i,this.vs=s,this.jn=new ti,t9.q(this.jn),this.vn=1e3,this.yn=6e4,this.bn=null,this.In=null,this.Mn=null}An(){return this.jn}Tn(t){return this.jn.Rt(t)}kn(){return this.bn}Dn(t){this.bn=t}lt(t,e,s,n){let r,o=new tc;if(e===S.wn||t instanceof tB){if(!t.Wt())return i.info("This in-app message has already received an impression. Ignoring analytics event."),o}else if((e===S.zn||t instanceof tA&&e===S.Sn)&&!t.$t(n))return i.info("This in-app message has already received a click. Ignoring analytics event."),o;return null==(r=t instanceof tB?{trigger_ids:[t.triggerId]}:this.Bn(t))?o:(t.messageExtras&&(r.message_extras=t.messageExtras),null!=s&&(r.bid=s),td.lt(e,r))}Rn(t,e){let s=new tc;if(!t.$t())return i.info("This in-app message button has already received a click. Ignoring analytics event."),s;let n=this.Bn(e);return null==n?s:t.id===tN._n?(i.info("This in-app message button does not have a tracking id. Not logging event to Braze servers."),s):(null!=t.id&&(n.bid=t.id),td.lt(S.Sn,n))}qn(t){let e=t.messageFields;return null!=e&&e.is_push_primer||!1}xn(t){let e;if(!(t instanceof tO))return;let s=t=>{if(!t)return;let e=function(t){try{let e=t.match(U),s=e?e[0].length:null,n=s?t.substring(s):null;if(null==s||s>t.length-1||!n)return void i.error(`Did not find base64 encoded brazeAction in url to process : ${t}`);let r=I(n);return r?JSON.parse(r):void i.error(`Failed to decode base64 encoded brazeAction: ${n}`)}catch(e){return void i.error(`Failed to process brazeAction URL ${t} : ${E(e)}`)}}(t);if(function t(e){try{if(null==e)return!0;let i=e[B];return i===_.io?O(t,e[k]):!G(i)}catch(t){return!0}}(e))return R==R?"In-App Message contains an unknown braze action type and will not be displayed.":"";if(function t(e){if(!e||!q(e))return!1;let i=e[B];return i===_.io?O(t,e[k]):i===_.requestPushPermission}(e)){let t=ty.En();if(!t.Gn)return ty.Nn(t.reason,"In-App Message")}};if(this.qn(t)){let t=ty.En();if(!t.Gn)return ty.Nn(t.reason,"In-App Message")}for(let i of t.buttons||[])if(i.clickAction===tO.ClickAction.URI&&i.uri&&U.test(i.uri)&&(e=s(i.uri)))return e;return t.clickAction===tO.ClickAction.URI&&t.uri&&U.test(t.uri)?s(t.uri):void 0}$n(t,e){e!==this.Mn&&this.Cn(),this.In=t,this.Mn=e}Cn(){null!=this.In&&(clearTimeout(this.In),this.In=null,this.Mn=null)}Fn(t,e,s,n){let r=this.j;if(!r)return;this.Mn&&t.triggerId!==this.Mn&&(this.Cn(),tg.fi(this.B,tg.H.On));let o=r.Xn(!1),l=r.$(o);l.template={trigger_id:t.triggerId,trigger_event_type:e},null!=s&&(l.template.data=s.Hn());let a=r.A(l,tg.H.On);r.J(l,(r=-1)=>{let o=this.j;if(!o)return;let u=new Date().valueOf();tg.K(this.B,tg.H.On,u),-1!==r&&a.push(["X-Braze-Req-Tokens-Remaining",r.toString()]);let h,c,d=!1;tp.O({url:`${o.V()}/template/`,data:l,headers:a,W:e=>{if(!o.Y(l,e,a))return void("function"==typeof t.Jn&&t.Jn());if(o.Z(),null==e||null==e.templated_message)return;let s=e.templated_message;if(s.type!==tV.Ln.Kn)return;let n=tU(s.data);if(null==n)return;let r=this.xn(n);r?(i.error(r),"function"==typeof t.Jn&&t.Jn()):"function"==typeof t.Qn&&t.Qn(n)},error:e=>{d=!0,h=e,c=`getting user personalization for message ${t.triggerId}.`},tt:(i,r)=>{if(new Date().valueOf()-t.Un<t.Vn){let i=0;if(d){let e=Math.min(t.Vn,this.yn),s=this.vn;null==n&&(n=s),i=Math.min(e,tb(s,3*n))}o.et(r,()=>{this.Fn(t,e,s,i)},tg.H.On,e=>this.$n(e,t.triggerId),()=>this.Cn(),i)}d&&o._(h,c)}})},tg.H.On)}Bn(t){if(null==t.triggerId)return i.info("The in-app message has no analytics id. Not logging event to Braze servers."),null;let e={};return null!=t.triggerId&&(e.trigger_ids=[t.triggerId]),e}fn(t){return!!this.B&&!(!(t&&t instanceof tO&&t.constructor!==tO)||t instanceof tB)&&this.B.bt(tt.ft.Wn,t.gt())}sa(){let t;if(!this.B)return null;let e=this.B.dt(tt.ft.Wn);if(!e)return null;switch(e.type){case tO.Eo.Yn:t=tL.Zn(e);break;case tO.Eo.Zo:case tO.Eo.Bo:case tO.Eo.Yo:t=tA.Zn(e);break;case tO.Eo.ta:case tO.Eo.Xo:t=tx.Zn(e);break;case tO.Eo.ia:t=tM.Zn(e)}return t&&this.oa(),t}oa(){this.B&&this.B.zt(tt.ft.Wn)}}let tZ={na:null,i:!1,ra:()=>(tZ.t(),tZ.na||(tZ.na=new tJ(t9.m(),t9.u(),t9.p(),t9.ir())),tZ.na),t:()=>{tZ.i||(t9.g(tZ),tZ.i=!0)},destroy:()=>{tZ.na=null,tZ.i=!1}};class tX{constructor(t,e,i,s,n){this.triggerId=t,this.Qn=e,this.Jn=i,this.Un=s,this.Vn=n,this.triggerId=t,this.Qn=e,this.Jn=i,this.Un=s,this.Vn=n}
2static fromJson(t,e,i,s,n){return null==t||null==t.trigger_id?null:new tX(t.trigger_id,e,i,s,n)}}class tY extends tr{constructor(t,e,i,s,n){super(),this.tg=t,this.ws=e,this.B=i,this.Ru=s,this.ig=n,this.tg=t,this.ws=e,this.B=i,this.Ru=s,this.ig=n,this.sg=[],this.eg=[],this.hg=null,this.ng={},this.og={},this.triggers=[],this.lg=0,this.ag(),this.gg()}fg(){if(this.B){this.hg=this.B.dt(tt.ft.iE)||this.hg,this.ng=this.B.dt(tt.ft.EE)||this.ng,this.og=this.B.dt(tt.ft.aE)||this.og;for(let t=0;t<this.triggers.length;t++){let e=this.triggers[t];e.id&&null!=this.og[e.id]&&e.zd(this.og[e.id])}}}ag(){if(!this.B)return;this.lg=this.B.dt(tt.ft.nE)||0;let t=this.B.dt(tt.ft.oE)||[],e=[];for(let i=0;i<t.length;i++)e.push(tV._u(t[i]));this.triggers=e,this.fg()}gg(){let t=this,e=function(e,i,s,n,r){return function(){t.cg(e,i,s,n,r)}},i={};for(let t of this.triggers)t.id&&(i[t.id]=t);let s=!1;for(let t=0;t<this.triggers.length;t++){let n=this.triggers[t];if(n.id&&null!=this.ng[n.id]){let t=this.ng[n.id],o=[];for(let s=0;s<t.length;s++){let l=t[s],a=n.Md(l.Un||0);if(a>0){let t,s;o.push(l),null!=l.ug&&(t=l.ug),null!=l.dg&&b.gE(l.dg)&&(s=b._u(l.dg));let u=[];if(l.pg&&r(l.pg))for(let t=0;t<l.pg.length;t++){let e=i[l.pg[t]];null!=e&&u.push(e)}this.eg.push(window.setTimeout(e(n,l.Un||0,t,s,u),a))}}this.ng[n.id].length>o.length&&(this.ng[n.id]=o,s=!0,0===this.ng[n.id].length&&delete this.ng[n.id])}}s&&this.B&&this.B.bt(tt.ft.EE,this.ng)}mg(){if(!this.B)return;let t=[];for(let e=0;e<this.triggers.length;e++)t.push(this.triggers[e].gt());this.lg=new Date().valueOf(),this.B.bt(tt.ft.oE,t),this.B.bt(tt.ft.nE,this.lg)}bg(){this.B&&((this.B.dt(tt.ft.nE)||0)>this.lg?this.ag():this.fg())}N(t){let e=!1;if(null!=t&&t.triggers){let s;this.ig.oa(),this.fg();let n={},r={};this.triggers=[];for(let i=0;i<t.triggers.length;i++){let s=tV.fromJson(t.triggers[i]);if(s){s.id&&null!=this.og[s.id]&&(s.zd(this.og[s.id]),n[s.id]=this.og[s.id]),s.id&&null!=this.ng[s.id]&&(r[s.id]=this.ng[s.id]);for(let t=0;t<s.Pd.length;t++)if(s.Pd[t].km(tH.qs,null)){e=!0;break}this.triggers.push(s)}}u(this.og,n)||(this.og=n,this.B&&this.B.bt(tt.ft.aE,this.og)),u(this.ng,r)||(this.ng=r,this.B&&this.B.bt(tt.ft.EE,this.ng)),this.mg(),e&&(i.info("Trigger with test condition found, firing test."),this.he(tH.qs)),this.he(tH.OPEN);let o=this.sg;this.sg=[];for(let t=0;t<o.length;t++)s=Array.prototype.slice.call(o[t]),this.he(...s)}}cg(t,e,s,n,r){let o,l,a,u=n=>{this.fg();let r=new Date().valueOf();t.Bd(e)||(!1===navigator.onLine&&t.type===tV.Ln.Kn&&n.imageUrl?i.info(`Not showing ${t.type} trigger action ${t.id} due to offline state.`):t.xd(r)&&this.wg(t,r,s)?0===this.ws.De()?i.info(`Not displaying trigger ${t.id} because neither automaticallyShowInAppMessages() nor subscribeToInAppMessage() were called.`):(this.ws.L([n]),this.yg(t,r)):i.info(`Not displaying trigger ${t.id} because display time fell outside of the acceptable time window.`))},h=()=>{this.fg();let o=r.pop();if(null!=o)if(this.Tg(o,e,s,n,r),o.Bd(e)){let t=`Server aborted in-app message display, but the timeout on fallback trigger ${o.id} has already elapsed.`;r.length>0&&(t+=" Continuing to fall back."),i.info(t),h()}else{i.info(`Server aborted in-app message display. Falling back to lower priority ${o.type} trigger action ${t.id}.`);let l=1e3*o.Ed-(new Date().valueOf()-e);l>0?this.eg.push(window.setTimeout(()=>{this.cg(o,e,s,n,r)},l)):this.cg(o,e,s,n,r)}};switch(t.type){case tV.Ln.Kn:if(null==(o=tU(t.data))){i.error(`Could not parse trigger data for trigger ${t.id}, ignoring.`);break}if(l=this.ig.xn(o)){i.error(l),h();break}u(o);break;case tV.Ln.Cd:if(null==(a=tX.fromJson(t.data,u,h,e,t.Vn||0))){i.error(`Could not parse trigger data for trigger ${t.id}, ignoring.`);break}this.ig.Fn(a,s,n);break;default:i.error(`Trigger ${t.id} was of unexpected type ${t.type}, ignoring.`)}}he(t,e=null,s){if(!n(tH,t,"Cannot fire trigger action.","TriggerEvents"))return;if(this.Ru&&this.Ru.vd())return i.info("Trigger sync is currently in progress, awaiting sync completion before firing trigger event."),void this.sg.push(arguments);this.bg();let r=new Date().valueOf(),o=r-(this.hg||0),l=!0,a=!0,u=[];for(let i=0;i<this.triggers.length;i++){let s=this.triggers[i],n=r+1e3*s.Ed;if(s.xd(n)&&(null==s.startTime||s.startTime.valueOf()<=r)&&(null==s.endTime||s.endTime.valueOf()>=r)){let i=!1;for(let n=0;n<s.Pd.length;n++)if(s.Pd[n].km(t,e)){i=!0;break}i&&(l=!1,this.wg(s,n,t)&&(a=!1,u.push(s)))}}if(l)return void i.info(`Trigger event ${t} did not match any trigger conditions.`);if(a)return void i.info(`Ignoring ${t} trigger event because a trigger was displayed ${o/1e3}s ago.`);u.sort((t,e)=>t.priority-e.priority);let h=u.pop();null!=h&&(i.info(`Firing ${h.type} trigger action ${h.id} from trigger event ${t}.`),this.Tg(h,r,t,s,u),0===h.Ed?this.cg(h,r,t,s,u):this.eg.push(window.setTimeout(()=>{this.cg(h,r,t,s,u)},1e3*h.Ed)))}changeUser(t=!1){if(this.triggers=[],this.B&&this.B.zt(tt.ft.oE),!t){this.sg=[],this.hg=null,this.og={},this.ng={};for(let t=0;t<this.eg.length;t++)clearTimeout(this.eg[t]);this.eg=[],this.B&&(this.B.zt(tt.ft.iE),this.B.zt(tt.ft.aE),this.B.zt(tt.ft.EE))}}clearData(){this.triggers=[],this.hg=null,this.og={},this.ng={};for(let t=0;t<this.eg.length;t++)clearTimeout(this.eg[t]);this.eg=[]}wg(t,e,s){if(null==this.hg)return!0;
2if(s===tH.qs)return i.info("Ignoring minimum interval between trigger because it is a test type."),!0;let n=t._d;return null==n&&(n=this.tg),e-this.hg>=1e3*n}Tg(t,e,i,s,n){let r;this.fg(),t.id&&(this.ng[t.id]=this.ng[t.id]||[]);let o={};o.Un=e,o.ug=i,null!=s&&(r=s.gt()),o.dg=r;let l=[];for(let t of n)t.id&&l.push(t.id);o.pg=l,t.id&&this.ng[t.id].push(o),this.B&&this.B.bt(tt.ft.EE,this.ng)}yg(t,e){this.fg(),t.zd(e),this.hg=e,t.id&&(this.og[t.id]=e),this.B&&(this.B.bt(tt.ft.iE,e),this.B.bt(tt.ft.aE,this.og))}}let tQ={i:!1,provider:null,o:()=>(tQ.t(),tQ.provider||tQ.rg(),tQ.provider),rg:()=>{if(!tQ.provider){let t=t9.re(t7.Xh);tQ.provider=new tY(null!=t?t:30,tZ.ra().An(),t9.p(),t9.nn(),tZ.ra()),t9.v(tQ.provider)}},t:()=>{tQ.i||(tQ.rg(),t9.g(tQ),tQ.i=!0)},destroy:()=>{tQ.provider=null,tQ.i=!1}};function t0(){return"u">typeof SharedWorker}class t1{constructor(t){this.Wr=null,this.Lr=null,this.isConnected=!1,this.Ir=null,this.Mr=null,this.we=t.we,this.ke=t.ke,this.Re=t.Re,this.Me=t.Me}initialize(){if(!t0())return i.info("SharedWorker not supported, will use direct connection"),!1;try{let t=new Blob(['\n"use strict";\nconst workerSelf = self;\nlet eventSource = null;\nlet currentConfig = null;\nlet retryCount = 0;\nlet retryTimeoutId = null;\nlet connectionInProgress = false;\nconst maxRetries = 5;\nconst connectedPorts = new Map();\nlet lastSleepMs = null;\nlet currentRcs = null;\nlet ttlTimeoutId = null;\nlet leaderPortId = null;\nlet ddrTimeoutId = null;\nconst fn = {\n startConnection: null,\n handleMessage: null,\n};\nfunction broadcast(message) {\n connectedPorts.forEach((portInfo, portId) => {\n try {\n portInfo.port.postMessage(message);\n }\n catch (_a) {\n connectedPorts.delete(portId);\n }\n });\n}\nfunction randomInclusive(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}\nfunction electLeader() {\n if (leaderPortId && connectedPorts.has(leaderPortId)) {\n return;\n }\n const firstPortId = connectedPorts.keys().next().value;\n leaderPortId = firstPortId || null;\n if (leaderPortId) {\n console.log("[Braze Real-Time] Elected leader port:", leaderPortId);\n }\n}\nfunction promoteToLeader(portId) {\n if (connectedPorts.has(portId) && leaderPortId !== portId) {\n leaderPortId = portId;\n console.log("[Braze Real-Time] Promoted to leader (tab became active):", portId);\n }\n}\nfunction sendToLeader(message) {\n electLeader();\n if (!leaderPortId) {\n console.warn("[Braze Real-Time] No leader to send message to");\n return;\n }\n const leader = connectedPorts.get(leaderPortId);\n if (leader) {\n try {\n leader.port.postMessage(message);\n }\n catch (_a) {\n connectedPorts.delete(leaderPortId);\n leaderPortId = null;\n sendToLeader(message);\n }\n }\n}\nfunction closeConnection() {\n connectionInProgress = false;\n if (retryTimeoutId !== null) {\n clearTimeout(retryTimeoutId);\n retryTimeoutId = null;\n }\n if (ttlTimeoutId !== null) {\n clearTimeout(ttlTimeoutId);\n ttlTimeoutId = null;\n }\n if (ddrTimeoutId !== null) {\n clearTimeout(ddrTimeoutId);\n ddrTimeoutId = null;\n }\n if (eventSource) {\n eventSource.close();\n eventSource = null;\n broadcast({ type: "disconnected" });\n }\n}\nfunction retryWithBackoff() {\n if (!currentConfig) {\n return;\n }\n retryCount++;\n const { minSleepMs, maxSleepMs, scaleFactor } = currentConfig.backoff;\n let previousSleepMs = lastSleepMs;\n if (previousSleepMs == null || previousSleepMs < minSleepMs) {\n previousSleepMs = minSleepMs;\n }\n const backoffMs = Math.min(maxSleepMs, randomInclusive(minSleepMs, previousSleepMs * scaleFactor));\n lastSleepMs = backoffMs;\n console.log("[Braze Real-Time] Retrying in " + backoffMs + "ms (attempt " + retryCount + "/" + maxRetries + ")");\n retryTimeoutId = setTimeout(function () {\n retryTimeoutId = null;\n fn.startConnection();\n }, backoffMs);\n}\nfunction startConnection(oldEventSourceToClose) {\n if (!currentConfig) {\n return;\n }\n if (eventSource && !oldEventSourceToClose) {\n console.warn("[Braze Real-Time] Connection already exists");\n return;\n }\n if (connectionInProgress && !oldEventSourceToClose) {\n console.warn("[Braze Real-Time] Connection attempt already in progress");\n return;\n }\n connectionInProgress = true;\n const { dustHost, mite, auth } = currentConfig;\n const dustHostWithScheme = /^https?:\\/\\//i.test(dustHost) ? dustHost : "https://" + dustHost;\n let queryString = "mite=" + encodeURIComponent(mite) + "&attempts=" + retryCount;
2\n if (auth) {\n queryString += "&auth=" + encodeURIComponent(auth);\n }\n if (currentRcs) {\n queryString += "&rcs=" + encodeURIComponent(currentRcs);\n }\n const subscribeUrl = dustHostWithScheme + "/sse?" + queryString;\n try {\n const newEventSource = new EventSource(subscribeUrl);\n newEventSource.onopen = function () {\n if (oldEventSourceToClose) {\n console.log("[Braze Real-Time] Gapless reconnection: new connection established, closing old connection");\n oldEventSourceToClose.close();\n }\n else {\n console.log("[Braze Real-Time] Connection established");\n }\n eventSource = newEventSource;\n connectionInProgress = false;\n retryCount = 0;\n lastSleepMs = null;\n broadcast({ type: "connected" });\n };\n newEventSource.addEventListener("msg", function (event) {\n fn.handleMessage(event.data);\n });\n newEventSource.onerror = function () {\n const readyState = newEventSource ? newEventSource.readyState : -1;\n if (readyState === 0) {\n console.log("[Braze Real-Time] Failed to connect");\n }\n else {\n console.log("[Braze Real-Time] Connection lost");\n }\n if (oldEventSourceToClose && eventSource !== newEventSource) {\n console.log("[Braze Real-Time] Gapless reconnection failed, keeping old connection");\n newEventSource.close();\n connectionInProgress = false;\n if (retryCount < maxRetries) {\n retryWithBackoff();\n }\n return;\n }\n closeConnection();\n if (retryCount < maxRetries) {\n retryWithBackoff();\n }\n else {\n console.error("[Braze Real-Time] Max retries reached");\n broadcast({ type: "error", error: "Max retry attempts reached" });\n }\n };\n }\n catch (error) {\n connectionInProgress = false;\n console.error("[Braze Real-Time] Failed to create EventSource:", error);\n broadcast({ type: "error", error: String(error) });\n }\n}\nfunction handleTtlMessage(tMs, rcs) {\n if (typeof tMs !== "number") {\n return;\n }\n if (typeof rcs === "string") {\n currentRcs = rcs;\n }\n console.log("[Braze Real-Time] TTL set to " + tMs + "ms, will perform gapless reconnection when expired");\n if (ttlTimeoutId !== null) {\n clearTimeout(ttlTimeoutId);\n }\n ttlTimeoutId = setTimeout(function () {\n ttlTimeoutId = null;\n console.log("[Braze Real-Time] TTL expired, performing gapless reconnection");\n startConnection(eventSource || undefined);\n }, tMs);\n}\nfunction handleDdrMessage(rMs, reason) {\n if (typeof rMs !== "number") {\n return;\n }\n const jitter = Math.random() * rMs * 0.3;\n const waitMs = Math.round(rMs + jitter);\n const reasonStr = reason ? " (" + reason + ")" : "";\n console.log("[Braze Real-Time] Admin requested disconnect" + reasonStr + ", reconnecting in " + waitMs + "ms");\n if (ddrTimeoutId !== null) {\n clearTimeout(ddrTimeoutId);\n }\n closeConnection();\n ddrTimeoutId = setTimeout(function () {\n ddrTimeoutId = null;\n fn.startConnection();\n }, waitMs);\n}\nfunction handleMessage(data) {\n try {\n const message = JSON.parse(data);\n if (!message.type) {\n console.warn("[Braze Real-Time] Message without type:", message);\n return;\n }\n if (message.type === "ttl" && message.body) {\n handleTtlMessage(message.body.t_ms, message.body.rcs);\n return;\n }\n if (message.type === "ddr" && message.body) {\n handleDdrMessage(message.body.r_ms, message.body.e);\n return;\n }\n console.log("[Braze Real-Time] Routing \'" + message.type + "\' message to leader");\n sendToLeader({ type: "message", data: message });\n }\n catch (error) {\n console.warn("[Braze Real-Time] Failed to parse message:", error);\n }\n}\nfn.startConnection = startConnection;\nfn.handleMessage = handleMessage;\nfunction handlePortMessage(port, portId, message) {\n switch (message.type) {\n case "connect":\n if (currentConfig &&\n (currentConfig.mite !== message.config.mite || currentConfig.dustHost !== message.config.dustHost)) {\n console.log("[Braze Real-Time] Config changed, reconnecting");\n closeConnection();\n retryCount = 0;\n lastSleepMs = null;\n currentRcs = null;\n }\n currentConfig = message.config;\n electLeader();\n if (!eventSource && !connectionInProgress) {\n startConnection();\n }\n else if (eventSource) {\n port.postMessage({ type: "connected" });\n }\n break;\n case "disconnect":\n connectedPorts.delete(portId);\n if (portId === leaderPortId) {\n leaderPortId = null;\n electLeader();\n }\n if (connectedPorts.size === 0) {\n console.log("[Braze Real-Time] No more ports, closing connection");\n closeConnection();\n currentConfig = null;\n currentRcs = null;\n leaderPortId = null;\n }\n break;\n case "tab_active":\n promoteToLeader(portId);\n break;\n case "ping":\n port.postMessage({ type: "pong" });\n break;\n default:\n console.warn("[Braze Real-Time] Unknown message type:", message.type);\n }\n}\nworkerSelf.onconnect = function (event) {\n const port = event.ports[0];\n const portId = "port-" + Date.now() + "-" + Math.random().toString(36).substr(2, 9);\n connectedPorts.set(portId, { port: port });\n port.onmessage = function (messageEvent) {\n try {\n handlePortMessage(port, portId, messageEvent.data);\n }\n catch (error) {\n console.error("[Braze Real-Time] Error handling message:", error);\n }\n };\n port.onmessageerror = function () {\n console.warn("[Braze Real-Time] Message error from port:", portId);\n connectedPorts.delete(portId);\n };\n port.start();\n};\n'],{type:"application/javascript"});return this.Lr=URL.createObjectURL(t),this.Wr=new SharedWorker(this.Lr,{name:"braze-dust-worker"}),this.Wr.port.onmessage=t=>{this.Br(t.data)},this.Wr.port.onmessageerror=()=>{i.warn("Message error from real-time messaging worker")},this.Wr.onerror=t=>{var e;i.error(`Real-time messaging worker error: ${t.message||"unknown error"}`),null==(e=this.Me)||e.call(this,"SharedWorker error")},this.Wr.port.start(),this.Ur(),this.Vr(),i.info("Real-time messaging worker initialized"),!0}catch(t){return i.error(`Failed to create real-time messaging worker: ${t instanceof Error?t.message:String(t)}`),this.Er(),!1}}Br(t){var e,s,n;switch(t.type){case"connected":i.info("Real-time messaging connection established via SharedWorker"),this.isConnected=!0,null==(e=this.ke)||e.call(this);break;case"disconnected":i.info("Real-time messaging connection closed via SharedWorker"),this.isConnected=!1,null==(s=this.Re)||s.call(this);break;case"message":this.we(t.data);break;case"error":i.error(`Real-time messaging error: ${t.error}`),null==(n=this.Me)||n.call(this,t.error)}}Ur(){this.Ir=window.setInterval(()=>{this.Wr&&this._r({type:"ping"})},3e4)}qr(){null!==this.Ir&&(window.clearInterval(this.Ir),this.Ir=null)}Vr(){this.Mr=()=>{"visible"===document.visibilityState&&this.Wr&&this._r({type:"tab_active"})},document.addEventListener("visibilitychange",this.Mr)}Ar(){this.Mr&&(document.removeEventListener("visibilitychange",this.Mr),this.Mr=null)}_r(t){this.Wr&&this.Wr.port.postMessage(t)}connect(t){this.Wr?(this._r({type:"connect",pn:t}),i.info("Connecting to real-time messaging")):i.error("Cannot connect: real-time messaging worker not initialized")}disconnect(){this.Wr&&(this._r({type:"disconnect"}),this.isConnected=!1,i.info("Disconnecting from real-time messaging"))}Ie(){return this.isConnected}isInitialized(){return null!==this.Wr}Er(){this.qr(),this.Ar(),this.Wr&&(this.Wr.port.close(),this.Wr=null),this.Lr&&(URL.revokeObjectURL(this.Lr),this.Lr=null),this.isConnected=!1}destroy(){this.disconnect(),this.Er(),i.info("Real-time messaging worker destroyed")}}class t3 extends tr{constructor(t,e,i,s,n=!0){super(),this.j=t,this.B=e,this.h=i,this.j=t,this.B=e,this.h=i,this.mite=null,this.ki=null,this.yi=null,this.$i=null,this.Ri=s||null,this.Mi=null,this.xi=null,this.D=null,this.ji=0,this.Wi=5,this.Fi=null,this.Ui=null,this.zi=!0,this.Bi=null,this.Gi=null,this.Pi=null,this.qi=null,this.Hi=!1,this.Ji=new Map,this.Li=null,this.Oi=null,this.Ki=null,this.Qi=this.Vi(n),this.Xi=!1,this.Yi=0,this.Zi()}Vi(t){return t?t0()?"sharedworker":(i.info("SharedWorker not supported, using direct EventSource (multi-tab will gracefully degrade)"),"direct"):(i.info("Shared connection disabled, using direct EventSource"),"direct")}_i(){this.Ki=new t1({we:t=>{this.Se(t)},ke:()=>{this.ye()},Re:()=>{},Me:t=>{i.error(`Real-time messaging SharedWorker error: ${t}`)}}),this.Ki.initialize()||(i.info("SharedWorker initialization failed, falling back to direct EventSource"),this.Qi="direct",this.Ki=null)}ye(){this.ji=0,this.Bi=null,this.zi=!0,this.Xi=!1,this.Yi=0}Se(t){if(!t.type)return void i.warn(`Received real-time message without type: ${JSON.stringify(t)}`);let e="sharedworker"===this.Qi?"SharedWorker":"Direct";i.info(`Received real-time message of type '${t.type}' via ${e}`);let s=this.Ji.get(t.type);if(s&&s.De()>0)try{s.L(t)}catch(e){i.error(`Error invoking subscription for message type '${t.type}': ${e}`)}else i.info(`No subscribers for real-time message type '${t.type}'`)}We(){return"sharedworker"===this.Qi}Fe(){return this.Qi}Zi(){if(this.B){let t=this.B.dt(tt.ft.Ue),e=this.B.dt(tt.ft.Ne),s=this.B.dt(tt.ft.Te),n=this.B.dt(tt.ft.ze);t&&e?(this.mite=t,this.ki=e,this.yi=s,this.$i=n,i.info("Restored real-time messaging configuration from storage")):(t||e)&&(i.warn("Incomplete real-time messaging configuration in storage, clearing"),this.Ae())}}Hr(){this.Li||this.Oi||(this.Li=this.Be("ddr",t=>{if(!t.body||"number"!=typeof t.body.Ge)return;let e=Math.random()*t.body.Ge*.3,s=Math.round(t.body.Ge+e),n=t.body.e?` (${t.body.e})`:"";i.info(`Admin requested disconnect${n}, reconnecting in ${s}ms`),this.Pe(),setTimeout(()=>this.qe(),s)}),this.Oi=this.Be("ttl",t=>{if(!t.body||"number"!=typeof t.body.He)return;let e=t.body.He;i.info(`Time to live set to ${e}ms, will reconnect when expired`),"sharedworker"!==this.Qi&&("string"==typeof t.body.Je&&(this.Mi=t.body.Je),null!==this.Ui&&window.clearTimeout(this.Ui),this.Ui=window.setTimeout(()=>{this.Ui=null,i.info("Time to live expired, performing gapless reconnection"),this.Le()},e))}))}Oe(){this.Gi||this.Pi||(this.qi=()=>{this.Hi=!0,this.zi=!1},window.addEventListener("beforeunload",this.qi),this.Gi=()=>{var t;
2this.Hi=!0,(this.xi||(null==(t=this.Ki)?void 0:t.Ie()))&&(i.info("Page unloading, closing real-time connection gracefully"),this.zi=!1,this.Pe())},window.addEventListener("pagehide",this.Gi),this.Pi=t=>{var e;let s=this.xi||(null==(e=this.Ki)?void 0:e.Ie());t.persisted&&this.Ke()&&!s&&(i.info("Page restored from bfcache, reconnecting"),this.Hi=!1,this.ye(),this.qe())},window.addEventListener("pageshow",this.Pi))}St(){return this.D}wt(t){this.D=t}Be(t,e){if("function"!=typeof e)return null;let i=this.Ji.get(t);return i||(i=new ti,this.Ji.set(t,i),t9.q(i)),i.Rt(e)}Qe(t,e){let i=this.Ji.get(t);i&&i.removeSubscription(e)}Ke(){return!!(this.mite&&this.ki)}Ve(){return!!this.$i&&Math.floor(new Date().valueOf()/1e3)>=this.$i}Ae(){this.mite=null,this.ki=null,this.yi=null,this.$i=null,this.Mi=null,this.B&&(this.B.zt(tt.ft.Ue),this.B.zt(tt.ft.Ne),this.B.zt(tt.ft.Te),this.B.zt(tt.ft.ze))}Xe(t,e){let s=()=>{"function"==typeof e&&e()},n=this.j,r=this.B;if(!n||!r)return i.error("NetworkManager or StorageManager not available"),void s();if(!this.h||!this.h.Ye())return i.info("Real-time messaging is not enabled, skipping refresh"),void s();this.Ke()?i.info("Refreshing real-time messaging configuration"):i.info("Fetching initial real-time messaging configuration");let o=n.$({},!0),l=n.A(o,tg.H.Ze,!1),a=new Date().valueOf();tg.K(r,tg.H.Ze,a),tp.O({url:`${n.V()}/dust/config`,headers:l,data:o,W:e=>{n.Y(o,e,l)?(n.Z(),e.mite&&e.host?(this.mite=e.mite,this.ki=e.host,this.yi=e.auth||null,this.$i=e.expiration||null,i.info("Received real-time messaging configuration from server"),r.bt(tt.ft.Ue,e.mite),r.bt(tt.ft.Ne,e.host),e.auth?r.bt(tt.ft.Te,e.auth):r.zt(tt.ft.Te),e.expiration?r.bt(tt.ft.ze,e.expiration):r.zt(tt.ft.ze),this.qe(),"function"==typeof t&&t()):(i.info("Real-time messaging configuration not available - this SDK version may not be supported"),this.Ae(),s())):(i.error("Failed to validate server response for real-time messaging configuration"),s())},error:t=>{n._(t,"retrieving DUST config"),s()}})}qe(){if(!this.h||!this.h.Ye())return;if(!this.Ke())return void i.error("Cannot start real-time subscription without configuration");if(this.Ve())return i.info("Real-time messaging auth token has expired, refreshing configuration"),void this.Xe(()=>{this.qe()},()=>{i.error("Failed to refresh expired real-time messaging configuration")});let t=this.mite,e=this.Ri||this.ki;if(t&&e)switch(this.Qi){case"sharedworker":this._e(t,e);break;case"direct":this.xi&&(i.info("Real-time connection already exists, closing before starting new subscription"),this.Pe()),this.sn()}}en(){var t,e,i;let s,n,r=this.mite,o=this.Ri||this.ki;return r&&o?(t=this.ji,e=this.yi||void 0,i=this.Mi||void 0,s=/^https?:\/\//i.test(o)?o:`https://${o}`,n=`mite=${encodeURIComponent(r)}&attempts=${t}`,e&&(n+=`&auth=${encodeURIComponent(e)}`),i&&(n+=`&rcs=${encodeURIComponent(i)}`),`${s}/sse?${n}`):null}_e(t,e){var s,n,r;if(this.Ki||this._i(),!this.Ki)return i.info("SharedWorker initialization failed, falling back to direct EventSource"),this.Qi="direct",void this.on();this.Ri&&i.info(`Using custom real-time messaging host: ${this.Ri}`),i.info("Starting real-time subscription via SharedWorker");let o=(null==(s=this.h)?void 0:s.st())||1e4,l=(null==(n=this.h)?void 0:n.nt())||3e5,a=(null==(r=this.h)?void 0:r.it())||3;this.Ki.connect({mite:t,ki:e,auth:this.yi||void 0,hn:{an:o,ln:l,cn:a}})}on(){this.xi&&(i.info("Real-time connection already exists, closing before starting new subscription"),this.un()),this.sn()}sn(t){let e=this.en();if(e){this.Ri&&i.info(`Using custom real-time messaging host: ${this.Ri}`);try{let s=new EventSource(e);s.onopen=()=>{t?(i.info("Gapless reconnection: new connection established, closing old connection"),t.close()):i.info("Real-time messaging connection established"),this.xi=s,this.ji=0,this.Bi=null,this.zi=!0,this.Xi=!0},s.addEventListener("msg",t=>{this.dn(t.data)}),s.onerror=()=>{let e=s.readyState;return this.Hi||(0===e?i.info("Real-time messaging failed to connect"):i.info("Real-time messaging connection lost")),t&&this.xi!==s?(i.info("Gapless reconnection failed, keeping old connection"),s.close(),void(this.zi&&this.ji<this.Wi&&this.gn())):(this.un(),this.Xi&&(this.Yi++,this.Yi>1)?(i.info("Real-time messaging connection lost twice after successful connect (likely multi-tab conflict), yielding to other tab"),void(this.zi=!1)):void(this.zi&&this.ji<this.Wi?this.gn():(this.ji>=this.Wi&&i.error(`Max retry attempts (${this.Wi}) reached for real-time messaging, giving up for current session`),this.zi=!1)))}}catch(t){i.error(`Failed to create real-time messaging connection: ${t instanceof Error?t.message:String(t)}`)}}}gn(){var t,e,s;this.ji++;let n=(null==(t=this.h)?void 0:t.st())||1e4,r=(null==(e=this.h)?void 0:e.it())||3,o=(null==(s=this.h)?void 0:s.nt())||3e5,l=this.Bi;(null==l||l<n)&&(l=n);let a=Math.min(o,tb(n,l*r));this.Bi=a,i.info(`Retrying real-time messaging connection in ${a}ms (attempt ${this.ji}/${this.Wi})`),this.Fi=window.setTimeout(()=>{this.Fi=null,this.qe()},a)}Le(){if(this.Ke()){if(this.Ve())return i.info("Auth token expired during gapless reconnection, falling back to regular reconnection"),this.Pe(),void this.qe();null!==this.Ui&&(window.clearTimeout(this.Ui),this.Ui=null),this.sn(this.xi||void 0)}else i.error("Cannot perform gapless reconnection without configuration")}Pe(){var t;switch(this.Qi){case"sharedworker":null==(t=this.Ki)||t.disconnect();break;case"direct":this.un()}}un(){null!==this.Fi&&(window.clearTimeout(this.Fi),this.Fi=null),null!==this.Ui&&(window.clearTimeout(this.Ui),this.Ui=null),this.xi&&(this.xi.
2close(),this.xi=null,i.info("Real-time messaging connection closed"))}dn(t){try{let e=JSON.parse(t);this.Se(e)}catch(t){i.warn(`Failed to parse real-time message: ${t instanceof Error?t.message:String(t)}`)}}changeUser(t=!1){this.Pe(),t||(this.Ke()&&i.info("Clearing cached real-time messaging configuration for user change"),this.Ae()),this.ye()}clearData(t=!1){this.zi=!1,this.Pe(),t&&(this.Ke()&&i.info("Clearing cached real-time messaging configuration (wipeData)"),this.Ae()),this.ye()}destroy(){this.zi=!1,this.Pe(),this.Ae(),this.Ki&&(this.Ki.destroy(),this.Ki=null),this.Li&&(this.Qe("ddr",this.Li),this.Li=null),this.Oi&&(this.Qe("ttl",this.Oi),this.Oi=null),this.qi&&(window.removeEventListener("beforeunload",this.qi),this.qi=null),this.Gi&&(window.removeEventListener("pagehide",this.Gi),this.Gi=null),this.Pi&&(window.removeEventListener("pageshow",this.Pi),this.Pi=null),this.D&&(t9.removeSubscription(this.D),this.D=null)}}let t5={i:!1,provider:null,o:()=>{if(t5.t(),!t5.provider){let t=t9.re("dustHost");t5.provider=new t3(t9.m(),t9.p(),t9.l(),t),t9.v(t5.provider),t5.provider.Hr()}return t5.provider},t:()=>{t5.i||(t9.g(t5),t5.i=!0)},destroy:()=>{t5.provider&&t5.provider.destroy(),t5.provider=null,t5.i=!1}};class t2{constructor(t,e,i,s,n){this.endpoint=t,this.Wu=e,this.publicKey=i,this.Yc=s,this.xc=n,this.endpoint=t||null,this.Wu=e||null,this.publicKey=i||null,this.Yc=s||null,this.xc=n||null}gt(){return{e:this.endpoint,c:this.Wu,p:this.publicKey,u:this.Yc,v:this.xc}}static _u(t){return new t2(t.e,g(t.c),t.p,t.u,t.v)}}t.s(["default",0,t2],627202);class t4{constructor(t,e){this.h=t,this.B=e,this.h=t,this.B=e}getUserId(){let t=this.B.$u(tt.Ou.Cu);if(null==t)return null;let e=t.Tu,i=T(e);if(i>H.mr){for(;i>H.mr;)i=T(e=e.slice(0,e.length-1));t.Tu=e,this.B.Iu(tt.Ou.Cu,t)}return e}Ju(t){let e=null==this.getUserId();this.B.Iu(tt.Ou.Cu,new w(t)),e&&this.B.Lu(t)}setCustomUserAttribute(t,e){if(this.h.qu(t))return i.info('Custom Attribute "'+t+'" is blocklisted, ignoring.'),!1;let s={};return s[t]=e,this.zu(H.Bu,s,!0)}zu(t,e,s=!1,n=!1){let r=this.B.Eu(this.getUserId(),t,e),o="",l=t,a=e;return s&&(o=" custom","object"==typeof e&&(l=Object.keys(e)[0],"object"==typeof(a=e[l])&&(a=JSON.stringify(a,null,2)))),!n&&r&&i.info(`Logged${o} attribute ${l} with value ${a}`),r}gu(t,e,s,n,r){this.zu("push_token",t,!1,!0),this.zu("custom_push_public_key",s,!1,!0),this.zu("custom_push_user_auth",n,!1,!0),this.zu("custom_push_vapid_public_key",r,!1,!0);let o=ts.Us.Rs,l=new ts(o,i),a=new t2(t,e,s,n,r);this.B.bt(tt.ft.Uu,a.gt()),l.setItem(o.Fs.Fu,o.fe,!0)}wu(t){if(this.zu("push_token",null,!1,!0),this.zu("custom_push_public_key",null,!1,!0),this.zu("custom_push_user_auth",null,!1,!0),this.zu("custom_push_vapid_public_key",null,!1,!0),t){let t=ts.Us.Rs,e=new ts(t,i);this.B.bt(tt.ft.Uu,!1),e.setItem(t.Fs.Fu,t.fe,!1)}}}function t6(t){null==t&&(t="");let e=t.split("?").slice(1).join("?"),i={};if(null!=e){let t=e.split("&");for(let e=0;e<t.length;e++){let s=t[e].split("=");""!==s[0]&&(i[s[0]]=s[1])}}return i}t.s(["isURIJavascriptOrData",0,function(t){return!(!t||0!==(t=t.toString().toLowerCase()).lastIndexOf("javascript:",0)&&0!==t.lastIndexOf("data:",0))},"parseQueryStringKeyValues",0,t6],844381);let t8={Ph:"allowCrawlerActivity",Wh:"baseUrl",Vh:"noCookies",Kh:"devicePropertyAllowlist",La:"disablePushTokenMaintenance",$h:"enableLogging",Yh:"enableSdkAuthentication",Ka:"manageServiceWorkerExternally",Xh:"minimumIntervalBetweenTriggerActionsInSeconds",Zh:"sessionTimeoutInSeconds",Qh:"appVersion",Xa:"appVersionNumber",Ga:"serviceWorkerLocation",Ia:"safariWebsitePushId",Wa:"localization",er:"contentSecurityNonce",te:"allowUserSuppliedJavascript",$a:"inAppMessageZIndex",Ja:"openInAppMessagesInNewTab",Oh:"requireExplicitInAppMessageDismissal",Za:"doNotLoadFontAwesome",tl:"deviceId",Ha:"serviceWorkerScope",Ne:"dustHost",il:"sdkFlavor",tn:"openCardsInNewTab"},t7={Ph:"allowCrawlerActivity",Wh:"baseUrl",Vh:"noCookies",Kh:"devicePropertyAllowlist",La:"disablePushTokenMaintenance",$h:"enableLogging",Yh:"enableSdkAuthentication",Ka:"manageServiceWorkerExternally",Xh:"minimumIntervalBetweenTriggerActionsInSeconds",Zh:"sessionTimeoutInSeconds",Qh:"appVersion",Xa:"appVersionNumber",Ga:"serviceWorkerLocation",Ia:"safariWebsitePushId",Wa:"localization",er:"contentSecurityNonce",te:"allowUserSuppliedJavascript",$a:"inAppMessageZIndex",Ja:"openInAppMessagesInNewTab",tn:"openCardsInNewTab",Oh:"requireExplicitInAppMessageDismissal",Za:"doNotLoadFontAwesome",tl:"deviceId",Ha:"serviceWorker
2Scope",Ne:"dustHost",il:"sdkFlavor"},t9=new class{constructor(){this.tu="",this.sl="",this.rl=void 0,this.hl=null,this.eu=null,this.j=null,this.Ru=null,this.h=null,this.C=null,this.B=null,this.vs=null,this.al="",this.isInitialized=!1,this.ul=!1,this.cl=new ti,this.fl=new ti,this.options={},this.ml=[],this.dl=[],this.jn=[],this.sl="6.5.0"}El(t){this.cl.Rt(t)}mh(t){this.fl.Rt(t)}initialize(e,o){if(this.ao())return i.info("Braze has already been initialized with an API key."),!0;this.options=o||{};let l=this.re(t7.$h),u=t6(window.location.href);if(u&&"true"===u.brazeLogging&&(l=!0),i.init(l),i.info(`Initialization Options: ${JSON.stringify(this.options,null,2)}`),null==e||""===e||"string"!=typeof e)return i.error("Braze requires a valid API key to be initialized."),!1;this.tu=e;let h=this.re(t7.Wh);if(null==h||""===h||"string"!=typeof h)return i.error("Braze requires a valid baseUrl to be initialized."),!1;!1===/^https?:/.test(h)&&(h=`https://${h}`);let c=h;if((h=document.createElement("a")).href=c,"/"===h.pathname&&(h=`${h}api/v3`),this.al=h.toString(),Q.Il&&!this.re(t7.Ph))return i.info("Ignoring activity from crawler bot "+navigator.userAgent),this.ul=!0,!1;let d=this.re(t7.Vh)||!1;if(this.B=t_._l(e,d),d&&this.B.Sl(e),new te.le(null,!0).jr(tt.pe))return i.info("Ignoring all activity due to previous opt out"),this.ul=!0,!1;for(let t of a(this.options))-1===s(t8).indexOf(t)&&i.warn(`Ignoring unknown initialization option '${t}'.`);if(null!=this.re(t7.il)){let t=this.re(t7.il);-1!==["mparticle","wordpress","tealium"].indexOf(t)?this.rl=t:i.error("Invalid sdk flavor passed: "+t)}let f=this.re(t8.Kh);if(null!=f)if(r(f)){let t=[];for(let e=0;e<f.length;e++)n(tl,f[e],"devicePropertyAllowlist contained an invalid value.","DeviceProperties")&&t.push(f[e]);f=t}else i.error("devicePropertyAllowlist must be an array. Defaulting to all properties."),f=null;let g=this.re(t7.tl);if(g){let t=new w(g);this.B.Iu(tt.Ou.tl,t)}this.eu=new ta(this.B,f),this.h=new tT(this.B),this.vs=new t4(this.h,this.B),this.C=new tI(this.B,this.vs,this.h,this.re(t7.Zh));let m=new ti;return this.hl=new tn(this.B,this.re(t7.Yh),m),this.q(m),this.j=new tv(this.eu,this.B,this.hl,this.vs,this.C,this.h,this.tu,this.al,this.sl,this.rl||"",this.re(t7.Qh),this.re(t7.Xa)),this.Ru=new tw(this.tu,this.al,this.C,this.eu,this.vs,this.h,this.B,t=>{if(this.ao())for(let e of this.gr())e.N(t)},this.hl,this.j),this.Ru.initialize(),d||this.B.Al(),i.info(`Initialized for the Braze backend at "${this.re(t7.Wh)}" with API key "${this.tu}".`),tQ.t(),function(){let t=t9.l(),e=t9.nn();if(!t||!e)return;let i=t5.o(),s=()=>
2{if(!i.St()){i.Oe();let s=e.rn(()=>{t.Ye()&&i.Xe()});return s&&i.wt(s),i.Ke()&&i.qe(),s}return i.St()};t.Tr(()=>{t9.ao()&&(t.Ye()?(i.Xe(),s()):(i.Pe(),i.Ke()&&i.Ae()))}),t.Ye()&&s()}(),this.h.jo(()=>{var e;this.isInitialized&&(null==(e=this.h)?void 0:e.Yr())&&t.A(719886).then(t=>{this.isInitialized&&(0,t.default)()})}),this.Ru.rn(()=>{var e;this.isInitialized&&(null==(e=this.h)?void 0:e.Yr())&&t.A(719886).then(t=>{this.isInitialized&&(0,t.default)(void 0,void 0,!0)})}),this.cl.L(this.options),this.isInitialized=!0,window.dispatchEvent(new CustomEvent("braze.initialized")),!0}destroy(t){if(i.destroy(),this.ao()){for(let t of(this.fl.L(),this.fl.removeAllSubscriptions(),this.ml))t.destroy();for(let t of(this.ml=[],this.dl))t.clearData(!1);this.j&&this.j.fo(),this.dl=[],this.removeAllSubscriptions(),this.jn=[],null!=this.Ru&&this.Ru.destroy(),this.Ru=null,this.hl=null,this.eu=null,this.j=null,this.h=null,this.C=null,this.vs=null,this.options={},this.rl=void 0,this.isInitialized=!1,this.ul=!1,t&&(this.B=null)}}rr(){return!this.Nl()&&(!!this.ao()||(console.warn(A.ee),!1))}_a(){return this.tu}Sr(){return this.hl}V(){return this.al}ue(){return this.eu}m(){return this.j}re(t){return this.options[t]}gr(){return this.dl}nn(){return this.Ru}l(){return this.h}u(){return this.C}p(){return this.B}br(){if(this.vs&&this.Ru)return new H(this.vs,this.Ru)}ir(){return this.vs}nr(){return!0===this.re(t7.te)}g(t){let e=!1;for(let i of this.ml)i===t&&(e=!0);e||this.ml.push(t)}v(t){let e=!1;for(let i of this.dl)i.constructor===t.constructor&&(e=!0);t instanceof tr&&!e&&this.dl.push(t)}q(t){t instanceof ti&&this.jn.push(t)}removeAllSubscriptions(){if(this.rr())for(let t of this.jn)t.removeAllSubscriptions()}removeSubscription(t){if(this.rr())for(let e of this.jn)e.removeSubscription(t)}ge(t){this.ul=t}ao(){return this.isInitialized}Nl(){return this.ul}tr(t,e){return this.rr()?t5.o().Be(t,e):null}Vs(){return this.sl}}}]); 3 4//# debugId=89007670-aed6-f24d-b259-2ee24ae0ccfe 5//# sourceMappingURL=1ar8wri_q-qfi.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.