(function() { function bxBootstrap() { var re = /bot|crawl|slurp|spider|mediapartners|headlesschrome|snap-prefetch|remotasks|woorank|uptime\.com|facebookexternalhit|facebookcatalog/i; if (re.test(navigator.userAgent) || navigator.userAgent == '') { return; } if (!(window.bouncex&&bouncex.website)) { var pushedData = []; if(window.bouncex && bouncex.push && bouncex.length){ pushedData = bouncex; } window.bouncex = {}; bouncex.pushedData = pushedData; bouncex.website = {"id":4803,"name":"Men's Wearhouse","cookie_name":"bounceClientVisit4803","domain":"menswearhouse.com","ct":"multi_cookie","ally":0,"ei":0,"tcjs":"","cjs":"","force_https":false,"waypoints":false,"content_width":900,"gai":"UA-30527783-1","swids":"","sd":0,"ljq":"auto","campaign_id":0,"is_preview":false,"aco":{"first_party_limit":"3500","local_storage":"1"},"cmp":{"gdpr":0,"gmp":0,"whitelist_check":0},"burls":[],"ple":false,"fbe":true,"ffs":"","mas":2,"map":1,"gar":true,"ete":1,"ettm":false,"etjs":"/* ---------------------------- SHARED VARIABLES ---------------------------- */\n \nvar CLEAN_URL = bouncex.utils.url.allowParams();\n\n/* --------------------------------- HELPERS -------------------------------- */\n\nfunction getItemIdFromURL(url) {\n var cleanedUrl = bouncex.utils.url.allowParams([], url);\n\treturn cleanedUrl ? cleanedUrl.split('/TMW/').pop().slice(0,11) : '';\n}\n\nfunction getItemId() {\n return bouncex.utils.getNestedProp('bvDCC.catalogData.catalogProducts[0].productId', '') || (window.dataLayer.find(function (e) { return e.item_id }) || {}).item_id;\n}\n\nfunction getItemCopy() {\n var brand = jQuery('h2.MuiTypography-h2:not(#widget-title)').first().text().trim(),\n product = jQuery('h1.MuiTypography-h1').first().text().trim(),\n color = jQuery('input[name=\"Color\"]:checked').val() || '';\n return brand && product && color ? `${brand} ${product}, ${color}` : '';\n}\n\nfunction getItemCategory() {\n return jQuery('.MuiBreadcrumbs-ol .MuiBreadcrumbs-li:last').text().trim() || 'global';\n}\n\nfunction getItemPrice() {\n return jQuery('.product-total__price, .final-price:visible, .MuiGrid-container span:contains(\"$\")').first().text().replace(/[^0-9.]/g, '');\n}\n\nfunction getStockStatus() {\n var availability = jQuery('meta[itemprop=\"availability\"]').attr('content') || '';\n return bouncex.vars.in_stock || availability.indexOf('InStock') > -1;\n}\n\n/* we don't want to fire the same images multiple times */\nfunction trackStylitics(itemUrl) {\n var trackedImages = [];\n fireStyliticsEvents();\n\n function fireStyliticsEvents() {\n jQuery('.stylitics-main-image').each(function () {\n var rawImageUrl = jQuery(this).attr('data-src'),\n imageUrl = rawImageUrl ? bouncex.utils.url.allowParams([], rawImageUrl) : '';\n if (imageUrl && trackedImages.indexOf(imageUrl) < 0) {\n trackedImages.push(imageUrl);\n bouncex.push(['view_collection', {\n image_url: imageUrl,\n item_url: itemUrl\n }]);\n }\n });\n }\n\n bouncex.on(jQuery('.stylitics-next'), 'click.bxstylitics', function() {\n bouncex.setTimeout2(function () {\n fireStyliticsEvents();\n }, 1000);\n });\n}\n\nfunction getItemImage() {\n var imgSrc = bouncex.utils.url.allowParams([], jQuery('img[src*=\"pdp2\"], img[src*=\"/TMW/\"]').first().attr('src'));\n\n return imgSrc || jQuery('meta[property=\\'og:image\\']').attr('content');\n}\n\nfunction getStars() {\n var stars = jQuery('.bv_avgRating_component_container').first().text(),\n starsRounded = (Math.round(stars * 2) / 2).toFixed(1);\n\n return starsRounded < 4 ? 0 : parseFloat(starsRounded);\n}\n\nfunction getReviewsCount(stars) {\n var reviews = jQuery('.bv_numReviews_component_container').first().text().replace(/[^0-9]/g,'').trim() || 0;\n\n return stars < 4 ? 0 : reviews;\n}\n\nfunction getFeedId() {\n var prodArr = bouncex.utils.getNestedProp('__NEXT_DATA__.props.pageProps.productDetailData.data.skuData', []) || bouncex.parseJSON(jQuery('div#_BM_').attr('data-bm')).props.productDetailData.data.variantData,\n iLen = prodArr.length,\n checkedColor = jQuery('input[name=\"Color\"]:checked').val(),\n checkedSize = jQuery('label.selected-size.size-swetch:not(.length-swetch) input').val(),\n checkedLength = jQuery('label.selected-size.length-swetch input').val();\n\n /* Loop through the __NEXT_DATA__ object for item data matching the currently selected color. */\n for (var i=0; i < iLen; i++) {\n var prodArrColor = prodArr[i] && prodArr[i].swatchColor;\n\n /* If item data matches the currently selected color, continue */\n if (checkedColor === prodArrColor) {\n var attrArr = prodArr[i].defAttributes || [],\n jLen = attrArr.length,\n sizeInArr = '',\n lengthInArr = '';\n\n /* There are size and length data that is nested within another array. Loop through this array to find the item data that matches the selected size and length. */\n for (var j=0; j < jLen; j++) {\n var indexName = attrArr[j].name || '',\n indexValue = attrArr[j].values[0].name;\n\n if (indexName === 'Length' || indexName === 'Width') {\n lengthInArr = indexValue;\n } else if (indexName === 'Size' || indexName === 'Waist') {\n sizeInArr = indexValue;\n }\n }\n\n /* If the color, size, and length matches item data, return the feed id */\n if (checkedSize === sizeInArr && checkedLength === lengthInArr) {\n var feedId = prodArr[i].partNumber;\n return feedId;\n }\n }\n }\n}\n// https://wunderkindco.atlassian.net/browse/SOTEC-8568\n// We're removing the '#' and encoded '&' from the URL because UTMs are being dropped.\n// We're manually recreating the URL with color and width parameters.\n// The website automatically adds an additional color and width parameter to the URL if one is not included with '#' or '#26'.\nfunction getPDPUrl() {\n var url = bouncex.utils.url.allowParams(['color', 'width']).replace(/#/g, '?').replace(/%26/g, '&'),\n color = bouncex.utils.url.getParam('color', url).split('?').shift(),\n width = bouncex.utils.url.getParam('width', url).split('?').shift();\n\n color = color ? '?color=' + color : '';\n width = width ? '?width=' + width : '';\n return bouncex.utils.url.allowParams() + color + width;\n}\n/* ------------------------------ ITEM TRACKING ----------------------------- */\n\nfunction getItem() {\n var stars = getStars();\n\n return {\n id: getItemId(),\n copy: getItemCopy(),\n category: getItemCategory(),\n url: getPDPUrl(),\n imageurl: getItemImage(),\n price: getItemPrice(),\n instock: getStockStatus(),\n stars: stars,\n reviewscount: getReviewsCount(stars)\n };\n}\n\nfunction fireViewItem(itemId) {\n bouncex.push(['view item', {\n 'item:id': itemId,\n 'item:itemgroupid': itemId\n }]);\n bouncex.setv('last_viewed_item', itemId);\n}\n\nfunction isExcluded(item) {\n return item.url.indexOf('gift-card') > -1;\n}\n\nfunction initializeItemEvents() {\n var item;\n\n bouncex.et.onTrue(\n function() {\n item = getItem();\n return !!item.id &&\n !!item.copy &&\n !!item.category &&\n !!item.price &&\n !!item.url &&\n !!item.imageurl &&\n jQuery('.bv_ratings_summary').is(':visible');\n },\n function() {\n if (isExcluded(item)) {\n return;\n }\n\n bouncex.push(['item', item]);\n trackColorChange();\n fireViewItem(item.id);\n trackStylitics(item.url);\n },\n 10\n );\n}\n\nfunction trackColorChange() {\n\tbouncex.et.on(jQuery('.color-swetch,[data-color-sku],.color-swatch'), 'click.bxColorChange', function () {\n\t\t\tvar itemId;\n\t\t\tbouncex.et.onTrue(\n\t\t\t\tfunction () {\n\t\t\t\t\titemId = getItemId();\n\t\t\t\t\treturn itemId && itemId !== bouncex.vars.last_viewed_item;\n\t\t\t\t},\n\t\t\t\tfunction () {\n\t\t\t\t\tfireViewItem(itemId);\n\t\t\t\t},\n\t\t\t\t5\n\t\t\t);\n\t\t}\n\t);\n}\n/* ------------------------------ SKU TRACKING ------------------------------ */\n\nfunction initializeSkuEvents() {\n var itemId = '',\n prevSku = '',\n newSku = '';\n\n bouncex.et.on(\n jQuery(document),\n 'click.bxsku',\n function() {\n\n bouncex.setTimeout2(function(){\n itemId = getItemId();\n newSku = getFeedId() || prevSku;\n\n if (prevSku === newSku) {\n return;\n }\n\n prevSku = newSku;\n\n if(newSku){\n bouncex.push([\n 'select_sku',\n {\n 'item:id': itemId,\n 'item:itemgroupid': itemId,\n 'item:feedid': newSku\n }\n ]);\n }\n }, 500);\n },\n 'button[data-color-sku], div.sizes-wrap li, .size-swetch'\n );\n}\n\n/* ---------------------------- CATEGORY TRACKING --------------------------- */\n\nfunction getItemIdsCat() {\n var ids = [];\n\n jQuery('.product-img div[typeof=\"ImageObject\"] img').each(function (i, e) {\n var id = getItemIdFromURL(jQuery(e).attr('src'));\n\n if (id && ids.indexOf(id) < 0) {\n ids.push(id);\n }\n });\n\n return ids.join(',');\n}\n\nfunction getCategoryObject() {\n return {\n 'page:url': CLEAN_URL,\n 'items:ids': getItemIdsCat()\n };\n}\n\nfunction initializeCategoryEvents() {\n var categoryObj;\n\n bouncex.et.onTrue(\n function() {\n categoryObj = getCategoryObject();\n return !!categoryObj['items:ids'].length &&\n !!categoryObj['page:url'];\n },\n function() {\n bouncex.push(['view category', categoryObj]);\n },\n 10\n );\n}\n\n/* ------------------------------- QV EVENTS ------------------------------ */\n\nfunction initializeQVEvents(){\n bouncex.et.onVisible('.quickView-header', function() {\n isViewItemReady();\n\n var $colorSwatches = jQuery('.color-swetch input');\n bouncex.off($colorSwatches, 'click.qvcolors');\n bouncex.on($colorSwatches, 'click.qvcolors', function() {\n isViewItemReady();\n });\n });\n}\n\nfunction isViewItemReady() {\n var imageUrl = '',\n itemId = '';\n\n bouncex.et.onTrue(\n function() {\n imageUrl = jQuery('.MuiDrawer-paper .MuiAvatar-circular img').attr('src') || '';\n itemId = getItemIdFromURL(imageUrl);\n return !!imageUrl && !!itemId && itemId !== bouncex.vars.last_viewed_item;\n },\n function() {\n fireViewItem(itemId);\n }\n );\n}\n\n/* ------------------------------- CART EVENTS ------------------------------ */\n\nfunction fireAddToCart(itemId) {\n bouncex.push(['add to cart', { 'item:id': itemId}]);\n\n if (bouncex.vars.cart) {\n return;\n }\n\n bouncex.setv('cart', true);\n}\n\nfunction checkSizesAndATC() {\n if (bouncex.firingATC) { // debounce\n return;\n }\n\n var $pSize = jQuery('[name=PrimarySize]'),\n $sSize = jQuery('[name=SecondarySize]');\n\n var primarySizeSelected = $pSize.length ? $pSize.filter(':checked').length : 1,\n secondarySizeSelected = $sSize.length ? $sSize.filter(':checked').length : 1;\n if (!primarySizeSelected || !secondarySizeSelected) {\n return;\n }\n\n bouncex.firing = 1;\n\n var itemId = '';\n bouncex.et.onTrue(\n function() {\n itemId = bouncex.vars.last_viewed_item;\n return !!itemId;\n },\n function() {\n fireAddToCart(itemId);\n bouncex.setTimeout2(() => bouncex.firingATC = 0, 100);\n }\n );\n}\n\nfunction trackAddToCart() {\n bouncex.firingATC = 0;\n if (bouncex.website.pts === 'product') {\n bouncex.on(jQuery('button[class*=add-to-bag]'), 'click.wknd', checkSizesAndATC); // pdps have extra click handlers that prevent our delegation from delagating\n } else {\n bouncex.on(bouncex.body, 'click.wknd', checkSizesAndATC, 'button[class*=add-to-bag]');\n }\n}\n\nfunction emptyCart() {\n bouncex.et.onVarChange('cart_qty', function(oldVal, newVal) {\n if (bouncex.vars.cart && newVal === 0 && oldVal > 0) {\n bouncex.push(['empty_cart']);\n bouncex.setv('cart', false);\n }\n });\n}\n\nfunction initializeCartEvents() {\n bouncex.et.cart.init({\n replenish: function () { },\n replenishmentType: 'single'\n });\n\n trackAddToCart();\n emptyCart();\n}\n\n/* ------------------------------ USER TRACKING ----------------------------- */\n\nfunction getUserEmail() {\n return jQuery('input[name=\"logonIdOld\"], #sign-in-email').first().val() || jQuery('label:contains(\"Current email\")').parent().find('input').val() || '';\n}\n\nfunction initializeUserTracking() {\n var userEmail;\n\n if (!bouncex.vars.logged_in || !!bouncex.vars.logged_in_identified) {\n return;\n }\n\n userEmail = getUserEmail();\n\n if (!bouncex.utils.validate.email(userEmail)) {\n return;\n }\n\n bouncex.push([\n 'user',\n {\n 'email': userEmail,\n 'source': 'LoggedIn'\n }\n ]);\n bouncex.setv('logged_in_identified', true);\n}\n\n/* --------------------------- QUIZ SUPRESSION EVENT -------------------------- */\n/* WRIKE:https://www.wrike.com/open.htm?id=980652800 */\n\nfunction initializeQuizSuppression(){\n if (CLEAN_URL.indexOf('/mens-clothing-style-quiz') > -1){\n bouncex.push(['start_quiz']);\n }\n}\n\n/* --------------------------- INITIALIZE TRACKING -------------------------- */\n\nfunction isValidDomain() {\n return CLEAN_URL.indexOf('https://www.menswearhouse.com/') > -1;\n}\n\nfunction isEn() {\n return bouncex.html.attr('lang') === 'en';\n}\n\nfunction isValidForTracking() {\n return isValidDomain() && isEn();\n}\n\nfunction init() {\n if (!isValidForTracking()) {\n return;\n }\n\n initializeUserTracking();\n initializeCartEvents();\n initializeQVEvents();\n initializeQuizSuppression();\n\n switch(bouncex.website.pts) {\n case 'category':\n initializeCategoryEvents();\n break;\n case 'product':\n initializeItemEvents();\n initializeSkuEvents();\n break;\n default:\n break;\n }\n}\n\ninit();\n","dge":true,"bxidLoadFirst":false,"pie":true,"cme":true,"gbi_enabled":0,"bpush":false,"pt":{"cart":{"testmode":false,"val":[[{"activation":"js","prop":"","prop2":"","prop3":"","val":"document.querySelectorAll('body.js-shopping-cart-page').length > 0;"},{"activation":"current_page_url","prop":"contains","prop2":"","prop3":"","val":"/cart"}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"stage-mw.tmw.com/AjaxOrderItemDisplayView"}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"tst."}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"tst7."}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"localhost"}]]},"category":{"testmode":false,"val":[[{"activation":"current_page_url","prop":"contains","prop2":"","prop3":"","val":"/c/"}]]},"checkout":{"testmode":false,"val":[[{"activation":"js","prop":"","prop2":"","prop3":"","val":"document.querySelectorAll('body.l-checkout').length > 0;"},{"activation":"current_page_url","prop":"contains","prop2":"","prop3":"","val":"/checkout"}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"stage-mw.tmw.com/OrderShippingBillingView"}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"tst."}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"tst7."}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"localhost"}]]},"home":{"testmode":false,"val":[[{"activation":"js","prop":"","prop2":"","prop3":"","val":"window.location.pathname === '/';"}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"stage-mw.tmw.com"}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"mw.localhost.tmw.com"}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"tst."}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"tst7."}],[{"activation":"current_page_url","prop":"not_contains","prop2":"","prop3":"","val":"localhost"}]]},"product":{"testmode":false,"val":[[{"activation":"current_page_url","prop":"contains","prop2":"","prop3":"","val":"/p/"}]]},"search":{"testmode":false,"val":[[{"activation":"current_page_url","prop":"contains","prop2":"","prop3":"","val":"/SearchDisplay?searchTerm="},{"activation":"current_page_url","prop":"contains","prop2":"","prop3":"","val":"/search/"}]]}},"els":{"blank_site_element":"","checkout_top_inline":"section.main-section .bag-items"},"vars":[{"name":"logged_in","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"(function(){\n if (bouncex.website.pts === 'checkout') {\n return null;\n }\n\n return jQuery('#header-user-greeting:visible').length > 0 || bouncex.getBounceCookie('isLoggedIn') === 'true';\n})();\n","trigger":""},{"name":"ever_logged_in","polling":"all","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"bouncex.vars.logged_in || null;","trigger":""},{"name":"cart_qty","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"0","code":"(function(){\n var $cartQty = jQuery('a[aria-label=\"View Cart\"]');\n\n if ($cartQty.length > 0) {\n return Number($cartQty.text().replace(/^0-9/g, ''));\n }\n\n return null;\n})();","trigger":""},{"name":"cart_value","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"0","code":"(function() {\n var $cartQty = jQuery('a[aria-label=\"View Cart\"]'),\n $cartVal = jQuery('span:contains(\"Est. total\")').parent().find('span:contains(\"$\")').first() || jQuery('h4:contains(\"$\")').first();\n\n\n if ($cartQty.text().trim() === '0') {\n return 0;\n } else if ($cartVal.length > 0) {\n return Number($cartVal.text().replace(/[^0-9.]/g, '')) || null;\n } else if (bouncex.website.pts === 'cart') {\n return Number(jQuery('h4:contains(\"$\")').first().text().replace(/[^0-9.]/g, '')) || null;\n }\n \n return null;\n})();","trigger":""},{"name":"prod_price","polling":"all","persist":"no","page_types":["product"],"testmode":false,"default":"false","code":"(function() {\n var $finalPrice = jQuery('.product-total__price, .final-price'),\n $muiPrice = jQuery('.MuiGrid-container span:contains(\"$\")');\n return Number($finalPrice.first().text().replace(/[^0-9.]/g, '') || $muiPrice.first().text().replace(/[^0-9.]/g, ''));\n})();\n","trigger":""},{"name":"prod_name","polling":"all","persist":"no","page_types":["product"],"testmode":false,"default":"false","code":"(function() {\n var brand = jQuery('h2.MuiTypography-h2:not(#widget-title)').first().text().trim(),\n product = jQuery('h1.MuiTypography-h1').first().text().trim(),\n color = jQuery('input[name=\"Color\"]:checked').val() || '';\n return brand && product && color ? `${brand} ${product}, ${color}` : '';\n})();\n","trigger":""},{"name":"in_stock","polling":"all","persist":"no","page_types":["product"],"testmode":false,"default":"false","code":"jQuery('.js-add-to-cart-oos:visible').length === 0;","trigger":""},{"name":"submitted_onsite","polling":"all","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"jQuery('.footer-snack-notification').text().toLowerCase().indexOf(\"signing up\") > -1 && (jQuery('.newsletter-box input[name=\"email\"]').val() || '').length > 0 || null;","trigger":""},{"name":"page_url","polling":"none","persist":"no","page_types":["category","search"],"testmode":true,"default":"false","code":"","trigger":""},{"name":"cart_token","polling":"none","persist":"no","page_types":[],"testmode":true,"default":"false","code":"null;","trigger":"pageload"},{"name":"cart_items","polling":"none","persist":"no","page_types":[],"testmode":true,"default":"false","code":"null;","trigger":"pageload"},{"name":"cart","polling":"none","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":"pageload"},{"name":"cookie_modal_present","polling":"all","persist":"no","page_types":[],"testmode":true,"default":"false","code":"null;","trigger":"pageload"},{"name":"last_viewed_item","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":"pageload"},{"name":"logged_in_identified","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":"pageload"}],"dgu":"pixel.cdnwidget.com","dgp":false,"ba":{"enabled":0,"fbte":0},"biu":"assets.bounceexchange.com","bau":"api.bounceexchange.com","beu":"events.bouncex.net","ibx":{"tjs":"","cjs":"","miw":0,"mibcx":1,"te":1,"cart_rep":{"get":"","set":""},"ulpj":{"smtrctid":"espemailid"},"cus":"","miw_exclude":"","enabled":1},"etjson":null,"osre":true,"osru":"osr.bounceexchange.com/v1/osr/items","checkDfp":false,"gamNetwork":"","spa":1,"spatm":0,"preinit_cjs":"var audiences = {\n /* PROPERTIES */\n testMode: false,\n interceptEnabled: true,\n mirrorEnabled: true,\n arrayObserverEnabled: true,\n\n /* Intercept Events: For overriding the default events that the cartridge attempts to make. */\n useIntercept: function useIntercept() {\n if (!this.interceptEnabled) {\n return;\n }\n bouncex.utils.shqInterceptEvent = {\n productView: true,\n cartAdd: true,\n cartEmpty: false,\n categoryView: true,\n 'purchase': function(wkndEventParams){\n var prodErr = false;\n var orderId = bouncex.utils.getNestedProp('obj.order_id', null, wkndEventParams);\n var purchTotal =Number(bouncex.utils.getNestedProp('obj.amount', 0, wkndEventParams)) + ( Number(bouncex.utils.getNestedProp('obj.tax', 0, wkndEventParams)) + Number(bouncex.utils.getNestedProp('obj.shipping', 0, wkndEventParams)) );\n var orderInfo = bouncex.utils.getNestedProp('obj.item', null, wkndEventParams);\n var items = bouncex.utils.getNestedProp('ecommerce.items', [], wkndEventParams);\n// Use map to extract the required properties for each item\nvar orderArray = items.map(function(item) {\n var prodId = item.item_id;\n var price = item.price;\n var qty = item.quantity;\n return [prodId, price, qty];\n});\n \n if (orderArray.length < 1) {\n prodErr = true;\n }\n if (!prodErr && orderId){\n \t\t_shq.push(['pageView', \n \t { 'pageType': 'purchase',\n \t\t \t'orderItems' : orderArray,\n \t\t \t'orderId': orderId,\n \t\t \t'total': purchTotal.toFixed(2)\n \t\t}]);\n }else{\n \t_shq.push(['pageView', \n \t {'pageType': 'purchase',\n 'orderId' : orderId,\n 'total': purchTotal.toFixed(2),\n 'usebasket': true\n \t\t}]);\n }\n}, };\n },\n useMirror: function useMirror() {\n if (!this.mirrorEnabled) {\n return;\n }\n bouncex.utils.shqMirrorEvent = {\n pageview: function(){\n if (window.location.href.indexOf('search') > -1){\n var searchTerm = bouncex.utils.getParam('q').replace(/\\+/gi,' ');\n if (searchTerm){\n _shq.push([ 'onSearch', \n {\n 'searchPhrase': searchTerm\n }]);\n }\n }\n }\n };\n },\n captureCategory: function captureCategory(obj) {\n bouncex.setTimeout2(function(){\n if (bouncex.website.pts === 'category') {\nvar catCode = bouncex.utils.getNestedProp('page_breadcrumb', '', obj).split('|').slice(1).join('').trim();\n if (catCode) {\n _shq.push([\"onCategory\", {\n \"catName\": catCode,\n \"catId\": catCode\n }]);\n }\n }\n }, 700);\n },\n capturePDP: function capturePDP(obj) {\n var prodId = bouncex.utils.getNestedProp('ecommerce.items[0].item_id', '', obj);\n if (prodId) {\n _shq.push(['onProductView', {\n productId: prodId\n }]);\n }\n },\n captureATC: function captureATC(obj) {\n var prodDetails = bouncex.utils.getNestedProp('ecommerce.items', [], obj);\n var aItems = prodDetails.map(function (ea){\n return {ProductId : ea.item_id, UnitPrice : ea.price, Quantity : ea.quantity };\n });\n \n if (aItems.length > 0){\n _shq.push(['onCartAdd', {\n Items: aItems\n }]);\n }\n },\n processObserver: function processObserver(aoItems) {\n // aoItems will be an array of objects\n while (aoItems.length) {\n var item = aoItems.shift();\n var actionType = item[1],\n event = item.event;\n\n if (event === 'page_view') {\n this.captureCategory(item);\n }\n if (event === 'view_item') {\n this.capturePDP(item);\n }\n if (event === 'add_to_cart') {\n this.captureATC(item);\n } \n //item variable will contain the object to process.\n }\n },\n arrayObserver: function arrayObserver() {\n\n var _this = this;\n\n if (!this.arrayObserverEnabled) {\n return;\n }\n bouncex.et.onTrue(function () {\n return bouncex.utils.getNestedProp('window._shq.loaded');\n }, function () {\n _shq.ArrayObserver(window.dataLayer, function (e) {\n _this.processObserver(e);\n },{catchUp: true});\n });\n },\n\n /* Initialize audiences Tracking */\n init: function init() {\n // test mode\n if(this.testMode && !bouncex.testmode.bxdev){ return;}\n // attach object to bouncex.et\n if (!bouncex.et) {\n return;\n }\n bouncex.et.audiences = this;\n // initialize main functions\n this.useIntercept();\n this.useMirror();\n this.arrayObserver();\n }\n};\n\naudiences.init();\n","crs":{"integrations":null,"pageCount":null},"mat":0,"math":0,"cpnu":"coupons.bounceexchange.com","dfpcms":0,"sms":{"optm":"","eventSharing":true,"shqId":"dli2bsdiel-1","enabled":1},"pde":true,"fmc":["AW","AI","AG","AR","BS","BB","BZ","BM","BO","BQ","BR","CA","KY","CL","CO","CR","CU","CW","DM","DO","EC","SV","GF","GL","GD","GT","GP","HT","HN","JM","MQ","MX","MS","NI","PA","PY","PE","PR","PM","MF","BL","KN","LC","VC","SX","SR","TT","US","UM","UY","VE","VG","VI"],"fme":true,"fmx":"[id*=recipientEmail]","sdk":{"android":{"enabled":false,"enabledVersions":[],"eventModifications":null},"ios":{"enabled":false,"enabledVersions":[],"eventModifications":null}},"onsite":{"enabled":1},"ads":{"enabled":0},"pubs":{"enabled":0},"websdk":{"enabled":0},"ga4_property_id":"402962464","ga4_measurement_id":"G-MHWJKZ4QP6","tag_state_domain":"api.bounceexchange.com"} ; bouncex.tag = 'tag3'; bouncex.$ = window.jQuery; bouncex.env = 'production'; bouncex.restrictedTlds = {"casl":{"ca":1},"gdpr":{"ad":1,"al":1,"at":1,"ax":1,"ba":1,"be":1,"bg":1,"by":1,"xn--90ais":1,"ch":1,"cy":1,"cz":1,"de":1,"dk":1,"ee":1,"es":1,"eu":1,"fi":1,"fo":1,"fr":1,"uk":1,"gb":1,"gg":1,"gi":1,"gr":1,"hr":1,"hu":1,"ie":1,"im":1,"is":1,"it":1,"je":1,"li":1,"lt":1,"lu":1,"lv":1,"mc":1,"md":1,"me":1,"mk":1,"xn--d1al":1,"mt":1,"nl":1,"no":1,"pl":1,"pt":1,"ro":1,"rs":1,"xn--90a3ac":1,"ru":1,"su":1,"xn--p1ai":1,"se":1,"si":1,"sj":1,"sk":1,"sm":1,"ua":1,"xn--j1amh":1,"va":1,"tr":1}}; bouncex.client = { supportsBrotli: 1 }; bouncex.assets = {"ads":"316b12a95511cf618ef642592cd7c824","creativesBaseStyles":"a53944a2","gpsAuction":"bbb80866120d17013073bb6d284cbd6b","inbox":"02aca5df0e176b8810a86da97ac05424","onsite":"0e56ab6ba004ee080ce3deb3edae35e9","sms":"e39203556bab2366e56296ce42e974a7","websdk":"fb3da6ba1a7a78e95cf94d2dc9e22138"}; bouncex.push = function(pushData) { bouncex.pushedData.push(pushData); } var runtime = document.createElement('script'); runtime.setAttribute('src', '//assets.bounceexchange.com/assets/smart-tag/versioned/runtime_6459738026535cda4232dc813c61447d.br.js'); runtime.setAttribute('async', 'async'); runtime.setAttribute('onload', 'bouncex.initializeTag()'); bouncex.initializeTag = function() { var script = document.createElement('script'); script.setAttribute('src', '//assets.bounceexchange.com/assets/smart-tag/versioned/main-v2_cbe64330162f40129adcc52cb7219c2e.br.js'); script.setAttribute('async', 'async'); document.body.appendChild(script); var deviceGraphScript = document.createElement('script'); deviceGraphScript.setAttribute('src', '//assets.bounceexchange.com/assets/smart-tag/versioned/cjs_min_3a843477d8e318f67237a66d0a58c542.js'); deviceGraphScript.setAttribute('async', 'async'); var dgAttrs = [{"Key":"id","Value":"c.js"},{"Key":"async","Value":"true"},{"Key":"data-apikey","Value":"2^HIykD"},{"Key":"data-cb","Value":"bouncex.dg.initPostDeviceGraph"},{"Key":"data-bx","Value":"1"},{"Key":"data-gm","Value":"1"},{"Key":"data-fire","Value":"1"}]; if (dgAttrs) { for (var i = 0; i < dgAttrs.length; i++) { deviceGraphScript.setAttribute(dgAttrs[i].Key, dgAttrs[i].Value); } } document.body.appendChild(deviceGraphScript); bouncex.initializeTag = function() {}; }; document.body.appendChild(runtime); } window._shq = window._shq || []; var eventSharingCartridge = document.createElement('script'); eventSharingCartridge.setAttribute('src', '//assets.bounceexchange.com/assets/smart-tag/versioned/wknd_audiences_2648fa8509e4b3a98a2790bb8171ddc1.js'); eventSharingCartridge.setAttribute('async', 'async'); document.body.appendChild(eventSharingCartridge); } if (document.readyState === "loading") { document.addEventListener("DOMContentLoaded", bxBootstrap); } else { bxBootstrap(); }})();