console-api |
log |
URL: https://cdn.zineone.com/apps/latest/z1m.js(Line 27)
Message:
{"actionMappingChanged":true,"profileId":"7b5da250-7117-4636-97f4-5e0a77b5ee9e","sdkPropsChanged":true,"firstTimeUser":true,"sessionTime":"30","id":"36e01afa-025c-46c7-9f47-2145cc22a579","config":{"actionMapping":[{"actionType":"z1script","eventName":"load","pageSelector":{"type":"all","condition":"equals","val":""},"tagName":"z1_codeLibraryTag","script":"var z1CodeLib = function () { };\nz1CodeLib.prototype = (function () {\n\n return {\n checkForSupcData: function () {\n \n \tvar supcInSession = sessionStorage.getItem('z1_supc');\n \tif(supcInSession && location.href.toString().indexOf('shopping_cart') == -1)\n {\n\t\t\t\tlocalStorage.setItem('z1_supc',supcInSession);\n sessionStorage.removeItem('z1_supc');\n \n }\n },\n };\n}) ();\n\n\nthis.configUtils = new z1CodeLib();\n\nthis.configUtils.checkForSupcData();"},{"tagName":"Creating Z1 Widget Div on CatalogPage","actionType":"z1script","script":"//add msg div as child of notifyDiv\n//var notifyDiv = document.getElementById(\"container\");\ntry {\n var notifyDiv = document.getElementById(\"mini-cart\");\n var z1Div = document.createElement(\"div\");\n z1Div.setAttribute(\"data-zineone-widget\", \"z1_content_widget\");\n z1Div.setAttribute(\"id\", \"z1widget\");\n notifyDiv.appendChild(z1Div);\n} catch (z1ie) {\n console.log(\"exception in Tag creating div to attch z1widget=\" + z1ie);\n}\n","eventName":"load","pageSelector":{"type":"pgName","condition":"contains","val":"/catalog"}},{"tagName":"webstoreSendEventAllPages","actionType":"z1script","script":"/*Changes done for IE\nA. function declaration like, var abc = function() won't work in IE if function is used first and then declared and defined. Please take below precaution before using it:\n 1. If you want to use function declaration like, var abc = function(), first declare it and then use it\n 2. Use normal function declaration like, function abc(). you can declare function anywhere in the page and use it before or after declaration. It will work on all the browsers.\nB. Do not use multiline strings, also call as 'Template String'. Template Strings are demarked by a backtick(`).\n Example. var abc = `This is multiline\n comment`; //multiline comments won't work in IE\n Use simple concatenation to achieve the same like,\n var abc = \"\";\n abc += 'This is multiline';\n abc += 'comment';\nC. You can not set defalut parameter values for function in IE.\n for e.g. function abc(num = 0,str=\"hello\") //Won't work in IE\nD. You can not use arguments object ([...args] or (...args) in function) in IE.\n For e.g function abc(...args){\n console.log(\"received paramenters \", args)\n } // Won't work in IE\nE. 'append' function won't work in IE. You can use 'appendChild' function to achieve the same functionality.\nF. 'prepend' function won't work IE. Try to use 'insertBefore' function to achieve the same functionality.\nG. new Event() function won't work in IE. You can use new CustomEvent() function to achieve the same functionality.\nH. Arrow functions (=>) won't work in IE\n*/\ntry {\n //var isIE = function() { //\n /*function isIE() {\n var ua = window.navigator.userAgent; //Check the userAgent property of the window.navigator object\n var msie = ua.indexOf('MSIE '); // IE 10 or older\n var trident = ua.indexOf('Trident/'); //IE 11\n return (msie > 0 || trident > 0);\n };\n var isIEFlag = isIE();\n if (!isIEFlag) return;\n var cust_id = pageData.customerDetails.customerID ? pageData.customerDetails.customerID : \"\";\n if ( !(cust_id == \"3000000030411692\" || cust_id == \"3000000126553504\") ) return;*/\n console.log(\"[Zineone-I]\");\n\n /* Aditya: fsg: js-shipping-banner --> js-shipping-banner-2\n * Aditya: fsg: js-meter-summary --> js-meter-summary-2\n * Aditya: getBopusInfo and get_Xhours\n * Manish: Webstore instrumentation for all pages except OrderConfirmation and MyAccount\n * Juzer: Added ML Instrumentation\n */\n var TIME_TO_LIVE = 1440; //Venkat on 11/22 - changing 1440 (24 hours) to 60 MINUTES\n // Venkat - Begin - 01/09/2019\n // PLEASE set the following var TO ENABLE the BOPUS Pdp store hour notifications\n var ENABLE_BOPUS_STORE_HOUR = false;\n // Venkat - End - 01/09/2019\n\n var isJsonNull = false;\n\n try {\n var debugScr = true;\n var cartValue = 0;\n var currentUserCartArr = [];\n\n\n console.log(\"[ZineOne] sendEventOnAllPages Tag is running.\");\n\n\n //Event Codes for vectors:\n var eventCodes = {\n _ws_addedtobag: \"A\",\n breachedgeofence: \"B\",\n _ws_completeshipping: \"C\",\n exitgeofence: \"D\",\n _ws_placedorder: \"E\",\n _ws_searched: \"F\",\n _ws_startedcheckout: \"G\",\n _ws_viewedcart: \"H\",\n _ws_viewedcatalog: \"I\",\n _ws_viewedhome: \"J\",\n _ws_viewedproduct: \"K\",\n _ws_completepayment: \"L\",\n _ws_viewedsku: \"M\",\n _ws_update_hcart: \"N\",\n _ws_changedsort: \"O\",\n _ws_rto: \"R\"\n\n };\n var SESSION_GAP = 1800000; //30min = 30*60*1000 millis\n\n\n\n\n\n function isNumeric(value) {\n return /^-{0,1}\\d+$/.test(value);\n }\n\n function isValid(value) {\n if (value == \"null\" || value == \"undefined\" || value == null || value == undefined) {\n return false;\n }\n\n return true;\n }\n\n // Get cookie from user's browser/desktop\n function getCookie(name) {\n var value = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)'));\n if (debugScr && value != null) console.log(\"[ZineOne] getCookie value for = \" + name + \" value - \" + value);\n return (value != null) ? unescape(value[2]) : null;\n //var re = new RegExp(name + \"=([^;]+)\");\n //var value = re.exec(document.cookie);\n //return (value != null) ? unescape(value[1]) : null;\n }\n //PerkPerf start\n function getBirthdayCookie(cname) {\n var name = cname + \"=\";\n var decodedCookie = decodeURIComponent(document.cookie);\n var ca = decodedCookie.split(';');\n for (var i = 0; i < ca.length; i++) {\n var c = ca[i];\n while (c.charAt(0) == ' ') {\n c = c.substring(1);\n }\n if (c.indexOf(name) == 0) {\n return c.substring(name.length, c.length);\n }\n }\n return;\n }\n //PerkPerf end\n\n function getCartData() {\n if (pageData && pageData.customerDetails) {\n if (!isSoftLoggedIn || (isSoftLoggedIn && !isSoftLoggedIn.includes(\"true\"))) {\n if (pageData.customerDetails.isLoggedIn) isLoggedIn = \"true\";\n }\n }\n\n var cartData = localStorage.getItem('persistent_bar_components_json_v1');\n if(cartData && !isValid(cartData)){\n cartData = (isValid(Kjs) && isValid(Kjs.PB) && isValid(Kjs.PB.getPbCartStorage())) ? JSON.stringify(Kjs.PB.getPbCartStorage()) : \"null\";\n }\n \n if (isValid(cartData)) {\n //if (debugScr) console.log(\"[ZineOne] CartData = \" + cartData);\n var cartInfo = JSON.parse(cartData);\n var productsArr = [];\n\n //Send the Event even if the Cart does not have any item, so that the OpenAPI could be called\n //on the Server side\n\n if (cartInfo == null || cartInfo.cartItems == null || cartInfo.cartItems.length <= 0)\n return true;\n\n for (var i = 0; i < cartInfo.cartItems.length; i++) {\n var si = cartInfo.cartItems[i];\n var saleUnitprice = 0;\n var regularUnitPrice = 0;\n if (!si.itemPriceInfo && !si.itemPriceInfo.saleUnitprice)\n saleUnitprice = si.itemPriceInfo.saleUnitprice;\n\n if (!si.itemPriceInfo && !si.itemPriceInfo.regularUnitPrice)\n regularUnitPrice = si.itemPriceInfo.regularUnitPrice;\n var obj = {\n \"id\": si.cartItemId,\n \"skuCode\": si.skuId,\n \"webID\": si.productId,\n \"saleUnitPrice\": saleUnitprice.toString(),\n \"regularUnitPrice\": regularUnitPrice.toString(),\n \"quantity\": si.quantity.toString()\n };\n productsArr.push(obj);\n //if (debugScr) console.log(\"[ZineOne] Product Array ==>\" + productsArr);\n }\n //if (debugScr) console.log(\"[ZineOne] Out of loop\");\n if (debugScr) console.log(\"[ZineOne] Product Array ==>\" + productsArr);\n return JSON.stringify(productsArr);\n }\n }\n\n //console.log(\"z1now start\");\n var z1Widgets = ZineOne.getZ1Widget();\n var configMap = { \"z1.banner.secondsToShow\": \"1200\" };\n z1Widgets.setConfiguration(configMap);\n //console.log(\"z1now end\");\n\n function getCurrentCartData(storeInLocal) {\n var cartData = localStorage.getItem('persistent_bar_components_json_v1');\n if(cartData && !isValid(cartData)){\n cartData = (isValid(Kjs) && isValid(Kjs.PB) && isValid(Kjs.PB.getPbCartStorage())) ? JSON.stringify(Kjs.PB.getPbCartStorage()) : \"null\";\n }\n if (isValid(cartData)) {\n var cartInfo = JSON.parse(cartData);\n\n if (cartInfo.cartItems) {\n var finalCartItems = [];\n for (var i = 0; i < cartInfo.cartItems.length; i++) {\n var cartObj = cartInfo.cartItems[i];\n\n var tempObj = {};\n var skuId = cartObj.skuId;\n var quantity = cartObj.quantity;\n\n tempObj.skuId = skuId;\n tempObj.quantity = quantity;\n\n finalCartItems[finalCartItems.length] = tempObj;\n\n }\n\n if (finalCartItems.length > 0 && storeInLocal == true) {\n localStorage.setItem('z1_current_cart_data', JSON.stringify(finalCartItems));\n }\n\n return finalCartItems;\n\n\n }\n }\n\n return null;\n }\n\n function checkForCartChanges() {\n var currentCartData = getCurrentCartData(false);\n var oldCartData = localStorage.getItem('z1_current_cart_data');\n\n if (validateForNotNull(currentCartData)) {\n oldCartData = JSON.parse(oldCartData);\n\n var removedSku = [];\n var updatedSku = [];\n var updatedskuQty = [];\n\n for (var i = 0; i < oldCartData.length; i++) {\n var tempOldSkuObj = oldCartData[i];\n var isFound = false;\n var isQtyUpdated = false;\n\n for (var j = 0; j < currentCartData.length; j++) {\n var tempCurrentSkuObj = currentCartData[j];\n\n if (tempOldSkuObj.skuId == tempCurrentSkuObj.skuId) {\n isFound = true;\n if (tempOldSkuObj.quantity != tempCurrentSkuObj.quantity) {\n isQtyUpdated = true;\n\n updatedSku[updatedSku.length] = tempCurrentSkuObj.skuId;\n updatedskuQty[updatedskuQty.length] = tempCurrentSkuObj.quantity;\n }\n\n\n break;\n }\n\n }\n\n if (isFound == false) {\n removedSku[removedSku.length] = tempCurrentSkuObj.skuId;\n }\n\n }\n\n console.log('Got Updated SKU ', updatedSku);\n console.log('Got Removed SKU ', removedSku);\n\n if (updatedSku.length > 0 || removedSku.length > 0) {\n var finalObj = {};\n finalObj.updatedSku = updatedSku.join('~');\n finalObj.updatedskuQty = updatedskuQty.join('~');\n finalObj.removedSku = removedSku.join('~');\n\n localStorage.setItem('z1_current_cart_data_update', JSON.stringify(finalObj));\n\n getCurrentCartData(true);\n } else {\n //return;\n }\n\n /*\n var cartData = localStorage.getItem('persistent_bar_components_json_v1');\n if (isValid(cartData)) {\n var cartInfo = JSON.parse(cartData);\n var productsArr = [];\n if (cartInfo.cartItems) {\n for (var i = 0; i < cartInfo.cartItems.length; i++) {\n var si = cartInfo.cartItems[i];\n var obj = {\n \"id\": si.cartItemId,\n \"sku\": si.skuId,\n \"webID\": si.productId,\n \"saleUnitPrice\": si.itemPriceInfo.saleUnitprice.toString(),\n \"regularUnitPrice\": si.itemPriceInfo.regularUnitPrice.toString(),\n \"quantity\": si.quantity.toString()\n };\n productsArr.push(obj);\n }\n }\n\n evtName = \"_ws_update_hcart\";\n\n var finalEventData = {};\n finalEventData[\"cartItems\"] = JSON.stringify(productsArr);\n\n ZineOne.pushEvent(evtName, finalEventData);\n\n updateUserVectors(false,null);\n\n\n }*/\n updateCartItems();\n updateUserVectors(false,null);\n } else {\n updateCartItems();\n }\n\n }\n\n\n\n function updateCartItems() {\n try {\n\n //debugScr = true;\n\n console.log(\"[ZineOne] update_cart from onload page TAG \");\n if (debugScr) console.log(\"[ZineOne] update_cart from onload page TAG \");\n\n var evtName = \"_ws_update_hcart\";\n var evtData = {};\n\n function getCurrentBagCount(cartInfo) {\n var itemsInBag = 0;\n for (var i = 0; i < cartInfo.cartItems.length; i++) {\n\n itemsInBag = itemsInBag + cartInfo.cartItems[i].quantity;\n }\n return itemsInBag;\n }\n\n var lastBagCount = 0;\n\n if (localStorage.getItem('z1_checkoutBagCount')) {\n lastBagCount = Number(localStorage.getItem('z1_checkoutBagCount'));\n }\n\n var cartData = localStorage.getItem('persistent_bar_components_json_v1');\n if(cartData && !isValid(cartData)){\n cartData = (isValid(Kjs) && isValid(Kjs.PB) && isValid(Kjs.PB.getPbCartStorage())) ? JSON.stringify(Kjs.PB.getPbCartStorage()) : \"null\";\n }\n if (isValid(cartData)) {\n var cartInfo = JSON.parse(cartData);\n\n var currentBagCount = getCurrentBagCount(cartInfo);\n\n if (currentBagCount != lastBagCount) {\n var productsArr = [];\n for (var i = 0; i < cartInfo.cartItems.length; i++) {\n var si = cartInfo.cartItems[i];\n var obj = {\n \"id\": si.cartItemId,\n \"sku\": si.skuId,\n \"webID\": si.productId,\n \"saleUnitPrice\": si.itemPriceInfo.saleUnitprice.toString(),\n \"regularUnitPrice\": si.itemPriceInfo.regularUnitPrice.toString(),\n \"quantity\": si.quantity.toString()\n };\n productsArr.push(obj);\n }\n evtData[\"cartItems\"] = JSON.stringify(productsArr);\n ZineOne.pushEvent(evtName, evtData);\n if (debugScr) console.log(\"[ZineOne] update_cart event pushed >>> \", evtName, \" >>> \", evtData);\n } else {\n if (debugScr) console.log(\"[ZineOne] checkoutbagcount and cureent bag count is same \");\n }\n } else {\n if (document.getElementsByClassName(\"number-items boss-number-items\") &&\n Number(document.getElementsByClassName(\"number-items boss-number-items\")[0].innerHTML) > 0) {\n\n // This is done to reduce traffic to the backend since Kohl's Website is having persitent bar json set to NULL initially, i.e..,\n // till the Mini Cart is clicked. August 28, 2019. We should take this out once the Website functions properly\n if (Math.random() * 100 < 20) {\n\n //console.log(\"[ZineOne] cart data \"+ cartData);\n if (debugScr) console.log(\"[ZineOne] cart data is null \");\n ZineOne.pushEvent(evtName, evtData);\n if (debugScr) console.log(\"[ZineOne] No cart data in persistent_bar_components_json \");\n\n }\n\n }\n }\n\n } catch (ie) {\n console.log(\"[Zineone] Error in Tag update cart . \", ie);\n }\n }\n\n function checkForUpdateCart() {\n var currentCartData = localStorage.getItem('z1_current_cart_data');\n if (!currentCartData) {\n\n var gotCart = getCurrentCartData(true);\n console.log('Got Current Cart ', gotCart);\n\n\n } else {\n checkForCartChanges();\n }\n }\n\n function checkForRtoApplied() {\n var existingSupc = localStorage.getItem('z1_supc');\n\n if (existingSupc != null && existingSupc != undefined && existingSupc != 'null') {\n var e = JSON.parse(existingSupc);\n\n var newUserVectors = localStorage.getItem('z1_newUserVectors');\n\n newUserVectors = JSON.parse(newUserVectors);\n var rtoData = newUserVectors.rto_data;\n\n if (e.is_redeemed == true && newUserVectors.rto_data.indexOf('|A') == -1) {\n updateUserVectors(true, 'applied');\n }\n }\n }\n\n checkForUpdateCart();\n\n\n if ((window.location.host).includes(\"kohls.com\")) {\n //ZineOne.isDebugOn(true);\n //ZineOne.enablePushNotification(true);\n if (debugScr) console.log(\"ZineOne is here!!\");\n\n var z1Widgets = ZineOne.getZ1Widget();\n z1Widgets.registerWidgetHandler(\"raw\", _handleRawData);\n\n // Determine the page user is on viz. PDP, PMP, Account, search\n var pg = Z1.window.browserInfo.pagePath;\n var pgName = \"unknownPage\";\n var evtName = \"_ws_unknownEvent\";\n var chkout = false; //flag for fsg tag\n\n if (debugScr) console.log(\"[ZineOne] Page Name ==>\" + pg);\n\n //console.log(\"PG ==>\"+pg):\n if (pg == \"/\") {\n pgName = \"Home\";\n evtName = \"_ws_viewedHome\";\n } else if (pg.startsWith(\"/product\")) {\n pgName = \"PDP\";\n evtName = \"_ws_viewedProduct\";\n\n if (s) {\n s.pageName = '';\n s.prop4 = '';\n\n }\n\n //console.log('after 1',s);\n\n\n } else if (pg.startsWith(\"/catalog\")) {\n pgName = \"PMP\";\n evtName = \"_ws_viewedCatalog\";\n\n if (pageData && pageData.pmpDetails && pageData.pmpDetails.pageFilter) {\n localStorage.setItem(\"z1_currentPageFilter\", pageData.pmpDetails.pageFilter);\n }\n\n\n } else if (pg.startsWith(\"/search\")) {\n pgName = \"Search\";\n evtName = \"_ws_searched\";\n } else if (pg.startsWith(\"/myaccount/kohls_rewards.jsp\")) {\n //PerkPerf start\n pgName = \"Rewards\";\n evtName = \"_ws_rewards\";\n\n } else if (pg.startsWith(\"/wallet/my_wallet.jsp\")) {\n pgName = \"Wallet\";\n evtName = \"_ws_mywallet\";\n\n } else if (pg.startsWith(\"/upgrade/giftinglisting/wishlist.jsp\")) {\n pgName = \"Wishlist\";\n evtName = \"_ws_wishlist\";\n\n } else if (pg.startsWith(\"/myaccount/v2/order-history.jsp\")) {\n pgName = \"OrderHistory\";\n evtName = \"_ws_orderhistory\";\n\n } else if (pg.startsWith(\"/sale-event/coupons-deals.jsp\")) {\n pgName = \"Coupon\";\n evtName = \"_ws_coupon\";\n\n } else if (pg.startsWith(\"/feature/wallet_home\")) {\n pgName = \"WalletHome\";\n evtName = \"_ws_mywallet\";\n } else if (pg.startsWith(\"/myaccount/v2/myinfo.jsp\")) {\n\n pgName = \"MyInfo\";\n evtName = \"_ws_myinfo\";\n //PerkPerf end \n } else if (pg.startsWith(\"/checkout\")) {\n chkout = true;\n pgName = \"Cart\";\n if (pg.endsWith(\"shopping_cart.jsp\")) {\n pgName = \"Cart\";\n evtName = \"_ws_viewedCart\";\n } else if (pg.endsWith(\"v2/checkout.jsp\")) {\n pgName = \"Checkout\";\n evtName = \"_ws_startedCheckout\";\n\n // var pgType = pageData && pageData.pageDetails && pageData.pageDetails.pageType;\n // if (pgType.includes(\"Shipping\"))\n // if (pgType.includes(\"Payment\")) evtName = \"_ws_completeShipping\";\n // if (pgType.includes(\"Review\")) evtName = \"_ws_completePayment\";\n\n checkForRtoApplied();\n\n\n\n }\n //orderConfirmation is separate Tag\n //viewedAccount is not instrumented???\n }\n\n //setTimeout(function(){ }, 10000);\n\n checkForOfferSequence(pgName);\n\n if (pgName == \"Home\" | pgName == \"PMP\" | pgName == \"Search\" | pgName == \"Cart\" | pgName == \"PDP\") {\n var abandonCartPopupDiv = document.createElement('div');\n abandonCartPopupDiv.setAttribute(\"id\", \"z1-abandon-cart-pop-up\");\n abandonCartPopupDiv.setAttribute(\"style\", \"position: fixed;height: 100%;width: 100%;z-index: 100000;top: 0;left: 0;display:none;\");\n document.body.appendChild(abandonCartPopupDiv);\n }\n\n\n\n var currentBag = localStorage.getItem('persistent_bar_components_json_v1');\n if(currentBag && !isValid(currentBag)){\n currentBag = (isValid(Kjs) && isValid(Kjs.PB) && isValid(Kjs.PB.getPbCartStorage())) ? JSON.stringify(Kjs.PB.getPbCartStorage()) : \"null\";\n }\n\n if (currentBag != null && currentBag != 'null') {\n\n\n var cartInfo = JSON.parse(currentBag);\n\n var itemsInBag = 0;\n var productIdList = '';\n\n for (var i = 0; i < cartInfo.cartItems.length; i++) {\n itemsInBag = itemsInBag + cartInfo.cartItems[i].quantity;\n\n var pId = cartInfo.cartItems[i].productId;\n var qty = cartInfo.cartItems[i].quantity;\n\n if (i > 0) productIdList = productIdList + \"|\";\n\n productIdList = productIdList + pId + \":\" + qty;\n }\n\n localStorage.setItem('z1_checkoutBagCount', itemsInBag);\n localStorage.setItem('z1_checkoutProductIdList', productIdList);\n\n } else {\n localStorage.setItem('z1_checkoutBagCount', 0);\n localStorage.setItem('z1_checkoutProductIdList', '');\n }\n\n\n\n var evtData = {\n \"page\": pgName\n };\n evtData.page_loc = window.location.href; //added on 08262019\n //RK- Check softloggedIn\n var isSoftLoggedIn = getCookie(\"SoftLoggedInCookie\");\n if (isSoftLoggedIn && isSoftLoggedIn.includes(\"true\")) {\n if (debugScr) console.log(\"[ZineOne] Soft Logged value is:\" + isSoftLoggedIn);\n }\n // Set HardLoggedIn = true only if user is not SoftLoggedIn\n var isLoggedIn = \"\";\n\n var myId = pageData.customerDetails.customerID ? pageData.customerDetails.customerID : \"\";\n var executeTrackerAPICall=false;\n if (myId == \"3000000126631786\" || myId == \"3000000007802300\") {\n executeTrackerAPICall = true;\n }\n var rewardsData = localStorage.getItem(\"z1_rewardsData\");\n function getRewardsDataAndPushEvent(){\n console.log(\"y2yrewardsApi getRewardsDataAndPushEvent funcation call\");\n var loy_id = Number(pageData.customerDetails.kohlsLoyaltyID);\n try {\n var data = JSON.stringify({\n \"payload\": {\n \"loyaltyId\": String(loy_id),\n \"hasKCC\": $env.hasKcc\n }\n });\n var xhr = new XMLHttpRequest();\n console.log(\"$$$$1\");\n xhr.addEventListener(\"readystatechange\", function() {\n \n console.log(\"$$$$2\");\n if (xhr.readyState === 4) {\n console.log(\"$$$$3\");\n if (xhr.status === 200) { \n console.log(\"$$$$4\");\n console.log(\"y2yrewardsApi responseText...\",JSON.parse(this.responseText));\n var y2yRwd=JSON.parse(this.responseText);\n \n if(isValid(y2yRwd.payload)){\n \n localStorage.setItem(\"z1_rewardsData\", this.responseText);\n evtData[\"rewardsData\"] = JSON.stringify(this.responseText);\n }else{\n console.log(\"y2yrewardsApi responseText err\");\n }\n ZineOne.pushEvent(evtName, evtData);\n return;\n }\n else{\n console.log(\"$$$$5\");\n ZineOne.pushEvent(evtName, evtData);\n return;\n }\n }else{\n console.log(\"$$$$6\");\n }\n });\n\n var mylink=window.location.origin;\n xhr.open(\"POST\",mylink+\"/v1/loyalty/tracker?lpf=v2\");\n xhr.setRequestHeader(\"content-type\", \"application/json\");\n xhr.setRequestHeader(\"channel\", \"zineOne\");\n xhr.setRequestHeader(\"correlation-id\", \"Test997\");\n xhr.send(data);\n } catch (e) {\n console.log(\"y2yrewardsApi ERROR\" + e);\n ZineOne.pushEvent(evtName, evtData);\n }\n }\n\n // wait max 6 times for pageData to be available, each try is after period millis\n var period = 600;\n var tCount = 0;\n var maxTcount = 2; // not 6\n var sendevt = true;\n if (typeof pageData != 'undefined' && pageData && pageData.customerDetails) {\n\n if (pageData.customerDetails.customerHasKohlsCharge) evtData.isKCC = 1;\n else evtData.isKCC = 0;\n\n if (pageData.customerDetails.kohlsLoyaltyID) evtData.loyaltyId = pageData.customerDetails.kohlsLoyaltyID;\n\n if (debugScr) console.log(\"[ZineOne] case 1...\");\n sendevt = addEventData();\n if (debugScr) console.log(\"[ZineOne] Sent Event ..case 1...\");\n if (sendevt && (evtName != \"_ws_unknownEvent\")) {\n //ZineOne.pushEvent(evtName, evtData); \n if (isValid(pageData) && isValid(pageData.customerDetails) && isValid(pageData.customerDetails.kohlsLoyaltyID) && !(isNaN(pageData.customerDetails.kohlsLoyaltyID)) && !isValid(rewardsData) && executeTrackerAPICall) { //Loyalty user but no rewards data\n getRewardsDataAndPushEvent();\n } else {\n ZineOne.pushEvent(evtName, evtData);\n }\n\n if (pgName != 'Rewards' && pgName != 'Wallet' && pgName != 'Wishlist' && pgName != 'OrderHistory' && pgName != 'Coupon' && pgName != 'WalletHome' && pgName != 'MyInfo') {\n updateUserVectors(false,null);\n }\n\n }\n //} else if (pgName == \"Home\" || pg.startsWith(\"/checkout\")) { // we don't need pageData\n // if (debugScr) console.log(\"[ZineOne] case 2...\");\n // ZineOne.pushEvent(evtName, edata);\n } else {\n if (debugScr) console.log(\"[ZineOne] case 3...\");\n var timer = setInterval(function() {\n tCount++;\n if (debugScr) console.log(\"[ZineOne] timerCount=\" + tCount);\n if (typeof pageData != 'undefined') {\n clearInterval(timer);\n sendevt = addEventData();\n if (sendevt && (evtName != \"_ws_unknownEvent\")) {\n //ZineOne.pushEvent(evtName, evtData);\n if (isValid(pageData) && isValid(pageData.customerDetails) && isValid(pageData.customerDetails.kohlsLoyaltyID) && !(isNaN(pageData.customerDetails.kohlsLoyaltyID)) && !isValid(rewardsData) && executeTrackerAPICall) { //Loyalty user but no rewards data\n getRewardsDataAndPushEvent();\n } else {\n ZineOne.pushEvent(evtName, evtData);\n }\n\n if (pgName != 'Rewards' && pgName != 'Wallet' && pgName != 'Wishlist' && pgName != 'OrderHistory' && pgName != 'Coupon' && pgName != 'WalletHome' && pgName != 'MyInfo') {\n updateUserVectors(false,null);\n }\n }\n } else if (tCount == 2) {\n clearInterval(timer);\n // we will send the event with what we have\n if (evtName != \"_ws_unknownEvent\") {\n //ZineOne.pushEvent(evtName, evtData);\n if (isValid(pageData) && isValid(pageData.customerDetails) && isValid(pageData.customerDetails.kohlsLoyaltyID) && !(isNaN(pageData.customerDetails.kohlsLoyaltyID)) && !isValid(rewardsData) && executeTrackerAPICall) { //Loyalty user but no rewards data\n getRewardsDataAndPushEvent();\n } else {\n ZineOne.pushEvent(evtName, evtData);\n }\n if (pgName != 'Rewards' && pgName != 'Wallet' && pgName != 'Wishlist' && pgName != 'OrderHistory' && pgName != 'Coupon' && pgName != 'WalletHome' && pgName != 'MyInfo') {\n updateUserVectors(false,null);\n }\n }\n }\n }, period);\n }\n\n\n //bopus start\n /*if (pgName == \"PDP\" && (\n localStorage.getItem(\"z1_cust_id\") == \"3000000015510732\" || localStorage.getItem(\"z1_cust_id\") == \"3000000013469959\" ||\n localStorage.getItem(\"z1_cust_id\") == \"2254015584448533\" || localStorage.getItem(\"z1_cust_id\") == \"2253998883117448\" ||\n localStorage.getItem(\"z1_cust_id\") == \"2254015110568294\" || localStorage.getItem(\"z1_cust_id\") == \"3000000013617619\" ||\n localStorage.getItem(\"z1_cust_id\") == \"2254009728812139\" || localStorage.getItem(\"z1_cust_id\") == \"2254040233704719\" ||\n localStorage.getItem(\"z1_cust_id\") == \"2254024615400568\" || localStorage.getItem(\"z1_cust_id\") == \"3000000018326613\")) { // FILTER\n\n\n var storageHandler = function() {\n try {\n if (debugScr) console.log(\"[ZineOne] Bopus event\");\n\n setTimeout(function() {\n var skuCode = Kjs.mainPanel.getBagItem(\"skuId\");\n console.log(\"[ZineOne] The sku selected is: \" + skuCode);\n if (skuCode && isValid(skuCode)) {\n\n // var inv_info = pageData.productDetails.pageItems.QtyInfo;\n // var payload = {\n // \"sku\": skuCode,\n // \"inv_info\": inv_info\n // };\n // ZineOne.pushEvent(\"_ws_viewedsku\", payload);\n\n var z1_bopus_data = localStorage.getItem(\"z1_bopus_data\") + \"\";\n if (isValid(z1_bopus_data)) {\n var z1_bopus_JSON = JSON.parse(z1_bopus_data);\n fireOmniture(z1_bopus_JSON);\n if (z1_bopus_JSON.bopus == \"1\") {\n getBopusInfo();\n }\n } else {\n var inv_info = pageData.productDetails.pageItems.QtyInfo;\n var payload = {\n \"sku\": skuCode,\n \"inv_info\": inv_info\n };\n ZineOne.pushEvent(\"_ws_viewedsku\", payload);\n }\n }\n }, 2000);\n } catch (ex) {\n console.log(\"[ZineOne] Encountered condition: \", ex);\n }\n };\n\n document.addEventListener('bopus', storageHandler, false);\n // Fire initial bopus event on page load, in case sku already selected by default\n var eventini = new CustomEvent('bopus');\n document.dispatchEvent(eventini);\n\n var patbc = document.getElementsByClassName(\"product_boss_tmpl\")[0];\n patbc.onclick = function() {\n var event = new CustomEvent('bopus');\n document.dispatchEvent(event);\n };\n\n }*/\n\n //bopus end\n\n //New code for bopus as well as viewedsku\n /*if (myId == \"3000000030411692\" || myId == \"3000000129500077\" || myId == \"3000000015076174\" || myId ==\"3000000074262095\") {\n console.log(\"Execute only for my Id\");*/\n if (pgName == \"PDP\") {\n function bopusEventDispatch() {\n //var event = new Event('bopus'); // Doesn't work on IE\n var event = new CustomEvent('bopus');\n document.dispatchEvent(event);\n };\n var storeUrgencyMsg=\"\";\n function storageHandler() {\n try {\n if (debugScr) console.log(\"[ZineOne] Bopus event\");\n setTimeout(function() {\n\n var aka_hp2_cookie = getCookie(\"AKA_HP2\");\n var aka_rv_cookie = getCookie(\"AKA_RV\");\n var aka_pdp2_cookie = getCookie(\"AKA_PDP2\");\n if (debugScr) console.log(\" aka_hp2_cookie ==> \", aka_hp2_cookie, \" aka_rv_cookie ==> \", aka_rv_cookie, \" aka_pdp2_cookie ==> \", aka_pdp2_cookie);\n\n if (aka_pdp2_cookie && aka_pdp2_cookie.toLowerCase() == \"true\") {\n var parentDiv = \"\";\n var productPageName=pageName;\n if(productPageName==\"regularProductPage\"){\n parentDiv = document.getElementById(\"PDP_z1Scarcity_badge\");\n }\n else if(productPageName==\"collectionPDPPage\"){\n parentDiv = document.getElementById(\"CDP_z1Scarcity_badge\");\n }\n else{\n parentDiv = \"\"; \n }\n if (parentDiv) {\n var chkz1pdpScarDiv = document.getElementById(\"z1-pdpscarcity\");\n if(chkz1pdpScarDiv){\n chkz1pdpScarDiv.style.display = \"block\";\n }\n else{\n var pdpScrDiv = document.createElement('div');\n console.log(\"[ZineOne] created new div for scarcity\");\n pdpScrDiv.setAttribute(\"id\", \"z1-pdpscarcity\");\n //pdpScrDiv.setAttribute(\"style\", \"display:block;text-align: left; width: 100%; color: purple; font-size: 15px; clear: both; padding-top: 5px; overflow: auto;\");\n pdpScrDiv.style.display = \"block\";\n pdpScrDiv.style.textAlign = \"left\";\n pdpScrDiv.style.width = \"100%\";\n pdpScrDiv.style.color = \"purple\";\n pdpScrDiv.style.fontSize = \"15px\";\n pdpScrDiv.style.clear = \"both\";\n pdpScrDiv.style.paddingTop = \"5px\";\n pdpScrDiv.style.overflow = \"auto\";\n //pdpScrDiv.innerHTML=\"Just <b>1 left in this store!</b>\";\n parentDiv.appendChild(pdpScrDiv);\n }\n }\n\n if(storeUrgencyMsg != \"\"){\n if(document.getElementById(\"PDP_z1Social_badge\") && document.getElementById(\"PDP_z1Social_badge\").innerHTML==\"\"){\n document.getElementById(\"PDP_z1Social_badge\").innerHTML = storeUrgencyMsg;\n } \n }\n else{\n storeUrgencyMsg = document.getElementById(\"PDP_z1Social_badge\") ? document.getElementById(\"PDP_z1Social_badge\").innerHTML : \"\";\n }\n }\n\n var pdp_size_collection = document.getElementsByClassName(\"pdp-product-swatch\");\n var color_swatch_collection = document.getElementsByClassName(\"pdp-size-swatch\");\n if (pdp_size_collection.length > 0) {\n for (let ij = 0; ij < pdp_size_collection.length; ij++) {\n pdp_size_collection[ij].removeEventListener(\"click\", bopusEventDispatch, false);\n pdp_size_collection[ij].addEventListener(\"click\", bopusEventDispatch, false);\n }\n }\n if (color_swatch_collection.length > 0) {\n for (let ij = 0; ij < color_swatch_collection.length; ij++) {\n color_swatch_collection[ij].removeEventListener(\"click\", bopusEventDispatch, false);\n color_swatch_collection[ij].addEventListener(\"click\", bopusEventDispatch, false);\n };\n }\n\n var skuCode = Kjs.mainPanel.getBagItem(\"skuId\");\n if (debugScr) console.log(\"[ZineOne] The sku selected is: \" + skuCode);\n if (skuCode && isValid(skuCode)) {\n var ls_skuCode = localStorage.getItem('z1_selectedsku');\n if (!isValid(ls_skuCode) || ls_skuCode != skuCode) {\n if (debugScr) console.log(\"[ZineOne] Changed SKU from ==> \" + ls_skuCode + \" to ==> \" + skuCode);\n var pdpScarcityDivLOAD = document.getElementById(\"z1-pdpscarcity\");\n if (isValid(pdpScarcityDivLOAD)) {\n if (debugScr) console.log(\"[ZineOne] valid\");\n pdpScarcityDivLOAD.setAttribute(\"style\", \"display: none;\");\n pdpScarcityDivLOAD.innerHTML = \"\";\n }\n /*var inv_info = pageData.productDetails.pageItems.QtyInfo;\n if (!isValid(inv_info)) {\n if (debugScr) console.log(\"[ZineOne] inv_info is invalid\");\n return;\n }*/\n var inv_info = [];\n var qtyInfo = pageData.productDetails.pageItems.QtyInfo;\n if (isValid(qtyInfo)) {\n for (var item = 0; item < qtyInfo.length; item++) {\n if (qtyInfo[item].skuCode == skuCode) {\n inv_info.push(qtyInfo[item]);\n }\n }\n }\n\n if (!isValid(inv_info) || inv_info == 0) {\n if (debugScr) console.log(\"[ZineOne] inv_info is invalid\");\n return;\n }\n\n evtName = '_ws_viewedsku';\n\n\n var payload = {\n \"selectedSKU\": skuCode,\n \"prd_inv\": JSON.stringify(inv_info)\n };\n /*if (myId == \"3000000074262095\" || myId == \"3000000030411692\"){\n if(productV2JsonData && productV2JsonData.webID && productV2JsonData.webID == \"4143386\"){\n payload = {\n \"selectedSKU\": skuCode,\n \"prd_inv\": JSON.stringify([{\"skuCode\":\"62573701\",\"ShipAvlQty\":8,\"BopusAvlQty\":0,\"BossAvlQty\":0}])\n };\n }\n }*/\n ZineOne.pushEvent(evtName, payload);\n\n updateUserVectors(false,null);\n\n if (debugScr) console.log(\"[ZineOne] _ws_viewedsku event fired...\", payload);\n\n\n if (debugScr) console.log(\"[ZineOne] Test 1\");\n localStorage.setItem('z1_selectedsku', skuCode);\n var z1_bopus_data = localStorage.getItem(\"z1_bopus_data\") + \"\";\n if (isValid(z1_bopus_data)) {\n var z1_bopus_JSON = JSON.parse(z1_bopus_data);\n // Venkat - Begin - 10/23/2018 - looks like this reporting too many omniture tags\n // fireOmniture(z1_bopus_JSON);\n // Venkat - End - 10/23/2018\n if (z1_bopus_JSON.bopus == \"1\") {\n getBopusInfo();\n }\n }\n if (debugScr) console.log(\"[ZineOne] Test 2\");\n\n }\n }\n \n \n function quantityChangeHandler(){\n setTimeout(function(){\n //console.log(\"quantityChangeHandler called!\");\n var aka_pdp2_cookie = getCookie(\"AKA_PDP2\");\n var pdp_qty_inventory_msg_txt = document.getElementsByClassName(\"pdp-qty-inventory-msg-txt\");\n //console.log(\"pdp_qty_inventory_msg_txt...\",pdp_qty_inventory_msg_txt);\n if(pdp_qty_inventory_msg_txt.length > 0){\n //console.log(\"pdp_qty_inventory_msg_txt...\",pdp_qty_inventory_msg_txt[0].innerHTML);\n if(pdp_qty_inventory_msg_txt[0].innerHTML != \"\"){\n var pdpscarcity_div = document.getElementById(\"z1-pdpscarcity\");\n if(pdpscarcity_div){\n pdpscarcity_div.style.display=\"none\";\n }\n }\n else{\n var pdpscarcity_div = document.getElementById(\"z1-pdpscarcity\");\n if(pdpscarcity_div){\n pdpscarcity_div.style.display=\"block\";\n }\n }\n }\n },400);\n }\n var pdp_quantity = document.getElementsByClassName(\"pdp-quantity\");\n \n if(pdp_quantity.length > 0 ){\n pdp_quantity[0].removeEventListener(\"click\", quantityChangeHandler, false);\n pdp_quantity[0].addEventListener(\"click\", quantityChangeHandler, false);\n }\n var pdp_product_quantity = document.getElementsByClassName(\"pdp-product-quantity\");\n if(pdp_product_quantity.length > 0){\n pdp_product_quantity[0].removeEventListener(\"keyup\", quantityChangeHandler, false);\n pdp_product_quantity[0].addEventListener(\"keyup\", quantityChangeHandler, false);\n }\n }, 800);\n } catch (ex) {\n console.log(\"[ZineOne] Encountered condition: \", ex);\n }\n };\n\n document.addEventListener('bopus', storageHandler, false);\n // Fire initial bopus event on page load, in case sku already selected by default\n var eventini = new CustomEvent('bopus');\n document.dispatchEvent(eventini);\n\n /*pdp_size_collection = document.getElementsByClassName(\"pdp-product-size\");\n color_swatch_collection = document.getElementsByClassName(\"pdp-product-color\");\n if (pdp_size_collection.length > 0) {\n pdp_size_collection[0].onclick = function() {\n var event = new CustomEvent('bopus');\n document.dispatchEvent(event);\n };\n }\n if (color_swatch_collection.length > 0) {\n color_swatch_collection[0].onclick = function() {\n var event = new CustomEvent('bopus');\n document.dispatchEvent(event);\n };\n }*/\n\n localStorage.setItem('z1_selectedsku', \"\");\n \n \n }\n \n /*}\n else{\n if (pgName == \"PDP\") {\n function storageHandler() {\n try {\n if (debugScr) console.log(\"[ZineOne] Bopus event\");\n setTimeout(function() {\n var skuCode = Kjs.mainPanel.getBagItem(\"skuId\");\n if (debugScr) console.log(\"[ZineOne] The sku selected is: \" + skuCode);\n if (skuCode && isValid(skuCode)) {\n var ls_skuCode = localStorage.getItem('z1_selectedsku');\n if (!isValid(ls_skuCode) || ls_skuCode != skuCode) {\n if (debugScr) console.log(\"[ZineOne] Changed SKU from ==> \" + ls_skuCode + \" to ==> \" + skuCode);\n var pdpScarcityDivLOAD = document.getElementById(\"z1-pdpscarcity\");\n if (isValid(pdpScarcityDivLOAD)) {\n if (debugScr) console.log(\"[ZineOne] valid\");\n pdpScarcityDivLOAD.setAttribute(\"style\", \"display: none;\");\n pdpScarcityDivLOAD.innerHTML = \"\";\n }\n //var inv_info = pageData.productDetails.pageItems.QtyInfo;\n //if (!isValid(inv_info)) {\n // if (debugScr) console.log(\"[ZineOne] inv_info is invalid\");\n // return;\n //}\n var inv_info = [];\n var qtyInfo = pageData.productDetails.pageItems.QtyInfo;\n if (isValid(qtyInfo)) {\n for (var item = 0; item < qtyInfo.length; item++) {\n if (qtyInfo[item].skuCode == skuCode) {\n inv_info.push(qtyInfo[item]);\n }\n }\n }\n\n if (!isValid(inv_info) || inv_info == 0) {\n if (debugScr) console.log(\"[ZineOne] inv_info is invalid\");\n return;\n }\n\n evtName = '_ws_viewedsku';\n\n\n var payload = {\n \"selectedSKU\": skuCode,\n \"prd_inv\": JSON.stringify(inv_info)\n };\n ZineOne.pushEvent(evtName, payload);\n\n updateUserVectors(false,null);\n\n if (debugScr) console.log(\"[ZineOne] _ws_viewedsku event fired...\", payload);\n\n\n if (debugScr) console.log(\"[ZineOne] Test 1\");\n localStorage.setItem('z1_selectedsku', skuCode);\n var z1_bopus_data = localStorage.getItem(\"z1_bopus_data\") + \"\";\n if (isValid(z1_bopus_data)) {\n var z1_bopus_JSON = JSON.parse(z1_bopus_data);\n // Venkat - Begin - 10/23/2018 - looks like this reporting too many omniture tags\n // fireOmniture(z1_bopus_JSON);\n // Venkat - End - 10/23/2018\n if (z1_bopus_JSON.bopus == \"1\") {\n getBopusInfo();\n }\n }\n if (debugScr) console.log(\"[ZineOne] Test 2\");\n\n }\n }\n }, 200);\n } catch (ex) {\n console.log(\"[ZineOne] Encountered condition: \", ex);\n }\n };\n\n document.addEventListener('bopus', storageHandler, false);\n // Fire initial bopus event on page load, in case sku already selected by default\n var eventini = new CustomEvent('bopus');\n document.dispatchEvent(eventini);\n\n pdp_size_collection = document.getElementsByClassName(\"pdp-product-size\");\n color_swatch_collection = document.getElementsByClassName(\"pdp-product-color\");\n if (pdp_size_collection.length > 0) {\n pdp_size_collection[0].onclick = function() {\n var event = new CustomEvent('bopus');\n document.dispatchEvent(event);\n };\n }\n if (color_swatch_collection.length > 0) {\n color_swatch_collection[0].onclick = function() {\n var event = new CustomEvent('bopus');\n document.dispatchEvent(event);\n };\n }\n\n localStorage.setItem('z1_selectedsku', \"\");\n }\n }*/\n\n //fsg start\n /////////////////// Purging fsg Data for users so that fsg isn't shown\n\n // localStorage.setItem('z1_fsg_data', null); // setting dummy data\n\n ////////////////////\n\n\n //if (false) {\n if (debugScr) console.log(\"[ZineOne] Starting fsg!!! \" + localStorage.getItem(\"z1_connectUserId\"));\n var vID = localStorage.getItem(\"z1_cust_id\"); //getCookie(\"VisitorId\");\n\n if (!isValid(vID)) {\n vID = localStorage.getItem(\"z1_connectUserId\");\n }\n\n var timestamp = new Date().getTime();\n var fsg_data = localStorage.getItem(\"z1_fsg_data\");\n var send = false;\n setKohlsId();\n //CHANGED MAR 15\n //console.log(\"CHKOUT PAGE ==> \" + chkout);\n //console.log(\"IsLoggedIn ==> \" + pageData.customerDetails.isLoggedIn);\n\n var userLoginStatus = pageData.customerDetails.isLoggedIn;\n //END CHANGE MAR 15\n /*if (fsg_data != null ) {\n delT = (timestamp - JSON.parse(fsg_data).timestamp);\n\n if (vID != JSON.parse(fsg_data).visitorId) {\n if (debugScr) console.log(\"[ZineOne] New User\" + vID); // send event and reset\n send = true;\n } else if (delT / 60000 > TIME_TO_LIVE) {\n if (debugScr) console.log(\"[ZineOne] TIME_TO_LIVE exceeded\"); // send event and reset\n if (debugScr) console.log(\"[ZineOne] re fsg, setting dummy data\");\n var dummy_data = {\n 'fsg': {\n '_d': \"0\",\n '_t': \"75\"\n },\n 'timestamp': timestamp,\n 'visitorId': vID\n };\n localStorage.setItem('z1_fsg_data', JSON.stringify(dummy_data)); // setting dummy data\n send = true;\n //CHANGED ON MAR 15 \n //} else if ((!userLoginStatus) || String(userLoginStatus).includes(\"false\")) {\n // console.log(\"User logged off, resetting fsg data\");\n // localStorage.setItem('z1_fsg_data', JSON.stringify(dummy_data));\n // send = true;\n //END CHANGED ON MAR 15\n } else if ((!userLoginStatus) || String(userLoginStatus).includes(\"false\")) {\n var dummy_data = {\n 'fsg': {\n '_d': \"0\",\n '_t': \"75\"\n },\n 'timestamp': timestamp,\n 'visitorId': vID\n };\n\n localStorage.setItem('z1_fsg_data', JSON.stringify(dummy_data));\n send = true;\n\n } else {\n if (debugScr) console.log(\"[ZineOne] TIME_TO_LIVE still live\"); // therefore dont send event\n //fsg(fsg_data); //CALL FUNC\n setTimeout(function() {\n let fsg_event = new CustomEvent('onZ1RawData', {\n detail: JSON.parse(localStorage.getItem(\"z1_fsg_data\"))\n });\n document.dispatchEvent(fsg_event);\n }, 400);\n }\n // Venkat - 11/28/2018 - on checkout page set the dummy data only if fsg_data is null\n } else if (fsg_data == null) { // fsg data null\n send = true;\n\n if (debugScr) console.log(\"[ZineOne] first fsg, setting dummy data\");\n\n var dummy_data = {\n 'fsg': {\n '_d': \"0\",\n '_t': \"75\"\n },\n 'timestamp': timestamp,\n 'visitorId': vID\n };\n\n localStorage.setItem('z1_fsg_data', JSON.stringify(dummy_data)); // setting dummy data\n\n }\n\n if (send ) { //send, checkout and loggedIn filter !!!! removed && (isNumeric((vID)))\n if (!isNumeric(vID)) {\n if (debugScr) console.log(\"[ZineOne] Anonymous user - \" + vID);\n var anon_fsg_data = {\n 'fsg': {\n '_d': \"1\",\n '_t': \"75\"\n },\n 'timestamp': timestamp,\n 'visitorId': vID\n };\n localStorage.setItem('z1_fsg_data', JSON.stringify(anon_fsg_data));\n // fsg(JSON.stringify(anon_fsg_data));\n setTimeout(function() {\n let raw_data_event = new CustomEvent('onZ1RawData', {\n detail: JSON.parse(localStorage.getItem(\"z1_fsg_data\"))\n });\n document.dispatchEvent(raw_data_event);\n }, 400);\n\n } else {\n\n var dummy_data = {\n 'fsg': {\n '_d': \"0\",\n '_t': \"75\"\n },\n 'timestamp': timestamp,\n 'visitorId': vID\n };\n localStorage.setItem('z1_fsg_data', JSON.stringify(dummy_data)); // setting dummy data\n\n var evtNoData = {};\n //ZineOne.pushEvent(\"_ws_z1__sb_fsg\", evtData);\n ZineOne.pushEvent(\"_ws_z1__sb_fsg\", evtNoData);\n\n if (debugScr) console.log(\"[ZineOne] Known user - \" + vID);\n if (debugScr) console.log(\"[ZineOne] pushing fsg \" + vID);\n }\n } else {\n if (debugScr) console.log(\"[ZineOne] Event not sent; or checkout\");\n }*/\n //}\n\n }\n\n function setKohlsId() {\n /*\n var cusId = pageData.customerDetails.customerID;\n if (isNumeric(cusId)) {\n ZineOne.setCustomerId(cusId);\n if (debugScr) console.log(\"[ZineOne] Found the customer Id from pageData : \" + cusId);\n }\n */\n var vID = getCookie(\"VisitorId\");\n if (debugScr) console.log(\"[ZineOne] cookie_VisitorId : \" + vID);\n if (isNumeric(vID)) {\n ZineOne.setCustomerId(vID);\n if (debugScr) console.log(\"[ZineOne] Found the customer Id from cookie_VisitorId : \" + vID);\n }\n }\n\n /*function getTotalSKUInventory(qtyInfo) {\n var sumQty = 0;\n if (qtyInfo) {\n var totalSKUs = qtyInfo.length;\n for (i = 0; i < totalSKUs; i++) {\n qtyObj = qtyInfo[i];\n if (qtyObj && qtyObj.ShipAvlQty)\n sumQty = sumQty + Number(qtyObj.ShipAvlQty);\n }\n }\n return sumQty;\n }*/\n\n function addEventData() {\n if (pageData && pageData.customerDetails) {\n if (!isSoftLoggedIn || (isSoftLoggedIn && !isSoftLoggedIn.includes(\"true\"))) {\n if (pageData.customerDetails.isLoggedIn) isLoggedIn = \"true\";\n }\n\n setKohlsId();\n\n /*\n var cusId = pageData.customerDetails.customerID;\n\n if (isNumeric(cusId)) {\n ZineOne.setCustomerId(cusId);\n if (debugScr) console.log(\"[ZineOne] Found the customer Id from pageData : \" + cusId);\n }*/\n } else {\n if (debugScr) console.log(\"[ZineOne] pageData NOT initialized. Cannot set customerId or login state.\");\n }\n\n // Check Items in Cart, not avail on PDP\n if (pgName != \"PDP\") {\n var itemsInBag = 0;\n var cartItems, cartId, cartTotalValue, cartSubTotalValue, cartShippingValue, cartDiscountValue;\n if (pageData && pageData.cartDetails) {\n itemsInBag = pageData.cartDetails.numberOfItems;\n if (debugScr) console.log('[ZineOne] Number of Items in the cart: ' + itemsInBag);\n cartId = pageData.cartDetails.cartID;\n cartTotalValue = pageData.cartDetails.cartTotalValue;\n cartSubTotalValue = pageData.cartDetails.cartSubTotalValue;\n cartShippingValue = pageData.cartDetails.shippingValue;\n cartDiscountValue = pageData.cartDetails.discountValue;\n\n //cartItems = pageData.cartDetails.cartItems;\n cartItems = getCartData();\n if (debugScr) console.log(\"[ZineOne] cartItems ==>\" + cartItems);\n }\n\n //ZineOne.setCustomKey(\"customerId\", RRTrackingBean.profileId);\n // replace e with var from webstore page (consider profile attr per Manish)\n // maybe do on page unload so you grab it once on first page and use it afterwards\n evtData.itemsInBag = itemsInBag;\n if (cartId) evtData.cartId = cartId;\n if (cartTotalValue) evtData.cartTotalValue = cartTotalValue;\n if (cartSubTotalValue) evtData.cartSubTotalValue = cartSubTotalValue;\n if (cartShippingValue) evtData.cartShippingValue = cartShippingValue;\n if (cartDiscountValue) evtData.cartDiscountValue = cartDiscountValue;\n if (cartItems) evtData.cartItems = cartItems;\n if (debugScr) console.log(\"[ZineOne] cartItems ==>\" + cartItems);\n }\n\n if (pgName == \"PDP\") {\n\n if (pageData.productDetails && pageData.productDetails.pageItems && pageData.productDetails.pageItems[0] && pageData.productDetails.pageItems[0].productID) {\n evtData.productId = pageData.productDetails.pageItems[0].productID;\n }\n console.log(\"myId ==> \",myId);\n if(!evtData.productId){\n //if (myId == \"3000000074262095\"){\n if(productV2JsonData && productV2JsonData.webID){\n console.log(\"productId ==> \",productV2JsonData.webID);\n evtData.productId=productV2JsonData.webID;\n }\n //}\n }\n \n\n if (pageData.productDetails && pageData.productDetails.pageItems && pageData.productDetails.pageItems[0] && pageData.productDetails.pageItems[0].isOnSale) {\n evtData.isOnSale = pageData.productDetails && pageData.productDetails.pageItems[0] && pageData.productDetails.pageItems[0].isOnSale;\n }\n\n if (pageData.productDetails && pageData.productDetails.pageItems && pageData.productDetails.pageItems[0] && pageData.productDetails.pageItems[0].salePrice) {\n evtData.salePrice = pageData.productDetails && pageData.productDetails.pageItems[0] && pageData.productDetails.pageItems[0].salePrice;\n }\n\n if (pageData.productDetails && pageData.productDetails.pageItems && pageData.productDetails.pageItems[0] && pageData.productDetails.pageItems[0].originalPrice) {\n evtData.originalPrice = pageData.productDetails && pageData.productDetails.pageItems[0] && pageData.productDetails.pageItems[0].originalPrice;\n }\n\n evtData.PDPCategory = pageData.productDetails && pageData.productDetails.categoryName;\n // This is PDP scarcity inventory info\n if (pageData && pageData.productDetails && pageData.productDetails.pageItems && pageData.productDetails.pageItems.QtyInfo) {\n //evtData.sumQtyInfo = getTotalSKUInventory(pageData.productDetails.pageItems.QtyInfo);\n evtData.prd_inv = JSON.stringify(pageData.productDetails.pageItems.QtyInfo);\n }\n\n }\n\n var isLoyaltyPilotUser = isValid(pageData) && isValid(pageData.customerDetails) && isValid(pageData.customerDetails.kohlsLoyalty2018Member) && pageData.customerDetails.kohlsLoyalty2018Member;\n var isLoyaltyPilotMVCUser = isValid(pageData) && isValid(pageData.customerDetails) && isValid(pageData.customerDetails.kohlsLoyalty2018EliteMember) && pageData.customerDetails.kohlsLoyalty2018EliteMember;\n var isLoyaltyUser = isLoyaltyPilotUser || isLoyaltyPilotMVCUser;\n //New Requirement from Shilpa for Abandoned Cart, 03/22/2019\n if (isLoyaltyUser) evtData[\"loyaltyUser\"] = isLoyaltyUser;\n\n var notificationpopoverId = document.getElementById(\"notificationpopover\");\n var kcNotificationPopoverInnerHTML = \"\";\n if (isValid(notificationpopoverId)) {\n kcNotificationPopoverInnerHTML = document.getElementById(\"notificationpopover\").innerHTML;\n }\n\n\n var kcMidPageBanner = (isValid($env.ksLoyaltyV2) && ($env.ksLoyaltyV2 == true) && isValid($(\"#fancybox-content .notificationPanelContent-kcreminder-v2\")) && $(\"#fancybox-content .notificationPanelContent-kcreminder-v2\").length >= 1) ? true : false;\n //evtData[\"kcNotificationBannerSeen\"] = kcNotificationPopoverInnerHTML != \"\" ? true : false;\n\n evtData[\"kcNotificationBannerSeen\"] = (kcNotificationPopoverInnerHTML != \"\" || kcMidPageBanner) ? true : false;\n\n var aka_hp2_cookie = getCookie(\"AKA_HP2\");\n var aka_rv_cookie = getCookie(\"AKA_RV\");\n evtData[\"aka_hp2\"] = isValid(aka_hp2_cookie) ? aka_hp2_cookie : \"\";\n evtData[\"aka_rv\"] = isValid(aka_rv_cookie) ? aka_rv_cookie : \"\";\n\n //guest user cookie check \n var dyn_user_id = getCookie(\"DYN_USER_ID\");\n evtData[\"dyn_user_id\"] = isValid(dyn_user_id) ? true : false;\n\n\n //PerkPerf Start\n try {\n var birthday_cookie_flag = '';\n\n var cookie_title = \"z1_perk_perf\";\n\n var birthday_cookie = getBirthdayCookie(cookie_title);\n\n console.log(\"READ birthday_cookie\" + birthday_cookie);\n\n if (isValid(birthday_cookie)) {\n\n birthday_cookie_flag = birthday_cookie;\n\n } else {\n\n birthday_cookie_flag = '';\n\n }\n\n evtData[\"birthday_cookie\"] = birthday_cookie_flag;\n\n } catch (cookerr) {\n console.log(\"bday cookie error\", cookerr);\n }\n\n\n try {\n\n var dataLayerCustomerDetails = JSON.parse(localStorage.getItem(\"dataLayerCustomerDetails\"));\n\n evtData[\"isMVCUser\"] = $env.rewardsPilot;\n\n var kl_id = dataLayerCustomerDetails.kohlsLoyaltyID;\n var kl_id_flag = kl_id.includes(\"N/A\");\n\n if (!(kl_id_flag) && String($env.rewardsPilot) == \"false\") {\n evtData[\"isY2YUser\"] = \"true\";\n } else {\n evtData[\"isY2YUser\"] = \"false\";\n }\n\n\n console.log(\"[Z1]READ cookie UserType::\" + evtData);\n console.log(\"[Z1]READ cookie UserType::stringify\" + JSON.stringify(evtData));\n\n\n } catch (errUserType) {\n console.log(\"bday cookie errUserType\", errUserType);\n }\n\n ///kkk new end\n\n //check for customerid if non-numeric\n var cust_id_non_numeric = localStorage.getItem('dataLayerCustomerDetails');\n if (isValid(cust_id_non_numeric)) {\n var isGuestUser_id = isNaN(JSON.parse(cust_id_non_numeric).customerID);\n evtData[\"isGuestUser_id_NAN\"] = isGuestUser_id;\n\n }\n\n //PerkPerf End\n\n //Check cookie: digiNotify\n var digiNotify = getCookie(\"digiNotify\");\n if (debugScr) console.log(\"[ZineOne] digiNotify value is:\" + digiNotify);\n\n if (digiNotify)\n evtData[\"digiNotify\"] = digiNotify;\n\n //Reqards Data start\n try {\n var rewardsData = localStorage.getItem('z1_rewardsData');\n\n if (isValid(rewardsData)) {\n evtData[\"rewardsData\"] = JSON.stringify(rewardsData);\n } \n } catch (errr) {\n console.log(\"rewardsData\" + errr);\n }\n //Reqards Data end\n\n\n if (isSoftLoggedIn) evtData[\"isSoftLoggedIn\"] = isSoftLoggedIn;\n if (isLoggedIn) evtData[\"isLoggedIn\"] = isLoggedIn;\n if (debugScr) console.log(\"[ZineOne] evtName = \" + evtName);\n if (debugScr) console.log(\"[ZineOne] evtData =\" + JSON.stringify(evtData));\n return true;\n }\n //ZineOne.pushEvent(evtName, evtData);\n\n /*\n window.addEventListener(\"beforeunload\", function(e) {\n var _z1_el = document.activeElement;\n //console.log('[ZineOne] activeElement = ' + _z1_el);\n //is usr leaving the site?\n //if ((_z1_el.nodeName === 'BODY') || (_z1_el.href && _z1_el.href.indexOf('kohls.com/') === -1))\n {\n //send event\n var _z1_timeOnPage = parseInt((performance.now() - _z1_pgStart) / 1000);\n var _z1_evtMap = {\n 'pgName': pgName,\n 'timeOnPage': _z1_timeOnPage,\n 'url': document.URL,\n 'ae': document.activeElement.nodeName\n };\n ZineOne.pushEvent(\"_z1_pageUnloaded\", _z1_evtMap);\n // console.log('[ZineOne] fired _z1_pageUnloaded with pgName=' + _z1_pageName + ', url=' + document.URL + ' and timeOnPage=' + _z1_timeOnPage);\n }\n });\n */\n\n\n\n\n function getUrlParameter(sParam) {\n var sPageURL = decodeURIComponent(window.location.search.substring(1)),\n sURLVariables = sPageURL.split('&'),\n sParameterName,\n i;\n\n for (i = 0; i < sURLVariables.length; i++) {\n sParameterName = sURLVariables[i].split('=');\n\n if (sParameterName[0] === sParam) {\n return sParameterName[1] === undefined ? true : sParameterName[1];\n }\n }\n }\n\n\n\n\n function validateForNotNull(obj) {\n //console.log('validateForNotNull',obj,typeof(obj));\n if (!(obj === undefined) && obj != null && obj != 'null' && obj.toString().length != 0) {\n return true;\n }\n\n return false;\n }\n\n function spltArrayObjectDataIntoVector(array, attribute) {\n var stringVector = '';\n\n if (debugScr) console.log(\"spltArrayObjectDataIntoVector attribute\", attribute, array);\n\n if (!validateForNotNull(array)) {\n\n return stringVector;\n\n }\n\n if (array.length == 0) {\n return stringVector;\n }\n\n\n for (var i = 0; i < array.length; i++) {\n var innerObj = array[i];\n\n var attributeValue = '#';\n if (validateForNotNull(innerObj) && validateForNotNull(innerObj[attribute])) {\n\n attributeValue = innerObj[attribute];\n\n }\n\n\n stringVector = stringVector + attributeValue + '^';\n }\n\n stringVector = stringVector.substring(0, stringVector.length - 1);\n\n return stringVector;\n\n }\n\n function spltArrayObjectWithArrayObjectDataIntoVector(array, mainAttribute, innerAttribute) {\n var stringVector = '';\n\n if (debugScr) console.log(\"spltArrayObjectWithArrayObjectDataIntoVector mainAttribute\", mainAttribute, innerAttribute, array);\n\n\n if (!validateForNotNull(array)) {\n\n return stringVector;\n\n }\n\n if (array.length == 0) {\n return stringVector;\n }\n\n\n for (var i = 0; i < array.length; i++) {\n var innerObj = array[i];\n var attributeValueArr = innerObj[mainAttribute];\n\n if (debugScr) console.log('spltArrayObjectDataIntoVector ', spltArrayObjectDataIntoVector(attributeValueArr, innerAttribute));\n stringVector = stringVector + spltArrayObjectDataIntoVector(attributeValueArr, innerAttribute) + '^';\n }\n\n stringVector = stringVector.substring(0, stringVector.length - 1);\n\n return stringVector;\n\n }\n\n\n function spltArrayObjectWithAttributeObjectDataIntoVector(array, mainAttribute, innerAttribute) {\n\n var stringVector = '';\n\n if (!validateForNotNull(array)) {\n\n return stringVector;\n\n }\n\n if (array.length == 0) {\n return stringVector;\n }\n\n for (var i = 0; i < array.length; i++) {\n var innerObj = array[i];\n\n var attributeValue = '-';\n if (validateForNotNull(innerObj) && validateForNotNull(innerObj[mainAttribute]) && validateForNotNull(innerObj[mainAttribute][innerAttribute])) {\n\n attributeValue = innerObj[mainAttribute][innerAttribute];\n\n }\n\n\n stringVector = stringVector + attributeValue + '~';\n }\n\n stringVector = stringVector.substring(0, stringVector.length - 1);\n\n return stringVector;\n\n }\n\n\n function onceInSessionAttributes(eventData) {\n var finalReturnObj = eventData;\n\n var persistLocalData = localStorage.getItem('persistent_bar_components_json_v1');\n if(!isValid(persistLocalData)){\n persistLocalData = (isValid(Kjs) && isValid(Kjs.PB) && isValid(Kjs.PB.getPbCartStorage())) ? JSON.stringify(Kjs.PB.getPbCartStorage()) : \"null\";\n }\n\n if (validateForNotNull(persistLocalData)) {\n\n var pageDataJson = pageData;\n persistLocalData = JSON.parse(persistLocalData);\n\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.incentiveAmount)) {\n finalReturnObj.incdet_incamnt = persistLocalData.incentiveDetails.incentiveAmount;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.incentiveType)) {\n finalReturnObj.incdet_inctype = persistLocalData.incentiveDetails.incentiveType;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.smartIncentiveStatus)) {\n finalReturnObj.incdet_smartincstatus = persistLocalData.incentiveDetails.smartIncentiveStatus;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.incentiveThreshold)) {\n finalReturnObj.incdet_incthreshold = persistLocalData.incentiveDetails.incentiveThreshold;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.incentiveEligible)) {\n finalReturnObj.incdet_inceligible = persistLocalData.incentiveDetails.incentiveEligible;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.incentiveQualified)) {\n finalReturnObj.incdet_incqualifed = persistLocalData.incentiveDetails.incentiveQualified;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.minCartThresholdMet)) {\n finalReturnObj.incdet_minicartthresholdmet = persistLocalData.incentiveDetails.minCartThresholdMet;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.customerHasKohlsCharge)) {\n finalReturnObj.custdet_custhaskohlschrg = persistLocalData.customerDetails.customerHasKohlsCharge;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.customerPostalCode)) {\n finalReturnObj.custdet_custpostalcode = persistLocalData.customerDetails.customerPostalCode;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.myStoreId)) {\n finalReturnObj.custdet_mystoreid = persistLocalData.customerDetails.myStoreId;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.rewardsPilotService)) {\n finalReturnObj.custdet_rewardspilotser = persistLocalData.customerDetails.rewardsPilotService;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.kohlsLoyalty2018EliteMember)) {\n finalReturnObj.custdet_lytelitemember = persistLocalData.customerDetails.kohlsLoyalty2018EliteMember;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.kohlsLoyalty2018Member)) {\n finalReturnObj.custdet_lytmember = persistLocalData.customerDetails.kohlsLoyalty2018Member;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.rewards) && validateForNotNull(persistLocalData.purchaseEarnings.rewards.loyaltyPointBalance)) {\n finalReturnObj.usrdata_lytypntbal = persistLocalData.purchaseEarnings.rewards.loyaltyPointBalance;\n }\n\n if (validateForNotNull(persistLocalData.userData) && validateForNotNull(persistLocalData.userData.optInIndicator)) {\n finalReturnObj.usrdata_optinindict = persistLocalData.userData.optInIndicator;\n }\n\n if (validateForNotNull(persistLocalData.userData) && validateForNotNull(persistLocalData.userData.accountStatus)) {\n finalReturnObj.usrdata_accstatus = persistLocalData.userData.accountStatus;\n }\n\n if (validateForNotNull(persistLocalData.userData) && validateForNotNull(persistLocalData.userData.storeNum)) {\n finalReturnObj.usrdata_strnum = persistLocalData.userData.storeNum;\n }\n\n if (validateForNotNull(persistLocalData.userData) && validateForNotNull(persistLocalData.userData.isEnrolledUser)) {\n finalReturnObj.usrdata_isenrusr = persistLocalData.userData.isEnrolledUser;\n }\n\n if (validateForNotNull(persistLocalData.userData) && validateForNotNull(persistLocalData.userData.sessionStatus)) {\n finalReturnObj.usrdata_sesstatus = persistLocalData.userData.sessionStatus;\n }\n\n if (validateForNotNull(pageDataJson.pageDetails) && validateForNotNull(pageDataJson.pageDetails.browserPostalCode)) {\n finalReturnObj.pgdata_pgdet_brwpostalcode = pageDataJson.pageDetails.browserPostalCode;\n }\n\n if (validateForNotNull(pageDataJson.customerDetails) && validateForNotNull(pageDataJson.customerDetails.customerPostalCode)) {\n finalReturnObj.pgdata_custdet_custpostalcode = pageDataJson.customerDetails.customerPostalCode;\n }\n\n\n\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.rewards) && validateForNotNull(persistLocalData.purchaseEarnings.rewards.awayPoints)) {\n finalReturnObj.purear_rwds_awaypnts = persistLocalData.purchaseEarnings.rewards.awayPoints;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.rewards) && validateForNotNull(persistLocalData.purchaseEarnings.rewards.ltyRewardThresholdValue)) {\n finalReturnObj.purear_rwds_lytrwdthreshval = persistLocalData.purchaseEarnings.rewards.ltyRewardThresholdValue;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.rewards) && validateForNotNull(persistLocalData.purchaseEarnings.rewards.loyaltyPointBalance)) {\n finalReturnObj.purear_rwds_lytpntbal = persistLocalData.purchaseEarnings.rewards.loyaltyPointBalance;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.rewards) && validateForNotNull(persistLocalData.purchaseEarnings.rewards.currentPurchaseEarnPoint)) {\n finalReturnObj.purear_rwds_curpurearnpnt = persistLocalData.purchaseEarnings.rewards.currentPurchaseEarnPoint;\n }\n\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash.qualificationAmount)) {\n finalReturnObj.purear_kc_qlfyamnt = persistLocalData.purchaseEarnings.kohlsCash.qualificationAmount;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash.earnAmount)) {\n finalReturnObj.purear_kc_earnamnt = persistLocalData.purchaseEarnings.kohlsCash.earnAmount;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash.currentPurchaseEarnAmount)) {\n finalReturnObj.purear_kc_curpurearnamnt = persistLocalData.purchaseEarnings.kohlsCash.currentPurchaseEarnAmount;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash.awayAmount)) {\n finalReturnObj.purear_kc_awayamnt = persistLocalData.purchaseEarnings.kohlsCash.awayAmount;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCashEarnings)) {\n finalReturnObj.purear_kcearnings = persistLocalData.purchaseEarnings.kohlsCashEarnings;\n }\n\n if (validateForNotNull(persistLocalData.addressDetails) && validateForNotNull(persistLocalData.addressDetails.billingAddress[0]) && validateForNotNull(persistLocalData.addressDetails.billingAddress[0].postalCode)) {\n finalReturnObj.addrdet_biladdr_postalcode = spltArrayObjectDataIntoVector(persistLocalData.addressDetails.billingAddress, 'postalCode');\n }\n\n }\n\n\n\n\n return finalReturnObj;\n }\n\n function fetchFilterData(cnString, oldCnFromEvent) {\n var finalReturnString = '';\n\n var splitCnString = cnString.toString().split(\"+\");\n\n var currentFilterObj = {};\n var oldCnFromEventSplit = oldCnFromEvent.toString().split(\"|\");\n\n //console.log('oldCnFromEventSplit',oldCnFromEventSplit,oldCnFromEventSplit.length);\n\n for (var i = (oldCnFromEventSplit.length - 1); i >= 0; i--) {\n if (oldCnFromEventSplit[i].length == 0 || oldCnFromEventSplit[i] == '-') {\n continue;\n }\n\n var innerObj = oldCnFromEventSplit[i].split(\"+\");\n\n if (innerObj.length > 0) {\n for (var k = 0; k < innerObj.length; k++) {\n var filterObj = innerObj[k].split(\":\");\n var filterName = filterObj[0];\n var filterValue = filterObj[1];\n\n currentFilterObj[filterName] = filterValue;\n }\n\n break;\n }\n\n }\n\n var alreadyUsedObj = {};\n\n //console.log(splitCnString);\n for (var i = 0; i < splitCnString.length; i++) {\n var filterObj = splitCnString[i].split(\":\");\n var filterName = filterObj[0];\n\n //console.log('Filter Name ',filterName);\n //console.log('Filter Value ',filterValue);\n\n if (filterName in alreadyUsedObj) {\n continue;\n }\n\n alreadyUsedObj[filterName] = true;\n\n if (filterName in currentFilterObj) {\n currentFilterObj[filterName] = Number(currentFilterObj[filterName]) + 1;\n } else {\n currentFilterObj[filterName] = 1;\n }\n\n\n }\n\n //console.log('currentFilterObj',currentFilterObj);\n\n var filterkeys = Object.keys(currentFilterObj);\n for (var i = 0; i < filterkeys.length; i++) {\n finalReturnString = finalReturnString + filterkeys[i] + ':' + currentFilterObj[filterkeys[i]] + '+';\n }\n\n finalReturnString = finalReturnString.substring(0, finalReturnString.length - 1);\n\n return finalReturnString;\n\n\n }\n\n function fetchNewAttributesForVectorization(eventData, eventName) {\n var finalReturnObj = eventData;\n\n var persistLocalData = localStorage.getItem('persistent_bar_components_json_v1');\n if(persistLocalData && !isValid(persistLocalData)){\n persistLocalData = (isValid(Kjs) && isValid(Kjs.PB) && isValid(Kjs.PB.getPbCartStorage())) ? JSON.stringify(Kjs.PB.getPbCartStorage()) : \"null\";\n }\n\n if (validateForNotNull(persistLocalData)) {\n var pageDataJson = pageData;\n\n persistLocalData = JSON.parse(persistLocalData);\n\n console.log('Into switch in fetchNewAttributesForVectorization', eventName);\n\n if (debugScr) console.log('Into switch in fetchNewAttributesForVectorization', eventName);\n\n switch (eventName.toLowerCase()) {\n case \"_ws_viewedcatalog\":\n\n if (validateForNotNull(pageDataJson.pmpDetails) && validateForNotNull(pageDataJson.pmpDetails.categoryName)) {\n finalReturnObj.pgdata_pmpdet_catname = pageDataJson.pmpDetails.categoryName;\n }\n\n if (validateForNotNull(pageDataJson.pmpDetails) && validateForNotNull(pageDataJson.pmpDetails.subcategoryName)) {\n finalReturnObj.pgdata_pmpdet_subcatname = pageDataJson.pmpDetails.subcategoryName;\n }\n\n if (validateForNotNull(pageDataJson.pmpDetails) && validateForNotNull(pageDataJson.pmpDetails.findingName)) {\n finalReturnObj.pgdata_pmpdet_findingname = pageDataJson.pmpDetails.findingName;\n }\n\n if (validateForNotNull(pageDataJson.pmpDetails) && validateForNotNull(pageDataJson.pmpDetails.keywords)) {\n finalReturnObj.pgdata_pmpdet_cat_keywords = pageDataJson.pmpDetails.keywords;\n }\n\n if (validateForNotNull(pageDataJson.pmpDetails) && validateForNotNull(pageDataJson.pmpDetails.pageFilter)) {\n finalReturnObj.pgdata_pmpdet_pgfilter = pageDataJson.pmpDetails.pageFilter;\n }\n\n if (validateForNotNull(pageDataJson.pmpDetails) && validateForNotNull(pageDataJson.pmpDetails.departmentName)) {\n finalReturnObj.pgdata_pmpdet_deptname = pageDataJson.pmpDetails.departmentName;\n }\n\n if (validateForNotNull(pageDataJson.pmpDetails) && validateForNotNull(pageDataJson.pmpDetails.genderValues)) {\n finalReturnObj.pgdata_pmpdet_gendervalues = pageDataJson.pmpDetails.genderValues;\n }\n\n\n var newUserVectors = localStorage.getItem('z1_newUserVectors');\n\n if (newUserVectors && newUserVectors.length > 0) {\n var newUserVectorsJson = JSON.parse(newUserVectors);\n var currentFilterString = newUserVectorsJson.filter_by_count;\n\n if (validateForNotNull(getUrlParameter('CN')) && validateForNotNull(currentFilterString)) {\n finalReturnObj.filter_by_count = fetchFilterData(getUrlParameter('CN'), currentFilterString);\n }\n\n } else {\n if (validateForNotNull(getUrlParameter('CN'))) {\n finalReturnObj.filter_by_count = fetchFilterData(getUrlParameter('CN'), '');\n }\n\n }\n\n var selectFilter = document.getElementById('sortby_select');\n if (selectFilter) {\n var selectedValue = selectFilter.options[selectFilter.selectedIndex].value;\n if (validateForNotNull(selectedValue)) {\n finalReturnObj.sort_by = selectedValue;\n }\n }\n\n break;\n\n case \"_ws_viewedproduct\":\n\n if (debugScr) console.log('Into _ws_viewedproduct in fetchNewAttributesForVectorization');\n if (validateForNotNull(pageDataJson.productDetails) && validateForNotNull(pageDataJson.productDetails.collectionID)) {\n finalReturnObj.pgdata_proddet_colid = pageDataJson.productDetails.collectionID;\n }\n\n if (validateForNotNull(pageDataJson.productDetails) && validateForNotNull(pageDataJson.productDetails.pageItems) && validateForNotNull(pageDataJson.productDetails.pageItems[0]) && validateForNotNull(pageDataJson.productDetails.pageItems[0].SKUS)) {\n finalReturnObj.prod_sku_count = pageDataJson.productDetails.pageItems[0].SKUS.length;\n }\n\n\n var skuCode = Kjs.mainPanel.getBagItem(\"skuId\");\n var skuSize = Kjs.mainPanel.getBagItem('size');\n var skuColor = Kjs.mainPanel.getBagItem('color');\n var regularPrice = Kjs.mainPanel.getBagItem('regularPrice');\n var salePrice = Kjs.mainPanel.getBagItem('salePrice');\n\n if (validateForNotNull(skuCode)) {\n finalReturnObj.selected_sku = skuCode;\n\n if (validateForNotNull(pageDataJson.productDetails) && validateForNotNull(pageDataJson.productDetails.pageItems) && validateForNotNull(pageDataJson.productDetails.pageItems.QtyInfo)) {\n\n var currentQtyInfo = pageDataJson.productDetails.pageItems.QtyInfo;\n\n for (var k = 0; k < currentQtyInfo.length; k++) {\n var innerObj = currentQtyInfo[k];\n if (innerObj.skuCode == skuCode) {\n finalReturnObj.sku_bopus_avail = innerObj.BopusAvlQty;\n finalReturnObj.sku_boss_avail = innerObj.BossAvlQty;\n finalReturnObj.sku_ship_avail = innerObj.ShipAvlQty;\n break;\n }\n }\n\n\n\n }\n }\n\n if (validateForNotNull(skuColor)) {\n finalReturnObj.selected_sku_color = skuColor;\n }\n\n if (validateForNotNull(skuSize)) {\n finalReturnObj.selected_sku_size = skuSize;\n }\n\n if (validateForNotNull(regularPrice)) {\n finalReturnObj.sku_reg_price = regularPrice.replace(\"$\", \"\");\n }\n\n if (validateForNotNull(salePrice)) {\n finalReturnObj.selected_sku_sale_price = salePrice.replace(\"$\", \"\");\n\n var regPriceNum = Number(finalReturnObj.sku_reg_price);\n var salePriceNum = Number(finalReturnObj.selected_sku_sale_price);\n\n if (!isNaN(salePriceNum)) {\n finalReturnObj.sku_per_dis = (((regPriceNum - salePriceNum) * (100)) / regPriceNum).toFixed(2);\n }\n\n }\n\n if (validateForNotNull(pageDataJson.productDetails) && validateForNotNull(pageDataJson.productDetails.categoryName)) {\n finalReturnObj.pgdata_proddet_catname = pageDataJson.productDetails.categoryName;\n }\n\n if (validateForNotNull(pageDataJson.productDetails) && validateForNotNull(pageDataJson.productDetails.subcategoryName)) {\n finalReturnObj.pgdata_proddet_subcatname = pageDataJson.productDetails.subcategoryName;\n }\n\n if (validateForNotNull(pageDataJson.productDetails) && validateForNotNull(pageDataJson.productDetails.departmentName)) {\n finalReturnObj.pgdata_proddet_deptname = pageDataJson.productDetails.departmentName;\n }\n\n\n break;\n\n\n case \"_ws_viewedsku\":\n\n if (debugScr) console.log('Into _ws_viewedproduct in fetchNewAttributesForVectorization');\n\n var skuCode = Kjs.mainPanel.getBagItem(\"skuId\");\n var skuSize = Kjs.mainPanel.getBagItem('size');\n var skuColor = Kjs.mainPanel.getBagItem('color');\n var regularPrice = Kjs.mainPanel.getBagItem('regularPrice');\n var salePrice = Kjs.mainPanel.getBagItem('salePrice');\n\n\n if (validateForNotNull(skuCode)) {\n finalReturnObj.selected_sku = skuCode;\n\n if (validateForNotNull(pageDataJson.productDetails) && validateForNotNull(pageDataJson.productDetails.pageItems) && validateForNotNull(pageDataJson.productDetails.pageItems.QtyInfo)) {\n\n var currentQtyInfo = pageDataJson.productDetails.pageItems.QtyInfo;\n\n for (var k = 0; k < currentQtyInfo.length; k++) {\n var innerObj = currentQtyInfo[k];\n if (innerObj.skuCode == skuCode) {\n finalReturnObj.sku_bopus_avail = innerObj.BopusAvlQty;\n finalReturnObj.sku_boss_avail = innerObj.BossAvlQty;\n finalReturnObj.sku_ship_avail = innerObj.ShipAvlQty;\n break;\n }\n }\n\n\n\n }\n }\n\n if (validateForNotNull(skuColor)) {\n finalReturnObj.selected_sku_color = skuColor;\n }\n\n if (validateForNotNull(skuSize)) {\n finalReturnObj.selected_sku_size = skuSize;\n }\n\n if (validateForNotNull(regularPrice)) {\n finalReturnObj.sku_reg_price = regularPrice.replace(\"$\", \"\");\n }\n\n if (validateForNotNull(salePrice)) {\n finalReturnObj.selected_sku_sale_price = salePrice.replace(\"$\", \"\");\n\n var regPriceNum = Number(finalReturnObj.sku_reg_price);\n var salePriceNum = Number(finalReturnObj.selected_sku_sale_price);\n\n\n finalReturnObj.sku_per_dis = (((regPriceNum - salePriceNum) * (100)) / regPriceNum).toFixed(2);\n }\n\n if (validateForNotNull(pageDataJson.productDetails) && validateForNotNull(pageDataJson.productDetails.categoryName)) {\n finalReturnObj.pgdata_proddet_catname = pageDataJson.productDetails.categoryName;\n }\n\n if (validateForNotNull(pageDataJson.productDetails) && validateForNotNull(pageDataJson.productDetails.subcategoryName)) {\n finalReturnObj.pgdata_proddet_subcatname = pageDataJson.productDetails.subcategoryName;\n }\n\n if (validateForNotNull(pageDataJson.productDetails) && validateForNotNull(pageDataJson.productDetails.departmentName)) {\n finalReturnObj.pgdata_proddet_deptname = pageDataJson.productDetails.departmentName;\n }\n\n if (validateForNotNull(pageDataJson.productDetails)) {\n finalReturnObj.selected_prd_id = (pageDataJson.productDetails && pageDataJson.productDetails.pageItems[0] && pageDataJson.productDetails.pageItems[0].productID) || '-';\n }\n\n break;\n\n\n case \"_ws_searched\":\n\n if (validateForNotNull(pageDataJson.pmpDetails) && validateForNotNull(pageDataJson.pmpDetails.keywords)) {\n finalReturnObj.pgdata_pmpdet_search_keywords = pageDataJson.pmpDetails.keywords;\n }\n\n var newUserVectors = localStorage.getItem('z1_newUserVectors');\n\n if (newUserVectors && newUserVectors.length > 0) {\n var newUserVectorsJson = JSON.parse(newUserVectors);\n var currentFilterString = newUserVectorsJson.filter_by_count;\n\n if (validateForNotNull(getUrlParameter('CN')) && validateForNotNull(currentFilterString)) {\n finalReturnObj.filter_by_count = fetchFilterData(getUrlParameter('CN'), currentFilterString);\n }\n\n } else {\n if (validateForNotNull(getUrlParameter('CN'))) {\n finalReturnObj.filter_by_count = fetchFilterData(getUrlParameter('CN'), '');\n }\n\n }\n\n var selectFilter = document.getElementById('sortby_select');\n if (selectFilter) {\n var selectedValue = selectFilter.options[selectFilter.selectedIndex].value;\n if (validateForNotNull(selectedValue)) {\n finalReturnObj.sort_by = selectedValue;\n }\n }\n\n break;\n\n\n case \"_ws_viewedcart\":\n\n if (validateForNotNull(pageDataJson.pageDetails) && validateForNotNull(pageDataJson.pageDetails.clientPostalCode)) {\n finalReturnObj.pgdata_pddetails_clientpostalcode = pageDataJson.pageDetails.clientPostalCode;\n }\n\n break;\n\n case \"_ws_update_hcart\":\n\n\n var currentCartUpdates = localStorage.getItem('z1_current_cart_data_update');\n currentCartUpdates = JSON.parse(currentCartUpdates);\n finalReturnObj.updated_sku = currentCartUpdates.updatedSku;\n finalReturnObj.updated_sku_qty = currentCartUpdates.updatedskuQty;\n finalReturnObj.removed_sku = currentCartUpdates.removedSku;\n\n localStorage.removeItem('z1_current_cart_data_update');\n\n finalReturnObj.shpi_shpp_ogshpchrgs = spltArrayObjectWithAttributeObjectDataIntoVector(persistLocalData.shipmentInfo, 'shipmentPriceInfo', 'originalShippingCharges');\n finalReturnObj.shpi_shpp_shpchrgsafdis = spltArrayObjectWithAttributeObjectDataIntoVector(persistLocalData.shipmentInfo, 'shipmentPriceInfo', 'shippingChargesAfterDiscount');\n finalReturnObj.shpi_shpp_freeshpqlfdelta = spltArrayObjectWithAttributeObjectDataIntoVector(persistLocalData.shipmentInfo, 'shipmentPriceInfo', 'freeShipQualificationDelta');\n finalReturnObj.shpi_shpp_shpitmstotal = spltArrayObjectWithAttributeObjectDataIntoVector(persistLocalData.shipmentInfo, 'shipmentPriceInfo', 'shipmentItemsTotal');\n\n finalReturnObj.shpi_shpo_disamnt = spltArrayObjectWithArrayObjectDataIntoVector(persistLocalData.shipmentInfo, 'shippingOffers', 'discountAmount');\n\n\n if (validateForNotNull(persistLocalData.orderSummary.merchandisePromoAmount)) {\n finalReturnObj.or_merpromoamnt = persistLocalData.orderSummary.merchandisePromoAmount;\n }\n\n if (validateForNotNull(persistLocalData.orderSummary.discountedShippingAmount)) {\n finalReturnObj.or_disshpamnt = persistLocalData.orderSummary.discountedShippingAmount;\n }\n\n if (validateForNotNull(persistLocalData.orderSummary.originalShippingAmount)) {\n finalReturnObj.or_ogshpamnt = persistLocalData.orderSummary.originalShippingAmount;\n }\n\n if (validateForNotNull(persistLocalData.orderSummary.tax.estimated)) {\n finalReturnObj.or_tax_est = persistLocalData.orderSummary.tax.estimated;\n }\n\n if (validateForNotNull(persistLocalData.orderSummary.tax.taxRate)) {\n finalReturnObj.or_tax_taxrt = persistLocalData.orderSummary.tax.taxRate;\n }\n\n if (validateForNotNull(persistLocalData.orderSummary.tax.tax)) {\n finalReturnObj.or_tax_tax = persistLocalData.orderSummary.tax.tax;\n }\n\n if (validateForNotNull(persistLocalData.orderSummary.totalSurcharges)) {\n finalReturnObj.or_totalsur = persistLocalData.orderSummary.totalSurcharges;\n }\n\n if (validateForNotNull(persistLocalData.orderSummary.totalTaxFee)) {\n finalReturnObj.or_totaltaxfree = persistLocalData.orderSummary.totalTaxFee;\n }\n\n if (validateForNotNull(persistLocalData.orderSummary.totalKohlsCashAndPromoDiscounts)) {\n finalReturnObj.or_totalkcpromodis = persistLocalData.orderSummary.totalKohlsCashAndPromoDiscounts;\n }\n\n if (validateForNotNull(persistLocalData.orderSummary.totalTax)) {\n finalReturnObj.or_totaltax = persistLocalData.orderSummary.totalTax;\n }\n\n if (validateForNotNull(persistLocalData.orderSummary.total)) {\n finalReturnObj.or_total = persistLocalData.orderSummary.total;\n }\n\n if (validateForNotNull(persistLocalData.orderSummary.savings)) {\n finalReturnObj.or_savings = persistLocalData.orderSummary.savings;\n }\n\n if (validateForNotNull(persistLocalData.orderSummary.taxFeeEnabled)) {\n finalReturnObj.or_taxfeeen = persistLocalData.orderSummary.taxFeeEnabled;\n }\n\n break;\n\n }\n }\n\n\n return finalReturnObj;\n\n }\n\n function fetchCartDump() {\n\n var persistLocalData = localStorage.getItem('persistent_bar_components_json_v1');\n if(!isValid(persistLocalData)){\n persistLocalData = (isValid(Kjs) && isValid(Kjs.PB) && isValid(Kjs.PB.getPbCartStorage())) ? JSON.stringify(Kjs.PB.getPbCartStorage()) : \"null\";\n }\n\n if (validateForNotNull(persistLocalData)) {\n\n var finalCartJSON = {};\n finalCartJSON.cartItems = [];\n\n persistLocalData = JSON.parse(persistLocalData);\n\n cartData = persistLocalData.cartItems;\n\n if (validateForNotNull(cartData)) {\n for (var i = 0; i < cartData.length; i++) {\n if (i == 15) {\n break;\n }\n\n var currentFinalObjToSend = {};\n\n var currentObj = cartData[i];\n currentFinalObjToSend.sku = currentObj.skuId;\n currentFinalObjToSend.prdId = currentObj.productId;\n currentFinalObjToSend.qty = currentObj.quantity;\n\n if (validateForNotNull(currentObj.storeClearance)) {\n currentFinalObjToSend.sc = currentObj.storeClearance;\n }\n\n if (validateForNotNull(currentObj.itemProperties.size)) {\n currentFinalObjToSend.size = currentObj.itemProperties.size;\n }\n\n if (validateForNotNull(currentObj.itemProperties.color)) {\n currentFinalObjToSend.color = currentObj.itemProperties.color;\n }\n\n if (validateForNotNull(currentObj.itemProperties.isWebExclusive)) {\n currentFinalObjToSend.isWebExcl = currentObj.itemProperties.isWebExclusive;\n }\n\n\n var finalInvInfo = {};\n\n if (validateForNotNull(currentObj.inventoryInfo.shipAvailable)) {\n finalInvInfo.shpAvai = currentObj.inventoryInfo.shipAvailable;\n }\n\n if (validateForNotNull(currentObj.inventoryInfo.bopusAvailable)) {\n finalInvInfo.bopAvail = currentObj.inventoryInfo.bopusAvailable;\n }\n\n if (validateForNotNull(currentObj.inventoryInfo.bossAvailable)) {\n finalInvInfo.bosAvail = currentObj.inventoryInfo.bossAvailable;\n }\n\n if (validateForNotNull(currentObj.inventoryInfo.invOnHandQtyShip)) {\n finalInvInfo.invOHQShip = currentObj.inventoryInfo.invOnHandQtyShip;\n }\n\n if (validateForNotNull(currentObj.finalInvInfo)) {\n currentFinalObjToSend.invInfo = currentObj.finalInvInfo;\n }\n\n\n var currentPromoInfo = currentObj.promoInfo;\n\n console.log(' currentPromoInfo ', currentPromoInfo);\n\n if (validateForNotNull(currentPromoInfo)) {\n var finalPromoArray = [];\n\n var prTypeArr = [];\n var prTextArr = [];\n\n for (var j = 0; j < currentPromoInfo.length; j++) {\n var currentPromoObj = currentPromoInfo[j];\n var tempPromoObj = {};\n\n if (validateForNotNull(currentPromoObj.promoType)) {\n prTypeArr[prTypeArr.length] = currentPromoObj.promoType;\n }\n\n if (validateForNotNull(currentPromoObj.promoText)) {\n prTextArr[prTextArr.length] = currentPromoObj.promoText;\n }\n\n\n\n }\n\n currentFinalObjToSend.prType = prTypeArr.join('|');\n currentFinalObjToSend.prText = prTextArr.join('|');\n }\n\n\n\n var currentOfferInfo = currentObj.offerInfo;\n\n console.log(' currentOfferInfo ', currentOfferInfo);\n\n if (validateForNotNull(currentOfferInfo)) {\n var finalOfferInfoArray = [];\n\n for (var j = 0; j < currentOfferInfo.length; j++) {\n var currentOfferInfoObj = currentOfferInfo[j];\n var tempOfferInfoObj = {};\n\n if (validateForNotNull(currentOfferInfoObj.offerDiscount)) {\n tempOfferInfoObj.ofDis = currentOfferInfoObj.offerDiscount;\n }\n\n if (validateForNotNull(currentOfferInfoObj.startDate)) {\n tempOfferInfoObj.stDt = currentOfferInfoObj.startDate;\n }\n\n if (validateForNotNull(currentOfferInfoObj.endDate)) {\n tempOfferInfoObj.enDT = currentOfferInfoObj.endDate;\n }\n\n\n finalOfferInfoArray[finalOfferInfoArray.length] = tempOfferInfoObj;\n\n }\n\n currentFinalObjToSend.offInfo = finalOfferInfoArray;\n }\n\n\n finalCartJSON.cartItems[finalCartJSON.cartItems.length] = currentFinalObjToSend;\n }\n }\n\n\n\n\n var shipmentInfo = persistLocalData.shipmentInfo;\n\n console.log(' shipmentInfo ', shipmentInfo);\n\n if (validateForNotNull(shipmentInfo)) {\n var finalshipmentInfoArray = [];\n\n for (var j = 0; j < shipmentInfo.length; j++) {\n var currentshipmentInfoObj = shipmentInfo[j];\n var tempShipmentInfoObj = {};\n\n if (validateForNotNull(currentshipmentInfoObj.shipmentPriceInfo.originalShippingCharges)) {\n tempShipmentInfoObj.ogShpChrgs = currentshipmentInfoObj.shipmentPriceInfo.originalShippingCharges;\n }\n\n if (validateForNotNull(currentshipmentInfoObj.shipmentPriceInfo.shippingChargesAfterDiscount)) {\n tempShipmentInfoObj.shpChrgsADis = currentshipmentInfoObj.shipmentPriceInfo.shippingChargesAfterDiscount;\n }\n\n if (validateForNotNull(currentshipmentInfoObj.shipmentPriceInfo.freeShipQualificationDelta)) {\n tempShipmentInfoObj.freeShpQlfDelta = currentshipmentInfoObj.shipmentPriceInfo.freeShipQualificationDelta;\n }\n\n if (validateForNotNull(currentshipmentInfoObj.shipmentPriceInfo.shipmentItemsTotal)) {\n tempShipmentInfoObj.shpItmsTot = currentshipmentInfoObj.shipmentPriceInfo.shipmentItemsTotal;\n }\n\n\n\n var shippingOffers = currentshipmentInfoObj.shippingOffers;\n if (validateForNotNull(shippingOffers)) {\n var finalshippingOfferArray = [];\n\n for (var k = 0; k < shippingOffers.length; k++) {\n var currentshippingOffersObj = shippingOffers[k];\n\n if (validateForNotNull(currentshippingOffersObj.discountAmount)) {\n finalshippingOfferArray[finalshippingOfferArray.length] = currentshippingOffersObj.discountAmount;\n }\n\n }\n\n\n tempShipmentInfoObj.disAmnt = finalshippingOfferArray.join('|');\n\n\n }\n\n finalshipmentInfoArray[finalshipmentInfoArray.length] = tempShipmentInfoObj;\n\n\n }\n\n finalCartJSON.shipmentInfo = finalshipmentInfoArray;\n }\n\n var orderSummary = persistLocalData.orderSummary;\n\n var finalOrderSummaryObj = {};\n\n if (validateForNotNull(orderSummary.merchandisePromoAmount)) {\n finalOrderSummaryObj.merProAmnt = orderSummary.merchandisePromoAmount;\n }\n\n if (validateForNotNull(orderSummary.discountedShippingAmount)) {\n finalOrderSummaryObj.disShpAmnt = orderSummary.discountedShippingAmount;\n }\n\n if (validateForNotNull(orderSummary.originalShippingAmount)) {\n finalOrderSummaryObj.ogShpAmnt = orderSummary.originalShippingAmount;\n }\n\n if (validateForNotNull(orderSummary.tax) && validateForNotNull(orderSummary.tax.estimated)) {\n finalOrderSummaryObj.taxest = orderSummary.tax.estimated;\n }\n\n if (validateForNotNull(orderSummary.tax) && validateForNotNull(orderSummary.tax.taxRate)) {\n finalOrderSummaryObj.taxRate = orderSummary.tax.taxRate;\n }\n\n if (validateForNotNull(orderSummary.tax) && validateForNotNull(orderSummary.tax.tax)) {\n finalOrderSummaryObj.tax = orderSummary.tax.tax;\n }\n\n if (validateForNotNull(orderSummary.totalSurcharges)) {\n finalOrderSummaryObj.totSurgs = orderSummary.totalSurcharges;\n }\n\n if (validateForNotNull(orderSummary.totalTaxFee)) {\n finalOrderSummaryObj.totTaxFee = orderSummary.totalTaxFee;\n }\n\n if (validateForNotNull(orderSummary.totalKohlsCashAndPromoDiscounts)) {\n finalOrderSummaryObj.totKCAProDis = orderSummary.totalKohlsCashAndPromoDiscounts;\n }\n\n if (validateForNotNull(orderSummary.totalTax)) {\n finalOrderSummaryObj.totTax = orderSummary.totalTax;\n }\n\n if (validateForNotNull(orderSummary.total)) {\n finalOrderSummaryObj.total = orderSummary.total;\n }\n\n if (validateForNotNull(orderSummary.savings)) {\n finalOrderSummaryObj.sav = orderSummary.savings;\n }\n\n if (validateForNotNull(orderSummary.taxFeeEnabled)) {\n finalOrderSummaryObj.taxFeeE = orderSummary.taxFeeEnabled;\n }\n\n finalCartJSON.orderSummary = finalOrderSummaryObj;\n\n return JSON.stringify(finalCartJSON);\n\n }\n\n return null;\n\n\n }\n\n function fetchMcmId() {\n var mcid = (typeof Visitor != 'undefined') ? Visitor.getInstance('F0EF5E09512D2CD20A490D4D@AdobeOrg') : '';\n var mcmId = (mcid ? mcid.getMarketingCloudVisitorID() : '');\n\n return mcmId;\n }\n\n function getSkuPriceObj(skuId)\n {\n if(pageData.productDetails && pageData.productDetails.pageItems[0] && pageData.productDetails.pageItems[0].SKUS)\n {\n var skuArr = pageData.productDetails.pageItems[0].SKUS;\n\n for(var i=0;i<skuArr.length;i++)\n {\n var tempObj = skuArr[i]\n\n if(tempObj.skuId == skuId)\n {\n return tempObj;\n }\n }\n }\n\n return null;\n }\n\n\n function getPresentVector(isRto, rtoEventType) {\n try {\n\n if (debugScr) console.log('getPresentVector');\n\n var itemsInBag = 0;\n cartValue = 0;\n\n isJsonNull = false;\n\n var cartData = localStorage.getItem(\"persistent_bar_components_json_v1\");\n if(cartData && !isValid(cartData)){\n cartData = (isValid(Kjs) && isValid(Kjs.PB) && isValid(Kjs.PB.getPbCartStorage())) ? JSON.stringify(Kjs.PB.getPbCartStorage()) : \"null\";\n }\n \n if (isValid(cartData)) {\n var cartInfo = JSON.parse(cartData);\n\n for (var i = 0; i < cartInfo.cartItems.length; i++) {\n itemsInBag = itemsInBag + cartInfo.cartItems[i].quantity;\n\n if (cartInfo.cartItems[i].itemPriceInfo.grossPrice) {\n cartValue = cartValue + Number(cartInfo.cartItems[i].itemPriceInfo.grossPrice);\n }\n\n\n var tempObj = {};\n tempObj.productId = cartInfo.cartItems[i].productId;\n tempObj.skuId = cartInfo.cartItems[i].skuId;\n tempObj.quantity = cartInfo.cartItems[i].quantity;\n tempObj.itemType = cartInfo.cartItems[i].itemType;\n\n currentUserCartArr.push(tempObj);\n\n }\n } else {\n\n var cookieBagTotal = getCookie('VisitorBagTotals');\n if (cookieBagTotal && cookieBagTotal.toString().length != 0) {\n isJsonNull = true;\n\n cartValue = -1;\n\n\n }\n\n }\n\n\n if (cartValue == 0 && (typeof pageData != 'undefined') && pageData.cartDetails && pageData.cartDetails.cartSubTotalValue) {\n cartValue = Number(pageData.cartDetails.cartSubTotalValue);\n }\n\n\n\n console.log(cartValue + ' Before Present Vector ', evtName);\n var presentVector = {};\n presentVector.event = eventCodes[evtName.toLocaleLowerCase()] || evtName; //common to all\n presentVector.productID = '-'; //ViewedProduct, AddedToBag\n presentVector.itemsInBag = itemsInBag || 0; //common to all\n presentVector.originalPrice = '-';\n presentVector.salePrice = '-';\n presentVector.KC = '-'; //Think\n presentVector.PDPCategory = '-'; //\n presentVector.department = '-';\n presentVector.CN = '-';\n presentVector.keywords = '-';\n presentVector.visualNavForm = '-';\n presentVector.pageFilter = '-';\n presentVector.searchType = '-';\n presentVector.userPFM = '-';\n presentVector.loginstatus = (isLoggedIn) ? 'full' : (isSoftLoggedIn ? 'soft' : '-');\n presentVector.onSale = '-';\n presentVector.time = new Date().getTime();\n\n console.log('Present Vector 1', presentVector);\n //New Ml Vectors\n\n presentVector.pgdata_pmpdet_catname = '-';\n presentVector.pgdata_pmpdet_subcatname = '-';\n presentVector.pgdata_pmpdet_findingname = '-';\n presentVector.pgdata_pmpdet_cat_keywords = '-';\n presentVector.pgdata_pmpdet_pgfilter = '-';\n presentVector.pgdata_pmpdet_deptname = '-';\n presentVector.pgdata_pmpdet_gendervalues = '-';\n presentVector.pgdata_pmpdet_search_keywords = '-';\n presentVector.pgdata_proddet_colid = '-';\n presentVector.pgdata_pddetails_clientpostalcode = '-';\n presentVector.selected_sku_color = '-';\n presentVector.selected_sku_size = '-';\n presentVector.selected_sku = '-';\n //presentVector.selected_sku_regular_price = '-';\n presentVector.selected_sku_sale_price = '-';\n\n\n\n presentVector.c_i_size = '-';\n presentVector.c_i_color = '-';\n presentVector.c_i_isweb = '-';\n presentVector.c_sclearance = '-';\n presentVector.c_i_shipavailable = '-';\n presentVector.c_i_bopusAval = '-';\n presentVector.c_i_bossAval = '-';\n presentVector.c_i_invShip = '-';\n presentVector.c_i_invBopus = '-';\n presentVector.c_i_invBoss = '-';\n presentVector.c_o_offDis = '-';\n presentVector.c_o_sdate = '-';\n presentVector.c_o_edate = '-';\n presentVector.c_p_type = '-';\n presentVector.c_p_ptext = '-';\n presentVector.shpi_shpp_ogshpchrgs = '-';\n presentVector.shpi_shpp_shpchrgsafdis = '-';\n presentVector.shpi_shpp_freeshpqlfdelta = '-';\n presentVector.shpi_shpp_shpitmstotal = '-';\n presentVector.shpi_shpo_disamnt = '-';\n presentVector.or_merpromoamnt = '-';\n presentVector.or_disshpamnt = '-';\n presentVector.or_ogshpamnt = '-';\n presentVector.or_tax_est = '-';\n presentVector.or_tax_taxrt = '-';\n presentVector.or_tax_tax = '-';\n presentVector.or_totalsur = '-';\n presentVector.or_totaltaxfree = '-';\n presentVector.or_totalkcpromodis = '-';\n presentVector.or_totaltax = '-';\n presentVector.or_total = '-';\n presentVector.or_savings = '-';\n presentVector.or_taxfeeen = '-';\n\n presentVector.removed_sku = '-';\n presentVector.updated_sku = '-';\n presentVector.updated_sku_qty = '-';\n\n presentVector.prod_sku_count = '-';\n presentVector.sku_reg_price = '-';\n presentVector.sku_per_dis = '-';\n presentVector.sku_bopus_avail = '-';\n presentVector.sku_boss_avail = '-';\n presentVector.sku_ship_avail = '-';\n\n presentVector.filter_by_count = '-';\n presentVector.sort_by = '-';\n\n presentVector.pgdata_proddet_catname = '-';\n presentVector.pgdata_proddet_subcatname = '-';\n presentVector.pgdata_proddet_deptname = '-';\n\n presentVector.selected_prd_id = '-';\n\n presentVector.rto_data = '-';\n\n\n if (isRto == true) {\n presentVector.event = eventCodes[\"_ws_rto\"];\n\n if (rtoEventType != null) {\n\n var rtoPageCode = '';\n\n switch (evtName.toLowerCase()) {\n case \"_ws_viewedhome\":\n\n rtoPageCode = 'HP';\n\n break;\n\n case \"_ws_searched\":\n\n rtoPageCode = 'SP';\n\n break;\n\n case \"_ws_viewedcatalog\":\n\n rtoPageCode = 'TP';\n\n break;\n case \"_ws_viewedproduct\":\n\n rtoPageCode = 'PP';\n\n\n break;\n\n case \"_ws_viewedsku\":\n\n rtoPageCode = 'PP';\n\n\n break;\n\n case \"_ws_viewedcart\":\n\n rtoPageCode = 'CP';\n\n break;\n\n case \"_ws_addedtobag\":\n\n rtoPageCode = 'PP';\n\n break;\n }\n\n switch (rtoEventType) {\n case \"qualification_test\":\n\n presentVector.rto_data = 'Q:T';\n\n break;\n\n case \"qualification_control\":\n\n presentVector.rto_data = 'Q:C';\n\n break;\n\n case \"shown\":\n\n presentVector.rto_data = 'S:' + rtoPageCode;\n\n break;\n\n case \"applied\":\n\n presentVector.rto_data = 'A';\n\n break;\n }\n\n\n\n evtName = '_ws_rto';\n }\n\n }\n\n if (evtName.toLocaleLowerCase() == '_ws_viewedproduct') {\n if (typeof pageData != 'undefined') {\n\n if(pageData.productDetails && pageData.productDetails.pageItems[0] && pageData.productDetails.pageItems[0].productID)\n {\n presentVector.productID = (pageData.productDetails && pageData.productDetails.pageItems[0] && pageData.productDetails.pageItems[0].productID) || '-';\n presentVector.originalPrice = (pageData.productDetails && pageData.productDetails.pageItems[0] && pageData.productDetails.pageItems[0].originalPrice) || '-';\n presentVector.salePrice = (pageData.productDetails && pageData.productDetails.pageItems[0] && pageData.productDetails.pageItems[0].salePrice) || '-';\n presentVector.PDPCategory = (pageData.productDetails && pageData.productDetails.categoryName) || '-';\n presentVector.onSale = (pageData.productDetails && pageData.productDetails.pageItems[0] && pageData.productDetails.pageItems[0].isOnSale) || '-'; \n }\n\n if (typeof productV2JsonData != 'undefined') {\n\n var skuPriceObj = getSkuPriceObj(productV2JsonData.preSelectedSku);\n\n if(skuPriceObj)\n {\n presentVector.originalPrice = skuPriceObj.regularPrice.toString().substring(1,skuPriceObj.regularPrice.length);\n presentVector.salePrice = skuPriceObj.salePrice.toString().substring(1,skuPriceObj.salePrice.length);\n presentVector.PDPCategory = (pageData.productDetails && pageData.productDetails.categoryName) || '-';\n presentVector.onSale = '-';\n }\n\n presentVector.productID = (productId) || '-';\n \n }\n\n \n } else {\n var prodUrlSplit = window.location.pathname.toString().split('prd-')[1];\n var firstIndexOf = prodUrlSplit.indexOf('/');\n\n presentVector.productID = prodUrlSplit.substring(0, firstIndexOf);\n }\n presentVector.userPFM = getUrlParameter('userPFM') || '-';\n }\n\n if (evtName.toLocaleLowerCase() == '_ws_searched') {\n\n presentVector.keywords = (pageData.pmpDetails && pageData.pmpDetails && pageData.pmpDetails.keywords) || '-';\n if (typeof pageData != 'undefined') {\n presentVector.CN = getUrlParameter('CN') || '-';\n presentVector.visualNavForm = getUrlParameter('VisualNavFrom') || '-';\n }\n var isFrmRecentSearch = getUrlParameter('isFrmRecentSearch');\n var isFrmTypeAhead = getUrlParameter('isFrmTypeAhead');\n presentVector.searchType = (isFrmRecentSearch == 'TRUE' && isFrmTypeAhead == 'TRUE') ? 'recent+typeahead' : (isFrmRecentSearch == 'TRUE' ? 'recent' : (isFrmTypeAhead == 'TRUE' ? 'typeahead' : '-'));\n }\n\n if (debugScr) console.log('Got Page Event Name ' + evtName.toLocaleLowerCase());\n\n if (evtName.toLocaleLowerCase() == '_ws_viewedcatalog') {\n if (typeof pageData != 'undefined') {\n presentVector.department = (pageData.pmpDetails && pageData.pmpDetails.departmentName) || '-';\n presentVector.pageFilter = (pageData.pmpDetails && pageData.pmpDetails.pageFilter) || '-';\n }\n presentVector.CN = getUrlParameter('CN') || '-';\n presentVector.visualNavForm = getUrlParameter('VisualNavFrom') || '-';\n }\n\n presentVector = fetchNewAttributesForVectorization(presentVector, evtName);\n\n if (debugScr) console.log(\"presentVector:\" + JSON.stringify(presentVector));\n\n //viewedhome/viewedcart do not require additional processing\n //addedtobag/placedorder have seperate tags\n\n return presentVector;\n } catch (ie) {\n console.log('[ZineOne getPresentVector] : ', ie);\n }\n }\n\n\n\n function updateUserVectors(isRto, rtoEventType) {\n try {\n\n if (!isValid(evtName)) {\n return;\n }\n\n if (debugScr) console.log('Into updateUserVectors');\n var presentVector = getPresentVector(isRto, rtoEventType);\n var previousVector = JSON.parse(localStorage.getItem('z1_previousVector'));\n var z1_sessionStart_ts = JSON.parse(localStorage.getItem('z1_sessionStart_ts'));\n\n var z1_features = localStorage.getItem('z1_features') || \"\";\n //Check if local Storage has userVector available\n var userVectors = JSON.parse(localStorage.getItem('z1_userVectors'));\n var newUserVectors = JSON.parse(localStorage.getItem('z1_newUserVectors'));\n\n //Updated the logic to send the Sequence if diff between present and previous event is more than 10 mins\n //if(previousVector && previousVector.time && previousVector.time < z1_sessionStart_ts){\n if (previousVector && previousVector.time && presentVector && presentVector.time && Number(presentVector.time) - Number(previousVector.time) > SESSION_GAP) {\n if (debugScr) console.log(\"New Session has started since the last Event\");\n //Changes to visitGap for gap between n-1 and nth session\n var visitGap = localStorage.getItem('visitGap');\n //Check if null or undefined\n if (!visitGap || typeof visitGap == undefined || visitGap == 'undefined') {\n visitGap = '';\n }\n\n try {\n\n var oldSessionStartTime = userVectors.timeVector.toString().split('|')[0];\n\n\n var vectorsEventData = {};\n\n vectorsEventData = onceInSessionAttributes(vectorsEventData);\n\n var cartDump = fetchCartDump();\n\n if (validateForNotNull(cartDump)) {\n cartDump = JSON.parse(cartDump);\n\n var cartKeys = Object.keys(cartDump);\n for (var k = 0; k < cartKeys.length; k++) {\n vectorsEventData[cartKeys[k]] = JSON.stringify(cartDump[cartKeys[k]]);\n }\n }\n\n\n vectorsEventData.z1_userVectors = JSON.stringify(userVectors);\n vectorsEventData.z1_features = z1_features;\n vectorsEventData.visitGap = visitGap;\n vectorsEventData.session_start_time = presentVector.time;\n vectorsEventData.old_session_start_time = oldSessionStartTime;\n\n if (validateForNotNull(newUserVectors)) {\n var newVectorKeys = Object.keys(newUserVectors);\n for (var k = 0; k < newVectorKeys.length; k++) {\n vectorsEventData[newVectorKeys[k]] = newUserVectors[newVectorKeys[k]];\n }\n }\n\n\n\n ZineOne.pushEvent('_ws_updatevectors', vectorsEventData);\n } catch (ieInner) {\n\n var errorObj = {};\n errorObj.p1 = ieInner.message;\n errorObj.p2 = 'webstoresendevent ' + evtName;\n\n ZineOne.pushEvent('_ws_logs', errorObj);\n\n }\n\n\n\n\n\n localStorage.setItem('visitGap', Number(presentVector.time) - Number(previousVector.time));\n localStorage.removeItem('z1_userVectors');\n localStorage.removeItem('z1_features');\n if (debugScr) console.log(\"z1_userVectors removed from local storage\");\n userVectors = null;\n newUserVectors = null;\n }\n\n if (!userVectors) {\n userVectors = {};\n userVectors.eventVector = presentVector.event;\n userVectors.timeVector = presentVector.time;\n userVectors.productVector = presentVector.productID;\n userVectors.originalPrice = presentVector.originalPrice;\n userVectors.salePrice = presentVector.salePrice;\n userVectors.PDPCategory = presentVector.PDPCategory;\n userVectors.CN = presentVector.CN;\n userVectors.itemsInBag = presentVector.itemsInBag;\n\n newUserVectors = {};\n newUserVectors.pgdata_pmpdet_catname = presentVector.pgdata_pmpdet_catname;\n newUserVectors.pgdata_pmpdet_subcatname = presentVector.pgdata_pmpdet_subcatname;\n newUserVectors.pgdata_pmpdet_findingname = presentVector.pgdata_pmpdet_findingname;\n newUserVectors.pgdata_pmpdet_cat_keywords = presentVector.pgdata_pmpdet_cat_keywords;\n newUserVectors.pgdata_pmpdet_pgfilter = presentVector.pgdata_pmpdet_pgfilter;\n newUserVectors.pgdata_pmpdet_deptname = presentVector.pgdata_pmpdet_deptname;\n newUserVectors.pgdata_pmpdet_gendervalues = presentVector.pgdata_pmpdet_gendervalues;\n newUserVectors.pgdata_pmpdet_search_keywords = presentVector.pgdata_pmpdet_search_keywords;\n newUserVectors.pgdata_proddet_colid = presentVector.pgdata_proddet_colid;\n newUserVectors.pgdata_pddetails_clientpostalcode = presentVector.pgdata_pddetails_clientpostalcode;\n newUserVectors.selected_sku_color = presentVector.selected_sku_color;\n newUserVectors.selected_sku_size = presentVector.selected_sku_size;\n newUserVectors.selected_sku = presentVector.selected_sku;\n //newUserVectors.selected_sku_regular_price = presentVector.selected_sku_regular_price;\n newUserVectors.selected_sku_sale_price = presentVector.selected_sku_sale_price;\n\n\n\n newUserVectors.c_i_size = presentVector.c_i_size;\n newUserVectors.c_i_color = presentVector.c_i_color;\n newUserVectors.c_i_isweb = presentVector.c_i_isweb;\n newUserVectors.c_sclearance = presentVector.c_sclearance;\n newUserVectors.c_i_shipavailable = presentVector.c_i_shipavailable;\n newUserVectors.c_i_bopusAval = presentVector.c_i_bopusAval;\n newUserVectors.c_i_bossAval = presentVector.c_i_bossAval;\n newUserVectors.c_i_invShip = presentVector.c_i_invShip;\n newUserVectors.c_i_invBopus = presentVector.c_i_invBopus;\n newUserVectors.c_i_invBoss = presentVector.c_i_invBoss;\n newUserVectors.c_o_offDis = presentVector.c_o_offDis;\n newUserVectors.c_o_sdate = presentVector.c_o_sdate;\n newUserVectors.c_o_edate = presentVector.c_o_edate;\n newUserVectors.c_p_type = presentVector.c_p_type;\n newUserVectors.c_p_ptext = presentVector.c_p_ptext;\n newUserVectors.shpi_shpp_ogshpchrgs = presentVector.shpi_shpp_ogshpchrgs;\n newUserVectors.shpi_shpp_shpchrgsafdis = presentVector.shpi_shpp_shpchrgsafdis;\n newUserVectors.shpi_shpp_freeshpqlfdelta = presentVector.shpi_shpp_freeshpqlfdelta;\n newUserVectors.shpi_shpp_shpitmstotal = presentVector.shpi_shpp_shpitmstotal;\n newUserVectors.shpi_shpo_disamnt = presentVector.shpi_shpo_disamnt;\n newUserVectors.or_merpromoamnt = presentVector.or_merpromoamnt;\n newUserVectors.or_disshpamnt = presentVector.or_disshpamnt;\n newUserVectors.or_ogshpamnt = presentVector.or_ogshpamnt;\n newUserVectors.or_tax_est = presentVector.or_tax_est;\n newUserVectors.or_tax_taxrt = presentVector.or_tax_taxrt;\n newUserVectors.or_tax_tax = presentVector.or_tax_tax;\n newUserVectors.or_totalsur = presentVector.or_totalsur;\n newUserVectors.or_totaltaxfree = presentVector.or_totaltaxfree;\n newUserVectors.or_totalkcpromodis = presentVector.or_totalkcpromodis;\n newUserVectors.or_totaltax = presentVector.or_totaltax;\n newUserVectors.or_total = presentVector.or_total;\n newUserVectors.or_savings = presentVector.or_savings;\n newUserVectors.or_taxfeeen = presentVector.or_taxfeeen;\n\n newUserVectors.removed_sku = presentVector.removed_sku;\n newUserVectors.updated_sku = presentVector.updated_sku;\n newUserVectors.updated_sku_qty = presentVector.updated_sku_qty;\n\n\n newUserVectors.prod_sku_count = presentVector.prod_sku_count;\n newUserVectors.sku_reg_price = presentVector.sku_reg_price;\n newUserVectors.sku_per_dis = presentVector.sku_per_dis;\n newUserVectors.sku_bopus_avail = presentVector.sku_bopus_avail;\n newUserVectors.sku_boss_avail = presentVector.sku_boss_avail;\n newUserVectors.sku_ship_avail = presentVector.sku_ship_avail;\n\n newUserVectors.filter_by_count = presentVector.filter_by_count;\n newUserVectors.sort_by = presentVector.sort_by;\n\n newUserVectors.pgdata_proddet_catname = presentVector.pgdata_proddet_catname;\n newUserVectors.pgdata_proddet_subcatname = presentVector.pgdata_proddet_subcatname;\n newUserVectors.pgdata_proddet_deptname = presentVector.pgdata_proddet_deptname;\n\n newUserVectors.selected_prd_id = presentVector.selected_prd_id;\n\n newUserVectors.rto_data = presentVector.rto_data;\n\n } else {\n userVectors.eventVector = userVectors.eventVector + '|' + presentVector.event;\n userVectors.timeVector = userVectors.timeVector + '|' + presentVector.time;\n userVectors.productVector = userVectors.productVector + '|' + presentVector.productID;\n userVectors.originalPrice = userVectors.originalPrice + '|' + presentVector.originalPrice;\n userVectors.salePrice = userVectors.salePrice + '|' + presentVector.salePrice;\n userVectors.PDPCategory = userVectors.PDPCategory + '|' + presentVector.PDPCategory;\n userVectors.CN = userVectors.CN + '|' + presentVector.CN;\n userVectors.itemsInBag = userVectors.itemsInBag + '|' + presentVector.itemsInBag;\n\n\n newUserVectors.pgdata_pmpdet_catname = newUserVectors.pgdata_pmpdet_catname + '|' + presentVector.pgdata_pmpdet_catname;\n newUserVectors.pgdata_pmpdet_subcatname = newUserVectors.pgdata_pmpdet_subcatname + '|' + presentVector.pgdata_pmpdet_subcatname;\n newUserVectors.pgdata_pmpdet_findingname = newUserVectors.pgdata_pmpdet_findingname + '|' + presentVector.pgdata_pmpdet_findingname;\n newUserVectors.pgdata_pmpdet_cat_keywords = newUserVectors.pgdata_pmpdet_cat_keywords + '|' + presentVector.pgdata_pmpdet_cat_keywords;\n newUserVectors.pgdata_pmpdet_pgfilter = newUserVectors.pgdata_pmpdet_pgfilter + '|' + presentVector.pgdata_pmpdet_pgfilter;\n newUserVectors.pgdata_pmpdet_deptname = newUserVectors.pgdata_pmpdet_deptname + '|' + presentVector.pgdata_pmpdet_deptname;\n newUserVectors.pgdata_pmpdet_gendervalues = newUserVectors.pgdata_pmpdet_gendervalues + '|' + presentVector.pgdata_pmpdet_gendervalues;\n newUserVectors.pgdata_pmpdet_search_keywords = newUserVectors.pgdata_pmpdet_search_keywords + '|' + presentVector.pgdata_pmpdet_search_keywords;\n newUserVectors.pgdata_proddet_colid = newUserVectors.pgdata_proddet_colid + '|' + presentVector.pgdata_proddet_colid;\n newUserVectors.pgdata_pddetails_clientpostalcode = newUserVectors.pgdata_pddetails_clientpostalcode + '|' + presentVector.pgdata_pddetails_clientpostalcode;\n newUserVectors.selected_sku_color = newUserVectors.selected_sku_color + '|' + presentVector.selected_sku_color;\n newUserVectors.selected_sku_size = newUserVectors.selected_sku_size + '|' + presentVector.selected_sku_size;\n newUserVectors.selected_sku = newUserVectors.selected_sku + '|' + presentVector.selected_sku;\n //newUserVectors.selected_sku_regular_price = newUserVectors.selected_sku_regular_price + '|' + presentVector.selected_sku_regular_price;\n newUserVectors.selected_sku_sale_price = newUserVectors.selected_sku_sale_price + '|' + presentVector.selected_sku_sale_price;\n\n\n newUserVectors.c_i_size = newUserVectors.c_i_size + '|' + presentVector.c_i_size;\n newUserVectors.c_i_color = newUserVectors.c_i_color + '|' + presentVector.c_i_color;\n newUserVectors.c_i_isweb = newUserVectors.c_i_isweb + '|' + presentVector.c_i_isweb;\n newUserVectors.c_sclearance = newUserVectors.c_sclearance + '|' + presentVector.c_sclearance;\n newUserVectors.c_i_shipavailable = newUserVectors.c_i_shipavailable + '|' + presentVector.c_i_shipavailable;\n newUserVectors.c_i_bopusAval = newUserVectors.c_i_bopusAval + '|' + presentVector.c_i_bopusAval;\n newUserVectors.c_i_bossAval = newUserVectors.c_i_bossAval + '|' + presentVector.c_i_bossAval;\n newUserVectors.c_i_invShip = newUserVectors.c_i_invShip + '|' + presentVector.c_i_invShip;\n newUserVectors.c_i_invBopus = newUserVectors.c_i_invBopus + '|' + presentVector.c_i_invBopus;\n newUserVectors.c_i_invBoss = newUserVectors.c_i_invBoss + '|' + presentVector.c_i_invBoss;\n newUserVectors.c_o_offDis = newUserVectors.c_o_offDis + '|' + presentVector.c_o_offDis;\n newUserVectors.c_o_sdate = newUserVectors.c_o_sdate + '|' + presentVector.c_o_sdate;\n newUserVectors.c_o_edate = newUserVectors.c_o_edate + '|' + presentVector.c_o_edate;\n newUserVectors.c_p_type = newUserVectors.c_p_type + '|' + presentVector.c_p_type;\n newUserVectors.c_p_ptext = newUserVectors.c_p_ptext + '|' + presentVector.c_p_ptext;\n newUserVectors.shpi_shpp_ogshpchrgs = newUserVectors.shpi_shpp_ogshpchrgs + '|' + presentVector.shpi_shpp_ogshpchrgs;\n newUserVectors.shpi_shpp_shpchrgsafdis = newUserVectors.shpi_shpp_shpchrgsafdis + '|' + presentVector.shpi_shpp_shpchrgsafdis;\n newUserVectors.shpi_shpp_freeshpqlfdelta = newUserVectors.shpi_shpp_freeshpqlfdelta + '|' + presentVector.shpi_shpp_freeshpqlfdelta;\n newUserVectors.shpi_shpp_shpitmstotal = newUserVectors.shpi_shpp_shpitmstotal + '|' + presentVector.shpi_shpp_shpitmstotal;\n newUserVectors.shpi_shpo_disamnt = newUserVectors.shpi_shpo_disamnt + '|' + presentVector.shpi_shpo_disamnt;\n newUserVectors.or_merpromoamnt = newUserVectors.or_merpromoamnt + '|' + presentVector.or_merpromoamnt;\n newUserVectors.or_disshpamnt = newUserVectors.or_disshpamnt + '|' + presentVector.or_disshpamnt;\n newUserVectors.or_ogshpamnt = newUserVectors.or_ogshpamnt + '|' + presentVector.or_ogshpamnt;\n newUserVectors.or_tax_est = newUserVectors.or_tax_est + '|' + presentVector.or_tax_est;\n newUserVectors.or_tax_taxrt = newUserVectors.or_tax_taxrt + '|' + presentVector.or_tax_taxrt;\n newUserVectors.or_tax_tax = newUserVectors.or_tax_tax + '|' + presentVector.or_tax_tax;\n newUserVectors.or_totalsur = newUserVectors.or_totalsur + '|' + presentVector.or_totalsur;\n newUserVectors.or_totaltaxfree = newUserVectors.or_totaltaxfree + '|' + presentVector.or_totaltaxfree;\n newUserVectors.or_totalkcpromodis = newUserVectors.or_totalkcpromodis + '|' + presentVector.or_totalkcpromodis;\n newUserVectors.or_totaltax = newUserVectors.or_totaltax + '|' + presentVector.or_totaltax;\n newUserVectors.or_total = newUserVectors.or_total + '|' + presentVector.or_total;\n newUserVectors.or_savings = newUserVectors.or_savings + '|' + presentVector.or_savings;\n newUserVectors.or_taxfeeen = newUserVectors.or_taxfeeen + '|' + presentVector.or_taxfeeen;\n\n newUserVectors.removed_sku = newUserVectors.removed_sku + '|' + presentVector.removed_sku;\n newUserVectors.updated_sku = newUserVectors.updated_sku + '|' + presentVector.updated_sku;\n newUserVectors.updated_sku_qty = newUserVectors.updated_sku_qty + '|' + presentVector.updated_sku_qty;\n\n\n newUserVectors.prod_sku_count = newUserVectors.prod_sku_count + '|' + presentVector.prod_sku_count;\n newUserVectors.sku_reg_price = newUserVectors.sku_reg_price + '|' + presentVector.sku_reg_price;\n newUserVectors.sku_per_dis = newUserVectors.sku_per_dis + '|' + presentVector.sku_per_dis;\n newUserVectors.sku_bopus_avail = newUserVectors.sku_bopus_avail + '|' + presentVector.sku_bopus_avail;\n newUserVectors.sku_boss_avail = newUserVectors.sku_boss_avail + '|' + presentVector.sku_boss_avail;\n newUserVectors.sku_ship_avail = newUserVectors.sku_ship_avail + '|' + presentVector.sku_ship_avail;\n\n newUserVectors.filter_by_count = newUserVectors.filter_by_count + '|' + presentVector.filter_by_count;\n newUserVectors.sort_by = newUserVectors.sort_by + '|' + presentVector.sort_by;\n\n newUserVectors.pgdata_proddet_catname = newUserVectors.pgdata_proddet_catname + '|' + presentVector.pgdata_proddet_catname;\n newUserVectors.pgdata_proddet_subcatname = newUserVectors.pgdata_proddet_subcatname + '|' + presentVector.pgdata_proddet_subcatname;\n newUserVectors.pgdata_proddet_deptname = newUserVectors.pgdata_proddet_deptname + '|' + presentVector.pgdata_proddet_deptname;\n\n newUserVectors.selected_prd_id = newUserVectors.selected_prd_id + '|' + presentVector.selected_prd_id;\n\n newUserVectors.rto_data = newUserVectors.rto_data + '|' + presentVector.rto_data;\n\n\n }\n localStorage.setItem('z1_userVectors', JSON.stringify(userVectors));\n localStorage.setItem('z1_newUserVectors', JSON.stringify(newUserVectors));\n\n updateFeatures();\n\n //Update the previousVector\n previousVector = presentVector;\n localStorage.setItem('z1_previousVector', JSON.stringify(previousVector));\n\n //Send the Sequence on 5th and 10th Element as well\n //Fetch the updated features as they are updated\n var z1_features = localStorage.getItem('z1_features') || \"\";\n //If this is the 5th Element, send the features and vectors\n if (userVectors && userVectors.eventVector && userVectors.eventVector.split('|').length == 5) {\n if (debugScr) console.log(\"The sequence is 5 element long\");\n //Changes to visitGap for gap between n-1 and nth session\n var visitGap = localStorage.getItem('visitGap');\n //Check if null or undefined\n if (!visitGap || typeof visitGap == undefined || visitGap == 'undefined') {\n visitGap = '';\n }\n\n var currentSessionStartTime = userVectors.timeVector.toString().split('|')[0];\n\n\n var vectorsEventData = {};\n\n var newVectorKeys = Object.keys(newUserVectors);\n for (var k = 0; k < newVectorKeys.length; k++) {\n vectorsEventData[newVectorKeys[k]] = newUserVectors[newVectorKeys[k]];\n }\n\n vectorsEventData.z1_userVectors = JSON.stringify(userVectors);\n vectorsEventData.z1_features = z1_features;\n vectorsEventData.cartValue = cartValue;\n vectorsEventData.session_start_time = currentSessionStartTime;\n vectorsEventData.visitGap = visitGap;\n vectorsEventData.currentCart = JSON.stringify(currentUserCartArr);\n\n if (validateForNotNull(pageData) && validateForNotNull(pageData.customerDetails) && validateForNotNull(pageData.customerDetails.customerHasKohlsCharge)) {\n vectorsEventData.isKcc = pageData.customerDetails.customerHasKohlsCharge;\n } else {\n vectorsEventData.isKcc = -1;\n }\n\n if (validateForNotNull(pageData) && validateForNotNull(pageData.customerDetails) && validateForNotNull(pageData.customerDetails.kohlsLoyalty2018EliteMember)) {\n vectorsEventData.kohlsLoyalty2018EliteMember = pageData.customerDetails.kohlsLoyalty2018EliteMember;\n } else {\n vectorsEventData.kohlsLoyalty2018EliteMember = -1;\n }\n\n if (validateForNotNull(pageData) && validateForNotNull(pageData.customerDetails) && validateForNotNull(pageData.customerDetails.kohlsLoyalty2018Member)) {\n vectorsEventData.kohlsLoyalty2018Member = pageData.customerDetails.kohlsLoyalty2018Member;\n } else {\n vectorsEventData.kohlsLoyalty2018Member = -1;\n }\n\n\n\n vectorsEventData.mcmId = fetchMcmId();\n\n ZineOne.pushEvent('_ws_updatevectors_len5', vectorsEventData);\n\n if (isJsonNull) {\n var lastUserPageArr = userVectors.eventVector.toString().split('|');\n var lastPageChar = lastUserPageArr[lastUserPageArr.length - 2];\n\n var tempEventData = {};\n tempEventData.VisitorBagTotals = getCookie('VisitorBagTotals');\n tempEventData.pgName = pgName;\n tempEventData.lastPgChar = lastPageChar;\n\n ZineOne.pushEvent('_ws_emptyjson_v2', tempEventData);\n }\n\n } else if (userVectors && userVectors.eventVector && userVectors.eventVector.split('|').length == 10) {\n if (debugScr) console.log(\"The sequence is 10 element long\");\n //Changes to visitGap for gap between n-1 and nth session\n var visitGap = localStorage.getItem('visitGap');\n //Check if null or undefined\n if (!visitGap || typeof visitGap == undefined || visitGap == 'undefined') {\n visitGap = '';\n }\n\n var currentSessionStartTime = userVectors.timeVector.toString().split('|')[0];\n\n var vectorsEventData = {};\n\n var newVectorKeys = Object.keys(newUserVectors);\n for (var k = 0; k < newVectorKeys.length; k++) {\n vectorsEventData[newVectorKeys[k]] = newUserVectors[newVectorKeys[k]];\n }\n\n\n\n vectorsEventData.z1_userVectors = JSON.stringify(userVectors);\n vectorsEventData.z1_features = z1_features;\n vectorsEventData.session_start_time = currentSessionStartTime;\n vectorsEventData.visitGap = visitGap;\n\n ZineOne.pushEvent('_ws_updatevectors_len10', vectorsEventData);\n }\n\n //If this is the 10th Element, send the features and vectors\n } catch (ie) {\n console.log('[ZineOne updateUserVectors] : ', ie);\n }\n }\n\n function updateFeatures() {\n\n if (debugScr) console.log('Into updateFeatures');\n /* z1_features is stored in local storage which holds following stats\n ** n Total number of events in visit\n ** A Total number of addedtobag events in the visit\n ** B Total number of breachedgeofence events in the visit\n ** C Total number of continuedcheckout events in the visit\n ** D Total number of exitgeofence events in the visit\n ** E Total number of placedorder events in the visit\n ** F Total number of searched events in the visit\n ** G Total number of startedcheckout events in the visit\n ** H Total number of viewedcart events in the visit\n ** I Total number of viewedcatalog events in the visit\n ** J Total number of viewedhome events in the visit\n ** K Total number of viewedproduct events in the visit\n ** p Total number of evented pages loaded in visit\n */\n\n var z1_features = localStorage.getItem('z1_features');\n if (!z1_features) {\n z1_features = \"0|0|0|0|0|0|0|0|0|0|0|0|0|0\";\n }\n\n z1_features_arr = z1_features.split('|');\n\n z1_features_arr[0] = Number(z1_features_arr[0]) + 1; //n\n\n if (evtName.toLocaleLowerCase() == '_ws_addedtobag') {\n z1_features_arr[1] = Number(z1_features_arr[1]) + 1;\n } else if (evtName.toLocaleLowerCase() == 'breachedgeofence') {\n z1_features_arr[2] = Number(z1_features_arr[2]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_completeshipping') {\n z1_features_arr[3] = Number(z1_features_arr[3]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == 'exitgeofence') {\n z1_features_arr[4] = Number(z1_features_arr[4]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_placedorder') {\n z1_features_arr[5] = Number(z1_features_arr[5]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_searched') {\n z1_features_arr[6] = Number(z1_features_arr[6]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_startedcheckout') {\n z1_features_arr[7] = Number(z1_features_arr[7]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_viewedcart') {\n z1_features_arr[8] = Number(z1_features_arr[8]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_viewedcatalog') {\n z1_features_arr[9] = Number(z1_features_arr[9]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_viewedhome') {\n z1_features_arr[10] = Number(z1_features_arr[10]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_viewedproduct') {\n z1_features_arr[11] = Number(z1_features_arr[11]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_completepayment') {\n z1_features_arr[13] = Number(z1_features_arr[13]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n }\n\n z1_features = z1_features_arr[0] + '|' + z1_features_arr[1] + '|' + z1_features_arr[2] + '|' + z1_features_arr[3] + '|' + z1_features_arr[4] + '|' + z1_features_arr[5] + '|' + z1_features_arr[6] + '|' + z1_features_arr[7] + '|' + z1_features_arr[8] + '|' + z1_features_arr[9] + '|' + z1_features_arr[10] + '|' + z1_features_arr[11] + '|' + z1_features_arr[12] + '|' + z1_features_arr[13];\n localStorage.setItem('z1_features', z1_features);\n }\n\n\n\n\n\n\n\n function _handleRawData(rawData, ctaData) {\n //debugScr = true;\n if (debugScr)\n console.log('[ZineOne-om] rawData recd ' + rawData);\n try {\n var showMsg = true;\n var z1Response = JSON.parse(rawData);\n\n let raw_data_event = new CustomEvent('onZ1RawData', {\n detail: z1Response\n });\n document.dispatchEvent(raw_data_event);\n\n\n if (debugScr) console.log('[ZineOne-om] omniture z1Response is Before Urgency ', typeof z1Response);\n\n if (z1Response && z1Response.pdpUrgencyMsg) {\n\n var isTopRated = document.getElementsByClassName(\"tce-toprated-text\");\n if (isTopRated.length >= 1) {\n //var topRatedDiv = isTopRated[0];\n showMsg = false;\n }\n var isKChoice = document.getElementsByClassName(\"tce-kchoice\");\n if (isKChoice.length >= 1) {\n //var topRatedDiv = isTopRated[0];\n showMsg = false;\n }\n if (debugScr) console.log('[ZineOne-om] Show Message Flag ', showMsg);\n if (showMsg) {\n\n if (z1Response.pdpUrgencyTag.includes(\"scarcity\")) {\n\n if (debugScr) console.log(\"[ZineOne]I am here 5\");\n\n if (localStorage.getItem(\"z1_cust_id\") == \"3000000018326613\" || localStorage.getItem(\"z1_cust_id\") == \"3000000015510732\" ||\n localStorage.getItem(\"z1_cust_id\") == \"3000000013469959\" || localStorage.getItem(\"z1_cust_id\") == \"2254024615400568\" ||\n localStorage.getItem(\"z1_cust_id\") == \"2254015584448533\" || localStorage.getItem(\"z1_cust_id\") == \"2253998883117448\" ||\n localStorage.getItem(\"z1_cust_id\") == \"2254015110568294\" || localStorage.getItem(\"z1_cust_id\") == \"3000000013617619\" ||\n localStorage.getItem(\"z1_cust_id\") == \"2254009728812139\" || localStorage.getItem(\"z1_cust_id\") == \"2254040233704719\" ||\n localStorage.getItem(\"z1_cust_id\") == \"2253999797960783\") {\n var z1Div = document.getElementById(\"z1-pdpscarcity\");\n if (isValid(z1Div)) {\n if (debugScr) console.log(\"[ZineOne] pdpscarcity!\");\n z1Div.innerHTML = z1Response.pdpUrgencyMsg;\n //z1Div.innerHTML = \"<i>Just a</i> <b> few left!!</b>\";\n z1Div.style.display = \"block\";\n }\n }\n\n } else {\n console.log('[ZineOne-om] Show Urgency');\n var z1div = document.getElementById(\"z1-pdpurgency\");\n z1div.innerHTML = z1Response.pdpUrgencyMsg;\n //z1div.style.display = \"block !important\";\n\n function overrideStyle(styles) {\n let css = document.createElement('style');\n css.type = 'text/css';\n\n if (css.styleSheet) css.styleSheet.cssText = styles;\n else css.appendChild(document.createTextNode(styles));\n\n document.getElementsByTagName(\"head\")[0].appendChild(css);\n }\n\n let styles = '#z1-pdpurgency {display: block !important;}';\n overrideStyle(styles);\n\t\t\t\t\t\t\tstoreUrgencyMsg = document.getElementById(\"PDP_z1Social_badge\") ? document.getElementById(\"PDP_z1Social_badge\").innerHTML : \"\";\n\n console.log('[ZineOne-om] rawData recd ' + z1div);\n console.log('[ZineOne-om] rawData recd ' + z1Response.pdpUrgencyMsg);\n }\n }\n\n }\n\n if (debugScr) console.log('[ZineOne-om] omniture z1Response is Before Scarcity ', typeof z1Response);\n\n if (z1Response && z1Response.scarcity) {\n if (debugScr) console.log(\"[ZineOne] omniture z1Response.scarcity is \", z1Response.scarcity);\n \tfunction inventoryMsgCheck(){\n var pdp_qty_inventory_msg_txt = document.getElementsByClassName(\"pdp-qty-inventory-msg-txt\");\n //console.log(\"pdp_qty_inventory_msg_txt...\",pdp_qty_inventory_msg_txt);\n if(pdp_qty_inventory_msg_txt.length > 0){\n //console.log(\"pdp_qty_inventory_msg_txt...\",pdp_qty_inventory_msg_txt[0].innerHTML);\n if(pdp_qty_inventory_msg_txt[0].innerHTML != \"\"){\n var pdpscarcity_div = document.getElementById(\"z1-pdpscarcity\");\n if(pdpscarcity_div){\n pdpscarcity_div.style.display=\"none\";\n }\n }\n else{\n var pdpscarcity_div = document.getElementById(\"z1-pdpscarcity\");\n if(pdpscarcity_div){\n pdpscarcity_div.style.display=\"block\";\n }\n }\n }\n }\n \n var scarcity = z1Response.scarcity;\n\n var quantitySectionDiv = document.getElementsByClassName(\"quantity\");\n var pdpScarcityDiv = document.getElementById(\"z1-pdpscarcity\");\n var bopusRadio = document.getElementById(\"bopusTab\");\n var shipRadio = document.getElementById(\"shipTab\");\n var bossRadio = document.getElementById(\"bossTab\");\n\n //var blockStyle = \"display:block;text-align: left; width: 100%; color: purple; font-size: 15px; clear: both; overflow: auto;\";\n\n if (scarcity.pdpInvTag == \"pdpBopusOnlineScarcity\" || scarcity.pdpInvTag == \"pdpOnlineScarcity\") {\n var onload_inv = scarcity.oInv;\n var onload_bInv = scarcity.bInv;\n if (onload_inv != 0 && onload_inv < 10) {\n //content with msg Just X left in this store\n if (quantitySectionDiv && pdpScarcityDiv) {\n if (debugScr) console.log(\"Only \" + onload_inv + \" left!\");\n //pdpScarcityDiv.setAttribute(\"style\", blockStyle);\n pdpScarcityDiv.style.display=\"block\";\n pdpScarcityDiv.style.textAlign=\"left\";\n pdpScarcityDiv.style.width=\"100%\";\n pdpScarcityDiv.style.color=\"purple\";\n pdpScarcityDiv.style.fontSize=\"15px\";\n pdpScarcityDiv.style.clear=\"both\";\n pdpScarcityDiv.style.overflow=\"auto\";\n pdpScarcityDiv.innerHTML = \"<b>Only \" + onload_inv + \" left!</b>\";\n }\n }\n }\n if (bossRadio) {\n if (bossRadio.checked) {\n if (debugScr) console.log(\"bossRadio already checked...\");\n //pdpScarcityDiv.setAttribute(\"style\", \"display: none;\");\n pdpScarcityDiv.style.display=\"none\";\n pdpScarcityDiv.innerHTML = \"\";\n }\n bossRadio.onclick = function() {\n if (debugScr) console.log(\"bossRadio checked...\");\n //pdpScarcityDiv.setAttribute(\"style\", \"display: none;\");\n pdpScarcityDiv.style.display=\"none\";\n pdpScarcityDiv.innerHTML = \"\";\n }\n }\n /**UnCommented as per Shilpa's mail on 04-06-2020**/\n if (bopusRadio) {\n if (bopusRadio.checked) {\n if (debugScr) console.log(\"bopusRadio. already checked...\", scarcity.bInv);\n var bopusValue = scarcity.bInv;\n if (bopusValue != 0 && bopusValue <= 2) {\n //content with msg Just X left in this store\n if (quantitySectionDiv && pdpScarcityDiv) {\n if (debugScr) console.log(\"Only \" + bopusValue + \" left in this store!\");\n //pdpScarcityDiv.setAttribute(\"style\", blockStyle);\n pdpScarcityDiv.style.display=\"block\";\n pdpScarcityDiv.style.textAlign=\"left\";\n pdpScarcityDiv.style.width=\"100%\";\n pdpScarcityDiv.style.color=\"purple\";\n pdpScarcityDiv.style.fontSize=\"15px\";\n pdpScarcityDiv.style.clear=\"both\";\n pdpScarcityDiv.style.overflow=\"auto\";\n pdpScarcityDiv.innerHTML = \"<b>Only \" + bopusValue + \" left in this store!</b>\";\n }\n } else {\n //remove style\n //pdpScarcityDiv.setAttribute(\"style\", \"display: none;\");\n pdpScarcityDiv.style.display=\"none\";\n pdpScarcityDiv.innerHTML = \"\";\n }\n }\n bopusRadio.onclick = function() {\n if (debugScr) console.log(\"bopusRadio clicked\");\n if (bopusRadio.checked) {\n if (debugScr) console.log(\"bopusRadio.checked...\", scarcity.bInv);\n var bopusValue = scarcity.bInv;\n if (bopusValue != 0 && bopusValue <= 2) {\n //content with msg Just X left in this store\n if (quantitySectionDiv && pdpScarcityDiv) {\n if (debugScr) console.log(\"Only \" + bopusValue + \" left in this store!\");\n //pdpScarcityDiv.setAttribute(\"style\", blockStyle);\n pdpScarcityDiv.style.display=\"block\";\n pdpScarcityDiv.style.textAlign=\"left\";\n pdpScarcityDiv.style.width=\"100%\";\n pdpScarcityDiv.style.color=\"purple\";\n pdpScarcityDiv.style.fontSize=\"15px\";\n pdpScarcityDiv.style.clear=\"both\";\n pdpScarcityDiv.style.overflow=\"auto\";\n pdpScarcityDiv.innerHTML = \"<b>Only \" + bopusValue + \" left in this store!</b>\";\n }\n } else {\n //remove style\n //pdpScarcityDiv.setAttribute(\"style\", \"display: none;\");\n pdpScarcityDiv.style.display=\"none\";\n pdpScarcityDiv.innerHTML = \"\";\n }\n }\n inventoryMsgCheck();\n };\n }\n if (shipRadio) {\n if (shipRadio.checked) {\n if (debugScr) console.log(\"shipRadio already checked...\", scarcity.oInv);\n var shipValue = scarcity.oInv;\n if (shipValue != 0 && shipValue < 10) {\n //content with msg Just X left in this store\n if (debugScr) console.log(\"Only \" + shipValue + \" left!\");\n if (quantitySectionDiv && pdpScarcityDiv) {\n if (debugScr) console.log(\"Only \" + onload_inv + \" left!\");\n //pdpScarcityDiv.setAttribute(\"style\", blockStyle);\n pdpScarcityDiv.style.display=\"block\";\n pdpScarcityDiv.style.textAlign=\"left\";\n pdpScarcityDiv.style.width=\"100%\";\n pdpScarcityDiv.style.color=\"purple\";\n pdpScarcityDiv.style.fontSize=\"15px\";\n pdpScarcityDiv.style.clear=\"both\";\n pdpScarcityDiv.style.overflow=\"auto\";\n pdpScarcityDiv.innerHTML = \"<b>Only \" + onload_inv + \" left!</b>\";\n }\n } else {\n //remove style\n //pdpScarcityDiv.setAttribute(\"style\", \"display: none;\");\n pdpScarcityDiv.style.display=\"none\";\n pdpScarcityDiv.innerHTML = \"\";\n }\n }\n shipRadio.onclick = function() {\n if (debugScr) console.log(\"shipRadio clicked\");\n if (shipRadio.checked) {\n if (debugScr) console.log(\"shipRadio.checked...\", scarcity.oInv);\n var shipValue = scarcity.oInv;\n if (shipValue != 0 && shipValue < 10) {\n //content with msg Just X left in this store\n if (debugScr) console.log(\"Only \" + shipValue + \" left!\");\n if (quantitySectionDiv && pdpScarcityDiv) {\n if (debugScr) console.log(\"Only \" + onload_inv + \" left!\");\n //pdpScarcityDiv.setAttribute(\"style\", blockStyle);\n pdpScarcityDiv.style.display=\"block\";\n pdpScarcityDiv.style.textAlign=\"left\";\n pdpScarcityDiv.style.width=\"100%\";\n pdpScarcityDiv.style.color=\"purple\";\n pdpScarcityDiv.style.fontSize=\"15px\";\n pdpScarcityDiv.style.clear=\"both\";\n pdpScarcityDiv.style.overflow=\"auto\";\n pdpScarcityDiv.innerHTML = \"<b>Only \" + onload_inv + \" left!</b>\";\n }\n } else {\n //remove style\n //pdpScarcityDiv.setAttribute(\"style\", \"display: none;\");\n pdpScarcityDiv.style.display=\"none\";\n pdpScarcityDiv.innerHTML = \"\";\n }\n }\n \tinventoryMsgCheck();\n };\n }\n\n function checkOtherStoreHandler() {\n try {\n if (quantitySectionDiv && pdpScarcityDiv) {\n //pdpScarcityDiv.setAttribute(\"style\", \"display: none;\");\n pdpScarcityDiv.style.display=\"none\";\n pdpScarcityDiv.innerHTML = \"\";\n }\n } catch (excp) {\n console.log(\"Error in checkOtherStore \", excp);\n }\n };\n\n document.addEventListener('checkOtherStore', checkOtherStoreHandler, false);\n var checkOtherStoreElem = document.getElementsByClassName(\"ce-fisCOS s-pickupstore\");\n if (checkOtherStoreElem && checkOtherStoreElem.length > 0) {\n checkOtherStoreElem = checkOtherStoreElem[0];\n checkOtherStoreElem.onclick = function() {\n //console.log(\"checkkkkkk\");\n var eventCheckOtherStore = new CustomEvent('checkOtherStore');\n document.dispatchEvent(eventCheckOtherStore);\n };\n }\n\n\n }\n\n\n if (debugScr) console.log('[ZineOne-om] omniture z1Response is Before RTOOfferData ', typeof z1Response);\n\n\n if (z1Response.silentRtoOfferData) {\n var rtoReportEvent = '_ws_sient_rto_page_report';\n\n var rtoPageCode = '';\n\n switch (evtName.toLowerCase()) {\n case \"_ws_viewedhome\":\n\n rtoPageCode = 'HP';\n\n break;\n\n case \"_ws_searched\":\n\n rtoPageCode = 'SP';\n\n break;\n\n case \"_ws_viewedcatalog\":\n\n rtoPageCode = 'TP';\n\n break;\n case \"_ws_viewedproduct\":\n\n rtoPageCode = 'PP';\n\n\n break;\n\n case \"_ws_viewedsku\":\n\n rtoPageCode = 'PP';\n\n\n break;\n\n case \"_ws_viewedcart\":\n\n rtoPageCode = 'CP';\n\n break;\n\n case \"_ws_addedtobag\":\n\n rtoPageCode = 'PP';\n\n\n\n break;\n }\n\n var currentUserVector = JSON.parse(localStorage.getItem('z1_userVectors'));\n\n if (currentUserVector) {\n var currentStartTime = currentUserVector.timeVector.toString().split('|')[0];\n\n var returnObj = {};\n returnObj.pgN = rtoPageCode;\n returnObj.sessionStartTime = currentStartTime;\n //returnObj.rtoName = e.rtoName;\n //returnObj.identifier = e.identifier;\n\n ZineOne.pushEvent(rtoReportEvent, returnObj);\n }\n\n updateUserVectors(true, 'qualification_control');\n }\n\n if (z1Response.rtoOfferData) {\n //z1Response = z1Response.rtoOfferData;\n\n var e = z1Response.rtoOfferData;\n\n localStorage.setItem('z1_supc', JSON.stringify(e));\n\n\n if (e.is_copied == 'true') return;\n\n ///////////////\n\n\n //Case 1: Display Omniture\n //Case 2: Redemption Omniture\n function sendRTOOmniture(caseToSend) {\n\n var existingSupc = localStorage.getItem('z1_supc');\n\n if (existingSupc != null && existingSupc != undefined && existingSupc != 'null') {\n\n existingSupc = JSON.parse(existingSupc);\n\n\n\n\n fireOmniture(prop75Obj);\n\n }\n }\n\n\n\n\n //function showRTOBanner(e)\n //{\n // Style string for RTO\n console.log(\"[ZineOne] webstoreSendEventAllPages tag running\");\n var style = '.popupPromoText {font-size: 1.85em;margin-bottom: 5px;}.z1_b_container_kohlsbannertoparrow_rto {font-family: \"Gotham 5r\";position: fixed;padding: 0px;z-index: 1000;background: transperant;transition: all 1s ease-in;-webkit-animation: fadein 2s;/* Safari, Chrome and Opera > 12.1 */-moz-animation: fadein 2s;/* Firefox < 16 */-ms-animation: fadein 2s;/* Internet Explorer */-o-animation: fadein 2s;/* Opera < 12.1 */animation: fadein 2s; { z1_position_val}}@keyframes fadein {from { opacity: 0;}to { opacity: 1;}}/* Firefox < 16 */@-moz-keyframes fadein {from { opacity: 0;}to { opacity: 1;}}/* Safari, Chrome and Opera > 12.1 */@-webkit-keyframes fadein {from { opacity: 0;}to { opacity: 1;}}/* Internet Explorer */@-ms-keyframes fadein {from { opacity: 0;}to { opacity: 1;}}/* Opera < 12.1 */@-o-keyframes fadein {from { opacity: 0;}to { opacity: 1;}}.arrow_box {position: absolute;text-align: center;left: 50%;transform: translate(-50%, 100%);bottom: -20px;background: #ffffff;border: 1px solid #bfbfbf;padding: 1rem;border-radius: 0.6rem;width: 238px;-webkit-box-shadow: 0px 2px 10px 7px rgba(70, 70, 70, 0.8);-moz-box-shadow: 0px 2px 10px 7px rgba(70, 70, 70, 0.8);box-shadow: 0px 2px 10px 7px rgba(70, 70, 70, 0.8);}.arrow_box:after,.arrow_box:before {content: \" \";position: absolute;}.arrow_box:after {border-color: rgba(255, 255, 255, 0);border-bottom-color: #ffffff;border-width: 20px;margin-left: -20px;}.arrow_box:before {width: 22px;height: 22px;background: #ffffff;z-index: 100;transform: translate(-50%, -50%) rotate(45deg);top: 1px;left: 50%;box-shadow: -6px -6px 5px 1px #999;}.z1_b_container_kohlsbannertoparrow_rto .z1_b_box_style {position: relative;}.z1_b_container_kohlsbannertoparrow_rto .z1_b_c1 {padding-left: 0px !important;margin-left: 0px;min-width: none;max-width: none;align-self: center;}.z1_b_container_kohlsbannertoparrow_rto .z1_b_c1 img {min-width: 64px;max-width: 64px;min-height: 64px;max-height: 64px;}.z1_b_container_kohlsbannertoparrow_rto .z1_b_c2 {padding: 0 10px;font-size: 0.9em !important;line-height: 1.5;}.z1_b_container_kohlsbannertoparrow_rto .z1_b_c2 .titleText {background: url(\"https://d2p4r375zfkzm8.cloudfront.net/zb-design-com/arrowdown3.png\") no-repeat 0 2px;font-weight: bold;color: #000;font-size: 1.08em;padding: 0px 0 3px 20px;line-height: 1.4;}.z1_b_container_kohlsbannertoparrow_rto .closeBtn {cursor: pointer;position: absolute;right: 3px;top: 8px;width: 20px;height: 20px;margin: 0;padding: 0;font-size: 19px;font-family: \"Gotham 4r\";}.z1_b_container_kohlsbannertoparrow_rto .closeBtn img {border-bottom-left-radius: 50%;border-top-left-radius: 50%;border-bottom-right-radius: 50%;border-top-right-radius: 50%;height: 13px;width: 13px;opacity: 1;}.z1_b_container_kohlsbannertoparrow_rto .offerPrice {font-size: 1.3em;color: #e8342c;padding-right: 8px;}.z1_b_container_kohlsbannertoparrow_rto .usernameText {font-size: 17px;font-weight: bold;font-style: normal;font-stretch: normal;line-height: 1.47;letter-spacing: normal;text-align: center;color: #005553;}.z1_b_container_kohlsbannertoparrow_rto .todaytext {font-size: 1.5em;color: #3a3a3a;font-weight: 400;margin: 5px 0px;display: flex;justify-content: center;align-items: center;}.z1_b_container_kohlsbannertoparrow_rto #offerDuration {font-weight: bold;font-size: 24px;}.z1_b_container_kohlsbannertoparrow_rto .todaytext div#offerDurationUnits {display: flex;flex-direction: column;text-align: left;font-size: 0.8em;}.z1_b_container_kohlsbannertoparrow_rto .savetext_row {padding: 0.6rem 0;}.z1_b_container_kohlsbannertoparrow_rto .cupontext {font-size: 14px;font-weight: 500;font-style: normal;font-stretch: normal;line-height: 1.07;letter-spacing: -0.4px;text-align: center;color: #000000;margin: 20px;}.z1_b_container_kohlsbannertoparrow_rto .cupontext span {font-weight: bold;color: #005553;}.z1_b_container_kohlsbannertoparrow_rto .btn_addoffer {background: #005553;text-transform: uppercase;color: #060606;padding: 0.40rem 1.85rem;border-radius: 2.2px;text-decoration: none;margin: 12px auto;letter-spacing: 1px;font-size: 13px;font-weight: bold;font-style: normal;font-stretch: normal;line-height: 0.6;letter-spacing: 0.5px;text-align: center;color: #ffffff;width: 138px;height: 31px;}.z1_b_container_kohlsbannertoparrow_rto .btn_addoffer.copy {content: \"Copy Offer\"}.z1_b_container_kohlsbannertoparrow_rto .btn_addoffer.copy:hover span {display: none;}.z1_b_container_kohlsbannertoparrow_rto .btn_addoffer.copy:hover:before {/* background:#d2e2d3; color: #005553; */content: \"Click to Copy\";}.z1_b_container_kohlsbannertoparrow_rto .btn_addoffer.copied:before {content: \"Copied\"}.z1_b_container_kohlsbannertoparrow_rto .btn_addoffer.copied {background-color: #d2e2d3;color: #005553;}.z1_b_container_kohlsbannertoparrow_rto .bottom_link {margin-top: 25px;font-size: 12px;font-weight: normal;font-style: normal;font-stretch: normal;line-height: 0.92;letter-spacing: normal;text-align: center;color: #444444;}.z1_b_container_kohlsbannertoparrow_rto .bottom_link a {text-decoration: underline;color: #969696;font-size: 0.8rem;line-height: 1.2;}.z1_b_container_kohlsbannertoparrow_rto .bottom_link a:hover {color: #333;}.z1_b_container_kohlsbannertoparrow_rto .saveMsg {font-size: 17px;font-weight: bold;font-style: normal;font-stretch: normal;line-height: 1.47;letter-spacing: normal;text-align: center;color: #005553;}.z1_b_container_kohlsbannertoparrow_rto .offerText {font-size: 37.1px;font-weight: bold;font-style: normal;font-stretch: normal;line-height: 0.49;letter-spacing: normal;text-align: center;color: #005553;margin: 20px 0;display: flex;justify-content: center;align-items: center;}.z1_b_container_kohlsbannertoparrow_rto .treatText {font-size: 17px;font-weight: 500;font-style: normal;font-stretch: normal;line-height: normal;letter-spacing: normal;text-align: center;color: #222222;}.z1_b_container_kohlsbannertoparrow_rto .treatTextNew {font-size: 1.2em;margin-bottom: 10px;color: #000;display: none;}.z1_b_container_kohlsbannertoparrow_rto .saveCont.saveMsg {margin-top: 8px;}.z1_b_container_kohlsbannertoparrow_rto .uptillTime {font-weight: 900;}.z1_b_container_kohlsbannertoparrow_rto .rtoOfferValue {font-size: 2em;}.treatTextLatest {font-size: 14px;font-weight: 500;font-style: normal;font-stretch: normal;line-height: normal;letter-spacing: normal;text-align: center;color: #222222;}.btn_offer_container {margin: 25px;}.z1-rto-dollar_reward {font-weight: bold;font-style: normal;font-stretch: normal;line-height: normal;letter-spacing: normal;text-align: center;color: #005553;margin-bottom: 10px;}.z1-rto-dollar_reward_content {display: flex;flex-wrap: wrap;justify-content: center;}.z1-rto-dollar-text {font-size: 34.2px;margin-top: auto;width: 20px;height: 25px;margin-bottom: auto;}.z1-rto-dollar-text-amount {font-size: 68px;height: 68px;letter-spacing: -3px;}.z1-rto-dollar-text-dOff-outer {margin-top: 15px;margin-bottom: auto;height: 25px;}.z1-rto-dollar-text-dOff-off {font-size: 16px;margin-left: -26px;position: relative;top: 4px;}.z1-rto-dollar-text-dOff-off-amount {font-size: 38px;position: relative;top: -4px;left: -5px;text-shadow: -1px 1px 0 #fff, 1px 1px 0 #fff, 1px -1px 0 #fff, -1px -1px 0 #fff;}.z1-rto-dollar-text-dOff-off-miniDollar {height: -1px;font-size: 23px;position: relative;top: -9px;}.z1-rto-dollar-text-dOff-off-miniDollarAmount {letter-spacing: -1px;}.z1_b_container_kohlsbannertoparrow_rto.loyalty {background-color: #e9f4cc;}.loyalty .usernameText {color: #208033;}.loyalty .saveMsg {color: #208033;}.loyalty .offerText {color: #208033;}.loyalty #rtoOfferCode {color: #208033;}.loyalty .z1-rto-dollar_reward_content {color: #208033;}.loyalty .btn_addoffer {background: #208033;}.loyalty.arrow_box:after {border-bottom-color: #208033;}.loyalty.arrow_box:before {background: #208033;}.z1_b_container_kohlsbannertoparrow_rto.loyalty .bottom_link a {color: #444444;}.loyalty-cont.disable {display: none}.loyalty-cont.enable {display: block}.loyalty-cont {background-color: #208033;position: relative;top: -17px;left: -17px;width: 273px;height: 60px;border-radius: 0.6em 0.6em 0 0;color: #fff;}.loyalty-cont .heading-1 {padding-top: 15px;font-size: 16px;}.loyalty-cont .heading-2 {padding-top: 8px;font-size: 12px;}.z1_b_container_kohlsbannertoparrow_rto.loyalty .closeBtn {z-index: 1;color: #fff;}.z1_b_container_kohlsbannertoparrow_rto.loyalty .loyalty-cont.disable {display: block;}.element_v2 {display: none;}.ui_v2 .element_v1 {display: none;}.ui_v2 .element_v2 {display: block;}#v2-take {position: absolute;left: 42px;top: 85px;}.ui_v2 .z1-rto-dollar-text {font-size: 36.9px;height: 5px;}.ui_v2 .z1-rto-dollar-text-amount {font-size: 82px;padding: 5px;}.ui_v2 {font-family: \"Gotham 5r\";}.ui_v2 .z1-rto-dollar-text-dOff-off {font-size: 25.6px;margin-left: 0px;top: 45px;font-weight: bold;}.ui_v2 .z1-rto-dollar_reward {margin-top: 5px;}.ui_v2 .treatText {margin-top: 25px;}.ui_v2.z1_b_container_kohlsbannertoparrow_rto .treatText {margin-top: 15px;font-size: 16px;color: #000;}.ui_v2.z1_b_container_kohlsbannertoparrow_rto .offerDuration {color: #000;font-size: 20px;margin-top: 5px;}.ui_v2.z1_b_container_kohlsbannertoparrow_rto .saveMsg {font-weight: normal;}.ui_v2.z1_b_container_kohlsbannertoparrow_rto .usernameText {font-weight: normal;}.ui_v2.z1_b_container_kohlsbannertoparrow_rto .cupontext {color: #005553;font-size: 15px;}.ui_v2.z1_b_container_kohlsbannertoparrow_rto .bottom_link a {color: #444444;}.ui_v2.dollar_fix .z1-rto-dollar-text-dOff-off {top: 20px;}.ui_v2.dollar_fix #v2-take {top: 70px;}.ui_v2.dollar_fix.z1_b_container_kohlsbannertoparrow_rto .offerText {margin: 30px 0;margin-bottom: 25px;}.ui_v2.dollar_fix.z1_b_container_kohlsbannertoparrow_rto .rtoOfferValue {font-size: 89.7px;}.ui_v2.dollar_fix.z1_b_container_kohlsbannertoparrow_rto .offerText {font-size: 40.4px;}';\n\n if (debugScr) console.log('Before RTO Style');\n\n\n var css = document.createElement('style');\n css.type = 'text/css';\n\n if (css.styleSheet) css.styleSheet.cssText = style;\n else css.appendChild(document.createTextNode(style));\n\n document.getElementsByTagName(\"head\")[0].appendChild(css);\n\n\n //appendStyle(style);\n var domstr_val = \"\";\n var dolStr = \"$\";\n var pctStr = \"\";\n\n\n domstr_val = '<div id=\"v2-take\" class=\"saveMsg element_v2\">Take</div><div class=\"offerText\">' + dolStr + '<span id=\"rtoOfferValue\" class=\"rtoOfferValue\"></span><span class=\"z1-rto-dollar-text-dOff-off element_v2\">off</span>' + '</div>';\n\n\n if (e.offType == \"PERCENT_FIX\") {\n pctStr = \"%\";\n\n domstr_val = '<div class=\"offerText\">' + '<span id=\"rtoOfferValue\" class=\"rtoOfferValue\"></span>' + pctStr + '</div>';\n }\n\n if (e.offType == \"DOLLAR_THR\") {\n domstr_val = '<div class=\"z1-rto-dollar_reward\"><div id=\"v2-take\" class=\"saveMsg element_v2\">Take</div><div class=\"z1-rto-dollar_reward_content\"><div class=\"z1-rto-dollar-text\">$</div><div id=\"rtoOfferValue\" class=\"z1-rto-dollar-text-amount\"></div><div class=\"z1-rto-dollar-text-dOff-outer\"><span class=\"z1-rto-dollar-text-dOff-off\">off</span> <br><span class=\"z1-rto-dollar-text-dOff-off-amount element_v1\"><span class=\"z1-rto-dollar-text-dOff-off-miniDollar\">$</span><span class=\"z1-rto-dollar-text-dOff-off-miniDollarAmount\">' + e.offThres + '</span></span></div></div></div>';\n }\n\n\n\n var domstr = '<div data-zineone-properties=\"modal:true;container-class:z1_b_container_kohlsbannertoparrow_rto;\" id=\"z1-rto-div\" class=\"z1_b_container_kohlsbannertoparrow_rto arrow_box\"><div class=\"closeBtn\" onclick=\"var el=document.getElementById(\\'z1-rto-div\\'); el.innerHTML=\\'\\';el.parentNode.removeChild(el);\">x</div><div class=\"z1_b_c1\"><div class=\"loyalty-cont disable\"><div class=\"heading-1\">KOHL’S REWARDS®</div><div class=\"heading-2\">MEMBER EXCLUSIVE</div></div><div><span class=\"usernameText\">Hi, </span><span class=\"saveMsg element_v1\"> save</span><div class=\"saveMsg element_v2\">your cart looks great!</div></div>' + domstr_val + '<div class=\"treatText element_v1\">in the next <span id=\"offerDuration\"></span> minutes.</div><div class=\"saveMsg element_v2\">the items in your cart!</div><div class=\"treatTextNew\">Valid until <span id=\"uptillTime\" class=\"uptillTime\"></span></div><div class=\"treatTextLatest element_v1\">(Go ahead, treat yourself!)</div><div class=\"element_v2\"><div class=\"treatText\">Check out in the next</div><div class=\"offerDuration\"><span id=\"offerDurationv2\"></span> minutes.</div></div><div class=\"cupontext\">PROMO CODE: <span id=\"rtoOfferCode\"></span></div><div class=\"btn_offer_container\"><a class=\"btn_addoffer\"><span id=\"btn_addoffer\"></span></a></div><div class=\"bottom_link\"><a id=\"discliamer_href\" href=\"#\" target=\"_default\">details & exclusions</a></div><input type=\"text\" id=\"textCopy\" style=\"opacity:0;pointer-events:none\" /></div></div>';\n\n\n\n var t = document.createRange().createContextualFragment(domstr);\n\n if (debugScr) console.log('Before RTO Z1 Widget');\n\n\n if (!document.getElementById('z1widget')) {\n return;\n }\n\n document.getElementById('z1widget').appendChild(t);\n\n\n /* On IE appendChild won't work with primitive values and strings. It needs DOM element or else use innerHTML if you want to put primitive values inside divs. \n document.getElementById('rtoOfferValue').appendChild(e.offerValue);\n document.getElementById('rtoOfferCode').appendChild(e.offerCode);\n document.getElementById('textCopy').value = e.offerCode;\n document.getElementById('offerDuration').appendChild(e.offerDuration);\n document.getElementById('offerDurationv2').appendChild(e.offerDuration);\n\n document.getElementById('discliamer_href').href = e.disclaimer;*/\n document.getElementById('rtoOfferValue').innerHTML=e.offerValue;\n document.getElementById('rtoOfferCode').innerHTML=e.offerCode;\n document.getElementById('textCopy').value= e.offerCode;\n document.getElementById('offerDuration').innerHTML=e.offerDuration;\n document.getElementById('offerDurationv2').innerHTML=e.offerDuration;\n\n document.getElementById('discliamer_href').href = e.disclaimer;\n\n \n var uptillTime = new Date();\n uptillTime.setMinutes(uptillTime.getMinutes() + Number(e.offerDuration));\n\n if (e.loyaltyCx == true) {\n document.getElementById('z1-rto-div').classList.add('loyalty');\n }\n\n if (e.ui_version && e.ui_version == 2) {\n document.getElementById('z1-rto-div').classList.add('ui_v2');\n document.getElementById('z1-rto-div').classList.add(e.offType.toLowerCase());\n }\n\n if (e.cta == \"COPY\") {\n document.getElementById('btn_addoffer').innerText = \"COPY OFFER\";\n document.getElementsByClassName('btn_addoffer')[0].classList.add('copy');\n }\n\n if (e.cta == \"ADD\" || e.cta == 'WALLET') {\n document.getElementById('btn_addoffer').innerText = \"ADD OFFER\";\n }\n \n\n document.getElementsByClassName('btn_addoffer')[0].onclick = function() {\n\n if (e.cta == 'COPY') {\n\n var copyTextField = document.getElementById('textCopy');\n copyTextField.select();\n\n var copied = document.execCommand(\"copy\");\n\n console.log('webStoreAllEvents: Got Copied Status ' + copied);\n\n\n document.getElementsByClassName('btn_addoffer')[0].classList.add('copied');\n document.getElementById('btn_addoffer').innerText = \"\";\n\n e.is_copied = 'true';\n localStorage.setItem('z1_supc', JSON.stringify(e));\n\n return;\n }\n\n var urlToGo = '/checkout/shopping_cart.jsp?redeemCoupon=true';\n\n\n if (e.cta == 'WALLET') {\n if (pageData && pageData.cartDetails && pageData.cartDetails.cartSubTotalValue) {\n var cartValue = parseInt(pageData.cartDetails.cartSubTotalValue);\n\n //alert('Got Cart Value '+cartValue);\n if (cartValue == 0) {\n urlToGo = '/wallet/my_wallet.jsp#offers';\n }\n\n }\n }\n\n location.href = urlToGo;\n\n };\n\n\n\n \n var hours = uptillTime.getHours();\n var minutes = uptillTime.getMinutes();\n var ampm = hours >= 12 ? 'pm' : 'am';\n hours = hours % 12;\n hours = hours ? hours : 12; // the hour '0' should be '12'\n minutes = minutes < 10 ? '0' + minutes : minutes;\n var strTime = hours + ':' + minutes + ' ' + ampm;\n\n\n \n var uptillTimeStr = strTime;\n\n //document.getElementById('uptillTime').appendChild(uptillTimeStr + '.');\n document.getElementById('uptillTime').innerHTML = uptillTimeStr + '.';\n\n if (document.getElementsByClassName('first-name')[0] && document.getElementsByClassName('first-name')[0].innerText.toLowerCase() != \"account\") {\n document.getElementsByClassName('usernameText')[0].innerText = document.getElementsByClassName('first-name')[0].innerText + ',';\n } else {\n document.getElementsByClassName('saveMsg')[0].innerText = \"Save\";\n }\n \n var existingSupc = localStorage.getItem('z1_supc');\n\n if (existingSupc != null && existingSupc != undefined && existingSupc != 'null') {\n\n existingSupc = JSON.parse(existingSupc);\n\n } else {\n existingSupc = {};\n existingSupc.offType = \"\";\n }\n \n var prop75 = existingSupc.omniturePrefix + '|';\n prop75 = prop75 + 'C:' + existingSupc.offerCampaign + '|';\n prop75 = prop75 + existingSupc.identifier + '|';\n\n prop75 = prop75 + 'OL|';\n\n console.log('Got Event Name for RTO ', evtName);\n\n\n var rtoReportEvent = '_ws_rto_page_report';\n\n var rtoPageCode = '';\n\n switch (evtName.toLowerCase()) {\n case \"_ws_viewedhome\":\n\n //prop75 = prop75 + 'HP|';\n rtoPageCode = 'HP';\n\n break;\n\n case \"_ws_searched\":\n\n //prop75 = prop75 + 'SP|';\n rtoPageCode = 'SP';\n\n break;\n\n case \"_ws_viewedcatalog\":\n\n //prop75 = prop75 + 'TP|';\n rtoPageCode = 'TP';\n\n break;\n case \"_ws_viewedproduct\":\n\n //prop75 = prop75 + 'PP|';\n rtoPageCode = 'PP';\n\n s.pageName = '';\n s.prop4 = '';\n\n\n break;\n\n case \"_ws_viewedsku\":\n\n //prop75 = prop75 + 'PP|';\n rtoPageCode = 'PP';\n\n s.pageName = '';\n s.prop4 = '';\n\n\n break;\n\n case \"_ws_viewedcart\":\n\n //prop75 = prop75 + 'CP|';\n rtoPageCode = 'CP';\n\n break;\n\n case \"_ws_addedtobag\":\n\n //prop75 = prop75 + 'PP|';\n rtoPageCode = 'PP';\n\n s.pageName = '';\n s.prop4 = '';\n\n\n break;\n }\n\n var currentUserVector = JSON.parse(localStorage.getItem('z1_userVectors'));\n\n if (currentUserVector) {\n var currentStartTime = currentUserVector.timeVector.toString().split('|')[0];\n\n var returnObj = {};\n returnObj.pgN = rtoPageCode;\n returnObj.sessionStartTime = currentStartTime;\n returnObj.type = \"shown\";\n returnObj.rtoName = e.rtoName;\n returnObj.identifier = e.identifier;\n\n ZineOne.pushEvent(rtoReportEvent, returnObj);\n }\n\n //console.log('After Report Event ', e.pscore,e.offerValue,pageData.cartDetails.cartSubTotalValue,e.offerCode,pageData.customerDetails.customerID);\n\n //prop75 = prop75 + 'P:' + e.pscore + '|';\n //prop75 = prop75 + 'O:' + e.offerValue + '|';\n //prop75 = prop75 + 'T:' + pageData.cartDetails.cartSubTotalValue + '|';\n //prop75 = prop75 + 'OC:' + e.offerCode;\n\n var prop75Obj = {};\n prop75Obj['prop75'] = prop75;\n\n if (debugScr) console.log('Got Prop 75 ', prop75Obj);\n\n var cusId = pageData.customerDetails.customerID;\n\n //console.log('Before Condition Check',prop75Obj.prop75,cusId);\n\n if (cusId && prop75Obj.prop75) {\n //console.log('Inside s.tl Omniture ',prop75Obj.prop75);\n\n var eVar39 = cusId;\n s.tl(this, 'o', 'ZineOne Impression', {\n linkTrackVars: 'prop75,eVar39',\n prop75: prop75Obj.prop75,\n eVar39: eVar39\n });\n\n }\n\n updateUserVectors(true, \"qualification_test\");\n\n document.getElementById(\"z1-rto-div\").onclick = function(e) {\n //console.log(\"Event...\",e)\n e.stopPropagation();\n\n //console.log('Elemtn Id ',e.toElement.id);\n\n if (e.toElement.id == 'discliamer_href') {\n window.open(\n document.getElementById(\"discliamer_href\").href,\n '_blank' // <- This is what makes it open in a new window.\n );\n }\n //e.preventDefault();\n return false;\n };\n\n\n\n\n\n\n }\n\n if (typeof s == 'undefined') {\n if (debugScr) console.log('[ZineOne] omniture s is not defined');\n return;\n }\n\n if (debugScr) console.log('[ZineOne-om] omniture z1Response is ', typeof z1Response);\n\n\n if (typeof z1Response == 'string') {\n z1Response = JSON.parse(z1Response);\n }\n\n if (debugScr) console.log('[ZineOne-om] omniture z1Response.prop75 is ', z1Response.prop75, typeof z1Response);\n\n if (z1Response && z1Response.prop75) {\n var showMsg = true;\n if ((z1Response.prop75).includes(\"w>z1pu\")) {\n var isTopRated = document.getElementsByClassName(\"tce-toprated-text\");\n if (isTopRated.length >= 1) {\n if (debugScr) console.log('[ZineOne] found isTopRated=true');\n var topRatedDiv = isTopRated[0];\n showMsg = false;\n }\n var isKChoice = document.getElementsByClassName(\"tce-kchoice\");\n if (isKChoice.length >= 1) {\n if (debugScr) console.log('[ZineOne] found isKChoice=true');\n var topRatedDiv = isKChoice[0];\n showMsg = false;\n }\n }\n if (showMsg) {\n var eVar39 = z1Response.evar39 ? z1Response.evar39 : z1Response.customerId;\n s.tl(this, 'o', 'ZineOne Impression', {\n linkTrackVars: 'prop75,eVar39',\n prop75: z1Response.prop75,\n eVar39: eVar39\n });\n } else {\n var eVar39 = z1Response.evar39 ? z1Response.evar39 : z1Response.customerId;\n var prop75 = \"w>z1pu|e\";\n s.tl(this, 'o', 'ZineOne Impression', {\n linkTrackVars: 'prop75,eVar39',\n prop75: prop75,\n eVar39: eVar39\n });\n }\n }\n\n if (z1Response && z1Response.prop75) {\n if ((z1Response.prop75).includes(\"w>z1wo\")) {\n ZineOne.pushEvent(\"_ws_z1_wallet_er_update_time\", {});\n }\n }\n\n if (z1Response && z1Response.rtoControl) {\n\n var rtoConProp75 = z1Response.rtoControl;\n\n switch (evtName.toLowerCase()) {\n case \"_ws_viewedhome\":\n\n rtoConProp75 = rtoConProp75.replace('<PN>', 'HP');\n\n break;\n\n case \"_ws_searched\":\n\n rtoConProp75 = rtoConProp75.replace('<PN>', 'SP');\n\n break;\n\n case \"_ws_viewedcatalog\":\n\n rtoConProp75 = rtoConProp75.replace('<PN>', 'TP');\n\n break;\n case \"_ws_viewedproduct\":\n\n rtoConProp75 = rtoConProp75.replace('<PN>', 'PP');\n\n s.pageName = '';\n s.prop4 = '';\n\n\n break;\n\n case \"_ws_viewedsku\":\n\n rtoConProp75 = rtoConProp75.replace('<PN>', 'PP');\n\n s.pageName = '';\n s.prop4 = '';\n\n\n break;\n\n case \"_ws_viewedcart\":\n\n rtoConProp75 = rtoConProp75.replace('<PN>', 'CP');\n\n break;\n\n case \"_ws_addedtobag\":\n\n rtoConProp75 = rtoConProp75.replace('<PN>', 'PP');\n\n s.pageName = '';\n s.prop4 = '';\n\n\n break;\n }\n\n\n var eVar39 = z1Response.evar39 ? z1Response.evar39 : z1Response.customerId;\n s.tl(this, 'o', 'ZineOne Impression', {\n linkTrackVars: 'prop75,eVar39',\n prop75: rtoConProp75,\n eVar39: eVar39\n });\n\n //updateUserVectors(true,'qualification_control');\n\n }\n\n if (z1Response && z1Response.fsg) {\n\n if (debugScr) console.log('[ZineOne] free shipping gauge is ' + (z1Response));\n\n var vID = localStorage.getItem(\"z1_cust_id\"); //getCookie(\"VisitorId\");\n if (!isValid(vID)) {\n vID = localStorage.getItem(\"z1_connectUserId\");\n }\n var timestamp = new Date().getTime();\n // Venkat - Begin 10/23/2018 - MVC freeship code enhancement\n var z1_fsg_data = {\n 'fsg': {\n '_d': z1Response.fsg._d,\n '_t': z1Response.fsg._t,\n 'offerCode': z1Response.fsg.offerCode\n },\n 'timestamp': timestamp,\n 'visitorId': vID\n };\n // Venkat - End 10/23/2018 - MVC freeship code enhancement\n localStorage.setItem('z1_fsg_data', JSON.stringify(z1_fsg_data));\n //fsg(JSON.stringify(z1_fsg_data));\n }\n\n if (z1Response && z1Response.bopus) {\n\n if (z1Response.bopus == \"1\") {\n getBopusInfo();\n localStorage.setItem(\"z1_bopus_data\", JSON.stringify(z1Response));\n }\n\n }\n\n if (z1Response && z1Response.rStar) {\n var product_list_with_stars = z1Response.rStar;\n if (product_list_with_stars.length > 0) {\n if (debugScr) console.log(\"[ZineOne] stars with commerce_ids rStar = \", product_list_with_stars);\n for (let i = 0; i < product_list_with_stars.length; i++) {\n //if (debugScr) console.log(\"c obj ...\",product_list_with_stars[i]);\n let elmnt_id = \"z1-star-\" + product_list_with_stars[i].cid;\n let number_of_stars = product_list_with_stars[i].stars;\n number_of_stars = Math.round(number_of_stars * 10) / 10;\n //if (debugScr) console.log(\"[ZineOne] elmnt_id ...\",elmnt_id);\n //if (debugScr) console.log(\"[ZineOne] number_of_stars ...\",number_of_stars);\n if (number_of_stars >= 4) {\n let parent_div = document.getElementById(elmnt_id);\n //if (debugScr) console.log(\"[ZineOne] parent_div...\",parent_div);\n let innerHTMLSvgString = \"\";\n innerHTMLSvgString = innerHTMLSvgString + '<div style=\"float: left;padding-right: 3px;\">';\n for (let j = 0; j < 5; j++) {\n var check_if_decimal = (number_of_stars - j).toFixed(2);\n //if (debugScr) console.log(\"[ZineOne] check_if_decimal...\",check_if_decimal);\n if (check_if_decimal < 1 && check_if_decimal > 0) {\n //if (debugScr) console.log(\"[ZineOne] iff... <1 >0...\");\n innerHTMLSvgString = innerHTMLSvgString + '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16px\" height=\"16px\" viewBox=\"0 0 25 25\" style=\"width: 16px !important; height: 16px !important;\"><polygon points=\"\" style=\"fill: url("#bv_rating_summary_star_filled_0_' + (check_if_decimal * 100) + '.99_975024") !important;\"></polygon><path d=\"M24.8676481,9.0008973 C24.7082329,8.54565507 24.2825324,8.23189792 23.7931772,8.20897226 L16.1009423,8.20897226 L13.658963,0.793674161 C13.4850788,0.296529881 12.9965414,-0.0267985214 12.4623931,0.00174912135 L12.4623931,0.00174912135 C11.9394964,-0.00194214302 11.4747239,0.328465149 11.3146628,0.81767189 L8.87268352,8.23296999 L1.20486846,8.23296999 C0.689809989,8.22949161 0.230279943,8.55030885 0.0640800798,9.0294023 C-0.102119784,9.50849575 0.0623083246,10.0383495 0.472274662,10.3447701 L6.69932193,14.9763317 L4.25734261,22.4396253 C4.08483744,22.9295881 4.25922828,23.4727606 4.68662933,23.7767181 C5.11403038,24.0806756 5.69357086,24.0736812 6.11324689,23.7595003 L12.6333317,18.9599546 L19.1778362,23.7595003 C19.381674,23.9119158 19.6299003,23.9960316 19.8860103,23.9994776 C20.2758842,24.0048539 20.6439728,23.8232161 20.8724402,23.5127115 C21.1009077,23.202207 21.1610972,22.8017824 21.0337405,22.4396253 L18.5917612,14.9763317 L24.6967095,10.3207724 C25.0258477,9.95783882 25.0937839,9.43328063 24.8676481,9.0008973 Z\" style=\"fill: url("#bv_rating_summary_star_filled_0_' + (check_if_decimal * 100) + '.99_975024") !important;\"></path><defs><linearGradient id=\"bv_rating_summary_star_filled_0_' + (check_if_decimal * 100) + '.99_975024\" x1=\"' + (check_if_decimal * 100) + '%\" y1=\"0%\" x2=\"100%\" y2=\"0%\"><stop offset=\"0%\" style=\"stop-color: rgb(0, 0, 0); stop-opacity: 1;\"></stop><stop offset=\"1%\" style=\"stop-color: rgb(246, 246, 246); stop-opacity: 1;\"></stop></linearGradient></defs></svg>';\n } else if (check_if_decimal <= 0) {\n //if (debugScr) console.log(\"[ZineOne] iff... <= 0...\");\n innerHTMLSvgString = innerHTMLSvgString + '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16px\" height=\"16px\" viewBox=\"0 0 25 25\" style=\"width: 16px !important; height: 16px !important;\"><polygon points=\"\" style=\"fill: url("#bv_rating_summary_star_filled_0_0.99_975024") !important;\"></polygon><path d=\"M24.8676481,9.0008973 C24.7082329,8.54565507 24.2825324,8.23189792 23.7931772,8.20897226 L16.1009423,8.20897226 L13.658963,0.793674161 C13.4850788,0.296529881 12.9965414,-0.0267985214 12.4623931,0.00174912135 L12.4623931,0.00174912135 C11.9394964,-0.00194214302 11.4747239,0.328465149 11.3146628,0.81767189 L8.87268352,8.23296999 L1.20486846,8.23296999 C0.689809989,8.22949161 0.230279943,8.55030885 0.0640800798,9.0294023 C-0.102119784,9.50849575 0.0623083246,10.0383495 0.472274662,10.3447701 L6.69932193,14.9763317 L4.25734261,22.4396253 C4.08483744,22.9295881 4.25922828,23.4727606 4.68662933,23.7767181 C5.11403038,24.0806756 5.69357086,24.0736812 6.11324689,23.7595003 L12.6333317,18.9599546 L19.1778362,23.7595003 C19.381674,23.9119158 19.6299003,23.9960316 19.8860103,23.9994776 C20.2758842,24.0048539 20.6439728,23.8232161 20.8724402,23.5127115 C21.1009077,23.202207 21.1610972,22.8017824 21.0337405,22.4396253 L18.5917612,14.9763317 L24.6967095,10.3207724 C25.0258477,9.95783882 25.0937839,9.43328063 24.8676481,9.0008973 Z\" style=\"fill: url("#bv_rating_summary_star_filled_0_0.99_975024") !important;\"></path><defs><linearGradient id=\"bv_rating_summary_star_filled_0_0.99_975024\" x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\"><stop offset=\"0%\" style=\"stop-color: rgb(0, 0, 0); stop-opacity: 1;\"></stop><stop offset=\"1%\" style=\"stop-color: rgb(246, 246, 246); stop-opacity: 1;\"></stop></linearGradient></defs></svg>';\n } else {\n //if (debugScr) console.log(\"[ZineOne] iff... 99...\");\n innerHTMLSvgString = innerHTMLSvgString + '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16px\" height=\"16px\" viewBox=\"0 0 25 25\" style=\"width: 16px !important; height: 16px !important;\"><polygon points=\"\" style=\"fill: url("#bv_rating_summary_star_filled_0_99.99_975024") !important;\"></polygon><path d=\"M24.8676481,9.0008973 C24.7082329,8.54565507 24.2825324,8.23189792 23.7931772,8.20897226 L16.1009423,8.20897226 L13.658963,0.793674161 C13.4850788,0.296529881 12.9965414,-0.0267985214 12.4623931,0.00174912135 L12.4623931,0.00174912135 C11.9394964,-0.00194214302 11.4747239,0.328465149 11.3146628,0.81767189 L8.87268352,8.23296999 L1.20486846,8.23296999 C0.689809989,8.22949161 0.230279943,8.55030885 0.0640800798,9.0294023 C-0.102119784,9.50849575 0.0623083246,10.0383495 0.472274662,10.3447701 L6.69932193,14.9763317 L4.25734261,22.4396253 C4.08483744,22.9295881 4.25922828,23.4727606 4.68662933,23.7767181 C5.11403038,24.0806756 5.69357086,24.0736812 6.11324689,23.7595003 L12.6333317,18.9599546 L19.1778362,23.7595003 C19.381674,23.9119158 19.6299003,23.9960316 19.8860103,23.9994776 C20.2758842,24.0048539 20.6439728,23.8232161 20.8724402,23.5127115 C21.1009077,23.202207 21.1610972,22.8017824 21.0337405,22.4396253 L18.5917612,14.9763317 L24.6967095,10.3207724 C25.0258477,9.95783882 25.0937839,9.43328063 24.8676481,9.0008973 Z\" style=\"fill: url("#bv_rating_summary_star_filled_0_99.99_975024") !important;\"></path><defs><linearGradient id=\"bv_rating_summary_star_filled_0_99.99_975024\" x1=\"99.99%\" y1=\"0%\" x2=\"100%\" y2=\"0%\"><stop offset=\"0%\" style=\"stop-color: rgb(0, 0, 0); stop-opacity: 1;\"></stop><stop offset=\"1%\" style=\"stop-color: rgb(246, 246, 246); stop-opacity: 1;\"></stop></linearGradient></defs></svg>';\n }\n }\n innerHTMLSvgString = innerHTMLSvgString + '</div>';\n innerHTMLSvgString = innerHTMLSvgString + '<div style=\"float:left;line-height: 20px;\"><span style=\"font-family: 'Gotham 7r',Helvetica,Arial,sans-serif;color:black;\">' + number_of_stars + '</span></div>';\n\n parent_div.innerHTML = innerHTMLSvgString;\n\n }\n }\n }\n }\n\n if (z1Response && z1Response.rStarAbovePointOne) {\n //console.log(\"SAIKAT - ENTERED BLOCK OF Z1RESPONSE & Z1RESPONSE.rStarAbovePointOne\");\n console.log(\"rStarAbovePointOne called!\");\n function showRating() {\n var product_list_with_stars = z1Response.rStarAbovePointOne;\n if (product_list_with_stars.length > 0) {\n if (debugScr) console.log(\"[ZineOne] stars with commerce_ids rStarAbovePointOne = \", product_list_with_stars);\n for (let i = 0; i < product_list_with_stars.length; i++) {\n //if (debugScr) console.log(\"c obj ...\",product_list_with_stars[i]);\n let elmnt_id = \"z1-star-\" + product_list_with_stars[i].cid;\n let number_of_stars = product_list_with_stars[i].stars;\n number_of_stars = Math.round(number_of_stars * 10) / 10;\n if (debugScr) console.log(\"[ZineOne] rStarAbovePointOne - elmnt_id ...\", elmnt_id);\n if (debugScr) console.log(\"[ZineOne] rStarAbovePointOne - number_of_stars ...\", number_of_stars);\n if (number_of_stars >= 0) {\n let parent_div = document.getElementById(elmnt_id);\n parent_div.setAttribute(\"style\", \"margin-top:10px;\");\n //if (debugScr) console.log(\"[ZineOne] parent_div...\",parent_div);\n let innerHTMLSvgString = \"\";\n innerHTMLSvgString = innerHTMLSvgString + '<div style=\"float: left;padding-right: 3px;\">';\n for (let j = 0; j < 5; j++) {\n var check_if_decimal = (number_of_stars - j).toFixed(2);\n //if (debugScr) console.log(\"[ZineOne] check_if_decimal...\",check_if_decimal);\n if (check_if_decimal < 1 && check_if_decimal > 0) {\n //if (debugScr) console.log(\"[ZineOne] iff... <1 >0...\");\n innerHTMLSvgString = innerHTMLSvgString + '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14px\" height=\"14px\" viewBox=\"0 0 25 25\" style=\"width: 14px !important; height: 14px !important;\"><polygon points=\"\" style=\"fill: url("#bv_rating_summary_star_filled_0_' + (check_if_decimal * 100) + '.99_975024") !important;\"></polygon><path d=\"M24.8676481,9.0008973 C24.7082329,8.54565507 24.2825324,8.23189792 23.7931772,8.20897226 L16.1009423,8.20897226 L13.658963,0.793674161 C13.4850788,0.296529881 12.9965414,-0.0267985214 12.4623931,0.00174912135 L12.4623931,0.00174912135 C11.9394964,-0.00194214302 11.4747239,0.328465149 11.3146628,0.81767189 L8.87268352,8.23296999 L1.20486846,8.23296999 C0.689809989,8.22949161 0.230279943,8.55030885 0.0640800798,9.0294023 C-0.102119784,9.50849575 0.0623083246,10.0383495 0.472274662,10.3447701 L6.69932193,14.9763317 L4.25734261,22.4396253 C4.08483744,22.9295881 4.25922828,23.4727606 4.68662933,23.7767181 C5.11403038,24.0806756 5.69357086,24.0736812 6.11324689,23.7595003 L12.6333317,18.9599546 L19.1778362,23.7595003 C19.381674,23.9119158 19.6299003,23.9960316 19.8860103,23.9994776 C20.2758842,24.0048539 20.6439728,23.8232161 20.8724402,23.5127115 C21.1009077,23.202207 21.1610972,22.8017824 21.0337405,22.4396253 L18.5917612,14.9763317 L24.6967095,10.3207724 C25.0258477,9.95783882 25.0937839,9.43328063 24.8676481,9.0008973 Z\" style=\"fill: url("#bv_rating_summary_star_filled_0_' + (check_if_decimal * 100) + '.99_975024") !important;\"></path><defs><linearGradient id=\"bv_rating_summary_star_filled_0_' + (check_if_decimal * 100) + '.99_975024\" x1=\"' + (check_if_decimal * 100) + '%\" y1=\"0%\" x2=\"100%\" y2=\"0%\"><stop offset=\"0%\" style=\"stop-color: rgb(0, 0, 0); stop-opacity: 1;\"></stop><stop offset=\"1%\" style=\"stop-color: rgb(246, 246, 246); stop-opacity: 1;\"></stop></linearGradient></defs></svg>';\n } else if (check_if_decimal <= 0) {\n //if (debugScr) console.log(\"[ZineOne] iff... <= 0...\");\n innerHTMLSvgString = innerHTMLSvgString + '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14px\" height=\"14px\" viewBox=\"0 0 25 25\" style=\"width: 14px !important; height: 14px !important;\"><polygon points=\"\" style=\"fill: url("#bv_rating_summary_star_filled_0_0.99_975024") !important;\"></polygon><path d=\"M24.8676481,9.0008973 C24.7082329,8.54565507 24.2825324,8.23189792 23.7931772,8.20897226 L16.1009423,8.20897226 L13.658963,0.793674161 C13.4850788,0.296529881 12.9965414,-0.0267985214 12.4623931,0.00174912135 L12.4623931,0.00174912135 C11.9394964,-0.00194214302 11.4747239,0.328465149 11.3146628,0.81767189 L8.87268352,8.23296999 L1.20486846,8.23296999 C0.689809989,8.22949161 0.230279943,8.55030885 0.0640800798,9.0294023 C-0.102119784,9.50849575 0.0623083246,10.0383495 0.472274662,10.3447701 L6.69932193,14.9763317 L4.25734261,22.4396253 C4.08483744,22.9295881 4.25922828,23.4727606 4.68662933,23.7767181 C5.11403038,24.0806756 5.69357086,24.0736812 6.11324689,23.7595003 L12.6333317,18.9599546 L19.1778362,23.7595003 C19.381674,23.9119158 19.6299003,23.9960316 19.8860103,23.9994776 C20.2758842,24.0048539 20.6439728,23.8232161 20.8724402,23.5127115 C21.1009077,23.202207 21.1610972,22.8017824 21.0337405,22.4396253 L18.5917612,14.9763317 L24.6967095,10.3207724 C25.0258477,9.95783882 25.0937839,9.43328063 24.8676481,9.0008973 Z\" style=\"fill: url("#bv_rating_summary_star_filled_0_0.99_975024") !important;\"></path><defs><linearGradient id=\"bv_rating_summary_star_filled_0_0.99_975024\" x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\"><stop offset=\"0%\" style=\"stop-color: rgb(0, 0, 0); stop-opacity: 1;\"></stop><stop offset=\"1%\" style=\"stop-color: rgb(246, 246, 246); stop-opacity: 1;\"></stop></linearGradient></defs></svg>';\n } else {\n //if (debugScr) console.log(\"[ZineOne] iff... 99...\");\n innerHTMLSvgString = innerHTMLSvgString + '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14px\" height=\"14px\" viewBox=\"0 0 25 25\" style=\"width: 14px !important; height: 14px !important;\"><polygon points=\"\" style=\"fill: url("#bv_rating_summary_star_filled_0_99.99_975024") !important;\"></polygon><path d=\"M24.8676481,9.0008973 C24.7082329,8.54565507 24.2825324,8.23189792 23.7931772,8.20897226 L16.1009423,8.20897226 L13.658963,0.793674161 C13.4850788,0.296529881 12.9965414,-0.0267985214 12.4623931,0.00174912135 L12.4623931,0.00174912135 C11.9394964,-0.00194214302 11.4747239,0.328465149 11.3146628,0.81767189 L8.87268352,8.23296999 L1.20486846,8.23296999 C0.689809989,8.22949161 0.230279943,8.55030885 0.0640800798,9.0294023 C-0.102119784,9.50849575 0.0623083246,10.0383495 0.472274662,10.3447701 L6.69932193,14.9763317 L4.25734261,22.4396253 C4.08483744,22.9295881 4.25922828,23.4727606 4.68662933,23.7767181 C5.11403038,24.0806756 5.69357086,24.0736812 6.11324689,23.7595003 L12.6333317,18.9599546 L19.1778362,23.7595003 C19.381674,23.9119158 19.6299003,23.9960316 19.8860103,23.9994776 C20.2758842,24.0048539 20.6439728,23.8232161 20.8724402,23.5127115 C21.1009077,23.202207 21.1610972,22.8017824 21.0337405,22.4396253 L18.5917612,14.9763317 L24.6967095,10.3207724 C25.0258477,9.95783882 25.0937839,9.43328063 24.8676481,9.0008973 Z\" style=\"fill: url("#bv_rating_summary_star_filled_0_99.99_975024") !important;\"></path><defs><linearGradient id=\"bv_rating_summary_star_filled_0_99.99_975024\" x1=\"99.99%\" y1=\"0%\" x2=\"100%\" y2=\"0%\"><stop offset=\"0%\" style=\"stop-color: rgb(0, 0, 0); stop-opacity: 1;\"></stop><stop offset=\"1%\" style=\"stop-color: rgb(246, 246, 246); stop-opacity: 1;\"></stop></linearGradient></defs></svg>';\n }\n }\n innerHTMLSvgString = innerHTMLSvgString + '</div>';\n innerHTMLSvgString = innerHTMLSvgString + '<div style=\"float: left;font-size: 12px;font-family: \\'Gotham 7r\\',GothamBold,Helvetica,Arial,sans-serif;height: 11px;width: 26px;font-weight: bold;font-style: normal;font-stretch: normal;line-height: normal;letter-spacing: normal;color: #000000;\">' + number_of_stars + '</div>';\n\n parent_div.innerHTML = innerHTMLSvgString;\n\n }\n }\n }\n\n var decrement_btn_collection = document.getElementsByClassName(\"shopping_cart_dec\");\n var increment_btn_collection = document.getElementsByClassName(\"shopping_cart_inc\");\n var remove_btn_collection = document.getElementsByClassName(\"bag_remove_item gwp-remove-item-shoppingcart\");\n\n if (isValid(decrement_btn_collection) && decrement_btn_collection.length > 0) {\n console.log(\"inside decrement_btn_collection\");\n for (let i = 0; i < decrement_btn_collection.length; i++) {\n decrement_btn_collection[i].onclick = function() {\n setRatings();\n };\n }\n }\n if (isValid(increment_btn_collection) && increment_btn_collection.length > 0) {\n console.log(\"inside increment_btn_collection\");\n for (let i = 0; i < increment_btn_collection.length; i++) {\n increment_btn_collection[i].onclick = function() {\n setRatings();\n };\n }\n }\n if (isValid(remove_btn_collection) && remove_btn_collection.length > 0) {\n console.log(\"inside remove_btn_collection\");\n for (let i = 0; i < remove_btn_collection.length; i++) {\n remove_btn_collection[i].onclick = function() {\n setRatings();\n };\n }\n }\n };\n\n document.addEventListener('ratings', showRating, false);\n var eventini = new CustomEvent('ratings');\n document.dispatchEvent(eventini);\n\n if (isValid(trJsonData) && isValid(trJsonData.cartItems) && trJsonData.cartItems.length > 0) {\n let prd_quanity = 0;\n trJsonData.cartItems.map(function(obj){\n prd_quanity = prd_quanity + obj.quantity;\n });\n localStorage.setItem(\"z1_prd_quanity\", prd_quanity);\n }\n\n function setRatings() {\n let timeCounter = 0;\n let maxCounter = 10;\n let timeDelay = 500;\n let previous_quantity = parseInt(localStorage.getItem(\"z1_prd_quanity\"));\n if (isValid(trJsonData) && isValid(trJsonData.cartItems) && trJsonData.cartItems.length > 0) {\n let checkQuantityChange = setInterval(function() {\n current_quanity = 0\n trJsonData.cartItems.map( function(obj) {\n current_quanity = current_quanity + obj.quantity;\n });\n if (current_quanity != previous_quantity) {\n console.log(\"dec pressed!\");\n let shoppingBagItems = document.getElementsByClassName(\"shoppingBagItem\");\n for (let j = 0; j < shoppingBagItems.length; j++) {\n let parent_div = shoppingBagItems[j].getElementsByClassName(\"z1PostItem\")[0];\n if (isValid(parent_div)) {\n let star_div = document.createElement(\"div\");\n star_div.setAttribute(\"id\", \"z1-star-\" + shoppingBagItems[j].getAttribute('data-skuid'));\n parent_div.appendChild(star_div);\n }\n }\n var event = new CustomEvent('ratings');\n document.dispatchEvent(event);\n localStorage.setItem(\"z1_prd_quanity\", current_quanity);\n clearInterval(checkQuantityChange);\n\n }\n if (timeCounter > maxCounter) {\n clearInterval(checkQuantityChange);\n }\n timeCounter++;\n }, timeDelay);\n }\n };\n\n }\n\n if (z1Response && z1Response.rStarAboveFour) {\n //console.log(\"SAIKAT - ENTERED BLOCK OF Z1RESPONSE & Z1RESPONSE.rStarAboveFour\");\n console.log(\"rStarAboveFour called!\");\n function showRating() {\n var product_list_with_stars = z1Response.rStarAboveFour;\n if (product_list_with_stars.length > 0) {\n if (debugScr) console.log(\"[ZineOne] stars with commerce_ids rStarAboveFour = \", product_list_with_stars);\n for (let i = 0; i < product_list_with_stars.length; i++) {\n //if (debugScr) console.log(\"c obj ...\",product_list_with_stars[i]);\n let elmnt_id = \"z1-star-\" + product_list_with_stars[i].cid;\n let number_of_stars = product_list_with_stars[i].stars;\n number_of_stars = Math.round(number_of_stars * 10) / 10;\n //if (debugScr) console.log(\"[ZineOne] elmnt_id ...\",elmnt_id);\n //if (debugScr) console.log(\"[ZineOne] number_of_stars ...\",number_of_stars);\n if (number_of_stars >= 0) {\n let parent_div = document.getElementById(elmnt_id);\n parent_div.setAttribute(\"style\", \"margin-top:10px;\");\n //if (debugScr) console.log(\"[ZineOne] parent_div...\",parent_div);\n let innerHTMLSvgString = \"\";\n innerHTMLSvgString = innerHTMLSvgString + '<div style=\"float: left;padding-right: 3px;\">';\n for (let j = 0; j < 5; j++) {\n var check_if_decimal = (number_of_stars - j).toFixed(2);\n //if (debugScr) console.log(\"[ZineOne] check_if_decimal...\",check_if_decimal);\n if (check_if_decimal < 1 && check_if_decimal > 0) {\n //if (debugScr) console.log(\"[ZineOne] iff... <1 >0...\");\n innerHTMLSvgString = innerHTMLSvgString + '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14px\" height=\"14px\" viewBox=\"0 0 25 25\" style=\"width: 14px !important; height: 14px !important;\"><polygon points=\"\" style=\"fill: url("#bv_rating_summary_star_filled_0_' + (check_if_decimal * 100) + '.99_975024") !important;\"></polygon><path d=\"M24.8676481,9.0008973 C24.7082329,8.54565507 24.2825324,8.23189792 23.7931772,8.20897226 L16.1009423,8.20897226 L13.658963,0.793674161 C13.4850788,0.296529881 12.9965414,-0.0267985214 12.4623931,0.00174912135 L12.4623931,0.00174912135 C11.9394964,-0.00194214302 11.4747239,0.328465149 11.3146628,0.81767189 L8.87268352,8.23296999 L1.20486846,8.23296999 C0.689809989,8.22949161 0.230279943,8.55030885 0.0640800798,9.0294023 C-0.102119784,9.50849575 0.0623083246,10.0383495 0.472274662,10.3447701 L6.69932193,14.9763317 L4.25734261,22.4396253 C4.08483744,22.9295881 4.25922828,23.4727606 4.68662933,23.7767181 C5.11403038,24.0806756 5.69357086,24.0736812 6.11324689,23.7595003 L12.6333317,18.9599546 L19.1778362,23.7595003 C19.381674,23.9119158 19.6299003,23.9960316 19.8860103,23.9994776 C20.2758842,24.0048539 20.6439728,23.8232161 20.8724402,23.5127115 C21.1009077,23.202207 21.1610972,22.8017824 21.0337405,22.4396253 L18.5917612,14.9763317 L24.6967095,10.3207724 C25.0258477,9.95783882 25.0937839,9.43328063 24.8676481,9.0008973 Z\" style=\"fill: url("#bv_rating_summary_star_filled_0_' + (check_if_decimal * 100) + '.99_975024") !important;\"></path><defs><linearGradient id=\"bv_rating_summary_star_filled_0_' + (check_if_decimal * 100) + '.99_975024\" x1=\"' + (check_if_decimal * 100) + '%\" y1=\"0%\" x2=\"100%\" y2=\"0%\"><stop offset=\"0%\" style=\"stop-color: rgb(0, 0, 0); stop-opacity: 1;\"></stop><stop offset=\"1%\" style=\"stop-color: rgb(246, 246, 246); stop-opacity: 1;\"></stop></linearGradient></defs></svg>';\n } else if (check_if_decimal <= 0) {\n //if (debugScr) console.log(\"[ZineOne] iff... <= 0...\");\n innerHTMLSvgString = innerHTMLSvgString + '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14px\" height=\"14px\" viewBox=\"0 0 25 25\" style=\"width: 14px !important; height: 14px !important;\"><polygon points=\"\" style=\"fill: url("#bv_rating_summary_star_filled_0_0.99_975024") !important;\"></polygon><path d=\"M24.8676481,9.0008973 C24.7082329,8.54565507 24.2825324,8.23189792 23.7931772,8.20897226 L16.1009423,8.20897226 L13.658963,0.793674161 C13.4850788,0.296529881 12.9965414,-0.0267985214 12.4623931,0.00174912135 L12.4623931,0.00174912135 C11.9394964,-0.00194214302 11.4747239,0.328465149 11.3146628,0.81767189 L8.87268352,8.23296999 L1.20486846,8.23296999 C0.689809989,8.22949161 0.230279943,8.55030885 0.0640800798,9.0294023 C-0.102119784,9.50849575 0.0623083246,10.0383495 0.472274662,10.3447701 L6.69932193,14.9763317 L4.25734261,22.4396253 C4.08483744,22.9295881 4.25922828,23.4727606 4.68662933,23.7767181 C5.11403038,24.0806756 5.69357086,24.0736812 6.11324689,23.7595003 L12.6333317,18.9599546 L19.1778362,23.7595003 C19.381674,23.9119158 19.6299003,23.9960316 19.8860103,23.9994776 C20.2758842,24.0048539 20.6439728,23.8232161 20.8724402,23.5127115 C21.1009077,23.202207 21.1610972,22.8017824 21.0337405,22.4396253 L18.5917612,14.9763317 L24.6967095,10.3207724 C25.0258477,9.95783882 25.0937839,9.43328063 24.8676481,9.0008973 Z\" style=\"fill: url("#bv_rating_summary_star_filled_0_0.99_975024") !important;\"></path><defs><linearGradient id=\"bv_rating_summary_star_filled_0_0.99_975024\" x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\"><stop offset=\"0%\" style=\"stop-color: rgb(0, 0, 0); stop-opacity: 1;\"></stop><stop offset=\"1%\" style=\"stop-color: rgb(246, 246, 246); stop-opacity: 1;\"></stop></linearGradient></defs></svg>';\n } else {\n //if (debugScr) console.log(\"[ZineOne] iff... 99...\");\n innerHTMLSvgString = innerHTMLSvgString + '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"14px\" height=\"14px\" viewBox=\"0 0 25 25\" style=\"width: 14px !important; height: 14px !important;\"><polygon points=\"\" style=\"fill: url("#bv_rating_summary_star_filled_0_99.99_975024") !important;\"></polygon><path d=\"M24.8676481,9.0008973 C24.7082329,8.54565507 24.2825324,8.23189792 23.7931772,8.20897226 L16.1009423,8.20897226 L13.658963,0.793674161 C13.4850788,0.296529881 12.9965414,-0.0267985214 12.4623931,0.00174912135 L12.4623931,0.00174912135 C11.9394964,-0.00194214302 11.4747239,0.328465149 11.3146628,0.81767189 L8.87268352,8.23296999 L1.20486846,8.23296999 C0.689809989,8.22949161 0.230279943,8.55030885 0.0640800798,9.0294023 C-0.102119784,9.50849575 0.0623083246,10.0383495 0.472274662,10.3447701 L6.69932193,14.9763317 L4.25734261,22.4396253 C4.08483744,22.9295881 4.25922828,23.4727606 4.68662933,23.7767181 C5.11403038,24.0806756 5.69357086,24.0736812 6.11324689,23.7595003 L12.6333317,18.9599546 L19.1778362,23.7595003 C19.381674,23.9119158 19.6299003,23.9960316 19.8860103,23.9994776 C20.2758842,24.0048539 20.6439728,23.8232161 20.8724402,23.5127115 C21.1009077,23.202207 21.1610972,22.8017824 21.0337405,22.4396253 L18.5917612,14.9763317 L24.6967095,10.3207724 C25.0258477,9.95783882 25.0937839,9.43328063 24.8676481,9.0008973 Z\" style=\"fill: url("#bv_rating_summary_star_filled_0_99.99_975024") !important;\"></path><defs><linearGradient id=\"bv_rating_summary_star_filled_0_99.99_975024\" x1=\"99.99%\" y1=\"0%\" x2=\"100%\" y2=\"0%\"><stop offset=\"0%\" style=\"stop-color: rgb(0, 0, 0); stop-opacity: 1;\"></stop><stop offset=\"1%\" style=\"stop-color: rgb(246, 246, 246); stop-opacity: 1;\"></stop></linearGradient></defs></svg>';\n }\n }\n innerHTMLSvgString = innerHTMLSvgString + '</div>';\n innerHTMLSvgString = innerHTMLSvgString + '<div style=\"float: left;font-size: 12px;font-family: \\'Gotham 7r\\',GothamBold,Helvetica,Arial,sans-serif;height: 11px;width: 26px;font-weight: bold;font-style: normal;font-stretch: normal;line-height: normal;letter-spacing: normal;color: #000000;\">' + number_of_stars + '</div>';\n\n parent_div.innerHTML = innerHTMLSvgString;\n\n }\n }\n }\n\n var decrement_btn_collection = document.getElementsByClassName(\"shopping_cart_dec\");\n var increment_btn_collection = document.getElementsByClassName(\"shopping_cart_inc\");\n var remove_btn_collection = document.getElementsByClassName(\"bag_remove_item gwp-remove-item-shoppingcart\");\n\n if (isValid(decrement_btn_collection) && decrement_btn_collection.length > 0) {\n console.log(\"inside decrement_btn_collection\");\n for (let i = 0; i < decrement_btn_collection.length; i++) {\n decrement_btn_collection[i].onclick = function() {\n setRatings();\n };\n }\n }\n if (isValid(increment_btn_collection) && increment_btn_collection.length > 0) {\n console.log(\"inside increment_btn_collection\");\n for (let i = 0; i < increment_btn_collection.length; i++) {\n increment_btn_collection[i].onclick = function() {\n setRatings();\n };\n }\n }\n if (isValid(remove_btn_collection) && remove_btn_collection.length > 0) {\n console.log(\"inside remove_btn_collection\");\n for (let i = 0; i < remove_btn_collection.length; i++) {\n remove_btn_collection[i].onclick = function() {\n setRatings();\n };\n }\n }\n };\n\n document.addEventListener('ratings', showRating, false);\n var eventini = new CustomEvent('ratings');\n document.dispatchEvent(eventini);\n\n if (isValid(trJsonData) && isValid(trJsonData.cartItems) && trJsonData.cartItems.length > 0) {\n let prd_quanity = 0;\n trJsonData.cartItems.map(function(obj) {\n prd_quanity = prd_quanity + obj.quantity;\n });\n localStorage.setItem(\"z1_prd_quanity\", prd_quanity);\n }\n\n function setRatings() {\n let timeCounter = 0;\n let maxCounter = 10;\n let timeDelay = 500;\n let previous_quantity = parseInt(localStorage.getItem(\"z1_prd_quanity\"));\n if (isValid(trJsonData) && isValid(trJsonData.cartItems) && trJsonData.cartItems.length > 0) {\n let checkQuantityChange = setInterval(function() {\n current_quanity = 0\n trJsonData.cartItems.map(function(obj) {\n current_quanity = current_quanity + obj.quantity;\n });\n if (current_quanity != previous_quantity) {\n console.log(\"dec pressed!\");\n let shoppingBagItems = document.getElementsByClassName(\"shoppingBagItem\");\n for (let j = 0; j < shoppingBagItems.length; j++) {\n let parent_div = shoppingBagItems[j].getElementsByClassName(\"z1PostItem\")[0];\n if (isValid(parent_div)) {\n let star_div = document.createElement(\"div\");\n star_div.setAttribute(\"id\", \"z1-star-\" + shoppingBagItems[j].getAttribute('data-skuid'));\n parent_div.appendChild(star_div);\n }\n }\n var event = new CustomEvent('ratings');\n document.dispatchEvent(event);\n localStorage.setItem(\"z1_prd_quanity\", current_quanity);\n clearInterval(checkQuantityChange);\n\n }\n if (timeCounter > maxCounter) {\n clearInterval(checkQuantityChange);\n }\n timeCounter++;\n }, timeDelay);\n }\n };\n\n }\n\n\n //console.log(\"Pre-Loading recommendations....\");\n if (z1Response && z1Response.recommendationData) {\n var recommendationData = z1Response.recommendationData;\n if (debugScr) console.log(\"[ZineOne] recommendationData = \", recommendationData);\n //console.log(\"Loading recommendations....\");\n var products = recommendationData;\n //if (debugScr) console.log(\"products...\",products);\n var innerHTMLString = '';\n if (products && products.length > 0) {\n var parent_div = document.getElementById(\"bd_rec_Horizontal\");\n innerHTMLString = innerHTMLString + '<div class=\"bd-flat-view-holder \">';\n //innerHTMLString = innerHTMLString + '<div class=\"bd-flat-view-title\" style=\"display: block;\">You’re so close to free shipping!</div>';\n innerHTMLString = innerHTMLString + '<div class=\"bd-flat-view-title\" style=\"display: block;\">';\n innerHTMLString = innerHTMLString + '<p class=\"tce-top-text\">You’re so close to free shipping!</p>';\n innerHTMLString = innerHTMLString + '<p class=\"tce-bottom-text\"></p>';\n innerHTMLString = innerHTMLString + '</div>';\n innerHTMLString = innerHTMLString + '<div class=\"bd-flat-view-product-container item-count-3\" data-channel=\"WebStore\" data-page=\"ShoppingBag\" data-placement=\"Horizontal\">';\n for (let j = 0; j < products.length; j++) {\n innerHTMLString = innerHTMLString + '<div class=\"bd-flat-view-product-holder\" data-product-id=\"' + products[j].id + '\" data-product-title=\"' + products[j].productTitle + '\">';\n //innerHTMLString = innerHTMLString + '<a href=\"/product/prd-'+products[j].id+'/*\">';\n\n //BDREC change recommended by Kohl's, 11/13/18\n innerHTMLString = innerHTMLString + '<a href=\"/product/prd-' + products[j].id + '?pfm=' + products[j].source + '-' + products[j].channel + '-' + products[j].page + '-' + products[j].placement + '\">';\n\n innerHTMLString = innerHTMLString + '<div class=\"bd-flat-view-product-detail-holder\">';\n innerHTMLString = innerHTMLString + '<div class=\"bd-flat-view-product-hover\" title=\"' + products[j].productTitle + '\">';\n innerHTMLString = innerHTMLString + '<div class=\"bd-template-common-loading\" style=\"display: none;\">';\n innerHTMLString = innerHTMLString + '<div class=\"bd-template-common-loader\"></div>';\n innerHTMLString = innerHTMLString + '</div>';\n innerHTMLString = innerHTMLString + '<img class=\"bd-flat-view-product-image\" src=\"' + products[j].image_url + '\">';\n innerHTMLString = innerHTMLString + '</div>';\n innerHTMLString = innerHTMLString + '<div class=\"bd-flat-view-product-details \">';\n innerHTMLString = innerHTMLString + '<div class=\"bd-flat-view-product-price-main-container\">';\n if (products[j].salePrice != \"\") {\n innerHTMLString = innerHTMLString + '<div class=\"bd-flat-view-product-sale-price-container\">';\n innerHTMLString = innerHTMLString + '<div class=\"bd-flat-view-product-sale-price-label\">Sale</div>';\n innerHTMLString = innerHTMLString + '<div class=\"bd-flat-view-product-sale-price\">$' + products[j].salePrice + '</div>';\n innerHTMLString = innerHTMLString + '</div>';\n }\n if (products[j].regularPrice != \"\") {\n innerHTMLString = innerHTMLString + '<div class=\"bd-flat-view-product-regular-price-container\">';\n innerHTMLString = innerHTMLString + '<div class=\"bd-flat-view-product-regular-price\">Regular</div>';\n innerHTMLString = innerHTMLString + '<div class=\"bd-flat-view-product-regular-price-label\">$' + products[j].regularPrice + '</div>';\n innerHTMLString = innerHTMLString + '</div>';\n }\n innerHTMLString = innerHTMLString + '</div>';\n innerHTMLString = innerHTMLString + '</div>';\n innerHTMLString = innerHTMLString + '</div>';\n innerHTMLString = innerHTMLString + '</a>';\n innerHTMLString = innerHTMLString + '</div>';\n }\n innerHTMLString = innerHTMLString + '</div>';\n innerHTMLString = innerHTMLString + '</div>';\n parent_div.innerHTML = innerHTMLString;\n }\n }\n\n if (z1Response && z1Response.abandon_cart_pop_up_image) {\n console.log(\" z1Response.abandon_cart_pop_up_image >>> \", z1Response.abandon_cart_pop_up_image);\n\n function appendStyle(styles) {\n var css = document.createElement('style');\n css.type = 'text/css';\n\n if (css.styleSheet) css.styleSheet.cssText = styles;\n else css.appendChild(document.createTextNode(styles));\n\n document.getElementsByTagName(\"head\")[0].appendChild(css);\n }\n var styles = '.z1-abandon-cart-pop-up-bg {width: 100%;height: 100%;background: #ffffff96}';\n styles += '.z1-abandon-cart-pop-up-container {position: absolute;top: 50%; left: 50%; width: 373px;height: 317px;border-radius: 8px;border: solid 4px #dceef0;background-color: #ffffff;transform: translate(-50%, -50%);}';\n styles += '.z1-abandon-cart-pop-up-welcome-back{ width: 373px;height: 54px;background-color: #dceef0;}';\n styles += '.z1-abandon-cart-pop-up-welcome-back-text-box { width: 381px;height: 35px;font-family: \"Gotham 5r\", Helvetica, Arial, sans-serif ;font-size: 26px;font-weight: bold;font-style: normal;font-stretch: normal;line-height: normal;letter-spacing: normal;text-align: center;color: #14718a;}';\n\n styles += '.z1-abandon-cart-pop-up-text{ margin-top: 10px;margin-bottom: 10px;font-family: \"Gotham 5r\", Helvetica, Arial, sans-serif;font-size: 15px;font-weight: 500;font-style: normal;font-stretch: normal;line-height: 1.27;letter-spacing: normal;text-align: center;color: #000000;}';\n styles += '.z1-abandon-cart-pop-up-center{text-align: center;}';\n\n styles += '.z1-abandon-cart-pop-up-center-checkout{ text-align: center;width: 162px;height: 40px;background-color: #14718a;margin: auto;}'\n styles += '.z1-abandon-cart-pop-up-img{ width: 162px; height: 142px; margin: 5px;}';\n styles += '.z1-abandon-cart-pop-up-checkout-btn { height: 40px;background-color: #14718a;font-family: \"Gotham 4r\", Helvetica, Arial, sans-serif;font-size: 14px;color: #ffffff;font-weight: 500;font-style: normal;font-stretch: normal;line-height: normal;letter-spacing: normal;text-align: center;}';\n styles += '.z1-abandon-cart-pop-up-close-btn-div { height: 12.5px; }';\n\n styles += '.z1-abandon-cart-pop-up-close:before, .z1-abandon-cart-pop-up-close:after {position: absolute;right: 12.5px;content: \\' \\';height: 20px;width: 1.5px;background-color: #14718a;}';\n\n\n\n styles += '.z1-abandon-cart-pop-up-close:before {transform: rotate(45deg);}';\n styles += '.z1-abandon-cart-pop-up-close:after {transform: rotate(-45deg);}';\n appendStyle(styles);\n\n var abcCartParentDiv = document.getElementById(\"z1-abandon-cart-pop-up\");\n\n var inHTMLString = \"\";\n inHTMLString = inHTMLString + \"<div class='z1-abandon-cart-pop-up-bg'></div>\";\n inHTMLString = inHTMLString + \"<div class='z1-abandon-cart-pop-up-container'>\";\n //inHTMLString = inHTMLString + \"<a href='JavaScript:Void(0);' onclick='document.getElementById(\\\"z1-abandon-cart-pop-up\\\").style.display=\\\"none\\\";' class='z1-abandon-cart-pop-up-close'></a>\";\n inHTMLString = inHTMLString + \"<div class='z1-abandon-cart-pop-up-welcome-back'><div class='z1-abandon-cart-pop-up-close-btn-div'><a href='JavaScript:Void(0);' onclick='document.getElementById(\\\"z1-abandon-cart-pop-up\\\").style.display=\\\"none\\\";' class='z1-abandon-cart-pop-up-close' style='background-color: transparent;float: right;height: 20px;width: 20px;cursor: pointer;'></a></div><div class='z1-abandon-cart-pop-up-welcome-back-text-box'>Welcome back.</div></div>\";\n inHTMLString = inHTMLString + \"<div class='z1-abandon-cart-pop-up-text'>There's still something in your cart.<br>Get it before it's gone!</div>\";\n inHTMLString = inHTMLString + \"<div class='z1-abandon-cart-pop-up-center' ><img src='\" + z1Response.abandon_cart_pop_up_image + \"' alt='' class='z1-abandon-cart-pop-up-img'></div>\";\n inHTMLString = inHTMLString + \"<div class='z1-abandon-cart-pop-up-center-checkout'><input type='button' onclick=\\\"location.href='https://www.kohls.com/checkout/v2/checkout.jsp'\\\" value='CHECK OUT NOW' class='z1-abandon-cart-pop-up-checkout-btn'></div>\";\n inHTMLString = inHTMLString + \"</div>\";\n abcCartParentDiv.innerHTML = inHTMLString;\n abcCartParentDiv.style.display = \"block\";\n }\n\n\n\n } catch (error) {\n console.log('[ZineOne-om] Could not process _ws_ rawdatahandler due to error. ', error);\n }\n }\n\n\n function fireOmniture(z1Response) {\n\n //////***** whats the s.tl(this) ??? */\n\n if (z1Response && z1Response.prop75) {\n var eVar39 = z1Response.evar39 ? z1Response.evar39 : z1Response.customerId;\n s.tl(this, 'o', 'ZineOne Impression', {\n linkTrackVars: 'prop75,eVar39',\n prop75: z1Response.prop75,\n eVar39: eVar39\n });\n\n }\n\n\n }\n\n\n function fsg(z1Response) {\n var timestart;\n if (debugScr) {\n timestart = new Date().getTime();\n }\n if (debugScr) console.log(\"[ZineOne] response = \" + z1Response);\n z1Response = JSON.parse(z1Response);\n var flag = (z1Response.fsg);\n if (debugScr) console.log(\"[ZineOne] flag = \" + flag);\n\n\n //fsg\n if (flag._d == \"1\") {\n\n var neb = document.getElementById(\"new-equity-banner\");\n //neb.fadeOut();\n neb.style.display = \"none\";\n // var jsb = document.getElementById(\"js-shipping-banner-2\");\n // jsb.style.display = \"block\";\n\n\n\n //fade(neb);\n\n //display flag\n //var vID = getCookie(\"VisitorId\");\n var vID = localStorage.getItem(\"z1_cust_id\"); //getCookie(\"VisitorId\");\n if (!isValid(vID)) {\n vID = localStorage.getItem(\"z1_connectUserId\");\n }\n var thresh = isNumeric(vID) ? (\"$\" + (flag._t)) : \"$75\"; // Oct 31-Nov25 is 50 not 75\n var thr = isNumeric(vID) ? parseInt(flag._t) : 75; // Oct 31-Nov25 is 50 not 75\n\n try {\n\n if (debugScr) console.log(\"[ZineOne] setting styles\");\n /*\n var parent = document.getElementById(\"new-equity-banner\");\n var css = document.createElement(\"style\");\n css.type = \"text/css\";\n var styles = \".kas-newpb-free-shipping-msg { font-size: 12px; font-family: 'Gotham 5r', 'GothamMedium', Helvetica, Arial, sans-serif !important;color: #5f5f5f !important } .freeShipSuggestMessage { color: #1babb4 !important; font-size: 13px; font-family: 'Gotham 7r', 'GothamMedium', Helvetica, Arial, sans-serif !important;color: #1babb4 !important } .freeShipSuggestMessage span { font-size: 13px; font-family: 'Gotham 7r', 'GothamMedium', Helvetica, Arial, sans-serif !important; color: #1babb4 !important} #js-shipping-banner-2 {display: block; !important }\";\n if (css.styleSheet) css.styleSheet.cssText = styles;\n else css.appendChild(document.createTextNode(styles));\n parent.appendChild(css);\n parent.style.height = \"40px\";\n */\n (\n function() {\n\n function a() {\n //changed tce-meter-bar from 56em to 39em and tce-meter-copy from 15em to 8em, changed tce-ship-meter-cartDetails height to 39px from 40px\n var r = \"<style type=\\\"text/css\\\"> #tce-ship-meter {display: block;clear: both;}.tce-meter-copy {position: absolute;top: 50%;left: 8em;transform: translateY(-50%);}.tce-meter-copy p {font-size: 16px;color: #000; font-family:'Gotham 5r', Helvetica, sans-serif;text align:center;}.tce-meter-copy span {font-size: 16px;color: #108281; font-family:'Gotham 5r', Helvetica, sans-serif;}.tce-meter-bar * {all: unset;}.tce-meter-bar {position: absolute;float: left;width: 315px;left: 49em;top: 1.2em;}.tce-meter-bar p {display: block;-webkit-margin-before: 1em;-webkit-margin-after: 1em;-webkit-margin-start: 0;-webkit-margin-end: 0;}.tce-ship-meter-cartDetails {width:100%;text-align:center;max-width: 1044px;margin-left: auto;margin-right: auto;display:block;position:relative;height:39px;text-align: center;background-color:#f0f0f0;}.tce-ship-meter-cartDetails__gauge {display: block;height: auto; width:100%;}.tce-ship-meter-cartDetails-meter {margin: 0 auto;width: 100%;height: 13px;position: absolute;left: 2.5em;}.tce-ship-meter-cartDetails-left {font-size: 11px;font-family:'Gotham 4r', Helvetica, sans-serif;color: #000;font-weight: bold;position: absolute;left: 0;}.tce-ship-meter-cartDetails-right {font-size: 11px;font-family:'Gotham 4r', Helvetica, sans-serif;font-weight: bold;color: #000;position: absolute;left: 112%;top: 0;}.tce-small-ship-meter-cartDetails {display:block;position:relative;width: 166px;height: 28px;top: 18px;margin-top:2px;}.tce-small-ship-meter-cartDetails-left {font-size: 11px;color:#000;font-weight:bold;position:absolute;font-family:'Gotham 4r', Helvetica, sans-serif;}.tce-small-ship-meter-cartDetails-meter {margin: 0 auto;width: 100%;height: 13px;position: absolute;left: 2.5em;}.tce-small-ship-meter-cartDetails-right {font-size: 11px;color:#000;position: absolute;left: 125%;top: 0;font-family:'Gotham 4r', Helvetica, sans-serif;}</style>\";\n\n function g(u, s, t) {\n\n\n return $(\"#js-free-shipping-meter1, #js-free-shipping-meter2\").css({\n\n background: \"linear-gradient(to right, \" + u + \" 0%,\" + u + \" \" + t + \"%,\" + s + \" \" + t + \"%,\" + s + \" 100%)\"\n\n }\n\n );\n\n };\n\n var n = '<div class=\"tce-meter-bar\" ><div class=\"tce-ship-meter-cartDetails-left\">$0</div><div id=\"js-free-shipping-meter1\" class=\"tce-ship-meter-cartDetails-meter\"></div><div class=\"tce-ship-meter-cartDetails-right\"> ' + thresh + '</div></div>';\n\n function d() {\n\n var s = f();\n var pqr = \"<a style='outline: 0 none;color: #000; text-decoration: none; 'href='https: //www.kohls.com/ecom/shipping/75_ShippingUPDATED_nodates_bopus.html' target='blank'><p style='background: url(https://media.kohlsimg.com/is/image/kohls/20180215-CL-shipping-truck-desktop?fmt=png-alpha&scl=1) 0px 7px no-repeat;display: inline-block;padding-left: 50px;height: 40px;line-height: 40px;background-size: 40px;'>Earn <span>free shipping</span> on orders \".concat(thresh.concat(\" or more! <span style='text-decoration: underline;text-transform: none;font-size: 10px;color:#000;'>details</span></p></a>\"));\n var t = s > 0 && s < thr ? \"<a style='outline:0 none;color: #000;text-decoration: none;'href='https://www.kohls.com/ecom/shipping/75_ShippingUPDATED_nodates_bopus.html' target='blank'><p style='background: url(https://media.kohlsimg.com/is/image/kohls/20180215-CL-shipping-truck-desktop?fmt=png-alpha&scl=1) 0px 7px no-repeat;display: inline-block;padding-left: 50px;height: 40px;line-height: 40px;background-size: 40px;'>You're $\" + h() + \" away from <span>free shipping!</span> <span style='text-decoration: underline;text-transform: none;font-size: 10px;color:#000;'>details</span></p></a>\" : s >= thr ? \"<a style='outline:0 none;color: #000;text-decoration: none;' href='https://www.kohls.com/ecom/shipping/75_ShippingUPDATED_nodates_bopus.html' target='blank'><p style='background: url(https://media.kohlsimg.com/is/image/kohls/20180215-CL-shipping-truck-desktop?fmt=png-alpha&scl=1) 0px 7px no-repeat;display: inline-block;padding-left: 50px;height: 40px;line-height: 40px;background-size: 40px;'>You’ve earned <span>free shipping</span> on your order! <span style='text-decoration: underline;text-transform: none;font-size: 10px;color: #000;'>details</span></p></a>\" : pqr;\n\n //changes done on 30102018\n //return (r + '<div id=\"js-shipping-banner-2\" class=\"tce-ship-meter-cartDetails\"><div class=\"tce-meter-copy\"><p>' + t + \"</p></div>\" + n + \"</div>\");\n return (r + '<div id=\"js-shipping-banner-2\" style=\"display:none;\" class=\"tce-ship-meter-cartDetails\"><div class=\"tce-meter-copy\"><p>' + t + \"</p></div>\" + n + \"</div>\");\n };\n\n function l() {\n //set display to none for js-meter-summary-2\n var xyz = '<div id=\"js-meter-summary-2\" style=\"display:block\" class=\"tce-small-ship-meter-cartDetails\"><div class=\"tce-small-ship-meter-cartDetails-left\">$0</div><div id=\"js-free-shipping-meter2\" class=\"tce-small-ship-meter-cartDetails-meter\"></div><div class=\"tce-small-ship-meter-cartDetails-right\"> '.concat(thresh.concat('</div> </div>'));\n return xyz; //'<div id=\"js-meter-summary-2\" class=\"tce-small-ship-meter-cartDetails\"><div class=\"tce-small-ship-meter-cartDetails-left\">$0</div><div id=\"js-free-shipping-meter2\" class=\"tce-small-ship-meter-cartDetails-meter\"></div><div class=\"tce-small-ship-meter-cartDetails-right\">$75</div> </div>'\n\n };\n\n\n function h() {\n var s = localStorage.getItem(\"persistent_bar_components_json_v1\");\n if(s && !isValid(s)){\n s = (isValid(Kjs) && isValid(Kjs.PB) && isValid(Kjs.PB.getPbCartStorage())) ? JSON.stringify(Kjs.PB.getPbCartStorage()) : \"null\";\n }\n if (s == \"null\" || (JSON.parse(s)).status == \"Failure\") {\n //if (debugScr) console.log(\"[ZineOne] the cart is empty\");\n return \"the-cart-is-empty\";\n }\n\n return (thr - i()).toFixed(2);\n\n //var t = $.parseJSON(s);\n //return t.shipmentInfo[0].shipmentPriceInfo.freeShipQualificationDelta // returns delta\n };\n\n function i() {\n var s = localStorage.getItem(\"persistent_bar_components_json_v1\");\n if(s && !isValid(s)){\n s = (isValid(Kjs) && isValid(Kjs.PB) && isValid(Kjs.PB.getPbCartStorage())) ? JSON.stringify(Kjs.PB.getPbCartStorage()) : \"null\";\n }\n if (s == \"null\" || (JSON.parse(s)).status == \"Failure\") {\n return 0;\n }\n\n var t = $.parseJSON(s);\n return t.orderSummary.merchandisePromoAmount; // returns total\n //return t.orderSummary.total // returns total\n };\n\n\n function f() {\n\n var u = i(); //total\n var t = h() >= 0 ? h() : 0; //delta\n var s = thr; //threshold\n\n\n if (debugScr) console.log(\"[ZineOne] (total,delta,threshold) = (\" + u + \",\" + t + \",\" + s + \")\");\n\n\n var x = t > 0 ? (s - t).toFixed(2) : t === 0 && u >= s ? s : 0; // returns total-delta\n\n return x;\n\n };\n\n\n function q() {\n\n return Math.round(100 / thr * f()); // returns %ge full\n };\n\n function m(t) {\n\n c(t);\n var s = q();\n var temp = s >= 100 ? g(\"#0d8886\", \"#0d8886\", 100) : g(\"#0d8886\", \"#d6d8da\", s);\n return;\n\n };\n\n\n function c(s) {\n\n if (s === \"add\") {\n\n $(d()).insertBefore($(\"div.tr_phase2_headercontainer\")); //tr_phase2_headercontainer\n\n }\n\n\n\n if (s === \"update\") {\n\n $(\"#js-shipping-banner-2\").html($(d()));\n }\n };\n\n m(\"add\");\n var j = $(\"#mini-cart .mini-cart-header .subtotal\");\n var e = {\n attributes: true,\n childList: true\n };\n function o(w) {\n var v = w.length;\n\n for (var t = 0; t < v; t++) {\n\n if (w[t].type === \"childList\") {\n var u = f();\n var s = $(\".loadedNewPB\");\n\n if (s.length === 0) {\n return;\n }\n $(\"#js-meter-summary-2\").remove();\n $(\".tr_phase2_add_padding_ghr\").appendChild(l());\n\n return m(\"update\");\n }\n /*\n if (w[t].type === \"attributes\") {\n var u = f();\n var s = $(\".loadedNewPB\");\n\n if (s.length === 0) {\n return;\n }\n\n $(\".tr_phase2_add_padding_ghr\").appendChild(l());\n\n return m(\"update\");\n }\n */\n\n }\n return;\n };\n\n var k = new MutationObserver(o);\n k.observe(j[0], e);\n var p = localStorage.setItem;\n localStorage.setItem = function() {\n var t = new CustomEvent(\"itemInserted\");\n document.dispatchEvent(t);\n p.apply(this, arguments);\n var s = h();\n if (s === \"the-cart-is-empty\") {\n return;\n }\n\n return m(\"update\");\n };\n };\n\n\n var b = setInterval(function() {\n if (document.readyState === \"complete\") {\n clearInterval(b);\n a();\n }\n\n }, 100);\n\n })();\n\n\n if (debugScr) {\n var timeend = new Date().getTime();\n if (debugScr) console.log(\"[ZineOne] FSG time taken ==> \" + (timeend - timestart));\n }\n\n } catch (z1ie) {\n console.log(\"[ZineOne] FSG Tag Failed.\", z1ie);\n }\n\n\n // Venkat - Begin - 10/23/2018 - MVC enhancement\n\n }\n if (flag._d == \"2\") {\n try {\n var z1_cid = localStorage.getItem(\"z1_cust_id\");\n if (debugScr) console.log(\"Newly added return code for only mvc_event and mvc_status true and offer code: \" + flag);\n if (z1_cid && (z1_cid == \"2254009728812139\" || z1_cid == \"3000000030411692\")) {\n\n var parentDiv = document.getElementById(\"shipping-banner\");\n if (isValid(parentDiv)) {\n var fsg_parent_div = document.createElement(\"div\");\n fsg_parent_div.setAttribute(\"id\", \"loyalty-default-msg1\");\n //parentDiv.prepend(fsg_parent_div);//Won't work in IE...need to write using other logic\n }\n var offerCode = flag.offerCode;\n myOfferCode = unescape(offerCode);\n if (debugScr) console.log(\"myOfferCode \" + myOfferCode);\n var existingDiv = document.getElementById(\"loyalty-default-msg1\");\n // TODO - in prod this is different - existingDiv.innerHTML = '';\n\n function appendStyle(styles) {\n var css = document.createElement('style');\n css.type = 'text/css';\n\n if (css.styleSheet) css.styleSheet.cssText = styles;\n else css.appendChild(document.createTextNode(styles));\n document.getElementsByTagName(\"head\")[0].appendChild(css);\n }\n\n /*var _styleStr = `\n \\/* FSG CSS: BEGIN *\\/\n\n .fsg-band-container { width: auto; display: flex; color: #FFFFFF; font-size: 12px; align-items: center; background-size: cover; height: 53px;object-fit: contain; background-image: linear-gradient(to left, #d9008c, #fb5f29);}\n .fsg-icon-container .shipping-icon {filter: brightness(0) invert(1); text-align: left; width: 50px; height: 33.7px; object-fit: contain;}\n .FSG-Hey-MVC-your-shipping {padding: 2px 65px; text-align: center; height: 27px; font-family: Gotham; font-size: 13px; font-weight: normal; font-style: normal; font-stretch: normal; line-height: normal; letter-spacing: -0.2px; text-align: center; color: #ffffff;}\n .FSG.mvc.t1 { letter-spacing: -0.5px;}\n .FSG.mvc.t2 { font-weight: 700; letter-spacing: -0.5px;}\n\n \\/* FSG CSS: END *\\/\n `;*/\n var _styleStr = '.fsg-band-container{height:35px;width:auto;display:flex;color:#fff;align-items:center;background-size:cover;object-fit:contain;background-image:linear-gradient(to left,#d9008c,#fb5f29);padding:3px 20px 3px 20px}.fsg-icon-container .shipping-icon{filter:brightness(0) invert(1);text-align:left;width:50px;height:33.7px;object-fit:contain}.FSG-Hey-MVC-your-shipping{font-family:\"Gotham 5r\",Helvetica,Arial,sans-serif;font-size:20px;font-weight:400;font-style:normal;font-stretch:normal;line-height:normal;letter-spacing:-.2px;text-align:center;color:#fff;margin:0 auto}.FSG.mvc.t1{letter-spacing:-.5px}.FSG.mvc.t2{font-weight:700;letter-spacing:-.5px}'; // Enhancement 26/10/2018\n\n //call appendStyle\n appendStyle(_styleStr);\n var fsg_fname = getCookie(\"VisitorUsaFullName\");\n //fsg_fname = (fsg_fname) ? \" \" + fsg_fname : \"\";\n fsg_fname = (fsg_fname) ? \" \" + fsg_fname.replace(/\\|/g, \"\") : \"\"; // Enhancement 26/10/2018\n\n /*var domstr = `\n <div class=\"fsg-band-container\">\n <div class=\"fsg-icon-container\">\n <img src=\"https://media.kohlsimg.com/is/image/kohls/20180215-CL-shipping-truck-desktop?fmt=png-alpha&scl=1\" class=\"shipping-icon\">\n </div>\n <div class=\"FSG-Hey-MVC-your-shipping\">\n <span >Hey` + fsg_fname + `, your shipping is on us! <br> </span>\n <span class=\"FSG.mvc.t1\"> Promo code: </span>\n <span class=\"FSG.mvc.t2\">${myOfferCode}</span>\n </div>\n </div>`;*/\n var domstr = '<div class=\"fsg-band-container\"><div class=\"fsg-icon-container\"><img src=\"https://media.kohlsimg.com/is/image/kohls/20180215-CL-shipping-truck-desktop?fmt=png-alpha&scl=1\" class=\"shipping-icon\"></div><div class=\"FSG-Hey-MVC-your-shipping\"><span>Hey' + fsg_fname + ', your shipping is on us! </span><span class=\"FSG.mvc.t1\"> Promo code: </span><span class=\"FSG.mvc.t2\">${myOfferCode}</span></div></div>'; // Enhancement 26/10/2018\n\n //changes done on 30102018\n //if (debugScr) console.log(\"domstr \" + domstr);\n // TODO - in prod this is different - existingDiv.innerHTML = domstr;\n existingDiv.innerHTML = domstr;\n }\n\n } catch (ze) {\n console.log(\"[ZineOne] @@ FSG Tag Failed.\", ze);\n }\n // Venkat - End - 10/23/2018 - MVC enhancement\n } else {\n if (debugScr) console.log(\"[ZineOne] FSG Display Off.\");\n var dc = document.getElementById(\"new-equity-banner\");\n dc.style.display = \"block\";\n }\n //fsg\n\n }\n\n\n function getBopusInfo() { //skuCode) {\n // Venkat - Begin - 01/09/2019\n // PLEASE set the following var TO ENABLE the BOPUS Pdp store hour notifications\n if (!ENABLE_BOPUS_STORE_HOUR)\n return;\n // Venkat - End - 01/09/2019\n\n\n if (debugScr) console.log(\"[ZineOne] BOPUS Start for selected sku!==> \" + typeof(Kjs.mainPanel.getBagItem(\"skuId\")));\n\n var bopusFound = false; //store found\n var bopusEligible = false; //product found\n var storeId = \"-1\";\n var customer = pageData.customerDetails;\n var qtyList = pageData.productDetails.pageItems.QtyInfo;\n var skuCode = Kjs.mainPanel.getBagItem(\"skuId\"); // KOHL'S client side function to get currently selected sku\n var storeDist = \"-1\";\n //console.log(\"[ZineOne] pageData ==> \" + JSON.stringify(pageData.productDetails.pageItems.QtyInfo));\n\n if (!isValid(pageData) || !isValid(pageData.customerDetails) || !isValid(pageData.productDetails) || !isValid(pageData.productDetails.pageItems) || !isValid(pageData.productDetails.pageItems.QtyInfo))\n return;\n\n if (debugScr) console.log(\"[ZineOne] pageData Exists with sku!==> \" + Kjs.mainPanel.getBagItem(\"skuId\"));\n\n //Check whether Bopus is available for the SKU\n for (var i = 0; i < qtyList.length; i++) {\n if (debugScr) console.log(\"[ZineOne] BOPUS loop: \" + (JSON.stringify(qtyList[i].skuCode) == skuCode));\n if (isValid(qtyList[i].storeWithBopusAvailability) && (qtyList[i].availableBopusInventory > 0) && (qtyList[i].storeDistanceFromPreferredStore >= 0) && qtyList[i].skuCode == skuCode) {\n if (debugScr) console.log(\"[ZineOne] BOPUS Eligible!\" + i);\n storeId = qtyList[i].storeWithBopusAvailability;\n storeDist = qtyList[i].storeDistanceFromPreferredStore;\n bopusEligible = true;\n break;\n }\n } // pageData SKU loop\n\n if (bopusEligible) { // then search for store in store list\n\n var storeList = localStorage.getItem('K_storelist');\n var storeListJson = JSON.parse(storeList).allAvailableStores;\n var storeName = \"-1\";\n var address = \"-1\";\n var longitude = \"0\";\n var workingHours = \"-1\";\n\n for (i = 0; i < storeListJson.length; i++) {\n if (storeId == storeListJson[i].shipNode) {\n // BOPUS store found\n if (debugScr) console.log(\"[ZineOne] Store FOUND in store list. \");\n bopusFound = true;\n storeName = storeListJson[i].organizationName;\n address = storeListJson[i].addressLine1;\n longitude = storeListJson[i].longitude;\n workingHours = storeListJson[i].workingHours;\n break;\n }\n } // K_storelist loop\n\n if (!bopusFound || !storeName || !address || storeName == \"-1\" || address == \"-1\") {\n if (debugScr) {\n if (debugScr) console.log(\"[ZineOne] Store NOT FOUND in store list.\");\n }\n //return; <==== Might want to uncomment in case storelist should be used\n }\n\n var X_hours = \"-1111111111\";\n X_hours = getX_hours(longitude, workingHours);\n if (debugScr) console.log(\"[ZineOne] X_hours ==> \" + X_hours);\n\n if (parseInt(X_hours) > 2) { // store not open or going to open soon. DON'T show message!!!!\n if (debugScr) console.log(\"[ZineOne] xhours not 2\" + parseInt(X_hours));\n return;\n }\n\n var suffix = \"!\";\n\n // FOR NOW. CHECK WITH NDE-40 TO UPDATE THE MILES SHOWN.\n if ((parseFloat(storeDist) > 0 && parseFloat(storeDist) <= 15)) {\n //Commented out as per discussions with Nikhil Chandurkar (since distance is already shown)\n //suffix = \", \" + storeDist + \" miles away!\";\n } else if (parseFloat(storeDist) > 15) {\n if (debugScr) console.log(\"[ZineOne] storedist too far \" + parseFloat(storeDist));\n return; // DON'T show if more than 15 miles away!!\n }\n\n var ship_selec = document.getElementsByClassName(\"preferedStore\")[0]; //document.getElementById(\"shipment-selection\");\n var txt = document.createElement(\"span\");\n if (isValid(document.getElementById(\"z1\"))) {\n var z1 = document.getElementById(\"z1\");\n if (debugScr) console.log(\"[ZineOne] removing z1\");\n z1.parentNode.removeChild(z1);\n }\n // Venkat - Begin - 10/08/2018 - Changing the copy message as per Nikhil's email\n //txt.innerHTML = (\"<span id='z1' style='color:#D88907; display:inline'><b style='color:black'>-</b> Pickup in store in \" + /*X_hours*/ \"2\" + \" hours\" + suffix + \"</span>\");\n txt.innerHTML = (\"<span id='z1' style='color:#D88907; display:inline'><b style='color:black'>-</b> Most orders ready in \" + /*X_hours*/ \"2\" + \" hours\" + suffix + \"</span>\");\n // Venkat - END - 10/08/2018\n ship_selec.appendChild(txt);\n\n } else {\n return; // bopusEligible = false\n }\n\n }\n\n function getX_hours(longitude, workingHours) {\n\n if (debugScr) console.log(\"[ZineOne] X_hours Start!\");\n\n var d = new Date();\n var currHH = parseInt(d.getHours()) < 10 ? (\"0\" + d.getHours()) : d.getHours();\n var currMM = parseInt(d.getMinutes()) < 10 ? (\"0\" + d.getMinutes()) : d.getMinutes();\n var currHHMM = parseInt(currHH + \"\" + currMM); //\"0331\"; //\"2342\"; //finHHMM; //parseInt(currHH+\"\"+currMM);\n var X_hours = \"\"; //= currHHMM > closesAtHHMM ? ((2400 - currHHMM) + opensAtHHMM) : currHHMM<opensAtHHMM? (opensAtHHMM-currHHMM) : 0;//(closesAtHHMM - currHHMM);\n var diffHH;\n var diffMM;\n ////////// According to NDE-40 updates, hardcode store hours to 7am-5pm. Show 2 hrs in between these times.\n var opensAtHHMM = 1300; // 7 am // 1 pm\n var closesAtHHMM = 1700; // 5 pm\n //////////\n\n if (debugScr) console.log(\"[ZineOne] X_hours MATH start!\");\n\n if (currHHMM > closesAtHHMM) {\n diffHH = 24 - Math.floor(currHHMM / 100) + Math.floor(opensAtHHMM / 100);\n diffMM = Math.floor(opensAtHHMM % 100) - Math.floor(currHHMM % 100);\n if (diffMM < 0) {\n diffHH = diffHH - 1;\n diffMM = diffMM + 60;\n }\n diffHH = diffHH < 10 ? \"0\" + diffHH : diffHH;\n diffMM = diffMM < 10 ? \"0\" + diffMM : diffMM;\n X_hours = diffHH + \"\" + diffMM;\n\n } else if (currHHMM < opensAtHHMM) {\n diffHH = Math.floor(opensAtHHMM / 100) - Math.floor(currHHMM / 100);\n diffMM = Math.floor(opensAtHHMM % 100) - Math.floor(currHHMM % 100);\n if (diffMM < 0) {\n diffHH = diffHH - 1;\n diffMM = diffMM + 60;\n }\n diffHH = diffHH < 10 ? \"0\" + diffHH : diffHH;\n diffMM = diffMM < 10 ? \"0\" + diffMM : diffMM;\n X_hours = diffHH + \"\" + diffMM;\n\n } else {\n X_hours = 2; // show 2 hours when between 7am and 5pm\n }\n\n if (debugScr) console.log(\"[ZineOne] X_hours MATH end! currHHMM => \" + currHHMM + \" X_hours ==> \" + X_hours);\n\n if ((\"\" + X_hours).length > 3) {\n var h = Math.floor(parseInt(X_hours) / 100);\n var dm = (parseFloat(X_hours) % 100) / 60;\n //console.log(\"[ZineOne] h, dm ==>\" + h + \",\" + dm);\n X_hours = Math.round(h + dm);\n }\n return X_hours;\n }\n\n\n\n function getDayLightOffset() {\n //Automatically adjust for GMT to Central Timediff based on Daylight savings\n //Returns number of hours Central is behind GMT\n //\n var now = new Date();\n //test data\n var test = now.getTime(); //238*24*3600000;\n var nowUtc = new Date(test);\n var month = nowUtc.getMonth() + 1; //make jan=1\n\n if (month < 3 || month > 11) return 6; // savings=F\n if (month > 3 && month < 11) return 5; // savings=T\n\n // switch if >2nd sun in march or >1st sun in nov\n // switches at midnight UTC, so 5 or 6 hrs away from 2AM Central\n\n var tzDiffInHours; //UTC vs Central diff in hours\n var day = nowUtc.getDate(); //already 1 based\n var dow = nowUtc.getDay(); //already sun=0\n var previousSunday = day - dow;\n if (month == 3) tzDiffInHours = (previousSunday >= 8) ? 5 : 6;\n if (month == 11) tzDiffInHours = (previousSunday < 0) ? 5 : 6;\n\n //java.lang.System.out.println(\"@@@@@@ Daylight savings computed variable=\"+tzDiff);\n //var tzDiffInHours = 5; //Change on sunday nov 4, 2018, to 6hrs\n\n return tzDiffInHours;\n }\n\n\n // Appends style tag\n function appendStyle(styles) {\n var css = document.createElement('style');\n css.type = 'text/css';\n\n if (css.styleSheet) css.styleSheet.cssText = styles;\n else css.appendChild(document.createTextNode(styles));\n\n document.getElementsByTagName(\"head\")[0].appendChild(css);\n }\n\n function convertUTCtoCST(dateObj) {\n var dayLightOffset = getDayLightOffset();\n return new Date(dateObj.getTime() - ((1 * 60 * 60 * 1000) * dayLightOffset));\n }\n\n\n function getTimeFromApiFormat(dateStr) {\n var dateStrSplit = dateStr.split(' ');\n\n var dateSplit = dateStrSplit[0].split('-');\n var timeSplit = dateStrSplit[1].split(':');\n\n var dateObj = new Date();\n dateObj.setYear(dateSplit[0]);\n dateObj.setMonth(dateSplit[1] - 1);\n dateObj.setDate(dateSplit[2]);\n\n dateObj.setHours(timeSplit[0]);\n dateObj.setMinutes(timeSplit[1] - 1);\n dateObj.setSeconds(timeSplit[2]);\n\n var dateObj = new Date((dateObj.getTime() - dateObj.getTimezoneOffset() * 60 * 1000) / 1000);\n\n if (debugScr) console.log(dateObj.getTime() + ' getTimeFromApiFormat ' + dateObj);\n\n return dateObj.valueOf();\n\n }\n\n\n\n function addDataToRedemptionPopup(popupDiv, promoCode) {\n //console.log(' addDataToRedemptionPopup '+document.getElementsByClassName('kc-applyContainer')[0]);\n\n var InitPopupContent = document.getElementsByClassName('kc-applyContainer')[0];\n\n\n var promoTextContent = '<div class=\"popupPromoText\">Your promo code is already entered, click Apply to redeem.</div>';\n\n\n if (debugScr) console.log('Final HTML ' + InitPopupContent);\n\n InitPopupContent.insertAdjacentHTML(\"afterbegin\", promoTextContent);\n\n //document.getElementsByClassName('kc-applyContainer')[0].innerHTML = InitPopupContent;\n\n document.getElementById('promo-kcInput').value = promoCode;\n\n document.getElementById('applyInputButton').onclick = function() {\n\n var currentPromoCode = document.getElementById('promo-kcInput').value;\n\n if (currentPromoCode == promoCode) {\n var existingSupc = localStorage.getItem('z1_supc');\n\n existingSupc = JSON.parse(existingSupc);\n\n existingSupc.is_redeemed = true;\n\n localStorage.setItem('z1_supc', JSON.stringify(existingSupc));\n\n }\n\n };\n\n }\n\n\n\n function addSUPCRedemption(e) {\n document.getElementsByClassName(\"kohlscashapply\")[0].onclick = function() {\n\n\n var style = '.popupPromoText { font-size: 1.85em; margin-bottom: 5px;}';\n\n appendStyle(style);\n\n if (debugScr) console.log(\"kohlscashapply Click \");\n\n var timeCounter = 0;\n var maxCounter = 10;\n var timeDelay = 500;\n\n var popupCheck = setInterval(function() {\n\n if (debugScr) console.log(\"Checking for Redemption Popup \" + timeCounter);\n\n var popupDiv = document.getElementsByClassName('kc-applyContainer')[0];\n\n //var popupDiv = document.getElementById('promo-kcInput');\n\n if (debugScr) console.log('Got Popup Div ' + popupDiv);\n\n if (popupDiv != undefined && popupDiv != null) {\n clearInterval(popupCheck);\n\n\n //setTimeout(function(){ }, 500);\n\n var parentDiv = document.getElementById('tr-wallet-content-placeholder');\n\n addDataToRedemptionPopup(parentDiv, e.offerCode);\n\n return;\n }\n\n if (timeCounter > maxCounter) {\n clearInterval(popupCheck);\n }\n\n timeCounter++;\n\n }, timeDelay);\n\n\n\n };\n }\n\n\n function checkForOfferSequence(pgName) {\n //return;\n if (pgName == \"Home\" | pgName == \"PMP\" | pgName == \"Search\" | pgName == \"Cart\") {\n var z1_offerDetails = localStorage.getItem('z1_offerDetails') + \"\";\n if (debugScr) console.log(\"z1_offerDetails...\", z1_offerDetails);\n if (isValid(z1_offerDetails)) {\n var z1_offerDetails_json = JSON.parse(z1_offerDetails);\n if (debugScr) console.log(\"z1_offerDetails_json...\", z1_offerDetails_json);\n if (!z1_offerDetails_json.offerUsed) {\n openKohlsCashModal('https://www.kohls.com/checkout/v2/includes/kohlsCash.jsp?shouldIncludeForms=true', Kjs.CMDM.softlogin('.kohlscashapply'));\n\n var popupInterval = setInterval( function() {\n\n if (document.getElementById('promo-kcInput') != null) {\n\n if (debugScr) console.log('promocode....' + z1_offerDetails_json.offerCode);\n document.getElementById('promo-kcInput').value = z1_offerDetails_json.offerCode;\n document.getElementById('applyInputButton').click();\n localStorage.removeItem('z1_offerDetails');\n\n clearInterval(popupInterval);\n }\n }, 1000);\n }\n }\n }\n }\n\n\n function addSUPCMinicart() {\n var existingSupc = localStorage.getItem('z1_supc');\n\n if (existingSupc != null && existingSupc != undefined && existingSupc != 'null') {\n var e = JSON.parse(existingSupc);\n\n var currentDate = new Date();\n\n currentDate = convertUTCtoCST(currentDate);\n var currentTime = currentDate.valueOf();\n\n if (debugScr) console.log(e.offerExpiry + \" Got Offer Expiry \");\n\n var endTime = getTimeFromApiFormat(e.offerExpiry);\n\n\n currentTime = Number(currentTime.toString().substring(0, currentTime.toString().length - 3));\n\n if (debugScr) console.log(endTime + \" timeCheck Main: \" + currentTime);\n\n rtoTimeRemaining = (endTime - currentTime);\n\n if (rtoTimeRemaining <= 0 || e.is_redeemed == true) {\n return;\n }\n\n document.getElementById(\"tr_phase2_ShoppingBg\").onclick = function() {\n\n\n var timeCounter = 0;\n var maxCounter = 10;\n var timeDelay = 500;\n\n\n\n var popupCheck = setInterval(function() {\n\n if (debugScr) console.log(\"Checking for Redemption Popup \" + timeCounter);\n\n var popupDiv = document.getElementsByClassName('tr_phase2_headerPanel')[0];\n\n //var popupDiv = document.getElementById('promo-kcInput');\n\n if (debugScr) console.log('Got Popup Div ' + popupDiv);\n\n if (popupDiv != undefined && popupDiv != null) {\n clearInterval(popupCheck);\n\n\n addSUPCRedemption(e);\n //setTimeout(function(){ }, 500);\n\n\n return;\n }\n\n if (timeCounter > maxCounter) {\n clearInterval(popupCheck);\n }\n\n timeCounter++;\n\n }, timeDelay);\n\n\n };\n\n\n }\n\n }\n\n\n addSUPCMinicart();\n\n\n } catch (ie) {\n console.log(\"Error in Tag webstoreSendEventAllPages: WebStore Z1 tag. \", ie);\n\n // var currentDate = new Date();\n // var errorObj = {};\n // errorObj.p1 = ie.message;\n\n // var custDetails = pageData.customerDetails.customerID;\n\n // errorObj.p2 = '8. webstoresendevent '+evtName + '|'+currentDate + '|'+custDetails;\n\n // ZineOne.pushEvent('_ws_logs', errorObj);\n }\n\n\n\n\n /*$(document).ready(function(){*/\n /*\n $.ajax({\n url: \"/common/user_check_status.jsp\",\n dataType: 'json',\n success: function(data) {\n console.log(JSON.stringify(data));\n },\n error: function() {\n //alert(\"error\");\n }\n });\n */\n /*});*/\n\n} catch (e) {\n console.log(\"[Zineone-I-I] Error in webstoreSendEventAllPages: WebStore Z1 tag \",e);\n}","eventName":"load","pageSelector":{"type":"all","condition":"equals","val":""}},{"tagName":"closeZ1WidgetOnMIniCartClick","actionType":"z1script","script":"try {\n var elem = document.getElementById('z1widget');\n if (elem) elem.style.display = \"none\";\n} catch (ee) {\n console.log(\"[zineone] err in tag closeZ1WidgetOnMIniCartClick \"+ee);\n}\n","eventName":"click","pageSelector":{"type":"pgName","condition":"contains","val":"/catalog"},"domSelector":{"type":"id","val":"mini-cart"}},{"tagName":"closeZ1WidgetOnUtilityGreeting","actionType":"z1script","script":"try {\n var elem = document.getElementById('z1widget');\n if (elem) elem.style.display = \"none\";\n} catch (ee) {\n console.log(\"[zineone] err in tag closeZ1WidgetOnUtilityGreeting \"+ee);\n}\n","eventName":"click","pageSelector":{"type":"pgName","condition":"contains","val":"/catalog"},"domSelector":{"type":"id","val":"utility-nav"}},{"tagName":"Creating Z1 Widget Div on SearchPage","actionType":"z1script","script":"//add msg div as child of notifyDiv\n//var notifyDiv = document.getElementById(\"container\");\ntry {\n var notifyDiv = document.getElementById(\"mini-cart\");\n var z1Div = document.createElement(\"div\");\n z1Div.setAttribute(\"data-zineone-widget\", \"z1_content_widget\");\n z1Div.setAttribute(\"id\", \"z1widget\");\n notifyDiv.appendChild(z1Div);\n} catch (z1ie) {\n console.log(\"[ZineOne] exception in running Tag to create div to attach z1widget=\"+z1ie);\n}\n","eventName":"load","pageSelector":{"type":"pgName","condition":"contains","val":"/search"}},{"tagName":"closeZ1WidgetOnMIniCartClickSearch","actionType":"z1script","script":"try {\n var elem = document.getElementById('z1widget');\n elem.style.display = \"none\";\n} catch (ee) {\n console.log(\"[zineone] err in tag closeZ1WidgetOnMIniCartClickSearch \" + ee);\n}\n","eventName":"click","pageSelector":{"type":"pgName","condition":"contains","val":"/search"},"domSelector":{"type":"id","val":"mini-cart"}},{"tagName":"Z1 Divs on PDP","actionType":"z1script","script":"/*\n//add msg div as child of parentDiv\nvar isDebugScr = true;\ntry {\n var parentDivCollection = document.getElementsByClassName(\"pdp-main-right-content\");\n if (parentDivCollection.length == 1) {\n var parentDiv = parentDivCollection[0];\n var z1Div = document.createElement(\"div\");\n if (isDebugScr) console.log(\"[zineone] created new div\");\n z1Div.setAttribute(\"data-zineone-widget\", \"z1_content_widget\");\n z1Div.setAttribute(\"id\", \"pdp-z1widget\");\n //z1Div.setAttribute(\"style\", \"color:#7E2C79\");\n z1Div.setAttribute(\"style\", \"color:#7E2C79;font-family:'Gotham 7r',Helvetica,Arial;font-size:16px;\");\n //parentDiv.appendChild(z1Div);\n parentDiv.prepend(z1Div);\n if (isDebugScr) console.log(\"[zineone] appended new div\"); \n }\n} catch (z1ie) {\n console.log(\"[zineone] exception in Tag creating div to attch z1widget on PDP=\" + z1ie);\n}\n\n\n//add msg div as child of parentDiv\nvar isDebugScr = false;\ntry {\n var parentDivCollection = document.getElementsByClassName(\"pdp-main-right-content\");\n if (parentDivCollection.length == 1) {\n var parentDiv = parentDivCollection[0];\n var z1Div = document.createElement(\"div\");\n if (isDebugScr) console.log(\"[zineone] created new div\");\n z1Div.setAttribute(\"data-zineone-widget\", \"z1_content_widget\");\n z1Div.setAttribute(\"id\", \"z1-pdpurgency\");\n //z1Div.setAttribute(\"style\", \"color:#7E2C79\");\n //z1Div.setAttribute(\"style\", \"display:none;width:100%;margin-left:15px;background-size: 100%;color:#ffffff;height:30px;line-height:30px;font-size:15px;text-align: center;position:relative;font-family:'Gotham 5r',Helvetica,Arial, sans-serif; font-weight:bold; font-size:16px;background:url('https://media.kohlsimg.com/is/image/kohls/20180606-tce-zineone-badge-bg?fmt=png') no-repeat\");\n z1Div.setAttribute(\"style\", \"display:none;width: 100%; background: linear-gradient(to right, #84337e, #2a2455); background-size:'100% 100%'; color: #ffffff; height: 2.5em; line-height: 2.5em; font-size: 17px; font-weight:bold; text-align: center;font-family: 'Gotham 7r', Helvetica, Arial, sans-serif;transform: skewX(-10deg);\");\n //parentDiv.appendChild(z1Div);\n //var z1Span = document.getElementById(\"z1_span_id\");\n //z1Span.setAttribute(\"style\", \"font-weight:lighter;\"); \n parentDiv.prepend(z1Div);\n if (isDebugScr) console.log(\"[zineone] appended new div\"); \n }\n} catch (z1ie) {\n console.log(\"[zineone] exception in _ws_ Tag creating div to attch z1widget on PDP=\" + z1ie);\n}\n*/\n\nvar isDebugScr = false;\ntry {\n /*var myId = pageData.customerDetails.customerID ? pageData.customerDetails.customerID : \"\";\n if (isDebugScr) console.log(\"Urgency my Id ==> \",myId);\n if (myId == \"3000000030411692\" || myId == \"3000000129500077\" || myId == \"3000000015076174\" || myId == \"3000000074262095\" ) {*/\n function getCookie(name) {\n var value = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)'));\n return (value != null) ? unescape(value[2]) : null;\n }\n\n function isValid(value) {\n if (value == \"null\" || value == \"undefined\" || value == null || value == undefined) {\n return false;\n }\n return true;\n }\n var productPageName = pageName;\n var parentDivCollection = \"\";\n var aka_hp2_cookie = getCookie(\"AKA_HP2\");\n var aka_rv_cookie = getCookie(\"AKA_RV\");\n var aka_pdp2_cookie = getCookie(\"AKA_PDP2\");\n if (isDebugScr) console.log(\" aka_hp2_cookie ==> \", aka_hp2_cookie, \" aka_rv_cookie ==> \", aka_rv_cookie, \" aka_pdp2_cookie ==> \", aka_pdp2_cookie);\n if (isValid(aka_pdp2_cookie) && aka_pdp2_cookie.toLowerCase() == \"true\") {\n var parentDiv = \"\";\n if (productPageName == \"regularProductPage\") {\n parentDiv = document.getElementById(\"PDP_z1Social_badge\");\n } else if (productPageName == \"collectionPDPPage\") {\n parentDiv = document.getElementById(\"CDP_z1Social_badge\");\n } else {\n parentDiv = \"\";\n }\n if (parentDiv) {\n var z1Div = document.createElement(\"div\");\n if (isDebugScr) console.log(\"[zineone] created new div\");\n z1Div.setAttribute(\"id\", \"z1-pdpurgency\");\n z1Div.style.display = \"none\";\n z1Div.style.margin = \".3em\";\n z1Div.style.textAlign = \"center\";\n z1Div.style.width = \"100%\";\n z1Div.style.background = \"linear-gradient(to right, #84337e, #2a2455)\";\n z1Div.style.backgroundSize = \"100% 100%\";\n z1Div.style.color = \"#ffffff\";\n z1Div.style.height = \"30px\";\n z1Div.style.lineHeight = \"30px\";\n z1Div.style.fontSize = \"17px\";\n z1Div.style.textAlign = \"center\";\n z1Div.style.fontFamily = \"\\'Gotham 7r\\', Helvetica, Arial, sans-serif\";\n //parentDiv.prepend(z1Div); //Doesn't work on IE\n parentDiv.appendChild(z1Div);\n }\n } else {\n var parentDivCollection = document.getElementsByClassName(\"pdp-main-right-content\");\n if (!parentDivCollection || (parentDivCollection && parentDivCollection.length == 0))\n parentDivCollection = document.getElementsByClassName(\"collection_main_right_content\");\n if (parentDivCollection && parentDivCollection.length == 1) {\n var parentDiv = parentDivCollection[0];\n var z1Div = document.createElement(\"div\");\n if (isDebugScr) console.log(\"[zineone] created new div\");\n z1Div.setAttribute(\"id\", \"z1-pdpurgency\");\n z1Div.style.display = \"none\";\n z1Div.style.margin = \".3em\";\n z1Div.style.textAlign = \"center\";\n z1Div.style.width = \"100%\";\n z1Div.style.background = \"linear-gradient(to right, #84337e, #2a2455)\";\n z1Div.style.backgroundSize = \"100% 100%\";\n z1Div.style.color = \"#ffffff\";\n z1Div.style.height = \"30px\";\n z1Div.style.lineHeight = \"30px\";\n z1Div.style.fontSize = \"17px\";\n z1Div.style.textAlign = \"center\";\n z1Div.style.fontFamily = \"\\'Gotham 7r\\', Helvetica, Arial, sans-serif\";\n\n //parentDiv.prepend(z1Div); //doesn't work on IE\n var refDiv = parentDiv.firstChild;\n parentDiv.insertBefore(z1Div, refDiv);\n\n if (isDebugScr) console.log(\"[zineone] appended new div\");\n }\n }\n\n /*} else {\n var parentDivCollection = document.getElementsByClassName(\"pdp-main-right-content\");\n if (!parentDivCollection || (parentDivCollection && parentDivCollection.length == 0))\n parentDivCollection = document.getElementsByClassName(\"collection_main_right_content\");\n if (parentDivCollection && parentDivCollection.length == 1) {\n var parentDiv = parentDivCollection[0];\n var z1Div = document.createElement(\"div\");\n if (isDebugScr) console.log(\"[zineone] created new div\");\n //z1Div.setAttribute(\"data-zineone-widget\", \"z1_content_widget\");\n z1Div.setAttribute(\"id\", \"z1-pdpurgency\");\n //z1Div.setAttribute(\"style\", \"display:none;margin: .3em; text-align: center; width: 100%; background: linear-gradient(to right, #84337e, #2a2455); background-size: 100% 100%; color: #ffffff; height: 30px; line-height: 30px; font-size: 17px;text-align: center;font-family: 'Gotham 7r', Helvetica, Arial, sans-serif;transform: skewX(-10deg);\");\n //z1Div.setAttribute(\"style\", \"display:none;margin: .3em; text-align: center; width: 100%; background: linear-gradient(to right, #84337e, #2a2455); background-size: 100% 100%; color: #ffffff; height: 30px; line-height: 30px; font-size: 17px;text-align: center;font-family: 'Gotham 7r', Helvetica, Arial, sans-serif;\"); \n z1Div.style.display = \"none\";\n z1Div.style.margin = \".3em\";\n z1Div.style.textAlign = \"center\";\n z1Div.style.width = \"100%\";\n z1Div.style.background = \"linear-gradient(to right, #84337e, #2a2455)\";\n z1Div.style.backgroundSize = \"100% 100%\";\n z1Div.style.color = \"#ffffff\";\n z1Div.style.height = \"30px\";\n z1Div.style.lineHeight = \"30px\";\n z1Div.style.fontSize = \"17px\";\n z1Div.style.textAlign = \"center\";\n z1Div.style.fontFamily = \"\\'Gotham 7r\\', Helvetica, Arial, sans-serif\";\n\n //parentDiv.prepend(z1Div); //doesn't work on IE\n var refDiv = parentDiv.firstChild;\n parentDiv.insertBefore(z1Div, refDiv);\n\n if (isDebugScr) console.log(\"[zineone] appended new div\");\n }\n }*/\n\n\n} catch (z1ie) {\n console.log(\"[zineone] exception in _ws_ Tag creating div to attch z1widget on PDP=\" + z1ie);\n}","eventName":"load","pageSelector":{"type":"pgName","condition":"contains","val":"/product/prd-"}},{"tagName":"Creating Z1 Widget Div on Homepage","actionType":"z1script","script":"//add msg div as child of notifyDiv\n//var notifyDiv = document.getElementById(\"container\");\ntry {\n \n var id = localStorage.getItem(\"z1_cust_id\");\n \n if(id==\"3000000015510732\"||id==\"2254040233704719\"){\n \n }\n \n var notifyDiv = document.getElementById(\"mini-cart\");\n var z1Div = document.createElement(\"div\");\n z1Div.setAttribute(\"data-zineone-widget\", \"z1_content_widget\");\n z1Div.setAttribute(\"id\", \"z1widget\");\n notifyDiv.appendChild(z1Div);\n} catch (z1ie) {\n console.log(\"exception in Tag creating div to attch z1widget=\" + z1ie);\n}","eventName":"load","pageSelector":{"type":"pgName","condition":"contains","val":"/"}},{"tagName":"Creating Z1 Widget Div on CartPage","actionType":"z1script","script":"//add msg div as child of notifyDiv\n//var notifyDiv = document.getElementById(\"container\");\ntry {\n var notifyDiv = document.getElementById(\"mini-cart\");\n var z1Div = document.createElement(\"div\");\n z1Div.setAttribute(\"data-zineone-widget\", \"z1_content_widget\");\n z1Div.setAttribute(\"id\", \"z1widget\");\n notifyDiv.appendChild(z1Div);\n} catch (z1ie) {\n console.log(\"exception in Tag creating div to attch z1widget=\" + z1ie);\n}","eventName":"load","pageSelector":{"type":"pgName","condition":"ends","val":"shopping_cart.jsp"}},{"tagName":"closeZ1WidgetOnMIniCartClickHome","actionType":"z1script","script":"try {\n var elem = document.getElementById('z1widget');\n elem.style.display = \"none\";\n} catch (ee) {\n console.log(\"[zineone] err in tag closeZ1WidgetOnMIniCartClickSearch \" + ee);\n}\n","eventName":"click","pageSelector":{"type":"pgName","condition":"contains","val":"/"},"domSelector":{"type":"id","val":"mini-cart"}},{"tagName":"closeZ1WidgetOnMIniCartClickCart","actionType":"z1script","script":"try {\n var elem = document.getElementById('z1widget');\n var e2 = document.querySelectorAll('#z1widget');\n for (var i = 0; i < e2.length; i++)\n {\n if (e2[i].style.display)\n {\n e2[i].style.display = \"none\";\n }\n }\n //elem.style.display = 'none';\n \t//elem.style.display = \"\";\n} catch (ee) {\n console.log(\"[zineone] err in tag closeZ1WidgetOnMIniCartClickSearch \" + ee);\n}\n","eventName":"click","pageSelector":{"type":"pgName","condition":"contains","val":"/shopping_cart.jsp"},"domSelector":{"type":"id","val":"mini-cart"}},{"tagName":"completeShipping","actionType":"z1script","script":"try {\n var debugScr = true;\n var cartValue = 0;\n\n if (debugScr) console.log(\"[ZineOne] addtobag Event will be triggered\");\n\n var evtName = \"_ws_completeShipping\";\n\n //Event Codes for vectors:\n var eventCodes = {\n _ws_addedtobag: \"A\",\n breachedgeofence: \"B\",\n _ws_completeshipping: \"C\",\n exitgeofence: \"D\",\n _ws_placedorder: \"E\",\n _ws_searched: \"F\",\n _ws_startedcheckout: \"G\",\n _ws_viewedcart: \"H\",\n _ws_viewedcatalog: \"I\",\n _ws_viewedhome: \"J\",\n _ws_viewedproduct: \"K\",\n _ws_completepayment: \"L\",\n _ws_viewedsku: \"M\",\n _ws_update_hcart: \"N\",\n _ws_changedsort: \"O\",\n _ws_rto: \"R\"\n };\n var SESSION_GAP = 1800000; //30min = 30*60*1000 millis\n\n function isValid(value) {\n if (value == \"null\" || value == \"undefined\" || value == null || value == undefined) {\n return false;\n }\n\n return true;\n }\n\n\n\n function getUrlParameter(sParam) {\n var sPageURL = decodeURIComponent(window.location.search.substring(1)),\n sURLVariables = sPageURL.split('&'),\n sParameterName,\n i;\n\n for (i = 0; i < sURLVariables.length; i++) {\n sParameterName = sURLVariables[i].split('=');\n\n if (sParameterName[0] === sParam) {\n return sParameterName[1] === undefined ? true : sParameterName[1];\n }\n }\n }\n\n function validateForNotNull(obj)\n {\n //console.log('validateForNotNull',obj,typeof(obj));\n if(!(obj === undefined) && obj != null && obj != 'null' && obj.toString().length != 0)\n {\n return true;\n }\n\n return false;\n }\n\n function spltArrayObjectDataIntoVector(array,attribute)\n {\n var stringVector = '';\n\n console.log(\"spltArrayObjectDataIntoVector attribute\",attribute,array);\n\n if (!validateForNotNull(array)) {\n\n return stringVector;\n\n }\n\n if(array.length == 0)\n {\n return stringVector;\n }\n\n\n for(var i=0;i<array.length;i++)\n {\n var innerObj = array[i];\n\n var attributeValue = '#';\n if (validateForNotNull(innerObj) && validateForNotNull(innerObj[attribute])) {\n\n attributeValue = innerObj[attribute];\n\n }\n \n\n stringVector = stringVector + attributeValue + '^';\n }\n\n stringVector = stringVector.substring(0,stringVector.length-1);\n\n return stringVector;\n\n }\n\n function spltArrayObjectWithArrayObjectDataIntoVector(array,mainAttribute,innerAttribute)\n {\n var stringVector = '';\n\n console.log(\"spltArrayObjectWithArrayObjectDataIntoVector mainAttribute\",mainAttribute,innerAttribute,array);\n\n\n if (!validateForNotNull(array)) {\n\n return stringVector;\n\n }\n\n if(array.length == 0)\n {\n return stringVector;\n }\n\n\n for(var i=0;i<array.length;i++)\n {\n var innerObj = array[i];\n var attributeValueArr = innerObj[mainAttribute];\n\n console.log('spltArrayObjectDataIntoVector ',spltArrayObjectDataIntoVector(attributeValueArr,innerAttribute));\n stringVector = stringVector + spltArrayObjectDataIntoVector(attributeValueArr,innerAttribute) + '^';\n }\n\n stringVector = stringVector.substring(0,stringVector.length-1);\n\n return stringVector;\n\n }\n\n\n function spltArrayObjectWithAttributeObjectDataIntoVector(array,mainAttribute,innerAttribute)\n {\n\n var stringVector = '';\n\n if (!validateForNotNull(array)) {\n\n return stringVector;\n\n }\n\n if(array.length == 0)\n {\n return stringVector;\n }\n\n for(var i=0;i<array.length;i++)\n {\n var innerObj = array[i];\n\n var attributeValue = '-';\n if (validateForNotNull(innerObj) && validateForNotNull(innerObj[mainAttribute]) && validateForNotNull(innerObj[mainAttribute][innerAttribute])) {\n\n attributeValue = innerObj[mainAttribute][innerAttribute];\n\n }\n \n\n stringVector = stringVector + attributeValue + '~';\n }\n\n stringVector = stringVector.substring(0,stringVector.length-1);\n\n return stringVector;\n\n }\n\n function fetchCartDump()\n {\n\n var persistLocalData = localStorage.getItem('persistent_bar_components_json_v1');\n\n if(!isValid(persistLocalData)){\n persistLocalData = JSON.stringify(Kjs.PB.getPbCartStorage());\n }\n\n if (validateForNotNull(persistLocalData)) {\n\n var finalCartJSON = {};\n finalCartJSON.cartItems = [];\n\n persistLocalData = JSON.parse(persistLocalData);\n\n cartData = persistLocalData.cartItems;\n\n if(validateForNotNull(cartData))\n {\n for(var i=0;i<cartData.length;i++)\n {\n if(i == 15)\n {\n break;\n }\n\n var currentFinalObjToSend = {};\n\n var currentObj = cartData[i];\n currentFinalObjToSend.sku = currentObj.skuId;\n currentFinalObjToSend.prdId = currentObj.productId;\n currentFinalObjToSend.qty = currentObj.quantity;\n\n if(validateForNotNull(currentObj.storeClearance))\n {\n currentFinalObjToSend.sc = currentObj.storeClearance; \n }\n \n if(validateForNotNull(currentObj.itemProperties.size))\n {\n currentFinalObjToSend.size = currentObj.itemProperties.size;\n }\n \n if(validateForNotNull(currentObj.itemProperties.color))\n {\n currentFinalObjToSend.color = currentObj.itemProperties.color;\n }\n \n if(validateForNotNull(currentObj.itemProperties.isWebExclusive))\n {\n currentFinalObjToSend.isWebExcl = currentObj.itemProperties.isWebExclusive; \n }\n \n\n var finalInvInfo = {};\n\n if(validateForNotNull(currentObj.inventoryInfo.shipAvailable))\n {\n finalInvInfo.shpAvai = currentObj.inventoryInfo.shipAvailable;\n }\n\n if(validateForNotNull(currentObj.inventoryInfo.bopusAvailable))\n {\n finalInvInfo.bopAvail = currentObj.inventoryInfo.bopusAvailable; \n }\n \n if(validateForNotNull(currentObj.inventoryInfo.bossAvailable))\n {\n finalInvInfo.bosAvail = currentObj.inventoryInfo.bossAvailable; \n }\n \n if(validateForNotNull(currentObj.inventoryInfo.invOnHandQtyShip))\n {\n finalInvInfo.invOHQShip = currentObj.inventoryInfo.invOnHandQtyShip; \n }\n \n if(validateForNotNull(currentObj.finalInvInfo))\n {\n currentFinalObjToSend.invInfo = currentObj.finalInvInfo; \n }\n \n\n var currentPromoInfo = currentObj.promoInfo;\n\n console.log(' currentPromoInfo ',currentPromoInfo);\n\n if(validateForNotNull(currentPromoInfo))\n {\n var finalPromoArray = [];\n\n var prTypeArr = [];\n var prTextArr = [];\n\n for(var j=0;j<currentPromoInfo.length;j++)\n {\n var currentPromoObj = currentPromoInfo[j];\n var tempPromoObj = {};\n\n if(validateForNotNull(currentPromoObj.promoType))\n {\n prTypeArr[prTypeArr.length] = currentPromoObj.promoType; \n }\n \n if(validateForNotNull(currentPromoObj.promoText))\n {\n prTextArr[prTextArr.length] = currentPromoObj.promoText; \n }\n \n\n\n }\n\n currentFinalObjToSend.prType = prTypeArr.join('|');\n currentFinalObjToSend.prText = prTextArr.join('|');\n }\n\n \n\n var currentOfferInfo = currentObj.offerInfo;\n\n console.log(' currentOfferInfo ',currentOfferInfo);\n\n if(validateForNotNull(currentOfferInfo))\n {\n var finalOfferInfoArray = [];\n\n for(var j=0;j<currentOfferInfo.length;j++)\n {\n var currentOfferInfoObj = currentOfferInfo[j];\n var tempOfferInfoObj = {};\n\n if(validateForNotNull(currentOfferInfoObj.offerDiscount))\n {\n tempOfferInfoObj.ofDis = currentOfferInfoObj.offerDiscount; \n }\n \n if(validateForNotNull(currentOfferInfoObj.startDate))\n {\n tempOfferInfoObj.stDt = currentOfferInfoObj.startDate; \n }\n \n if(validateForNotNull(currentOfferInfoObj.endDate))\n {\n tempOfferInfoObj.enDT = currentOfferInfoObj.endDate; \n }\n \n\n finalOfferInfoArray[finalOfferInfoArray.length] = tempOfferInfoObj;\n\n }\n\n currentFinalObjToSend.offInfo = finalOfferInfoArray;\n }\n\n\n finalCartJSON.cartItems[finalCartJSON.cartItems.length] = currentFinalObjToSend;\n }\n }\n\n \n\n\n var shipmentInfo = persistLocalData.shipmentInfo;\n\n console.log(' shipmentInfo ',shipmentInfo);\n\n if(validateForNotNull(shipmentInfo))\n {\n var finalshipmentInfoArray = [];\n\n for(var j=0;j<shipmentInfo.length;j++)\n {\n var currentshipmentInfoObj = shipmentInfo[j];\n var tempShipmentInfoObj = {}; \n\n if(validateForNotNull(currentshipmentInfoObj.shipmentPriceInfo.originalShippingCharges))\n {\n tempShipmentInfoObj.ogShpChrgs = currentshipmentInfoObj.shipmentPriceInfo.originalShippingCharges; \n }\n \n if(validateForNotNull(currentshipmentInfoObj.shipmentPriceInfo.shippingChargesAfterDiscount))\n {\n tempShipmentInfoObj.shpChrgsADis = currentshipmentInfoObj.shipmentPriceInfo.shippingChargesAfterDiscount; \n }\n \n if(validateForNotNull(currentshipmentInfoObj.shipmentPriceInfo.freeShipQualificationDelta))\n {\n tempShipmentInfoObj.freeShpQlfDelta = currentshipmentInfoObj.shipmentPriceInfo.freeShipQualificationDelta; \n }\n \n if(validateForNotNull(currentshipmentInfoObj.shipmentPriceInfo.shipmentItemsTotal))\n {\n tempShipmentInfoObj.shpItmsTot = currentshipmentInfoObj.shipmentPriceInfo.shipmentItemsTotal; \n }\n \n\n\n var shippingOffers = currentshipmentInfoObj.shippingOffers;\n if(validateForNotNull(shippingOffers))\n {\n var finalshippingOfferArray = [];\n\n for(var k=0;k<shippingOffers.length;k++)\n {\n var currentshippingOffersObj = shippingOffers[k];\n\n if(validateForNotNull(currentshippingOffersObj.discountAmount))\n {\n finalshippingOfferArray[finalshippingOfferArray.length] = currentshippingOffersObj.discountAmount; \n }\n \n }\n\n\n tempShipmentInfoObj.disAmnt = finalshippingOfferArray.join('|');\n\n\n }\n\n finalshipmentInfoArray[finalshipmentInfoArray.length] = tempShipmentInfoObj;\n\n\n }\n\n finalCartJSON.shipmentInfo = finalshipmentInfoArray;\n }\n\n var orderSummary = persistLocalData.orderSummary; \n\n var finalOrderSummaryObj = {};\n\n if(validateForNotNull(orderSummary.merchandisePromoAmount))\n {\n finalOrderSummaryObj.merProAmnt = orderSummary.merchandisePromoAmount; \n }\n \n if(validateForNotNull(orderSummary.discountedShippingAmount))\n {\n finalOrderSummaryObj.disShpAmnt = orderSummary.discountedShippingAmount;\n }\n \n if(validateForNotNull(orderSummary.originalShippingAmount))\n {\n finalOrderSummaryObj.ogShpAmnt = orderSummary.originalShippingAmount; \n }\n \n if(validateForNotNull(orderSummary.tax) && validateForNotNull(orderSummary.tax.estimated))\n {\n finalOrderSummaryObj.taxest = orderSummary.tax.estimated; \n }\n \n if(validateForNotNull(orderSummary.tax) && validateForNotNull(orderSummary.tax.taxRate))\n {\n finalOrderSummaryObj.taxRate = orderSummary.tax.taxRate; \n }\n \n if(validateForNotNull(orderSummary.tax) && validateForNotNull(orderSummary.tax.tax))\n {\n finalOrderSummaryObj.tax = orderSummary.tax.tax; \n }\n \n if(validateForNotNull(orderSummary.totalSurcharges))\n {\n finalOrderSummaryObj.totSurgs = orderSummary.totalSurcharges; \n }\n \n if(validateForNotNull(orderSummary.totalTaxFee))\n {\n finalOrderSummaryObj.totTaxFee = orderSummary.totalTaxFee; \n }\n \n if(validateForNotNull(orderSummary.totalKohlsCashAndPromoDiscounts))\n {\n finalOrderSummaryObj.totKCAProDis = orderSummary.totalKohlsCashAndPromoDiscounts; \n }\n \n if(validateForNotNull(orderSummary.totalTax))\n {\n finalOrderSummaryObj.totTax = orderSummary.totalTax; \n }\n \n if(validateForNotNull(orderSummary.total))\n {\n finalOrderSummaryObj.total = orderSummary.total; \n }\n \n if(validateForNotNull(orderSummary.savings))\n {\n finalOrderSummaryObj.sav = orderSummary.savings; \n }\n \n if(validateForNotNull(orderSummary.taxFeeEnabled))\n {\n finalOrderSummaryObj.taxFeeE = orderSummary.taxFeeEnabled; \n }\n\n finalCartJSON.orderSummary = finalOrderSummaryObj;\n\n return JSON.stringify(finalCartJSON);\n\n }\n\n return null;\n\n\n }\n\n\n function onceInSessionAttributes(eventData) {\n var finalReturnObj = eventData;\n\n var persistLocalData = localStorage.getItem('persistent_bar_components_json_v1');\n\n if(!isValid(persistLocalData)){\n persistLocalData = JSON.stringify(Kjs.PB.getPbCartStorage());\n }\n\n if (validateForNotNull(persistLocalData)) {\n\n var pageDataJson = pageData;\n persistLocalData = JSON.parse(persistLocalData);\n\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.incentiveAmount)) {\n finalReturnObj.incdet_incamnt = persistLocalData.incentiveDetails.incentiveAmount;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.incentiveType)) {\n finalReturnObj.incdet_inctype = persistLocalData.incentiveDetails.incentiveType;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.smartIncentiveStatus)) {\n finalReturnObj.incdet_smartincstatus = persistLocalData.incentiveDetails.smartIncentiveStatus;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.incentiveThreshold)) {\n finalReturnObj.incdet_incthreshold = persistLocalData.incentiveDetails.incentiveThreshold;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.incentiveEligible)) {\n finalReturnObj.incdet_inceligible = persistLocalData.incentiveDetails.incentiveEligible;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.incentiveQualified)) {\n finalReturnObj.incdet_incqualifed = persistLocalData.incentiveDetails.incentiveQualified;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.minCartThresholdMet)) {\n finalReturnObj.incdet_minicartthresholdmet = persistLocalData.incentiveDetails.minCartThresholdMet;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.customerHasKohlsCharge)) {\n finalReturnObj.custdet_custhaskohlschrg = persistLocalData.customerDetails.customerHasKohlsCharge;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.customerPostalCode)) {\n finalReturnObj.custdet_custpostalcode = persistLocalData.customerDetails.customerPostalCode;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.myStoreId)) {\n finalReturnObj.custdet_mystoreid = persistLocalData.customerDetails.myStoreId;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.rewardsPilotService)) {\n finalReturnObj.custdet_rewardspilotser = persistLocalData.customerDetails.rewardsPilotService;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.kohlsLoyalty2018EliteMember)) {\n finalReturnObj.custdet_lytelitemember = persistLocalData.customerDetails.kohlsLoyalty2018EliteMember;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.kohlsLoyalty2018Member)) {\n finalReturnObj.custdet_lytmember = persistLocalData.customerDetails.kohlsLoyalty2018Member;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.rewards) && validateForNotNull(persistLocalData.purchaseEarnings.rewards.loyaltyPointBalance)) {\n finalReturnObj.usrdata_lytypntbal = persistLocalData.purchaseEarnings.rewards.loyaltyPointBalance;\n }\n\n if (validateForNotNull(persistLocalData.userData) && validateForNotNull(persistLocalData.userData.optInIndicator)) {\n finalReturnObj.usrdata_optinindict = persistLocalData.userData.optInIndicator;\n }\n\n if (validateForNotNull(persistLocalData.userData) && validateForNotNull(persistLocalData.userData.accountStatus)) {\n finalReturnObj.usrdata_accstatus = persistLocalData.userData.accountStatus;\n }\n\n if (validateForNotNull(persistLocalData.userData) && validateForNotNull(persistLocalData.userData.storeNum)) {\n finalReturnObj.usrdata_strnum = persistLocalData.userData.storeNum;\n }\n\n if (validateForNotNull(persistLocalData.userData) && validateForNotNull(persistLocalData.userData.isEnrolledUser)) {\n finalReturnObj.usrdata_isenrusr = persistLocalData.userData.isEnrolledUser;\n }\n\n if (validateForNotNull(persistLocalData.userData) && validateForNotNull(persistLocalData.userData.sessionStatus)) {\n finalReturnObj.usrdata_sesstatus = persistLocalData.userData.sessionStatus;\n }\n\n if (validateForNotNull(pageDataJson.pageDetails) && validateForNotNull(pageDataJson.pageDetails.browserPostalCode)) {\n finalReturnObj.pgdata_pgdet_brwpostalcode = pageDataJson.pageDetails.browserPostalCode;\n }\n\n if (validateForNotNull(pageDataJson.customerDetails) && validateForNotNull(pageDataJson.customerDetails.customerPostalCode)) {\n finalReturnObj.pgdata_custdet_custpostalcode = pageDataJson.customerDetails.customerPostalCode;\n }\n\n\n\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.rewards) && validateForNotNull(persistLocalData.purchaseEarnings.rewards.awayPoints)) {\n finalReturnObj.purear_rwds_awaypnts = persistLocalData.purchaseEarnings.rewards.awayPoints;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.rewards) && validateForNotNull(persistLocalData.purchaseEarnings.rewards.ltyRewardThresholdValue)) {\n finalReturnObj.purear_rwds_lytrwdthreshval = persistLocalData.purchaseEarnings.rewards.ltyRewardThresholdValue;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.rewards) && validateForNotNull(persistLocalData.purchaseEarnings.rewards.loyaltyPointBalance)) {\n finalReturnObj.purear_rwds_lytpntbal = persistLocalData.purchaseEarnings.rewards.loyaltyPointBalance;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.rewards) && validateForNotNull(persistLocalData.purchaseEarnings.rewards.currentPurchaseEarnPoint)) {\n finalReturnObj.purear_rwds_curpurearnpnt = persistLocalData.purchaseEarnings.rewards.currentPurchaseEarnPoint;\n }\n\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash.qualificationAmount)) {\n finalReturnObj.purear_kc_qlfyamnt = persistLocalData.purchaseEarnings.kohlsCash.qualificationAmount;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash.earnAmount)) {\n finalReturnObj.purear_kc_earnamnt = persistLocalData.purchaseEarnings.kohlsCash.earnAmount;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash.currentPurchaseEarnAmount)) {\n finalReturnObj.purear_kc_curpurearnamnt = persistLocalData.purchaseEarnings.kohlsCash.currentPurchaseEarnAmount;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash.awayAmount)) {\n finalReturnObj.purear_kc_awayamnt = persistLocalData.purchaseEarnings.kohlsCash.awayAmount;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCashEarnings)) {\n finalReturnObj.purear_kcearnings = persistLocalData.purchaseEarnings.kohlsCashEarnings;\n }\n\n if (validateForNotNull(persistLocalData.addressDetails) && validateForNotNull(persistLocalData.addressDetails.billingAddress[0]) && validateForNotNull(persistLocalData.addressDetails.billingAddress[0].postalCode)) {\n finalReturnObj.addrdet_biladdr_postalcode = spltArrayObjectDataIntoVector(persistLocalData.addressDetails.billingAddress, 'postalCode');\n }\n\n }\n\n return finalReturnObj;\n }\n\n function fetchMcmId()\n {\n var mcid = (typeof Visitor != 'undefined') ? Visitor.getInstance('F0EF5E09512D2CD20A490D4D@AdobeOrg') : '';\n var mcmId = (mcid ? mcid.getMarketingCloudVisitorID() : '');\n\n return mcmId;\n }\n\n function getPresentVector() {\n try {\n\n console.log('getPresentVector');\n\n if(pageData.cartDetails)\n {\n cartValue = pageData.cartDetails.cartSubTotalValue;\n }\n\n var itemsInBag = Number(localStorage.getItem(\"z1_checkoutBagCount\"));\n\n var presentVector = {};\n presentVector.event = eventCodes[evtName.toLocaleLowerCase()] || evtName; //common to all\n presentVector.productID = '-'; //ViewedProduct, AddedToBag\n presentVector.itemsInBag = itemsInBag || 0; //common to all\n presentVector.originalPrice = '-';\n presentVector.salePrice = '-';\n presentVector.KC = '-'; //Think\n presentVector.PDPCategory = '-'; //\n presentVector.department = '-';\n presentVector.CN = '-';\n presentVector.keywords = '-';\n presentVector.visualNavForm = '-';\n presentVector.pageFilter = '-';\n presentVector.searchType = '-';\n presentVector.userPFM = '-';\n presentVector.loginstatus = (isLoggedIn) ? 'full' : (isSoftLoggedIn ? 'soft' : '-');\n presentVector.onSale = '-';\n presentVector.time = new Date().getTime();\n\n //New Ml Vectors\n\n presentVector.pgdata_pmpdet_catname = '-';\n presentVector.pgdata_pmpdet_subcatname = '-';\n presentVector.pgdata_pmpdet_findingname = '-';\n presentVector.pgdata_pmpdet_cat_keywords = '-';\n presentVector.pgdata_pmpdet_pgfilter = '-';\n presentVector.pgdata_pmpdet_deptname = '-';\n presentVector.pgdata_pmpdet_gendervalues = '-';\n presentVector.pgdata_pmpdet_search_keywords = '-';\n presentVector.pgdata_proddet_colid = '-';\n presentVector.pgdata_pddetails_clientpostalcode = '-';\n presentVector.selected_sku_color = '-';\n presentVector.selected_sku_size = '-';\n presentVector.selected_sku = '-';\n //presentVector.selected_sku_regular_price = '-';\n presentVector.selected_sku_sale_price = '-';\n\n presentVector.c_i_size = '-';\n presentVector.c_i_color = '-';\n presentVector.c_i_isweb = '-';\n presentVector.c_sclearance = '-';\n presentVector.c_i_shipavailable = '-';\n presentVector.c_i_bopusAval = '-';\n presentVector.c_i_bossAval = '-';\n presentVector.c_i_invShip = '-';\n presentVector.c_i_invBopus = '-';\n presentVector.c_i_invBoss = '-';\n presentVector.c_o_offDis = '-';\n presentVector.c_o_sdate = '-';\n presentVector.c_o_edate = '-';\n presentVector.c_p_type = '-';\n presentVector.c_p_ptext = '-';\n presentVector.shpi_shpp_ogshpchrgs = '-';\n presentVector.shpi_shpp_shpchrgsafdis = '-';\n presentVector.shpi_shpp_freeshpqlfdelta = '-';\n presentVector.shpi_shpp_shpitmstotal = '-';\n presentVector.shpi_shpo_disamnt = '-';\n presentVector.or_merpromoamnt = '-';\n presentVector.or_disshpamnt = '-';\n presentVector.or_ogshpamnt = '-';\n presentVector.or_tax_est = '-';\n presentVector.or_tax_taxrt = '-';\n presentVector.or_tax_tax = '-';\n presentVector.or_totalsur = '-';\n presentVector.or_totaltaxfree = '-';\n presentVector.or_totalkcpromodis = '-';\n presentVector.or_totaltax = '-';\n presentVector.or_total = '-';\n presentVector.or_savings = '-';\n presentVector.or_taxfeeen = '-';\n\n presentVector.removed_sku = '-';\n presentVector.updated_sku = '-';\n presentVector.updated_sku_qty = '-';\n\n presentVector.prod_sku_count = '-';\n presentVector.sku_reg_price = '-';\n presentVector.sku_per_dis = '-';\n presentVector.sku_bopus_avail = '-';\n presentVector.sku_boss_avail = '-';\n presentVector.sku_ship_avail = '-';\n\n presentVector.filter_by_count = '-';\n presentVector.sort_by = '-';\n\n presentVector.pgdata_proddet_catname = '-';\n presentVector.pgdata_proddet_subcatname = '-';\n presentVector.pgdata_proddet_deptname = '-';\n\n presentVector.selected_prd_id = '-';\n\n presentVector.rto_data = '-';\n\n if (evtName.toLocaleLowerCase() == '_ws_completeshipping') {\n if (typeof pageData != 'undefined') {\n presentVector.customerState = (pageData.customerDetails && pageData.customerDetails.customerState) || '-';\n presentVector.customerPostalCode = (pageData.customerDetails && pageData.customerDetails.customerPostalCode) || '-'; \n }\n presentVector.userPFM = getUrlParameter('userPFM') || '-';\n }\n\n if (debugScr) console.log(\"presentVector:\" + JSON.stringify(presentVector));\n\n //viewedhome/viewedcart do not require additional processing\n //addedtobag/placedorder have seperate tags\n\n return presentVector;\n } catch (ie) {\n console.log('[ZineOne getPresentVector] : ' + ie);\n }\n }\n\n\n function updateUserVectors() {\n try {\n\n console.log('Into updateUserVectors');\n var presentVector = getPresentVector();\n var previousVector = JSON.parse(localStorage.getItem('z1_previousVector'));\n var z1_sessionStart_ts = JSON.parse(localStorage.getItem('z1_sessionStart_ts'));\n\n var z1_features = localStorage.getItem('z1_features') || \"\";\n //Check if local Storage has userVector available\n var userVectors = JSON.parse(localStorage.getItem('z1_userVectors'));\n var newUserVectors = JSON.parse(localStorage.getItem('z1_newUserVectors'));\n\n //Updated the logic to send the Sequence if diff between present and previous event is more than 10 mins\n //if(previousVector && previousVector.time && previousVector.time < z1_sessionStart_ts){\n if (previousVector && previousVector.time && presentVector && presentVector.time && Number(presentVector.time) - Number(previousVector.time) > SESSION_GAP) {\n console.log(\"New Session has started since the last Event\");\n //Changes to visitGap for gap between n-1 and nth session\n var visitGap = localStorage.getItem('visitGap');\n //Check if null or undefined\n if (!visitGap || typeof visitGap == undefined || visitGap == 'undefined') {\n visitGap = '';\n }\n\n try\n {\n var oldSessionStartTime = userVectors.timeVector.toString().split('|')[0];\n\n\n var vectorsEventData = {};\n\n vectorsEventData = onceInSessionAttributes(vectorsEventData);\n\n\n var cartDump = fetchCartDump();\n\n if(validateForNotNull(cartDump))\n {\n cartDump = JSON.parse(cartDump);\n\n var cartKeys = Object.keys(cartDump);\n for(var k=0;k<cartKeys.length;k++)\n {\n vectorsEventData[cartKeys[k]] = JSON.stringify(cartDump[cartKeys[k]]);\n }\n }\n\n \n vectorsEventData.z1_userVectors = JSON.stringify(userVectors);\n vectorsEventData.z1_features = z1_features;\n vectorsEventData.visitGap = visitGap;\n vectorsEventData.session_start_time = presentVector.time;\n vectorsEventData.old_session_start_time = oldSessionStartTime;\n\n\n if(validateForNotNull(newUserVectors))\n {\n var newVectorKeys = Object.keys(newUserVectors);\n for(var k=0;k<newVectorKeys.length;k++)\n {\n vectorsEventData[newVectorKeys[k]] = newUserVectors[newVectorKeys[k]];\n }\n }\n\n ZineOne.pushEvent('_ws_updatevectors', vectorsEventData);\n }\n catch (ieInner) {\n\n var errorObj = {};\n errorObj.p1 = ieInner.message;\n errorObj.p2 = 'completeShipping';\n\n ZineOne.pushEvent('_ws_logs', errorObj);\n\n }\n\n\n localStorage.setItem('visitGap', Number(presentVector.time) - Number(previousVector.time));\n localStorage.removeItem('z1_userVectors');\n localStorage.removeItem('z1_features');\n console.log(\"z1_userVectors removed from local storage\");\n userVectors = null;\n newUserVectors = null;\n }\n\n if (!userVectors) {\n userVectors = {};\n userVectors.eventVector = presentVector.event;\n userVectors.timeVector = presentVector.time;\n userVectors.productVector = presentVector.productID;\n userVectors.originalPrice = presentVector.originalPrice;\n userVectors.salePrice = presentVector.salePrice;\n userVectors.PDPCategory = presentVector.PDPCategory;\n userVectors.CN = presentVector.CN;\n userVectors.itemsInBag = presentVector.itemsInBag;\n\n newUserVectors = {};\n newUserVectors.pgdata_pmpdet_catname = presentVector.pgdata_pmpdet_catname;\n newUserVectors.pgdata_pmpdet_subcatname = presentVector.pgdata_pmpdet_subcatname;\n newUserVectors.pgdata_pmpdet_findingname = presentVector.pgdata_pmpdet_findingname;\n newUserVectors.pgdata_pmpdet_cat_keywords = presentVector.pgdata_pmpdet_cat_keywords;\n newUserVectors.pgdata_pmpdet_pgfilter = presentVector.pgdata_pmpdet_pgfilter;\n newUserVectors.pgdata_pmpdet_deptname = presentVector.pgdata_pmpdet_deptname;\n newUserVectors.pgdata_pmpdet_gendervalues = presentVector.pgdata_pmpdet_gendervalues;\n newUserVectors.pgdata_pmpdet_search_keywords = presentVector.pgdata_pmpdet_search_keywords;\n newUserVectors.pgdata_proddet_colid = presentVector.pgdata_proddet_colid;\n newUserVectors.pgdata_pddetails_clientpostalcode = presentVector.pgdata_pddetails_clientpostalcode;\n newUserVectors.selected_sku_color = presentVector.selected_sku_color;\n newUserVectors.selected_sku_size = presentVector.selected_sku_size;\n newUserVectors.selected_sku = presentVector.selected_sku;\n //newUserVectors.selected_sku_regular_price = presentVector.selected_sku_regular_price;\n newUserVectors.selected_sku_sale_price = presentVector.selected_sku_sale_price;\n\n\n\n newUserVectors.c_i_size = presentVector.c_i_size;\n newUserVectors.c_i_color = presentVector.c_i_color;\n newUserVectors.c_i_isweb = presentVector.c_i_isweb;\n newUserVectors.c_sclearance = presentVector.c_sclearance;\n newUserVectors.c_i_shipavailable = presentVector.c_i_shipavailable;\n newUserVectors.c_i_bopusAval = presentVector.c_i_bopusAval;\n newUserVectors.c_i_bossAval = presentVector.c_i_bossAval;\n newUserVectors.c_i_invShip = presentVector.c_i_invShip;\n newUserVectors.c_i_invBopus = presentVector.c_i_invBopus;\n newUserVectors.c_i_invBoss = presentVector.c_i_invBoss;\n newUserVectors.c_o_offDis = presentVector.c_o_offDis;\n newUserVectors.c_o_sdate = presentVector.c_o_sdate;\n newUserVectors.c_o_edate = presentVector.c_o_edate;\n newUserVectors.c_p_type = presentVector.c_p_type;\n newUserVectors.c_p_ptext = presentVector.c_p_ptext;\n newUserVectors.shpi_shpp_ogshpchrgs = presentVector.shpi_shpp_ogshpchrgs;\n newUserVectors.shpi_shpp_shpchrgsafdis = presentVector.shpi_shpp_shpchrgsafdis;\n newUserVectors.shpi_shpp_freeshpqlfdelta = presentVector.shpi_shpp_freeshpqlfdelta;\n newUserVectors.shpi_shpp_shpitmstotal = presentVector.shpi_shpp_shpitmstotal;\n newUserVectors.shpi_shpo_disamnt = presentVector.shpi_shpo_disamnt;\n newUserVectors.or_merpromoamnt = presentVector.or_merpromoamnt;\n newUserVectors.or_disshpamnt = presentVector.or_disshpamnt;\n newUserVectors.or_ogshpamnt = presentVector.or_ogshpamnt;\n newUserVectors.or_tax_est = presentVector.or_tax_est;\n newUserVectors.or_tax_taxrt = presentVector.or_tax_taxrt;\n newUserVectors.or_tax_tax = presentVector.or_tax_tax;\n newUserVectors.or_totalsur = presentVector.or_totalsur;\n newUserVectors.or_totaltaxfree = presentVector.or_totaltaxfree;\n newUserVectors.or_totalkcpromodis = presentVector.or_totalkcpromodis;\n newUserVectors.or_totaltax = presentVector.or_totaltax;\n newUserVectors.or_total = presentVector.or_total;\n newUserVectors.or_savings = presentVector.or_savings;\n newUserVectors.or_taxfeeen = presentVector.or_taxfeeen;\n\n newUserVectors.removed_sku = presentVector.removed_sku;\n newUserVectors.updated_sku = presentVector.updated_sku;\n newUserVectors.updated_sku_qty = presentVector.updated_sku_qty;\n\n newUserVectors.prod_sku_count = presentVector.prod_sku_count;\n newUserVectors.sku_reg_price = presentVector.sku_reg_price;\n newUserVectors.sku_per_dis = presentVector.sku_per_dis;\n newUserVectors.sku_bopus_avail = presentVector.sku_bopus_avail;\n newUserVectors.sku_boss_avail = presentVector.sku_boss_avail;\n newUserVectors.sku_ship_avail = presentVector.sku_ship_avail;\n\n newUserVectors.filter_by_count = presentVector.filter_by_count;\n newUserVectors.sort_by = presentVector.sort_by;\n\n newUserVectors.pgdata_proddet_catname = presentVector.pgdata_proddet_catname;\n newUserVectors.pgdata_proddet_subcatname = presentVector.pgdata_proddet_subcatname;\n newUserVectors.pgdata_proddet_deptname = presentVector.pgdata_proddet_deptname;\n\n newUserVectors.selected_prd_id = presentVector.selected_prd_id;\n\n newUserVectors.rto_data = presentVector.rto_data;\n\n } else {\n userVectors.eventVector = userVectors.eventVector + '|' + presentVector.event;\n userVectors.timeVector = userVectors.timeVector + '|' + presentVector.time;\n userVectors.productVector = userVectors.productVector + '|' + presentVector.productID;\n userVectors.originalPrice = userVectors.originalPrice + '|' + presentVector.originalPrice;\n userVectors.salePrice = userVectors.salePrice + '|' + presentVector.salePrice;\n userVectors.PDPCategory = userVectors.PDPCategory + '|' + presentVector.PDPCategory;\n userVectors.CN = userVectors.CN + '|' + presentVector.CN;\n userVectors.itemsInBag = userVectors.itemsInBag + '|' + presentVector.itemsInBag;\n\n newUserVectors.pgdata_pmpdet_catname = newUserVectors.pgdata_pmpdet_catname + '|' + presentVector.pgdata_pmpdet_catname;\n newUserVectors.pgdata_pmpdet_subcatname = newUserVectors.pgdata_pmpdet_subcatname + '|' + presentVector.pgdata_pmpdet_subcatname;\n newUserVectors.pgdata_pmpdet_findingname = newUserVectors.pgdata_pmpdet_findingname + '|' + presentVector.pgdata_pmpdet_findingname;\n newUserVectors.pgdata_pmpdet_cat_keywords = newUserVectors.pgdata_pmpdet_cat_keywords + '|' + presentVector.pgdata_pmpdet_cat_keywords;\n newUserVectors.pgdata_pmpdet_pgfilter = newUserVectors.pgdata_pmpdet_pgfilter + '|' + presentVector.pgdata_pmpdet_pgfilter;\n newUserVectors.pgdata_pmpdet_deptname = newUserVectors.pgdata_pmpdet_deptname + '|' + presentVector.pgdata_pmpdet_deptname;\n newUserVectors.pgdata_pmpdet_gendervalues = newUserVectors.pgdata_pmpdet_gendervalues + '|' + presentVector.pgdata_pmpdet_gendervalues;\n newUserVectors.pgdata_pmpdet_search_keywords = newUserVectors.pgdata_pmpdet_search_keywords + '|' + presentVector.pgdata_pmpdet_search_keywords;\n newUserVectors.pgdata_proddet_colid = newUserVectors.pgdata_proddet_colid + '|' + presentVector.pgdata_proddet_colid;\n newUserVectors.pgdata_pddetails_clientpostalcode = newUserVectors.pgdata_pddetails_clientpostalcode + '|' + presentVector.pgdata_pddetails_clientpostalcode;\n newUserVectors.selected_sku_color = newUserVectors.selected_sku_color + '|' + presentVector.selected_sku_color;\n newUserVectors.selected_sku_size = newUserVectors.selected_sku_size + '|' + presentVector.selected_sku_size;\n newUserVectors.selected_sku = newUserVectors.selected_sku + '|' + presentVector.selected_sku;\n //newUserVectors.selected_sku_regular_price = newUserVectors.selected_sku_regular_price + '|' + presentVector.selected_sku_regular_price;\n newUserVectors.selected_sku_sale_price = newUserVectors.selected_sku_sale_price + '|' + presentVector.selected_sku_sale_price;\n\n\n newUserVectors.c_i_size = newUserVectors.c_i_size + '|' + presentVector.c_i_size;\n newUserVectors.c_i_color = newUserVectors.c_i_color + '|' + presentVector.c_i_color;\n newUserVectors.c_i_isweb = newUserVectors.c_i_isweb + '|' + presentVector.c_i_isweb;\n newUserVectors.c_sclearance = newUserVectors.c_sclearance + '|' + presentVector.c_sclearance;\n newUserVectors.c_i_shipavailable = newUserVectors.c_i_shipavailable + '|' + presentVector.c_i_shipavailable;\n newUserVectors.c_i_bopusAval = newUserVectors.c_i_bopusAval + '|' + presentVector.c_i_bopusAval;\n newUserVectors.c_i_bossAval = newUserVectors.c_i_bossAval + '|' + presentVector.c_i_bossAval;\n newUserVectors.c_i_invShip = newUserVectors.c_i_invShip + '|' + presentVector.c_i_invShip;\n newUserVectors.c_i_invBopus = newUserVectors.c_i_invBopus + '|' + presentVector.c_i_invBopus;\n newUserVectors.c_i_invBoss = newUserVectors.c_i_invBoss + '|' + presentVector.c_i_invBoss;\n newUserVectors.c_o_offDis = newUserVectors.c_o_offDis + '|' + presentVector.c_o_offDis;\n newUserVectors.c_o_sdate = newUserVectors.c_o_sdate + '|' + presentVector.c_o_sdate;\n newUserVectors.c_o_edate = newUserVectors.c_o_edate + '|' + presentVector.c_o_edate;\n newUserVectors.c_p_type = newUserVectors.c_p_type + '|' + presentVector.c_p_type;\n newUserVectors.c_p_ptext = newUserVectors.c_p_ptext + '|' + presentVector.c_p_ptext;\n newUserVectors.shpi_shpp_ogshpchrgs = newUserVectors.shpi_shpp_ogshpchrgs + '|' + presentVector.shpi_shpp_ogshpchrgs;\n newUserVectors.shpi_shpp_shpchrgsafdis = newUserVectors.shpi_shpp_shpchrgsafdis + '|' + presentVector.shpi_shpp_shpchrgsafdis;\n newUserVectors.shpi_shpp_freeshpqlfdelta = newUserVectors.shpi_shpp_freeshpqlfdelta + '|' + presentVector.shpi_shpp_freeshpqlfdelta;\n newUserVectors.shpi_shpp_shpitmstotal = newUserVectors.shpi_shpp_shpitmstotal + '|' + presentVector.shpi_shpp_shpitmstotal;\n newUserVectors.shpi_shpo_disamnt = newUserVectors.shpi_shpo_disamnt + '|' + presentVector.shpi_shpo_disamnt;\n newUserVectors.or_merpromoamnt = newUserVectors.or_merpromoamnt + '|' + presentVector.or_merpromoamnt;\n newUserVectors.or_disshpamnt = newUserVectors.or_disshpamnt + '|' + presentVector.or_disshpamnt;\n newUserVectors.or_ogshpamnt = newUserVectors.or_ogshpamnt + '|' + presentVector.or_ogshpamnt;\n newUserVectors.or_tax_est = newUserVectors.or_tax_est + '|' + presentVector.or_tax_est;\n newUserVectors.or_tax_taxrt = newUserVectors.or_tax_taxrt + '|' + presentVector.or_tax_taxrt;\n newUserVectors.or_tax_tax = newUserVectors.or_tax_tax + '|' + presentVector.or_tax_tax;\n newUserVectors.or_totalsur = newUserVectors.or_totalsur + '|' + presentVector.or_totalsur;\n newUserVectors.or_totaltaxfree = newUserVectors.or_totaltaxfree + '|' + presentVector.or_totaltaxfree;\n newUserVectors.or_totalkcpromodis = newUserVectors.or_totalkcpromodis + '|' + presentVector.or_totalkcpromodis;\n newUserVectors.or_totaltax = newUserVectors.or_totaltax + '|' + presentVector.or_totaltax;\n newUserVectors.or_total = newUserVectors.or_total + '|' + presentVector.or_total;\n newUserVectors.or_savings = newUserVectors.or_savings + '|' + presentVector.or_savings;\n newUserVectors.or_taxfeeen = newUserVectors.or_taxfeeen + '|' + presentVector.or_taxfeeen;\n\n newUserVectors.removed_sku = newUserVectors.removed_sku + '|' + presentVector.removed_sku;\n newUserVectors.updated_sku = newUserVectors.updated_sku + '|' + presentVector.updated_sku;\n newUserVectors.updated_sku_qty = newUserVectors.updated_sku_qty + '|' + presentVector.updated_sku_qty;\n\n newUserVectors.prod_sku_count = newUserVectors.prod_sku_count + '|' + presentVector.prod_sku_count;\n newUserVectors.sku_reg_price = newUserVectors.sku_reg_price + '|' + presentVector.sku_reg_price;\n newUserVectors.sku_per_dis = newUserVectors.sku_per_dis + '|' + presentVector.sku_per_dis;\n newUserVectors.sku_bopus_avail = newUserVectors.sku_bopus_avail + '|' + presentVector.sku_bopus_avail;\n newUserVectors.sku_boss_avail = newUserVectors.sku_boss_avail + '|' + presentVector.sku_boss_avail;\n newUserVectors.sku_ship_avail = newUserVectors.sku_ship_avail + '|' + presentVector.sku_ship_avail;\n\n\n newUserVectors.filter_by_count = newUserVectors.filter_by_count + '|' + presentVector.filter_by_count;\n newUserVectors.sort_by = newUserVectors.sort_by + '|' + presentVector.sort_by;\n\n newUserVectors.pgdata_proddet_catname = newUserVectors.pgdata_proddet_catname + '|' + presentVector.pgdata_proddet_catname;\n newUserVectors.pgdata_proddet_subcatname = newUserVectors.pgdata_proddet_subcatname + '|' + presentVector.pgdata_proddet_subcatname;\n newUserVectors.pgdata_proddet_deptname = newUserVectors.pgdata_proddet_deptname + '|' + presentVector.pgdata_proddet_deptname;\n\n newUserVectors.selected_prd_id = newUserVectors.selected_prd_id + '|' + presentVector.selected_prd_id;\n\n newUserVectors.rto_data = newUserVectors.rto_data + '|' + presentVector.rto_data;\n\n\n }\n localStorage.setItem('z1_userVectors', JSON.stringify(userVectors));\n localStorage.setItem('z1_newUserVectors', JSON.stringify(newUserVectors));\n\n updateFeatures();\n\n //Update the previousVector\n previousVector = presentVector;\n localStorage.setItem('z1_previousVector', JSON.stringify(previousVector));\n\n //Send the Sequence on 5th and 10th Element as well\n //Fetch the updated features as they are updated \n var z1_features = localStorage.getItem('z1_features') || \"\";\n //If this is the 5th Element, send the features and vectors\n if (userVectors && userVectors.eventVector && userVectors.eventVector.split('|').length == 5) {\n console.log(\"The sequence is 5 element long\");\n //Changes to visitGap for gap between n-1 and nth session\n var visitGap = localStorage.getItem('visitGap');\n //Check if null or undefined\n if (!visitGap || typeof visitGap == undefined || visitGap == 'undefined') {\n visitGap = '';\n }\n\n var currentSessionStartTime = userVectors.timeVector.toString().split('|')[0];\n\n\n var vectorsEventData = {};\n\n var newVectorKeys = Object.keys(newUserVectors);\n for(var k=0;k<newVectorKeys.length;k++)\n {\n vectorsEventData[newVectorKeys[k]] = newUserVectors[newVectorKeys[k]];\n }\n\n vectorsEventData.z1_userVectors = JSON.stringify(userVectors);\n vectorsEventData.z1_features = z1_features;\n vectorsEventData.cartValue= cartValue;\n vectorsEventData.session_start_time = currentSessionStartTime;\n vectorsEventData.visitGap = visitGap;\n\n if(validateForNotNull(pageData) && validateForNotNull(pageData.customerDetails) && validateForNotNull(pageData.customerDetails.customerHasKohlsCharge))\n {\n vectorsEventData.isKcc = pageData.customerDetails.customerHasKohlsCharge;\n }\n else\n {\n vectorsEventData.isKcc = -1;\n }\n\n if (validateForNotNull(pageData) && validateForNotNull(pageData.customerDetails) && validateForNotNull(pageData.customerDetails.kohlsLoyalty2018EliteMember)) {\n vectorsEventData.kohlsLoyalty2018EliteMember = pageData.customerDetails.kohlsLoyalty2018EliteMember;\n } else {\n vectorsEventData.kohlsLoyalty2018EliteMember = -1;\n }\n\n if (validateForNotNull(pageData) && validateForNotNull(pageData.customerDetails) && validateForNotNull(pageData.customerDetails.kohlsLoyalty2018Member)) {\n vectorsEventData.kohlsLoyalty2018Member = pageData.customerDetails.kohlsLoyalty2018Member;\n } else {\n vectorsEventData.kohlsLoyalty2018Member = -1;\n }\n \n vectorsEventData.mcmId = fetchMcmId();\n\n ZineOne.pushEvent('_ws_updatevectors_len5', vectorsEventData);\n } else if (userVectors && userVectors.eventVector && userVectors.eventVector.split('|').length == 10) {\n console.log(\"The sequence is 10 element long\");\n //Changes to visitGap for gap between n-1 and nth session\n var visitGap = localStorage.getItem('visitGap');\n //Check if null or undefined\n if (!visitGap || typeof visitGap == undefined || visitGap == 'undefined') {\n visitGap = '';\n }\n\n var currentSessionStartTime = userVectors.timeVector.toString().split('|')[0];\n\n var vectorsEventData = {};\n\n var newVectorKeys = Object.keys(newUserVectors);\n for(var k=0;k<newVectorKeys.length;k++)\n {\n vectorsEventData[newVectorKeys[k]] = newUserVectors[newVectorKeys[k]];\n }\n\n\n vectorsEventData.z1_userVectors = JSON.stringify(userVectors);\n vectorsEventData.z1_features = z1_features;\n vectorsEventData.session_start_time = currentSessionStartTime;\n vectorsEventData.visitGap = visitGap;\n\n ZineOne.pushEvent('_ws_updatevectors_len10', vectorsEventData);\n }\n\n //If this is the 10th Element, send the features and vectors\n } catch (ie) {\n console.log('[ZineOne updateUserVectors] : ' + ie);\n }\n }\n\n function updateFeatures() {\n\n console.log('Into updateFeatures');\n /* z1_features is stored in local storage which holds following stats\n ** n Total number of events in visit\n ** A Total number of addedtobag events in the visit\n ** B Total number of breachedgeofence events in the visit\n ** C Total number of continuedcheckout events in the visit\n ** D Total number of exitgeofence events in the visit\n ** E Total number of placedorder events in the visit\n ** F Total number of searched events in the visit\n ** G Total number of startedcheckout events in the visit\n ** H Total number of viewedcart events in the visit\n ** I Total number of viewedcatalog events in the visit\n ** J Total number of viewedhome events in the visit\n ** K Total number of viewedproduct events in the visit\n ** p Total number of evented pages loaded in visit\n */\n\n var z1_features = localStorage.getItem('z1_features');\n if (!z1_features) {\n z1_features = \"0|0|0|0|0|0|0|0|0|0|0|0|0|0\";\n }\n\n z1_features_arr = z1_features.split('|');\n\n z1_features_arr[0] = Number(z1_features_arr[0]) + 1; //n\n\n if (evtName.toLocaleLowerCase() == '_ws_addedtobag') {\n z1_features_arr[1] = Number(z1_features_arr[1]) + 1;\n } else if (evtName.toLocaleLowerCase() == 'breachedgeofence') {\n z1_features_arr[2] = Number(z1_features_arr[2]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_completeshipping') {\n z1_features_arr[3] = Number(z1_features_arr[3]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == 'exitgeofence') {\n z1_features_arr[4] = Number(z1_features_arr[4]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_placedorder') {\n z1_features_arr[5] = Number(z1_features_arr[5]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_searched') {\n z1_features_arr[6] = Number(z1_features_arr[6]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_startedcheckout') {\n z1_features_arr[7] = Number(z1_features_arr[7]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_viewedcart') {\n z1_features_arr[8] = Number(z1_features_arr[8]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_viewedcatalog') {\n z1_features_arr[9] = Number(z1_features_arr[9]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_viewedhome') {\n z1_features_arr[10] = Number(z1_features_arr[10]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_viewedproduct') {\n z1_features_arr[11] = Number(z1_features_arr[11]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_completepayment') {\n z1_features_arr[13] = Number(z1_features_arr[13]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n }\n\n z1_features = z1_features_arr[0] + '|' + z1_features_arr[1] + '|' + z1_features_arr[2] + '|' + z1_features_arr[3] + '|' + z1_features_arr[4] + '|' + z1_features_arr[5] + '|' + z1_features_arr[6] + '|' + z1_features_arr[7] + '|' + z1_features_arr[8] + '|' + z1_features_arr[9] + '|' + z1_features_arr[10] + '|' + z1_features_arr[11] + '|' + z1_features_arr[12] + '|' + z1_features_arr[13];\n localStorage.setItem('z1_features', z1_features);\n }\n\n\n\n\n\n var isSoftLoggedIn = getCookie(\"SoftLoggedInCookie\");\n if (isSoftLoggedIn && isSoftLoggedIn.includes(\"true\")) {\n if (debugScr) console.log(\"[ZineOne] Soft Logged value is:\" + isSoftLoggedIn);\n }\n // Set HardLoggedIn = true only if user is not SoftLoggedIn\n var isLoggedIn = \"\";\n\n\n if (pageData && pageData.customerDetails) {\n if (!isSoftLoggedIn || (isSoftLoggedIn && !isSoftLoggedIn.includes(\"true\"))) {\n if (pageData.customerDetails.isLoggedIn) isLoggedIn = \"true\";\n }\n }\n\n\n\n ZineOne.pushEvent(evtName, {});\n\n updateUserVectors();\n\n\n\n} catch (ie) {\n\nif (debugScr) console.log(\"[Zineone] Error in Tag Script: WebStore Z1 tag. \" + ie);\n\n}","eventName":"click","pageSelector":{"type":"pgName","condition":"ends","val":"checkout/v2/checkout.jsp"},"domSelector":{"type":"class","val":"button_continueToPayment"}},{"tagName":"completePayment","actionType":"z1script","script":"try {\n var debugScr = true;\n var cartValue = 0;\n\n if (debugScr) console.log(\"[ZineOne] addtobag Event will be triggered\");\n\n var evtName = \"_ws_completePayment\";\n\n //Event Codes for vectors:\n var eventCodes = {\n _ws_addedtobag: \"A\",\n breachedgeofence: \"B\",\n _ws_completeshipping: \"C\",\n exitgeofence: \"D\",\n _ws_placedorder: \"E\",\n _ws_searched: \"F\",\n _ws_startedcheckout: \"G\",\n _ws_viewedcart: \"H\",\n _ws_viewedcatalog: \"I\",\n _ws_viewedhome: \"J\",\n _ws_viewedproduct: \"K\",\n _ws_completepayment: \"L\",\n _ws_viewedsku: \"M\",\n _ws_update_hcart: \"N\",\n _ws_changedsort: \"O\",\n _ws_rto: \"R\"\n };\n var SESSION_GAP = 1800000; //30min = 30*60*1000 millis\n\n function isValid(value) {\n if (value == \"null\" || value == \"undefined\" || value == null || value == undefined) {\n return false;\n }\n\n return true;\n }\n\n\n\n function getUrlParameter(sParam) {\n var sPageURL = decodeURIComponent(window.location.search.substring(1)),\n sURLVariables = sPageURL.split('&'),\n sParameterName,\n i;\n\n for (i = 0; i < sURLVariables.length; i++) {\n sParameterName = sURLVariables[i].split('=');\n\n if (sParameterName[0] === sParam) {\n return sParameterName[1] === undefined ? true : sParameterName[1];\n }\n }\n }\n\n function validateForNotNull(obj)\n {\n //console.log('validateForNotNull',obj,typeof(obj));\n if(!(obj === undefined) && obj != null && obj != 'null' && obj.toString().length != 0)\n {\n return true;\n }\n\n return false;\n }\n\n function spltArrayObjectDataIntoVector(array,attribute)\n {\n var stringVector = '';\n\n console.log(\"spltArrayObjectDataIntoVector attribute\",attribute,array);\n\n if (!validateForNotNull(array)) {\n\n return stringVector;\n\n }\n\n if(array.length == 0)\n {\n return stringVector;\n }\n\n\n for(var i=0;i<array.length;i++)\n {\n var innerObj = array[i];\n\n var attributeValue = '#';\n if (validateForNotNull(innerObj) && validateForNotNull(innerObj[attribute])) {\n\n attributeValue = innerObj[attribute];\n\n }\n \n\n stringVector = stringVector + attributeValue + '^';\n }\n\n stringVector = stringVector.substring(0,stringVector.length-1);\n\n return stringVector;\n\n }\n\n function spltArrayObjectWithArrayObjectDataIntoVector(array,mainAttribute,innerAttribute)\n {\n var stringVector = '';\n\n console.log(\"spltArrayObjectWithArrayObjectDataIntoVector mainAttribute\",mainAttribute,innerAttribute,array);\n\n\n if (!validateForNotNull(array)) {\n\n return stringVector;\n\n }\n\n if(array.length == 0)\n {\n return stringVector;\n }\n\n\n for(var i=0;i<array.length;i++)\n {\n var innerObj = array[i];\n var attributeValueArr = innerObj[mainAttribute];\n\n console.log('spltArrayObjectDataIntoVector ',spltArrayObjectDataIntoVector(attributeValueArr,innerAttribute));\n stringVector = stringVector + spltArrayObjectDataIntoVector(attributeValueArr,innerAttribute) + '^';\n }\n\n stringVector = stringVector.substring(0,stringVector.length-1);\n\n return stringVector;\n\n }\n\n\n function spltArrayObjectWithAttributeObjectDataIntoVector(array,mainAttribute,innerAttribute)\n {\n\n var stringVector = '';\n\n if (!validateForNotNull(array)) {\n\n return stringVector;\n\n }\n\n if(array.length == 0)\n {\n return stringVector;\n }\n\n for(var i=0;i<array.length;i++)\n {\n var innerObj = array[i];\n\n var attributeValue = '-';\n if (validateForNotNull(innerObj) && validateForNotNull(innerObj[mainAttribute]) && validateForNotNull(innerObj[mainAttribute][innerAttribute])) {\n\n attributeValue = innerObj[mainAttribute][innerAttribute];\n\n }\n \n\n stringVector = stringVector + attributeValue + '~';\n }\n\n stringVector = stringVector.substring(0,stringVector.length-1);\n\n return stringVector;\n\n }\n\n function fetchCartDump()\n {\n\n var persistLocalData = localStorage.getItem('persistent_bar_components_json_v1');\n\n if(!isValid(persistLocalData)){\n persistLocalData = JSON.stringify(Kjs.PB.getPbCartStorage());\n }\n\n if (validateForNotNull(persistLocalData)) {\n\n var finalCartJSON = {};\n finalCartJSON.cartItems = [];\n\n persistLocalData = JSON.parse(persistLocalData);\n\n cartData = persistLocalData.cartItems;\n\n if(validateForNotNull(cartData))\n {\n for(var i=0;i<cartData.length;i++)\n {\n if(i == 15)\n {\n break;\n }\n\n var currentFinalObjToSend = {};\n\n var currentObj = cartData[i];\n currentFinalObjToSend.sku = currentObj.skuId;\n currentFinalObjToSend.prdId = currentObj.productId;\n currentFinalObjToSend.qty = currentObj.quantity;\n\n if(validateForNotNull(currentObj.storeClearance))\n {\n currentFinalObjToSend.sc = currentObj.storeClearance; \n }\n \n if(validateForNotNull(currentObj.itemProperties.size))\n {\n currentFinalObjToSend.size = currentObj.itemProperties.size;\n }\n \n if(validateForNotNull(currentObj.itemProperties.color))\n {\n currentFinalObjToSend.color = currentObj.itemProperties.color;\n }\n \n if(validateForNotNull(currentObj.itemProperties.isWebExclusive))\n {\n currentFinalObjToSend.isWebExcl = currentObj.itemProperties.isWebExclusive; \n }\n \n\n var finalInvInfo = {};\n\n if(validateForNotNull(currentObj.inventoryInfo.shipAvailable))\n {\n finalInvInfo.shpAvai = currentObj.inventoryInfo.shipAvailable;\n }\n\n if(validateForNotNull(currentObj.inventoryInfo.bopusAvailable))\n {\n finalInvInfo.bopAvail = currentObj.inventoryInfo.bopusAvailable; \n }\n \n if(validateForNotNull(currentObj.inventoryInfo.bossAvailable))\n {\n finalInvInfo.bosAvail = currentObj.inventoryInfo.bossAvailable; \n }\n \n if(validateForNotNull(currentObj.inventoryInfo.invOnHandQtyShip))\n {\n finalInvInfo.invOHQShip = currentObj.inventoryInfo.invOnHandQtyShip; \n }\n \n if(validateForNotNull(currentObj.finalInvInfo))\n {\n currentFinalObjToSend.invInfo = currentObj.finalInvInfo; \n }\n \n\n var currentPromoInfo = currentObj.promoInfo;\n\n console.log(' currentPromoInfo ',currentPromoInfo);\n\n if(validateForNotNull(currentPromoInfo))\n {\n var finalPromoArray = [];\n\n var prTypeArr = [];\n var prTextArr = [];\n\n for(var j=0;j<currentPromoInfo.length;j++)\n {\n var currentPromoObj = currentPromoInfo[j];\n var tempPromoObj = {};\n\n if(validateForNotNull(currentPromoObj.promoType))\n {\n prTypeArr[prTypeArr.length] = currentPromoObj.promoType; \n }\n \n if(validateForNotNull(currentPromoObj.promoText))\n {\n prTextArr[prTextArr.length] = currentPromoObj.promoText; \n }\n \n\n\n }\n\n currentFinalObjToSend.prType = prTypeArr.join('|');\n currentFinalObjToSend.prText = prTextArr.join('|');\n }\n\n \n\n var currentOfferInfo = currentObj.offerInfo;\n\n console.log(' currentOfferInfo ',currentOfferInfo);\n\n if(validateForNotNull(currentOfferInfo))\n {\n var finalOfferInfoArray = [];\n\n for(var j=0;j<currentOfferInfo.length;j++)\n {\n var currentOfferInfoObj = currentOfferInfo[j];\n var tempOfferInfoObj = {};\n\n if(validateForNotNull(currentOfferInfoObj.offerDiscount))\n {\n tempOfferInfoObj.ofDis = currentOfferInfoObj.offerDiscount; \n }\n \n if(validateForNotNull(currentOfferInfoObj.startDate))\n {\n tempOfferInfoObj.stDt = currentOfferInfoObj.startDate; \n }\n \n if(validateForNotNull(currentOfferInfoObj.endDate))\n {\n tempOfferInfoObj.enDT = currentOfferInfoObj.endDate; \n }\n \n\n finalOfferInfoArray[finalOfferInfoArray.length] = tempOfferInfoObj;\n\n }\n\n currentFinalObjToSend.offInfo = finalOfferInfoArray;\n }\n\n\n finalCartJSON.cartItems[finalCartJSON.cartItems.length] = currentFinalObjToSend;\n }\n }\n\n \n\n\n var shipmentInfo = persistLocalData.shipmentInfo;\n\n console.log(' shipmentInfo ',shipmentInfo);\n\n if(validateForNotNull(shipmentInfo))\n {\n var finalshipmentInfoArray = [];\n\n for(var j=0;j<shipmentInfo.length;j++)\n {\n var currentshipmentInfoObj = shipmentInfo[j];\n var tempShipmentInfoObj = {}; \n\n if(validateForNotNull(currentshipmentInfoObj.shipmentPriceInfo.originalShippingCharges))\n {\n tempShipmentInfoObj.ogShpChrgs = currentshipmentInfoObj.shipmentPriceInfo.originalShippingCharges; \n }\n \n if(validateForNotNull(currentshipmentInfoObj.shipmentPriceInfo.shippingChargesAfterDiscount))\n {\n tempShipmentInfoObj.shpChrgsADis = currentshipmentInfoObj.shipmentPriceInfo.shippingChargesAfterDiscount; \n }\n \n if(validateForNotNull(currentshipmentInfoObj.shipmentPriceInfo.freeShipQualificationDelta))\n {\n tempShipmentInfoObj.freeShpQlfDelta = currentshipmentInfoObj.shipmentPriceInfo.freeShipQualificationDelta; \n }\n \n if(validateForNotNull(currentshipmentInfoObj.shipmentPriceInfo.shipmentItemsTotal))\n {\n tempShipmentInfoObj.shpItmsTot = currentshipmentInfoObj.shipmentPriceInfo.shipmentItemsTotal; \n }\n \n\n\n var shippingOffers = currentshipmentInfoObj.shippingOffers;\n if(validateForNotNull(shippingOffers))\n {\n var finalshippingOfferArray = [];\n\n for(var k=0;k<shippingOffers.length;k++)\n {\n var currentshippingOffersObj = shippingOffers[k];\n\n if(validateForNotNull(currentshippingOffersObj.discountAmount))\n {\n finalshippingOfferArray[finalshippingOfferArray.length] = currentshippingOffersObj.discountAmount; \n }\n \n }\n\n\n tempShipmentInfoObj.disAmnt = finalshippingOfferArray.join('|');\n\n\n }\n\n finalshipmentInfoArray[finalshipmentInfoArray.length] = tempShipmentInfoObj;\n\n\n }\n\n finalCartJSON.shipmentInfo = finalshipmentInfoArray;\n }\n\n var orderSummary = persistLocalData.orderSummary; \n\n var finalOrderSummaryObj = {};\n\n if(validateForNotNull(orderSummary.merchandisePromoAmount))\n {\n finalOrderSummaryObj.merProAmnt = orderSummary.merchandisePromoAmount; \n }\n \n if(validateForNotNull(orderSummary.discountedShippingAmount))\n {\n finalOrderSummaryObj.disShpAmnt = orderSummary.discountedShippingAmount;\n }\n \n if(validateForNotNull(orderSummary.originalShippingAmount))\n {\n finalOrderSummaryObj.ogShpAmnt = orderSummary.originalShippingAmount; \n }\n \n if(validateForNotNull(orderSummary.tax) && validateForNotNull(orderSummary.tax.estimated))\n {\n finalOrderSummaryObj.taxest = orderSummary.tax.estimated; \n }\n \n if(validateForNotNull(orderSummary.tax) && validateForNotNull(orderSummary.tax.taxRate))\n {\n finalOrderSummaryObj.taxRate = orderSummary.tax.taxRate; \n }\n \n if(validateForNotNull(orderSummary.tax) && validateForNotNull(orderSummary.tax.tax))\n {\n finalOrderSummaryObj.tax = orderSummary.tax.tax; \n }\n \n if(validateForNotNull(orderSummary.totalSurcharges))\n {\n finalOrderSummaryObj.totSurgs = orderSummary.totalSurcharges; \n }\n \n if(validateForNotNull(orderSummary.totalTaxFee))\n {\n finalOrderSummaryObj.totTaxFee = orderSummary.totalTaxFee; \n }\n \n if(validateForNotNull(orderSummary.totalKohlsCashAndPromoDiscounts))\n {\n finalOrderSummaryObj.totKCAProDis = orderSummary.totalKohlsCashAndPromoDiscounts; \n }\n \n if(validateForNotNull(orderSummary.totalTax))\n {\n finalOrderSummaryObj.totTax = orderSummary.totalTax; \n }\n \n if(validateForNotNull(orderSummary.total))\n {\n finalOrderSummaryObj.total = orderSummary.total; \n }\n \n if(validateForNotNull(orderSummary.savings))\n {\n finalOrderSummaryObj.sav = orderSummary.savings; \n }\n \n if(validateForNotNull(orderSummary.taxFeeEnabled))\n {\n finalOrderSummaryObj.taxFeeE = orderSummary.taxFeeEnabled; \n }\n\n finalCartJSON.orderSummary = finalOrderSummaryObj;\n\n return JSON.stringify(finalCartJSON);\n\n }\n\n return null;\n\n\n }\n\n\n function onceInSessionAttributes(eventData) {\n var finalReturnObj = eventData;\n\n var persistLocalData = localStorage.getItem('persistent_bar_components_json_v1');\n\n if(!isValid(persistLocalData)){\n persistLocalData = JSON.stringify(Kjs.PB.getPbCartStorage());\n }\n\n if (validateForNotNull(persistLocalData)) {\n\n var pageDataJson = pageData;\n persistLocalData = JSON.parse(persistLocalData);\n\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.incentiveAmount)) {\n finalReturnObj.incdet_incamnt = persistLocalData.incentiveDetails.incentiveAmount;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.incentiveType)) {\n finalReturnObj.incdet_inctype = persistLocalData.incentiveDetails.incentiveType;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.smartIncentiveStatus)) {\n finalReturnObj.incdet_smartincstatus = persistLocalData.incentiveDetails.smartIncentiveStatus;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.incentiveThreshold)) {\n finalReturnObj.incdet_incthreshold = persistLocalData.incentiveDetails.incentiveThreshold;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.incentiveEligible)) {\n finalReturnObj.incdet_inceligible = persistLocalData.incentiveDetails.incentiveEligible;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.incentiveQualified)) {\n finalReturnObj.incdet_incqualifed = persistLocalData.incentiveDetails.incentiveQualified;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.minCartThresholdMet)) {\n finalReturnObj.incdet_minicartthresholdmet = persistLocalData.incentiveDetails.minCartThresholdMet;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.customerHasKohlsCharge)) {\n finalReturnObj.custdet_custhaskohlschrg = persistLocalData.customerDetails.customerHasKohlsCharge;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.customerPostalCode)) {\n finalReturnObj.custdet_custpostalcode = persistLocalData.customerDetails.customerPostalCode;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.myStoreId)) {\n finalReturnObj.custdet_mystoreid = persistLocalData.customerDetails.myStoreId;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.rewardsPilotService)) {\n finalReturnObj.custdet_rewardspilotser = persistLocalData.customerDetails.rewardsPilotService;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.kohlsLoyalty2018EliteMember)) {\n finalReturnObj.custdet_lytelitemember = persistLocalData.customerDetails.kohlsLoyalty2018EliteMember;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.kohlsLoyalty2018Member)) {\n finalReturnObj.custdet_lytmember = persistLocalData.customerDetails.kohlsLoyalty2018Member;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.rewards) && validateForNotNull(persistLocalData.purchaseEarnings.rewards.loyaltyPointBalance)) {\n finalReturnObj.usrdata_lytypntbal = persistLocalData.purchaseEarnings.rewards.loyaltyPointBalance;\n }\n\n if (validateForNotNull(persistLocalData.userData) && validateForNotNull(persistLocalData.userData.optInIndicator)) {\n finalReturnObj.usrdata_optinindict = persistLocalData.userData.optInIndicator;\n }\n\n if (validateForNotNull(persistLocalData.userData) && validateForNotNull(persistLocalData.userData.accountStatus)) {\n finalReturnObj.usrdata_accstatus = persistLocalData.userData.accountStatus;\n }\n\n if (validateForNotNull(persistLocalData.userData) && validateForNotNull(persistLocalData.userData.storeNum)) {\n finalReturnObj.usrdata_strnum = persistLocalData.userData.storeNum;\n }\n\n if (validateForNotNull(persistLocalData.userData) && validateForNotNull(persistLocalData.userData.isEnrolledUser)) {\n finalReturnObj.usrdata_isenrusr = persistLocalData.userData.isEnrolledUser;\n }\n\n if (validateForNotNull(persistLocalData.userData) && validateForNotNull(persistLocalData.userData.sessionStatus)) {\n finalReturnObj.usrdata_sesstatus = persistLocalData.userData.sessionStatus;\n }\n\n if (validateForNotNull(pageDataJson.pageDetails) && validateForNotNull(pageDataJson.pageDetails.browserPostalCode)) {\n finalReturnObj.pgdata_pgdet_brwpostalcode = pageDataJson.pageDetails.browserPostalCode;\n }\n\n if (validateForNotNull(pageDataJson.customerDetails) && validateForNotNull(pageDataJson.customerDetails.customerPostalCode)) {\n finalReturnObj.pgdata_custdet_custpostalcode = pageDataJson.customerDetails.customerPostalCode;\n }\n\n\n\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.rewards) && validateForNotNull(persistLocalData.purchaseEarnings.rewards.awayPoints)) {\n finalReturnObj.purear_rwds_awaypnts = persistLocalData.purchaseEarnings.rewards.awayPoints;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.rewards) && validateForNotNull(persistLocalData.purchaseEarnings.rewards.ltyRewardThresholdValue)) {\n finalReturnObj.purear_rwds_lytrwdthreshval = persistLocalData.purchaseEarnings.rewards.ltyRewardThresholdValue;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.rewards) && validateForNotNull(persistLocalData.purchaseEarnings.rewards.loyaltyPointBalance)) {\n finalReturnObj.purear_rwds_lytpntbal = persistLocalData.purchaseEarnings.rewards.loyaltyPointBalance;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.rewards) && validateForNotNull(persistLocalData.purchaseEarnings.rewards.currentPurchaseEarnPoint)) {\n finalReturnObj.purear_rwds_curpurearnpnt = persistLocalData.purchaseEarnings.rewards.currentPurchaseEarnPoint;\n }\n\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash.qualificationAmount)) {\n finalReturnObj.purear_kc_qlfyamnt = persistLocalData.purchaseEarnings.kohlsCash.qualificationAmount;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash.earnAmount)) {\n finalReturnObj.purear_kc_earnamnt = persistLocalData.purchaseEarnings.kohlsCash.earnAmount;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash.currentPurchaseEarnAmount)) {\n finalReturnObj.purear_kc_curpurearnamnt = persistLocalData.purchaseEarnings.kohlsCash.currentPurchaseEarnAmount;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash.awayAmount)) {\n finalReturnObj.purear_kc_awayamnt = persistLocalData.purchaseEarnings.kohlsCash.awayAmount;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCashEarnings)) {\n finalReturnObj.purear_kcearnings = persistLocalData.purchaseEarnings.kohlsCashEarnings;\n }\n\n if (validateForNotNull(persistLocalData.addressDetails) && validateForNotNull(persistLocalData.addressDetails.billingAddress[0]) && validateForNotNull(persistLocalData.addressDetails.billingAddress[0].postalCode)) {\n finalReturnObj.addrdet_biladdr_postalcode = spltArrayObjectDataIntoVector(persistLocalData.addressDetails.billingAddress, 'postalCode');\n }\n\n }\n\n return finalReturnObj;\n }\n\n function fetchMcmId()\n {\n var mcid = (typeof Visitor != 'undefined') ? Visitor.getInstance('F0EF5E09512D2CD20A490D4D@AdobeOrg') : '';\n var mcmId = (mcid ? mcid.getMarketingCloudVisitorID() : '');\n\n return mcmId;\n }\n\n\n function getPresentVector() {\n try {\n\n console.log('getPresentVector');\n\n if(pageData.cartDetails)\n {\n cartValue = pageData.cartDetails.cartSubTotalValue;\n }\n\n var itemsInBag = Number(localStorage.getItem(\"z1_checkoutBagCount\"));\n\n var presentVector = {};\n presentVector.event = eventCodes[evtName.toLocaleLowerCase()] || evtName; //common to all\n presentVector.productID = '-'; //ViewedProduct, AddedToBag\n presentVector.itemsInBag = itemsInBag || 0; //common to all\n presentVector.originalPrice = '-';\n presentVector.salePrice = '-';\n presentVector.KC = '-'; //Think\n presentVector.PDPCategory = '-'; //\n presentVector.department = '-';\n presentVector.CN = '-';\n presentVector.keywords = '-';\n presentVector.visualNavForm = '-';\n presentVector.pageFilter = '-';\n presentVector.searchType = '-';\n presentVector.userPFM = '-';\n presentVector.loginstatus = (isLoggedIn) ? 'full' : (isSoftLoggedIn ? 'soft' : '-');\n presentVector.onSale = '-';\n presentVector.time = new Date().getTime();\n\n //New Ml Vectors\n\n presentVector.pgdata_pmpdet_catname = '-';\n presentVector.pgdata_pmpdet_subcatname = '-';\n presentVector.pgdata_pmpdet_findingname = '-';\n presentVector.pgdata_pmpdet_cat_keywords = '-';\n presentVector.pgdata_pmpdet_pgfilter = '-';\n presentVector.pgdata_pmpdet_deptname = '-';\n presentVector.pgdata_pmpdet_gendervalues = '-';\n presentVector.pgdata_pmpdet_search_keywords = '-';\n presentVector.pgdata_proddet_colid = '-';\n presentVector.pgdata_pddetails_clientpostalcode = '-';\n presentVector.selected_sku_color = '-';\n presentVector.selected_sku_size = '-';\n presentVector.selected_sku = '-';\n //presentVector.selected_sku_regular_price = '-';\n presentVector.selected_sku_sale_price = '-';\n\n presentVector.c_i_size = '-';\n presentVector.c_i_color = '-';\n presentVector.c_i_isweb = '-';\n presentVector.c_sclearance = '-';\n presentVector.c_i_shipavailable = '-';\n presentVector.c_i_bopusAval = '-';\n presentVector.c_i_bossAval = '-';\n presentVector.c_i_invShip = '-';\n presentVector.c_i_invBopus = '-';\n presentVector.c_i_invBoss = '-';\n presentVector.c_o_offDis = '-';\n presentVector.c_o_sdate = '-';\n presentVector.c_o_edate = '-';\n presentVector.c_p_type = '-';\n presentVector.c_p_ptext = '-';\n presentVector.shpi_shpp_ogshpchrgs = '-';\n presentVector.shpi_shpp_shpchrgsafdis = '-';\n presentVector.shpi_shpp_freeshpqlfdelta = '-';\n presentVector.shpi_shpp_shpitmstotal = '-';\n presentVector.shpi_shpo_disamnt = '-';\n presentVector.or_merpromoamnt = '-';\n presentVector.or_disshpamnt = '-';\n presentVector.or_ogshpamnt = '-';\n presentVector.or_tax_est = '-';\n presentVector.or_tax_taxrt = '-';\n presentVector.or_tax_tax = '-';\n presentVector.or_totalsur = '-';\n presentVector.or_totaltaxfree = '-';\n presentVector.or_totalkcpromodis = '-';\n presentVector.or_totaltax = '-';\n presentVector.or_total = '-';\n presentVector.or_savings = '-';\n presentVector.or_taxfeeen = '-';\n\n presentVector.removed_sku = '-';\n presentVector.updated_sku = '-';\n presentVector.updated_sku_qty = '-';\n\n presentVector.prod_sku_count = '-';\n presentVector.sku_reg_price = '-';\n presentVector.sku_per_dis = '-';\n presentVector.sku_bopus_avail = '-';\n presentVector.sku_boss_avail = '-';\n presentVector.sku_ship_avail = '-';\n\n presentVector.filter_by_count = '-';\n presentVector.sort_by = '-';\n\n presentVector.pgdata_proddet_catname = '-';\n presentVector.pgdata_proddet_subcatname = '-';\n presentVector.pgdata_proddet_deptname = '-';\n\n presentVector.selected_prd_id = '-';\n\n presentVector.rto_data = '-';\n\n if (evtName.toLocaleLowerCase() == '_ws_completepayment') {\n\n presentVector.cardType = document.getElementsByClassName('shippingAddreswrap selected')[0].getElementsByClassName('shippingAddress_name')[0].getElementsByTagName('h3')[0].innerHTML.toString().trim();\n\n }\n\n if (debugScr) console.log(\"presentVector:\" + JSON.stringify(presentVector));\n\n //viewedhome/viewedcart do not require additional processing\n //addedtobag/placedorder have seperate tags\n\n return presentVector;\n } catch (ie) {\n console.log('[ZineOne getPresentVector] : ' + ie);\n }\n }\n\n\n function updateUserVectors() {\n try {\n\n console.log('Into updateUserVectors');\n var presentVector = getPresentVector();\n var previousVector = JSON.parse(localStorage.getItem('z1_previousVector'));\n var z1_sessionStart_ts = JSON.parse(localStorage.getItem('z1_sessionStart_ts'));\n\n var z1_features = localStorage.getItem('z1_features') || \"\";\n //Check if local Storage has userVector available\n var userVectors = JSON.parse(localStorage.getItem('z1_userVectors'));\n var newUserVectors = JSON.parse(localStorage.getItem('z1_newUserVectors'));\n\n //Updated the logic to send the Sequence if diff between present and previous event is more than 10 mins\n //if(previousVector && previousVector.time && previousVector.time < z1_sessionStart_ts){\n if (previousVector && previousVector.time && presentVector && presentVector.time && Number(presentVector.time) - Number(previousVector.time) > SESSION_GAP) {\n console.log(\"New Session has started since the last Event\");\n //Changes to visitGap for gap between n-1 and nth session\n var visitGap = localStorage.getItem('visitGap');\n //Check if null or undefined\n if (!visitGap || typeof visitGap == undefined || visitGap == 'undefined') {\n visitGap = '';\n }\n\n try{\n\n\n var oldSessionStartTime = userVectors.timeVector.toString().split('|')[0];\n\n\n var vectorsEventData = {};\n\n vectorsEventData = onceInSessionAttributes(vectorsEventData);\n\n\n var cartDump = fetchCartDump();\n\n if(validateForNotNull(cartDump))\n {\n cartDump = JSON.parse(cartDump);\n\n var cartKeys = Object.keys(cartDump);\n for(var k=0;k<cartKeys.length;k++)\n {\n vectorsEventData[cartKeys[k]] = JSON.stringify(cartDump[cartKeys[k]]);\n }\n }\n\n \n vectorsEventData.z1_userVectors = JSON.stringify(userVectors);\n vectorsEventData.z1_features = z1_features;\n vectorsEventData.visitGap = visitGap;\n vectorsEventData.session_start_time = presentVector.time;\n vectorsEventData.old_session_start_time = oldSessionStartTime;\n\n\n if(validateForNotNull(newUserVectors))\n {\n var newVectorKeys = Object.keys(newUserVectors);\n for(var k=0;k<newVectorKeys.length;k++)\n {\n vectorsEventData[newVectorKeys[k]] = newUserVectors[newVectorKeys[k]];\n }\n }\n\n ZineOne.pushEvent('_ws_updatevectors', vectorsEventData);\n }\n catch (ieInner) {\n\n var errorObj = {};\n errorObj.p1 = ieInner.message;\n errorObj.p2 = 'completePayment';\n\n ZineOne.pushEvent('_ws_logs', errorObj);\n\n }\n\n\n localStorage.setItem('visitGap', Number(presentVector.time) - Number(previousVector.time));\n localStorage.removeItem('z1_userVectors');\n localStorage.removeItem('z1_features');\n console.log(\"z1_userVectors removed from local storage\");\n userVectors = null;\n newUserVectors = null;\n }\n\n if (!userVectors) {\n userVectors = {};\n userVectors.eventVector = presentVector.event;\n userVectors.timeVector = presentVector.time;\n userVectors.productVector = presentVector.productID;\n userVectors.originalPrice = presentVector.originalPrice;\n userVectors.salePrice = presentVector.salePrice;\n userVectors.PDPCategory = presentVector.PDPCategory;\n userVectors.CN = presentVector.CN;\n userVectors.itemsInBag = presentVector.itemsInBag;\n\n newUserVectors = {};\n newUserVectors.pgdata_pmpdet_catname = presentVector.pgdata_pmpdet_catname;\n newUserVectors.pgdata_pmpdet_subcatname = presentVector.pgdata_pmpdet_subcatname;\n newUserVectors.pgdata_pmpdet_findingname = presentVector.pgdata_pmpdet_findingname;\n newUserVectors.pgdata_pmpdet_cat_keywords = presentVector.pgdata_pmpdet_cat_keywords;\n newUserVectors.pgdata_pmpdet_pgfilter = presentVector.pgdata_pmpdet_pgfilter;\n newUserVectors.pgdata_pmpdet_deptname = presentVector.pgdata_pmpdet_deptname;\n newUserVectors.pgdata_pmpdet_gendervalues = presentVector.pgdata_pmpdet_gendervalues;\n newUserVectors.pgdata_pmpdet_search_keywords = presentVector.pgdata_pmpdet_search_keywords;\n newUserVectors.pgdata_proddet_colid = presentVector.pgdata_proddet_colid;\n newUserVectors.pgdata_pddetails_clientpostalcode = presentVector.pgdata_pddetails_clientpostalcode;\n newUserVectors.selected_sku_color = presentVector.selected_sku_color;\n newUserVectors.selected_sku_size = presentVector.selected_sku_size;\n newUserVectors.selected_sku = presentVector.selected_sku;\n //newUserVectors.selected_sku_regular_price = presentVector.selected_sku_regular_price;\n newUserVectors.selected_sku_sale_price = presentVector.selected_sku_sale_price;\n\n\n\n newUserVectors.c_i_size = presentVector.c_i_size;\n newUserVectors.c_i_color = presentVector.c_i_color;\n newUserVectors.c_i_isweb = presentVector.c_i_isweb;\n newUserVectors.c_sclearance = presentVector.c_sclearance;\n newUserVectors.c_i_shipavailable = presentVector.c_i_shipavailable;\n newUserVectors.c_i_bopusAval = presentVector.c_i_bopusAval;\n newUserVectors.c_i_bossAval = presentVector.c_i_bossAval;\n newUserVectors.c_i_invShip = presentVector.c_i_invShip;\n newUserVectors.c_i_invBopus = presentVector.c_i_invBopus;\n newUserVectors.c_i_invBoss = presentVector.c_i_invBoss;\n newUserVectors.c_o_offDis = presentVector.c_o_offDis;\n newUserVectors.c_o_sdate = presentVector.c_o_sdate;\n newUserVectors.c_o_edate = presentVector.c_o_edate;\n newUserVectors.c_p_type = presentVector.c_p_type;\n newUserVectors.c_p_ptext = presentVector.c_p_ptext;\n newUserVectors.shpi_shpp_ogshpchrgs = presentVector.shpi_shpp_ogshpchrgs;\n newUserVectors.shpi_shpp_shpchrgsafdis = presentVector.shpi_shpp_shpchrgsafdis;\n newUserVectors.shpi_shpp_freeshpqlfdelta = presentVector.shpi_shpp_freeshpqlfdelta;\n newUserVectors.shpi_shpp_shpitmstotal = presentVector.shpi_shpp_shpitmstotal;\n newUserVectors.shpi_shpo_disamnt = presentVector.shpi_shpo_disamnt;\n newUserVectors.or_merpromoamnt = presentVector.or_merpromoamnt;\n newUserVectors.or_disshpamnt = presentVector.or_disshpamnt;\n newUserVectors.or_ogshpamnt = presentVector.or_ogshpamnt;\n newUserVectors.or_tax_est = presentVector.or_tax_est;\n newUserVectors.or_tax_taxrt = presentVector.or_tax_taxrt;\n newUserVectors.or_tax_tax = presentVector.or_tax_tax;\n newUserVectors.or_totalsur = presentVector.or_totalsur;\n newUserVectors.or_totaltaxfree = presentVector.or_totaltaxfree;\n newUserVectors.or_totalkcpromodis = presentVector.or_totalkcpromodis;\n newUserVectors.or_totaltax = presentVector.or_totaltax;\n newUserVectors.or_total = presentVector.or_total;\n newUserVectors.or_savings = presentVector.or_savings;\n newUserVectors.or_taxfeeen = presentVector.or_taxfeeen;\n\n newUserVectors.removed_sku = presentVector.removed_sku;\n newUserVectors.updated_sku = presentVector.updated_sku;\n newUserVectors.updated_sku_qty = presentVector.updated_sku_qty;\n\n newUserVectors.prod_sku_count = presentVector.prod_sku_count;\n newUserVectors.sku_reg_price = presentVector.sku_reg_price;\n newUserVectors.sku_per_dis = presentVector.sku_per_dis;\n newUserVectors.sku_bopus_avail = presentVector.sku_bopus_avail;\n newUserVectors.sku_boss_avail = presentVector.sku_boss_avail;\n newUserVectors.sku_ship_avail = presentVector.sku_ship_avail;\n\n newUserVectors.filter_by_count = presentVector.filter_by_count;\n newUserVectors.sort_by = presentVector.sort_by;\n\n newUserVectors.pgdata_proddet_catname = presentVector.pgdata_proddet_catname;\n newUserVectors.pgdata_proddet_subcatname = presentVector.pgdata_proddet_subcatname;\n newUserVectors.pgdata_proddet_deptname = presentVector.pgdata_proddet_deptname;\n\n newUserVectors.selected_prd_id = presentVector.selected_prd_id;\n\n newUserVectors.rto_data = presentVector.rto_data;\n\n } else {\n userVectors.eventVector = userVectors.eventVector + '|' + presentVector.event;\n userVectors.timeVector = userVectors.timeVector + '|' + presentVector.time;\n userVectors.productVector = userVectors.productVector + '|' + presentVector.productID;\n userVectors.originalPrice = userVectors.originalPrice + '|' + presentVector.originalPrice;\n userVectors.salePrice = userVectors.salePrice + '|' + presentVector.salePrice;\n userVectors.PDPCategory = userVectors.PDPCategory + '|' + presentVector.PDPCategory;\n userVectors.CN = userVectors.CN + '|' + presentVector.CN;\n userVectors.itemsInBag = userVectors.itemsInBag + '|' + presentVector.itemsInBag;\n\n newUserVectors.pgdata_pmpdet_catname = newUserVectors.pgdata_pmpdet_catname + '|' + presentVector.pgdata_pmpdet_catname;\n newUserVectors.pgdata_pmpdet_subcatname = newUserVectors.pgdata_pmpdet_subcatname + '|' + presentVector.pgdata_pmpdet_subcatname;\n newUserVectors.pgdata_pmpdet_findingname = newUserVectors.pgdata_pmpdet_findingname + '|' + presentVector.pgdata_pmpdet_findingname;\n newUserVectors.pgdata_pmpdet_cat_keywords = newUserVectors.pgdata_pmpdet_cat_keywords + '|' + presentVector.pgdata_pmpdet_cat_keywords;\n newUserVectors.pgdata_pmpdet_pgfilter = newUserVectors.pgdata_pmpdet_pgfilter + '|' + presentVector.pgdata_pmpdet_pgfilter;\n newUserVectors.pgdata_pmpdet_deptname = newUserVectors.pgdata_pmpdet_deptname + '|' + presentVector.pgdata_pmpdet_deptname;\n newUserVectors.pgdata_pmpdet_gendervalues = newUserVectors.pgdata_pmpdet_gendervalues + '|' + presentVector.pgdata_pmpdet_gendervalues;\n newUserVectors.pgdata_pmpdet_search_keywords = newUserVectors.pgdata_pmpdet_search_keywords + '|' + presentVector.pgdata_pmpdet_search_keywords;\n newUserVectors.pgdata_proddet_colid = newUserVectors.pgdata_proddet_colid + '|' + presentVector.pgdata_proddet_colid;\n newUserVectors.pgdata_pddetails_clientpostalcode = newUserVectors.pgdata_pddetails_clientpostalcode + '|' + presentVector.pgdata_pddetails_clientpostalcode;\n newUserVectors.selected_sku_color = newUserVectors.selected_sku_color + '|' + presentVector.selected_sku_color;\n newUserVectors.selected_sku_size = newUserVectors.selected_sku_size + '|' + presentVector.selected_sku_size;\n newUserVectors.selected_sku = newUserVectors.selected_sku + '|' + presentVector.selected_sku;\n //newUserVectors.selected_sku_regular_price = newUserVectors.selected_sku_regular_price + '|' + presentVector.selected_sku_regular_price;\n newUserVectors.selected_sku_sale_price = newUserVectors.selected_sku_sale_price + '|' + presentVector.selected_sku_sale_price;\n\n\n newUserVectors.c_i_size = newUserVectors.c_i_size + '|' + presentVector.c_i_size;\n newUserVectors.c_i_color = newUserVectors.c_i_color + '|' + presentVector.c_i_color;\n newUserVectors.c_i_isweb = newUserVectors.c_i_isweb + '|' + presentVector.c_i_isweb;\n newUserVectors.c_sclearance = newUserVectors.c_sclearance + '|' + presentVector.c_sclearance;\n newUserVectors.c_i_shipavailable = newUserVectors.c_i_shipavailable + '|' + presentVector.c_i_shipavailable;\n newUserVectors.c_i_bopusAval = newUserVectors.c_i_bopusAval + '|' + presentVector.c_i_bopusAval;\n newUserVectors.c_i_bossAval = newUserVectors.c_i_bossAval + '|' + presentVector.c_i_bossAval;\n newUserVectors.c_i_invShip = newUserVectors.c_i_invShip + '|' + presentVector.c_i_invShip;\n newUserVectors.c_i_invBopus = newUserVectors.c_i_invBopus + '|' + presentVector.c_i_invBopus;\n newUserVectors.c_i_invBoss = newUserVectors.c_i_invBoss + '|' + presentVector.c_i_invBoss;\n newUserVectors.c_o_offDis = newUserVectors.c_o_offDis + '|' + presentVector.c_o_offDis;\n newUserVectors.c_o_sdate = newUserVectors.c_o_sdate + '|' + presentVector.c_o_sdate;\n newUserVectors.c_o_edate = newUserVectors.c_o_edate + '|' + presentVector.c_o_edate;\n newUserVectors.c_p_type = newUserVectors.c_p_type + '|' + presentVector.c_p_type;\n newUserVectors.c_p_ptext = newUserVectors.c_p_ptext + '|' + presentVector.c_p_ptext;\n newUserVectors.shpi_shpp_ogshpchrgs = newUserVectors.shpi_shpp_ogshpchrgs + '|' + presentVector.shpi_shpp_ogshpchrgs;\n newUserVectors.shpi_shpp_shpchrgsafdis = newUserVectors.shpi_shpp_shpchrgsafdis + '|' + presentVector.shpi_shpp_shpchrgsafdis;\n newUserVectors.shpi_shpp_freeshpqlfdelta = newUserVectors.shpi_shpp_freeshpqlfdelta + '|' + presentVector.shpi_shpp_freeshpqlfdelta;\n newUserVectors.shpi_shpp_shpitmstotal = newUserVectors.shpi_shpp_shpitmstotal + '|' + presentVector.shpi_shpp_shpitmstotal;\n newUserVectors.shpi_shpo_disamnt = newUserVectors.shpi_shpo_disamnt + '|' + presentVector.shpi_shpo_disamnt;\n newUserVectors.or_merpromoamnt = newUserVectors.or_merpromoamnt + '|' + presentVector.or_merpromoamnt;\n newUserVectors.or_disshpamnt = newUserVectors.or_disshpamnt + '|' + presentVector.or_disshpamnt;\n newUserVectors.or_ogshpamnt = newUserVectors.or_ogshpamnt + '|' + presentVector.or_ogshpamnt;\n newUserVectors.or_tax_est = newUserVectors.or_tax_est + '|' + presentVector.or_tax_est;\n newUserVectors.or_tax_taxrt = newUserVectors.or_tax_taxrt + '|' + presentVector.or_tax_taxrt;\n newUserVectors.or_tax_tax = newUserVectors.or_tax_tax + '|' + presentVector.or_tax_tax;\n newUserVectors.or_totalsur = newUserVectors.or_totalsur + '|' + presentVector.or_totalsur;\n newUserVectors.or_totaltaxfree = newUserVectors.or_totaltaxfree + '|' + presentVector.or_totaltaxfree;\n newUserVectors.or_totalkcpromodis = newUserVectors.or_totalkcpromodis + '|' + presentVector.or_totalkcpromodis;\n newUserVectors.or_totaltax = newUserVectors.or_totaltax + '|' + presentVector.or_totaltax;\n newUserVectors.or_total = newUserVectors.or_total + '|' + presentVector.or_total;\n newUserVectors.or_savings = newUserVectors.or_savings + '|' + presentVector.or_savings;\n newUserVectors.or_taxfeeen = newUserVectors.or_taxfeeen + '|' + presentVector.or_taxfeeen;\n\n newUserVectors.removed_sku = newUserVectors.removed_sku + '|' + presentVector.removed_sku;\n newUserVectors.updated_sku = newUserVectors.updated_sku + '|' + presentVector.updated_sku;\n newUserVectors.updated_sku_qty = newUserVectors.updated_sku_qty + '|' + presentVector.updated_sku_qty;\n\n newUserVectors.prod_sku_count = newUserVectors.prod_sku_count + '|' + presentVector.prod_sku_count;\n newUserVectors.sku_reg_price = newUserVectors.sku_reg_price + '|' + presentVector.sku_reg_price;\n newUserVectors.sku_per_dis = newUserVectors.sku_per_dis + '|' + presentVector.sku_per_dis;\n newUserVectors.sku_bopus_avail = newUserVectors.sku_bopus_avail + '|' + presentVector.sku_bopus_avail;\n newUserVectors.sku_boss_avail = newUserVectors.sku_boss_avail + '|' + presentVector.sku_boss_avail;\n newUserVectors.sku_ship_avail = newUserVectors.sku_ship_avail + '|' + presentVector.sku_ship_avail;\n\n newUserVectors.filter_by_count = newUserVectors.filter_by_count + '|' + presentVector.filter_by_count;\n newUserVectors.sort_by = newUserVectors.sort_by + '|' + presentVector.sort_by;\n\n newUserVectors.pgdata_proddet_catname = newUserVectors.pgdata_proddet_catname + '|' + presentVector.pgdata_proddet_catname;\n newUserVectors.pgdata_proddet_subcatname = newUserVectors.pgdata_proddet_subcatname + '|' + presentVector.pgdata_proddet_subcatname;\n newUserVectors.pgdata_proddet_deptname = newUserVectors.pgdata_proddet_deptname + '|' + presentVector.pgdata_proddet_deptname;\n\n newUserVectors.selected_prd_id = newUserVectors.selected_prd_id + '|' + presentVector.selected_prd_id;\n\n newUserVectors.rto_data = newUserVectors.rto_data + '|' + presentVector.rto_data;\n \n }\n localStorage.setItem('z1_userVectors', JSON.stringify(userVectors));\n localStorage.setItem('z1_newUserVectors', JSON.stringify(newUserVectors));\n\n updateFeatures();\n\n //Update the previousVector\n previousVector = presentVector;\n localStorage.setItem('z1_previousVector', JSON.stringify(previousVector));\n\n //Send the Sequence on 5th and 10th Element as well\n //Fetch the updated features as they are updated \n var z1_features = localStorage.getItem('z1_features') || \"\";\n //If this is the 5th Element, send the features and vectors\n if (userVectors && userVectors.eventVector && userVectors.eventVector.split('|').length == 5) {\n console.log(\"The sequence is 5 element long\");\n //Changes to visitGap for gap between n-1 and nth session\n var visitGap = localStorage.getItem('visitGap');\n //Check if null or undefined\n if (!visitGap || typeof visitGap == undefined || visitGap == 'undefined') {\n visitGap = '';\n }\n\n var currentSessionStartTime = userVectors.timeVector.toString().split('|')[0];\n\n\n var vectorsEventData = {};\n\n var newVectorKeys = Object.keys(newUserVectors);\n for(var k=0;k<newVectorKeys.length;k++)\n {\n vectorsEventData[newVectorKeys[k]] = newUserVectors[newVectorKeys[k]];\n }\n\n vectorsEventData.z1_userVectors = JSON.stringify(userVectors);\n vectorsEventData.z1_features = z1_features;\n vectorsEventData.cartValue= cartValue;\n vectorsEventData.session_start_time = currentSessionStartTime;\n vectorsEventData.visitGap = visitGap;\n\n if(validateForNotNull(pageData) && validateForNotNull(pageData.customerDetails) && validateForNotNull(pageData.customerDetails.customerHasKohlsCharge))\n {\n vectorsEventData.isKcc = pageData.customerDetails.customerHasKohlsCharge;\n }\n else\n {\n vectorsEventData.isKcc = -1;\n }\n\n if (validateForNotNull(pageData) && validateForNotNull(pageData.customerDetails) && validateForNotNull(pageData.customerDetails.kohlsLoyalty2018EliteMember)) {\n vectorsEventData.kohlsLoyalty2018EliteMember = pageData.customerDetails.kohlsLoyalty2018EliteMember;\n } else {\n vectorsEventData.kohlsLoyalty2018EliteMember = -1;\n }\n\n if (validateForNotNull(pageData) && validateForNotNull(pageData.customerDetails) && validateForNotNull(pageData.customerDetails.kohlsLoyalty2018Member)) {\n vectorsEventData.kohlsLoyalty2018Member = pageData.customerDetails.kohlsLoyalty2018Member;\n } else {\n vectorsEventData.kohlsLoyalty2018Member = -1;\n }\n\n vectorsEventData.mcmId = fetchMcmId();\n\n ZineOne.pushEvent('_ws_updatevectors_len5', vectorsEventData);\n } else if (userVectors && userVectors.eventVector && userVectors.eventVector.split('|').length == 10) {\n console.log(\"The sequence is 10 element long\");\n //Changes to visitGap for gap between n-1 and nth session\n var visitGap = localStorage.getItem('visitGap');\n //Check if null or undefined\n if (!visitGap || typeof visitGap == undefined || visitGap == 'undefined') {\n visitGap = '';\n }\n\n var currentSessionStartTime = userVectors.timeVector.toString().split('|')[0];\n\n var vectorsEventData = {};\n\n var newVectorKeys = Object.keys(newUserVectors);\n for(var k=0;k<newVectorKeys.length;k++)\n {\n vectorsEventData[newVectorKeys[k]] = newUserVectors[newVectorKeys[k]];\n }\n\n\n vectorsEventData.z1_userVectors = JSON.stringify(userVectors);\n vectorsEventData.z1_features = z1_features;\n vectorsEventData.session_start_time = currentSessionStartTime;\n vectorsEventData.visitGap = visitGap;\n \n ZineOne.pushEvent('_ws_updatevectors_len10', vectorsEventData);\n }\n\n //If this is the 10th Element, send the features and vectors\n } catch (ie) {\n console.log('[ZineOne updateUserVectors] : ' + ie);\n }\n }\n\n function updateFeatures() {\n\n console.log('Into updateFeatures');\n /* z1_features is stored in local storage which holds following stats\n ** n Total number of events in visit\n ** A Total number of addedtobag events in the visit\n ** B Total number of breachedgeofence events in the visit\n ** C Total number of continuedcheckout events in the visit\n ** D Total number of exitgeofence events in the visit\n ** E Total number of placedorder events in the visit\n ** F Total number of searched events in the visit\n ** G Total number of startedcheckout events in the visit\n ** H Total number of viewedcart events in the visit\n ** I Total number of viewedcatalog events in the visit\n ** J Total number of viewedhome events in the visit\n ** K Total number of viewedproduct events in the visit\n ** p Total number of evented pages loaded in visit\n */\n\n var z1_features = localStorage.getItem('z1_features');\n if (!z1_features) {\n z1_features = \"0|0|0|0|0|0|0|0|0|0|0|0|0|0\";\n }\n\n z1_features_arr = z1_features.split('|');\n\n z1_features_arr[0] = Number(z1_features_arr[0]) + 1; //n\n\n if (evtName.toLocaleLowerCase() == '_ws_addedtobag') {\n z1_features_arr[1] = Number(z1_features_arr[1]) + 1;\n } else if (evtName.toLocaleLowerCase() == 'breachedgeofence') {\n z1_features_arr[2] = Number(z1_features_arr[2]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_completeshipping') {\n z1_features_arr[3] = Number(z1_features_arr[3]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == 'exitgeofence') {\n z1_features_arr[4] = Number(z1_features_arr[4]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_placedorder') {\n z1_features_arr[5] = Number(z1_features_arr[5]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_searched') {\n z1_features_arr[6] = Number(z1_features_arr[6]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_startedcheckout') {\n z1_features_arr[7] = Number(z1_features_arr[7]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_viewedcart') {\n z1_features_arr[8] = Number(z1_features_arr[8]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_viewedcatalog') {\n z1_features_arr[9] = Number(z1_features_arr[9]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_viewedhome') {\n z1_features_arr[10] = Number(z1_features_arr[10]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_viewedproduct') {\n z1_features_arr[11] = Number(z1_features_arr[11]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_completepayment') {\n z1_features_arr[13] = Number(z1_features_arr[13]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n }\n\n z1_features = z1_features_arr[0] + '|' + z1_features_arr[1] + '|' + z1_features_arr[2] + '|' + z1_features_arr[3] + '|' + z1_features_arr[4] + '|' + z1_features_arr[5] + '|' + z1_features_arr[6] + '|' + z1_features_arr[7] + '|' + z1_features_arr[8] + '|' + z1_features_arr[9] + '|' + z1_features_arr[10] + '|' + z1_features_arr[11] + '|' + z1_features_arr[12] + '|' + z1_features_arr[13];\n localStorage.setItem('z1_features', z1_features);\n }\n\n\n\n\n\n var isSoftLoggedIn = getCookie(\"SoftLoggedInCookie\");\n if (isSoftLoggedIn && isSoftLoggedIn.includes(\"true\")) {\n if (debugScr) console.log(\"[ZineOne] Soft Logged value is:\" + isSoftLoggedIn);\n }\n // Set HardLoggedIn = true only if user is not SoftLoggedIn\n var isLoggedIn = \"\";\n\n\n if (pageData && pageData.customerDetails) {\n if (!isSoftLoggedIn || (isSoftLoggedIn && !isSoftLoggedIn.includes(\"true\"))) {\n if (pageData.customerDetails.isLoggedIn) isLoggedIn = \"true\";\n }\n }\n\n\n\n ZineOne.pushEvent(evtName, {});\n\n updateUserVectors();\n\n\n\n} catch (ie) {\n\nif (debugScr) console.log(\"[Zineone] Error in Tag Script: WebStore Z1 tag. \" + ie);\n\n}","eventName":"click","pageSelector":{"type":"pgName","condition":"ends","val":"checkout/v2/checkout.jsp"},"domSelector":{"type":"class","val":"button_continueto_review_order"}},{"tagName":"Catalog Filter","actionType":"z1script","script":"\ntry {\n\n\n\tvar debugScr = true;\n var cartValue = 0;\n var currentUserCartArr = [];\n\n var isJsonNull = false;\n\n\n\tvar evtName = '_ws_viewedCatalog';\n\n\n\t//Event Codes for vectors:\n var eventCodes = {\n _ws_addedtobag: \"A\",\n breachedgeofence: \"B\",\n _ws_completeshipping: \"C\",\n exitgeofence: \"D\",\n _ws_placedorder: \"E\",\n _ws_searched: \"F\",\n _ws_startedcheckout: \"G\",\n _ws_viewedcart: \"H\",\n _ws_viewedcatalog: \"I\",\n _ws_viewedhome: \"J\",\n _ws_viewedproduct: \"K\",\n _ws_completepayment: \"L\",\n _ws_viewedsku: \"M\",\n _ws_update_hcart: \"N\",\n _ws_changedsort: \"O\",\n _ws_rto: \"R\"\n\n };\n var SESSION_GAP = 1800000; //30min = 30*60*1000 millis\n\n function isValid(value) {\n if (value == \"null\" || value == \"undefined\" || value == null || value == undefined) {\n return false;\n }\n\n return true;\n }\n\n\tfunction getUrlParameter(sParam) \n\t{\n\t\tvar sPageURL = decodeURIComponent(window.location.search.substring(1)),\n\t sURLVariables = sPageURL.split('&'),\n\t sParameterName,\n\t i;\n\n\t for (i = 0; i < sURLVariables.length; i++) {\n\t sParameterName = sURLVariables[i].split('=');\n\n\t if (sParameterName[0] === sParam) {\n\t return sParameterName[1] === undefined ? true : sParameterName[1];\n\t }\n\t }\n }\n\n function checkForCNUpdate()\n {\n \tCURRENT_CN_CHECK++;\n\n \tconsole.log(' checkForCNUpdate '+CURRENT_CN_CHECK+'::'+MAX_CN_CHECK);\n\n \tif(CURRENT_CN_CHECK <= MAX_CN_CHECK)\n \t{\n \t\tvar tempCN = getUrlParameter('CN');\n\n \t\tconsole.log(currentCN+' CHecking CN '+tempCN);\n\n \t\tif(tempCN == currentCN)\n \t\t{\n \t\t\tsetTimeout(function(){ \n \t\t\t\tcheckForCNUpdate(); \n \t\t\t}, 1000);\n\n\t\t\t\t\n\t\t\t\treturn;\n \t\t}\n \t\telse\n \t\t{\n\n \t\t\tcurrentCN = getUrlParameter('CN');\n\n \t\t\tvar evtData = addEventData();\n \t\t\tZineOne.pushEvent(evtName, evtData);\n updateUserVectors();\n\n \t\t}\n \t}\n \t\n }\n\n\n function validateForNotNull(obj)\n {\n //console.log('validateForNotNull',obj,typeof(obj));\n if(!(obj === undefined) && obj != null && obj != 'null' && obj.toString().length != 0)\n {\n return true;\n }\n\n return false;\n }\n\n function spltArrayObjectDataIntoVector(array,attribute)\n {\n var stringVector = '';\n\n console.log(\"spltArrayObjectDataIntoVector attribute\",attribute,array);\n\n if (!validateForNotNull(array)) {\n\n return stringVector;\n\n }\n\n if(array.length == 0)\n {\n return stringVector;\n }\n\n\n for(var i=0;i<array.length;i++)\n {\n var innerObj = array[i];\n\n var attributeValue = '#';\n if (validateForNotNull(innerObj) && validateForNotNull(innerObj[attribute])) {\n\n attributeValue = innerObj[attribute];\n\n }\n \n\n stringVector = stringVector + attributeValue + '^';\n }\n\n stringVector = stringVector.substring(0,stringVector.length-1);\n\n return stringVector;\n\n }\n\n function spltArrayObjectWithArrayObjectDataIntoVector(array,mainAttribute,innerAttribute)\n {\n var stringVector = '';\n\n console.log(\"spltArrayObjectWithArrayObjectDataIntoVector mainAttribute\",mainAttribute,innerAttribute,array);\n\n\n if (!validateForNotNull(array)) {\n\n return stringVector;\n\n }\n\n if(array.length == 0)\n {\n return stringVector;\n }\n\n\n for(var i=0;i<array.length;i++)\n {\n var innerObj = array[i];\n var attributeValueArr = innerObj[mainAttribute];\n\n console.log('spltArrayObjectDataIntoVector ',spltArrayObjectDataIntoVector(attributeValueArr,innerAttribute));\n stringVector = stringVector + spltArrayObjectDataIntoVector(attributeValueArr,innerAttribute) + '^';\n }\n\n stringVector = stringVector.substring(0,stringVector.length-1);\n\n return stringVector;\n\n }\n\n\n function spltArrayObjectWithAttributeObjectDataIntoVector(array,mainAttribute,innerAttribute)\n {\n\n var stringVector = '';\n\n if (!validateForNotNull(array)) {\n\n return stringVector;\n\n }\n\n if(array.length == 0)\n {\n return stringVector;\n }\n\n for(var i=0;i<array.length;i++)\n {\n var innerObj = array[i];\n\n var attributeValue = '-';\n if (validateForNotNull(innerObj) && validateForNotNull(innerObj[mainAttribute]) && validateForNotNull(innerObj[mainAttribute][innerAttribute])) {\n\n attributeValue = innerObj[mainAttribute][innerAttribute];\n\n }\n \n\n stringVector = stringVector + attributeValue + '~';\n }\n\n stringVector = stringVector.substring(0,stringVector.length-1);\n\n return stringVector;\n\n }\n\n function fetchCartDump()\n {\n\n var persistLocalData = localStorage.getItem('persistent_bar_components_json_v1');\n\n if(!isValid(persistLocalData)){\n persistLocalData = JSON.stringify(Kjs.PB.getPbCartStorage());\n }\n\n if (validateForNotNull(persistLocalData)) {\n\n var finalCartJSON = {};\n finalCartJSON.cartItems = [];\n\n persistLocalData = JSON.parse(persistLocalData);\n\n cartData = persistLocalData.cartItems;\n\n if(validateForNotNull(cartData))\n {\n for(var i=0;i<cartData.length;i++)\n {\n if(i == 15)\n {\n break;\n }\n\n var currentFinalObjToSend = {};\n\n var currentObj = cartData[i];\n currentFinalObjToSend.sku = currentObj.skuId;\n currentFinalObjToSend.prdId = currentObj.productId;\n currentFinalObjToSend.qty = currentObj.quantity;\n\n if(validateForNotNull(currentObj.storeClearance))\n {\n currentFinalObjToSend.sc = currentObj.storeClearance; \n }\n \n if(validateForNotNull(currentObj.itemProperties.size))\n {\n currentFinalObjToSend.size = currentObj.itemProperties.size;\n }\n \n if(validateForNotNull(currentObj.itemProperties.color))\n {\n currentFinalObjToSend.color = currentObj.itemProperties.color;\n }\n \n if(validateForNotNull(currentObj.itemProperties.isWebExclusive))\n {\n currentFinalObjToSend.isWebExcl = currentObj.itemProperties.isWebExclusive; \n }\n \n\n var finalInvInfo = {};\n\n if(validateForNotNull(currentObj.inventoryInfo.shipAvailable))\n {\n finalInvInfo.shpAvai = currentObj.inventoryInfo.shipAvailable;\n }\n\n if(validateForNotNull(currentObj.inventoryInfo.bopusAvailable))\n {\n finalInvInfo.bopAvail = currentObj.inventoryInfo.bopusAvailable; \n }\n \n if(validateForNotNull(currentObj.inventoryInfo.bossAvailable))\n {\n finalInvInfo.bosAvail = currentObj.inventoryInfo.bossAvailable; \n }\n \n if(validateForNotNull(currentObj.inventoryInfo.invOnHandQtyShip))\n {\n finalInvInfo.invOHQShip = currentObj.inventoryInfo.invOnHandQtyShip; \n }\n \n if(validateForNotNull(currentObj.finalInvInfo))\n {\n currentFinalObjToSend.invInfo = currentObj.finalInvInfo; \n }\n \n\n var currentPromoInfo = currentObj.promoInfo;\n\n console.log(' currentPromoInfo ',currentPromoInfo);\n\n if(validateForNotNull(currentPromoInfo))\n {\n var finalPromoArray = [];\n\n var prTypeArr = [];\n var prTextArr = [];\n\n for(var j=0;j<currentPromoInfo.length;j++)\n {\n var currentPromoObj = currentPromoInfo[j];\n var tempPromoObj = {};\n\n if(validateForNotNull(currentPromoObj.promoType))\n {\n prTypeArr[prTypeArr.length] = currentPromoObj.promoType; \n }\n \n if(validateForNotNull(currentPromoObj.promoText))\n {\n prTextArr[prTextArr.length] = currentPromoObj.promoText; \n }\n \n\n\n }\n\n currentFinalObjToSend.prType = prTypeArr.join('|');\n currentFinalObjToSend.prText = prTextArr.join('|');\n }\n\n \n\n var currentOfferInfo = currentObj.offerInfo;\n\n console.log(' currentOfferInfo ',currentOfferInfo);\n\n if(validateForNotNull(currentOfferInfo))\n {\n var finalOfferInfoArray = [];\n\n for(var j=0;j<currentOfferInfo.length;j++)\n {\n var currentOfferInfoObj = currentOfferInfo[j];\n var tempOfferInfoObj = {};\n\n if(validateForNotNull(currentOfferInfoObj.offerDiscount))\n {\n tempOfferInfoObj.ofDis = currentOfferInfoObj.offerDiscount; \n }\n \n if(validateForNotNull(currentOfferInfoObj.startDate))\n {\n tempOfferInfoObj.stDt = currentOfferInfoObj.startDate; \n }\n \n if(validateForNotNull(currentOfferInfoObj.endDate))\n {\n tempOfferInfoObj.enDT = currentOfferInfoObj.endDate; \n }\n \n\n finalOfferInfoArray[finalOfferInfoArray.length] = tempOfferInfoObj;\n\n }\n\n currentFinalObjToSend.offInfo = finalOfferInfoArray;\n }\n\n\n finalCartJSON.cartItems[finalCartJSON.cartItems.length] = currentFinalObjToSend;\n }\n }\n\n \n\n\n var shipmentInfo = persistLocalData.shipmentInfo;\n\n console.log(' shipmentInfo ',shipmentInfo);\n\n if(validateForNotNull(shipmentInfo))\n {\n var finalshipmentInfoArray = [];\n\n for(var j=0;j<shipmentInfo.length;j++)\n {\n var currentshipmentInfoObj = shipmentInfo[j];\n var tempShipmentInfoObj = {}; \n\n if(validateForNotNull(currentshipmentInfoObj.shipmentPriceInfo.originalShippingCharges))\n {\n tempShipmentInfoObj.ogShpChrgs = currentshipmentInfoObj.shipmentPriceInfo.originalShippingCharges; \n }\n \n if(validateForNotNull(currentshipmentInfoObj.shipmentPriceInfo.shippingChargesAfterDiscount))\n {\n tempShipmentInfoObj.shpChrgsADis = currentshipmentInfoObj.shipmentPriceInfo.shippingChargesAfterDiscount; \n }\n \n if(validateForNotNull(currentshipmentInfoObj.shipmentPriceInfo.freeShipQualificationDelta))\n {\n tempShipmentInfoObj.freeShpQlfDelta = currentshipmentInfoObj.shipmentPriceInfo.freeShipQualificationDelta; \n }\n \n if(validateForNotNull(currentshipmentInfoObj.shipmentPriceInfo.shipmentItemsTotal))\n {\n tempShipmentInfoObj.shpItmsTot = currentshipmentInfoObj.shipmentPriceInfo.shipmentItemsTotal; \n }\n \n\n\n var shippingOffers = currentshipmentInfoObj.shippingOffers;\n if(validateForNotNull(shippingOffers))\n {\n var finalshippingOfferArray = [];\n\n for(var k=0;k<shippingOffers.length;k++)\n {\n var currentshippingOffersObj = shippingOffers[k];\n\n if(validateForNotNull(currentshippingOffersObj.discountAmount))\n {\n finalshippingOfferArray[finalshippingOfferArray.length] = currentshippingOffersObj.discountAmount; \n }\n \n }\n\n\n tempShipmentInfoObj.disAmnt = finalshippingOfferArray.join('|');\n\n\n }\n\n finalshipmentInfoArray[finalshipmentInfoArray.length] = tempShipmentInfoObj;\n\n\n }\n\n finalCartJSON.shipmentInfo = finalshipmentInfoArray;\n }\n\n var orderSummary = persistLocalData.orderSummary; \n\n var finalOrderSummaryObj = {};\n\n if(validateForNotNull(orderSummary.merchandisePromoAmount))\n {\n finalOrderSummaryObj.merProAmnt = orderSummary.merchandisePromoAmount; \n }\n \n if(validateForNotNull(orderSummary.discountedShippingAmount))\n {\n finalOrderSummaryObj.disShpAmnt = orderSummary.discountedShippingAmount;\n }\n \n if(validateForNotNull(orderSummary.originalShippingAmount))\n {\n finalOrderSummaryObj.ogShpAmnt = orderSummary.originalShippingAmount; \n }\n \n if(validateForNotNull(orderSummary.tax) && validateForNotNull(orderSummary.tax.estimated))\n {\n finalOrderSummaryObj.taxest = orderSummary.tax.estimated; \n }\n \n if(validateForNotNull(orderSummary.tax) && validateForNotNull(orderSummary.tax.taxRate))\n {\n finalOrderSummaryObj.taxRate = orderSummary.tax.taxRate; \n }\n \n if(validateForNotNull(orderSummary.tax) && validateForNotNull(orderSummary.tax.tax))\n {\n finalOrderSummaryObj.tax = orderSummary.tax.tax; \n }\n \n if(validateForNotNull(orderSummary.totalSurcharges))\n {\n finalOrderSummaryObj.totSurgs = orderSummary.totalSurcharges; \n }\n \n if(validateForNotNull(orderSummary.totalTaxFee))\n {\n finalOrderSummaryObj.totTaxFee = orderSummary.totalTaxFee; \n }\n \n if(validateForNotNull(orderSummary.totalKohlsCashAndPromoDiscounts))\n {\n finalOrderSummaryObj.totKCAProDis = orderSummary.totalKohlsCashAndPromoDiscounts; \n }\n \n if(validateForNotNull(orderSummary.totalTax))\n {\n finalOrderSummaryObj.totTax = orderSummary.totalTax; \n }\n \n if(validateForNotNull(orderSummary.total))\n {\n finalOrderSummaryObj.total = orderSummary.total; \n }\n \n if(validateForNotNull(orderSummary.savings))\n {\n finalOrderSummaryObj.sav = orderSummary.savings; \n }\n \n if(validateForNotNull(orderSummary.taxFeeEnabled))\n {\n finalOrderSummaryObj.taxFeeE = orderSummary.taxFeeEnabled; \n }\n\n finalCartJSON.orderSummary = finalOrderSummaryObj;\n\n return JSON.stringify(finalCartJSON);\n\n }\n\n return null;\n\n\n }\n\n\n function onceInSessionAttributes(eventData) {\n var finalReturnObj = eventData;\n\n var persistLocalData = localStorage.getItem('persistent_bar_components_json_v1');\n\n if(!isValid(persistLocalData)){\n persistLocalData = JSON.stringify(Kjs.PB.getPbCartStorage());\n }\n\n if (validateForNotNull(persistLocalData)) {\n\n var pageDataJson = pageData;\n persistLocalData = JSON.parse(persistLocalData);\n\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.incentiveAmount)) {\n finalReturnObj.incdet_incamnt = persistLocalData.incentiveDetails.incentiveAmount;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.incentiveType)) {\n finalReturnObj.incdet_inctype = persistLocalData.incentiveDetails.incentiveType;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.smartIncentiveStatus)) {\n finalReturnObj.incdet_smartincstatus = persistLocalData.incentiveDetails.smartIncentiveStatus;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.incentiveThreshold)) {\n finalReturnObj.incdet_incthreshold = persistLocalData.incentiveDetails.incentiveThreshold;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.incentiveEligible)) {\n finalReturnObj.incdet_inceligible = persistLocalData.incentiveDetails.incentiveEligible;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.incentiveQualified)) {\n finalReturnObj.incdet_incqualifed = persistLocalData.incentiveDetails.incentiveQualified;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.minCartThresholdMet)) {\n finalReturnObj.incdet_minicartthresholdmet = persistLocalData.incentiveDetails.minCartThresholdMet;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.customerHasKohlsCharge)) {\n finalReturnObj.custdet_custhaskohlschrg = persistLocalData.customerDetails.customerHasKohlsCharge;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.customerPostalCode)) {\n finalReturnObj.custdet_custpostalcode = persistLocalData.customerDetails.customerPostalCode;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.myStoreId)) {\n finalReturnObj.custdet_mystoreid = persistLocalData.customerDetails.myStoreId;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.rewardsPilotService)) {\n finalReturnObj.custdet_rewardspilotser = persistLocalData.customerDetails.rewardsPilotService;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.kohlsLoyalty2018EliteMember)) {\n finalReturnObj.custdet_lytelitemember = persistLocalData.customerDetails.kohlsLoyalty2018EliteMember;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.kohlsLoyalty2018Member)) {\n finalReturnObj.custdet_lytmember = persistLocalData.customerDetails.kohlsLoyalty2018Member;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.rewards) && validateForNotNull(persistLocalData.purchaseEarnings.rewards.loyaltyPointBalance)) {\n finalReturnObj.usrdata_lytypntbal = persistLocalData.purchaseEarnings.rewards.loyaltyPointBalance;\n }\n\n if (validateForNotNull(persistLocalData.userData) && validateForNotNull(persistLocalData.userData.optInIndicator)) {\n finalReturnObj.usrdata_optinindict = persistLocalData.userData.optInIndicator;\n }\n\n if (validateForNotNull(persistLocalData.userData) && validateForNotNull(persistLocalData.userData.accountStatus)) {\n finalReturnObj.usrdata_accstatus = persistLocalData.userData.accountStatus;\n }\n\n if (validateForNotNull(persistLocalData.userData) && validateForNotNull(persistLocalData.userData.storeNum)) {\n finalReturnObj.usrdata_strnum = persistLocalData.userData.storeNum;\n }\n\n if (validateForNotNull(persistLocalData.userData) && validateForNotNull(persistLocalData.userData.isEnrolledUser)) {\n finalReturnObj.usrdata_isenrusr = persistLocalData.userData.isEnrolledUser;\n }\n\n if (validateForNotNull(persistLocalData.userData) && validateForNotNull(persistLocalData.userData.sessionStatus)) {\n finalReturnObj.usrdata_sesstatus = persistLocalData.userData.sessionStatus;\n }\n\n if (validateForNotNull(pageDataJson.pageDetails) && validateForNotNull(pageDataJson.pageDetails.browserPostalCode)) {\n finalReturnObj.pgdata_pgdet_brwpostalcode = pageDataJson.pageDetails.browserPostalCode;\n }\n\n if (validateForNotNull(pageDataJson.customerDetails) && validateForNotNull(pageDataJson.customerDetails.customerPostalCode)) {\n finalReturnObj.pgdata_custdet_custpostalcode = pageDataJson.customerDetails.customerPostalCode;\n }\n\n\n\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.rewards) && validateForNotNull(persistLocalData.purchaseEarnings.rewards.awayPoints)) {\n finalReturnObj.purear_rwds_awaypnts = persistLocalData.purchaseEarnings.rewards.awayPoints;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.rewards) && validateForNotNull(persistLocalData.purchaseEarnings.rewards.ltyRewardThresholdValue)) {\n finalReturnObj.purear_rwds_lytrwdthreshval = persistLocalData.purchaseEarnings.rewards.ltyRewardThresholdValue;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.rewards) && validateForNotNull(persistLocalData.purchaseEarnings.rewards.loyaltyPointBalance)) {\n finalReturnObj.purear_rwds_lytpntbal = persistLocalData.purchaseEarnings.rewards.loyaltyPointBalance;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.rewards) && validateForNotNull(persistLocalData.purchaseEarnings.rewards.currentPurchaseEarnPoint)) {\n finalReturnObj.purear_rwds_curpurearnpnt = persistLocalData.purchaseEarnings.rewards.currentPurchaseEarnPoint;\n }\n\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash.qualificationAmount)) {\n finalReturnObj.purear_kc_qlfyamnt = persistLocalData.purchaseEarnings.kohlsCash.qualificationAmount;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash.earnAmount)) {\n finalReturnObj.purear_kc_earnamnt = persistLocalData.purchaseEarnings.kohlsCash.earnAmount;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash.currentPurchaseEarnAmount)) {\n finalReturnObj.purear_kc_curpurearnamnt = persistLocalData.purchaseEarnings.kohlsCash.currentPurchaseEarnAmount;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash.awayAmount)) {\n finalReturnObj.purear_kc_awayamnt = persistLocalData.purchaseEarnings.kohlsCash.awayAmount;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCashEarnings)) {\n finalReturnObj.purear_kcearnings = persistLocalData.purchaseEarnings.kohlsCashEarnings;\n }\n\n if (validateForNotNull(persistLocalData.addressDetails) && validateForNotNull(persistLocalData.addressDetails.billingAddress[0]) && validateForNotNull(persistLocalData.addressDetails.billingAddress[0].postalCode)) {\n finalReturnObj.addrdet_biladdr_postalcode = spltArrayObjectDataIntoVector(persistLocalData.addressDetails.billingAddress, 'postalCode');\n }\n\n }\n\n return finalReturnObj;\n }\n\n\n function fetchFilterData(cnString,oldCnFromEvent)\n {\n var finalReturnString = '';\n\n var splitCnString = cnString.toString().split(\"+\");\n\n var currentFilterObj = {};\n var oldCnFromEventSplit = oldCnFromEvent.toString().split(\"|\");\n\n //console.log('oldCnFromEventSplit',oldCnFromEventSplit,oldCnFromEventSplit.length);\n\n for(var i=(oldCnFromEventSplit.length-1);i>=0;i--)\n {\n if(oldCnFromEventSplit[i].length == 0 || oldCnFromEventSplit[i] == '-')\n {\n continue;\n }\n\n var innerObj = oldCnFromEventSplit[i].split(\"+\");\n\n if(innerObj.length > 0)\n {\n for(var k=0;k<innerObj.length;k++)\n {\n var filterObj = innerObj[k].split(\":\");\n var filterName = filterObj[0];\n var filterValue = filterObj[1];\n\n currentFilterObj[filterName] = filterValue;\n }\n\n break;\n }\n \n }\n\n var alreadyUsedObj = {};\n\n //console.log(splitCnString);\n for(var i=0;i<splitCnString.length;i++)\n {\n var filterObj = splitCnString[i].split(\":\");\n var filterName = filterObj[0];\n\n //console.log('Filter Name ',filterName);\n //console.log('Filter Value ',filterValue);\n\n if(filterName in alreadyUsedObj)\n {\n continue;\n }\n\n alreadyUsedObj[filterName] = true;\n \n if(filterName in currentFilterObj)\n {\n currentFilterObj[filterName] = Number(currentFilterObj[filterName]) + 1;\n }\n else\n {\n currentFilterObj[filterName] = 1;\n }\n\n\n }\n\n //console.log('currentFilterObj',currentFilterObj);\n\n var filterkeys = Object.keys(currentFilterObj);\n for(var i=0;i<filterkeys.length;i++)\n {\n finalReturnString = finalReturnString + filterkeys[i] + ':' + currentFilterObj[filterkeys[i]] + '+';\n }\n\n finalReturnString = finalReturnString.substring(0,finalReturnString.length - 1);\n\n return finalReturnString;\n\n\n }\n\n function fetchNewAttributesForVectorization(eventData,eventName) {\n var finalReturnObj = eventData;\n\n var persistLocalData = localStorage.getItem('persistent_bar_components_json_v1');\n\n if (validateForNotNull(persistLocalData)) \n {\n var pageDataJson = pageData;\n\n persistLocalData = JSON.parse(persistLocalData);\n\n console.log('Into switch in fetchNewAttributesForVectorization',eventName);\n\n switch(eventName.toLowerCase())\n {\n case \"_ws_viewedcatalog\":\n\n if (validateForNotNull(pageDataJson.pmpDetails) && validateForNotNull(pageDataJson.pmpDetails.categoryName)) {\n finalReturnObj.pgdata_pmpdet_catname = pageDataJson.pmpDetails.categoryName;\n }\n\n if (validateForNotNull(pageDataJson.pmpDetails) && validateForNotNull(pageDataJson.pmpDetails.subcategoryName)) {\n finalReturnObj.pgdata_pmpdet_subcatname = pageDataJson.pmpDetails.subcategoryName;\n }\n\n if (validateForNotNull(pageDataJson.pmpDetails) && validateForNotNull(pageDataJson.pmpDetails.findingName)) {\n finalReturnObj.pgdata_pmpdet_findingname = pageDataJson.pmpDetails.findingName;\n }\n\n if (validateForNotNull(pageDataJson.pmpDetails) && validateForNotNull(pageDataJson.pmpDetails.keywords)) {\n finalReturnObj.pgdata_pmpdet_cat_keywords = pageDataJson.pmpDetails.keywords;\n }\n\n if (validateForNotNull(pageDataJson.pmpDetails) && validateForNotNull(pageDataJson.pmpDetails.pageFilter)) {\n finalReturnObj.pgdata_pmpdet_pgfilter = pageDataJson.pmpDetails.pageFilter;\n }\n\n if (validateForNotNull(pageDataJson.pmpDetails) && validateForNotNull(pageDataJson.pmpDetails.departmentName)) {\n finalReturnObj.pgdata_pmpdet_deptname = pageDataJson.pmpDetails.departmentName;\n }\n\n if (validateForNotNull(pageDataJson.pmpDetails) && validateForNotNull(pageDataJson.pmpDetails.genderValues)) {\n finalReturnObj.pgdata_pmpdet_gendervalues = pageDataJson.pmpDetails.genderValues;\n }\n\n\n var newUserVectors = localStorage.getItem('z1_newUserVectors');\n\n if(newUserVectors && newUserVectors.length > 0)\n {\n var newUserVectorsJson = JSON.parse(newUserVectors);\n var currentFilterString = newUserVectorsJson.filter_by_count;\n\n if(validateForNotNull(getUrlParameter('CN')) && validateForNotNull(currentFilterString))\n {\n finalReturnObj.filter_by_count = fetchFilterData(getUrlParameter('CN'),currentFilterString); \n }\n \n }\n else\n {\n if(validateForNotNull(getUrlParameter('CN')))\n {\n finalReturnObj.filter_by_count = fetchFilterData(getUrlParameter('CN'),''); \n }\n \n }\n\n break;\n\n case '_ws_changedsort':\n\n var selectFilter = document.getElementById('sortby_select');\n if(selectFilter)\n {\n var selectedValue = selectFilter.options[selectFilter.selectedIndex].value;\n if(validateForNotNull(selectedValue))\n {\n finalReturnObj.sort_by = selectedValue;\n }\n }\n\n\n break;\n\n }\n }\n\n\n return finalReturnObj;\n\n }\n\n function fetchMcmId()\n {\n var mcid = (typeof Visitor != 'undefined') ? Visitor.getInstance('F0EF5E09512D2CD20A490D4D@AdobeOrg') : '';\n var mcmId = (mcid ? mcid.getMarketingCloudVisitorID() : '');\n\n return mcmId;\n }\n\n\n function getPresentVector() {\n try {\n\n console.log('getPresentVector');\n\n var itemsInBag = 0;\n\n cartValue = 0;\n\n isJsonNull = false;\n\n var cartData = localStorage.getItem(\"persistent_bar_components_json_v1\");\n if(isValid(cartData))\n {\n var cartInfo = JSON.parse(cartData);\n\n for (var i = 0; i < cartInfo.cartItems.length; i++) {\n itemsInBag = itemsInBag + cartInfo.cartItems[i].quantity;\n\n cartValue = cartValue + Number(cartInfo.cartItems[i].itemPriceInfo.grossPrice);\n\n var tempObj = {};\n tempObj.productId = cartInfo.cartItems[i].productId;\n tempObj.skuId = cartInfo.cartItems[i].skuId;\n tempObj.quantity = cartInfo.cartItems[i].quantity;\n tempObj.itemType = cartInfo.cartItems[i].itemType;\n\n currentUserCartArr.push(tempObj);\n\n }\n }\n else\n {\n if(getCookie('VisitorBagTotals').toString().length != 0)\n {\n cartValue = -1;\n\n isJsonNull = true;\n }\n }\n\n if (cartValue == 0 && (typeof pageData != 'undefined') && pageData.cartDetails && pageData.cartDetails.cartSubTotalValue) {\n cartValue = Number(pageData.cartDetails.cartSubTotalValue);\n }\n\n\n\n \n\n var presentVector = {};\n presentVector.event = eventCodes[evtName.toLocaleLowerCase()] || evtName; //common to all\n presentVector.productID = '-'; //ViewedProduct, AddedToBag\n presentVector.itemsInBag = itemsInBag || 0; //common to all\n presentVector.originalPrice = '-';\n presentVector.salePrice = '-';\n presentVector.KC = '-'; //Think\n presentVector.PDPCategory = '-'; //\n presentVector.department = '-';\n presentVector.CN = '-';\n presentVector.keywords = '-';\n presentVector.visualNavForm = '-';\n presentVector.pageFilter = '-';\n presentVector.searchType = '-';\n presentVector.userPFM = '-';\n presentVector.loginstatus = (isLoggedIn) ? 'full' : (isSoftLoggedIn ? 'soft' : '-');\n presentVector.onSale = '-';\n presentVector.time = new Date().getTime();\n\n //New Ml Vectors\n\n presentVector.pgdata_pmpdet_catname = '-';\n presentVector.pgdata_pmpdet_subcatname = '-';\n presentVector.pgdata_pmpdet_findingname = '-';\n presentVector.pgdata_pmpdet_cat_keywords = '-';\n presentVector.pgdata_pmpdet_pgfilter = '-';\n presentVector.pgdata_pmpdet_deptname = '-';\n presentVector.pgdata_pmpdet_gendervalues = '-';\n presentVector.pgdata_pmpdet_search_keywords = '-';\n presentVector.pgdata_proddet_colid = '-';\n presentVector.pgdata_pddetails_clientpostalcode = '-';\n presentVector.selected_sku_color = '-';\n presentVector.selected_sku_size = '-';\n presentVector.selected_sku = '-';\n //presentVector.selected_sku_regular_price = '-';\n presentVector.selected_sku_sale_price = '-';\n\n presentVector.c_i_size = '-';\n presentVector.c_i_color = '-';\n presentVector.c_i_isweb = '-';\n presentVector.c_sclearance = '-';\n presentVector.c_i_shipavailable = '-';\n presentVector.c_i_bopusAval = '-';\n presentVector.c_i_bossAval = '-';\n presentVector.c_i_invShip = '-';\n presentVector.c_i_invBopus = '-';\n presentVector.c_i_invBoss = '-';\n presentVector.c_o_offDis = '-';\n presentVector.c_o_sdate = '-';\n presentVector.c_o_edate = '-';\n presentVector.c_p_type = '-';\n presentVector.c_p_ptext = '-';\n presentVector.shpi_shpp_ogshpchrgs = '-';\n presentVector.shpi_shpp_shpchrgsafdis = '-';\n presentVector.shpi_shpp_freeshpqlfdelta = '-';\n presentVector.shpi_shpp_shpitmstotal = '-';\n presentVector.shpi_shpo_disamnt = '-';\n presentVector.or_merpromoamnt = '-';\n presentVector.or_disshpamnt = '-';\n presentVector.or_ogshpamnt = '-';\n presentVector.or_tax_est = '-';\n presentVector.or_tax_taxrt = '-';\n presentVector.or_tax_tax = '-';\n presentVector.or_totalsur = '-';\n presentVector.or_totaltaxfree = '-';\n presentVector.or_totalkcpromodis = '-';\n presentVector.or_totaltax = '-';\n presentVector.or_total = '-';\n presentVector.or_savings = '-';\n presentVector.or_taxfeeen = '-';\n\n presentVector.removed_sku = '-';\n presentVector.updated_sku = '-';\n presentVector.updated_sku_qty = '-';\n\n presentVector.prod_sku_count = '-';\n presentVector.sku_reg_price = '-';\n presentVector.sku_per_dis = '-';\n presentVector.sku_bopus_avail = '-';\n presentVector.sku_boss_avail = '-';\n presentVector.sku_ship_avail = '-';\n\n presentVector.filter_by_count = '-';\n presentVector.sort_by = '-';\n\n presentVector.pgdata_proddet_catname = '-';\n presentVector.pgdata_proddet_subcatname = '-';\n presentVector.pgdata_proddet_deptname = '-';\n\n presentVector.selected_prd_id = '-';\n\n presentVector.rto_data = '-';\n\n if (evtName.toLocaleLowerCase() == '_ws_viewedcatalog') {\n if (typeof pageData != 'undefined') {\n presentVector.department = (pageData.pmpDetails && pageData.pmpDetails.departmentName) || '-';\n presentVector.pageFilter = (pageData.pmpDetails && pageData.pmpDetails.pageFilter) || '-';\n }\n presentVector.CN = getUrlParameter('CN') || '-';\n presentVector.visualNavForm = getUrlParameter('VisualNavFrom') || '-';\n }\n\n presentVector = fetchNewAttributesForVectorization(presentVector,evtName);\n\n if (debugScr) console.log(\"presentVector:\" + JSON.stringify(presentVector));\n\n //viewedhome/viewedcart do not require additional processing\n //addedtobag/placedorder have seperate tags\n\n return presentVector;\n } catch (ie) {\n console.log('[ZineOne getPresentVector] : ' + ie);\n }\n }\n\n\n function updateUserVectors() {\n try {\n\n console.log('Into updateUserVectors');\n var presentVector = getPresentVector();\n var previousVector = JSON.parse(localStorage.getItem('z1_previousVector'));\n var z1_sessionStart_ts = JSON.parse(localStorage.getItem('z1_sessionStart_ts'));\n\n var z1_features = localStorage.getItem('z1_features') || \"\";\n //Check if local Storage has userVector available\n var userVectors = JSON.parse(localStorage.getItem('z1_userVectors'));\n var newUserVectors = JSON.parse(localStorage.getItem('z1_newUserVectors'));\n\n //Updated the logic to send the Sequence if diff between present and previous event is more than 10 mins\n //if(previousVector && previousVector.time && previousVector.time < z1_sessionStart_ts){\n if (previousVector && previousVector.time && presentVector && presentVector.time && Number(presentVector.time) - Number(previousVector.time) > SESSION_GAP) {\n console.log(\"New Session has started since the last Event\");\n //Changes to visitGap for gap between n-1 and nth session\n var visitGap = localStorage.getItem('visitGap');\n //Check if null or undefined\n if (!visitGap || typeof visitGap == undefined || visitGap == 'undefined') {\n visitGap = '';\n }\n\n try{\n\n\n var oldSessionStartTime = userVectors.timeVector.toString().split('|')[0];\n\n\n var vectorsEventData = {};\n\n vectorsEventData = onceInSessionAttributes(vectorsEventData);\n\n\n var cartDump = fetchCartDump();\n\n if(validateForNotNull(cartDump))\n {\n cartDump = JSON.parse(cartDump);\n\n var cartKeys = Object.keys(cartDump);\n for(var k=0;k<cartKeys.length;k++)\n {\n vectorsEventData[cartKeys[k]] = JSON.stringify(cartDump[cartKeys[k]]);\n }\n }\n \n\n\n vectorsEventData.z1_userVectors = JSON.stringify(userVectors);\n vectorsEventData.z1_features = z1_features;\n vectorsEventData.visitGap = visitGap;\n vectorsEventData.session_start_time = presentVector.time;\n vectorsEventData.old_session_start_time = oldSessionStartTime;\n\n\n if(validateForNotNull(newUserVectors))\n {\n var newVectorKeys = Object.keys(newUserVectors);\n for(var k=0;k<newVectorKeys.length;k++)\n {\n vectorsEventData[newVectorKeys[k]] = newUserVectors[newVectorKeys[k]];\n }\n }\n\n\n\n ZineOne.pushEvent('_ws_updatevectors', vectorsEventData);\n }\n catch (ieInner) {\n\n var errorObj = {};\n errorObj.p1 = ieInner.message;\n errorObj.p2 = '2. Catalog Filter';\n\n ZineOne.pushEvent('_ws_logs', errorObj);\n\n }\n\n try\n {\n var maxAttrSize = 0;\n\n var totalSize = JSON.stringify(vectorsEventData);\n totalSize = totalSize.length;\n\n var vectorsEventDataKeys = Object.keys(vectorsEventData);\n for(var k=0;k<vectorsEventDataKeys.length;k++)\n {\n var attrSize = vectorsEventData[vectorsEventDataKeys[k]].length;\n\n if(attrSize > maxAttrSize)\n {\n maxAttrSize = attrSize;\n }\n }\n\n var newObj = {};\n newObj.ml_uv_maxAttrSize = maxAttrSize;\n newObj.ml_uv_totalSize = totalSize;\n\n ZineOne.pushEvent('_ws_updatevectors_size_tracking', newObj);\n\n } catch (ie) {\n\n \n }\n\n\n localStorage.setItem('visitGap', Number(presentVector.time) - Number(previousVector.time));\n localStorage.removeItem('z1_userVectors');\n localStorage.removeItem('z1_features');\n console.log(\"z1_userVectors removed from local storage\");\n userVectors = null;\n newUserVectors = null;\n }\n\n if (!userVectors) {\n userVectors = {};\n userVectors.eventVector = presentVector.event;\n userVectors.timeVector = presentVector.time;\n userVectors.productVector = presentVector.productID;\n userVectors.originalPrice = presentVector.originalPrice;\n userVectors.salePrice = presentVector.salePrice;\n userVectors.PDPCategory = presentVector.PDPCategory;\n userVectors.CN = presentVector.CN;\n userVectors.itemsInBag = presentVector.itemsInBag;\n\n newUserVectors = {};\n newUserVectors.pgdata_pmpdet_catname = presentVector.pgdata_pmpdet_catname;\n newUserVectors.pgdata_pmpdet_subcatname = presentVector.pgdata_pmpdet_subcatname;\n newUserVectors.pgdata_pmpdet_findingname = presentVector.pgdata_pmpdet_findingname;\n newUserVectors.pgdata_pmpdet_cat_keywords = presentVector.pgdata_pmpdet_cat_keywords;\n newUserVectors.pgdata_pmpdet_pgfilter = presentVector.pgdata_pmpdet_pgfilter;\n newUserVectors.pgdata_pmpdet_deptname = presentVector.pgdata_pmpdet_deptname;\n newUserVectors.pgdata_pmpdet_gendervalues = presentVector.pgdata_pmpdet_gendervalues;\n newUserVectors.pgdata_pmpdet_search_keywords = presentVector.pgdata_pmpdet_search_keywords;\n newUserVectors.pgdata_proddet_colid = presentVector.pgdata_proddet_colid;\n newUserVectors.pgdata_pddetails_clientpostalcode = presentVector.pgdata_pddetails_clientpostalcode;\n newUserVectors.selected_sku_color = presentVector.selected_sku_color;\n newUserVectors.selected_sku_size = presentVector.selected_sku_size;\n newUserVectors.selected_sku = presentVector.selected_sku;\n //newUserVectors.selected_sku_regular_price = presentVector.selected_sku_regular_price;\n newUserVectors.selected_sku_sale_price = presentVector.selected_sku_sale_price;\n\n\n\n newUserVectors.c_i_size = presentVector.c_i_size;\n newUserVectors.c_i_color = presentVector.c_i_color;\n newUserVectors.c_i_isweb = presentVector.c_i_isweb;\n newUserVectors.c_sclearance = presentVector.c_sclearance;\n newUserVectors.c_i_shipavailable = presentVector.c_i_shipavailable;\n newUserVectors.c_i_bopusAval = presentVector.c_i_bopusAval;\n newUserVectors.c_i_bossAval = presentVector.c_i_bossAval;\n newUserVectors.c_i_invShip = presentVector.c_i_invShip;\n newUserVectors.c_i_invBopus = presentVector.c_i_invBopus;\n newUserVectors.c_i_invBoss = presentVector.c_i_invBoss;\n newUserVectors.c_o_offDis = presentVector.c_o_offDis;\n newUserVectors.c_o_sdate = presentVector.c_o_sdate;\n newUserVectors.c_o_edate = presentVector.c_o_edate;\n newUserVectors.c_p_type = presentVector.c_p_type;\n newUserVectors.c_p_ptext = presentVector.c_p_ptext;\n newUserVectors.shpi_shpp_ogshpchrgs = presentVector.shpi_shpp_ogshpchrgs;\n newUserVectors.shpi_shpp_shpchrgsafdis = presentVector.shpi_shpp_shpchrgsafdis;\n newUserVectors.shpi_shpp_freeshpqlfdelta = presentVector.shpi_shpp_freeshpqlfdelta;\n newUserVectors.shpi_shpp_shpitmstotal = presentVector.shpi_shpp_shpitmstotal;\n newUserVectors.shpi_shpo_disamnt = presentVector.shpi_shpo_disamnt;\n newUserVectors.or_merpromoamnt = presentVector.or_merpromoamnt;\n newUserVectors.or_disshpamnt = presentVector.or_disshpamnt;\n newUserVectors.or_ogshpamnt = presentVector.or_ogshpamnt;\n newUserVectors.or_tax_est = presentVector.or_tax_est;\n newUserVectors.or_tax_taxrt = presentVector.or_tax_taxrt;\n newUserVectors.or_tax_tax = presentVector.or_tax_tax;\n newUserVectors.or_totalsur = presentVector.or_totalsur;\n newUserVectors.or_totaltaxfree = presentVector.or_totaltaxfree;\n newUserVectors.or_totalkcpromodis = presentVector.or_totalkcpromodis;\n newUserVectors.or_totaltax = presentVector.or_totaltax;\n newUserVectors.or_total = presentVector.or_total;\n newUserVectors.or_savings = presentVector.or_savings;\n newUserVectors.or_taxfeeen = presentVector.or_taxfeeen;\n\n newUserVectors.removed_sku = presentVector.removed_sku;\n newUserVectors.updated_sku = presentVector.updated_sku;\n newUserVectors.updated_sku_qty = presentVector.updated_sku_qty;\n\n newUserVectors.prod_sku_count = presentVector.prod_sku_count;\n newUserVectors.sku_reg_price = presentVector.sku_reg_price;\n newUserVectors.sku_per_dis = presentVector.sku_per_dis;\n newUserVectors.sku_bopus_avail = presentVector.sku_bopus_avail;\n newUserVectors.sku_boss_avail = presentVector.sku_boss_avail;\n newUserVectors.sku_ship_avail = presentVector.sku_ship_avail;\n\n newUserVectors.filter_by_count = presentVector.filter_by_count;\n newUserVectors.sort_by = presentVector.sort_by;\n\n newUserVectors.pgdata_proddet_catname = presentVector.pgdata_proddet_catname;\n newUserVectors.pgdata_proddet_subcatname = presentVector.pgdata_proddet_subcatname;\n newUserVectors.pgdata_proddet_deptname = presentVector.pgdata_proddet_deptname;\n\n newUserVectors.selected_prd_id = presentVector.selected_prd_id;\n\n newUserVectors.rto_data = presentVector.rto_data;\n\n } else {\n userVectors.eventVector = userVectors.eventVector + '|' + presentVector.event;\n userVectors.timeVector = userVectors.timeVector + '|' + presentVector.time;\n userVectors.productVector = userVectors.productVector + '|' + presentVector.productID;\n userVectors.originalPrice = userVectors.originalPrice + '|' + presentVector.originalPrice;\n userVectors.salePrice = userVectors.salePrice + '|' + presentVector.salePrice;\n userVectors.PDPCategory = userVectors.PDPCategory + '|' + presentVector.PDPCategory;\n userVectors.CN = userVectors.CN + '|' + presentVector.CN;\n userVectors.itemsInBag = userVectors.itemsInBag + '|' + presentVector.itemsInBag;\n\n newUserVectors.pgdata_pmpdet_catname = newUserVectors.pgdata_pmpdet_catname + '|' + presentVector.pgdata_pmpdet_catname;\n newUserVectors.pgdata_pmpdet_subcatname = newUserVectors.pgdata_pmpdet_subcatname + '|' + presentVector.pgdata_pmpdet_subcatname;\n newUserVectors.pgdata_pmpdet_findingname = newUserVectors.pgdata_pmpdet_findingname + '|' + presentVector.pgdata_pmpdet_findingname;\n newUserVectors.pgdata_pmpdet_cat_keywords = newUserVectors.pgdata_pmpdet_cat_keywords + '|' + presentVector.pgdata_pmpdet_cat_keywords;\n newUserVectors.pgdata_pmpdet_pgfilter = newUserVectors.pgdata_pmpdet_pgfilter + '|' + presentVector.pgdata_pmpdet_pgfilter;\n newUserVectors.pgdata_pmpdet_deptname = newUserVectors.pgdata_pmpdet_deptname + '|' + presentVector.pgdata_pmpdet_deptname;\n newUserVectors.pgdata_pmpdet_gendervalues = newUserVectors.pgdata_pmpdet_gendervalues + '|' + presentVector.pgdata_pmpdet_gendervalues;\n newUserVectors.pgdata_pmpdet_search_keywords = newUserVectors.pgdata_pmpdet_search_keywords + '|' + presentVector.pgdata_pmpdet_search_keywords;\n newUserVectors.pgdata_proddet_colid = newUserVectors.pgdata_proddet_colid + '|' + presentVector.pgdata_proddet_colid;\n newUserVectors.pgdata_pddetails_clientpostalcode = newUserVectors.pgdata_pddetails_clientpostalcode + '|' + presentVector.pgdata_pddetails_clientpostalcode;\n newUserVectors.selected_sku_color = newUserVectors.selected_sku_color + '|' + presentVector.selected_sku_color;\n newUserVectors.selected_sku_size = newUserVectors.selected_sku_size + '|' + presentVector.selected_sku_size;\n newUserVectors.selected_sku = newUserVectors.selected_sku + '|' + presentVector.selected_sku;\n //newUserVectors.selected_sku_regular_price = newUserVectors.selected_sku_regular_price + '|' + presentVector.selected_sku_regular_price;\n newUserVectors.selected_sku_sale_price = newUserVectors.selected_sku_sale_price + '|' + presentVector.selected_sku_sale_price;\n\n\n newUserVectors.c_i_size = newUserVectors.c_i_size + '|' + presentVector.c_i_size;\n newUserVectors.c_i_color = newUserVectors.c_i_color + '|' + presentVector.c_i_color;\n newUserVectors.c_i_isweb = newUserVectors.c_i_isweb + '|' + presentVector.c_i_isweb;\n newUserVectors.c_sclearance = newUserVectors.c_sclearance + '|' + presentVector.c_sclearance;\n newUserVectors.c_i_shipavailable = newUserVectors.c_i_shipavailable + '|' + presentVector.c_i_shipavailable;\n newUserVectors.c_i_bopusAval = newUserVectors.c_i_bopusAval + '|' + presentVector.c_i_bopusAval;\n newUserVectors.c_i_bossAval = newUserVectors.c_i_bossAval + '|' + presentVector.c_i_bossAval;\n newUserVectors.c_i_invShip = newUserVectors.c_i_invShip + '|' + presentVector.c_i_invShip;\n newUserVectors.c_i_invBopus = newUserVectors.c_i_invBopus + '|' + presentVector.c_i_invBopus;\n newUserVectors.c_i_invBoss = newUserVectors.c_i_invBoss + '|' + presentVector.c_i_invBoss;\n newUserVectors.c_o_offDis = newUserVectors.c_o_offDis + '|' + presentVector.c_o_offDis;\n newUserVectors.c_o_sdate = newUserVectors.c_o_sdate + '|' + presentVector.c_o_sdate;\n newUserVectors.c_o_edate = newUserVectors.c_o_edate + '|' + presentVector.c_o_edate;\n newUserVectors.c_p_type = newUserVectors.c_p_type + '|' + presentVector.c_p_type;\n newUserVectors.c_p_ptext = newUserVectors.c_p_ptext + '|' + presentVector.c_p_ptext;\n newUserVectors.shpi_shpp_ogshpchrgs = newUserVectors.shpi_shpp_ogshpchrgs + '|' + presentVector.shpi_shpp_ogshpchrgs;\n newUserVectors.shpi_shpp_shpchrgsafdis = newUserVectors.shpi_shpp_shpchrgsafdis + '|' + presentVector.shpi_shpp_shpchrgsafdis;\n newUserVectors.shpi_shpp_freeshpqlfdelta = newUserVectors.shpi_shpp_freeshpqlfdelta + '|' + presentVector.shpi_shpp_freeshpqlfdelta;\n newUserVectors.shpi_shpp_shpitmstotal = newUserVectors.shpi_shpp_shpitmstotal + '|' + presentVector.shpi_shpp_shpitmstotal;\n newUserVectors.shpi_shpo_disamnt = newUserVectors.shpi_shpo_disamnt + '|' + presentVector.shpi_shpo_disamnt;\n newUserVectors.or_merpromoamnt = newUserVectors.or_merpromoamnt + '|' + presentVector.or_merpromoamnt;\n newUserVectors.or_disshpamnt = newUserVectors.or_disshpamnt + '|' + presentVector.or_disshpamnt;\n newUserVectors.or_ogshpamnt = newUserVectors.or_ogshpamnt + '|' + presentVector.or_ogshpamnt;\n newUserVectors.or_tax_est = newUserVectors.or_tax_est + '|' + presentVector.or_tax_est;\n newUserVectors.or_tax_taxrt = newUserVectors.or_tax_taxrt + '|' + presentVector.or_tax_taxrt;\n newUserVectors.or_tax_tax = newUserVectors.or_tax_tax + '|' + presentVector.or_tax_tax;\n newUserVectors.or_totalsur = newUserVectors.or_totalsur + '|' + presentVector.or_totalsur;\n newUserVectors.or_totaltaxfree = newUserVectors.or_totaltaxfree + '|' + presentVector.or_totaltaxfree;\n newUserVectors.or_totalkcpromodis = newUserVectors.or_totalkcpromodis + '|' + presentVector.or_totalkcpromodis;\n newUserVectors.or_totaltax = newUserVectors.or_totaltax + '|' + presentVector.or_totaltax;\n newUserVectors.or_total = newUserVectors.or_total + '|' + presentVector.or_total;\n newUserVectors.or_savings = newUserVectors.or_savings + '|' + presentVector.or_savings;\n newUserVectors.or_taxfeeen = newUserVectors.or_taxfeeen + '|' + presentVector.or_taxfeeen;\n\n newUserVectors.removed_sku = newUserVectors.removed_sku + '|' + presentVector.removed_sku;\n newUserVectors.updated_sku = newUserVectors.updated_sku + '|' + presentVector.updated_sku;\n newUserVectors.updated_sku_qty = newUserVectors.updated_sku_qty + '|' + presentVector.updated_sku_qty;\n\n newUserVectors.prod_sku_count = newUserVectors.prod_sku_count + '|' + presentVector.prod_sku_count;\n newUserVectors.sku_reg_price = newUserVectors.sku_reg_price + '|' + presentVector.sku_reg_price;\n newUserVectors.sku_per_dis = newUserVectors.sku_per_dis + '|' + presentVector.sku_per_dis;\n newUserVectors.sku_bopus_avail = newUserVectors.sku_bopus_avail + '|' + presentVector.sku_bopus_avail;\n newUserVectors.sku_boss_avail = newUserVectors.sku_boss_avail + '|' + presentVector.sku_boss_avail;\n newUserVectors.sku_ship_avail = newUserVectors.sku_ship_avail + '|' + presentVector.sku_ship_avail;\n\n\n newUserVectors.filter_by_count = newUserVectors.filter_by_count + '|' + presentVector.filter_by_count;\n newUserVectors.sort_by = newUserVectors.sort_by + '|' + presentVector.sort_by;\n\n newUserVectors.pgdata_proddet_catname = newUserVectors.pgdata_proddet_catname + '|' + presentVector.pgdata_proddet_catname;\n newUserVectors.pgdata_proddet_subcatname = newUserVectors.pgdata_proddet_subcatname + '|' + presentVector.pgdata_proddet_subcatname;\n newUserVectors.pgdata_proddet_deptname = newUserVectors.pgdata_proddet_deptname + '|' + presentVector.pgdata_proddet_deptname;\n\n newUserVectors.selected_prd_id = newUserVectors.selected_prd_id + '|' + presentVector.selected_prd_id;\n\n newUserVectors.rto_data = newUserVectors.rto_data + '|' + presentVector.rto_data;\n\n\n }\n localStorage.setItem('z1_userVectors', JSON.stringify(userVectors));\n localStorage.setItem('z1_newUserVectors', JSON.stringify(newUserVectors));\n\n updateFeatures();\n\n //Update the previousVector\n previousVector = presentVector;\n localStorage.setItem('z1_previousVector', JSON.stringify(previousVector));\n\n //Send the Sequence on 5th and 10th Element as well\n //Fetch the updated features as they are updated \n var z1_features = localStorage.getItem('z1_features') || \"\";\n //If this is the 5th Element, send the features and vectors\n if (userVectors && userVectors.eventVector && userVectors.eventVector.split('|').length == 5) {\n console.log(\"The sequence is 5 element long\");\n //Changes to visitGap for gap between n-1 and nth session\n var visitGap = localStorage.getItem('visitGap');\n //Check if null or undefined\n if (!visitGap || typeof visitGap == undefined || visitGap == 'undefined') {\n visitGap = '';\n }\n\n var currentSessionStartTime = userVectors.timeVector.toString().split('|')[0];\n\n\n var vectorsEventData = {};\n\n var newVectorKeys = Object.keys(newUserVectors);\n for(var k=0;k<newVectorKeys.length;k++)\n {\n vectorsEventData[newVectorKeys[k]] = newUserVectors[newVectorKeys[k]];\n }\n\n vectorsEventData.z1_userVectors = JSON.stringify(userVectors);\n vectorsEventData.z1_features = z1_features;\n vectorsEventData.cartValue= cartValue;\n vectorsEventData.session_start_time = currentSessionStartTime;\n vectorsEventData.visitGap = visitGap;\n vectorsEventData.currentCart = JSON.stringify(currentUserCartArr);\n\n if(validateForNotNull(pageData) && validateForNotNull(pageData.customerDetails) && validateForNotNull(pageData.customerDetails.customerHasKohlsCharge))\n {\n vectorsEventData.isKcc = pageData.customerDetails.customerHasKohlsCharge;\n }\n else\n {\n vectorsEventData.isKcc = -1;\n }\n \n if (validateForNotNull(pageData) && validateForNotNull(pageData.customerDetails) && validateForNotNull(pageData.customerDetails.kohlsLoyalty2018EliteMember)) {\n vectorsEventData.kohlsLoyalty2018EliteMember = pageData.customerDetails.kohlsLoyalty2018EliteMember;\n } else {\n vectorsEventData.kohlsLoyalty2018EliteMember = -1;\n }\n\n if (validateForNotNull(pageData) && validateForNotNull(pageData.customerDetails) && validateForNotNull(pageData.customerDetails.kohlsLoyalty2018Member)) {\n vectorsEventData.kohlsLoyalty2018Member = pageData.customerDetails.kohlsLoyalty2018Member;\n } else {\n vectorsEventData.kohlsLoyalty2018Member = -1;\n }\n\n \n vectorsEventData.mcmId = fetchMcmId();\n\n ZineOne.pushEvent('_ws_updatevectors_len5', vectorsEventData);\n\n if(isJsonNull)\n {\n var lastUserPageArr = userVectors.eventVector.toString().split('|');\n var lastPageChar = lastUserPageArr[lastUserPageArr.length - 2];\n\n var tempEventData = {};\n tempEventData.VisitorBagTotals = getCookie('VisitorBagTotals');\n tempEventData.pgName = 'PMP';\n tempEventData.lastPgChar = lastPageChar;\n\n ZineOne.pushEvent('_ws_emptyjson_v2', tempEventData);\n }\n\n\n } else if (userVectors && userVectors.eventVector && userVectors.eventVector.split('|').length == 10) {\n console.log(\"The sequence is 10 element long\");\n //Changes to visitGap for gap between n-1 and nth session\n var visitGap = localStorage.getItem('visitGap');\n //Check if null or undefined\n if (!visitGap || typeof visitGap == undefined || visitGap == 'undefined') {\n visitGap = '';\n }\n\n var currentSessionStartTime = userVectors.timeVector.toString().split('|')[0];\n\n var vectorsEventData = {};\n\n var newVectorKeys = Object.keys(newUserVectors);\n for(var k=0;k<newVectorKeys.length;k++)\n {\n vectorsEventData[newVectorKeys[k]] = newUserVectors[newVectorKeys[k]];\n }\n\n\n\n vectorsEventData.z1_userVectors = JSON.stringify(userVectors);\n vectorsEventData.z1_features = z1_features;\n vectorsEventData.session_start_time = currentSessionStartTime;\n vectorsEventData.visitGap = visitGap;\n\n \n ZineOne.pushEvent('_ws_updatevectors_len10', vectorsEventData);\n }\n\n //If this is the 10th Element, send the features and vectors\n } catch (ie) {\n console.log('[ZineOne updateUserVectors] : ' + ie);\n }\n }\n\n function updateFeatures() {\n\n console.log('Into updateFeatures');\n /* z1_features is stored in local storage which holds following stats\n ** n Total number of events in visit\n ** A Total number of addedtobag events in the visit\n ** B Total number of breachedgeofence events in the visit\n ** C Total number of continuedcheckout events in the visit\n ** D Total number of exitgeofence events in the visit\n ** E Total number of placedorder events in the visit\n ** F Total number of searched events in the visit\n ** G Total number of startedcheckout events in the visit\n ** H Total number of viewedcart events in the visit\n ** I Total number of viewedcatalog events in the visit\n ** J Total number of viewedhome events in the visit\n ** K Total number of viewedproduct events in the visit\n ** p Total number of evented pages loaded in visit\n */\n\n var z1_features = localStorage.getItem('z1_features');\n if (!z1_features) {\n z1_features = \"0|0|0|0|0|0|0|0|0|0|0|0|0|0\";\n }\n\n z1_features_arr = z1_features.split('|');\n\n z1_features_arr[0] = Number(z1_features_arr[0]) + 1; //n\n\n if (evtName.toLocaleLowerCase() == '_ws_addedtobag') {\n z1_features_arr[1] = Number(z1_features_arr[1]) + 1;\n } else if (evtName.toLocaleLowerCase() == 'breachedgeofence') {\n z1_features_arr[2] = Number(z1_features_arr[2]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_completeshipping') {\n z1_features_arr[3] = Number(z1_features_arr[3]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == 'exitgeofence') {\n z1_features_arr[4] = Number(z1_features_arr[4]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_placedorder') {\n z1_features_arr[5] = Number(z1_features_arr[5]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_searched') {\n z1_features_arr[6] = Number(z1_features_arr[6]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_startedcheckout') {\n z1_features_arr[7] = Number(z1_features_arr[7]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_viewedcart') {\n z1_features_arr[8] = Number(z1_features_arr[8]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_viewedcatalog') {\n z1_features_arr[9] = Number(z1_features_arr[9]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_viewedhome') {\n z1_features_arr[10] = Number(z1_features_arr[10]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_viewedproduct') {\n z1_features_arr[11] = Number(z1_features_arr[11]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_completepayment') {\n z1_features_arr[13] = Number(z1_features_arr[13]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n }\n\n z1_features = z1_features_arr[0] + '|' + z1_features_arr[1] + '|' + z1_features_arr[2] + '|' + z1_features_arr[3] + '|' + z1_features_arr[4] + '|' + z1_features_arr[5] + '|' + z1_features_arr[6] + '|' + z1_features_arr[7] + '|' + z1_features_arr[8] + '|' + z1_features_arr[9] + '|' + z1_features_arr[10] + '|' + z1_features_arr[11] + '|' + z1_features_arr[12] + '|' + z1_features_arr[13];\n localStorage.setItem('z1_features', z1_features);\n }\n\n\n\n function getCartData() {\n if (pageData && pageData.customerDetails) {\n if (!isSoftLoggedIn || (isSoftLoggedIn && !isSoftLoggedIn.includes(\"true\"))) {\n if (pageData.customerDetails.isLoggedIn) isLoggedIn = \"true\";\n }\n }\n\n var cartData = localStorage.getItem('persistent_bar_components_json_v1');\n //if (debugScr) console.log(\"[ZineOne] CartData = \" + cartData);\n var cartInfo = JSON.parse(cartData);\n var productsArr = [];\n\n //Send the Event even if the Cart does not have any item, so that the OpenAPI could be called\n //on the Server side\n\n if (cartInfo == null || cartInfo.cartItems == null || cartInfo.cartItems.length <= 0)\n return true;\n\n for (var i = 0; i < cartInfo.cartItems.length; i++) {\n var si = cartInfo.cartItems[i];\n var saleUnitprice = 0;\n var regularUnitPrice = 0;\n if (!si.itemPriceInfo && !si.itemPriceInfo.saleUnitprice)\n saleUnitprice = si.itemPriceInfo.saleUnitprice;\n\n if (!si.itemPriceInfo && !si.itemPriceInfo.regularUnitPrice)\n regularUnitPrice = si.itemPriceInfo.regularUnitPrice;\n var obj = {\n \"id\": si.cartItemId,\n \"skuCode\": si.skuId,\n \"webID\": si.productId,\n \"saleUnitPrice\": saleUnitprice.toString(),\n \"regularUnitPrice\": regularUnitPrice.toString()\n };\n productsArr.push(obj);\n //if (debugScr) console.log(\"[ZineOne] Product Array ==>\" + productsArr);\n }\n //if (debugScr) console.log(\"[ZineOne] Out of loop\");\n if (debugScr) console.log(\"[ZineOne] Product Array ==>\" + productsArr);\n return JSON.stringify(productsArr);\n }\n\n\n\n function addEventData() {\n\n \tvar evtData = {};\n\n if (pageData && pageData.customerDetails) {\n if (!isSoftLoggedIn || (isSoftLoggedIn && !isSoftLoggedIn.includes(\"true\"))) {\n if (pageData.customerDetails.isLoggedIn) isLoggedIn = \"true\";\n }\n\n \n } else {\n if (debugScr) console.log(\"[ZineOne] pageData NOT initialized. Cannot set customerId or login state.\");\n }\n\n var itemsInBag = 0;\n var cartItems, cartId, cartTotalValue, cartSubTotalValue, cartShippingValue, cartDiscountValue;\n if (pageData && pageData.cartDetails) {\n itemsInBag = pageData.cartDetails.numberOfItems;\n if (debugScr) console.log('[ZineOne] Number of Items in the cart: ' + itemsInBag);\n cartId = pageData.cartDetails.cartID;\n cartTotalValue = pageData.cartDetails.cartTotalValue;\n cartSubTotalValue = pageData.cartDetails.cartSubTotalValue;\n cartShippingValue = pageData.cartDetails.shippingValue;\n cartDiscountValue = pageData.cartDetails.discountValue;\n\n //cartItems = pageData.cartDetails.cartItems;\n cartItems = getCartData();\n if (debugScr) console.log(\"[ZineOne] cartItems ==>\" + cartItems);\n }\n\n //ZineOne.setCustomKey(\"customerId\", RRTrackingBean.profileId);\n // replace e with var from webstore page (consider profile attr per Manish)\n // maybe do on page unload so you grab it once on first page and use it afterwards\n evtData.itemsInBag = itemsInBag;\n if (cartId) evtData.cartId = cartId;\n if (cartTotalValue) evtData.cartTotalValue = cartTotalValue;\n if (cartSubTotalValue) evtData.cartSubTotalValue = cartSubTotalValue;\n if (cartShippingValue) evtData.cartShippingValue = cartShippingValue;\n if (cartDiscountValue) evtData.cartDiscountValue = cartDiscountValue;\n if (cartItems) evtData.cartItems = cartItems;\n if (debugScr) console.log(\"[ZineOne] cartItems ==>\" + cartItems);\n\n\n if (isSoftLoggedIn) evtData[\"isSoftLoggedIn\"] = isSoftLoggedIn;\n if (isLoggedIn) evtData[\"isLoggedIn\"] = isLoggedIn;\n if (debugScr) console.log(\"[ZineOne] evtName = \" + evtName);\n if (debugScr) console.log(\"[ZineOne] evtData =\" + JSON.stringify(evtData));\n\n\n return evtData;\n }\n\n\n}\n\ncatch (ie) {\n if (debugScr) console.log(\"[Zineone] Error in Tag Script: Catalog Filter Z1 tag. \" + ie);\n}\n\ntry {\n\n\n\n\tvar isSoftLoggedIn = getCookie(\"SoftLoggedInCookie\");\n if (isSoftLoggedIn && isSoftLoggedIn.includes(\"true\")) {\n if (debugScr) console.log(\"[ZineOne] Soft Logged value is:\" + isSoftLoggedIn);\n }\n // Set HardLoggedIn = true only if user is not SoftLoggedIn\n var isLoggedIn = \"\";\n\n if (!isSoftLoggedIn || (isSoftLoggedIn && !isSoftLoggedIn.includes(\"true\"))) {\n if (pageData.customerDetails.isLoggedIn) isLoggedIn = \"true\";\n }\n\n\n\n\tvar currentCN = getUrlParameter('CN');\n\n\tvar MAX_CN_CHECK = 10;\n\tvar CURRENT_CN_CHECK = 0;\n\n\n\tdocument.addEventListener('click',function(e){\n\n\t\tconsole.log('E Target ',e.target.className);\n\n\t\tvar classNameArr = e.target.className.toString().split('facet_checkbox');\n\t\tvar ceAjaxArr = e.target.className.toString().split('ce-ajax');\n\t\tvar checkmarkArr = e.target.className.toString().split('checkmark');\n\t\t\n\n\t\tconsole.log('Class Name Length '+classNameArr.length);\n\n \tif(e.target && (classNameArr.length > 1 || ceAjaxArr.length > 1 || checkmarkArr.length > 1)){\n\n evtName = '_ws_viewedCatalog';\n\n \t\tCURRENT_CN_CHECK = 0;\n\t\t\tcheckForCNUpdate();\n\n \t}});\n\n //Check for Sorting Dropdown\n var selectFilter = document.getElementById('sortby_select');\n selectFilter.onchange = function(){\n\n evtName = '_ws_changedsort';\n\n updateUserVectors();\n\n console.log('selectFilter Change',selectFilter);\n\n };\n\n}\n\ncatch (ie) {\n if (debugScr) console.log(\"[Zineone] Error in Tag Script: Catalog Filter Z1 tag. \" + ie);\n}","eventName":"load","pageSelector":{"type":"pgName","condition":"contains","val":"catalog/"}},{"tagName":"Search Filter","actionType":"z1script","script":"\ntry {\n\n\n\tvar debugScr = true;\n var cartValue = 0;\n var currentUserCartArr = [];\n\n var isJsonNull = false;\n\n\n\tvar evtName = '_ws_searched';\n\n\n\t//Event Codes for vectors:\n var eventCodes = {\n _ws_addedtobag: \"A\",\n breachedgeofence: \"B\",\n _ws_completeshipping: \"C\",\n exitgeofence: \"D\",\n _ws_placedorder: \"E\",\n _ws_searched: \"F\",\n _ws_startedcheckout: \"G\",\n _ws_viewedcart: \"H\",\n _ws_viewedcatalog: \"I\",\n _ws_viewedhome: \"J\",\n _ws_viewedproduct: \"K\",\n _ws_completepayment: \"L\",\n _ws_viewedsku: \"M\",\n _ws_update_hcart: \"N\",\n _ws_changedsort: \"O\",\n _ws_rto: \"R\"\n\n };\n var SESSION_GAP = 1800000; //30min = 30*60*1000 millis\n\n function isValid(value) {\n if (value == \"null\" || value == \"undefined\" || value == null || value == undefined) {\n return false;\n }\n\n return true;\n }\n\n\tfunction getUrlParameter(sParam) \n\t{\n\t\tvar sPageURL = decodeURIComponent(window.location.search.substring(1)),\n\t sURLVariables = sPageURL.split('&'),\n\t sParameterName,\n\t i;\n\n\t for (i = 0; i < sURLVariables.length; i++) {\n\t sParameterName = sURLVariables[i].split('=');\n\n\t if (sParameterName[0] === sParam) {\n\t return sParameterName[1] === undefined ? true : sParameterName[1];\n\t }\n\t }\n }\n\n function checkForCNUpdate()\n {\n \tCURRENT_CN_CHECK++;\n\n \tconsole.log(' checkForCNUpdate '+CURRENT_CN_CHECK+'::'+MAX_CN_CHECK);\n\n \tif(CURRENT_CN_CHECK <= MAX_CN_CHECK)\n \t{\n \t\tvar tempCN = getUrlParameter('CN');\n\n \t\tconsole.log(currentCN+' CHecking CN '+tempCN);\n\n \t\tif(tempCN == currentCN)\n \t\t{\n \t\t\tsetTimeout(function(){ \n \t\t\t\tcheckForCNUpdate(); \n \t\t\t}, 1000);\n\n\t\t\t\t\n\t\t\t\treturn;\n \t\t}\n \t\telse\n \t\t{\n\n \t\t\tcurrentCN = getUrlParameter('CN');\n\n \t\t\tvar evtData = addEventData();\n \t\t\tZineOne.pushEvent(evtName, evtData);\n updateUserVectors();\n\n \t\t}\n \t}\n \t\n }\n\n\n function validateForNotNull(obj)\n {\n //console.log('validateForNotNull',obj,typeof(obj));\n if(!(obj === undefined) && obj != null && obj != 'null' && obj.toString().length != 0)\n {\n return true;\n }\n\n return false;\n }\n\n function spltArrayObjectDataIntoVector(array,attribute)\n {\n var stringVector = '';\n\n console.log(\"spltArrayObjectDataIntoVector attribute\",attribute,array);\n\n if (!validateForNotNull(array)) {\n\n return stringVector;\n\n }\n\n if(array.length == 0)\n {\n return stringVector;\n }\n\n\n for(var i=0;i<array.length;i++)\n {\n var innerObj = array[i];\n\n var attributeValue = '#';\n if (validateForNotNull(innerObj) && validateForNotNull(innerObj[attribute])) {\n\n attributeValue = innerObj[attribute];\n\n }\n \n\n stringVector = stringVector + attributeValue + '^';\n }\n\n stringVector = stringVector.substring(0,stringVector.length-1);\n\n return stringVector;\n\n }\n\n function spltArrayObjectWithArrayObjectDataIntoVector(array,mainAttribute,innerAttribute)\n {\n var stringVector = '';\n\n console.log(\"spltArrayObjectWithArrayObjectDataIntoVector mainAttribute\",mainAttribute,innerAttribute,array);\n\n\n if (!validateForNotNull(array)) {\n\n return stringVector;\n\n }\n\n if(array.length == 0)\n {\n return stringVector;\n }\n\n\n for(var i=0;i<array.length;i++)\n {\n var innerObj = array[i];\n var attributeValueArr = innerObj[mainAttribute];\n\n console.log('spltArrayObjectDataIntoVector ',spltArrayObjectDataIntoVector(attributeValueArr,innerAttribute));\n stringVector = stringVector + spltArrayObjectDataIntoVector(attributeValueArr,innerAttribute) + '^';\n }\n\n stringVector = stringVector.substring(0,stringVector.length-1);\n\n return stringVector;\n\n }\n\n\n function spltArrayObjectWithAttributeObjectDataIntoVector(array,mainAttribute,innerAttribute)\n {\n\n var stringVector = '';\n\n if (!validateForNotNull(array)) {\n\n return stringVector;\n\n }\n\n if(array.length == 0)\n {\n return stringVector;\n }\n\n for(var i=0;i<array.length;i++)\n {\n var innerObj = array[i];\n\n var attributeValue = '-';\n if (validateForNotNull(innerObj) && validateForNotNull(innerObj[mainAttribute]) && validateForNotNull(innerObj[mainAttribute][innerAttribute])) {\n\n attributeValue = innerObj[mainAttribute][innerAttribute];\n\n }\n \n\n stringVector = stringVector + attributeValue + '~';\n }\n\n stringVector = stringVector.substring(0,stringVector.length-1);\n\n return stringVector;\n\n }\n\n function fetchCartDump()\n {\n\n var persistLocalData = localStorage.getItem('persistent_bar_components_json_v1');\n\n if(!isValid(persistLocalData)){\n persistLocalData = JSON.stringify(Kjs.PB.getPbCartStorage());\n }\n\n if (validateForNotNull(persistLocalData)) {\n\n var finalCartJSON = {};\n finalCartJSON.cartItems = [];\n\n persistLocalData = JSON.parse(persistLocalData);\n\n cartData = persistLocalData.cartItems;\n\n if(validateForNotNull(cartData))\n {\n for(var i=0;i<cartData.length;i++)\n {\n if(i == 15)\n {\n break;\n }\n\n var currentFinalObjToSend = {};\n\n var currentObj = cartData[i];\n currentFinalObjToSend.sku = currentObj.skuId;\n currentFinalObjToSend.prdId = currentObj.productId;\n currentFinalObjToSend.qty = currentObj.quantity;\n\n if(validateForNotNull(currentObj.storeClearance))\n {\n currentFinalObjToSend.sc = currentObj.storeClearance; \n }\n \n if(validateForNotNull(currentObj.itemProperties.size))\n {\n currentFinalObjToSend.size = currentObj.itemProperties.size;\n }\n \n if(validateForNotNull(currentObj.itemProperties.color))\n {\n currentFinalObjToSend.color = currentObj.itemProperties.color;\n }\n \n if(validateForNotNull(currentObj.itemProperties.isWebExclusive))\n {\n currentFinalObjToSend.isWebExcl = currentObj.itemProperties.isWebExclusive; \n }\n \n\n var finalInvInfo = {};\n\n if(validateForNotNull(currentObj.inventoryInfo.shipAvailable))\n {\n finalInvInfo.shpAvai = currentObj.inventoryInfo.shipAvailable;\n }\n\n if(validateForNotNull(currentObj.inventoryInfo.bopusAvailable))\n {\n finalInvInfo.bopAvail = currentObj.inventoryInfo.bopusAvailable; \n }\n \n if(validateForNotNull(currentObj.inventoryInfo.bossAvailable))\n {\n finalInvInfo.bosAvail = currentObj.inventoryInfo.bossAvailable; \n }\n \n if(validateForNotNull(currentObj.inventoryInfo.invOnHandQtyShip))\n {\n finalInvInfo.invOHQShip = currentObj.inventoryInfo.invOnHandQtyShip; \n }\n \n if(validateForNotNull(currentObj.finalInvInfo))\n {\n currentFinalObjToSend.invInfo = currentObj.finalInvInfo; \n }\n \n\n var currentPromoInfo = currentObj.promoInfo;\n\n console.log(' currentPromoInfo ',currentPromoInfo);\n\n if(validateForNotNull(currentPromoInfo))\n {\n var finalPromoArray = [];\n\n var prTypeArr = [];\n var prTextArr = [];\n\n for(var j=0;j<currentPromoInfo.length;j++)\n {\n var currentPromoObj = currentPromoInfo[j];\n var tempPromoObj = {};\n\n if(validateForNotNull(currentPromoObj.promoType))\n {\n prTypeArr[prTypeArr.length] = currentPromoObj.promoType; \n }\n \n if(validateForNotNull(currentPromoObj.promoText))\n {\n prTextArr[prTextArr.length] = currentPromoObj.promoText; \n }\n \n\n\n }\n\n currentFinalObjToSend.prType = prTypeArr.join('|');\n currentFinalObjToSend.prText = prTextArr.join('|');\n }\n\n \n\n var currentOfferInfo = currentObj.offerInfo;\n\n console.log(' currentOfferInfo ',currentOfferInfo);\n\n if(validateForNotNull(currentOfferInfo))\n {\n var finalOfferInfoArray = [];\n\n for(var j=0;j<currentOfferInfo.length;j++)\n {\n var currentOfferInfoObj = currentOfferInfo[j];\n var tempOfferInfoObj = {};\n\n if(validateForNotNull(currentOfferInfoObj.offerDiscount))\n {\n tempOfferInfoObj.ofDis = currentOfferInfoObj.offerDiscount; \n }\n \n if(validateForNotNull(currentOfferInfoObj.startDate))\n {\n tempOfferInfoObj.stDt = currentOfferInfoObj.startDate; \n }\n \n if(validateForNotNull(currentOfferInfoObj.endDate))\n {\n tempOfferInfoObj.enDT = currentOfferInfoObj.endDate; \n }\n \n\n finalOfferInfoArray[finalOfferInfoArray.length] = tempOfferInfoObj;\n\n }\n\n currentFinalObjToSend.offInfo = finalOfferInfoArray;\n }\n\n\n finalCartJSON.cartItems[finalCartJSON.cartItems.length] = currentFinalObjToSend;\n }\n }\n\n \n\n\n var shipmentInfo = persistLocalData.shipmentInfo;\n\n console.log(' shipmentInfo ',shipmentInfo);\n\n if(validateForNotNull(shipmentInfo))\n {\n var finalshipmentInfoArray = [];\n\n for(var j=0;j<shipmentInfo.length;j++)\n {\n var currentshipmentInfoObj = shipmentInfo[j];\n var tempShipmentInfoObj = {}; \n\n if(validateForNotNull(currentshipmentInfoObj.shipmentPriceInfo.originalShippingCharges))\n {\n tempShipmentInfoObj.ogShpChrgs = currentshipmentInfoObj.shipmentPriceInfo.originalShippingCharges; \n }\n \n if(validateForNotNull(currentshipmentInfoObj.shipmentPriceInfo.shippingChargesAfterDiscount))\n {\n tempShipmentInfoObj.shpChrgsADis = currentshipmentInfoObj.shipmentPriceInfo.shippingChargesAfterDiscount; \n }\n \n if(validateForNotNull(currentshipmentInfoObj.shipmentPriceInfo.freeShipQualificationDelta))\n {\n tempShipmentInfoObj.freeShpQlfDelta = currentshipmentInfoObj.shipmentPriceInfo.freeShipQualificationDelta; \n }\n \n if(validateForNotNull(currentshipmentInfoObj.shipmentPriceInfo.shipmentItemsTotal))\n {\n tempShipmentInfoObj.shpItmsTot = currentshipmentInfoObj.shipmentPriceInfo.shipmentItemsTotal; \n }\n \n\n\n var shippingOffers = currentshipmentInfoObj.shippingOffers;\n if(validateForNotNull(shippingOffers))\n {\n var finalshippingOfferArray = [];\n\n for(var k=0;k<shippingOffers.length;k++)\n {\n var currentshippingOffersObj = shippingOffers[k];\n\n if(validateForNotNull(currentshippingOffersObj.discountAmount))\n {\n finalshippingOfferArray[finalshippingOfferArray.length] = currentshippingOffersObj.discountAmount; \n }\n \n }\n\n\n tempShipmentInfoObj.disAmnt = finalshippingOfferArray.join('|');\n\n\n }\n\n finalshipmentInfoArray[finalshipmentInfoArray.length] = tempShipmentInfoObj;\n\n\n }\n\n finalCartJSON.shipmentInfo = finalshipmentInfoArray;\n }\n\n var orderSummary = persistLocalData.orderSummary; \n\n var finalOrderSummaryObj = {};\n\n if(validateForNotNull(orderSummary.merchandisePromoAmount))\n {\n finalOrderSummaryObj.merProAmnt = orderSummary.merchandisePromoAmount; \n }\n \n if(validateForNotNull(orderSummary.discountedShippingAmount))\n {\n finalOrderSummaryObj.disShpAmnt = orderSummary.discountedShippingAmount;\n }\n \n if(validateForNotNull(orderSummary.originalShippingAmount))\n {\n finalOrderSummaryObj.ogShpAmnt = orderSummary.originalShippingAmount; \n }\n \n if(validateForNotNull(orderSummary.tax) && validateForNotNull(orderSummary.tax.estimated))\n {\n finalOrderSummaryObj.taxest = orderSummary.tax.estimated; \n }\n \n if(validateForNotNull(orderSummary.tax) && validateForNotNull(orderSummary.tax.taxRate))\n {\n finalOrderSummaryObj.taxRate = orderSummary.tax.taxRate; \n }\n \n if(validateForNotNull(orderSummary.tax) && validateForNotNull(orderSummary.tax.tax))\n {\n finalOrderSummaryObj.tax = orderSummary.tax.tax; \n }\n \n if(validateForNotNull(orderSummary.totalSurcharges))\n {\n finalOrderSummaryObj.totSurgs = orderSummary.totalSurcharges; \n }\n \n if(validateForNotNull(orderSummary.totalTaxFee))\n {\n finalOrderSummaryObj.totTaxFee = orderSummary.totalTaxFee; \n }\n \n if(validateForNotNull(orderSummary.totalKohlsCashAndPromoDiscounts))\n {\n finalOrderSummaryObj.totKCAProDis = orderSummary.totalKohlsCashAndPromoDiscounts; \n }\n \n if(validateForNotNull(orderSummary.totalTax))\n {\n finalOrderSummaryObj.totTax = orderSummary.totalTax; \n }\n \n if(validateForNotNull(orderSummary.total))\n {\n finalOrderSummaryObj.total = orderSummary.total; \n }\n \n if(validateForNotNull(orderSummary.savings))\n {\n finalOrderSummaryObj.sav = orderSummary.savings; \n }\n \n if(validateForNotNull(orderSummary.taxFeeEnabled))\n {\n finalOrderSummaryObj.taxFeeE = orderSummary.taxFeeEnabled; \n }\n\n finalCartJSON.orderSummary = finalOrderSummaryObj;\n\n return JSON.stringify(finalCartJSON);\n\n }\n\n return null;\n\n\n }\n\n\n function onceInSessionAttributes(eventData) {\n var finalReturnObj = eventData;\n\n var persistLocalData = localStorage.getItem('persistent_bar_components_json_v1');\n\n if(!isValid(persistLocalData)){\n persistLocalData = JSON.stringify(Kjs.PB.getPbCartStorage());\n }\n\n if (validateForNotNull(persistLocalData)) {\n\n var pageDataJson = pageData;\n persistLocalData = JSON.parse(persistLocalData);\n\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.incentiveAmount)) {\n finalReturnObj.incdet_incamnt = persistLocalData.incentiveDetails.incentiveAmount;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.incentiveType)) {\n finalReturnObj.incdet_inctype = persistLocalData.incentiveDetails.incentiveType;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.smartIncentiveStatus)) {\n finalReturnObj.incdet_smartincstatus = persistLocalData.incentiveDetails.smartIncentiveStatus;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.incentiveThreshold)) {\n finalReturnObj.incdet_incthreshold = persistLocalData.incentiveDetails.incentiveThreshold;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.incentiveEligible)) {\n finalReturnObj.incdet_inceligible = persistLocalData.incentiveDetails.incentiveEligible;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.incentiveQualified)) {\n finalReturnObj.incdet_incqualifed = persistLocalData.incentiveDetails.incentiveQualified;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.minCartThresholdMet)) {\n finalReturnObj.incdet_minicartthresholdmet = persistLocalData.incentiveDetails.minCartThresholdMet;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.customerHasKohlsCharge)) {\n finalReturnObj.custdet_custhaskohlschrg = persistLocalData.customerDetails.customerHasKohlsCharge;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.customerPostalCode)) {\n finalReturnObj.custdet_custpostalcode = persistLocalData.customerDetails.customerPostalCode;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.myStoreId)) {\n finalReturnObj.custdet_mystoreid = persistLocalData.customerDetails.myStoreId;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.rewardsPilotService)) {\n finalReturnObj.custdet_rewardspilotser = persistLocalData.customerDetails.rewardsPilotService;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.kohlsLoyalty2018EliteMember)) {\n finalReturnObj.custdet_lytelitemember = persistLocalData.customerDetails.kohlsLoyalty2018EliteMember;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.kohlsLoyalty2018Member)) {\n finalReturnObj.custdet_lytmember = persistLocalData.customerDetails.kohlsLoyalty2018Member;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.rewards) && validateForNotNull(persistLocalData.purchaseEarnings.rewards.loyaltyPointBalance)) {\n finalReturnObj.usrdata_lytypntbal = persistLocalData.purchaseEarnings.rewards.loyaltyPointBalance;\n }\n\n if (validateForNotNull(persistLocalData.userData) && validateForNotNull(persistLocalData.userData.optInIndicator)) {\n finalReturnObj.usrdata_optinindict = persistLocalData.userData.optInIndicator;\n }\n\n if (validateForNotNull(persistLocalData.userData) && validateForNotNull(persistLocalData.userData.accountStatus)) {\n finalReturnObj.usrdata_accstatus = persistLocalData.userData.accountStatus;\n }\n\n if (validateForNotNull(persistLocalData.userData) && validateForNotNull(persistLocalData.userData.storeNum)) {\n finalReturnObj.usrdata_strnum = persistLocalData.userData.storeNum;\n }\n\n if (validateForNotNull(persistLocalData.userData) && validateForNotNull(persistLocalData.userData.isEnrolledUser)) {\n finalReturnObj.usrdata_isenrusr = persistLocalData.userData.isEnrolledUser;\n }\n\n if (validateForNotNull(persistLocalData.userData) && validateForNotNull(persistLocalData.userData.sessionStatus)) {\n finalReturnObj.usrdata_sesstatus = persistLocalData.userData.sessionStatus;\n }\n\n if (validateForNotNull(pageDataJson.pageDetails) && validateForNotNull(pageDataJson.pageDetails.browserPostalCode)) {\n finalReturnObj.pgdata_pgdet_brwpostalcode = pageDataJson.pageDetails.browserPostalCode;\n }\n\n if (validateForNotNull(pageDataJson.customerDetails) && validateForNotNull(pageDataJson.customerDetails.customerPostalCode)) {\n finalReturnObj.pgdata_custdet_custpostalcode = pageDataJson.customerDetails.customerPostalCode;\n }\n\n\n\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.rewards) && validateForNotNull(persistLocalData.purchaseEarnings.rewards.awayPoints)) {\n finalReturnObj.purear_rwds_awaypnts = persistLocalData.purchaseEarnings.rewards.awayPoints;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.rewards) && validateForNotNull(persistLocalData.purchaseEarnings.rewards.ltyRewardThresholdValue)) {\n finalReturnObj.purear_rwds_lytrwdthreshval = persistLocalData.purchaseEarnings.rewards.ltyRewardThresholdValue;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.rewards) && validateForNotNull(persistLocalData.purchaseEarnings.rewards.loyaltyPointBalance)) {\n finalReturnObj.purear_rwds_lytpntbal = persistLocalData.purchaseEarnings.rewards.loyaltyPointBalance;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.rewards) && validateForNotNull(persistLocalData.purchaseEarnings.rewards.currentPurchaseEarnPoint)) {\n finalReturnObj.purear_rwds_curpurearnpnt = persistLocalData.purchaseEarnings.rewards.currentPurchaseEarnPoint;\n }\n\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash.qualificationAmount)) {\n finalReturnObj.purear_kc_qlfyamnt = persistLocalData.purchaseEarnings.kohlsCash.qualificationAmount;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash.earnAmount)) {\n finalReturnObj.purear_kc_earnamnt = persistLocalData.purchaseEarnings.kohlsCash.earnAmount;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash.currentPurchaseEarnAmount)) {\n finalReturnObj.purear_kc_curpurearnamnt = persistLocalData.purchaseEarnings.kohlsCash.currentPurchaseEarnAmount;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash.awayAmount)) {\n finalReturnObj.purear_kc_awayamnt = persistLocalData.purchaseEarnings.kohlsCash.awayAmount;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCashEarnings)) {\n finalReturnObj.purear_kcearnings = persistLocalData.purchaseEarnings.kohlsCashEarnings;\n }\n\n if (validateForNotNull(persistLocalData.addressDetails) && validateForNotNull(persistLocalData.addressDetails.billingAddress[0]) && validateForNotNull(persistLocalData.addressDetails.billingAddress[0].postalCode)) {\n finalReturnObj.addrdet_biladdr_postalcode = spltArrayObjectDataIntoVector(persistLocalData.addressDetails.billingAddress, 'postalCode');\n }\n\n }\n\n return finalReturnObj;\n }\n\n\n function fetchFilterData(cnString,oldCnFromEvent)\n {\n var finalReturnString = '';\n\n var splitCnString = cnString.toString().split(\"+\");\n\n var currentFilterObj = {};\n var oldCnFromEventSplit = oldCnFromEvent.toString().split(\"|\");\n\n //console.log('oldCnFromEventSplit',oldCnFromEventSplit,oldCnFromEventSplit.length);\n\n for(var i=(oldCnFromEventSplit.length-1);i>=0;i--)\n {\n if(oldCnFromEventSplit[i].length == 0 || oldCnFromEventSplit[i] == '-')\n {\n continue;\n }\n\n var innerObj = oldCnFromEventSplit[i].split(\"+\");\n\n if(innerObj.length > 0)\n {\n for(var k=0;k<innerObj.length;k++)\n {\n var filterObj = innerObj[k].split(\":\");\n var filterName = filterObj[0];\n var filterValue = filterObj[1];\n\n currentFilterObj[filterName] = filterValue;\n }\n\n break;\n }\n \n }\n\n var alreadyUsedObj = {};\n\n //console.log(splitCnString);\n for(var i=0;i<splitCnString.length;i++)\n {\n var filterObj = splitCnString[i].split(\":\");\n var filterName = filterObj[0];\n\n //console.log('Filter Name ',filterName);\n //console.log('Filter Value ',filterValue);\n\n if(filterName in alreadyUsedObj)\n {\n continue;\n }\n\n alreadyUsedObj[filterName] = true;\n \n if(filterName in currentFilterObj)\n {\n currentFilterObj[filterName] = Number(currentFilterObj[filterName]) + 1;\n }\n else\n {\n currentFilterObj[filterName] = 1;\n }\n\n\n }\n\n //console.log('currentFilterObj',currentFilterObj);\n\n var filterkeys = Object.keys(currentFilterObj);\n for(var i=0;i<filterkeys.length;i++)\n {\n finalReturnString = finalReturnString + filterkeys[i] + ':' + currentFilterObj[filterkeys[i]] + '+';\n }\n\n finalReturnString = finalReturnString.substring(0,finalReturnString.length - 1);\n\n return finalReturnString;\n\n\n }\n\n function fetchNewAttributesForVectorization(eventData,eventName) {\n var finalReturnObj = eventData;\n\n var persistLocalData = localStorage.getItem('persistent_bar_components_json_v1');\n\n if (validateForNotNull(persistLocalData)) \n {\n var pageDataJson = pageData;\n\n persistLocalData = JSON.parse(persistLocalData);\n\n console.log('Into switch in fetchNewAttributesForVectorization',eventName);\n\n switch(eventName)\n {\n case \"_ws_searched\":\n\n if (validateForNotNull(pageDataJson.pmpDetails) && validateForNotNull(pageDataJson.pmpDetails.keywords)) {\n finalReturnObj.pgdata_pmpdet_search_keywords = pageDataJson.pmpDetails.keywords;\n }\n\n \n\n\n var newUserVectors = localStorage.getItem('z1_newUserVectors');\n\n if(newUserVectors && newUserVectors.length > 0)\n {\n var newUserVectorsJson = JSON.parse(newUserVectors);\n var currentFilterString = newUserVectorsJson.filter_by_count;\n\n if(validateForNotNull(getUrlParameter('CN')) && validateForNotNull(currentFilterString))\n {\n finalReturnObj.filter_by_count = fetchFilterData(getUrlParameter('CN'),currentFilterString); \n }\n \n }\n else\n {\n if(validateForNotNull(getUrlParameter('CN')))\n {\n finalReturnObj.filter_by_count = fetchFilterData(getUrlParameter('CN'),''); \n }\n \n }\n \n\n break;\n\n case '_ws_changedsort':\n\n var selectFilter = document.getElementById('sortby_select');\n if(selectFilter)\n {\n var selectedValue = selectFilter.options[selectFilter.selectedIndex].value;\n if(validateForNotNull(selectedValue))\n {\n finalReturnObj.sort_by = selectedValue;\n }\n }\n\n\n break;\n\n\n }\n }\n\n\n return finalReturnObj;\n\n }\n\n function fetchMcmId()\n {\n var mcid = (typeof Visitor != 'undefined') ? Visitor.getInstance('F0EF5E09512D2CD20A490D4D@AdobeOrg') : '';\n var mcmId = (mcid ? mcid.getMarketingCloudVisitorID() : '');\n\n return mcmId;\n }\n\n\n function getPresentVector() {\n try {\n\n console.log('getPresentVector');\n\n var itemsInBag = 0;\n\n cartValue = 0;\n\n isJsonNull = false;\n\n var cartData = localStorage.getItem(\"persistent_bar_components_json_v1\");\n if(isValid(cartData))\n {\n var cartInfo = JSON.parse(cartData);\n\n for (var i = 0; i < cartInfo.cartItems.length; i++) {\n itemsInBag = itemsInBag + cartInfo.cartItems[i].quantity;\n\n cartValue = cartValue + Number(cartInfo.cartItems[i].itemPriceInfo.grossPrice);\n\n var tempObj = {};\n tempObj.productId = cartInfo.cartItems[i].productId;\n tempObj.skuId = cartInfo.cartItems[i].skuId;\n tempObj.quantity = cartInfo.cartItems[i].quantity;\n tempObj.itemType = cartInfo.cartItems[i].itemType;\n\n currentUserCartArr.push(tempObj);\n }\n }\n else\n {\n if(getCookie('VisitorBagTotals').toString().length != 0)\n {\n cartValue = -1;\n\n isJsonNull = true;\n }\n }\n\n\n if (cartValue == 0 && (typeof pageData != 'undefined') && pageData.cartDetails && pageData.cartDetails.cartSubTotalValue) {\n cartValue = Number(pageData.cartDetails.cartSubTotalValue);\n }\n\n\n\n \n\n var presentVector = {};\n presentVector.event = eventCodes[evtName.toLocaleLowerCase()] || evtName; //common to all\n presentVector.productID = '-'; //ViewedProduct, AddedToBag\n presentVector.itemsInBag = itemsInBag || 0; //common to all\n presentVector.originalPrice = '-';\n presentVector.salePrice = '-';\n presentVector.KC = '-'; //Think\n presentVector.PDPCategory = '-'; //\n presentVector.department = '-';\n presentVector.CN = '-';\n presentVector.keywords = '-';\n presentVector.visualNavForm = '-';\n presentVector.pageFilter = '-';\n presentVector.searchType = '-';\n presentVector.userPFM = '-';\n presentVector.loginstatus = (isLoggedIn) ? 'full' : (isSoftLoggedIn ? 'soft' : '-');\n presentVector.onSale = '-';\n presentVector.time = new Date().getTime();\n\n //New Ml Vectors\n\n presentVector.pgdata_pmpdet_catname = '-';\n presentVector.pgdata_pmpdet_subcatname = '-';\n presentVector.pgdata_pmpdet_findingname = '-';\n presentVector.pgdata_pmpdet_cat_keywords = '-';\n presentVector.pgdata_pmpdet_pgfilter = '-';\n presentVector.pgdata_pmpdet_deptname = '-';\n presentVector.pgdata_pmpdet_gendervalues = '-';\n presentVector.pgdata_pmpdet_search_keywords = '-';\n presentVector.pgdata_proddet_colid = '-';\n presentVector.pgdata_pddetails_clientpostalcode = '-';\n presentVector.selected_sku_color = '-';\n presentVector.selected_sku_size = '-';\n presentVector.selected_sku = '-';\n //presentVector.selected_sku_regular_price = '-';\n presentVector.selected_sku_sale_price = '-';\n\n presentVector.c_i_size = '-';\n presentVector.c_i_color = '-';\n presentVector.c_i_isweb = '-';\n presentVector.c_sclearance = '-';\n presentVector.c_i_shipavailable = '-';\n presentVector.c_i_bopusAval = '-';\n presentVector.c_i_bossAval = '-';\n presentVector.c_i_invShip = '-';\n presentVector.c_i_invBopus = '-';\n presentVector.c_i_invBoss = '-';\n presentVector.c_o_offDis = '-';\n presentVector.c_o_sdate = '-';\n presentVector.c_o_edate = '-';\n presentVector.c_p_type = '-';\n presentVector.c_p_ptext = '-';\n presentVector.shpi_shpp_ogshpchrgs = '-';\n presentVector.shpi_shpp_shpchrgsafdis = '-';\n presentVector.shpi_shpp_freeshpqlfdelta = '-';\n presentVector.shpi_shpp_shpitmstotal = '-';\n presentVector.shpi_shpo_disamnt = '-';\n presentVector.or_merpromoamnt = '-';\n presentVector.or_disshpamnt = '-';\n presentVector.or_ogshpamnt = '-';\n presentVector.or_tax_est = '-';\n presentVector.or_tax_taxrt = '-';\n presentVector.or_tax_tax = '-';\n presentVector.or_totalsur = '-';\n presentVector.or_totaltaxfree = '-';\n presentVector.or_totalkcpromodis = '-';\n presentVector.or_totaltax = '-';\n presentVector.or_total = '-';\n presentVector.or_savings = '-';\n presentVector.or_taxfeeen = '-';\n\n presentVector.removed_sku = '-';\n presentVector.updated_sku = '-';\n presentVector.updated_sku_qty = '-';\n\n presentVector.prod_sku_count = '-';\n presentVector.sku_reg_price = '-';\n presentVector.sku_per_dis = '-';\n presentVector.sku_bopus_avail = '-';\n presentVector.sku_boss_avail = '-';\n presentVector.sku_ship_avail = '-';\n\n presentVector.filter_by_count = '-';\n presentVector.sort_by = '-';\n\n presentVector.pgdata_proddet_catname = '-';\n presentVector.pgdata_proddet_subcatname = '-';\n presentVector.pgdata_proddet_deptname = '-';\n\n presentVector.selected_prd_id = '-';\n\n presentVector.rto_data = '-';\n\n if (evtName.toLocaleLowerCase() == '_ws_searched') {\n\n presentVector.keywords = (pageData.pmpDetails && pageData.pmpDetails && pageData.pmpDetails.keywords) || '-';\n \n presentVector.CN = getUrlParameter('CN') || '-';\n presentVector.visualNavForm = getUrlParameter('VisualNavFrom') || '-';\n\n var isFrmRecentSearch = getUrlParameter('isFrmRecentSearch');\n var isFrmTypeAhead = getUrlParameter('isFrmTypeAhead');\n presentVector.searchType = (isFrmRecentSearch == 'TRUE' && isFrmTypeAhead == 'TRUE') ? 'recent+typeahead' : (isFrmRecentSearch == 'TRUE' ? 'recent' : (isFrmTypeAhead == 'TRUE' ? 'typeahead' : '-'));\n\n }\n\n presentVector = fetchNewAttributesForVectorization(presentVector,evtName);\n\n if (debugScr) console.log(\"presentVector:\" + JSON.stringify(presentVector));\n\n //viewedhome/viewedcart do not require additional processing\n //addedtobag/placedorder have seperate tags\n\n return presentVector;\n } catch (ie) {\n console.log('[ZineOne getPresentVector] : ' + ie);\n }\n }\n\n\n function updateUserVectors() {\n try {\n\n console.log('Into updateUserVectors');\n var presentVector = getPresentVector();\n var previousVector = JSON.parse(localStorage.getItem('z1_previousVector'));\n var z1_sessionStart_ts = JSON.parse(localStorage.getItem('z1_sessionStart_ts'));\n\n var z1_features = localStorage.getItem('z1_features') || \"\";\n //Check if local Storage has userVector available\n var userVectors = JSON.parse(localStorage.getItem('z1_userVectors'));\n var newUserVectors = JSON.parse(localStorage.getItem('z1_newUserVectors'));\n\n //Updated the logic to send the Sequence if diff between present and previous event is more than 10 mins\n //if(previousVector && previousVector.time && previousVector.time < z1_sessionStart_ts){\n if (previousVector && previousVector.time && presentVector && presentVector.time && Number(presentVector.time) - Number(previousVector.time) > SESSION_GAP) {\n console.log(\"New Session has started since the last Event\");\n //Changes to visitGap for gap between n-1 and nth session\n var visitGap = localStorage.getItem('visitGap');\n //Check if null or undefined\n if (!visitGap || typeof visitGap == undefined || visitGap == 'undefined') {\n visitGap = '';\n }\n\n try{\n\n var oldSessionStartTime = userVectors.timeVector.toString().split('|')[0];\n\n\n var vectorsEventData = {};\n\n vectorsEventData = onceInSessionAttributes(vectorsEventData);\n\n\n var cartDump = fetchCartDump();\n\n if(validateForNotNull(cartDump))\n {\n cartDump = JSON.parse(cartDump);\n\n var cartKeys = Object.keys(cartDump);\n for(var k=0;k<cartKeys.length;k++)\n {\n vectorsEventData[cartKeys[k]] = JSON.stringify(cartDump[cartKeys[k]]);\n }\n }\n\n\n vectorsEventData.z1_userVectors = JSON.stringify(userVectors);\n vectorsEventData.z1_features = z1_features;\n vectorsEventData.visitGap = visitGap;\n vectorsEventData.session_start_time = presentVector.time;\n vectorsEventData.old_session_start_time = oldSessionStartTime;\n\n\n if(validateForNotNull(newUserVectors))\n {\n var newVectorKeys = Object.keys(newUserVectors);\n for(var k=0;k<newVectorKeys.length;k++)\n {\n vectorsEventData[newVectorKeys[k]] = newUserVectors[newVectorKeys[k]];\n }\n }\n\n ZineOne.pushEvent('_ws_updatevectors', vectorsEventData);\n }\n catch (ieInner) {\n\n var errorObj = {};\n errorObj.p1 = ieInner.message;\n errorObj.p2 = '2. searchFilter ';\n\n ZineOne.pushEvent('_ws_logs', errorObj);\n\n }\n\n\n localStorage.setItem('visitGap', Number(presentVector.time) - Number(previousVector.time));\n localStorage.removeItem('z1_userVectors');\n localStorage.removeItem('z1_features');\n console.log(\"z1_userVectors removed from local storage\");\n userVectors = null;\n newUserVectors = null;\n }\n\n if (!userVectors) {\n userVectors = {};\n userVectors.eventVector = presentVector.event;\n userVectors.timeVector = presentVector.time;\n userVectors.productVector = presentVector.productID;\n userVectors.originalPrice = presentVector.originalPrice;\n userVectors.salePrice = presentVector.salePrice;\n userVectors.PDPCategory = presentVector.PDPCategory;\n userVectors.CN = presentVector.CN;\n userVectors.itemsInBag = presentVector.itemsInBag;\n\n newUserVectors = {};\n newUserVectors.pgdata_pmpdet_catname = presentVector.pgdata_pmpdet_catname;\n newUserVectors.pgdata_pmpdet_subcatname = presentVector.pgdata_pmpdet_subcatname;\n newUserVectors.pgdata_pmpdet_findingname = presentVector.pgdata_pmpdet_findingname;\n newUserVectors.pgdata_pmpdet_cat_keywords = presentVector.pgdata_pmpdet_cat_keywords;\n newUserVectors.pgdata_pmpdet_pgfilter = presentVector.pgdata_pmpdet_pgfilter;\n newUserVectors.pgdata_pmpdet_deptname = presentVector.pgdata_pmpdet_deptname;\n newUserVectors.pgdata_pmpdet_gendervalues = presentVector.pgdata_pmpdet_gendervalues;\n newUserVectors.pgdata_pmpdet_search_keywords = presentVector.pgdata_pmpdet_search_keywords;\n newUserVectors.pgdata_proddet_colid = presentVector.pgdata_proddet_colid;\n newUserVectors.pgdata_pddetails_clientpostalcode = presentVector.pgdata_pddetails_clientpostalcode;\n newUserVectors.selected_sku_color = presentVector.selected_sku_color;\n newUserVectors.selected_sku_size = presentVector.selected_sku_size;\n newUserVectors.selected_sku = presentVector.selected_sku;\n //newUserVectors.selected_sku_regular_price = presentVector.selected_sku_regular_price;\n newUserVectors.selected_sku_sale_price = presentVector.selected_sku_sale_price;\n\n\n\n newUserVectors.c_i_size = presentVector.c_i_size;\n newUserVectors.c_i_color = presentVector.c_i_color;\n newUserVectors.c_i_isweb = presentVector.c_i_isweb;\n newUserVectors.c_sclearance = presentVector.c_sclearance;\n newUserVectors.c_i_shipavailable = presentVector.c_i_shipavailable;\n newUserVectors.c_i_bopusAval = presentVector.c_i_bopusAval;\n newUserVectors.c_i_bossAval = presentVector.c_i_bossAval;\n newUserVectors.c_i_invShip = presentVector.c_i_invShip;\n newUserVectors.c_i_invBopus = presentVector.c_i_invBopus;\n newUserVectors.c_i_invBoss = presentVector.c_i_invBoss;\n newUserVectors.c_o_offDis = presentVector.c_o_offDis;\n newUserVectors.c_o_sdate = presentVector.c_o_sdate;\n newUserVectors.c_o_edate = presentVector.c_o_edate;\n newUserVectors.c_p_type = presentVector.c_p_type;\n newUserVectors.c_p_ptext = presentVector.c_p_ptext;\n newUserVectors.shpi_shpp_ogshpchrgs = presentVector.shpi_shpp_ogshpchrgs;\n newUserVectors.shpi_shpp_shpchrgsafdis = presentVector.shpi_shpp_shpchrgsafdis;\n newUserVectors.shpi_shpp_freeshpqlfdelta = presentVector.shpi_shpp_freeshpqlfdelta;\n newUserVectors.shpi_shpp_shpitmstotal = presentVector.shpi_shpp_shpitmstotal;\n newUserVectors.shpi_shpo_disamnt = presentVector.shpi_shpo_disamnt;\n newUserVectors.or_merpromoamnt = presentVector.or_merpromoamnt;\n newUserVectors.or_disshpamnt = presentVector.or_disshpamnt;\n newUserVectors.or_ogshpamnt = presentVector.or_ogshpamnt;\n newUserVectors.or_tax_est = presentVector.or_tax_est;\n newUserVectors.or_tax_taxrt = presentVector.or_tax_taxrt;\n newUserVectors.or_tax_tax = presentVector.or_tax_tax;\n newUserVectors.or_totalsur = presentVector.or_totalsur;\n newUserVectors.or_totaltaxfree = presentVector.or_totaltaxfree;\n newUserVectors.or_totalkcpromodis = presentVector.or_totalkcpromodis;\n newUserVectors.or_totaltax = presentVector.or_totaltax;\n newUserVectors.or_total = presentVector.or_total;\n newUserVectors.or_savings = presentVector.or_savings;\n newUserVectors.or_taxfeeen = presentVector.or_taxfeeen;\n\n newUserVectors.removed_sku = presentVector.removed_sku;\n newUserVectors.updated_sku = presentVector.updated_sku;\n newUserVectors.updated_sku_qty = presentVector.updated_sku_qty;\n\n newUserVectors.prod_sku_count = presentVector.prod_sku_count;\n newUserVectors.sku_reg_price = presentVector.sku_reg_price;\n newUserVectors.sku_per_dis = presentVector.sku_per_dis;\n newUserVectors.sku_bopus_avail = presentVector.sku_bopus_avail;\n newUserVectors.sku_boss_avail = presentVector.sku_boss_avail;\n newUserVectors.sku_ship_avail = presentVector.sku_ship_avail;\n\n newUserVectors.filter_by_count = presentVector.filter_by_count;\n newUserVectors.sort_by = presentVector.sort_by;\n\n newUserVectors.pgdata_proddet_catname = presentVector.pgdata_proddet_catname;\n newUserVectors.pgdata_proddet_subcatname = presentVector.pgdata_proddet_subcatname;\n newUserVectors.pgdata_proddet_deptname = presentVector.pgdata_proddet_deptname;\n\n newUserVectors.selected_prd_id = presentVector.selected_prd_id;\n\n newUserVectors.rto_data = presentVector.rto_data;\n\n } else {\n userVectors.eventVector = userVectors.eventVector + '|' + presentVector.event;\n userVectors.timeVector = userVectors.timeVector + '|' + presentVector.time;\n userVectors.productVector = userVectors.productVector + '|' + presentVector.productID;\n userVectors.originalPrice = userVectors.originalPrice + '|' + presentVector.originalPrice;\n userVectors.salePrice = userVectors.salePrice + '|' + presentVector.salePrice;\n userVectors.PDPCategory = userVectors.PDPCategory + '|' + presentVector.PDPCategory;\n userVectors.CN = userVectors.CN + '|' + presentVector.CN;\n userVectors.itemsInBag = userVectors.itemsInBag + '|' + presentVector.itemsInBag;\n\n newUserVectors.pgdata_pmpdet_catname = newUserVectors.pgdata_pmpdet_catname + '|' + presentVector.pgdata_pmpdet_catname;\n newUserVectors.pgdata_pmpdet_subcatname = newUserVectors.pgdata_pmpdet_subcatname + '|' + presentVector.pgdata_pmpdet_subcatname;\n newUserVectors.pgdata_pmpdet_findingname = newUserVectors.pgdata_pmpdet_findingname + '|' + presentVector.pgdata_pmpdet_findingname;\n newUserVectors.pgdata_pmpdet_cat_keywords = newUserVectors.pgdata_pmpdet_cat_keywords + '|' + presentVector.pgdata_pmpdet_cat_keywords;\n newUserVectors.pgdata_pmpdet_pgfilter = newUserVectors.pgdata_pmpdet_pgfilter + '|' + presentVector.pgdata_pmpdet_pgfilter;\n newUserVectors.pgdata_pmpdet_deptname = newUserVectors.pgdata_pmpdet_deptname + '|' + presentVector.pgdata_pmpdet_deptname;\n newUserVectors.pgdata_pmpdet_gendervalues = newUserVectors.pgdata_pmpdet_gendervalues + '|' + presentVector.pgdata_pmpdet_gendervalues;\n newUserVectors.pgdata_pmpdet_search_keywords = newUserVectors.pgdata_pmpdet_search_keywords + '|' + presentVector.pgdata_pmpdet_search_keywords;\n newUserVectors.pgdata_proddet_colid = newUserVectors.pgdata_proddet_colid + '|' + presentVector.pgdata_proddet_colid;\n newUserVectors.pgdata_pddetails_clientpostalcode = newUserVectors.pgdata_pddetails_clientpostalcode + '|' + presentVector.pgdata_pddetails_clientpostalcode;\n newUserVectors.selected_sku_color = newUserVectors.selected_sku_color + '|' + presentVector.selected_sku_color;\n newUserVectors.selected_sku_size = newUserVectors.selected_sku_size + '|' + presentVector.selected_sku_size;\n newUserVectors.selected_sku = newUserVectors.selected_sku + '|' + presentVector.selected_sku;\n //newUserVectors.selected_sku_regular_price = newUserVectors.selected_sku_regular_price + '|' + presentVector.selected_sku_regular_price;\n newUserVectors.selected_sku_sale_price = newUserVectors.selected_sku_sale_price + '|' + presentVector.selected_sku_sale_price;\n\n\n newUserVectors.c_i_size = newUserVectors.c_i_size + '|' + presentVector.c_i_size;\n newUserVectors.c_i_color = newUserVectors.c_i_color + '|' + presentVector.c_i_color;\n newUserVectors.c_i_isweb = newUserVectors.c_i_isweb + '|' + presentVector.c_i_isweb;\n newUserVectors.c_sclearance = newUserVectors.c_sclearance + '|' + presentVector.c_sclearance;\n newUserVectors.c_i_shipavailable = newUserVectors.c_i_shipavailable + '|' + presentVector.c_i_shipavailable;\n newUserVectors.c_i_bopusAval = newUserVectors.c_i_bopusAval + '|' + presentVector.c_i_bopusAval;\n newUserVectors.c_i_bossAval = newUserVectors.c_i_bossAval + '|' + presentVector.c_i_bossAval;\n newUserVectors.c_i_invShip = newUserVectors.c_i_invShip + '|' + presentVector.c_i_invShip;\n newUserVectors.c_i_invBopus = newUserVectors.c_i_invBopus + '|' + presentVector.c_i_invBopus;\n newUserVectors.c_i_invBoss = newUserVectors.c_i_invBoss + '|' + presentVector.c_i_invBoss;\n newUserVectors.c_o_offDis = newUserVectors.c_o_offDis + '|' + presentVector.c_o_offDis;\n newUserVectors.c_o_sdate = newUserVectors.c_o_sdate + '|' + presentVector.c_o_sdate;\n newUserVectors.c_o_edate = newUserVectors.c_o_edate + '|' + presentVector.c_o_edate;\n newUserVectors.c_p_type = newUserVectors.c_p_type + '|' + presentVector.c_p_type;\n newUserVectors.c_p_ptext = newUserVectors.c_p_ptext + '|' + presentVector.c_p_ptext;\n newUserVectors.shpi_shpp_ogshpchrgs = newUserVectors.shpi_shpp_ogshpchrgs + '|' + presentVector.shpi_shpp_ogshpchrgs;\n newUserVectors.shpi_shpp_shpchrgsafdis = newUserVectors.shpi_shpp_shpchrgsafdis + '|' + presentVector.shpi_shpp_shpchrgsafdis;\n newUserVectors.shpi_shpp_freeshpqlfdelta = newUserVectors.shpi_shpp_freeshpqlfdelta + '|' + presentVector.shpi_shpp_freeshpqlfdelta;\n newUserVectors.shpi_shpp_shpitmstotal = newUserVectors.shpi_shpp_shpitmstotal + '|' + presentVector.shpi_shpp_shpitmstotal;\n newUserVectors.shpi_shpo_disamnt = newUserVectors.shpi_shpo_disamnt + '|' + presentVector.shpi_shpo_disamnt;\n newUserVectors.or_merpromoamnt = newUserVectors.or_merpromoamnt + '|' + presentVector.or_merpromoamnt;\n newUserVectors.or_disshpamnt = newUserVectors.or_disshpamnt + '|' + presentVector.or_disshpamnt;\n newUserVectors.or_ogshpamnt = newUserVectors.or_ogshpamnt + '|' + presentVector.or_ogshpamnt;\n newUserVectors.or_tax_est = newUserVectors.or_tax_est + '|' + presentVector.or_tax_est;\n newUserVectors.or_tax_taxrt = newUserVectors.or_tax_taxrt + '|' + presentVector.or_tax_taxrt;\n newUserVectors.or_tax_tax = newUserVectors.or_tax_tax + '|' + presentVector.or_tax_tax;\n newUserVectors.or_totalsur = newUserVectors.or_totalsur + '|' + presentVector.or_totalsur;\n newUserVectors.or_totaltaxfree = newUserVectors.or_totaltaxfree + '|' + presentVector.or_totaltaxfree;\n newUserVectors.or_totalkcpromodis = newUserVectors.or_totalkcpromodis + '|' + presentVector.or_totalkcpromodis;\n newUserVectors.or_totaltax = newUserVectors.or_totaltax + '|' + presentVector.or_totaltax;\n newUserVectors.or_total = newUserVectors.or_total + '|' + presentVector.or_total;\n newUserVectors.or_savings = newUserVectors.or_savings + '|' + presentVector.or_savings;\n newUserVectors.or_taxfeeen = newUserVectors.or_taxfeeen + '|' + presentVector.or_taxfeeen;\n\n newUserVectors.removed_sku = newUserVectors.removed_sku + '|' + presentVector.removed_sku;\n newUserVectors.updated_sku = newUserVectors.updated_sku + '|' + presentVector.updated_sku;\n newUserVectors.updated_sku_qty = newUserVectors.updated_sku_qty + '|' + presentVector.updated_sku_qty;\n\n newUserVectors.prod_sku_count = newUserVectors.prod_sku_count + '|' + presentVector.prod_sku_count;\n newUserVectors.sku_reg_price = newUserVectors.sku_reg_price + '|' + presentVector.sku_reg_price;\n newUserVectors.sku_per_dis = newUserVectors.sku_per_dis + '|' + presentVector.sku_per_dis;\n newUserVectors.sku_bopus_avail = newUserVectors.sku_bopus_avail + '|' + presentVector.sku_bopus_avail;\n newUserVectors.sku_boss_avail = newUserVectors.sku_boss_avail + '|' + presentVector.sku_boss_avail;\n newUserVectors.sku_ship_avail = newUserVectors.sku_ship_avail + '|' + presentVector.sku_ship_avail;\n\n newUserVectors.filter_by_count = newUserVectors.filter_by_count + '|' + presentVector.filter_by_count;\n newUserVectors.sort_by = newUserVectors.sort_by + '|' + presentVector.sort_by;\n\n newUserVectors.pgdata_proddet_catname = newUserVectors.pgdata_proddet_catname + '|' + presentVector.pgdata_proddet_catname;\n newUserVectors.pgdata_proddet_subcatname = newUserVectors.pgdata_proddet_subcatname + '|' + presentVector.pgdata_proddet_subcatname;\n newUserVectors.pgdata_proddet_deptname = newUserVectors.pgdata_proddet_deptname + '|' + presentVector.pgdata_proddet_deptname;\n\n newUserVectors.selected_prd_id = newUserVectors.selected_prd_id + '|' + presentVector.selected_prd_id;\n\n newUserVectors.rto_data = newUserVectors.rto_data + '|' + presentVector.rto_data;\n\n }\n localStorage.setItem('z1_userVectors', JSON.stringify(userVectors));\n localStorage.setItem('z1_newUserVectors', JSON.stringify(newUserVectors));\n\n updateFeatures();\n\n //Update the previousVector\n previousVector = presentVector;\n localStorage.setItem('z1_previousVector', JSON.stringify(previousVector));\n\n //Send the Sequence on 5th and 10th Element as well\n //Fetch the updated features as they are updated \n var z1_features = localStorage.getItem('z1_features') || \"\";\n //If this is the 5th Element, send the features and vectors\n if (userVectors && userVectors.eventVector && userVectors.eventVector.split('|').length == 5) {\n console.log(\"The sequence is 5 element long\");\n //Changes to visitGap for gap between n-1 and nth session\n var visitGap = localStorage.getItem('visitGap');\n //Check if null or undefined\n if (!visitGap || typeof visitGap == undefined || visitGap == 'undefined') {\n visitGap = '';\n }\n\n var currentSessionStartTime = userVectors.timeVector.toString().split('|')[0];\n\n\n var vectorsEventData = {};\n\n var newVectorKeys = Object.keys(newUserVectors);\n for(var k=0;k<newVectorKeys.length;k++)\n {\n vectorsEventData[newVectorKeys[k]] = newUserVectors[newVectorKeys[k]];\n }\n\n vectorsEventData.z1_userVectors = JSON.stringify(userVectors);\n vectorsEventData.z1_features = z1_features;\n vectorsEventData.cartValue= cartValue;\n vectorsEventData.session_start_time = currentSessionStartTime;\n vectorsEventData.visitGap = visitGap;\n vectorsEventData.currentCart = JSON.stringify(currentUserCartArr);\n\n if(validateForNotNull(pageData) && validateForNotNull(pageData.customerDetails) && validateForNotNull(pageData.customerDetails.customerHasKohlsCharge))\n {\n vectorsEventData.isKcc = pageData.customerDetails.customerHasKohlsCharge;\n }\n else\n {\n vectorsEventData.isKcc = -1;\n }\n\n if (validateForNotNull(pageData) && validateForNotNull(pageData.customerDetails) && validateForNotNull(pageData.customerDetails.kohlsLoyalty2018EliteMember)) {\n vectorsEventData.kohlsLoyalty2018EliteMember = pageData.customerDetails.kohlsLoyalty2018EliteMember;\n } else {\n vectorsEventData.kohlsLoyalty2018EliteMember = -1;\n }\n\n if (validateForNotNull(pageData) && validateForNotNull(pageData.customerDetails) && validateForNotNull(pageData.customerDetails.kohlsLoyalty2018Member)) {\n vectorsEventData.kohlsLoyalty2018Member = pageData.customerDetails.kohlsLoyalty2018Member;\n } else {\n vectorsEventData.kohlsLoyalty2018Member = -1;\n }\n\n vectorsEventData.mcmId = fetchMcmId();\n\n ZineOne.pushEvent('_ws_updatevectors_len5', vectorsEventData);\n\n if(isJsonNull)\n {\n var lastUserPageArr = userVectors.eventVector.toString().split('|');\n var lastPageChar = lastUserPageArr[lastUserPageArr.length - 2];\n\n var tempEventData = {};\n tempEventData.VisitorBagTotals = getCookie('VisitorBagTotals');\n tempEventData.pgName = 'Search';\n tempEventData.lastPgChar = lastPageChar;\n\n ZineOne.pushEvent('_ws_emptyjson_v2', tempEventData);\n }\n\n\n } else if (userVectors && userVectors.eventVector && userVectors.eventVector.split('|').length == 10) {\n console.log(\"The sequence is 10 element long\");\n //Changes to visitGap for gap between n-1 and nth session\n var visitGap = localStorage.getItem('visitGap');\n //Check if null or undefined\n if (!visitGap || typeof visitGap == undefined || visitGap == 'undefined') {\n visitGap = '';\n }\n\n var currentSessionStartTime = userVectors.timeVector.toString().split('|')[0];\n\n var vectorsEventData = {};\n\n var newVectorKeys = Object.keys(newUserVectors);\n for(var k=0;k<newVectorKeys.length;k++)\n {\n vectorsEventData[newVectorKeys[k]] = newUserVectors[newVectorKeys[k]];\n }\n\n\n\n vectorsEventData.z1_userVectors = JSON.stringify(userVectors);\n vectorsEventData.z1_features = z1_features;\n vectorsEventData.session_start_time = currentSessionStartTime;\n vectorsEventData.visitGap = visitGap;\n \n ZineOne.pushEvent('_ws_updatevectors_len10', vectorsEventData);\n }\n\n //If this is the 10th Element, send the features and vectors\n } catch (ie) {\n console.log('[ZineOne updateUserVectors] : ' + ie);\n }\n }\n\n function updateFeatures() {\n\n console.log('Into updateFeatures');\n /* z1_features is stored in local storage which holds following stats\n ** n Total number of events in visit\n ** A Total number of addedtobag events in the visit\n ** B Total number of breachedgeofence events in the visit\n ** C Total number of continuedcheckout events in the visit\n ** D Total number of exitgeofence events in the visit\n ** E Total number of placedorder events in the visit\n ** F Total number of searched events in the visit\n ** G Total number of startedcheckout events in the visit\n ** H Total number of viewedcart events in the visit\n ** I Total number of viewedcatalog events in the visit\n ** J Total number of viewedhome events in the visit\n ** K Total number of viewedproduct events in the visit\n ** p Total number of evented pages loaded in visit\n */\n\n var z1_features = localStorage.getItem('z1_features');\n if (!z1_features) {\n z1_features = \"0|0|0|0|0|0|0|0|0|0|0|0|0|0\";\n }\n\n z1_features_arr = z1_features.split('|');\n\n z1_features_arr[0] = Number(z1_features_arr[0]) + 1; //n\n\n if (evtName.toLocaleLowerCase() == '_ws_addedtobag') {\n z1_features_arr[1] = Number(z1_features_arr[1]) + 1;\n } else if (evtName.toLocaleLowerCase() == 'breachedgeofence') {\n z1_features_arr[2] = Number(z1_features_arr[2]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_completeshipping') {\n z1_features_arr[3] = Number(z1_features_arr[3]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == 'exitgeofence') {\n z1_features_arr[4] = Number(z1_features_arr[4]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_placedorder') {\n z1_features_arr[5] = Number(z1_features_arr[5]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_searched') {\n z1_features_arr[6] = Number(z1_features_arr[6]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_startedcheckout') {\n z1_features_arr[7] = Number(z1_features_arr[7]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_viewedcart') {\n z1_features_arr[8] = Number(z1_features_arr[8]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_viewedcatalog') {\n z1_features_arr[9] = Number(z1_features_arr[9]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_viewedhome') {\n z1_features_arr[10] = Number(z1_features_arr[10]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_viewedproduct') {\n z1_features_arr[11] = Number(z1_features_arr[11]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_completepayment') {\n z1_features_arr[13] = Number(z1_features_arr[13]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n }\n\n z1_features = z1_features_arr[0] + '|' + z1_features_arr[1] + '|' + z1_features_arr[2] + '|' + z1_features_arr[3] + '|' + z1_features_arr[4] + '|' + z1_features_arr[5] + '|' + z1_features_arr[6] + '|' + z1_features_arr[7] + '|' + z1_features_arr[8] + '|' + z1_features_arr[9] + '|' + z1_features_arr[10] + '|' + z1_features_arr[11] + '|' + z1_features_arr[12] + '|' + z1_features_arr[13];\n localStorage.setItem('z1_features', z1_features);\n }\n\n\n\n function getCartData() {\n if (pageData && pageData.customerDetails) {\n if (!isSoftLoggedIn || (isSoftLoggedIn && !isSoftLoggedIn.includes(\"true\"))) {\n if (pageData.customerDetails.isLoggedIn) isLoggedIn = \"true\";\n }\n }\n\n var cartData = localStorage.getItem('persistent_bar_components_json_v1');\n //if (debugScr) console.log(\"[ZineOne] CartData = \" + cartData);\n var cartInfo = JSON.parse(cartData);\n var productsArr = [];\n\n //Send the Event even if the Cart does not have any item, so that the OpenAPI could be called\n //on the Server side\n\n if (cartInfo == null || cartInfo.cartItems == null || cartInfo.cartItems.length <= 0)\n return true;\n\n for (var i = 0; i < cartInfo.cartItems.length; i++) {\n var si = cartInfo.cartItems[i];\n var saleUnitprice = 0;\n var regularUnitPrice = 0;\n if (!si.itemPriceInfo && !si.itemPriceInfo.saleUnitprice)\n saleUnitprice = si.itemPriceInfo.saleUnitprice;\n\n if (!si.itemPriceInfo && !si.itemPriceInfo.regularUnitPrice)\n regularUnitPrice = si.itemPriceInfo.regularUnitPrice;\n var obj = {\n \"id\": si.cartItemId,\n \"skuCode\": si.skuId,\n \"webID\": si.productId,\n \"saleUnitPrice\": saleUnitprice.toString(),\n \"regularUnitPrice\": regularUnitPrice.toString()\n };\n productsArr.push(obj);\n //if (debugScr) console.log(\"[ZineOne] Product Array ==>\" + productsArr);\n }\n //if (debugScr) console.log(\"[ZineOne] Out of loop\");\n if (debugScr) console.log(\"[ZineOne] Product Array ==>\" + productsArr);\n return JSON.stringify(productsArr);\n }\n\n\n\n function addEventData() {\n\n \tvar evtData = {};\n\n if (pageData && pageData.customerDetails) {\n if (!isSoftLoggedIn || (isSoftLoggedIn && !isSoftLoggedIn.includes(\"true\"))) {\n if (pageData.customerDetails.isLoggedIn) isLoggedIn = \"true\";\n }\n\n \n } else {\n if (debugScr) console.log(\"[ZineOne] pageData NOT initialized. Cannot set customerId or login state.\");\n }\n\n var itemsInBag = 0;\n var cartItems, cartId, cartTotalValue, cartSubTotalValue, cartShippingValue, cartDiscountValue;\n if (pageData && pageData.cartDetails) {\n itemsInBag = pageData.cartDetails.numberOfItems;\n if (debugScr) console.log('[ZineOne] Number of Items in the cart: ' + itemsInBag);\n cartId = pageData.cartDetails.cartID;\n cartTotalValue = pageData.cartDetails.cartTotalValue;\n cartSubTotalValue = pageData.cartDetails.cartSubTotalValue;\n cartShippingValue = pageData.cartDetails.shippingValue;\n cartDiscountValue = pageData.cartDetails.discountValue;\n\n //cartItems = pageData.cartDetails.cartItems;\n cartItems = getCartData();\n if (debugScr) console.log(\"[ZineOne] cartItems ==>\" + cartItems);\n }\n\n //ZineOne.setCustomKey(\"customerId\", RRTrackingBean.profileId);\n // replace e with var from webstore page (consider profile attr per Manish)\n // maybe do on page unload so you grab it once on first page and use it afterwards\n evtData.itemsInBag = itemsInBag;\n if (cartId) evtData.cartId = cartId;\n if (cartTotalValue) evtData.cartTotalValue = cartTotalValue;\n if (cartSubTotalValue) evtData.cartSubTotalValue = cartSubTotalValue;\n if (cartShippingValue) evtData.cartShippingValue = cartShippingValue;\n if (cartDiscountValue) evtData.cartDiscountValue = cartDiscountValue;\n if (cartItems) evtData.cartItems = cartItems;\n if (debugScr) console.log(\"[ZineOne] cartItems ==>\" + cartItems);\n\n\n if (isSoftLoggedIn) evtData[\"isSoftLoggedIn\"] = isSoftLoggedIn;\n if (isLoggedIn) evtData[\"isLoggedIn\"] = isLoggedIn;\n if (debugScr) console.log(\"[ZineOne] evtName = \" + evtName);\n if (debugScr) console.log(\"[ZineOne] evtData =\" + JSON.stringify(evtData));\n\n\n return evtData;\n }\n\n\n}\n\ncatch (ie) {\n if (debugScr) console.log(\"[Zineone] Error in Tag Script: Catalog Filter Z1 tag. \" + ie);\n}\n\ntry {\n\n\n\n\tvar isSoftLoggedIn = getCookie(\"SoftLoggedInCookie\");\n if (isSoftLoggedIn && isSoftLoggedIn.includes(\"true\")) {\n if (debugScr) console.log(\"[ZineOne] Soft Logged value is:\" + isSoftLoggedIn);\n }\n // Set HardLoggedIn = true only if user is not SoftLoggedIn\n var isLoggedIn = \"\";\n\n if (!isSoftLoggedIn || (isSoftLoggedIn && !isSoftLoggedIn.includes(\"true\"))) {\n if (pageData.customerDetails.isLoggedIn) isLoggedIn = \"true\";\n }\n\n\n\n\tvar currentCN = getUrlParameter('CN');\n\n\tvar MAX_CN_CHECK = 10;\n\tvar CURRENT_CN_CHECK = 0;\n\n\n\tdocument.addEventListener('click',function(e){\n\n\t\tconsole.log('E Target ',e.target.className);\n\n\t\tvar classNameArr = e.target.className.toString().split('facet_checkbox');\n\t\tvar ceAjaxArr = e.target.className.toString().split('ce-ajax');\n\t\tvar checkmarkArr = e.target.className.toString().split('checkmark');\n\t\t\n\n\t\tconsole.log('Class Name Length '+classNameArr.length);\n\n \tif(e.target && (classNameArr.length > 1 || ceAjaxArr.length > 1 || checkmarkArr.length > 1)){\n\n evtName = '_ws_searched';\n\n \t\tCURRENT_CN_CHECK = 0;\n\t\t\tcheckForCNUpdate();\n\n \t}});\n\n //Check for Sorting Dropdown\n var selectFilter = document.getElementById('sortby_select');\n selectFilter.onchange = function(){\n\n evtName = '_ws_changedsort';\n\n updateUserVectors();\n\n console.log('selectFilter Change',selectFilter);\n\n };\n\n}\n\ncatch (ie) {\n if (debugScr) console.log(\"[Zineone] Error in Tag Script: Catalog Filter Z1 tag. \" + ie);\n}","eventName":"load","pageSelector":{"type":"pgName","condition":"contains","val":"search"}},{"tagName":"ClearZ1ItemsInEdgeBrowserLocalStorage","actionType":"z1script","script":"try {\n\n var uaval = window.navigator.userAgent; // > -1\"Mozilla/5.0 (X11; CrOS x86_64 6783.1.0) AppleWebKit/537.36 (KHTML, like Gecko) Edge/12.0\";\n //console.log(uaval);\n if (uaval && uaval.indexOf(\"Edge\", 0) > -1) {\n //console.log(\"Device Id is \" + dev_Id);\n Object.keys(localStorage).forEach(function(key) {\n if (key.lastIndexOf(\"z1_\", 0) === 0) {\n //console.log(\"key - \" + key + \" - value \" + localStorage.getItem(key));\n //console.log(\"key - \" + key);\n localStorage.setItem(key, \"\");\n localStorage.removeItem(key);\n }\n });\n ZineOne.turnOffApi(true);\n }\n} catch (e) {\n console.log('ZineOne : Unable to execute script' + e);\n}","eventName":"load","pageSelector":{"type":"all","condition":"equals","val":""}},{"tagName":"ClearZ1OnUserLogout","actionType":"z1script","script":"function getParameterByName(name) {\n var match = RegExp('[\\\\?&]' + name + '=([^&#/]*)').exec(window.location.search);\n return match && decodeURIComponent(match[1].replace(/\\+/g, ' '));\n}\n\nfunction getCookie(name) {\n var value = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)'));\n if (debugScr && value != null) console.log(\"[ZineOne] getCookie value for = \" + name + \" value - \" + value);\n return (value != null) ? unescape(value[2]) : null;\n\n}\n\nfunction isNumeric(value) {\n return /^-{0,1}\\d+$/.test(value);\n}\n\nfunction isValid(value) {\n if (value == \"null\" || value == \"undefined\" || value == null || value == undefined) {\n return false;\n }\n\n return true;\n}\n\ntry {\n var debugScr = false;\n //Uncomment the below in production and comment the below in non-prod\n if ((window.location.host).includes(\"kohls.com\")) {\n var pg = Z1.window.browserInfo.pagePath;\n var reset = false;\n if (debugScr) console.log(\"[ZineOne] Page Name ==>\" + pg);\n\n if (pg == \"/\") {\n var logoutparam = getParameterByName('DPSLogout');\n if (logoutparam != null && logoutparam.toLowerCase() == 'true') {\n if (debugScr) console.log(\"[ZineOne] @@@@@@@@@@@@ - logoutparam------------ **\" + logoutparam);\n reset = true;\n } else {\n if (debugScr) console.log(\"[ZineOne] @@@@@@@@@@@@ - logoutparam is NULL ------------ **\");\n }\n } else {\n var xprof = getCookie('X-PROFILEID');\n var vistorId = getCookie(\"VisitorId\");\n if (debugScr) console.log(\"[ZineOne] xprof ==>\" + xprof + \" vistorId ==>\" + vistorId);\n\n if (!isValid(xprof) && (!isValid(vistorId) || !isNumeric(vistorId))) {\n //reset = true;\n }\n }\n\n var z1OTR = localStorage.getItem(\"z1_otr\");\n if (reset && (!isValid(z1OTR) || (z1OTR.toLowerCase() == 'false'))) {\n localStorage.setItem(\"z1_otr\", \"true\");\n if (debugScr) console.log(\"[ZineOne] @@@@@@@@@@@@ - Reset Z1 properties ------------ ** z1_otr \" + z1OTR);\n\n \t// Venkat - 9/24/2018 - Begin\n \t// Uncommenting the lines below to enable the fix\n Object.keys(localStorage).forEach(function(key) {\n if (key.lastIndexOf(\"z1_\", 0) === 0) {\n //console.log(\"key - \" + key + \" - value \" + localStorage.getItem(key));\n //console.log(\"key - \" + key);\n if (!key.includes(\"z1_otr\")) {\n \tlocalStorage.setItem(key, \"\");\n \tlocalStorage.removeItem(key);\n }\n }\n });\n // Venkat - 9/24/2018 - End\n\n \t/*\n //var dev_Id = ZineOne.getDeviceId();\n //if (debugScr) console.log(\"[ZineOne] @@@@@@@@@@@@ - Reset CustomerId to devId ------------ **\" + dev_Id);\n //ZineOne.setCustomerId(dev_Id);\n */\n } else if (!reset && (isValid(z1OTR) && z1OTR.toLowerCase() == 'true')) {\n localStorage.setItem(\"z1_otr\", \"false\");\n if (debugScr) console.log(\"[ZineOne] @@@@@@@@@@@@ - Not resetting Z1 properties but z1_otr set to false ------------ ** original z1_otr \" + z1OTR);\n } else {\n if (debugScr) console.log(\"[ZineOne] @@@@@@@@@@@@ - Already reset Z1 properties ------------ ** z1_otr \" + z1OTR);\n }\n\n }\n} catch (e) {\n console.log(\" @@@ ClearZ1OnUserLogout \" + e);\n}","eventName":"load","pageSelector":{"type":"all","condition":"equals","val":""}},{"tagName":"Z1 Div on PDP Scarcity Message","actionType":"z1script","script":"var isDebugScr = false;\ntry {\n /*var myId = pageData.customerDetails.customerID ? pageData.customerDetails.customerID : \"\";\n console.log(\"Scarcity myId ==> \",myId);\n if (myId == \"3000000030411692\" || myId == \"3000000129500077\" || myId == \"3000000015076174\" || myId == \"3000000074262095\" ) {\n console.log(\"Execute only for my Id\");*/\n\n function getCookie(name) {\n var value = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)'));\n if (isDebugScr && value != null) console.log(\"[ZineOne] getCookie value for = \" + name + \" value - \" + value);\n return (value != null) ? unescape(value[2]) : null;\n }\n var aka_hp2_cookie = getCookie(\"AKA_HP2\");\n var aka_rv_cookie = getCookie(\"AKA_RV\");\n var aka_pdp2_cookie = getCookie(\"AKA_PDP2\");\n if (isDebugScr) console.log(\" aka_hp2_cookie ==> \", aka_hp2_cookie, \" aka_rv_cookie ==> \", aka_rv_cookie, \" aka_pdp2_cookie ==> \", aka_pdp2_cookie);\n if (aka_pdp2_cookie && aka_pdp2_cookie.toLowerCase() == \"true\") {\n var parentDiv;\n var productPageName = pageName;\n if (isDebugScr) console.log(\" productPageName ==> \",productPageName);\n if (productPageName == \"regularProductPage\") {\n parentDiv = document.getElementById(\"PDP_z1Scarcity_badge\");\n } else if (productPageName == \"collectionPDPPage\") {\n parentDiv = document.getElementById(\"CDP_z1Scarcity_badge\");\n }\n\n if (parentDiv) {\n var pdpScrDiv = document.createElement('div');\n if (isDebugScr) console.log(\"[ZineOne] created new div for scarcity\");\n pdpScrDiv.setAttribute(\"id\", \"z1-pdpscarcity\");\n //pdpScrDiv.setAttribute(\"style\", \"display:block;text-align: left; width: 100%; color: purple; font-size: 15px; clear: both; padding-top: 5px; overflow: auto;\");\n pdpScrDiv.style.display = \"block\";\n pdpScrDiv.style.textAlign = \"left\";\n pdpScrDiv.style.width = \"100%\";\n pdpScrDiv.style.color = \"purple\";\n pdpScrDiv.style.fontSize = \"15px\";\n pdpScrDiv.style.clear = \"both\";\n pdpScrDiv.style.paddingTop = \"5px\";\n pdpScrDiv.style.overflow = \"auto\";\n //pdpScrDiv.innerHTML=\"Just <b>1 left in this store!</b>\";\n parentDiv.appendChild(pdpScrDiv);\n }\n } else {\n var scarcityParentDiv = document.getElementsByClassName(\"quantity\");\n if (scarcityParentDiv) {\n var parentDiv = scarcityParentDiv[0];\n var pdpScrDiv = document.createElement('div');\n if (isDebugScr) console.log(\"[ZineOne] created new div for scarcity\");\n pdpScrDiv.setAttribute(\"id\", \"z1-pdpscarcity\");\n //pdpScrDiv.setAttribute(\"style\", \"display:block;text-align: left; width: 100%; color: purple; font-size: 15px; clear: both; padding-top: 5px; overflow: auto;\");\n pdpScrDiv.style.display = \"block\";\n pdpScrDiv.style.textAlign = \"left\";\n pdpScrDiv.style.width = \"100%\";\n pdpScrDiv.style.color = \"purple\";\n pdpScrDiv.style.fontSize = \"15px\";\n pdpScrDiv.style.clear = \"both\";\n pdpScrDiv.style.paddingTop = \"5px\";\n pdpScrDiv.style.overflow = \"auto\";\n //pdpScrDiv.innerHTML=\"Just <b>1 left in this store!</b>\";\n parentDiv.appendChild(pdpScrDiv);\n }\n }\n /*} else {\n var scarcityParentDiv = document.getElementsByClassName(\"quantity\");\n if (scarcityParentDiv) {\n var parentDiv = scarcityParentDiv[0];\n var pdpScrDiv = document.createElement('div');\n if (isDebugScr) console.log(\"[ZineOne] created new div for scarcity\");\n pdpScrDiv.setAttribute(\"id\", \"z1-pdpscarcity\");\n //pdpScrDiv.setAttribute(\"style\", \"display:block;text-align: left; width: 100%; color: purple; font-size: 15px; clear: both; padding-top: 5px; overflow: auto;\");\n pdpScrDiv.style.display = \"block\";\n pdpScrDiv.style.textAlign = \"left\";\n pdpScrDiv.style.width = \"100%\";\n pdpScrDiv.style.color = \"purple\";\n pdpScrDiv.style.fontSize = \"15px\";\n pdpScrDiv.style.clear = \"both\";\n pdpScrDiv.style.paddingTop = \"5px\";\n pdpScrDiv.style.overflow = \"auto\";\n //pdpScrDiv.innerHTML=\"Just <b>1 left in this store!</b>\";\n parentDiv.appendChild(pdpScrDiv);\n }\n }*/\n} catch (z1ie) {\n if (isDebugScr) console.log(\"[zineone] exception in Tag creating div to attch z1 scarcity on PDP=\" + z1ie);\n}","eventName":"load","pageSelector":{"type":"pgName","condition":"contains","val":"product/prd-"}},{"tagName":"RTO Shopping Cart","actionType":"z1script","script":"/*Changes done for IE\nA. function declaration like, var abc = function() won't work in IE if function is used first and then declared and defined. Please take below precaution before using it:\n 1. If you want to use function declaration like, var abc = function(), first declare it and then use it\n 2. Use normal function declaration like, function abc(). you can declare function anywhere in the page and use it before or after declaration. It will work on all the browsers.\nB. Do not use multiline strings, also call as 'Template String'. Template Strings are demarked by a backtick(`).\n Example. var abc = `This is multiline\n comment`; //multiline comments won't work in IE\n Use simple concatenation to achieve the same like,\n var abc = \"\";\n abc += 'This is multiline';\n abc += 'comment';\nC. You can not set defalut parameter values for function in IE.\n for e.g. function abc(num = 0,str=\"hello\") //Won't work in IE\nD. You can not use arguments object ([...args] or (...args) in function) in IE.\n For e.g function abc(...args){\n console.log(\"received paramenters \", args)\n } // Won't work in IE\nE. 'append' function won't work in IE. You can use 'appendChild' function to achieve the same functionality.\nF. 'prepend' function won't work IE. Try to use 'insertBefore' function to achieve the same functionality.\nG. new Event() function won't work in IE. You can use new CustomEvent() function to achieve the same functionality.\nH. Arrow functions (=>) won't work in IE\n*/\n\nvar debugScr = true;\ntry {\n\n var evtName = null;\n\n var isLoggedIn = \"\";\n\n var isSoftLoggedIn = \"\";\n\n var SESSION_GAP = 1800000; //30min = 30*60*1000 millis\n\n var cartValue = 0;\n\n var currentUserCartArr = [];\n\n\n //Event Codes for vectors:\n var eventCodes = {\n _ws_addedtobag: \"A\",\n breachedgeofence: \"B\",\n _ws_completeshipping: \"C\",\n exitgeofence: \"D\",\n _ws_placedorder: \"E\",\n _ws_searched: \"F\",\n _ws_startedcheckout: \"G\",\n _ws_viewedcart: \"H\",\n _ws_viewedcatalog: \"I\",\n _ws_viewedhome: \"J\",\n _ws_viewedproduct: \"K\",\n _ws_completepayment: \"L\",\n _ws_viewedsku: \"M\",\n _ws_update_hcart: \"N\",\n _ws_changedsort: \"O\",\n _ws_rto: \"R\"\n };\n\n\n function isValid(value) {\n if (value == \"null\" || value == \"undefined\" || value == null || value == undefined) {\n return false;\n }\n\n return true;\n }\n\n\n\n function getPresentVector(isRto, rtoEventType) {\n try {\n\n if (debugScr) console.log('getPresentVector');\n\n var itemsInBag = 0;\n cartValue = 0;\n\n isJsonNull = false;\n\n var cartData = pageData.cartDetails.cartItems;\n if(isValid(cartData))\n {\n var cartInfo = (cartData);\n\n for (var i = 0; i < cartInfo.length; i++) {\n itemsInBag = itemsInBag + Number(cartInfo[i].quantity);\n\n cartValue = cartValue + Number(cartInfo[i].quantity)*Number(cartInfo[i].finalPrice);\n\n }\n }\n else\n {\n if(getCookie('VisitorBagTotals').toString().length != 0)\n {\n cartValue = -1;\n\n isJsonNull = true;\n\n }\n }\n\n\n if (cartValue == 0 && (typeof pageData != 'undefined') && pageData.cartDetails && pageData.cartDetails.cartSubTotalValue) {\n cartValue = Number(pageData.cartDetails.cartSubTotalValue);\n }\n\n\n\n console.log(cartValue + ' Before Present Vector ', evtName);\n var presentVector = {};\n presentVector.event = eventCodes[evtName.toLocaleLowerCase()] || evtName; //common to all\n presentVector.productID = '-'; //ViewedProduct, AddedToBag\n presentVector.itemsInBag = itemsInBag || 0; //common to all\n presentVector.originalPrice = '-';\n presentVector.salePrice = '-';\n presentVector.KC = '-'; //Think\n presentVector.PDPCategory = '-'; //\n presentVector.department = '-';\n presentVector.CN = '-';\n presentVector.keywords = '-';\n presentVector.visualNavForm = '-';\n presentVector.pageFilter = '-';\n presentVector.searchType = '-';\n presentVector.userPFM = '-';\n presentVector.loginstatus = (isLoggedIn) ? 'full' : (isSoftLoggedIn ? 'soft' : '-');\n presentVector.onSale = '-';\n presentVector.time = new Date().getTime();\n\n console.log('Present Vector 1', presentVector);\n //New Ml Vectors\n\n presentVector.pgdata_pmpdet_catname = '-';\n presentVector.pgdata_pmpdet_subcatname = '-';\n presentVector.pgdata_pmpdet_findingname = '-';\n presentVector.pgdata_pmpdet_cat_keywords = '-';\n presentVector.pgdata_pmpdet_pgfilter = '-';\n presentVector.pgdata_pmpdet_deptname = '-';\n presentVector.pgdata_pmpdet_gendervalues = '-';\n presentVector.pgdata_pmpdet_search_keywords = '-';\n presentVector.pgdata_proddet_colid = '-';\n presentVector.pgdata_pddetails_clientpostalcode = '-';\n presentVector.selected_sku_color = '-';\n presentVector.selected_sku_size = '-';\n presentVector.selected_sku = '-';\n //presentVector.selected_sku_regular_price = '-';\n presentVector.selected_sku_sale_price = '-';\n\n\n\n presentVector.c_i_size = '-';\n presentVector.c_i_color = '-';\n presentVector.c_i_isweb = '-';\n presentVector.c_sclearance = '-';\n presentVector.c_i_shipavailable = '-';\n presentVector.c_i_bopusAval = '-';\n presentVector.c_i_bossAval = '-';\n presentVector.c_i_invShip = '-';\n presentVector.c_i_invBopus = '-';\n presentVector.c_i_invBoss = '-';\n presentVector.c_o_offDis = '-';\n presentVector.c_o_sdate = '-';\n presentVector.c_o_edate = '-';\n presentVector.c_p_type = '-';\n presentVector.c_p_ptext = '-';\n presentVector.shpi_shpp_ogshpchrgs = '-';\n presentVector.shpi_shpp_shpchrgsafdis = '-';\n presentVector.shpi_shpp_freeshpqlfdelta = '-';\n presentVector.shpi_shpp_shpitmstotal = '-';\n presentVector.shpi_shpo_disamnt = '-';\n presentVector.or_merpromoamnt = '-';\n presentVector.or_disshpamnt = '-';\n presentVector.or_ogshpamnt = '-';\n presentVector.or_tax_est = '-';\n presentVector.or_tax_taxrt = '-';\n presentVector.or_tax_tax = '-';\n presentVector.or_totalsur = '-';\n presentVector.or_totaltaxfree = '-';\n presentVector.or_totalkcpromodis = '-';\n presentVector.or_totaltax = '-';\n presentVector.or_total = '-';\n presentVector.or_savings = '-';\n presentVector.or_taxfeeen = '-';\n\n presentVector.removed_sku = '-';\n presentVector.updated_sku = '-';\n presentVector.updated_sku_qty = '-';\n\n presentVector.prod_sku_count = '-';\n presentVector.sku_reg_price = '-';\n presentVector.sku_per_dis = '-';\n presentVector.sku_bopus_avail = '-';\n presentVector.sku_boss_avail = '-';\n presentVector.sku_ship_avail = '-';\n\n presentVector.filter_by_count = '-';\n presentVector.sort_by = '-';\n\n presentVector.pgdata_proddet_catname = '-';\n presentVector.pgdata_proddet_subcatname = '-';\n presentVector.pgdata_proddet_deptname = '-';\n\n presentVector.selected_prd_id = '-';\n\n presentVector.rto_data = '-';\n\n\n if(isRto == true)\n {\n presentVector.event = eventCodes[\"_ws_rto\"] ;\n\n if(rtoEventType != null)\n {\n\n var rtoPageCode = '';\n\n rtoPageCode = 'CP';\n\n presentVector.rto_data = 'A';\n }\n\n }\n\n return presentVector;\n } catch (ie) {\n console.log('[ZineOne getPresentVector] : ', ie);\n }\n }\n\n\n\n function updateUserVectors(isRto, rtoEventType) {\n try {\n\n evtName = '_ws_rto';;\n if (debugScr) console.log('Into updateUserVectors');\n var presentVector = getPresentVector(isRto, rtoEventType);\n var previousVector = JSON.parse(localStorage.getItem('z1_previousVector'));\n var z1_sessionStart_ts = JSON.parse(localStorage.getItem('z1_sessionStart_ts'));\n\n var z1_features = localStorage.getItem('z1_features') || \"\";\n //Check if local Storage has userVector available\n var userVectors = JSON.parse(localStorage.getItem('z1_userVectors'));\n var newUserVectors = JSON.parse(localStorage.getItem('z1_newUserVectors'));\n\n //Updated the logic to send the Sequence if diff between present and previous event is more than 10 mins\n //if(previousVector && previousVector.time && previousVector.time < z1_sessionStart_ts){\n if (previousVector && previousVector.time && presentVector && presentVector.time && Number(presentVector.time) - Number(previousVector.time) > SESSION_GAP) {\n if (debugScr) console.log(\"New Session has started since the last Event\");\n //Changes to visitGap for gap between n-1 and nth session\n var visitGap = localStorage.getItem('visitGap');\n //Check if null or undefined\n if (!visitGap || typeof visitGap == undefined || visitGap == 'undefined') {\n visitGap = '';\n }\n\n try {\n\n var oldSessionStartTime = userVectors.timeVector.toString().split('|')[0];\n\n\n var vectorsEventData = {};\n\n vectorsEventData = onceInSessionAttributes(vectorsEventData);\n\n var cartDump = fetchCartDump();\n\n if (validateForNotNull(cartDump)) {\n cartDump = JSON.parse(cartDump);\n\n var cartKeys = Object.keys(cartDump);\n for (var k = 0; k < cartKeys.length; k++) {\n vectorsEventData[cartKeys[k]] = JSON.stringify(cartDump[cartKeys[k]]);\n }\n }\n\n\n vectorsEventData.z1_userVectors = JSON.stringify(userVectors);\n vectorsEventData.z1_features = z1_features;\n vectorsEventData.visitGap = visitGap;\n vectorsEventData.session_start_time = presentVector.time;\n vectorsEventData.old_session_start_time = oldSessionStartTime;\n\n if (validateForNotNull(newUserVectors)) {\n var newVectorKeys = Object.keys(newUserVectors);\n for (var k = 0; k < newVectorKeys.length; k++) {\n vectorsEventData[newVectorKeys[k]] = newUserVectors[newVectorKeys[k]];\n }\n }\n\n\n\n ZineOne.pushEvent('_ws_updatevectors', vectorsEventData);\n } catch (ieInner) {\n\n var errorObj = {};\n errorObj.p1 = ieInner.message;\n errorObj.p2 = 'webstoresendevent ' + evtName;\n\n ZineOne.pushEvent('_ws_logs', errorObj);\n\n }\n\n\n\n\n\n localStorage.setItem('visitGap', Number(presentVector.time) - Number(previousVector.time));\n localStorage.removeItem('z1_userVectors');\n localStorage.removeItem('z1_features');\n if (debugScr) console.log(\"z1_userVectors removed from local storage\");\n userVectors = null;\n newUserVectors = null;\n }\n\n if (!userVectors) {\n userVectors = {};\n userVectors.eventVector = presentVector.event;\n userVectors.timeVector = presentVector.time;\n userVectors.productVector = presentVector.productID;\n userVectors.originalPrice = presentVector.originalPrice;\n userVectors.salePrice = presentVector.salePrice;\n userVectors.PDPCategory = presentVector.PDPCategory;\n userVectors.CN = presentVector.CN;\n userVectors.itemsInBag = presentVector.itemsInBag;\n\n newUserVectors = {};\n newUserVectors.pgdata_pmpdet_catname = presentVector.pgdata_pmpdet_catname;\n newUserVectors.pgdata_pmpdet_subcatname = presentVector.pgdata_pmpdet_subcatname;\n newUserVectors.pgdata_pmpdet_findingname = presentVector.pgdata_pmpdet_findingname;\n newUserVectors.pgdata_pmpdet_cat_keywords = presentVector.pgdata_pmpdet_cat_keywords;\n newUserVectors.pgdata_pmpdet_pgfilter = presentVector.pgdata_pmpdet_pgfilter;\n newUserVectors.pgdata_pmpdet_deptname = presentVector.pgdata_pmpdet_deptname;\n newUserVectors.pgdata_pmpdet_gendervalues = presentVector.pgdata_pmpdet_gendervalues;\n newUserVectors.pgdata_pmpdet_search_keywords = presentVector.pgdata_pmpdet_search_keywords;\n newUserVectors.pgdata_proddet_colid = presentVector.pgdata_proddet_colid;\n newUserVectors.pgdata_pddetails_clientpostalcode = presentVector.pgdata_pddetails_clientpostalcode;\n newUserVectors.selected_sku_color = presentVector.selected_sku_color;\n newUserVectors.selected_sku_size = presentVector.selected_sku_size;\n newUserVectors.selected_sku = presentVector.selected_sku;\n //newUserVectors.selected_sku_regular_price = presentVector.selected_sku_regular_price;\n newUserVectors.selected_sku_sale_price = presentVector.selected_sku_sale_price;\n\n\n\n newUserVectors.c_i_size = presentVector.c_i_size;\n newUserVectors.c_i_color = presentVector.c_i_color;\n newUserVectors.c_i_isweb = presentVector.c_i_isweb;\n newUserVectors.c_sclearance = presentVector.c_sclearance;\n newUserVectors.c_i_shipavailable = presentVector.c_i_shipavailable;\n newUserVectors.c_i_bopusAval = presentVector.c_i_bopusAval;\n newUserVectors.c_i_bossAval = presentVector.c_i_bossAval;\n newUserVectors.c_i_invShip = presentVector.c_i_invShip;\n newUserVectors.c_i_invBopus = presentVector.c_i_invBopus;\n newUserVectors.c_i_invBoss = presentVector.c_i_invBoss;\n newUserVectors.c_o_offDis = presentVector.c_o_offDis;\n newUserVectors.c_o_sdate = presentVector.c_o_sdate;\n newUserVectors.c_o_edate = presentVector.c_o_edate;\n newUserVectors.c_p_type = presentVector.c_p_type;\n newUserVectors.c_p_ptext = presentVector.c_p_ptext;\n newUserVectors.shpi_shpp_ogshpchrgs = presentVector.shpi_shpp_ogshpchrgs;\n newUserVectors.shpi_shpp_shpchrgsafdis = presentVector.shpi_shpp_shpchrgsafdis;\n newUserVectors.shpi_shpp_freeshpqlfdelta = presentVector.shpi_shpp_freeshpqlfdelta;\n newUserVectors.shpi_shpp_shpitmstotal = presentVector.shpi_shpp_shpitmstotal;\n newUserVectors.shpi_shpo_disamnt = presentVector.shpi_shpo_disamnt;\n newUserVectors.or_merpromoamnt = presentVector.or_merpromoamnt;\n newUserVectors.or_disshpamnt = presentVector.or_disshpamnt;\n newUserVectors.or_ogshpamnt = presentVector.or_ogshpamnt;\n newUserVectors.or_tax_est = presentVector.or_tax_est;\n newUserVectors.or_tax_taxrt = presentVector.or_tax_taxrt;\n newUserVectors.or_tax_tax = presentVector.or_tax_tax;\n newUserVectors.or_totalsur = presentVector.or_totalsur;\n newUserVectors.or_totaltaxfree = presentVector.or_totaltaxfree;\n newUserVectors.or_totalkcpromodis = presentVector.or_totalkcpromodis;\n newUserVectors.or_totaltax = presentVector.or_totaltax;\n newUserVectors.or_total = presentVector.or_total;\n newUserVectors.or_savings = presentVector.or_savings;\n newUserVectors.or_taxfeeen = presentVector.or_taxfeeen;\n\n newUserVectors.removed_sku = presentVector.removed_sku;\n newUserVectors.updated_sku = presentVector.updated_sku;\n newUserVectors.updated_sku_qty = presentVector.updated_sku_qty;\n\n\n newUserVectors.prod_sku_count = presentVector.prod_sku_count;\n newUserVectors.sku_reg_price = presentVector.sku_reg_price;\n newUserVectors.sku_per_dis = presentVector.sku_per_dis;\n newUserVectors.sku_bopus_avail = presentVector.sku_bopus_avail;\n newUserVectors.sku_boss_avail = presentVector.sku_boss_avail;\n newUserVectors.sku_ship_avail = presentVector.sku_ship_avail;\n\n newUserVectors.filter_by_count = presentVector.filter_by_count;\n newUserVectors.sort_by = presentVector.sort_by;\n\n newUserVectors.pgdata_proddet_catname = presentVector.pgdata_proddet_catname;\n newUserVectors.pgdata_proddet_subcatname = presentVector.pgdata_proddet_subcatname;\n newUserVectors.pgdata_proddet_deptname = presentVector.pgdata_proddet_deptname;\n\n newUserVectors.selected_prd_id = presentVector.selected_prd_id;\n\n newUserVectors.rto_data = presentVector.rto_data;\n\n } else {\n userVectors.eventVector = userVectors.eventVector + '|' + presentVector.event;\n userVectors.timeVector = userVectors.timeVector + '|' + presentVector.time;\n userVectors.productVector = userVectors.productVector + '|' + presentVector.productID;\n userVectors.originalPrice = userVectors.originalPrice + '|' + presentVector.originalPrice;\n userVectors.salePrice = userVectors.salePrice + '|' + presentVector.salePrice;\n userVectors.PDPCategory = userVectors.PDPCategory + '|' + presentVector.PDPCategory;\n userVectors.CN = userVectors.CN + '|' + presentVector.CN;\n userVectors.itemsInBag = userVectors.itemsInBag + '|' + presentVector.itemsInBag;\n\n\n newUserVectors.pgdata_pmpdet_catname = newUserVectors.pgdata_pmpdet_catname + '|' + presentVector.pgdata_pmpdet_catname;\n newUserVectors.pgdata_pmpdet_subcatname = newUserVectors.pgdata_pmpdet_subcatname + '|' + presentVector.pgdata_pmpdet_subcatname;\n newUserVectors.pgdata_pmpdet_findingname = newUserVectors.pgdata_pmpdet_findingname + '|' + presentVector.pgdata_pmpdet_findingname;\n newUserVectors.pgdata_pmpdet_cat_keywords = newUserVectors.pgdata_pmpdet_cat_keywords + '|' + presentVector.pgdata_pmpdet_cat_keywords;\n newUserVectors.pgdata_pmpdet_pgfilter = newUserVectors.pgdata_pmpdet_pgfilter + '|' + presentVector.pgdata_pmpdet_pgfilter;\n newUserVectors.pgdata_pmpdet_deptname = newUserVectors.pgdata_pmpdet_deptname + '|' + presentVector.pgdata_pmpdet_deptname;\n newUserVectors.pgdata_pmpdet_gendervalues = newUserVectors.pgdata_pmpdet_gendervalues + '|' + presentVector.pgdata_pmpdet_gendervalues;\n newUserVectors.pgdata_pmpdet_search_keywords = newUserVectors.pgdata_pmpdet_search_keywords + '|' + presentVector.pgdata_pmpdet_search_keywords;\n newUserVectors.pgdata_proddet_colid = newUserVectors.pgdata_proddet_colid + '|' + presentVector.pgdata_proddet_colid;\n newUserVectors.pgdata_pddetails_clientpostalcode = newUserVectors.pgdata_pddetails_clientpostalcode + '|' + presentVector.pgdata_pddetails_clientpostalcode;\n newUserVectors.selected_sku_color = newUserVectors.selected_sku_color + '|' + presentVector.selected_sku_color;\n newUserVectors.selected_sku_size = newUserVectors.selected_sku_size + '|' + presentVector.selected_sku_size;\n newUserVectors.selected_sku = newUserVectors.selected_sku + '|' + presentVector.selected_sku;\n //newUserVectors.selected_sku_regular_price = newUserVectors.selected_sku_regular_price + '|' + presentVector.selected_sku_regular_price;\n newUserVectors.selected_sku_sale_price = newUserVectors.selected_sku_sale_price + '|' + presentVector.selected_sku_sale_price;\n\n\n newUserVectors.c_i_size = newUserVectors.c_i_size + '|' + presentVector.c_i_size;\n newUserVectors.c_i_color = newUserVectors.c_i_color + '|' + presentVector.c_i_color;\n newUserVectors.c_i_isweb = newUserVectors.c_i_isweb + '|' + presentVector.c_i_isweb;\n newUserVectors.c_sclearance = newUserVectors.c_sclearance + '|' + presentVector.c_sclearance;\n newUserVectors.c_i_shipavailable = newUserVectors.c_i_shipavailable + '|' + presentVector.c_i_shipavailable;\n newUserVectors.c_i_bopusAval = newUserVectors.c_i_bopusAval + '|' + presentVector.c_i_bopusAval;\n newUserVectors.c_i_bossAval = newUserVectors.c_i_bossAval + '|' + presentVector.c_i_bossAval;\n newUserVectors.c_i_invShip = newUserVectors.c_i_invShip + '|' + presentVector.c_i_invShip;\n newUserVectors.c_i_invBopus = newUserVectors.c_i_invBopus + '|' + presentVector.c_i_invBopus;\n newUserVectors.c_i_invBoss = newUserVectors.c_i_invBoss + '|' + presentVector.c_i_invBoss;\n newUserVectors.c_o_offDis = newUserVectors.c_o_offDis + '|' + presentVector.c_o_offDis;\n newUserVectors.c_o_sdate = newUserVectors.c_o_sdate + '|' + presentVector.c_o_sdate;\n newUserVectors.c_o_edate = newUserVectors.c_o_edate + '|' + presentVector.c_o_edate;\n newUserVectors.c_p_type = newUserVectors.c_p_type + '|' + presentVector.c_p_type;\n newUserVectors.c_p_ptext = newUserVectors.c_p_ptext + '|' + presentVector.c_p_ptext;\n newUserVectors.shpi_shpp_ogshpchrgs = newUserVectors.shpi_shpp_ogshpchrgs + '|' + presentVector.shpi_shpp_ogshpchrgs;\n newUserVectors.shpi_shpp_shpchrgsafdis = newUserVectors.shpi_shpp_shpchrgsafdis + '|' + presentVector.shpi_shpp_shpchrgsafdis;\n newUserVectors.shpi_shpp_freeshpqlfdelta = newUserVectors.shpi_shpp_freeshpqlfdelta + '|' + presentVector.shpi_shpp_freeshpqlfdelta;\n newUserVectors.shpi_shpp_shpitmstotal = newUserVectors.shpi_shpp_shpitmstotal + '|' + presentVector.shpi_shpp_shpitmstotal;\n newUserVectors.shpi_shpo_disamnt = newUserVectors.shpi_shpo_disamnt + '|' + presentVector.shpi_shpo_disamnt;\n newUserVectors.or_merpromoamnt = newUserVectors.or_merpromoamnt + '|' + presentVector.or_merpromoamnt;\n newUserVectors.or_disshpamnt = newUserVectors.or_disshpamnt + '|' + presentVector.or_disshpamnt;\n newUserVectors.or_ogshpamnt = newUserVectors.or_ogshpamnt + '|' + presentVector.or_ogshpamnt;\n newUserVectors.or_tax_est = newUserVectors.or_tax_est + '|' + presentVector.or_tax_est;\n newUserVectors.or_tax_taxrt = newUserVectors.or_tax_taxrt + '|' + presentVector.or_tax_taxrt;\n newUserVectors.or_tax_tax = newUserVectors.or_tax_tax + '|' + presentVector.or_tax_tax;\n newUserVectors.or_totalsur = newUserVectors.or_totalsur + '|' + presentVector.or_totalsur;\n newUserVectors.or_totaltaxfree = newUserVectors.or_totaltaxfree + '|' + presentVector.or_totaltaxfree;\n newUserVectors.or_totalkcpromodis = newUserVectors.or_totalkcpromodis + '|' + presentVector.or_totalkcpromodis;\n newUserVectors.or_totaltax = newUserVectors.or_totaltax + '|' + presentVector.or_totaltax;\n newUserVectors.or_total = newUserVectors.or_total + '|' + presentVector.or_total;\n newUserVectors.or_savings = newUserVectors.or_savings + '|' + presentVector.or_savings;\n newUserVectors.or_taxfeeen = newUserVectors.or_taxfeeen + '|' + presentVector.or_taxfeeen;\n\n newUserVectors.removed_sku = newUserVectors.removed_sku + '|' + presentVector.removed_sku;\n newUserVectors.updated_sku = newUserVectors.updated_sku + '|' + presentVector.updated_sku;\n newUserVectors.updated_sku_qty = newUserVectors.updated_sku_qty + '|' + presentVector.updated_sku_qty;\n\n\n newUserVectors.prod_sku_count = newUserVectors.prod_sku_count + '|' + presentVector.prod_sku_count;\n newUserVectors.sku_reg_price = newUserVectors.sku_reg_price + '|' + presentVector.sku_reg_price;\n newUserVectors.sku_per_dis = newUserVectors.sku_per_dis + '|' + presentVector.sku_per_dis;\n newUserVectors.sku_bopus_avail = newUserVectors.sku_bopus_avail + '|' + presentVector.sku_bopus_avail;\n newUserVectors.sku_boss_avail = newUserVectors.sku_boss_avail + '|' + presentVector.sku_boss_avail;\n newUserVectors.sku_ship_avail = newUserVectors.sku_ship_avail + '|' + presentVector.sku_ship_avail;\n\n newUserVectors.filter_by_count = newUserVectors.filter_by_count + '|' + presentVector.filter_by_count;\n newUserVectors.sort_by = newUserVectors.sort_by + '|' + presentVector.sort_by;\n\n newUserVectors.pgdata_proddet_catname = newUserVectors.pgdata_proddet_catname + '|' + presentVector.pgdata_proddet_catname;\n newUserVectors.pgdata_proddet_subcatname = newUserVectors.pgdata_proddet_subcatname + '|' + presentVector.pgdata_proddet_subcatname;\n newUserVectors.pgdata_proddet_deptname = newUserVectors.pgdata_proddet_deptname + '|' + presentVector.pgdata_proddet_deptname;\n\n newUserVectors.selected_prd_id = newUserVectors.selected_prd_id + '|' + presentVector.selected_prd_id;\n\n newUserVectors.rto_data = newUserVectors.rto_data + '|' + presentVector.rto_data;\n\n\n }\n localStorage.setItem('z1_userVectors', JSON.stringify(userVectors));\n localStorage.setItem('z1_newUserVectors', JSON.stringify(newUserVectors));\n\n updateFeatures();\n\n //Update the previousVector\n previousVector = presentVector;\n localStorage.setItem('z1_previousVector', JSON.stringify(previousVector));\n\n //Send the Sequence on 5th and 10th Element as well\n //Fetch the updated features as they are updated\n var z1_features = localStorage.getItem('z1_features') || \"\";\n //If this is the 5th Element, send the features and vectors\n if (userVectors && userVectors.eventVector && userVectors.eventVector.split('|').length == 5) {\n if (debugScr) console.log(\"The sequence is 5 element long\");\n //Changes to visitGap for gap between n-1 and nth session\n var visitGap = localStorage.getItem('visitGap');\n //Check if null or undefined\n if (!visitGap || typeof visitGap == undefined || visitGap == 'undefined') {\n visitGap = '';\n }\n\n var currentSessionStartTime = userVectors.timeVector.toString().split('|')[0];\n\n\n var vectorsEventData = {};\n\n var newVectorKeys = Object.keys(newUserVectors);\n for (var k = 0; k < newVectorKeys.length; k++) {\n vectorsEventData[newVectorKeys[k]] = newUserVectors[newVectorKeys[k]];\n }\n\n vectorsEventData.z1_userVectors = JSON.stringify(userVectors);\n vectorsEventData.z1_features = z1_features;\n vectorsEventData.cartValue = cartValue;\n vectorsEventData.session_start_time = currentSessionStartTime;\n vectorsEventData.visitGap = visitGap;\n vectorsEventData.currentCart = JSON.stringify(currentUserCartArr);\n\n if (validateForNotNull(pageData) && validateForNotNull(pageData.customerDetails) && validateForNotNull(pageData.customerDetails.customerHasKohlsCharge)) {\n vectorsEventData.isKcc = pageData.customerDetails.customerHasKohlsCharge;\n } else {\n vectorsEventData.isKcc = -1;\n }\n\n if (validateForNotNull(pageData) && validateForNotNull(pageData.customerDetails) && validateForNotNull(pageData.customerDetails.kohlsLoyalty2018EliteMember)) {\n vectorsEventData.kohlsLoyalty2018EliteMember = pageData.customerDetails.kohlsLoyalty2018EliteMember;\n } else {\n vectorsEventData.kohlsLoyalty2018EliteMember = -1;\n }\n\n if (validateForNotNull(pageData) && validateForNotNull(pageData.customerDetails) && validateForNotNull(pageData.customerDetails.kohlsLoyalty2018Member)) {\n vectorsEventData.kohlsLoyalty2018Member = pageData.customerDetails.kohlsLoyalty2018Member;\n } else {\n vectorsEventData.kohlsLoyalty2018Member = -1;\n }\n\n\n\n vectorsEventData.mcmId = fetchMcmId();\n\n ZineOne.pushEvent('_ws_updatevectors_len5', vectorsEventData);\n\n if (isJsonNull) {\n var lastUserPageArr = userVectors.eventVector.toString().split('|');\n var lastPageChar = lastUserPageArr[lastUserPageArr.length - 2];\n\n var tempEventData = {};\n tempEventData.VisitorBagTotals = getCookie('VisitorBagTotals');\n tempEventData.pgName = pgName;\n tempEventData.lastPgChar = lastPageChar;\n\n ZineOne.pushEvent('_ws_emptyjson_v2', tempEventData);\n }\n\n } else if (userVectors && userVectors.eventVector && userVectors.eventVector.split('|').length == 10) {\n if (debugScr) console.log(\"The sequence is 10 element long\");\n //Changes to visitGap for gap between n-1 and nth session\n var visitGap = localStorage.getItem('visitGap');\n //Check if null or undefined\n if (!visitGap || typeof visitGap == undefined || visitGap == 'undefined') {\n visitGap = '';\n }\n\n var currentSessionStartTime = userVectors.timeVector.toString().split('|')[0];\n\n var vectorsEventData = {};\n\n var newVectorKeys = Object.keys(newUserVectors);\n for (var k = 0; k < newVectorKeys.length; k++) {\n vectorsEventData[newVectorKeys[k]] = newUserVectors[newVectorKeys[k]];\n }\n\n\n\n vectorsEventData.z1_userVectors = JSON.stringify(userVectors);\n vectorsEventData.z1_features = z1_features;\n vectorsEventData.session_start_time = currentSessionStartTime;\n vectorsEventData.visitGap = visitGap;\n\n ZineOne.pushEvent('_ws_updatevectors_len10', vectorsEventData);\n }\n\n //If this is the 10th Element, send the features and vectors\n } catch (ie) {\n console.log('[ZineOne updateUserVectors] : ', ie);\n }\n }\n\n function updateFeatures() {\n\n if (debugScr) console.log('Into updateFeatures');\n /* z1_features is stored in local storage which holds following stats\n ** n Total number of events in visit\n ** A Total number of addedtobag events in the visit\n ** B Total number of breachedgeofence events in the visit\n ** C Total number of continuedcheckout events in the visit\n ** D Total number of exitgeofence events in the visit\n ** E Total number of placedorder events in the visit\n ** F Total number of searched events in the visit\n ** G Total number of startedcheckout events in the visit\n ** H Total number of viewedcart events in the visit\n ** I Total number of viewedcatalog events in the visit\n ** J Total number of viewedhome events in the visit\n ** K Total number of viewedproduct events in the visit\n ** p Total number of evented pages loaded in visit\n */\n\n var z1_features = localStorage.getItem('z1_features');\n if (!z1_features) {\n z1_features = \"0|0|0|0|0|0|0|0|0|0|0|0|0|0\";\n }\n\n z1_features_arr = z1_features.split('|');\n\n z1_features_arr[0] = Number(z1_features_arr[0]) + 1; //n\n\n if (evtName.toLocaleLowerCase() == '_ws_addedtobag') {\n z1_features_arr[1] = Number(z1_features_arr[1]) + 1;\n } else if (evtName.toLocaleLowerCase() == 'breachedgeofence') {\n z1_features_arr[2] = Number(z1_features_arr[2]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_completeshipping') {\n z1_features_arr[3] = Number(z1_features_arr[3]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == 'exitgeofence') {\n z1_features_arr[4] = Number(z1_features_arr[4]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_placedorder') {\n z1_features_arr[5] = Number(z1_features_arr[5]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_searched') {\n z1_features_arr[6] = Number(z1_features_arr[6]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_startedcheckout') {\n z1_features_arr[7] = Number(z1_features_arr[7]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_viewedcart') {\n z1_features_arr[8] = Number(z1_features_arr[8]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_viewedcatalog') {\n z1_features_arr[9] = Number(z1_features_arr[9]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_viewedhome') {\n z1_features_arr[10] = Number(z1_features_arr[10]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_viewedproduct') {\n z1_features_arr[11] = Number(z1_features_arr[11]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_completepayment') {\n z1_features_arr[13] = Number(z1_features_arr[13]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n }\n\n z1_features = z1_features_arr[0] + '|' + z1_features_arr[1] + '|' + z1_features_arr[2] + '|' + z1_features_arr[3] + '|' + z1_features_arr[4] + '|' + z1_features_arr[5] + '|' + z1_features_arr[6] + '|' + z1_features_arr[7] + '|' + z1_features_arr[8] + '|' + z1_features_arr[9] + '|' + z1_features_arr[10] + '|' + z1_features_arr[11] + '|' + z1_features_arr[12] + '|' + z1_features_arr[13];\n localStorage.setItem('z1_features', z1_features);\n }\n\n /*function isIE() {\n var ua = window.navigator.userAgent; //Check the userAgent property of the window.navigator object\n var msie = ua.indexOf('MSIE '); // IE 10 or older\n var trident = ua.indexOf('Trident/'); //IE 11\n return (msie > 0 || trident > 0);\n };\n var isIEFlag = isIE();\n if (!isIEFlag) return;\n var cust_id = pageData.customerDetails.customerID ? pageData.customerDetails.customerID : \"\";\n if ( !(cust_id == \"3000000030411692\" || cust_id == \"3000000126553504\") ) return;*/\n\n console.log(\"RTO Shopping cart START\");\n console.log('This is on the page load');\n\n // Appends style tag\n function appendStyle(styles) {\n var css = document.createElement('style');\n css.type = 'text/css';\n\n if (css.styleSheet) css.styleSheet.cssText = styles;\n else css.appendChild(document.createTextNode(styles));\n\n document.getElementsByTagName(\"head\")[0].appendChild(css);\n }\n\n\n function getUrlParameter(sParam) {\n var sPageURL = decodeURIComponent(window.location.search.substring(1)),\n sURLVariables = sPageURL.split('&'),\n sParameterName,\n i;\n\n for (i = 0; i < sURLVariables.length; i++) {\n sParameterName = sURLVariables[i].split('=');\n\n if (sParameterName[0] === sParam) {\n return sParameterName[1] === undefined ? true : sParameterName[1];\n }\n }\n }\n\n\n function addDataToRedemptionPopup(popupDiv,promoCode)\n {\n //console.log(' addDataToRedemptionPopup '+document.getElementsByClassName('kc-applyContainer')[0]);\n\n var InitPopupContent = document.getElementsByClassName('kc-applyContainer')[0];\n \n\n var promoTextContent = '<div class=\"popupPromoText\">Your promo code is already entered, click Apply to redeem.</div>';\n\n\n console.log('Final HTML '+InitPopupContent);\n\n InitPopupContent.insertAdjacentHTML(\"afterbegin\", promoTextContent);\n\n //document.getElementsByClassName('kc-applyContainer')[0].innerHTML = InitPopupContent;\n\n document.getElementById('promo-kcInput').value = promoCode;\n\n document.getElementById('applyInputButton').onclick = function(){\n\n var currentPromoCode = document.getElementById('promo-kcInput').value;\n\n if(currentPromoCode == promoCode)\n {\n var existingSupc = localStorage.getItem('z1_supc');\n\n\n\n existingSupc = JSON.parse(existingSupc);\n\n console.log('Got existingSupc ',existingSupc);\n\n existingSupc.is_redeemed = true;\n\n console.log('Setting is_redeemed ',existingSupc);\n\n var status = localStorage.setItem('z1_supc',JSON.stringify(existingSupc));\n\n console.log(status+' After Storage',localStorage.getItem('z1_supc'));\n\n sessionStorage.setItem('z1_supc',JSON.stringify(existingSupc));\n\n console.log(status+' After Session Storage',sessionStorage.getItem('z1_supc'));\n\n sendRTOOmniture(2);\n\n }\n\n };\n\n\n }\n\n function getSessionStartTime()\n {\n var userVector = JSON.parse(localStorage.getItem('z1_userVectors'));\n\n var timeVector = userVector.timeVector.toString().split('|');\n\n return timeVector[0];\n }\n\n\n function sendDisEventToC3(pageName,type,existingSupc)\n {\n var eventName = '_ws_rto_page_report';\n\n var sessionStartTime = getSessionStartTime();\n\n\n var returnObj = {};\n returnObj.pgN = pageName;\n returnObj.sessionStartTime = sessionStartTime;\n returnObj.type = type;\n returnObj.rtoName = existingSupc.rtoName;\n returnObj.identifier = existingSupc.identifier;\n\n ZineOne.pushEvent(eventName, returnObj);\n\n }\n\n\n //Case 1: Display Omniture \n //Case 2: Redemption Omniture\n function sendRTOOmniture(caseToSend)\n {\n\n var existingSupc = localStorage.getItem('z1_supc');\n\n if(existingSupc != null && existingSupc != undefined && existingSupc != 'null')\n {\n\n existingSupc = JSON.parse(existingSupc);\n\n var prop75 = existingSupc.omniturePrefix+'|';\n prop75 = prop75 + 'C:' + existingSupc.offerCampaign + '|';\n prop75 = prop75 + existingSupc.identifier + '|';\n\n\n if(caseToSend == 1)\n {\n prop75 = prop75+'CP|CP|';\n\n sendDisEventToC3(\"CP\",\"shown\",existingSupc);\n }\n\n if(caseToSend == 2)\n {\n prop75 = prop75+'OM|';\n sendDisEventToC3(\"OM\",\"redeem\",existingSupc);\n\n updateUserVectors(true,'applied');\n }\n\n \n \n //prop75 = prop75+'P:'+existingSupc.pscore+'|';\n //prop75 = prop75+'O:'+existingSupc.offerValue+'|';\n //prop75 = prop75+'T:'+pageData.cartDetails.cartSubTotalValue+'|';\n //prop75 = prop75+'OC:'+existingSupc.offerCode;\n\n var prop75Obj = {};\n prop75Obj['prop75'] = prop75;\n\n console.log('Got Prop 75 ',prop75Obj);\n\n fireOmniture(prop75Obj);\n\n }\n }\n\n\n function formatAMPM(date) {\n var hours = date.getHours();\n var minutes = date.getMinutes();\n var ampm = hours >= 12 ? 'pm' : 'am';\n hours = hours % 12;\n hours = hours ? hours : 12; // the hour '0' should be '12'\n minutes = minutes < 10 ? '0'+minutes : minutes;\n var strTime = hours + ':' + minutes + ' ' + ampm;\n return strTime;\n }\n\n function showRTOBanner(e)\n {\n // Style string for RTO\n var style = '.popupPromoText {font-size: 1.85em;margin-bottom: 5px;}.z1_b_container_kohlsbannertoparrow_rto {font-family: \\'Gotham 5r\\';position: fixed;padding: 0px;z-index: 1000;background: transperant;transition: all 1s ease-in;-webkit-animation: fadein 2s;/* Safari, Chrome and Opera > 12.1 */-moz-animation: fadein 2s;/* Firefox < 16 */-ms-animation: fadein 2s;/* Internet Explorer */-o-animation: fadein 2s;/* Opera < 12.1 */animation: fadein 2s; { z1_position_val}}@keyframes fadein {from { opacity: 0;}to { opacity: 1;}}/* Firefox < 16 */@-moz-keyframes fadein {from { opacity: 0;}to { opacity: 1;}}/* Safari, Chrome and Opera > 12.1 */@-webkit-keyframes fadein {from { opacity: 0;}to { opacity: 1;}}/* Internet Explorer */@-ms-keyframes fadein {from { opacity: 0;}to { opacity: 1;}}/* Opera < 12.1 */@-o-keyframes fadein {from { opacity: 0;}to { opacity: 1;}}.arrow_box {position: absolute;text-align: center;left: 50%;transform: translate(-50%, 100%);bottom: -20px;background: #ffffff;border: 1px solid #bfbfbf;padding: 1rem;border-radius: 0.6rem;width: 238px;-webkit-box-shadow: 0px 2px 10px 7px rgba(70, 70, 70, 0.8);-moz-box-shadow: 0px 2px 10px 7px rgba(70, 70, 70, 0.8);box-shadow: 0px 2px 10px 7px rgba(70, 70, 70, 0.8);}.arrow_box:after,.arrow_box:before {content: \" \";position: absolute;}.arrow_box:after {border-color: rgba(255, 255, 255, 0);border-bottom-color: #ffffff;border-width: 20px;margin-left: -20px;}.arrow_box:before {width: 22px;height: 22px;background: #ffffff;z-index: 100;transform: translate(-50%, -50%) rotate(45deg);top: 1px;left: 50%;box-shadow: -6px -6px 5px 1px #999;}.z1_b_container_kohlsbannertoparrow_rto .z1_b_box_style {position: relative;}.z1_b_container_kohlsbannertoparrow_rto .z1_b_c1 {padding-left: 0px !important;margin-left: 0px;min-width: none;max-width: none;align-self: center;}.z1_b_container_kohlsbannertoparrow_rto .z1_b_c1 img {min-width: 64px;max-width: 64px;min-height: 64px;max-height: 64px;}.z1_b_container_kohlsbannertoparrow_rto .z1_b_c2 {padding: 0 10px;font-size: 0.9em !important;line-height: 1.5;}.z1_b_container_kohlsbannertoparrow_rto .z1_b_c2 .titleText {background: url(\\'https://d2p4r375zfkzm8.cloudfront.net/zb-design-com/arrowdown3.png\\') no-repeat 0 2px;font-weight: bold;color: #000;font-size: 1.08em;padding: 0px 0 3px 20px;line-height: 1.4;}.z1_b_container_kohlsbannertoparrow_rto .closeBtn {cursor: pointer;position: absolute;right: 3px;top: 8px;width: 20px;height: 20px;margin: 0;padding: 0;font-size: 19px;font-family: \\'Gotham 4r\\';}.z1_b_container_kohlsbannertoparrow_rto .closeBtn img {border-bottom-left-radius: 50%;border-top-left-radius: 50%;border-bottom-right-radius: 50%;border-top-right-radius: 50%;height: 13px;width: 13px;opacity: 1;}.z1_b_container_kohlsbannertoparrow_rto .offerPrice {font-size: 1.3em;color: #e8342c;padding-right: 8px;}.z1_b_container_kohlsbannertoparrow_rto .usernameText {font-size: 17px;font-weight: bold;font-style: normal;font-stretch: normal;line-height: 1.47;letter-spacing: normal;text-align: center;color: #005553;}.z1_b_container_kohlsbannertoparrow_rto .todaytext {font-size: 1.5em;color: #3a3a3a;font-weight: 400;margin: 5px 0px;display: flex;justify-content: center;align-items: center;}.z1_b_container_kohlsbannertoparrow_rto #offerDuration {font-weight: bold;font-size: 24px;}.z1_b_container_kohlsbannertoparrow_rto .todaytext div#offerDurationUnits {display: flex;flex-direction: column;text-align: left;font-size: 0.8em;}.z1_b_container_kohlsbannertoparrow_rto .savetext_row {padding: 0.6rem 0;}.z1_b_container_kohlsbannertoparrow_rto .cupontext {font-size: 14px;font-weight: 500;font-style: normal;font-stretch: normal;line-height: 1.07;letter-spacing: -0.4px;text-align: center;color: #000000;margin: 20px;}.z1_b_container_kohlsbannertoparrow_rto .cupontext span {font-weight: bold;color: #005553;}.z1_b_container_kohlsbannertoparrow_rto .btn_addoffer {background: #005553;text-transform: uppercase;color: #060606;padding: 0.40rem 1.85rem;border-radius: 2.2px;text-decoration: none;margin: 12px auto;letter-spacing: 1px;font-size: 13px;font-weight: bold;font-style: normal;font-stretch: normal;line-height: 0.6;letter-spacing: 0.5px;text-align: center;color: #ffffff;width: 138px;height: 31px;}.z1_b_container_kohlsbannertoparrow_rto .btn_addoffer.copy {content: \"Copy Offer\"}.z1_b_container_kohlsbannertoparrow_rto .btn_addoffer.copy:hover span {display: none;}.z1_b_container_kohlsbannertoparrow_rto .btn_addoffer.copy:hover:before {/* background:#d2e2d3; color: #005553; */content: \"Click to Copy\";}.z1_b_container_kohlsbannertoparrow_rto .btn_addoffer.copied:before {content: \"Copied\"}.z1_b_container_kohlsbannertoparrow_rto .btn_addoffer.copied {background-color: #d2e2d3;color: #005553;}.z1_b_container_kohlsbannertoparrow_rto .bottom_link {margin-top: 25px;font-size: 12px;font-weight: normal;font-style: normal;font-stretch: normal;line-height: 0.92;letter-spacing: normal;text-align: center;color: #444444;}.z1_b_container_kohlsbannertoparrow_rto .bottom_link a {text-decoration: underline;color: #969696;font-size: 0.8rem;line-height: 1.2;}.z1_b_container_kohlsbannertoparrow_rto .bottom_link a:hover {color: #333;}.z1_b_container_kohlsbannertoparrow_rto .saveMsg {font-size: 17px;font-weight: bold;font-style: normal;font-stretch: normal;line-height: 1.47;letter-spacing: normal;text-align: center;color: #005553;}.z1_b_container_kohlsbannertoparrow_rto .offerText {font-size: 37.1px;font-weight: bold;font-style: normal;font-stretch: normal;line-height: 0.49;letter-spacing: normal;text-align: center;color: #005553;margin: 20px 0;display: flex;justify-content: center;align-items: center;}.z1_b_container_kohlsbannertoparrow_rto .treatText {font-size: 17px;font-weight: 500;font-style: normal;font-stretch: normal;line-height: normal;letter-spacing: normal;text-align: center;color: #222222;}.z1_b_container_kohlsbannertoparrow_rto .treatTextNew {font-size: 1.2em;margin-bottom: 10px;color: #000;display: none;}.z1_b_container_kohlsbannertoparrow_rto .saveCont.saveMsg {margin-top: 8px;}.z1_b_container_kohlsbannertoparrow_rto .uptillTime {font-weight: 900;}.z1_b_container_kohlsbannertoparrow_rto .rtoOfferValue {font-size: 2em;}.treatTextLatest {font-size: 14px;font-weight: 500;font-style: normal;font-stretch: normal;line-height: normal;letter-spacing: normal;text-align: center;color: #222222;}.btn_offer_container {margin: 25px;}.z1-rto-dollar_reward {font-weight: bold;font-style: normal;font-stretch: normal;line-height: normal;letter-spacing: normal;text-align: center;color: #005553;margin-bottom: 10px;}.z1-rto-dollar_reward_content {display: flex;flex-wrap: wrap;justify-content: center;}.z1-rto-dollar-text {font-size: 34.2px;margin-top: auto;width: 20px;height: 25px;margin-bottom: auto;}.z1-rto-dollar-text-amount {font-size: 68px;height: 68px;letter-spacing: -3px;}.z1-rto-dollar-text-dOff-outer {margin-top: 15px;margin-bottom: auto;height: 25px;}.z1-rto-dollar-text-dOff-off {font-size: 16px;margin-left: -26px;position: relative;top: 4px;}.z1-rto-dollar-text-dOff-off-amount {font-size: 38px;position: relative;top: -4px;left: -5px;text-shadow: -1px 1px 0 #fff, 1px 1px 0 #fff, 1px -1px 0 #fff, -1px -1px 0 #fff;}.z1-rto-dollar-text-dOff-off-miniDollar {height: -1px;font-size: 23px;position: relative;top: -9px;}.z1-rto-dollar-text-dOff-off-miniDollarAmount {letter-spacing: -1px;}.z1_b_container_kohlsbannertoparrow_rto.loyalty {background-color: #e9f4cc;}.loyalty .usernameText {color: #208033;}.loyalty .saveMsg {color: #208033;}.loyalty .offerText {color: #208033;}.loyalty #rtoOfferCode {color: #208033;}.loyalty .z1-rto-dollar_reward_content {color: #208033;}.loyalty .btn_addoffer {background: #208033;}.loyalty.arrow_box:after {border-bottom-color: #208033;}.loyalty.arrow_box:before {background: #208033;}.z1_b_container_kohlsbannertoparrow_rto.loyalty .bottom_link a {color: #444444;}.loyalty-cont.disable {display: none}.loyalty-cont.enable {display: block}.loyalty-cont {background-color: #208033;position: relative;top: -17px;left: -17px;width: 273px;height: 60px;border-radius: 0.6em 0.6em 0 0;color: #fff;}.loyalty-cont .heading-1 {padding-top: 15px;font-size: 16px;}.loyalty-cont .heading-2 {padding-top: 8px;font-size: 12px;}.z1_b_container_kohlsbannertoparrow_rto.loyalty .closeBtn {z-index: 1;color: #fff;}.z1_b_container_kohlsbannertoparrow_rto.loyalty .loyalty-cont.disable {display: block;}.element_v2 {display: none;}.ui_v2 .element_v1 {display: none;}.ui_v2 .element_v2 {display: block;}#v2-take {position: absolute;left: 42px;top: 85px;}.ui_v2 .z1-rto-dollar-text {font-size: 36.9px;height: 5px;}.ui_v2 .z1-rto-dollar-text-amount {font-size: 82px;padding: 5px;}.ui_v2 {font-family: \\'Gotham 5r\\';}.ui_v2 .z1-rto-dollar-text-dOff-off {font-size: 25.6px;margin-left: 0px;top: 45px;font-weight: bold;}.ui_v2 .z1-rto-dollar_reward {margin-top: 5px;}.ui_v2 .treatText {margin-top: 25px;}.ui_v2.z1_b_container_kohlsbannertoparrow_rto .treatText {margin-top: 15px;font-size: 16px;color: #000;}.ui_v2.z1_b_container_kohlsbannertoparrow_rto .offerDuration {color: #000;font-size: 20px;margin-top: 5px;}.ui_v2.z1_b_container_kohlsbannertoparrow_rto .saveMsg {font-weight: normal;}.ui_v2.z1_b_container_kohlsbannertoparrow_rto .usernameText {font-weight: normal;}.ui_v2.z1_b_container_kohlsbannertoparrow_rto .cupontext {color: #005553;font-size: 15px;}.ui_v2.z1_b_container_kohlsbannertoparrow_rto .bottom_link a {color: #444444;}.ui_v2.dollar_fix .z1-rto-dollar-text-dOff-off {top: 20px;}.ui_v2.dollar_fix #v2-take {top: 70px;}.ui_v2.dollar_fix.z1_b_container_kohlsbannertoparrow_rto .offerText {margin: 30px 0;margin-bottom: 25px;}.ui_v2.dollar_fix.z1_b_container_kohlsbannertoparrow_rto .rtoOfferValue {font-size: 89.7px;}.ui_v2.dollar_fix.z1_b_container_kohlsbannertoparrow_rto .offerText {font-size: 40.4px;}';\n\n console.log('Before RTO Style');\n\n appendStyle(style);\n\n\n var domstr_val = \"\";\n var dolStr = \"$\";\n var pctStr = \"\";\n\n domstr_val = '<div id=\"v2-take\" class=\"saveMsg element_v2\">Take</div><div class=\\'offerText\\'>'+dolStr+'<span id=\\'rtoOfferValue\\' class=\\'rtoOfferValue\\'></span><span class=\"z1-rto-dollar-text-dOff-off element_v2\">off</span>'+'</div>';\n\n\n if (e.offType == \"PERCENT_FIX\") {\n pctStr = \"%\"; \n\n domstr_val = '<div class=\\'offerText\\'>'+'<span id=\\'rtoOfferValue\\' class=\\'rtoOfferValue\\'></span>'+pctStr+'</div>'; \n } \n\n if (e.offType == \"DOLLAR_THR\") {\n domstr_val = '<div class=\"z1-rto-dollar_reward\"><div id=\"v2-take\" class=\"saveMsg element_v2\">Take</div><div class=\"z1-rto-dollar_reward_content\"><div class=\"z1-rto-dollar-text\">$</div><div id=\\'rtoOfferValue\\' class=\"z1-rto-dollar-text-amount\"></div><div class=\"z1-rto-dollar-text-dOff-outer\"><span class=\"z1-rto-dollar-text-dOff-off\">off</span> <br><span class=\"z1-rto-dollar-text-dOff-off-amount element_v1\"><span class=\"z1-rto-dollar-text-dOff-off-miniDollar\">$</span><span class=\"z1-rto-dollar-text-dOff-off-miniDollarAmount\">'+e.offThres+'</span></span></div></div></div>';\n }\n\n var domstr = '<div data-zineone-properties=\"modal:true;container-class:z1_b_container_kohlsbannertoparrow_rto;\" id=\"z1-rto-div\" class=\"z1_b_container_kohlsbannertoparrow_rto arrow_box\"><div class=\"closeBtn\" onclick=\"var el=document.getElementById(\\'z1-rto-div\\');el.innerHTML=\\'\\';el.parentNode.removeChild(el);\">x</div><div class=\"z1_b_c1\"><div class=\\'loyalty-cont disable\\'><div class=\\'heading-1\\'>KOHL’S REWARDS®</div><div class=\\'heading-2\\'>MEMBER EXCLUSIVE</div></div><div><span class=\"usernameText\">Hi, </span><span class=\\'saveMsg element_v1\\'> save</span><div class=\\'saveMsg element_v2\\'>your cart looks great!</div></div>' + domstr_val +'<div class=\\'treatText element_v1\\'>in the next <span id=\\'offerDuration\\'></span> minutes.</div><div class=\\'saveMsg element_v2\\'>the items in your cart!</div><div class=\\'treatTextNew\\'>Valid until <span id=\\'uptillTime\\' class=\\'uptillTime\\'></span></div><div class=\\'treatTextLatest element_v1\\'>(Go ahead, treat yourself!)</div><div class=\\'element_v2\\'><div class=\\'treatText\\'>Check out in the next</div><div class=\\'offerDuration\\'><span id=\\'offerDurationv2\\'></span> minutes.</div></div><div class=\"cupontext\">PROMO CODE: <span id=\\'rtoOfferCode\\'></span></div><div class=\"btn_offer_container\"><a class=\"btn_addoffer\"><span id=\\'btn_addoffer\\'></span></a></div><div class=\"bottom_link\"><a id=\\'discliamer_href\\' href=\"#\" target=\\'_default\\'>details & exclusions</a></div><input type=\"text\" id=\"textCopy\" style=\\'opacity:0;pointer-events:none\\' /></div></div>';\n\n var t = document.createRange().createContextualFragment(domstr);\n\n console.log('Before RTO Z1 Widget');\n\n document.getElementById('z1widget').appendChild(t);\n\n\n /*document.getElementById('rtoOfferValue').append(e.offerValue);\n document.getElementById('rtoOfferCode').append(e.offerCode);\n document.getElementById('textCopy').value = e.offerCode; \n\n document.getElementById('offerDuration').append(e.offerDuration);\n\n document.getElementById('offerDurationv2').append(e.offerDuration);\n\n document.getElementById('discliamer_href').href = e.disclaimer;*/\n document.getElementById('rtoOfferValue').innerHTML=e.offerValue;\n document.getElementById('rtoOfferCode').innerHTML=e.offerCode;\n document.getElementById('textCopy').value = e.offerCode; \n\n document.getElementById('offerDuration').innerHTML=e.offerDuration;\n\n document.getElementById('offerDurationv2').innerHTML=e.offerDuration;\n\n document.getElementById('discliamer_href').href = e.disclaimer;\n\n var uptillTime = new Date();\n uptillTime.setMinutes(uptillTime.getMinutes() + Number(e.offerDuration));\n\n var uptillTimeStr = formatAMPM(uptillTime);\n\n //document.getElementById('uptillTime').append(uptillTimeStr + '.');\n document.getElementById('uptillTime').innerHTML=uptillTimeStr + '.';\n\n\n\n if(document.getElementsByClassName('first-name')[0] && document.getElementsByClassName('first-name')[0].innerText.toLowerCase()!=\"account\")\n {\n document.getElementsByClassName('usernameText')[0].innerText = document.getElementsByClassName('first-name')[0].innerText + ','; \n }\n else\n {\n document.getElementsByClassName('saveMsg')[0].innerText = \"Save\";\n }\n\n if(e.loyaltyCx == true)\n {\n document.getElementById('z1-rto-div').classList.add('loyalty');\n }\n\n\n if(e.ui_version && e.ui_version == 2)\n {\n document.getElementById('z1-rto-div').classList.add('ui_v2');\n document.getElementById('z1-rto-div').classList.add(e.offType.toLowerCase());\n }\n\n\n if(e.cta == \"COPY\")\n {\n document.getElementById('btn_addoffer').innerText = \"COPY OFFER\";\n document.getElementsByClassName('btn_addoffer')[0].classList.add('copy');\n }\n\n if(e.cta == \"ADD\" || e.cta == 'WALLET')\n {\n document.getElementById('btn_addoffer').innerText = \"ADD OFFER\";\n }\n\n\n document.getElementsByClassName('btn_addoffer')[0].onclick = function(){\n\n console.log('btn_addoffer Click ');\n\n\n if(e.cta == 'WALLET')\n {\n if(pageData && pageData.cartDetails && pageData.cartDetails.cartSubTotalValue)\n {\n var cartValue = parseInt(pageData.cartDetails.cartSubTotalValue);\n\n //alert('Got Cart Value '+cartValue);\n if(cartValue == 0)\n {\n urlToGo = '/wallet/my_wallet.jsp#offers';\n\n location.href=urlToGo;\n\n return;\n }\n\n } \n }\n\n\n document.getElementsByClassName(\"kohlscashapply\")[0].onclick = function(){\n\n\n if(e.cta == 'COPY')\n {\n\n var copyTextField = document.getElementById('textCopy');\n copyTextField.select();\n\n var copied = document.execCommand (\"copy\");\n\n console.log('Got Copied Status '+copied);\n \n document.getElementsByClassName('btn_addoffer')[0].classList.add('copied');\n document.getElementById('btn_addoffer').innerText = \"\";\n \n e.is_copied = 'true';\n localStorage.setItem('z1_supc',JSON.stringify(e));\n\n } \n \n\n console.log(\"kohlscashapply Click \"); \n\n var timeCounter = 0;\n var maxCounter = 10;\n var timeDelay = 500;\n\n var popupCheck = setInterval(function(){ \n\n console.log(\"Checking for Redemption Popup \"+timeCounter); \n\n var popupDiv = document.getElementsByClassName('kc-applyContainer')[0];\n\n //var popupDiv = document.getElementById('promo-kcInput');\n\n console.log('Got Popup Div '+popupDiv);\n\n if(popupDiv != undefined && popupDiv != null)\n {\n clearInterval(popupCheck);\n\n\n //setTimeout(function(){ }, 500);\n\n var parentDiv = document.getElementById('tr-wallet-content-placeholder');\n\n addDataToRedemptionPopup(parentDiv,e.offerCode);\n\n return;\n }\n\n if(timeCounter > maxCounter)\n {\n clearInterval(popupCheck);\n }\n\n timeCounter++;\n\n }, timeDelay);\n\n\n\n };\n \n\n document.getElementsByClassName(\"kohlscashapply\")[0].click(); \n\n document.getElementById('z1widget').innerHTML='';\n\n };\n\n \n\n sendRTOOmniture(1);\n\n\n document.getElementById(\"z1-rto-div\").onclick = function(e){\n //console.log(\"Event...\",e)\n e.stopPropagation();\n\n //console.log('Elemtn Id ',e.toElement.id);\n\n if(e.toElement.id == 'discliamer_href')\n {\n window.open(\n document.getElementById(\"discliamer_href\").href,\n '_blank' // <- This is what makes it open in a new window.\n );\n }\n //e.preventDefault();\n return false;\n };\n\n\n\n\n }\n\n\n function getDayLightOffset()\n {\n //Automatically adjust for GMT to Central Timediff based on Daylight savings\n //Returns number of hours Central is behind GMT\n //\n var now = new Date();\n //test data\n var test = now.getTime(); //238*24*3600000;\n var nowUtc = new Date(test);\n var month = nowUtc.getMonth()+1; //make jan=1\n\n if (month < 3 || month > 11) return 6; // savings=F\n if (month > 3 && month < 11) return 5; // savings=T\n\n // switch if >2nd sun in march or >1st sun in nov\n // switches at midnight UTC, so 5 or 6 hrs away from 2AM Central\n\n var tzDiffInHours; //UTC vs Central diff in hours\n var day = nowUtc.getDate(); //already 1 based\n var dow = nowUtc.getDay(); //already sun=0\n var previousSunday = day - dow; \n if (month == 3) tzDiffInHours = (previousSunday >= 8) ? 5 : 6;\n if (month == 11) tzDiffInHours = (previousSunday < 0) ? 5 : 6;\n \n //java.lang.System.out.println(\"@@@@@@ Daylight savings computed variable=\"+tzDiff);\n //var tzDiffInHours = 5; //Change on sunday nov 4, 2018, to 6hrs\n\n return tzDiffInHours;\n }\n\n function convertUTCtoCST(dateObj)\n {\n var dayLightOffset = getDayLightOffset();\n return new Date(dateObj.getTime() - ((1 * 60 * 60 * 1000) * dayLightOffset));\n }\n\n\n function getTimeFromApiFormat(dateStr)\n {\n var dateStrSplit = dateStr.split(' ');\n\n var dateSplit = dateStrSplit[0].split('-');\n var timeSplit = dateStrSplit[1].split(':');\n\n var dateObj = new Date();\n dateObj.setYear(dateSplit[0]);\n dateObj.setMonth(dateSplit[1]-1);\n dateObj.setDate(dateSplit[2]);\n\n dateObj.setHours(timeSplit[0]);\n dateObj.setMinutes(timeSplit[1]-1);\n dateObj.setSeconds(timeSplit[2]);\n\n var dateObj = new Date((dateObj.getTime() - dateObj.getTimezoneOffset()*60*1000)/1000);\n\n console.log(dateObj.getTime()+' getTimeFromApiFormat '+dateObj);\n\n return dateObj.valueOf();\n\n }\n\n function checkForLocalRTO()\n {\n var existingSupc = localStorage.getItem('z1_supc');\n\n if(existingSupc != null && existingSupc != undefined && existingSupc != 'null')\n {\n\n var e = JSON.parse(existingSupc);\n\n var offerExpiry = e.offerExpiry;\n\n\n var currentDate = new Date();\n\n currentDate = convertUTCtoCST(currentDate);\n var currentTime = currentDate.valueOf();\n\n console.log(e.offerExpiry+\" Got Offer Expiry \");\n\n var endTime = getTimeFromApiFormat(e.offerExpiry);\n\n\n currentTime = Number(currentTime.toString().substring(0,currentTime.toString().length - 3));\n\n console.log(endTime+\" timeCheck Main: \" + currentTime);\n\n var timeCheck = endTime-currentTime;\n\n if(timeCheck > 0)\n {\n if(e.is_redeemed != true)\n {\n var expiryInMinutes = Math.ceil((timeCheck)/(60));\n\n e.offerDuration = expiryInMinutes;\n\n showRTOBanner(e); \n\n\n if(getUrlParameter('redeemCoupon') == 'true')\n {\n document.getElementById(\"btn_addoffer\").click(); \n }\n }\n \n\n\n }\n else\n {\n return false;\n }\n \n\n \n console.log(\" timeCheck: \" + timeCheck);\n\n return true;\n\n\n }\n\n return false;\n }\n\n\n\nfunction fireOmniture(z1Response) {\n\n //////***** whats the s.tl(this) ??? */\n\n if (z1Response && z1Response.prop75) {\n var eVar39 = z1Response.evar39 ? z1Response.evar39 : z1Response.customerId;\n s.tl(this, 'o', 'ZineOne Impression', {\n linkTrackVars: 'prop75,eVar39',\n prop75: z1Response.prop75,\n eVar39: eVar39\n });\n\n }\n\n\n}\n\n\nisSoftLoggedIn = getCookie(\"SoftLoggedInCookie\");\n\nif (pageData && pageData.customerDetails) {\n if (!isSoftLoggedIn || (isSoftLoggedIn && !isSoftLoggedIn.includes(\"true\"))) {\n if (pageData.customerDetails.isLoggedIn) isLoggedIn = \"true\";\n }\n}\n\n\n\n if(checkForLocalRTO() == true)\n {\n return;\n }\n\n localStorage.setItem('z1_supc',null);\n\n console.log(\"RTO Shopping cart END\");\n\n}\ncatch(err)\n{\n console.log(\"[Zineone] Error in RTO Offers Tag: WebStore Z1 tag. \", err);\n}\n\n","eventName":"load","pageSelector":{"type":"pgName","condition":"contains","val":"shopping_cart"}},{"tagName":"RTO Offers","actionType":"z1script","script":"/*Changes done for IE\nA. function declaration like, var abc = function() won't work in IE if function is used first and then declared and defined. Please take below precaution before using it:\n 1. If you want to use function declaration like, var abc = function(), first declare it and then use it\n 2. Use normal function declaration like, function abc(). you can declare function anywhere in the page and use it before or after declaration. It will work on all the browsers.\nB. Do not use multiline strings, also call as 'Template String'. Template Strings are demarked by a backtick(`).\n Example. var abc = `This is multiline\n comment`; //multiline comments won't work in IE\n Use simple concatenation to achieve the same like,\n var abc = \"\";\n abc += 'This is multiline';\n abc += 'comment';\nC. You can not set defalut parameter values for function in IE.\n for e.g. function abc(num = 0,str=\"hello\") //Won't work in IE\nD. You can not use arguments object ([...args] or (...args) in function) in IE.\n For e.g function abc(...args){\n console.log(\"received paramenters \", args)\n } // Won't work in IE\nE. 'append' function won't work in IE. You can use 'appendChild' function to achieve the same functionality.\nF. 'prepend' function won't work IE. Try to use 'insertBefore' function to achieve the same functionality.\nG. new Event() function won't work in IE. You can use new CustomEvent() function to achieve the same functionality.\nH. Arrow functions (=>) won't work in IE\n*/\n\nvar debugScr = true;\ntry {\n\n /*function isIE() {\n var ua = window.navigator.userAgent; //Check the userAgent property of the window.navigator object\n var msie = ua.indexOf('MSIE '); // IE 10 or older\n var trident = ua.indexOf('Trident/'); //IE 11\n return (msie > 0 || trident > 0);\n };\n var isIEFlag = isIE();\n if (!isIEFlag) return;\n var cust_id = pageData.customerDetails.customerID ? pageData.customerDetails.customerID : \"\";\n if ( !(cust_id == \"3000000030411692\" || cust_id == \"3000000126553504\") ) return;*/\n // var localVariable = localStorage.getItem('z1_rto_ui_v2');\n\n // if(!localVariable || localVariable == null || localVariable == 'null' || localVariable == undefined || localVariable == \"undefined\")\n // {\n // return;\n // }\n\n console.log(\"RTO offers START\");\n console.log('This is on the page load');\n\n\n function fireOmniture(z1Response) {\n\n //////***** whats the s.tl(this) ??? */\n\n if (z1Response && z1Response.prop75) {\n var eVar39 = z1Response.evar39 ? z1Response.evar39 : z1Response.customerId;\n s.tl(this, 'o', 'ZineOne Impression', {\n linkTrackVars: 'prop75,eVar39',\n prop75: z1Response.prop75,\n eVar39: eVar39\n });\n\n }\n\n\n }\n\n // Appends style tag\n function appendStyle(styles) {\n var css = document.createElement('style');\n css.type = 'text/css';\n\n if (css.styleSheet) css.styleSheet.cssText = styles;\n else css.appendChild(document.createTextNode(styles));\n\n document.getElementsByTagName(\"head\")[0].appendChild(css);\n }\n\n\n function getUrlParameter(sParam) {\n var sPageURL = decodeURIComponent(window.location.search.substring(1)),\n sURLVariables = sPageURL.split('&'),\n sParameterName,\n i;\n\n for (i = 0; i < sURLVariables.length; i++) {\n sParameterName = sURLVariables[i].split('=');\n\n if (sParameterName[0] === sParam) {\n return sParameterName[1] === undefined ? true : sParameterName[1];\n }\n }\n }\n\n\n function addDataToRedemptionPopup(popupDiv,promoCode)\n {\n //console.log(' addDataToRedemptionPopup '+document.getElementsByClassName('kc-applyContainer')[0]);\n\n var InitPopupContent = document.getElementsByClassName('kc-applyContainer')[0];\n \n\n var promoTextContent = '<div class=\"popupPromoText\">Your promo code is already entered, click Apply to redeem.</div>';\n\n\n console.log('Final HTML '+InitPopupContent);\n\n InitPopupContent.insertAdjacentHTML(\"afterbegin\", promoTextContent);\n\n //document.getElementsByClassName('kc-applyContainer')[0].innerHTML = InitPopupContent;\n\n document.getElementById('promo-kcInput').value = promoCode;\n\n document.getElementById('applyInputButton').onclick = function(){\n\n var currentPromoCode = document.getElementById('promo-kcInput').value;\n\n if(currentPromoCode == promoCode)\n {\n var existingSupc = localStorage.getItem('z1_supc');\n\n existingSupc = JSON.parse(existingSupc);\n\n existingSupc.is_redeemed = true;\n\n localStorage.setItem('z1_supc',JSON.stringify(existingSupc));\n\n\n sendRTOOmniture(2);\n\n }\n\n };\n\n\n }\n\n function getSessionStartTime()\n {\n var userVector = JSON.parse(localStorage.getItem('z1_userVectors'));\n\n var timeVector = userVector.timeVector.toString().split('|');\n\n return timeVector[0];\n }\n\n\n function sendDisEventToC3(pageName,type,existingSupc)\n {\n var eventName = '_ws_rto_page_report';\n\n var sessionStartTime = getSessionStartTime();\n\n\n var returnObj = {};\n returnObj.pgN = pageName;\n returnObj.sessionStartTime = sessionStartTime;\n returnObj.type = type;\n returnObj.rtoName = existingSupc.rtoName;\n returnObj.identifier = existingSupc.identifier;\n\n ZineOne.pushEvent(eventName, returnObj);\n\n }\n\n\n //Case 1: Display Omniture \n //Case 2: Redemption Omniture\n function sendRTOOmniture(caseToSend)\n {\n\n var existingSupc = localStorage.getItem('z1_supc');\n\n if(existingSupc != null && existingSupc != undefined && existingSupc != 'null')\n {\n\n existingSupc = JSON.parse(existingSupc);\n\n\n var prop75 = existingSupc.omniturePrefix+'|';\n prop75 = prop75 + 'C:' + existingSupc.offerCampaign + '|';\n prop75 = prop75 + existingSupc.identifier + '|';\n\n\n if(caseToSend == 1)\n {\n prop75 = prop75+'CP|HP|';\n sendDisEventToC3(\"HP\",\"shown\",existingSupc);\n }\n\n if(caseToSend == 2)\n {\n prop75 = prop75+'OM|';\n sendDisEventToC3(\"OM\",\"redeem\",existingSupc);\n }\n\n \n \n //prop75 = prop75+'P:'+existingSupc.pscore+'|';\n //prop75 = prop75+'O:'+existingSupc.offerValue+'|';\n //prop75 = prop75+'T:'+pageData.cartDetails.cartSubTotalValue+'|';\n //prop75 = prop75+'OC:'+existingSupc.offerCode;\n\n var prop75Obj = {};\n prop75Obj['prop75'] = prop75;\n\n console.log('Got Prop 75 ',prop75Obj);\n\n fireOmniture(prop75Obj);\n\n }\n }\n\n\n function formatAMPM(date) {\n var hours = date.getHours();\n var minutes = date.getMinutes();\n var ampm = hours >= 12 ? 'pm' : 'am';\n hours = hours % 12;\n hours = hours ? hours : 12; // the hour '0' should be '12'\n minutes = minutes < 10 ? '0'+minutes : minutes;\n var strTime = hours + ':' + minutes + ' ' + ampm;\n return strTime;\n }\n\n function showRTOBanner(e)\n {\n console.log(\"[ZineOne] RTO Offers tag running\");\n if (e.is_copied == 'true') return;\n // Style string for RTO\n var style = '.popupPromoText {font-size: 1.85em;margin-bottom: 5px;}.z1_b_container_kohlsbannertoparrow_rto {font-family: \\'Gotham 5r\\';position: fixed;padding: 0px;z-index: 1000;background: transperant;transition: all 1s ease-in;-webkit-animation: fadein 2s;/* Safari, Chrome and Opera > 12.1 */-moz-animation: fadein 2s;/* Firefox < 16 */-ms-animation: fadein 2s;/* Internet Explorer */-o-animation: fadein 2s;/* Opera < 12.1 */animation: fadein 2s; { z1_position_val}}@keyframes fadein {from { opacity: 0;}to { opacity: 1;}}/* Firefox < 16 */@-moz-keyframes fadein {from { opacity: 0;}to { opacity: 1;}}/* Safari, Chrome and Opera > 12.1 */@-webkit-keyframes fadein {from { opacity: 0;}to { opacity: 1;}}/* Internet Explorer */@-ms-keyframes fadein {from { opacity: 0;}to { opacity: 1;}}/* Opera < 12.1 */@-o-keyframes fadein {from { opacity: 0;}to { opacity: 1;}}.arrow_box {position: absolute;text-align: center;left: 50%;transform: translate(-50%, 100%);bottom: -20px;background: #ffffff;border: 1px solid #bfbfbf;padding: 1rem;border-radius: 0.6rem;width: 238px;-webkit-box-shadow: 0px 2px 10px 7px rgba(70, 70, 70, 0.8);-moz-box-shadow: 0px 2px 10px 7px rgba(70, 70, 70, 0.8);box-shadow: 0px 2px 10px 7px rgba(70, 70, 70, 0.8);}.arrow_box:after,.arrow_box:before {content: \" \";position: absolute;}.arrow_box:after {border-color: rgba(255, 255, 255, 0);border-bottom-color: #ffffff;border-width: 20px;margin-left: -20px;}.arrow_box:before {width: 22px;height: 22px;background: #ffffff;z-index: 100;transform: translate(-50%, -50%) rotate(45deg);top: 1px;left: 50%;box-shadow: -6px -6px 5px 1px #999;}.z1_b_container_kohlsbannertoparrow_rto .z1_b_box_style {position: relative;}.z1_b_container_kohlsbannertoparrow_rto .z1_b_c1 {padding-left: 0px !important;margin-left: 0px;min-width: none;max-width: none;align-self: center;}.z1_b_container_kohlsbannertoparrow_rto .z1_b_c1 img {min-width: 64px;max-width: 64px;min-height: 64px;max-height: 64px;}.z1_b_container_kohlsbannertoparrow_rto .z1_b_c2 {padding: 0 10px;font-size: 0.9em !important;line-height: 1.5;}.z1_b_container_kohlsbannertoparrow_rto .z1_b_c2 .titleText {background: url(\\'https://d2p4r375zfkzm8.cloudfront.net/zb-design-com/arrowdown3.png\\') no-repeat 0 2px;font-weight: bold;color: #000;font-size: 1.08em;padding: 0px 0 3px 20px;line-height: 1.4;}.z1_b_container_kohlsbannertoparrow_rto .closeBtn {cursor: pointer;position: absolute;right: 3px;top: 8px;width: 20px;height: 20px;margin: 0;padding: 0;font-size: 19px;font-family: \\'Gotham 4r\\';}.z1_b_container_kohlsbannertoparrow_rto .closeBtn img {border-bottom-left-radius: 50%;border-top-left-radius: 50%;border-bottom-right-radius: 50%;border-top-right-radius: 50%;height: 13px;width: 13px;opacity: 1;}.z1_b_container_kohlsbannertoparrow_rto .offerPrice {font-size: 1.3em;color: #e8342c;padding-right: 8px;}.z1_b_container_kohlsbannertoparrow_rto .usernameText {font-size: 17px;font-weight: bold;font-style: normal;font-stretch: normal;line-height: 1.47;letter-spacing: normal;text-align: center;color: #005553;}.z1_b_container_kohlsbannertoparrow_rto .todaytext {font-size: 1.5em;color: #3a3a3a;font-weight: 400;margin: 5px 0px;display: flex;justify-content: center;align-items: center;}.z1_b_container_kohlsbannertoparrow_rto #offerDuration,.z1_b_container_kohlsbannertoparrow_rto .offerDuration {font-weight: bold;font-size: 24px;}.z1_b_container_kohlsbannertoparrow_rto .todaytext div#offerDurationUnits {display: flex;flex-direction: column;text-align: left;font-size: 0.8em;}.z1_b_container_kohlsbannertoparrow_rto .savetext_row {padding: 0.6rem 0;}.z1_b_container_kohlsbannertoparrow_rto .cupontext {font-size: 14px;font-weight: 500;font-style: normal;font-stretch: normal;line-height: 1.07;letter-spacing: -0.4px;text-align: center;color: #000000;margin: 20px;}.z1_b_container_kohlsbannertoparrow_rto .cupontext span {font-weight: bold;color: #005553;}.z1_b_container_kohlsbannertoparrow_rto .btn_addoffer {background: #005553;text-transform: uppercase;color: #060606;padding: 0.40rem 1.85rem;border-radius: 2.2px;text-decoration: none;margin: 12px auto;letter-spacing: 1px;font-size: 13px;font-weight: bold;font-style: normal;font-stretch: normal;line-height: 0.6;letter-spacing: 0.5px;text-align: center;color: #ffffff;width: 138px;height: 31px;}.z1_b_container_kohlsbannertoparrow_rto .btn_addoffer.copy {content: \"Copy Offer\"}.z1_b_container_kohlsbannertoparrow_rto .btn_addoffer.copy:hover span {display: none;}.z1_b_container_kohlsbannertoparrow_rto .btn_addoffer.copy:hover:before {/* background:#d2e2d3; color: #005553; */content: \"Click to Copy\";}.z1_b_container_kohlsbannertoparrow_rto .btn_addoffer.copied:before {content: \"Copied\"}.z1_b_container_kohlsbannertoparrow_rto .btn_addoffer.copied {background-color: #d2e2d3;color: #005553;}.z1_b_container_kohlsbannertoparrow_rto .bottom_link {margin-top: 25px;font-size: 12px;font-weight: normal;font-style: normal;font-stretch: normal;line-height: 0.92;letter-spacing: normal;text-align: center;color: #444444;}.z1_b_container_kohlsbannertoparrow_rto .bottom_link a {text-decoration: underline;color: #969696;font-size: 0.8rem;line-height: 1.2;}.z1_b_container_kohlsbannertoparrow_rto .bottom_link a:hover {color: #333;}.z1_b_container_kohlsbannertoparrow_rto .saveMsg {font-size: 17px;font-weight: bold;font-style: normal;font-stretch: normal;line-height: 1.47;letter-spacing: normal;text-align: center;color: #005553;}.z1_b_container_kohlsbannertoparrow_rto .offerText {font-size: 37.1px;font-weight: bold;font-style: normal;font-stretch: normal;line-height: 0.49;letter-spacing: normal;text-align: center;color: #005553;margin: 20px 0;display: flex;justify-content: center;align-items: center;}.z1_b_container_kohlsbannertoparrow_rto .treatText {font-size: 17px;font-weight: 500;font-style: normal;font-stretch: normal;line-height: normal;letter-spacing: normal;text-align: center;color: #222222;}.z1_b_container_kohlsbannertoparrow_rto .treatTextNew {font-size: 1.2em;margin-bottom: 10px;color: #000;display: none;}.z1_b_container_kohlsbannertoparrow_rto .saveCont.saveMsg {margin-top: 8px;}.z1_b_container_kohlsbannertoparrow_rto .uptillTime {font-weight: 900;}.z1_b_container_kohlsbannertoparrow_rto .rtoOfferValue {font-size: 2em;}.treatTextLatest {font-size: 14px;font-weight: 500;font-style: normal;font-stretch: normal;line-height: normal;letter-spacing: normal;text-align: center;color: #222222;}.btn_offer_container {margin: 25px;}.z1-rto-dollar_reward {font-weight: bold;font-style: normal;font-stretch: normal;line-height: normal;letter-spacing: normal;text-align: center;color: #005553;margin-bottom: 10px;}.z1-rto-dollar_reward_content {display: flex;flex-wrap: wrap;justify-content: center;}.z1-rto-dollar-text {font-size: 34.2px;margin-top: auto;width: 20px;height: 25px;margin-bottom: auto;}.z1-rto-dollar-text-amount {font-size: 68px;height: 68px;letter-spacing: -3px;}.z1-rto-dollar-text-dOff-outer {margin-top: 15px;margin-bottom: auto;height: 25px;}.z1-rto-dollar-text-dOff-off {font-size: 16px;margin-left: -26px;position: relative;top: 4px;}.z1-rto-dollar-text-dOff-off-amount {font-size: 38px;position: relative;top: -4px;left: -5px;text-shadow: -1px 1px 0 #fff, 1px 1px 0 #fff, 1px -1px 0 #fff, -1px -1px 0 #fff;}.z1-rto-dollar-text-dOff-off-miniDollar {height: -1px;font-size: 23px;position: relative;top: -9px;}.z1-rto-dollar-text-dOff-off-miniDollarAmount {letter-spacing: -1px;}.z1_b_container_kohlsbannertoparrow_rto.loyalty {background-color: #e9f4cc;}.loyalty .usernameText {color: #208033;}.loyalty .saveMsg {color: #208033;}.loyalty .offerText {color: #208033;}.loyalty #rtoOfferCode {color: #208033;}.loyalty .z1-rto-dollar_reward_content {color: #208033;}.loyalty .btn_addoffer {background: #208033;}.loyalty.arrow_box:after {border-bottom-color: #208033;}.loyalty.arrow_box:before {background: #208033;}.z1_b_container_kohlsbannertoparrow_rto.loyalty .bottom_link a {color: #444444;}.loyalty-cont.disable {display: none}.loyalty-cont.enable {display: block}.loyalty-cont {background-color: #208033;position: relative;top: -17px;left: -17px;width: 272px;height: 60px;border-radius: 0.6em 0.6em 0 0;color: #fff;}.loyalty-cont .heading-1 {padding-top: 15px;font-size: 16px;}.loyalty-cont .heading-2 {padding-top: 8px;font-size: 12px;}.z1_b_container_kohlsbannertoparrow_rto.loyalty .closeBtn {z-index: 1;color: #fff;}.z1_b_container_kohlsbannertoparrow_rto.loyalty .loyalty-cont.disable {display: block;}.element_v2 {display: none;}.ui_v2 .element_v1 {display: none;}.ui_v2 .element_v2 {display: block;}#v2-take {position: absolute;left: 42px;top: 85px;}.ui_v2 .z1-rto-dollar-text {font-size: 36.9px;height: 5px;}.ui_v2 .z1-rto-dollar-text-amount {font-size: 82px;padding: 5px;}.ui_v2 {font-family: \\'Gotham 5r\\';}.ui_v2 .z1-rto-dollar-text-dOff-off {font-size: 25.6px;margin-left: 0px;top: 45px;font-weight: bold;}.ui_v2 .z1-rto-dollar_reward {margin-top: 5px;}.ui_v2 .treatText {margin-top: 25px;}.ui_v2.z1_b_container_kohlsbannertoparrow_rto .treatText {margin-top: 15px;font-size: 16px;color: #000;}.ui_v2.z1_b_container_kohlsbannertoparrow_rto .offerDuration {color: #000;font-size: 20px;margin-top: 5px;}.ui_v2.z1_b_container_kohlsbannertoparrow_rto .saveMsg {font-weight: normal;}.ui_v2.z1_b_container_kohlsbannertoparrow_rto .usernameText {font-weight: normal;}.ui_v2.z1_b_container_kohlsbannertoparrow_rto .cupontext {color: #005553;font-size: 15px;}.ui_v2.z1_b_container_kohlsbannertoparrow_rto .bottom_link a {color: #444444;}.ui_v2.dollar_fix .z1-rto-dollar-text-dOff-off {top: 20px;}.ui_v2.dollar_fix #v2-take {top: 70px;}.ui_v2.dollar_fix.z1_b_container_kohlsbannertoparrow_rto .offerText {margin: 30px 0;margin-bottom: 25px;}.ui_v2.dollar_fix.z1_b_container_kohlsbannertoparrow_rto .rtoOfferValue {font-size: 89.7px;}.ui_v2.dollar_fix.z1_b_container_kohlsbannertoparrow_rto .offerText {font-size: 40.4px;}';\n\n console.log('Before RTO Style');\n\n appendStyle(style);\n var domstr_val = \"\";\n var dolStr = \"$\";\n var pctStr = \"\";\n\n domstr_val = '<div id=\"v2-take\" class=\"saveMsg element_v2\">Take</div><div class=\\'offerText\\'>'+dolStr+'<span id=\\'rtoOfferValue\\' class=\\'rtoOfferValue\\'></span><span class=\"z1-rto-dollar-text-dOff-off element_v2\">off</span>'+'</div>';\n\n\n if (e.offType == \"PERCENT_FIX\") {\n pctStr = \"%\"; \n\n domstr_val = '<div class=\\'offerText\\'>'+'<span id=\\'rtoOfferValue\\' class=\\'rtoOfferValue\\'></span>'+pctStr+'</div>'; \n } \n\n if (e.offType == \"DOLLAR_THR\") {\n domstr_val = '<div class=\"z1-rto-dollar_reward\"><div id=\"v2-take\" class=\"saveMsg element_v2\">Take</div><div class=\"z1-rto-dollar_reward_content\"><div class=\"z1-rto-dollar-text\">$</div><div id=\\'rtoOfferValue\\' class=\"z1-rto-dollar-text-amount\"></div><div class=\"z1-rto-dollar-text-dOff-outer\"><span class=\"z1-rto-dollar-text-dOff-off\">off</span> <br><span class=\"z1-rto-dollar-text-dOff-off-amount element_v1\"><span class=\"z1-rto-dollar-text-dOff-off-miniDollar\">$</span><span class=\"z1-rto-dollar-text-dOff-off-miniDollarAmount\">'+e.offThres+'</span></span></div></div></div>';\n }\n\n\n var domstr = '<div data-zineone-properties=\"modal:true;container-class:z1_b_container_kohlsbannertoparrow_rto;\" id=\"z1-rto-div\" class=\"z1_b_container_kohlsbannertoparrow_rto arrow_box\"><div class=\"closeBtn\" onclick=\"var el=document.getElementById(\\'z1-rto-div\\');el.innerHTML=\\'\\';el.parentNode.removeChild(el);\">x</div><div class=\"z1_b_c1\"><div class=\\'loyalty-cont disable\\'><div class=\\'heading-1\\'>KOHL’S REWARDS®</div><div class=\\'heading-2\\'>MEMBER EXCLUSIVE</div></div><div><span class=\"usernameText\">Hi, </span><span class=\\'saveMsg element_v1\\'> save</span><div class=\\'saveMsg element_v2\\'>your cart looks great!</div></div>' + domstr_val +'<div class=\\'treatText element_v1\\'>in the next <span id=\\'offerDuration\\'></span> minutes.</div><div class=\\'saveMsg element_v2\\'>the items in your cart!</div><div class=\\'treatTextNew\\'>Valid until <span id=\\'uptillTime\\' class=\\'uptillTime\\'></span></div><div class=\\'treatTextLatest element_v1\\'>(Go ahead, treat yourself!)</div><div class=\\'element_v2\\'><div class=\\'treatText\\'>Check out in the next</div><div class=\\'offerDuration\\'><span id=\\'offerDurationv2\\'></span> minutes.</div></div><div class=\"cupontext\">PROMO CODE: <span id=\\'rtoOfferCode\\'></span></div><div class=\"btn_offer_container\"><a class=\"btn_addoffer\"><span id=\\'btn_addoffer\\'></span></a></div><div class=\"bottom_link\"><a id=\\'discliamer_href\\' href=\"#\" target=\\'_default\\'>details & exclusions</a></div><input type=\"text\" id=\"textCopy\" style=\\'opacity:0;pointer-events:none\\' /></div></div>';\n\n \n\n var t = document.createRange().createContextualFragment(domstr);\n\n console.log('Before RTO Z1 Widget');\n\n document.getElementById('z1widget').appendChild(t);\n\n\n /*document.getElementById('rtoOfferValue').append(e.offerValue);\n document.getElementById('rtoOfferCode').append(e.offerCode);\n document.getElementById('textCopy').value = e.offerCode; \n document.getElementById('offerDuration').append(e.offerDuration);\n\n document.getElementById('offerDurationv2').append(e.offerDuration);*/\n document.getElementById('rtoOfferValue').innerHTML= e.offerValue;\n document.getElementById('rtoOfferCode').innerHTML= e.offerCode;\n document.getElementById('textCopy').value = e.offerCode; \n document.getElementById('offerDuration').innerHTML= e.offerDuration;\n\n document.getElementById('offerDurationv2').innerHTML= e.offerDuration;\n\n \n\n document.getElementById('discliamer_href').href = e.disclaimer;\n\n\n var uptillTime = new Date();\n uptillTime.setMinutes(uptillTime.getMinutes() + Number(e.offerDuration));\n\n var uptillTimeStr = formatAMPM(uptillTime);\n\n //document.getElementById('uptillTime').append(uptillTimeStr + '.');\n document.getElementById('uptillTime').innerHTML = uptillTimeStr + '.';\n\n \n if(document.getElementsByClassName('first-name')[0] && document.getElementsByClassName('first-name')[0].innerText.toLowerCase()!=\"account\")\n {\n document.getElementsByClassName('usernameText')[0].innerText = document.getElementsByClassName('first-name')[0].innerText + ','; \n }\n else\n {\n document.getElementsByClassName('saveMsg')[0].innerText = \"Save\";\n }\n\n\n if(e.loyaltyCx == true)\n {\n document.getElementById('z1-rto-div').classList.add('loyalty');\n }\n\n if(e.ui_version && e.ui_version == 2)\n {\n document.getElementById('z1-rto-div').classList.add('ui_v2');\n document.getElementById('z1-rto-div').classList.add(e.offType.toLowerCase());\n }\n\n if(e.cta == \"COPY\")\n {\n document.getElementById('btn_addoffer').innerText = \"COPY OFFER\";\n document.getElementsByClassName('btn_addoffer')[0].classList.add('copy');\n }\n\n if(e.cta == \"ADD\" || e.cta == \"WALLET\")\n {\n document.getElementById('btn_addoffer').innerText = \"ADD OFFER\";\n }\n\n\n document.getElementsByClassName('btn_addoffer')[0].onclick = function() {\n if(e.cta == 'COPY')\n {\n\n var copyTextField = document.getElementById('textCopy');\n copyTextField.select();\n\n var copied = document.execCommand (\"copy\");\n\n console.log('Got Copied Status '+copied);\n \n document.getElementsByClassName('btn_addoffer')[0].classList.add('copied');\n document.getElementById('btn_addoffer').innerText = \"\";\n\n e.is_copied = 'true';\n localStorage.setItem('z1_supc',JSON.stringify(e));\n\n return;\n } \n\n var urlToGo = '/checkout/shopping_cart.jsp?redeemCoupon=true';\n\n\n if(e.cta == 'WALLET')\n {\n if(pageData && pageData.cartDetails && pageData.cartDetails.cartSubTotalValue)\n {\n var cartValue = parseInt(pageData.cartDetails.cartSubTotalValue);\n\n //alert('Got Cart Value '+cartValue);\n if(cartValue == 0)\n {\n urlToGo = '/wallet/my_wallet.jsp#offers';\n }\n\n } \n }\n\n\n location.href=urlToGo;\n\n };\n\n\n sendRTOOmniture(1);\n\n\n document.getElementById(\"z1-rto-div\").onclick = function(e){\n //console.log(\"Event...\",e)\n e.stopPropagation();\n\n //console.log('Elemtn Id ',e.toElement.id);\n\n if(e.toElement.id == 'discliamer_href')\n {\n window.open(\n document.getElementById(\"discliamer_href\").href,\n '_blank' // <- This is what makes it open in a new window.\n );\n }\n //e.preventDefault();\n return false;\n };\n\n\n }\n\n\n\n\n function getDayLightOffset()\n {\n //Automatically adjust for GMT to Central Timediff based on Daylight savings\n //Returns number of hours Central is behind GMT\n //\n var now = new Date();\n //test data\n var test = now.getTime(); //238*24*3600000;\n var nowUtc = new Date(test);\n var month = nowUtc.getMonth()+1; //make jan=1\n\n if (month < 3 || month > 11) return 6; // savings=F\n if (month > 3 && month < 11) return 5; // savings=T\n\n // switch if >2nd sun in march or >1st sun in nov\n // switches at midnight UTC, so 5 or 6 hrs away from 2AM Central\n\n var tzDiffInHours; //UTC vs Central diff in hours\n var day = nowUtc.getDate(); //already 1 based\n var dow = nowUtc.getDay(); //already sun=0\n var previousSunday = day - dow; \n if (month == 3) tzDiffInHours = (previousSunday >= 8) ? 5 : 6;\n if (month == 11) tzDiffInHours = (previousSunday < 0) ? 5 : 6;\n \n //java.lang.System.out.println(\"@@@@@@ Daylight savings computed variable=\"+tzDiff);\n //var tzDiffInHours = 5; //Change on sunday nov 4, 2018, to 6hrs\n\n return tzDiffInHours;\n }\n\n function convertUTCtoCST(dateObj)\n {\n var dayLightOffset = getDayLightOffset();\n return new Date(dateObj.getTime() - ((1 * 60 * 60 * 1000) * dayLightOffset));\n }\n\n\n function getTimeFromApiFormat(dateStr)\n {\n var dateStrSplit = dateStr.split(' ');\n\n var dateSplit = dateStrSplit[0].split('-');\n var timeSplit = dateStrSplit[1].split(':');\n\n var dateObj = new Date();\n dateObj.setYear(dateSplit[0]);\n dateObj.setMonth(dateSplit[1]-1);\n dateObj.setDate(dateSplit[2]);\n\n dateObj.setHours(timeSplit[0]);\n dateObj.setMinutes(timeSplit[1]-1);\n dateObj.setSeconds(timeSplit[2]);\n\n var dateObj = new Date((dateObj.getTime() - dateObj.getTimezoneOffset()*60*1000)/1000);\n\n console.log(dateObj.getTime()+' getTimeFromApiFormat '+dateObj);\n\n return dateObj.valueOf();\n\n }\n\n function checkForLocalRTO()\n {\n var existingSupc = localStorage.getItem('z1_supc');\n\n if(existingSupc != null && existingSupc != undefined && existingSupc != 'null')\n {\n\n var e = JSON.parse(existingSupc);\n\n var offerExpiry = e.offerExpiry;\n\n\n var currentDate = new Date();\n\n currentDate = convertUTCtoCST(currentDate);\n var currentTime = currentDate.valueOf();\n\n console.log(e.offerExpiry+\" Got Offer Expiry \");\n\n var endTime = getTimeFromApiFormat(e.offerExpiry);\n\n\n currentTime = Number(currentTime.toString().substring(0,currentTime.toString().length - 3));\n\n console.log(endTime+\" timeCheck Main: \" + currentTime);\n\n var timeCheck = endTime-currentTime;\n\n if(timeCheck > 0)\n {\n if(e.is_redeemed != true)\n {\n\n var expiryInMinutes = Math.ceil((timeCheck)/(60));\n\n e.offerDuration = expiryInMinutes;\n\n showRTOBanner(e); \n }\n }\n else\n {\n return false;\n }\n \n\n \n console.log(\" timeCheck: \" + timeCheck);\n\n return true;\n\n\n }\n\n return false;\n }\n\n function _handleRawRTOData(e) {\n // alert('Got raw data...' + JSON.stringify(e));\n console.log('Got Raw RTO data: ' + e);\n\n if(e)\n {\n e = JSON.parse(e);\n\n if(e.rtoOfferData)\n {\n e = e.rtoOfferData;\n\n localStorage.setItem('z1_supc',JSON.stringify(e));\n\n showRTOBanner(e);\n }\n\n\n fireOmniture(e);\n }\n \n \n }\n\n\n try {\n //var z1Widgets = ZineOne.getZ1Widget();\n //z1Widgets.registerWidgetHandler(\"raw\", _handleRawRTOData);\n } catch (e) {\n console.log('Could not register handler for Raw RTO Data.');\n }\n\n if(getUrlParameter('redeemCoupon') == 'true')\n {\n document.getElementsByClassName(\"kohlscashapply\")[0].click(); \n }\n\n\n if(checkForLocalRTO() == true)\n {\n return;\n }\n\n localStorage.setItem('z1_supc',null);\n\n\n var evtName = '_ws_rto_offers';\n\n var isSoftLoggedIn = getCookie(\"SoftLoggedInCookie\");\n if (isSoftLoggedIn && isSoftLoggedIn.includes(\"true\")) {\n if (debugScr) console.log(\"[ZineOne] Soft Logged value is:\" + isSoftLoggedIn);\n }\n // Set HardLoggedIn = true only if user is not SoftLoggedIn\n var isLoggedIn = \"\";\n\n\n if (pageData && pageData.customerDetails) {\n if (!isSoftLoggedIn || (isSoftLoggedIn && !isSoftLoggedIn.includes(\"true\"))) {\n if (pageData.customerDetails.isLoggedIn) isLoggedIn = \"true\";\n }\n }\n\n if(isSoftLoggedIn == 'true' || isLoggedIn == 'true')\n {\n //ZineOne.pushEvent(evtName, {});\n }\n console.log(\"RTO offers END\");\n}\ncatch(e)\n{\n if (debugScr) console.log(\"[Zineone] Error in Rto New UI Tag: WebStore Z1 tag. \" + e);\n}\n\n","eventName":"load","pageSelector":{"type":"pgName","condition":"equals","val":"/"}},{"tagName":"RTO Order Review","actionType":"z1script","script":"/*Changes done for IE\nA. function declaration like, var abc = function() won't work in IE if function is used first and then declared and defined. Please take below precaution before using it:\n 1. If you want to use function declaration like, var abc = function(), first declare it and then use it\n 2. Use normal function declaration like, function abc(). you can declare function anywhere in the page and use it before or after declaration. It will work on all the browsers.\nB. Do not use multiline strings, also call as 'Template String'. Template Strings are demarked by a backtick(`).\n Example. var abc = `This is multiline\n comment`; //multiline comments won't work in IE\n Use simple concatenation to achieve the same like,\n var abc = \"\";\n abc += 'This is multiline';\n abc += 'comment';\nC. You can not set defalut parameter values for function in IE.\n for e.g. function abc(num = 0,str=\"hello\") //Won't work in IE\nD. You can not use arguments object ([...args] or (...args) in function) in IE.\n For e.g function abc(...args){\n console.log(\"received paramenters \", args)\n } // Won't work in IE\nE. 'append' function won't work in IE. You can use 'appendChild' function to achieve the same functionality.\nF. 'prepend' function won't work IE. Try to use 'insertBefore' function to achieve the same functionality.\nG. new Event() function won't work in IE. You can use new CustomEvent() function to achieve the same functionality.\nH. Arrow functions (=>) won't work in IE\n*/\n\nvar debugScr = true;\ntry {\n\n /*function isIE() {\n var ua = window.navigator.userAgent; //Check the userAgent property of the window.navigator object\n var msie = ua.indexOf('MSIE '); // IE 10 or older\n var trident = ua.indexOf('Trident/'); //IE 11\n return (msie > 0 || trident > 0);\n };\n var isIEFlag = isIE();\n if (!isIEFlag) return;\n var cust_id = pageData.customerDetails.customerID ? pageData.customerDetails.customerID : \"\";\n if ( !(cust_id == \"3000000030411692\" || cust_id == \"3000000126553504\") ) return;*/\n\n // var localVariable = localStorage.getItem('z1_rto_ui_v2');\n\n // if(!localVariable || localVariable == null || localVariable == 'null' || localVariable == undefined || localVariable == \"undefined\")\n // {\n // return;\n // }\n console.log(\"RTO Order Review START\");\n\n var evtName = null;\n\n var isLoggedIn = \"\";\n\n var isSoftLoggedIn = \"\";\n\n var SESSION_GAP = 1800000; //30min = 30*60*1000 millis\n\n\n //Event Codes for vectors:\n var eventCodes = {\n _ws_addedtobag: \"A\",\n breachedgeofence: \"B\",\n _ws_completeshipping: \"C\",\n exitgeofence: \"D\",\n _ws_placedorder: \"E\",\n _ws_searched: \"F\",\n _ws_startedcheckout: \"G\",\n _ws_viewedcart: \"H\",\n _ws_viewedcatalog: \"I\",\n _ws_viewedhome: \"J\",\n _ws_viewedproduct: \"K\",\n _ws_completepayment: \"L\",\n _ws_viewedsku: \"M\",\n _ws_update_hcart: \"N\",\n _ws_changedsort: \"O\",\n _ws_rto: \"R\"\n };\n\n\n function isValid(value) {\n if (value == \"null\" || value == \"undefined\" || value == null || value == undefined) {\n return false;\n }\n\n return true;\n }\n\n\n\n function getPresentVector(isRto, rtoEventType) {\n try {\n\n if (debugScr) console.log('getPresentVector');\n\n var itemsInBag = 0;\n cartValue = 0;\n\n isJsonNull = false;\n\n var cartData = pageData.cartDetails.cartItems;\n if(isValid(cartData))\n {\n var cartInfo = (cartData);\n\n for (var i = 0; i < cartInfo.length; i++) {\n itemsInBag = itemsInBag + Number(cartInfo[i].quantity);\n\n cartValue = cartValue + Number(cartInfo[i].quantity)*Number(cartInfo[i].finalPrice);\n\n }\n }\n else\n {\n if(getCookie('VisitorBagTotals').toString().length != 0)\n {\n cartValue = -1;\n\n isJsonNull = true;\n\n }\n }\n\n\n if (cartValue == 0 && (typeof pageData != 'undefined') && pageData.cartDetails && pageData.cartDetails.cartSubTotalValue) {\n cartValue = Number(pageData.cartDetails.cartSubTotalValue);\n }\n\n\n\n console.log(cartValue + ' Before Present Vector ', evtName);\n var presentVector = {};\n presentVector.event = eventCodes[evtName.toLocaleLowerCase()] || evtName; //common to all\n presentVector.productID = '-'; //ViewedProduct, AddedToBag\n presentVector.itemsInBag = itemsInBag || 0; //common to all\n presentVector.originalPrice = '-';\n presentVector.salePrice = '-';\n presentVector.KC = '-'; //Think\n presentVector.PDPCategory = '-'; //\n presentVector.department = '-';\n presentVector.CN = '-';\n presentVector.keywords = '-';\n presentVector.visualNavForm = '-';\n presentVector.pageFilter = '-';\n presentVector.searchType = '-';\n presentVector.userPFM = '-';\n presentVector.loginstatus = (isLoggedIn) ? 'full' : (isSoftLoggedIn ? 'soft' : '-');\n presentVector.onSale = '-';\n presentVector.time = new Date().getTime();\n\n console.log('Present Vector 1', presentVector);\n //New Ml Vectors\n\n presentVector.pgdata_pmpdet_catname = '-';\n presentVector.pgdata_pmpdet_subcatname = '-';\n presentVector.pgdata_pmpdet_findingname = '-';\n presentVector.pgdata_pmpdet_cat_keywords = '-';\n presentVector.pgdata_pmpdet_pgfilter = '-';\n presentVector.pgdata_pmpdet_deptname = '-';\n presentVector.pgdata_pmpdet_gendervalues = '-';\n presentVector.pgdata_pmpdet_search_keywords = '-';\n presentVector.pgdata_proddet_colid = '-';\n presentVector.pgdata_pddetails_clientpostalcode = '-';\n presentVector.selected_sku_color = '-';\n presentVector.selected_sku_size = '-';\n presentVector.selected_sku = '-';\n //presentVector.selected_sku_regular_price = '-';\n presentVector.selected_sku_sale_price = '-';\n\n\n\n presentVector.c_i_size = '-';\n presentVector.c_i_color = '-';\n presentVector.c_i_isweb = '-';\n presentVector.c_sclearance = '-';\n presentVector.c_i_shipavailable = '-';\n presentVector.c_i_bopusAval = '-';\n presentVector.c_i_bossAval = '-';\n presentVector.c_i_invShip = '-';\n presentVector.c_i_invBopus = '-';\n presentVector.c_i_invBoss = '-';\n presentVector.c_o_offDis = '-';\n presentVector.c_o_sdate = '-';\n presentVector.c_o_edate = '-';\n presentVector.c_p_type = '-';\n presentVector.c_p_ptext = '-';\n presentVector.shpi_shpp_ogshpchrgs = '-';\n presentVector.shpi_shpp_shpchrgsafdis = '-';\n presentVector.shpi_shpp_freeshpqlfdelta = '-';\n presentVector.shpi_shpp_shpitmstotal = '-';\n presentVector.shpi_shpo_disamnt = '-';\n presentVector.or_merpromoamnt = '-';\n presentVector.or_disshpamnt = '-';\n presentVector.or_ogshpamnt = '-';\n presentVector.or_tax_est = '-';\n presentVector.or_tax_taxrt = '-';\n presentVector.or_tax_tax = '-';\n presentVector.or_totalsur = '-';\n presentVector.or_totaltaxfree = '-';\n presentVector.or_totalkcpromodis = '-';\n presentVector.or_totaltax = '-';\n presentVector.or_total = '-';\n presentVector.or_savings = '-';\n presentVector.or_taxfeeen = '-';\n\n presentVector.removed_sku = '-';\n presentVector.updated_sku = '-';\n presentVector.updated_sku_qty = '-';\n\n presentVector.prod_sku_count = '-';\n presentVector.sku_reg_price = '-';\n presentVector.sku_per_dis = '-';\n presentVector.sku_bopus_avail = '-';\n presentVector.sku_boss_avail = '-';\n presentVector.sku_ship_avail = '-';\n\n presentVector.filter_by_count = '-';\n presentVector.sort_by = '-';\n\n presentVector.pgdata_proddet_catname = '-';\n presentVector.pgdata_proddet_subcatname = '-';\n presentVector.pgdata_proddet_deptname = '-';\n\n presentVector.selected_prd_id = '-';\n\n presentVector.rto_data = '-';\n\n\n if(isRto == true)\n {\n presentVector.event = eventCodes[\"_ws_rto\"];\n\n presentVector.rto_data = 'A';\n\n }\n\n return presentVector;\n } catch (ie) {\n console.log('[ZineOne getPresentVector] : ', ie);\n }\n }\n\n\n\n function updateUserVectors(isRto, rtoEventType) {\n try {\n\n evtName = '_ws_rto';\n if (debugScr) console.log('Into updateUserVectors');\n var presentVector = getPresentVector(isRto, rtoEventType);\n var previousVector = JSON.parse(localStorage.getItem('z1_previousVector'));\n var z1_sessionStart_ts = JSON.parse(localStorage.getItem('z1_sessionStart_ts'));\n\n var z1_features = localStorage.getItem('z1_features') || \"\";\n //Check if local Storage has userVector available\n var userVectors = JSON.parse(localStorage.getItem('z1_userVectors'));\n var newUserVectors = JSON.parse(localStorage.getItem('z1_newUserVectors'));\n\n //Updated the logic to send the Sequence if diff between present and previous event is more than 10 mins\n //if(previousVector && previousVector.time && previousVector.time < z1_sessionStart_ts){\n if (previousVector && previousVector.time && presentVector && presentVector.time && Number(presentVector.time) - Number(previousVector.time) > SESSION_GAP) {\n if (debugScr) console.log(\"New Session has started since the last Event\");\n //Changes to visitGap for gap between n-1 and nth session\n var visitGap = localStorage.getItem('visitGap');\n //Check if null or undefined\n if (!visitGap || typeof visitGap == undefined || visitGap == 'undefined') {\n visitGap = '';\n }\n\n try {\n\n var oldSessionStartTime = userVectors.timeVector.toString().split('|')[0];\n\n\n var vectorsEventData = {};\n\n vectorsEventData = onceInSessionAttributes(vectorsEventData);\n\n var cartDump = fetchCartDump();\n\n if (validateForNotNull(cartDump)) {\n cartDump = JSON.parse(cartDump);\n\n var cartKeys = Object.keys(cartDump);\n for (var k = 0; k < cartKeys.length; k++) {\n vectorsEventData[cartKeys[k]] = JSON.stringify(cartDump[cartKeys[k]]);\n }\n }\n\n\n vectorsEventData.z1_userVectors = JSON.stringify(userVectors);\n vectorsEventData.z1_features = z1_features;\n vectorsEventData.visitGap = visitGap;\n vectorsEventData.session_start_time = presentVector.time;\n vectorsEventData.old_session_start_time = oldSessionStartTime;\n\n if (validateForNotNull(newUserVectors)) {\n var newVectorKeys = Object.keys(newUserVectors);\n for (var k = 0; k < newVectorKeys.length; k++) {\n vectorsEventData[newVectorKeys[k]] = newUserVectors[newVectorKeys[k]];\n }\n }\n\n\n\n ZineOne.pushEvent('_ws_updatevectors', vectorsEventData);\n } catch (ieInner) {\n\n var errorObj = {};\n errorObj.p1 = ieInner.message;\n errorObj.p2 = 'webstoresendevent ' + evtName;\n\n ZineOne.pushEvent('_ws_logs', errorObj);\n\n }\n\n\n\n\n\n localStorage.setItem('visitGap', Number(presentVector.time) - Number(previousVector.time));\n localStorage.removeItem('z1_userVectors');\n localStorage.removeItem('z1_features');\n if (debugScr) console.log(\"z1_userVectors removed from local storage\");\n userVectors = null;\n newUserVectors = null;\n }\n\n if (!userVectors) {\n userVectors = {};\n userVectors.eventVector = presentVector.event;\n userVectors.timeVector = presentVector.time;\n userVectors.productVector = presentVector.productID;\n userVectors.originalPrice = presentVector.originalPrice;\n userVectors.salePrice = presentVector.salePrice;\n userVectors.PDPCategory = presentVector.PDPCategory;\n userVectors.CN = presentVector.CN;\n userVectors.itemsInBag = presentVector.itemsInBag;\n\n newUserVectors = {};\n newUserVectors.pgdata_pmpdet_catname = presentVector.pgdata_pmpdet_catname;\n newUserVectors.pgdata_pmpdet_subcatname = presentVector.pgdata_pmpdet_subcatname;\n newUserVectors.pgdata_pmpdet_findingname = presentVector.pgdata_pmpdet_findingname;\n newUserVectors.pgdata_pmpdet_cat_keywords = presentVector.pgdata_pmpdet_cat_keywords;\n newUserVectors.pgdata_pmpdet_pgfilter = presentVector.pgdata_pmpdet_pgfilter;\n newUserVectors.pgdata_pmpdet_deptname = presentVector.pgdata_pmpdet_deptname;\n newUserVectors.pgdata_pmpdet_gendervalues = presentVector.pgdata_pmpdet_gendervalues;\n newUserVectors.pgdata_pmpdet_search_keywords = presentVector.pgdata_pmpdet_search_keywords;\n newUserVectors.pgdata_proddet_colid = presentVector.pgdata_proddet_colid;\n newUserVectors.pgdata_pddetails_clientpostalcode = presentVector.pgdata_pddetails_clientpostalcode;\n newUserVectors.selected_sku_color = presentVector.selected_sku_color;\n newUserVectors.selected_sku_size = presentVector.selected_sku_size;\n newUserVectors.selected_sku = presentVector.selected_sku;\n //newUserVectors.selected_sku_regular_price = presentVector.selected_sku_regular_price;\n newUserVectors.selected_sku_sale_price = presentVector.selected_sku_sale_price;\n\n\n\n newUserVectors.c_i_size = presentVector.c_i_size;\n newUserVectors.c_i_color = presentVector.c_i_color;\n newUserVectors.c_i_isweb = presentVector.c_i_isweb;\n newUserVectors.c_sclearance = presentVector.c_sclearance;\n newUserVectors.c_i_shipavailable = presentVector.c_i_shipavailable;\n newUserVectors.c_i_bopusAval = presentVector.c_i_bopusAval;\n newUserVectors.c_i_bossAval = presentVector.c_i_bossAval;\n newUserVectors.c_i_invShip = presentVector.c_i_invShip;\n newUserVectors.c_i_invBopus = presentVector.c_i_invBopus;\n newUserVectors.c_i_invBoss = presentVector.c_i_invBoss;\n newUserVectors.c_o_offDis = presentVector.c_o_offDis;\n newUserVectors.c_o_sdate = presentVector.c_o_sdate;\n newUserVectors.c_o_edate = presentVector.c_o_edate;\n newUserVectors.c_p_type = presentVector.c_p_type;\n newUserVectors.c_p_ptext = presentVector.c_p_ptext;\n newUserVectors.shpi_shpp_ogshpchrgs = presentVector.shpi_shpp_ogshpchrgs;\n newUserVectors.shpi_shpp_shpchrgsafdis = presentVector.shpi_shpp_shpchrgsafdis;\n newUserVectors.shpi_shpp_freeshpqlfdelta = presentVector.shpi_shpp_freeshpqlfdelta;\n newUserVectors.shpi_shpp_shpitmstotal = presentVector.shpi_shpp_shpitmstotal;\n newUserVectors.shpi_shpo_disamnt = presentVector.shpi_shpo_disamnt;\n newUserVectors.or_merpromoamnt = presentVector.or_merpromoamnt;\n newUserVectors.or_disshpamnt = presentVector.or_disshpamnt;\n newUserVectors.or_ogshpamnt = presentVector.or_ogshpamnt;\n newUserVectors.or_tax_est = presentVector.or_tax_est;\n newUserVectors.or_tax_taxrt = presentVector.or_tax_taxrt;\n newUserVectors.or_tax_tax = presentVector.or_tax_tax;\n newUserVectors.or_totalsur = presentVector.or_totalsur;\n newUserVectors.or_totaltaxfree = presentVector.or_totaltaxfree;\n newUserVectors.or_totalkcpromodis = presentVector.or_totalkcpromodis;\n newUserVectors.or_totaltax = presentVector.or_totaltax;\n newUserVectors.or_total = presentVector.or_total;\n newUserVectors.or_savings = presentVector.or_savings;\n newUserVectors.or_taxfeeen = presentVector.or_taxfeeen;\n\n newUserVectors.removed_sku = presentVector.removed_sku;\n newUserVectors.updated_sku = presentVector.updated_sku;\n newUserVectors.updated_sku_qty = presentVector.updated_sku_qty;\n\n\n newUserVectors.prod_sku_count = presentVector.prod_sku_count;\n newUserVectors.sku_reg_price = presentVector.sku_reg_price;\n newUserVectors.sku_per_dis = presentVector.sku_per_dis;\n newUserVectors.sku_bopus_avail = presentVector.sku_bopus_avail;\n newUserVectors.sku_boss_avail = presentVector.sku_boss_avail;\n newUserVectors.sku_ship_avail = presentVector.sku_ship_avail;\n\n newUserVectors.filter_by_count = presentVector.filter_by_count;\n newUserVectors.sort_by = presentVector.sort_by;\n\n newUserVectors.pgdata_proddet_catname = presentVector.pgdata_proddet_catname;\n newUserVectors.pgdata_proddet_subcatname = presentVector.pgdata_proddet_subcatname;\n newUserVectors.pgdata_proddet_deptname = presentVector.pgdata_proddet_deptname;\n\n newUserVectors.selected_prd_id = presentVector.selected_prd_id;\n\n newUserVectors.rto_data = presentVector.rto_data;\n\n } else {\n userVectors.eventVector = userVectors.eventVector + '|' + presentVector.event;\n userVectors.timeVector = userVectors.timeVector + '|' + presentVector.time;\n userVectors.productVector = userVectors.productVector + '|' + presentVector.productID;\n userVectors.originalPrice = userVectors.originalPrice + '|' + presentVector.originalPrice;\n userVectors.salePrice = userVectors.salePrice + '|' + presentVector.salePrice;\n userVectors.PDPCategory = userVectors.PDPCategory + '|' + presentVector.PDPCategory;\n userVectors.CN = userVectors.CN + '|' + presentVector.CN;\n userVectors.itemsInBag = userVectors.itemsInBag + '|' + presentVector.itemsInBag;\n\n\n newUserVectors.pgdata_pmpdet_catname = newUserVectors.pgdata_pmpdet_catname + '|' + presentVector.pgdata_pmpdet_catname;\n newUserVectors.pgdata_pmpdet_subcatname = newUserVectors.pgdata_pmpdet_subcatname + '|' + presentVector.pgdata_pmpdet_subcatname;\n newUserVectors.pgdata_pmpdet_findingname = newUserVectors.pgdata_pmpdet_findingname + '|' + presentVector.pgdata_pmpdet_findingname;\n newUserVectors.pgdata_pmpdet_cat_keywords = newUserVectors.pgdata_pmpdet_cat_keywords + '|' + presentVector.pgdata_pmpdet_cat_keywords;\n newUserVectors.pgdata_pmpdet_pgfilter = newUserVectors.pgdata_pmpdet_pgfilter + '|' + presentVector.pgdata_pmpdet_pgfilter;\n newUserVectors.pgdata_pmpdet_deptname = newUserVectors.pgdata_pmpdet_deptname + '|' + presentVector.pgdata_pmpdet_deptname;\n newUserVectors.pgdata_pmpdet_gendervalues = newUserVectors.pgdata_pmpdet_gendervalues + '|' + presentVector.pgdata_pmpdet_gendervalues;\n newUserVectors.pgdata_pmpdet_search_keywords = newUserVectors.pgdata_pmpdet_search_keywords + '|' + presentVector.pgdata_pmpdet_search_keywords;\n newUserVectors.pgdata_proddet_colid = newUserVectors.pgdata_proddet_colid + '|' + presentVector.pgdata_proddet_colid;\n newUserVectors.pgdata_pddetails_clientpostalcode = newUserVectors.pgdata_pddetails_clientpostalcode + '|' + presentVector.pgdata_pddetails_clientpostalcode;\n newUserVectors.selected_sku_color = newUserVectors.selected_sku_color + '|' + presentVector.selected_sku_color;\n newUserVectors.selected_sku_size = newUserVectors.selected_sku_size + '|' + presentVector.selected_sku_size;\n newUserVectors.selected_sku = newUserVectors.selected_sku + '|' + presentVector.selected_sku;\n //newUserVectors.selected_sku_regular_price = newUserVectors.selected_sku_regular_price + '|' + presentVector.selected_sku_regular_price;\n newUserVectors.selected_sku_sale_price = newUserVectors.selected_sku_sale_price + '|' + presentVector.selected_sku_sale_price;\n\n\n newUserVectors.c_i_size = newUserVectors.c_i_size + '|' + presentVector.c_i_size;\n newUserVectors.c_i_color = newUserVectors.c_i_color + '|' + presentVector.c_i_color;\n newUserVectors.c_i_isweb = newUserVectors.c_i_isweb + '|' + presentVector.c_i_isweb;\n newUserVectors.c_sclearance = newUserVectors.c_sclearance + '|' + presentVector.c_sclearance;\n newUserVectors.c_i_shipavailable = newUserVectors.c_i_shipavailable + '|' + presentVector.c_i_shipavailable;\n newUserVectors.c_i_bopusAval = newUserVectors.c_i_bopusAval + '|' + presentVector.c_i_bopusAval;\n newUserVectors.c_i_bossAval = newUserVectors.c_i_bossAval + '|' + presentVector.c_i_bossAval;\n newUserVectors.c_i_invShip = newUserVectors.c_i_invShip + '|' + presentVector.c_i_invShip;\n newUserVectors.c_i_invBopus = newUserVectors.c_i_invBopus + '|' + presentVector.c_i_invBopus;\n newUserVectors.c_i_invBoss = newUserVectors.c_i_invBoss + '|' + presentVector.c_i_invBoss;\n newUserVectors.c_o_offDis = newUserVectors.c_o_offDis + '|' + presentVector.c_o_offDis;\n newUserVectors.c_o_sdate = newUserVectors.c_o_sdate + '|' + presentVector.c_o_sdate;\n newUserVectors.c_o_edate = newUserVectors.c_o_edate + '|' + presentVector.c_o_edate;\n newUserVectors.c_p_type = newUserVectors.c_p_type + '|' + presentVector.c_p_type;\n newUserVectors.c_p_ptext = newUserVectors.c_p_ptext + '|' + presentVector.c_p_ptext;\n newUserVectors.shpi_shpp_ogshpchrgs = newUserVectors.shpi_shpp_ogshpchrgs + '|' + presentVector.shpi_shpp_ogshpchrgs;\n newUserVectors.shpi_shpp_shpchrgsafdis = newUserVectors.shpi_shpp_shpchrgsafdis + '|' + presentVector.shpi_shpp_shpchrgsafdis;\n newUserVectors.shpi_shpp_freeshpqlfdelta = newUserVectors.shpi_shpp_freeshpqlfdelta + '|' + presentVector.shpi_shpp_freeshpqlfdelta;\n newUserVectors.shpi_shpp_shpitmstotal = newUserVectors.shpi_shpp_shpitmstotal + '|' + presentVector.shpi_shpp_shpitmstotal;\n newUserVectors.shpi_shpo_disamnt = newUserVectors.shpi_shpo_disamnt + '|' + presentVector.shpi_shpo_disamnt;\n newUserVectors.or_merpromoamnt = newUserVectors.or_merpromoamnt + '|' + presentVector.or_merpromoamnt;\n newUserVectors.or_disshpamnt = newUserVectors.or_disshpamnt + '|' + presentVector.or_disshpamnt;\n newUserVectors.or_ogshpamnt = newUserVectors.or_ogshpamnt + '|' + presentVector.or_ogshpamnt;\n newUserVectors.or_tax_est = newUserVectors.or_tax_est + '|' + presentVector.or_tax_est;\n newUserVectors.or_tax_taxrt = newUserVectors.or_tax_taxrt + '|' + presentVector.or_tax_taxrt;\n newUserVectors.or_tax_tax = newUserVectors.or_tax_tax + '|' + presentVector.or_tax_tax;\n newUserVectors.or_totalsur = newUserVectors.or_totalsur + '|' + presentVector.or_totalsur;\n newUserVectors.or_totaltaxfree = newUserVectors.or_totaltaxfree + '|' + presentVector.or_totaltaxfree;\n newUserVectors.or_totalkcpromodis = newUserVectors.or_totalkcpromodis + '|' + presentVector.or_totalkcpromodis;\n newUserVectors.or_totaltax = newUserVectors.or_totaltax + '|' + presentVector.or_totaltax;\n newUserVectors.or_total = newUserVectors.or_total + '|' + presentVector.or_total;\n newUserVectors.or_savings = newUserVectors.or_savings + '|' + presentVector.or_savings;\n newUserVectors.or_taxfeeen = newUserVectors.or_taxfeeen + '|' + presentVector.or_taxfeeen;\n\n newUserVectors.removed_sku = newUserVectors.removed_sku + '|' + presentVector.removed_sku;\n newUserVectors.updated_sku = newUserVectors.updated_sku + '|' + presentVector.updated_sku;\n newUserVectors.updated_sku_qty = newUserVectors.updated_sku_qty + '|' + presentVector.updated_sku_qty;\n\n\n newUserVectors.prod_sku_count = newUserVectors.prod_sku_count + '|' + presentVector.prod_sku_count;\n newUserVectors.sku_reg_price = newUserVectors.sku_reg_price + '|' + presentVector.sku_reg_price;\n newUserVectors.sku_per_dis = newUserVectors.sku_per_dis + '|' + presentVector.sku_per_dis;\n newUserVectors.sku_bopus_avail = newUserVectors.sku_bopus_avail + '|' + presentVector.sku_bopus_avail;\n newUserVectors.sku_boss_avail = newUserVectors.sku_boss_avail + '|' + presentVector.sku_boss_avail;\n newUserVectors.sku_ship_avail = newUserVectors.sku_ship_avail + '|' + presentVector.sku_ship_avail;\n\n newUserVectors.filter_by_count = newUserVectors.filter_by_count + '|' + presentVector.filter_by_count;\n newUserVectors.sort_by = newUserVectors.sort_by + '|' + presentVector.sort_by;\n\n newUserVectors.pgdata_proddet_catname = newUserVectors.pgdata_proddet_catname + '|' + presentVector.pgdata_proddet_catname;\n newUserVectors.pgdata_proddet_subcatname = newUserVectors.pgdata_proddet_subcatname + '|' + presentVector.pgdata_proddet_subcatname;\n newUserVectors.pgdata_proddet_deptname = newUserVectors.pgdata_proddet_deptname + '|' + presentVector.pgdata_proddet_deptname;\n\n newUserVectors.selected_prd_id = newUserVectors.selected_prd_id + '|' + presentVector.selected_prd_id;\n\n newUserVectors.rto_data = newUserVectors.rto_data + '|' + presentVector.rto_data;\n\n\n }\n localStorage.setItem('z1_userVectors', JSON.stringify(userVectors));\n localStorage.setItem('z1_newUserVectors', JSON.stringify(newUserVectors));\n\n updateFeatures();\n\n //Update the previousVector\n previousVector = presentVector;\n localStorage.setItem('z1_previousVector', JSON.stringify(previousVector));\n\n //Send the Sequence on 5th and 10th Element as well\n //Fetch the updated features as they are updated\n var z1_features = localStorage.getItem('z1_features') || \"\";\n //If this is the 5th Element, send the features and vectors\n if (userVectors && userVectors.eventVector && userVectors.eventVector.split('|').length == 5) {\n if (debugScr) console.log(\"The sequence is 5 element long\");\n //Changes to visitGap for gap between n-1 and nth session\n var visitGap = localStorage.getItem('visitGap');\n //Check if null or undefined\n if (!visitGap || typeof visitGap == undefined || visitGap == 'undefined') {\n visitGap = '';\n }\n\n var currentSessionStartTime = userVectors.timeVector.toString().split('|')[0];\n\n\n var vectorsEventData = {};\n\n var newVectorKeys = Object.keys(newUserVectors);\n for (var k = 0; k < newVectorKeys.length; k++) {\n vectorsEventData[newVectorKeys[k]] = newUserVectors[newVectorKeys[k]];\n }\n\n vectorsEventData.z1_userVectors = JSON.stringify(userVectors);\n vectorsEventData.z1_features = z1_features;\n vectorsEventData.cartValue = cartValue;\n vectorsEventData.session_start_time = currentSessionStartTime;\n vectorsEventData.visitGap = visitGap;\n vectorsEventData.currentCart = JSON.stringify(currentUserCartArr);\n\n if (validateForNotNull(pageData) && validateForNotNull(pageData.customerDetails) && validateForNotNull(pageData.customerDetails.customerHasKohlsCharge)) {\n vectorsEventData.isKcc = pageData.customerDetails.customerHasKohlsCharge;\n } else {\n vectorsEventData.isKcc = -1;\n }\n\n if (validateForNotNull(pageData) && validateForNotNull(pageData.customerDetails) && validateForNotNull(pageData.customerDetails.kohlsLoyalty2018EliteMember)) {\n vectorsEventData.kohlsLoyalty2018EliteMember = pageData.customerDetails.kohlsLoyalty2018EliteMember;\n } else {\n vectorsEventData.kohlsLoyalty2018EliteMember = -1;\n }\n\n if (validateForNotNull(pageData) && validateForNotNull(pageData.customerDetails) && validateForNotNull(pageData.customerDetails.kohlsLoyalty2018Member)) {\n vectorsEventData.kohlsLoyalty2018Member = pageData.customerDetails.kohlsLoyalty2018Member;\n } else {\n vectorsEventData.kohlsLoyalty2018Member = -1;\n }\n\n\n\n vectorsEventData.mcmId = fetchMcmId();\n\n ZineOne.pushEvent('_ws_updatevectors_len5', vectorsEventData);\n\n if (isJsonNull) {\n var lastUserPageArr = userVectors.eventVector.toString().split('|');\n var lastPageChar = lastUserPageArr[lastUserPageArr.length - 2];\n\n var tempEventData = {};\n tempEventData.VisitorBagTotals = getCookie('VisitorBagTotals');\n tempEventData.pgName = pgName;\n tempEventData.lastPgChar = lastPageChar;\n\n ZineOne.pushEvent('_ws_emptyjson_v2', tempEventData);\n }\n\n } else if (userVectors && userVectors.eventVector && userVectors.eventVector.split('|').length == 10) {\n if (debugScr) console.log(\"The sequence is 10 element long\");\n //Changes to visitGap for gap between n-1 and nth session\n var visitGap = localStorage.getItem('visitGap');\n //Check if null or undefined\n if (!visitGap || typeof visitGap == undefined || visitGap == 'undefined') {\n visitGap = '';\n }\n\n var currentSessionStartTime = userVectors.timeVector.toString().split('|')[0];\n\n var vectorsEventData = {};\n\n var newVectorKeys = Object.keys(newUserVectors);\n for (var k = 0; k < newVectorKeys.length; k++) {\n vectorsEventData[newVectorKeys[k]] = newUserVectors[newVectorKeys[k]];\n }\n\n\n\n vectorsEventData.z1_userVectors = JSON.stringify(userVectors);\n vectorsEventData.z1_features = z1_features;\n vectorsEventData.session_start_time = currentSessionStartTime;\n vectorsEventData.visitGap = visitGap;\n\n ZineOne.pushEvent('_ws_updatevectors_len10', vectorsEventData);\n }\n\n //If this is the 10th Element, send the features and vectors\n } catch (ie) {\n console.log('[ZineOne updateUserVectors] : ', ie);\n }\n }\n\n function updateFeatures() {\n\n if (debugScr) console.log('Into updateFeatures');\n /* z1_features is stored in local storage which holds following stats\n ** n Total number of events in visit\n ** A Total number of addedtobag events in the visit\n ** B Total number of breachedgeofence events in the visit\n ** C Total number of continuedcheckout events in the visit\n ** D Total number of exitgeofence events in the visit\n ** E Total number of placedorder events in the visit\n ** F Total number of searched events in the visit\n ** G Total number of startedcheckout events in the visit\n ** H Total number of viewedcart events in the visit\n ** I Total number of viewedcatalog events in the visit\n ** J Total number of viewedhome events in the visit\n ** K Total number of viewedproduct events in the visit\n ** p Total number of evented pages loaded in visit\n */\n\n var z1_features = localStorage.getItem('z1_features');\n if (!z1_features) {\n z1_features = \"0|0|0|0|0|0|0|0|0|0|0|0|0|0\";\n }\n\n z1_features_arr = z1_features.split('|');\n\n z1_features_arr[0] = Number(z1_features_arr[0]) + 1; //n\n\n if (evtName.toLocaleLowerCase() == '_ws_addedtobag') {\n z1_features_arr[1] = Number(z1_features_arr[1]) + 1;\n } else if (evtName.toLocaleLowerCase() == 'breachedgeofence') {\n z1_features_arr[2] = Number(z1_features_arr[2]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_completeshipping') {\n z1_features_arr[3] = Number(z1_features_arr[3]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == 'exitgeofence') {\n z1_features_arr[4] = Number(z1_features_arr[4]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_placedorder') {\n z1_features_arr[5] = Number(z1_features_arr[5]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_searched') {\n z1_features_arr[6] = Number(z1_features_arr[6]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_startedcheckout') {\n z1_features_arr[7] = Number(z1_features_arr[7]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_viewedcart') {\n z1_features_arr[8] = Number(z1_features_arr[8]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_viewedcatalog') {\n z1_features_arr[9] = Number(z1_features_arr[9]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_viewedhome') {\n z1_features_arr[10] = Number(z1_features_arr[10]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_viewedproduct') {\n z1_features_arr[11] = Number(z1_features_arr[11]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_completepayment') {\n z1_features_arr[13] = Number(z1_features_arr[13]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n }\n\n z1_features = z1_features_arr[0] + '|' + z1_features_arr[1] + '|' + z1_features_arr[2] + '|' + z1_features_arr[3] + '|' + z1_features_arr[4] + '|' + z1_features_arr[5] + '|' + z1_features_arr[6] + '|' + z1_features_arr[7] + '|' + z1_features_arr[8] + '|' + z1_features_arr[9] + '|' + z1_features_arr[10] + '|' + z1_features_arr[11] + '|' + z1_features_arr[12] + '|' + z1_features_arr[13];\n localStorage.setItem('z1_features', z1_features);\n }\n\n\n var rtoTimeRemaining = 0;\n\n console.log('This is on RTO Review Page');\n\n\n function fireOmniture(z1Response) {\n\n //////***** whats the s.tl(this) ??? */\n\n if (z1Response && z1Response.prop75) {\n var eVar39 = z1Response.evar39 ? z1Response.evar39 : z1Response.customerId;\n s.tl(this, 'o', 'ZineOne Impression', {\n linkTrackVars: 'prop75,eVar39',\n prop75: z1Response.prop75,\n eVar39: eVar39\n });\n\n }\n\n\n }\n\n\n // Appends style tag\n function appendStyle(styles) {\n var css = document.createElement('style');\n css.type = 'text/css';\n\n if (css.styleSheet) css.styleSheet.cssText = styles;\n else css.appendChild(document.createTextNode(styles));\n\n document.getElementsByTagName(\"head\")[0].appendChild(css);\n }\n\n function appendJs(jsStr)\n {\n var jsElement = document.createElement('script');\n\n var t = document.createTextNode(jsStr);\n jsElement.appendChild(t);\n\n document.getElementsByTagName(\"head\")[0].appendChild(jsElement);\n \n }\n\n\n function getDayLightOffset()\n {\n //Automatically adjust for GMT to Central Timediff based on Daylight savings\n //Returns number of hours Central is behind GMT\n //\n var now = new Date();\n //test data\n var test = now.getTime(); //238*24*3600000;\n var nowUtc = new Date(test);\n var month = nowUtc.getMonth()+1; //make jan=1\n\n if (month < 3 || month > 11) return 6; // savings=F\n if (month > 3 && month < 11) return 5; // savings=T\n\n // switch if >2nd sun in march or >1st sun in nov\n // switches at midnight UTC, so 5 or 6 hrs away from 2AM Central\n\n var tzDiffInHours; //UTC vs Central diff in hours\n var day = nowUtc.getDate(); //already 1 based\n var dow = nowUtc.getDay(); //already sun=0\n var previousSunday = day - dow; \n if (month == 3) tzDiffInHours = (previousSunday >= 8) ? 5 : 6;\n if (month == 11) tzDiffInHours = (previousSunday < 0) ? 5 : 6;\n \n //java.lang.System.out.println(\"@@@@@@ Daylight savings computed variable=\"+tzDiff);\n //var tzDiffInHours = 5; //Change on sunday nov 4, 2018, to 6hrs\n\n return tzDiffInHours;\n }\n\n\n function convertUTCtoCST(dateObj)\n {\n var dayLightOffset = getDayLightOffset();\n return new Date(dateObj.getTime() - ((1 * 60 * 60 * 1000) * dayLightOffset));\n }\n\n\n function getTimeFromApiFormat(dateStr)\n {\n var dateStrSplit = dateStr.split(' ');\n\n var dateSplit = dateStrSplit[0].split('-');\n var timeSplit = dateStrSplit[1].split(':');\n\n var dateObj = new Date();\n dateObj.setYear(dateSplit[0]);\n dateObj.setMonth(dateSplit[1]-1);\n dateObj.setDate(dateSplit[2]);\n\n dateObj.setHours(timeSplit[0]);\n dateObj.setMinutes(timeSplit[1]-1);\n dateObj.setSeconds(timeSplit[2]);\n\n var dateObj = new Date((dateObj.getTime() - dateObj.getTimezoneOffset()*60*1000)/1000);\n\n console.log(dateObj.getTime()+' getTimeFromApiFormat '+dateObj);\n\n return dateObj.valueOf();\n\n }\n\n\n function updateSupcDetails()\n {\n var existingSupc = localStorage.getItem('z1_supc');\n\n existingSupc = JSON.parse(existingSupc);\n\n if(existingSupc.is_redeemed == true)\n {\n if(document.getElementById(\"show_offer_status\"))\n {\n document.getElementById(\"show_offer_status\").innerHTML = \"\";\n document.getElementById(\"link_applynow\").style.display = \"none\";\n document.getElementById(\"link_applynow2\").style.display = \"none\";\n }\n \n //document.getElementById('reviewApplyNow').innerHTML = 'Applied';\n //document.getElementById('reviewApplyNow').href='javascript:void(0)';\n }\n else\n {\n console.log(\"document.getElementById('reviewApplyNow')\",document.getElementById('reviewApplyNow'));\n\n if(document.getElementById('reviewApplyNow'))\n {\n document.getElementById('reviewApplyNow').text ='APPLY NOW'; \n }\n \n }\n }\n\n\n function addDataToRedemptionPopup(popupDiv,promoCode)\n {\n //console.log(' addDataToRedemptionPopup '+document.getElementsByClassName('kc-applyContainer')[0]);\n\n var InitPopupContent = document.getElementsByClassName('kc-applyContainer')[0];\n \n\n var promoTextContent = '<div class=\"popupPromoText\">Your promo code is already entered, click Apply to redeem.</div>';\n\n\n console.log('Final HTML '+InitPopupContent);\n\n InitPopupContent.insertAdjacentHTML(\"afterbegin\", promoTextContent);\n\n //document.getElementsByClassName('kc-applyContainer')[0].innerHTML = InitPopupContent;\n\n document.getElementById('promo-kcInput').value = promoCode;\n\n document.getElementById('applyInputButton').onclick = function(){\n\n var currentPromoCode = document.getElementById('promo-kcInput').value;\n\n if(currentPromoCode == promoCode)\n {\n var existingSupc = localStorage.getItem('z1_supc');\n\n existingSupc = JSON.parse(existingSupc);\n\n existingSupc.is_redeemed = true;\n\n localStorage.setItem('z1_supc',JSON.stringify(existingSupc));\n\n\n updateSupcDetails();\n\n sendRTOOmniture(2);\n\n updateUserVectors(true, null);\n\n }\n\n };\n\n }\n\n\n function populateUsername()\n {\n\n\n var usernameText = document.getElementById('usernameText');\n\n console.log(trJsonData.userData.firstName+' populateUsername '+usernameText);\n\n if(trJsonData.userData.firstName)\n {\n document.getElementById('usernameText').innerHTML = trJsonData.userData.firstName +', save';\n\t\t\tdocument.getElementById('usernameText2').innerHTML = trJsonData.userData.firstName+' '+trJsonData.userData.lastName+',';\n \t\n }\n else\n {\n document.getElementById('usernameText').innerHTML = 'Save';\n }\n \n\n console.log('usernameText '+document.getElementById('usernameText').innerHTML);\n \n }\n\n\n\n function showRTOReviewSection(e)\n {\n // Style string for RTO\n var style = '.popupPromoText {font-size: 1.85em;margin-bottom: 5px;}.z1_orderreview_container {background-color: #d5e1d4;/*display: flex;align-content: space-between;align-items: center;*/height: 85px;}.z1_orderreview_container {font-family: \\'Gotham 5r\\';border: 1px solid #717171;padding: 0.5rem 0.2rem;margin-bottom: 0.6rem;/*display: -webkit-flex;display: flex;justify-content: space-between;*/color: #454545;/*align-content: space-between;align-items: center;*/}#username-container {font-size: 17px;font-weight: bold;font-style: normal;font-stretch: normal;line-height: 1.06;letter-spacing: normal;color: #005553;text-align: center;}.z1_orderreview_container #price-container {flex-shrink: 0;display: flex;align-items: center;}.z1_orderreview_container #price-container .priceTag {margin-top: 8px;font-size: 28.4px;font-weight: bold;line-height: 0.49;color: #005553;text-align: center;font-style: normal;font-stretch: normal;}.z1_orderreview_container #price-container #rtoOfferValue {font-size: 63.2px;font-weight: 700;letter-spacing: -4.4px;color: #005553;display: block;}#message-container {font-size: 13px;font-weight: 500;font-style: normal;font-stretch: normal;line-height: 1;letter-spacing: normal;color: #222222;width: 76px;margin: auto;}#time-container {display: flex;text-align: center;font-size: 9.7px;font-weight: bold;font-style: normal;font-stretch: normal;line-height: normal;letter-spacing: normal;color: #222222;margin: auto;}#show_min,#show_sec {width: 61px;height: 39px;background-color: #005553;border: 1px solid #e3e3e3;margin: 0.3rem;font-size: 29.9px;font-weight: bold;font-style: normal;font-stretch: normal;line-height: normal;letter-spacing: normal;color: #d2e2d3;text-align: center;box-sizing: border-box;}#show_min,#show_sec {width: 61px;height: 39px;background-color: #005553;border: 1px solid #e3e3e3;margin: 0.3rem;font-size: 29.9px;font-weight: bold;font-style: normal;font-stretch: normal;line-height: normal;letter-spacing: normal;color: #d2e2d3;text-align: center;box-sizing: border-box;}#promo-container {width: 60%;}/*.z1_orderreview_container #link_applynow {text-transform: uppercase;text-align: center;padding-top: 0.3rem;font-family: \\'Gotham 5r\\';font-size: 13px;font-weight: normal;}.z1_orderreview_container #link_applynow a {text-decoration: underline;color: #000;font-weight: 700;}*/.z1_orderreview_container #show_offer_status {font-family: \\'Gotham 5r\\';font-size: 13px;text-transform: uppercase;text-decoration: none;color: #000;font-weight: normal;text-align: center;}.z1_orderreview_container .promocodecontainer {text-transform: uppercase;/*padding: 0.7rem 0;*/text-align: center;margin: 15px auto;}.z1_orderreview_container .promocodecontainer h4 {font-family: \\'Gotham 5r\\';font-size: 13px;font-weight: 500;font-style: normal;font-stretch: normal;line-height: 1.08;letter-spacing: -0.4px;text-align: center;color: #000000;}#rtoOfferCode {font-weight: bold;color: #005553;}.z1_orderreview_container .promocodecontainer h5 {font-family: \\'Gotham 5r\\';font-weight: 500;font-style: normal;font-stretch: normal;line-height: 1.08;letter-spacing: -0.4px;text-align: center;color: #005553;font-size: 13px;}.z1_orderreview_container>* {/*margin: 10px;*/}#z1-rto-new-outerDiv {display: flex;flex-direction: row;justify-content: space-evenly;}.z1-rto-dollar_reward {font-weight: bold;font-style: normal;font-stretch: normal;line-height: normal;letter-spacing: normal;text-align: center;color: #005553;position: relative;top: -8px;}.z1-rto-dollar_reward_content {display: flex;flex-wrap: wrap;}.z1-rto-dollar-text {font-size: 25.2px;width: 14px;height: 36px;position: relative;top: 27px;}.z1-rto-dollar-text-amount {font-size: 60px;height: 68px;letter-spacing: -3px;}.z1-rto-dollar-text-dOff-outer {margin-top: 21px;margin-bottom: auto;height: 20px;}.z1-rto-dollar-text-dOff-off {font-size: 15px;margin-left: -26px;position: relative;top: 1px;}.z1-rto-dollar-text-dOff-off-amount {font-size: 32px;position: relative;top: -4px;left: -6px;text-shadow: -1px 1px 0 #d5e1d4, 1px 1px 0 #d5e1d4, 1px -1px 0 #d5e1d4, -1px -1px 0 #d5e1d4;}.z1-rto-dollar-text-dOff-off-miniDollar {height: -1px;font-size: 20px;position: relative;top: -9px;}.z1-rto-dollar-text-dOff-off-miniDollarAmount {letter-spacing: -1px;top: -2px;left: -1px;position: relative;}#z1-tro-new-promoCodeText {font-size: 13px;font-weight: 500;font-style: normal;font-stretch: normal;line-height: 1.08;letter-spacing: -0.4px;text-align: center;color: #005553;font-weight: bold;}#z1-rto-new-addOfferContainer {text-align: center;margin: auto;}.btn_offer_container {margin: 25px;}#z1-rto-new-addOfferContainer .bottom_link {text-align: center;margin-top: 3px;}#z1-rto-new-addOfferContainer .bottom_link a {font-size: 11px;font-weight: 500;font-style: normal;font-stretch: normal;line-height: 1;letter-spacing: normal;text-align: center;color: #000000;}#link_applynow,#link_applynow2 {background: #005553;text-transform: uppercase;border-radius: 2.2px;text-decoration: none;letter-spacing: 1px;font-size: 13px;font-weight: bold;font-style: normal;font-stretch: normal;text-align: center;width: 104px;height: 31px;color: white;display: flex;align-items: center;justify-content: center;margin: 0 auto;}/* start old */.tag_min,.tag_sec {font-family: \\'Gotham 5r\\';font-size: 11px;text-transform: uppercase;text-align: center;color: #454545;margin-top: 0.3rem;font-weight: 700;}.loyalty #username-container {text-align: left;color: #208033;}.loyalty #show_min,.loyalty #show_sec {background-color: #208033;}.loyalty #price-container .priceTag {color: #208033;}.loyalty #price-container #rtoOfferValue {color: #208033;}.loyalty .promocodecontainer #z1-tro-new-promoCodeText {color: #208033;}.loyalty .promocodecontainer #rtoOfferCode {color: #208033;}.loyalty .btn_addoffer {background: #208033;}.loyalty #link_applynow {background: #208033;}.loyalty #link_applynow2 {background: #208033;}.loyalty .z1-rto-dollar_reward {color: #1f8033;}.loyalty-cont.disable {display: none}.loyalty-cont.enable {display: block}.loyalty-cont {text-align: center;background-color: #208033;height: 20px;position: relative;top: -8px;left: -3px;width: 598px;padding-top: 7px;color: #fff;font-size: 14px;}.z1_orderreview_container.loyalty {height: 115px;}.loyalty .heading-2 {font-weight: lighter;font-family: \\'Gotham 4r\\';}.z1_orderreview_container.loyalty .loyalty-cont.disable {display: block;}.z1_orderreview_container_2 {background-color: #d5e1d4;display: flex;justify-content: space-between;align-items: center;height: 85px;}.z1_orderreview_container_2 {font-family: \\'Gotham 5r\\';border: 1px solid #717171;padding: 10px 10px;margin-bottom: 0.6rem;color: #454545;}#first-div {display: flex;flex-direction: column;justify-content: space-around;}#second-div {display: flex;flex-direction: column;justify-content: space-around;text-align: center;}#third-div {display: flex;flex-direction: column;justify-content: space-around;}.usernameText2 {width: 200px;height: 15px;font-size: 14px;font-weight: 500;font-stretch: normal;font-style: normal;line-height: 1.14;letter-spacing: normal;text-align: center;color: #005553;}.price-container-2 {width: 200px;height: 38px;font-size: 28px;font-weight: bold;font-stretch: normal;font-style: normal;line-height: 1.36;letter-spacing: normal;color: #005553;text-align: center;margin-top: 5px;}.price-container-2-msg {width: 200px;height: 34px;font-size: 14px;font-weight: bold;font-stretch: normal;font-style: normal;letter-spacing: normal;color: #005553;text-align: center;}.show_min_msg {width: 206px;height: 17px;font-size: 15px;font-weight: 500;font-stretch: normal;font-style: normal;letter-spacing: normal;color: #222222;}.show_min_2 {font-size: 19px;font-weight: bold;color: #222222;}.promocodecontainer-2 {height: 30px;font-size: 13px;font-weight: bold;font-stretch: normal;font-style: normal;line-height: 1.31;letter-spacing: -0.4px;text-align: center;color: #000000;margin-top: 15px;}.element_v2 {display: none;}.ui_v2 .element_v1 {display: none;}.ui_v2 .element_v2 {display: block;}#username-container-2 {margin-top: 20px;}.ui_v2 .bottom_link {margin-top: 10px;}#z1-rto-new-addOfferContainer-2 .bottom_link a {font-size: 11px;font-weight: 500;font-style: normal;font-stretch: normal;line-height: 1;letter-spacing: normal;text-align: center;color: #000000;}#rtoOfferValue2 {margin-left: -8px;}.ui_v2 .show_min_msg {height: 20px;}';\n\n console.log('Before RTO Style');\n\n appendStyle(style);\n\n\n var currentDate = new Date();\n\n currentDate = convertUTCtoCST(currentDate);\n var currentTime = currentDate.valueOf();\n\n console.log(e.offerExpiry+\" Got Offer Expiry \");\n\n var endTime = getTimeFromApiFormat(e.offerExpiry);\n\n\n currentTime = Number(currentTime.toString().substring(0,currentTime.toString().length - 3));\n\n console.log(endTime+\" timeCheck Main: \" + currentTime);\n\n rtoTimeRemaining = (endTime-currentTime);\n\n if(rtoTimeRemaining <= 0)\n {\n return;\n }\n\n rtoTimeRemaining = rtoTimeRemaining*1000;\n\n var expiryInMinutes = Math.ceil((endTime-currentTime)/(60));\n\n e.offerDuration = expiryInMinutes;\n\n\n console.log(\" rtoTimeRemaining: \" + rtoTimeRemaining);\n\n var rtoTimejsStr = 'var rtoTimeRemaining = '+rtoTimeRemaining;\n\n appendJs(rtoTimejsStr);\n\n\n /*var javscriptStr = `\n // Set the TIME we're counting down from\n //var distance = 1*30*1000; //12min\n\n // Update the count down every 1 second\n var x = setInterval(function() {\n\n // Time calculations for days, hours, minutes and seconds\n var days = Math.floor(rtoTimeRemaining / (1000 * 60 * 60 * 24));\n var hours = Math.floor((rtoTimeRemaining % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));\n var minutes = Math.floor((rtoTimeRemaining % (1000 * 60 * 60)) / (1000 * 60));\n var seconds = Math.floor((rtoTimeRemaining % (1000 * 60)) / 1000);\n seconds = (\"0\" + seconds).slice(-2);\n minutes = (\"0\" + minutes).slice(-2);\n\n // Output the result in an element with id=\"show_min and show_sec\"\n\n if(document.getElementById(\"show_min\"))\n {\n document.getElementById(\"show_min\").innerHTML = minutes;\n document.getElementById(\"show_sec\").innerHTML = seconds;\n }\n \n\n // If the count down is over, write some text \n if (rtoTimeRemaining <= 0) {\n clearInterval(x);\n //document.getElementById(\"timercontainer\").style.display = \"none\";\n document.getElementById(\"link_applynow\").style.display = \"none\"; \n document.getElementById(\"show_offer_status\").innerHTML = \"EXPIRED\";\n\n return;\n }\n rtoTimeRemaining = rtoTimeRemaining - 1000;\n }, 1000);\n `;*/\n var javscriptStr ='var x = setInterval(function() { var days = Math.floor(rtoTimeRemaining / (1000 * 60 * 60 * 24)); var hours = Math.floor((rtoTimeRemaining % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); var minutes = Math.floor((rtoTimeRemaining % (1000 * 60 * 60)) / (1000 * 60)); var seconds = Math.floor((rtoTimeRemaining % (1000 * 60)) / 1000); seconds = (\"0\" + seconds).slice(-2); minutes = (\"0\" + minutes).slice(-2); if (document.getElementById(\"show_min\")) { document.getElementById(\"show_min\").innerHTML = minutes; document.getElementById(\"show_sec\").innerHTML = seconds; } if (rtoTimeRemaining <= 0) { clearInterval(x); document.getElementById(\"link_applynow\").style.display = \"none\"; document.getElementById(\"show_offer_status\").innerHTML = \"EXPIRED\"; return; } rtoTimeRemaining = rtoTimeRemaining - 1000;}, 1000);';\n\n appendJs(javscriptStr);\n \n var domstr_val = \"\";\n var dolStr = \"$\";\n var pctStr = \"\";\n var domstr_val_2=\"\";\n\n domstr_val = '<div id=\"price-container\"><span class=\"priceTag\">'+dolStr+'</span><span id=\"rtoOfferValue\"></span></div>';\n domstr_val_2 = '<div id=\"price-container\"><span class=\"priceTag\">Take '+dolStr+' off</span><span id=\"rtoOfferValue\"></span></div>';\n\n if (e.offType == \"PERCENT_FIX\") {\n pctStr = \"%\"; \n\n domstr_val = '<div id=\"price-container\"><span id=\"rtoOfferValue\"></span><span class=\"priceTag\" style=\"margin:5px\">'+pctStr+'</span></div>'; \n } \n\n if (e.offType == \"DOLLAR_THR\") {\n domstr_val = '<div class=\"z1-rto-dollar_reward\"><div class=\"z1-rto-dollar_reward_content\"><div class=\"z1-rto-dollar-text\">$</div><div class=\"z1-rto-dollar-text-amount\" id=\"rtoOfferValue\"></div><div class=\"z1-rto-dollar-text-dOff-outer\"><span class=\"z1-rto-dollar-text-dOff-off\">off</span> <br><span class=\"z1-rto-dollar-text-dOff-off-amount\"><span class=\"z1-rto-dollar-text-dOff-off-miniDollar\">$</span><span class=\"z1-rto-dollar-text-dOff-off-miniDollarAmount\">'+e.offThres+'</span></span></div></div></div>';\n }\n\n\n var domstr = '<div class=\\'main-cont\\'><div class=\\'element_v1\\'><div class=\"z1_orderreview_container\"><div class=\\'loyalty-cont disable\\'><span class=\\'heading-1\\'>KOHL’S REWARDS®</span><span class=\\'heading-2\\'>MEMBER EXCLUSIVE</span></div><div id=\"username-container\"><div id=\"usernameText\">Hi, take</div></div><div id=\"z1-rto-new-outerDiv\">'+domstr_val+'<div id=\"message-container\">when you<br> place your<br> order in<br> the next..</div><div id=\"time-container\"><div id=\"min-container\"> <div id=\"show_min\">45</div> <div class=\"tag_min\">MINUTES</div></div><div id=\"sec-container\"> <div id=\"show_sec\">39</div> <div class=\"tag_sec\">SECONDS</div></div></div><div class=\"promocodecontainer\"><div id=\"z1-tro-new-promoCodeText\">Promo Code:</div><div id=\"rtoOfferCode\"></div></div><div id=\"z1-rto-new-addOfferContainer\"><div id=\"link_applynow\"><a id=\"reviewApplyNow\" style=\"color:white;text-decoration: none;\" href=\"#\">ADD OFFER</a></div><div id=\"show_offer_status\"></div><div class=\"bottom_link\"><a id=\"discliamer_href\" href=\"'+e.disclaimer+'\" target=\"_default\">details & exclusions</a></div></div></div></div></div><div class=\\'element_v2\\'><div class=\"z1_orderreview_container_2\"><div id=\"first-div\"><div id=\"username-container-2\"><div id=\"usernameText2\" class=\"usernameText2\">Hi, take</div><div class=\\'usernameText2\\'>your cart looks great!</div></div><div id=\"price-container-2\" class=\"price-container-2\"><span class=\"priceTag\">Take '+dolStr+'</span><span id=\"rtoOfferValue2\"></span><span>off</span></div><div id=\"price-container-2-msg\" class=\"price-container-2-msg\">the items in your cart!</div></div><div id=\"second-div\"><div id=\"min-container-2\"><div id=\"show_min_msg\" class=\"show_min_msg\">Checkout in the next</div><div id=\"show_min_2\" class=\"show_min_2\"><span id=\\'offerDuration\\' class=\\'offerDuration\\'> </span> minutes.</div></div><div class=\"promocodecontainer-2\"><div id=\"z1-tro-new-promoCodeText_2\">PROMO CODE:</div><div id=\"rtoOfferCode2\"></div></div></div><div id=\"third-div\"><div id=\"z1-rto-new-addOfferContainer-2\"><div id=\"link_applynow2\"><a id=\"reviewApplyNow2\" style=\"color:white;text-decoration: none;\" href=\"#\">ADD OFFER</a></div><div id=\"show_offer_status\"></div><div class=\"bottom_link\"><a id=\"discliamer_href\" href=\"'+e.disclaimer+'\" target=\"_default\">details & exclusions</a></div></div></div></div></div></div>';\n \n \n \n\n console.log('Before RTO Reiview Widget');\n\n //document.querySelector('#checkoutreview #shopping_Bag_Lpanel').insertAdjacentHTML(\"afterbegin\", domstr);\n\tdocument.querySelector('#checkoutreview #shopping_Bag_Lpanel').insertAdjacentHTML(\"afterbegin\", domstr);\n\n document.getElementById('rtoOfferValue').innerHTML =e.offerValue;\n document.getElementById('rtoOfferValue2').innerHTML =e.offerValue;\n\n document.getElementById('rtoOfferCode').innerHTML =e.offerCode;\n document.getElementById('rtoOfferCode2').innerHTML =e.offerCode;\n \n document.getElementById('offerDuration').innerHTML =e.offerDuration;\n\n if(e.loyaltyCx == true)\n {\n document.getElementsByClassName('z1_orderreview_container')[0].classList.add('loyalty');\n }\n\n if(e.ui_version && e.ui_version == 2)\n {\n document.getElementsByClassName('main-cont')[0].classList.add('ui_v2');\n document.getElementsByClassName('main-cont')[0].classList.add(e.offType.toLowerCase());\n }\n\n document.getElementById('reviewApplyNow').onclick = function(){\n\n\n document.getElementsByClassName(\"kohlscashapply\")[0].onclick = function(){\n\n\n console.log(\"kohlscashapply Click \"); \n\n var timeCounter = 0;\n var maxCounter = 10;\n var timeDelay = 500;\n\n var popupCheck = setInterval(function(){ \n\n console.log(\"Checking for Redemption Popup \"+timeCounter); \n\n var popupDiv = document.getElementsByClassName('kc-applyContainer')[0];\n\n //var popupDiv = document.getElementById('promo-kcInput');\n\n console.log('Got Popup Div '+popupDiv);\n\n if(popupDiv != undefined && popupDiv != null)\n {\n clearInterval(popupCheck);\n\n\n //setTimeout(function(){ }, 500);\n\n var parentDiv = document.getElementById('tr-wallet-content-placeholder');\n\n addDataToRedemptionPopup(parentDiv,e.offerCode);\n\n return;\n }\n\n if(timeCounter > maxCounter)\n {\n clearInterval(popupCheck);\n }\n\n timeCounter++;\n\n }, timeDelay);\n\n\n\n };\n\n document.getElementsByClassName(\"kohlscashapply\")[0].click(); \n };\n\n\n\n document.getElementById('reviewApplyNow2').onclick = function(){\n\n\n document.getElementsByClassName(\"kohlscashapply\")[0].onclick = function(){\n\n\n console.log(\"kohlscashapply Click \"); \n\n var timeCounter = 0;\n var maxCounter = 10;\n var timeDelay = 500;\n\n var popupCheck = setInterval(function(){ \n\n console.log(\"Checking for Redemption Popup \"+timeCounter); \n\n var popupDiv = document.getElementsByClassName('kc-applyContainer')[0];\n\n //var popupDiv = document.getElementById('promo-kcInput');\n\n console.log('Got Popup Div '+popupDiv);\n\n if(popupDiv != undefined && popupDiv != null)\n {\n clearInterval(popupCheck);\n\n\n //setTimeout(function(){ }, 500);\n\n var parentDiv = document.getElementById('tr-wallet-content-placeholder');\n\n addDataToRedemptionPopup(parentDiv,e.offerCode);\n\n return;\n }\n\n if(timeCounter > maxCounter)\n {\n clearInterval(popupCheck);\n }\n\n timeCounter++;\n\n }, timeDelay);\n\n\n\n };\n\n document.getElementsByClassName(\"kohlscashapply\")[0].click(); \n };\n\n\n \n\n\n \n populateUsername();\n\n updateSupcDetails();\n\n sendRTOOmniture(1);\n\n\n \n\n }\n\n function getSessionStartTime()\n {\n var userVector = JSON.parse(localStorage.getItem('z1_userVectors'));\n\n var timeVector = userVector.timeVector.toString().split('|');\n\n return timeVector[0];\n }\n\n\n function sendDisEventToC3(pageName,type,existingSupc)\n {\n var eventName = '_ws_rto_page_report';\n\n var sessionStartTime = getSessionStartTime();\n\n\n var returnObj = {};\n returnObj.pgN = pageName;\n returnObj.sessionStartTime = sessionStartTime;\n returnObj.type = type;\n returnObj.rtoName = existingSupc.rtoName;\n returnObj.identifier = existingSupc.identifier;\n\n ZineOne.pushEvent(eventName, returnObj);\n\n }\n\n\n //Case 1: Display Omniture \n //Case 2: Redemption Omniture\n function sendRTOOmniture(caseToSend)\n {\n\n var existingSupc = localStorage.getItem('z1_supc');\n\n if(existingSupc != null && existingSupc != undefined && existingSupc != 'null')\n {\n\n existingSupc = JSON.parse(existingSupc);\n\n\n var prop75 = existingSupc.omniturePrefix+'|';\n prop75 = prop75 + 'C:' + existingSupc.offerCampaign + '|';\n prop75 = prop75 + existingSupc.identifier + '|';\n\n\n if(caseToSend == 1)\n {\n prop75 = prop75+'CP|OR|';\n sendDisEventToC3(\"OR\",\"shown\",existingSupc);\n }\n\n if(caseToSend == 2)\n {\n prop75 = prop75+'OM|';\n sendDisEventToC3(\"OM\",\"redeem\",existingSupc);\n }\n\n \n //prop75 = prop75+'P:'+existingSupc.pscore+'|';\n //prop75 = prop75+'O:'+existingSupc.offerValue+'|';\n //prop75 = prop75+'T:'+pageData.cartDetails.cartSubTotalValue+'|';\n //prop75 = prop75+'OC:'+existingSupc.offerCode;\n\n var prop75Obj = {};\n prop75Obj['prop75'] = prop75;\n\n console.log('Got Prop 75 ',prop75Obj);\n\n fireOmniture(prop75Obj);\n\n }\n }\n\n\n\n\n\n var existingSupc = localStorage.getItem('z1_supc');\n\n if(existingSupc != null && existingSupc != undefined && existingSupc != 'null')\n {\n var e = JSON.parse(existingSupc);\n showRTOReviewSection(e);\n\n return;\n }\n\n\n localStorage.setItem('z1_supc',null);\n\n\n isSoftLoggedIn = getCookie(\"SoftLoggedInCookie\");\n\n if (pageData && pageData.customerDetails) {\n if (!isSoftLoggedIn || (isSoftLoggedIn && !isSoftLoggedIn.includes(\"true\"))) {\n if (pageData.customerDetails.isLoggedIn) isLoggedIn = \"true\";\n }\n }\n\n\n\n console.log(\"RTO Order Review END\");\n \n}\ncatch(e)\n{\n if (debugScr) console.log(\"[Zineone] Error in RTO Order Review Tag: WebStore Z1 tag. \" + e);\n}\n ","eventName":"load","pageSelector":{"type":"pgName","condition":"ends","val":"checkout/V2/checkout.jsp"}},{"tagName":"ws_show_stars_if_rating_above_4","actionType":"z1script","script":"try {\n var isDebugScr = false;\n var sendevt = true;\n var evtName = \"ws_products_stars\";\n var evtData = {\n \"page\": \"Cart\"\n };\n var shoppingBagItems = document.getElementsByClassName(\"shoppingBagItem\");\n var commerce_ids = \"\";\n var product_ids = \"\";\n for (let i = 0; i < shoppingBagItems.length; i++) {\n if (i == 0) {\n commerce_ids = commerce_ids + shoppingBagItems[i].getAttribute('data-commerceid');\n product_ids = product_ids + shoppingBagItems[i].getAttribute('data-skuid');\n } else {\n commerce_ids = commerce_ids + \",\" + shoppingBagItems[i].getAttribute('data-commerceid');\n product_ids = product_ids + \",\" + shoppingBagItems[i].getAttribute('data-skuid');\n }\n var parent_div = shoppingBagItems[i].getElementsByClassName(\"z1PostItem\")[0];\n if (isDebugScr) console.log(\"[zineone] parent_div...\", parent_div);\n var star_div = document.createElement(\"div\");\n star_div.setAttribute(\"id\", \"z1-star-\" + shoppingBagItems[i].getAttribute('data-skuid'));\n parent_div.append(star_div);\n }\n evtData.commerce_ids = commerce_ids;\n evtData.product_ids = product_ids;\n if (sendevt) {\n if (isDebugScr) console.log(\"[zineone] IF send event \", evtData);\n if (isDebugScr) console.log(\"[zineone] IF send event name \", evtName);\n ZineOne.pushEvent(evtName, evtData);\n if (isDebugScr) console.log(\"[zineone] ws_products_stars event pushed\");\n } else {\n if (isDebugScr) console.log(\"[zineone] ws_products_stars disabled\");\n }\n\n} catch (e) {\n console.log(\"[zineone] exception in ws_products_stars Tag=\" + e);\n}","eventName":"load","pageSelector":{"type":"pgName","condition":"contains","val":"checkout/shopping_cart"}},{"tagName":"ws_pdp_recommendations","actionType":"z1script","script":"var debug = false;\nvar sendevt = true;\nvar evtName = \"ws_pdp_recommendations\";\nvar evtData = {\n \"page\": \"Shopping Cart\"\n};\ntry {\n var myId = pageData.customerDetails.customerID ? pageData.customerDetails.customerID : \"\";\n if (myId == \"3000000129500077\") {\n\n var product_ids = \"\";\n //var freeShipQualificationDelta = JSON.parse(localStorage.getItem(\"persistent_bar_components_json_v1\")).shipmentInfo[0].shipmentPriceInfo.freeShipQualificationDelta;\n var freeShipQualificationDelta = trJsonData.shipmentInfo[0].shipmentPriceInfo.freeShipQualificationDelta;\n if (debug) console.log(\"[Zineone] freeShipQualificationDelta = \", freeShipQualificationDelta);\n var shoppingBagItems = document.getElementsByClassName(\"shoppingBagItem\");\n for (let i = 0; i < shoppingBagItems.length; i++) {\n if (i == 0) {\n product_ids = product_ids + shoppingBagItems[i].getAttribute('data-productid');\n } else {\n product_ids = product_ids + \",\" + shoppingBagItems[i].getAttribute('data-productid');\n }\n }\n evtData.product_ids = product_ids;\n evtData.freeShipQualificationDelta = freeShipQualificationDelta;\n if (sendevt) {\n if (debug) console.log(\"[Zineone] IF send event \", evtData);\n if (debug) console.log(\"[Zineone] IF send event name \", evtName);\n ZineOne.pushEvent(evtName, evtData);\n if (debug) console.log(\"[Zineone] ws_pdp_recommendations event pushed\");\n } else {\n console.log(\"[Zineone] ws_pdp_recommendations Event disabled\");\n }\n } else {\n console.log(\"Firning only for testing users\");\n return;\n }\n} catch (e) {\n console.log(\"[zineone] exception in ws_pdp_recommendations Tag=\" + e);\n}","eventName":"load","pageSelector":{"type":"pgName","condition":"contains","val":"checkout/shopping_cart"}},{"tagName":"SetMCMSecondaryKey","actionType":"z1script","script":"\nvar mcid = (typeof Visitor != 'undefined') ? Visitor.getInstance('F0EF5E09512D2CD20A490D4D@AdobeOrg') : '';\nId = (mcid ? mcid.getMarketingCloudVisitorID() : '');\n\n//console.log (\" MCID - \" + Id );\n\nvar limitCustomerIds = [\"2254009728812139\",\"3000000015001846\"];\n\n\nvar localMcm = localStorage.getItem('mcm_id');\n\nif(localMcm == null)\n{\n\tZineOne.setCustomKey(\"mcid\", Id);\n\tlocalStorage.setItem('mcm_id',Id);\n}\n\n","eventName":"load","pageSelector":{"type":"all","condition":"equals","val":""}},{"tagName":"RTO Wallet Apply","actionType":"z1script","script":"try {\n \t\n\tvar debugScr = true;\n \n \tconsole.log('RTO WAllet Start');\n\n \tfunction fireOmniture(z1Response) {\n\n\t //////***** whats the s.tl(this) ??? */\n\n\t if (z1Response && z1Response.prop75) {\n\t var eVar39 = z1Response.evar39 ? z1Response.evar39 : z1Response.customerId;\n\t s.tl(this, 'o', 'ZineOne Impression', {\n\t linkTrackVars: 'prop75,eVar39',\n\t prop75: z1Response.prop75,\n\t eVar39: eVar39\n\t });\n\n\t }\n\n\n\t}\n\n \tfunction getSessionStartTime()\n {\n var userVector = JSON.parse(localStorage.getItem('z1_userVectors'));\n\n var timeVector = userVector.timeVector.toString().split('|');\n\n return timeVector[0];\n }\n\n \tfunction sendDisEventToC3(pageName,type,existingSupc)\n {\n var eventName = '_ws_rto_page_report';\n\n var sessionStartTime = getSessionStartTime();\n\n\n var returnObj = {};\n returnObj.pgN = pageName;\n returnObj.sessionStartTime = sessionStartTime;\n returnObj.type = type;\n returnObj.rtoName = existingSupc.rtoName;\n returnObj.identifier = existingSupc.identifier;\n\n ZineOne.pushEvent(eventName, returnObj);\n\n }\n\n\tfunction sendRTOOmniture(caseToSend)\n {\n\n var existingSupc = localStorage.getItem('z1_supc');\n\n if(existingSupc != null && existingSupc != undefined && existingSupc != 'null')\n {\n\n existingSupc = JSON.parse(existingSupc);\n\n var prop75 = existingSupc.omniturePrefix+'|';\n prop75 = prop75+'C:'+existingSupc.offerCampaign+'|';\n prop75 = prop75 + existingSupc.identifier + '|';\n\n\n if(caseToSend == 1)\n {\n prop75 = prop75+'CP|CP|';\n\n sendDisEventToC3(\"CP\",\"shown\",existingSupc);\n }\n\n if(caseToSend == 2)\n {\n prop75 = prop75+'OM|';\n sendDisEventToC3(\"OM\",\"redeem\",existingSupc);\n }\n\n \n \n //prop75 = prop75+'P:'+existingSupc.pscore+'|';\n //prop75 = prop75+'O:'+existingSupc.offerValue+'|';\n //prop75 = prop75+'T:'+pageData.cartDetails.cartSubTotalValue+'|';\n //prop75 = prop75+'OC:'+existingSupc.offerCode;\n\n var prop75Obj = {};\n prop75Obj['prop75'] = prop75;\n\n\n fireOmniture(prop75Obj);\n\n }\n }\n\n function addDataToRedemptionPopup(popupDiv,promoCode)\n {\n //console.log(' addDataToRedemptionPopup '+document.getElementsByClassName('kc-applyContainer')[0]); \n\n var initPopupContent = document.querySelector('#fancybox-content .kas-promo_code'); \n\n var div = document.getElementById('wallet-promoText');\n\n if(div)\n {\n \tdiv.parentNode.removeChild(div);\t\n }\n\t\t\n\n var promoTextContent = '<div id=\"wallet-promoText\" style=\"font-size: 14px;text-align: left;\" class=\"popupPromoText\">Your promo code is already entered</div>';\n\n\n\n initPopupContent.parentNode.insertAdjacentHTML(\"afterend\", promoTextContent);\n\n //document.getElementsByClassName('kc-applyContainer')[0].innerHTML = InitPopupContent;\n\n initPopupContent.value = promoCode;\n\n\n var applyButton = document.querySelector('#fancybox-content .addto_wallet_btn'); \n\n\n applyButton.onclick = function(){\n\n var currentPromoCode = initPopupContent.value;\n\n if(currentPromoCode == promoCode)\n {\n var existingSupc = localStorage.getItem('z1_supc');\n\n existingSupc = JSON.parse(existingSupc);\n\n existingSupc.is_redeemed = true;\n\n localStorage.setItem('z1_supc',JSON.stringify(existingSupc));\n\n sendRTOOmniture(2);\n\n }\n\n };\n\n\n }\n\n function getDayLightOffset()\n\t {\n\t //Automatically adjust for GMT to Central Timediff based on Daylight savings\n\t //Returns number of hours Central is behind GMT\n\t //\n\t var now = new Date();\n\t //test data\n\t var test = now.getTime(); //238*24*3600000;\n\t var nowUtc = new Date(test);\n\t var month = nowUtc.getMonth()+1; //make jan=1\n\n\t if (month < 3 || month > 11) return 6; // savings=F\n\t if (month > 3 && month < 11) return 5; // savings=T\n\n\t // switch if >2nd sun in march or >1st sun in nov\n\t // switches at midnight UTC, so 5 or 6 hrs away from 2AM Central\n\n\t var tzDiffInHours; //UTC vs Central diff in hours\n\t var day = nowUtc.getDate(); //already 1 based\n\t var dow = nowUtc.getDay(); //already sun=0\n\t var previousSunday = day - dow; \n\t if (month == 3) tzDiffInHours = (previousSunday >= 8) ? 5 : 6;\n\t if (month == 11) tzDiffInHours = (previousSunday < 0) ? 5 : 6;\n\t \n\t //java.lang.System.out.println(\"@@@@@@ Daylight savings computed variable=\"+tzDiff);\n\t //var tzDiffInHours = 5; //Change on sunday nov 4, 2018, to 6hrs\n\n\t return tzDiffInHours;\n\t }\n\n function convertUTCtoCST(dateObj)\n {\n var dayLightOffset = getDayLightOffset();\n return new Date(dateObj.getTime() - ((1 * 60 * 60 * 1000) * dayLightOffset));\n }\n\n function getTimeFromApiFormat(dateStr)\n {\n var dateStrSplit = dateStr.split(' ');\n\n var dateSplit = dateStrSplit[0].split('-');\n var timeSplit = dateStrSplit[1].split(':');\n\n var dateObj = new Date();\n dateObj.setYear(dateSplit[0]);\n dateObj.setMonth(dateSplit[1]-1);\n dateObj.setDate(dateSplit[2]);\n\n dateObj.setHours(timeSplit[0]);\n dateObj.setMinutes(timeSplit[1]-1);\n dateObj.setSeconds(timeSplit[2]);\n\n var dateObj = new Date((dateObj.getTime() - dateObj.getTimezoneOffset()*60*1000)/1000);\n\n console.log(dateObj.getTime()+' getTimeFromApiFormat '+dateObj);\n\n return dateObj.valueOf();\n\n }\n \n function checkForLocalRTO()\n {\n var existingSupc = localStorage.getItem('z1_supc');\n\n if(existingSupc != null && existingSupc != undefined && existingSupc != 'null')\n {\n\n var e = JSON.parse(existingSupc);\n\n var offerExpiry = e.offerExpiry;\n\n\n var currentDate = new Date();\n\n currentDate = convertUTCtoCST(currentDate);\n var currentTime = currentDate.valueOf();\n\n\n var endTime = getTimeFromApiFormat(e.offerExpiry);\n\n\n currentTime = Number(currentTime.toString().substring(0,currentTime.toString().length - 3));\n\n\n var timeCheck = endTime-currentTime;\n\n //console.log(\" timeCheck: \" + timeCheck);\n\n if(timeCheck > 0)\n {\n\n if(e.is_redeemed != true)\n {\n\n document.getElementsByClassName('open-addtowallet')[0].onclick = function(){\n\n \tvar timeCounter = 0;\n\t\t var maxCounter = 10;\n\t\t var timeDelay = 500;\n\n\t\t var popupCheck = setInterval(function(){ \n\n\n\t\t var popupDiv = document.querySelector('#fancybox-content .kas-promo_code');\n\n\t\t //var popupDiv = document.getElementById('promo-kcInput');\n\n\t\t console.log('Got Popup Div '+popupDiv);\n\n\t\t if(popupDiv != undefined && popupDiv != null)\n\t\t {\n\t\t clearInterval(popupCheck);\n\n\n\t\t //setTimeout(function(){ }, 500);\n\n\t\t addDataToRedemptionPopup(popupDiv,e.offerCode);\n\n\t\t return;\n\t\t }\n\n\t\t if(timeCounter > maxCounter)\n\t\t {\n\t\t clearInterval(popupCheck);\n\t\t }\n\n\t\t timeCounter++;\n\n\t\t }, timeDelay);\n\n };\n\n document.getElementsByClassName('open-addtowallet')[0].click();\n }\n }\n else\n {\n return false;\n }\n \n\n \n return true;\n\n\n }\n\n return false;\n }\n\n console.log('RTO WAllet Before Check');\n\n if(checkForLocalRTO() == true)\n {\n return;\n }\n\n localStorage.setItem('z1_supc',null);\n\n\n}\ncatch(e)\n{\n if (debugScr) console.log(\"[Zineone] Error in RTO Wallet Apply Tag: WebStore Z1 tag. \" + e);\n}","eventName":"load","pageSelector":{"type":"pgName","condition":"contains","val":"my_wallet.jsp"}},{"tagName":"perk_perf_tag","actionType":"z1script","script":"/*Changes done for IE\nA. function declaration like, var abc = function() won't work in IE if function is used first and then declared and defined. Please take below precaution before using it:\n 1. If you want to use function declaration like, var abc = function(), first declare it and then use it\n 2. Use normal function declaration like, function abc(). you can declare function anywhere in the page and use it before or after declaration. It will work on all the browsers.\nB. Do not use multiline strings, also call as 'Template String'. Template Strings are demarked by a backtick(`).\n Example. var abc = `This is multiline\n comment`; //multiline comments won't work in IE\n Use simple concatenation to achieve the same like,\n var abc = \"\";\n abc += 'This is multiline';\n abc += 'comment';\nC. You can not set defalut parameter values for function in IE.\n for e.g. function abc(num = 0,str=\"hello\") //Won't work in IE\nD. You can not use arguments object ([...args] or (...args) in function) in IE.\n For e.g function abc(...args){\n console.log(\"received paramenters \", args)\n } // Won't work in IE\nE. 'append' function won't work in IE. You can use 'appendChild' function to achieve the same functionality.\nF. 'prepend' function won't work IE. Try to use 'insertBefore' function to achieve the same functionality.\nG. new Event() function won't work in IE. You can use new CustomEvent() function to achieve the same functionality.\nH. Arrow functions (=>) won't work in IE\nI. while creating div do not put all the css in style attribute. For e.g.\n<new div>.style=\"margin:24px;display:flex;float:right\" \nchange to \n\n\n<new div>.style.margin=\"24px\";\n<new div>.style.display=\"flex\";\n<new div>.style.float=\"right\"; \n*/\n/*function isIE() {\n var ua = window.navigator.userAgent; //Check the userAgent property of the window.navigator object\n var msie = ua.indexOf('MSIE '); // IE 10 or older\n var trident = ua.indexOf('Trident/'); //IE 11\n return (msie > 0 || trident > 0);\n };\n var isIEFlag = isIE();\n if (!isIEFlag) return;\n var cust_id = pageData.customerDetails.customerID ? pageData.customerDetails.customerID : \"\";\n if (cust_id != \"3000000030411692\") return;*/\n console.log(\"[Zineone-I] Perk Perf Tag\");\n/*try {\n if (debug) console.log(\" [Z1] perk_perf_tag_test\");\n\n var birthday_perk_perfCodeHandler = function(e) {\n if (debug) console.log(\"birthday_perk_perfCodeHandler...\", e);\n if (debug) console.log(\"e.detail...\", e.detail);\n localStorage.setItem(\"z1_ws_birthday_perk_perf_tag_data\",JSON.stringify(e.detail));\n // handleEmailOptIn(e.detail);\n }\n document.addEventListener(\"ws_birthday_perk_perf\", birthday_perk_perfCodeHandler, false);\n}\ncatch(e)\n{if (debug) console.log(\"perk_perf_tag_test\");}*/\n\nvar debug = false;\n\nfunction isValid(datapoint) {\n if (!datapoint || typeof datapoint == 'undefined' || datapoint == undefined || datapoint === undefined || String(datapoint) === 'undefined' || datapoint == \"null\" || datapoint == null) {\n\n return false;\n } else {\n return true;\n }\n}\n\nfunction appendStyle(styles) {\n var css = document.createElement('style');\n css.type = 'text/css';\n\n if (css.styleSheet) css.styleSheet.cssText = styles;\n else css.appendChild(document.createTextNode(styles));\n\n document.getElementsByTagName(\"head\")[0].appendChild(css);\n}\n\nfunction perkPerfBannersCouponPage() {\n\n var pg_url = window.location.href;\n if (pg_url.includes(\"qa02\")) {\n //QA02 start\n var perkPerfBannersDiv3 = document.getElementById('bottom-right');\n if (debug) console.log(\"perkPerfBannersCouponPage>>>\", perkPerfBannersDiv3);\n var perkPerfBannersCouponPage = \".perk_notify_coupon{display:flex;flex-direction:row;width:417px;height:147px;background-color:#238341}.perk_notify_coupon_content{display:flex;flex-direction:column}#PICK-YOUR-PERK_btn{padding-bottom:9px;margin-left:34px;margin-right:99px;margin-top:14px;width:128px}.clk-btn{display:block;height:30.4px;background-color:#fff;cursor:pointer;font-family:'Gotham 7r',GothamBold,Helvetica,Arial,sans-serif;font-size:12px;font-weight:700;font-style:normal;font-stretch:normal;line-height:.6px;letter-spacing:.5px;text-align:center;color:#238341;border:solid transparent;width:100%}.gift{text-align:center;font-size:70px;color:#fff;margin-top:auto;margin-right:39.2px;margin-bottom:auto}.Your-birthdays-comi{width:228px;height:50px;font-family:'Gotham 5r',GothamBold,Helvetica,Arial,sans-serif;font-size:25px;font-style:normal;font-stretch:normal;line-height:1.08;letter-spacing:.44px;color:#fff;margin-right:53px;margin-left:33px;margin-top:25px}\";\n appendStyle(perkPerfBannersCouponPage);\n\n var inHTMLperkPerfBannersCouponPage = \"\";\n inHTMLperkPerfBanners = \"<div class='perk_notify_coupon'> <div class='perk_notify_coupon_content'> <div class='Your-birthdays-comi'>Your birthday’s<br>coming up… </div><div id='PICK-YOUR-PERK_btn'><a href='/myaccount/kohls_rewards.jsp' > <input type='button' style='font-weight: bold;font-family: 'Gotham 4r', GothamBold, Helvetica, Arial, sans-serif;' class='clk-btn' value='PICK YOUR PERK'></a> </div></div><div class='gift'> <img src='https://d2p4r375zfkzm8.cloudfront.net/sandbox-kohlswebqa02-com/group3.png' class='Group-3'></div></div>\";\n var child = document.createElement(\"div\");\n child.innerHTML = inHTMLperkPerfBanners;\n // child.style = \"margin:24px;display:flex;float:right\";\n\n child.style.margin=\"24px\";\n child.style.display=\"flex\";\n child.style.float=\"right\"; \n\n\n perkPerfBannersDiv3.appendChild(child);\n // perkPerfBannersDiv3.innerHTML =appendChild(inHTMLperkPerfBannersCouponPage);\n // perkPerfBannersDiv3.style.display = \"block\";\n //QA02 end\n }\n\n\n //if (pg_url.includes(\"rel02\")) {\n //REL02 start\n /* var perkPerfBannersDiv3 = document.getElementsByClassName('tdeals_lot -tcs');\n perkPerfBannersDiv3[0].style = \"margin-bottom: 66px;\";\n var clearanceDiv = document.getElementsByClassName(\"tdeals_box -half -major -clearance\")[0];\n clearanceDiv.style = \"display: none;\"*/\n\n var rel2_cpn = document.getElementsByClassName('tdeals_box -half -major -clearance');\n rel2_cpn[0].innerHTML = \"\";\n rel2_cpn[0].onclick=\"\";\n //rel2_cpn[0].style = \"background-color:#238341; padding: 25px;\";\n rel2_cpn[0].style.backgroundColor = \"#238341\";\n rel2_cpn[0].style.padding = \"25px\";\n\n var perkPerfBannersDiv3 = rel2_cpn;\n var perkPerfBannersCouponPage = \".perk_notify_coupon_rel{display:flex;flex-direction:row;width:372 px;height:134 px;background-color:#238341}.perk_notify_coupon_content_rel{display:flex;flex-direction:column}#PICK-YOUR-PERK_btn_rel{margin-top:14px;width:128px}.clk-btn_rel{display:block;height:30.4px;background-color:#fff;cursor:pointer;font-family:'Gotham 4r',GothamMedium,Helvetica,Arial,sans-serif;font-size:12px;font-weight:700;font-style:normal;font-stretch:normal;line-height:.6px;letter-spacing:.5px;text-align:center;color:#238341;border:solid transparent;width:100%}.gift_rel{text-align:center;font-size:70px;color:#fff;margin:auto;position:relative;left:45px}.Your-birthdays-comi_rel{width:228px;height:50px;font-family:'Gotham 5r',GothamBold,Helvetica,Arial,sans-serif;font-size:25px;font-style:normal;font-stretch:normal;line-height:1.08;letter-spacing:.44px;color:#fff}\";\n appendStyle(perkPerfBannersCouponPage);\n var inHTMLperkPerfBannersCouponPage = \"\";\n inHTMLperkPerfBanners = \"<div class='new2' > <div class='perk_notify_coupon_rel'> <div class='perk_notify_coupon_content_rel'> <div class='Your-birthdays-comi_rel'>Your birthday’s<br>coming up… </div><div id='PICK-YOUR-PERK_btn_rel'><a href='/myaccount/kohls_rewards.jsp' > <input type='button' style='font-weight: bold;font-family: 'Gotham 4r', GothamBold, Helvetica, Arial, sans-serif;' class='clk-btn_rel' value='PICK YOUR PERK'></a> </div></div><div class='gift_rel'> <img src='https://d2p4r375zfkzm8.cloudfront.net/sandbox-kohlswebqa02-com/group3.png' class='Group-3'></div></div></div>\";\n /* var child = document.createElement(\"div\");\n child.style = \"display: flex;flex-direction: row-reverse;position: absolute;margin: -124px 223px;\";\n child.class = \"tdeals_box -half -major -clearance\";\n //child.style = \"display: flex;flex-direction: row-reverse;margin-left:19px;\";\n child.innerHTML = inHTMLperkPerfBanners;\n perkPerfBannersDiv3[0].appendChild(child);*/\n\n var child = document.createElement(\"div\");\n child.innerHTML = inHTMLperkPerfBanners;\n /* child.style = \"margin:24px;display:flex;float:right\";*/\n perkPerfBannersDiv3[0].appendChild(child);\n\n\n //REL02 end\n //}\n}\n\n\nfunction perkPerfBannersCouponPage2() {\n\n\n //var perkPerfBannersDiv3 = document.getElementById('monetizationElements');\n var perkPerfBannersDiv3 = document.getElementsByClassName('tdeals_box -half -major -clearance')[0];\n \n perkPerfBannersDiv3.onclick=\"\";\n perkPerfBannersDiv3.innerHTML=\"\";\n //perkPerfBannersDiv3.style = \"background-color:#e6f0ca; padding: 20px;\";\n\n perkPerfBannersDiv3.style.backgroundColor=\"#e6f0ca\";\n perkPerfBannersDiv3.style.padding=\"20px\";\n \n\n\n\n\n\n\n\n\n if (debug) console.log(\"perkPerfBannersCouponPage>>>\", perkPerfBannersDiv3);\n var perkPerfBannersCouponPage = \".perf_notify_rewards{display:flex;flex-direction:row}.Want-more-of-what-yo{font-family:GothamBold,Helvetica,Arial,sans-serif!important;font-size:25px;font-style:normal;font-stretch:normal;font-weight:700;line-height:1;letter-spacing:.44px;color:#238341}.Take-a-moment-to-tel{font-family:GothamMedium,Helvetica,Arial,sans-serif!important;font-size:12px;font-weight:500;font-style:normal;font-stretch:normal;line-height:1.25;letter-spacing:-.07px;color:#238341;padding:5px}#SET-PREFERENCES_btn{margin:auto;margin-left:35px;font-family:GothamMedium,Helvetica,Arial,sans-serif;font-size:12px;font-weight:500;font-style:normal;font-stretch:normal;line-height:1.25;letter-spacing:-.07px;text-align:center;color:#fff}.clk-btn{display:block;border-radius:2.2px;height:30.4px;background-color:#238341;cursor:pointer;font-family:'Gotham 4r',GothamMedium,Helvetica,Arial,sans-serif;font-size:13px;font-weight:700;font-style:normal;font-stretch:normal;line-height:.6px;letter-spacing:.5px;text-align:center;color:#fff;border:solid transparent;width:100%;padding:5px}\";\n\n appendStyle(perkPerfBannersCouponPage);\n\n var inHTMLperkPerfBannersCouponPage = \"\";\n inHTMLperkPerfBannersCouponPage = \"<div class='perf_notify_rewards'> <div class='perf_notify_rewards_content'> <div class='Want-more-of-what-yo'>Want more of <br>what you love?</div><div class='Take-a-moment-to-tel'>Take a moment to tell us who<br>and what you like to shop for.</div></div><div id='SET-PREFERENCES_btn'> <a href='/myaccount/v2/myinfo.jsp' > <input type='button' class='clk-btn' value='SET PREFERENCES'> </a> </div></div>\";\n var child = document.createElement(\"div\");\n child.innerHTML = inHTMLperkPerfBannersCouponPage;\n // child.style = \"display:flex;float:right\";\n\n\n child.style.display=\"flex\";\n child.style.float=\"right\"; \n\n perkPerfBannersDiv3.appendChild(child);\n\n // perkPerfBannersDiv3.innerHTML =appendChild(inHTMLperkPerfBannersCouponPage);\n // perkPerfBannersDiv3.style.display = \"block\";\n}\n\n\nfunction perkPerfBanners() {\n\n //var perkPerfBannersDiv2 = document.getElementById(\"enrollment_wrapper\");\n\n\n var perkPerfBannersDiv2 = document.getElementsByClassName(\"birthday-perk-container\");\n\n if (debug) console.log(\"perkPerfBannersRewardsPage>>>\", perkPerfBannersDiv2);\n\n var perkPerfBanners = \".perk_notify_coupon{display:flex;flex-direction:row;height:110px;background-color:#238341}.perk_notify_coupon_content{display:flex;flex-direction:column}#PICK-YOUR-PERK_btn{padding-bottom:9px;margin-left:34px;margin-right:99px;margin-top:14px;width:128px}.clk-btn{display:block;border-radius:2.2px;height:30.4px;background-color:#fff;cursor:pointer;font-family:'gotham 4r';font-size:12px;font-weight:700;font-style:normal;font-stretch:normal;line-height:.6px;letter-spacing:.5px;text-align:center;color:#238341;border:solid transparent;width:100%}.gift{text-align:center;font-size:70px;color:#fff;margin-top:auto;margin-right:39.2px;margin-bottom:auto}.Your-birthdays-comi{width:228px;height:50px;font-family:Gotham;font-size:25px;font-weight:700;font-style:normal;font-stretch:normal;line-height:1.08;letter-spacing:.44px;color:#fff;margin-right:53px;margin-left:33px;margin-top:25px}\";\n appendStyle(perkPerfBanners);\n\n var inHTMLperkPerfBannersRewardsPage = \"\";\n inHTMLperkPerfBannersRewardsPage = \"<div class='perk_notify_coupon'> <div class='perk_notify_coupon_content'> <div class='Your-birthdays-comi'>Your birthday’s<br>coming up… </div><div id='PICK-YOUR-PERK_btn'> <input type='button' class='clk-btn' value='PICK YOUR PERK'> </div></div><div class='gift'> <img src='https://d2p4r375zfkzm8.cloudfront.net/sandbox-kohlswebqa02-com/group3.png' class='Group-3'></div></div>\";\n\n var child = document.createElement(\"div\");\n child.innerHTML = inHTMLperkPerfBannersRewardsPage;\n\n //child.style = \"margin-top: 25px;\";\n child.style.marginTop=\"25px\";\n\n\n perkPerfBannersDiv2[0].appendChild(child);\n\n // perkPerfBannersDiv2.innerHTML = inHTMLperkPerfBannersRewardsPage;\n // perkPerfBannersDiv2.style.display = \"block\";\n\n\n}\n\nfunction showPerf(args) {\n\n var perfParentDiv2 = document.getElementById(\"z1widget\");\n var stylesPERF = \".z1_b_container_kohlsbannertoparrow{background-color:transparent;padding:0!important;background-color:#238341}.arrow_box{position:relative;background:#238341;border:none;width:198px;border-radius:.3rem .3rem 0 0;left:-50px;top:0;-webkit-box-shadow:0 0 2px 0 rgba(0,0,0,.08);-moz-box-shadow:0 0 2px 0 rgba(0,0,0,.08);box-shadow:0 0 2px 0 rgba(0,0,0,.08)}.arrow_box:after,.arrow_box:before{bottom:100%;left:45%;border:solid transparent;content:'';height:0;width:0;position:absolute;pointer-events:none}.arrow_box:after{border-color:rgba(255,255,255,0);border-bottom-color:#238341;border-width:8px;margin-left:auto}.arrow_box:before{border-color:rgba(191,191,191,0);border-bottom-color:#238341;border-width:8px;margin-left:auto}#detailsContentId{display:block;width:198px}.box{display:flex;flex-direction:column;height:200px}.cross{display:flex;flex-direction:row;height:13px}.Kohls-Rewards-HZ-R{background:url(https://d2p4r375zfkzm8.cloudfront.net/sandbox-kohlswebqa02-com/kohlsrewardshzr.png) center no-repeat;height:15.3px;color:#fff;margin-left:15%;margin-bottom:9px;height:30px}.Want-more-of-what-yo{width:143px;height:55.5px;font-family:'Gotham 7r',GothamBold,Helvetica,Arial,sans-serif;font-size:19px;font-style:normal;font-stretch:normal;line-height:1;letter-spacing:-.07px;text-align:center;color:#238341;margin-right:auto;margin-left:auto;margin-top:24px}.Take-a-moment-to-tel{width:143px;height:55.5px;margin-bottom:7.5px;font-family:'Gotham 5r',GothamMedium,Helvetica,Arial,sans-serif;font-size:12px;font-weight:500;font-style:normal;font-stretch:normal;line-height:1.17;letter-spacing:-.07px;text-align:center;color:#238341;margin-right:auto;margin-left:auto}#SET-PREFERENCES_btn{padding-bottom:18.6px;padding-right:20px;padding-left:20px;margin:auto}.clk-btn{display:block;border-radius:2.2px;height:30.4px;background-color:#238341;cursor:pointer;font-family:'Gotham 4r',GothamBold,Helvetica,Arial,sans-serif;font-size:13px;font-weight:700;font-style:normal;font-stretch:normal;line-height:.6px;letter-spacing:.5px;text-align:center;color:#fff;border:solid transparent;width:100%}.close{height:29px;width:17px;font-size:28px;cursor:pointer;color:#fff;font-weight:500;margin:2px}.div2_content{background-color:#e6f0ca;border-radius:0 0 .3rem .3rem}#z1-pd-yp-close{float:right;position:relative;right:8px;top:5px;width:15px;height:15px}#z1-pd-yp-close:before{transform:rotate(45deg);position:absolute;left:9px;content:' ';height:18px;width:1.5px;background-color:#fff}#z1-pd-yp-close:after{transform:rotate(-45deg);position:absolute;left:9px;content:' ';height:18px;width:1.5px;background-color:#fff}\";\n appendStyle(stylesPERF);\n var inHTMLStringPERF = \"\";\n inHTMLStringPERF = \"<div data-zineone-properties='modal:true;container-class:z1_b_container_kohlsbannertoparrow;' class='arrow_box'> <div id='detailsContentId'> <div class='box'> <div> <div class='cross'> <div style='width: 88%;'></div><div class='close' data-zineone-close='z1://close'><a data-zineone-close='z1://close' href='javascript:void(0);' id='z1-pd-yp-close'></a></div></div><div class='Kohls-Rewards-HZ-R '></div></div><div class='div2_content'> <div class='Want-more-of-what-yo'>Want more of what you love?</div><div class='Take-a-moment-to-tel'>Take a moment to tell<br>us who and what you<br>like to shop for.</div><div id='SET-PREFERENCES_btn'> <a href='/myaccount/v2/myinfo.jsp?z1_pref=1' > <input type='button' class='clk-btn' value='SET PREFERENCES'> </a> </div></div></div></div></div>\";\n perfParentDiv2.innerHTML = inHTMLStringPERF;\n perfParentDiv2.style.display = \"block\";\n\n /*let setPrefBtn = document.getElementById(\"SET-PREFERENCES_btn\");\n function setPrefBtnClick(){\n if (debug) console.log(\"setPreferenceBtnClicked..\");\n // alert('setPreferenceBtnClicked');\n setTimeout(function(){\n if (debug) console.log(\"TIMEOUT FUNCTION\");\n let setPrefEvent = new CustomEvent('setPreferenceBtnClicked', { detail: {} });\n document.dispatchEvent(setPrefEvent);\n },5000);\n\n }\n setPrefBtn.addEventListener(\"click\",setPrefBtnClick,false);*/\n let setPrefBtn = document.getElementById(\"SET-PREFERENCES_btn\");\n\n function setPrefBtnClick() {\n if (debug) console.log(\"setPreferenceBtnClicked..\");\n localStorage.setItem(\"z1_pref_clicked\", \"true\");\n\n }\n setPrefBtn.addEventListener(\"click\", setPrefBtnClick, false);\n\n var eventdata = {\n usecase: \"perk\",\n onPage: pgName\n };\n\n ZineOne.pushEvent(\"_ws_updatePerkPerfLastseen\", eventdata);\n sessionStorage.setItem(\"showPerfOnCouponPage\", \"true\");\n\n\n}\n\nfunction showPerk(argument) {\n // body...\n var perkParentDiv2 = document.getElementById(\"z1widget\");\n var stylesPERK = \".z1_b_container_kohlsbannertoparrow{background-color:transparent;padding:0!important;background-color:#238341}.arrow_box{position:relative;border:none;width:198px;border-radius:.3rem;left:-50px;top:0;height:262.3px;-webkit-box-shadow:0 0 2px 0 rgba(0,0,0,.08);-moz-box-shadow:0 0 2px 0 rgba(0,0,0,.08);box-shadow:0 0 2px 0 rgba(0,0,0,.08);background-size:75px,31px,57px;background-color:#238341}.arrow_box:after,.arrow_box:before{bottom:100%;left:45%;border:solid transparent;content:'';height:0;width:0;position:absolute;pointer-events:none}.arrow_box:after{border-color:rgba(255,255,255,0);border-bottom-color:#238341;border-width:8px;margin-left:auto}.arrow_box:before{border-color:rgba(191,191,191,0);border-bottom-color:#238341;border-width:8px;margin-left:auto}#detailsContentId{display:block;width:198px;padding:5px 0}.box{display:flex;flex-direction:column}.cross{display:flex;flex-direction:row;height:13px}.Kohls-Rewards-HZ-R{height:15.3px;color:#fff;margin-left:15%;margin-top:10px}.MEMBER-EXCLUSIVE{font-family:'Gotham 4r',GothamMedium,Helvetica,Arial,sans-serif;font-size:11px;font-weight:500;font-style:normal;font-stretch:normal;line-height:1.27;letter-spacing:-.1px;text-align:center;color:#fff;margin-right:auto;margin-left:auto;height:17.5px;width:143px}.gift{text-align:center;font-size:78px;color:#fff;margin:12.5px auto}.Your-birthdays-comi-outer-div{height:55.5px;width:143px;margin:auto}.Your-birthdays-comi{font-family:'Gotham 5r',GothamBold,Helvetica,Arial,sans-serif;font-size:18px;font-style:normal;font-stretch:normal;font-weight:500;line-height:1.06;letter-spacing:-.1px;text-align:center;color:#fff;margin-right:auto;margin-left:auto;height:55.5px;width:143px}#TREAT-YOURSELF_btn{padding-bottom:9px;margin:auto;width:158px}.clk-btn{display:block;border-radius:2.2px;height:30.4px;background-color:#fff;cursor:pointer;font-family:'gotham 4r';font-size:13px;font-weight:700;font-style:normal;font-stretch:normal;line-height:.6px;letter-spacing:.5px;text-align:center;color:#238341;border:solid transparent;width:100%}.close{padding-right:13px}.pick_ur_perk_btn{width:158.5px}.star1{position:absolute;top:17%;left:-1.9%;width:77px;height:89px;object-fit:contain}.star2{position:absolute;top:60.4%;left:-5%;width:40px;height:50px;object-fit:contain}.star3{position:absolute;top:35.8%;left:78.1%;width:57px;height:89px;object-fit:contain}#z1-pd-yp-close{float:right;position:relative;right:0;top:5px;width:15px;height:15px}#z1-pd-yp-close:before{transform:rotate(45deg);position:absolute;left:9px;content:' ';height:18px;width:1.5px;background-color:#fff}#z1-pd-yp-close:after{transform:rotate(-45deg);position:absolute;left:9px;content:' ';height:18px;width:1.5px;background-color:#fff}\";\n appendStyle(stylesPERK);\n var inHTMLStringPERK = \"\";\n inHTMLStringPERK = \"<div data-zineone-properties='modal:true;container-class:z1_b_container_kohlsbannertoparrow;' class='arrow_box'> <div id='detailsContentId'> <div class='box'> <div class='cross'> <div style='width: 89%;'></div><div class='close' data-zineone-close='z1://close'><a data-zineone-close='z1://close' href='javascript:void(0);' id='z1-pd-yp-close'></a></div></div><div class='Kohls-Rewards-HZ-R'><img src='https://d2p4r375zfkzm8.cloudfront.net/sandbox-kohlswebqa02-com/kohlsrewardshzr.png'></div><div class='MEMBER-EXCLUSIVE'>MEMBER EXCLUSIVE</div><div> <img class='star1' src='https://d2p4r375zfkzm8.cloudfront.net/sandbox-kohlswebqa02-com/group2x.png'> <img class='star2' src='https://d2p4r375zfkzm8.cloudfront.net/sandbox-kohlswebqa02-com/group3.3.png'> <img class='star3' src='https://d2p4r375zfkzm8.cloudfront.net/sandbox-kohlswebqa02-com/group2.3.png'> </div><div class='gift'><img src='https://d2p4r375zfkzm8.cloudfront.net/sandbox-kohlswebqa02-com/group3.png' class='Group-3'></div><div class='Your-birthdays-comi-outer-div'> <div class='Your-birthdays-comi'>Your birthday’s<br>coming up… </div></div><div id='TREAT-YOURSELF_btn'> <a href='/myaccount/kohls_rewards.jsp' > <input type='button' class='clk-btn' value='PICK YOUR PERK' class='pick_ur_perk_btn'> </a> </div><div class='Fill-20'></div></div></div></div>\";\n perkParentDiv2.innerHTML = inHTMLStringPERK;\n perkParentDiv2.style.display = \"block\";\n\n\n var eventdata = {\n usecase: \"perk\",\n onPage: pgName\n };\n\n ZineOne.pushEvent(\"_ws_updatePerkPerfLastseen\", eventdata);\n sessionStorage.setItem(\"showPerkOnCouponPage\", \"true\");\n\n}\n\nfunction handlePerkPerf(received_data) {\n\n if (debug) console.log('[Z1]SetCookie. ' + received_data.SetCookie);\n\n if (debug) console.log('[Z1]TTLperf. ' + received_data.perf_ttl);\n if (debug) console.log('[Z1]TTLperk. ' + received_data.perk_ttl);\n if (debug) console.log('[Z1]perk. ' + received_data.perk);\n if (debug) console.log('[Z1]perf. ' + received_data.perf);\n /*\n function setCookie(cname, cvalue, exdays) {\n if (debug) console.log('[Z1]cname. ' + cname);\n if (debug) console.log('[Z1]cvalue. ' + cvalue);\n if (debug) console.log('[Z1]exdays. ' + exdays);\n\n var d = new Date();\n d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));\n\n\n var expires = \"expires=\" + d.toGMTString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n }\n\n function getUTCTimeInMILLIS() {\n var now = new Date();\n var millis = now.getTime() + (now.getTimezoneOffset() * 60000);\n // var millis = now.getTime() + ((now.getTimezoneOffset() * 60000)+(5*86400000));\n return millis;\n }\n\n if (String(received_data.SetCookie) == \"true\") {\n var cvalue, cookie_expiry;\n\n var today = getUTCTimeInMILLIS();\n if (String(received_data.perf) == \"true\") {\n // cvalue=JSON.stringify({ \"perf\": \"true\", \"ttl\":String(received_data.perf_ttl)});\n cvalue = JSON.stringify({ \"perf\": \"false\", \"ttl_perf\": String(today) });\n\n cookie_expiry = Number(received_data.perf_ttl);\n }\n\n if (String(received_data.perk) == \"true\") {\n // cvalue=JSON.stringify({ \"perk\":\"true\", \"ttl\":String(received_data.perk_ttl)});\n cvalue = JSON.stringify({ \"perk\": \"false\", \"ttl_perk\": String(today) });\n cookie_expiry = Number(received_data.perk_ttl);\n }\n\n // cvalue=JSON.stringify({ \"perf\": received_data.perf, \"perk\": received_data.perk, \"ttl\":received_data.perk_ttl});\n //document.cookie = \"z1_perk_perf=\" + cvalue + \";\" + expires + \";path=/\";\n var cookie_name = \"z1_perk_perf\";\n var cookie_value = cvalue;\n\n\n if (debug) console.log('[Z1]cookie_name.B ' + cookie_name);\n if (debug) console.log('[Z1]cookie_value. ' + cookie_value);\n if (debug) console.log('[Z1]cookie_expiry. ' + cookie_expiry);\n\n //setCookie(cookie_name,cookie_value,4);\n setCookie(cookie_name, cookie_value, cookie_expiry);\n\n }*/\n\n\n}\n\n\nfunction getUTCTimeInMILLIS() {\n var now = new Date();\n // var millis = now.getTime() + (now.getTimezoneOffset() * 60000);\n // var millis = now.getTime() + ((now.getTimezoneOffset() * 60000)+(5*86400000));\n var millis = now.getTime();\n return millis;\n}\n\n\nfunction setCookie(cname, cvalue, exdays) {\n if (debug) console.log('[Z1]perkPerfCodeHandle cname. ' + cname);\n if (debug) console.log('[Z1]perkPerfCodeHandle cvalue. ' + cvalue);\n if (debug) console.log('[Z1]perkPerfCodeHandle exdays. ' + exdays);\n\n var d = new Date();\n d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));\n\n\n var expires = \"expires=\" + d.toGMTString();\n if (debug) console.log('[Z1]perkPerf################ ' + cname + \"=\" + JSON.stringify(cvalue) + \";\" + expires + \";path=/\");\n document.cookie = cname + \"=\" + JSON.stringify(cvalue) + \";\" + expires + \";path=/\";\n}\n\n\nfunction perkPerfCodeHandle(received_data) {\n var showPerkBanner = received_data.notification_ds.showPerk;\n var showPerfBanner = received_data.notification_ds.showPerf;\n var displayBannerTimer = received_data.notification_ds.bannerDisplay;\n\n if (debug) console.log('[Z1]perkPerfCodeHandle>>>>>>>>>>> received_data ' + received_data);\n if (debug) console.log('[Z1]perkPerfCodeHandle>>>>>>>>>>> notification_ds ' + received_data.notification_ds);\n if (debug) console.log('[Z1]perkPerfCodeHandle>>>>>>>>>>> cookie_ds ' + received_data.cookie_ds);\n\n if (debug) console.log('\\n\\n[Z1]perkPerfCodeHandle>>>>>>>>>>> notification_ds.showPerf ' + ((received_data.notification_ds.showPerf) == \"true\"));\n if (debug) console.log('[Z1]perkPerfCodeHandle>>>>>>>>>>> notification_ds.showPerk ' + ((received_data.notification_ds.showPerk) == \"true\"));\n if (debug) console.log('[Z1]perkPerfCodeHandle>>>>>>>>>>> notification_ds.bannerDisplay ' + received_data.notification_ds.bannerDisplay);\n if (debug) console.log('[Z1]################perkPerfCodeHandle############################ ');\n\n if (debug) console.log('[Z1]perkPerfCodeHandle?????? received_data isCookieSet' + received_data.cookie_ds.isCookieSet);\n if (debug) console.log('[Z1]perkPerfCodeHandle?????? received_data do we have to SetCookie?' + received_data.cookie_ds.SetCookie);\n\n\n if (String(received_data.cookie_ds.SetCookie) == \"true\") {\n\n var cvalue, cookie_expiry;\n var today = getUTCTimeInMILLIS();\n\n if ((String(received_data.cookie_ds.uc) == \"perk\") && (String(received_data.cookie_ds.usecase) == \"perk\")) {\n if (debug) console.log('[Z1] ONE PERK ');\n\n\n cvalue = {\n perk: \"false\",\n ttl_perk: Number(today)\n };\n\n cookie_expiry = Number(received_data.cookie_ds.ttl_perk);\n }\n\n\n if ((String(received_data.cookie_ds.uc) == \"perf\") && (String(received_data.cookie_ds.usecase) == \"perf\")) {\n if (debug) console.log('[Z1] ONE PERF ');\n\n\n cvalue = {\n perf: \"false\",\n ttl_perf: Number(today)\n };\n\n cookie_expiry = Number(received_data.cookie_ds.ttl_perf);\n }\n\n if (String(received_data.cookie_ds.uc) == \"both\") {\n\n if (debug) console.log('[Z1] BOTH ');\n\n\n\n\n if (received_data.cookie_ds.onBothList == \"true\") {\n if (debug) console.log('[Z1]perkPerfCodeHandle?????? onBothList? Double COOKIE value ');\n //if (debug) console.log('[Z1]perkPerfCodeHandle?????? onBothList? Double COOKIE value uc '+uc);\n //if (debug) console.log('[Z1]perkPerfCodeHandle?????? onBothList? Double COOKIE value usecase '+usecase);\n if ((String(received_data.cookie_ds.usecase) == \"perk\")) {\n cvalue = {\n perf: \"false\",\n ttl_perf: Number(today),\n perk: \"false\",\n ttl_perk: Number(today)\n };\n cookie_expiry = Number(received_data.cookie_ds.ttl_perk);\n\n }\n\n if ((String(received_data.cookie_ds.usecase) == \"perf\")) {\n cvalue = {\n perf: \"false\",\n ttl_perf: Number(today),\n perk: \"true\",\n ttl_perk: Number(today)\n };\n cookie_expiry = Number(received_data.cookie_ds.ttl_perf);\n\n }\n\n } else {\n if (debug) console.log('[Z1]perkPerfCodeHandle?????? onBothList? Double COOKIE value false ');\n if ((String(received_data.cookie_ds.uc) == \"both\") && (String(received_data.cookie_ds.usecase) == \"perk\")) {\n if (debug) console.log('[Z1] ONE PERK ');\n\n\n cvalue = {\n perk: \"false\",\n ttl_perk: Number(today)\n };\n\n cookie_expiry = Number(received_data.cookie_ds.ttl_perk);\n }\n\n\n\n if ((String(received_data.cookie_ds.uc) == \"both\") && (String(received_data.cookie_ds.usecase) == \"perf\")) {\n if (debug) console.log('[Z1] ONE PERF ');\n\n\n cvalue = {\n perf: \"false\",\n ttl_perf: Number(today)\n };\n\n cookie_expiry = Number(received_data.cookie_ds.ttl_perf);\n }\n }\n }\n\n\n\n if (debug) console.log('[Z1]perkPerfCodeHandle?????? COOKIE value to set ' + cvalue);\n if (debug) console.log('[Z1]perkPerfCodeHandle?????? COOKIE value to set cookie_expiry:' + cookie_expiry);\n\n\n var cookie_name = \"z1_perk_perf\";\n var cookie_value = cvalue;\n\n\n if (debug) console.log('[Z1]perkPerfCodeHandle?????? cookie_name.B ' + cookie_name);\n if (debug) console.log('[Z1]perkPerfCodeHandle?????? cookie_value. ' + cookie_value);\n if (debug) console.log('[Z1]perkPerfCodeHandle?????? cookie_expiry. ' + cookie_expiry);\n\n //setCookie(cookie_name,cookie_value,4);\n setCookie(cookie_name, cookie_value, cookie_expiry);\n\n\n\n }\n\n\n\n\n\n\n\n\n if (debug) console.log('[Z1]################perkPerfCodeHandle############################ ');\n\n\n\n\n\tvar cust_id_non_numeric=localStorage.getItem('dataLayerCustomerDetails');\n\tvar isGuestUser_id = false;\n if(isValid(cust_id_non_numeric)){\n isGuestUser_id=isNaN(JSON.parse(cust_id_non_numeric).customerID);\n\n }\n if (!isGuestUser_id && showPerkBanner == \"true\" && displayBannerTimer == \"false\" ) {\n if (pgName == \"Home\") {\n showPerk();\n }\n }\n\n if (!isGuestUser_id && showPerfBanner == \"true\" && displayBannerTimer == \"false\") {\n if (pgName == \"Home\") {\n showPerf();\n }\n }\n\n\n}\n\nfunction getBirthdayCookie(cname) {\n var name = cname + \"=\";\n var decodedCookie = decodeURIComponent(document.cookie);\n var ca = decodedCookie.split(';');\n for (var i = 0; i < ca.length; i++) {\n var c = ca[i];\n while (c.charAt(0) == ' ') {\n c = c.substring(1);\n }\n if (c.indexOf(name) == 0) {\n return c.substring(name.length, c.length);\n }\n }\n return;\n}\nvar delete_cookie = function(name) {\n document.cookie = name + '=;expires=Thu, 01 Jan 1970 00:00:01 GMT;';\n};\n\n\ntry {\n\n //if (debug) console.log(\" [Z1] Pagedata*****************************\"+pagedata);\n\n if (debug) console.log(\" [Z1] perk_perf_tag_test*****************************\");\n\n if (isValid(pageData.customerDetails)) {\n if (pageData.customerDetails.isLoggedIn == \"false\") {\n if (debug) console.log(\"[Z1]delete cookie for logged out user1\");\n try {\n if (debug) console.log(\"[Z1]delete cookie for logged out user2\");\n delete_cookie('z1_perk_perf');\n\n\n var perkOnCouponPage = sessionStorage.getItem(\"showPerkOnCouponPage\");\n if(isValid(perkOnCouponPage)){\n sessionStorage.removeItem(\"showPerkOnCouponPage\");\n }\n\n var perfOnCouponPage = sessionStorage.getItem(\"showPerfOnCouponPage\");\n if(isValid(perfOnCouponPage)){\n sessionStorage.removeItem(\"showPerfOnCouponPage\");\n }\n\n\n\n } catch (del) {\n if (debug) console.log(\"[Z1] no cookie for logged out user\");\n }\n }\n }\n\n var pg = Z1.window.browserInfo.pagePath;\n var pgName = \"unknownPage\";\n // if (isDebug) if (debug) console.log(\"[ZineOne] Page Name ==>\" + pg);\n if (pg == \"/\") {\n pgName = \"Home\";\n } else if (pg.startsWith(\"/product\")) {\n pgName = \"PDP\";\n } else if (pg.startsWith(\"/catalog\")) {\n pgName = \"PMP\";\n } else if (pg.startsWith(\"/search\")) {\n pgName = \"Search\";\n } else if (pg.startsWith(\"/myaccount/kohls_rewards.jsp\")) {\n pgName = \"Rewards\";\n // ZineOne.pushEvent(\"Perk_Perf_Event\", {});\n\n } else if (pg.startsWith(\"/myaccount/v2/myinfo.jsp\")) {\n\n pgName = \"myInfo\";\n // ZineOne.pushEvent(\"Perk_Perf_Event\", {});\n\n } else if (pg.startsWith(\"/wallet/my_wallet.jsp\")) {\n pgName = \"Wallet\";\n\n\n } else if (pg.startsWith(\"/upgrade/giftinglisting/wishlist.jsp\")) {\n pgName = \"Wishlist\";\n\n } else if (pg.startsWith(\"/myaccount/v2/order-history.jsp\")) {\n pgName = \"OrderHistory\";\n\n\n } else if (pg.startsWith(\"/sale-event/coupons-deals.jsp\")) {\n pgName = \"Coupons\";\n }\n if (pg.startsWith(\"/?DPSLogout=true\")) {\n pgName = \"Logout\";\n } else if (pg.startsWith(\"/checkout\")) {\n pgName = \"Cart\";\n if (pg.endsWith(\"shopping_cart.jsp\")) {\n pgName = \"Cart\";\n } else if (pg.endsWith(\"v2/checkout.jsp\")) {\n pgName = \"Checkout\";\n }\n }\n\n //if logged out unset seeion variable\n var loggedout = document.URL;\n\n function getBirthdayCookie(cname) {\n var name = cname + \"=\";\n var decodedCookie = decodeURIComponent(document.cookie);\n var ca = decodedCookie.split(';');\n for (var i = 0; i < ca.length; i++) {\n var c = ca[i];\n while (c.charAt(0) == ' ') {\n c = c.substring(1);\n }\n if (c.indexOf(name) == 0) {\n return c.substring(name.length, c.length);\n }\n }\n return;\n }\n var birthday_cookie_flag = '';\n var cookie_title = \"z1_perk_perf\";\n var birthday_cookie = getBirthdayCookie(cookie_title);\n if (isValid(birthday_cookie)) {\n birthday_cookie_flag = birthday_cookie;\n } else {\n birthday_cookie_flag = '';\n }\n var isPerkSelected=false;\n var isPerfSelected=false;\n if(birthday_cookie_flag != ''){\n var parsedBirthCookie = JSON.parse(birthday_cookie_flag);\n if(parsedBirthCookie && parsedBirthCookie.perk){\n isPerkSelected= String(parsedBirthCookie.perk) == \"true\" ? true : false;\n }\n if(parsedBirthCookie && parsedBirthCookie.perf){\n isPerfSelected= String(parsedBirthCookie.perf) == \"true\" ? true : false;\n }\n }\n if (isPerkSelected) {\n sessionStorage.removeItem('showPerkOnCouponPage');\n }\n if (isPerfSelected) {\n sessionStorage.removeItem('showPerfOnCouponPage');\n }\n if ((loggedout.endsWith(\"/?DPSLogout=true\")) ) {\n\n // var customer=JSON.parse(localStorage.getItem(z1_cust_id));\n var cookie_title = \"z1_perk_perf\";\n // if (debug) console.log(\"[Z1]This user logged out>>>$$$$\",customer);\n delete_cookie('z1_perk_perf');\n // var birthday_cookie = getBirthdayCookie(cookie_title);\n //if (debug) console.log(\"[Z1] READ birthday_cookie on Logout page\" + birthday_cookie);\n\n var sess1 = sessionStorage.getItem(\"showPerkOnCouponPage\");\n if (sess1 == \"true\") {\n sessionStorage.removeItem('showPerkOnCouponPage');\n }\n\n\n\n var sess2 = sessionStorage.getItem(\"showPerfOnCouponPage\");\n if (sess2 == \"true\") {\n sessionStorage.removeItem('showPerfOnCouponPage');\n }\n }\n\n\n\n\n if (debug) console.log(\"perk_perfCodeHandler...pgName:::\" + pgName);\n\n\n /*var birthday_perk_perfCodeHandler = function(e) {\n if (debug) console.log(\"birthday_perk_perfCodeHandler...\", e);\n if (debug) console.log(\"e.detail...\", e.detail);\n // localStorage.setItem(\"z1_ws_birthday_perk_perf_tag_data\", JSON.stringify(e.detail));\n handlePerkPerf(e.detail);\n\n };\n\n\n document.addEventListener(\"ws_birthday_perk_perf\", birthday_perk_perfCodeHandler, false);*/\n\n\n if (pgName == \"myInfo\") {\n // alert('setPreferenceBtnClicked...myInfo 2');\n if (debug) console.log(\"setPreferenceBtnClicked...myInfo 2\");\n // alert('setPreferenceBtnClickedHandler...myInfo 3');\n /* let locn=window.location.href;\n if(locn.includes(\"/myaccount/v2/myinfo.jsp?z1_pref=1\")){\n var element = document.getElementById(\"leftInfoItem\");\n element.getElementsByTagName(\"li\")[0].classList.remove(\"selected\");\n element.getElementsByTagName(\"li\")[3].classList.add(\"selected\");\n var t = document.getElementsByClassName(\"shoppingPref\");\n t[0].children[0].click();\n\n }*/\n\n let ls_z1_pref_clicked = localStorage.getItem('z1_pref_clicked');\n\n if (isValid(ls_z1_pref_clicked) && String(ls_z1_pref_clicked) == \"true\") {\n\n if (debug) console.log(\"z1_pref_clicked val from ls\" + ls_z1_pref_clicked);\n var element = document.getElementById(\"leftInfoItem\");\n element.getElementsByTagName(\"li\")[0].classList.remove(\"selected\");\n element.getElementsByTagName(\"li\")[3].classList.add(\"selected\");\n var t = document.getElementsByClassName(\"shoppingPref\");\n t[0].children[0].click();\n localStorage.removeItem('z1_pref_clicked');\n if (debug) console.log(\"z1_pref_clicked val from ls removed\");\n }\n\n }\n\n if (pgName == \"Rewards\") {\n\n /* var showdivs = String(sessionStorage.getItem(\"showPerkOnCouponPage\"));\n isValid(showdivs);\n if (debug) console.log(\"showdivs\", showdivs);\n\n if (isValid(showdivs)) {\n if (showdivs) {\n if (debug) console.log(\"showdivs\", showdivs);\n perkPerfBanners();\n }\n }*/\n }\n\n if (pgName == \"Coupons\") {\n\n /* var showdivs1 = String(sessionStorage.getItem(\"showPerkOnCouponPage\"));\n // isValid(showdivs1);\n if (debug) console.log(\"Coupons pages showdivs>>>>\",showdivs1);\n\n if (isValid(showdivs1)) {\n if (showdivs1) {\n if (debug) console.log(\"showdivs1\",showdivs1);\n perkPerfBannersCouponPage();\n }\n }*/\n\n\n\n var showdivs1 = String(sessionStorage.getItem(\"showPerkOnCouponPage\"));\n\n if (debug) console.log(\"Coupons pages showdivs>>>>\", showdivs1);\n\n if (showdivs1 == \"true\") {\n\n if (debug) console.log(\"showdivs1\", showdivs1);\n perkPerfBannersCouponPage();\n var cusId = pageData.customerDetails.customerID;\n\n //if (debug) console.log('Before Condition Check',prop75Obj.prop75,cusId);\n\n if (cusId) {\n //if (debug) console.log('Inside s.tl Omniture ',prop75Obj.prop75);\n\n var eVar39 = cusId;\n s.tl(this, 'o', 'ZineOne Impression', {\n linkTrackVars: 'prop75,eVar39',\n prop75: \"w>z1bdayperk>b|cp\",\n eVar39: eVar39\n });\n\n }\n\n }\n\n\n\n var showdivs2 = sessionStorage.getItem(\"showPerfOnCouponPage\");\n // isValid(showdivs2);\n if (debug) console.log(\"Coupons pages showdivs2>>>>\", showdivs2);\n\n if (showdivs2 == \"true\") {\n\n if (debug) console.log(\"showdivs2\", showdivs2);\n\n perkPerfBannersCouponPage2();\n var cusId = pageData.customerDetails.customerID;\n if (cusId) {\n //if (debug) console.log('Inside s.tl Omniture ',prop75Obj.prop75);\n\n var eVar39 = cusId;\n s.tl(this, 'o', 'ZineOne Impression', {\n linkTrackVars: 'prop75,eVar39',\n prop75: \"w>z1completeprof>b|cp\",\n eVar39: eVar39\n });\n\n }\n\n\n\n }\n\n\n }\n\n\n\n /* var perkPerfCodeHandler = function(f) {\n if (debug) console.log(\"birthday_perk_perfCodeHandler...New\", f);\n if (debug) console.log(\"f.detail...\", f.detail);\n localStorage.setItem(\"z1_ws_birthday_perk_perf_tag_data NEW\", JSON.stringify(f.detail));\n // handlePerkPerf(e.detail);\n perkPerfCodeHandle(f.detail);\n\n };\n document.addEventListener(\"ws_PerkPerfdata\", perkPerfCodeHandler, false);*/\n\n var z1ResponseHandler = function(e) {\n if (debug) console.log(\"birthday_perk_perfCodeHandler..\");\n if (e.detail && e.detail.PerkPerfdata) {\n if (debug) console.log(\"birthday_perk_perfCodeHandler...New\", e);\n if (debug) console.log(\"e.detail...\", e.detail.PerkPerfdata);\n localStorage.setItem(\"z1_ws_birthday_perk_perf_tag_data NEW\", JSON.stringify(e.detail.PerkPerfdata));\n perkPerfCodeHandle(e.detail.PerkPerfdata);\n // localStorage.setItem(\"z1_emailOptIn_data\", JSON.stringify(e.detail.emailOptInOfferCode));\n // handleEmailOptIn(e.detail.emailOptInOfferCode);\n }\n };\n document.addEventListener(\"onZ1RawData\", z1ResponseHandler, false);\n\n\n\n} catch (e) {\n console.log(\"Error in perk_perf_tag = \", e);\n}\n","eventName":"load","pageSelector":{"type":"all","condition":"equals","val":""}},{"tagName":"shopToRoundUpV2","actionType":"z1script","script":"var isDebug = false;\nvar __debug = false;\n\nfunction isValid(datapoint) {\n if (!datapoint || typeof datapoint == 'undefined' || datapoint == undefined || datapoint === undefined || String(datapoint) === 'undefined' || datapoint == \"null\" || datapoint == null) {\n returnObj.reason = \"invalid input\";\n return false;\n } else {\n return true;\n }\n}\n\n/*\nvar debug_log = function(msg) {\n if (__debug) {\n console.log(\"debug_ShopToRoundUpDataV2::\" + msg);\n \n }\n};*/\n\nfunction debug_log(...args) {\n if (isDebug) {\n console.log(\"debug_ShopToRoundUpDataV2::\");\n console.log.apply(this, args);\n }\n}\n\nfunction appendStyle(styles) {\n var css = document.createElement('style');\n css.type = 'text/css';\n\n if (css.styleSheet) css.styleSheet.cssText = styles;\n else css.appendChild(document.createTextNode(styles));\n\n document.getElementsByTagName(\"head\")[0].appendChild(css);\n}\n\n\nfunction showShopRoundUpV2OnCoupon(cpn) {\n\n\n var shopRoundUpV2CouponBannersDiv = document.getElementById('monetizationElements');\n console.log(\"shopRoundUpV2CouponBannersDiv>>>\", shopRoundUpV2CouponBannersDiv)\n\n console.log(\"cpn date:\" + cpn.ends_in);\n var cpn_ends_in = cpn.ends_in;\n\n var styleShowShopRoundUpV2OnCouponPage = ` #strup-container{padding: 10px; background-color: #eef7e6; font-family: 'Gotham 4r', 'GothamMedium', Helvetica, Arial, sans-serif; font-size: 11px; position: relative}\n #strup-container #strup_header {margin-bottom: 5px}\n #strup-container #strup-coupon-Rewards-Lockup-Horizontal {position: absolute; right: 0px; top: 0px}\n #strup-container #strup-coupon-Cant-wait-to-hit-yo{font-size: 15px;font-family: 'Gotham 7r', 'GothamBold', Helvetica, Arial, sans-serif;}\n #strup-container .green-text {color: #208033;}\n #strup-container .bold-text {font-family: 'Gotham 7r', 'GothamBold', Helvetica, Arial, sans-serif;}\n \n #strup-container .strup-coupon-dollar_reward_content {display: flex; font-size: 26px; align-items: flex-start;}\n #strup-container .strup-coupon-dollar_reward_content .offer_currency {margin-right: 48px}\n #strup-container .strup-coupon-dollar_reward_content .offer_value {font-size: 68px; transform: translateY(-25%); position: absolute; left: 30px;}\n #strup-container .strup-coupon-Spend-25-or-more-in {margin-bottom: 10px;}\n #strup-container .strup-coupon-footer {margin: 0px 0px 0px 65px;font-weight: bold;}`;\n appendStyle(styleShowShopRoundUpV2OnCouponPage);\n\n\n\n var innerHTMLshowShopRoundUpV2OnCouponPage = \"\";\n innerHTMLshowShopRoundUpV2OnCouponPage = `<div class=\"strup-coupon-Rectangle\" id=\"strup-container\">\n <div id=\"strup_header\">\n <div id=\"inboxHeader_1\">\n <div id=\"strup-coupon-Rewards-Lockup-Horizontal\" class=\"strup-coupon-Rewards-Lockup-Horizontal\"><img style=\"height: 25px;\" src=\"/account/media/images/loyaltyV2/kohls-rewards.png\"></div>\n </div>\n <div id=\"inboxHeader_2\">\n <div id=\"strup-coupon-Cant-wait-to-hit-yo\" class=\"strup-coupon-Cant-wait-to-hit-yo\">Can't wait to hit your next</div>\n </div>\n </div>\n <div class=\"strup-coupon-dollar_reward\">\n <div class=\"strup-coupon-dollar_reward_content green-text bold-text\">\n \n <div class=\"offer_currency\">$</div>\n <div class=\"offer_value\">5</div>\n <div class=\"offer_text\">reward?</div>\n </div>\n <div class=\"strup-coupon-footer\">\n <div class=\"strup-coupon-Spend-25-or-more-in\">Spend $25 or more in-store or online. We'll add $2.50<br> to your Kohl's Rewards balance to get you there.</div>\n <div class=\"strup-coupon-Ends-August-20\">Ends ${cpn_ends_in}</div>\n <div class=\"strup-coupon-details-exclusions\"><u>details & exclusions</u></div>\n </div>\n </div>\n </div> `;\n\n\n\n var child = document.createElement(\"div\");\n child.innerHTML = innerHTMLshowShopRoundUpV2OnCouponPage;\n child.style = \"margin:24px;display:flex;float:right\";\n shopRoundUpV2CouponBannersDiv.appendChild(child);\n\n\n\n}\n\nfunction showShopRoundUpV2OnHome(hm) {\n var hm_ends_in = hm.ends_in;\n\n var showShopRoundUpV2OnHomeDiv = document.getElementById(\"z1widget\");\n var stylesShopRoundUpV2OnHomePage = `.z1_b_container_kohlsbannertoparrow {\n background-color: transparent;\n padding: 0px !important;\n \n }\n\n\n .arrow_box {\n position: relative;\n padding: 0px;\n \n border: none;\n width: 265px;\n border-radius: 0.3rem;\n left: -173px;\n top: 0px;\n height: 312px;\n\n -webkit-box-shadow: 0px 0px 2px 0px rgba(0, 0, 0, 0.08);\n -moz-box-shadow: 0px 0px 2px 0px rgba(0, 0, 0, 0.08);\n box-shadow: 0px 0px 2px 0px rgba(0, 0, 0, 0.08);\n background-size: 75px, 31px, 57px;\n background-color: #eef7e6;\n }\n\n .arrow_box:after,\n .arrow_box:before {\n bottom: 100%;\n left: 45%;\n border: solid transparent;\n content: \" \";\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none;\n }\n\n .arrow_box:after {\n border-color: rgba(255, 255, 255, 0);\n border-bottom-color: #eef7e6;\n border-width: 8px;\n margin-left: auto;\n }\n\n .arrow_box:before {\n border-color: rgba(191, 191, 191, 0);\n border-bottom-color: #eef7e6;\n border-width: 8px;\n margin-left: auto;\n }\n\n \n\n .box {\n display: flex;\n flex-direction: column;\n }\n\n .cross {\n display: flex;\n flex-direction: row;\n }\n\n #z1-pd-yp-close {\n float: right;\n position: relative;\n right: 0px;\n top: 10px;\n width: 15px;\n height: 15px;\n }\n #z1-pd-yp-close:before{\n transform: rotate(45deg);\n position: absolute;\n left: 9px;\n content: ' ';\n height: 18px;\n width: 1.5px;\n background-color: #474747;\n }\n\n #z1-pd-yp-close:after {\n transform: rotate(-45deg);\n position: absolute;\n left: 9px;\n content: ' ';\n height: 18px;\n width: 1.5px;\n background-color: #474747;\n }\n \n .Rewards-Lockup-Horizontal {\n width: 239px;\n height: 44px;\n object-fit: contain;\n margin-left: auto;\n margin-right: auto;\n \n \n }\n .Rewards-Lockup-Horizontal-image {\n width: 239px;\n height: 44px;\n object-fit: contain;\n \n \n }\n \n\n .MEMBER-EXCLUSIVE {\n width: 149px;\n height: 17px;\n font-family: 'Gotham 4r', 'GothamMedium', Helvetica, Arial, sans-serif;\n font-size: 11px;\n font-weight: normal;\n font-style: normal;\n font-stretch: normal;\n line-height: normal;\n letter-spacing: 2px;\n margin-right: auto;\n margin-left: auto;\n color: #444444;\n\t position: relative;\n top: -12px;\n }\n .Cant-wait-to-hit-yo {\n width: 203px;\n height: 16px;\n font-family: 'Gotham 7r', 'GothamBold', Helvetica, Arial, sans-serif;\n font-size: 15px;\n font-weight: 500;\n font-style: normal;\n font-stretch: normal;\n line-height: normal;\n letter-spacing: normal;\n text-align: center;\n color: #222222;\n margin: 0px 30px 0px 30px;\n }\n\n .dollar_reward {\n font-family: 'Gotham 7r', 'GothamBold', Helvetica, Arial, sans-serif;\n font-weight: bold;\n font-style: normal;\n font-stretch: normal;\n line-height: normal;\n letter-spacing: normal;\n text-align: center;\n color: #208033;\n margin-bottom: 10px;\n margin-top: 5px;\n \n}\n\n.dollar_reward_content {\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n margin-top: -12px;\n margin-bottom: -12px;\n}\n.Spend-25-or-more-in {\n width: 174px;\n height: 36px;\n font-family: 'Gotham 5r', 'GothamMedium', Helvetica, Arial, sans-serif;\n font-size: 15px;\n font-weight: 500;\n font-style: normal;\n font-stretch: normal;\n line-height: 1.2;\n letter-spacing: normal;\n text-align: center;\n color: #222222;\n margin-right: auto;\n margin-left: auto;\n}\n\n.Well-add-250-to-y {\n width: 240px;\n height: 26px;\n font-family: 'Gotham 5r', 'GothamMedium', Helvetica, Arial, sans-serif;\n font-size: 11px;\n font-weight: 500;\n font-style: normal;\n font-stretch: normal;\n line-height: 1.18;\n letter-spacing: normal;\n text-align: center;\n color: #222222;\n margin-top: 15px;\n margin-left: auto;\n margin-right: auto;\n margin-bottom: 15px; \n}\n.Ends-August-20 {\n width: 96px;\n \n font-family: 'Gotham 5r', 'GothamMedium', Helvetica, Arial, sans-serif;\n font-size: 9px;\n font-weight: 500;\n font-style: normal;\n font-stretch: normal;\n line-height: 1.78;\n letter-spacing: normal;\n text-align: center;\n color: #222222;\n margin: auto;\n}\n.details-exclusions {\n width: 89px;\n height: 9px;\n font-family: 'Gotham 5r', 'GothamMedium', Helvetica, Arial, sans-serif;\n font-size: 9px;\n font-weight: bold;\n font-style: normal;\n font-stretch: normal;\n line-height: normal;\n letter-spacing: normal;\n text-align: center;\n color: #222222;\n margin: auto;\n}`;\n appendStyle(stylesShopRoundUpV2OnHomePage);\n var inHTMLShopRoundUpV2OnHomePage = \"\";\n inHTMLShopRoundUpV2OnHomePage = `<div data-zineone-properties=\"modal:true;container-class:z1_b_container_kohlsbannertoparrow;\" class=\"arrow_box\">\n \n \n <div class=\"box\">\n <div class=\"cross\">\n <div style=\"width: 89%;\"></div>\n \n <div class=\"close\" data-zineone-close=\"z1://close\"><a data-zineone-close=\"z1://close\" href=\"javascript:void(0);\" id=\"z1-pd-yp-close\"></a></div>\n </div>\n <div class=\"Rewards-Lockup-Horizontal\"><img class=\"Rewards-Lockup-Horizontal-image\" src=\"/account/media/images/loyaltyV2/kohls-rewards.png\"><!--<span class=\"kr\">KOHL'S REWARDS</span>--></div>\n <div class=\"MEMBER-EXCLUSIVE\">MEMBER EXCLUSIVE</div>\n <div class=\"Cant-wait-to-hit-yo\">Can’t wait to hit your next</div>\n <div class=\"dollar_reward\">\n <div class=\"dollar_reward_content\">\n <div style=\"font-size: 28px;margin-top: auto; margin-bottom: auto;font-weight: initial;\">$</div>\n <div style=\"font-size: 75.5px;font-weight: initial; margin-right: 3px;\">5</div>\n <div style=\"font-size: 28px;margin-top: auto; margin-bottom: auto;font-weight: initial;\"> reward?</div>\n \n </div>\n \n </div>\n <div class=\"Spend-25-or-more-in\">Spend $25 or more<br>in-store or online.</div>\n <div class=\"Well-add-250-to-y\">We’ll add $2.50 to your Kohl’s Rewards<br>balance to get you there. </div>\n\n <div class=\"Ends-August-20\">Ends ${hm_ends_in}.</div>\n <div class=\"details-exclusions\"><a style=\"color: #222222;font-weight: 500;\" target=\"_blank\" href=\"/ecom/OnlineOnly/BONUSPOINTS.html\"><u>details & exclusions</u></a></div>\n\n \n </div>\n </div>`;\n\n showShopRoundUpV2OnHomeDiv.innerHTML = inHTMLShopRoundUpV2OnHomePage;\n showShopRoundUpV2OnHomeDiv.style.display = \"block\";\n\n var cusId = pageData.customerDetails.customerID;\n\n if (cusId) {\n //console.log('Inside s.tl Omniture ',prop75Obj.prop75);\n var eVar39 = cusId;\n if(hm.pageName==\"Home\"){\n \n \ts.tl(this, 'o', 'ZineOne Impression', {\n \tlinkTrackVars: 'prop75,eVar39',\n \tprop75: \"w>z1rewardsrndup|b|hp\",\n \teVar39: eVar39\n });\n }\n if(hm.pageName==\"PMP\"){\n \n \ts.tl(this, 'o', 'ZineOne Impression', {\n \tlinkTrackVars: 'prop75,eVar39',\n \tprop75: \"w>z1rewardsrndup|b|pmp\",\n \teVar39: eVar39\n });\n }\n if(hm.pageName==\"PDP\"){\n \n \ts.tl(this, 'o', 'ZineOne Impression', {\n \tlinkTrackVars: 'prop75,eVar39',\n \tprop75: \"w>z1rewardsrndup|b|pdp\",\n \teVar39: eVar39\n });\n }\n\n \n\n }\n\n\n\n}\n\nfunction showShopRoundUpV2OnRewards(rwd) {\n\n var shopRoundUpV2OnRewards_replacer = document.getElementsByClassName('background-square-invite-friend kas-background-square-invite-friend');\n shopRoundUpV2OnRewards_replacer[0].style.display = 'none';\n\n\n (\"background-square-invite-friend kas-background-square-invite-friend\");\n\n var showShopRoundUpV2OnRewardsBannersDiv = document.getElementById('inviteFriendAndShopPrefContainer');\n console.log(\"showShopRoundUpV2OnRewards>>>\", showShopRoundUpV2OnRewards);\n\n console.log(\"rwd date:\" + rwd.ends_in);\n var rwd_ends_in = rwd.ends_in;\n\n\n var styleShowShopRoundUpV2OnRewardsPage = `.stru-rewards-Rectangle {\n width: 341px;\n height: 244px;\n border: solid 1px #d3e6d7;\n background-color: #eef7e6;\n}\n.stru-rewards-Cant-wait-to-hit-yo {\n /* width: 203px;\n height: 15px;*/\n font-family:'GothamBold', Helvetica, Arial, sans-serif;\n font-size: 15px;\n font-weight: bold;\n font-style: normal;\n font-stretch: normal;\n line-height: normal;\n letter-spacing: normal;\n text-align: center;\n color: #222222;\n margin-left: auto;\n margin-right: auto; \n margin-top: 6px;\n\n}\n.stru-rewards-Rewards-Lockup-Horizontal {\n width: 239px;\n height: 44px;\n object-fit: contain;\n margin:auto;\n }\n .stru-rewards-dollar_reward {\n font-family:'GothamBold', Helvetica, Arial, sans-serif;\n font-weight: bold;\n font-style: normal;\n font-stretch: normal;\n line-height: normal;\n letter-spacing: normal;\n text-align: center;\n color: #208033;\n margin-bottom: 10px;\n margin-top: 10px;\n \n}\n\n.stru-rewards-dollar_reward_content {\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n margin-top: -12px;\n margin-bottom: -12px;\n}\n.stru-rewards-Spend-25-or-more-in {\n width: 280px;\n height: 48px;\n font-family: Gotham-Medium, Helvetica, Arial, sans-serif;\n font-size: 13px;\n font-weight: bold;\n font-style: normal;\n font-stretch: normal;\n line-height: 1.23;\n letter-spacing: normal;\n text-align: center;\n color: #222222;\n margin-top: 18px;\n margin-bottom: 12px;\n margin-left: auto;\n margin-right: auto;\n}\n.stru-rewards-Shop-Now {\n width: 68px;\n height: 13px;\n font-family: Gotham-Medium, Helvetica, Arial, sans-serif;\n font-size: 13px;\n font-weight: bold;\n font-style: normal;\n font-stretch: normal;\n line-height: normal;\n letter-spacing: normal;\n color: #222222;\n margin-left: auto;\n margin-right: auto;\n}\n.stru-rewards-Ends-August-20 {\n width: 96px;\n height: 16px;\n font-family: Gotham-Medium, Helvetica, Arial, sans-serif;\n font-size: 9px;\n font-weight: bold;\n font-style: normal;\n font-stretch: normal;\n line-height: 1.78;\n letter-spacing: normal;\n color: #222222;\n position: relative;\n left: -85px;\n}\n.stru-rewards-details-exclusions {\n width: 89px;\n height: 9px;\n font-family: Gotham-Medium, Helvetica, Arial, sans-serif;\n font-size: 9px;\n font-weight: bold;\n font-style: normal;\n font-stretch: normal;\n line-height: normal;\n letter-spacing: normal;\n color: #222222;\n position: relative;\n left: 72px;\n cursor: pointer;\n}\n.stru-rewards-footer\n{\n display: inline-flex;\n margin-bottom: 12px;\n margin-top: 12px;\n}\n.stru-rewards-kr-img{\n width: 250px;\n\n}\n`;\n appendStyle(styleShowShopRoundUpV2OnRewardsPage);\n\n //inviteFriendAndShopPrefContainer\n\n var innerHTMLshowShopRoundUpV2OnRewardsPage = \"\";\n innerHTMLshowShopRoundUpV2OnRewardsPage = `<div class=\"stru-rewards-Rectangle\">\n <div>\n <div class=\"stru-rewards-Rewards-Lockup-Horizontal\"><img class=\"stru-rewards-kr-img\" src=\"/account/media/images/loyaltyV2/kohls-rewards.png\"></div>\n <div class=\"stru-rewards-Cant-wait-to-hit-yo\">Can’t wait to hit your next</div>\n <div class=\"stru-rewards-dollar_reward\">\n <div class=\"stru-rewards-dollar_reward_content\">\n <div style=\"font-size: 25.2px;margin-top: auto;width: 17px;height: 25px;margin-bottom: auto;\">$</div>\n <div style=\"font-size: 68px;width: 43px;height: 68px;\">5</div>\n <div style=\"font-size: 25.2px;margin-top: auto;margin-bottom: auto;width: 103px;height: 25px;\"> reward?</div>\n \n \n \n </div>\n <div class=\"stru-rewards-Spend-25-or-more-in\">\n Spend $25 or more in-store or online.<br> We’ll add $2.50 to your Kohl’s Rewards<br> balance to get you there. \n </div>\n <div class=\"stru-rewards-Shop-Now\"><u>Shop Now</u></div>\n <div class=\"stru-rewards-footer\">\n <div class=\"stru-rewards-Ends-August-20\">Ends `;\n innerHTMLshowShopRoundUpV2OnRewardsPage += rwd_ends_in + `</div>\n <div class=\"stru-rewards-details-exclusions\" onclick=\"location.href='/ecom/OnlineOnly/BONUSPOINTS.html';\" ><u>details & exclusions</u></div>\n </div>\n </div>\n\n \n </div>\n </div> `;\n\n\n var child = document.createElement(\"div\");\n child.innerHTML = innerHTMLshowShopRoundUpV2OnRewardsPage;\n child.style = \"margin-right: 26px\";\n showShopRoundUpV2OnRewardsBannersDiv.appendChild(child);\n\n var cusId = pageData.customerDetails.customerID;\n\n if (cusId) {\n //console.log('Inside s.tl Omniture ',prop75Obj.prop75);\n\n var eVar39 = cusId;\n s.tl(this, 'o', 'ZineOne Impression', {\n linkTrackVars: 'prop75,eVar39',\n prop75: \"w>z1rewardsrndup|b|rwd\",\n eVar39: eVar39\n });\n\n }\n}\n\n\ntry {\n //wsShopToRoundUpDataV2Code\n\n try {\n function handleShopToRoundUpDataV2Code(data) {\n debug_log(\"z1ResponsehandleShopToRoundUpDataV2Code::::\", data);\n /*if (data.pageName == \"Coupon\" && data.display_banner == \"true\") {\n showShopRoundUpV2OnCoupon(data);\n }*/\n if (data.pageName == \"Home\" && data.display_banner == \"true\") {\n showShopRoundUpV2OnHome(data);\n }\n if (data.pageName == \"PDP\" && data.display_banner == \"true\") {\n showShopRoundUpV2OnHome(data);\n }\n \tif (data.pageName == \"PMP\" && data.display_banner == \"true\") {\n showShopRoundUpV2OnHome(data);\n }\n if (data.pageName == \"Rewards\" && data.display_banner == \"true\") {\n showShopRoundUpV2OnRewards(data);\n }\n }\n } catch (resErr) {\n debug_log(\"z1ResponsehandleShopToRoundUpDataV2Code Error::::\", resErr);\n }\n\n\n var z1ResponseHandler = function(e) {\n console.log(\"stru???..\" + JSON.stringify(e));\n console.log(\"stru???..\" + e.detail);\n\n if (e.detail && e.detail.ws_shop_to_round_up_dataV2) {\n debug_log(\"e.detail...\", e.detail.ws_shop_to_round_up_dataV2);\n localStorage.setItem(\"z1_wsShopToRoundUpDataV2\", JSON.stringify(e.detail.ws_shop_to_round_up_dataV2));\n handleShopToRoundUpDataV2Code(e.detail.ws_shop_to_round_up_dataV2);\n }\n };\n document.addEventListener(\"onZ1RawData\", z1ResponseHandler, false);\n} catch (err) {\n console.log(\"Error :: Tag:: shopToRoundUpV2\" + err);\n\n}","eventName":"load","pageSelector":{"type":"all","condition":"equals","val":""}},{"tagName":"Rto New UI","actionType":"z1script","script":"var debugScr = true;\ntry {\n\n var localVariable = localStorage.getItem('z1_rto_ui_v2');\n\n if(!localVariable || localVariable == null || localVariable == 'null' || localVariable == undefined || localVariable == \"undefined\")\n {\n return;\n }\n\n\n console.log('This is on the page load');\n\n\n function fireOmniture(z1Response) {\n\n //////***** whats the s.tl(this) ??? */\n\n if (z1Response && z1Response.prop75) {\n var eVar39 = z1Response.evar39 ? z1Response.evar39 : z1Response.customerId;\n s.tl(this, 'o', 'ZineOne Impression', {\n linkTrackVars: 'prop75,eVar39',\n prop75: z1Response.prop75,\n eVar39: eVar39\n });\n\n }\n\n\n }\n\n // Appends style tag\n function appendStyle(styles) {\n var css = document.createElement('style');\n css.type = 'text/css';\n\n if (css.styleSheet) css.styleSheet.cssText = styles;\n else css.appendChild(document.createTextNode(styles));\n\n document.getElementsByTagName(\"head\")[0].appendChild(css);\n }\n\n\n function getUrlParameter(sParam) {\n var sPageURL = decodeURIComponent(window.location.search.substring(1)),\n sURLVariables = sPageURL.split('&'),\n sParameterName,\n i;\n\n for (i = 0; i < sURLVariables.length; i++) {\n sParameterName = sURLVariables[i].split('=');\n\n if (sParameterName[0] === sParam) {\n return sParameterName[1] === undefined ? true : sParameterName[1];\n }\n }\n }\n\n\n function addDataToRedemptionPopup(popupDiv,promoCode)\n {\n //console.log(' addDataToRedemptionPopup '+document.getElementsByClassName('kc-applyContainer')[0]);\n\n var InitPopupContent = document.getElementsByClassName('kc-applyContainer')[0];\n \n\n var promoTextContent = '<div class=\"popupPromoText\">Your promo code is already entered, click Apply to redeem.</div>';\n\n\n console.log('Final HTML '+InitPopupContent);\n\n InitPopupContent.insertAdjacentHTML(\"afterbegin\", promoTextContent);\n\n //document.getElementsByClassName('kc-applyContainer')[0].innerHTML = InitPopupContent;\n\n document.getElementById('promo-kcInput').value = promoCode;\n\n document.getElementById('applyInputButton').onclick = function(){\n\n var currentPromoCode = document.getElementById('promo-kcInput').value;\n\n if(currentPromoCode == promoCode)\n {\n var existingSupc = localStorage.getItem('z1_supc');\n\n existingSupc = JSON.parse(existingSupc);\n\n existingSupc.is_redeemed = true;\n\n localStorage.setItem('z1_supc',JSON.stringify(existingSupc));\n\n\n sendRTOOmniture(2);\n\n }\n\n };\n\n\n }\n\n function getSessionStartTime()\n {\n var userVector = JSON.parse(localStorage.getItem('z1_userVectors'));\n\n var timeVector = userVector.timeVector.toString().split('|');\n\n return timeVector[0];\n }\n\n\n function sendDisEventToC3(pageName,type,existingSupc)\n {\n var eventName = '_ws_rto_page_report';\n\n var sessionStartTime = getSessionStartTime();\n\n\n var returnObj = {};\n returnObj.pgN = pageName;\n returnObj.sessionStartTime = sessionStartTime;\n returnObj.type = type;\n returnObj.rtoName = existingSupc.rtoName;\n returnObj.identifier = existingSupc.identifier;\n\n ZineOne.pushEvent(eventName, returnObj);\n\n }\n\n\n //Case 1: Display Omniture \n //Case 2: Redemption Omniture\n function sendRTOOmniture(caseToSend)\n {\n\n var existingSupc = localStorage.getItem('z1_supc');\n\n if(existingSupc != null && existingSupc != undefined && existingSupc != 'null')\n {\n\n existingSupc = JSON.parse(existingSupc);\n\n\n var prop75 = existingSupc.omniturePrefix+'|';\n prop75 = prop75 + 'C:' + existingSupc.offerCampaign + '|';\n prop75 = prop75 + existingSupc.identifier + '|';\n\n\n if(caseToSend == 1)\n {\n prop75 = prop75+'CP|HP|';\n sendDisEventToC3(\"HP\",\"shown\",existingSupc);\n }\n\n if(caseToSend == 2)\n {\n prop75 = prop75+'OM|';\n sendDisEventToC3(\"OM\",\"redeem\",existingSupc);\n }\n\n \n \n //prop75 = prop75+'P:'+existingSupc.pscore+'|';\n //prop75 = prop75+'O:'+existingSupc.offerValue+'|';\n //prop75 = prop75+'T:'+pageData.cartDetails.cartSubTotalValue+'|';\n //prop75 = prop75+'OC:'+existingSupc.offerCode;\n\n var prop75Obj = {};\n prop75Obj['prop75'] = prop75;\n\n console.log('Got Prop 75 ',prop75Obj);\n\n fireOmniture(prop75Obj);\n\n }\n }\n\n\n function formatAMPM(date) {\n var hours = date.getHours();\n var minutes = date.getMinutes();\n var ampm = hours >= 12 ? 'pm' : 'am';\n hours = hours % 12;\n hours = hours ? hours : 12; // the hour '0' should be '12'\n minutes = minutes < 10 ? '0'+minutes : minutes;\n var strTime = hours + ':' + minutes + ' ' + ampm;\n return strTime;\n }\n\n function showRTOBanner(e)\n {\n console.log(\"[ZineOne] RTO Offers tag running\");\n if (e.is_copied == 'true') return;\n // Style string for RTO\n var style = `\n\n .popupPromoText {\n\n font-size: 1.85em;\n margin-bottom: 5px;\n\n }\n\n .z1_b_container_kohlsbannertoparrow_rto {\n font-family: 'Gotham 5r';\n position: fixed;\n padding: 0px;\n z-index: 1000;\n background: transperant;\n transition: all 1s ease-in;\n -webkit-animation: fadein 2s;\n /* Safari, Chrome and Opera > 12.1 */\n -moz-animation: fadein 2s;\n /* Firefox < 16 */\n -ms-animation: fadein 2s;\n /* Internet Explorer */\n -o-animation: fadein 2s;\n /* Opera < 12.1 */\n animation: fadein 2s;\n {\n z1_position_val\n }\n }\n\n @keyframes fadein {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n\n /* Firefox < 16 */\n\n @-moz-keyframes fadein {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n\n /* Safari, Chrome and Opera > 12.1 */\n\n @-webkit-keyframes fadein {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n\n /* Internet Explorer */\n\n @-ms-keyframes fadein {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n\n /* Opera < 12.1 */\n\n @-o-keyframes fadein {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n\n\n .arrow_box {\n position: absolute;\n text-align:center;\n left: 50%;\n transform: translate(-50%,100%);\n bottom: -20px;\n background: #ffffff;\n border: 1px solid #bfbfbf;\n padding: 1rem;\n border-radius: 0.6rem;\n width: 238px;\n -webkit-box-shadow: 0px 2px 10px 7px rgba(70, 70, 70, 0.8);\n -moz-box-shadow: 0px 2px 10px 7px rgba(70, 70, 70, 0.8);\n box-shadow: 0px 2px 10px 7px rgba(70, 70, 70, 0.8);\n }\n .arrow_box:after,.arrow_box:before {\n \n content: \" \";\n \n position: absolute;\n }\n .arrow_box:after {\n border-color: rgba(255, 255, 255, 0);\n border-bottom-color: #ffffff;\n border-width: 20px;\n margin-left: -20px;\n }\n .arrow_box:before {\n width: 22px;\n height: 22px;\n background: #ffffff;\n z-index: 100;\n transform: translate(-50%, -50%) rotate(45deg);\n top: 1px;\n left: 50%;\n box-shadow: -6px -6px 5px 1px #999;\n }\n\n .z1_b_container_kohlsbannertoparrow_rto .z1_b_box_style {\n position: relative;\n \n }\n .z1_b_container_kohlsbannertoparrow_rto .z1_b_c1 {\n padding-left: 0px !important;\n margin-left: 0px;\n min-width: none;\n max-width: none;\n align-self: center;\n }\n .z1_b_container_kohlsbannertoparrow_rto .z1_b_c1 img {\n min-width: 64px;\n max-width: 64px;\n min-height: 64px;\n max-height: 64px;\n }\n .z1_b_container_kohlsbannertoparrow_rto .z1_b_c2 {\n padding: 0 10px;\n font-size: 0.9em !important;\n line-height: 1.5;\n }\n .z1_b_container_kohlsbannertoparrow_rto .z1_b_c2 .titleText {\n background: url('https://d2p4r375zfkzm8.cloudfront.net/zb-design-com/arrowdown3.png') no-repeat 0 2px;\n font-weight: bold;\n color: #000;\n \n font-size: 1.08em;\n padding: 0px 0 3px 20px;\n line-height: 1.4;\n }\n .z1_b_container_kohlsbannertoparrow_rto .closeBtn {\n cursor: pointer;\n position: absolute;\n right: 3px;\n top: 8px;\n width: 20px;\n height: 20px;\n margin: 0;\n padding: 0;\n font-size: 19px;\n font-family: 'Gotham 4r';\n }\n .z1_b_container_kohlsbannertoparrow_rto .closeBtn img {\n border-bottom-left-radius: 50%;\n border-top-left-radius: 50%;\n border-bottom-right-radius: 50%;\n border-top-right-radius: 50%;\n height: 13px;\n width: 13px;\n opacity: 1;\n }\n .z1_b_container_kohlsbannertoparrow_rto .offerPrice {\n font-size: 1.3em;\n color: #e8342c;\n padding-right: 8px;\n \n }\n .z1_b_container_kohlsbannertoparrow_rto .usernameText {\n font-size: 17px;\n font-weight: bold;\n font-style: normal;\n font-stretch: normal;\n line-height: 1.47;\n letter-spacing: normal;\n text-align: center;\n color: #005553;\n }\n .z1_b_container_kohlsbannertoparrow_rto .todaytext {\n font-size: 1.5em;\n color: #3a3a3a;\n font-weight: 400;\n \n margin: 5px 0px;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n .z1_b_container_kohlsbannertoparrow_rto #offerDuration, .z1_b_container_kohlsbannertoparrow_rto .offerDuration {\n font-weight: bold;\n font-size: 24px;\n }\n\n .z1_b_container_kohlsbannertoparrow_rto .todaytext div#offerDurationUnits {\n display: flex;\n flex-direction: column;\n text-align: left;\n font-size: 0.8em;\n }\n\n .z1_b_container_kohlsbannertoparrow_rto .savetext_row {\n padding: 0.6rem 0;\n }\n .z1_b_container_kohlsbannertoparrow_rto .cupontext {\n font-size: 14px;\n font-weight: 500;\n font-style: normal;\n font-stretch: normal;\n line-height: 1.07;\n letter-spacing: -0.4px;\n text-align: center;\n color: #000000;\n margin: 20px;\n \n }\n .z1_b_container_kohlsbannertoparrow_rto .cupontext span {\n font-weight: bold;\n color: #005553;\n }\n .z1_b_container_kohlsbannertoparrow_rto .btn_addoffer {\n background: #005553;\n text-transform: uppercase;\n color: #060606;\n padding: 0.40rem 1.85rem;\n border-radius: 2.2px;\n text-decoration: none;\n margin: 12px auto;\n letter-spacing: 1px;\n font-size: 13px;\n font-weight: bold;\n font-style: normal;\n font-stretch: normal;\n line-height: 0.6;\n letter-spacing: 0.5px;\n text-align: center;\n color: #ffffff;\n width: 138px;\n height: 31px;\n }\n\n .z1_b_container_kohlsbannertoparrow_rto .btn_addoffer.copy{content: \"Copy Offer\"} \n .z1_b_container_kohlsbannertoparrow_rto .btn_addoffer.copy:hover span {\n display: none;\n }\n .z1_b_container_kohlsbannertoparrow_rto .btn_addoffer.copy:hover:before {\n /* background:#d2e2d3;\n color: #005553; */\n content: \"Click to Copy\";\n }\n .z1_b_container_kohlsbannertoparrow_rto .btn_addoffer.copied:before{content: \"Copied\"}\n .z1_b_container_kohlsbannertoparrow_rto .btn_addoffer.copied{background-color: #d2e2d3;color: #005553;}\n\n.z1_b_container_kohlsbannertoparrow_rto .bottom_link {\n margin-top: 25px;\n font-size: 12px;\n font-weight: normal;\n font-style: normal;\n font-stretch: normal;\n line-height: 0.92;\n letter-spacing: normal;\n text-align: center;\n color: #444444;\n }\n .z1_b_container_kohlsbannertoparrow_rto .bottom_link a{\n text-decoration:underline;\n color:#969696;\n font-size:0.8rem;\n line-height:1.2;\n }\n .z1_b_container_kohlsbannertoparrow_rto .bottom_link a:hover{\n color:#333;\n }\n\n .z1_b_container_kohlsbannertoparrow_rto .saveMsg{\n font-size: 17px;\n font-weight: bold;\n font-style: normal;\n font-stretch: normal;\n line-height: 1.47;\n letter-spacing: normal;\n text-align: center;\n color: #005553;\n }\n\n .z1_b_container_kohlsbannertoparrow_rto .offerText{\n font-size: 37.1px;\n font-weight: bold;\n font-style: normal;\n font-stretch: normal;\n line-height: 0.49;\n letter-spacing: normal;\n text-align: center;\n color: #005553;\n margin: 20px 0;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n \n\n .z1_b_container_kohlsbannertoparrow_rto .treatText{\n font-size: 17px;\n font-weight: 500;\n font-style: normal;\n font-stretch: normal;\n line-height: normal;\n letter-spacing: normal;\n text-align: center;\n color: #222222;\n }\n\n .z1_b_container_kohlsbannertoparrow_rto .treatTextNew{\n font-size: 1.2em;\n margin-bottom: 10px;\n color: #000;\n display:none;\n }\n\n\n\n\n .z1_b_container_kohlsbannertoparrow_rto .saveCont.saveMsg {\n margin-top: 8px;\n }\n\n .z1_b_container_kohlsbannertoparrow_rto .uptillTime{\n font-weight:900;\n }\n\n .z1_b_container_kohlsbannertoparrow_rto .rtoOfferValue{\n font-size: 2em;\n }\n\n .treatTextLatest{\n font-size: 14px;\n font-weight: 500;\n font-style: normal;\n font-stretch: normal;\n line-height: normal;\n letter-spacing: normal;\n text-align: center;\n color: #222222;\n\n }\n\n .btn_offer_container{\n margin: 25px;\n }\n\n .z1-rto-dollar_reward {\n font-weight: bold;\n font-style: normal;\n font-stretch: normal;\n line-height: normal;\n letter-spacing: normal;\n text-align: center;\n color: #005553;\n margin-bottom: 10px;\n } \n .z1-rto-dollar_reward_content {\n display: flex;\n flex-wrap: wrap;\n justify-content: center;\n } \n .z1-rto-dollar-text {\n font-size: 34.2px;\n margin-top: auto;\n width: 20px;\n height: 25px;\n margin-bottom: auto;\n } \n .z1-rto-dollar-text-amount {\n font-size: 68px;\n height: 68px;\n letter-spacing: -3px;\n } \n .z1-rto-dollar-text-dOff-outer {\n margin-top: 15px;\n margin-bottom: auto;\n height: 25px;\n } \n .z1-rto-dollar-text-dOff-off {\n font-size: 16px;\n margin-left: -26px;\n position: relative;\n top: 4px;\n } \n .z1-rto-dollar-text-dOff-off-amount {\n font-size: 38px;\n position: relative;\n top: -4px;\n left: -5px;\n text-shadow: -1px 1px 0 #fff, 1px 1px 0 #fff, 1px -1px 0 #fff, -1px -1px 0 #fff;\n } \n .z1-rto-dollar-text-dOff-off-miniDollar {\n height: -1px;\n font-size: 23px;\n position: relative;\n top: -9px;\n } \n .z1-rto-dollar-text-dOff-off-miniDollarAmount {\n letter-spacing: -1px;\n }\n\n .z1_b_container_kohlsbannertoparrow_rto.loyalty {\n background-color: #e9f4cc;\n }\n\n .loyalty .usernameText {color: #208033;}\n .loyalty .saveMsg {color: #208033;}\n .loyalty .offerText {color: #208033;}\n .loyalty #rtoOfferCode {color: #208033;}\n .loyalty .z1-rto-dollar_reward_content {color: #208033;}\n .loyalty .btn_addoffer {background: #208033;}\n .loyalty.arrow_box:after{border-bottom-color: #208033;}\n .loyalty.arrow_box:before {\n background: #208033;\n }\n\n .z1_b_container_kohlsbannertoparrow_rto.loyalty .bottom_link a{\n color: #444444;\n }\n\n .loyalty-cont.disable {display:none}\n .loyalty-cont.enable {display:block}\n\n .loyalty-cont{\n background-color: #208033;\n position: relative;\n top: -17px;\n left: -17px;\n width: 272px;\n height: 60px;\n border-radius: 0.6em 0.6em 0 0;\n color: #fff;\n }\n\n .loyalty-cont .heading-1 {\n padding-top: 15px;\n font-size: 16px;\n }\n\n .loyalty-cont .heading-2 {\n padding-top: 8px;\n font-size: 12px;\n }\n\n \n .z1_b_container_kohlsbannertoparrow_rto.loyalty .closeBtn{\n z-index: 1;\n color: #fff;\n }\n\n .z1_b_container_kohlsbannertoparrow_rto.loyalty .loyalty-cont.disable{\n\n display:block;\n\n }\n\n\n .element_v2 {display:none;}\n\n .ui_v2 .element_v1 {display:none;}\n .ui_v2 .element_v2 {display:block;}\n\n #v2-take {position: absolute;left: 42px;top: 85px;}\n\n .ui_v2 .z1-rto-dollar-text {font-size: 36.9px;height: 5px;}\n .ui_v2 .z1-rto-dollar-text-amount{font-size: 82px;padding: 5px;}\n\n .ui_v2 {font-family: 'Gotham 5r';}\n\n .ui_v2 .z1-rto-dollar-text-dOff-off{ \n font-size: 25.6px;\n margin-left: 0px;\n top: 45px;\n font-weight: bold;\n }\n\n .ui_v2 .z1-rto-dollar_reward {margin-top: 5px;}\n\n .ui_v2 .treatText {margin-top: 25px;}\n\n .ui_v2.z1_b_container_kohlsbannertoparrow_rto .treatText {margin-top: 15px;font-size: 16px;color: #000;}\n\n .ui_v2.z1_b_container_kohlsbannertoparrow_rto .offerDuration {color: #000;font-size:20px;margin-top: 5px;}\n\n .ui_v2.z1_b_container_kohlsbannertoparrow_rto .saveMsg {font-weight: normal;}\n\n .ui_v2.z1_b_container_kohlsbannertoparrow_rto .usernameText {font-weight: normal;}\n\n .ui_v2.z1_b_container_kohlsbannertoparrow_rto .cupontext {color: #005553;font-size: 15px;}\n\n .ui_v2.z1_b_container_kohlsbannertoparrow_rto .bottom_link a {color: #444444;}\n\n\n\n .ui_v2.dollar_fix .z1-rto-dollar-text-dOff-off{\n\n top: 20px;\n\n }\n\n\n .ui_v2.dollar_fix #v2-take {\n\n top: 70px;\n\n }\n\n .ui_v2.dollar_fix.z1_b_container_kohlsbannertoparrow_rto .offerText{\n margin: 30px 0;\n margin-bottom: 25px;\n }\n\n .ui_v2.dollar_fix.z1_b_container_kohlsbannertoparrow_rto .rtoOfferValue{\n font-size: 89.7px;\n }\n\n .ui_v2.dollar_fix.z1_b_container_kohlsbannertoparrow_rto .offerText{\n font-size:40.4px;\n }\n\n\n `;\n\n console.log('Before RTO Style');\n\n appendStyle(style);\n var domstr_val = \"\";\n var dolStr = \"$\";\n var pctStr = \"\";\n\n domstr_val = `<div id=\"v2-take\" class=\"saveMsg element_v2\">Take</div><div class='offerText'>`+dolStr+`<span id='rtoOfferValue' class='rtoOfferValue'></span><span class=\"z1-rto-dollar-text-dOff-off element_v2\">off</span>`+`</div>`;\n\n\n if (e.offType == \"PERCENT_FIX\") {\n pctStr = \"%\"; \n\n domstr_val = `<div class='offerText'>`+`<span id='rtoOfferValue' class='rtoOfferValue'></span>`+pctStr+`</div>`; \n } \n\n if (e.offType == \"DOLLAR_THR\") {\n domstr_val = `<div class=\"z1-rto-dollar_reward\">\n\n <div id=\"v2-take\" class=\"saveMsg element_v2\">Take</div>\n\n\n <div class=\"z1-rto-dollar_reward_content\">\n <div class=\"z1-rto-dollar-text\">$</div>\n <div id='rtoOfferValue' class=\"z1-rto-dollar-text-amount\"></div>\n <div class=\"z1-rto-dollar-text-dOff-outer\">\n <span class=\"z1-rto-dollar-text-dOff-off\">off</span> <br><span class=\"z1-rto-dollar-text-dOff-off-amount element_v1\"><span class=\"z1-rto-dollar-text-dOff-off-miniDollar\">$</span><span class=\"z1-rto-dollar-text-dOff-off-miniDollarAmount\">`+e.offThres+`</span></span>\n </div>\n </div>\n </div>`;\n }\n\n\n var domstr = `<div data-zineone-properties=\"modal:true;container-class:z1_b_container_kohlsbannertoparrow_rto;\" id=\"z1-rto-div\" class=\"z1_b_container_kohlsbannertoparrow_rto arrow_box\">\n <div class=\"closeBtn\" onclick=\"var el=document.getElementById('z1-rto-div');el.innerHTML='';el.parentNode.removeChild(el);\">x</div>\n <div class=\"z1_b_c1\">\n <div class='loyalty-cont disable'>\n <div class='heading-1'>KOHL’S REWARDS®</div>\n <div class='heading-2'>MEMBER EXCLUSIVE</div>\n </div>\n <div><span class=\"usernameText\">Hi, </span><span class='saveMsg element_v1'> save</span>\n\n <div class='saveMsg element_v2'>your cart looks great!</div>\n\n </div>` + domstr_val +\n `<div class='treatText element_v1'>in the next <span id='offerDuration'></span> minutes.</div>\n <div class='saveMsg element_v2'>the items in your cart!</div>\n\n <div class='treatTextNew'>Valid until <span id='uptillTime' class='uptillTime'></span></div>\n <div class='treatTextLatest element_v1'>(Go ahead, treat yourself!)</div>\n\n <div class='element_v2'>\n <div class='treatText'>Check out in the next</div>\n <div class='offerDuration'><span id='offerDurationv2'></span> minutes.</div>\n </div>\n\n <div class=\"cupontext\">PROMO CODE: <span id='rtoOfferCode'></span></div>\n <div class=\"btn_offer_container\"><a class=\"btn_addoffer\"><span id='btn_addoffer'></span></a></div>\n <div class=\"bottom_link\"><a id='discliamer_href' href=\"#\" target='_default'>details & exclusions</a></div>\n <input type=\"text\" id=\"textCopy\" style='opacity:0;pointer-events:none'/> \n </div>\n </div>`;\n\n \n\n var t = document.createRange().createContextualFragment(domstr);\n\n console.log('Before RTO Z1 Widget');\n\n document.getElementById('z1widget').append(t);\n\n\n document.getElementById('rtoOfferValue').append(e.offerValue);\n document.getElementById('rtoOfferCode').append(e.offerCode);\n document.getElementById('textCopy').value = e.offerCode; \n document.getElementById('offerDuration').append(e.offerDuration);\n\n document.getElementById('offerDurationv2').append(e.offerDuration);\n\n \n\n document.getElementById('discliamer_href').href = e.disclaimer;\n\n\n var uptillTime = new Date();\n uptillTime.setMinutes(uptillTime.getMinutes() + Number(e.offerDuration));\n\n var uptillTimeStr = formatAMPM(uptillTime);\n\n document.getElementById('uptillTime').append(uptillTimeStr + '.');\n\n \n if(document.getElementsByClassName('first-name')[0] && document.getElementsByClassName('first-name')[0].innerText.toLowerCase()!=\"account\")\n {\n document.getElementsByClassName('usernameText')[0].innerText = document.getElementsByClassName('first-name')[0].innerText + ','; \n }\n else\n {\n document.getElementsByClassName('saveMsg')[0].innerText = \"Save\";\n }\n\n\n if(e.loyaltyCx == true)\n {\n document.getElementById('z1-rto-div').classList.add('loyalty');\n }\n\n if(e.cta == \"COPY\")\n {\n document.getElementById('btn_addoffer').innerText = \"COPY OFFER\";\n document.getElementsByClassName('btn_addoffer')[0].classList.add('copy');\n }\n\n if(e.cta == \"ADD\" || e.cta == \"WALLET\")\n {\n document.getElementById('btn_addoffer').innerText = \"ADD OFFER\";\n }\n\n\n document.getElementsByClassName('btn_addoffer')[0].onclick = function() {\n if(e.cta == 'COPY')\n {\n\n var copyTextField = document.getElementById('textCopy');\n copyTextField.select();\n\n var copied = document.execCommand (\"copy\");\n\n console.log('Got Copied Status '+copied);\n \n document.getElementsByClassName('btn_addoffer')[0].classList.add('copied');\n e.is_copied = 'true';\n localStorage.setItem('z1_supc',JSON.stringify(e));\n\n return;\n } \n\n var urlToGo = '/checkout/shopping_cart.jsp?redeemCoupon=true';\n\n\n if(e.cta == 'WALLET')\n {\n if(pageData && pageData.cartDetails && pageData.cartDetails.cartSubTotalValue)\n {\n var cartValue = parseInt(pageData.cartDetails.cartSubTotalValue);\n\n //alert('Got Cart Value '+cartValue);\n if(cartValue == 0)\n {\n urlToGo = '/wallet/my_wallet.jsp#offers';\n }\n\n } \n }\n\n\n location.href=urlToGo;\n\n };\n\n\n sendRTOOmniture(1);\n\n\n }\n\n\n\n\n function getDayLightOffset()\n {\n //Automatically adjust for GMT to Central Timediff based on Daylight savings\n //Returns number of hours Central is behind GMT\n //\n var now = new Date();\n //test data\n var test = now.getTime(); //238*24*3600000;\n var nowUtc = new Date(test);\n var month = nowUtc.getMonth()+1; //make jan=1\n\n if (month < 3 || month > 11) return 6; // savings=F\n if (month > 3 && month < 11) return 5; // savings=T\n\n // switch if >2nd sun in march or >1st sun in nov\n // switches at midnight UTC, so 5 or 6 hrs away from 2AM Central\n\n var tzDiffInHours; //UTC vs Central diff in hours\n var day = nowUtc.getDate(); //already 1 based\n var dow = nowUtc.getDay(); //already sun=0\n var previousSunday = day - dow; \n if (month == 3) tzDiffInHours = (previousSunday >= 8) ? 5 : 6;\n if (month == 11) tzDiffInHours = (previousSunday < 0) ? 5 : 6;\n \n //java.lang.System.out.println(\"@@@@@@ Daylight savings computed variable=\"+tzDiff);\n //var tzDiffInHours = 5; //Change on sunday nov 4, 2018, to 6hrs\n\n return tzDiffInHours;\n }\n\n function convertUTCtoCST(dateObj)\n {\n var dayLightOffset = getDayLightOffset();\n return new Date(dateObj.getTime() - ((1 * 60 * 60 * 1000) * dayLightOffset));\n }\n\n\n function getTimeFromApiFormat(dateStr)\n {\n var dateStrSplit = dateStr.split(' ');\n\n var dateSplit = dateStrSplit[0].split('-');\n var timeSplit = dateStrSplit[1].split(':');\n\n var dateObj = new Date();\n dateObj.setYear(dateSplit[0]);\n dateObj.setMonth(dateSplit[1]-1);\n dateObj.setDate(dateSplit[2]);\n\n dateObj.setHours(timeSplit[0]);\n dateObj.setMinutes(timeSplit[1]-1);\n dateObj.setSeconds(timeSplit[2]);\n\n var dateObj = new Date((dateObj.getTime() - dateObj.getTimezoneOffset()*60*1000)/1000);\n\n console.log(dateObj.getTime()+' getTimeFromApiFormat '+dateObj);\n\n return dateObj.valueOf();\n\n }\n\n function checkForLocalRTO()\n {\n var existingSupc = localStorage.getItem('z1_supc');\n\n if(existingSupc != null && existingSupc != undefined && existingSupc != 'null')\n {\n\n var e = JSON.parse(existingSupc);\n\n var offerExpiry = e.offerExpiry;\n\n\n var currentDate = new Date();\n\n currentDate = convertUTCtoCST(currentDate);\n var currentTime = currentDate.valueOf();\n\n console.log(e.offerExpiry+\" Got Offer Expiry \");\n\n var endTime = getTimeFromApiFormat(e.offerExpiry);\n\n\n currentTime = Number(currentTime.toString().substring(0,currentTime.toString().length - 3));\n\n console.log(endTime+\" timeCheck Main: \" + currentTime);\n\n var timeCheck = endTime-currentTime;\n\n if(timeCheck > 0)\n {\n if(e.is_redeemed != true)\n {\n\n var expiryInMinutes = Math.ceil((timeCheck)/(60));\n\n e.offerDuration = expiryInMinutes;\n\n showRTOBanner(e); \n }\n }\n else\n {\n return false;\n }\n \n\n \n console.log(\" timeCheck: \" + timeCheck);\n\n return true;\n\n\n }\n\n return false;\n }\n\n function _handleRawRTOData(e) {\n // alert('Got raw data...' + JSON.stringify(e));\n console.log('Got Raw RTO data: ' + e);\n\n if(e)\n {\n e = JSON.parse(e);\n\n if(e.rtoOfferData)\n {\n e = e.rtoOfferData;\n\n localStorage.setItem('z1_supc',JSON.stringify(e));\n\n showRTOBanner(e);\n }\n\n\n fireOmniture(e);\n }\n \n \n }\n\n\n try {\n //var z1Widgets = ZineOne.getZ1Widget();\n //z1Widgets.registerWidgetHandler(\"raw\", _handleRawRTOData);\n } catch (e) {\n console.log('Could not register handler for Raw RTO Data.');\n }\n\n if(getUrlParameter('redeemCoupon') == 'true')\n {\n document.getElementsByClassName(\"kohlscashapply\")[0].click(); \n }\n\n\n if(checkForLocalRTO() == true)\n {\n return;\n }\n\n localStorage.setItem('z1_supc',null);\n\n\n var evtName = '_ws_rto_offers';\n\n var isSoftLoggedIn = getCookie(\"SoftLoggedInCookie\");\n if (isSoftLoggedIn && isSoftLoggedIn.includes(\"true\")) {\n if (debugScr) console.log(\"[ZineOne] Soft Logged value is:\" + isSoftLoggedIn);\n }\n // Set HardLoggedIn = true only if user is not SoftLoggedIn\n var isLoggedIn = \"\";\n\n\n if (pageData && pageData.customerDetails) {\n if (!isSoftLoggedIn || (isSoftLoggedIn && !isSoftLoggedIn.includes(\"true\"))) {\n if (pageData.customerDetails.isLoggedIn) isLoggedIn = \"true\";\n }\n }\n\n if(isSoftLoggedIn == 'true' || isLoggedIn == 'true')\n {\n //ZineOne.pushEvent(evtName, {});\n }\n}\ncatch(e)\n{\n if (debugScr) console.log(\"[Zineone] Error in Rto New UI Tag: WebStore Z1 tag. \" + e);\n}\n\n","eventName":"load","pageSelector":{"type":"pgName","condition":"contains","val":"bedding-bed-bath"}},{"tagName":"RTO Order Review New","actionType":"z1script","script":"var debugScr = true;\ntry {\n\n var localVariable = localStorage.getItem('z1_rto_ui_v2');\n\n if(!localVariable || localVariable == null || localVariable == 'null' || localVariable == undefined || localVariable == \"undefined\")\n {\n return;\n }\n\n\n var rtoTimeRemaining = 0;\n\n console.log('This is on RTO Review Page');\n\n\n function fireOmniture(z1Response) {\n\n //////***** whats the s.tl(this) ??? */\n\n if (z1Response && z1Response.prop75) {\n var eVar39 = z1Response.evar39 ? z1Response.evar39 : z1Response.customerId;\n s.tl(this, 'o', 'ZineOne Impression', {\n linkTrackVars: 'prop75,eVar39',\n prop75: z1Response.prop75,\n eVar39: eVar39\n });\n\n }\n\n\n }\n\n\n // Appends style tag\n function appendStyle(styles) {\n var css = document.createElement('style');\n css.type = 'text/css';\n\n if (css.styleSheet) css.styleSheet.cssText = styles;\n else css.appendChild(document.createTextNode(styles));\n\n document.getElementsByTagName(\"head\")[0].appendChild(css);\n }\n\n function appendJs(jsStr)\n {\n var jsElement = document.createElement('script');\n\n var t = document.createTextNode(jsStr);\n jsElement.appendChild(t);\n\n document.getElementsByTagName(\"head\")[0].appendChild(jsElement);\n \n }\n\n\n function getDayLightOffset()\n {\n //Automatically adjust for GMT to Central Timediff based on Daylight savings\n //Returns number of hours Central is behind GMT\n //\n var now = new Date();\n //test data\n var test = now.getTime(); //238*24*3600000;\n var nowUtc = new Date(test);\n var month = nowUtc.getMonth()+1; //make jan=1\n\n if (month < 3 || month > 11) return 6; // savings=F\n if (month > 3 && month < 11) return 5; // savings=T\n\n // switch if >2nd sun in march or >1st sun in nov\n // switches at midnight UTC, so 5 or 6 hrs away from 2AM Central\n\n var tzDiffInHours; //UTC vs Central diff in hours\n var day = nowUtc.getDate(); //already 1 based\n var dow = nowUtc.getDay(); //already sun=0\n var previousSunday = day - dow; \n if (month == 3) tzDiffInHours = (previousSunday >= 8) ? 5 : 6;\n if (month == 11) tzDiffInHours = (previousSunday < 0) ? 5 : 6;\n \n //java.lang.System.out.println(\"@@@@@@ Daylight savings computed variable=\"+tzDiff);\n //var tzDiffInHours = 5; //Change on sunday nov 4, 2018, to 6hrs\n\n return tzDiffInHours;\n }\n\n\n function convertUTCtoCST(dateObj)\n {\n var dayLightOffset = getDayLightOffset();\n return new Date(dateObj.getTime() - ((1 * 60 * 60 * 1000) * dayLightOffset));\n }\n\n\n function getTimeFromApiFormat(dateStr)\n {\n var dateStrSplit = dateStr.split(' ');\n\n var dateSplit = dateStrSplit[0].split('-');\n var timeSplit = dateStrSplit[1].split(':');\n\n var dateObj = new Date();\n dateObj.setYear(dateSplit[0]);\n dateObj.setMonth(dateSplit[1]-1);\n dateObj.setDate(dateSplit[2]);\n\n dateObj.setHours(timeSplit[0]);\n dateObj.setMinutes(timeSplit[1]-1);\n dateObj.setSeconds(timeSplit[2]);\n\n var dateObj = new Date((dateObj.getTime() - dateObj.getTimezoneOffset()*60*1000)/1000);\n\n console.log(dateObj.getTime()+' getTimeFromApiFormat '+dateObj);\n\n return dateObj.valueOf();\n\n }\n\n\n function updateSupcDetails()\n {\n var existingSupc = localStorage.getItem('z1_supc');\n\n existingSupc = JSON.parse(existingSupc);\n\n if(existingSupc.is_redeemed == true)\n {\n if(document.getElementById(\"show_offer_status\"))\n {\n document.getElementById(\"show_offer_status\").innerHTML = \"\";\n document.getElementById(\"link_applynow\").style.display = \"none\";\n document.getElementById(\"link_applynow2\").style.display = \"none\";\n }\n \n //document.getElementById('reviewApplyNow').innerHTML = 'Applied';\n //document.getElementById('reviewApplyNow').href='javascript:void(0)';\n }\n else\n {\n console.log(\"document.getElementById('reviewApplyNow')\",document.getElementById('reviewApplyNow'));\n\n if(document.getElementById('reviewApplyNow'))\n {\n document.getElementById('reviewApplyNow').text ='APPLY NOW'; \n }\n \n }\n }\n\n\n function addDataToRedemptionPopup(popupDiv,promoCode)\n {\n //console.log(' addDataToRedemptionPopup '+document.getElementsByClassName('kc-applyContainer')[0]);\n\n var InitPopupContent = document.getElementsByClassName('kc-applyContainer')[0];\n \n\n var promoTextContent = '<div class=\"popupPromoText\">Your promo code is already entered, click Apply to redeem.</div>';\n\n\n console.log('Final HTML '+InitPopupContent);\n\n InitPopupContent.insertAdjacentHTML(\"afterbegin\", promoTextContent);\n\n //document.getElementsByClassName('kc-applyContainer')[0].innerHTML = InitPopupContent;\n\n document.getElementById('promo-kcInput').value = promoCode;\n\n document.getElementById('applyInputButton').onclick = function(){\n\n var currentPromoCode = document.getElementById('promo-kcInput').value;\n\n if(currentPromoCode == promoCode)\n {\n var existingSupc = localStorage.getItem('z1_supc');\n\n existingSupc = JSON.parse(existingSupc);\n\n existingSupc.is_redeemed = true;\n\n localStorage.setItem('z1_supc',JSON.stringify(existingSupc));\n\n\n updateSupcDetails();\n\n sendRTOOmniture(2);\n\n }\n\n };\n\n }\n\n\n function populateUsername()\n {\n\n\n var usernameText = document.getElementById('usernameText');\n\n console.log(trJsonData.userData.firstName+' populateUsername '+usernameText);\n\n if(trJsonData.userData.firstName)\n {\n document.getElementById('usernameText').innerHTML = trJsonData.userData.firstName +', save';\n\t\t\tdocument.getElementById('usernameText2').innerHTML = trJsonData.userData.firstName+' '+trJsonData.userData.lastName+',';\n \t\n }\n else\n {\n document.getElementById('usernameText').innerHTML = 'Save';\n }\n \n\n console.log('usernameText '+document.getElementById('usernameText').innerHTML);\n \n }\n\n\n\n function showRTOReviewSection(e)\n {\n // Style string for RTO\n var style = `\n\n .popupPromoText {\n\n font-size: 1.85em;\n margin-bottom: 5px;\n\n }\n\n .z1_orderreview_container {\n background-color: #d5e1d4;\n /*display: flex;\n align-content: space-between;\n align-items: center;*/\n height: 85px;\n }\n \n .z1_orderreview_container {\n font-family: 'Gotham 5r';\n border: 1px solid #717171;\n padding: 0.5rem 0.2rem;\n margin-bottom: 0.6rem;\n /*display: -webkit-flex;\n display: flex;\n justify-content: space-between;*/\n color: #454545;\n /*align-content: space-between;\n align-items: center;*/\n }\n \n #username-container {\n font-size: 17px;\n font-weight: bold;\n font-style: normal;\n font-stretch: normal;\n line-height: 1.06;\n letter-spacing: normal;\n color: #005553;\n text-align: center;\n }\n \n .z1_orderreview_container #price-container {\n flex-shrink: 0;\n display: flex;\n align-items: center;\n }\n \n .z1_orderreview_container #price-container .priceTag {\n margin-top: 8px;\n font-size: 28.4px;\n font-weight: bold;\n line-height: 0.49;\n color: #005553;\n text-align: center;\n font-style: normal;\n font-stretch: normal;\n }\n \n .z1_orderreview_container #price-container #rtoOfferValue {\n font-size: 63.2px;\n font-weight: 700;\n letter-spacing: -4.4px;\n color: #005553;\n display: block;\n }\n \n #message-container {\n font-size: 13px;\n font-weight: 500;\n font-style: normal;\n font-stretch: normal;\n line-height: 1;\n letter-spacing: normal;\n color: #222222;\n width: 76px;\n margin: auto;\n }\n \n #time-container {\n display: flex;\n text-align: center;\n font-size: 9.7px;\n font-weight: bold;\n font-style: normal;\n font-stretch: normal;\n line-height: normal;\n letter-spacing: normal;\n color: #222222;\n margin: auto;\n }\n \n #show_min,\n #show_sec {\n width: 61px;\n height: 39px;\n background-color: #005553;\n border: 1px solid #e3e3e3;\n margin: 0.3rem;\n font-size: 29.9px;\n font-weight: bold;\n font-style: normal;\n font-stretch: normal;\n line-height: normal;\n letter-spacing: normal;\n color: #d2e2d3;\n text-align: center;\n box-sizing: border-box;\n }\n \n #show_min,\n #show_sec {\n width: 61px;\n height: 39px;\n background-color: #005553;\n border: 1px solid #e3e3e3;\n margin: 0.3rem;\n font-size: 29.9px;\n font-weight: bold;\n font-style: normal;\n font-stretch: normal;\n line-height: normal;\n letter-spacing: normal;\n color: #d2e2d3;\n text-align: center;\n box-sizing: border-box;\n }\n \n #promo-container {\n width: 60%;\n }\n \n /*.z1_orderreview_container #link_applynow {\n text-transform: uppercase;\n text-align: center;\n padding-top: 0.3rem;\n font-family: 'Gotham 5r';\n font-size: 13px;\n font-weight: normal;\n }\n \n .z1_orderreview_container #link_applynow a {\n text-decoration: underline;\n color: #000;\n font-weight: 700;\n }*/\n \n .z1_orderreview_container #show_offer_status {\n font-family: 'Gotham 5r';\n font-size: 13px;\n text-transform: uppercase;\n text-decoration: none;\n color: #000;\n font-weight: normal;\n text-align: center;\n }\n \n .z1_orderreview_container .promocodecontainer {\n text-transform: uppercase;\n /*padding: 0.7rem 0;*/\n text-align: center;\n margin: 15px auto;\n }\n \n .z1_orderreview_container .promocodecontainer h4 {\n font-family: 'Gotham 5r';\n font-size: 13px;\n font-weight: 500;\n font-style: normal;\n font-stretch: normal;\n line-height: 1.08;\n letter-spacing: -0.4px;\n text-align: center;\n color: #000000;\n }\n \n #rtoOfferCode {\n font-weight: bold;\n color: #005553;\n }\n \n .z1_orderreview_container .promocodecontainer h5 {\n font-family: 'Gotham 5r';\n font-weight: 500;\n font-style: normal;\n font-stretch: normal;\n line-height: 1.08;\n letter-spacing: -0.4px;\n text-align: center;\n color: #005553;\n font-size: 13px;\n }\n \n .z1_orderreview_container>* {\n /*margin: 10px;*/\n }\n \n #z1-rto-new-outerDiv {\n display: flex;\n flex-direction: row;\n justify-content: space-evenly;\n }\n \n .z1-rto-dollar_reward {\n font-weight: bold;\n font-style: normal;\n font-stretch: normal;\n line-height: normal;\n letter-spacing: normal;\n text-align: center;\n color: #005553;\n position: relative;\n top: -8px;\n }\n \n .z1-rto-dollar_reward_content {\n display: flex;\n flex-wrap: wrap;\n }\n \n .z1-rto-dollar-text {\n font-size: 25.2px;\n width: 14px;\n height: 36px;\n position: relative;\n top: 27px;\n }\n \n .z1-rto-dollar-text-amount {\n font-size: 60px;\n height: 68px;\n letter-spacing: -3px;\n }\n \n .z1-rto-dollar-text-dOff-outer {\n margin-top: 21px;\n margin-bottom: auto;\n height: 20px;\n }\n \n .z1-rto-dollar-text-dOff-off {\n font-size: 15px;\n margin-left: -26px;\n position: relative;\n top: 1px;\n }\n \n .z1-rto-dollar-text-dOff-off-amount {\n font-size: 32px;\n position: relative;\n top: -4px;\n left: -6px;\n text-shadow: -1px 1px 0 #d5e1d4, 1px 1px 0 #d5e1d4, 1px -1px 0 #d5e1d4, -1px -1px 0 #d5e1d4;\n }\n \n .z1-rto-dollar-text-dOff-off-miniDollar {\n height: -1px;\n font-size: 20px;\n position: relative;\n top: -9px;\n }\n \n .z1-rto-dollar-text-dOff-off-miniDollarAmount {\n letter-spacing: -1px;\n top: -2px;\n left: -1px;\n position: relative;\n }\n \n #z1-tro-new-promoCodeText {\n font-size: 13px;\n font-weight: 500;\n font-style: normal;\n font-stretch: normal;\n line-height: 1.08;\n letter-spacing: -0.4px;\n text-align: center;\n color: #005553;\n font-weight: bold;\n }\n \n #z1-rto-new-addOfferContainer {\n text-align: center;\n margin: auto;\n }\n \n .btn_offer_container {\n margin: 25px;\n }\n \n #z1-rto-new-addOfferContainer .bottom_link {\n text-align: center;\n margin-top: 3px;\n }\n \n #z1-rto-new-addOfferContainer .bottom_link a {\n font-size: 11px;\n font-weight: 500;\n font-style: normal;\n font-stretch: normal;\n line-height: 1;\n letter-spacing: normal;\n text-align: center;\n color: #000000;\n }\n \n #link_applynow, #link_applynow2 {\n background: #005553;\n text-transform: uppercase;\n border-radius: 2.2px;\n text-decoration: none;\n letter-spacing: 1px;\n font-size: 13px;\n font-weight: bold;\n font-style: normal;\n font-stretch: normal;\n text-align: center;\n width: 104px;\n height: 31px;\n color: white;\n display: flex;\n align-items: center;\n justify-content: center;\n margin: 0 auto;\n } \n /* start old */\n .tag_min, .tag_sec {\n font-family: 'Gotham 5r';\n font-size: 11px;\n text-transform: uppercase;\n text-align: center;\n color: #454545;\n margin-top: 0.3rem;\n font-weight: 700;\n }\n\n .loyalty #username-container {\n text-align: left;\n color: #208033;\n }\n\n .loyalty #show_min, .loyalty #show_sec {background-color: #208033;}\n\n .loyalty #price-container .priceTag {color: #208033;}\n .loyalty #price-container #rtoOfferValue {color: #208033;}\n\n .loyalty .promocodecontainer #z1-tro-new-promoCodeText {color: #208033;}\n .loyalty .promocodecontainer #rtoOfferCode {color: #208033;}\n .loyalty .btn_addoffer {background: #208033;}\n\n .loyalty #link_applynow {background: #208033;}\n .loyalty #link_applynow2 {background: #208033;}\n\n\n .loyalty-cont.disable {display:none}\n .loyalty-cont.enable {display:block}\n\n .loyalty-cont\n {\n text-align: center;\n background-color: #208033;\n height: 20px;\n position: relative;\n top: -8px;\n left: -3px;\n width: 598px;\n padding-top: 7px;\n color: #fff;\n font-size: 14px;\n }\n\n .z1_orderreview_container.loyalty{\n height: 115px;\n }\n\n .loyalty .heading-2 {\n font-weight: lighter;\n font-family: 'Gotham 4r';\n }\n\n .z1_orderreview_container.loyalty .loyalty-cont.disable{\n\n display:block;\n\n }\n\n\n .z1_orderreview_container_2 {\n background-color: #d5e1d4;\n display: flex;\n justify-content: space-between;\n align-items: center;\n height: 85px;\n }\n \n .z1_orderreview_container_2 {\n font-family: 'Gotham 5r';\n border: 1px solid #717171;\n padding: 10px 10px;\n margin-bottom: 0.6rem;\n color: #454545;\n \n }\n\n #first-div{\n display:flex;\n flex-direction:column;\n justify-content: space-around;\n }\n #second-div{\n display:flex;\n flex-direction:column;\n justify-content: space-around;\n text-align:center;\n }\n #third-div{\n display:flex;\n flex-direction:column;\n justify-content: space-around;\n }\n\n\n\t.usernameText2{\n\t\n width: 200px;\n height: 15px;\n font-size: 14px;\n font-weight: 500;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.14;\n letter-spacing: normal;\n text-align: center;\n color: #005553;\n\n\t}\n\n\t.price-container-2{\n\t width: 200px;\n height: 38px;\n font-size: 28px;\n font-weight: bold;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.36;\n letter-spacing: normal;\n color: #005553;\n text-align: center;\n margin-top: 5px;\n\t}\n\n .price-container-2-msg{\n width: 200px;\n height: 34px;\n font-size: 14px;\n font-weight: bold;\n font-stretch: normal;\n font-style: normal;\n letter-spacing: normal;\n color: #005553;\n text-align: center;\n }\n\n .show_min_msg{width: 206px;\n height: 17px;\n \n font-size: 15px;\n font-weight: 500;\n font-stretch: normal;\n font-style: normal;\n \n letter-spacing: normal;\n \n color: #222222;}\n\n\t.show_min_2{font-size: 19px;\n font-weight: bold;\n color: #222222;}\n\n.promocodecontainer-2{ \n height: 30px;\n \n font-size: 13px;\n font-weight: bold;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.31;\n letter-spacing: -0.4px;\n text-align: center;\n color: #000000;\n margin-top: 15px;}\n\n\n\n .element_v2 {display:none;}\n\n .ui_v2 .element_v1 {display:none;}\n .ui_v2 .element_v2 {display:block;}\n\n\n #username-container-2 {margin-top: 20px;}\n\n\n .ui_v2 .bottom_link {margin-top: 10px;}\n\n #z1-rto-new-addOfferContainer-2 .bottom_link a {font-size: 11px;\n font-weight: 500;\n font-style: normal;\n font-stretch: normal;\n line-height: 1;\n letter-spacing: normal;\n text-align: center;\n color: #000000;\n }\n\n\n #rtoOfferValue2 {margin-left: -8px;}\n\n\n .ui_v2 .show_min_msg {height: 20px;}\n\n\n\n `;\n\n console.log('Before RTO Style');\n\n appendStyle(style);\n\n\n var currentDate = new Date();\n\n currentDate = convertUTCtoCST(currentDate);\n var currentTime = currentDate.valueOf();\n\n console.log(e.offerExpiry+\" Got Offer Expiry \");\n\n var endTime = getTimeFromApiFormat(e.offerExpiry);\n\n\n currentTime = Number(currentTime.toString().substring(0,currentTime.toString().length - 3));\n\n console.log(endTime+\" timeCheck Main: \" + currentTime);\n\n rtoTimeRemaining = (endTime-currentTime);\n\n if(rtoTimeRemaining <= 0)\n {\n return;\n }\n\n rtoTimeRemaining = rtoTimeRemaining*1000;\n\n var expiryInMinutes = Math.ceil((endTime-currentTime)/(60));\n\n e.offerDuration = expiryInMinutes;\n\n\n console.log(\" rtoTimeRemaining: \" + rtoTimeRemaining);\n\n var rtoTimejsStr = 'var rtoTimeRemaining = '+rtoTimeRemaining;\n\n appendJs(rtoTimejsStr);\n\n\n var javscriptStr = `\n // Set the TIME we're counting down from\n //var distance = 1*30*1000; //12min\n\n // Update the count down every 1 second\n var x = setInterval(function() {\n\n // Time calculations for days, hours, minutes and seconds\n var days = Math.floor(rtoTimeRemaining / (1000 * 60 * 60 * 24));\n var hours = Math.floor((rtoTimeRemaining % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));\n var minutes = Math.floor((rtoTimeRemaining % (1000 * 60 * 60)) / (1000 * 60));\n var seconds = Math.floor((rtoTimeRemaining % (1000 * 60)) / 1000);\n seconds = (\"0\" + seconds).slice(-2);\n minutes = (\"0\" + minutes).slice(-2);\n\n // Output the result in an element with id=\"show_min and show_sec\"\n\n if(document.getElementById(\"show_min\"))\n {\n document.getElementById(\"show_min\").innerHTML = minutes;\n document.getElementById(\"show_sec\").innerHTML = seconds;\n }\n \n\n // If the count down is over, write some text \n if (rtoTimeRemaining <= 0) {\n clearInterval(x);\n //document.getElementById(\"timercontainer\").style.display = \"none\";\n document.getElementById(\"link_applynow\").style.display = \"none\"; \n document.getElementById(\"show_offer_status\").innerHTML = \"EXPIRED\";\n\n return;\n }\n rtoTimeRemaining = rtoTimeRemaining - 1000;\n }, 1000);\n `;\n\n appendJs(javscriptStr);\n \n var domstr_val = \"\";\n var dolStr = \"$\";\n var pctStr = \"\";\n var domstr_val_2=\"\";\n\n domstr_val = `<div id=\"price-container\">\n <span class=\"priceTag\">`+dolStr+`</span>\n <span id=\"rtoOfferValue\"></span>\n </div>`;\n domstr_val_2 = `<div id=\"price-container\">\n <span class=\"priceTag\">Take `+dolStr+` off</span>\n <span id=\"rtoOfferValue\"></span>\n </div>`;\n\n if (e.offType == \"PERCENT_FIX\") {\n pctStr = \"%\"; \n\n domstr_val = `<div id=\"price-container\">\n <span id=\"rtoOfferValue\"></span>\n <span class=\"priceTag\" style=\"margin:5px\">`+pctStr+`</span>\n </div>`; \n } \n\n if (e.offType == \"DOLLAR_THR\") {\n domstr_val = `<div class=\"z1-rto-dollar_reward\">\n <div class=\"z1-rto-dollar_reward_content\">\n <div class=\"z1-rto-dollar-text\">$</div>\n <div class=\"z1-rto-dollar-text-amount\" id=\"rtoOfferValue\"></div>\n <div class=\"z1-rto-dollar-text-dOff-outer\">\n <span class=\"z1-rto-dollar-text-dOff-off\">off</span> <br><span class=\"z1-rto-dollar-text-dOff-off-amount\"><span class=\"z1-rto-dollar-text-dOff-off-miniDollar\">$</span><span class=\"z1-rto-dollar-text-dOff-off-miniDollarAmount\">`+e.offThres+`</span></span>\n </div>\n </div>\n </div>`;\n }\n\n\n var domstr = `\n <div class='main-cont'>\n <div class='element_v1'>\n <div class=\"z1_orderreview_container\">\n\n <div class='loyalty-cont disable'>\n <span class='heading-1'>KOHL’S REWARDS®</span>\n <span class='heading-2'>MEMBER EXCLUSIVE</span>\n </div>\n\n <div id=\"username-container\">\n <div id=\"usernameText\">Hi, take</div>\n </div>\n <div id=\"z1-rto-new-outerDiv\">`+domstr_val+`\n <div id=\"message-container\">when you<br> place your<br> order in<br> the next..</div>\n <div id=\"time-container\">\n <div id=\"min-container\">\n <div id=\"show_min\">45</div>\n <div class=\"tag_min\">MINUTES</div>\n </div>\n <div id=\"sec-container\">\n <div id=\"show_sec\">39</div>\n <div class=\"tag_sec\">SECONDS</div>\n </div>\n </div>\n <div class=\"promocodecontainer\">\n <div id=\"z1-tro-new-promoCodeText\">Promo Code:</div>\n <div id=\"rtoOfferCode\"></div>\n </div>\n <div id=\"z1-rto-new-addOfferContainer\">\n <div id=\"link_applynow\"><a id=\"reviewApplyNow\" style=\"color:white;text-decoration: none;\" href=\"#\">ADD OFFER</a></div>\n <div id=\"show_offer_status\"></div>\n\n <div class=\"bottom_link\"><a id=\"discliamer_href\" href=\"`+e.disclaimer+`\" target=\"_default\">details & exclusions</a></div>\n </div>\n </div>\n </div>\n </div>\n\n <div class='element_v2'>\n <div class=\"z1_orderreview_container_2\">\n <div id=\"first-div\">\n <div id=\"username-container-2\">\n <div id=\"usernameText2\" class=\"usernameText2\">Hi, take</div>\n <div class='usernameText2'>your cart looks great!</div>\n </div>\n\n <div id=\"price-container-2\" class=\"price-container-2\">\n <span class=\"priceTag\">Take `+dolStr+`</span>\n <span id=\"rtoOfferValue2\"></span>\n <span>off</span>\n </div>\n <div id=\"price-container-2-msg\" class=\"price-container-2-msg\">\n the items in your cart!\n </div>\n \n </div>\n <div id=\"second-div\">\n <div id=\"min-container-2\">\n <div id=\"show_min_msg\" class=\"show_min_msg\">Checkout in the next</div>\n <div id=\"show_min_2\" class=\"show_min_2\"><span id='offerDuration' class='offerDuration'> </span> minutes.</div>\n </div>\n <div class=\"promocodecontainer-2\">\n <div id=\"z1-tro-new-promoCodeText_2\">PROMO CODE:</div>\n <div id=\"rtoOfferCode2\"></div>\n </div>\n </div>\n <div id=\"third-div\">\n <div id=\"z1-rto-new-addOfferContainer-2\">\n <div id=\"link_applynow2\"><a id=\"reviewApplyNow2\" style=\"color:white;text-decoration: none;\" href=\"#\">ADD OFFER</a></div>\n <div id=\"show_offer_status\"></div>\n\n <div class=\"bottom_link\"><a id=\"discliamer_href\" href=\"`+e.disclaimer+`\" target=\"_default\">details & exclusions</a></div>\n </div>\n </div>\n \n </div>\n </div>\n </div>\n`;\n \n \n \n\n console.log('Before RTO Reiview Widget');\n\n //document.querySelector('#checkoutreview #shopping_Bag_Lpanel').insertAdjacentHTML(\"afterbegin\", domstr);\n\tdocument.querySelector('#checkoutreview #shopping_Bag_Lpanel').insertAdjacentHTML(\"afterbegin\", domstr);\n\n document.getElementById('rtoOfferValue').append(e.offerValue);\n document.getElementById('rtoOfferValue2').append(e.offerValue);\n\n document.getElementById('rtoOfferCode').append(e.offerCode);\n document.getElementById('rtoOfferCode2').append(e.offerCode);\n \n document.getElementById('offerDuration').append(e.offerDuration);\n\n if(e.loyaltyCx == true)\n {\n document.getElementsByClassName('z1_orderreview_container')[0].classList.add('loyalty');\n }\n\n document.getElementById('reviewApplyNow').onclick = function(){\n\n\n document.getElementsByClassName(\"kohlscashapply\")[0].onclick = function(){\n\n\n console.log(\"kohlscashapply Click \"); \n\n var timeCounter = 0;\n var maxCounter = 10;\n var timeDelay = 500;\n\n var popupCheck = setInterval(function(){ \n\n console.log(\"Checking for Redemption Popup \"+timeCounter); \n\n var popupDiv = document.getElementsByClassName('kc-applyContainer')[0];\n\n //var popupDiv = document.getElementById('promo-kcInput');\n\n console.log('Got Popup Div '+popupDiv);\n\n if(popupDiv != undefined && popupDiv != null)\n {\n clearInterval(popupCheck);\n\n\n //setTimeout(function(){ }, 500);\n\n var parentDiv = document.getElementById('tr-wallet-content-placeholder');\n\n addDataToRedemptionPopup(parentDiv,e.offerCode);\n\n return;\n }\n\n if(timeCounter > maxCounter)\n {\n clearInterval(popupCheck);\n }\n\n timeCounter++;\n\n }, timeDelay);\n\n\n\n };\n\n document.getElementsByClassName(\"kohlscashapply\")[0].click(); \n };\n\n\n\n document.getElementById('reviewApplyNow2').onclick = function(){\n\n\n document.getElementsByClassName(\"kohlscashapply\")[0].onclick = function(){\n\n\n console.log(\"kohlscashapply Click \"); \n\n var timeCounter = 0;\n var maxCounter = 10;\n var timeDelay = 500;\n\n var popupCheck = setInterval(function(){ \n\n console.log(\"Checking for Redemption Popup \"+timeCounter); \n\n var popupDiv = document.getElementsByClassName('kc-applyContainer')[0];\n\n //var popupDiv = document.getElementById('promo-kcInput');\n\n console.log('Got Popup Div '+popupDiv);\n\n if(popupDiv != undefined && popupDiv != null)\n {\n clearInterval(popupCheck);\n\n\n //setTimeout(function(){ }, 500);\n\n var parentDiv = document.getElementById('tr-wallet-content-placeholder');\n\n addDataToRedemptionPopup(parentDiv,e.offerCode);\n\n return;\n }\n\n if(timeCounter > maxCounter)\n {\n clearInterval(popupCheck);\n }\n\n timeCounter++;\n\n }, timeDelay);\n\n\n\n };\n\n document.getElementsByClassName(\"kohlscashapply\")[0].click(); \n };\n\n\n \n\n\n \n populateUsername();\n\n updateSupcDetails();\n\n sendRTOOmniture(1);\n\n\n \n\n }\n\n function getSessionStartTime()\n {\n var userVector = JSON.parse(localStorage.getItem('z1_userVectors'));\n\n var timeVector = userVector.timeVector.toString().split('|');\n\n return timeVector[0];\n }\n\n\n function sendDisEventToC3(pageName,type,existingSupc)\n {\n var eventName = '_ws_rto_page_report';\n\n var sessionStartTime = getSessionStartTime();\n\n\n var returnObj = {};\n returnObj.pgN = pageName;\n returnObj.sessionStartTime = sessionStartTime;\n returnObj.type = type;\n returnObj.rtoName = existingSupc.rtoName;\n returnObj.identifier = existingSupc.identifier;\n\n ZineOne.pushEvent(eventName, returnObj);\n\n }\n\n\n //Case 1: Display Omniture \n //Case 2: Redemption Omniture\n function sendRTOOmniture(caseToSend)\n {\n\n var existingSupc = localStorage.getItem('z1_supc');\n\n if(existingSupc != null && existingSupc != undefined && existingSupc != 'null')\n {\n\n existingSupc = JSON.parse(existingSupc);\n\n\n var prop75 = existingSupc.omniturePrefix+'|';\n prop75 = prop75 + 'C:' + existingSupc.offerCampaign + '|';\n prop75 = prop75 + existingSupc.identifier + '|';\n\n\n if(caseToSend == 1)\n {\n prop75 = prop75+'CP|OR|';\n sendDisEventToC3(\"OR\",\"shown\",existingSupc);\n }\n\n if(caseToSend == 2)\n {\n prop75 = prop75+'OM|';\n sendDisEventToC3(\"OM\",\"redeem\",existingSupc);\n }\n\n \n //prop75 = prop75+'P:'+existingSupc.pscore+'|';\n //prop75 = prop75+'O:'+existingSupc.offerValue+'|';\n //prop75 = prop75+'T:'+pageData.cartDetails.cartSubTotalValue+'|';\n //prop75 = prop75+'OC:'+existingSupc.offerCode;\n\n var prop75Obj = {};\n prop75Obj['prop75'] = prop75;\n\n console.log('Got Prop 75 ',prop75Obj);\n\n fireOmniture(prop75Obj);\n\n }\n }\n\n\n\n\n\n var existingSupc = localStorage.getItem('z1_supc');\n\n if(existingSupc != null && existingSupc != undefined && existingSupc != 'null')\n {\n var e = JSON.parse(existingSupc);\n showRTOReviewSection(e);\n\n return;\n }\n\n\n localStorage.setItem('z1_supc',null);\n\n\n var evtName = '_ws_rto_offers';\n\n var isSoftLoggedIn = getCookie(\"SoftLoggedInCookie\");\n if (isSoftLoggedIn && isSoftLoggedIn.includes(\"true\")) {\n if (debugScr) console.log(\"[ZineOne] Soft Logged value is:\" + isSoftLoggedIn);\n }\n // Set HardLoggedIn = true only if user is not SoftLoggedIn\n var isLoggedIn = \"\";\n\n\n if (pageData && pageData.customerDetails) {\n if (!isSoftLoggedIn || (isSoftLoggedIn && !isSoftLoggedIn.includes(\"true\"))) {\n if (pageData.customerDetails.isLoggedIn) isLoggedIn = \"true\";\n }\n }\n\n\n\n \n \n}\ncatch(e)\n{\n if (debugScr) console.log(\"[Zineone] Error in RTO Order Review Tag: WebStore Z1 tag. \" + e);\n}\n ","eventName":"load","pageSelector":{"type":"pgName","condition":"contains","val":"checkout/v2/checkout.jsp"}},{"tagName":"Order Details","actionType":"z1script","script":"try\n{\n\t\n\n\tvar debugScr = false;\n var cartValue = 0;\n\n var SESSION_GAP = 1800000; //30min = 30*60*1000 millis\n\n if (debugScr) console.log(\"[ZineOne] Entering PlaceOrder Tag\");\n\n var evtName = \"_ws_placedorder\";\n\n var presentVector = null;\n\n var isSoftLoggedIn = getCookie(\"SoftLoggedInCookie\");\n var isLoggedIn = \"\";\n\n //Event Codes for vectors:\n var eventCodes = {\n _ws_addedtobag: \"A\",\n breachedgeofence: \"B\",\n _ws_completeshipping: \"C\",\n exitgeofence: \"D\",\n _ws_placedorder: \"E\",\n _ws_searched: \"F\",\n _ws_startedcheckout: \"G\",\n _ws_viewedcart: \"H\",\n _ws_viewedcatalog: \"I\",\n _ws_viewedhome: \"J\",\n _ws_viewedproduct: \"K\",\n _ws_completepayment: \"L\",\n _ws_viewedsku: \"M\",\n _ws_update_hcart: \"N\",\n _ws_changedsort: \"O\",\n _ws_rto: \"R\"\n }\n\n function isValid(value) {\n if (value == \"null\" || value == \"undefined\" || value == null || value == undefined) {\n return false;\n }\n\n return true;\n }\n\n\n function fireOmniture(z1Response) {\n\n if (z1Response && z1Response.prop75) {\n var eVar39 = z1Response.evar39 ? z1Response.evar39 : z1Response.customerId;\n s.tl(this, 'o', 'ZineOne Impression', {\n linkTrackVars: 'prop75,eVar39',\n prop75: z1Response.prop75,\n eVar39: eVar39\n });\n\n }\n\n }\n\n\n\n function sendRTOOmniture()\n {\n\n var existingSupc = localStorage.getItem('z1_supc');\n\n if(existingSupc != null && existingSupc != undefined && existingSupc != 'null')\n {\n\n existingSupc = JSON.parse(existingSupc);\n\n var prop75 = existingSupc.omniturePrefix+'|';\n prop75 = prop75 + 'C:' + existingSupc.offerCampaign + '|';\n prop75 = prop75 + existingSupc.identifier + '|';\n\n\n prop75 = prop75+'OR|'; \n \n //prop75 = prop75+'P:'+existingSupc.pscore+'|';\n //prop75 = prop75+'O:'+existingSupc.offerValue+'|';\n //prop75 = prop75+'T:'+pageData.cartDetails.cartSubTotalValue+'|';\n //prop75 = prop75+'OC:'+existingSupc.offerCode;\n\n var prop75Obj = {};\n prop75Obj['prop75'] = prop75;\n\n console.log('Got Prop 75 ',prop75Obj);\n\n fireOmniture(prop75Obj);\n\n }\n }\n\n\n function checkForPreviousEvent(presentVector,previousVector)\n {\n if(presentVector.event == eventCodes._ws_placedorder)\n {\n if(presentVector.event == previousVector.event)\n {\n console.log('Current Event is same as previous event');\n return false;\n }\n }\n \n\n return true;\n }\n\n\n function getUrlParameter(sParam) {\n var sPageURL = decodeURIComponent(window.location.search.substring(1)),\n sURLVariables = sPageURL.split('&'),\n sParameterName,\n i;\n\n for (i = 0; i < sURLVariables.length; i++) {\n sParameterName = sURLVariables[i].split('=');\n\n if (sParameterName[0] === sParam) {\n return sParameterName[1] === undefined ? true : sParameterName[1];\n }\n }\n }\n\n function getSessionStartTime()\n {\n var userVector = JSON.parse(localStorage.getItem('z1_userVectors'));\n\n var timeVector = userVector.timeVector.toString().split('|');\n\n return timeVector[0];\n }\n\n function validateForNotNull(obj)\n {\n //console.log('validateForNotNull',obj,typeof(obj));\n if(!(obj === undefined) && obj != null && obj != 'null' && obj.toString().length != 0)\n {\n return true;\n }\n\n return false;\n }\n\n function spltArrayObjectDataIntoVector(array,attribute)\n {\n var stringVector = '';\n\n console.log(\"spltArrayObjectDataIntoVector attribute\",attribute,array);\n\n if (!validateForNotNull(array)) {\n\n return stringVector;\n\n }\n\n if(array.length == 0)\n {\n return stringVector;\n }\n\n\n for(var i=0;i<array.length;i++)\n {\n var innerObj = array[i];\n\n var attributeValue = '#';\n if (validateForNotNull(innerObj) && validateForNotNull(innerObj[attribute])) {\n\n attributeValue = innerObj[attribute];\n\n }\n \n\n stringVector = stringVector + attributeValue + '^';\n }\n\n stringVector = stringVector.substring(0,stringVector.length-1);\n\n return stringVector;\n\n }\n\n function spltArrayObjectWithArrayObjectDataIntoVector(array,mainAttribute,innerAttribute)\n {\n var stringVector = '';\n\n console.log(\"spltArrayObjectWithArrayObjectDataIntoVector mainAttribute\",mainAttribute,innerAttribute,array);\n\n\n if (!validateForNotNull(array)) {\n\n return stringVector;\n\n }\n\n if(array.length == 0)\n {\n return stringVector;\n }\n\n\n for(var i=0;i<array.length;i++)\n {\n var innerObj = array[i];\n var attributeValueArr = innerObj[mainAttribute];\n\n console.log('spltArrayObjectDataIntoVector ',spltArrayObjectDataIntoVector(attributeValueArr,innerAttribute));\n stringVector = stringVector + spltArrayObjectDataIntoVector(attributeValueArr,innerAttribute) + '^';\n }\n\n stringVector = stringVector.substring(0,stringVector.length-1);\n\n return stringVector;\n\n }\n\n\n function spltArrayObjectWithAttributeObjectDataIntoVector(array,mainAttribute,innerAttribute)\n {\n\n var stringVector = '';\n\n if (!validateForNotNull(array)) {\n\n return stringVector;\n\n }\n\n if(array.length == 0)\n {\n return stringVector;\n }\n\n for(var i=0;i<array.length;i++)\n {\n var innerObj = array[i];\n\n var attributeValue = '-';\n if (validateForNotNull(innerObj) && validateForNotNull(innerObj[mainAttribute]) && validateForNotNull(innerObj[mainAttribute][innerAttribute])) {\n\n attributeValue = innerObj[mainAttribute][innerAttribute];\n\n }\n \n\n stringVector = stringVector + attributeValue + '~';\n }\n\n stringVector = stringVector.substring(0,stringVector.length-1);\n\n return stringVector;\n\n }\n\n function fetchCartDump()\n {\n\n var persistLocalData = localStorage.getItem('persistent_bar_components_json_v1');\n\n if(!isValid(persistLocalData)){\n persistLocalData = JSON.stringify(Kjs.PB.getPbCartStorage());\n }\n\n if (validateForNotNull(persistLocalData)) {\n\n var finalCartJSON = {};\n finalCartJSON.cartItems = [];\n\n persistLocalData = JSON.parse(persistLocalData);\n\n cartData = persistLocalData.cartItems;\n\n if(validateForNotNull(cartData))\n {\n for(var i=0;i<cartData.length;i++)\n {\n if(i == 15)\n {\n break;\n }\n\n var currentFinalObjToSend = {};\n\n var currentObj = cartData[i];\n currentFinalObjToSend.sku = currentObj.skuId;\n currentFinalObjToSend.prdId = currentObj.productId;\n currentFinalObjToSend.qty = currentObj.quantity;\n\n if(validateForNotNull(currentObj.storeClearance))\n {\n currentFinalObjToSend.sc = currentObj.storeClearance; \n }\n \n if(validateForNotNull(currentObj.itemProperties.size))\n {\n currentFinalObjToSend.size = currentObj.itemProperties.size;\n }\n \n if(validateForNotNull(currentObj.itemProperties.color))\n {\n currentFinalObjToSend.color = currentObj.itemProperties.color;\n }\n \n if(validateForNotNull(currentObj.itemProperties.isWebExclusive))\n {\n currentFinalObjToSend.isWebExcl = currentObj.itemProperties.isWebExclusive; \n }\n \n\n var finalInvInfo = {};\n\n if(validateForNotNull(currentObj.inventoryInfo.shipAvailable))\n {\n finalInvInfo.shpAvai = currentObj.inventoryInfo.shipAvailable;\n }\n\n if(validateForNotNull(currentObj.inventoryInfo.bopusAvailable))\n {\n finalInvInfo.bopAvail = currentObj.inventoryInfo.bopusAvailable; \n }\n \n if(validateForNotNull(currentObj.inventoryInfo.bossAvailable))\n {\n finalInvInfo.bosAvail = currentObj.inventoryInfo.bossAvailable; \n }\n \n if(validateForNotNull(currentObj.inventoryInfo.invOnHandQtyShip))\n {\n finalInvInfo.invOHQShip = currentObj.inventoryInfo.invOnHandQtyShip; \n }\n \n if(validateForNotNull(currentObj.finalInvInfo))\n {\n currentFinalObjToSend.invInfo = currentObj.finalInvInfo; \n }\n \n\n var currentPromoInfo = currentObj.promoInfo;\n\n console.log(' currentPromoInfo ',currentPromoInfo);\n\n if(validateForNotNull(currentPromoInfo))\n {\n var finalPromoArray = [];\n\n var prTypeArr = [];\n var prTextArr = [];\n\n for(var j=0;j<currentPromoInfo.length;j++)\n {\n var currentPromoObj = currentPromoInfo[j];\n var tempPromoObj = {};\n\n if(validateForNotNull(currentPromoObj.promoType))\n {\n prTypeArr[prTypeArr.length] = currentPromoObj.promoType; \n }\n \n if(validateForNotNull(currentPromoObj.promoText))\n {\n prTextArr[prTextArr.length] = currentPromoObj.promoText; \n }\n \n\n\n }\n\n currentFinalObjToSend.prType = prTypeArr.join('|');\n currentFinalObjToSend.prText = prTextArr.join('|');\n }\n\n \n\n var currentOfferInfo = currentObj.offerInfo;\n\n console.log(' currentOfferInfo ',currentOfferInfo);\n\n if(validateForNotNull(currentOfferInfo))\n {\n var finalOfferInfoArray = [];\n\n for(var j=0;j<currentOfferInfo.length;j++)\n {\n var currentOfferInfoObj = currentOfferInfo[j];\n var tempOfferInfoObj = {};\n\n if(validateForNotNull(currentOfferInfoObj.offerDiscount))\n {\n tempOfferInfoObj.ofDis = currentOfferInfoObj.offerDiscount; \n }\n \n if(validateForNotNull(currentOfferInfoObj.startDate))\n {\n tempOfferInfoObj.stDt = currentOfferInfoObj.startDate; \n }\n \n if(validateForNotNull(currentOfferInfoObj.endDate))\n {\n tempOfferInfoObj.enDT = currentOfferInfoObj.endDate; \n }\n \n\n finalOfferInfoArray[finalOfferInfoArray.length] = tempOfferInfoObj;\n\n }\n\n currentFinalObjToSend.offInfo = finalOfferInfoArray;\n }\n\n\n finalCartJSON.cartItems[finalCartJSON.cartItems.length] = currentFinalObjToSend;\n }\n }\n\n \n\n\n var shipmentInfo = persistLocalData.shipmentInfo;\n\n console.log(' shipmentInfo ',shipmentInfo);\n\n if(validateForNotNull(shipmentInfo))\n {\n var finalshipmentInfoArray = [];\n\n for(var j=0;j<shipmentInfo.length;j++)\n {\n var currentshipmentInfoObj = shipmentInfo[j];\n var tempShipmentInfoObj = {}; \n\n if(validateForNotNull(currentshipmentInfoObj.shipmentPriceInfo.originalShippingCharges))\n {\n tempShipmentInfoObj.ogShpChrgs = currentshipmentInfoObj.shipmentPriceInfo.originalShippingCharges; \n }\n \n if(validateForNotNull(currentshipmentInfoObj.shipmentPriceInfo.shippingChargesAfterDiscount))\n {\n tempShipmentInfoObj.shpChrgsADis = currentshipmentInfoObj.shipmentPriceInfo.shippingChargesAfterDiscount; \n }\n \n if(validateForNotNull(currentshipmentInfoObj.shipmentPriceInfo.freeShipQualificationDelta))\n {\n tempShipmentInfoObj.freeShpQlfDelta = currentshipmentInfoObj.shipmentPriceInfo.freeShipQualificationDelta; \n }\n \n if(validateForNotNull(currentshipmentInfoObj.shipmentPriceInfo.shipmentItemsTotal))\n {\n tempShipmentInfoObj.shpItmsTot = currentshipmentInfoObj.shipmentPriceInfo.shipmentItemsTotal; \n }\n \n\n\n var shippingOffers = currentshipmentInfoObj.shippingOffers;\n if(validateForNotNull(shippingOffers))\n {\n var finalshippingOfferArray = [];\n\n for(var k=0;k<shippingOffers.length;k++)\n {\n var currentshippingOffersObj = shippingOffers[k];\n\n if(validateForNotNull(currentshippingOffersObj.discountAmount))\n {\n finalshippingOfferArray[finalshippingOfferArray.length] = currentshippingOffersObj.discountAmount; \n }\n \n }\n\n\n tempShipmentInfoObj.disAmnt = finalshippingOfferArray.join('|');\n\n\n }\n\n finalshipmentInfoArray[finalshipmentInfoArray.length] = tempShipmentInfoObj;\n\n\n }\n\n finalCartJSON.shipmentInfo = finalshipmentInfoArray;\n }\n\n var orderSummary = persistLocalData.orderSummary; \n\n var finalOrderSummaryObj = {};\n\n if(validateForNotNull(orderSummary.merchandisePromoAmount))\n {\n finalOrderSummaryObj.merProAmnt = orderSummary.merchandisePromoAmount; \n }\n \n if(validateForNotNull(orderSummary.discountedShippingAmount))\n {\n finalOrderSummaryObj.disShpAmnt = orderSummary.discountedShippingAmount;\n }\n \n if(validateForNotNull(orderSummary.originalShippingAmount))\n {\n finalOrderSummaryObj.ogShpAmnt = orderSummary.originalShippingAmount; \n }\n \n if(validateForNotNull(orderSummary.tax) && validateForNotNull(orderSummary.tax.estimated))\n {\n finalOrderSummaryObj.taxest = orderSummary.tax.estimated; \n }\n \n if(validateForNotNull(orderSummary.tax) && validateForNotNull(orderSummary.tax.taxRate))\n {\n finalOrderSummaryObj.taxRate = orderSummary.tax.taxRate; \n }\n \n if(validateForNotNull(orderSummary.tax) && validateForNotNull(orderSummary.tax.tax))\n {\n finalOrderSummaryObj.tax = orderSummary.tax.tax; \n }\n \n if(validateForNotNull(orderSummary.totalSurcharges))\n {\n finalOrderSummaryObj.totSurgs = orderSummary.totalSurcharges; \n }\n \n if(validateForNotNull(orderSummary.totalTaxFee))\n {\n finalOrderSummaryObj.totTaxFee = orderSummary.totalTaxFee; \n }\n \n if(validateForNotNull(orderSummary.totalKohlsCashAndPromoDiscounts))\n {\n finalOrderSummaryObj.totKCAProDis = orderSummary.totalKohlsCashAndPromoDiscounts; \n }\n \n if(validateForNotNull(orderSummary.totalTax))\n {\n finalOrderSummaryObj.totTax = orderSummary.totalTax; \n }\n \n if(validateForNotNull(orderSummary.total))\n {\n finalOrderSummaryObj.total = orderSummary.total; \n }\n \n if(validateForNotNull(orderSummary.savings))\n {\n finalOrderSummaryObj.sav = orderSummary.savings; \n }\n \n if(validateForNotNull(orderSummary.taxFeeEnabled))\n {\n finalOrderSummaryObj.taxFeeE = orderSummary.taxFeeEnabled; \n }\n\n finalCartJSON.orderSummary = finalOrderSummaryObj;\n\n return JSON.stringify(finalCartJSON);\n\n }\n\n return null;\n\n\n }\n\n function onceInSessionAttributes(eventData) {\n var finalReturnObj = eventData;\n\n var persistLocalData = localStorage.getItem('persistent_bar_components_json_v1');\n\n if(!isValid(persistLocalData)){\n persistLocalData = JSON.stringify(Kjs.PB.getPbCartStorage());\n }\n\n if (validateForNotNull(persistLocalData)) {\n\n var pageDataJson = pageData;\n persistLocalData = JSON.parse(persistLocalData);\n\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.incentiveAmount)) {\n finalReturnObj.incdet_incamnt = persistLocalData.incentiveDetails.incentiveAmount;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.incentiveType)) {\n finalReturnObj.incdet_inctype = persistLocalData.incentiveDetails.incentiveType;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.smartIncentiveStatus)) {\n finalReturnObj.incdet_smartincstatus = persistLocalData.incentiveDetails.smartIncentiveStatus;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.incentiveThreshold)) {\n finalReturnObj.incdet_incthreshold = persistLocalData.incentiveDetails.incentiveThreshold;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.incentiveEligible)) {\n finalReturnObj.incdet_inceligible = persistLocalData.incentiveDetails.incentiveEligible;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.incentiveQualified)) {\n finalReturnObj.incdet_incqualifed = persistLocalData.incentiveDetails.incentiveQualified;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.minCartThresholdMet)) {\n finalReturnObj.incdet_minicartthresholdmet = persistLocalData.incentiveDetails.minCartThresholdMet;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.customerHasKohlsCharge)) {\n finalReturnObj.custdet_custhaskohlschrg = persistLocalData.customerDetails.customerHasKohlsCharge;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.customerPostalCode)) {\n finalReturnObj.custdet_custpostalcode = persistLocalData.customerDetails.customerPostalCode;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.myStoreId)) {\n finalReturnObj.custdet_mystoreid = persistLocalData.customerDetails.myStoreId;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.rewardsPilotService)) {\n finalReturnObj.custdet_rewardspilotser = persistLocalData.customerDetails.rewardsPilotService;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.kohlsLoyalty2018EliteMember)) {\n finalReturnObj.custdet_lytelitemember = persistLocalData.customerDetails.kohlsLoyalty2018EliteMember;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.kohlsLoyalty2018Member)) {\n finalReturnObj.custdet_lytmember = persistLocalData.customerDetails.kohlsLoyalty2018Member;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.rewards) && validateForNotNull(persistLocalData.purchaseEarnings.rewards.loyaltyPointBalance)) {\n finalReturnObj.usrdata_lytypntbal = persistLocalData.purchaseEarnings.rewards.loyaltyPointBalance;\n }\n\n if (validateForNotNull(persistLocalData.userData) && validateForNotNull(persistLocalData.userData.optInIndicator)) {\n finalReturnObj.usrdata_optinindict = persistLocalData.userData.optInIndicator;\n }\n\n if (validateForNotNull(persistLocalData.userData) && validateForNotNull(persistLocalData.userData.accountStatus)) {\n finalReturnObj.usrdata_accstatus = persistLocalData.userData.accountStatus;\n }\n\n if (validateForNotNull(persistLocalData.userData) && validateForNotNull(persistLocalData.userData.storeNum)) {\n finalReturnObj.usrdata_strnum = persistLocalData.userData.storeNum;\n }\n\n if (validateForNotNull(persistLocalData.userData) && validateForNotNull(persistLocalData.userData.isEnrolledUser)) {\n finalReturnObj.usrdata_isenrusr = persistLocalData.userData.isEnrolledUser;\n }\n\n if (validateForNotNull(persistLocalData.userData) && validateForNotNull(persistLocalData.userData.sessionStatus)) {\n finalReturnObj.usrdata_sesstatus = persistLocalData.userData.sessionStatus;\n }\n\n if (validateForNotNull(pageDataJson.pageDetails) && validateForNotNull(pageDataJson.pageDetails.browserPostalCode)) {\n finalReturnObj.pgdata_pgdet_brwpostalcode = pageDataJson.pageDetails.browserPostalCode;\n }\n\n if (validateForNotNull(pageDataJson.customerDetails) && validateForNotNull(pageDataJson.customerDetails.customerPostalCode)) {\n finalReturnObj.pgdata_custdet_custpostalcode = pageDataJson.customerDetails.customerPostalCode;\n }\n\n\n\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.rewards) && validateForNotNull(persistLocalData.purchaseEarnings.rewards.awayPoints)) {\n finalReturnObj.purear_rwds_awaypnts = persistLocalData.purchaseEarnings.rewards.awayPoints;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.rewards) && validateForNotNull(persistLocalData.purchaseEarnings.rewards.ltyRewardThresholdValue)) {\n finalReturnObj.purear_rwds_lytrwdthreshval = persistLocalData.purchaseEarnings.rewards.ltyRewardThresholdValue;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.rewards) && validateForNotNull(persistLocalData.purchaseEarnings.rewards.loyaltyPointBalance)) {\n finalReturnObj.purear_rwds_lytpntbal = persistLocalData.purchaseEarnings.rewards.loyaltyPointBalance;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.rewards) && validateForNotNull(persistLocalData.purchaseEarnings.rewards.currentPurchaseEarnPoint)) {\n finalReturnObj.purear_rwds_curpurearnpnt = persistLocalData.purchaseEarnings.rewards.currentPurchaseEarnPoint;\n }\n\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash.qualificationAmount)) {\n finalReturnObj.purear_kc_qlfyamnt = persistLocalData.purchaseEarnings.kohlsCash.qualificationAmount;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash.earnAmount)) {\n finalReturnObj.purear_kc_earnamnt = persistLocalData.purchaseEarnings.kohlsCash.earnAmount;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash.currentPurchaseEarnAmount)) {\n finalReturnObj.purear_kc_curpurearnamnt = persistLocalData.purchaseEarnings.kohlsCash.currentPurchaseEarnAmount;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash.awayAmount)) {\n finalReturnObj.purear_kc_awayamnt = persistLocalData.purchaseEarnings.kohlsCash.awayAmount;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCashEarnings)) {\n finalReturnObj.purear_kcearnings = persistLocalData.purchaseEarnings.kohlsCashEarnings;\n }\n\n if (validateForNotNull(persistLocalData.addressDetails) && validateForNotNull(persistLocalData.addressDetails.billingAddress[0]) && validateForNotNull(persistLocalData.addressDetails.billingAddress[0].postalCode)) {\n finalReturnObj.addrdet_biladdr_postalcode = spltArrayObjectDataIntoVector(persistLocalData.addressDetails.billingAddress, 'postalCode');\n }\n\n }\n\n return finalReturnObj;\n }\n\n function fetchMcmId()\n {\n var mcid = (typeof Visitor != 'undefined') ? Visitor.getInstance('F0EF5E09512D2CD20A490D4D@AdobeOrg') : '';\n var mcmId = (mcid ? mcid.getMarketingCloudVisitorID() : '');\n\n return mcmId;\n }\n\n function getPresentVector() \n {\n try {\n\n console.log('getPresentVector');\n\n if(pageData.cartDetails)\n {\n cartValue = pageData.cartDetails.cartSubTotalValue;\n }\n\n if(presentVector != null && Object.keys(presentVector).length > 0)\n {\n return presentVector;\n }\n\n presentVector = {};\n\n var itemsInBag = Number(localStorage.getItem(\"z1_checkoutBagCount\"));\n\n \n\n presentVector.event = eventCodes[evtName.toLocaleLowerCase()] || evtName; //common to all\n presentVector.productID = '-'; //ViewedProduct, AddedToBag\n presentVector.itemsInBag = itemsInBag || 0; //common to all\n presentVector.originalPrice = '-';\n presentVector.salePrice = '-';\n presentVector.KC = '-'; //Think\n presentVector.PDPCategory = '-'; //\n presentVector.department = '-';\n presentVector.CN = '-';\n presentVector.keywords = '-';\n presentVector.visualNavForm = '-';\n presentVector.pageFilter = '-';\n presentVector.searchType = '-';\n presentVector.userPFM = '-';\n presentVector.loginstatus = (isLoggedIn) ? 'full' : (isSoftLoggedIn ? 'soft' : '-');\n presentVector.onSale = '-';\n presentVector.time = new Date().getTime();\n\n //New Ml Vectors\n\n presentVector.pgdata_pmpdet_catname = '-';\n presentVector.pgdata_pmpdet_subcatname = '-';\n presentVector.pgdata_pmpdet_findingname = '-';\n presentVector.pgdata_pmpdet_cat_keywords = '-';\n presentVector.pgdata_pmpdet_pgfilter = '-';\n presentVector.pgdata_pmpdet_deptname = '-';\n presentVector.pgdata_pmpdet_gendervalues = '-';\n presentVector.pgdata_pmpdet_search_keywords = '-';\n presentVector.pgdata_proddet_colid = '-';\n presentVector.pgdata_pddetails_clientpostalcode = '-';\n presentVector.selected_sku_color = '-';\n presentVector.selected_sku_size = '-';\n presentVector.selected_sku = '-';\n //presentVector.selected_sku_regular_price = '-';\n presentVector.selected_sku_sale_price = '-';\n\n presentVector.c_i_size = '-';\n presentVector.c_i_color = '-';\n presentVector.c_i_isweb = '-';\n presentVector.c_sclearance = '-';\n presentVector.c_i_shipavailable = '-';\n presentVector.c_i_bopusAval = '-';\n presentVector.c_i_bossAval = '-';\n presentVector.c_i_invShip = '-';\n presentVector.c_i_invBopus = '-';\n presentVector.c_i_invBoss = '-';\n presentVector.c_o_offDis = '-';\n presentVector.c_o_sdate = '-';\n presentVector.c_o_edate = '-';\n presentVector.c_p_type = '-';\n presentVector.c_p_ptext = '-';\n presentVector.shpi_shpp_ogshpchrgs = '-';\n presentVector.shpi_shpp_shpchrgsafdis = '-';\n presentVector.shpi_shpp_freeshpqlfdelta = '-';\n presentVector.shpi_shpp_shpitmstotal = '-';\n presentVector.shpi_shpo_disamnt = '-';\n presentVector.or_merpromoamnt = '-';\n presentVector.or_disshpamnt = '-';\n presentVector.or_ogshpamnt = '-';\n presentVector.or_tax_est = '-';\n presentVector.or_tax_taxrt = '-';\n presentVector.or_tax_tax = '-';\n presentVector.or_totalsur = '-';\n presentVector.or_totaltaxfree = '-';\n presentVector.or_totalkcpromodis = '-';\n presentVector.or_totaltax = '-';\n presentVector.or_total = '-';\n presentVector.or_savings = '-';\n presentVector.or_taxfeeen = '-';\n\n presentVector.removed_sku = '-';\n presentVector.updated_sku = '-';\n presentVector.updated_sku_qty = '-';\n\n presentVector.prod_sku_count = '-';\n presentVector.sku_reg_price = '-';\n presentVector.sku_per_dis = '-';\n presentVector.sku_bopus_avail = '-';\n presentVector.sku_boss_avail = '-';\n presentVector.sku_ship_avail = '-';\n\n presentVector.filter_by_count = '-';\n presentVector.sort_by = '-';\n\n presentVector.pgdata_proddet_catname = '-';\n presentVector.pgdata_proddet_subcatname = '-';\n presentVector.pgdata_proddet_deptname = '-';\n\n presentVector.selected_prd_id = '-';\n\n presentVector.rto_data = '-';\n\n\n\n if (debugScr) console.log(\"presentVector:\" + JSON.stringify(presentVector));\n\n //viewedhome/viewedcart do not require additional processing\n //addedtobag/placedorder have seperate tags\n\n return presentVector;\n } catch (ie) {\n console.log('[ZineOne getPresentVector] : ' + ie);\n }\n }\n\n\n function updateUserVectors() \n {\n try \n {\n\n console.log('Into updateUserVectors');\n var presentVector = getPresentVector();\n var previousVector = JSON.parse(localStorage.getItem('z1_previousVector'));\n var z1_sessionStart_ts = JSON.parse(localStorage.getItem('z1_sessionStart_ts'));\n\n\n if(!checkForPreviousEvent(presentVector,previousVector))\n {\n return;\n }\n\n var z1_features = localStorage.getItem('z1_features') || \"\";\n //Check if local Storage has userVector available\n var userVectors = JSON.parse(localStorage.getItem('z1_userVectors'));\n var newUserVectors = JSON.parse(localStorage.getItem('z1_newUserVectors'));\n\n //Updated the logic to send the Sequence if diff between present and previous event is more than 10 mins\n //if(previousVector && previousVector.time && previousVector.time < z1_sessionStart_ts){\n if (previousVector && previousVector.time && presentVector && presentVector.time && Number(presentVector.time) - Number(previousVector.time) > SESSION_GAP) \n {\n console.log(\"New Session has started since the last Event\");\n //Changes to visitGap for gap between n-1 and nth session\n var visitGap = localStorage.getItem('visitGap');\n //Check if null or undefined\n if (!visitGap || typeof visitGap == undefined || visitGap == 'undefined') {\n visitGap = '';\n }\n\n try {\n\n var oldSessionStartTime = userVectors.timeVector.toString().split('|')[0];\n\n\n var vectorsEventData = {};\n\n vectorsEventData = onceInSessionAttributes(vectorsEventData);\n\n\n var cartDump = fetchCartDump();\n\n if(validateForNotNull(cartDump))\n {\n cartDump = JSON.parse(cartDump);\n\n var cartKeys = Object.keys(cartDump);\n for(var k=0;k<cartKeys.length;k++)\n {\n vectorsEventData[cartKeys[k]] = JSON.stringify(cartDump[cartKeys[k]]);\n }\n }\n\n \n vectorsEventData.z1_userVectors = JSON.stringify(userVectors);\n vectorsEventData.z1_features = z1_features;\n vectorsEventData.visitGap = visitGap;\n vectorsEventData.session_start_time = presentVector.time;\n vectorsEventData.old_session_start_time = oldSessionStartTime;\n\n\n if(validateForNotNull(newUserVectors))\n {\n var newVectorKeys = Object.keys(newUserVectors);\n for(var k=0;k<newVectorKeys.length;k++)\n {\n vectorsEventData[newVectorKeys[k]] = newUserVectors[newVectorKeys[k]];\n }\n }\n\n ZineOne.pushEvent('_ws_updatevectors', vectorsEventData);\n }catch (ieInner) {\n\n var errorObj = {};\n errorObj.p1 = ieInner.message;\n errorObj.p2 = '_ws_placedorder';\n\n ZineOne.pushEvent('_ws_logs', errorObj);\n\n }\n\n\n localStorage.setItem('visitGap', Number(presentVector.time) - Number(previousVector.time));\n localStorage.removeItem('z1_userVectors');\n localStorage.removeItem('z1_features');\n console.log(\"z1_userVectors removed from local storage\");\n userVectors = null;\n newUserVectors = null;\n }\n\n if (!userVectors) {\n userVectors = {};\n userVectors.eventVector = presentVector.event;\n userVectors.timeVector = presentVector.time;\n userVectors.productVector = presentVector.productID;\n userVectors.originalPrice = presentVector.originalPrice;\n userVectors.salePrice = presentVector.salePrice;\n userVectors.PDPCategory = presentVector.PDPCategory;\n userVectors.CN = presentVector.CN;\n userVectors.itemsInBag = presentVector.itemsInBag;\n\n newUserVectors = {};\n newUserVectors.pgdata_pmpdet_catname = presentVector.pgdata_pmpdet_catname;\n newUserVectors.pgdata_pmpdet_subcatname = presentVector.pgdata_pmpdet_subcatname;\n newUserVectors.pgdata_pmpdet_findingname = presentVector.pgdata_pmpdet_findingname;\n newUserVectors.pgdata_pmpdet_cat_keywords = presentVector.pgdata_pmpdet_cat_keywords;\n newUserVectors.pgdata_pmpdet_pgfilter = presentVector.pgdata_pmpdet_pgfilter;\n newUserVectors.pgdata_pmpdet_deptname = presentVector.pgdata_pmpdet_deptname;\n newUserVectors.pgdata_pmpdet_gendervalues = presentVector.pgdata_pmpdet_gendervalues;\n newUserVectors.pgdata_pmpdet_search_keywords = presentVector.pgdata_pmpdet_search_keywords;\n newUserVectors.pgdata_proddet_colid = presentVector.pgdata_proddet_colid;\n newUserVectors.pgdata_pddetails_clientpostalcode = presentVector.pgdata_pddetails_clientpostalcode;\n newUserVectors.selected_sku_color = presentVector.selected_sku_color;\n newUserVectors.selected_sku_size = presentVector.selected_sku_size;\n newUserVectors.selected_sku = presentVector.selected_sku;\n //newUserVectors.selected_sku_regular_price = presentVector.selected_sku_regular_price;\n newUserVectors.selected_sku_sale_price = presentVector.selected_sku_sale_price;\n\n\n\n newUserVectors.c_i_size = presentVector.c_i_size;\n newUserVectors.c_i_color = presentVector.c_i_color;\n newUserVectors.c_i_isweb = presentVector.c_i_isweb;\n newUserVectors.c_sclearance = presentVector.c_sclearance;\n newUserVectors.c_i_shipavailable = presentVector.c_i_shipavailable;\n newUserVectors.c_i_bopusAval = presentVector.c_i_bopusAval;\n newUserVectors.c_i_bossAval = presentVector.c_i_bossAval;\n newUserVectors.c_i_invShip = presentVector.c_i_invShip;\n newUserVectors.c_i_invBopus = presentVector.c_i_invBopus;\n newUserVectors.c_i_invBoss = presentVector.c_i_invBoss;\n newUserVectors.c_o_offDis = presentVector.c_o_offDis;\n newUserVectors.c_o_sdate = presentVector.c_o_sdate;\n newUserVectors.c_o_edate = presentVector.c_o_edate;\n newUserVectors.c_p_type = presentVector.c_p_type;\n newUserVectors.c_p_ptext = presentVector.c_p_ptext;\n newUserVectors.shpi_shpp_ogshpchrgs = presentVector.shpi_shpp_ogshpchrgs;\n newUserVectors.shpi_shpp_shpchrgsafdis = presentVector.shpi_shpp_shpchrgsafdis;\n newUserVectors.shpi_shpp_freeshpqlfdelta = presentVector.shpi_shpp_freeshpqlfdelta;\n newUserVectors.shpi_shpp_shpitmstotal = presentVector.shpi_shpp_shpitmstotal;\n newUserVectors.shpi_shpo_disamnt = presentVector.shpi_shpo_disamnt;\n newUserVectors.or_merpromoamnt = presentVector.or_merpromoamnt;\n newUserVectors.or_disshpamnt = presentVector.or_disshpamnt;\n newUserVectors.or_ogshpamnt = presentVector.or_ogshpamnt;\n newUserVectors.or_tax_est = presentVector.or_tax_est;\n newUserVectors.or_tax_taxrt = presentVector.or_tax_taxrt;\n newUserVectors.or_tax_tax = presentVector.or_tax_tax;\n newUserVectors.or_totalsur = presentVector.or_totalsur;\n newUserVectors.or_totaltaxfree = presentVector.or_totaltaxfree;\n newUserVectors.or_totalkcpromodis = presentVector.or_totalkcpromodis;\n newUserVectors.or_totaltax = presentVector.or_totaltax;\n newUserVectors.or_total = presentVector.or_total;\n newUserVectors.or_savings = presentVector.or_savings;\n newUserVectors.or_taxfeeen = presentVector.or_taxfeeen;\n\n newUserVectors.removed_sku = presentVector.removed_sku;\n newUserVectors.updated_sku = presentVector.updated_sku;\n newUserVectors.updated_sku_qty = presentVector.updated_sku_qty;\n\n newUserVectors.prod_sku_count = presentVector.prod_sku_count;\n newUserVectors.sku_reg_price = presentVector.sku_reg_price;\n newUserVectors.sku_per_dis = presentVector.sku_per_dis;\n newUserVectors.sku_bopus_avail = presentVector.sku_bopus_avail;\n newUserVectors.sku_boss_avail = presentVector.sku_boss_avail;\n newUserVectors.sku_ship_avail = presentVector.sku_ship_avail;\n\n newUserVectors.filter_by_count = presentVector.filter_by_count;\n newUserVectors.sort_by = presentVector.sort_by;\n\n newUserVectors.pgdata_proddet_catname = presentVector.pgdata_proddet_catname;\n newUserVectors.pgdata_proddet_subcatname = presentVector.pgdata_proddet_subcatname;\n newUserVectors.pgdata_proddet_deptname = presentVector.pgdata_proddet_deptname;\n\n newUserVectors.selected_prd_id = presentVector.selected_prd_id;\n\n newUserVectors.rto_data = presentVector.rto_data;\n\n } else {\n userVectors.eventVector = userVectors.eventVector + '|' + presentVector.event;\n userVectors.timeVector = userVectors.timeVector + '|' + presentVector.time;\n userVectors.productVector = userVectors.productVector + '|' + presentVector.productID;\n userVectors.originalPrice = userVectors.originalPrice + '|' + presentVector.originalPrice;\n userVectors.salePrice = userVectors.salePrice + '|' + presentVector.salePrice;\n userVectors.PDPCategory = userVectors.PDPCategory + '|' + presentVector.PDPCategory;\n userVectors.CN = userVectors.CN + '|' + presentVector.CN;\n userVectors.itemsInBag = userVectors.itemsInBag + '|' + presentVector.itemsInBag;\n\n newUserVectors.pgdata_pmpdet_catname = newUserVectors.pgdata_pmpdet_catname + '|' + presentVector.pgdata_pmpdet_catname;\n newUserVectors.pgdata_pmpdet_subcatname = newUserVectors.pgdata_pmpdet_subcatname + '|' + presentVector.pgdata_pmpdet_subcatname;\n newUserVectors.pgdata_pmpdet_findingname = newUserVectors.pgdata_pmpdet_findingname + '|' + presentVector.pgdata_pmpdet_findingname;\n newUserVectors.pgdata_pmpdet_cat_keywords = newUserVectors.pgdata_pmpdet_cat_keywords + '|' + presentVector.pgdata_pmpdet_cat_keywords;\n newUserVectors.pgdata_pmpdet_pgfilter = newUserVectors.pgdata_pmpdet_pgfilter + '|' + presentVector.pgdata_pmpdet_pgfilter;\n newUserVectors.pgdata_pmpdet_deptname = newUserVectors.pgdata_pmpdet_deptname + '|' + presentVector.pgdata_pmpdet_deptname;\n newUserVectors.pgdata_pmpdet_gendervalues = newUserVectors.pgdata_pmpdet_gendervalues + '|' + presentVector.pgdata_pmpdet_gendervalues;\n newUserVectors.pgdata_pmpdet_search_keywords = newUserVectors.pgdata_pmpdet_search_keywords + '|' + presentVector.pgdata_pmpdet_search_keywords;\n newUserVectors.pgdata_proddet_colid = newUserVectors.pgdata_proddet_colid + '|' + presentVector.pgdata_proddet_colid;\n newUserVectors.pgdata_pddetails_clientpostalcode = newUserVectors.pgdata_pddetails_clientpostalcode + '|' + presentVector.pgdata_pddetails_clientpostalcode;\n newUserVectors.selected_sku_color = newUserVectors.selected_sku_color + '|' + presentVector.selected_sku_color;\n newUserVectors.selected_sku_size = newUserVectors.selected_sku_size + '|' + presentVector.selected_sku_size;\n newUserVectors.selected_sku = newUserVectors.selected_sku + '|' + presentVector.selected_sku;\n //newUserVectors.selected_sku_regular_price = newUserVectors.selected_sku_regular_price + '|' + presentVector.selected_sku_regular_price;\n newUserVectors.selected_sku_sale_price = newUserVectors.selected_sku_sale_price + '|' + presentVector.selected_sku_sale_price;\n\n\n newUserVectors.c_i_size = newUserVectors.c_i_size + '|' + presentVector.c_i_size;\n newUserVectors.c_i_color = newUserVectors.c_i_color + '|' + presentVector.c_i_color;\n newUserVectors.c_i_isweb = newUserVectors.c_i_isweb + '|' + presentVector.c_i_isweb;\n newUserVectors.c_sclearance = newUserVectors.c_sclearance + '|' + presentVector.c_sclearance;\n newUserVectors.c_i_shipavailable = newUserVectors.c_i_shipavailable + '|' + presentVector.c_i_shipavailable;\n newUserVectors.c_i_bopusAval = newUserVectors.c_i_bopusAval + '|' + presentVector.c_i_bopusAval;\n newUserVectors.c_i_bossAval = newUserVectors.c_i_bossAval + '|' + presentVector.c_i_bossAval;\n newUserVectors.c_i_invShip = newUserVectors.c_i_invShip + '|' + presentVector.c_i_invShip;\n newUserVectors.c_i_invBopus = newUserVectors.c_i_invBopus + '|' + presentVector.c_i_invBopus;\n newUserVectors.c_i_invBoss = newUserVectors.c_i_invBoss + '|' + presentVector.c_i_invBoss;\n newUserVectors.c_o_offDis = newUserVectors.c_o_offDis + '|' + presentVector.c_o_offDis;\n newUserVectors.c_o_sdate = newUserVectors.c_o_sdate + '|' + presentVector.c_o_sdate;\n newUserVectors.c_o_edate = newUserVectors.c_o_edate + '|' + presentVector.c_o_edate;\n newUserVectors.c_p_type = newUserVectors.c_p_type + '|' + presentVector.c_p_type;\n newUserVectors.c_p_ptext = newUserVectors.c_p_ptext + '|' + presentVector.c_p_ptext;\n newUserVectors.shpi_shpp_ogshpchrgs = newUserVectors.shpi_shpp_ogshpchrgs + '|' + presentVector.shpi_shpp_ogshpchrgs;\n newUserVectors.shpi_shpp_shpchrgsafdis = newUserVectors.shpi_shpp_shpchrgsafdis + '|' + presentVector.shpi_shpp_shpchrgsafdis;\n newUserVectors.shpi_shpp_freeshpqlfdelta = newUserVectors.shpi_shpp_freeshpqlfdelta + '|' + presentVector.shpi_shpp_freeshpqlfdelta;\n newUserVectors.shpi_shpp_shpitmstotal = newUserVectors.shpi_shpp_shpitmstotal + '|' + presentVector.shpi_shpp_shpitmstotal;\n newUserVectors.shpi_shpo_disamnt = newUserVectors.shpi_shpo_disamnt + '|' + presentVector.shpi_shpo_disamnt;\n newUserVectors.or_merpromoamnt = newUserVectors.or_merpromoamnt + '|' + presentVector.or_merpromoamnt;\n newUserVectors.or_disshpamnt = newUserVectors.or_disshpamnt + '|' + presentVector.or_disshpamnt;\n newUserVectors.or_ogshpamnt = newUserVectors.or_ogshpamnt + '|' + presentVector.or_ogshpamnt;\n newUserVectors.or_tax_est = newUserVectors.or_tax_est + '|' + presentVector.or_tax_est;\n newUserVectors.or_tax_taxrt = newUserVectors.or_tax_taxrt + '|' + presentVector.or_tax_taxrt;\n newUserVectors.or_tax_tax = newUserVectors.or_tax_tax + '|' + presentVector.or_tax_tax;\n newUserVectors.or_totalsur = newUserVectors.or_totalsur + '|' + presentVector.or_totalsur;\n newUserVectors.or_totaltaxfree = newUserVectors.or_totaltaxfree + '|' + presentVector.or_totaltaxfree;\n newUserVectors.or_totalkcpromodis = newUserVectors.or_totalkcpromodis + '|' + presentVector.or_totalkcpromodis;\n newUserVectors.or_totaltax = newUserVectors.or_totaltax + '|' + presentVector.or_totaltax;\n newUserVectors.or_total = newUserVectors.or_total + '|' + presentVector.or_total;\n newUserVectors.or_savings = newUserVectors.or_savings + '|' + presentVector.or_savings;\n newUserVectors.or_taxfeeen = newUserVectors.or_taxfeeen + '|' + presentVector.or_taxfeeen;\n\n newUserVectors.removed_sku = newUserVectors.removed_sku + '|' + presentVector.removed_sku;\n newUserVectors.updated_sku = newUserVectors.updated_sku + '|' + presentVector.updated_sku;\n newUserVectors.updated_sku_qty = newUserVectors.updated_sku_qty + '|' + presentVector.updated_sku_qty;\n\n newUserVectors.prod_sku_count = newUserVectors.prod_sku_count + '|' + presentVector.prod_sku_count;\n newUserVectors.sku_reg_price = newUserVectors.sku_reg_price + '|' + presentVector.sku_reg_price;\n newUserVectors.sku_per_dis = newUserVectors.sku_per_dis + '|' + presentVector.sku_per_dis;\n newUserVectors.sku_bopus_avail = newUserVectors.sku_bopus_avail + '|' + presentVector.sku_bopus_avail;\n newUserVectors.sku_boss_avail = newUserVectors.sku_boss_avail + '|' + presentVector.sku_boss_avail;\n newUserVectors.sku_ship_avail = newUserVectors.sku_ship_avail + '|' + presentVector.sku_ship_avail;\n\n\n newUserVectors.filter_by_count = newUserVectors.filter_by_count + '|' + presentVector.filter_by_count;\n newUserVectors.sort_by = newUserVectors.sort_by + '|' + presentVector.sort_by;\n\n newUserVectors.pgdata_proddet_catname = newUserVectors.pgdata_proddet_catname + '|' + presentVector.pgdata_proddet_catname;\n newUserVectors.pgdata_proddet_subcatname = newUserVectors.pgdata_proddet_subcatname + '|' + presentVector.pgdata_proddet_subcatname;\n newUserVectors.pgdata_proddet_deptname = newUserVectors.pgdata_proddet_deptname + '|' + presentVector.pgdata_proddet_deptname;\n\n newUserVectors.selected_prd_id = newUserVectors.selected_prd_id + '|' + presentVector.selected_prd_id;\n\n newUserVectors.rto_data = newUserVectors.rto_data + '|' + presentVector.rto_data;\n\n }\n localStorage.setItem('z1_userVectors', JSON.stringify(userVectors));\n localStorage.setItem('z1_newUserVectors', JSON.stringify(newUserVectors));\n\n updateFeatures();\n\n //Update the previousVector\n previousVector = presentVector;\n localStorage.setItem('z1_previousVector', JSON.stringify(previousVector));\n\n //Send the Sequence on 5th and 10th Element as well\n //Fetch the updated features as they are updated \n var z1_features = localStorage.getItem('z1_features') || \"\";\n //If this is the 5th Element, send the features and vectors\n if (userVectors && userVectors.eventVector && userVectors.eventVector.split('|').length == 5) \n {\n console.log(\"The sequence is 5 element long\");\n //Changes to visitGap for gap between n-1 and nth session\n var visitGap = localStorage.getItem('visitGap');\n //Check if null or undefined\n if (!visitGap || typeof visitGap == undefined || visitGap == 'undefined') {\n visitGap = '';\n }\n\n var currentSessionStartTime = userVectors.timeVector.toString().split('|')[0];\n\n\n var vectorsEventData = {};\n\n var newVectorKeys = Object.keys(newUserVectors);\n for(var k=0;k<newVectorKeys.length;k++)\n {\n vectorsEventData[newVectorKeys[k]] = newUserVectors[newVectorKeys[k]];\n }\n\n vectorsEventData.z1_userVectors = JSON.stringify(userVectors);\n vectorsEventData.z1_features = z1_features;\n vectorsEventData.cartValue= cartValue;\n vectorsEventData.session_start_time = currentSessionStartTime;\n vectorsEventData.visitGap = visitGap;\n\n if(validateForNotNull(pageData) && validateForNotNull(pageData.customerDetails) && validateForNotNull(pageData.customerDetails.customerHasKohlsCharge))\n {\n vectorsEventData.isKcc = pageData.customerDetails.customerHasKohlsCharge;\n }\n else\n {\n vectorsEventData.isKcc = -1;\n }\n\n if (validateForNotNull(pageData) && validateForNotNull(pageData.customerDetails) && validateForNotNull(pageData.customerDetails.kohlsLoyalty2018EliteMember)) {\n vectorsEventData.kohlsLoyalty2018EliteMember = pageData.customerDetails.kohlsLoyalty2018EliteMember;\n } else {\n vectorsEventData.kohlsLoyalty2018EliteMember = -1;\n }\n\n if (validateForNotNull(pageData) && validateForNotNull(pageData.customerDetails) && validateForNotNull(pageData.customerDetails.kohlsLoyalty2018Member)) {\n vectorsEventData.kohlsLoyalty2018Member = pageData.customerDetails.kohlsLoyalty2018Member;\n } else {\n vectorsEventData.kohlsLoyalty2018Member = -1;\n }\n\n vectorsEventData.mcmId = fetchMcmId();\n\n ZineOne.pushEvent('_ws_updatevectors_len5', vectorsEventData);\n } \n else if (userVectors && userVectors.eventVector && userVectors.eventVector.split('|').length == 10) \n {\n console.log(\"The sequence is 10 element long\");\n //Changes to visitGap for gap between n-1 and nth session\n var visitGap = localStorage.getItem('visitGap');\n //Check if null or undefined\n if (!visitGap || typeof visitGap == undefined || visitGap == 'undefined') {\n visitGap = '';\n }\n\n var currentSessionStartTime = userVectors.timeVector.toString().split('|')[0];\n\n var vectorsEventData = {};\n\n var newVectorKeys = Object.keys(newUserVectors);\n for(var k=0;k<newVectorKeys.length;k++)\n {\n vectorsEventData[newVectorKeys[k]] = newUserVectors[newVectorKeys[k]];\n }\n\n\n\n vectorsEventData.z1_userVectors = JSON.stringify(userVectors);\n vectorsEventData.z1_features = z1_features;\n vectorsEventData.session_start_time = currentSessionStartTime;\n vectorsEventData.visitGap = visitGap;\n\n ZineOne.pushEvent('_ws_updatevectors_len10', vectorsEventData);\n }\n\n //If this is the 10th Element, send the features and vectors\n } catch (ie) {\n console.log('[ZineOne updateUserVectors] : ' + ie);\n }\n }\n\n function updateFeatures() {\n\n console.log('Into updateFeatures');\n /* z1_features is stored in local storage which holds following stats\n ** n Total number of events in visit\n ** A Total number of addedtobag events in the visit\n ** B Total number of breachedgeofence events in the visit\n ** C Total number of continuedcheckout events in the visit\n ** D Total number of exitgeofence events in the visit\n ** E Total number of placedorder events in the visit\n ** F Total number of searched events in the visit\n ** G Total number of startedcheckout events in the visit\n ** H Total number of viewedcart events in the visit\n ** I Total number of viewedcatalog events in the visit\n ** J Total number of viewedhome events in the visit\n ** K Total number of viewedproduct events in the visit\n ** p Total number of evented pages loaded in visit\n */\n\n var z1_features = localStorage.getItem('z1_features');\n if (!z1_features) {\n z1_features = \"0|0|0|0|0|0|0|0|0|0|0|0|0|0\";\n }\n\n z1_features_arr = z1_features.split('|');\n\n z1_features_arr[0] = Number(z1_features_arr[0]) + 1; //n\n\n if (evtName.toLocaleLowerCase() == '_ws_addedtobag') {\n z1_features_arr[1] = Number(z1_features_arr[1]) + 1;\n } else if (evtName.toLocaleLowerCase() == 'breachedgeofence') {\n z1_features_arr[2] = Number(z1_features_arr[2]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_completeshipping') {\n z1_features_arr[3] = Number(z1_features_arr[3]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == 'exitgeofence') {\n z1_features_arr[4] = Number(z1_features_arr[4]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_placedorder') {\n z1_features_arr[5] = Number(z1_features_arr[5]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_searched') {\n z1_features_arr[6] = Number(z1_features_arr[6]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_startedcheckout') {\n z1_features_arr[7] = Number(z1_features_arr[7]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_viewedcart') {\n z1_features_arr[8] = Number(z1_features_arr[8]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_viewedcatalog') {\n z1_features_arr[9] = Number(z1_features_arr[9]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_viewedhome') {\n z1_features_arr[10] = Number(z1_features_arr[10]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_viewedproduct') {\n z1_features_arr[11] = Number(z1_features_arr[11]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_completepayment') {\n z1_features_arr[13] = Number(z1_features_arr[13]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n }\n\n z1_features = z1_features_arr[0] + '|' + z1_features_arr[1] + '|' + z1_features_arr[2] + '|' + z1_features_arr[3] + '|' + z1_features_arr[4] + '|' + z1_features_arr[5] + '|' + z1_features_arr[6] + '|' + z1_features_arr[7] + '|' + z1_features_arr[8] + '|' + z1_features_arr[9] + '|' + z1_features_arr[10] + '|' + z1_features_arr[11] + '|' + z1_features_arr[12] + '|' + z1_features_arr[13];\n localStorage.setItem('z1_features', z1_features);\n }\n\n\n function init()\n {\n\n \n var edata = {};\n \n edata.productIdList = localStorage.getItem('z1_checkoutProductIdList')+\"\";\n\n\n var presVec = getPresentVector();\n var sessionStartTime = getSessionStartTime();\n\n edata.time = presVec.time;\n edata.sessionStartTime = sessionStartTime;\n\n\n var cartValue = 0;\n var cartItems = 0;\n var finalCartQuantity = 0;\n\n if(pageData.cartDetails)\n {\n cartValue = pageData.cartDetails.cartSubTotalValue;\n\n\n cartItems = pageData.cartDetails.cartItems.length;\n\n for(var i=0;i<cartItems;i++)\n {\n finalCartQuantity = finalCartQuantity + Number(pageData.cartDetails.cartItems[i].quantity);\n }\n }\n\n if(cartValue == 0 || finalCartQuantity == 0)\n {\n if(trJsonData && trJsonData.orderSummary && trJsonData.orderSummary.merchandisePromoAmount)\n {\n cartValue = Number(trJsonData.orderSummary.merchandisePromoAmount);\n\n if(trJsonData.cartItems)\n {\n cartItems = trJsonData.cartItems.length;\n\n for(var i=0;i<cartItems;i++)\n {\n finalCartQuantity = finalCartQuantity + Number(trJsonData.cartItems[i].quantity);\n }\n }\n \n\n }\n }\n\n edata.cartValue = cartValue;\n edata.cartItems = finalCartQuantity;\n\n\n if(isValid(pageData) && isValid(pageData.orderConfirmation) && isValid(pageData.orderConfirmation.orderID))\n {\n var orderId = pageData.orderConfirmation.orderID;\n var promoCodes = pageData.orderConfirmation.promoCodes;\n\n\n var userVectors = JSON.parse(localStorage.getItem('z1_userVectors'));\n\n\n var temp = {};\n temp.orderId = orderId;\n temp.eventVector = userVectors.eventVector;\n temp.promoCodes = promoCodes;\n\n edata.orderId = orderId;\n //edata.eventVector = userVectors.eventVector;\n edata.promoCodes = promoCodes;\n\n //ZineOne.pushEvent(\"_ws_confirmedOrder\", temp);\n\n }\n\n\n var existingSupc = localStorage.getItem('z1_supc');\n\n if(existingSupc != null && existingSupc != undefined && existingSupc != 'null')\n {\n existingSupc = JSON.parse(existingSupc);\n\n var currentPromoCode = existingSupc.offerCode;\n\n if(edata.promoCodes.toString().indexOf(currentPromoCode) != -1)\n {\n\n\n edata.supc_redeemed = 'true';\n\n sendRTOOmniture();\n \n localStorage.setItem('z1_supc',null);\n \n // if(existingSupc.offType == \"DOLLAR_THR\")\n // {\n // if(cartValue >= parseFloat(existingSupc.offThres))\n // {\n // edata.supc_redeemed = 'true';\n\n // sendRTOOmniture();\n \n // localStorage.setItem('z1_supc',null);\n // }\n // }\n // else\n // {\n \n // }\n }\n\n edata.rtoName = existingSupc.rtoName;\n edata.identifier = existingSupc.identifier;\n\n }\n \n var previousVector = JSON.parse(localStorage.getItem('z1_previousVector'));\n\n var presentVectorTmp = {};\n presentVectorTmp.event = eventCodes._ws_placedorder;\n\n if(!checkForPreviousEvent(presentVectorTmp,previousVector))\n {\n return;\n }\n\n \n\n console.log(\"[ZineOne] Firing _ws_placeOrder Event...\");\n ZineOne.pushEvent(evtName, edata);\n updateUserVectors();\n\n \t\n }\n\n\n init();\n\n}\ncatch(e)\n{\n console.log('Error in order details Tag '+e);\n console.log(e);\n}","eventName":"load","pageSelector":{"type":"pgName","condition":"contains","val":"checkout/v2/order_confirm"}},{"tagName":"FSG new tag","actionType":"z1script","script":"try {\n\n /*function isIE() {\n var ua = window.navigator.userAgent; //Check the userAgent property of the window.navigator object\n var msie = ua.indexOf('MSIE '); // IE 10 or older\n var trident = ua.indexOf('Trident/'); //IE 11\n return (msie > 0 || trident > 0);\n };\n var isIEFlag = isIE();\n if (!isIEFlag) return;\n var cust_id = pageData.customerDetails.customerID ? pageData.customerDetails.customerID : \"\";\n if ( !(cust_id == \"3000000030411692\" || cust_id == \"3000000126553504\") ) return;*/\n console.log(\"[Zineone-I] FSG NEW TAG IE\");\n\n var debug = true;\n\n if(debug) console.log(\"ZINEONE fsg_new_tag\");\n\n var fsgKillSwitch = false;\n\n if (fsgKillSwitch) return;\n\n var TIME_TO_LIVE = 0;\n\n var isValid = function(value) {\n if (value == \"null\" || value == \"undefined\" || value == null || value == undefined) {\n return false;\n }\n return true;\n };\n\n var isNumeric = function(value) {\n return /^-{0,1}\\d+$/.test(value);\n };\n\n var getCookie = function(name) {\n var value = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)'));\n return (value != null) ? unescape(value[2]) : null;\n };\n\n var vID = localStorage.getItem(\"z1_cust_id\");\n if (!isValid(vID)) {\n vID = localStorage.getItem(\"z1_connectUserId\");\n }\n var timestamp = new Date().getTime();\n var send = false;\n var userLoginStatus = pageData.customerDetails.isLoggedIn;\n\n var pg = Z1.window.browserInfo.pagePath;\n var pgName = \"unknownPage\";\n var chkout = false;\n var elementToWatchFor = \"\";\n\n if (pg == \"/\") {\n pgName = \"Home\";\n } else if (pg.startsWith(\"/product\")) {\n pgName = \"PDP\";\n } else if (pg.startsWith(\"/catalog\")) {\n pgName = \"PMP\";\n } else if (pg.startsWith(\"/search\")) {\n pgName = \"Search\";\n } else if (pg.startsWith(\"/checkout\")) {\n pgName = \"Cart\";\n chkout = true;\n if (pg.endsWith(\"shopping_cart.jsp\")) {\n pgName = \"Cart\";\n } else if (pg.endsWith(\"v2/checkout.jsp\")) {\n pgName = \"Checkout\";\n }\n }\n\n elementToWatchFor = (document.getElementsByClassName(\"subtotal\") && document.getElementsByClassName(\"subtotal\")[0]) ? document.getElementsByClassName(\"subtotal\")[0] : \"\";\n\n\n if(debug) console.log(\"ZINEONE FSG NEW elementToWatchFor...\", elementToWatchFor);\n\n if (elementToWatchFor == \"\") return;\n\n //getFSGConfig\n var defaultFSGConfig = {\n '_d': \"0\",\n '_t': \"75\"\n };\n var guestFSGConfig = {\n '_d': \"1\",\n '_t': \"75\"\n };\n\n var paintFSG = function(cartData, fsgData){\n if(debug) console.log(\"ZINEONE FSG NEW paintFSG START\");\n var freeShippingDelta = 0;\n var thresh = fsgData._t;\n var showthreshold = \"$\" + fsgData._t;\n var cartTotal = 0;\n var subTotal = 0;\n var percentageFill = 0;\n cartTotal = cartData.orderSummary.merchandisePromoAmount;\n if(debug) console.log(\"ZINEONE FSG NEW thresh...\", thresh, \"...cartTotal...\", cartTotal);\n if ((cartData != null) && (cartData.shipmentInfo.length > 0)) {\n for (var k = 0; k < cartData.shipmentInfo.length; k++) {\n if ((cartData.shipmentInfo[k].shippingMethod == \"BOPUS\") || (cartData.shipmentInfo[k].shippingMethod == \"BOSS\")) {\n continue;\n } else if (cartData.shipmentInfo[k].shippingMethod == \"STD\") {\n freeShippingDelta = cartData.shipmentInfo[k].shipmentPriceInfo.freeShipQualificationDelta;\n break;\n }\n }\n } else {\n freeShippingDelta = (thresh - cartTotal).toFixed(2);\n }\n if(debug) console.log(\"ZINEONE FSG NEW freeShippingDelta...\", freeShippingDelta);\n subTotal = freeShippingDelta > 0 ? (thresh - freeShippingDelta).toFixed(2) : freeShippingDelta === 0 && cartTotal >= thresh ? thresh : 0; // returns total-delta\n if (subTotal == 0) return;\n if(debug) console.log(\"ZINEONE FSG NEW subTotal...\", subTotal);\n percentageFill = Math.round(100 / thresh * subTotal);\n\n if(debug) console.log(\"ZINEONE FSG NEW percentageFill...\", percentageFill);\n\n //var meterBar = '<div id=\"js-meter-summary-2\" style=\"display:block\" class=\"tce-small-ship-meter-cartDetails\"><div class=\"tce-small-ship-meter-cartDetails-left\">$0</div><div id=\"js-free-shipping-meter2\" class=\"tce-small-ship-meter-cartDetails-meter\"></div><div class=\"tce-small-ship-meter-cartDetails-right\"> ' + showthreshold + '</div> </div>';\n var diffUI = ($('.freeShipMessFirst') && $('.freeShipMessFirst')[0]) ? true : false;\n var meterBar = \"\";\n if (diffUI) {\n meterBar = '<div style=\"margin:20px;\"></div><div id=\"js-meter-summary-2\" style=\"display:block\" class=\"tce-small-ship-meter-cartDetails\"><div class=\"tce-small-ship-meter-cartDetails-left\">$0</div><div id=\"js-free-shipping-meter2\" class=\"tce-small-ship-meter-cartDetails-meter\"></div><div class=\"tce-small-ship-meter-cartDetails-right\"> ' + showthreshold + '</div> </div>';\n } else {\n meterBar = '<div id=\"js-meter-summary-2\" style=\"display:block\" class=\"tce-small-ship-meter-cartDetails\"><div class=\"tce-small-ship-meter-cartDetails-left\">$0</div><div id=\"js-free-shipping-meter2\" class=\"tce-small-ship-meter-cartDetails-meter\"></div><div class=\"tce-small-ship-meter-cartDetails-right\"> ' + showthreshold + '</div> </div>';\n }\n var noMeterBar = '<div id=\"js-meter-summary-2\" style=\"display: none;\" class=\"tce-small-ship-meter-freeShipDetails\">You’ve earned free shipping!</div>';\n if(debug) console.log(\"ZINEONE FSG NEW subTotal...\", subTotal);\n if(debug) console.log(\"ZINEONE FSG NEW thresh...\", thresh);\n if(debug) console.log(\"ZINEONE FSG NEW condition1...\", (subTotal > 0));\n if(debug) console.log(\"ZINEONE FSG NEW condition2...\", (subTotal < thresh));\n if(debug) console.log(\"ZINEONE FSG NEW condition...\", (subTotal > 0 && subTotal < thresh));\n var miniCart = (Number(subTotal) > 0 && Number(subTotal) < Number(thresh)) ? meterBar : noMeterBar; // (subTotal > 0 && subTotal < thresh) ? meterBar : noMeterBar;\n\n if(debug) console.log(\"ZINEONE FSG NEW percentageFill...\", miniCart);\n if (pgName == \"Cart\") {\n if(debug) console.log(\"ZINEONE FSG NEW before appending testing...\", ($('#js-free-shipping-meter2')[0] ? \"meter shown\" : \"no meter\"));\n var isMeterExist = $('#js-free-shipping-meter2')[0] ? true : false;\n if (!isMeterExist) {\n $(\".freeShipSuggestMessage\").append(miniCart);\n }\n //$(\".freeShipSuggestMessage\").append(miniCart);\n $(\"#js-free-shipping-meter1, #js-free-shipping-meter2\").css({\n background: \"linear-gradient(to right,#167d9a 0%,#167d9a \" + percentageFill + \"%,rgb(220, 238, 240) \" + percentageFill + \"%,rgb(220, 238, 240) 100%)\",\n \"border-radius\": \"2px\"\n });\n } else if (pgName != \"Cart\") {\n if(debug) console.log(\"ZINEONE FSG NEW before appending testing...\", ($('#js-free-shipping-meter2')[0] ? \"meter shown\" : \"no meter\"));\n var isMeterExist = $('#js-free-shipping-meter2')[0] ? true : false;\n if (!isMeterExist) {\n $(\".tr_phase2_add_padding_ghr\").append(miniCart);\n }\n $(\"#js-free-shipping-meter1, #js-free-shipping-meter2\").css({\n background: \"linear-gradient(to right,#167d9a 0%,#167d9a \" + percentageFill + \"%,rgb(255, 255, 255) \" + percentageFill + \"%,rgb(255, 255, 255) 100%)\",\n \"border-radius\": \"2px\"\n });\n if(debug) console.log(\"ZINEONE FSG NEW after appending testing...\", ($('#js-free-shipping-meter2')[0] ? \"meter shown\" : \"no meter\"));\n }\n if(debug) console.log(\"ZINEONE FSG NEW paintFSG END\");\n }\n\n var miniCartBar = function(fsgData) {\n if(debug) console.log(\"ZINEONE FSG NEW miniCartBar function!\", fsgData);\n if (pgName != \"Cart\") {\n if(debug) console.log(\"ZINEONE FSG NEW Not on Cart Page\");\n let s = Kjs.PB.getPbCartStorage();\n if(!isValid(s)) return;\n if(debug) console.log(\"ZINEONE FSG NEW s...\",s);\n paintFSG(s, fsgData);\n } else {\n if(debug) console.log(\"ZINEONE FSG NEW On Cart Page\");\n let s = trJsonData;\n if (!isValid(s)) return;\n if (s != \"null\" && s.status != \"Failure\") {\n paintFSG(s, fsgData);//trJsonData is available in all browsers\n }\n }\n };\n\n var fsg = function(fsgData) {\n if(debug) console.log(\"ZINEONE FSG NEW FUNCTION CALLED!\", fsgData);\n\n //////////SAIKAT - Test////////////\n if(debug) console.log(\"ZINEONE - Landed fsg function and setting localStorage\");\n localStorage.setItem('z1_fsg_data', JSON.stringify(fsgData));\n ///////////////////////////////////\n\n //var fsgStyles = \"<style type=\\\"text/css\\\"> #tce-ship-meter {display: block;clear: both;}.tce-meter-copy {position: absolute;top: 50%;left: 8em;transform: translateY(-50%);}.tce-meter-copy p {font-size: 16px;color: #000; font-family:'Gotham 5r', Helvetica, sans-serif;text align:center;}.tce-meter-copy span {font-size: 16px;color: #108281; font-family:'Gotham 5r', Helvetica, sans-serif;}.tce-meter-bar * {all: unset;}.tce-meter-bar {position: absolute;float: left;width: 315px;left: 49em;top: 1.2em;}.tce-meter-bar p {display: block;-webkit-margin-before: 1em;-webkit-margin-after: 1em;-webkit-margin-start: 0;-webkit-margin-end: 0;}.tce-ship-meter-cartDetails {width:100%;text-align:center;max-width: 1044px;margin-left: auto;margin-right: auto;display:block;position:relative;height:39px;text-align: center;background-color:#f0f0f0;}.tce-ship-meter-cartDetails__gauge {display: block;height: auto; width:100%;}.tce-ship-meter-cartDetails-meter {margin: 0 auto;width: 100%;height: 13px;position: absolute;left: 2.5em;}.tce-ship-meter-cartDetails-left {font-size: 11px;font-family:'Gotham 4r', Helvetica, sans-serif;color: #000;font-weight: bold;position: absolute;left: 0;}.tce-ship-meter-cartDetails-right {font-size: 11px;font-family:'Gotham 4r', Helvetica, sans-serif;font-weight: bold;color: #000;position: absolute;left: 112%;top: 0;}.tce-small-ship-meter-cartDetails {display:block;position:relative;width: 158px;height: 28px;top: 18px;margin-top:2px;}.tce-small-ship-meter-cartDetails-left {font-size: 11px;color:#3e3e3e;font-weight:bold;position:absolute;font-family:'Gotham 4r', Helvetica, sans-serif;}.tce-small-ship-meter-cartDetails-meter {margin: 0 auto;width: 100%;height: 9px;position: absolute;left: 2.5em;margin-left: -8px;}.tce-small-ship-meter-cartDetails-right {font-size: 11px;font-weight: bold;color:#3e3e3e;position: absolute;left: 125%;top: 0;font-family:'Gotham 4r', Helvetica, sans-serif;margin-left: -12px;}.tce-small-ship-meter-freeShipDetails {clear:both;height: 20px;font-family: 'Gotham 5r','GothamBold',Helvetica,Arial,sans-serif;font-size: 11px; font-style: normal;font-stretch: normal;line-height: normal;letter-spacing: -0.24px;color: #15718a;top: 5px;position: relative;}.tce-small-ship-text-z1{font-weight: bold;font-style: normal;font-stretch: normal;line-height: normal;letter-spacing: -0.24px;text-align: center;color: #15718a;font-family: 'Gotham 5r', Helvetica, sans-serif;margin-left: 5px;}</style>\";\n \tvar fsgStyles = \"<style type=\\\"text/css\\\"> #tce-ship-meter {display: block;clear: both;}.tce-meter-copy {position: absolute;top: 50%;left: 8em;transform: translateY(-50%);}.tce-meter-copy p {font-size: 16px;color: #000; font-family:'Gotham 5r', Helvetica, sans-serif;text align:center;}.tce-meter-copy span {font-size: 16px;color: #108281; font-family:'Gotham 5r', Helvetica, sans-serif;}.tce-meter-bar * {all: unset;}.tce-meter-bar {position: absolute;float: left;width: 315px;left: 49em;top: 1.2em;}.tce-meter-bar p {display: block;-webkit-margin-before: 1em;-webkit-margin-after: 1em;-webkit-margin-start: 0;-webkit-margin-end: 0;}.tce-ship-meter-cartDetails {width:100%;text-align:center;max-width: 1044px;margin-left: auto;margin-right: auto;display:block;position:relative;height:39px;text-align: center;background-color:#f0f0f0;}.tce-ship-meter-cartDetails__gauge {display: block;height: auto; width:100%;}.tce-ship-meter-cartDetails-meter {margin: 0 auto;width: 100%;height: 13px;position: absolute;left: 2.5em;}.tce-ship-meter-cartDetails-left {font-size: 11px;font-family:'Gotham 4r', Helvetica, sans-serif;color: #000;font-weight: bold;position: absolute;left: 0;}.tce-ship-meter-cartDetails-right {font-size: 11px;font-family:'Gotham 4r', Helvetica, sans-serif;font-weight: bold;color: #000;position: absolute;left: 112%;top: 0;}.tce-small-ship-meter-cartDetails {display:block;position:relative;width: 158px;clear:both;height: 14px;padding-top:6px;/*top: 18px;margin-top:2px;*/}.tce-small-ship-meter-cartDetails-left {font-size: 11px;color:#3e3e3e;font-weight:bold;position:absolute;font-family:'Gotham 4r', Helvetica, sans-serif;}.tce-small-ship-meter-cartDetails-meter {margin: 0 auto;width: 100%;height: 9px;position: absolute;left: 2.5em;margin-left: -8px;}.tce-small-ship-meter-cartDetails-right {font-size: 11px;font-weight: bold;color:#3e3e3e;position: absolute;left: 125%;/*top: 0;*/font-family:'Gotham 4r', Helvetica, sans-serif;margin-left: -12px;}.tce-small-ship-meter-freeShipDetails {clear:both;height: 20px;font-family: 'Gotham 5r','GothamBold',Helvetica,Arial,sans-serif;font-size: 11px; font-style: normal;font-stretch: normal;line-height: normal;letter-spacing: -0.24px;color: #15718a;top: 5px;position: relative;}.tce-small-ship-text-z1{font-weight: bold;font-style: normal;font-stretch: normal;line-height: normal;letter-spacing: -0.24px;text-align: center;color: #15718a;font-family: 'Gotham 5r', Helvetica, sans-serif;margin-left: 5px;}</style>\";\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n\n head.appendChild(style);\n\n style.type = 'text/css';\n if (style.styleSheet) {\n // This is required for IE8 and below.\n style.styleSheet.cssText = fsgStyles;\n } else {\n style.appendChild(document.createTextNode(fsgStyles));\n }\n miniCartBar(fsgData.fsg); //Default Call for CartPage\n var mutationObserver = new MutationObserver(function(mutations) {\n mutations.forEach(function(mutation) {\n if(debug) console.log(\"ZINEONE FSG NEW miniCartBar called!\");\n if(debug) console.log(\"ZINEONE FSG NEW mutation...\", mutation);\n miniCartBar(fsgData.fsg);\n });\n });\n mutationObserver.disconnect();\n mutationObserver.observe(elementToWatchFor, {\n attributes: true,\n characterData: true,\n childList: true,\n subtree: true,\n attributeOldValue: true,\n characterDataOldValue: true\n });\n };\n\n var fsg_data = localStorage.getItem(\"z1_fsg_data\");\n if (fsg_data != null && !chkout) {\n delT = (timestamp - JSON.parse(fsg_data).timestamp);\n if (vID != JSON.parse(fsg_data).visitorId) {\n send = true;\n } else if (delT / 60000 > TIME_TO_LIVE) {\n send = true;\n } else if ((!userLoginStatus) || String(userLoginStatus).includes(\"false\")) {\n send = true;\n } else {\n fsg(fsg_data);\n }\n } else {\n send = true;\n }\n\n if (send) {\n if (!isNumeric(vID)) {\n if(debug) console.log(\"ZINEONE [ZineOne] Anonymous user - \" + vID);\n var guest_fsg_data = {\n fsg: guestFSGConfig,\n timestamp: timestamp,\n visitorId: vID\n };\n localStorage.setItem('z1_fsg_data', JSON.stringify(guest_fsg_data));\n fsg(guest_fsg_data);\n } else {\n var dummy_data = {\n fsg: defaultFSGConfig,\n timestamp: timestamp,\n visitorId: vID\n };\n localStorage.setItem('z1_fsg_data', JSON.stringify(dummy_data));\n ZineOne.pushEvent(\"_ws_z1__sb_fsg\", {});\n }\n }\n\n var z1ResponseHandler = function(e) {\n if(debug) console.log(\"ZINEONE Reached z1ResponseHandler in FSG NEW TAG\");\n if (e.detail && e.detail.fsg) {\n fsg(e.detail);\n }\n };\n document.addEventListener(\"onZ1RawData\", z1ResponseHandler, false);\n} catch (e) {\n console.log(\"ZINEONE Error in fsg_new_tag \" + e);\n}","eventName":"load","pageSelector":{"type":"all","condition":"equals","val":""}},{"tagName":"addtobagNew","actionType":"z1script","script":"\n var debugScr = true;\ntry {\n console.log(\"In addtobagNew\");\n\n var addToBagClickHandler = function() {\n\n\n \n console.log(\"In addtobagNew clicked\");\n /*\n * Manish: Webstore instrumentation for all pages except OrderConfirmation and MyAccount\n * Varun: Added isNumeric to check if CustomerID is for Guest User\n * Manish: 05/18 Moved addEventData() to within try-catch block\n * Juzer: Checking for persistent_bar_components_json_v1 for ProductId before pushEvent\n * Juzer: Added ML Instrumentation\n * Juzer: Race condition validation check for the product count\n */\n try {\n \n var cartValue = 0;\n var currentUserCartArr = [];\n\n var isJsonNull = false;\n\n if (debugScr) console.log(\"[ZineOne] addtobag Event will be triggered\");\n\n var evtName = \"_ws_addedtobag\";\n\n //Event Codes for vectors:\n var eventCodes = {\n _ws_addedtobag: \"A\",\n breachedgeofence: \"B\",\n _ws_completeshipping: \"C\",\n exitgeofence: \"D\",\n _ws_placedorder: \"E\",\n _ws_searched: \"F\",\n _ws_startedcheckout: \"G\",\n _ws_viewedcart: \"H\",\n _ws_viewedcatalog: \"I\",\n _ws_viewedhome: \"J\",\n _ws_viewedproduct: \"K\",\n _ws_completepayment: \"L\",\n _ws_viewedsku: \"M\",\n _ws_update_hcart: \"N\",\n _ws_changedsort: \"O\",\n _ws_rto: \"R\"\n };\n\n var SESSION_GAP = 1800000; //30min = 30*60*1000 millis\n\n\n\n var evtData = {};\n\n function isNumeric(value) {\n return /^-{0,1}\\d+$/.test(value);\n }\n\n // Get cookie from user's browser/desktop\n function getCookie(name) {\n var re = new RegExp(name + \"=([^;]+)\");\n var value = re.exec(document.cookie);\n return (value != null) ? unescape(value[1]) : null;\n }\n\n function isValid(value) {\n if (value == \"null\" || value == \"undefined\" || value == null || value == undefined) {\n return false;\n }\n\n return true;\n }\n\n\n function getCurrentBagCount(cartInfo) {\n console.log('Got Cart Info ' + cartInfo);\n var itemsInBag = 0;\n\n console.log('Got Cart Items Length ' + cartInfo.cartItems.length);\n\n for (var i = 0; i < cartInfo.cartItems.length; i++) {\n\n itemsInBag = itemsInBag + cartInfo.cartItems[i].quantity;\n }\n\n return itemsInBag;\n }\n\n function getSkuPriceObj(skuId)\n {\n if(pageData.productDetails && pageData.productDetails.pageItems && pageData.productDetails.pageItems[0] && pageData.productDetails.pageItems[0].SKUS)\n {\n var skuArr = pageData.productDetails.pageItems[0].SKUS;\n\n for(var i=0;i<skuArr.length;i++)\n {\n var tempObj = skuArr[i]\n\n if(tempObj.skuId == skuId)\n {\n return tempObj;\n }\n }\n }\n\n return null;\n }\n\n function addEventData() {\n\n if (debugScr) {\n console.log('[Zineone] Starting to check for New Product in Cart');\n }\n\n var cartData = localStorage.getItem('persistent_bar_components_json_v1');\n //if (debugScr) console.log(\"[ZineOne] CartData = \" + cartData);\n var cartInfo = JSON.parse(cartData);\n\n var prodFound = false;\n\n if (cartInfo && cartInfo.cartItems) {\n //Check if the cartInfo has the product Id\n\n var newProdId = -1;\n\n if(pageData.productDetails && pageData.productDetails.pageItems && pageData.productDetails.pageItems[0] && pageData.productDetails.pageItems[0].productID)\n {\n newProdId = pageData.productDetails.pageItems[0].productID;\n }\n if(productV2JsonData && productV2JsonData.webID){\n newProdId = productV2JsonData.webID;\n }\n\n /*if (typeof productId != 'undefined') {\n\n newProdId = productId;\n }*/\n\n \n\n for (var i = 0; i < cartInfo.cartItems.length; i++) {\n var tempProdId = cartInfo.cartItems[i].productId;\n if (tempProdId == newProdId) {\n\n\n var lastBagCount = 0;\n\n if (localStorage.getItem('z1_checkoutBagCount')) {\n lastBagCount = Number(localStorage.getItem('z1_checkoutBagCount'));\n }\n\n\n var currentBagCount = getCurrentBagCount(cartInfo);\n\n if (currentBagCount > lastBagCount) {\n if (debugScr) {\n console.log('[Zineone] Found Product directly in persistent_bar_components_json_v1');\n }\n prodFound = true;\n sendEventOnSuccess();\n }\n\n }\n }\n\n }\n\n if (debugScr && prodFound == false) {\n console.log('[Zineone] Could not find product in 1st Check');\n }\n\n\n if (prodFound == false) {\n if (debugScr) {\n console.log('[Zineone] Inside prodFound == false after 1st Check');\n }\n\n var period = 500;\n var tCount = 0;\n var MAX_TCount = 10;\n\n\n\n var timer = setInterval(function() {\n try {\n tCount++;\n //if (debugScr) console.log(\"[ZineOne] timerCount=\" + tCount);\n if (prodFound == true) {\n if (debugScr) {\n console.log('[Zineone] Found Product in persistent_bar_components_json_v1 after count: ' + tCount);\n }\n\n clearInterval(timer);\n\n } else if (tCount <= MAX_TCount) {\n\n cartData = localStorage.getItem('persistent_bar_components_json_v1');\n //if (debugScr) console.log(\"[ZineOne] CartData = \" + cartData);\n cartInfo = JSON.parse(cartData);\n\n // if (cartInfo == null || cartInfo.cartItems == null || cartInfo.cartItems.length <= 0)\n // return true;\n\n var newProdId = -1;\n\n if(pageData.productDetails && pageData.productDetails.pageItems && pageData.productDetails.pageItems[0] && pageData.productDetails.pageItems[0].productID)\n {\n newProdId = pageData.productDetails.pageItems[0].productID;\n }\n if(productV2JsonData && productV2JsonData.webID){\n newProdId = productV2JsonData.webID;\n }\n\n /*if (typeof productId != 'undefined') {\n\n newProdId = productId;\n }*/\n\n console.log('CartInfo from SetInterval ', cartInfo);\n if (cartInfo.cartItems) {\n for (var i = 0; i < cartInfo.cartItems.length; i++) {\n var tempProdId = cartInfo.cartItems[i].productId;\n if (tempProdId == newProdId) {\n\n\n var lastBagCount = 0;\n\n if (localStorage.getItem('z1_checkoutBagCount')) {\n lastBagCount = Number(localStorage.getItem('z1_checkoutBagCount'));\n }\n\n\n var currentBagCount = getCurrentBagCount(cartInfo);\n\n if (currentBagCount > lastBagCount) {\n if (debugScr) {\n console.log('[Zineone] Found Product in persistent_bar_components_json_v1 after count: ' + tCount);\n }\n\n prodFound = true;\n\n if (debugScr) {\n console.log('[Zineone] Before sendEventOnSuccess inside SetInterval Found After Count ' + tCount);\n }\n sendEventOnSuccess();\n\n clearInterval(timer);\n\n break;\n }\n\n }\n }\n }\n\n\n }\n } catch (ie) {\n if (debugScr) console.log(\"[Zineone] Exception in setInterval \" + ie);\n }\n }, period);\n\n\n }\n\n\n\n }\n\n\n var isSoftLoggedIn = getCookie(\"SoftLoggedInCookie\");\n if (isSoftLoggedIn && isSoftLoggedIn.includes(\"true\")) {\n if (debugScr) console.log(\"[ZineOne] Soft Logged value is:\" + isSoftLoggedIn);\n }\n // Set HardLoggedIn = true only if user is not SoftLoggedIn\n var isLoggedIn = \"\";\n\n\n if (pageData && pageData.customerDetails) {\n if (!isSoftLoggedIn || (isSoftLoggedIn && !isSoftLoggedIn.includes(\"true\"))) {\n if (pageData.customerDetails.isLoggedIn) isLoggedIn = \"true\";\n }\n }\n\n\n\n var sendevt;\n\n sendevt = addEventData();\n\n if (debugScr)\n console.log('[Zineone] AddedToBag Event Code block Complete ');\n\n\n function sendEventOnSuccess() {\n\n if (debugScr)\n console.log('[Zineone] Into SendEventOnSuccess ');\n\n var productsArr = [];\n\n var cartData = localStorage.getItem('persistent_bar_components_json_v1');\n //if (debugScr) console.log(\"[ZineOne] CartData = \" + cartData);\n var cartInfo = JSON.parse(cartData);\n\n //Send the Event even if the Cart does not have any item, so that the OpenAPI could be called\n //on the Server side\n\n var itemsInBag = 0;\n var productIdList = '';\n\n for (var i = 0; i < cartInfo.cartItems.length; i++) {\n var si = cartInfo.cartItems[i];\n var obj = {\n \"id\": si.cartItemId,\n \"sku\": si.skuId,\n \"webID\": si.productId,\n \"saleUnitPrice\": si.itemPriceInfo.saleUnitprice.toString(),\n \"regularUnitPrice\": si.itemPriceInfo.regularUnitPrice.toString(),\n \"quantity\": si.quantity.toString()\n };\n\n productsArr.push(obj);\n\n\n itemsInBag = itemsInBag + cartInfo.cartItems[i].quantity;\n\n var sku = cartInfo.cartItems[i].skuId;\n var qty = cartInfo.cartItems[i].quantity;\n\n if (i > 0) productIdList = productIdList + \"|\";\n\n productIdList = productIdList + sku + \":\" + qty;\n }\n\n\n localStorage.setItem('z1_checkoutBagCount', itemsInBag);\n localStorage.setItem('z1_checkoutProductIdList', productIdList);\n\n\n evtData[\"cartItems\"] = JSON.stringify(productsArr);\n\n evtData['page'] = \"PDP\";\n\n\n ZineOne.pushEvent(evtName, evtData);\n\n updateUserVectors();\n\n }\n\n\n function checkForPreviousEvent() {\n console.log('checkForPreviousEvent');\n\n var previousVector = JSON.parse(localStorage.getItem('z1_previousVector'));\n\n if (previousVector.event == eventCodes.viewedproduct) {\n var prevProdId = previousVector.productID;\n\n console.log('Got ProductId from previousEventVector ' + prevProdId);\n\n return prevProdId;\n }\n\n return '-';\n }\n\n\n function getUrlParameter(sParam) {\n var sPageURL = decodeURIComponent(window.location.search.substring(1)),\n sURLVariables = sPageURL.split('&'),\n sParameterName,\n i;\n\n for (i = 0; i < sURLVariables.length; i++) {\n sParameterName = sURLVariables[i].split('=');\n\n if (sParameterName[0] === sParam) {\n return sParameterName[1] === undefined ? true : sParameterName[1];\n }\n }\n }\n\n\n function validateForNotNull(obj) {\n //console.log('validateForNotNull',obj,typeof(obj));\n if (!(obj === undefined) && obj != null && obj != 'null' && obj.toString().length != 0) {\n return true;\n }\n\n return false;\n }\n\n function spltArrayObjectDataIntoVector(array, attribute) {\n var stringVector = '';\n\n console.log(\"spltArrayObjectDataIntoVector attribute\", attribute, array);\n\n if (!validateForNotNull(array)) {\n\n return stringVector;\n\n }\n\n if (array.length == 0) {\n return stringVector;\n }\n\n\n for (var i = 0; i < array.length; i++) {\n var innerObj = array[i];\n\n var attributeValue = '#';\n if (validateForNotNull(innerObj) && validateForNotNull(innerObj[attribute])) {\n\n attributeValue = innerObj[attribute];\n\n }\n\n\n stringVector = stringVector + attributeValue + '^';\n }\n\n stringVector = stringVector.substring(0, stringVector.length - 1);\n\n return stringVector;\n\n }\n\n function spltArrayObjectWithArrayObjectDataIntoVector(array, mainAttribute, innerAttribute) {\n var stringVector = '';\n\n console.log(\"spltArrayObjectWithArrayObjectDataIntoVector mainAttribute\", mainAttribute, innerAttribute, array);\n\n\n if (!validateForNotNull(array)) {\n\n return stringVector;\n\n }\n\n if (array.length == 0) {\n return stringVector;\n }\n\n\n for (var i = 0; i < array.length; i++) {\n var innerObj = array[i];\n var attributeValueArr = innerObj[mainAttribute];\n\n console.log('spltArrayObjectDataIntoVector ', spltArrayObjectDataIntoVector(attributeValueArr, innerAttribute));\n stringVector = stringVector + spltArrayObjectDataIntoVector(attributeValueArr, innerAttribute) + '^';\n }\n\n stringVector = stringVector.substring(0, stringVector.length - 1);\n\n return stringVector;\n\n }\n\n\n function spltArrayObjectWithAttributeObjectDataIntoVector(array, mainAttribute, innerAttribute) {\n\n var stringVector = '';\n\n if (!validateForNotNull(array)) {\n\n return stringVector;\n\n }\n\n if (array.length == 0) {\n return stringVector;\n }\n\n for (var i = 0; i < array.length; i++) {\n var innerObj = array[i];\n\n var attributeValue = '-';\n if (validateForNotNull(innerObj) && validateForNotNull(innerObj[mainAttribute]) && validateForNotNull(innerObj[mainAttribute][innerAttribute])) {\n\n attributeValue = innerObj[mainAttribute][innerAttribute];\n\n }\n\n\n stringVector = stringVector + attributeValue + '~';\n }\n\n stringVector = stringVector.substring(0, stringVector.length - 1);\n\n return stringVector;\n\n }\n\n\n function checkForPreviousEvent() {\n console.log('checkForPreviousEvent');\n\n var previousVector = JSON.parse(localStorage.getItem('z1_previousVector'));\n\n if (previousVector.event == eventCodes.viewedproduct) {\n var prevProdId = previousVector.productID;\n\n console.log('Got ProductId from previousEventVector ' + prevProdId);\n\n return prevProdId;\n }\n\n return '-';\n }\n\n function fetchCartDump() {\n\n var persistLocalData = localStorage.getItem('persistent_bar_components_json_v1');\n\n if (!isValid(persistLocalData)) {\n persistLocalData = JSON.stringify(Kjs.PB.getPbCartStorage());\n }\n\n if (validateForNotNull(persistLocalData)) {\n\n var finalCartJSON = {};\n finalCartJSON.cartItems = [];\n\n persistLocalData = JSON.parse(persistLocalData);\n\n cartData = persistLocalData.cartItems;\n\n if (validateForNotNull(cartData)) {\n for (var i = 0; i < cartData.length; i++) {\n if (i == 15) {\n break;\n }\n\n var currentFinalObjToSend = {};\n\n var currentObj = cartData[i];\n currentFinalObjToSend.sku = currentObj.skuId;\n currentFinalObjToSend.prdId = currentObj.productId;\n currentFinalObjToSend.qty = currentObj.quantity;\n\n if (validateForNotNull(currentObj.storeClearance)) {\n currentFinalObjToSend.sc = currentObj.storeClearance;\n }\n\n if (validateForNotNull(currentObj.itemProperties.size)) {\n currentFinalObjToSend.size = currentObj.itemProperties.size;\n }\n\n if (validateForNotNull(currentObj.itemProperties.color)) {\n currentFinalObjToSend.color = currentObj.itemProperties.color;\n }\n\n if (validateForNotNull(currentObj.itemProperties.isWebExclusive)) {\n currentFinalObjToSend.isWebExcl = currentObj.itemProperties.isWebExclusive;\n }\n\n\n var finalInvInfo = {};\n\n if (validateForNotNull(currentObj.inventoryInfo.shipAvailable)) {\n finalInvInfo.shpAvai = currentObj.inventoryInfo.shipAvailable;\n }\n\n if (validateForNotNull(currentObj.inventoryInfo.bopusAvailable)) {\n finalInvInfo.bopAvail = currentObj.inventoryInfo.bopusAvailable;\n }\n\n if (validateForNotNull(currentObj.inventoryInfo.bossAvailable)) {\n finalInvInfo.bosAvail = currentObj.inventoryInfo.bossAvailable;\n }\n\n if (validateForNotNull(currentObj.inventoryInfo.invOnHandQtyShip)) {\n finalInvInfo.invOHQShip = currentObj.inventoryInfo.invOnHandQtyShip;\n }\n\n if (validateForNotNull(currentObj.finalInvInfo)) {\n currentFinalObjToSend.invInfo = currentObj.finalInvInfo;\n }\n\n\n var currentPromoInfo = currentObj.promoInfo;\n\n console.log(' currentPromoInfo ', currentPromoInfo);\n\n if (validateForNotNull(currentPromoInfo)) {\n var finalPromoArray = [];\n\n var prTypeArr = [];\n var prTextArr = [];\n\n for (var j = 0; j < currentPromoInfo.length; j++) {\n var currentPromoObj = currentPromoInfo[j];\n var tempPromoObj = {};\n\n if (validateForNotNull(currentPromoObj.promoType)) {\n prTypeArr[prTypeArr.length] = currentPromoObj.promoType;\n }\n\n if (validateForNotNull(currentPromoObj.promoText)) {\n prTextArr[prTextArr.length] = currentPromoObj.promoText;\n }\n\n\n\n }\n\n currentFinalObjToSend.prType = prTypeArr.join('|');\n currentFinalObjToSend.prText = prTextArr.join('|');\n }\n\n\n\n var currentOfferInfo = currentObj.offerInfo;\n\n console.log(' currentOfferInfo ', currentOfferInfo);\n\n if (validateForNotNull(currentOfferInfo)) {\n var finalOfferInfoArray = [];\n\n for (var j = 0; j < currentOfferInfo.length; j++) {\n var currentOfferInfoObj = currentOfferInfo[j];\n var tempOfferInfoObj = {};\n\n if (validateForNotNull(currentOfferInfoObj.offerDiscount)) {\n tempOfferInfoObj.ofDis = currentOfferInfoObj.offerDiscount;\n }\n\n if (validateForNotNull(currentOfferInfoObj.startDate)) {\n tempOfferInfoObj.stDt = currentOfferInfoObj.startDate;\n }\n\n if (validateForNotNull(currentOfferInfoObj.endDate)) {\n tempOfferInfoObj.enDT = currentOfferInfoObj.endDate;\n }\n\n\n finalOfferInfoArray[finalOfferInfoArray.length] = tempOfferInfoObj;\n\n }\n\n currentFinalObjToSend.offInfo = finalOfferInfoArray;\n }\n\n\n finalCartJSON.cartItems[finalCartJSON.cartItems.length] = currentFinalObjToSend;\n }\n }\n\n\n\n\n var shipmentInfo = persistLocalData.shipmentInfo;\n\n console.log(' shipmentInfo ', shipmentInfo);\n\n if (validateForNotNull(shipmentInfo)) {\n var finalshipmentInfoArray = [];\n\n for (var j = 0; j < shipmentInfo.length; j++) {\n var currentshipmentInfoObj = shipmentInfo[j];\n var tempShipmentInfoObj = {};\n\n if (validateForNotNull(currentshipmentInfoObj.shipmentPriceInfo.originalShippingCharges)) {\n tempShipmentInfoObj.ogShpChrgs = currentshipmentInfoObj.shipmentPriceInfo.originalShippingCharges;\n }\n\n if (validateForNotNull(currentshipmentInfoObj.shipmentPriceInfo.shippingChargesAfterDiscount)) {\n tempShipmentInfoObj.shpChrgsADis = currentshipmentInfoObj.shipmentPriceInfo.shippingChargesAfterDiscount;\n }\n\n if (validateForNotNull(currentshipmentInfoObj.shipmentPriceInfo.freeShipQualificationDelta)) {\n tempShipmentInfoObj.freeShpQlfDelta = currentshipmentInfoObj.shipmentPriceInfo.freeShipQualificationDelta;\n }\n\n if (validateForNotNull(currentshipmentInfoObj.shipmentPriceInfo.shipmentItemsTotal)) {\n tempShipmentInfoObj.shpItmsTot = currentshipmentInfoObj.shipmentPriceInfo.shipmentItemsTotal;\n }\n\n\n\n var shippingOffers = currentshipmentInfoObj.shippingOffers;\n if (validateForNotNull(shippingOffers)) {\n var finalshippingOfferArray = [];\n\n for (var k = 0; k < shippingOffers.length; k++) {\n var currentshippingOffersObj = shippingOffers[k];\n\n if (validateForNotNull(currentshippingOffersObj.discountAmount)) {\n finalshippingOfferArray[finalshippingOfferArray.length] = currentshippingOffersObj.discountAmount;\n }\n\n }\n\n\n tempShipmentInfoObj.disAmnt = finalshippingOfferArray.join('|');\n\n\n }\n\n finalshipmentInfoArray[finalshipmentInfoArray.length] = tempShipmentInfoObj;\n\n\n }\n\n finalCartJSON.shipmentInfo = finalshipmentInfoArray;\n }\n\n var orderSummary = persistLocalData.orderSummary;\n\n var finalOrderSummaryObj = {};\n\n if (validateForNotNull(orderSummary.merchandisePromoAmount)) {\n finalOrderSummaryObj.merProAmnt = orderSummary.merchandisePromoAmount;\n }\n\n if (validateForNotNull(orderSummary.discountedShippingAmount)) {\n finalOrderSummaryObj.disShpAmnt = orderSummary.discountedShippingAmount;\n }\n\n if (validateForNotNull(orderSummary.originalShippingAmount)) {\n finalOrderSummaryObj.ogShpAmnt = orderSummary.originalShippingAmount;\n }\n\n if (validateForNotNull(orderSummary.tax) && validateForNotNull(orderSummary.tax.estimated)) {\n finalOrderSummaryObj.taxest = orderSummary.tax.estimated;\n }\n\n if (validateForNotNull(orderSummary.tax) && validateForNotNull(orderSummary.tax.taxRate)) {\n finalOrderSummaryObj.taxRate = orderSummary.tax.taxRate;\n }\n\n if (validateForNotNull(orderSummary.tax) && validateForNotNull(orderSummary.tax.tax)) {\n finalOrderSummaryObj.tax = orderSummary.tax.tax;\n }\n\n if (validateForNotNull(orderSummary.totalSurcharges)) {\n finalOrderSummaryObj.totSurgs = orderSummary.totalSurcharges;\n }\n\n if (validateForNotNull(orderSummary.totalTaxFee)) {\n finalOrderSummaryObj.totTaxFee = orderSummary.totalTaxFee;\n }\n\n if (validateForNotNull(orderSummary.totalKohlsCashAndPromoDiscounts)) {\n finalOrderSummaryObj.totKCAProDis = orderSummary.totalKohlsCashAndPromoDiscounts;\n }\n\n if (validateForNotNull(orderSummary.totalTax)) {\n finalOrderSummaryObj.totTax = orderSummary.totalTax;\n }\n\n if (validateForNotNull(orderSummary.total)) {\n finalOrderSummaryObj.total = orderSummary.total;\n }\n\n if (validateForNotNull(orderSummary.savings)) {\n finalOrderSummaryObj.sav = orderSummary.savings;\n }\n\n if (validateForNotNull(orderSummary.taxFeeEnabled)) {\n finalOrderSummaryObj.taxFeeE = orderSummary.taxFeeEnabled;\n }\n\n finalCartJSON.orderSummary = finalOrderSummaryObj;\n\n return JSON.stringify(finalCartJSON);\n\n }\n\n return null;\n\n\n }\n\n function fetchNewAttributesDeltaForSKU(eventData, eventName, skuCode) {\n\n var finalReturnObj = eventData;\n\n var persistLocalData = localStorage.getItem('persistent_bar_components_json_v1');\n\n if (validateForNotNull(persistLocalData)) {\n var pageDataJson = pageData;\n\n persistLocalData = JSON.parse(persistLocalData);\n\n var cartItems = persistLocalData.cartItems;\n\n console.log('Cart items ', cartItems);\n\n var skuCartObj = null;\n\n for (var i = 0; i < cartItems.length; i++) {\n var tempObj = cartItems[i];\n\n if (tempObj.skuId == skuCode) {\n skuCartObj = tempObj;\n break;\n }\n }\n\n console.log('Got skuCartObj ', skuCartObj);\n\n if (skuCartObj == null) {\n return;\n }\n\n switch (eventName) {\n\n case \"_ws_addedtobag\":\n\n console.log('Into Switch Statement');\n var skuCode = Kjs.mainPanel.getBagItem(\"skuId\");\n\n finalReturnObj.selected_sku = skuCode;\n finalReturnObj.c_i_size = skuCartObj.itemProperties.size;\n finalReturnObj.c_i_color = skuCartObj.itemProperties.color;\n finalReturnObj.c_i_isweb = skuCartObj.itemProperties.isWebExclusive;\n finalReturnObj.c_sclearance = skuCartObj.storeClearance;\n finalReturnObj.c_i_shipavailable = skuCartObj.inventoryInfo.shipAvailable;\n finalReturnObj.c_i_bopusAval = skuCartObj.inventoryInfo.bopusAvailable;\n\n finalReturnObj.c_i_bossAval = skuCartObj.inventoryInfo.bossAvailable;\n\n var invOnHandQtyShip = skuCartObj.inventoryInfo.invOnHandQtyShip;\n if (validateForNotNull(invOnHandQtyShip)) {\n finalReturnObj.c_i_invShip = invOnHandQtyShip;\n }\n var invOnHandQtyBopus = skuCartObj.inventoryInfo.invOnHandQtyBopus;\n if (validateForNotNull(invOnHandQtyBopus)) {\n finalReturnObj.c_i_invBopus = invOnHandQtyBopus;\n }\n var invOnHandQtyBoss = skuCartObj.inventoryInfo.invOnHandQtyBoss;\n if (validateForNotNull(invOnHandQtyBoss)) {\n finalReturnObj.c_i_invBoss = invOnHandQtyBoss;\n }\n\n\n\n finalReturnObj.c_o_offDis = spltArrayObjectWithAttributeObjectDataIntoVector(skuCartObj, 'offerInfo', 'offerDiscount');\n finalReturnObj.c_o_sdate = spltArrayObjectWithAttributeObjectDataIntoVector(skuCartObj, 'offerInfo', 'startDate');\n finalReturnObj.c_o_edate = spltArrayObjectWithAttributeObjectDataIntoVector(skuCartObj, 'offerInfo', 'endDate');\n\n finalReturnObj.c_p_type = spltArrayObjectWithAttributeObjectDataIntoVector(skuCartObj, 'promoInfo', 'promoType');\n finalReturnObj.c_p_ptext = spltArrayObjectWithAttributeObjectDataIntoVector(skuCartObj, 'promoInfo', 'promoText');\n\n\n\n finalReturnObj.shpi_shpp_ogshpchrgs = spltArrayObjectWithAttributeObjectDataIntoVector(persistLocalData.shipmentInfo, 'shipmentPriceInfo', 'originalShippingCharges');\n finalReturnObj.shpi_shpp_shpchrgsafdis = spltArrayObjectWithAttributeObjectDataIntoVector(persistLocalData.shipmentInfo, 'shipmentPriceInfo', 'shippingChargesAfterDiscount');\n finalReturnObj.shpi_shpp_freeshpqlfdelta = spltArrayObjectWithAttributeObjectDataIntoVector(persistLocalData.shipmentInfo, 'shipmentPriceInfo', 'freeShipQualificationDelta');\n finalReturnObj.shpi_shpp_shpitmstotal = spltArrayObjectWithAttributeObjectDataIntoVector(persistLocalData.shipmentInfo, 'shipmentPriceInfo', 'shipmentItemsTotal');\n\n finalReturnObj.shpi_shpo_disamnt = spltArrayObjectWithArrayObjectDataIntoVector(persistLocalData.shipmentInfo, 'shippingOffers', 'discountAmount');\n\n if (validateForNotNull(persistLocalData.orderSummary.merchandisePromoAmount)) {\n finalReturnObj.or_merpromoamnt = persistLocalData.orderSummary.merchandisePromoAmount;\n }\n\n if (validateForNotNull(persistLocalData.orderSummary.discountedShippingAmount)) {\n finalReturnObj.or_disshpamnt = persistLocalData.orderSummary.discountedShippingAmount;\n }\n\n if (validateForNotNull(persistLocalData.orderSummary.originalShippingAmount)) {\n finalReturnObj.or_ogshpamnt = persistLocalData.orderSummary.originalShippingAmount;\n }\n\n if (validateForNotNull(persistLocalData.orderSummary.tax.estimated)) {\n finalReturnObj.or_tax_est = persistLocalData.orderSummary.tax.estimated;\n }\n\n if (validateForNotNull(persistLocalData.orderSummary.tax.taxRate)) {\n finalReturnObj.or_tax_taxrt = persistLocalData.orderSummary.tax.taxRate;\n }\n\n if (validateForNotNull(persistLocalData.orderSummary.tax.tax)) {\n finalReturnObj.or_tax_tax = persistLocalData.orderSummary.tax.tax;\n }\n\n if (validateForNotNull(persistLocalData.orderSummary.totalSurcharges)) {\n finalReturnObj.or_totalsur = persistLocalData.orderSummary.totalSurcharges;\n }\n\n if (validateForNotNull(persistLocalData.orderSummary.totalTaxFee)) {\n finalReturnObj.or_totaltaxfree = persistLocalData.orderSummary.totalTaxFee;\n }\n\n if (validateForNotNull(persistLocalData.orderSummary.totalKohlsCashAndPromoDiscounts)) {\n finalReturnObj.or_totalkcpromodis = persistLocalData.orderSummary.totalKohlsCashAndPromoDiscounts;\n }\n\n if (validateForNotNull(persistLocalData.orderSummary.totalTax)) {\n finalReturnObj.or_totaltax = persistLocalData.orderSummary.totalTax;\n }\n\n if (validateForNotNull(persistLocalData.orderSummary.total)) {\n finalReturnObj.or_total = persistLocalData.orderSummary.total;\n }\n\n if (validateForNotNull(persistLocalData.orderSummary.savings)) {\n finalReturnObj.or_savings = persistLocalData.orderSummary.savings;\n }\n\n if (validateForNotNull(persistLocalData.orderSummary.taxFeeEnabled)) {\n finalReturnObj.or_taxfeeen = persistLocalData.orderSummary.taxFeeEnabled;\n }\n\n\n break;\n\n }\n }\n\n\n return finalReturnObj;\n\n }\n\n function onceInSessionAttributes(eventData) {\n var finalReturnObj = eventData;\n\n var persistLocalData = localStorage.getItem('persistent_bar_components_json_v1');\n\n if (!isValid(persistLocalData)) {\n persistLocalData = JSON.stringify(Kjs.PB.getPbCartStorage());\n }\n\n if (validateForNotNull(persistLocalData)) {\n\n var pageDataJson = pageData;\n persistLocalData = JSON.parse(persistLocalData);\n\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.incentiveAmount)) {\n finalReturnObj.incdet_incamnt = persistLocalData.incentiveDetails.incentiveAmount;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.incentiveType)) {\n finalReturnObj.incdet_inctype = persistLocalData.incentiveDetails.incentiveType;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.smartIncentiveStatus)) {\n finalReturnObj.incdet_smartincstatus = persistLocalData.incentiveDetails.smartIncentiveStatus;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.incentiveThreshold)) {\n finalReturnObj.incdet_incthreshold = persistLocalData.incentiveDetails.incentiveThreshold;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.incentiveEligible)) {\n finalReturnObj.incdet_inceligible = persistLocalData.incentiveDetails.incentiveEligible;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.incentiveQualified)) {\n finalReturnObj.incdet_incqualifed = persistLocalData.incentiveDetails.incentiveQualified;\n }\n\n if (validateForNotNull(persistLocalData.incentiveDetails) && validateForNotNull(persistLocalData.incentiveDetails.minCartThresholdMet)) {\n finalReturnObj.incdet_minicartthresholdmet = persistLocalData.incentiveDetails.minCartThresholdMet;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.customerHasKohlsCharge)) {\n finalReturnObj.custdet_custhaskohlschrg = persistLocalData.customerDetails.customerHasKohlsCharge;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.customerPostalCode)) {\n finalReturnObj.custdet_custpostalcode = persistLocalData.customerDetails.customerPostalCode;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.myStoreId)) {\n finalReturnObj.custdet_mystoreid = persistLocalData.customerDetails.myStoreId;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.rewardsPilotService)) {\n finalReturnObj.custdet_rewardspilotser = persistLocalData.customerDetails.rewardsPilotService;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.kohlsLoyalty2018EliteMember)) {\n finalReturnObj.custdet_lytelitemember = persistLocalData.customerDetails.kohlsLoyalty2018EliteMember;\n }\n\n if (validateForNotNull(persistLocalData.customerDetails) && validateForNotNull(persistLocalData.customerDetails.kohlsLoyalty2018Member)) {\n finalReturnObj.custdet_lytmember = persistLocalData.customerDetails.kohlsLoyalty2018Member;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.rewards) && validateForNotNull(persistLocalData.purchaseEarnings.rewards.loyaltyPointBalance)) {\n finalReturnObj.usrdata_lytypntbal = persistLocalData.purchaseEarnings.rewards.loyaltyPointBalance;\n }\n\n if (validateForNotNull(persistLocalData.userData) && validateForNotNull(persistLocalData.userData.optInIndicator)) {\n finalReturnObj.usrdata_optinindict = persistLocalData.userData.optInIndicator;\n }\n\n if (validateForNotNull(persistLocalData.userData) && validateForNotNull(persistLocalData.userData.accountStatus)) {\n finalReturnObj.usrdata_accstatus = persistLocalData.userData.accountStatus;\n }\n\n if (validateForNotNull(persistLocalData.userData) && validateForNotNull(persistLocalData.userData.storeNum)) {\n finalReturnObj.usrdata_strnum = persistLocalData.userData.storeNum;\n }\n\n if (validateForNotNull(persistLocalData.userData) && validateForNotNull(persistLocalData.userData.isEnrolledUser)) {\n finalReturnObj.usrdata_isenrusr = persistLocalData.userData.isEnrolledUser;\n }\n\n if (validateForNotNull(persistLocalData.userData) && validateForNotNull(persistLocalData.userData.sessionStatus)) {\n finalReturnObj.usrdata_sesstatus = persistLocalData.userData.sessionStatus;\n }\n\n if (validateForNotNull(pageDataJson.pageDetails) && validateForNotNull(pageDataJson.pageDetails.browserPostalCode)) {\n finalReturnObj.pgdata_pgdet_brwpostalcode = pageDataJson.pageDetails.browserPostalCode;\n }\n\n if (validateForNotNull(pageDataJson.customerDetails) && validateForNotNull(pageDataJson.customerDetails.customerPostalCode)) {\n finalReturnObj.pgdata_custdet_custpostalcode = pageDataJson.customerDetails.customerPostalCode;\n }\n\n\n\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.rewards) && validateForNotNull(persistLocalData.purchaseEarnings.rewards.awayPoints)) {\n finalReturnObj.purear_rwds_awaypnts = persistLocalData.purchaseEarnings.rewards.awayPoints;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.rewards) && validateForNotNull(persistLocalData.purchaseEarnings.rewards.ltyRewardThresholdValue)) {\n finalReturnObj.purear_rwds_lytrwdthreshval = persistLocalData.purchaseEarnings.rewards.ltyRewardThresholdValue;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.rewards) && validateForNotNull(persistLocalData.purchaseEarnings.rewards.loyaltyPointBalance)) {\n finalReturnObj.purear_rwds_lytpntbal = persistLocalData.purchaseEarnings.rewards.loyaltyPointBalance;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.rewards) && validateForNotNull(persistLocalData.purchaseEarnings.rewards.currentPurchaseEarnPoint)) {\n finalReturnObj.purear_rwds_curpurearnpnt = persistLocalData.purchaseEarnings.rewards.currentPurchaseEarnPoint;\n }\n\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash.qualificationAmount)) {\n finalReturnObj.purear_kc_qlfyamnt = persistLocalData.purchaseEarnings.kohlsCash.qualificationAmount;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash.earnAmount)) {\n finalReturnObj.purear_kc_earnamnt = persistLocalData.purchaseEarnings.kohlsCash.earnAmount;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash.currentPurchaseEarnAmount)) {\n finalReturnObj.purear_kc_curpurearnamnt = persistLocalData.purchaseEarnings.kohlsCash.currentPurchaseEarnAmount;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCash.awayAmount)) {\n finalReturnObj.purear_kc_awayamnt = persistLocalData.purchaseEarnings.kohlsCash.awayAmount;\n }\n\n if (validateForNotNull(persistLocalData.purchaseEarnings) && validateForNotNull(persistLocalData.purchaseEarnings.kohlsCashEarnings)) {\n finalReturnObj.purear_kcearnings = persistLocalData.purchaseEarnings.kohlsCashEarnings;\n }\n\n if (validateForNotNull(persistLocalData.addressDetails) && validateForNotNull(persistLocalData.addressDetails.billingAddress[0]) && validateForNotNull(persistLocalData.addressDetails.billingAddress[0].postalCode)) {\n finalReturnObj.addrdet_biladdr_postalcode = spltArrayObjectDataIntoVector(persistLocalData.addressDetails.billingAddress, 'postalCode');\n }\n\n }\n\n return finalReturnObj;\n }\n\n function fetchMcmId() {\n var mcid = (typeof Visitor != 'undefined') ? Visitor.getInstance('F0EF5E09512D2CD20A490D4D@AdobeOrg') : '';\n var mcmId = (mcid ? mcid.getMarketingCloudVisitorID() : '');\n\n return mcmId;\n }\n\n\n function getPresentVector() {\n try {\n\n console.log('getPresentVector');\n\n var itemsInBag = 0;\n cartValue = 0;\n\n isJsonNull = false;\n\n var cartData = localStorage.getItem(\"persistent_bar_components_json_v1\");\n if (isValid(cartData)) {\n var cartInfo = JSON.parse(cartData);\n\n for (var i = 0; i < cartInfo.cartItems.length; i++) {\n itemsInBag = itemsInBag + cartInfo.cartItems[i].quantity;\n\n cartValue = cartValue + Number(cartInfo.cartItems[i].itemPriceInfo.grossPrice);\n\n var tempObj = {};\n tempObj.productId = cartInfo.cartItems[i].productId;\n tempObj.skuId = cartInfo.cartItems[i].skuId;\n tempObj.quantity = cartInfo.cartItems[i].quantity;\n tempObj.itemType = cartInfo.cartItems[i].itemType;\n\n currentUserCartArr.push(tempObj);\n\n }\n } else {\n if (getCookie('VisitorBagTotals').toString().length != 0) {\n cartValue = -1;\n\n isJsonNull = true;\n\n }\n }\n\n\n if (cartValue == 0 && (typeof pageData != 'undefined') && pageData.cartDetails && pageData.cartDetails.cartSubTotalValue) {\n cartValue = Number(pageData.cartDetails.cartSubTotalValue);\n }\n\n\n\n\n var presentVector = {};\n presentVector.event = eventCodes[evtName.toLocaleLowerCase()] || evtName; //common to all\n presentVector.productID = '-'; //ViewedProduct, AddedToBag\n presentVector.itemsInBag = itemsInBag || 0; //common to all\n presentVector.originalPrice = '-';\n presentVector.salePrice = '-';\n presentVector.KC = '-'; //Think\n presentVector.PDPCategory = '-'; //\n presentVector.department = '-';\n presentVector.CN = '-';\n presentVector.keywords = '-';\n presentVector.visualNavForm = '-';\n presentVector.pageFilter = '-';\n presentVector.searchType = '-';\n presentVector.userPFM = '-';\n presentVector.loginstatus = (isLoggedIn) ? 'full' : (isSoftLoggedIn ? 'soft' : '-');\n presentVector.onSale = '-';\n presentVector.time = new Date().getTime();\n\n //New Ml Vectors\n\n presentVector.pgdata_pmpdet_catname = '-';\n presentVector.pgdata_pmpdet_subcatname = '-';\n presentVector.pgdata_pmpdet_findingname = '-';\n presentVector.pgdata_pmpdet_cat_keywords = '-';\n presentVector.pgdata_pmpdet_pgfilter = '-';\n presentVector.pgdata_pmpdet_deptname = '-';\n presentVector.pgdata_pmpdet_gendervalues = '-';\n presentVector.pgdata_pmpdet_search_keywords = '-';\n presentVector.pgdata_proddet_colid = '-';\n presentVector.pgdata_pddetails_clientpostalcode = '-';\n presentVector.selected_sku_color = '-';\n presentVector.selected_sku_size = '-';\n presentVector.selected_sku = '-';\n //presentVector.selected_sku_regular_price = '-';\n presentVector.selected_sku_sale_price = '-';\n\n presentVector.c_i_size = '-';\n presentVector.c_i_color = '-';\n presentVector.c_i_isweb = '-';\n presentVector.c_sclearance = '-';\n presentVector.c_i_shipavailable = '-';\n presentVector.c_i_bopusAval = '-';\n presentVector.c_i_bossAval = '-';\n presentVector.c_i_invShip = '-';\n presentVector.c_i_invBopus = '-';\n presentVector.c_i_invBoss = '-';\n presentVector.c_o_offDis = '-';\n presentVector.c_o_sdate = '-';\n presentVector.c_o_edate = '-';\n presentVector.c_p_type = '-';\n presentVector.c_p_ptext = '-';\n presentVector.shpi_shpp_ogshpchrgs = '-';\n presentVector.shpi_shpp_shpchrgsafdis = '-';\n presentVector.shpi_shpp_freeshpqlfdelta = '-';\n presentVector.shpi_shpp_shpitmstotal = '-';\n presentVector.shpi_shpo_disamnt = '-';\n presentVector.or_merpromoamnt = '-';\n presentVector.or_disshpamnt = '-';\n presentVector.or_ogshpamnt = '-';\n presentVector.or_tax_est = '-';\n presentVector.or_tax_taxrt = '-';\n presentVector.or_tax_tax = '-';\n presentVector.or_totalsur = '-';\n presentVector.or_totaltaxfree = '-';\n presentVector.or_totalkcpromodis = '-';\n presentVector.or_totaltax = '-';\n presentVector.or_total = '-';\n presentVector.or_savings = '-';\n presentVector.or_taxfeeen = '-';\n\n presentVector.removed_sku = '-';\n presentVector.updated_sku = '-';\n presentVector.updated_sku_qty = '-';\n\n presentVector.prod_sku_count = '-';\n presentVector.sku_reg_price = '-';\n presentVector.sku_per_dis = '-';\n presentVector.sku_bopus_avail = '-';\n presentVector.sku_boss_avail = '-';\n presentVector.sku_ship_avail = '-';\n\n presentVector.filter_by_count = '-';\n presentVector.sort_by = '-';\n\n presentVector.pgdata_proddet_catname = '-';\n presentVector.pgdata_proddet_subcatname = '-';\n presentVector.pgdata_proddet_deptname = '-';\n\n presentVector.selected_prd_id = '-';\n\n presentVector.rto_data = '-';\n\n if (evtName.toLocaleLowerCase() == '_ws_addedtobag') {\n\n\n if (typeof pageData != 'undefined') {\n if(pageData.productDetails && pageData.productDetails.pageItems && pageData.productDetails.pageItems[0] && pageData.productDetails.pageItems[0].productID)\n {\n presentVector.productID = (pageData.productDetails && pageData.productDetails.pageItems[0] && pageData.productDetails.pageItems[0].productID) || '-';\n presentVector.originalPrice = (pageData.productDetails && pageData.productDetails.pageItems[0] && pageData.productDetails.pageItems[0].originalPrice) || '-';\n presentVector.salePrice = (pageData.productDetails && pageData.productDetails.pageItems[0] && pageData.productDetails.pageItems[0].salePrice) || '-';\n presentVector.PDPCategory = (pageData.productDetails && pageData.productDetails.categoryName) || '-';\n presentVector.onSale = (pageData.productDetails && pageData.productDetails.pageItems[0] && pageData.productDetails.pageItems[0].isOnSale) || '-'; \n }\n\n if (validateForNotNull(pageData.productDetails) && validateForNotNull(pageData.productDetails.categoryName)) {\n presentVector.pgdata_proddet_catname = pageData.productDetails.categoryName;\n }\n\n if (validateForNotNull(pageData.productDetails) && validateForNotNull(pageData.productDetails.subcategoryName)) {\n presentVector.pgdata_proddet_subcatname = pageData.productDetails.subcategoryName;\n }\n\n if (validateForNotNull(pageData.productDetails) && validateForNotNull(pageData.productDetails.departmentName)) {\n presentVector.pgdata_proddet_deptname = pageData.productDetails.departmentName;\n }\n\n if (productId) {\n\n var skuPriceObj = getSkuPriceObj(Kjs.mainPanel.getBagItem(\"skuId\"));\n\n if(skuPriceObj)\n {\n presentVector.originalPrice = skuPriceObj.regularPrice.toString().substring(1,skuPriceObj.regularPrice.length);\n presentVector.salePrice = skuPriceObj.salePrice.toString().substring(1,skuPriceObj.salePrice.length);\n presentVector.PDPCategory = (pageData.productDetails && pageData.productDetails.categoryName) || '-';\n presentVector.onSale = '-';\n }\n\n presentVector.productID = (productId) || '-';\n \n }\n }\n else {\n var prodUrlSplit = window.location.pathname.toString().split('prd-')[1];\n var firstIndexOf = prodUrlSplit.indexOf('/');\n\n presentVector.productID = prodUrlSplit.substring(0, firstIndexOf);\n }\n\n\n presentVector.userPFM = getUrlParameter('userPFM') || '-';\n\n if (presentVector.productID == '-') {\n presentVector.productID = checkForPreviousEvent();\n }\n\n var skuCode = Kjs.mainPanel.getBagItem(\"skuId\");\n presentVector = fetchNewAttributesDeltaForSKU(presentVector, evtName, skuCode);\n\n }\n\n if (debugScr) console.log(\"presentVector:\" + JSON.stringify(presentVector));\n\n //viewedhome/viewedcart do not require additional processing\n //addedtobag/placedorder have seperate tags\n\n return presentVector;\n } catch (ie) {\n console.log('[ZineOne getPresentVector] : ' + ie);\n }\n }\n\n\n function updateUserVectors() {\n try {\n\n console.log('Into updateUserVectors');\n var presentVector = getPresentVector();\n var previousVector = JSON.parse(localStorage.getItem('z1_previousVector'));\n var z1_sessionStart_ts = JSON.parse(localStorage.getItem('z1_sessionStart_ts'));\n\n var z1_features = localStorage.getItem('z1_features') || \"\";\n //Check if local Storage has userVector available\n var userVectors = JSON.parse(localStorage.getItem('z1_userVectors'));\n var newUserVectors = JSON.parse(localStorage.getItem('z1_newUserVectors'));\n\n //Updated the logic to send the Sequence if diff between present and previous event is more than 10 mins\n //if(previousVector && previousVector.time && previousVector.time < z1_sessionStart_ts){\n if (previousVector && previousVector.time && presentVector && presentVector.time && Number(presentVector.time) - Number(previousVector.time) > SESSION_GAP) {\n console.log(\"New Session has started since the last Event\");\n //Changes to visitGap for gap between n-1 and nth session\n var visitGap = localStorage.getItem('visitGap');\n //Check if null or undefined\n if (!visitGap || typeof visitGap == undefined || visitGap == 'undefined') {\n visitGap = '';\n }\n\n try {\n\n var oldSessionStartTime = userVectors.timeVector.toString().split('|')[0];\n\n\n var vectorsEventData = {};\n\n vectorsEventData = onceInSessionAttributes(vectorsEventData);\n\n\n var cartDump = fetchCartDump();\n\n if (validateForNotNull(cartDump)) {\n cartDump = JSON.parse(cartDump);\n\n var cartKeys = Object.keys(cartDump);\n for (var k = 0; k < cartKeys.length; k++) {\n vectorsEventData[cartKeys[k]] = JSON.stringify(cartDump[cartKeys[k]]);\n }\n }\n\n\n vectorsEventData.z1_userVectors = JSON.stringify(userVectors);\n vectorsEventData.z1_features = z1_features;\n vectorsEventData.visitGap = visitGap;\n vectorsEventData.session_start_time = presentVector.time;\n vectorsEventData.old_session_start_time = oldSessionStartTime;\n\n\n if (validateForNotNull(newUserVectors)) {\n var newVectorKeys = Object.keys(newUserVectors);\n for (var k = 0; k < newVectorKeys.length; k++) {\n vectorsEventData[newVectorKeys[k]] = newUserVectors[newVectorKeys[k]];\n }\n }\n\n\n ZineOne.pushEvent('_ws_updatevectors', vectorsEventData);\n } catch (ieInner) {\n\n var errorObj = {};\n errorObj.p1 = ieInner.message;\n errorObj.p2 = 'AddedToBag';\n\n ZineOne.pushEvent('_ws_logs', errorObj);\n\n }\n\n\n localStorage.setItem('visitGap', Number(presentVector.time) - Number(previousVector.time));\n localStorage.removeItem('z1_userVectors');\n localStorage.removeItem('z1_features');\n console.log(\"z1_userVectors removed from local storage\");\n userVectors = null;\n newUserVectors = null;\n }\n\n if (!userVectors) {\n userVectors = {};\n userVectors.eventVector = presentVector.event;\n userVectors.timeVector = presentVector.time;\n userVectors.productVector = presentVector.productID;\n userVectors.originalPrice = presentVector.originalPrice;\n userVectors.salePrice = presentVector.salePrice;\n userVectors.PDPCategory = presentVector.PDPCategory;\n userVectors.CN = presentVector.CN;\n userVectors.itemsInBag = presentVector.itemsInBag;\n\n newUserVectors = {};\n newUserVectors.pgdata_pmpdet_catname = presentVector.pgdata_pmpdet_catname;\n newUserVectors.pgdata_pmpdet_subcatname = presentVector.pgdata_pmpdet_subcatname;\n newUserVectors.pgdata_pmpdet_findingname = presentVector.pgdata_pmpdet_findingname;\n newUserVectors.pgdata_pmpdet_cat_keywords = presentVector.pgdata_pmpdet_cat_keywords;\n newUserVectors.pgdata_pmpdet_pgfilter = presentVector.pgdata_pmpdet_pgfilter;\n newUserVectors.pgdata_pmpdet_deptname = presentVector.pgdata_pmpdet_deptname;\n newUserVectors.pgdata_pmpdet_gendervalues = presentVector.pgdata_pmpdet_gendervalues;\n newUserVectors.pgdata_pmpdet_search_keywords = presentVector.pgdata_pmpdet_search_keywords;\n newUserVectors.pgdata_proddet_colid = presentVector.pgdata_proddet_colid;\n newUserVectors.pgdata_pddetails_clientpostalcode = presentVector.pgdata_pddetails_clientpostalcode;\n newUserVectors.selected_sku_color = presentVector.selected_sku_color;\n newUserVectors.selected_sku_size = presentVector.selected_sku_size;\n newUserVectors.selected_sku = presentVector.selected_sku;\n //newUserVectors.selected_sku_regular_price = presentVector.selected_sku_regular_price;\n newUserVectors.selected_sku_sale_price = presentVector.selected_sku_sale_price;\n\n\n\n newUserVectors.c_i_size = presentVector.c_i_size;\n newUserVectors.c_i_color = presentVector.c_i_color;\n newUserVectors.c_i_isweb = presentVector.c_i_isweb;\n newUserVectors.c_sclearance = presentVector.c_sclearance;\n newUserVectors.c_i_shipavailable = presentVector.c_i_shipavailable;\n newUserVectors.c_i_bopusAval = presentVector.c_i_bopusAval;\n newUserVectors.c_i_bossAval = presentVector.c_i_bossAval;\n newUserVectors.c_i_invShip = presentVector.c_i_invShip;\n newUserVectors.c_i_invBopus = presentVector.c_i_invBopus;\n newUserVectors.c_i_invBoss = presentVector.c_i_invBoss;\n newUserVectors.c_o_offDis = presentVector.c_o_offDis;\n newUserVectors.c_o_sdate = presentVector.c_o_sdate;\n newUserVectors.c_o_edate = presentVector.c_o_edate;\n newUserVectors.c_p_type = presentVector.c_p_type;\n newUserVectors.c_p_ptext = presentVector.c_p_ptext;\n newUserVectors.shpi_shpp_ogshpchrgs = presentVector.shpi_shpp_ogshpchrgs;\n newUserVectors.shpi_shpp_shpchrgsafdis = presentVector.shpi_shpp_shpchrgsafdis;\n newUserVectors.shpi_shpp_freeshpqlfdelta = presentVector.shpi_shpp_freeshpqlfdelta;\n newUserVectors.shpi_shpp_shpitmstotal = presentVector.shpi_shpp_shpitmstotal;\n newUserVectors.shpi_shpo_disamnt = presentVector.shpi_shpo_disamnt;\n newUserVectors.or_merpromoamnt = presentVector.or_merpromoamnt;\n newUserVectors.or_disshpamnt = presentVector.or_disshpamnt;\n newUserVectors.or_ogshpamnt = presentVector.or_ogshpamnt;\n newUserVectors.or_tax_est = presentVector.or_tax_est;\n newUserVectors.or_tax_taxrt = presentVector.or_tax_taxrt;\n newUserVectors.or_tax_tax = presentVector.or_tax_tax;\n newUserVectors.or_totalsur = presentVector.or_totalsur;\n newUserVectors.or_totaltaxfree = presentVector.or_totaltaxfree;\n newUserVectors.or_totalkcpromodis = presentVector.or_totalkcpromodis;\n newUserVectors.or_totaltax = presentVector.or_totaltax;\n newUserVectors.or_total = presentVector.or_total;\n newUserVectors.or_savings = presentVector.or_savings;\n newUserVectors.or_taxfeeen = presentVector.or_taxfeeen;\n\n newUserVectors.removed_sku = presentVector.removed_sku;\n newUserVectors.updated_sku = presentVector.updated_sku;\n newUserVectors.updated_sku_qty = presentVector.updated_sku_qty;\n\n newUserVectors.prod_sku_count = presentVector.prod_sku_count;\n newUserVectors.sku_reg_price = presentVector.sku_reg_price;\n newUserVectors.sku_per_dis = presentVector.sku_per_dis;\n newUserVectors.sku_bopus_avail = presentVector.sku_bopus_avail;\n newUserVectors.sku_boss_avail = presentVector.sku_boss_avail;\n newUserVectors.sku_ship_avail = presentVector.sku_ship_avail;\n\n newUserVectors.filter_by_count = presentVector.filter_by_count;\n newUserVectors.sort_by = presentVector.sort_by;\n\n newUserVectors.pgdata_proddet_catname = presentVector.pgdata_proddet_catname;\n newUserVectors.pgdata_proddet_subcatname = presentVector.pgdata_proddet_subcatname;\n newUserVectors.pgdata_proddet_deptname = presentVector.pgdata_proddet_deptname;\n\n newUserVectors.selected_prd_id = presentVector.selected_prd_id;\n\n newUserVectors.rto_data = presentVector.rto_data;\n\n } else {\n userVectors.eventVector = userVectors.eventVector + '|' + presentVector.event;\n userVectors.timeVector = userVectors.timeVector + '|' + presentVector.time;\n userVectors.productVector = userVectors.productVector + '|' + presentVector.productID;\n userVectors.originalPrice = userVectors.originalPrice + '|' + presentVector.originalPrice;\n userVectors.salePrice = userVectors.salePrice + '|' + presentVector.salePrice;\n userVectors.PDPCategory = userVectors.PDPCategory + '|' + presentVector.PDPCategory;\n userVectors.CN = userVectors.CN + '|' + presentVector.CN;\n userVectors.itemsInBag = userVectors.itemsInBag + '|' + presentVector.itemsInBag;\n\n newUserVectors.pgdata_pmpdet_catname = newUserVectors.pgdata_pmpdet_catname + '|' + presentVector.pgdata_pmpdet_catname;\n newUserVectors.pgdata_pmpdet_subcatname = newUserVectors.pgdata_pmpdet_subcatname + '|' + presentVector.pgdata_pmpdet_subcatname;\n newUserVectors.pgdata_pmpdet_findingname = newUserVectors.pgdata_pmpdet_findingname + '|' + presentVector.pgdata_pmpdet_findingname;\n newUserVectors.pgdata_pmpdet_cat_keywords = newUserVectors.pgdata_pmpdet_cat_keywords + '|' + presentVector.pgdata_pmpdet_cat_keywords;\n newUserVectors.pgdata_pmpdet_pgfilter = newUserVectors.pgdata_pmpdet_pgfilter + '|' + presentVector.pgdata_pmpdet_pgfilter;\n newUserVectors.pgdata_pmpdet_deptname = newUserVectors.pgdata_pmpdet_deptname + '|' + presentVector.pgdata_pmpdet_deptname;\n newUserVectors.pgdata_pmpdet_gendervalues = newUserVectors.pgdata_pmpdet_gendervalues + '|' + presentVector.pgdata_pmpdet_gendervalues;\n newUserVectors.pgdata_pmpdet_search_keywords = newUserVectors.pgdata_pmpdet_search_keywords + '|' + presentVector.pgdata_pmpdet_search_keywords;\n newUserVectors.pgdata_proddet_colid = newUserVectors.pgdata_proddet_colid + '|' + presentVector.pgdata_proddet_colid;\n newUserVectors.pgdata_pddetails_clientpostalcode = newUserVectors.pgdata_pddetails_clientpostalcode + '|' + presentVector.pgdata_pddetails_clientpostalcode;\n newUserVectors.selected_sku_color = newUserVectors.selected_sku_color + '|' + presentVector.selected_sku_color;\n newUserVectors.selected_sku_size = newUserVectors.selected_sku_size + '|' + presentVector.selected_sku_size;\n newUserVectors.selected_sku = newUserVectors.selected_sku + '|' + presentVector.selected_sku;\n //newUserVectors.selected_sku_regular_price = newUserVectors.selected_sku_regular_price + '|' + presentVector.selected_sku_regular_price;\n newUserVectors.selected_sku_sale_price = newUserVectors.selected_sku_sale_price + '|' + presentVector.selected_sku_sale_price;\n\n\n newUserVectors.c_i_size = newUserVectors.c_i_size + '|' + presentVector.c_i_size;\n newUserVectors.c_i_color = newUserVectors.c_i_color + '|' + presentVector.c_i_color;\n newUserVectors.c_i_isweb = newUserVectors.c_i_isweb + '|' + presentVector.c_i_isweb;\n newUserVectors.c_sclearance = newUserVectors.c_sclearance + '|' + presentVector.c_sclearance;\n newUserVectors.c_i_shipavailable = newUserVectors.c_i_shipavailable + '|' + presentVector.c_i_shipavailable;\n newUserVectors.c_i_bopusAval = newUserVectors.c_i_bopusAval + '|' + presentVector.c_i_bopusAval;\n newUserVectors.c_i_bossAval = newUserVectors.c_i_bossAval + '|' + presentVector.c_i_bossAval;\n newUserVectors.c_i_invShip = newUserVectors.c_i_invShip + '|' + presentVector.c_i_invShip;\n newUserVectors.c_i_invBopus = newUserVectors.c_i_invBopus + '|' + presentVector.c_i_invBopus;\n newUserVectors.c_i_invBoss = newUserVectors.c_i_invBoss + '|' + presentVector.c_i_invBoss;\n newUserVectors.c_o_offDis = newUserVectors.c_o_offDis + '|' + presentVector.c_o_offDis;\n newUserVectors.c_o_sdate = newUserVectors.c_o_sdate + '|' + presentVector.c_o_sdate;\n newUserVectors.c_o_edate = newUserVectors.c_o_edate + '|' + presentVector.c_o_edate;\n newUserVectors.c_p_type = newUserVectors.c_p_type + '|' + presentVector.c_p_type;\n newUserVectors.c_p_ptext = newUserVectors.c_p_ptext + '|' + presentVector.c_p_ptext;\n newUserVectors.shpi_shpp_ogshpchrgs = newUserVectors.shpi_shpp_ogshpchrgs + '|' + presentVector.shpi_shpp_ogshpchrgs;\n newUserVectors.shpi_shpp_shpchrgsafdis = newUserVectors.shpi_shpp_shpchrgsafdis + '|' + presentVector.shpi_shpp_shpchrgsafdis;\n newUserVectors.shpi_shpp_freeshpqlfdelta = newUserVectors.shpi_shpp_freeshpqlfdelta + '|' + presentVector.shpi_shpp_freeshpqlfdelta;\n newUserVectors.shpi_shpp_shpitmstotal = newUserVectors.shpi_shpp_shpitmstotal + '|' + presentVector.shpi_shpp_shpitmstotal;\n newUserVectors.shpi_shpo_disamnt = newUserVectors.shpi_shpo_disamnt + '|' + presentVector.shpi_shpo_disamnt;\n newUserVectors.or_merpromoamnt = newUserVectors.or_merpromoamnt + '|' + presentVector.or_merpromoamnt;\n newUserVectors.or_disshpamnt = newUserVectors.or_disshpamnt + '|' + presentVector.or_disshpamnt;\n newUserVectors.or_ogshpamnt = newUserVectors.or_ogshpamnt + '|' + presentVector.or_ogshpamnt;\n newUserVectors.or_tax_est = newUserVectors.or_tax_est + '|' + presentVector.or_tax_est;\n newUserVectors.or_tax_taxrt = newUserVectors.or_tax_taxrt + '|' + presentVector.or_tax_taxrt;\n newUserVectors.or_tax_tax = newUserVectors.or_tax_tax + '|' + presentVector.or_tax_tax;\n newUserVectors.or_totalsur = newUserVectors.or_totalsur + '|' + presentVector.or_totalsur;\n newUserVectors.or_totaltaxfree = newUserVectors.or_totaltaxfree + '|' + presentVector.or_totaltaxfree;\n newUserVectors.or_totalkcpromodis = newUserVectors.or_totalkcpromodis + '|' + presentVector.or_totalkcpromodis;\n newUserVectors.or_totaltax = newUserVectors.or_totaltax + '|' + presentVector.or_totaltax;\n newUserVectors.or_total = newUserVectors.or_total + '|' + presentVector.or_total;\n newUserVectors.or_savings = newUserVectors.or_savings + '|' + presentVector.or_savings;\n newUserVectors.or_taxfeeen = newUserVectors.or_taxfeeen + '|' + presentVector.or_taxfeeen;\n\n newUserVectors.removed_sku = newUserVectors.removed_sku + '|' + presentVector.removed_sku;\n newUserVectors.updated_sku = newUserVectors.updated_sku + '|' + presentVector.updated_sku;\n newUserVectors.updated_sku_qty = newUserVectors.updated_sku_qty + '|' + presentVector.updated_sku_qty;\n\n newUserVectors.prod_sku_count = newUserVectors.prod_sku_count + '|' + presentVector.prod_sku_count;\n newUserVectors.sku_reg_price = newUserVectors.sku_reg_price + '|' + presentVector.sku_reg_price;\n newUserVectors.sku_per_dis = newUserVectors.sku_per_dis + '|' + presentVector.sku_per_dis;\n newUserVectors.sku_bopus_avail = newUserVectors.sku_bopus_avail + '|' + presentVector.sku_bopus_avail;\n newUserVectors.sku_boss_avail = newUserVectors.sku_boss_avail + '|' + presentVector.sku_boss_avail;\n newUserVectors.sku_ship_avail = newUserVectors.sku_ship_avail + '|' + presentVector.sku_ship_avail;\n\n\n newUserVectors.filter_by_count = newUserVectors.filter_by_count + '|' + presentVector.filter_by_count;\n newUserVectors.sort_by = newUserVectors.sort_by + '|' + presentVector.sort_by;\n\n newUserVectors.pgdata_proddet_catname = newUserVectors.pgdata_proddet_catname + '|' + presentVector.pgdata_proddet_catname;\n newUserVectors.pgdata_proddet_subcatname = newUserVectors.pgdata_proddet_subcatname + '|' + presentVector.pgdata_proddet_subcatname;\n newUserVectors.pgdata_proddet_deptname = newUserVectors.pgdata_proddet_deptname + '|' + presentVector.pgdata_proddet_deptname;\n\n newUserVectors.selected_prd_id = newUserVectors.selected_prd_id + '|' + presentVector.selected_prd_id;\n\n newUserVectors.rto_data = newUserVectors.rto_data + '|' + presentVector.rto_data;\n\n\n }\n localStorage.setItem('z1_userVectors', JSON.stringify(userVectors));\n localStorage.setItem('z1_newUserVectors', JSON.stringify(newUserVectors));\n\n updateFeatures();\n\n //Update the previousVector\n previousVector = presentVector;\n localStorage.setItem('z1_previousVector', JSON.stringify(previousVector));\n\n //Send the Sequence on 5th and 10th Element as well\n //Fetch the updated features as they are updated \n var z1_features = localStorage.getItem('z1_features') || \"\";\n //If this is the 5th Element, send the features and vectors\n if (userVectors && userVectors.eventVector && userVectors.eventVector.split('|').length == 5) {\n console.log(\"The sequence is 5 element long\");\n //Changes to visitGap for gap between n-1 and nth session\n var visitGap = localStorage.getItem('visitGap');\n //Check if null or undefined\n if (!visitGap || typeof visitGap == undefined || visitGap == 'undefined') {\n visitGap = '';\n }\n\n var currentSessionStartTime = userVectors.timeVector.toString().split('|')[0];\n\n\n var vectorsEventData = {};\n\n var newVectorKeys = Object.keys(newUserVectors);\n for (var k = 0; k < newVectorKeys.length; k++) {\n vectorsEventData[newVectorKeys[k]] = newUserVectors[newVectorKeys[k]];\n }\n\n vectorsEventData.z1_userVectors = JSON.stringify(userVectors);\n vectorsEventData.z1_features = z1_features;\n vectorsEventData.cartValue = cartValue;\n vectorsEventData.session_start_time = currentSessionStartTime;\n vectorsEventData.visitGap = visitGap;\n vectorsEventData.currentCart = JSON.stringify(currentUserCartArr);\n\n if (validateForNotNull(pageData) && validateForNotNull(pageData.customerDetails) && validateForNotNull(pageData.customerDetails.customerHasKohlsCharge)) {\n vectorsEventData.isKcc = pageData.customerDetails.customerHasKohlsCharge;\n } else {\n vectorsEventData.isKcc = -1;\n }\n\n if (validateForNotNull(pageData) && validateForNotNull(pageData.customerDetails) && validateForNotNull(pageData.customerDetails.kohlsLoyalty2018EliteMember)) {\n vectorsEventData.kohlsLoyalty2018EliteMember = pageData.customerDetails.kohlsLoyalty2018EliteMember;\n } else {\n vectorsEventData.kohlsLoyalty2018EliteMember = -1;\n }\n\n if (validateForNotNull(pageData) && validateForNotNull(pageData.customerDetails) && validateForNotNull(pageData.customerDetails.kohlsLoyalty2018Member)) {\n vectorsEventData.kohlsLoyalty2018Member = pageData.customerDetails.kohlsLoyalty2018Member;\n } else {\n vectorsEventData.kohlsLoyalty2018Member = -1;\n }\n\n\n vectorsEventData.mcmId = fetchMcmId();\n\n ZineOne.pushEvent('_ws_updatevectors_len5', vectorsEventData);\n\n if (isJsonNull) {\n var lastUserPageArr = userVectors.eventVector.toString().split('|');\n var lastPageChar = lastUserPageArr[lastUserPageArr.length - 2];\n\n var tempEventData = {};\n tempEventData.VisitorBagTotals = getCookie('VisitorBagTotals');\n tempEventData.pgName = 'PDP';\n tempEventData.lastPgChar = lastPageChar;\n\n ZineOne.pushEvent('_ws_emptyjson_v2', tempEventData);\n }\n\n\n } else if (userVectors && userVectors.eventVector && userVectors.eventVector.split('|').length == 10) {\n console.log(\"The sequence is 10 element long\");\n //Changes to visitGap for gap between n-1 and nth session\n var visitGap = localStorage.getItem('visitGap');\n //Check if null or undefined\n if (!visitGap || typeof visitGap == undefined || visitGap == 'undefined') {\n visitGap = '';\n }\n\n var currentSessionStartTime = userVectors.timeVector.toString().split('|')[0];\n\n var vectorsEventData = {};\n\n var newVectorKeys = Object.keys(newUserVectors);\n for (var k = 0; k < newVectorKeys.length; k++) {\n vectorsEventData[newVectorKeys[k]] = newUserVectors[newVectorKeys[k]];\n }\n\n\n\n vectorsEventData.z1_userVectors = JSON.stringify(userVectors);\n vectorsEventData.z1_features = z1_features;\n vectorsEventData.session_start_time = currentSessionStartTime;\n vectorsEventData.visitGap = visitGap;\n\n\n ZineOne.pushEvent('_ws_updatevectors_len10', vectorsEventData);\n }\n\n //If this is the 10th Element, send the features and vectors\n } catch (ie) {\n console.log('[ZineOne updateUserVectors] : ' + ie);\n }\n }\n\n function updateFeatures() {\n\n console.log('Into updateFeatures');\n /* z1_features is stored in local storage which holds following stats\n ** n Total number of events in visit\n ** A Total number of addedtobag events in the visit\n ** B Total number of breachedgeofence events in the visit\n ** C Total number of continuedcheckout events in the visit\n ** D Total number of exitgeofence events in the visit\n ** E Total number of placedorder events in the visit\n ** F Total number of searched events in the visit\n ** G Total number of startedcheckout events in the visit\n ** H Total number of viewedcart events in the visit\n ** I Total number of viewedcatalog events in the visit\n ** J Total number of viewedhome events in the visit\n ** K Total number of viewedproduct events in the visit\n ** p Total number of evented pages loaded in visit\n */\n\n var z1_features = localStorage.getItem('z1_features');\n if (!z1_features) {\n z1_features = \"0|0|0|0|0|0|0|0|0|0|0|0|0|0\";\n }\n\n z1_features_arr = z1_features.split('|');\n\n z1_features_arr[0] = Number(z1_features_arr[0]) + 1; //n\n\n if (evtName.toLocaleLowerCase() == '_ws_addedtobag') {\n z1_features_arr[1] = Number(z1_features_arr[1]) + 1;\n } else if (evtName.toLocaleLowerCase() == 'breachedgeofence') {\n z1_features_arr[2] = Number(z1_features_arr[2]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_completeshipping') {\n z1_features_arr[3] = Number(z1_features_arr[3]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == 'exitgeofence') {\n z1_features_arr[4] = Number(z1_features_arr[4]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_placedorder') {\n z1_features_arr[5] = Number(z1_features_arr[5]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_searched') {\n z1_features_arr[6] = Number(z1_features_arr[6]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_startedcheckout') {\n z1_features_arr[7] = Number(z1_features_arr[7]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_viewedcart') {\n z1_features_arr[8] = Number(z1_features_arr[8]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_viewedcatalog') {\n z1_features_arr[9] = Number(z1_features_arr[9]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_viewedhome') {\n z1_features_arr[10] = Number(z1_features_arr[10]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_viewedproduct') {\n z1_features_arr[11] = Number(z1_features_arr[11]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n } else if (evtName.toLocaleLowerCase() == '_ws_completepayment') {\n z1_features_arr[13] = Number(z1_features_arr[13]) + 1;\n z1_features_arr[12] = Number(z1_features_arr[12]) + 1;\n }\n\n z1_features = z1_features_arr[0] + '|' + z1_features_arr[1] + '|' + z1_features_arr[2] + '|' + z1_features_arr[3] + '|' + z1_features_arr[4] + '|' + z1_features_arr[5] + '|' + z1_features_arr[6] + '|' + z1_features_arr[7] + '|' + z1_features_arr[8] + '|' + z1_features_arr[9] + '|' + z1_features_arr[10] + '|' + z1_features_arr[11] + '|' + z1_features_arr[12] + '|' + z1_features_arr[13];\n localStorage.setItem('z1_features', z1_features);\n }\n\n\n } catch (ie) {\n if (debugScr) console.log(\"[Zineone] Error in Tag Script: WebStore Z1 tag. \" + ie);\n }\n \n\n\n \n\n };\n\n var selector='addtobagID';\n var rootElement = document.querySelector('body');\n rootElement.addEventListener('click',function(event){\n var targetElement = event.target.id;\n\n if(targetElement.match(selector)){\n //logic for handling the click event of addtobagID \n addToBagClickHandler();\n }\n },true);\n\n\n\n\n\n\n \n} catch (ie) {\n if (debugScr) console.log(\"[Zineone] Error in Tag Script: WebStore Z1 tag. \" + ie);\n}","eventName":"load","pageSelector":{"type":"pgName","condition":"contains","val":"/product/prd-"}}],"TTL":"1440"}}
|