PageSourceSearch

https://www.bowflex.com/cdn/shop/t/6/assets/bfx-exit-intent.js?v=104372342994642478291787190131

js bowflex.com collected 2026-09-24 17:58:49 UTC 4,369 bytes, 2 lines download raw bytes

1import{logCustomEventOrThrow,sendToBraze}from"util.braze";const market=document.body.dataset.market||"",EVENT_NAME="exit_intent",INACTIVITY_MS=6e4,root=()=>window.Shopify?.routes?.root||"/",getCart=()=>fetch(`${root()}cart.js`,{headers:{"X-Requested-With":"XMLHttpRequest"}}).then(r=>{if(!r.ok)throw new Error(`cart.js responded with ${r.status}`);return r.json()}),restorableItems=cart=>cart.items.filter(item=>!item.properties?._parent_sku&&!item.properties?.__shopify_send_gift_card_to_recipient&&!item.selling_plan_allocation),buildCartPermalink=items=>{if(items.length===0)return null;const variantPairs=items.map(item=>`${item.variant_id}:${item.quantity}`).join(",");return`${window.location.origin}${root()}cart/${variantPairs}?storefront=true`},isAccountPath=pathname=>{const accountPrefix=`${root()}account`;return pathname===accountPrefix||pathname.startsWith(`${accountPrefix}/`)},buildSource=()=>{const{origin,pathname}=window.location;return isAccountPath(pathname)?origin:`${origin}${pathname}`},centsToDollars=cents=>cents/100,buildPayload=cart=>{if(!cart||!Array.isArray(cart.items)||cart.items.length===0)return null;const items=restorableItems(cart);if(items.length===0)return null;const totalValueCents=items.reduce((sum,item)=>sum+item.final_line_price,0),originalTotalPriceCents=items.reduce((sum,item)=>sum+item.original_line_price,0);return{currency:cart.currency,total_value:centsToDollars(totalValueCents),original_total_price:centsToDollars(originalTotalPriceCents),products:items.map(item=>({product_id:item.product_id,sku:item.sku,product_name:item.product_title,quantity:item.quantity,price:centsToDollars(item.price),discounted_price:centsToDollars(item.discounted_price)})),source:buildSource(),cart_permalink:buildCartPermalink(items)}},controller=new AbortController;let fired=!1,pending=!1,inactivityTimerId=null,mobileIntervalId=null;const teardown=()=>{controller.abort(),inactivityTimerId&&window.clearTimeout(inactivityTimerId),mobileIntervalId&&window.clearInterval(mobileIntervalId)},sendExitIntentEvent=payload=>sendToBraze(()=>logCustomEventOrThrow(EVENT_NAME,payload),`bfx-exit-intent: ${EVENT_NAME}`,"bfx-exit-intent"),stayArmed=()=>{pending=!1,resetInactivityTimer(),resetMobileGesture()},fireExitIntent=()=>{fired||pending||(pending=!0,getCart().then(async cart=>{const payload=buildPayload(cart);if(!payload){stayArmed();return}await sendExitIntentEvent(payload)?(fired=!0,teardown()):stayArmed()}).catch(error=>{console.error("bfx-exit-intent: failed to load cart",error),stayArmed()}))},resetInactivityTimer=()=>{inactivityTimerId&&window.clearTimeout(inactivityTimerId),inactivityTimerId=window.setTimeout(fireExitIntent,INACTIVITY_MS)},setupInactivityTimer=()=>{const{signal}=controller;document.addEventListener("mousemove",resetInactivityTimer,{signal}),document.addEventListener("mousedown",resetInactivityTimer,{signal}),document.addEventListener("keypress",resetInactivityTimer,{signal}),document.addEventListener("touchmove",resetInactivityTimer,{signal,passive:!0}),resetInactivityTimer()},setupDesktopExitIntent=()=>{document.addEventListener("mouseleave",event=>{typeof event.clientY=="number"&&event.clientY<0&&fireExitIntent()},{signal:controller.signal})},isMobileOrTablet=()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobi/i.test(navigator.userAgent||"");let mobileDownThresholdReached=!1,mobileDownStartY=0,mobileUpStartY=0;const resetMobileGesture=()=>{mobileDownThresholdReached=!1,mobileDownStartY=window.pageYOffset||document.documentElement.scrollTop||0,mobileUpStartY=0},setupMobileExitIntent=()=>{resetMobileGesture(),mobileIntervalId=window.setInterval(()=>{const y=window.pageYOffset||document.documentElement.scrollTop||0,pageHeight=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight);pageHeight&&(mobileDownThresholdReached?Math.max(0,mobileUpStartY-y)/pageHeight>=.2&&fireExitIntent():Math.max(0,y-mobileDownStartY)/pageHeight>=.5&&(mobileDownThresholdReached=!0,mobileUpStartY=y))},1e3)},run=()=>{setupInactivityTimer(),isMobileOrTablet()?setupMobileExitIntent():setupDesktopExitIntent
1()},init=()=>{market==="us"&&(document.readyState!=="loading"?run():document.addEventListener("DOMContentLoaded",run,{once:!0,signal:controller.signal}))};init();
2//# sourceMappingURL=/cdn/shop/t/6/assets/bfx-exit-intent.js.map?v=104372342994642478291787190131

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.