files1.cybba.solutions
Open in
urlscan Pro
138.199.37.225
Public Scan
URL:
https://files1.cybba.solutions/autonews.com/loader.min.js?v=32196
Submission Tags: falconsandbox
Submission: On January 05 via api from US — Scanned from NL
Submission Tags: falconsandbox
Submission: On January 05 via api from US — Scanned from NL
Form analysis
0 forms found in the DOMText Content
/*July 28, 2021, 6:14 pm*/function checkInit(){var e;e=!1;try{e=!(window.location.search.indexOf("vt_stop=true")>=0),e=!(document.cookie.indexOf("vt_stop")>=0)&&e,window.noVTCache&&(e=!0),_vtsdk.state.running=e}catch(t){e=!1}window.top!==window.self&&(e=!1);try{if(window.location.search.indexOf("vt_validate=true")>=0){var t=_vtsdk.Helpers.getURLParams(window.location.search),a=_vtsdk.Helpers.addQueryString(_vtsdk.defaults.validateUrl,t);_vtsdk.Helpers.getAsync(a),e=!1}}catch(e){}if(_vtsdk&&!0===_vtsdk.state.ready){e=!1;try{console.log("VTSDK ready.")}catch(e){}}if(e){for(var o=3,s=document.createElement("div"),n=s.getElementsByTagName("i");s.innerHTML="\x3c!--[if gt IE "+ ++o+"]><i></i><![endif]--\x3e",n[0];);if(o<=4){var i=navigator.userAgent.match(/(?:MSIE |Trident\/.*; rv:|Edge\/)(\d+)/);o=i?parseInt(i[1]):-1}e=o>=9||-1==o}e&&_vtsdk.init()}if(function(e,t){e.vtlodash=function(){function e(e,t){var a={};if(a.bindFunction=function(e,t){return function(){try{return e.apply(t,[t])}catch(e){}}},a.stateChange=function(e){try{4==a.request.readyState&&a.callbackFunction(a.request.responseText)}catch(e){}},a.getRequest=function(){try{return window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):!!window.XMLHttpRequest&&new XMLHttpRequest}catch(e){}},a.postBody=arguments[2]||"",a.callbackFunction=t,a.url=e,a.request=a.getRequest(),a.request)try{var o=a.request;o.onreadystatechange=a.bindFunction(a.stateChange,a),""!==a.postBody?(o.open("POST",e,!0),o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.setRequestHeader("Content-type","application/x-www-form-urlencoded")):o.open("GET",e,!0),o.send(a.postBody)}catch(e){}}var t=function(e){return p("Object",e)&&p("Array",e)&&p("String",e)&&!o(e.splice)?!Object.keys(e).length:!s(e)},a=function(e){return void 0===e},o=function(e){var t={};return e&&"[object Function]"===t.toString.call(e)},s=function(e){if(null==e)return 0;try{return p("Array",e)?e.length:Object.keys(e).length}catch(e){return 0}},n=function(e){return null===e},i=function(e){return p("Object",e)},r=function(e){return p("Array",e)},c=function(e){return p("Boolean",e)},l=function(e){return p("Number",e)},d=function(e){return p("String",e)},u=function(e){return p("Arguments",e)},p=function(e,t){var a=Object.prototype.toString.call(t).slice(8,-1);return void 0!==t&&null!==t&&a===e},m=function(e){return[].slice.call(arguments,1).forEach(function(t){var a;for(a in t)a in e&&p("Array",e[a])?e[a]=e[a].concat(t[a]):a in e&&p("Object",e[a])?e[a]=m(e[a],t[a]):e[a]=t[a]}),e},b=function(e,t){for(var o in e)e.hasOwnProperty(o)&&!a(t[o])&&(p("Object",e[o])&&p("Object",t[o])?e[o]=b(e[o],t[o]):e[o]=t[o]);return e};return{isObject:i,isArray:r,merge:m,overwrite:b,size:s,isNull:n,isNumber:l,isBoolean:c,isString:d,isFunction:o,isUndefined:a,isArguments:u,isEmpty:t,request:e}}()}(this),"object"!=typeof vtstore)var vtstore={};!function(e,t){e.vtstore=function(){var e,t={},a=window,o=a.document,s="localStorage",n="script";if(t.disabled=!1,t.version="1.3.17",t.set=function(e,t){},t.get=function(e,t){},t.has=function(e){return void 0!==t.get(e)},t.remove=function(e){},t.clear=function(){},t.transact=function(e,a,o){null==o&&(o=a,a=null),null==a&&(a={});var s=t.get(e,a);o(s),t.set(e,s)},t.getAll=function(){},t.forEach=function(){},t.serialize=function(e){return JSON.stringify(e)},t.deserialize=function(e){if("string"==typeof e)try{return JSON.parse(e)}catch(t){return e||void 0}},function(){try{return s in a&&a[s]}catch(e){return!1}}())e=a[s],t.set=function(a,o){return void 0===o?t.remove(a):(e.setItem(a,t.serialize(o)),o)},t.get=function(a,o){var s=t.deserialize(e.getItem(a));return void 0===s?o:s},t.remove=function(t){e.removeItem(t)},t.clear=function(){e.clear()},t.getAll=function(){var e={};return t.forEach(function(t,a){e[t]=a}),e},t.forEach=function(a){for(var o=0;o<e.length;o++){var s=e.key(o);a(s,t.get(s))}};else if(o.documentElement.addBehavior){var i,r;try{r=new ActiveXObject("htmlfile"),r.open(),r.write("<"+n+">document.w=window</"+n+'><iframe src="/favicon.ico"></iframe>'),r.close(),i=r.w.frames[0].document,e=i.createElement("div")}catch(t){e=o.createElement("div"),i=o.body}var c=function(a){return function(){var o=Array.prototype.slice.call(arguments,0);o.unshift(e),i.appendChild(e),e.addBehavior("#default#userData"),e.load(s);var n=a.apply(t,o);return i.removeChild(e),n}},l=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g"),d=function(e){return e.replace(/^d/,"___$&").replace(l,"___")};t.set=c(function(e,a,o){return a=d(a),void 0===o?t.remove(a):(e.setAttribute(a,t.serialize(o)),e.save(s),o)}),t.get=c(function(e,a,o){a=d(a);var s=t.deserialize(e.getAttribute(a));return void 0===s?o:s}),t.remove=c(function(e,t){t=d(t),e.removeAttribute(t),e.save(s)}),t.clear=c(function(e){var t=e.XMLDocument.documentElement.attributes;e.load(s);for(var a=t.length-1;a>=0;a--)e.removeAttribute(t[a].name);e.save(s)}),t.getAll=function(e){var a={};return t.forEach(function(e,t){a[e]=t}),a},t.forEach=c(function(e,a){for(var o,s=e.XMLDocument.documentElement.attributes,n=0;o=s[n];++n)a(o.name,t.deserialize(e.getAttribute(o.name)))})}try{var u="__storejs__";t.set(u,u),t.get(u)!=u&&(t.disabled=!0),t.remove(u)}catch(e){t.disabled=!0}return t.enabled=!t.disabled,vtstore=t}()}(this),window._vtsdk||(window._vtsdk=function(){var documentAlias=document,windowAlias=window,object={defaults:{tags:{prefix:"**|",suffix:"|**"},cdns:[4],cookieNames:{all:"all",ne:"ne",push:"pushtkn",ts:"ts",shop:"shop",sess:"sess",uId:"user",debug:"debug",stopevents:"stopevents",campaignsStatus:"cs",condCount:"count",visitor:"info",capping:"cap_",poll:"poll",contentStep:"cstep_",cStatus:"c_"},debug:"info",version:"1.0",queueCheckInterval:500,visitorHost:"https://pro.ip-api.com/json/?key=X8nNh9l0HcVYntp",visitorCallback:"_vtsdk.tasks.callbackVisitor",eventHost:"https://app.cybba.solutions/event/",eventCallback:"_vtsdk.eventApi.callbackEvent",reccsHost:"https://rec.cybba.solutions/html/",reccsCallback:"_vtsdk.Recommender.callBackRecommender",reccsCallbackTwo:"_vtsdk.Recommender.callBackRecommenderTwo",userHost:"https://app.cybba.solutions/user",userCallback:"_vtsdk.User.callbackUser",mcUrl:"https://pages.cybba.solutions/integrations/mailchimp.php",validateUrl:"https://pages.cybba.solutions/tasks/util/jsValidation.php",prefix:"_vt_",monthDuration:2592e6,dayDuration:864e5,sessionDuration:432e5,expiration:31536e6,nowTime:(new Date).getTime(),nowTimeLocal:(new Date).getTime(),userIndentityParams:["vt_user","email"],userKeyLength:16,loaderGif:"https://files1.cybba.solutions/_assets/images/ajax-loader.gif",stylesheet:"https://files1.cybba.solutions/_assets/vtmarketing.css",idPrefix:"vt-campaign-",push:{widget:"101",token:"https://admin.cybba.solutions/push/token.php"},recc:{className:"vt-campaign",attributeId:"data-vt-id",cIdLength:7},siteEvents:{click:"siteclick",submit:"sitesubmit",display:"sitedisplay",close:"siteclose",referer:"referer"},ecomEvents:{},siteClasses:{close:"vtw-close",click:"vtw-click",overlay:"vtw-bck",toggle:"vtw-toggle",error:"vtw-error",attr:"vtw-attr",attrPrefix:"vta-",classPrefix:"vtw-",submit:"vtw-submit",required:"vtw-required",invalid:"vtw-invalid"}},state:{timeDiff:0,hasLoaded:!1,waitUserRequest:!1,ready:!1,hasUser:!1,pageQueue:[],reccCampaigns:[],calledRecommender:!1,emailToPush:!1,reccTpls:{},campaignsOK:[],pageCampaigns:{},inactivityCampaigns:[]}};return object.defaults.userIndentityParams.push("utm_ra"),object.shop={id:714,url:"https://www.autonews.com",params:{getVisitorInfo:!1,emailGrab:!0,customJS:'try{\n//apn ads - all accounts\nif(window.location.href.indexOf("OrderReceipt") >= 0 && document.querySelector("#ctl00_CenterContent_receipt_lblOrderNumber") && document.querySelector(\'#ctl00_CenterContent_receipt_cartControl_Tr4\')){\n var oN = document.querySelector("#ctl00_CenterContent_receipt_lblOrderNumber").textContent.trim(); //order id\n var oV = document.querySelector(\'#ctl00_CenterContent_receipt_cartControl_Tr4\').textContent.trim().match(/[0-9.,]+/)[0].replace(",",""); //order value\n var sub = document.cookie.replace(/(?:(?:^|.*;\\s*)CYB_SUB\\s*\\=\\s*([^;]*).*$)|^.*$/, "$1") !== "" ? document.cookie.replace(/(?:(?:^|.*;\\s*)CYB_SUB\\s*\\=\\s*([^;]*).*$)|^.*$/, "$1") : document.querySelector("#ctl00_CenterContent_receipt_cartControl_cartRepeater_ctl00_Label2").innerText\n if(Number(oV) === 9900 || Number(oV) === 99 ){\n oV = \'99.00\';\n }\n window.cybOrderData = {\n order_id: document.querySelector("#ctl00_CenterContent_receipt_lblOrderNumber").textContent.trim() + \' | \' + sub,\n value: oV\n };\n \n window._vteq = window._vteq || [];\n window._vteq.push({\n confirmation: {\n items: [],\n orderId: window.cybOrderData.order_id,\n total: window.cybOrderData.value\n }\n });\n } \n\n}catch(e){}\n\n\n/**********************START USER INPUT**************************************/\nwindow.cybData = {};\n\n// Initialization function - allows for customization of basic settings \nwindow.configSettingsCYB = function() {\n // Various Settings\n cybData.curVersion = \'VT_CDN_1.0\'; // Current Framework Version\n cybData.allowLogs = true; //True to enable debug logs, does not turn off console.log - this will be on by default in staging\n cybData.cookieStaging = false; //Initalizes cookie staging mode if true and panel will only fire with the cookie - MUST BE FALSE WHEN LIVE (cybbatest=true)\n\n //Trigger Rules for ONSITE\n cybData.exitIntent = true;\n cybData.onClose = false; // true/false\n cybData.deskInactivity = 0; //time in seconds\n cybData.mobileInactivity = 0; //time in seconds\n cybData.mobileExit = false; // true/false - Firings on buttons from browser/OS\n cybData.ABtest = [50, 50]; //Percentage of Firing per agent - sets Cookie "CYB_AB" with the index of the agent to be fired\n cybData.sessionMgmt = {\n timesPerSession: 1, // Times the Onsite can fire per session without the cookie dropping\n hours: 2 // Time in hours when the onsite can next fire. \n };\n cybData.triggerSensitivity = 0.75; // time in seconds for mouse to be outside of browser to delay firing panel \n cybData.fireTowardsX = [false, 25, 75]; // True if only firing panel when users goes towards the corners of the browser, % for left hand side, % for right hand side\n cybData.repeatCustomer = { // Tracks number of times user has been onsite\n enabled: false,\n timePeriod: 365, // days\n trackSales: false\n };\n cybData.addCSS = \'\'; //add minified CSS for custom CSS here\n cybData.copiedText = \'\'; // Text for Copy Success Message, Default is "COPIED!" if left blank \n cybData.excludedUrls = []; //add any excluded urls here - onsite will not fire here, leave blank if not needed\n cybData.includedUrls = []; //add any included urls here - onsite will only fire here, leave blank if not needed\n cybData.disableEU = false; //Disable onsite for EU clients\n \n /** START PROMOBAR DATA **/\n cybData.promoBarData = {\n \'IDHERE\': { // One object per promobar\n enabled: false, //True for live, false for off\n position: \'top\',\n countDown: {\n countDownDate: \'Jan 1, 2019 00:00:00\', // must be date, number (getTime()), or date string\n countDownExpirationClose: false, // Close promobar after time expiration\n countDownExpireText: "EXPIRED",\n hasLetters: true, // eg. 4d 6h 2m 10s vs 4:6:2:10\n padNums: true, // shows 09 instead of 9\n hideZeroes: false, // does not show 0m 30s, instead shows 30s,\n syncTime: false // Have time synchronized to initial fire\n },\n triggers: {\n onload: {\n enabled: false,\n conditionally: true //false will fire the same one every load, true will check filters first\n },\n afterOE: { //Fires after an Onsite, on next reload\n enabled: false,\n checkFilters: true\n },\n mobile: true,\n onOEClose: \'\', //Fires immediately after X button closed on the onsite\n exitIntent: false,\n persist: { // promobar persists after initial fire dependent on filters, also works to just filter after CYBSession cookie exists\n enabled: false,\n conditionally: false //false will fire the same one every load, true will check filters first\n }\n },\n sessionMgmt: {\n enabled: true,\n timesPerSession: 1,\n hours: 2\n },\n stickyNav: {\n hasStickyNav: false,\n selector: \'\'\n }\n }\n }\n /** END PROMOBAR DATA **/\n\n //Dynamic Product Data\n cybData.dynamicProductData = {\n history: false, // true for history features\n histObjCYB: { // selectors for product page (history) data - leave blank if not using\n pName: "",\n pPrice: "",\n pImg: "",\n pUrl: window.location.href\n },\n addImageURLPrefix: \'\', // use if you need to add domain or protocol to URL\n imageIsSource: true, // true if trying to grab image src, false if image is a background image in the CSS\n viewButtonText: \'View Item\',\n historyTabText: \'History\'\n };\n\n // Lowers Z-Index of any element that is in-front of the onsite\n cybData.resetZIndex = {\n enabled: false,\n selectors: [\'\']\n };\n\n //Do not remove or modify this call\n try {setTimeout(initCYB, 200)} catch (e){console.log(e);}\n}\n//Code all things you need to have excute on load here\nwindow.onloadFunctionsCYB = function(){\n if(!!~document.referrer.indexOf("/AN/") && document.referrer.match(/(W9AN1159)|(W9AN2149)|(W95AN3B)|(W95AN4B)/g) ){\n setCookieCYB("CYB_ref", document.referrer, .08 )\n }\n if( document.querySelector("[id$=\'productBrief_manyChoicesPanel\']") && jQuery("[id$=\'_productBrief_choice\'] option:selected").length){\n setCookieCYB("CYB_SUB", document.querySelector("[id$=\'productBrief_manyChoicesPanel\']").innerText.trim() + \': \' + jQuery("[id$=\'_productBrief_choice\'] option:selected").text(), .5)\n jQuery("[id$=\'_productBrief_choice\']").change(function(){\n setCookieCYB("CYB_SUB", document.querySelector("[id$=\'productBrief_manyChoicesPanel\']").innerText.trim() + \': \' + jQuery("[id$=\'_productBrief_choice\'] option:selected").text(), .5)\n })\n }\n}\n\n// Criteria Filters Here\nwindow.cybbaFilters= function(){\n if( (!!~window.location.href.indexOf("//www.autonews.com/section/subscribe") && !window.location.href.match(/(subscribe)[0-9]+/)) || (!!~window.location.href.indexOf("//www.autonews.com/subscribe") && !window.location.href.match(/(subscribe)[0-9]+/))){\n fireCampaignCYB("1011416");\n \n }else if( !!~window.location.href.indexOf("/AN/") && window.location.href.match(/(W9AN1159)|(W9AN2149)|(W95AN3B)|(W95AN4B)/g)) { \n fireCampaignCYB("1011416");\n \n }else if( !!~document.referrer.indexOf("/AN/") && document.referrer.match(/(W9AN1159)|(W9AN2149)|(W95AN3B)|(W95AN4B)/g) ){\n if( document.querySelector("#ctl00_CenterContent_imgProgressImage")){\n if( document.querySelector("#ctl00_CenterContent_imgProgressImage").alt === \'Shipping and payment\'){\n fireCampaignCYB("1011416");\n \n }\n }\n }\n else if( !!~window.location.href.indexOf("/AN/")) fireCampaignCYB("1011416");\n else if( !!~window.location.href.indexOf("/ConfirmOrder.aspx") && !!getCookieCYB("CYB_ref")){\n if( document.querySelector("#ctl00_CenterContent_imgOrderProgress")){\n if( getCookieCYB("CYB_ref").indexOf("/AN/") && getCookieCYB("CYB_ref").match(/(W9AN1159)|(W9AN2149)|(W95AN3B)|(W95AN4B)/g)){\n fireCampaignCYB("1011416"); \n }\n } \n }\n}\n\n// Promobar Criteria Filters Here\nwindow.promobarFilters= function(){}\n\nwindow.asCompleteOrder= function(){\n //AddShoppersWidget.API.Behavioral.showSuccessModal(\'59e61614d55930ef5a660f01\');\n closeOnsiteCYB();\n pingAff(encodeURIComponent(window.location.href) + (!!~window.location.href.indexOf("?") ? "&utm_content=NABJ5D0707&utm_term=AbandonOverlay&utm_campaign=CybbaTest&utm_source=onsiteoverlay&utm_medium=website&cci_msa=NABJ5D0707" : "?utm_content=NABJ5D0707&utm_term=AbandonOverlay&utm_campaign=CybbaTest&utm_source=onsiteoverlay&utm_medium=website&cci_msa=NABJ5D0707"));\n}\n/******DO NOT REMOVE********/\ncybCDN !== void(0) && setTimeout(configSettingsCYB, 1500);\n/******DO NOT REMOVE********/',hasActTriggers:!1,hasSendActTriggers:!1,hasRunningInteractions:!1,hasRunningReccs:!1,hasRunningContent:!1,hasRunningAds:!1,countConditions:[],embedCSS:!1},agency:108,debug:"none",domain:"autonews.com",campaigns:{},merchandising:{},content:{campaigns:{}},adserver:{}},object.User={data:{},context:{vars:{pageType:""}},getLocalUser:function(){var e=object.Helpers.readCookie(object.defaults.prefix+object.defaults.cookieNames.uId);if(null!=e){var t=e.split("_");e={userId:t[0],sessionId:t[1],email:"true"==t[2],push:"true"==t[3]},object.Helpers.setCookie(object.defaults.cookieNames.uId,e)}else if(e=object.Helpers.getCookie(object.defaults.cookieNames.uId),vtlodash.isObject(e)){var a=e.userId+"_"+e.sessionId+"_"+e.email+"_"+e.push;object.Helpers.writeCookie(object.defaults.prefix+object.defaults.cookieNames.uId,a,object.defaults.expiration)}return!vtlodash.isEmpty(e)&&e||null},requestUser:function(e){if(!0!==object.state.waitUserRequest){object.Helpers.log("Requesting user data from server..."+JSON.stringify(e),"info"),e=e||{};var t={callback:object.defaults.userCallback,shopId:object.shop.id};e.userId&&(t.userId=e.userId||null),e.sessionId&&(t.sessionId=e.sessionId||null),e.email&&object.Helpers.emailIsValid(e.email)?(t.email=e.email,vtlodash.isFunction(windowAlias.btoa)&&(t.email=windowAlias.btoa(t.email)),t.userId=object.User.data.userId||null,t.sessionId=object.User.data.sessionId||null):t.email=null;var a=object.Helpers.addQueryString(object.defaults.userHost,t);object.state.botagent||(object.Helpers.getAsync(a),object.state.waitUserRequest=!0)}},isIdentified:function(){return!!object.User.data.email||!!object.Helpers.emailIsValid(object.User.data.email)},changeUserByEmail:function(e){e=object.Helpers.cleanEmail(e),object.Helpers.emailIsValid(e)&&object.User.requestUser({email:e})},changeUserById:function(e){object.User.data.userId!==""+e&&object.User.requestUser({userId:e})},callbackUser:function(e){object.Helpers.log("Callback User server data","info");var t={};if(e.userId&&(t.userId=e.userId),e.sessionId&&(t.sessionId=e.sessionId),t.email=!!e.email,t.push=!!e.push,object.state.oldUserData={sessionId:object.User.data.sessionId,userId:object.User.data.userId},e.ts){var a=object.defaults.nowTimeLocal-parseInt(e.ts);a=a>100?a:1,object.Helpers.setCookie(object.defaults.cookieNames.ts,a,object.defaults.dayDuration),object.defaults.nowTime-=a}vtlodash.isEmpty(t)||(object.Helpers.setCookie(object.defaults.cookieNames.uId,t),object.User.data=t,object.state.hasUser=!0,object.User.context&&object.User.context.all&&(object.User.context.all.hasEmail=object.User.isIdentified(),object.User.context.all.hasPush=!!object.User.data.push)),object.state.emailToPush&&object.Helpers.emailIsValid(object.state.emailToPush.login.email)&&object.state.eventQueue.push(object.state.emailToPush),object.state.waitUserRequest=!1},activityInit:function(){function e(){var t=Date.now()-object.state.lastActiveTime;t>o&&(object.Campaign.triggerInactivityCampaigns(t/1e3),n+=1),a&&clearInterval(a);var s=o+1e3*n;s<12e4&&(a=windowAlias.setTimeout(e,s))}function t(){object.state.lastActiveTime=Date.now(),n=1,object.shop.params.hasSendActTriggers&&(!object.state.lastCallActive||object.state.lastActiveTime-object.state.lastCallActive>s)&&(object.User.activitySend(n),object.Helpers.log("Sending activity","info"))}if(object.shop.params.hasActTriggers||object.shop.params.hasSendActTriggers){var a,o=5e3,s=12e4;object.state.lastActiveTime=Date.now();var n=0,i=document.documentElement,r=document;!function(){object.Helpers.addEventListener(i,"mousedown",t,!0),object.Helpers.addEventListener(i,"keypress",t,!0),object.Helpers.addEventListener(r,"touchmove",t,!0),object.Helpers.addEventListener(r,"scroll",t,!0),e()}()}},activitySend:function(e){object.Helpers.log("Updating server user activity for check "+e,"info"),object.state.lastCallActive=object.state.lastActiveTime;var t={shopId:object.shop.id,userId:object.User.data.userId,sessionId:object.User.data.sessionId,ts:object.state.lastActiveTime},a=object.Helpers.addQueryString(object.defaults.userHost+"/active",t);object.Helpers.getAsync(a)}},object.eventApi={convertEventObject:function(e){var t={type:""};for(var a in e)if(e.hasOwnProperty(a)){t.type=a;var o=vtlodash.isObject(e[a])?e[a]:{};if("confirmation"===a&&vtlodash.size(o)>1)try{t.items=o.items||[],t.generic=o.generic||{},delete o.items,["orderId","total","email"].forEach(function(e,a){o[e]&&(t.generic[e]=o[e])}),o={}}catch(e){object.Helpers.log("Error creating generic for confirmation ","error")}"event"===a&&(t.type="generic",t.generic=e.event,t.generic.event_name&&(t.generic.event_name=object.eventApi.formatEventName(t.generic.event_name)),o={}),"addtocart"!=a&&"viewitem"!=a&&"addtowishlist"!=a||!o.itemId||(o.itemId=(""+o.itemId).trim(),object.setVar("itemId",o.itemId)),"viewcategory"==a&&o.category&&(o.category=(""+o.category).trim().toLowerCase().replace(/\s/g,"_"),object.setVar("category",o.category)),"search"==a&&o.query&&(o.query=(""+o.query.replace(/"/g,"'")).trim(),object.setVar("query",o.query),o.query=o.query.toLowerCase()),"pageview"==a&&o.url&&(o.url=o.url.replace(/"/g,"'")),o.device=object.User.context.session.deviceType,t=vtlodash.merge(t,o),vtlodash.isFunction(windowAlias.btoa)&&t.email&&(t.email=windowAlias.btoa(t.email))}else;return object.state._vtsid&&(t._vtsid=object.state._vtsid),t},formatEventName:function(e){return e.trim().toLowerCase().replace(/\s/g,"_")},sendEventArray:function(e){if(object.Helpers.log("Received array events "+a,"info"),vtlodash.isArray(e)){ret_array=[];for(var t=0;t<e.length;t++){var a=e[t],o={userId:object.User.data.userId,sessionId:object.User.data.sessionId};a=object.eventApi.convertEventObject(a),o=vtlodash.merge(o,a),ret_array.push(o)}var s={data:JSON.stringify(ret_array),callback:object.defaults.eventCallback},n=object.defaults.eventHost+object.shop.id+"/"+a.type;n=object.Helpers.addQueryString(n,s),object.state.botagent||object.Helpers.getAsync(n)}},pushNext:function(e){object.Helpers.setCookie(object.defaults.cookieNames.ne,e)},sendEvent:function(e){try{object.Helpers.log("Received event "+JSON.stringify(e),"info")}catch(e){}if(e=object.eventApi.convertEventObject(e),!object.eventApi.validateEvent(e,!0))return object.Helpers.log("Event not valid "+JSON.stringify(e),"error"),!1;var t={userId:object.User.data.userId,sessionId:object.User.data.sessionId};t=vtlodash.merge(t,e);var a={data:JSON.stringify(t),callback:object.defaults.eventCallback},o=object.defaults.eventHost+object.shop.id+"/"+e.type;return o=object.Helpers.addQueryString(o,a),object.state.botagent?void 0:(object.Helpers.getAsync(o),object.Helpers.sendToAnalytics(t),!0)},callbackEvent:function(e){if(vtlodash.isObject(e))var t=JSON.stringify(e);if(object.Helpers.log("Event received "+t,"info"),e.payload.sessionId!==object.User.data.sessionId||e.payload.userId!==object.User.data.userId){object.Helpers.log("New session for user ","info");var a=object.User.data;a.sessionId=e.payload.sessionId,a.userId=e.payload.userId,vtlodash.isEmpty(a)||object.Helpers.setCookie(object.defaults.cookieNames.uId,a)}if(e.payload.capping){var o=vtlodash.isArray(e.payload.capping)?e.payload.capping:[e.payload.capping];if(vtlodash.size(o)>0)for(var s=0;s<o.length;s++){var n=o[s];if(n){if(n.campaign&&n.campaign.campaign){var i=n.campaign.campaign;delete n.campaign.campaign,object.Helpers.setCookie(object.defaults.cookieNames.capping+i,n.campaign)}if(n.group&&n.group.group){var r=n.group.group;delete n.group.group,object.Helpers.setCookie(object.defaults.cookieNames.capping+r,n.group)}}}}},validateEvent:function(e,t){if("viewitem"==e.type&&!e.itemId)return!1;if("login"==e.type&&!e.email)return!1;if("viewcategory"==e.type&&!e.category)return!1;if("addtocart"==e.type&&!e.itemId)return!1;if("addtowishlist"==e.type&&!e.itemId)return!1;if("search"==e.type&&!e.query)return!1;if("generic"==e.type&&!e.generic.event_name)return!1;if("confirmation"==e.type&&e.generic&&e.generic.orderId){if(object.User.context.all.orderId===e.generic.orderId)return!1;object.Helpers.updateCookie(object.defaults.cookieNames.all,{orderId:e.generic.orderId}),object.User.context.all.orderId=e.generic.orderId}if(t){object.state.guardEvents=object.state.guardEvents||[];var a=btoa(unescape(encodeURIComponent(JSON.stringify(object.Helpers.getSortedDict(e)))));if(object.state.guardEvents.indexOf(a)>=0)return!1;object.state.guardEvents.push(a)}return!0}},object.Helpers={getContextValue:function(e,t,a){var o=object.Helpers.getDeepValue(object.User.context,e);if("all.hasEmail"===e&&(o=object.User.isIdentified()),0==e.indexOf("cookie.")&&(o=object.Helpers.readCookie(e.split(".").splice(1).join("."))),"e"==t&&a&&"session.vte."+a.type===e)switch(a.type){case"viewitem":case"addtocart":case"addtowishlist":o=a.itemId?a.itemId:"";break;case"search":o=a.query?a.query:"";break;case"viewcategory":o=a.category?a.category:""}return o},getDeepValue:function(e,t){try{if(!t)return;for(var a=t.split("."),o=0;o<a.length;o++)if(void 0===(e=e[a[o]]))return;return e}catch(e){object.Helpers.log("Error extracting deep value","error")}},returnRandomZoneBanners:function(e,t){if(!vtlodash.isArray(e)||t<1)return!1;for(var a,o,s=e.length;0!==s;)o=Math.floor(Math.random()*s),s-=1,a=e[s],e[s]=e[o],e[o]=a;return e=object.Helpers.returnValidZoneBanners(e),e.slice(0,t)},returnValidZoneBanners:function(e){for(var t=[],a=0;a<vtlodash.size(e);){var o=e[a];object.Campaign.checkDisplayLimits(o.tpl,object.shop.adserver.campaigns[o.campaign].siteParams.banners[o.tpl])&&object.shop.adserver.templates[o.tpl]&&t.push(o),a++}return t},cleanEmail:function(e){return e&&e.replace(/[\s\'\"\/\\#]/g,"").toLowerCase()},extractTagFromHtml:function(e,t){if(!e||!t)return"";var a=new RegExp("<"+t+"[^>]*>([\\s\\S]*?)<\\/"+t+">","i");return result=a.exec(e),vtlodash.isArray(result)&&result.length>0?result[1]:""},addClass:function(e,t){e.className=e.className.split(t).join(" ")+" "+t},removeClass:function(e,t){e.className=e.className.split(t).join(" ")},serializeForm:function(e){var t,a,o=[];if("object"==typeof e&&"FORM"==e.nodeName){var s=e.elements.length;for(i=0;i<s;i++)if(t=e.elements[i],t.name&&!t.disabled&&"file"!=t.type&&"reset"!=t.type&&"submit"!=t.type&&"button"!=t.type)if("select-multiple"==t.type)for(a=e.elements[i].options.length,j=0;j<a;j++)t.options[j].selected&&(o[o.length]=t.name+"="+t.options[j].value);else("checkbox"!=t.type&&"radio"!=t.type||t.checked)&&(o[o.length]=t.name+"="+t.value)}return o},pickRandomPercentages:function(e){var t,a,o,s,n;s=100*Math.random(),n=t=0;for(a in e)if(o=e[a],n=t,t+=o,n<=s&&s<=t)return a;throw new Error("Could not pick any number for items "+e)},generateRandomBetween:function(e,t,a){return a?Math.floor(Math.random()*(t-e))+e:Math.random()*(t-e)+e},valuesComparer:function(val1,val2,op){if(val1="false"!==val1&&("true"===val1||val1),!1===(val2="false"!==val2&&("true"===val2||val2))&&vtlodash.isUndefined(val1)&&"eq"==op)return!0;if(0===val2&&vtlodash.isUndefined(val1)&&["eq","lte","gte"].indexOf(op)>=0)return!0;switch(op){case"gt":return val1>val2;case"gte":return val1>=val2;case"lt":return val1<val2;case"lte":return val1<=val2;case"eq":return val1===val2;case"ne":return val1!=val2;case"regex":if(vtlodash.isUndefined(val1))return!1;var r=new RegExp(val2);return!!r.test(val1);case"eval":try{var x=eval(val2.replace(/\(x\)/g,val1))}catch(e){var x=!1}return!!vtlodash.isBoolean(x)&&x}return!1},getSortedDict:function(e){if(!vtlodash.isObject(e))return e;var t={};return Object.keys(e).sort().forEach(function(a){t[a]=object.Helpers.getSortedDict(e[a])}),t},addEventListener:function(e,t,a,o){return o=!vtlodash.isUndefined(o)&&o,e.addEventListener?(e.addEventListener(t,a,o),!0):e.attachEvent?e.attachEvent("on"+t,a):void(e["on"+t]=a)},getAsync:function(e,t){void 0===t&&(e+=(-1==e.indexOf("?")?"?":"&")+"_ts="+String(Math.round(1e8*Math.random())));var a=object.Helpers.embedTag("script","","head",{type:"text/javascript",src:e});try{a.async=!0}catch(e){}return a},emailIsValid:function(e){return e=object.Helpers.cleanEmail(e),/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)},log:function(e,t){var a=(new Date).getTime()-object.defaults.nowTimeLocal;t=t||"info",e=vtlodash.isObject(e)?JSON.stringify(e):e;var o={info:1,warning:2,error:3,none:4};if(o[object.defaults.debug]<=o[t])try{console.log("["+t+"]["+a+"]"+e)}catch(e){}},setAnalyticsSource:function(e,t){if(object.shop.ganalytics&&!0===object.shop.ganalytics.setSource){var a=setInterval(function(){if("undefined"!=typeof ga){try{object.state.ganame=ga.getAll()[0].get("name")+"."}catch(e){object.state.ganame=""}ga(object.state.ganame+"send","pageview",{campaignSource:"vtmarketing",campaignMedium:t,campaignName:e}),clearInterval(a)}},100);setTimeout(function(){clearInterval(a)},1e3)}},sendToAnalytics:function(e){if(object.shop.ganalytics&&!0===object.shop.ganalytics.status&&!(object.shop.ganalytics.events.length&&object.shop.ganalytics.events.indexOf(e.type)<0)){var t=setInterval(function(){var a="";try{switch(e.type){case"viewitem":case"addtocart":case"addtowishlist":a=e.itemId;break;case"viewcategory":a=e.category;break;case"checkout":a=e.step||"";break;case"sitesubmit":case"siteclick":case"siteclose":case"sitedisplay":a=e.tracking.vt_campaign+"_"+e.tracking.vt_content;break;case"search":a=e.query;break;case"confirmation":a=(e.orderId?e.orderId+"_":"")+(e.items?e.items.length:0)}}catch(e){object.Helpers.log("Error building opt_label for analytics","error")}if("undefined"!=typeof ga){try{object.state.ganame=ga.getAll()[0].get("name")+"."}catch(e){object.state.ganame=""}ga(object.state.ganame+"send","event",object.shop.ganalytics.category,e.type,a,0,{nonInteraction:1}),clearInterval(t)}else"undefined"!=typeof _gaq&&(_gaq.push(["_trackEvent",object.shop.ganalytics.category,e.type,a,0,!0]),clearInterval(t))},100);setTimeout(function(){clearInterval(t)},1e3)}},getStorageType:function(){if(vtstore.enabled)return"vts";if(window.indexedDB=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,window.indexedDB){var e=window.indexedDB.open("vtstore",1);return e.onupgradeneeded=function(t){var a=e.result;object.state.db=a;var o=a.createObjectStore("vtStoreObj",{keyPath:"id"});object.state.store=o},e.onerror=function(e){object.Helpers.log("DB error","error")},e.onsuccess=function(t){object.state.db=e.result},"db"}return!1},updateCookie:function(e,t){var a=object.Helpers.getCookie(e,!0);a&&(vtlodash.isObject(t)?a.val=vtlodash.merge(a.val,t):a.val=t,object.Helpers.setCookie(e,a.val,a.exp))},setCookie:function(e,t,a){if(e=object.defaults.prefix+e,a=vtlodash.isNumber(a)?a:0,"vts"==object.state.storage)vtstore.set(e,{val:t,exp:a,time:(new Date).getTime()});else if("db"==object.state.storage)try{object.state.db.transaction(["vtStoreObj"],"readwrite").objectStore("vtStoreObj").put({id:e,val:t,exp:a,time:(new Date).getTime()}).onsuccess=function(e){}}catch(o){setTimeout(function(){object.Helpers.setCookie(e.replace(object.defaults.prefix,""),t,a)},50)}if(e===object.defaults.prefix+object.defaults.cookieNames.uId){var o=t.userId+"_"+t.sessionId+"_"+t.email+"_"+!!t.push;object.Helpers.writeCookie(object.defaults.prefix+object.defaults.cookieNames.uId,o,object.defaults.expiration)}},getCookie:function(e,t){t=!!t,e=object.defaults.prefix+e;var a=function(a){ return t?a:a?a.exp>0&&(new Date).getTime()-a.time>a.exp?(object.Helpers.removeCookie(e),null):a.val:null};if("vts"==object.state.storage){var o=vtstore.get(e);return a(o)}if("db"==object.state.storage)try{object.state.db.transaction(["vtStoreObj"],"readwrite").objectStore("vtStoreObj").get(e).onsuccess=function(e){return a(e.target.result)}}catch(t){setTimeout(function(){return object.Helpers.getCookie(e.replace(object.defaults.prefix,""))},50)}},readCookie:function(e){var t=null;try{t=new RegExp(e+"=([^;]+)").exec(document.cookie)}catch(e){object.Helpers.log("Trying to read inexistent cookie","warning")}return null!=t?unescape(t[1]):null},writeCookie:function(e,t,a){try{if(vtlodash.isNumber(a)){var o=new Date;o.setTime(o.getTime()+a),a=";expires="+o.toGMTString()}else a="";document.cookie=e+"="+t+a+";domain=."+window.location.hostname+";path=/"}catch(e){object.Helpers.log("Error trying to set cookie","warning")}},removeCookie:function(e){if(e=object.defaults.prefix+e,"vts"==object.state.storage)vtstore.remove(e);else if("db"==object.state.storage)try{object.state.db.transaction(["vtStoreObj"],"readwrite").objectStore("vtStoreObj").delete(e)}catch(t){setTimeout(function(){object.Helpers.removeCookie(e.replace(object.defaults.prefix,""))},100)}},extractMainURL:function(e){return e.indexOf("?")>=0?e.substring(0,e.indexOf("?")):e},extractDomain:function(e){var t;return e=e||"",t=e.indexOf("//")>-1?e.split("/")[2]:e.split("/")[0],t=t.split(":")[0]},makeQueryString:function(e){var t=[];for(var a in e)e.hasOwnProperty(a)&&t.push(encodeURIComponent(a)+"="+encodeURIComponent(e[a]));return t.join("&")},addQueryString:function(e,t){return object.Helpers.extractMainURL(e)+"?"+object.Helpers.makeQueryString(vtlodash.merge(object.Helpers.getURLParams(e),t))},getURLParams:function(e){return e.substring(e.indexOf("?")+1).replace(/(^\?)/,"").split("&").map(function(e){return e=e.split("="),e[0]&&!vtlodash.isUndefined(e[1])&&(this[e[0]]=e[1]),this}.bind({}))[0]},browserInfo:function(e){var t,a=navigator.userAgent,o=a.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];if(/trident/i.test(o[1])){if(t=/\brv[ :]+(\d+)/g.exec(a)||[],"name"==e)return"explorer";if("version"==e)return t[1]}if("Chrome"===o[1]){if(null!=(t=a.match(/\bOPR\/(\d+)/))&&"name"==e)return"opera";if(null!=t&&"version"==e)return t[1]}return o=o[2]?[o[1],o[2]]:[navigator.appName,navigator.appVersion,"-?"],null!=(t=a.match(/version\/(\d+)/i))&&o.splice(1,1,t[1]),"version"==e?o[1]:"name"==e?(o[0]="MSIE"==o[0]?"Explorer":o[0],o[0].toLowerCase()):void 0},browserLang:function(){var e=window.navigator.userLanguage||window.navigator.language;return e&&e.substring(0,e.indexOf("-"))||""},osName:function(){for(var e=[{string:navigator.platform.toLowerCase(),subString:"win",identity:"Windows"},{string:navigator.platform.toLowerCase(),subString:"mac",identity:"Mac"},{string:navigator.userAgent.toLowerCase(),subString:"iphone",identity:"iOS"},{string:navigator.userAgent.toLowerCase(),subString:"android",identity:"Android"},{string:navigator.platform.toLowerCase(),subString:"linux",identity:"Linux"}],t=0;t<e.length;t++){var a=e[t].string;if(a&&-1!=a.indexOf(e[t].subString))return e[t].identity}},inputHasValue:function(e,t){var a,o=!1;switch(e.nodeName){case"INPUT":switch(e.type){case"text":case"url":case"email":case"date":case"number":case"hidden":case"password":case"button":case"reset":case"submit":o=e.value;break;case"checkbox":case"radio":o=t.querySelector('input[name="'+e.name+'"]:checked'),o&&(o=o.value)}break;case"TEXTAREA":o=e.value;break;case"SELECT":switch(e.type){case"select-one":o=e.value;break;case"select-multiple":for(a=e.options.length-1;a>=0;a-=1)e.options[a].selected&&(o=e.options[a].value)}break;case"BUTTON":switch(e.type){case"reset":case"submit":case"button":o=e.value}}return vtlodash.isString(o)&&(o=encodeURIComponent(o.trim())),o},isDomNode:function(e){try{return!!e.nodeName}catch(e){return!1}},applyStyle:function(e,t,a){if(e)if(object.Helpers.isDomNode(e))e.style[t]=a;else for(el in e)e.hasOwnProperty(el)&&object.Helpers.isDomNode(e[el])&&(e[el].style[t]=a)},showDom:function(e){object.Helpers.applyStyle(e,"display","block")},hideDom:function(e){object.Helpers.applyStyle(e,"display","none")},embedTag:function(e,t,a,o){a=a||"body",e=e||"div",t=t||"";var s=documentAlias.createElement(e);for(el in o)o.hasOwnProperty(el)&&s.setAttribute(el,o[el]);return s.innerHTML=t,vtlodash.isString(a)?documentAlias.getElementsByTagName(a)[0].appendChild(s):object.Helpers.isDomNode(a)&&a.appendChild(s),s},readDataLayer:function(){if(windowAlias&&vtlodash.isArray(windowAlias.dataLayer)&&vtlodash.size(windowAlias.dataLayer)>0){for(var e=windowAlias.dataLayer,t={event:{}},a=0;a<e.length;a++)if(!vtlodash.isObject(e[a])||e[a].event&&0===e[a].event.indexOf("gtm."))vtlodash.isArguments(e[a])&&"event"==e[a][0]&&(t.event[e[a][1]]=t.event[e[a][1]]||[],t.event[e[a][1]].push(e[a][2]));else if(e[a].event)t.event[e[a].event]=t.event[e[a].event]||[],t.event[e[a].event].push(e[a]);else for(var o in e[a])e[a].hasOwnProperty(o)&&(t[o]=t[o]||[],t[o][e[a][o]]=t[o][e[a][o]]||[],t[o][e[a][o]].push(e[a][o]));return t}return null},deviceType:function(){var e=object.Helpers.strtolower(navigator.userAgent||navigator.vendor||window.opera),t="desktop";return e.match(/(ipad|galaxy|xoom|touchpad|t800)/)?t="tablet":(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4)))&&(t="mobile"),t},strtolower:function(e){return void 0==e&&(e=""),vtlodash.isString(e)?e.toLowerCase():e},getExternalReferrer:function(){return object.Helpers.extractDomain(documentAlias.referrer)==windowAlias.location.hostname?null:documentAlias.referrer},checkAndSubscribe:function(e,t,a,o){var s=document.querySelector(e);if(s&&object.Helpers.emailIsValid(s.value)){var n=!0;if(t){n=!1;var i=document.querySelector(t);i&&i.checked&&(n=!0)}if(!n)return;var r={login:{email:s.value,isSubscribed:!0,isSubscribedAlerts:!0}};return o&&vtlodash.isObject(o)&&(r.login=vtlodash.merge(o,r.login)),a?object.eventApi.pushNext(r):object.state.eventQueue.push(r),!0}return!1}},object.Recommender={embedMerchandisingCampaigns:function(){if(!1!==object.shop.params.hasRunningReccs&&!0!==object.state.calledRecommender){object.Helpers.log("Started looking for merchandising campaigns on page!","info");var e=documentAlias.getElementsByClassName(object.defaults.recc.className),t=!1;object.state.reccCampaigns=[];for(i in e)if(e.hasOwnProperty(i)&&object.Helpers.isDomNode(e[i])){var a=e[i],o=a.getAttribute(object.defaults.recc.attributeId);try{o&&object.shop.merchandising[o]?(object.shop.merchandising[o].siteParams.eventBound&&(t=!0),object.state.reccCampaigns.push(o)):object.Helpers.log("Trying to embed merchandising campaign "+o+"not running!","warning")}catch(e){}}return object.Helpers.log("There are "+object.state.reccCampaigns.length+" merchandising campaigns on page!","info"),object.state.waitReccEvent=t,(t&&vtlodash.isObject(object.state.reccEvent)||!1===t)&&(object.Helpers.log("Recc Event is already here!","warning"),object.Recommender.getData()),object.state.reccCampaigns}},callBackRecommender:function(e){object.Helpers.log("Started inserting merchandising campaigns into page","info"),object.state.waitReccEvent=!1;for(c in object.state.reccCampaigns)if(object.state.reccCampaigns.hasOwnProperty(c)){cId=object.state.reccCampaigns[c];var t=document.querySelectorAll('[data-vt-id="'+cId+'"]');t&&1==t.length&&e[cId]&&(!0===object.shop.merchandising[cId].siteParams.testMode&&"info"===object.defaults.debug||!object.shop.merchandising[cId].siteParams.testMode?(t[0].innerHTML=e[cId],object.state.eventQueue.push(object.Campaign.createSiteEvent(object.defaults.siteEvents.display,cId,object.state.reccTpls[cId]))):object.Helpers.log("Campaign "+cId+" not embeded because of test mode!","error"))}object.Helpers.log("Finished inserting merchandising campaigns into page","info")},callBackRecommenderTwo:function(data){object.Helpers.log("Started inserting recommender response one campaign","info");for(var cId in data)if(data.hasOwnProperty(cId)){var cDom=document.getElementById(object.defaults.idPrefix+cId);if(cDom&&data[cId]){if(vtlodash.isString(data[cId]))var newHtml=object.Campaign.interpolateVars(data[cId]);else if(vtlodash.isObject(data[cId])){data[cId].loadLibrary&&eval(data[cId].loadLibrary),data[cId].campaign&&("content"==data[cId].campaign.type?object.shop.content.campaigns[cId]=data[cId].campaign:object.shop.campaigns[cId]=data[cId].campaign);var newHtml=object.Campaign.interpolateVars(data[cId].html)}cDom.innerHTML=newHtml,eval(object.Helpers.extractTagFromHtml(newHtml,"script"))}if(object.state.pageCampaigns[cId]&&!0!==object.state.pageCampaigns[cId])var tpl=object.state.pageCampaigns[cId];else if(cDom&&cDom.getAttribute("data-tpl"))var tpl=cDom.getAttribute("data-tpl");tpl&&object.Campaign.attachClickEvents(cId,tpl,cDom)}object.Helpers.log("Finished inserting recommender response for one campaign","info")},getData:function(e,t){if(vtlodash.isUndefined(e)&&(vtlodash.size(object.state.reccCampaigns)<1||object.state.calledRecommender))return void object.Helpers.log("No recommendations campaigns on page/already called! ","warning");var a={};if(vtlodash.isUndefined(e)){for(c in object.state.reccCampaigns)if(object.state.reccCampaigns.hasOwnProperty(c)){var o=object.state.reccCampaigns[c];object.shop.merchandising[o]?a[o]=object.Helpers.pickRandomPercentages(object.shop.merchandising[o].templatesPick.params):object.Helpers.log("Onsite merchandising campaign "+o+" not found under shop campaigns","error")}object.state.reccTpls=a}else vtlodash.isUndefined(t)?a[e]=object.Helpers.pickRandomPercentages(object.shop.campaigns[e].templatesPick.params):a[e]=t;var s={userId:object.User.data.userId,sessionId:object.User.data.sessionId,campaigns:a};if(object.state.waitReccEvent&&vtlodash.isUndefined(e)){var n={},i="";object.state.reccEvent&&object.state.reccEvent.hasOwnProperty("viewitem")&&(object.Helpers.log("Recommender event "+JSON.stringify(object.state.reccEvent),"info"),n.itemId=object.state.reccEvent.viewitem.itemId,i="viewitem"),object.state.reccEvent&&object.state.reccEvent.hasOwnProperty("addtocart")&&(object.Helpers.log("Recommender event "+JSON.stringify(object.state.reccEvent),"info"),n.itemId=object.state.reccEvent.addtocart.itemId,i="addtocart"),object.state.reccEvent&&object.state.reccEvent.hasOwnProperty("viewcategory")&&(object.Helpers.log("Recommender event "+JSON.stringify(object.state.reccEvent),"info"),n.category=object.state.reccEvent.viewcategory.category,i="viewcategory"),s.eventType=i,s.event=n}var r={data:JSON.stringify(s),callback:object.defaults.reccsCallback};if(vtlodash.isUndefined(e)){var l=vtlodash.size(object.state.reccCampaigns)+" campaigns";object.state.calledRecommender=!0}else{var l=""+e;r.callback=object.defaults.reccsCallbackTwo,r.returnType="detail"}if(0===vtlodash.size(s.campaigns))return void object.Helpers.log("Trying to request recommender without campaigns ","error");var d=object.defaults.reccsHost+object.shop.id+"/";return d=object.Helpers.addQueryString(d,r),object.Helpers.log("Calling the recommender for "+l,"info"),object.Helpers.getAsync(d),s.campaigns}},object.Campaign={extractAttributeFromClass:function(e){var t=new RegExp(object.defaults.siteClasses.attrPrefix+"([^\\s]+)","g");try{t.lastIndex=0;return t.exec(e)[1]}catch(t){object.Helpers.log("Error extracting attribute or from class "+e,"error")}return null},displayCampaign:function(cId,display){if(!cId||!object.shop.campaigns[cId])return!1;var campaign=object.shop.campaigns[cId],ret={};if(4==campaign.campaignType){windowAlias._vtpoll.data=campaign;var div=windowAlias._vtpoll.init(!1);documentAlias.getElementsByTagName("body")[0].appendChild(div),ret.tpl=0,object.Campaign.attachClickEvents(cId,ret.tpl,div)}else{ret.tpl=object.Helpers.pickRandomPercentages(campaign.templatesPick.params);var div=documentAlias.createElement("div");object.Helpers.hideDom(div),div.setAttribute("id",object.defaults.idPrefix+cId),div.setAttribute("data-tpl",ret.tpl);var runJs=!1;if(!1===campaign.templates[ret.tpl])object.Recommender.getData(cId);else{var newHtml=object.Campaign.interpolateVars(campaign.templates[ret.tpl]);div.innerHTML=newHtml,runJs=!0}documentAlias.getElementsByTagName("body")[0].appendChild(div),runJs&&eval(object.Helpers.extractTagFromHtml(newHtml,"script")),object.Campaign.attachClickEvents(cId,ret.tpl,div)}return display&&object.Helpers.showDom(div),ret.dom=div,ret},embedCampaign:function(e,t){if(e&&t){var a=object.Helpers.embedTag("div","","body",{id:object.defaults.idPrefix+e,"data-tpl":t});return object.Recommender.getData(e,t),object.state.pageCampaigns[e]||(object.state.pageCampaigns[e]=t),a}var o=object.Helpers.getCookie(object.defaults.cookieNames.cStatus+e);vtlodash.isNull(o)&&(o={no:0}),o.stop&&!object.shop.campaigns[e].siteParams.displayCountSession&&"0"==object.shop.campaigns[e].siteParams.afterClose&&delete o.stop;var s=object.User.context.session[e];vtlodash.isNull(s)&&(s=0);var a=documentAlias.getElementById(object.defaults.idPrefix+e);try{if(object.shop.campaigns[e].siteParams.displayCountSession&&s>=object.shop.campaigns[e].siteParams.displayCountSession&&(object.Helpers.log("Number of displays per session overcome for "+e,"error"),o.stop=!0),!0===object.shop.campaigns[e].siteParams.testMode&&"info"!==object.defaults.debug)return void object.Helpers.log("Campaign "+e+" not embeded because of test mode!","error");if(!object.Campaign.checkDisplayLimits(e,object.shop.campaigns[e].siteParams))return;if(a||!(o.no<object.shop.campaigns[e].siteParams.displayCount)&&object.shop.campaigns[e].siteParams.displayCount||!0===o.stop)return void object.Helpers.log("Not allowed to embed campaign "+e,"warning");object.Helpers.log("Embeding campaign "+e+" into page","info");var n=object.Campaign.displayCampaign(e,!1);return o.tpl=n.tpl,object.Helpers.setCookie(object.defaults.cookieNames.cStatus+e,o),n.dom}catch(t){object.Helpers.log("Error trying to embed campaign "+e+". Does not exists or attr missing.","error")}},embedContent:function(cDom,cId,siteParams,tId,groupId){var contentId=cId+"_"+groupId,cStatusSession=object.User.context.session[contentId];if(cStatusSession||(cStatusSession=0),cStatusSession+=1,siteParams.displayCountSession&&cStatusSession>siteParams.displayCountSession)return object.Helpers.log("Number of displays per session overcome for "+contentId,"error"),!1;var sessContext=object.User.context&&object.User.context.session||object.Helpers.getCookie(object.defaults.cookieNames.sess);sessContext[contentId]=cStatusSession,object.Helpers.setCookie(object.defaults.cookieNames.sess,sessContext,object.defaults.sessionDuration);try{if(object.Helpers.log("Embeding content "+contentId+" "+tId+" into page","info"),cDom.setAttribute("id",object.defaults.idPrefix+cId),cDom.setAttribute("data-tpl",tId),!1===object.shop.content.templates[tId])object.Recommender.getData(cId,tId);else{var newHtml=object.Campaign.interpolateVars(object.shop.content.templates[tId]);cDom.innerHTML=newHtml,eval(object.Helpers.extractTagFromHtml(newHtml,"script"))}return object.Campaign.attachClickEvents(cId,tId,cDom),cDom}catch(e){return object.Helpers.log("Error trying to embed campaign "+contentId+". Does not exists or attr missing.","error"),!1}},runDisplayCampaign:function(cId){var campaign=object.shop.campaigns[cId],cStatus=object.Helpers.getCookie(object.defaults.cookieNames.cStatus+cId);cStatus.no+=1,cStatus.no===campaign.siteParams.displayCount&&(cStatus.stop=!0),cStatus&&cStatus.stop&&!object.shop.campaigns[cId].siteParams.displayCountSession&&delete cStatus.stop,object.Helpers.setCookie(object.defaults.cookieNames.cStatus+cId,cStatus);var cStatusSession=vtlodash.isNumber(object.User.context.session[cId])?object.User.context.session[cId]:0;cStatusSession+=1;var sessContext=object.User.context&&object.User.context.session||object.Helpers.getCookie(object.defaults.cookieNames.sess);if(sessContext[cId]=cStatusSession,object.Helpers.setCookie(object.defaults.cookieNames.sess,sessContext,object.defaults.sessionDuration),cStatus&&(object.state.pageCampaigns[cId]=!0,object.state.eventQueue.push(object.Campaign.createSiteEvent(object.defaults.siteEvents.display,cId,cStatus.tpl)),object.Helpers.log("Campaign "+cId+" has been displayed","info")),campaign.siteParams.jsDisplay)try{eval(campaign.siteParams.jsDisplay)}catch(e){}if(campaign.siteParams.autoClose&&campaign.siteParams.autoClose>0){var cDom=cDom||documentAlias.getElementById(object.defaults.idPrefix+cId);setTimeout(function(){object.Helpers.hideDom(cDom)},1e3*campaign.siteParams.autoClose)}},interpolateVars:function(e,t,a){if(!t)var t=object.User.context;var o=e,s=new RegExp(/\*\*\|([^\s]+?)\|\*\*/g);do{var n=s.exec(e);if(n){var i=object.Helpers.getDeepValue(t,n[1]);if(!(i=i||"")&&a)continue;o=o.replace(n[0],i)}}while(n);return o},increaseCountIsValid:function(e,t,a,o){var s=!1;return"p"===e&&"session.pathname"===t?s=!0:"e"==e&&vtlodash.isString(t)&&"session.vte."+o.type===t&&(s=!0),s},statusObserver:function(e,t){if(!object.state.hasUser)return object.Helpers.log("No user, onsite campaigns delayed for "+e,"info"),void setTimeout(function(){object.Campaign.statusObserver(e,t)},1e3);if(object.Helpers.log("Starting Onsite campaigns observer "+e,"info"),"v"!==e&&object.shop.params.countConditions&&vtlodash.size(object.shop.params.countConditions)>0){object.Helpers.log("Increasing counts for display rules conditions","info");var a=object.Helpers.getCookie(object.defaults.cookieNames.condCount);a=a||{};for(var o=0;o<vtlodash.size(object.shop.params.countConditions);o++){cond=object.shop.params.countConditions[o],condKey=object.shop.params.countConditionsKeys[cond.key+cond.op+cond.val];var s=object.Helpers.getContextValue(cond.key,e,t);object.Helpers.valuesComparer(s,cond.val,cond.op)&&object.Campaign.increaseCountIsValid(e,cond.key,s,t)&&(a[condKey]=a[condKey]||0,a[condKey]+=1)}object.Helpers.setCookie(object.defaults.cookieNames.condCount,a)}if(vtlodash.size(object.shop.campaigns)>0){object.state.campaignsOK=[];for(cId in object.shop.campaigns){var n=object.Helpers.getCookie(object.defaults.cookieNames.cStatus+cId);if(n&&n.stop&&!object.shop.campaigns[cId].siteParams.displayCountSession&&delete n.stop,object.shop.campaigns.hasOwnProperty(cId)&&(n&&!0!==n.stop||vtlodash.isNull(n))){c=object.shop.campaigns[cId];var i=!1;c.siteParams.displayRulesOR&&c.siteParams.displayRulesOR.length>0&&(i=!0),(object.Campaign.checkDisplayRules(c.siteParams.displayRules,!1)||i&&object.Campaign.checkDisplayRules(c.siteParams.displayRulesOR,i))&&!object.state.pageCampaigns[cId]&&object.state.campaignsOK.push(cId)}}object.tasks.addReadyListener(object.Campaign.triggerCampaigns,"trigc")}object.Helpers.log("Ending Onsite campaigns observer "+e,"info")},triggerCampaigns:function(){if(vtlodash.size(object.state.campaignsOK)>0){object.Helpers.log("Triggering campaigns that match display rules","info");for(var e=[],t=!1,a=0;a<vtlodash.size(object.state.campaignsOK);a++)cId=object.state.campaignsOK[a],object.shop.campaigns[cId].siteParams.priority&&0!=object.shop.campaigns[cId].siteParams.priority||e.push(cId),vtlodash.isNumber(object.shop.campaigns[cId].siteParams.priority)&&(t&&object.shop.campaigns[cId].siteParams.priority>object.shop.campaigns[t].siteParams.priority||!t)&&(t=cId);object.Helpers.log("No priority campaigns in "+e.length+". Max priority "+t,"info"),t&&(object.Campaign.triggerOne(t,object.shop.campaigns[t]),e.indexOf(t)>=0&&e.splice(e.indexOf(t),1));for(var a=0;a<e.length;a++)object.Campaign.triggerOne(e[a],object.shop.campaigns[e[a]])}},triggerOne:function(e,t){if(e){if(t.siteParams.limitDisplay&&t.siteParams.limitDisplay.operator&&!object.Helpers.valuesComparer(t.siteParams.limitDisplay.pageType,object.User.context.vars.pageType,t.siteParams.limitDisplay.operator))return void object.Helpers.log("Campaign "+e+" cant be displayed on this page","warning");object.Helpers.log("Campaign "+e+" might be triggered","info");var a={};a.timeOnPage=function(t,a){object.Helpers.log("Trigger "+e+" after "+a.delay+" seconds","info");var o=vtlodash.isNumber(a.delay)&&1e3*a.delay||0;setTimeout(function(){(!object.shop.campaigns[e].siteParams.single||object.shop.campaigns[e].siteParams.single&&!object.state.singleFlag)&&(object.Helpers.showDom(t),object.Campaign.runDisplayCampaign(e),object.shop.campaigns[e].siteParams.single&&(object.state.singleFlag=!0))},o)},a.onClose=function(t,a){object.Helpers.log("Trigger "+e+" on page unload ","info"),windowAlias.onbeforeunload=function(){return object.Helpers.showDom(t),object.Campaign.runDisplayCampaign(e),"?"}},a.onInactivity=function(t,a){object.state.inactivityCampaigns.push(e)},a.onExit=function(t,a){function o(){object.Helpers.addEventListener(u,"mouseleave",s),object.Helpers.addEventListener(u,"mouseenter",n),object.Helpers.addEventListener(u,"keydown",i)}function s(e){if(!(e.clientY>d.sensitivity)){var t=Math.max(document.documentElement.clientWidth,window.innerWidth||0),a=t*d.cornerWidth/100;"input"!=e.target.tagName.toLowerCase()&&("left"==d.corner&&e.clientX>a||"right"==d.corner&&e.clientX<t-a||"any"==d.corner&&e.clientX>a&&e.clientX<t-a||e.clientX>=t-50||(l=setTimeout(r,1e3*d.delay)))}}function n(){l&&d.cancelDelay&&(clearTimeout(l),l=null)}function i(e){p||e.metaKey&&76===e.keyCode&&(p=!0,l=setTimeout(r,d.delay))}function r(){object.Helpers.showDom(t),object.shop.campaigns[e].siteParams.single&&object.state.singleFlag?object.Helpers.hideDom(t):(object.Campaign.runDisplayCampaign(e),object.shop.campaigns[e].siteParams.single&&(object.state.singleFlag=!0)),c()}function c(e){u.removeEventListener("mouseleave",s),u.removeEventListener("mouseenter",n),u.removeEventListener("keydown",i),l&&clearTimeout(l)}var l,d={sensitivity:a.sensitivity||20,timer:a.timer||1,delay:a.delay||0,cancelDelay:a.cancelDelay||!1,corner:a.corner||"any",cornerWidth:a.cornerWidth||50},u=document.documentElement,p=!1;"os"==d.corner&&(d.corner="left",["Windows"].indexOf(object.User.context.session.osname)>=0&&(d.corner="right")),setTimeout(o,1e3*d.timer),object.Helpers.log("Trigger "+e+" on exit intent","info")},a.onClick=function(t,a){if(a.selector){var o=documentAlias.querySelectorAll(a.selector);for(el in o)o.hasOwnProperty(el)&&object.Helpers.addEventListener(o[el],"click",function(a){a.preventDefault(),object.Helpers.showDom(t),object.state.pageCampaigns[e]||(!object.shop.campaigns[e].siteParams.single||object.shop.campaigns[e].siteParams.single&&!object.state.singleFlag)&&(object.Campaign.runDisplayCampaign(e),object.shop.campaigns[e].siteParams.single&&(object.state.singleFlag=!0))},!1);object.Helpers.log("Trigger "+e+" on click elements "+a.selector,"info")}},a.onScroll=function(t,a){a.percent=vtlodash.isNumber(a.percent)?a.percent:25;var o=function(t,a){try{var a=100*((document.documentElement.scrollTop+document.body.scrollTop)/(document.documentElement.scrollHeight-document.documentElement.clientHeight)||0)}catch(e){var a=0}a>=a&&!object.state.pageCampaigns[e]&&(!object.shop.campaigns[e].siteParams.single||object.shop.campaigns[e].siteParams.single&&!object.state.singleFlag)&&(object.Helpers.showDom(t),object.Campaign.runDisplayCampaign(e),object.shop.campaigns[e].siteParams.single&&(object.state.singleFlag=!0))};object.Helpers.addEventListener(windowAlias,"scroll",function(e){o(t,a.percent)}),object.Helpers.log("Trigger "+e+" on % scroll ","info")},a.onLeave=function(t,a){if(object.state.leaveCp=object.state.leaveCp||[],object.state.leaveCp.push(e),1==object.state.leaveCp.length&&history.replaceState){var o=!1;if(object.Helpers.getExternalReferrer()?(object.state.exit_vtp=history.length-1,_vtsdk.User.context.session.exit_vtp=object.state.exit_vtp,object.Helpers.updateCookie(object.defaults.cookieNames.sess,{exit_vtp:object.state.exit_vtp}),o=!0):history.state&&history.state.vtp&&object.User.context.session.exit_vtp===history.state.vtp&&(object.state.exit_vtp=object.User.context.session.exit_vtp,o=!0),!o)return;object.Helpers.log("onLeave trigger is valid.","info"),history.replaceState({vtp:object.state.exit_vtp,href:location.href},""),history.pushState({vtp:object.state.exit_vtp+1,href:location.href},""),object.Helpers.addEventListener(windowAlias,"popstate",function(t){if(history.state&&history.state.vtp==object.state.exit_vtp)for(var a=0;a<object.state.leaveCp.length;a++){var o=object.state.leaveCp[a],o=documentAlias.getElementById(object.defaults.idPrefix+e);object.Helpers.showDom(o),object.Campaign.runDisplayCampaign(e)}})}},setTimeout(function(){if(["complete","loaded","interactive"].indexOf(document.readyState)>=0){var o=object.Campaign.embedCampaign(e),s=vtlodash.isNull(t.siteParams.trigger.params)?null:t.siteParams.trigger.params;if(o)return object.Helpers.log("Attaching trigger to campaign "+e,"info"),a[t.siteParams.trigger.mode](o,s)}},10)}},triggerInactivityCampaigns:function(e){if(e+=2,object.state.inactivityCampaigns&&object.shop.params.hasActTriggers)for(var t,a=object.state.inactivityCampaigns.length-1;a>=0;a--){var o=object.state.inactivityCampaigns[a];!object.state.pageCampaigns[o]&&object.shop.campaigns[o].siteParams.trigger.params.delay<=e&&(object.Helpers.log("Valid inactivity campaign "+o,"info"),(!object.shop.campaigns[o].siteParams.single||object.shop.campaigns[o].siteParams.single&&!object.state.singleFlag)&&(t=documentAlias.getElementById(object.defaults.idPrefix+o),object.Helpers.showDom(t),object.Campaign.runDisplayCampaign(o),object.shop.campaigns[o].siteParams.single&&(object.state.singleFlag=!0)))}},buildAttrObject:function(e,t){for(var a,o,s={},n=0;n<e.length;n++)try{if(!(a=object.Campaign.extractAttributeFromClass(e[n].className))||!t&&-1!=e[n].className.indexOf(object.defaults.siteClasses.submit))continue;null!==(o=e[n]=e[n].value||null)&&""!==o&&(["radio","checkbox"].indexOf(e[n].type)<0||!0===e[n].checked)&&("tags"==a?(s[a]=s[a]||[],s[a].push(o)):s[a]=o)}catch(e){object.Helpers.log("Error getting attribute type and value from campaign inputs","error")}return s},createSiteEvent:function(e,t,a,o){var s={};if(e){if(o)var o=JSON.parse(JSON.stringify(o));var n=object.shop.campaigns[t]?object.shop.campaigns[t].campaignType:null;if(vtlodash.isNull(n)&&(n=null==n&&object.shop.merchandising[t]?object.shop.merchandising[t].campaignType:null,vtlodash.isNull(n)&&(n=null==n&&object.shop.params.hasRunningContent&&object.shop.content.campaigns[t]?object.shop.content.campaigns[t].campaignType:null),vtlodash.isNull(n)&&(n=null==n&&object.shop.params.hasRunningAds&&object.shop.adserver&&object.shop.adserver.campaigns&&object.shop.adserver.campaigns[t]?object.shop.adserver.campaigns[t].campaignType:null)),o&&o.campaignType&&(n=o.campaignType),null===n&&(n=0),!t||!a)return!1;s[e]={tracking:{vt_campaign:t,vt_content:a,campaignType:n}},o&&o.generic&&o.generic.tags&&(o.tags=o.generic.tags,delete o.generic.tags),vtlodash.isObject(o)&&(s[e]=vtlodash.merge(s[e],o))}return s},attachClickEvents:function(cId,tpl,cDom){var cDomDom=cDom;if(cDomDom&&cDomDom.innerHTML&&""===cDomDom.innerHTML.trim())return void object.Helpers.log("Empty tag, so we won't attach click events","error");object.Helpers.log("Attaching click events on campaign classes ","info");var elem,toggle_fct=function(e,t,a){try{var a=a||documentAlias.getElementById(object.defaults.idPrefix+e);if(!a)return;var o,s;o=a.getElementsByClassName(t);for(s in o)o.hasOwnProperty(s)&&(o[s].style.display="none"==o[s].style.display?"block":"none")}catch(e){console.log(e)}};elem=cDom.querySelectorAll("[vtw-toggle]");for(el in elem)elem.hasOwnProperty(el)&&object.Helpers.addEventListener(elem[el],"click",function(e){return e.preventDefault(),object.Helpers.log("Toggle event attached to "+el+" element for "+cId,"info"),toggle_fct(cId,elem[el].getAttribute("vtw-toggle"),cDomDom)},!1);var close_fct=function(cId,tpl,cDom){var cDom=cDom||documentAlias.getElementById(object.defaults.idPrefix+cId),cObject=object.shop.campaigns[cId]||object.shop.content.campaigns[cId]||!1;if(cDom&&(object.Helpers.hideDom(cDom),cObject)){if("0"!=cObject.siteParams.afterClose&&(cStatus=object.Helpers.getCookie(object.defaults.cookieNames.cStatus+cId),cStatus.stop=!0,object.Helpers.setCookie(object.defaults.cookieNames.cStatus+cId,cStatus,object.defaults.dayDuration*parseInt(cObject.siteParams.afterClose)),object.Helpers.log("Campaign "+cId+" not displayed for "+cObject.siteParams.afterClose+"days !","info")),cObject.siteParams.jsClose)try{eval(cObject.siteParams.jsClose)}catch(e){}cDom&&cDom.className.indexOf(object.defaults.siteClasses.click)>=0?(object.state.eventQueue.push(object.Campaign.createSiteEvent(object.defaults.siteEvents.click,cId,tpl)),object.Helpers.setAnalyticsSource(cId,"interaction")):object.state.eventQueue.push(object.Campaign.createSiteEvent(object.defaults.siteEvents.close,cId,tpl))}};elem=cDom.getElementsByClassName(object.defaults.siteClasses.close);for(el in elem)elem.hasOwnProperty(el)&&object.Helpers.addEventListener(elem[el],"click",function(e){e.preventDefault(),e.stopPropagation();try{if(e.currentTarget.className.indexOf(object.defaults.siteClasses.overlay)>=0&&e.target!==e.currentTarget)return!1}catch(e){}return object.Helpers.log("Close event attached to "+el+" element for "+cId,"info"),close_fct(cId,tpl,cDomDom)},!1);var click_fct=function(e,t,a){if(object.shop.campaigns[e]||object.shop.content.campaigns[e]||!1){object.state.eventQueue.push(object.Campaign.createSiteEvent(object.defaults.siteEvents.click,e,t)),object.Helpers.setAnalyticsSource(e,"interaction");var o=a.getAttribute("href");o&&("_blank"==a.getAttribute("target")?window.open(o):window.location=o)}};elem=cDom.getElementsByClassName(object.defaults.siteClasses.click);for(el in elem)elem.hasOwnProperty(el)&&object.Helpers.addEventListener(elem[el],"click",function(e){return e.preventDefault(),e.stopPropagation(),object.Helpers.log("Click event attached to "+el+" element for "+cId,"info"),click_fct(cId,tpl,e.currentTarget)},!1);var submit_fct=function(target,cId,tpl,cDom){ var cDom=cDom||documentAlias.getElementById(object.defaults.idPrefix+cId),cObject=object.shop.campaigns[cId]||object.shop.content.campaigns[cId]||!1;if(cDom){for(var reqOK=!0,invalidOK=!0,req=cDom.querySelectorAll("[required]"),class2Add="",i=0;i<req.length;i++){class2Add="",object.Helpers.inputHasValue(req[i],cDom)||(reqOK=!1,class2Add=" "+object.defaults.siteClasses.required);try{req[i].className=req[i].className.split(object.defaults.siteClasses.required).join("")+class2Add,req[i].parentNode&&(req[i].parentNode.className=req[i].parentNode.className.split(object.defaults.siteClasses.required).join("")+class2Add)}catch(e){}try{class2Add="",req[i].validity.valid||(class2Add=" "+object.defaults.siteClasses.invalid,req[i].className=req[i].className.split(object.defaults.siteClasses.invalid).join("")+class2Add,invalidOK=!1),req[i].parentNode&&(req[i].parentNode.className=req[i].parentNode.className.split(object.defaults.siteClasses.invalid).join("")+class2Add)}catch(e){}}if(!reqOK)return cDom.className=cDom.className.split(object.defaults.siteClasses.required).join("")+" "+object.defaults.siteClasses.required,void object.Helpers.showDom(cDom.getElementsByClassName(object.defaults.siteClasses.error));if(!invalidOK)return cDom.className=cDom.className.split(object.defaults.siteClasses.invalid).join("")+" "+object.defaults.siteClasses.invalid,void object.Helpers.showDom(cDom.getElementsByClassName(object.defaults.siteClasses.error));var elem=cDom.getElementsByClassName(object.defaults.siteClasses.attr),params=object.Campaign.buildAttrObject(elem,!1),submit_attr=object.Campaign.extractAttributeFromClass(target.className);if(submit_attr&&target.value&&(params[submit_attr]=target.value),submitOK=!1,params.email&&object.Helpers.emailIsValid(params.email))params.email=object.Helpers.cleanEmail(params.email),params.isSubscribed=!0,params.isSubscribedAlerts=!0,object.state.eventQueue&&object.state.eventQueue.push({login:params}),submitOK=!0,object.Helpers.setAnalyticsSource(cId,"interaction");else if(params.email&&!object.Helpers.emailIsValid(params.email))return object.Helpers.showDom(cDom.getElementsByClassName(object.defaults.siteClasses.error)),void(cDom.className=cDom.className.split(object.defaults.siteClasses.invalid).join("")+" "+object.defaults.siteClasses.invalid);if(!params.hasOwnProperty("email")||submitOK){object.state.eventQueue&&object.state.eventQueue.push(object.Campaign.createSiteEvent(object.defaults.siteEvents.submit,cId,tpl,{generic:params})),object.Helpers.setAnalyticsSource(cId,"interaction");var next=target.getAttribute("nextstate"),current=target.getAttribute("currentstate");if(next&¤t&&(next=0===next.indexOf(object.defaults.siteClasses.classPrefix)?next:object.defaults.siteClasses.classPrefix+next,current=0===current.indexOf(object.defaults.siteClasses.classPrefix)?current:object.defaults.siteClasses.classPrefix+current,object.Helpers.showDom(cDom.getElementsByClassName(next)),object.Helpers.hideDom(cDom.getElementsByClassName(current))),object.Helpers.hideDom(cDom.getElementsByClassName(object.defaults.siteClasses.error)),cObject&&cObject.siteParams.afterSubmit)if("close"===cObject.siteParams.afterSubmit)setTimeout(function(){object.Helpers.hideDom(cDom)},2e3);else if(parseInt(cObject.siteParams.afterSubmit)>0){var cStatus=object.Helpers.getCookie(object.defaults.cookieNames.cStatus+cId);vtlodash.isNull(cStatus)&&(cStatus={no:1}),cStatus.stop=!0,object.Helpers.setCookie(object.defaults.cookieNames.cStatus+cId,cStatus,object.defaults.dayDuration*parseInt(cObject.siteParams.afterSubmit)),object.Helpers.log("Campaign "+cId+" not displayed for "+cObject.siteParams.afterSubmit+"days !","info")}}try{object.state.ganame=object.state.ganame||ga.getAll()[0].get("name")+".",ga(object.state.ganame+"send","pageview","/submit?vt_campaign="+cId+"&vt_content="+tpl)}catch(e){}var onsubmit=target.getAttribute("onsubmit");if(onsubmit)try{eval(onsubmit)}catch(e){}if(cObject){if(cObject.siteParams.jsSubmit)try{eval(cObject.siteParams.jsSubmit)}catch(e){}if(cObject.siteParams.mailchimpList){var mcparams={shopId:object.shop.id,service:"mailchimp",action:"lists/"+cObject.siteParams.mailchimpList+"/members",do:"post",email:params.email,merge_fields:JSON.stringify(params)},url=object.Helpers.addQueryString(object.defaults.mcUrl,mcparams);object.Helpers.getAsync(url)}if(cObject.siteParams.callEndpoint){var url=object.Campaign.interpolateVars(cObject.siteParams.callEndpoint,params,!0);url=object.Campaign.interpolateVars(url,object.shop,!0),url=object.Campaign.interpolateVars(url),object.Helpers.getAsync(url)}}}};elem=cDom.getElementsByClassName(object.defaults.siteClasses.submit);for(el in elem)elem.hasOwnProperty(el)&&object.Helpers.addEventListener(elem[el],"click",function(e){return e.preventDefault(),e.stopPropagation(),object.Helpers.log("Submit event attached to "+el+" element for "+cId,"info"),submit_fct(e.currentTarget,cId,tpl,cDomDom)},!1)},checkDisplayRules:function(e,t){var a=vtlodash.size(e),o=!0;t&&(o=!1);var s,n,i,r;r=object.Helpers.getCookie(object.defaults.cookieNames.condCount);for(var c=0;c<a;c++){var s=e[c];n=object.Helpers.getContextValue(s.key);var i=object.Helpers.valuesComparer(n,s.val,s.op);try{contextCountVal=r[object.shop.params.countConditionsKeys[s.key+s.op+s.val]]}catch(e){contextCountVal=null}if(i&&s.hasOwnProperty("count")&&null!=contextCountVal&&(i=object.Helpers.valuesComparer(contextCountVal,s.count.val,s.count.op)),!t&&!i)return!1;if(t&&i)return!0}return o},checkDisplayLimits:function(e,t){if(!vtlodash.isObject(t))return!1;var a=object.Helpers.getCookie(object.defaults.cookieNames.capping+e);return a&&(t.dulimit&&a.dulimit>=t.dulimit||t.dlimit&&a.dlimit>=t.dlimit||t.mlimit&&a.mlimit>=t.mlimit)?(object.Helpers.log("Capping exceeded for "+e,"warning"),!1):!(t.start&&t.startDate>object.defaults.nowTime||t.end&&t.endDate<object.defaults.nowTime)||(object.Helpers.log("Time limits exceeded for "+e,"warning"),!1)},embedContentCampaigns:function(){if(!1!==object.shop.params.hasRunningContent&&!0!==object.state.calledContent){object.Helpers.log("Started content campaigns!","info");var e={};for(cId in object.shop.content.campaigns)if(object.shop.content.campaigns.hasOwnProperty(cId)&&object.Campaign.checkDisplayLimits(cId,object.shop.content.campaigns[cId].siteParams)){var t=object.shop.content.campaigns[cId];if(t.siteParams.selector){var a=documentAlias.querySelector(t.siteParams.selector);if(object.Helpers.isDomNode(a)){var o=documentAlias.createElement("div");"append"==object.shop.content.campaigns[cId].siteParams.embedType?a.appendChild(o):"prepend"==object.shop.content.campaigns[cId].siteParams.embedType?a.insertBefore(o,a.firstChild):(a.innerHTML="",a.appendChild(o))}}else{var o=documentAlias.createElement("div");documentAlias.body.appendChild(o)}if(object.Helpers.isDomNode(o)&&(!t.siteParams.testMode||!0===t.siteParams.testMode&&"info"===object.defaults.debug)){object.Helpers.log("Embeding content on "+t.siteParams.selector+" in page for campaign "+cId,"info");for(var s=vtlodash.size(t.content),n=0;n<s;n++){var i=object.Helpers.pickRandomPercentages(t.content[n].templatesPick),r=t.content[n].displayRulesOR&&t.content[n].displayRulesOR.length>0;if((!0===object.Campaign.checkDisplayRules(t.content[n].displayRules,!1)||r&&object.Campaign.checkDisplayRules(t.content[n].displayRulesOR,r))&&object.Campaign.embedContent(o,t.id,t.siteParams[t.content[n].id],i,t.content[n].id)){object.Helpers.log("Group "+n+" embeded for campaign "+cId,"info"),e[cId]=t.content[n].id,object.state.eventQueue.push(object.Campaign.createSiteEvent(object.defaults.siteEvents.display,t.id,i));break}}}else object.Helpers.log("Campaign "+cId+" not embeded because of test mode!","error")}return object.state.calledContent=!0,e}}},object.queueManager={eventsObserver:function(){if(!object.state.hasUser)return void object.Helpers.log("No local user, exiting!","error");if(object.state.waitUserRequest)return void object.Helpers.log("Requesting user!","error");var e=object.state.eventQueue.shift();if(e)return object.defaults.stopevents?void object.Helpers.log("Events are stopped!","error"):(object.state.pageQueue.push(e),(e.viewitem||e.viewcategory||e.addtocart)&&object.eventApi.validateEvent(object.eventApi.convertEventObject(e))&&(object.state.reccEvent=e),e.login&&e.login.email&&!object.state.emailToPush?(e.login.email=object.Helpers.cleanEmail(e.login.email),object.User.changeUserByEmail(e.login.email),void(object.state.emailToPush=e)):vtlodash.isArray(e)?void("setVar"===e[0]&&(object.setVar(e[1],e[2]),object.Campaign.statusObserver("v"))):(vtlodash.size(object.state.reccCampaigns)>=1&&!0===object.state.waitReccEvent&&object.state.reccEvent&&object.Recommender.getData(),e&&object.eventApi.sendEvent(e)&&object.tasks.createVisitorContext("e",e)))}},object.tasks={runShopJS:function(){if(object.shop.params.customJS&&!object.state.runPageJS){object.state.runPageJS=!0;try{eval(object.shop.params.customJS)}catch(e){object.Helpers.log("Error running custom JS for shop "+e.message,"error")}}},followDataLayer:function(){var e=object.Helpers.readDataLayer();e&&(object.User.context.vars=object.User.context.vars||{},object.User.context.vars.dataLayer=e)},checkUserIdentity:function(){object.Helpers.log("Checking user identity from URL params","info");for(var e=object.defaults.userIndentityParams.length-1;e>=0;e--){var t,a=object.defaults.userIndentityParams[e];if(object.User.context.session.urlparams.hasOwnProperty(a))return t=object.User.context.session.urlparams[a],"vt_user"==a&&t.length==object.defaults.userKeyLength?object.User.changeUserById(t):object.Helpers.emailIsValid(t)&&object.User.changeUserByEmail(t),!0}return!1},createUserContext:function(e){object.Helpers.log("Creating User context","info");var t=object.User.getLocalUser();t?(object.User.data=t,object.state.hasUser=!0):e||object.User.requestUser()},createVisitorContext:function(e,t){object.Helpers.log("Creating visitor context for "+e,"info");var a=object.User.context&&object.User.context.all||object.Helpers.getCookie(object.defaults.cookieNames.all),o=object.User.context&&object.User.context.session||object.Helpers.getCookie(object.defaults.cookieNames.sess),s=sessChanged=!1;if(t=t||null,e=e||"p",null==a&&(a={noVisits:0,firstVisit:object.defaults.nowTime,lastVisit:object.defaults.nowTime},s=!0),"p"==e){var n=object.Helpers.getURLParams(windowAlias.location.search),i={utm_source:null,utm_term:null,utm_campaign:null,utm_content:null,utm_medium:null};null!=o&&(i=vtlodash.overwrite(i,o)),i=vtlodash.overwrite(i,n),null==o&&(o={pathname:"",landing:windowAlias.location.pathname,noPageViews:0,firstVisit:object.defaults.nowTime,city:"",country:""},sessChanged=!0,a.noVisits+=1,a.lastVisit=o.firstVisit,s=!0,object.state.eventQueue.push({update:{lastVisitDate:object.defaults.nowTime}}));var r=object.Helpers.getExternalReferrer();if((r||n.utm_campaign)&&(o.lastReferrer=r,r!=a.lastReferrer&&(a.lastReferrer=r,s=!0),object.shop.params.referer)){var c={domain:object.Helpers.extractDomain(r),url:r};r&&(c.generic={url:r}),c=vtlodash.merge(c,i),object.state.eventQueue.push({referer:c})}for(var l in i)i.hasOwnProperty(l)&&delete n[l];o.urlparams=n,o=vtlodash.merge(o,i),o.timeOnSite=Math.round((object.defaults.nowTime-o.firstVisit)/1e3/60);var d={pathname:windowAlias.location.pathname+windowAlias.location.search+windowAlias.location.hash,homepage:"/"==windowAlias.location.pathname,hostname:windowAlias.location.hostname,urlparams:n,osname:object.Helpers.osName(),browser:object.Helpers.browserInfo("name"),browserVersion:object.Helpers.browserInfo("version"),lang:object.Helpers.browserLang(),deviceType:object.Helpers.deviceType(),vt_campaign:n.vt_campaign||null,vt_content:n.vt_content||null,noPageViews:o.noPageViews+=1};if(n.vt_campaign&&n.vt_content&&(d.vt_click=n.vt_campaign+"_"+n.vt_content),object.shop.push&&object.shop.push.enabled)if(d.pushValid=!0,"chrome"==d.browser){d.pushValid=!0;var u=window.RequestFileSystem||window.webkitRequestFileSystem;u&&u(window.TEMPORARY,100,function(){object.User.context.session.private=!1},function(){object.User.context.session.private=!0,object.User.context.session.pushValid=!1})}else if("firefox"==d.browser){d.pushValid=!0;var p=indexedDB.open("test");p.onerror=function(){object.User.context.session.private=!0,object.User.context.session.pushValid=!1},p.onsuccess=function(){object.User.context.session.private=!1}}o=vtlodash.merge(o,d),object.shop.push&&object.shop.push.enabled&&object.webpush&&!object.state.webpush&&(object.state.webpush=!0)}else if("e"==e){var d={};switch(t=object.eventApi.convertEventObject(t),sessChanged=!0,o.vte=o.vte||{},o.vte[t.type]=o.vte[t.type]?o.vte[t.type]+1:1,t.type){case"viewitem":object.setVar("pageType","product");break;case"viewcategory":object.setVar("pageType","category");break;case"confirmation":object.setVar("pageType","confirmation"),a.isCustomer=!0,s=!0,a.lastPurchaseDays=object.defaults.nowTime,a.firstPurchaseDays=a.firstPurchaseDays?a.firstPurchaseDays:object.defaults.nowTime;break;case"addtocart":o.lastaddcart=object.defaults.nowTime;break;case"search":object.setVar("pageType","search");break;case"addtowishlist":break;case"checkout":object.setVar("pageType","checkout")}}return s&&object.Helpers.setCookie(object.defaults.cookieNames.all,a),sessChanged&&object.Helpers.setCookie(object.defaults.cookieNames.sess,o,object.defaults.sessionDuration),o.lastaddcartSec=o.lastaddcart?Math.round((object.defaults.nowTime-o.lastaddcart)/1e3):null,a.lastPurchaseDays=a.lastPurchaseDays?Math.round((object.defaults.nowTime-a.lastPurchaseDays)/object.defaults.dayDuration):null,a.firstPurchaseDays=a.firstPurchaseDays?Math.round((object.defaults.nowTime-a.firstPurchaseDays)/object.defaults.dayDuration):null,a.lastVisitDays=a.lastVisitDays?Math.round((object.defaults.nowTime-a.lastVisitDays)/object.defaults.dayDuration):null,a.firstVisitDays=a.firstVisitDays?Math.round((object.defaults.nowTime-a.firstVisitDays)/object.defaults.dayDuration):null,object.User.context.session=o,object.User.context.all=a,object.User.context.all.hasEmail=object.User.isIdentified(),object.User.context.all.hasPush=!!object.User.data.push,object.Helpers.log("Done creating visitor context for "+e,"info"),object.state.webpush&&object.tasks.addReadyListener(object.webpush.instantiate,"wpins"),object.Campaign.statusObserver(e,t),!0},domIsUpdated:function(){object.Helpers.log("Document changed, adding input listeners again","info"),object.Helpers.addEventListener("document","change",object.Helpers.inputEmailListening)},sendClickEvents:function(){object.Helpers.log("Start generate click events","info");var e,t,a=object.User.context.session.urlparams.vt_campaign,o=object.User.context.session.urlparams.vt_content;if(a&&o&&object.shop.merchandising[a]&&object.shop.merchandising[a].templatesPick.params[o]||object.shop.campaigns[a]&&object.shop.campaigns[a].templatesPick.params[o]||object.shop.params.hasRunningAds&&object.shop.adserver.campaigns[a]&&object.shop.adserver.templates[o])return t={},(e=object.User.context.session.urlparams.vt_product)&&(t={itemId:e}),object.state.eventQueue.push(object.Campaign.createSiteEvent(object.defaults.siteEvents.click,a,o,t)),void object.Helpers.log("Generate click event for onsite: "+a+":"+o,"info")},getVisitorInfo:function(){if(!1!==object.shop.params.getVisitorInfo){var e=object.Helpers.getCookie(object.defaults.cookieNames.visitor);e?vtlodash.isObject(e)&&(object.User.context.session=vtlodash.merge(object.User.context.session,e)):vtlodash.request(object.defaults.visitorHost,function(e){if(vtlodash.isString(e)&&(e=JSON.parse(e)),vtlodash.isObject(e)){var t={city:e.city,state:e.regionName,country:e.country,country_code:e.countryCode};object.Helpers.setCookie(object.defaults.cookieNames.visitor,t,object.defaults.monthDuration),object.User.context.session=vtlodash.merge(object.User.context.session,t)}})}},callbackNull:function(e){object.Helpers.log("Callback without an active role","info")},callbackVisitor:function(e){vtlodash.isObject(e)&&(object.Helpers.setCookie(object.defaults.cookieNames.visitor,e,object.defaults.dayDuration),object.User.context.session=vtlodash.merge(object.User.context.session,e))},injectCss:function(e){object.shop.params.embedCSS&&(object.Helpers.embedTag("link","","head",{href:e,type:"text/css",rel:"stylesheet"}),object.Helpers.log("Injecting proprietary CSS into page","info"))},inputEmailListening:function(){if(!1!==object.shop.params.emailGrab){object.Helpers.log("Adding blur event listeners for every input field.","info");var e=object.shop.params.listenFields||"input[type=text],input[type=email],input[type=input]",t=document.querySelectorAll(e),a=function(e){var t={login:{email:object.Helpers.cleanEmail(e.target.value)}};object.shop.params.grabSource&&(t.login.source=object.shop.params.grabSource),-1===e.target.className.indexOf(object.defaults.siteClasses.attr)&&object.Helpers.emailIsValid(e.target.value)&&object.state.eventQueue.push(t)};for(i in t)t.hasOwnProperty(i)&&object.Helpers.addEventListener(t[i],"blur",a,!1)}},addReadyListener:function(e,t){if(object.Helpers.log("Run ready for "+t,"info"),"complete"===documentAlias.readyState)return object.Helpers.log("Run loadHandler 0"+t,"info"),void e();var a;documentAlias.addEventListener?(object.Helpers.addEventListener(documentAlias,"DOMContentLoaded",function a(){object.Helpers.log("Run loadHandler 1"+t,"info"),e(),documentAlias.removeEventListener("DOMContentLoaded",a,!1)}),object.Helpers.log("Added ready for "+t,"info")):documentAlias.attachEvent&&(documentAlias.attachEvent("onreadystatechange",function a(){"interactive"!==documentAlias.readyState&&"loaded"!==documentAlias.readyState||(e(),documentAlias.detachEvent("onreadystatechange",a),object.Helpers.log("Run loadHandler 2"+t,"info"))}),documentAlias.documentElement.doScroll&&windowAlias===windowAlias.top&&function a(){if(!object.state.hasLoaded){try{documentAlias.documentElement.doScroll("left")}catch(e){return void setTimeout(a,0)}object.Helpers.log("Run loadHandler 3"+t,"info"),e()}}()),new RegExp("WebKit").test(navigator.userAgent)?a=setInterval(function(){(object.state.hasLoaded||/loaded|complete/.test(documentAlias.readyState))&&(object.Helpers.log("Run loadHandler 4"+t,"info"),clearInterval(a),e())},10):(object.Helpers.log("Added load event listener at the end"+t,"info"),object.Helpers.addEventListener(windowAlias,"load",e,!1))}},object.setVar=function(e,t,a){if(0!==a&&1!==a&&2!==a&&(a=0),/^[\s\/a-zA-Z0-9:.\-_;#$!@^&*=<>\\,|{}?]+$/.test(t))return"VTuser"===e?(t&&t.indexOf("@")<0&&atob(t)&&(t=atob(t)),void(object.User.isIdentified()||object.User.changeUserByEmail(t))):"VTsid"===e?void(object.state._vtsid=t):void(object.User.context.vars[e]=t)},object.init=function(){if(!object.state.ready){object.state.ready=!0,object.state.storage=object.Helpers.getStorageType();try{var e=object.Helpers.getCookie(object.defaults.cookieNames.ts);e&&(object.state.timeDiff=e,object.defaults.nowTime=object.defaults.nowTimeLocal-e)}catch(e){console.log(e)}object.state.botagent=!1;try{object.state.botagent=/bot|googlebot|crawler|spider|robot|crawling/i.test(navigator.userAgent)}catch(e){object.Helpers.log("Error checking for bot agents!","error")}windowAlias.location.hostname.indexOf(object.shop.domain);try{if("undefined"!=typeof Prototype&&parseFloat(Prototype.Version.substr(0,3))<1.7&&void 0!==Array.prototype.toJSON){var t=JSON.stringify;JSON.stringify=function(e){var a=Array.prototype.toJSON;delete Array.prototype.toJSON;var o=t(e);return Array.prototype.toJSON=a,o}}}catch(e){}var a=object.Helpers.getCookie(object.defaults.cookieNames.debug);if(object.defaults.debug=object.shop.debug?object.shop.debug:object.defaults.debug,a&&(object.defaults.debug=a),object.Helpers.getCookie(object.defaults.cookieNames.stopevents)&&(object.defaults.stopevents=1),object.state.pageQueue=[],object.state.eventQueue=windowAlias._vteq||[],windowAlias.location.search.indexOf("vt_preview=")>=0){var o=object.Helpers.getURLParams(windowAlias.location.search);return object.defaults.debug="info",object.tasks.createUserContext(),void object.Campaign.embedCampaign(o.vt_campaign,o.vt_content)}object.tasks.addReadyListener(object.Campaign.embedContentCampaigns,"emcon"),object.tasks.addReadyListener(object.Recommender.embedMerchandisingCampaigns,"emmer"),object.state.eventQueueId=setInterval(object.queueManager.eventsObserver,object.defaults.queueCheckInterval),object.tasks.createUserContext(!0),object.tasks.createVisitorContext("p"),object.User.context.session.urlparams.vt_debug&&(object.Helpers.setCookie(object.defaults.cookieNames.debug,object.User.context.session.urlparams.vt_debug),object.defaults.debug=object.User.context.session.urlparams.vt_debug),1==object.User.context.session.urlparams.vt_stopevents?(object.Helpers.setCookie(object.defaults.cookieNames.stopevents,1),object.defaults.stopevents=1):0==object.User.context.session.urlparams.vt_stopevents&&object.Helpers.removeCookie(object.defaults.cookieNames.stopevents),object.tasks.checkUserIdentity(),object.tasks.createUserContext();var s=function(){object.state.hasLoaded||(object.state.hasLoaded=!0,object.Helpers.log("Running onLoad functions","info"),object.tasks.inputEmailListening(),object.tasks.injectCss(object.defaults.stylesheet),object.tasks.runShopJS())};object.tasks.addReadyListener(s,"loadh"),object.tasks.getVisitorInfo(),object.setVar("random",object.Helpers.generateRandomBetween(0,100,!0)),object.tasks.sendClickEvents(),object.tasks.followDataLayer(),object.state.timeDiff||object.User.requestUser({userId:object.User.data.userId}),object.User.activityInit(),object.Helpers.getCookie(object.defaults.cookieNames.ne)&&(object.state.eventQueue.push(object.Helpers.getCookie(object.defaults.cookieNames.ne)),object.Helpers.removeCookie(object.defaults.cookieNames.ne)),object.Helpers.writeCookie(object.defaults.prefix+object.defaults.cookieNames.shop,object.shop.id)}},object}()),window._vteq=window._vteq||[],checkInit(),_vtshop={};