1import{t as e}from"./preload-helper-B6JZccWF.js";var t={Fn:function(e){let t=(e+`=`.repeat((4-e.length%4)%4)).replace(/\-/g,`+`).replace(/_/g,`/`),n=atob(t),r=new Uint8Array(n.length);for(let e=0;e<n.length;++e)r[e]=n.charCodeAt(e);return r}},n={CustomEvent:`ce`,Pr:`p`,Mu:`pc`,cc:`ca`,Ka:`i`,qs:`ie`,P:`cci`,T:`ccic`,$:`ccc`,H:`ccd`,Wl:`ss`,xl:`se`,Vi:`si`,Li:`sc`,Qi:`sbc`,Ki:`sfe`,eo:`iec`,Lu:`lr`,Tu:`uae`,R:`ci`,B:`cc`,Ru:`lcaa`,Pu:`lcar`,Xn:`inc`,Jn:`add`,Qn:`rem`,Hn:`set`,Kn:`ncam`,Nu:`sgu`,Fr:`ffi`},r={Br:`feed_displayed`,dc:`content_cards_displayed`},i={Y:function(){let e=(e=!1)=>{let t=(Math.random().toString(16)+`000000000`).substr(2,8);return e?`-`+t.substr(0,4)+`-`+t.substr(4,4):t};return e()+e(!0)+e(!0)+e()}},a=class{constructor(e,t){this.database=e,this.j=t,this.parent=typeof window>`u`?self:window,this.database=e,this.j=t}td(){if(`indexedDB`in this.parent)return this.parent.indexedDB}isSupported(){try{if(this.td()==null)return!1;{let e=this.td()?.open(`Braze IndexedDB Support Test`);if(e&&(e.onupgradeneeded=()=>e.result.close(),e.onsuccess=()=>e.result.close()),typeof window<`u`){let e=window,t=e.chrome||e.browser||e.ed;if(t&&t.runtime&&t.runtime.id)return this.j.info(`Not using IndexedDB for storage because we are running inside an extension`),!1}return!0}}catch(e){return this.j.info(`Not using IndexedDB for storage due to following error: `+e),!1}}nd(e,t){let n=this.td()?.open(this.database.od,this.database.VERSION);if(n==null)return typeof t==`function`&&t(),!1;let r=this;return n.onupgradeneeded=e=>{r.j.info(`Upgrading indexedDB `+r.database.od+` to v`+r.database.VERSION+`...`);let t=e.target?.result;for(let e in r.database.Jt){let n=e;r.database.Jt.hasOwnProperty(e)&&!t.objectStoreNames.contains(r.database.Jt[n])&&t.createObjectStore(r.database.Jt[n])}},n.onsuccess=n=>{let i=n.target?.result;i.onversionchange=()=>{i.close(),typeof t==`function`&&t(),r.j.error(`Needed to close the database unexpectedly because of an upgrade in another tab`)},e(i)},n.onerror=e=>{let n=e;return r.j.info(`Could not open indexedDB `+r.database.od+` v`+r.database.VERSION+`: `+n.target?.errorCode),typeof t==`function`&&t(),!0},!0}setItem(e,t,n,r,i){if(!this.isSupported())return typeof i==`function`&&i(),!1;let a=this;return this.nd(o=>{if(!o.objectStoreNames.contains(e))return a.j.error(`Could not store object `+t+` in `+e+` on indexedDB `+a.database.od+` - `+e+` is not a valid objectStore`),typeof i==`function`&&i(),void o.close();let s=o.transaction([e],`readwrite`);s.oncomplete=()=>o.close();let c=s.objectStore(e).put(n,t);c.onerror=()=>{a.j.error(`Could not store object `+t+` in `+e+` on indexedDB `+a.database.od),typeof i==`function`&&i()},c.onsuccess=()=>{typeof r==`function`&&r()}},i)}getItem(e,t,n){if(!this.isSupported())return!1;let r=this;return this.nd(i=>{if(!i.objectStoreNames.contains(e))return r.j.error(`Could not retrieve object `+t+` in `+e+` on indexedDB `+r.database.od+` - `+e+` is not a valid objectStore`),void i.close();let a=i.transaction([e],`readonly`);a.oncomplete=()=>i.close();let o=a.objectStore(e).get(t);o.onerror=()=>{r.j.error(`Could not retrieve object `+t+` in `+e+` on indexedDB `+r.database.od)},o.onsuccess=e=>{let t=e.target?.result;t!=null&&n(t)}})}hr(e,t,n){if(!this.isSupported())return typeof n==`function`&&n(),!1;let r=this;return this.nd(i=>{if(!i.objectStoreNames.contains(e))return r.j.error(`Could not retrieve last record from `+e+` on indexedDB `+r.database.od+` - `+e+` is not a valid objectStore`),typeof n==`function`&&n(),void i.close();let a=i.transaction([e],`readonly`);a.oncomplete=()=>i.close();let o=a.objectStore(e).openCursor(null,`prev`);o.onerror=()=>{r.j.error(`Could not open cursor for `+e+` on indexedDB `+r.database.od),typeof n==`function`&&n()},o.onsuccess=e=>{let r=e.target?.result;r!=null&&r.value!=null&&r.key!=null?t(r.key,r.value):typeof n==`function`&&n()}},n)}oe(e,t){if(!this.isSupported())return!1;let n=this;return this.nd(r=>{if(!r.objectStoreNames.contains(e))return n.j.error(`Could not delete record `+t+` from `+e+` on indexedDB `+n.database.od+` - `+e+` is not a valid objectStore`),void r.close();let i=r.transaction([e],`readwrite`);i.oncomplete=()=>r.close(),i.objectStore(e).delete(t).onerror=()=>{n.j.error(`Could not delete record `+t+` from `+e+` on indexedDB `+n.database.od)}})}Mt(e,t){if(!this.isSupported())return!1;let n=this;return this.nd(r=>{if(!r.objectStoreNames.contains(e))return n.j.error(`Could not retrieve objects from `+e+` on indexedDB `+n.database.od+` - `+e+` is not a valid objectStore`),void r.close();let i=r.transaction([e],`readwrite`);i.oncomplete=()=>r.close();let a=i.objectStore(e),o=a.openCursor(),s=[];o.onerror=()=>{s.length>0?(n.j.info(`Cursor closed midway through for `+e+` on indexedDB `+n.database.od),t(s)):n.j.error(`Could not open cursor for `+e+` on indexedDB `+n.database.od)},o.onsuccess=e=>{let n=e.target?.result;n==null?s.length>0&&t(s):(n.value!=null&&n.key!=null&&(a.delete(n.key).onsuccess=()=>{s.push(n.value)}),typeof n.continue==`function`&&n.continue())}})}clearData(){if(!this.isSupported())return!1;let e=[];for(let t in this.database.Jt){let n=t;this.database.Jt.hasOwnProperty(t)&&this.database.Jt[n]!==this.database.Jt.se&&e.push(this.database.Jt[n])}let t=this;return this.nd(function(n){let r=n.transaction(e,`readwrite`);r.oncomplete=()=>n.close();for(let n=0;n<e.length;n++){let i=e[n];r.objectStore(i).clear().onerror=function(){t.j.error(`Could not clear `+this.source.name+` on indexedDB `+t.database.od)}}r.onerror=function(){t.j.error(`Could not clear object stores on indexedDB `+t.database.od)}})}};a.ep={Ft:{od:`AppboyServiceWorkerAsyncStorage`,VERSION:6,Jt:{Na:`data`,kr:`pushClicks`,cu:`pushSubscribed`,dd:`fallbackDevice`,qt:`cardUpdates`,se:`optOut`,wr:`pendingData`,qh:`sdkAuthenticationSignature`},ie:1}};var o={init:function(e){e===void 0&&o.zg!==void 0||(o.zg=!!e),o.t||=!0},destroy:function(){o.t=!1,o.zg=void 0,o.j=void 0},setLogger:function(e){typeof e==`function`?(o.init(),o.j=e):o.info(`Ignoring set
1Logger call since logger is not a function`)},toggleLogging:function(){o.init(),o.zg?(console.log(`Disabling Braze logging`),o.zg=!1):(console.log(`Enabled Braze logging`),o.zg=!0)},info:function(e){if(o.zg){let t=`Braze: `+e;o.j==null?console.log(t):o.j(t)}},warn:function(e){if(o.zg){let t=`Braze SDK Warning: `+e+` (v4.10.2)`;o.j==null?console.warn(t):o.j(t)}},error:function(e){if(o.zg){let t=`Braze SDK Error: `+e+` (v4.10.2)`;o.j==null?console.error(t):o.j(t)}}},s={On:t,q:n,Cr:r,Z:i,xt:a,zt:a.ep,j:o,Yo:{ho:`allowCrawlerActivity`,Eo:`baseUrl`,_o:`noCookies`,Io:`devicePropertyAllowlist`,Aa:`disablePushTokenMaintenance`,Ao:`enableLogging`,So:`enableSdkAuthentication`,qa:`manageServiceWorkerExternally`,No:`minimumIntervalBetweenTriggerActionsInSeconds`,wo:`sessionTimeoutInSeconds`,Oo:`appVersion`,Po:`appVersionNumber`,_a:`serviceWorkerLocation`,ka:`safariWebsitePushId`,Ba:`localization`,po:`contentSecurityNonce`,Ro:`enableHtmlInAppMessages`,Co:`allowUserSuppliedJavascript`,lo:`inAppMessageZIndex`,fo:`openInAppMessagesInNewTab`,en:`openNewsFeedCardsInNewTab`,mh:`requireExplicitInAppMessageDismissal`,Lo:`doNotLoadFontAwesome`,Mo:`sdkFlavor`,tn:`openCardsInNewTab`}};function c(e){let t=[],n;for(let r in e)n=r,Object.prototype.hasOwnProperty.call(e,n)&&e[n]!==void 0&&t.push(e[n]);return t}function l(e,t,n,r){let i=c(e);return i.indexOf(t)!==-1||(s.j.error(`${n} Valid values from ${r} are "${i.join(`"/"`)}".`),!1)}function u(e){return Array.isArray?Array.isArray(e):Object.prototype.toString.call(e)===`[object Array]`}function d(e){return Object.prototype.toString.call(e)===`[object Date]`}function f(e){return Object.prototype.toString.call(e)===`[object Object]`}function p(e,...t){e??=[];let n=[],r=arguments.length;for(let t=0,i=e.length;t<i;t++){let i=e[t];if(n.indexOf(i)!==-1)continue;let a=1;for(a=1;a<r&&arguments[a].indexOf(i)!==-1;a++);a===r&&n.push(i)}return n}function m(e){let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}function h(e,t){if(e===t)return e!==0||1/e==1/t;if(e==null||t==null)return e===t;let n=e.toString();if(n!==t.toString())return!1;switch(n){case`[object RegExp]`:case`[object String]`:return``+e==``+t;case`[object Number]`:return+e==+e?+e==0?1/e==1/t:+e==+t:+t!=+t;case`[object Date]`:case`[object Boolean]`:return+e==+t}let r=n===`[object Array]`;if(!r){if(typeof e!=`object`||typeof t!=`object`)return!1;let n=e.constructor,r=t.constructor;if(n!==r&&!(typeof n==`function`&&n instanceof n&&typeof r==`function`&&r instanceof r)&&`constructor`in e&&`constructor`in t)return!1}let i=[],a=[],o=i.length;for(;o--;)if(i[o]===e)return a[o]===t;if(i.push(e),a.push(t),r){if(o=e.length,o!==t.length)return!1;for(;o--;)if(!h(e[o],t[o]))return!1}else{let n=m(e),r;if(o=n.length,m(t).length!==o)return!1;for(;o--;)if(r=n[o],!Object.prototype.hasOwnProperty.call(t,r)||!h(e[r],t[r]))return!1}return i.pop(),a.pop(),!0}function g(e,t=!1){let n=e/1e3;return t&&(n=Math.floor(n)),n}function _(e){return 1e3*e}function v(e){if(e==null)return null;let t=parseInt(e.toString());return isNaN(t)?null:new Date(1e3*t)}function y(e){return e!=null&&d(e)?e.toISOString().replace(/\.[0-9]{3}Z$/,``):e}function b(e){return e==null||e===``?null:new Date(e)}function ee(e){return e==null||e===``?new Date().valueOf():e}function x(e){return(new Date().valueOf()-e.valueOf())/1e3}function S(e){return(e.valueOf()-new Date().valueOf())/1e3}var C=`must be a Card object`,w=`logCustomEvent`,T=`setCustomUserAttribute`,E=`Braze must be initialized before calling methods.`,te=72e5,D=class{constructor(){this.Ve={}}lt(e){if(typeof e!=`function`)return null;let t=s.Z.Y();return this.Ve[t]=e,t}removeSubscription(e){delete this.Ve[e]}removeAllSubscriptions(){this.Ve={}}tc(){return Object.keys(this.Ve).length}Et(e){let t=[];for(let n in this.Ve){let r=this.Ve[n];t.push(r(e))}return t}},O=class e{constructor(e,t,n,r,i){this.userId=e,this.type=t,this.time=n,this.sessionId=r,this.data=i,this.userId=e,this.type=t,this.time=ee(n),this.sessionId=r,this.data=i}Kr(){let e={name:this.type,time:g(this.time),data:this.data||{},session_id:this.sessionId,user_id:void 0};return this.userId!=null&&(e.user_id=this.userId),e}
1ss(){return{u:this.userId,t:this.type,ts:this.time,s:this.sessionId,d:this.data}}static fromJson(t){return new e(t.user_id,t.name,t.time,t.session_id,t.data)}static TE(e){return e!=null&&f(e)&&e.t!=null&&e.t!==``}static Yn(t){return new e(t.u,t.t,t.ts,t.s,t.d)}},k=class e{constructor(e,t,n){this.iu=e,e??=s.Z.Y(),!n||isNaN(n)?this.vl=new Date().valueOf():this.vl=n,this.iu=e,this.Nl=new Date().valueOf(),this.Gl=t}ss(){return{g:this.iu,e:this.Gl,c:this.vl,l:this.Nl}}static Yn(t){if(t==null||t.g==null)return null;let n=new e(t.g,t.e,t.c);return n.Nl=t.l,n}};function A(e){let t=e.length;for(let n=e.length-1;n>=0;n--){let r=e.charCodeAt(n);r>127&&r<=2047?t++:r>2047&&r<=65535&&(t+=2),r>=56320&&r<=57343&&n--}return t}function j(e){try{e=e.replace(/-/g,`+`).replace(/_/g,`/`);let t=window.atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);let r=new Uint16Array(n.buffer);return String.fromCharCode(...r)}catch(e){return s.j.error(`Unable to decode Base64: `+e),null}}var M=e=>e instanceof Error?e.message:String(e),N={types:{ue:`container`,logCustomEvent:`logCustomEvent`,setEmailNotificationSubscriptionType:`setEmailNotificationSubscriptionType`,setPushNotificationSubscriptionType:`setPushNotificationSubscriptionType`,setCustomUserAttribute:`setCustomUserAttribute`,requestPushPermission:`requestPushPermission`,addToSubscriptionGroup:`addToSubscriptionGroup`,removeFromSubscriptionGroup:`removeFromSubscriptionGroup`,addToCustomAttributeArray:`addToCustomAttributeArray`,removeFromCustomAttributeArray:`removeFromCustomAttributeArray`,pe:`openLink`,je:`openLinkInWebView`},properties:{type:`type`,me:`steps`,le:`args`}},ne={_r:`unknownBrazeAction`,Or:`noPushPrompt`},re=(e,t)=>{switch(e){case ne._r:return`${t} contains an unknown braze action type and will not be displayed.`;case ne.Or:return`${t} contains a push prompt braze action, but is not eligible for a push prompt. Ignoring.`;default:return``}};function ie(e){try{let t=e.match(fe),n=t?t[0].length:null,r=n?e.substring(n):null;if(n==null||n>e.length-1||!r)return void s.j.error(`Did not find base64 encoded brazeAction in url to process : ${e}`);let i=j(r);return i?JSON.parse(i):void s.j.error(`Failed to decode base64 encoded brazeAction: ${r}`)}catch(t){s.j.error(`Failed to process brazeAction URL ${e} : ${M(t)}`);return}}function ae(e,t){let n=!1;if(t){for(let r of t)if(n||=e(r),n)return!0}return!1}function oe(e){let t=N.properties.type,n=N.properties.me;try{if(e==null)return!0;let r=e[t];return r===N.types.ue?ae(oe,e[n]):!xe(r)}catch{return!0}}function se(e){if(!e||!be(e))return!1;let t=N.properties.type,n=N.properties.me,r=e[t];return r===N.types.ue?ae(se,e[n]):r===N.types.requestPushPermission}var ce=/^[^\x00-\x1F\x22]+$/,le=/[$.]/,ue=[`$add`,`$update`,`$remove`,`$identifier_key`,`$identifier_value`,`$new_object`,`$time`],de=new RegExp(/^.+@.+\..+$/),fe=/^brazeActions:\/\/v\d+\//;function P(e,t,n){let r=e!=null&&typeof e==`string`&&(e===``||e.match(ce)!=null);return r||s.j.error(`Cannot ${t} because ${n} "${e}" is invalid.`),r}function pe(e){return e!=null&&e.match(le)&&ue.indexOf(e)===-1&&s.j.warn(`Custom attribute keys cannot contain '$' or '.'`),P(e,`set custom user attribute`,`the given key`)}function me(e){let t=typeof e;return e==null||t===`number`||t===`boolean`||d(e)||t===`string`}function he(e,t,n){let r=n!==-1;if(r&&n>50)return s.j.error(`Nested attributes cannot be more than 50 levels deep.`),!1;let i=r?n+1:-1;if(u(e)&&u(t)){for(let n=0;n<e.length&&n<t.length;n++)if(d(e[n])&&(t[n]=y(e[n])),!he(e[n],t[n],i))return!1}else{if(!f(e))return me(e);for(let n of m(e)){let a=e[n];if(r&&!pe(n)||(d(a)&&(t[n]=y(a)),!he(a,t[n],i)))return!1}}return!0}function ge(e,t,n,r,i){let a;return a=f(e)||u(e)?he(e,t,i?1:-1):me(e),a||s.j.error(`Cannot ${n} because ${r} "${e}" is invalid.`),a}function F(e,t,n,r=!1){let i=typeof e==`string`||e===null&&r;return i||s.j.error(`Cannot ${t} because ${n} "${e}" is invalid.`),i}function _e(e,t,n,r,i){if(e??={},typeof e!=`object`||u(e))return s.j.error(`${t} requires that ${n} be an object. Ignoring ${i}.`),[!1,null];let a,o;t===`setCustomUserAttribute`?(a=76800,o=`75KB`):(a=51200,o=`50KB`);let c=JSON.stringify(e);if(A(c)>a)return s.j.error(`Could not ${r} because ${n} was greater than the max size of ${o}.`),[!1,null];let l;try{l=JSON.parse(c)}catch{return s.j.error(`Could not ${r} because ${n} did not contain valid JSON.`),[!1,null]}for(let n in e){if(t===`setCustomUserAttribute`&&!pe(n)||!P(n,r,`the ${i} property name`))return[!1,null];let a=e[n];if(t!==`setCustomUserAttribute`&&a==null){delete e[n],delete l[n];continue}if(d(a)&&(l[n]=y(a)),!ge(a,l[n],r,`the ${i} property "${n}"`,t===`setCustomUserAttribute`))return[!1,null]}return[!0,l]}function ve(e,t){let n=!1,r=!1,i=()=>{s.j.error(`Custom attribute arrays must be either string arrays or object arrays.`)};for(let a of t)if(typeof a==`string`){if(r)return i(),[!1,!1];
1if(!P(a,`set custom user attribute "${e}"`,`the element in the given array`))return[!1,!1];n=!0}else{if(!f(a)||n)return i(),[!1,!1];if(!_e(a,`setCustomUserAttribute`,`attribute value`,`set custom user attribute "${e}"`,`custom user attribute`))return[!1,!1];r=!0}return[n,r]}function ye(e){return typeof e==`string`&&e.toLowerCase().match(de)!=null}function be(e){if(!(N.properties.type in e))return!1;switch(e[N.properties.type]){case N.types.ue:if(N.properties.me in e)return!0;break;case N.types.logCustomEvent:case N.types.setEmailNotificationSubscriptionType:case N.types.setPushNotificationSubscriptionType:case N.types.setCustomUserAttribute:case N.types.addToSubscriptionGroup:case N.types.removeFromSubscriptionGroup:case N.types.addToCustomAttributeArray:case N.types.removeFromCustomAttributeArray:case N.types.pe:case N.types.je:if(N.properties.le in e)return!0;break;case N.types.requestPushPermission:return!0;default:return!1}return!1}function xe(e){let t=!1;return Object.keys(N.types).forEach(n=>{N.types[n]!==e.toString()||(t=!0)}),t}var I=class e{constructor(e,t){this.ft=e,this.ki=t,this.ft=e,this.ki=t}getUserId(e){let t=this.ft.getUserId();if(typeof e!=`function`)return t;s.j.warn("The callback for getUserId is deprecated. You can access its return value directly instead (e.g. `const id = braze.getUser().getUserId()`)"),e(t)}addAlias(e,t){return!F(e,`add alias`,`the alias`,!1)||e.length<=0?(s.j.error(`addAlias requires a non-empty alias`),!1):!F(t,`add alias`,`the label`,!1)||t.length<=0?(s.j.error(`addAlias requires a non-empty label`),!1):this.ki.$n(e,t).O}setFirstName(e){return!!F(e,`set first name`,`the firstName`,!0)&&this.ft.nu(`first_name`,e)}setLastName(e){return!!F(e,`set last name`,`the lastName`,!0)&&this.ft.nu(`last_name`,e)}setEmail(e){return e===null||ye(e)?this.ft.nu(`email`,e):(s.j.error(`Cannot set email address - "${e}" did not pass RFC-5322 validation.`),!1)}setGender(t){return typeof t==`string`&&(t=t.toLowerCase()),!(t!==null&&!l(e.Genders,t,`Gender "${t}" is not a valid gender.`,`User.Genders`))&&this.ft.nu(`gender`,t)}setDateOfBirth(e,t,n){return e===null&&t===null&&n===null?this.ft.nu(`dob`,null):(e=e==null?null:parseInt(e.toString()),t=t==null?null:parseInt(t.toString()),n=n==null?null:parseInt(n.toString()),e==null||t==null||n==null||isNaN(e)||isNaN(t)||isNaN(n)||t>12||t<1||n>31||n<1?(s.j.error(`Cannot set date of birth - parameters should comprise a valid date e.g. setDateOfBirth(1776, 7, 4);`),!1):this.ft.nu(`dob`,`${e}-${t}-${n}`))}setCountry(e){return!!F(e,`set country`,`the country`,!0)&&this.ft.nu(`country`,e)}setHomeCity(e){return!!F(e,`set home city`,`the homeCity`,!0)&&this.ft.nu(`home_city`,e)}setLanguage(e){return!!F(e,`set language`,`the language`,!0)&&this.ft.nu(`language`,e)}setEmailNotificationSubscriptionType(t){return!!l(e.NotificationSubscriptionTypes,t,`Email notification setting "${t}" is not a valid subscription type.`,`User.NotificationSubscriptionTypes`)&&this.ft.nu(`email_subscribe`,t)}setPushNotificationSubscriptionType(t){return!!l(e.NotificationSubscriptionTypes,t,`Push notification setting "${t}" is not a valid subscription type.`,`User.NotificationSubscriptionTypes`)&&this.ft.nu(`push_subscribe`,t)}setPhoneNumber(t){return!!F(t,`set phone number`,`the phoneNumber`,!0)&&(t===null||t.match(e.Ln)?this.ft.nu(`phone`,t):(s.j.error(`Cannot set phone number - "${t}" did not pass validation.`),!1))}setLastKnownLocation(e,t,n,r,i){return e==null||t==null?(s.j.error(`Cannot set last-known location - latitude and longitude are required.`),!1):(e=parseFloat(e.toString()),t=parseFloat(t.toString()),n!=null&&(n=parseFloat(n.toString())),r!=null&&(r=parseFloat(r.toString())),i!=null&&(i=parseFloat(i.toString())),isNaN(e)||isNaN(t)||n!=null&&isNaN(n)||r!=null&&isNaN(r)||i!=null&&isNaN(i)?(s.j.error(`Cannot set last-known location - all supplied parameters must be numeric.`),!1):e>90||e<-90||t>180||t<-180?(s.j.error(`Cannot set last-known location - latitude and longitude are bounded by ±90 and ±180 respectively.`),!1):n!=null&&n<0||i!=null&&i<0?(s.j.error(`Cannot set last-known location - accuracy and altitudeAccuracy may not be negative.`),!1):this.ki.setLastKnownLocation(this.ft.getUserId(),e,t,r,n,i).O)}setCustomUserAttribute(e,t,n){if(!pe(e))return!1;let r=t=>{let[n]=_e(t,T,`attribute value`,`set custom user attribute "${e}"`,`custom user attribute`);return n};if(u(t)){let[n,i]=ve(e,t);if(!n&&!i&&t.length!==0)return!1;if(n||t.length===0)return this.ki.Gn(s.q.Hn,e,t).O;for(let e of t)if(!r(e))return!1}else if(f(t)){if(!r(t))return!1;if(n)return this.ki.Gn(s.q.Kn,e,t).O}else if(!(t!==void 0&&me(t))||(d(t)&&(t=y(t)),typeof t==`string`&&!P(t,`set custom user attribute "${e}"`,`the element in the given array`)))return!1;return this.ft.setCustomUserAttribute(e,t)}addToCustomAttributeArray(e,t){return!!P(e,`add to custom user attribute array`,`the given key`)&&!(t!=null&&!P(t,`add to custom user attribute array`,`the given value`))&&this.ki.Gn(s.q.Jn,e,t).O}removeFromCustomAttributeArray(e,t){return!!P(e,`remove from custom user attribute array`,`the given key`)&&!(t!=null&&!P(t,`remove from custom user attribute array`,`the given value`))&&this.ki.Gn(s.q.Qn,e,t).O}incrementCustomUserAttribute(e,t){if(!P(e,`increment custom user attribute`,`the given key`))return!1;t??=1;let n=parseInt(t.toString());return isNaN(n)||n!==parseFloat(t.toString())?(s.j.error(`Cannot increment custom user attribute because the given incrementValue "${t}" is not an integer.`),!1):this.ki.Gn(s.q.Xn,e,n).O}setCustomLocationAttribute(e,t,n){return!!P(e,`set custom location attribute`,`the given key`)&&((t!==null||n!==null)&&(t=t==null?null:parseFloat(t.toString()),n=n==null?null:parseFloat(n.toString()),t==null&&n!=null||t!=null&&n==null||t!=null&&(isNaN(t)||t>90||t<-90)||n!=null&&(isNaN(n)||n>
1180||n<-180))?(s.j.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.ki.Zn(e,t,n).O)}addToSubscriptionGroup(t){return!F(t,`add user to subscription group`,`subscription group ID`,!1)||t.length<=0?(s.j.error(`addToSubscriptionGroup requires a non-empty subscription group ID`),!1):this.ki.au(t,e.du.SUBSCRIBED).O}removeFromSubscriptionGroup(t){return!F(t,`remove user from subscription group`,`subscription group ID`,!1)||t.length<=0?(s.j.error(`removeFromSubscriptionGroup requires a non-empty subscription group ID`),!1):this.ki.au(t,e.du.UNSUBSCRIBED).O}_n(e,t,n,r,i){this.ft._n(e,t,n,r,i),this.ki.pu()}Nn(e){this.ft.Nn(e)}};I.Genders={MALE:`m`,FEMALE:`f`,OTHER:`o`,UNKNOWN:`u`,NOT_APPLICABLE:`n`,PREFER_NOT_TO_SAY:`p`},I.NotificationSubscriptionTypes={OPTED_IN:`opted_in`,SUBSCRIBED:`subscribed`,UNSUBSCRIBED:`unsubscribed`},I.Ln=/^[0-9 .\\(\\)\\+\\-]+$/,I.du={SUBSCRIBED:`subscribed`,UNSUBSCRIBED:`unsubscribed`},I.bu=`user_id`,I.lu=`custom`,I.lr=997;var Se=class{constructor(){}tf(){}ef(){}Ta(e){}static rf(e,t){if(e&&t){if(e=e.toLowerCase(),u(t.if)){for(let n=0;n<t.if.length;n++)if(e.indexOf(t.if[n].toLowerCase())!==-1)return t.identity}else if(e.indexOf(t.if.toLowerCase())!==-1)return t.identity}}},L={pE:`Chrome`,xE:`Edge`,oc:`Internet Explorer`,FE:`Opera`,Bg:`Safari`,ME:`Firefox`},R={xg:`Android`,de:`iOS`,kg:`Mac`,Pg:`Windows`},Ce=class e extends Se{constructor(){if(super(),this.userAgentData=navigator.userAgentData,this.browser=null,this.version=null,this.userAgentData){let e=this.ic();this.browser=e.browser||`Unknown Browser`,this.version=e.version||`Unknown Version`}this.OS=null}tf(){return this.browser}ef(){return this.version}Ta(t){if(this.OS)return Promise.resolve(this.OS);let n=n=>{for(let r=0;r<t.length;r++){let i=e.rf(n,t[r]);if(i)return this.OS=i,this.OS}return n};return this.userAgentData.platform?Promise.resolve(n(this.userAgentData.platform)):this.getHighEntropyValues().then(e=>e.platform?n(e.platform):navigator.platform).catch(()=>navigator.platform)}ic(){let e={},t=this.userAgentData.brands;if(t&&t.length)for(let n of t){let t=this.nc(L),r=n.brand.match(t);if(r&&r.length>0){e.browser=r[0],e.version=n.version;break}}return e}nc(e){let t=[];for(let n in e){let r=n;e[r]!==L.oc&&t.push(e[r])}return RegExp(`(`+t.join(`|`)+`)`,`i`)}getHighEntropyValues(){return this.userAgentData.getHighEntropyValues?this.userAgentData.getHighEntropyValues([`platform`]):Promise.reject()}},we=class e extends Se{constructor(){super(),this.rd=e.ic(navigator.userAgent||``)}tf(){return this.rd[0]||`Unknown Browser`}ef(){return this.rd[1]||`Unknown Version`}Ta(t){for(let n=0;n<t.length;n++){let r=t[n].string,i=e.rf(r,t[n]);if(i)return i===R.kg&&navigator.maxTouchPoints>1&&(i=R.de),Promise.resolve(i)}return Promise.resolve(navigator.platform)}static ic(e){let t,n=e.match(/(samsungbrowser|tizen|roku|konqueror|icab|crios|opera|ucbrowser|chrome|safari|firefox|camino|msie|trident(?=\/))\/?\s*(\.?\d+(\.\d+)*)/i)||[];if(n[1]&&/trident/i.test(n[1]))return t=/\brv[ :]+(\.?\d+(\.\d+)*)/g.exec(e)||[],[L.oc,t[1]||``];if(e.indexOf(`(Web0S; Linux/SmartTV)`)!==-1)return[`LG Smart TV`,null];if(e.indexOf(`CrKey`)!==-1)return[`Chromecast`,null];if(e.indexOf(`BRAVIA`)!==-1||e.indexOf(`SonyCEBrowser`)!==-1||e.indexOf(`SonyDTV`)!==-1)return[`Sony Smart TV`,null];if(e.indexOf(`PhilipsTV`)!==-1)return[`Philips Smart TV`,null];if(e.match(/\b(Roku)\b/))return[`Roku`,null];if(e.match(/\bAFTM\b/))return[`Amazon Fire Stick`,null];if(n[1]===L.pE&&(t=e.match(/\b(OPR|Edge|EdgA|Edg|UCBrowser)\/(\.?\d+(\.\d+)*)/),t!=null))return t=t.slice(1),t[0]=t[0].replace(`OPR`,L.FE),t[0]=t[0].replace(`EdgA`,L.xE),t[0]===`Edg`&&(t[0]=L.xE),[t[0],t[1]];if(n[1]===L.Bg&&(t=e.match(/\b(EdgiOS)\/(\.?\d+(\.\d+)*)/),t!=null))return t=t.slice(1),t[0]=t[0].replace(`EdgiOS`,L.xE),[t[0],t[1]];if(n=n[2]?[n[1],n[2]]:[null,null],n[0]===L.Bg&&(t=e.match(/version\/(\.?\d+(\.\d+)*)/i))!=null&&n.splice(1,1,t[1]),(t=e.match(/\b(UCBrowser)\/(\.?\d+(\.\d+)*)/))!=null&&n.splice(1,1,t[2]),n[0]===L.FE&&(t=e.match(/mini\/(\.?\d+(\.\d+)*)/i))!=null)return[`Opera Mini`,t[1]||``];if(n[0]){let e=n[0].toLowerCase();e===`msie`&&(n[0]=L.oc),e===`crios`&&(n[0]=L.pE),e===`tizen`&&(n[0]=`Samsung Smart TV`,n[1]=null),e===`samsungbrowser`&&(n[0]=`Samsung Browser`)}return n}},Te=class e{constructor(){let t=navigator.userAgentData?Ce:we;this.Sg=new t,this.userAgent=navigator.userAgent,this.browser=this.Sg.tf(),this.version=this.Sg.ef(),this.OS=null,this.Ta().then(e=>this.OS=e);let n=navigator;this.language=(n.userLanguage||n.language||n.browserLanguage||n.systemLanguage||``).toLowerCase(),this.qo=e.vg(this.userAgent)}OE(){return this.browser===L.Bg}Ca(){return this.OS||null}Ta(){return this.OS?Promise.resolve(this.OS):this.Sg.Ta(e.Og).then(e=>(this.OS=e,e))}static vg(e){e=e.toLowerCase();let t=[`googlebot`,`bingbot`,`slurp`,`duckduckbot`,`baiduspider`,`yandex`,`facebookexternalhit`,`sogou`,`ia_archiver`,`https://github.com/prerender/prerender`,`aolbuild`,`bingpreview`,`msnbot`,`adsbot`,`mediapartners-google`,`teoma`];for(let n=0;n<t.length;n++)if(e.indexOf(t[n])!==-1)return!0;return!1}};Te.Og=[{string:navigator.platform,if:`Win`,identity:R.Pg},{string:navigator.platform,if:`Mac`,identity:R.kg},{string:navigator.platform,if:`BlackBerry`,identity:`BlackBerry`},{string:navigator.platform,if:`FreeBSD`,identity:`FreeBSD`},{string:navigator.platform,if:`OpenBSD`,identity:`OpenBSD`},{string:navigator.platform,if:`Nintendo`,identity:`Nintendo`},{string:navigator.platform,if:`SunOS`,identity:`SunOS`},{string:navigator.platform,if:`PlayStation`,identity:`PlayStation`},{string:navigator.platform,if:`X11`,identity:`X11`},{string:navigator.userAgent,if:[`iPhone`,`iPad`,`iPod`],identity:R.de},{string:navigator.platform,if:`Pike v`,identity:R.de},{string:navigator.userAgent,if:[`Web0S`],identity:`WebOS`},{string:navigator.platform,if:[`Linux armv7l`,`Android`],identity:R.xg},{string:navigator.userAgent,if:[`Android`],identity:R.xg},{string:navigator.platform,if:`Linux`,identity:`Linux`}];var z=new Te,B={eu:{su:`ab.storage.userId`,Zo:`ab.storage.deviceId`,Dl:`ab.storage.sessionId`},k:{Qa:`ab.test`,tE:`ab.storage.events`,eE:`ab.storage.attributes`,sE:`ab.storage.attributes.anonymous_user`,Fa:`ab.storage.device`,Kh:`ab.storage.sdk_metadata`,Wh:`ab.storage.session_id_for_cached_metadata`,Bn:`ab.storage.pushToken`,Bi:`ab.storage.newsFeed`,Ei:`ab.storage.lastNewsFeedRefresh`,L:`ab.storage.cardImpressions`,hl:`ab.storage.serverConfig`,rE:`ab.storage.triggers`,oE:`ab.storage.triggers.ts`,zl:`ab.storage.messagingSessionStart`,Yt:`ab.storage.cc`,ws:`ab.storage.ccLastFullSync`,vs:`ab.storage.ccLastCardUpdated`,Vs:`ab.storage.ccLastClientRequest`,ci:`ab.storage.ccRateLimitCurrentTokenCount`,C:`ab.storage.ccClicks`,K:`ab.storage.ccImpressions`,G:`ab.storage.ccDismissals`,nE:`ab.storage.lastDisplayedTriggerTimesById`,iE:`ab.storage.lastDisplayedTriggerTime`,aE:`ab.storage.triggerFireInstancesById`,xh:`ab.storage.signature`,Ls:`ab.storage.brazeSyncRetryCount`,Ss:`ab.storage.sdkVersion`,Ri:`ab.storage.ff`,qi:`ab.storage.ffImpressions`,Ui:`ab.storage.ff
1LastRefreshAt`,EE:`ab.storage.lastReqToEndpoint`,lE:`ab.storage.requestAttempts`,rn:`ab.storage.deferredIam`},re:`ab.optOut`},V=class e{constructor(e,t){this.SE=e,this._E=t,this.SE=e,this._E=t}Jo(t){let n=m(B.eu),r=new e.ee(t);for(let e of n)r.remove(B.eu[e])}uu(e,t){let n=null;t!=null&&t instanceof k&&(n=t.ss()),this.SE.store(e,n)}uE(e){let t=this.tu(e);t!=null&&(t.Nl=new Date().valueOf(),this.uu(e,t))}tu(e){return k.Yn(this.SE.jr(e))}ql(e){this.SE.remove(e)}bo(e){let t;if(e==null||e.length===0)return!1;t=u(e)?e:[e];let n=this._E.jr(B.k.tE);n!=null&&u(n)||(n=[]);for(let e=0;e<t.length;e++)n.push(t[e].ss());return this._E.store(B.k.tE,n)}Hl(e){return e!=null&&this.bo([e])}cE(){let e=this._E.jr(B.k.tE);this._E.remove(B.k.tE),e??=[];let t=[],n=!1,r=null;if(u(e))for(let n=0;n<e.length;n++)O.TE(e[n])?t.push(O.Yn(e[n])):r=n;else n=!0;if(n||r!=null){let i=`Stored events could not be deserialized as Events`;n&&(i+=`, was `+Object.prototype.toString.call(e)+` not an array`),r!=null&&(i+=`, value at index `+r+` does not look like an event`),i+=`, serialized values were of type `+typeof e+`: `+JSON.stringify(e),t.push(new O(null,s.q.qs,new Date().valueOf(),null,{e:i}))}return t}D(e,t){return!!l(B.k,e,`StorageManager cannot store object.`,`STORAGE_KEYS.OBJECTS`)&&this._E.store(e,t)}v(e){return!!l(B.k,e,`StorageManager cannot retrieve object.`,`STORAGE_KEYS.OBJECTS`)&&this._E.jr(e)}ni(e){return!!l(B.k,e,`StorageManager cannot remove object.`,`STORAGE_KEYS.OBJECTS`)&&(this._E.remove(e),!0)}clearData(){let e=m(B.eu),t=m(B.k);for(let t=0;t<e.length;t++){let n=e[t];this.SE.remove(B.eu[n])}for(let e=0;e<t.length;e++){let n=t[e];this._E.remove(B.k[n])}}hE(e){return e||B.k.sE}Ha(e){let t=this._E.jr(B.k.eE);t??={};let n=this.hE(e[I.bu]),r=t[n];for(let i in e)i!==I.bu&&(t[n]==null||r&&r[i]==null)&&this.mu(e[I.bu],i,e[i])}mu(e,t,n){let r=this._E.jr(B.k.eE);r??={};let i=this.hE(e),a=r[i];if(a??(a={},e!=null&&(a[I.bu]=e)),t===I.lu){a[t]??(a[t]={});for(let e in n)a[t][e]=n[e]}else a[t]=n;return r[i]=a,this._E.store(B.k.eE,r)}AE(){let e=this._E.jr(B.k.eE);this._E.remove(B.k.eE);let t=[];for(let n in e)e[n]!=null&&t.push(e[n]);return t}ou(e){let t=this._E.jr(B.k.eE);if(t!=null){let n=this.hE(null),r=t[n];r!=null&&(t[n]=void 0,this._E.store(B.k.eE,t),r[I.bu]=e,this.Ha(r))}let n=this.tu(B.eu.Dl),r=null;n!=null&&(r=n.iu);let i=this.cE();if(i!=null)for(let t=0;t<i.length;t++){let n=i[t];n.userId==null&&n.sessionId==r&&(n.userId=e),this.Hl(n)}}RE(){return this._E.gE}};V.Ya=class{constructor(e){this.cn=e,this.cn=e,this.gE=z.OE()?3:10}dE(e){return e+`.`+this.cn}store(e,t){let n={v:t};try{return localStorage.setItem(this.dE(e),JSON.stringify(n)),!0}catch(e){return s.j.info(`Storage failure: `+M(e)),!1}}jr(e){try{let t=null,n=localStorage.getItem(this.dE(e));return n!=null&&(t=JSON.parse(n)),t==null?null:t.v}catch(e){return s.j.info(`Storage retrieval failure: `+M(e)),null}}remove(e){try{localStorage.removeItem(this.dE(e))}catch(e){return s.j.info(`Storage removal failure: `+M(e)),!1}}},V.Za=class{constructor(){this.fE={},this.bE=5242880,this.gE=3}store(e,t){let n={value:t},r=this.IE(t);return r>this.bE?(s.j.info(`Storage failure: object is â`+r+` bytes which is greater than the max of `+this.bE),!1):(this.fE[e]=n,!0)}IE(e){let t=[],n=[e],r=0;for(;n.length;){let e=n.pop();if(typeof e==`boolean`)r+=4;else if(typeof e==`string`)r+=2*e.length;else if(typeof e==`number`)r+=8;else if(typeof e==`object`&&t.indexOf(e)===-1){let r,i;t.push(e);for(let t in e)i=e,r=t,n.push(i[r])}}return r}jr(e){let t=this.fE[e];return t==null?null:t.value}remove(e){this.fE[e]=null}},V.ee=class{constructor(e,t){this.cn=e,this.mE=t,this.cn=e,this.KE=this.YE(),this.NE=576e3,this.mE=!!t}dE(e){return this.cn==null?e:e+`.`+this.cn}YE(){let e=0,t=document.location.hostname,n=t.split(`.`);for(;e<n.length-1&&document.cookie.indexOf(`ab._gd=ab._gd`)===-1;)e++,t=`.`+n.slice(-1-e).join(`.`),document.cookie=`ab._gd=ab._gd;domain=`+t+`;`;return document.cookie=`ab._gd=;expires=`+new Date(0).toUTCString()+`;domain=`+t+`;`,t}ae(){let e=new Date;return e.setTime(e.getTime()+60*this.NE*1e3),e.getFullYear()}DE(){let e=c(B.eu),t=document.cookie.split(`;`);for(let n=0;n<t.length;n++){let r=t[n];for(;r.charAt(0)===` `;)r=r.substring(1);let i=!1;for(let t=0;t<e.length;t++)if(r.indexOf(e[t])===0){i=!0;break}if(i){let e=r.split(`=`)[0];e.indexOf(`.`+this.cn)===-1&&this.CE(e)}}}store(e,t){this.DE();let n=new Date;n.setTime(n.getTime()+60*this.NE*1e3);let r=`expires=`+n.toUTCString(),i=`domain=`+this.KE,a;a=this.mE?t:encodeURIComponent(JSON.stringify(t));let o=this.dE(e)+`=`+a+`;`+r+`;`+i+`;path=/`;return o.length>=4093?(s.j.info(`Storage failure: string is `+o.length+` chars which is too large to store as a cookie.`),!1):(document.cookie=o,!0)}jr(e){let t=[],n=this.dE(e)+`=`,r=document.cookie.split(`;`);for(let i=0;i<r.length;i++){let a=r[i];for(;a.charAt(0)===` `;)a=a.substring(1);if(a.indexOf(n)===0)try{let e;e=this.mE?a.substring(n.length,a.length):JSON.parse(decodeURIComponent(a.substring(n.length,a.length))),t.push(e)}catch(t){return s.j.info(`Storage retrieval failure: `+M(t)),this.remove(e),null}}return t.length>0?t[t.length-1]:null}remove(e){this.CE(this.dE(e))}CE(e){let t=e+`=;expires=`+new Date(0).toUTCString();document.cookie=t,document.cookie=t+`;path=/`;let n=t+`;domain=`+this.KE;document.cookie=n,document.cookie=n+`;path=/`}},V.Va=class{constructor(e,t,n){this.cn=e,this.GE=[],t&&this.GE.push(new V.ee(e)),n&&this.GE.push(new V.Ya(e)),this.GE.push(new V.Za)}store(e,t){let n=!0;for(let r=0;r<this.GE.length;r++)n=this.GE[r].store(e,t)&&n;return n}jr(e){for(let t=0;t<this.GE.length;t++){let n=this.GE[t].jr(e);if(n!=null)return n}return null}remove(e){new V.ee(this.cn).remove(e);for(let t=0;t<this.GE.length;t++)this.GE[t].remove(e)}};var Ee=class{constructor(e,t,n){this.u=e,this.gh=t,this.ph=n,this.u=e,this.gh=t||!1,this.ph=n,this.Fh=new D,this.kh=0,this.fh=1}wh(){return this.gh}jh(){return this.u.v(B.k.xh)}setSdkAuthenticationSignature(e){let t=this.jh();this.u.D(B.k.xh,e);let n=s.zt.Ft;new s.xt(n,s.j).setItem(n.Jt.qh,this.fh,e),t!==e&&this.ti()}yh(){this.u.ni(B.k.xh);let e=s.zt.Ft;new s.xt(e,s.j).oe(e.Jt.qh,this.fh)}subscribeToSdkAuthenticationFailures(e){return this.ph.lt(e)}Bh(e){this.ph.Et(e)}Gh(){this.Fh.removeAllSubscriptions()}Hh(){this.kh+=1}Jh(){return this.kh}ti(){this.kh=0}},De=class{constructor(){}Ts(e){}changeUser(e=!1){}clearData(e=!1){}},Oe=class{constructor(e){this.id=e,this.id=e}Kr(){let e={};return this.browser!=null&&(e.browser=this.browser),this.Ia!=null&&(e.browser_version=this.Ia),this.os!=null&&(e.os_version=this.os),this.resolution!=null&&(e.resolution=this.resolution),this.language!=null&&(e.locale=this.language),this.timeZone!=null&&(e.time_zone=this.timeZone),this.userAgent!=null&&(e.user_agent=this.userAgent),e}},H={BROWSER:`browser`,BROWSER_VERSION:`browserVersion`,OS:`os`,RESOLUTION:`resolution`,LANGUAGE:`language`,TIME_ZONE:`timeZone`,USER_AGENT:`userAgent`},ke=class{constructor(e,t){this.u=e,this.Qo=t,this.u=e,t??=c(H),this.Qo=t}ce(e=!0){let t=this.u.tu(B.eu.Zo);t??(t=new k(s.Z.Y()),e&&this.u.uu(B.eu.Zo,t));let n=new Oe(t.iu);for(let e=0;e<this.Qo.length;e++)switch(this.Qo[e]){case H.BROWSER:n.browser=z.browser;break;case H.BROWSER_VERSION:n.Ia=z.version;break;case H.OS:n.os=this.Ta();break;case H.RESOLUTION:n.Da=screen.width+`x`+screen.height;break;case H.LANGUAGE:n.language=z.language;break;case H.TIME_ZONE:n.timeZone=this.Oa(new Date);break;case H.USER_AGENT:n.userAgent=z.userAgent}return n}Ta(){if(z.Ca())return z.Ca();let e=this.u.v(B.k.Fa);return e&&e.os_version?e.os_version:z.Ta()}Oa(e){let t=!1;if(typeof Intl<`u`&&typeof Intl.DateTimeFormat==`function`)try{if(typeof Intl.DateTimeFormat().resolvedOptions==`function`){let e=Intl.DateTimeFormat().resolvedOptions().timeZone;if(e!=null&&e!==``)return e}}catch(e){s.j.info(`Intl.DateTimeFormat threw an error, cannot detect user's time zone:`+M(e)),t=!0}if(t)return``;let n=e.getTimezoneOffset();return this.Ga(n)}Ga(e){let t=Math.trunc(e/60),n=Math.trunc(e%60),r=`GMT`;return e!==0&&(r+=e<0?`+`:`-`,r+=(`00`+Math.abs(t)).slice(-2)+`:`+(`00`+Math.abs(n)).slice(-2)),r}};function Ae(e,t,n){let r=`The '${e}' ${t} is deprecated.`;n&&(r+=` Please use '${n}' instead.`),s.j.warn(r)}
1var je={Ra:`invalid_api_key`,Xa:`blacklisted`,Ea:`no_device_identifier`,Zh:`invalid_json_response`,Vh:`empty_response`,__:`sdk_auth_error`},U={Os:{Na:`d`,Ks:`cc`,Si:`ff`,Lr:`t`},rm:e=>{if(e)return e.v(B.k.EE)},sm:e=>{if(e)return e.v(B.k.lE)},nm:(e,t)=>{e&&e.D(B.k.EE,t)},um:(e,t)=>{e&&e.D(B.k.lE,t)},La:(e,t)=>{if(!e||!t)return-1;let n=U.rm(e);if(n==null)return-1;let r=n[t];return r==null||isNaN(r)?-1:r},Wa:(e,t)=>{let n=1;if(!e||!t)return n;let r=U.sm(e);return r==null?n:(n=r[t],n==null||isNaN(n)?1:n)},Ws:(e,t,n)=>{if(!e||!t)return;let r=U.rm(e);r??={},r[t]=n,U.nm(e,r)},si:(e,t,n)=>{if(!e||!t)return;let r=U.sm(e);r??={},r[t]=n,U.um(e,r)},hi:(e,t)=>{if(!e||!t)return;let n=U.Wa(e,t);U.si(e,t,n+1)}},Me=class{constructor(e,t,n,r,i,a,o,s,c,l,u,d){this.fn=e,this.u=t,this.Uo=n,this.ft=r,this._e=i,this.wt=a,this.cn=o,this.Bo=s,this.jo=c,this.Do=l,this.appVersion=u,this.Xh=d,this.fn=e,this.u=t,this.Uo=n,this.ft=r,this._e=i,this.wt=a,this.cn=o,this.Bo=s,this.jo=c,this.Do=l,this.appVersion=u,this.Xh=d,this.$h=[`npm`]}Bs(e,t=!1,n=!1){let r=this.fn.ce(!n),i=r.Kr();h(this.u.v(B.k.Fa),i)||(e.device=i),e.api_key=this.cn,e.time=g(new Date().valueOf(),!0);let a=this.u.v(B.k.Kh)||[],o=this.u.v(B.k.Wh)||``;if(this.$h.length>0&&(!h(a,this.$h)||o!==this._e.Yh())&&(e.sdk_metadata=this.$h),e.sdk_version=this.jo,this.Do&&(e.sdk_flavor=this.Do),e.app_version=this.appVersion,e.app_version_code=this.Xh,e.device_id=r.id,t){let t=this.ft.getUserId();t!=null&&(e.user_id=t)}return e}Zs(e,t,n){let r=t.auth_error,i=t.error;if(!r&&!i)return!0;if(r){let t;this.Uo.Hh();let i={errorCode:r.error_code};for(let e of n)u(e)&&e[0]===`X-Braze-Auth-Signature`&&(i.signature=e[1]);e.respond_with&&e.respond_with.user_id?i.userId=e.respond_with.user_id:e.user_id&&(i.userId=e.user_id);let a=r.reason;return a?(i.reason=a,t=`due to ${a}`):t=`with error code ${r.error_code}.`,this.Uo.wh()||(t+=` Please use the "enableSdkAuthentication" initialization option to enable authentication.`),s.j.error(`SDK Authentication failed ${t}`),this.Qh(e.events||[],e.attributes||[]),this.Uo.Bh(i),!1}if(i){let n,r=i;switch(r){case je.Vh:return n=`Received successful response with empty body.`,$.N(s.q.qs,{e:n}),s.j.info(n),!1;case je.Zh:return n=`Received successful response with invalid JSON`,$.N(s.q.qs,{e:n+`: `+t.response}),s.j.info(n),!1;case je.Ra:r=`The API key "${e.api_key}" is invalid for the baseUrl ${this.Bo}`;break;case je.Xa:r=`Sorry, we are not currently accepting your requests. If you think this is in error, please contact us.`;break;case je.Ea:r=`No device identifier. Please contact [email protected]`}s.j.error(`Backend error: `+r)}return!1}Pa(e,t,n,r){return!!(e&&e.length!==0||t&&t.length!==0||n||r)}$a(e,t,n,r,i=!1){let a=[],o=e=>e||``,s=o(this.ft.getUserId()),c=this.Jr(e,t),l=[],u=[],d,f=null;if(n.length>0){let e=[];for(let t of n){if(d=t.Kr(),this.Uo.wh()){if(s&&!d.user_id){f||={},f.events||=[],f.events.push(d);continue}if(o(d.user_id)!==s){u.push(d);continue}}e.push(d)}e.length>0&&(c.events=e)}if(r.length>0){let e=[];for(let t of r)t&&(this.Uo.wh()&&o(t.user_id)!==s?l.push(t):e.push(t));e.length>0&&(c.attributes=e)}if(this.Qh(u,l),c=this.Bs(c,!0,i),f){f=this.Bs(f,!1,i);let e={requestData:f,headers:this.Hs(f,U.Os.Na)};a.push(e)}if(c&&!this.Pa(c.events,c.attributes,e,t))return f?a:null;let p={requestData:c,headers:this.Hs(c,U.Os.Na)};return a.push(p),a}Qh(e,t){if(e){let t=[];for(let n of e){let e=O.fromJson(n);e.time=_(e.time),t.push(e)}this.u.bo(t)}if(t)for(let e of t)this.u.Ha(e)}ii(e,t){let n=`HTTP error `;e!=null&&(n+=e+` `),n+=t,s.j.error(n)}qr(e){return $.N(s.q.Ka,{n:e})}Jr(e,t,n){let r={};e&&(r.feed=!0),t&&(r.triggers=!0);let i=n??this.ft.getUserId();return i&&(r.user_id=i),r.config={config_time:this.wt.li()},{respond_with:r}}Ua(e){let t=new Date().valueOf(),n=te.toString(),r=U.La(this.u,e);return r!==-1&&(n=(t-r).toString()),n}Hs(e,t,n=!1){let r=[[`X-Braze-Api-Key`,this.cn]],i=this.Ua(t);r.push([`X-Braze-Last-Req-Ms-Ago`,i]);let a=U.Wa(this.u,t).toString();r.push([`X-Braze-Req-Attempt`,a]);let o=!1;if(e.respond_with!=null&&e.respond_with.triggers&&(r.push([`X-Braze-TriggersRequest`,`true`]),o=!0),e.respond_with!=null&&e.respond_with.feed&&(r.push([`X-Braze-FeedRequest`,`true`]),o=!0),t===U.Os.Ks){r.push([`X-Braze-ContentCardsRequest`,`true`]);let e=this.u.v(B.k.Ls);e&&n||(e=0,this.u.D(B.k.Ls,e)),r.push([`BRAZE-SYNC-RETRY-COUNT`,e.toString()]),o=!0}if(t===U.Os.Si&&(r.push([`X-Braze-FeatureFlagsRequest`,`true`]),o=!0),o&&r.push([`X-Braze-DataRequest`,`true`]),this.Uo.wh()){let e=this.Uo.jh();e!=null&&r.push([`X-Braze-Auth-Signature`,e])}return r}Qs(e,t){let n=e.device;n&&n.os_version instanceof Promise?n.os_version.then(n=>{e.device.os_version=n,t()}):t()}ti(){this.Uo.ti()}Ys(){return this.Bo}
1addSdkMetadata(e){for(let t of e)this.$h.indexOf(t)===-1&&this.$h.push(t)}},Ne={Xs:e=>{let t,n;try{let r=()=>{s.j.error(`This browser does not have any supported ajax options!`)},i=!1;if(window.XMLHttpRequest&&(i=!0),!i)return void r();t=new XMLHttpRequest;let a=()=>{typeof e.error==`function`&&e.error(t.status),typeof e.ei==`function`&&e.ei(!1)};t.onload=()=>{let n=!1;if(t.readyState===4)if(n=t.status>=200&&t.status<300||t.status===304,n){if(typeof e.O==`function`){let n,r;try{n=JSON.parse(t.responseText),r=t.getAllResponseHeaders()}catch{let n={error:t.responseText===``?je.Vh:je.Zh,response:t.responseText};(0,e.O)(n,r)}n&&e.O(n,r)}typeof e.ei==`function`&&e.ei(!0)}else a()},t.onerror=()=>{a()},t.ontimeout=()=>{a()},n=JSON.stringify(e.data),t.open(`POST`,e.url,!0),t.setRequestHeader(`Content-type`,`application/json`),t.setRequestHeader(`X-Requested-With`,`XMLHttpRequest`);let o=e.headers||[];for(let e of o)t.setRequestHeader(e[0],e[1]);t.send(n)}catch(e){s.j.error(`Network request error: ${M(e)}`)}}},Pe=e=>{let t={},n=e.toString().split(`\r 2`);if(!n)return t;let r,i;for(let e of n)e&&(r=e.slice(0,e.indexOf(`:`)).toLowerCase().trim(),i=e.slice(e.indexOf(`:`)+1).trim(),t[r]=i);return t},Fe=(e,t)=>(e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e),Ie=class{constructor(e=!1,t=[]){this.O=e,this.ve=t,this.O=e,this.ve=t}S(e){this.O=this.O&&e.O,this.ve.push(...e.ve)}},W={kn:()=>`serviceWorker`in navigator&&typeof ServiceWorkerRegistration<`u`&&`showNotification`in ServiceWorkerRegistration.prototype&&`PushManager`in window,Dn:()=>`safari`in window&&`pushNotification`in window.safari&&typeof window.safari.pushNotification.permission==`function`&&typeof window.safari.pushNotification.requestPermission==`function`,isPushSupported:()=>W.kn()||W.Dn(),isPushBlocked:()=>{let e=W.isPushSupported()&&`Notification`in window&&window.Notification!=null&&window.Notification.permission!=null&&window.Notification.permission===`denied`,t=W.isPushSupported()&&(!(`Notification`in window)||window.Notification==null);return e||t},isPushPermissionGranted:()=>W.isPushSupported()&&`Notification`in window&&window.Notification!=null&&window.Notification.permission!=null&&window.Notification.permission===`granted`,Gr:()=>!W.isPushBlocked()&&W.isPushSupported()&&!W.isPushPermissionGranted()},Le=class{constructor(e,t,n,r,i,a,o,s,c,l){this.cn=e,this.baseUrl=t,this._e=n,this.fn=r,this.ft=i,this.wt=a,this.u=o,this.fu=s,this.Uo=c,this.gt=l,this.cn=e,this.baseUrl=t,this.gu=0,this.gE=o.RE()||0,this.vu=null,this._e=n,this.fn=r,this.ft=i,this.wt=a,this.u=o,this.Uo=c,this.gt=l,this.fu=s,this.wu=new D,this.ku=null,this.yu=50,this.ju=!1}Su(e,t){return!e&&!t&&this.Uo.Jh()>=this.yu}$u(e){let t=this._e.El();if(e.length>0){let n=this.ft.getUserId();for(let r of e){let e=!r.userId&&!n||r.userId===n;r.type===s.q.Wl&&e&&(t=!0)}}return t}qu(e=!1,t=!1,n=!0,r,i,a,o=!1,c=!1){n&&this.Au();let l=this.u.cE(),u=this.u.AE(),d=!1,f=(e,t)=>{let o=!1;U.Ws(this.u,U.Os.Na,new Date().valueOf()),Ne.Xs({url:this.baseUrl+`/data/`,data:e,headers:t,O:n=>{e.respond_with!=null&&e.respond_with.triggers&&(this.gu=Math.max(this.gu-1,0)),this.gt.Zs(e,n,t)?(this.Uo.ti(),this.wt.ul(n),e.respond_with!=null&&e.respond_with.user_id!=this.ft.getUserId()||(e.device!=null&&this.u.D(B.k.Fa,e.device),e.sdk_metadata!=null&&(this.u.D(B.k.Kh,e.sdk_metadata),this.u.D(B.k.Wh,this._e.Yh())),this.fu(n),U.si(this.u,U.Os.Na,1),typeof r==`function`&&r())):n.auth_error&&(o=!0)},error:()=>{e.respond_with!=null&&e.respond_with.triggers&&(this.gu=Math.max(this.gu-1,0)),this.gt.Qh(e.events,e.attributes),typeof i==`function`&&i()},ei:e=>{if(typeof a==`function`&&a(e),n&&!d){if(e&&!o)this.Cu();else{U.hi(this.u,U.Os.Na);let e=this.vu;(e==null||e<1e3*this.gE)&&(e=1e3*this.gE),this.Cu(Math.min(3e5,Fe(1e3*this.gE,3*e)))}d=!0}}})},p=this.$u(l),m=t||p;if(this.Su(o,p))return void s.j.info(`Declining to flush data due to 50 consecutive authentication failures`);if(n&&!this.gt.Pa(l,u,e,m))return this.Cu(),void(typeof a==`function`&&a(!0));let h=this.gt.$a(e,m,l,u,c);m&&this.gu++;let g=!1;if(h)for(let e of h)this.gt.Qs(e.requestData,()=>f(e.requestData,e.headers)),g=!0;this.Uo.wh()&&n&&!g?this.Cu():p&&(s.j.info(`Invoking new session subscriptions`),this.wu.Et())}Du(){return this.gu>0}Cu(e=1e3*this.gE){this.ju||(this.Au(),this.ku=window.setTimeout(()=>{if(document.hidden){let e=`visibilitychange`,t=()=>{document.hidden||(document.removeEventListener(e,t,!1),this.qu())};document.addEventListener(e,t,!1)}else this.qu()},e),this.vu=e)}Au(){this.ku!=null&&(clearTimeout(this.ku),this.ku=null)}initialize(){this.ju=!1,this.Cu()}destroy(){this.wu.removeAllSubscriptions(),this.Uo.Gh(),this.Au(),this.ju=!0,this.qu(void 0,void 0,!1,void 0,void 0,void 0,void 0,!0),this.ku=null}pr(e){return this.wu.lt(e)}openSession(){let t=this._e.Yh()!==this._e.co();t&&(this.u.uE(B.eu.Zo),this.u.uE(B.eu.su)),this.qu(void 0,!1,void 0,void 0,void 0),this.pu(),t&&e(()=>import(`./push-manager-factory-JGX4nf33.js`).then(e=>{if(this.ju)return;let t=e.default.m();if(t!=null&&(W.isPushPermissionGranted()||W.isPushBlocked())){let e=()=>{t.Sn()?s.j.info(`Push token maintenance is disabled, not refreshing token for backend.`):t.subscribe()},n=(t,n)=>{n&&e()},r=()=>{let t=this.u.v(B.k.Bn);(t==null||t)&&e()},i=s.zt.Ft;new s.xt(i,s.j).hr(i.Jt.cu,n,r)}}),[])}Fu(){this.u.ni(B.k.Ri),this.u.ni(B.k.Yt),this.u.ni(B.k.rn)}changeUser(e,t,n){let r=this.ft.getUserId();if(r!==e){this._e.kl(),this.Fu(),r!=null&&this.qu(void 0,!1,void 0,void 0,void 0),this.ft.ru(e),n?this.Uo.setSdkAuthenticationSignature(n):this.Uo.yh();for(let e=0;e<t.length;e++)t[e].changeUser(r==null);r!=null&&this.u.ni(B.k.L),this.u.ni(B.k.Fa),this.openSession(),s.j.info(`Changed user to "`+e+`".`)}else{let t=`Doing nothing.`;n&&this.Uo.jh()!==n&&(this.Uo.setSdkAuthenticationSignature(n),t=`Updated SDK authentication signature`),s.j.info(`Current user is already ${e}. ${t}`)}}requestImmediateDataFlush(e){this.Au(),this._e.co(),this.qu(void 0,void 0,void 0,void 0,()=>{s.j.error(`Failed to flush data, request will be retried automatically.`)},e,!0)}requestFeedRefresh(){this._e.co(),this.qu(!0)}$r(e,t){this._e.co(),s.j.info(`Requesting explicit trigger refresh.`),this.qu(void 0,!0,void 0,e,t)}$n(e,t){let n=s.q.Tu,r={a:e,l:t},i=$.N(n,r);return i&&s.j.info(`Logged alias ${e} with label ${t}`),i}
2Gn(e,t,n){if(this.wt.hu(t))return s.j.info(`Custom Attribute "${t}" is blocklisted, ignoring.`),new Ie;let r={key:t,value:n},i=$.N(e,r);if(i){let e=typeof n==`object`?JSON.stringify(n,null,2):n;s.j.info(`Logged custom attribute: ${t} with value: ${e}`)}return i}setLastKnownLocation(e,t,n,r,i,a){let o={latitude:t,longitude:n};r!=null&&(o.altitude=r),i!=null&&(o.ll_accuracy=i),a!=null&&(o.alt_accuracy=a);let c=$.N(s.q.Lu,o,e||void 0);return c&&s.j.info(`Set user last known location as ${JSON.stringify(o,null,2)}`),c}vr(e,t){let n=this._e.co();return new O(this.ft.getUserId(),s.q.Mu,e,n,{cid:t})}pu(){let e=s.zt.Ft;new s.xt(e,s.j).setItem(e.Jt.Na,1,{baseUrl:this.baseUrl,data:{api_key:this.cn,device_id:this.fn.ce().id},userId:this.ft.getUserId(),sdkAuthEnabled:this.Uo.wh()})}yr(e){for(let t of e)if(t.api_key===this.cn)this.gt.Qh(t.events,t.attributes);else{let e=s.zt.Ft;new s.xt(e,s.j).setItem(e.Jt.wr,s.Z.Y(),t)}}Zn(e,t,n){if(this.wt.hu(e))return s.j.info(`Custom Attribute "${e}" is blocklisted, ignoring.`),new Ie;let r,i;return t===null&&n===null?(r=s.q.Pu,i={key:e}):(r=s.q.Ru,i={key:e,latitude:t,longitude:n}),$.N(r,i)}au(e,t){let n={group_id:e,status:t};return $.N(s.q.Nu,n)}},Re=class e{constructor(e=0,t=[],n=[],r=[],i=null,a=null,o={enabled:!1},s={enabled:!1,refresh_rate_limit:void 0}){this.ol=e,this.cl=t,this.gl=n,this.fl=r,this.bl=i,this.al=a,this.ml=o,this.pi=s,this.ol=e,this.cl=t,this.gl=n,this.fl=r,this.bl=i,this.al=a,this.ml=o,this.pi=s}ss(){return{s:`4.10.2`,l:this.ol,e:this.cl,a:this.gl,p:this.fl,m:this.bl,v:this.al,c:this.ml,f:this.pi}}static Yn(t){let n=t.l;return t.s!==`4.10.2`&&(n=0),new e(n,t.e,t.a,t.p,t.m,t.v,t.c,t.f)}},ze=class{constructor(e){this.u=e,this.u=e,this.tl=new D,this.el=new D,this.sl=new D,this.il=null,this.rl=null}ll(){if(this.rl==null){let e=this.u.v(B.k.hl);this.rl=e==null?new Re:Re.Yn(e)}return this.rl}li(){return this.ll().ol}ul(e){if(e!=null&&e.config!=null){let t=e.config;if(t.time>this.ll().ol){let e=new Re(t.time,t.events_blacklist,t.attributes_blacklist,t.purchases_blacklist,t.messaging_session_timeout,t.vapid_public_key,t.content_cards,t.feature_flags),n=!1;e.al!=null&&this.En()!==e.al&&(n=!0);let r=!1;e.ml.enabled!=null&&this.oi()!==e.ml.enabled&&(r=!0);let i=!1;e.pi.enabled!=null&&this.vi()!==e.pi.enabled&&(i=!0),this.rl=e,this.u.D(B.k.hl,e.ss()),n&&this.tl.Et(),r&&this.el.Et(),i&&this.sl.Et()}}}Rn(e){let t=this.tl.lt(e);return this.il&&this.tl.removeSubscription(this.il),this.il=t,t}Ps(e){return this.el.lt(e)}Ci(e){return this.sl.lt(e)}ge(e){return this.ll().cl.indexOf(e)!==-1}hu(e){return this.ll().gl.indexOf(e)!==-1}Dr(e){return this.ll().fl.indexOf(e)!==-1}dl(){return this.ll().bl}En(){return this.ll().al}oi(){return this.ll().ml.enabled||!1}$s(){let e=this.ll().ml.rate_limit;return!(!e||e.enabled==null)&&e.enabled}di(){if(!this.$s())return-1;let e=this.ll().ml.rate_limit;return e.capacity==null?5:e.capacity<=0?-1:e.capacity}mi(){if(!this.$s())return-1;let e=this.ll().ml.rate_limit;return e.refill_rate==null?90:e.refill_rate<=0?-1:e.refill_rate}vi(){return this.ll().pi.enabled&&this.Mi()==null?($.N(s.q.qs,{e:`Missing feature flag refresh_rate_limit.`}),!1):this.ll().pi.enabled||!1}Mi(){return this.ll().pi.refresh_rate_limit}},Be=class{constructor(e,t,n,r){this.u=e,this.ft=t,this.wt=n,this.wl=r,this.u=e,this.ft=t,this.wt=n,this.Sl=1e3,(r==null||isNaN(r))&&(r=1800),r<this.Sl/1e3&&(s.j.info(`Specified session timeout of `+r+`s is too small, using the minimum session timeout of `+this.Sl/1e3+`s instead.`),r=this.Sl/1e3),this.wl=r}jl(e,t){return new O(this.ft.getUserId(),s.q.xl,e,t.iu,{d:g(e-t.vl)})}Yh(){let e=this.u.tu(B.eu.Dl);return e==null?null:e.iu}El(){let e=new Date().valueOf(),t=this.wt.dl(),n=this.u.v(B.k.zl);if(n!=null&&t==null)return!1;let r=!1;return n==null?r=!0:t!=null&&(r=e-n>1e3*t),r&&this.u.D(B.k.zl,e),r}Cl(e,t){return t==null||t.Gl==null||!(e-t.vl<this.Sl)&&t.Gl<e}co(){let e=new Date().valueOf(),t=e+1e3*this.wl,n=this.u.tu(B.eu.Dl);if(this.Cl(e,n)){let r=`Generating session start event with time `+e;if(n!=null){let e=n.Nl;e-n.vl<this.Sl&&(e=n.vl+this.Sl),this.u.Hl(this.jl(e,n)),r+=` (old session ended `+e+`)`}r+=`. Will expire `+t.valueOf(),s.j.info(r);let i=new k(s.Z.Y(),t);return this.u.Hl(new O(this.ft.getUserId(),s.q.Wl,e,i.iu)),this.u.uu(B.eu.Dl,i),this.u.v(B.k.zl)??this.u.D(B.k.zl,e),i.iu}if(n!=null)return n.Nl=e,n.Gl=t,this.u.uu(B.eu.Dl,n),n.iu}kl(){let e=this.u.tu(B.eu.Dl);e!=null&&(this.u.ql(B.eu.Dl),this.u.Hl(this.jl(new Date().valueOf(),e)))}},Ve={xo:function(e,t=!1){let n=!1;try{if(localStorage&&localStorage.getItem)try{localStorage.setItem(B.k.Qa,`true`),localStorage.getItem(B.k.Qa)&&(localStorage.removeItem(B.k.Qa),n=!0)}catch(e){if(!(e instanceof Error&&(e.name===`QuotaExceededError`||e.name===`NS_ERROR_DOM_QUOTA_REACHED`)&&localStorage.length>0))throw e;n=!0}}catch{s.j.info(`Local Storage not supported!`)}let r=Ve.Ja(),i=new V.Va(e,r&&!t,n),a;return a=n?new V.Ya(e):new V.Za,new V(i,a)},Ja:function(){return navigator.cookieEnabled||`cookie`in document&&(document.cookie.length>0||(document.cookie=`test`).indexOf.call(document.cookie,`test`)>-1)}},He=class e{constructor(e){this.triggerId=e,this.triggerId=e,this.extras={}
2,this.isControl=!0}static fromJson(t){return new e(t.trigger_id)}};function Ue(e,t=!1,n=!1,r=!1){if(e==null)return!1;t||=!1,n||=!1;let i=e.getBoundingClientRect();return i!=null&&(i.top>=0&&i.top<=(window.innerHeight||document.documentElement.clientHeight)||!t)&&(i.left>=0||!r)&&(i.bottom>=0&&i.bottom<=(window.innerHeight||document.documentElement.clientHeight)||!n)&&(i.right<=(window.innerWidth||document.documentElement.clientWidth)||!r)}var We={lc:null,no:Ue},Ge={Oe:`up`,Qe:`down`,W:`left`,X:`right`};function Ke(){if(We.lc==null){We.lc=!1;try{let e=Object.defineProperty({},"passive",{get:()=>{We.lc=!0}});window.addEventListener(`testPassive`,()=>{},e),window.removeEventListener(`testPassive`,()=>{},e)}catch(e){s.j.error(M(e))}}return We.lc}function qe(e,t,n=()=>{}){e.addEventListener(t,n,!!Ke()&&{passive:!0})}function Je(e){return We.no(e,!0,!1,!1)}function Ye(e){return We.no(e,!1,!0,!1)}function Xe(e){if(e.onclick){let t=document.createEvent(`MouseEvents`);t.initEvent(`click`,!0,!0),e.onclick.apply(e,[t])}}function Ze(e,t,n){let r=null,i=null;qe(e,`touchstart`,e=>{r=e.touches[0].clientX,i=e.touches[0].clientY}),qe(e,`touchmove`,a=>{if(r==null||i==null)return;let o=r-a.touches[0].clientX,s=i-a.touches[0].clientY;Math.abs(o)>Math.abs(s)&&Math.abs(o)>=25?((o>0&&t===Ge.W||o<0&&t===Ge.X)&&n(a),r=null,i=null):Math.abs(s)>=25&&((s>0&&t===Ge.Oe&&e.scrollTop===e.scrollHeight-e.offsetHeight||s<0&&t===Ge.Qe&&e.scrollTop===0)&&n(a),r=null,i=null)})}function Qe(e,t,n){let r=`http://www.w3.org/2000/svg`,i=document.createElementNS(r,`svg`);i.setAttribute(`viewBox`,e),i.setAttribute(`xmlns`,r);let a=document.createElementNS(r,`path`);return a.setAttribute(`d`,t),n!=null&&a.setAttribute(`fill`,n),i.appendChild(a),i}var $e={Fo:32,oo:9,To:13,_h:27},et=e=>e!==null&&e.tagName===`IFRAME`,G=class e{constructor(t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,ee,x,S,C,w,T,E,te,O){this.message=t,this.messageAlignment=n,this.slideFrom=r,this.extras=i,this.triggerId=a,this.clickAction=o,this.uri=s,this.openTarget=c,this.dismissType=l,this.duration=u,this.icon=d,this.imageUrl=f,this.imageStyle=p,this.iconColor=m,this.iconBackgroundColor=h,this.backgroundColor=g,this.textColor=_,this.closeButtonColor=v,this.animateIn=y,this.animateOut=b,this.header=ee,this.headerAlignment=x,this.headerTextColor=S,this.frameColor=C,this.buttons=w,this.cropType=T,this.orientation=E,this.htmlId=te,this.css=O,this.message=t,this.messageAlignment=n||e.TextAlignment.CENTER,this.duration=u||5e3,this.slideFrom=r||e.SlideFrom.BOTTOM,this.extras=i||{},this.triggerId=a,this.clickAction=o||e.ClickAction.NONE,this.uri=s,this.openTarget=c||e.OpenTarget.NONE,this.dismissType=l||e.DismissType.AUTO_DISMISS,this.icon=d,this.imageUrl=f,this.imageStyle=p||e.ImageStyle.TOP,this.iconColor=m||e.th.ih,this.iconBackgroundColor=h||e.th.sh,this.backgroundColor=g||e.th.ih,this.textColor=_||e.th.hh,this.closeButtonColor=v||e.th.eh,this.animateIn=y,this.animateIn??=!0,this.animateOut=b,this.animateOut??=!0,this.header=ee,this.headerAlignment=x||e.TextAlignment.CENTER,this.headerTextColor=S||e.th.hh,this.frameColor=C||e.th.Eh,this.buttons=w||[],this.cropType=T||e.CropType.FIT_CENTER,this.orientation=E,this.htmlId=te,this.css=O,this.isControl=!1,this.nh=!1,this.Th=!1,this.do=!1,this.oh=!1,this.Me=null,this.ke=null,this.ht=new D,this.rh=new D,this.Te=e.TextAlignment.CENTER}subscribeToClickedEvent(e){return this.ht.lt(e)}subscribeToDismissedEvent(e){return this.rh.lt(e)}removeSubscription(e){this.ht.removeSubscription(e),this.rh.removeSubscription(e)}removeAllSubscriptions(){this.ht.removeAllSubscriptions(),this.rh.removeAllSubscriptions()}closeMessage(){this.ye(this.Me)}xe(){return!0}io(){return this.xe()}Ne(){return this.htmlId!=null&&this.htmlId.length>4}Ae(){return this.Ne()&&this.css!=null&&this.css.length>0}Ce(){if(this.Ne()&&this.Ae())return this.htmlId+`-css`}M(){return!this.Th&&(this.Th=!0,!0)}so(){return this.Th}p(e){return!this.do&&(this.do=!0,this.ht.Et(),!0)}F(){return!this.oh&&(this.oh=!0,this.rh.Et(),!0)}hide(t){if(t&&t.parentNode){let n=t.closest(`.ab-iam-root`);if(n??=t,this.xe()&&n.parentNode!=null){let t=n.parentNode.classList;t&&t.contains(e.lh)&&t.remove(e.lh),document.body.removeEventListener(`touchmove`,e.uh)}n.className=n.className.replace(e.ah,e.Ih)}return this.animateOut||!1}ye(t,n){if(t==null)return;let r;this.Me=null,r=t.className.indexOf(`ab-in-app-message`)===-1?t.getElementsByClassName(`ab-in-app-message`)[0]:t;let i=!1;r&&(i=this.hide(r));let a=document.body,o;a!=null&&(o=a.scrollTop);let s=()=>
2{if(t&&t.parentNode){let e=t.closest(`.ab-iam-root`);e??=t,e.parentNode&&e.parentNode.removeChild(e)}let e=this.Ce();if(e!=null){let t=document.getElementById(e);t&&t.parentNode&&t.parentNode.removeChild(t)}a!=null&&z.browser===`Safari`&&(a.scrollTop=o),n?n():this.F()};i?setTimeout(s,e.Oh):s(),this.ke&&this.ke.focus()}Ge(){return document.createTextNode(this.message||``)}Be(e){let t=``;this.message||this.header||!this.xe()||(t=`Modal Image`),e.setAttribute(`alt`,t)}static uh(t){if(t.targetTouches&&t.targetTouches.length>1)return;let n=t.target;n&&n.classList&&n.classList.contains(`ab-message-text`)&&n.scrollHeight>n.clientHeight||document.querySelector(`.${e.lh}`)&&t.preventDefault()}Ah(t){let n=t.parentNode;this.xe()&&n!=null&&this.orientation!==e.Orientation.LANDSCAPE&&(n.classList!=null&&n.classList.add(e.lh),document.body.addEventListener(`touchmove`,e.uh,!!Ke()&&{passive:!1})),t.className+=` `+e.ah}static Lh(e){if(e.keyCode===$e._h&&!Q.nn(Z.mh)&&document.querySelectorAll(`.ab-modal-interactions`).length>0){let e=document.getElementsByClassName(`ab-html-message`),t=!1;for(let n of e){let e=null;et(n)&&n.contentWindow&&(e=n.contentWindow.document.getElementsByClassName(`ab-programmatic-close-button`)[0]),e!=null&&(Xe(e),t=!0)}if(!t){let e=document.querySelectorAll(`.ab-modal-interactions > .ab-close-button`)[0];e!=null&&Xe(e)}}}Nh(){this.nh||Q.nn(Z.mh)||(document.addEventListener(`keydown`,e.Lh,!1),Q.Rh(()=>{document.removeEventListener(`keydown`,e.Lh)}),this.nh=!0)}ss(t){let n={};return t?(n[e.hs.ea]=this.message,n[e.hs.ra]=this.messageAlignment,n[e.hs.Sh]=this.slideFrom,n[e.hs.xs]=this.extras,n[e.hs.sa]=this.triggerId,n[e.hs.ta]=this.clickAction,n[e.hs.URI]=this.uri,n[e.hs.ia]=this.openTarget,n[e.hs.oa]=this.dismissType,n[e.hs.pa]=this.duration,n[e.hs.ma]=this.icon,n[e.hs.os]=this.imageUrl,n[e.hs.na]=this.imageStyle,n[e.hs.ua]=this.iconColor,n[e.hs.ca]=this.iconBackgroundColor,n[e.hs.fa]=this.backgroundColor,n[e.hs.da]=this.textColor,n[e.hs.la]=this.closeButtonColor,n[e.hs.ga]=this.animateIn,n[e.hs.ja]=this.animateOut,n[e.hs.xa]=this.header,n[e.hs.za]=this.headerAlignment,n[e.hs.ha]=this.headerTextColor,n[e.hs.va]=this.frameColor,n[e.hs.wa]=this.buttons,n[e.hs.ya]=this.cropType,n[e.hs.Sa]=this.orientation,n[e.hs.ba]=this.htmlId,n[e.hs.CSS]=this.css,n[e.hs.ts]=t,n):n}};G.th={hh:4281545523,ih:4294967295,sh:4278219733,Dh:4293914607,Mh:4283782485,Eh:3224580915,eh:4288387995},G.Ie={Ch:`hd`,Le:`ias`,dh:`of`,Uh:`do`,Xr:`umt`,Qr:`tf`,bh:`te`},G.SlideFrom={TOP:`TOP`,BOTTOM:`BOTTOM`},G.ClickAction={NEWS_FEED:`NEWS_FEED`,URI:`URI`,NONE:`NONE`},G.DismissType={AUTO_DISMISS:`AUTO_DISMISS`,MANUAL:`SWIPE`},G.OpenTarget={NONE:`NONE`,BLANK:`BLANK`},G.ImageStyle={TOP:`TOP`,GRAPHIC:`GRAPHIC`},G.Orientation={PORTRAIT:`PORTRAIT`,LANDSCAPE:`LANDSCAPE`},G.TextAlignment={START:`START`,CENTER:`CENTER`,END:`END`},G.CropType={CENTER_CROP:`CENTER_CROP`,FIT_CENTER:`FIT_CENTER`},G.qe={pn:`SLIDEUP`,un:`MODAL`,Se:`MODAL_STYLED`,on:`FULL`,ln:`WEB_HTML`,Ee:`HTML`,Ue:`HTML_FULL`},G.Oh=500,G.Ph=200,G.ah=`ab-show`,G.Ih=`ab-hide`,G.lh=`ab-pause-scrolling`,G.hs={ea:`m`,ra:`ma`,Sh:`sf`,xs:`e`,sa:`ti`,ta:`ca`,URI:`u`,ia:`oa`,oa:`dt`,pa:`d`,ma:`i`,os:`iu`,na:`is`,ua:`ic`,ca:`ibc`,fa:`bc`,da:`tc`,la:`cbc`,ga:`ai`,ja:`ao`,xa:`h`,za:`ha`,ha:`htc`,va:`fc`,wa:`b`,ya:`ct`,Sa:`o`,ba:`hi`,CSS:`css`,ts:`type`,vo:`messageFields`};var tt=class e extends G{constructor(e,t,n,r,i,a,o,s,c,l,u){super(e,void 0,void 0,t,n,void 0,void 0,void 0,r||=G.DismissType.MANUAL,i,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,a,o,void 0,void 0,void 0,s,void 0,void 0,void 0,c,l),this.messageFields=u,this.messageFields=u}io(){return!1}p(e){if(this.Pe===G.qe.ln){if(this.do)return!1;this.do=!0}return this.ht.Et(e),!0}ss(){let t=super.ss(e.es);return t[G.hs.vo]=this.messageFields,t}static an(t){return new e(t[G.hs.ea],t[G.hs.xs],t[G.hs.sa],t[G.hs.oa],t[G.hs.pa],t[G.hs.ga],t[G.hs.ja],t[G.hs.va],t[G.hs.ba],t[G.hs.CSS],t[G.hs.vo])}};tt.es=G.qe.ln;var nt=class e{constructor(t,n,r,i,a,o,s){this.text=t,this.backgroundColor=n,this.textColor=r,this.borderColor=i,this.clickAction=a,this.uri=o,this.id=s,this.text=t||``,this.backgroundColor=n||G.th.sh,this.textColor=r||G.th.ih,this.borderColor=i||this.backgroundColor,this.clickAction=a||G.ClickAction.NONE,this.uri=o,s??=e.Yi,this.id=s,this.do=!1,this.ht=new D}subscribeToClickedEvent(e){return this.ht.lt(e)}removeSubscription(e){this.ht.removeSubscription(e)}removeAllSubscriptions(){this.ht.removeAllSubscriptions()}p(){return!this.do&&(this.do=!0,this.ht.Et(),!0)}static fromJson(t){return new e(t.text,t.bg_color,t.text_color,t.border_color,t.click_action,t.uri,t.id)}};nt.Yi=-1;var rt=class e extends G{constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,ee,x,S,C,w,T,E){s||=G.DismissType.MANUAL,w||=G.Orientation.PORTRAIT,super(e,t,void 0,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,ee,x,S,C||=G.CropType.CENTER_CROP,w,T,E),this.Te=G.TextAlignment.CENTER}ss(){return super.ss(e.es)}static an(t){return new e(t[G.hs.ea],t[G.hs.ra],t[G.hs.xs],t[G.hs.sa],t[G.hs.ta],t[G.hs.URI],t[G.hs.ia],t[G.hs.oa],t[G.hs.pa],t[G.hs.ma],t[G.hs.os],t[G.hs.na],t[G.hs.ua],t[G.hs.ca],t[G.hs.fa],t[G.hs.da],t[G.hs.la],t[G.hs.ga],t[G.hs.ja],t[G.hs.xa],t[G.hs.za],t[G.hs.ha],t[G.hs.va],st(t[G.hs.wa]),t[G.hs.ya],t[G.hs.Sa],t[G.hs.ba],t[G.hs.CSS])}};rt.es=G.qe.on;var it=class e extends G{constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,ee,x,S,C,w,T){super(e,t,void 0,n,r,i,a,o,s||=G.DismissType.MANUAL,c,l,u,d,f,p,m,h,g,_,v,y,b,ee,x,S,C||=G.CropType.FIT_CENTER,void 0,w,T),this.Te=G.TextAlignment.CENTER}ss(){return super.ss(e.es)}static an(t){return new e(t[G.hs.ea],t[G.hs.ra],t[G.hs.xs],t[G.hs.sa],t[G.hs.ta],t[G.hs.URI],t[G.hs.ia],t[G.hs.oa],t[G.hs.pa],t[G.hs.ma],t[G.hs.os],t[G.hs.na],t[G.hs.ua],t[G.hs.ca],t[G.hs.fa],t[G.hs.da],t[G.hs.la],t[G.hs.ga],t[G.hs.ja],t[G.hs.xa],t[G.hs.za],t[G.hs.ha],t[G.hs.va],st(t[G.hs.wa]),t[G.hs.ya],t[G.hs.ba],t[G.hs.CSS])}};it.es=G.qe.un;var at=class e extends G{constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b){h||=G.th.Mh,m||=G.th.Dh,super(e,t||=G.TextAlignment.START,n,r,i,a,o,s,c,l,u,d,void 0,f,p,m,h,g,_,v,void 0,void 0,void 0,void 0,void 0,void 0,void 0,y,b),this.Te=G.TextAlignment.START}xe(){return!1}Ge(){let e=document.createElement(`span`);return e.appendChild(document.createTextNode(this.message||``)),e}Ah(e){let t=e.getElementsByClassName(`ab-in-app-message`)[0];We.no(t,!0,!0)||(this.slideFrom===G.SlideFrom.TOP?t.style.top=`0px`:t.style.bottom=`0px`),super.Ah(e)}ss(){return super.ss(e.es)}static an(t){return new e(t[G.hs.ea],t[G.hs.ra],t[G.hs.Sh],t[G.hs.xs],t[G.hs.sa],t[G.hs.ta],t[G.hs.URI],t[G.hs.ia],t[G.hs.oa],t[G.hs.pa],t[G.hs.ma],t[G.hs.os],t[G.hs.ua],t[G.hs.ca],t[G.hs.fa],t[G.hs.da],t[G.hs.la],t[G.hs.ga],t[G.hs.ja],t[G.hs.ba],t[G.hs.CSS])}};at.es=G.qe.pn;function ot(e){if(!e)return null;if(e.is_control)return He.fromJson(e);let t=e.type;t!=null&&(t=t.toUpperCase());let n=e.message,r=e.text_align_message,i=e.slide_from,a=e.extras,o=e.trigger_id,c=e.click_action,l=e.uri,u=e.open_target,d=e.message_close,f=e.duration,p=e.icon,m=e.image_url,h=e.image_style,g=e.icon_color,_=e.icon_bg_color,v=e.bg_color,y=e.text_color,b=e.close_btn_color,ee=e.header,x=e.text_align_header,S=e.header_text_color,C=e.frame_color,w=[],T=e.btns;T??=[];for(let e=0;e<T.length;e++)w.push(nt.fromJson(T[e]));let E=e.crop_type,te=e.orientation,D=e.animate_in,O=e.animate_out,k,A=e.html_id,j=e.css;if(A!=null&&A!==``&&j!=null&&j!==``||(A=void 0,j=void 0),t===it.es||t===G.qe.Se)k=new it(n,r,a,o,c,l,u,d,f,p,m,h,g,_,v,y,b,D,O,ee,x,S,C,w,E,A,j);else if(t===rt.es)k=new rt(n,r,a,o,c,l,u,d,f,p,m,h,g,_,v,y,b,D,O,ee,x,S,C,w,E,te,A,j);else if(t===at.es)k=new at(n,r,i,a,o,c,l,u,d,f,p,m,g,_,v,y,b,D,O,A,j);else{if(t!==tt.es&&t!==G.qe.Ee&&t!==G.qe.Ue)return void s.j.error(`Ignoring message with unknown type `+t);{let t=e.message_fields;k=new tt(n,a,o,d,f,D,O,C,A,j,t),k.trusted=e.trusted||!1}}return k.Pe=t,k}function st(e){let t=[];for(let n of e)t.push(new nt(n.text,n.backgroundColor,n.textColor,n.borderColor,n.clickAction,n.uri,n.id));return t}var ct=class e{constructor(e){this.yl=e,this.yl=e}Bl(e){return this.yl==null||this.yl===e[0]}static fromJson(t){return new e(t?t.event_name:null)}ss(){return this.yl}},lt=class e{constructor(t,n,r,i){this.Tl=t,this.Al=n,this.comparator=r,this._l=i,this.Tl=t,this.Al=n,this.comparator=r,this._l=i,this.Al===e.Rl.Ml&&this.comparator!==e.Il.Ll&&this.comparator!==e.Il.Ol&&this.comparator!==e.Il.Ul&&this.comparator!==e.Il.Ql&&(this._l=v(this._l))}Bl(t){let n=null;switch(t!=null&&(n=t[this.Tl]),this.comparator){case e.Il.Xl:return n!=null&&n.valueOf()===this._l.valueOf();case e.Il.Fl:return n==null||n.valueOf()!==this._l.valueOf();case e.Il.Kl:return n!=null&&typeof n==typeof this._l&&n>this._l;case e.Il.Ll:return this.Al===e.Rl.Ml?n!=null&&d(n)&&x(n)<=this._l.valueOf():n!=null&&typeof n==typeof this._l&&n>=this._l;case e.Il.Pl:return n!=null&&typeof n==typeof this._l&&n<this._l;case e.Il.Ol:return this.Al===e.Rl.Ml?n!=null&&d(n)&&x(n)>=this._l.valueOf():n!=null&&typeof n==typeof this._l&&n<=this._l;case e.Il.Yl:return n!=null&&typeof n==`string`&&typeof n==typeof this._l&&n.match(this._l)!=null;case e.Il.Zl:return n!=null;case e.Il.$l:return n==null;case e.Il.Ul:return n!=null&&d(n)&&S(n)<this._l;case e.Il.Ql:return n!=null&&d(n)&&S(n)>this._l;case e.Il.Eu:return n==null||typeof n!=typeof this._l||typeof n!=`string`||n.match(this._l)==null}return!1}static fromJson(t){return new e(t.property_key,t.property_type,t.comparator,t.property_value)}ss(){let e=this._l;return d(this._l)&&(e=g(e.valueOf())),{k:this.Tl,t:this.Al,c:this.comparator,v:e}}static Yn(t){return new e(t.k,t.t,t.c,t.v)}};lt.Rl={_u:`boolean`,Hu:`number`,Iu:`string`,Ml:`date`},lt.Il={Xl:1,Fl:2,Kl:3,Ll:4,Pl:5,Ol:6,Yl:10,Zl:11,$l:12,Ul:15,Ql:16,Eu:17};var ut=class e{constructor(e){this.filters=e,this.filters=e}Bl(e){let t=!0;for(let n=0;n<this.filters.length;n++){let r=this.filters[n],i=!1;for(let t=0;t<r.length;t++)if(r[t].Bl(e)){i=!0;break}if(!i){t=!1;break}}return t}static fromJson(t){if(t==null||!u(t))return null;let n=[];for(let e=0;e<t.length;e++){let r=[],i=t[e];for(let e=0;e<i.length;e++)r.push(lt.fromJson(i[e]));n.push(r)}return new e(n)}ss(){let e=[];for(let t=0;t<this.filters.length;t++){let n=this.filters[t],r=[];for(let e=0;e<n.length;e++)r.push(n[e].ss());e.push(r)}return e}static Yn(t){let n=[];for(let e=0;e<t.length;e++){let r=[],i=t[e];for(let e=0;e<i.length;e++)r.push(lt.Yn(i[e]));n.push(r)}return new e(n)}},dt=class e{constructor(e,t){this.yl=e,this.Jl=t,this.yl=e,this.Jl=t}Bl(e){if(this.yl==null||this.Jl==null)return!1;let t=e[0],n=e[1];return t===this.yl&&this.Jl.Bl(n)}static fromJson(t){return new e(t?t.event_name:null,t?ut.fromJson(t.property_filters):null)}ss(){return{e:this.yl,pf:this.Jl?this.Jl.ss():null}}},ft=class e{constructor(e,t){this.xu=e,this.zu=t,this.xu=e,this.zu=t}Bl(e){if(this.xu==null)return!1;let t=q.Bu(e[0],this.xu);if(!t)return!1;let n=this.zu==null||this.zu.length===0;
2if(this.zu!=null){for(let t=0;t<this.zu.length;t++)if(this.zu[t]===e[1]){n=!0;break}}return t&&n}static fromJson(t){return new e(t?t.id:null,t?t.buttons:null)}ss(){return this.xu}},pt=class e{constructor(e){this.productId=e,this.productId=e}Bl(e){return this.productId==null||e[0]===this.productId}static fromJson(t){return new e(t?t.product_id:null)}ss(){return this.productId}},mt=class e{constructor(e,t){this.productId=e,this.Jl=t,this.productId=e,this.Jl=t}Bl(e){if(this.productId==null||this.Jl==null)return!1;let t=e[0],n=e[1];return t===this.productId&&this.Jl.Bl(n)}static fromJson(t){return new e(t?t.product_id:null,t?ut.fromJson(t.property_filters):null)}ss(){return{id:this.productId,pf:this.Jl?this.Jl.ss():null}}},ht=class e{constructor(e){this.xu=e,this.xu=e}Bl(e){return this.xu==null||q.Bu(e[0],this.xu)}static fromJson(t){return new e(t?t.campaign_id:null)}ss(){return this.xu}},K={OPEN:`open`,Rr:`purchase`,zr:`push_click`,$e:`custom_event`,ro:`iam_click`,zs:`test`},q=class e{constructor(e,t){this.type=e,this.data=t,this.type=e,this.data=t}ec(t,n){return e.rc[this.type]===t&&(this.data==null||this.data.Bl(n))}static Bu(e,t){let n=null;try{n=window.atob(e)}catch(t){return s.j.info(`Failed to unencode analytics id `+e+`: `+M(t)),!1}return t===n.split(`_`)[0]}static fromJson(t){let n=t.type,r=null;switch(n){case e.Wr.OPEN:case e.Wr.zs:break;case e.Wr.Rr:r=pt.fromJson(t.data);break;case e.Wr.sc:r=mt.fromJson(t.data);break;case e.Wr.zr:r=ht.fromJson(t.data);break;case e.Wr.$e:r=ct.fromJson(t.data);break;case e.Wr.ac:r=dt.fromJson(t.data);break;case e.Wr.ro:r=ft.fromJson(t.data)}return new e(n,r)}ss(){return{t:this.type,d:this.data?this.data.ss():null}}static Yn(t){let n,r=null;switch(t.t){case e.Wr.OPEN:case e.Wr.zs:break;case e.Wr.Rr:r=new pt(t.d);break;case e.Wr.sc:n=t.d||{},r=new mt(n.id,ut.Yn(n.pf||[]));break;case e.Wr.zr:r=new ht(t.d);break;case e.Wr.$e:r=new ct(t.d);break;case e.Wr.ac:n=t.d||{},r=new dt(n.e,ut.Yn(n.pf||[]));break;case e.Wr.ro:r=new ft(t.d)}return new e(t.t,r)}};q.Wr={OPEN:`open`,Rr:`purchase`,sc:`purchase_property`,zr:`push_click`,$e:`custom_event`,ac:`custom_event_property`,ro:`iam_click`,zs:`test`},q.rc={},q.rc[q.Wr.OPEN]=K.OPEN,q.rc[q.Wr.Rr]=K.Rr,q.rc[q.Wr.sc]=K.Rr,q.rc[q.Wr.zr]=K.zr,q.rc[q.Wr.$e]=K.$e,q.rc[q.Wr.ac]=K.$e,q.rc[q.Wr.ro]=K.ro,q.rc[q.Wr.zs]=K.zs;var J=class e{constructor(t,n=[],r,i,a=0,o,s,c=0,l=e.Ju,u,d,f){this.id=t,this.Vu=n,this.startTime=r,this.endTime=i,this.priority=a,this.type=o,this.data=s,this.Gu=c,this.Ku=l,this.sn=u,this.Ou=d,this.Qu=f,this.id=t,this.Vu=n||[],r===void 0&&(r=null),this.startTime=r,i===void 0&&(i=null),this.endTime=i,this.priority=a||0,this.type=o,this.Gu=c||0,u??=1e3*(this.Gu+30),this.sn=u,this.data=s,l!=null&&(this.Ku=l),this.Ou=d,this.Qu=f||null}Uu(t){return this.Qu==null||this.Ku!==e.Ju&&t-this.Qu>=1e3*this.Ku}Wu(e){this.Qu=e}Xu(e){let t=e+1e3*this.Gu;return Math.max(t-new Date().valueOf(),0)}Yu(e){let t=new Date().valueOf()-e,n=e==null||isNaN(t)||this.sn==null||t<this.sn;return n||s.j.info(`Trigger action ${this.type} is no longer eligible for display - fired ${t}ms ago and has a timeout of ${this.sn}ms.`),!n}static fromJson(t){let n=t.id,r=[];for(let e=0;e<t.trigger_condition.length;e++)r.push(q.fromJson(t.trigger_condition[e]));let i=v(t.start_time),a=v(t.end_time),o=t.priority,s=t.type,c=t.delay,u=t.re_eligibility,d=t.timeout,f=t.data,p=t.min_seconds_since_last_trigger;return l(e.Wr,s,`Could not construct Trigger from server data`,`Trigger.Types`)?new e(n,r,i,a,o,s,f,c,u,d,p):null}ss(){let e=[];for(let t=0;t<this.Vu.length;t++)e.push(this.Vu[t].ss());return{i:this.id,c:e,s:this.startTime,e:this.endTime,p:this.priority,t:this.type,da:this.data,d:this.Gu,r:this.Ku,tm:this.sn,ss:this.Ou,ld:this.Qu}}static Yn(t){let n=[],r=t.c||[];for(let e=0;e<r.length;e++)n.push(q.Yn(r[e]));return new e(t.i,n,b(t.s),b(t.e),t.p,t.t,t.da,t.d,t.r,t.tm,t.ss,t.ld)}};J.Wr={Vr:`inapp`,Zu:`templated_iam`},J.Ju=-1;var gt={PORTRAIT:0,LANDSCAPE:1};function _t(){return screen.width<=600}function vt(){if(`orientation`in window)return Math.abs(window.orientation)===90||window.orientation===270?gt.LANDSCAPE:gt.PORTRAIT;let e=window;if(`screen`in e){let t=e.screen.orientation||screen.mozOrientation||screen.msOrientation;return typeof t==`object`&&t&&(t=t.type),t===`landscape-primary`||t===`landscape-secondary`?gt.LANDSCAPE:gt.PORTRAIT}return gt.PORTRAIT}function yt(e,t,n){e&&(t||n!=null&&n.metaKey?window.open(e):window.location=e)}function bt(){return window.location.href}var xt={openUri:yt,ao:_t,mo:vt,Cn:bt};function St(e){e??=``;let t=e.split(`?`).slice(1).join(`?`),n={};if(t!=null){let e=t.split(`&`);for(let t=0;t<e.length;t++){let r=e[t].split(`=`);r[0]!==``&&(n[r[0]]=r[1])}}return n}function Ct(e){return!(!e||(e=e.toString().toLowerCase()).lastIndexOf(`javascript:`,0)!==0&&e.lastIndexOf(`data:`,0)!==0)}var wt=class{constructor(e,t,n,r){this.gt=e,this._e=t,this.u=n,this.ft=r,this.gt=e,this._e=t,this.u=n,this.ft=r,this.Ve=new D,Q.jt(this.Ve),this.We=1e3,this.Xe=6e4,this.Ye=null}Ze(){return this.Ve}_i(e){return this.Ve.lt(e)}Pi(){return this.Ye}Oi(e){this.Ye=e}Ji(e,t){if(!e||!l(G.Ie,t,`${t} is not a valid in-app message display failure`,`InAppMessage.Dis
2playFailures`))return new Ie;let n={trigger_ids:[e],error_code:t};return $.N(s.q.Ki,n)}N(e,t,n,r){let i=new Ie,a;if(e instanceof He)a={trigger_ids:[e.triggerId]};else{if(t===s.q.Li||e instanceof tt&&t===s.q.Qi){if(!e.p(r))return s.j.info(`This in-app message has already received a click. Ignoring analytics event.`),i}else if(t===s.q.Vi&&!e.M())return s.j.info(`This in-app message has already received an impression. Ignoring analytics event.`),i;a=this.Wi(e)}return a==null?i:(n!=null&&(a.bid=n),$.N(t,a))}Xi(e,t){let n=new Ie;if(!e.p())return s.j.info(`This in-app message button has already received a click. Ignoring analytics event.`),n;let r=this.Wi(t);return r==null?n:e.id===nt.Yi?(s.j.info(`This in-app message button does not have a tracking id. Not logging event to Braze servers.`),n):(e.id!=null&&(r.bid=e.id),$.N(s.q.Qi,r))}Zi(e){let t=e.messageFields;return t!=null&&t.is_push_primer||!1}Mr(e){if(!(e instanceof G))return;let t=e=>{if(!e)return;let t=ie(e);return oe(t)?re(ne._r,`In-App Message`):se(t)&&!W.Gr()?re(ne.Or,`In-App Message`):void 0};if(this.Zi(e)&&!W.Gr())return`In-App Message contains a push prompt, but is not eligible for a push prompt. Ignoring.`;let n=e.buttons||[],r;for(let e of n)if(e.clickAction===G.ClickAction.URI&&e.uri&&fe.test(e.uri)&&(r=t(e.uri),r))return r;return e.clickAction===G.ClickAction.URI&&e.uri&&fe.test(e.uri)?t(e.uri):void 0}Hr(e,t,n,r){if(!this.gt)return;let i=this.gt.Jr(!1,!1),a=this.gt.Bs(i);a.template={trigger_id:e.triggerId,trigger_event_type:t},n!=null&&(a.template.data=n.Kr());let o=this.gt.Hs(a,U.Os.Lr);this.gt.Qs(a,()=>{this.gt&&(U.Ws(this.u,U.Os.Lr,new Date().valueOf()),Ne.Xs({url:`${this.gt.Ys()}/template/`,data:a,headers:o,O:t=>{if(U.si(this.u,U.Os.Lr,1),!this.gt.Zs(a,t,o))return this.Ji(e.triggerId,G.Ie.Qr),void(typeof e.Ur==`function`&&e.Ur());if(this.gt.ti(),t==null||t.templated_message==null)return void this.Ji(e.triggerId,G.Ie.Qr);let n=t.templated_message;if(n.type!==J.Wr.Vr)return void this.Ji(e.triggerId,G.Ie.Xr);let r=ot(n.data);if(r==null)return void this.Ji(e.triggerId,G.Ie.Xr);let i=this.Mr(r);if(i)return s.j.error(i),void(typeof e.Ur==`function`&&e.Ur());typeof e.Yr==`function`?e.Yr(r):this.Ji(e.triggerId,G.Ie.Qr)},error:i=>{let a=`getting user personalization for message ${e.triggerId}`;if(new Date().valueOf()-e.Zr>e.sn)this.Ji(e.triggerId,G.Ie.Qr);else{U.hi(this.u,U.Os.Lr);let i=Math.min(e.sn,this.Xe),o=this.We;r??=o;let s=Math.min(i,Fe(o,3*r));a+=`. Retrying in ${s} ms`,setTimeout(()=>{this.Hr(e,t,n,s)},s)}this.gt.ii(i,a)}}))})}Wi(e){if(e.triggerId==null)return s.j.info(`The in-app message has no analytics id. Not logging event to Braze servers.`),null;let t={};return e.triggerId!=null&&(t.trigger_ids=[e.triggerId]),t}he(e){return!!this.u&&!(!(e&&e instanceof G&&e.constructor!==G)||e instanceof He)&&this.u.D(B.k.rn,e.ss())}Re(){if(!this.u)return null;let e=this.u.v(B.k.rn);if(!e)return null;let t;switch(e.type){case G.qe.on:t=rt.an(e);break;case G.qe.ln:case G.qe.Ee:case G.qe.Ue:t=tt.an(e);break;case G.qe.un:case G.qe.Se:t=it.an(e);break;case G.qe.pn:t=at.an(e)}return t&&this.mn(),t}mn(){this.u&&this.u.ni(B.k.rn)}},Y={i:null,t:!1,m:()=>(Y.o(),Y.i||=new wt(Q.ar(),Q.aa(),Q.l(),Q.ir()),Y.i),o:()=>{Y.t||=(Q.g(Y),!0)},destroy:()=>{Y.i=null,Y.t=!1}},Tt=class e{constructor(e,t,n,r,i){this.triggerId=e,this.Yr=t,this.Ur=n,this.Zr=r,this.sn=i,this.triggerId=e,this.Yr=t,this.Ur=n,this.Zr=r,this.sn=i}static fromJson(t,n,r,i,a){return t==null||t.trigger_id==null?null:new e(t.trigger_id,n,r,i,a)}},Et=class extends De{constructor(e,t,n,r,i){super(),this.tg=e,this.yt=t,this.u=n,this.ki=r,this.ig=i,this.tg=e,this.yt=t,this.u=n,this.ki=r,this.ig=i,this.sg=[],this.eg=[],this.hg=null,this.ng={},this.og={},this.triggers=[],this.ag=0,this.lg(),this.gg()}fg(){if(this.u){this.hg=this.u.v(B.k.iE)||this.hg,this.ng=this.u.v(B.k.aE)||this.ng,this.og=this.u.v(B.k.nE)||this.og;for(let e=0;e<this.triggers.length;e++){let t=this.triggers[e];t.id&&this.og[t.id]!=null&&t.Wu(this.og[t.id])}}}lg(){if(!this.u)return;this.ag=this.u.v(B.k.oE)||0;let e=this.u.v(B.k.rE)||[],t=[];for(let n=0;n<e.length;n++)t.push(J.Yn(e[n]));this.triggers=t,this.fg()}gg(){let e=this,t=function(t,n,r,i,a){return function(){e.cg(t,n,r,i,a)}},n={};for(let e of this.triggers)e.id&&(n[e.id]=e);let r=!1;for(let e=0;e<this.triggers.length;e++){let i=this.triggers[e];if(i.id&&this.ng[i.id]!=null){let e=this.ng[i.id],a=[];for(let r=0;r<e.length;r++){let o=e[r],s=i.Xu(o.Zr||0);if(s>0){let e,r;a.push(o),o.ug!=null&&(e=o.ug),o.dg!=null&&O.TE(o.dg)&&(r=O.Yn(o.dg));let c=[];if(o.pg&&u(o.pg))for(let e=0;e<o.pg.length;e++){let t=n[o.pg[e]];t!=null&&c.push(t)}this.eg.push(window.setTimeout(t(i,o.Zr||0,e,r,c),s))}}this.ng[i.id].length>a.length&&(this.ng[i.id]=a,r=!0,this.ng[i.id].length===0&&delete this.ng[i.id])}}r&&this.u&&this.u.D(B.k.aE,this.ng)}mg(){if(!this.u)return;let e=[];for(let t=0;t<this.triggers.length;t++)e.push(this.triggers[t].ss());this.ag=new Date().valueOf(),this.u.D(B.k.rE,e),this.u.D(B.k.oE,this.ag)}bg(){this.u&&((this.u.v(B.k.oE)||0)>this.ag?this.lg():this.fg())}Ts(e){let t=!1;if(e!=null&&e.triggers){this.ig.mn(),this.fg();let n={},r={};this.triggers=[];for(let i=0;i<e.triggers.length;i++){let a=J.fromJson(e.triggers[i]);if(a){a.id&&this.og[a.id]!=null&&(a.Wu(this.og[a.id]),n[a.id]=this.og[a.id]),a.id&&this.ng[a.id]!=null&&(r[a.id]=this.ng[a.id]);for(let e=0;e<a.Vu.length;e++)if(a.Vu[e].ec(K.zs,null)){t=!0;break}this.triggers.push(a)}}h(this.og,n)||(this.og=n,this.u&&this.u.D(B.k.nE,this.og)),h(this.ng,r)||(this.ng=r,this.u&&this.u.D(B.k.aE,this.ng)),this.mg(),t&&(s.j.info(`Trigger with test c
2ondition found, firing test.`),this.be(K.zs)),this.be(K.OPEN);let i=this.sg,a;this.sg=[];for(let e=0;e<i.length;e++)a=Array.prototype.slice.call(i[e]),this.be(...a)}}cg(e,t,n,r,i){let a=r=>{this.fg();let i=new Date().valueOf();if(!e.Yu(t))return!1===navigator.onLine&&e.type===J.Wr.Vr&&r.imageUrl?(s.j.info(`Not showing ${e.type} trigger action ${e.id} due to offline state.`),void this.ig.Ji(e.id,G.Ie.Uh)):void(e.Uu(i)&&this.wg(e,i,n)?this.yt.tc()===0?s.j.info(`Not displaying trigger ${e.id} because neither automaticallyShowInAppMessages() nor subscribeToInAppMessage() were called.`):(this.yt.Et([r]),this.yg(e,i)):s.j.info(`Not displaying trigger ${e.id} because display time fell outside of the acceptable time window.`));e.type===J.Wr.Zu?this.ig.Ji(e.id,G.Ie.Qr):this.ig.Ji(e.id,G.Ie.bh)},o=()=>{this.fg();let a=i.pop();if(a!=null)if(this.Tg(a,t,n,r,i),a.Yu(t)){let e=`Server aborted in-app message display, but the timeout on fallback trigger ${a.id} has already elapsed.`;i.length>0&&(e+=` Continuing to fall back.`),s.j.info(e),this.ig.Ji(a.id,G.Ie.bh),o()}else{s.j.info(`Server aborted in-app message display. Falling back to lower priority ${a.type} trigger action ${e.id}.`);let o=1e3*a.Gu-(new Date().valueOf()-t);o>0?this.eg.push(window.setTimeout(()=>{this.cg(a,t,n,r,i)},o)):this.cg(a,t,n,r,i)}},c,l,u;switch(e.type){case J.Wr.Vr:if(c=ot(e.data),c==null){s.j.error(`Could not parse trigger data for trigger ${e.id}, ignoring.`),this.ig.Ji(e.id,G.Ie.Xr);break}if(l=this.ig.Mr(c),l){s.j.error(l),o();break}a(c);break;case J.Wr.Zu:if(u=Tt.fromJson(e.data,a,o,t,e.sn||0),u==null){s.j.error(`Could not parse trigger data for trigger ${e.id}, ignoring.`),this.ig.Ji(e.id,G.Ie.Xr);break}this.ig.Hr(u,n,r);break;default:s.j.error(`Trigger ${e.id} was of unexpected type ${e.type}, ignoring.`),this.ig.Ji(e.id,G.Ie.Xr)}}be(e,t=null,n){if(!l(K,e,`Cannot fire trigger action.`,`TriggerEvents`))return;if(this.ki&&this.ki.Du())return s.j.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(),i=r-(this.hg||0),a=!0,o=!0,c=[];for(let n=0;n<this.triggers.length;n++){let i=this.triggers[n],s=r+1e3*i.Gu;if(i.Uu(s)&&(i.startTime==null||i.startTime.valueOf()<=r)&&(i.endTime==null||i.endTime.valueOf()>=r)){let n=!1;for(let r=0;r<i.Vu.length;r++)if(i.Vu[r].ec(e,t)){n=!0;break}n&&(a=!1,this.wg(i,s,e)&&(o=!1,c.push(i)))}}if(a)return void s.j.info(`Trigger event ${e} did not match any trigger conditions.`);if(o)return void s.j.info(`Ignoring ${e} trigger event because a trigger was displayed ${i/1e3}s ago.`);c.sort((e,t)=>e.priority-t.priority);let u=c.pop();u!=null&&(s.j.info(`Firing ${u.type} trigger action ${u.id} from trigger event ${e}.`),this.Tg(u,r,e,n,c),u.Gu===0?this.cg(u,r,e,n,c):this.eg.push(window.setTimeout(()=>{this.cg(u,r,e,n,c)},1e3*u.Gu)))}changeUser(e=!1){if(this.triggers=[],this.u&&this.u.ni(B.k.rE),!e){this.sg=[],this.hg=null,this.og={},this.ng={};for(let e=0;e<this.eg.length;e++)clearTimeout(this.eg[e]);this.eg=[],this.u&&(this.u.ni(B.k.iE),this.u.ni(B.k.nE),this.u.ni(B.k.aE))}}clearData(){this.triggers=[],this.hg=null,this.og={},this.ng={};for(let e=0;e<this.eg.length;e++)clearTimeout(this.eg[e]);this.eg=[]}wg(e,t,n){if(this.hg==null)return!0;if(n===K.zs)return s.j.info(`Ignoring minimum interval between trigger because it is a test type.`),!0;let r=e.Ou;return r??=this.tg,t-this.hg>=1e3*r}Tg(e,t,n,r,i){this.fg(),e.id&&(this.ng[e.id]=this.ng[e.id]||[]);let a={},o;a.Zr=t,a.ug=n,r!=null&&(o=r.ss()),a.dg=o;let s=[];for(let e of i)e.id&&s.push(e.id);a.pg=s,e.id&&this.ng[e.id].push(a),this.u&&this.u.D(B.k.aE,this.ng)}yg(e,t){this.fg(),e.Wu(t),this.hg=t,e.id&&(this.og[e.id]=t),this.u&&(this.u.D(B.k.iE,t),this.u.D(B.k.nE,this.og))}},X={t:!1,provider:null,er:()=>(X.o(),X.provider||X.rg(),X.provider),rg:()=>{X.provider||(X.provider=new Et(Q.nn(Z.No)??30,Y.m().Ze(),Q.l(),Q.cr(),Y.m()),Q.dr(X.provider))},o:()=>{X.t||=(X.rg(),Q.g(X),!0)},destroy:()=>{X.provider=null,X.t=!1}},Dt=class e{constructor(e,t,n,r,i){this.endpoint=e,this.Mn=t,this.publicKey=n,this.Vl=r,this.al=i,this.endpoint=e||null,this.Mn=t||null,this.publicKey=n||null,this.Vl=r||null,this.al=i||null}ss(){return{e:this.endpoint,c:this.Mn,p:this.publicKey,u:this.Vl,v:this.al}}static Yn(t){return new e(t.e,b(t.c),t.p,t.u,t.v)}},Ot=class{constructor(e,t){this.wt=e,this.u=t,this.wt=e,this.u=t}getUserId(){let e=this.u.tu(B.eu.su);if(e==null)return null;let t=e.iu,n=A(t);if(n>I.lr){for(;n>I.lr;)t=t.slice(0,t.length-1),n=A(t);e.iu=t,this.u.uu(B.eu.su,e)}return t}ru(e){let t=this.getUserId()==null;this.u.uu(B.eu.su,new k(e)),t&&this.u.ou(e)}setCustomUserAttribute(e,t){if(this.wt.hu(e))return s.j.info(`Custom Attribute "`+e+`" is blocklisted, ignoring.`),!1;let n={};return n[e]=t,this.nu(I.lu,n,!0)}nu(e,t,n=!1,r=!1){let i=this.u.mu(this.getUserId(),e,t),a=``,o=e,c=t;return n&&(a=` custom`,typeof t==`object`&&(o=Object.keys(t)[0],c=t[o
2],typeof c==`object`&&(c=JSON.stringify(c,null,2)))),!r&&i&&s.j.info(`Logged${a} attribute ${o} with value ${c}`),i}_n(e,t,n,r,i){this.nu(`push_token`,e,!1,!0),this.nu(`custom_push_public_key`,n,!1,!0),this.nu(`custom_push_user_auth`,r,!1,!0),this.nu(`custom_push_vapid_public_key`,i,!1,!0);let a=s.zt.Ft,o=new s.xt(a,s.j),c=new Dt(e,t,n,r,i);this.u.D(B.k.Bn,c.ss()),o.setItem(a.Jt.cu,a.ie,!0)}Nn(e){if(this.nu(`push_token`,null,!1,!0),this.nu(`custom_push_public_key`,null,!1,!0),this.nu(`custom_push_user_auth`,null,!1,!0),this.nu(`custom_push_vapid_public_key`,null,!1,!0),e){let e=s.zt.Ft,t=new s.xt(e,s.j);this.u.D(B.k.Bn,!1),t.setItem(e.Jt.cu,e.ie,!1)}}},Z={ho:`allowCrawlerActivity`,Eo:`baseUrl`,_o:`noCookies`,Io:`devicePropertyAllowlist`,Aa:`disablePushTokenMaintenance`,Ao:`enableLogging`,So:`enableSdkAuthentication`,qa:`manageServiceWorkerExternally`,No:`minimumIntervalBetweenTriggerActionsInSeconds`,wo:`sessionTimeoutInSeconds`,Oo:`appVersion`,Po:`appVersionNumber`,_a:`serviceWorkerLocation`,ka:`safariWebsitePushId`,Ba:`localization`,po:`contentSecurityNonce`,Ro:`enableHtmlInAppMessages`,Co:`allowUserSuppliedJavascript`,lo:`inAppMessageZIndex`,fo:`openInAppMessagesInNewTab`,tn:`openCardsInNewTab`,en:`openNewsFeedCardsInNewTab`,mh:`requireExplicitInAppMessageDismissal`,Lo:`doNotLoadFontAwesome`,Mo:`sdkFlavor`},Q=new class{constructor(){this.cn=``,this.jo=``,this.Do=void 0,this.Uo=null,this.fn=null,this.gt=null,this.ki=null,this.wt=null,this._e=null,this.u=null,this.ft=null,this.Bo=``,this.Wo=!1,this.zo=!1,this.Vo=new D,this.Go=new D,this.options={},this.Ko=[],this.Ho=[],this.Ve=[],this.jo=`4.10.2`}$o(e){this.Vo.lt(e)}Rh(e){this.Go.lt(e)}initialize(t,n){if(this.fe())return s.j.info(`Braze has already been initialized with an API key.`),!0;this.options=n||{};let r=this.nn(Z.Ao),i=St(xt.Cn());if(i&&i.brazeLogging===`true`&&(r=!0),s.j.init(r),s.j.info(`Initialization Options: ${JSON.stringify(this.options,null,2)}`),t==null||t===``||typeof t!=`string`)return s.j.error(`Braze requires a valid API key to be initialized.`),!1;this.cn=t;let a=this.nn(Z.Eo);if(a==null||a===``||typeof a!=`string`)return s.j.error(`Braze requires a valid baseUrl to be initialized.`),!1;!1===/^https?:/.test(a)&&(a=`https://${a}`);let o=a;if(a=document.createElement(`a`),a.href=o,a.pathname===`/`&&(a=`${a}api/v3`),this.Bo=a.toString(),z.qo&&!this.nn(Z.ho))return s.j.info(`Ignoring activity from crawler bot `+navigator.userAgent),this.zo=!0,!1;let d=this.nn(Z._o)||!1;if(this.u=Ve.xo(t,d),d&&this.u.Jo(t),new V.ee(null,!0).jr(B.re))return s.j.info(`Ignoring all activity due to previous opt out`),this.zo=!0,!1;for(let e of m(this.options))c(s.Yo).indexOf(e)===-1&&s.j.warn(`Ignoring unknown initialization option '${e}'.`);let f=[`mparticle`,`wordpress`,`tealium`];if(this.nn(Z.Mo)!=null){let e=this.nn(Z.Mo);f.indexOf(e)===-1?s.j.error(`Invalid sdk flavor passed: `+e):this.Do=e}let p=this.nn(s.Yo.Io);if(p!=null)if(u(p)){let e=[];for(let t=0;t<p.length;t++)l(H,p[t],`devicePropertyAllowlist contained an invalid value.`,`DeviceProperties`)&&e.push(p[t]);p=e}else s.j.error(`devicePropertyAllowlist must be an array. Defaulting to all properties.`),p=null;this.fn=new ke(this.u,p),this.wt=new ze(this.u),this.ft=new Ot(this.wt,this.u),this._e=new Be(this.u,this.ft,this.wt,this.nn(Z.wo));let h=new D;return this.Uo=new Ee(this.u,this.nn(Z.So),h),this.jt(h),this.gt=new Me(this.fn,this.u,this.Uo,this.ft,this._e,this.wt,this.cn,this.Bo,this.jo,this.Do||``,this.nn(Z.Oo),this.nn(Z.Po)),this.ki=new Le(this.cn,this.Bo,this._e,this.fn,this.ft,this.wt,this.u,e=>{if(this.fe())for(let t of this.gr())t.Ts(e)},this.Uo,this.gt),this.ki.initialize(),s.j.info(`Initialized for the Braze backend at "${this.nn(Z.Eo)}" with API key "${this.cn}".`),this.nn(Z.Ro)!=null&&Ae(`enableHtmlInAppMessages`,`initialization option`,`allowUserSuppliedJavascript`),X.o(),this.wt.Ci(()=>{this.Wo&&this.wt&&this.wt.vi()&&e(()=>import(`./refresh-feature-flags-JvL3pLMs.js`).then(e=>{this.Wo&&(0,e.default)()}),[])}),this.ki.pr(()=>{this.Wo&&this.wt&&this.wt.vi()&&e(()=>import(`./refresh-feature-flags-JvL3pLMs.js`).then(e=>{this.Wo&&(0,e.default)(void 0,void 0,!0)}),[])}),this.Vo.Et(this.options),this.Wo=!0,!0}destroy(e){if(s.j.destroy(),this.fe()){this.Go.Et(),this.Go.removeAllSubscriptions();for(let e of this.Ko)e.destroy();this.Ko=[];for(let e of this.Ho)e.clearData(!1);this.Ho=[],this.removeAllSubscriptions(),this.Ve=[],this.ki!=null&&this.ki.destroy(),this.ki=null,this.Uo=null,this.fn=null,this.gt=null,this.wt=null,this._e=null,this.ft=null,this.options={},this.Do=void 0,this.Wo=!1,this.zo=!1,e&&(this.u=null)}}rr(){if(this.Xo())return!1;if(!this.fe())throw Error(E);return!0}Ma(){return this.cn}Sr(){return this.Uo}Ys(){return this.Bo}te(){return this.fn}ar(){return this.gt}nn(e){return this.options[e]}gr(){return this.Ho}cr(){return this.ki}tr(){return this.wt}aa(){return this._e}l(){return this.u}br(){if(this.ft&&this.ki)return new I(this.ft,this.ki)}ir(){return this.ft}nr(){return!0===this.nn(Z.Co)||!0===this.nn(Z.Ro)}g(e){let t=!1;for(let n of this.Ko)n===e&&(t=!0);t||this.Ko.push(e)}dr(e){let t=!1;for(let n of this.Ho)n.constructor===e.constructor&&(t=!0);e instanceof De&&!t&&this.Ho.push(e)}jt(e){e instanceof D&&this.Ve.push(e)}removeAllSubscriptions(){if(this.rr())for(let e of this.Ve)e.removeAllSubscriptions()}removeSubscription(e){if(this.rr())for(let t of this.Ve)t.removeSubscription(e)}ne(e){this.zo=e}fe(){return this.Wo}Xo(){return this.zo}ks(){return this.jo}},$={N:(e,t,n)=>{let r=new Ie,i=Q.aa();if(!i)return s.j.info(`Not logging event with type "${e}" because the current session ID could not be found.`),r;let a=i.co();r.ve.push(new O(n||Q.ir()?.getUserId(),e,new Date().valueOf(),a,t));let o=Q.l();return o&&(r.O=o.bo(r.ve)),r}};export{P as A,E as B,B as C,fe as D,I as E,ie as F,b as G,C as H,re as I,h as J,p as K,M as L,N as M,ne as N,be as O,oe as P,A as R,De as S,R as T,g as U,w as V,v as W,s as Y,Ie as _,X as a,Pe as b,
2K as c,qe as d,Ye as f,W as g,Je as h,Dt as i,F as j,_e as k,$e as l,Ze as m,Z as n,Ct as o,Qe as p,u as q,Q as r,xt as s,$ as t,Ge as u,Fe as v,z as w,U as x,Ne as y,D as z}; 3//# sourceMappingURL=event-logger-C6mrs14a.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.