1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_astro/brazeService.DHPRW1rA.js","_astro/resolve.B3WuOKFk.js","_astro/index.DVwZf235.js","_astro/preload-helper.BlTxHScW.js","_astro/brazeStore.CF2_g0Q7.js","_astro/index.CDAgpjSw.js"])))=>i.map(i=>d[i]); 2import{_ as f}from"./preload-helper.BlTxHScW.js";import{getAuth as c,getSessionMigration as p}from"./index.DbIBqvaw.js";import{l as n}from"./index.DVwZf235.js";import{s as a}from"./userStore.fsk2SzIk.js";import{g}from"./getScreenSize.CnXIUdNe.js";import{a as u}from"./index.CbUm5JID.js";import{g as y}from"./ClipClubTansstackClient.-B4jvXLC.js";import{U as d}from"./UserEventType.Baa6S0_b.js";import"./resolve.B3WuOKFk.js";import"./index.CDAgpjSw.js";import"./customMedia.TddthWa7.js";import"./subidTransformer.D67TlOXC.js";import"./isExternal.pyCLhaOv.js";import"./getFeatureFlagClient.CFsM0M_T.js";import"./utc.D8ANpP3u.js";import"./_commonjsHelpers.D6-XlEtG.js";import"./index.DBbMZl2G.js";import"./index.DdhaQPQ0.js";import"./impressions.model.D7dMMwUg.js";import"./impressionsStore.C0MRAWlD.js";import"./v4.BKrj-4V8.js";import"./queryClient.DJMADRCh.js";let r=!1;const S=async e=>{if(e){const{brazeLogin:t}=await f(async()=>{const{brazeLogin:s}=await import("./brazeService.DHPRW1rA.js").then(i=>i.a0);return{brazeLogin:s}},__vite__mapDeps([0,1,2,3,4,5]));t(e.profileId),a(e),u.connect(e,g()),r=e.isAnonymous===!1}else{const t=y();t.removeQueries({queryKey:["user","brands"]}),t.removeQueries({queryKey:["user","wallet"]}),a(null),r&&u.disconnect(),r=!1;const i=await(await c()).signInAnonymously();i.isSuccessful||n.error("failed to sign in anonymously",i.error)}},x=async e=>{e.type===d.AUTH_CHANGED&&await S(e.user),a(e.user)},G=async()=>{const e=await c();if(!(await e.validateAndRenewSession()).isSuccessful){const s=await p(),i=await s.isSessionMigrationNeeded();let l=!0;if(i){const o=await s.migrateSession();o.isSuccessful||n.error("failed to migrate session",{error:o.error}),l=!o.isSuccessful}if(!l)return;const m=await e.signInAnonymously();m.isSuccessful||n.error("failed to sign in anonymously",{error:m.error})}};export{G as establishSession,S as handleAuthState,x as handleUserChanged};
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.