1import{r as e}from"./DAXXjFlN.chunk.js";import{r as t}from"./BftnFbcr.chunk.js";import"./DFZS3Ffo.chunk.js";import{n,t as r}from"./BFXddaSP.chunk.js";import{n as i}from"./CsF4wDV1.chunk.js";import{r as a}from"./DlEtkSBj2.chunk.js";import{t as o}from"./CUBiptKh.chunk.js";import{t as s}from"./D1UCk2Gf.chunk.js";var c=o(),l={getInstanceRegion(e,t){return e.instanceRegion?e.instanceRegion:s.getInstanceRegion(t?.countryCode)},BRAZE_CLIENT_SOURCE:`cv_product_braze_client_service`},u=e({BrazeClientService:()=>f,BrazeNewIamEvent:()=>d}),d=`braze:new:iam`,f=class extends t{get name(){return i.BrazeClient}get channelName(){return a.BRAZE}get clientInstance(){if(this.ready)return this.brazeClient}constructor(e){super(e)}initialize(){this.options.eventOptions?.logUtmParameters&&(this.utmParameters=r.getUtmParameters()),this.options.eventOptions?.logAttributionData&&(this.attributionData=n.getDecodedAttributionData()),this.setup()}get isReady(){return this.ready&&this.options.client.shouldInitialize}setup(){let{context:e}=this.options;if(this.iamQueue=[],this.brazeClient=new c.BrazeClient({apiOptions:this.getInstanceOptions(),allowAnonymous:!1,shouldInitialize:this.options.client.shouldInitialize,subscriptions:{subscribeToInAppMessage:e=>this.subscribeToInAppMessage(e)}}),e.user.isAuthenticated&&this.options.client.shouldInitialize){let t=this.getBrazeUser(e.user);this.options.geoLocation?.countryCode&&(t.country=this.options.geoLocation.countryCode),this.setUser(t)}this.ready=!0}setUser(e){this.brazeClient.setUser(e)}setUserInit(e){this.brazeClient.setUserInit(e)}getBrazeUser(e){return{email:e.email,firstName:e.givenName,lastName:e.familyName,custom:{masterId:e.id,source:l.BRAZE_CLIENT_SOURCE}}}getInstanceOptions(){return{productName:this.options.client.productName,productVersion:this.options.client.version,apiKey:this.options.client.apiKey,baseUrl:this.options.client.baseUrl,enableLogging:!1,automaticallyShowInAppMessages:!1,allowUserSuppliedJavascript:!0}}subscribeToInAppMessage(e){if(!this.options?.subscriptions?.inAppMessage||e.isControl)return;let t=this.getChannel();this.iamQueue.push(e),t.trigger(d)}async getContentCards(){return await this.brazeClient.card?.getContentCards()}logContentCardDismissal(e){return this.brazeClient.card?.logDismissal(e)}logContentCardClick(e){return this.brazeClient.card?.logClick(e)}logContentCardImpressions(e){return this.brazeClient.card?.logImpressions(e)}logFormEvent(e){let t=this.hydrateAdditionalData(e);this.brazeClient.event.logForm(t)}logAnalyticsEvent(e){let t=this.hydrateAdditionalData(e);this.brazeClient.event.logAnalytics(t)}logEvent(e){let t=this.hydrateAdditionalData(e);return this.brazeClient.event.log(t)}showInAppMessage(e,t,n){return this.brazeClient.bam.show(e,t,n)}handleInAppMessages(e){if(this.iamQueue.length)for(;this.iamQueue.length;){let t=this.iamQueue.pop();if(!t)return;e(t)}}hydrateAdditionalData(e){let t=e.additionalData||{};return this.utmParameters&&(t.utms=this.utmParameters),this.attributionData?.originalReferrer&&(t.original_referrer=this.attributionData.originalReferrer),this.attributionData?.internalReferrer&&(t.internal_referrer=this.attributionData.internalReferrer),{...e,additionalData:t}}};export{d as n,l as r,u as t}; 2//# sourceMappingURL=CduyscTN.chunk.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.