(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":3010,"name":"Natori","cookie_name":"bounceClientVisit3010","domain":"natori.com","ct":"fp_local_storage","ally":0,"ei":0,"tcjs":"","cjs":"","force_https":false,"waypoints":false,"content_width":900,"gai":"UA-3571087-1","swids":"","sd":0,"ljq":"auto","campaign_id":0,"is_preview":false,"aco":{"first_party_limit":"3500","local_storage":"1"},"cmp":{"gdpr":1,"gmp":0,"whitelist_check":0},"burls":[],"ple":false,"fbe":true,"ffs":"","mas":2,"map":1,"gar":true,"ete":1,"ettm":false,"etjs":"/* ============================================================== */\n/* -------------------- REPLATFORM SEPTEMBER 2020 --------------- */\n/* ============================================================== */\nif (bouncex.vars.valid_domain) {\n\tinitTracking();\n}\n\nfunction initTracking() {\n\tvar pageType = bouncex.website.pts;\n\n\tif (pageType === 'product'){\n\t\tbouncex.et.onTrue(itemLoaded, trackItem, 15);\n\t}\n\tif (pageType === 'category' || pageType === 'search'){\n\t\tbouncex.et.onTrue(categoryLoaded, trackCategory, 15);\n\t\tgetShqCategory();\n\t}\n if (pageType !== 'search') {\n bouncex.et.onTrue(getGiftCardCategory);\n}\n\n\ttrackLoggedInUser();\n\ttrackCartEvents();\n\ttrackSHQSearch();\n}\n\n/* ------------ITEM TRACKING ---------- */\n\nfunction itemLoaded() {\n\treturn bouncex.vars.item_id_pdp && bouncex.vars.item_imageurl;\n}\n\nfunction trackItem(){\n\tvar item = getItem();\n\tbouncex.push(['item', item]);\n\tviewItem(item.id);\n\ttrackAddToCart(item.id);\n\tbouncex.et.setInterval(skuTrack());\n}\n\nfunction getItem() {\n\treturn {\n\t\tid : bouncex.vars.item_id_pdp || jQuery('.yotpo.bottomLine').attr('data-product-id'),\n\t\tcopy: bouncex.vars.prod_name,\n\t\tcategory : bouncex.vars.item_category || 'other',\n\t\turl : bouncex.vars.page_url,\n\t\timageurl: bouncex.vars.item_imageurl,\n\t\tinstock : bouncex.vars.in_stock\n\t};\n}\n\nfunction viewItem(itemId){\t\n var groupId = getGroupId();\n\tbouncex.push(['view item', {\n\t\t'item:id': itemId,\n\t\t'item:itemgroupid': itemId,\n\t\t'item:shq_id': groupId\n\t}]);\n}\n\nfunction getSearchTerm() {\n return bouncex.utils.url.getParam('search_query').replace(/\\+/gi, ' ') || '';\n}\n\n/* ------------- CATEGORY TRACKING ------------ */\nfunction categoryLoaded() {\n\treturn getCategoryIds().length > 0;\n}\n\nfunction getCategoryIds(){\n\treturn jQuery('.yotpo.bottomLine.yotpo-small').toArray().map(function(element) {\n return jQuery(element).attr('data-product-id');\n }).join(',') || false;\n}\n\nfunction trackCategory(){\n\tvar categoryObj = getCategoryObj();\n\tbouncex.push(['view category', categoryObj]);\n}\n\nfunction getCategoryObj(){\n\treturn {\n\t\t'page:url': bouncex.website.pts === 'search' ? bouncex.vars.search_url : bouncex.vars.page_url,\n\t\t'items:ids': getCategoryIds()\n\t};\n}\n\nfunction getShqCategory() {\n\n\tvar fullCat = bouncex.utils.getNestedProp('SearchSpring.Catalog.context.category','',window);\n\tvar catCode = fullCat ? fullCat.split('>').splice(-2).join('>') :'';\n\n\tif(catCode){\n\t\t_shq.push(['pageView', {\n\t\t\t'pageType': 'category',\n\t\t\t'catName': catCode,\n\t\t\t'catId': catCode\n\t\t}]);\n\t}\n\n}\n\nfunction trackSHQSearch() {\n if (bouncex.website.pts === 'search' && !!getSearchTerm()) {\n _shq.push(['pageView', {\n pageType: 'search',\n searchPhrase: getSearchTerm()\n }]);\n }\n}\n\nfunction getGiftCardCategory() {\n var catCode =bouncex.utils.getNestedProp('wwPage', '', window).split('/').pop();\n if (catCode) {\n _shq.push(['onCategory', {\n 'pageType': 'category',\n 'catName': catCode,\n 'catId': catCode\n }]);\n }\n}\n\n/* ------------- LOGGED IN USER TRACKING ------------ */\n\nfunction trackLoggedInUser() {\n if (bouncex.vars.logged_in && bouncex.vars.logged_in_identified === false) {\n\t\tvar email = getLoggedInEmail();\n\t\tif (email) {\n\t\t\tbouncex.push([\n\t\t\t\t'user',\n\t\t\t\t{\n\t\t\t\t\temail: email,\n\t\t\t\t\tsource: 'LoggedIn'\n\t\t\t\t}\n\t\t\t]);\n\t\t}\n\t\tbouncex.setv('logged_in_identified', true);\n\n\t}\n}\n\nfunction getLoggedInEmail() {\n return window.spapi.customer.email;\n}\n\n/* |----------- CART INIT AND REPLENISHMENT ----------------| */\nfunction trackCartEvents() {\n bouncex.et.cart.init({\n cartCountVariable: 'cart_qty',\n storeValues: [],\n replenishmentType: 'single',\n replenish: {}\n });\n\n bouncex.et.onTrue(cartEmpty, trackEmptyCart);\n}\n\nfunction trackAddToCart(id){\n\tjQuery('#form-action-addToCart').on('click', function() {\n\t\tfireATC(id);\n\t});\n}\n\nfunction fireATC(itemId) {\n var sku = jQuery('[data-product-sku]').text();\n\tbouncex.push(['add to cart', {'item:id':itemId, 'item:shq_id':sku}]);\n\tbouncex.setv('cart_set', true);\n}\n\nfunction cartEmpty() {\n if (bouncex.website.pts === 'cart' && \n bouncex.vars.cart_qty === 0 &&\n jQuery('main h3').text().indexOf('cart is empty') > -1)\n { return true; }\n}\n\nfunction trackEmptyCart(){\n if (bouncex.vars.cart_set === true) {\n bouncex.push(['empty_cart', {}]);\n\t\tbouncex.setv('cart_set', false);\n\t}\n}\n\n/* |----------- CATALOG TRACKING ----------------| */\n\nfunction skuTrack() {\n\tvar lastSKU = '';\n\tvar lastItemGroup = '';\n\n\treturn function() {\n\t\tvar groupId = getGroupId();\n\t\tvar sku = jQuery('[data-product-sku]').text();\n\t\t// initially landed on page, lastSku not yet set\n\t\tif(lastSKU === ''){\n\t\t\tlastSKU = sku;\n\t\t\tlastItemGroup = groupId;\n\t\t}\n\n\t\tif (sku !== lastSKU && groupId) {\n\t\t\tlastSKU = sku;\n\t\t\tlastItemGroup = groupId;\n\t\t\tbouncex.push(['select_sku', {\n\t\t\t\t'item:id': bouncex.vars.item_id_pdp,\n\t\t\t\t'item:itemgroupid': bouncex.vars.item_id_pdp,\n\t\t\t\t'item:feedid': sku\n\t\t\t}]);\n\t\t}\n\t};\n}\n\nfunction getGroupId() {\n var groupId = jQuery('.productView .productView-info-value').text().split('Free Shipping')[0];\n\t\tif(groupId.indexOf('-') > -1){\n\t\t\treturn groupId.split('-')[0].split('Free Shipping')[0];\n\t\t} else if(groupId.indexOf(' ') > -1){\n\t\t\treturn groupId.split(' ')[0];\n\t\t} else { return groupId; }\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('.page-cart').length > 0"}]]},"category":{"testmode":false,"val":[[{"activation":"js","prop":"","prop2":"","prop3":"","val":"document.querySelectorAll('.page-category').length > 0"}]]},"checkout":{"testmode":false,"val":[[{"activation":"js","prop":"","prop2":"","prop3":"","val":"jQuery('#checkout-page').length > 0;"},{"activation":"current_page_url","prop":"contains","prop2":"","prop3":"","val":"/checkout"}]]},"home":{"testmode":false,"val":[[{"activation":"current_page_url","prop":"exactly","prop2":"","prop3":"","val":"https://www.natori.com/"},{"activation":"js","prop":"","prop2":"","prop3":"","val":"jQuery('body').hasClass('cms-home') && jQuery('link[rel=\"canonical\"]').attr('href') === \"https://www.natori.com/\";"}]]},"product":{"testmode":false,"val":[[{"activation":"js","prop":"","prop2":"","prop3":"","val":"document.querySelectorAll('.page-product').length > 0"}]]},"search":{"testmode":false,"val":[[{"activation":"current_page_url","prop":"contains","prop2":"","prop3":"","val":"/search?search_query"},{"activation":"current_page_url","prop":"contains","prop2":"","prop3":"","val":"/search"}]]}},"els":{"CART - Checkout Button":".cart-actions .button","CART - Promo Code Box":"input#redeemableCode","CART - Promo code apply button":"button#applyRedeemableButton","CAT - Product Grid Image":".card-image","NON-CART - Footer":"footer.footer","NON-CART - Navigation bar ":"header.header","PDP - Add to Cart Button":"#form-action-addToCart","PDP - Color Option":"div.optcolor","PDP - Hero Image":"figure.productView-image","PDP - Product Price":"div.productView-price","PDP - Quantity Option":".form-field--increments","PDP - Review Stars":"div.star-clickable","PDP - Size Option":"div.option-size","PDP - Thumbnail Image":"li.productView-thumbnail","SEARCH - Product Grid Image":".card-image"},"vars":[{"name":"logged_in","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"jQuery('.navUser-item--account .account-subMenu a:contains(\"Account\")').length > 0 || jQuery('div[data-test=\"customer-info\"]').length > 0 && jQuery('checkout-header[state=\".customer.guest\"]').length === 0;","trigger":""},{"name":"ever_logged_in","polling":"none","persist":"permanent","page_types":[],"testmode":false,"default":"false","code":"bouncex.vars.logged_in || null","trigger":""},{"name":"cart_qty","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"0","code":"(function(){\r\n if(jQuery('.countPill.countPill--positive.cart-quantity').length > 0){\r\n return jQuery('.countPill.countPill--positive.cart-quantity').text().trim().replace(/[^0-9\\.]/g,'');\r\n } else if (jQuery('h3[data-test=\"cart-count-total\"]').length > 0) {\r\n return jQuery('h3[data-test=\"cart-count-total\"]').text().trim().replace(/[^0-9\\.]/g,'');\r\n }\r\n \r\n return 0;\r\n})();","trigger":""},{"name":"cart_value","polling":"all","persist":"visit","page_types":[],"testmode":false,"default":"0","code":"(function(){\n var cartPopup = jQuery('.previewCartCheckout-price');\n if(cartPopup.length > 0){\n return cartPopup.text().trim().replace(/[^0-9\\.]/g,'');\n }else if(window.location.href.indexOf('cart.php') > -1){\n return jQuery('.cart-total-value span:first').length > 0 ? jQuery('.cart-total-value span:first').text().trim().replace(/[^0-9\\.]/g,'') : 0;\n }else if(window.location.href.indexOf('checkout') > -1){\n return jQuery('.cart-priceItem-value span[data-test=\"cart-price-value\"]').first().text().trim().replace(/[^0-9\\.]/g,'');\n } else if (jQuery('.previewCart .previewCart-emptyBody:visible').length > 0){\n return 0;\n }\n return null;\n})();","trigger":""},{"name":"prod_price","polling":"all","persist":"no","page_types":[],"testmode":false,"default":"0","code":"jQuery('.productView-price span[data-product-price-without-tax]').length > 0 ? jQuery('.productView-price span[data-product-price-without-tax]').first().text().trim().replace(/[^0-9\\.]/g,'') : false;","trigger":""},{"name":"prod_name","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"jQuery('h1.productView-title').length > 0 ? jQuery.trim(jQuery('h1.productView-title').text()) : false;","trigger":""},{"name":"in_stock","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"jQuery('meta[property=\"og:availability\"]').prop('content') === \"instock\" ? true : false;","trigger":""},{"name":"submitted_onsite","polling":"vars","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"(function(){\n if(jQuery('.footer-info-col.newsletter .alertBox-column.alertBox-message:first:visible').text().indexOf('Thank you for joining our mailing list') > -1 ){\n return true;\n }\n \n return null;\n})();","trigger":"pageload"},{"name":"item_id_pdp","polling":"none","persist":"no","page_types":["product"],"testmode":false,"default":"false","code":"(function(){\n\tvar i = dataLayer.filter(function(i) {\n\t\treturn 'albert_item_id' in i;\n\t});\n\tif (i.length > 0) {\n\t\treturn i[i.length-1]['albert_item_id'];\n\t}\n\treturn 'Global';\n})();","trigger":"pageload"},{"name":"item_ids","polling":"none","persist":"no","page_types":["category","search"],"testmode":false,"default":"false","code":"jQuery('.yotpo.bottomLine.yotpo-small').toArray().map(function(element) {\n\treturn jQuery(element).attr('data-product-id')\n}).join(',') || false;","trigger":"pageload"},{"name":"page_url","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"window.location.origin + window.location.pathname;","trigger":"pageload"},{"name":"item_imageurl","polling":"none","persist":"no","page_types":["product"],"testmode":false,"default":"false","code":"jQuery('meta[property=\"og:image\"]').attr('content');","trigger":"pageload"},{"name":"item_copy","polling":"none","persist":"no","page_types":["product"],"testmode":false,"default":"false","code":"jQuery('.productView-title[itemprop=\"name\"]').text().toLowerCase()","trigger":"pageload"},{"name":"item_category","polling":"none","persist":"no","page_types":["product"],"testmode":false,"default":"false","code":"jQuery('.breadcrumb').filter(function(){\n\treturn jQuery(this).css('display') === 'block'\n}).text().split('to')[1].trim().toLowerCase();","trigger":"pageload"},{"name":"cart","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":"pageload"},{"name":"search_url","polling":"none","persist":"no","page_types":["search"],"testmode":false,"default":"false","code":"window.location.search.split('&').reduce(function(accum, current){\n\tif(!(current.indexOf('utm') > -1)) {\n \treturn accum + current + '&'\n\t}\n\treturn accum\n}, window.location.origin + window.location.pathname).slice(0, -1);","trigger":"pageload"},{"name":"valid_domain","polling":"none","persist":"no","page_types":[],"testmode":false,"default":"false","code":"window.location.origin === 'https://www.natori.com';","trigger":"pageload"},{"name":"logged_in_identified","polling":"none","persist":"visit","page_types":[],"testmode":false,"default":"false","code":"null;","trigger":"pageload"},{"name":"cart_set","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":1,"mibcx":1,"te":1,"cart_rep":{"get":"","set":""},"ulpj":{"bxid":"espemailid"},"cus":"","miw_exclude":"#to_email","enabled":1},"etjson":null,"osre":true,"osru":"osr.bounceexchange.com/v1/osr/items","checkDfp":false,"gamNetwork":"","spa":0,"spatm":1,"preinit_cjs":"// SHQ Intercept Event to adjust default WKND Cartridge behavior\n// SHQ Intercept Event to adjust default WKND Cartridge behavior\nbouncex.utils.shqInterceptEvent = {\n // blocking default and firing custom function to pass unit price and cart total\n\n 'productView': function () {\n var pID = bouncex.utils.getNestedProp('bodlEvents.events[0].line_items[0].sku');\n if (pID) {\n _shq.push(['onProductView', { 'productId': pID }]);\n }\n },\n 'cartAdd': function (wkdata) {\n var prodId = bouncex.utils.getNestedProp('params', {}, wkdata)['item:shq_id'];\n if (!!prodId) {\n _shq.push(['onCartAdd', {\n CartId: null,\n Items: [{\n ProductId: prodId,\n UnitPrice: bouncex.vars.prod_price || null,\n Quantity: 1\n }],\n Total: bouncex.vars.cart_value || null\n }]);\n } else {\n _shq.log('ATC event failed! wkdata params missing item:shq_id', 'error', '');\n }\n }\n};\n\n bouncex.utils.shqMirrorEvent = {\n pageview: (function(bxData){\n var onCart = document.querySelectorAll('.page-cart').length > 0;\n if(onCart){\n var Items = bouncex.utils.getNestedProp('cc_cart_items', []).map(function(item){\n return {\n \"ProductId\": item.id,\n \"UnitPrice\": item.price,\n \"Quantity\": item.quantity\n };\n });\n var Total = Items.reduce(function(t, i){\n return t += (i.UnitPrice * i.Quantity);\n }, 0);\n \n if(Items.length){\n _shq.push(['onCartView',{\n \"Items\": Items,\n \"Total\": Total\n }]);\n }\n }\n }())\n };","crs":{"integrations":null,"pageCount":null},"mat":0,"math":0,"cpnu":"coupons.bounceexchange.com","dfpcms":0,"sms":{"optm":"Hit 'Send' to sign-up for automated, recurring Natori mktg txts (like cart reminders) to this #, per terms.","eventSharing":true,"shqId":"p3pkovw2l2-1","enabled":1},"pde":true,"fmc":["US","CA"],"fme":true,"fmx":"#to_email","uid2":false,"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,"devMode":0},"ga4_property_id":"326831808","ga4_measurement_id":"G-7SJF6EFLSF","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":"7b352b1295e35e9c90089d9dd48e488f","creativesBaseStyles":"a53944a2","gpsAuction":"bbb80866120d17013073bb6d284cbd6b","inbox":"75060a85c1a4aebcc6f779b9e84db722","onsite":"abbdf7a49be9b52b097917b7b527b262","sms":"e39203556bab2366e56296ce42e974a7","websdk":"04cde0014774b7eb597770595769aab1"}; bouncex.push = function(pushData) { bouncex.pushedData.push(pushData); } var runtime = document.createElement('script'); runtime.setAttribute('src', '//assets.bounceexchange.com/assets/smart-tag/versioned/runtime_c81e76ee00d795b1eebf8d27949f8dc5.br.js'); runtime.setAttribute('async', 'async'); bouncex.initializeTag = function() { var script = document.createElement('script'); script.setAttribute('src', '//assets.bounceexchange.com/assets/smart-tag/versioned/main-v2_e09343dd04d7b7bcfa02231dd6dc80d7.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_6ef1802500d8367a80105e664862d0d7.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() {}; }; runtime.onload = bouncex.initializeTag; 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(); }})();